1import{S as Y}from"./slider.B3Szgx8a.js";const Z={direction:"forward",speed:2,startDelay:1e3,active:!0,breakpoints:{},playOnInit:!0,stopOnFocusIn:!0,stopOnInteraction:!0,stopOnMouseEnter:!1,rootNode:null};function _(c,e){const t=c.rootNode();return e&&e(t)||t}function I(c={}){let e,t,s,a,O=0,i=!1,d=!1,E;function F(n,o){t=n;const{mergeOptions:f,optionsAtMedia:p}=o,h=f(Z,I.globalOptions),M=f(h,c);if(e=p(M),t.scrollSnapList().length<=1)return;a=e.startDelay,s=!1,E=t.internalEngine().scrollBody;const{eventStore:l}=t.internalEngine(),g=!!t.internalEngine().options.watchDrag,m=_(t,e.rootNode);g&&t.on("pointerDown",P),g&&!e.stopOnInteraction&&t.on("pointerUp",A),e.stopOnMouseEnter&&l.add(m,"mouseenter",T),e.stopOnMouseEnter&&!e.stopOnInteraction&&l.add(m,"mouseleave",z),e.stopOnFocusIn&&t.on("slideFocusStart",r),e.stopOnFocusIn&&!e.stopOnInteraction&&l.add(t.containerNode(),"focusout",u),e.playOnInit&&u()}function k(){t.off("pointerDown",P).off("pointerUp",A).off("slideFocusStart",r).off("settle",y),r(),s=!0,i=!1}function u(){if(s||i)return;t.emit("autoScroll:play");const n=t.internalEngine(),{ownerWindow:o}=n;O=o.setTimeout(()=>{n.scrollBody=x(n),n.animation.start()},a),i=!0}function r(){if(s||!i)return;t.emit("autoScroll:stop");const n=t.internalEngine(),{ownerWindow:o}=n;n.scrollBody=E,o.clearTimeout(O),O=0,i=!1}function x(n){const{location:o,previousLocation:f,offsetLocation:p,target:h,scrollTarget:M,index:l,indexPrevious:g,limit:{reachedMin:m,reachedMax:R,constrain:j},options:{loop:G}}=n,J=e.direction==="forward"?-1:1,S=()=>b;let v=0,D=0,w=o.get(),V=0,C=!1;function K(){let H=0;f.set(o),v=J*e.speed,w+=v,o.add(v),h.set(o),H=w-V,D=Math.sign(H),V=w;const B=M.byDistance(0,!1).index;l.get()!==B&&(g.set(l.get()),l.set(B),t.emit("select"));const Q=e.direction==="forward"?m(p.get()):R(p.get());if(!G&&Q){C=!0;const X=j(o.get());o.set(X),h.set(o),r()}return b}const b={direction:()=>D,duration:()=>-1,velocity:()=>v,settled:()=>C,seek:K,useBaseFriction:S,useBaseDuration:S,useFriction:S,useDuration:S};return b}function P(){d||r()}function A(){d||L()}function T(){d=!0,r()}function z(){d=!1,u()}function y(){t.off("settle",y),u()}function L(){t.on("settle",y)}function N(n){typeof n<"u"&&(a=n),u()}function W(){i&&r()}function U(){i&&(r(),L())}function q(){return i}return{name:"autoScroll",options:c,init:F,destroy:k,play:N,stop:W,reset:U,isPlaying:q}}I.globalOptions=void 0;class $ extends Y{intersectionObserver;isInView;isHoveringProduct=!1;isManualMode;resizeHandler=()=>this.updateSliderMode();constructor(){super(),this.emblaOptions={loop:!0,align:"start",skipSnaps:!0,slidesToScroll:"auto"},this.playWhenInView()}playWhenInView(){this.intersectionObserver=new IntersectionObserver(e=>{e.forEach(t=>{t.isIntersecting?this.isInView=!0:this.isInView=!1,this.setPlayState()})}),this.intersectionObserver.observe(this)}setPlayState(){if(this.hasManualControlsVisible()){this.emblaApi?.plugins()?.autoScroll.stop();return}this.isInView&&!this.isHoveringProduct?this.emblaApi?.plugins()?.autoScroll.play():this.emblaApi?.plugins()?.autoScroll.stop()}hasManualControlsVisible(){const e=this.querySelector(".arrows");return e instanceof HTMLElement?window.getComputedStyle(e).display!=="none":!1}updateSliderMode(){const e=this.hasManualControlsVisible();if(this.isManualMode===e){this.setPlayState();return}this.isManualMode=e,this.emblaApi&&this.emblaApi.reInit({...this.emblaOptions,align:e?"center":"start"}),this.setPlayState()}connectedCallback(){super.connectedCallback(),this.addEventListener("mouseover",this.handleMouseOver),this.addEventListener("mouseout",this.handleMouseOut),window.addEventListener("resize",this.resizeHandler),this.updateSliderMode()}disconnectedCallback(){this.removeEventListener("mouseover",this.handleMouseOver),this.removeEventListener("mouseout",this.handleMouseOut),window.removeEventListener("resize",this.resizeHandler),super.disconnectedCallback()}handleMouseOver=e=>{const t=e.target;t&&t.closest(".product")&&(this.isHoveringProduct=!0,this.setPlayState())};handleMouseOut=e=>{const t=e.target,s=e.relatedTarget;!t||!t.closest(".product")||s?.closest(".product")||(this.isHoveringProduct=!1,this.setPlayState())};getPlugins(){return[I({speed:1,stopOnMouseEnter:!1,stopOnFocusIn:!1,stopOnInteraction:!1,playOnInit:!0})]}shuffle(){const e=this.querySelector(".list");if(e?.children?.length)for(let t=e?.children.length;t>=0;t--){const s=Math.random()*t|0,a=e?.children[s];a&&e.appendChild(a)}}}customElements.define("hero-products",$);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.