!function(){"use strict";var e={n:function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,{a:n}),n},d:function(t,n){for(var o in n)e.o(n,o)&&!e.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:n[o]})},o:function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}},t=window.ctFrontend,n=window.ctEvents,o=e.n(n);let r={};const c=function(e){const t=new URLSearchParams(location.search);window.wp&&window.wp.customize&&(t.append("filter_panel_position",wp.customize("filter_panel_position")()),t.append("filter_source",wp.customize("filter_source")()),t.append("filter_panel_close_on_select",wp.customize("filter_panel_close_on_select")())),t.append("blocksy_ajax","yes");const n=`${location.origin}${location.pathname}?${t.toString()}`;return{isCached:!!r[n],fetch:function(){return new Promise(function(e){var t;(t=n,r[t]?new Promise(function(e){e(r[t]),r[t]=r[t].clone()}):new Promise(function(e){return fetch(t).then(function(n){e(n),r[t]=n.clone()})})).then(function(e){return e.text()}).then(function(t){const n=(new DOMParser).parseFromString(t,"text/html").querySelector("#woo-filters-panel");n&&[...n.querySelectorAll('a[href*="blocksy_ajax"]')].map(function(e){const t=new URL(e.getAttribute("href"),window.location.href);t.searchParams.delete("blocksy_ajax"),e.setAttribute("href",t.toString())}),e(n)})})}}},i=function({event:e,el:t,completeAction:n}){if(document.querySelector("#woo-filters-panel")){const t=document.querySelector("#woo-filters-panel");return void n({finalState:"",onCompleted:function(){o().trigger("ct:overlay:handle-click",{event:e,options:{openStrategy:"fast",container:t}})}})}c().fetch().then(function(t){n({finalState:"",onCompleted:function(){document.querySelector(".ct-drawer-canvas").appendChild(t);const n=document.querySelector("#woo-filters-panel");setTimeout(function(){o().trigger("ct:overlay:handle-click",{event:e,options:{openStrategy:"fast",container:n}}),function(e,t){setTimeout(function(){o().trigger("ct:overlay:handle-click",{e:t,href:`#${e.id}`,options:{openStrategy:"skip",isModal:!0,computeScrollContainer:function(){return e.closest("body")?e.querySelector(".ct-panel-content-inner"):null},clickOutside:!0,focus:!1}})})}(n,e)},10)}})})};(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_filters_ajax_reveal",{mount:function(e,{event:t,completeAction:n}){if(t.preventDefault(),t.stopPropagation(),e.dataset.togglePanel)i({event:t,el:e,completeAction:n});else{c().fetch().then(function(t){n({finalState:"",onCompleted:function(){!function(e,t){document.querySelector("#woo-filters-panel").innerHTML=e.innerHTML;const n=t.cloneNode(!0);n.classList.add("ct-expandable-trigger"),n.setAttribute("aria-expanded","true"),t.parentNode.replaceChild(n,t),setTimeout(function(){o().trigger("blocksy:frontend:init"),n.click()},200)}(t,e)}})})}}})}();