!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),c={},r=function(e){return c[e]?new Promise((function(t){t(c[e]),c[e]=c[e].clone()})):new Promise((function(t){return fetch(e).then((function(n){t(n),c[e]=n.clone()}))}))},i=function(){var e=new URLSearchParams;e.append("action","blocksy_get_woo_compare"),e.append("items",JSON.stringify(ct_localizations.blc_ext_compare_list.list));var t="".concat(ct_localizations.ajax_url,"?").concat(e.toString());return{isCached:!!c[t],fetch:function(){return new Promise((function(e){r(t).then((function(e){return e.json()})).then((function(t){t.success;var n=t.data,o=document.createElement("div");o.innerHTML=n.content,e(o.firstElementChild)}))}))}}},a=function(e){var n=e.event,c=e.completeAction;e.el;n.preventDefault(),i().fetch().then((function(e){document.querySelector(".ct-drawer-canvas").appendChild(e);var r=document.querySelector("#ct-compare-modal");o().trigger("ct:overlay:handle-click",{event:n,options:{openStrategy:"fast",container:r}}),c({finalState:""}),o().trigger("blocksy:wishlist:sync"),function(e,n){o().trigger("blocksy:frontend:init"),setTimeout((function(){setTimeout((function(){o().trigger("ct:overlay:handle-click",{e:n,href:"#".concat(e.id),options:{openStrategy:"skip",isModal:!0,computeScrollContainer:function(){if(e.closest("body"))return t.getCurrentScreen&&"mobile"===(0,t.getCurrentScreen)({withTablet:!0})?e.querySelector(".ct-compare-content"):e.querySelector(".entry-summary")},clickOutside:!0,focus:!1}})}))}))}(r,n)}))};(0,t.registerDynamicChunk)("blocksy_ext_woo_extra_compare_modal",{mount:function(e,t){var n=t.event,o=t.completeAction;n.preventDefault(),n.stopPropagation(),a({event:n,completeAction:o,el:e})},maybeGetPanelContent:function(e,t){t.event;return i().isCached?new Promise((function(e){e("")})):null}}),o().on("ct:modal:closed",(function(e){"ct-compare-modal"===e.id&&setTimeout((function(){e.remove()}))}))}();