Determine the active facet

document.addEventListener('facetwp-refresh', function() {
  if (null !== FWP.active_facet) {
    console.log(FWP.active_facet.nodes[0]);
  }
});