var q=Object.defineProperty;var L=n=>{throw TypeError(n)};var M=(n,e,t)=>e in n?q(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var N=(n,e,t)=>M(n,typeof e!="symbol"?e+"":e,t),x=(n,e,t)=>e.has(n)||L("Cannot "+t);var r=(n,e,t)=>(x(n,e,"read from private field"),t?t.call(n):e.get(n)),T=(n,e,t)=>e.has(n)?L("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(n):e.set(n,t),C=(n,e,t,o)=>(x(n,e,"write to private field"),o?o.call(n,t):e.set(n,t),t);var a,d;const i=class i{static init(){return r(i,a)||C(i,a,new i),r(i,a).initCarousels(document),r(i,a)}static reInit(e=document){if(!r(i,a)){i.init();return}r(i,a).initCarousels(e)}static cleanupHoverZones(e){const t=r(i,d).get(e);t&&(t.abort(),r(i,d).delete(e))}static addHoverNavigationZones(e,t,o){if(Math.max(1,Number(o.slidesToShow||1))>1||!t.slides||t.slides.length<=1||e.querySelector(".fct-hover-zone")||!window.matchMedia("(hover: hover)").matches)return;const v=r(i,d).get(e);v&&v.abort();const u=new AbortController;r(i,d).set(e,u);const f=document.createElement("div"),l=document.createElement("div");f.className="fct-hover-zone fct-hover-left",l.className="fct-hover-zone fct-hover-right";let g=!1;const p=c=>{g||(g=!0,c==="prev"?t.slidePrev():t.slideNext(),setTimeout(()=>{g=!1},i.SLIDE_THROTTLE_MS))};f.addEventListener("mouseenter",()=>{p("prev")},{signal:u.signal}),l.addEventListener("mouseenter",()=>{p("next")},{signal:u.signal}),e.appendChild(f),e.appendChild(l)}initCarousels(e=document){if(!e||!e.querySelectorAll)return;const t=e.querySelectorAll(".swiper.fct-product-carousel[data-fluent-cart-product-carousel]");t.length&&t.forEach(o=>{if(o.swiper)return;let s={};try{s=JSON.parse(o.getAttribute("data-carousel-settings")||"{}")}catch{}const v=Math.max(1,Number(s.slidesToShow||3)),u=s.pagination==="yes"||s.dots==="yes",f={bullets:"bullets",fraction:"fraction",progress:"progressbar",segmented:"custom"},l=s.autoplay||"no",g=l==="yes"||l==="hover"?{delay:Number(s.autoplayDelay||3e3),disableOnInteraction:!1}:!1;let p=!1;if(u){const h=f[s.paginationType]||"bullets";p={el:o.querySelector(".swiper-pagination"),clickable:!0,type:h},s.paginationType==="segmented"&&(p.renderCustom=function(Z,w,E){let b="";for(let m=1;m<=E;m++){let S="swiper-pagination-segment";m<w?S+=" is-completed":m===w&&(S+=" is-active"),b+=`<div class="${S}"></div>`}return b+=`<span class="segment-counter">${w} / ${E}</span>`,b})}const c=new Swiper(o,{slidesPerView:v,spaceBetween:16,loop:s.infinite==="yes",observer:!0,observeParents:!0,grabCursor:!0,autoplay:g,on:{init(h){s.autoplay==="hover"&&h.autoplay.stop()}},navigation:s.arrows==="yes"?{nextEl:o.querySelector(".swiper-button-next"),prevEl:o.querySelector(".swiper-button-prev")}:!1,pagination:p});l==="hover"&&c.autoplay&&(o.addEventListener("mouseenter",()=>{c.autoplay.start()}),o.addEventListener("mouseleave",()=>{c.autoplay.stop()})),i.addHoverNavigationZones(o,c,s),o.swiper=c})}};a=new WeakMap,d=new WeakMap,T(i,a,null),N(i,"SLIDE_THROTTLE_MS",350),T(i,d,new WeakMap);let y=i;window.FluentCartMediaCarousel=y;document.addEventListener("DOMContentLoaded",()=>{y.init()});
