!function(){"use strict";var e;window.fUtil=(()=>{class e{constructor(e){if("string"==typeof e||e instanceof String)if(""===(e=e.replace(":selected",":checked")))this.nodes=[];else if(this.isValidSelector(e))this.nodes=Array.from(document.querySelectorAll(e));else{var a=document.createElement("template");a.innerHTML=e,this.nodes=[a.content]}else Array.isArray(e)?this.nodes=e:"object"==typeof e&&e.nodeName?this.nodes=[e]:"function"==typeof e?this.ready(e):e===window?this.nodes=[window]:this.nodes=[document];t.each(t.fn,(e,t)=>{this[t]=e})}static isset(e){return void 0!==e}static post(e,a,s){(s=Object.assign({},{dataType:"json",contentType:"application/json",headers:{},done:()=>{},fail:()=>{}},s)).headers["Content-Type"]=s.contentType,a="application/json"===s.contentType?JSON.stringify(a):t.toEncoded(a),fetch(e,{method:"POST",headers:s.headers,body:a}).then(e=>e.ok?e[s.dataType]():s.fail(e.status+" - "+e.statusText)).then(e=>s.done(e)).catch(e=>s.fail(e))}static toEncoded(e,a,s){s=s||[],a=a||"";return Array.isArray(e)?e.length?e.forEach(e=>{t.toEncoded(e,a+"[]",s)}):t.toEncoded("",a,s):"object"==typeof e&&null!==e?Object.keys(e).forEach(o=>{var n=a?a+"["+o+"]":o;t.toEncoded(e[o],n,s)}):s.push(encodeURIComponent(a)+"="+encodeURIComponent(e)),s.join("&")}static forEach(e,t){return"object"==typeof e&&null!==e&&(Array.isArray(e)?e.forEach((e,a)=>t.bind(e)(e,a)):Object.keys(e).forEach(a=>{var s=e[a];t.bind(s)(s,a)})),e}isValidSelector(e){try{document.createDocumentFragment().querySelector(e)}catch(e){return!1}return!0}clone(){return t(this.nodes)}len(){return this.nodes.length}each(e){return this.nodes.forEach((t,a)=>{e.bind(t)(t,a)}),this}ready(e){if("function"==typeof e)return"complete"===document.readyState?e():void document.addEventListener("DOMContentLoaded",e,!1)}addClass(e){return this.each(t=>t&&t.classList&&t.classList.add(e)),this}removeClass(e){return this.each(t=>t&&t.classList&&t.classList.remove(e)),this}hasClass(e){return t.isset(this.nodes.find(t=>t.classList.contains(e)))}toggleClass(e){return this.each(t=>t&&t.classList&&t.classList.toggle(e)),this}is(e){for(let t=0;t<this.len();t++)if(this.nodes[t].matches(e))return!0;return!1}find(e){e=e.replace(":selected",":checked");let t=[],a=this.clone();return a.each(a=>{t=t.concat(Array.from(a.querySelectorAll(e)))}),a.nodes=t,a}first(){let e=this.clone();return e.len()&&(e.nodes=this.nodes.slice(0,1)),e}last(){let e=this.clone();return e.len()&&(e.nodes=this.nodes.slice(-1)),e}prev(e){let a=[],s=this.clone();return s.each(s=>{let o=s.previousElementSibling;for(;o&&t.isset(e)&&!o.matches(e);)o=o.previousElementSibling;o&&a.push(o)}),s.nodes=a,s}next(e){let a=[],s=this.clone();return s.each(s=>{let o=s.nextElementSibling;for(;o&&t.isset(e)&&!o.matches(e);)o=o.nextElementSibling;o&&a.push(o)}),s.nodes=a,s}prepend(e){return this.each(t=>t.insertAdjacentHTML("afterbegin",e)),this}append(e){return this.each(t=>t.insertAdjacentHTML("beforeend",e)),this}parents(e){let t=[],a=this.clone();return a.each(a=>{let s=a.parentNode;for(;s&&s!==document;)s.matches(e)&&t.push(s),s=s.parentNode}),a.nodes=[...new Set(t)],a}closest(e){let t=[],a=this.clone();return a.each(a=>{let s=a.closest(e);s&&t.push(s)}),a.nodes=t,a}remove(){return this.each(e=>e.remove()),this}on(e,a,s){if(t.isset(a)){if(!t.isset(s))s=a,a=null;var o=e=>{if(null===a||e.target.matches(a))s.bind(e.target)(e);else if(e.target.closest(a)){var t=e.target.closest(a);s.bind(t)(e)}};return this.each(n=>{t.isset(n._id)||(n._id=t.event.count,t.event.store[t.event.count]=n,t.event.count++);var c=n._id;o._str=s.toString(),t.isset(t.event.map[c])||(t.event.map[c]={}),t.isset(t.event.map[c][e])||(t.event.map[c][e]={}),t.isset(t.event.map[c][e][a])||(t.event.map[c][e][a]=[]);let i=t.event.map[c][e][a].push(o);n.addEventListener(e,t.event.map[c][e][a][i-1])}),this}}off(e,a,s){if(!t.isset(s))s=a,a=null;return this.each(o=>{var n=o._id;t.each(t.event.map[n],(c,i)=>{t.each(c,(c,r)=>{t.each(c,(c,l)=>{e&&i!==e||a&&r!==a||s&&c._str!==s.toString()||(o.removeEventListener(i,t.event.map[n][i][r][l]),delete t.event.map[n][i][r][l])})})})}),this}trigger(e,t){return this.each(a=>a.dispatchEvent(new CustomEvent(e,{detail:t,bubbles:!0}))),this}attr(e,a){return t.isset(a)?(this.each(t=>t.setAttribute(e,a)),this):this.len()?this.nodes[0].getAttribute(e):null}removeAttr(e){return this.each(t=>t.removeAttribute(e)),this}data(e,a){return t.isset(a)?(this.each(t=>t._fdata[e]=a),this):this.len()?this.nodes[0]._fdata[e]:null}html(e){return t.isset(e)?(this.each(t=>t.innerHTML=e),this):this.len()?this.nodes[0].innerHTML:null}text(e){return t.isset(e)?(this.each(t=>t.textContent=e),this):this.len()?this.nodes[0].textContent:null}val(e){if(t.isset(e))return this.each(t=>t.value=e),this;if(this.len()){var a=this.nodes[0];return"select"===a.nodeName.toLowerCase()&&a.multiple?[...a.options].filter(e=>e.selected).map(e=>e.value):a.value}return null}}var t=t=>new e(t);return t.fn={},t.post=e.post,t.isset=e.isset,t.each=e.forEach,t.toEncoded=e.toEncoded,t.event={map:{},store:[],count:0},t})(),(e=window).FWP=e.FWP||{},e.FWP.hooks=e.FWP.hooks||new function(){function e(e,t,a,s){var o,c,i;if(n[e][t])if(a)if(o=n[e][t],s)for(i=o.length;i--;)(c=o[i]).callback===a&&c.context===s&&o.splice(i,1);else for(i=o.length;i--;)o[i].callback===a&&o.splice(i,1);else n[e][t]=[]}function t(e,t,a,s,o){var c={callback:a,priority:s,context:o},i=n[e][t];i?(i.push(c),i=function(e){for(var t,a,s,o=1,n=e.length;o<n;o++){for(t=e[o],a=o;(s=e[a-1])&&s.priority>t.priority;)e[a]=e[a-1],--a;e[a]=t}return e}(i)):i=[c],n[e][t]=i}function a(e,t,a){var s,o,c=n[e][t];if(!c)return"filters"===e&&a[0];if(o=c.length,"filters"===e)for(s=0;s<o;s++)a[0]=c[s].callback.apply(c[s].context,a);else for(s=0;s<o;s++)c[s].callback.apply(c[s].context,a);return"filters"!==e||a[0]}var s=Array.prototype.slice,o={removeFilter:function(t,a){return"string"==typeof t&&e("filters",t,a),o},applyFilters:function(){var e=s.call(arguments),t=e.shift();return"string"==typeof t?a("filters",t,e):o},addFilter:function(e,a,s,n){return"string"==typeof e&&"function"==typeof a&&t("filters",e,a,s=parseInt(s||10,10),n),o},removeAction:function(t,a){return"string"==typeof t&&e("actions",t,a),o},doAction:function(){var e=s.call(arguments),t=e.shift();return"string"==typeof t&&a("actions",t,e),o},addAction:function(e,a,s,n){return"string"==typeof e&&"function"==typeof a&&t("actions",e,a,s=parseInt(s||10,10),n),o}},n={actions:{},filters:{}};return o},window.FWP=(e=>{class t{constructor(){this.import(),this.bindEvents()}import(){"undefined"!=typeof FWP&&e.each(FWP,(e,t)=>this[t]=e)}init(){var t=this;if(this.setDefaults(),0<e(".facetwp-sort").len()&&(t.extras.sort="default"),0<e(".facetwp-pager").len()&&(t.extras.pager=!0),0<e(".facetwp-per-page").len()&&(t.extras.per_page="default"),0<e(".facetwp-counts").len()&&(t.extras.counts=!0),0<e(".facetwp-selections").len()&&(t.extras.selections=!0),!(e(".facetwp-template").len()>0)){var a=t.helper.detectLoop(document.body);if(!a)return void console.error("FacetWP has not detected a listing template");e(a).addClass("facetwp-template")}var s=e(".facetwp-template").first();t.template=s.attr("data-name")?s.attr("data-name"):"wp",s.find(".facetwp-facet").len()>0&&console.error('Facets should not be inside the "facetwp-template" container'),t.hooks.doAction("facetwp/ready"),t.extras.selections&&t.hooks.addAction("facetwp/loaded",()=>{var a="",s="",o=["pager","reset","sort"];o=t.hooks.applyFilters("facetwp/selections/facet_types_skipped",o);var n=t.loaded||t.is_bfcache||!e.isset(FWP_HTTP.url_vars)?t.facets:Object.assign(t.facets,FWP_HTTP.url_vars);n=t.hooks.applyFilters("facetwp/selections/facets",n),e.each(n,(s,n)=>{if(s.length<1||!e.isset(t.settings.labels[n])||o.includes(t.facet_type[n]))return!0;var c=s,i=e(".facetwp-facet-"+n),r=i.attr("data-ui")||i.attr("data-type");"search"!=r&&"autocomplete"!=r||Array.isArray(c)&&(c=c.join(",")),c=t.hooks.applyFilters("facetwp/selections/"+r,c,{el:i,selected_values:c}),"search"===r&&"string"==typeof c&&(c=c.replace(/&quot;/g,'"')),c.length&&("string"==typeof c?c=[{value:"",label:c}]:e.isset(c[0].label)||(c=[{value:"",label:c[0]}]));var l="";e.each(c,e=>{e='<span class="facetwp-selection-value" data-facet="'+n+'" data-value="'+e.value+'">'+t.helper.escapeHtml(e.label)+"</span>",e=t.hooks.applyFilters("facetwp/selections/facet_selection_choice_html",e,n),l+=e});var f="",d="",p="",h="";""!==l&&(f=t.settings.labels[n],d='<span class="facetwp-selection-label">{selection_label_content}: </span>',p=(d=(d=t.hooks.applyFilters("facetwp/selections/facet_selection_label_html",d,n)).replace("{selection_label_content}",f))+l,h="<li>{selection_content}</li>",h=(h=t.hooks.applyFilters("facetwp/selections/facet_selection_html",h,n)).replace("{selection_content}",p),a+=h)}),""!==a&&(s=a,a="<ul>{selections}</ul>",a=(a=t.hooks.applyFilters("facetwp/selections/wrapper_html",a)).replace("{selections}",s)),e(".facetwp-selections").html(a)}),t.refresh()}setDefaults(){let t={facets:{},template:null,settings:{},is_reset:!1,is_refresh:!1,is_bfcache:!1,is_hash_click:!1,is_load_more:!1,auto_refresh:!0,soft_refresh:!1,frozen_facets:{},active_facet:null,facet_type:{},loaded:!1,extras:{},paged:1};for(var a in t)e.isset(this[a])||(this[a]=t[a])}refresh(){FWP.is_refresh=!0,FWP.toggleOverlay("on"),FWP.is_reset||FWP.parseFacets(),FWP.loaded||FWP.loadFromHash(),e().trigger("facetwp-refresh"),!FWP.loaded||FWP.is_popstate||FWP.is_load_more||FWP.setHash(),FWP.loaded||FWP.is_bfcache||!e.isset(FWP_JSON.preload_data)?FWP.fetchData():FWP.render(FWP_JSON.preload_data),e.each(FWP.frozen_facets,(e,t)=>{"hard"!==e&&delete FWP.frozen_facets[t]}),FWP.paged=1,FWP.soft_refresh=!1,FWP.is_refresh=!1,FWP.is_reset=!1}autoload(){FWP.auto_refresh&&!FWP.is_refresh&&FWP.refresh()}parseFacets(){FWP.facets={},e(".facetwp-facet").each(function(){var t=e(this),a=t.attr("data-name"),s=t.attr("data-type"),o=t.hasClass("facetwp-ignore");null!==t.attr("data-ui")&&(s=t.attr("data-ui")),FWP.facet_type[a]=s,o||FWP.hooks.doAction("facetwp/refresh/"+s,t,a)})}buildQueryString(){var t="",a=[],s=window.location.search.replace("?","").split("&");e.each(s,e=>{0!==e.split("=")[0].indexOf(FWP_JSON.prefix)&&a.push(e)}),a=a.join("&");var o=Object.assign({},FWP.facets);return 1<FWP.paged&&(o.paged=FWP.paged),FWP.extras.per_page&&"default"!==FWP.extras.per_page&&(o.per_page=FWP.extras.per_page),FWP.extras.sort&&"default"!==FWP.extras.sort&&(o.sort=FWP.extras.sort),o=FWP.helper.serialize(o,FWP_JSON.prefix),""!==a&&(t+=a),""!==o&&(t+=(""!==a?"&":"")+o),t}setHash(){var e=FWP.buildQueryString();""!==e&&(e="?"+e),history.pushState&&history.pushState(null,null,window.location.pathname+e),FWP_HTTP.get={},window.location.search.replace("?","").split("&").forEach(e=>{var t=e.split("=");""!=t[0]&&(FWP_HTTP.get[t[0]]=t[1])})}loadFromHash(){var t=[],a=window.location.search.replace("?","").split("&");e.each(a,e=>{0===e.split("=")[0].indexOf(FWP_JSON.prefix)&&t.push(e.replace(FWP_JSON.prefix,""))}),t=t.join("&"),e.each(FWP.facets,(e,t)=>{FWP.facets[t]=[]}),FWP.paged=1,FWP.extras.sort="default",""!==t&&(t=t.split("&"),e.each(t,t=>{var a=t.split("=")[0],s=t.split("=")[1];if("paged"===a)FWP.paged=s;else if("per_page"===a||"sort"===a)FWP.extras[a]=s;else if(""!==s){var o=e.isset(FWP.facet_type[a])?FWP.facet_type[a]:"";FWP.facets[a]="search"===o||"autocomplete"===o?decodeURIComponent(s):decodeURIComponent(s).split(",")}}))}buildPostData(){return{facets:FWP.facets,frozen_facets:FWP.frozen_facets,http_params:FWP_HTTP,template:FWP.template,extras:FWP.extras,soft_refresh:FWP.soft_refresh?1:0,is_bfcache:FWP.is_bfcache?1:0,first_load:FWP.loaded?0:1,paged:FWP.paged}}fetchData(){var t="wp"===FWP.template?document.URL:FWP_JSON.ajaxurl,a={action:"facetwp_refresh",data:FWP.buildPostData()},s={dataType:"text",done:t=>{try{var a=JSON.parse(t);FWP.render(a)}catch(o){var s=t.indexOf('{"facets');if(-1<s){a=JSON.parse(t.substr(s));FWP.render(a)}else e(".facetwp-template").text("FacetWP was unable to auto-detect the post listing"),console.log(t)}},fail:e=>{console.log(e)}};s=FWP.hooks.applyFilters("facetwp/ajax_settings",s),e.post(t,a,s)}render(t){if(FWP.response=t,"wp"!==FWP.template&&""!==t.template||FWP.loaded||FWP.is_bfcache){n=t.template;if("wp"===FWP.template){var a=e(t.template),s=a.find(".facetwp-template");if(s.len()<1){var o=FWP.helper.detectLoop(a.nodes[0]);o&&(s=e(o).addClass("facetwp-template"))}if(s.len()>0)n=s.html();else n=FWP_JSON.no_results_text}}else var n=!1;!1!==n&&(FWP.hooks.applyFilters("facetwp/template_html",!1,{response:t,html:n})||e(".facetwp-template").html(n)),e.each(t.facets,(t,a)=>{e(".facetwp-facet-"+a).html(t)}),e.isset(t.counts)&&e(".facetwp-counts").html(t.counts),e.isset(t.pager)&&e(".facetwp-pager").html(t.pager),e.isset(t.per_page)&&(e(".facetwp-per-page").html(t.per_page),"default"!==FWP.extras.per_page&&e(".facetwp-per-page-select").val(FWP.extras.per_page)),e.isset(t.sort)&&(e(".facetwp-sort").html(t.sort),e(".facetwp-sort-select").val(FWP.extras.sort)),e.each(t.settings,(e,t)=>{FWP.settings[t]=e}),"function"==typeof WPPlaylistView&&e(".facetwp-template .wp-playlist").each(e=>new WPPlaylistView({el:e})),e().trigger("facetwp-loaded"),FWP.hooks.doAction("facetwp/loaded"),FWP.toggleOverlay("off"),FWP.active_facet=null,FWP.is_bfcache=!0,FWP.loaded=!0}reset(t){FWP.parseFacets();var a={};"string"==typeof t?a[t]="":Array.isArray(t)?e.each(t,e=>{a[e]=""}):"object"==typeof t&&t&&(a=t);var s=Object.keys(a).length<1;e.each(FWP.facets,(t,o)=>{var n=e.isset(a[o]),c=Array.isArray(t)?t:[t];if(n&&-1<c.indexOf(a[o])){var i=c.indexOf(a[o]);c.splice(i,1),FWP.facets[o]=c}n&&(c.length<1||""===a[o])&&delete FWP.frozen_facets[o],(s||n&&""===a[o])&&(FWP.facets[o]=[]),n&&"pager"===FWP.facet_type[o]&&"per_page"===FWP.settings[o].pager_type&&(FWP.extras.per_page="default")}),s&&(FWP.extras.per_page="default",FWP.extras.sort="default",FWP.frozen_facets={}),FWP.hooks.doAction("facetwp/reset"),FWP.is_reset=!0,FWP.refresh()}toggleOverlay(t){var a="on"===t?"addClass":"removeClass";e(".facetwp-facet")[a]("is-loading")}bindEvents(){window.addEventListener("popstate",()=>{FWP.is_bfcache&&(FWP.loaded=!1),!FWP.loaded&&!FWP.is_bfcache||FWP.is_refresh||FWP.is_hash_click||(FWP.is_popstate=!0,FWP.refresh(),FWP.is_popstate=!1),FWP.is_hash_click=!1}),e().on("click",'a[href^="#"]',()=>{FWP.is_hash_click=!0}),e().on("click",".facetwp-selections .facetwp-selection-value",function(){if(!FWP.is_refresh){var t=e(this).attr("data-facet"),a=e(this).attr("data-value");if(""!=a){var s={};s[t]=a,FWP.reset(s)}else FWP.reset(t)}}),e().on("click",".facetwp-page[data-page]",function(){e(".facetwp-page").removeClass("active"),e(this).addClass("active"),FWP.paged=e(this).attr("data-page"),FWP.soft_refresh=!0;let t=e(this).closest(".facetwp-type-pager").attr("data-name");FWP.scroll_target="string"==typeof t?FWP.settings[t].scroll_target:"",FWP.scroll_offset=""!=FWP.scroll_target&&"number"==typeof Number(FWP.settings[t].scroll_offset)?FWP.settings[t].scroll_offset:0,FWP.refresh()}),FWP.hooks.addAction("facetwp/loaded",function(){try{if(!FWP.loaded&&1<FWP.settings.pager.page){let e=Object.keys(FWP.settings).filter(e=>FWP.settings[e].hasOwnProperty("scroll_target"))[0];FWP.scroll_target="string"==typeof e?FWP.settings[e].scroll_target:"",FWP.scroll_offset=""!=FWP.scroll_target&&"number"==typeof Number(FWP.settings[e].scroll_offset)?FWP.settings[e].scroll_offset:0}let e=document.querySelector(FWP.scroll_target).getBoundingClientRect().top+Number(FWP.scroll_offset);window.scrollBy({top:e,behavior:"smooth"})}catch(e){}FWP.scroll_target="",FWP.scroll_offset=""},100);var t="function"==typeof jQuery?jQuery:fUtil;t(document).on("change",".facetwp-per-page-select",function(){FWP.extras.per_page=e(this).val(),FWP.soft_refresh=!0,FWP.autoload()}),t(document).on("change",".facetwp-sort-select",function(){FWP.extras.sort=e(this).val(),FWP.soft_refresh=!0,FWP.autoload()}),t(()=>{this.init()})}}return t.prototype.helper={getUrlVar:e=>{e=FWP_JSON.prefix+e;for(var t=window.location.search.replace("?","").split("&"),a=0;a<t.length;a++){var s=t[a].split("=");if(s[0]===e)return s[1]}return!1},debounce:(e,t)=>{var a;return function(...s){var o=e.bind(this,...s);clearTimeout(a),a=setTimeout(o,t)}},serialize:(t,a)=>{var s=[];a=e.isset(a)?a:"";for(var o in t)""!=t[o]&&s.push(a+encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return s.join("&")},escapeHtml:e=>{var t={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;"};return e.replace(/[&<>"']/g,e=>t[e]).trim()},detectLoop:e=>{for(var t=null,a=document.createNodeIterator(e,NodeFilter.SHOW_COMMENT,()=>NodeFilter.FILTER_ACCEPT,!1);t=a.nextNode();)if(8===t.nodeType&&"fwp-loop"===t.nodeValue)return t.parentNode;return!1}},new t})(fUtil),function(e){function t(t){let a=e(t);return a.val()===a.attr("placeholder")?"":a.val()}FWP.logic=FWP.logic||{},e(".facetwp-facet").each(function(){this.addEventListener("mousedown",function(){var t=e(".facetwp-facet-"+e(this).attr("data-name"));1<t.len()&&(t.addClass("facetwp-ignore"),e(this).removeClass("facetwp-ignore")),FWP.active_facet=e(this)},!0)}),FWP.hooks.addAction("facetwp/refresh/autocomplete",function(e,t){var a=e.find(".facetwp-autocomplete").val()||"";FWP.facets[t]=a}),e().on("facetwp-loaded",function(){e(".facetwp-autocomplete:not(.fcomplete-enabled)").each(function(){var t=this,a=e(t).closest(".facetwp-facet").attr("data-name"),s="wp"===FWP.template?document.URL:FWP_JSON.ajaxurl,o=FWP.settings[a];o.data=()=>e.post(s,{action:"facetwp_autocomplete_load",facet_name:a,query:t.value,data:FWP.buildPostData()},{done:e=>{this.fcomplete.render(e)}}),o.onSelect=()=>FWP.autoload(),fComplete(t,o)})}),e().on("keyup",".facetwp-autocomplete",function(e){13!==e.which||FWP.is_refresh||FWP.autoload()}),e().on("click",".facetwp-autocomplete-update",function(){FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/checkboxes",function(t,a){var s=[];t.find(".facetwp-checkbox.checked").each(function(){s.push(e(this).attr("data-value"))}),FWP.facets[a]=s}),FWP.hooks.addFilter("facetwp/selections/checkboxes",function(t,a){var s=[];return e.each(a.selected_values,function(t){var o=a.el.find('.facetwp-checkbox[data-value="'+t+'"]');if(o.len()){var n=e(o.html());n.find(".facetwp-counter").remove(),n.find(".facetwp-expand").remove(),s.push({value:t,label:n.text()})}}),s}),e().on("click",".facetwp-type-checkboxes .facetwp-expand",function(t){var a=e(this).closest(".facetwp-checkbox").next(".facetwp-depth");a.toggleClass("visible");var s=a.hasClass("visible")?FWP_JSON.collapse:FWP_JSON.expand;e(this).html(s),t.stopImmediatePropagation()}),e().on("click",".facetwp-type-checkboxes .facetwp-checkbox:not(.disabled)",function(){var t=e(this),a=!t.hasClass("checked"),s=t.closest(".facetwp-depth").len()>0;t.next().hasClass("facetwp-depth")&&t.next(".facetwp-depth").find(".facetwp-checkbox").removeClass("checked"),s&&t.parents(".facetwp-depth").each(function(){e(this).prev(".facetwp-checkbox").removeClass("checked")}),t.toggleClass("checked",a),FWP.autoload()}),e().on("click",".facetwp-type-checkboxes .facetwp-toggle",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-toggle").toggleClass("facetwp-hidden"),t.find(".facetwp-overflow").toggleClass("facetwp-hidden")}),e().on("facetwp-loaded",function(){e(".facetwp-type-checkboxes .facetwp-overflow").each(function(){var t=e(this).find(".facetwp-checkbox").len(),a=e(this).next(".facetwp-toggle");a.text(a.text().replace("{num}",t)),0<e(this).find(".facetwp-checkbox.checked").len()&&a.trigger("click")}),e(".facetwp-type-checkboxes").each(function(){var t=e(this),a=t.attr("data-name");Object.keys(FWP.settings).length<1||("yes"===FWP.settings[a].show_expanded&&t.find(".facetwp-depth").addClass("visible"),1>t.find(".facetwp-expand").len()&&(t.find(".facetwp-checkbox.checked").each(function(){e(this).parents(".facetwp-depth").addClass("visible")}),t.find(".facetwp-depth").each(function(){var t=e(this).hasClass("visible")?"collapse":"expand";e(this).prev(".facetwp-checkbox").append(' <span class="facetwp-expand">'+FWP_JSON[t]+"</span>")})))})}),FWP.hooks.addAction("facetwp/refresh/radio",function(t,a){var s=[];t.find(".facetwp-radio.checked").each(function(){var t=e(this).attr("data-value");""!==t&&s.push(t)}),FWP.facets[a]=s}),FWP.hooks.addFilter("facetwp/selections/radio",function(t,a){var s=[];return e.each(a.selected_values,function(t){var o=a.el.find('.facetwp-radio[data-value="'+t+'"]');if(o.len()){var n=e(o.html());n.find(".facetwp-counter").remove(),s.push({value:t,label:n.text()})}}),s}),e().on("click",".facetwp-type-radio .facetwp-radio:not(.disabled)",function(){var t=e(this).hasClass("checked");e(this).closest(".facetwp-facet").find(".facetwp-radio").removeClass("checked"),t||e(this).addClass("checked"),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/date_range",function(e,a){var s=e.find(".facetwp-date-min"),o=e.find(".facetwp-date-max"),n=s.len()?t(s.nodes[0]):"",c=o.len()?t(o.nodes[0]):"";FWP.facets[a]=""!==n||""!==c?[n,c]:[]}),FWP.hooks.addFilter("facetwp/selections/date_range",function(e,t){var a=t.el,s=t.selected_values,o=a.attr("data-name"),n=FWP.settings[o].fields,c="";return"exact"==n?""!==s[0]&&(c=s[0]):"start_date"==n?""!==s[0]&&(c="[>=] "+s[0]):"end_date"==n?""!==s[1]&&(c="[<=] "+s[1]):"both"==n&&(""===s[0]&&""===s[1]||(""!==s[0]&&""!==s[1]?c=s[0]+" - "+s[1]:""!==s[0]?c="[>=] "+s[0]:""!==s[1]&&(c="[<=] "+s[1]))),c}),e().on("facetwp-loaded",function(){var t=e(".facetwp-type-date_range .facetwp-date:not(.ready)");0!==t.len()&&t.each(function(){var t=e(this),a=t.closest(".facetwp-facet").attr("data-name"),s=FWP.settings[a],o={onChange:function(e){FWP.autoload()}};if(""!==s.locale&&(o.i18n=s.locale),""!==s.format&&(o.altFormat=s.format),"both"==s.fields){var n=t.hasClass("facetwp-date-min")?"min":"max";o.minDate=s.range[n].minDate,o.maxDate=s.range[n].maxDate}else o.minDate=s.range.minDate,o.maxDate=s.range.maxDate;if(o=FWP.hooks.applyFilters("facetwp/set_options/date_range",o,{facet_name:a,element:t}),t.addClass("ready"),o.minDate.length&&o.maxDate.length)new fDate(this,o);else{this.value="";let e=t.attr("data-empty");t.attr("placeholder",e).attr("disabled","disabled").addClass("disabled")}})}),FWP.hooks.addAction("facetwp/refresh/dropdown",function(e,t){var a=e.find(".facetwp-dropdown").val();FWP.facets[t]=a?[a]:[]}),FWP.hooks.addFilter("facetwp/selections/dropdown",function(t,a){var s=[],o=a.el.nodes.find(e=>!e.classList.contains("facetwp-ignore")),n=e(o).find(".facetwp-dropdown");if(n.len()){var c=n.nodes[0],i=c.options[c.selectedIndex].value,r=c.options[c.selectedIndex].text;r=r.replace(/\(\d+\)$/,""),s.push({value:i,label:r})}return s}),("function"==typeof jQuery?jQuery:fUtil)(document).on("change",".facetwp-type-dropdown select",function(){var t=e(this).closest(".facetwp-facet"),a=t.attr("data-name"),s=e(this).val();t.find('.facetwp-dropdown [selected=""]').each(function(){e(this).val()!=s&&e(this).removeAttr("selected")}),""!==s&&(FWP.frozen_facets[a]="soft",t.find('.facetwp-dropdown option[value="'+s+'"]').attr("selected","")),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/fselect",function(e,t){var a=e.find("select").val();null!==a&&""!==a||(a=[]),FWP.facets[t]=Array.isArray(a)?a:[a]}),FWP.hooks.addFilter("facetwp/selections/fselect",function(t,a){var s=[];return e.each(a.selected_values,e=>{var t=a.el.find('option[value="'+e+'"]');t.len()&&s.push({value:e,label:t.text()})}),s}),FWP.hooks.addAction("facetwp/loaded",function(){if(null!==FWP.active_facet){var e=FWP.active_facet;if("fselect"==e.attr("data-type")){var t=e.find(".facetwp-dropdown").nodes[0];t.fselect.settings.multiple&&t.fselect.open()}}}),e().on("facetwp-loaded",function(){e(".facetwp-type-fselect select:not(.fs-hidden)").each(function(){var t=e(this).closest(".facetwp-facet").attr("data-name"),a=FWP.settings[t];a.optionFormatter=function(e,t){var a=t.getAttribute("data-counter");return a?e+" ("+a+")":e};var s=FWP.hooks.applyFilters("facetwp/set_options/fselect",a,{facet_name:t});fSelect(this,s)})}),e().on("fs:changed",function(t){var a=e(t.detail[0]).closest(".facetwp-type-fselect").len()>0;!FWP.is_refresh&&a&&FWP.autoload()}),e().on("fs:closed",function(){FWP.active_facet=null}),FWP.hooks.addAction("facetwp/refresh/hierarchy",function(t,a){var s=[];t.find(".facetwp-link.checked").each(function(){s.push(e(this).attr("data-value"))}),FWP.facets[a]=s}),FWP.hooks.addFilter("facetwp/selections/hierarchy",function(e,t){var a=t.el.find(".facetwp-link.checked");return a.len()?a.text():""}),e().on("click",".facetwp-type-hierarchy .facetwp-link",function(){e(this).closest(".facetwp-facet").find(".facetwp-link").removeClass("checked"),""!==e(this).attr("data-value")&&e(this).addClass("checked"),FWP.autoload()}),e().on("click",".facetwp-type-hierarchy .facetwp-toggle",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-toggle").toggleClass("facetwp-hidden"),t.find(".facetwp-overflow").toggleClass("facetwp-hidden")}),e().on("facetwp-loaded",function(){e(".facetwp-type-hierarchy .facetwp-overflow").each(function(){var t=e(this).find(".facetwp-link").len(),a=e(this).next(".facetwp-toggle");a.text(a.text().replace("{num}",t))})}),FWP.hooks.addAction("facetwp/refresh/number_range",function(e,t){var a=e.find(".facetwp-number-min").val()||"",s=e.find(".facetwp-number-max").val()||"";FWP.facets[t]=""!==a||""!==s?[a,s]:[]}),FWP.hooks.addFilter("facetwp/selections/number_range",function(e,t){var a=t.el,s=t.selected_values,o=a.attr("data-name"),n=FWP.settings[o].fields,c="";return"exact"==n?""!==s[0]&&(c=s[0]):"min"==n?""!==s[0]&&(c="[>=] "+s[0]):"max"==n?""!==s[1]&&(c="[<=] "+s[1]):"both"==n&&(""===s[0]&&""===s[1]||(""!==s[0]&&""!==s[1]?c=s[0]+" - "+s[1]:""!==s[0]?c="[>=] "+s[0]:""!==s[1]&&(c="[<=] "+s[1]))),c}),e().on("keyup",".facetwp-type-number_range .facetwp-number",function(e){13!==e.which||FWP.is_refresh||FWP.autoload()}),e().on("click",".facetwp-type-number_range .facetwp-submit",function(){FWP.refresh()}),e().on("facetwp-loaded",async function(){var t=e(".facetwp-location");if(!(t.nodes.length<1)){if(!FWP.loaded)if(window.FWP_MAP=window.FWP_MAP||{},"place-class"==FWP.settings.places)try{const{AutocompleteSessionToken:t,AutocompleteSuggestion:a}=await google.maps.importLibrary("places");e().on("input",".facetwp-location",FWP.helper.debounce(function(s){const o=e(s.target).val(),n=e(s.target).closest(".facetwp-facet");if(!o||o.length<FWP_JSON.proximity.minLength)return void n.find(".location-results").addClass("facetwp-hidden");FWP_MAP.token||=new t;const c={input:o,sessionToken:FWP_MAP.token,...FWP_JSON.proximity.autocomplete_options};a.fetchAutocompleteSuggestions(c).then(({suggestions:e})=>{if(e&&e.length>0){let t="";e.forEach((e,a)=>{let s=e.placePrediction;t+='<div class="location-result'+(0===a?" active":"")+'" data-place-id="'+s.placeId+'" data-index="'+a+'">',t+='<span class="result-main">'+(s.mainText?.toString()??"")+"</span> ",t+='<span class="result-secondary">'+(s.secondaryText?.toString()??"")+"</span>",t+='<span class="result-description facetwp-hidden">'+(s.text?.toString()??"")+"</span>",t+="</div>"}),t+='<div class="location-attribution"><div class="powered-by-google"></div></div>',n.find(".location-results").html(t).removeClass("facetwp-hidden")}else n.find(".location-results").html("").addClass("facetwp-hidden")}).catch(e=>{console.error("Error fetching predictions:",e),n.find(".location-results").html('<div class="location-error">Error fetching results.</div>').removeClass("facetwp-hidden")})},FWP_JSON.proximity.queryDelay))}catch(e){console.error("Error loading Places library:",e)}else await google.maps.importLibrary("places"),FWP_MAP.sessionToken=new google.maps.places.AutocompleteSessionToken,FWP_MAP.autocompleteService=new google.maps.places.AutocompleteService,FWP_MAP.placesService=new google.maps.places.PlacesService(document.createElement("div")),e().on("input",".facetwp-location",FWP.helper.debounce(function(t){var a=e(t.target).val(),s=e(t.target).closest(".facetwp-facet");if(""==a||a.length<FWP_JSON.proximity.minLength)s.find(".location-results").addClass("facetwp-hidden");else{var o=FWP_JSON.proximity.autocomplete_options;o.sessionToken=FWP_MAP.sessionToken,o.input=a,FWP_MAP.autocompleteService.getPredictions(o,function(e,t){if(t===google.maps.places.PlacesServiceStatus.OK){var a="";e.forEach(function(e,t){a+='<div class="location-result'+(0===t?" active":"")+'" data-id="'+e.place_id+'" data-index="'+t+'">',a+='<span class="result-main">'+e.structured_formatting.main_text+"</span> ",a+='<span class="result-secondary">'+e.structured_formatting.secondary_text+"</span>",a+='<span class="result-description facetwp-hidden">'+e.description+"</span>",a+="</div>"}),a+='<div class="location-attribution"><div class="powered-by-google"></div></div>',s.find(".location-results").html(a).removeClass("facetwp-hidden")}})}},FWP_JSON.proximity.queryDelay));t.each(function(t,a){e(this).trigger("keyup")})}}),e().on("click",".location-result",async function(){if("place-class"==FWP.settings.places){const t=e(this).closest(".facetwp-facet"),a=e(this).attr("data-place-id"),{Place:s,AutocompleteSessionToken:o}=await google.maps.importLibrary("places");FWP_MAP.token||=new o;const n=["location"],c=new s({id:a,sessionToken:FWP_MAP.token});c.fetchFields({fields:n}).then(()=>{t.find(".facetwp-lat").val(c.location.lat()),t.find(".facetwp-lng").val(c.location.lng()),FWP.autoload()}).catch(e=>{console.error("Error fetching place details:",e)}),FWP_MAP.token=null}else{var t=e(this).closest(".facetwp-facet"),a=e(this).attr("data-id");FWP_MAP.placesService.getDetails({placeId:a,fields:["geometry"],sessionToken:FWP_MAP.sessionToken},function(e,a){a===google.maps.places.PlacesServiceStatus.OK&&(t.find(".facetwp-lat").val(e.geometry.location.lat()),t.find(".facetwp-lng").val(e.geometry.location.lng()),FWP.autoload())})}var s=e(this).find(".result-description").text();e(".facetwp-location").val(s),e(".location-results").addClass("facetwp-hidden")}),e().on("click",".facetwp-type-proximity .locate-me",function(t){var a=e(this),s=a.closest(".facetwp-facet"),o=s.find(".facetwp-location"),n=s.find(".facetwp-lat"),c=s.find(".facetwp-lng");if(a.hasClass("f-reset"))return n.val(""),c.val(""),o.val(""),void FWP.autoload();a.addClass("f-loading"),navigator.geolocation?navigator.geolocation.getCurrentPosition(function(e){var t=e.coords.latitude,i=e.coords.longitude;n.val(t),c.val(i);var r=new google.maps.Geocoder,l={lat:parseFloat(t),lng:parseFloat(i)};r.geocode({location:l},function(e,t){t===google.maps.GeocoderStatus.OK?o.val(e[0].formatted_address):(console.error("Geocoder failed due to: "+t),o.val("Your location"),alert("Could not determine your address.")),a.addClass("f-reset"),FWP.autoload()}),a.removeClass("f-loading"),FWP.hooks.doAction("facetwp/geolocation/success",{facet:s,position:e})},function(e){a.removeClass("f-loading");let t="Could not get your location.";switch(e.code){case e.PERMISSION_DENIED:t="User denied the request for Geolocation.";break;case e.POSITION_UNAVAILABLE:t="Location information is unavailable.";break;case e.TIMEOUT:t="The request to get user location timed out.";break;case e.UNKNOWN_ERROR:t="An unknown error occurred."}console.error("Geolocation error: "+t,e),alert(t),FWP.hooks.doAction("facetwp/geolocation/error",{facet:s,error:e})}):(a.removeClass("f-loading"),alert("Your browser doesn't support Geolocation."))}),e().on("keyup",".facetwp-location",function(t){var a=e(this).closest(".facetwp-facet"),s=""!==e(this).val()?"addClass":"removeClass";if(a.find(".locate-me")[s]("f-reset"),38===t.which||40===t.which||13===t.which)var o=parseInt(a.find(".location-result.active").attr("data-index")),n=parseInt(a.find(".location-result").last().attr("data-index"));if(38===t.which){var c=0<o?o-1:n;a.find(".location-result.active").removeClass("active"),a.find('.location-result[data-index="'+c+'"]').addClass("active")}else if(40===t.which){c=o<n?o+1:0;a.find(".location-result.active").removeClass("active"),a.find('.location-result[data-index="'+c+'"]').addClass("active")}else 13===t.which&&a.find(".location-result.active").trigger("click")});var a=function(t){var a=e(t.target);(a.closest(".facetwp-input-wrap").len()<1||a.hasClass("f-reset"))&&e(".location-results").addClass("facetwp-hidden")};e().on("click",a),e().on("focusout",a),e().on("focusin",".facetwp-location",function(){var t=e(this).closest(".facetwp-facet");""!=e(this).val()&&t.find(".location-results").removeClass("facetwp-hidden")}),e().on("change",".facetwp-radius",function(){""!==e(this).closest(".facetwp-facet").find(".facetwp-location").val()&&FWP.autoload()}),e().on("input",".facetwp-radius-slider",function(t){e(this).closest(".facetwp-facet").find(".facetwp-radius-dist").text(t.target.value)}),FWP.hooks.addAction("facetwp/refresh/proximity",function(e,t){var a=e.find(".facetwp-lat").val(),s=e.find(".facetwp-lng").val(),o=e.find(".facetwp-radius").val(),n=encodeURIComponent(e.find(".facetwp-location").val());FWP.frozen_facets[t]="hard",FWP.facets[t]=""!==a&&void 0!==a?[a,s,o,n]:[]}),FWP.hooks.addFilter("facetwp/selections/proximity",function(e,t){return FWP_JSON.proximity.clearText}),FWP.logic.search={delay_refresh:FWP.helper.debounce(function(e){FWP.frozen_facets[e]="soft",FWP.autoload()},500)},FWP.hooks.addAction("facetwp/refresh/search",function(e,t){var a=e.find(".facetwp-search");FWP.facets[t]=a.val()||"",e.find(".facetwp-icon").addClass("f-loading")}),FWP.hooks.addAction("facetwp/loaded",function(){e(".facetwp-type-search .facetwp-icon").removeClass("f-loading")}),e().on("keyup",".facetwp-type-search .facetwp-search",function(t){if(!FWP.is_refresh){var a=e(this).closest(".facetwp-facet").attr("data-name");void 0!==FWP.settings[a]&&("yes"===FWP.settings[a].auto_refresh?FWP.logic.search.delay_refresh(a):13===t.keyCode&&FWP.autoload())}}),e().on("click",".facetwp-type-search .facetwp-icon",function(){FWP.is_refresh||FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/slider",function(e,t){FWP.facets[t]=[];var a=FWP.active_facet,s=FWP.helper.getUrlVar(t);if(null!==a&&t===a.attr("data-name")){var o=a.find(".facetwp-slider").nodes[0];void 0!==o.noUiSlider&&(FWP.facets[t]=o.noUiSlider.get())}else!1!==s&&(FWP.facets[t]=s.replace("%2C",",").split(","));e.find(".facetwp-slider").attr("disabled",!0)}),FWP.hooks.addAction("facetwp/loaded",function(){e(".facetwp-type-slider .facetwp-slider").nodes.forEach(e=>e.removeAttribute("disabled"))}),FWP.hooks.addAction("facetwp/set_label/slider",function(e){var t=e.attr("data-name"),a=FWP.settings[t].lower,s=FWP.settings[t].upper,o=FWP.settings[t].format,n={decimal_separator:FWP.settings[t].decimal_separator,thousands_separator:FWP.settings[t].thousands_separator},c=FWP.settings[t].prefix,i=FWP.settings[t].suffix;if(a===s)var r=c+nummy(a).format(o,n)+i;else r=c+nummy(a).format(o,n)+i+" &mdash; "+c+nummy(s).format(o,n)+i;e.find(".facetwp-slider-label").html(r)}),FWP.hooks.addFilter("facetwp/selections/slider",function(e,t){var a=t.el.find(".facetwp-slider-label");return a.len()?a.text():""}),e().on("facetwp-loaded",function(){e(".facetwp-type-slider .facetwp-slider").each(function(){var t=e(this),a=t.closest(".facetwp-facet"),s=a.attr("data-name"),o=FWP.settings[s],n=FWP.hooks.applyFilters("facetwp/set_options/slider",{range:o.range,start:o.start,step:parseFloat(o.step),connect:!0,handleAttributes:o.handle_attributes},{facet_name:s});if(t.hasClass("ready"))t.nodes[0].noUiSlider.updateOptions({range:n.range},!1);else{if(void 0!==this.noUiSlider)return;if(null===n.start[0])return;if(parseFloat(o.range.min)>parseFloat(o.range.max))return FWP.settings[s].lower=o.range.min,FWP.settings[s].upper=o.range.max,void FWP.hooks.doAction("facetwp/set_label/slider",a);parseFloat(o.range.min)==parseFloat(o.range.max)&&t.attr("data-disabled","true");var c=this;noUiSlider.create(c,n),c.noUiSlider.on("slide",function(){t.attr("data-has-moved","true")}),c.noUiSlider.on("update",function(e,t){FWP.settings[s].lower=e[0],FWP.settings[s].upper=e[1],FWP.hooks.doAction("facetwp/set_label/slider",a)}),c.noUiSlider.on("set",function(){"true"===t.attr("data-has-moved")&&(t.attr("data-has-moved",""),FWP.active_facet=t.closest(".facetwp-facet"),FWP.autoload())}),t.addClass("ready")}}),e(".facetwp-type-slider").each(function(){var t=e(this).attr("data-name");e(this).find(".facetwp-slider-reset")[FWP.facets[t].length?"removeClass":"addClass"]("facetwp-hidden")})}),e().on("click",".facetwp-type-slider .facetwp-slider-reset",function(){var t=e(this).closest(".facetwp-facet").attr("data-name");FWP.reset(t)}),FWP.hooks.addAction("facetwp/refresh/rating",function(t,a){var s=[];t.find(".facetwp-star.selected").each(function(){var t=e(this).attr("data-value");""!=t&&s.push(t)}),FWP.facets[a]=s}),e().on("mouseover",".facetwp-star:not(.disabled)",function(){var t=e(this).closest(".facetwp-facet");if(e(this).hasClass("selected"))t.find(".facetwp-star-label").text(FWP_JSON.rating.Undo);else{var a="5"==e(this).attr("data-value")?"":FWP_JSON.rating["& up"];t.find(".facetwp-star-label").text(a),t.find(".facetwp-counter").text("("+e(this).attr("data-counter")+")")}}),e().on("mouseout",".facetwp-star:not(.disabled)",function(){var t=e(this).closest(".facetwp-facet");t.find(".facetwp-star-label").text(""),t.find(".facetwp-counter").text("")}),e().on("click",".facetwp-star:not(.disabled)",function(){var t=e(this).closest(".facetwp-facet"),a=e(this).hasClass("selected");t.find(".facetwp-star").removeClass("selected"),a||e(this).addClass("selected"),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/sort",function(e,t){var a=e.find("select").val();FWP.facets[t]=a?[a]:[]}),FWP.hooks.addFilter("facetwp/selections/sort",function(t,a){var s=[],o=a.el.nodes.find(e=>!e.classList.contains("facetwp-ignore")),n=e(o).find("select");if(n.len()){var c=n.nodes[0],i=c.options[c.selectedIndex].value,r=c.options[c.selectedIndex].text;r=r.replace(/\(\d+\)$/,""),s.push({value:i,label:r})}return s}),e().on("change",".facetwp-type-sort select",function(){var t=e(this).closest(".facetwp-facet"),a=t.attr("data-name"),s=e(this).val();t.find('.facetwp-type-sort select [selected=""]').each(function(){e(this).val()!=s&&e(this).removeAttr("selected")}),""!==s&&(FWP.frozen_facets[a]="hard",t.find('.facetwp-type-sort select option[value="'+s+'"]').attr("selected","")),FWP.autoload()}),FWP.hooks.addAction("facetwp/refresh/pager",function(e,t){FWP.facets[t]=[]}),FWP.hooks.addFilter("facetwp/template_html",function(t,a){if(FWP.is_load_more){if(FWP.is_load_more=!1,0<e(".fwpl-layout").len()){var s=e(a.html).find(".fwpl-layout").html();e(".facetwp-template .fwpl-layout").append(s)}else e(".facetwp-template").append(a.html);return!0}return t}),e().on("click",".facetwp-load-more",function(){var t=e(this).attr("data-loading");e(this).html(t),FWP.is_load_more=!0,FWP.load_more_paged+=1,FWP.paged=FWP.load_more_paged,FWP.soft_refresh=!0,FWP.refresh()}),e().on("facetwp-loaded",function(){var t=FWP.settings.pager.page<FWP.settings.pager.total_pages?"removeClass":"addClass";e(".facetwp-load-more")[t]("facetwp-hidden")}),e().on("facetwp-refresh",function(){FWP.loaded&&FWP.is_load_more||(FWP.load_more_paged=1)}),e().on("click",".facetwp-reset",function(){let t=e(this).nodes[0]._facets;FWP.reset(t)}),e().on("facetwp-loaded",function(){FWP.loaded||e(".facetwp-reset").each(function(){let t=e(this),a=t.attr("data-mode"),s=t.attr("data-values");s=null==s?Object.keys(FWP.facets):s.split(","),"exclude"==a&&(s=Object.keys(FWP.facets).filter(e=>!s.includes(e))),t.nodes[0]._facets=s})}),FWP.hooks.addAction("facetwp/loaded",function(){e(".facetwp-hide-empty").each(function(){let t=e(this),a=t.closest(".facetwp-facet"),s=t.nodes[0]._facets,o=FWP.loaded||FWP.is_bfcache||!e.isset(FWP_HTTP.url_vars)?FWP.facets:Object.assign(FWP.facets,FWP_HTTP.url_vars);s.every(e=>void 0===o[e]||o[e].length<1)?a.addClass("facetwp-hidden"):a.removeClass("facetwp-hidden")})},20)}(fUtil)}();