"use strict";(globalThis.blocksyJsonP=globalThis.blocksyJsonP||[]).push([[708],{3708(t,e,o){o.r(e),o.d(e,{mount:function(){return l}});var c=o(8043),n=o.n(c),r=o(2151),i=o.n(r);let s=!1,a=!1;const d=[".ct-suggested-products--mini-cart",".ct-shipping-progress-mini-cart"],u=function(){ct_localizations.dynamic_styles_selectors&&d.forEach(function(t){[...document.querySelectorAll(t)].forEach(function(t){ct_localizations.dynamic_styles_selectors.some(function(e){return t.matches(e.selector)})||t.remove()})})},l=function(t,{event:e}){if(!n())return;const o=t.querySelector(".ct-cart-item");if(t.matches(".ct-header-cart")&&o&&!o.classList.contains("ct-offcanvas-trigger")&&e&&"touchstart"===e.type)return void(location.href=o.getAttribute("href"));const c='.ct-header-cart, .ct-shortcuts-bar [data-id="cart"]';if(s)return;s=!0,u(),n()(document.body).on("adding_to_cart",function(){return[...document.querySelectorAll(c)].map(function(t){t.closest(".ct-shortcuts-bar")||(t=t.firstElementChild),t.classList.remove("ct-added"),t.classList.add("ct-adding")})}),n()(document.body).on("wc_fragments_loaded",function(){setTimeout(function(){return i().trigger("blocksy:frontend:init")})}),n()(document.body).on("wc_cart_button_updated",function(t,e){if(window.wc_add_to_cart_params&&window.wc_add_to_cart_params.i18n_view_cart_with_icon&&e&&e.length>0){const t=e[0];t.closest("[data-products]")&&(t.nextElementSibling.innerHTML=wc_add_to_cart_params.i18n_view_cart_with_icon)}});const r=function(){[...document.querySelectorAll(c)].map(function(t,e){e>0||document.querySelector("#ct-compare-modal.active")||document.querySelector(".quick-view-modal.active")||document.querySelector("#woo-cart-panel.active")||!(!document.body.classList.contains("single-product")&&!document.body.classList.contains("woocommerce-cart")&&!document.body.classList.contains("woocommerce-checkout")&&t.querySelector('[data-auto-open*="archive"]')||document.body.classList.contains("single-product")&&t.querySelector('[data-auto-open*="product"]'))||(t.querySelector("[data-auto-open]").focusDisabled=!0,t.querySelector("[data-auto-open]").click())})};n()(document.body).on("added_to_cart",function(t,e,o,n,i){n=n[0],[...document.querySelectorAll(c)].map(function(t,e){let o=t;t.closest(".ct-shortcuts-bar")||(o=t.firstElementChild),o.classList.remove("ct-adding"),o.classList.add("ct-added")}),Object.keys(e).length>0?r():a=!0}),n()(document.body).on("wc_fragments_refreshed",function(){a&&r(),a=!1,setTimeout(function(){i().trigger("blocksy:frontend:init"),d()})}),n()(document).on("uael_quick_view_loader_stop",function(){i().trigger("ct:add-to-cart:quantity")}),n()(document).on("facetwp-loaded",function(){i().trigger("ct:custom-select:init")});const d=function(){let t=document.querySelector(".ct-header-cart .ct-cart-content");t&&t.removeAttribute("style")};n()(document.body).on("wc_fragments_loaded",function(){setTimeout(function(){i().trigger("blocksy:frontend:init"),d()})}),["wc_fragments_loaded","wc_fragments_refreshed"].forEach(function(t){n()(document.body).on(t,function(){setTimeout(function(){return u()})})}),n()(document.body).on("click",".remove_from_cart_button",{},function(t){const e=t.target.closest(".woocommerce-mini-cart-item");e&&e.classList.add("processing")}),n()(document.body).on("removed_from_cart",function(t,e,o,r){[...document.querySelectorAll(c)].map(function(t){if(r)try{r[0].closest(".updating")&&r[0].closest(".updating").classList.remove("updating"),r[0].closest("li").remove()}catch(t){}}),n()(document).trigger("wc_update_cart"),n()(document.body).trigger("update_checkout")}),n()(document.body).on("click",".remove_from_cart_button",function(t){t.target.closest("[data-placement]")&&(window.blocksySkippedFragments=[t.target.closest("[data-placement]")])});const l=jQuery.fn.replaceWith;jQuery.fn.replaceWith=function(){var t=this;let e=arguments[0];if(e&&"string"!=typeof e&&((e.jquery||void 0!==e.length)&&(e=e[0]),e instanceof Element&&(e=e.outerHTML)),window.blocksySkippedFragments&&window.blocksySkippedFragments.includes(this[0])){const o=document.createElement("div");return o.innerHTML=e,this[0].innerHTML=o.firstElementChild.innerHTML,[...o.firstElementChild.attributes].forEach(function({name:e,value:o}){t[0].setAttribute(e,o)}),ctFrontend.preloadAssetsForContent(e),this}return"string"==typeof e&&ctFrontend.preloadAssetsForContent(e),l.apply(this,arguments)}}}}]);