1import{Component}from"@theme/component";import{isMobileBreakpoint,isDesktopBreakpoint,mediaBreakpointMobile,mediaBreakpointTablet,mediaQueryLarge,mediaQueryDesktop,getLenis,fetchConfig,formatCurrency,mediaQueryMobile,debounce,prefersReducedMotion,isTouch,CookieManager,getLocalStorage,setLocalStorage,hasLocalStorage,isRTL,mediaHoverFine,waitForEvent,removeScrollLockClass,onDocumentReady,getFocusableElements}from"@theme/utilities";import{inView,animate,scroll}from"@theme/animation";import{ResizeNotifier}from"@theme/critical";import{CarouselComponent}from"@theme/carousel";import{DialogCloseEvent}from"@theme/dialog";import{AccordionComponent}from"@theme/modules";import{morph}from"@theme/morph";import{ThemeEvents,CartGroupedSections,CartAddEvent,CartErrorEvent,CartUpdateEvent}from"@theme/events";import"@theme/badge-float";class BasicHeader extends HTMLElement{constructor(){super()}get headerSection(){return document.querySelector(".header-section")}get enableTransparent(){return this.dataset.enableTransparent==="true"}connectedCallback(){if(this.#init(),new ResizeNotifier(this.#setHeight.bind(this)).observe(this),Shopify.designMode){const section=this.closest(".shopify-section");section.addEventListener("shopify:section:load",this.#init.bind(this)),section.addEventListener("shopify:section:unload",this.#init.bind(this)),section.addEventListener("shopify:section:reorder",this.#init.bind(this))}}#init(){this.#setHeight(),this.enableTransparent&&this.headerSection.classList.add("header-transparent")}#setHeight(){requestAnimationFrame(()=>{const offsetHeight=Math.round(this.offsetHeight);document.documentElement.style.setProperty("--header-height",`${offsetHeight}px`)})}}customElements.define("basic-header",BasicHeader,{extends:"header"});class StickyHeader extends BasicHeader{#boundHandleScroll=null;#resizeObserver=null;constructor(){super(),this.classes={pinned:"header-pinned",headerScrolled:"header-scrolled",headerSticky:"header-sticky"},this.currentScrollTop=0,this.scrollThreshold=200,this.scrollDirection="none",this.scrollDistance=0,this.lenis=null,this.hasScrolledPastThreshold=!1,this._isPinned=!1,this._isScrolled=!1}get isAlwaysSticky(){return this.dataset.stickyType==="always"}connectedCallback(){super.connectedCallback(),this.#cacheInitialHeaderPosition(),this.#initStickyHeader(),this.#checkInitialScrollState(),this.#resizeObserver||(this.#resizeObserver=new ResizeObserver(()=>{this.#cacheInitialHeaderPosition()}),this.#resizeObserver.observe(this.headerSection))}disconnectedCallback(){super.disconnectedCallback?.(),this.#boundHandleScroll&&(this.lenis?this.lenis.off("scroll",this.#boundHandleScroll):window.removeEventListener("scroll",this.#boundHandleScroll),this.#boundHandleScroll=null),this.#resizeObserver&&(this.#resizeObserver.disconnect(),this.#resizeObserver=null)}#cacheInitialHeaderPosition(){requestAnimationFrame(()=>{const headerBounds=this.headerSection?.querySelector(".header")?.getBoundingClientRect()||this.headerSection.getBoundingClientRect(),scrollY=this.lenis?this.lenis.scroll:window.scrollY;this.initialHeaderTop=headerBounds.top+scrollY,this.initialHeaderHeight=headerBounds.height;const headerOffsetFromTop=headerBounds.top;headerOffsetFromTop>0?this.stickThreshold=headerOffsetFromTop:this.stickThreshold=this.initialHeaderTop+this.initialHeaderHeight,(this.stickThreshold<=0||!this.initialHeaderHeight)&&(this.stickThreshold=Math.max(this.initialHeaderHeight||0,1))})}#initStickyHeader(){this.headerSection.classList.add(this.classes.headerSticky),this.headerSection.dataset.stickyType=this.dataset.stickyType,this.#boundHandleScroll=this.#handleScroll.bind(this),this.lenis=getLenis(),this.lenis?this.lenis.on("scroll",this.#boundHandleScroll):window.addEventListener("scroll",this.#boundHandleScroll,{passive:!0})}#checkInitialScrollState(){requestAnimationFrame(()=>{const scrollTop=this.lenis?this.lenis.scroll:window.scrollY;(!this.stickThreshold||this.stickThreshold<=0)&&this.#cacheInitialHeaderPosition(),scrollTop>=this.stickThreshold?(this.hasScrolledPastThreshold=!0,this._isScrolled||(this._isScrolled=!0,this.headerSection.classList.add(this.classes.headerScrolled)),this._isPinned||(this._isPinned=!0,document.body.classList.add(this.classes.pinned))):(this.hasScrolledPastThreshold=!1,this._isScrolled&&(this._isScrolled=!1,this.headerSection.classList.remove(this.classes.headerScrolled)),this._isPinned&&(this._isPinned=!1,document.body.classList.remove(this.classes.pinned))),this.currentScrollTop=scrollTop})}#handleScroll(){if(!this.lenis){const retryLenis=getLenis();retryLenis&&(this.lenis=retryLenis,window.removeEventListener("scroll",this.#boundHandleScroll),this.lenis.on("scroll",this.#boundHandleScroll))}const scrollTop=this.lenis?this.lenis.scroll:window.scrollY;(!this.stickThreshold||this.stickThreshold<=0)&&this.#cacheInitialHeaderPosition();const shouldStick=scrollTop>=this.stickThreshold,headerBoundsBottom=this.initialHeaderTop+(this.initialHeaderHeight||0);this.#updateScrollMetrics(scrollTop),shouldStick?this.#handleScrolledPastHeader(scrollTop,headerBoundsBottom):this.isAlwaysSticky&&this.hasScrolledPastThreshold?scrollTop<1&&this.#handleScrolledBeforeHeader():this.#handleScrolledBeforeHeader(),this.currentScrollTop=scrollTop}#updateScrollMetrics(scrollTop){const newDirection=scrollTop>this.currentScrollTop?"down":"up";newDirection!==this.scrollDirection?(this.scrollDistance=0,this.scrollDirection=newDirection):this.scrollDistance+=Math.abs(scrollTop-this.currentScrollTop)}#handleScrolledPastHeader(scrollTop,headerBoundsBottom){if(this.hasScrolledPastThreshold=!0,this._isScrolled||(this._isScrolled=!0,this.headerSection.classList.add(this.classes.headerScrolled)),this.isAlwaysSticky)this._isPinned||(this._isPinned=!0,document.body.classList.add(this.classes.pinned));else{const isScrollingUp=this.scrollDirection==="up",isNearHeader=scrollTop<headerBoundsBottom+100,hasScrolledEnough=this.scrollDistance>=this.scrollThreshold;isScrollingUp||isNearHeader?this._isPinned||(this._isPinned=!0,document.body.classList.add(this.classes.pinned)):hasScrolledEnough&&this._isPinned&&(this._isPinned=!1,document.body.classList.remove(this.classes.pinned))}}#handleScrolledBeforeHeader(){this.isAlwaysSticky&&this.hasScrolledPastThreshold?(this.lenis?this.lenis.scroll:window.scrollY)<1&&(this.hasScrolledPastThreshold=!1,this._isScrolled&&(this._isScrolled=!1,this.headerSection.classList.remove(this.classes.headerScrolled)),this._isPinned&&(this._isPinned=!1,document.body.classList.remove(this.classes.pinned))):(this.hasScrolledPastThreshold=!1,this._isScrolled&&(this._isScrolled=!1,this.headerSection.classList.remove(this.classes.headerScrolled)),this._isPinned&&(this._isPinned=!1,document.body.classList.remove(this.classes.pinned)))}}customElements.define("sticky-header",StickyHeader,{extends:"header"});const lockDropdownCount=new WeakMap,ANIMATION_TIMING={hoverEnterDelay:100,hoverLeaveDelay:150,contentOpenDelay:100,hoverIntentGrace:400};class DetailsDropdown extends HTMLDetailsElement{constructor(){super(),this.classes={bodyClass:"has-dropdown-menu"},this.events={handleAfterHide:"menu:handleAfterHide",handleAfterShow:"menu:handleAfterShow"},this.summaryElement=this.firstElementChild,this.contentElement=this.lastElementChild,this._open=this.hasAttribute("open"),this.hoverEnterTimer=null,this.hoverLeaveTimer=null,this.hoverIntentTimer=null,this.isHoveringItem=!1,this.isHoveringContent=!1,this._prevPoint=null,this._lastPoint=null,this._cachedTrigger=null,this._cachedTranslateY=null,this.handleSummaryClick=this.handleSummaryClick.bind(this),this.handleOutsideClick=this.handleOutsideClick.bind(this),this.handleEscKeyPress=this.handleEscKeyPress.bind(this),this.handleFocusOut=this.handleFocusOut.bind(this),this.handleMouseEnter=this.handleMouseEnter.bind(this),this.handleMouseLeave=this.handleMouseLeave.bind(this),this.handleContentMouseEnter=this.handleContentMouseEnter.bind(this),this.handleContentMouseLeave=this.handleContentMouseLeave.bind(this)}connectedCallback(){this.summaryElement.addEventListener("click",this.handleSummaryClick),this.trigger==="hover"&&(this.summaryElement.addEventListener("focusin",this.#handleFocusIn),this.summaryElement.addEventListener("focusout",this.#handleFocusOutInternal),this.contentElement.addEventListener("mouseenter",this.handleContentMouseEnter),this.contentElement.addEventListener("mouseleave",this.handleContentMouseLeave),this.addEventListener("mousemove",this.#trackPointer)),this.addEventListener("mouseenter",this.handleMouseEnter),this.addEventListener("mouseleave",this.handleMouseLeave)}disconnectedCallback(){this.#clearHoverTimers(),this.summaryElement.removeEventListener("click",this.handleSummaryClick),this.trigger==="hover"&&(this.summaryElement.removeEventListener("focusin",this.#handleFocusIn),this.summaryElement.removeEventListener("focusout",this.#handleFocusOutInternal),this.contentElement.removeEventListener("mouseenter",this.handleContentMouseEnter),this.contentElement.removeEventListener("mouseleave",this.handleContentMouseLeave),this.removeEventListener("mousemove",this.#trackPointer)),this.removeEventListener("mouseenter",this.handleMouseEnter),this.removeEventListener("mouseleave",this.handleMouseLeave),document.removeEventListener("click",this.handleOutsideClick),document.removeEventListener("keydown",this.handleEscKeyPress),document.removeEventListener("focusout",this.handleFocusOut),this._cachedTrigger=null,this._cachedTranslateY=null,this._cachedChildEl=null}#handleFocusIn=event=>{event.target===this.summaryElement&&(this.open=!0)};#handleFocusOutInternal=event=>{this.contentElement.contains(event.relatedTarget)||(this.open=!1)};#trackPointer=event=>{this._prevPoint=this._lastPoint,this._lastPoint={x:event.clientX,y:event.clientY}};handleMouseEnter(){this.isHoveringItem=!0,this.#clearHoverTimer("leave"),this.#clearHoverIntent(),this.hoverEnterTimer=setTimeout(()=>{this.detectHover({type:"mouseenter"})},ANIMATION_TIMING.hoverEnterDelay)}handleMouseLeave(event){if(this.isHoveringItem=!1,this.trigger==="hover"&&this.#isHeadingToMenu(event)){this.#clearHoverTimer("leave"),this.#armHoverIntent();return}this.#clearHoverTimer("enter"),this.open&&!this.isHoveringContent&&(this.hoverLeaveTimer=setTimeout(()=>{this.open&&this.detectHover({type:"mouseleave"})},ANIMATION_TIMING.hoverLeaveDelay))}handleContentMouseEnter(){this.isHoveringContent=!0,this.#clearHoverTimer("leave"),this.#clearHoverIntent()}#isHeadingToMenu(event){const rect=this.getBoundingClientRect();if(!((this._prevPoint&&this._lastPoint?this._lastPoint.y-this._prevPoint.y:0)>0||event.clientY>=rect.bottom-2))return!1;const header=this.closest(".header");if(!header)return!1;const startY=Math.max(event.clientY,rect.bottom)+2;for(const offset of[0,8,20]){const el=document.elementFromPoint(event.clientX,startY+offset);if(el){if(this.contains(el))return!0;
1if(!header.contains(el)||el.closest('details[is="details-mega"], details[is="details-dropdown"][level="top"]'))return!1}}return!0}#armHoverIntent(){this.#clearHoverIntent(),this.hoverIntentTimer=setTimeout(()=>{this.hoverIntentTimer=null,!this.isHoveringContent&&!this.isHoveringItem&&(this.#clearHoverTimer("enter"),this.open&&this.detectHover({type:"mouseleave"}))},ANIMATION_TIMING.hoverIntentGrace)}#clearHoverIntent(){this.hoverIntentTimer&&(clearTimeout(this.hoverIntentTimer),this.hoverIntentTimer=null)}handleContentMouseLeave(){this.isHoveringContent=!1,this.open&&!this.isHoveringItem&&(this.hoverLeaveTimer=setTimeout(()=>{this.open&&this.detectHover({type:"mouseleave"})},ANIMATION_TIMING.hoverLeaveDelay))}#clearHoverTimer(type){const timer=type==="enter"?this.hoverEnterTimer:this.hoverLeaveTimer;timer&&(clearTimeout(timer),type==="enter"?this.hoverEnterTimer=null:this.hoverLeaveTimer=null)}#clearHoverTimers(){this.hoverEnterTimer&&(clearTimeout(this.hoverEnterTimer),this.hoverEnterTimer=null),this.hoverLeaveTimer&&(clearTimeout(this.hoverLeaveTimer),this.hoverLeaveTimer=null),this.#clearHoverIntent()}set open(value){value!==this._open&&(this._open=value,this.isConnected?this.transition(value):value?this.setAttribute("open",""):this.removeAttribute("open"))}get open(){return this._open}get trigger(){return this._cachedTrigger===null&&(mediaHoverFine()?this._cachedTrigger=this.getAttribute("trigger")||"click":this._cachedTrigger="click"),this._cachedTrigger}handleSummaryClick(event){event.preventDefault(),mediaHoverFine()&&this.trigger==="hover"&&this.summaryElement.hasAttribute("data-link")?window.location.href=this.summaryElement.getAttribute("data-link"):this.open=!this.open}beforeOpen(){}beforeClose(){}get level(){return this.hasAttribute("level")?this.getAttribute("level"):"top"}async transition(value){return value?(this.beforeOpen(),this.#incrementDropdownCount(),this.#setupOpenState(),await this.showWithTransition(),this.needsReverse(),waitForEvent(this,this.events.handleAfterShow)):(this.beforeClose(),this.#decrementDropdownCount(),this.#cleanupOpenState(),await this.hideWithTransition(),this.open||this.removeAttribute("open"),waitForEvent(this,this.events.handleAfterHide))}#incrementDropdownCount(){lockDropdownCount.set(DetailsDropdown,(lockDropdownCount.get(DetailsDropdown)||0)+1)}#decrementDropdownCount(){const count=(lockDropdownCount.get(DetailsDropdown)||0)-1;lockDropdownCount.set(DetailsDropdown,count),count>0?document.body.classList.add(this.classes.bodyClass):removeScrollLockClass(document.body,this.classes.bodyClass,()=>(lockDropdownCount.get(DetailsDropdown)||0)===0)}#setupOpenState(){document.body.classList.add(this.classes.bodyClass),document.body.classList.contains("search-open")&&document.body.classList.remove("search-open"),this.setAttribute("open",""),this.summaryElement.setAttribute("open",""),setTimeout(()=>{this.contentElement.setAttribute("open","")},ANIMATION_TIMING.contentOpenDelay),document.addEventListener("click",this.handleOutsideClick),document.addEventListener("keydown",this.handleEscKeyPress),document.addEventListener("focusout",this.handleFocusOut)}#cleanupOpenState(){this.summaryElement.removeAttribute("open"),this.contentElement.removeAttribute("open"),this.#clearHoverTimers(),document.removeEventListener("click",this.handleOutsideClick),document.removeEventListener("keydown",this.handleEscKeyPress),document.removeEventListener("focusout",this.handleFocusOut)}get parentEl(){return this.contentElement}get childEl(){return this._cachedChildEl||(this._cachedChildEl=this.parentEl.firstElementChild),this._cachedChildEl}#getTranslateY(){return this._cachedTranslateY===null&&(this._cachedTranslateY=this.level==="top"?"-3rem":"2rem"),this._cachedTranslateY}async showWithTransition(){const reducedMotion=prefersReducedMotion();animate(this.parentEl,{opacity:[0,1],visibility:"visible"},{duration:reducedMotion?0:.3,easing:"ease-in-out"},{delay:reducedMotion?0:.2});const translateY=this.#getTranslateY();return animate(this.childEl,{transform:[`translateY(${translateY})`,"translateY(0)"]},{duration:reducedMotion?0:.6,easing:[.3,1,.3,1]}).finished}async hideWithTransition(){const reducedMotion=prefersReducedMotion();animate(this.parentEl,{opacity:0,visibility:"hidden"},{duration:reducedMotion?0:.2,easing:"ease-in-out"});const translateY=this.#getTranslateY();return animate(this.childEl,{transform:`translateY(${translateY})`},{duration:reducedMotion?0:.6,easing:[.3,1,.3,1]}).finished}handleOutsideClick(event){const isClickInside=this.contains(event.target),isClickOnDetailsDropdown=event.target.closest("details")instanceof DetailsDropdown;!isClickInside&&!isClickOnDetailsDropdown&&(this.open=!1)}handleEscKeyPress(event){if(event.code==="Escape"){const targetMenu=event.target.closest("details[open]");targetMenu?targetMenu.open=!1:this.open&&(this.open=!1)}}handleFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&(this.open=!1)}detectHover(event){if(this.trigger==="hover"&&this.isConnected){const shouldOpen=event.type==="mouseenter";this.open!==shouldOpen&&(this.open=shouldOpen)}}needsReverse(){if(!this.contentElement||this.contentElement.clientWidth===0)return;const clientWidth=this.contentElement.clientWidth,offsetLeft=this.contentElement.offsetLeft,windowWidth=window.innerWidth;offsetLeft+clientWidth*2>windowWidth?this.contentElement.classList.add("needs-reverse"):this.contentElement.classList.remove("needs-reverse")}}customElements.define("details-dropdown",DetailsDropdown,{extends:"details"}),lockDropdownCount.set(DetailsDropdown,0);const lockMegaCount=new WeakMap;let megaMenuZIndexCounter=1;class DetailsMega extends DetailsDropdown{constructor(){super(),Shopify.designMode&&(this.addEventListener("shopify:block:select",()=>{this.open=!0}),this.addEventListener("shopify:block:deselect",()=>{this.open=!1}))}get additionalBodyClass(){return"has-mega-menu"}#incrementMegaCount(){lockMegaCount.set(DetailsMega,(lockMegaCount.get(DetailsMega)||0)+1)}#decrementMegaCount(){const count=Math.max((lockMegaCount.get(DetailsMega)||0)-1,0);return lockMegaCount.set(DetailsMega,count),count}async showWithTransition(){this.#incrementMegaCount(),document.body.classList.remove("mega-menu-closing"),document.body.classList.add(this.additionalBodyClass),megaMenuZIndexCounter+=1,this.contentElement.style.zIndex=megaMenuZIndexCounter.toString();const reducedMotion=prefersReducedMotion();return animate(this.childEl,{visibility:"visible",transform:["translateY(-100%)","translateY(0)"]},{duration:reducedMotion?0:.6,easing:[.7,0,.2,1]}).finished}async hideWithTransition(){const reducedMotion=prefersReducedMotion(),animationDuration=reducedMotion?0:.6;document.documentElement.style.setProperty("--mega-menu-close-delay",reducedMotion?"0s":"0.6s"),await new Promise(resolve=>{requestAnimationFrame(()=>{document.body.classList.add("mega-menu-closing"),resolve()})}),this.contentElement.style.zIndex="0",this.#decrementMegaCount(),removeScrollLockClass(document.body,this.additionalBodyClass,()=>lockMegaCount.get(DetailsMega)===0),await animate(this.childEl,{visibility:"hidden",transform:"translateY(-100%)"},{duration:animationDuration,easing:[.7,0,.2,1]}).finished,document.body.classList.remove("mega-menu-closing")}}customElements.define("details-mega",DetailsMega,{extends:"details"}),lockMegaCount.set(DetailsMega,0);class MenuSidebar extends HTMLElement{#intersectionObserver=null;constructor(){super(),this.classes={visible:"is-visible"},this.handleSidenavMenuToggle=this.handleSidenavMenuToggle.bind(this),this.handleKeyDown=this.handleKeyDown.bind(this),this.updateHeight=this.updateHeight.bind(this)}get summarys(){return this.querySelectorAll("summary")}
1get containerEl(){return this._containerEl=this._containerEl||this.closest(".mega-menu__wrapper")}connectedCallback(){this.#setupAriaAttributes(),onDocumentReady(this.setInitialMinHeight.bind(this)),this.summarys.forEach(summary=>{summary.addEventListener("mouseenter",this.handleSidenavMenuToggle),summary.addEventListener("keydown",this.handleKeyDown),summary.addEventListener("click",e=>{e.preventDefault();const summaryEl=e.target.closest("summary");this.#goToLink(summaryEl)})}),this.setupIntersectionObserver()}setInitialMinHeight(){requestAnimationFrame(()=>{this.setPromotionsHeight()})}setPromotionsHeight(){if(!this.containerEl)return;const promotionsEl=this.containerEl.querySelector(".mega-menu__promotions");if(!promotionsEl)return;const promotionsHeight=promotionsEl.offsetHeight;this.containerEl.style.setProperty("--promotions-height",`${promotionsHeight}px`)}#setupAriaAttributes(){this.summarys.forEach((summary,index)=>{const contentEl=summary.nextElementSibling;if(!contentEl)return;const summaryId=summary.id||`menu-sidebar-item-${index}`,contentId=contentEl.id||`menu-sidebar-content-${index}`;summary.id=summaryId,contentEl.id=contentId,summary.setAttribute("role","menuitem"),summary.setAttribute("aria-controls",contentId),summary.setAttribute("aria-expanded","false"),contentEl.setAttribute("role","menu"),contentEl.setAttribute("aria-labelledby",summaryId)})}setupIntersectionObserver(){this.#intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&setTimeout(()=>{this.updateHeight(),this.setPromotionsHeight()},100)})}),this.#intersectionObserver.observe(this)}updateHeight(){const activeSummary=this.querySelector(`.${this.classes.visible}`);if(!activeSummary)return;const contentEl=activeSummary.nextElementSibling;if(!this.containerEl||!contentEl)return;const contentHeight=contentEl.offsetHeight;this.containerEl.style.setProperty("--sidebar-height",`${contentHeight}px`)}setActiveItem(summaryEl,isUpdateHeight=!0){const lastSidenavEl=this.querySelector(`.${this.classes.visible}`);lastSidenavEl&&(lastSidenavEl.classList.remove(this.classes.visible),lastSidenavEl.setAttribute("aria-expanded","false")),summaryEl.classList.add(this.classes.visible),summaryEl.setAttribute("aria-expanded","true"),isUpdateHeight&&this.updateHeight()}handleSidenavMenuToggle(event){const summaryEl=event.target.closest("summary");summaryEl&&this.setActiveItem(summaryEl)}handleKeyDown(event){const summaryEl=event.target.closest("summary");if(!summaryEl)return;const summaries=Array.from(this.summarys),currentIndex=summaries.indexOf(summaryEl);if(currentIndex===-1)return;const key=event.key;let targetIndex=currentIndex;switch(key){case"ArrowDown":event.preventDefault(),targetIndex=currentIndex+1,targetIndex>=summaries.length&&(targetIndex=0),summaries[targetIndex].focus(),this.setActiveItem(summaries[targetIndex]);break;case"ArrowUp":event.preventDefault(),targetIndex=currentIndex-1,targetIndex<0&&(targetIndex=summaries.length-1),summaries[targetIndex].focus(),this.setActiveItem(summaries[targetIndex]);break;case"Home":event.preventDefault(),summaries[0].focus(),this.setActiveItem(summaries[0]);break;case"End":event.preventDefault(),summaries[summaries.length-1].focus(),this.setActiveItem(summaries[summaries.length-1]);break;case"Enter":event.preventDefault(),this.setActiveItem(summaryEl),this.#goToLink(summaryEl);break;case" ":event.preventDefault(),this.setActiveItem(summaryEl);break;default:return}}#goToLink(summaryEl){const linkUrl=summaryEl.dataset.linkUrl;linkUrl&&(window.location.href=linkUrl)}disconnectedCallback(){this.summarys.forEach(el=>{el.removeEventListener("mouseenter",this.handleSidenavMenuToggle),el.removeEventListener("keydown",this.handleKeyDown)}),this.#intersectionObserver&&(this.#intersectionObserver.disconnect(),this.#intersectionObserver=null)}}customElements.define("menu-sidebar",MenuSidebar);class MenuDrawerDetails extends HTMLDetailsElement{#abortController=new AbortController;#animationFrameId=null;#boundHandleKeyDown=null;#boundHandleToggle=null;#detailsOutsideRestore=[];
1#focusableElements=[];#focusTrapHandler=null;constructor(){super(),this.onSummaryClick=this.onSummaryClick.bind(this),this.onCloseButtonClick=this.onCloseButtonClick.bind(this),this.onOpenSubmenuButtonClick=this.onOpenSubmenuButtonClick.bind(this),this.#boundHandleKeyDown=this.#handleKeyDown.bind(this),this.#boundHandleToggle=this.#handleToggle.bind(this)}get parent(){return this.closest("[data-parent]")}get summary(){return this.querySelector("summary")}get closeButton(){return this.querySelector(".menu-drawer__item-link-back")}get openSubmenuButton(){return this.querySelector(".menu-drawer__item-link-arrow")}connectedCallback(){const summary=this.summary,closeButton=this.closeButton,openSubmenuButton=this.openSubmenuButton,{signal}=this.#abortController;summary&&(summary.addEventListener("click",this.onSummaryClick,{signal}),this.#setupAriaAttributes()),openSubmenuButton&&openSubmenuButton.addEventListener("click",this.onOpenSubmenuButtonClick,{signal}),closeButton&&closeButton.addEventListener("click",this.onCloseButtonClick,{signal}),document.addEventListener("keydown",this.#boundHandleKeyDown),this.addEventListener("toggle",this.#boundHandleToggle,{signal}),this.#syncAriaExpanded()}disconnectedCallback(){this.#abortController.abort(),document.removeEventListener("keydown",this.#boundHandleKeyDown),this.#removeFocusTrap(),this.#restoreDetailsTabindex(),this.#animationFrameId&&(window.cancelAnimationFrame(this.#animationFrameId),this.#animationFrameId=null)}#handleToggle(){this.open?(this.#setDetailsTabindex(),this.#setupFocusTrap()):(this.#removeFocusTrap(),this.#restoreDetailsTabindex())}#setupFocusTrap(){if(this.#focusableElements.length===0)return;const firstElement=this.#focusableElements[0],lastElement=this.#focusableElements[this.#focusableElements.length-1],handleTabKey=event=>{if(event.key!=="Tab")return;const activeElement=document.activeElement,isFocusInDrawer=this.#focusableElements.includes(activeElement);event.shiftKey?(activeElement===firstElement||!isFocusInDrawer)&&(event.preventDefault(),event.stopPropagation(),lastElement.focus()):(activeElement===lastElement||!isFocusInDrawer)&&(event.preventDefault(),event.stopPropagation(),firstElement.focus())};this.closeButton&&this.closeButton.focus(),this.addEventListener("keydown",handleTabKey,!0),this.#focusTrapHandler=handleTabKey}#removeFocusTrap(){this.#focusTrapHandler&&(this.removeEventListener("keydown",this.#focusTrapHandler,!0),this.#focusTrapHandler=null),this.#focusableElements=[]}#setDetailsTabindex(){this.#restoreDetailsTabindex();const dialog=this.closest(".dialog"),dialogHeader=dialog?.querySelector(".dialog__header"),submenu=this.querySelector(".menu-drawer__submenu"),focusableElements=getFocusableElements(dialog);this.#focusableElements=[],focusableElements.forEach(el=>{if(submenu?.contains(el)||dialogHeader?.contains(el)){this.#focusableElements.push(el);return}const tabindex=el.getAttribute("tabindex");this.#detailsOutsideRestore.push({element:el,tabindex}),el.setAttribute("tabindex","-1")})}#restoreDetailsTabindex(){for(const{element,tabindex}of this.#detailsOutsideRestore)tabindex===null?element.removeAttribute("tabindex"):element.setAttribute("tabindex",tabindex);this.#detailsOutsideRestore.length=0}#setupAriaAttributes(){const summary=this.summary;if(!summary)return;const contentId=summary.id||`${this.tagName.toLowerCase()}-content`;summary.id=summary.id||contentId,summary.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false")}#syncAriaExpanded(){const summary=this.summary;summary&&summary.setAttribute("aria-expanded",this.hasAttribute("open")?"true":"false")}#handleKeyDown(event){if(event.key!=="Escape"||!this.hasAttribute("open"))return;const closestDrawer=event.target.closest("menu-drawer-details");!closestDrawer||closestDrawer!==this||(event.preventDefault(),this.onCloseButtonClick())}onSummaryClick(event){const href=this.summary.dataset.linkUrl;if(href){event.preventDefault(),window.location.href=href;return}}onOpenSubmenuButtonClick(event){event.preventDefault(),event.stopPropagation();const parent=this.parent,summary=this.summary;setTimeout(()=>{!parent||!summary||(this.open||(this.open=!0),parent.classList.add("active"),this.classList.add("active"),this.#syncAriaExpanded())},100)}onCloseButtonClick(){const parent=this.parent,summary=this.summary;!parent||!summary||(parent.classList.remove("active"),this.classList.remove("active"),this.#syncAriaExpanded(),this.#closeAnimation())}#closeAnimation(){this.#animationFrameId&&window.cancelAnimationFrame(this.#animationFrameId);let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?this.#animationFrameId=window.requestAnimationFrame(handleAnimation):(this.removeAttribute("open"),this.#animationFrameId=null,this.#syncAriaExpanded())};this.#animationFrameId=window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer-details",MenuDrawerDetails,{extends:"details"});class MenuDrawerSubmenu extends AccordionComponent{constructor(){super()}connectedCallback(){super.connectedCallback()}onSummaryClick(event){event.preventDefault();const{target}=event,summary=target.closest("summary");if(summary){const href=summary.dataset.linkUrl;if(href){window.location.href=href;return}}}onArrowClick(event){event.preventDefault(),event.stopPropagation(),super.onSummaryClick(event)}}
1customElements.define("menu-drawer-submenu",MenuDrawerSubmenu);class ShowMoreComponent extends Component{requiredRefs=["showMoreButton","showMoreItems","showMoreContent"];#expanded=!1;#disableOnDesktop=!1;#collapsedHeight=0;#disabledClass="hidden";get#currentBreakpoint(){return isMobileBreakpoint()?"MOBILE":"DESKTOP"}#animation;#animationSpeed=300;connectedCallback(){super.connectedCallback(),this.#updateBreakpointState()}#updateBreakpointState=()=>{this.#disableOnDesktop=this.dataset.disableOnDesktop==="true",this.#disabledClass=this.#disableOnDesktop?"mobile:hidden":"hidden"};#expand=()=>{const{showMoreItems,showMoreContent}=this.refs;this.#collapsedHeight=showMoreContent.offsetHeight;const startHeight=this.#collapsedHeight;return showMoreItems?.forEach(item=>item.classList.remove(this.#disabledClass)),{startHeight,endHeight:showMoreContent.scrollHeight}};#collapse=()=>{const{showMoreContent}=this.refs,startHeight=showMoreContent.offsetHeight,endHeight=this.#collapsedHeight;return{startHeight,endHeight}};#animateHeight=(startHeight,endHeight)=>{const{showMoreContent}=this.refs;showMoreContent.style.overflow="hidden",this.#animation?.cancel(),this.#animation=showMoreContent.animate({height:[`${startHeight}px`,`${endHeight}px`]},{duration:this.#animationSpeed,easing:"ease-in-out"}),this.#animation.onfinish=()=>this.#onAnimationFinish()};#onAnimationFinish(){const{showMoreContent,showMoreItems}=this.refs;this.#expanded&&showMoreItems.forEach(item=>item.classList.add(this.#disabledClass)),showMoreContent.style.removeProperty("height"),showMoreContent.style.overflow="",this.#expanded=!this.#expanded}toggle=event=>{event.preventDefault(),this.toggleOpen({willOpen:!this.#expanded})};toggleOpen(settings){const{willOpen}=settings;if(this.#updateBreakpointState(),this.#currentBreakpoint==="DESKTOP"&&this.#disableOnDesktop)return;const{startHeight,endHeight}=willOpen?this.#expand():this.#collapse();this.dataset.expanded=willOpen?"true":"false",this.refs.showMoreButton.setAttribute("aria-expanded",this.dataset.expanded),this.#animateHeight(startHeight,endHeight)}}customElements.get("show-more-component")||customElements.define("show-more-component",ShowMoreComponent);class HighlightText extends HTMLElement{constructor(){super(),this.hasAnimated=!1}connectedCallback(){this.#bindInView()}#bindInView(){inView(this,async()=>{this.hasAnimated||(this.hasAnimated=!0,await this.#enter())},{rootMargin:"0px 0px -50px 0px"})}#enter(){this.classList.add("animate")}}customElements.get("highlight-text")||customElements.define("highlight-text",HighlightText,{extends:"em"});class ReadMore extends Component{requiredRefs=["readMoreButton","readMoreButtonText","readMoreContent"];constructor(){super(),this.classes={isDisabled:"is-disabled",isCollapsed:"is-collapsed"},this.toggleClass=this.dataset.toggleClass,this.showText=this.dataset.showText,this.hideText=this.dataset.hideText,this.lineClamp=parseInt(this.dataset.lineClamp)}connectedCallback(){super.connectedCallback(),this.init()}init(){const{readMoreButton:button,readMoreContent:content}=this.refs,lineHeight=parseFloat(window.getComputedStyle(content).lineHeight),contentHeight=content.scrollHeight,maxHeight=lineHeight*this.lineClamp;if(contentHeight<=maxHeight){button.style.display="none";return}this.classList.remove(this.classes.isDisabled),content.classList.remove(this.toggleClass),this.showLess()}showMore(){const{readMoreContent:content,readMoreButtonText:buttonText}=this.refs;this.classList.remove(this.classes.isCollapsed),content.classList.remove(this.toggleClass),buttonText.textContent=this.hideText,this.resetHeight()}showLess(){const{readMoreContent:content,readMoreButtonText:buttonText}=this.refs;this.classList.add(this.classes.isCollapsed),content.classList.add(this.toggleClass),buttonText.textContent=this.showText,this.setHeight()}setHeight(){const{readMoreContent:content}=this.refs,contentStyle=window.getComputedStyle(content),lineHeight=parseFloat(contentStyle.lineHeight),lines=parseInt(contentStyle.getPropertyValue("--line-clamp")),maxHeight=lineHeight*lines;content.style.setProperty("max-height",maxHeight+"px")}resetHeight(){const{readMoreContent:content}=this.refs;content.style.removeProperty("max-height")}onToggleClick(event){event.preventDefault();const{readMoreContent:content}=this.refs;content.classList.contains(this.toggleClass)?this.showMore():this.showLess()}}customElements.get("read-more")||customElements.define("read-more",ReadMore);class SwipeComponent extends HTMLDivElement{#abortController=null;#resizer=null;#mutationObserver=null;#previousActiveElement=null;#isActive=!1;constructor(){super(),this.swipeEl=null,this.swipeInner=null,this.scrollHandler=this.updateScrollClasses.bind(this),this.classes={active:"is--active",begin:"is--beginning",end:"is--end"}}connectedCallback(){this.swipeEl=this.querySelector(".swipe__element"),this.swipeEl&&(this.swipeInner=this.swipeEl.querySelector(".swipe__inner"),this.#abortController=new AbortController,this.init(),this.swipeEl.addEventListener("scroll",this.scrollHandler,{passive:!0,signal:this.#abortController.signal}),this.swipeEl.offsetParent!==null&&this.updateScrollClasses(),this.#resizer=new ResizeNotifier(()=>{this.swipeEl.offsetParent!==null&&this.updateScrollClasses()}),this.#resizer.observe(this.swipeEl),this.#isActive&&this.#startObservingActiveChanges())}disconnectedCallback(){this.#abortController?.abort(),this.#abortController=null,this.#resizer?.disconnect(),this.#resizer=null,this.#mutationObserver?.disconnect(),this.#mutationObserver=null}#startObservingActiveChanges(){if(!this.swipeInner||this.#mutationObserver)return;const observedAttributes=["aria-current","aria-selected"];this.#mutationObserver=new MutationObserver(mutations=>{for(const mutation of mutations){if(mutation.type==="attributes"){const target=mutation.target,attributeName=mutation.attributeName;observedAttributes.includes(attributeName)&&target.getAttribute(attributeName)==="true"&&this.#scrollToActiveElement(target)}if(mutation.type==="childList"&&mutation.addedNodes.length>0)for(const node of mutation.addedNodes)node.nodeType===Node.ELEMENT_NODE&&this.#mutationObserver.observe(node,{attributes:!0,attributeFilter:observedAttributes})}}),this.#mutationObserver.observe(this.swipeInner,{childList:!0});const children=Array.from(this.swipeInner.children);for(const child of children)this.#mutationObserver.observe(child,{attributes:!0,attributeFilter:observedAttributes})}#stopObservingActiveChanges(){this.#mutationObserver&&(this.#mutationObserver.disconnect(),this.#mutationObserver=null)}#scrollToActiveElement(activeElement){if(!this.swipeEl||!activeElement||!this.swipeInner||this.#previousActiveElement===activeElement)return;const scrollRect=activeElement.getBoundingClientRect(),boxRect=this.swipeEl.getBoundingClientRect(),scrollLeft=this.swipeEl.scrollLeft,containerGap=16,children=Array.from(this.swipeInner.children),currentIndex=children.indexOf(activeElement),previousIndex=this.#previousActiveElement?children.indexOf(this.#previousActiveElement):-1;let scrollOffset;previousIndex<currentIndex?scrollOffset=scrollRect.x+scrollLeft-boxRect.x-containerGap:scrollOffset=scrollRect.x+scrollLeft-boxRect.x-boxRect.width+scrollRect.width+containerGap,this.#previousActiveElement=activeElement,this.swipeEl.scrollTo({left:scrollOffset,behavior:"smooth"})}init(){if(this.swipeEl.classList.contains("swipe-all")){this.setActive(!0);return}const setupResponsive=(className,mediaQuery)=>{if(!this.swipeEl.classList.contains(className))return;const mql=window.matchMedia(mediaQuery),update=()=>this.setActive(mql.matches);
1update(),mql.addEventListener("change",update,{signal:this.#abortController.signal})};setupResponsive("swipe-mobile",mediaBreakpointMobile),setupResponsive("swipe-tablet",mediaBreakpointTablet)}setActive(isActive=!0){this.#isActive=isActive,this.classList.toggle(this.classes.active,isActive),isActive?this.#startObservingActiveChanges():this.#stopObservingActiveChanges()}updateScrollClasses(){const scrollLeft=this.swipeEl.scrollLeft,clientWidth=this.swipeEl.clientWidth,scrollWidth=this.swipeEl.scrollWidth,atStart=scrollLeft<=0,atEnd=Math.ceil(scrollLeft+clientWidth)>=scrollWidth;this._wasAtStart!==atStart&&(this._wasAtStart=atStart,this.classList.toggle(this.classes.begin,atStart)),this._wasAtEnd!==atEnd&&(this._wasAtEnd=atEnd,this.classList.toggle(this.classes.end,atEnd))}}customElements.define("swipe-component",SwipeComponent,{extends:"div"});export class NewsletterForm extends Component{constructor(){super()}connectedCallback(){super.connectedCallback(),this.init()}init(){const{input,messageDialog}=this.refs,messageDialogRefs=messageDialog?.refs??{},{alert:alert2,messageErrorSubscribed}=messageDialogRefs,isSubscribed=window.location.href.includes("form_type=customer")&&input.value.length!=0;isSubscribed&&messageErrorSubscribed&&!alert2&&messageErrorSubscribed.classList.remove("hidden"),(isSubscribed||alert2)&&(window.isMessageDialogShow||(messageDialog&&messageDialog.showDialog(),window.isMessageDialogShow=!0))}}customElements.get("newsletter-form")||customElements.define("newsletter-form",NewsletterForm);class SlideshowComponent extends CarouselComponent{#resizeObserver;#lastSyncedMediaIndex=null;constructor(){super(),this.selectedIndex=this.selectedIndex}get sectionId(){return this.getAttribute("data-section-id")}get controlType(){return this.getAttribute("data-control-type")}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",`${index}`)}connectedCallback(){super.connectedCallback(),this.swiperInstance?this.#initAfterSwiperReady():this.addEventListener("carousel:ready",()=>{this.#initAfterSwiperReady()},{once:!0})}#initAfterSwiperReady(){this.#init();const activeSlide=this.refs.slides?.[0]??this.swiperInstance?.slides?.[this.swiperInstance.activeIndex];activeSlide&&this.#updateControlsScheme(activeSlide),this.refs.controls&&(this.#resizeObserver?.disconnect(),this.#resizeObserver=new ResizeObserver(()=>this.#updateControlHeight()),this.#resizeObserver.observe(this.refs.controls))}updatedCallback(){if(this.addEventListener("carousel:ready",()=>this.#initAfterSwiperReady(),{once:!0}),super.updatedCallback?.(),this.swiperInstance&&this.refs.controls){this.#resizeObserver?.disconnect(),this.#resizeObserver=new ResizeObserver(()=>this.#updateControlHeight()),this.#resizeObserver.observe(this.refs.controls);const activeSlide=this.refs.slides?.[0]??this.swiperInstance?.slides?.[this.swiperInstance.activeIndex];activeSlide&&this.#updateControlsScheme(activeSlide)}}disconnectedCallback(){this.#resizeObserver?.disconnect(),this.#detachSwiperMediaListeners(),super.disconnectedCallback()}#detachSwiperMediaListeners(){const swiper=this.swiperInstance;!swiper||swiper.destroyed||(swiper.off("realIndexChange",this.#handleChange),swiper.off("slideChangeTransitionEnd",this.#handleSlideTransitionEnd))}#pauseSlideMedia(index){this.querySelectorAll(`[data-swiper-slide-index="${index}
1"]`).forEach(slide=>{slide.querySelector("deferred-media")?.pauseMedia()})}#playActiveSlideMedia(){const swiper=this.swiperInstance;if(!swiper||swiper.destroyed)return;const activeSlide=swiper.slides[swiper.activeIndex];if(!activeSlide)return;const deferredMedia=activeSlide.querySelector("deferred-media");deferredMedia&&deferredMedia.playMedia(),document.body.hasAttribute("data-motion-disabled")||activeSlide.querySelectorAll("motion-component").forEach(el=>{el.replay()})}#init(){if(typeof this.swiperInstance!="object")return;const{slides,activeIndex}=this.swiperInstance,runMotionReplay=()=>{slides[activeIndex]&&slides[activeIndex].querySelectorAll("motion-component[data-motion-hold]")?.forEach(el=>el.replay())},PAGE_TRANSITION_DURATION_MS=500,MOTION_OVERLAP_MS=200;if(document.body.classList.contains("page-transitions-enabled")){const pageTransition=document.querySelector("page-transition");if(pageTransition&&!pageTransition.hidden){const startDelay=Math.max(0,PAGE_TRANSITION_DURATION_MS-MOTION_OVERLAP_MS);let done=!1;const runOnce=()=>{done||(done=!0,runMotionReplay())};document.addEventListener(ThemeEvents.pageTransitionEnd,runOnce,{once:!0}),setTimeout(runOnce,startDelay)}else runMotionReplay()}else runMotionReplay();this.#detachSwiperMediaListeners(),this.#lastSyncedMediaIndex=this.swiperInstance.realIndex,this.swiperInstance.on("realIndexChange",this.#handleChange),this.swiperInstance.on("slideChangeTransitionEnd",this.#handleSlideTransitionEnd)}#handleChange=swiper=>{const{slides,realIndex,activeIndex}=swiper,previousIndex=this.#lastSyncedMediaIndex??this.selectedIndex;previousIndex!==realIndex&&this.#pauseSlideMedia(previousIndex),this.selectedIndex=realIndex,this.#lastSyncedMediaIndex=realIndex,this.#updateControlsScheme(slides[activeIndex])};#handleSlideTransitionEnd=()=>{this.#playActiveSlideMedia()};#updateControlsScheme(activeSlide){if(!this.refs.controls||!activeSlide)return;Array.from(this.refs.controls.classList).filter(className=>className.startsWith("color-")).forEach(className=>this.refs.controls.classList.remove(className));const colorScheme=activeSlide.dataset?.colorScheme;colorScheme&&this.refs.controls.classList.add(colorScheme)}#updateControlHeight(){const height=this.refs.controls.offsetHeight;this.style.setProperty("--control-height",`${height}px`)}}customElements.get("slideshow-component")||customElements.define("slideshow-component",SlideshowComponent);class CollectionHighlight extends Component{#shopifyAbortController;connectedCallback(){super.connectedCallback(),this.#registerDesignModeEvents()}disconnectedCallback(){this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,super.disconnectedCallback()}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;document.addEventListener("shopify:block:select",e=>{if(e.detail.sectionId!=this.sectionId)return;const titleEl=this.getBlockEl(e),index=Number(titleEl.dataset.index);this.setActiveTab(index)},{signal})}get sectionId(){const{sectionId}=this.dataset;if(!sectionId)throw new Error("Section id missing");return sectionId}isActive(el){return el.getAttribute("aria-current")==="true"}getBlockEl(event){const{target}=event;return target.closest(".collection-highlight__part")}getTitleEl(event){const{target}=event;return target.closest(".collection-highlight__part-title")}handleNavigationKeys(event){const{key}=event,{titles}=this.refs;if(!titles?.length)return;const titleEl=this.getTitleEl(event);if(!titleEl)return;const currentIndex=titles.indexOf(titleEl);if(currentIndex===-1)return;if(key==="Enter"||key===" "){const linkUrl=titleEl.dataset.linkUrl;linkUrl&&(event.preventDefault(),window.location.href=linkUrl);return}let nextIndex=currentIndex;switch(key){case"ArrowDown":nextIndex=currentIndex+1;break;case"ArrowUp":nextIndex=currentIndex-1;break;case"Home":nextIndex=0;break;case"End":nextIndex=titles.length-1;break;default:return}nextIndex=Math.max(0,Math.min(nextIndex,titles.length-1)),nextIndex!==currentIndex&&(event.preventDefault(),titles[nextIndex]?.focus())}}class CollectionHighlightWithImageCard extends CollectionHighlight{#abortController=new AbortController;#hoverTracker=null;#preventClick=!1;#initialPreviewHeight=!1;#currentActiveIndex=0;connectedCallback(){super.connectedCallback();const{titles,preview}=this.refs,{signal}=this.#abortController;titles&&(requestAnimationFrame(()=>{this.setActiveTab(0),requestAnimationFrame(()=>{this.isConnected&&this.setPreviewHeight()})}),this.onTouchChangeHandler=this.onTouchChange.bind(this),this.onClickHandler=this.onClick.bind(this),this.onKeydownHandler=this.handleNavigationKeys.bind(this),this.onMouseOverHandler=this.onMouseOver.bind(this),this.textsWrapMouseOverHandler=this.#onTextsWrapMouseOver.bind(this),"ontouchstart"in window?titles.forEac
1h(item=>{item.addEventListener("touchstart",this.onTouchChangeHandler,{signal,passive:!0}),item.addEventListener("click",this.onClickHandler,{signal})}):(titles.forEach(item=>{item.addEventListener("mouseover",this.onMouseOverHandler,{signal}),item.addEventListener("focus",this.onMouseOverHandler,{signal})}),this.addEventListener("keydown",this.onKeydownHandler,{signal}),preview.addEventListener("mouseover",this.textsWrapMouseOverHandler,{signal})),window.matchMedia(mediaBreakpointMobile).addEventListener("change",()=>this.updatePreviewHeight(),{signal}))}disconnectedCallback(){this.#abortController.abort(),super.disconnectedCallback()}setPreviewHeight(targetText=null){const{preview,texts}=this.refs;if(preview&&texts.length>0){const source=targetText||texts[0];if(!source)return;preview.style.setProperty("height",`${Math.ceil(source.getBoundingClientRect().height)}px`)}}updatePreviewHeight(){const{preview,texts}=this.refs;!preview||!texts||texts.length===0||requestAnimationFrame(()=>{let maxHeight=0;texts.forEach(el=>{maxHeight=Math.max(maxHeight,el.offsetHeight)}),preview.style.setProperty("height",maxHeight+"px"),this.#initialPreviewHeight=!0})}setActiveTab(newIndex){const{titles,images,texts}=this.refs,newTitle=titles[newIndex],newImage=images[newIndex],newText=texts[newIndex];this.#currentActiveIndex=newIndex,texts.forEach(el=>
1el.classList.toggle("is-active",el===newText)),titles.forEach(el=>{const index=Number(el.dataset.index);el.setAttribute("aria-current",el===newTitle),el.setAttribute("tabindex",index==newIndex?"0":"-1")}),images.forEach(el=>{el.classList.toggle("is-active",el===newImage)})}onMouseOver(event){this.#initialPreviewHeight||this.updatePreviewHeight();const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);if(event.type==="mouseover")clearTimeout(this.#hoverTracker),this.#hoverTracker=setTimeout(()=>{this.isActive(titleEl)||this.setActiveTab(index)},100);else{if(this.isActive(titleEl))return;this.setActiveTab(index)}}onTouchChange(event){const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);if(this.isActive(titleEl)){this.#preventClick=!1;return}else this.#preventClick=!0;this.setActiveTab(index)}onClick(event){this.#preventClick&&event.preventDefault()}#onTextsWrapMouseOver(){clearTimeout(this.#hoverTracker)}}customElements.get("collection-highlight-with-image-card")||customElements.define("collection-highlight-with-image-card",CollectionHighlightWithImageCard);class CollectionsWithBackground extends CollectionHighlight{#abortController=new AbortController;#hoverTracker=null;#preventClick=!1;connectedCallback(){super.connectedCallback();const{titles,descriptionsWrap}=this.refs,{signal}=this.#abortController;titles&&(requestAnimationFrame(()=>{this.setActiveTab(0)}),this.onTouchChangeHandler=this.onTouchChange.bind(this),this.onClickHandler=this.onClick.bind(this),this.onKeydownHandler=this.handleNavigationKeys.bind(this),this.onMouseOverHandler=this.onMouseOver.bind(this),this.textsWrapMouseOverHandler=this.#onTextsWrapMouseOver.bind(this),"ontouchstart"in window?titles.forEac
1h(item=>{item.addEventListener("touchstart",this.onTouchChangeHandler,{signal,passive:!0}),item.addEventListener("click",this.onClickHandler,{signal})}):titles.forEach(item=>{item.addEventListener("mouseover",this.onMouseOverHandler,{signal}),item.addEventListener("focus",this.onMouseOverHandler,{signal})}),this.addEventListener("keydown",this.onKeydownHandler,{signal}),descriptionsWrap.addEventListener("mouseover",this.textsWrapMouseOverHandler,{signal}),mediaQueryMobile.addEventListener("change",this.#updatePreviewHeight.bind(this)))}disconnectedCallback(){this.#abortController.abort(),super.disconnectedCallback()}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",`${index}`)}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const{images}=this.refs;if(!images)return;const activeImage=images[newValue];if(activeImage&&!document.body.hasAttribute("data-motion-disabled")){const motionEls=activeImage.querySelectorAll("motion-component");motionEls&&motionEls.forEach(el=>{el.replay()})}}}#updateControlsScheme(){const{container,titles}=this.refs,activeTitle=titles[this.selectedIndex];Array.from(container.classList).filter(className=>className.startsWith("color-")).forEach(className=>container.classList.remove(className));const colorScheme=activeTitle.dataset.colorScheme;colorScheme&&container.classList.add(colorScheme)}#updatePreviewHeight(){const{descriptionsWrap,descriptions,productsWrap,products}=this.refs;requestAnimationFrame(()=>{descriptionsWrap&&descriptions.length>0&&descriptionsWrap.style.setProperty("height",descriptions[this.selectedIndex].offsetHeight+"px"),productsWrap&&products.length>0&&productsWrap.style.setProperty("height",products[this.selectedIndex].offsetHeight+"px")})}setActiveTab(newIndex){const{titles,descriptions,images,products}=this.refs,newTitle=titles[newIndex],newDescription=descriptions[newIndex],newImage=images[newIndex],newProduct=products[newIndex];this.selectedIndex=newIndex,this.#updatePreviewHeight(),this.#updateControlsScheme(),titles.forEac
1h(el=>{el.setAttribute("aria-current",el===newTitle),el.setAttribute("tabindex",el===newTitle?"0":"-1");const hlText=el.querySelector("em");hlText&&hlText.classList.toggle("animate",el===newTitle)}),images.forEach(el=>el.classList.toggle("is-active",el===newImage)),products.forEach(el=>el.classList.toggle("is-active",el===newProduct)),descriptions.forEach(el=>el.classList.toggle("is-active",el===newDescription))}onMouseOver(event){const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);clearTimeout(this.#hoverTracker),this.#hoverTracker=setTimeout(()=>{this.isActive(titleEl)||this.setActiveTab(index)},100)}onTouchChange(event){const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);if(this.isActive(titleEl)){this.#preventClick=!1;return}else this.#preventClick=!0;this.setActiveTab(index)}onClick(event){this.#preventClick&&event.preventDefault()}#onTextsWrapMouseOver(){clearTimeout(this.#hoverTracker)}}customElements.get("collections-with-background")||customElements.define("collections-with-background",CollectionsWithBackground);class CollectionsWithImage extends CollectionHighlight{#abortController=new AbortController;#hoverTracker=null;#preventClick=!1;#initialPreviewHeight=!1;connectedCallback(){super.connectedCallback();const{titles}=this.refs,{signal}=this.#abortController;titles&&(requestAnimationFrame(()=>{this.setActiveTab(0),requestAnimationFrame(()=>{this.isConnected&&this.setPreviewHeight()})}),this.onTouchChangeHandler=this.onTouchChange.bind(this),this.onClickHandler=this.onClick.bind(this),this.onKeydownHandler=this.handleNavigationKeys.bind(this),this.onMouseOverHandler=this.onMouseOver.bind(this),"ontouchstart"in window?titles.forEac
1h(item=>{item.addEventListener("touchstart",this.onTouchChangeHandler,{signal,passive:!0}),item.addEventListener("click",this.onClickHandler,{signal})}):titles.forEach(item=>{item.addEventListener("mouseover",this.onMouseOverHandler,{signal}),item.addEventListener("focus",this.onMouseOverHandler,{signal})}),this.addEventListener("keydown",this.onKeydownHandler,{signal}),window.matchMedia(mediaBreakpointMobile).addEventListener("change",()=>this.updatePreviewHeight(),{signal}))}disconnectedCallback(){this.#abortController.abort(),super.disconnectedCallback()}setupPreview(){const{titles,preview}=this.refs;titles.forEach(item=>{const templateEl=item.querySelector("template");if(templateEl){const titlePreview=templateEl.content.firstElementChild.cloneNode(!0);preview.append(titlePreview)}}),this.updatePreviewHeight()}setPreviewHeight(targetProduct=null){const{preview,products}=this.refs;if(preview&&products.length>0){const source=targetProduct||products[0];if(!source)return;preview.style.setProperty("height",`${Math.ceil(source.getBoundingClientRect().height)}px`)}}updatePreviewHeight(){const{preview,products}=this.refs;!preview||!products||products.length===0||requestAnimationFrame(()=>{let maxHeight=0;products.forEach(el=>{maxHeight=Math.max(maxHeight,el.offsetHeight)}),preview.style.setProperty("height",maxHeight+"px"),this.#initialPreviewHeight=!0})}setActiveTab(newIndex){const{titles,images,products}=this.refs,newTitle=titles[newIndex],newImage=images[newIndex],newProduct=products[newIndex];
1titles.forEach(el=>{el.setAttribute("aria-current",el===newTitle),el.setAttribute("tabindex",el===newTitle?"0":"-1");const hlText=el.querySelector("em");hlText&&hlText.classList.toggle("animate",el===newTitle)}),images.forEach(el=>el.classList.toggle("is-active",el===newImage)),products.forEach(el=>el.classList.toggle("is-active",el===newProduct))}onMouseOver(event){this.#initialPreviewHeight||this.updatePreviewHeight();const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);clearTimeout(this.#hoverTracker),this.#hoverTracker=setTimeout(()=>{this.isActive(titleEl)||this.setActiveTab(index)},100)}onTouchChange(event){const titleEl=this.getTitleEl(event),index=Number(titleEl.dataset.index);if(this.isActive(titleEl)){this.#preventClick=!1;return}else this.#preventClick=!0;this.setActiveTab(index)}onClick(event){this.#preventClick&&event.preventDefault()}}customElements.get("collections-with-image")||customElements.define("collections-with-image",CollectionsWithImage);class CollectionHighlightScrolling extends Component{requiredRefs=["spacer","container","imagesWrap","titlesContainer","titlesWrap","wrapper","sectionContainer"];#lenis=null;#headerHeight=0;#offsetHeight=0;#visualHeight=0;#offsetTop=0;#stickySpacing=30;#isInViewport=!1;#cachedStartPoint=null;#cachedEndPoint=null;#cachedScrollRange=null;#cachedViewportHeight=0;#imagesWrapMaxTranslateY=0;#titlesWrapMaxTranslateY=0;#desktopScrollHandler=null;#rafId=null;#intersectionObserver=null;#resizeObserver=null;#mediaQueryChangeHandler=null;#shopifyAbortController=null;#initObserver=null;#initialApplied=!1;static#INIT_OBSERVER_MARGIN="300px 0px";get sectionId(){return this.dataset.sectionId??""}connectedCallback(){super.connectedCallback(),this.#mediaQueryChangeHandler=()=>{this.#initialApplied=!0,this.#applyBreakpointLayout()},mediaQueryMobile.addEventListener("change",this.#mediaQueryChangeHandler),this.#registerDesignModeEvents(),this.#scheduleInitialApply()}#scheduleInitialApply(){this.#initialApplied||(typeof IntersectionObserver<"u"?(this.#initObserver=new IntersectionObserver(entries=>{entries[0]?.isIntersecting&&(this.#initObserver?.disconnect(),this.#initObserver=null,this.#initialApplied=!0,this.#applyBreakpointLayout())},{rootMargin:CollectionHighlightScrolling.#INIT_OBSERVER_MARGIN}),this.#initObserver.observe(this)):(this.#initialApplied=!0,this.#applyBreakpointLayout()))}#isDesktop(){return!mediaQueryMobile.matches}#applyBreakpointLayout(){this.#isDesktop()?(this.#setupIntersectionObserver(),this.#setupResizeObserver(),this.#setupSpacer(),this.#desktopScrollHandler||(this.#lenis=getLenis(),this.#desktopScrollHandler=()=>{this.#isInViewport&&(this.#rafId&&cancelAnimationFrame(this.#rafId),this.#rafId=requestAnimationFrame(()=>{this.#updateScrollTransform(),this.#rafId=null}))}),this.#addScrollListener(),requestAnimationFrame(()=>this.#updateScrollTransform())):(this.#removeScrollListener(),this.#cleanUpObservers(),this.#cleanUpSticky())}#addScrollListener(){this.#desktopScrollHandler&&(this.#lenis=getLenis(),this.#lenis?this.#lenis.on("scroll",this.#desktopScrollHandler):window.addEventListener("scroll",this.#desktopScrollHandler,{passive:!0}))}#removeScrollListener(){this.#desktopScrollHandler&&(this.#lenis?this.#lenis.off("scroll",this.#desktopScrollHandler):window.removeEventListener("scroll",this.#desktopScrollHandler,{passive:!0}))}#cleanUpSticky(){const{spacer,container,imagesWrap,titlesWrap}=this.refs;container&&(container.style.removeProperty("position"),container.style.removeProperty("top"),container.style.removeProperty("height")),spacer&&(spacer.style.height="0"),this.style.removeProperty("--container-height"),imagesWrap&&(imagesWrap.style.transform="translateY(0)"),titlesWrap&&(titlesWrap.style.transform="translateY(0)"),this.#setScrollStateClasses(0),this.#setActiveTitleByIndex(0),this.#invalidateCache()}#cleanUpObservers(){this.#intersectionObserver?.disconnect(),this.#intersectionObserver=null,this.#resizeObserver?.disconnect(),this.#resizeObserver=null}#setupIntersectionObserver(){if(this.#intersectionObserver)return;const{container}=this.refs;if(!container)return;const options={root:null,rootMargin:"0px",threshold:0};this.#intersectionObserver=new IntersectionObserver(entries=>
1{for(const entry of entries)this.#isInViewport=entry.isIntersecting,this.#isInViewport&&requestAnimationFrame(()=>this.#updateScrollTransform())},options),this.#intersectionObserver.observe(container)}#setupResizeObserver(){this.#resizeObserver||(this.#resizeObserver=new ResizeNotifier(()=>{this.#invalidateCache(),this.#setupSpacer(),requestAnimationFrame(()=>this.#updateScrollTransform())}),this.#resizeObserver.observe(this))}#invalidateCache(){this.#cachedStartPoint=null}#setupSpacer(){if(!this.#isDesktop()){this.#cleanUpSticky();return}const{spacer,container}=this.refs;!spacer||!container||requestAnimationFrame(()=>{this.#isDesktop()&&(container.style.removeProperty("position"),container.style.removeProperty("top"),container.style.removeProperty("height"),this.#headerHeight=document.querySelector(".header")?.offsetHeight||0,this.#offsetHeight=container.offsetHeight,this.#cachedViewportHeight=window.innerHeight,this.#visualHeight=this.#cachedViewportHeight-this.#headerHeight-this.#stickySpacing*2,this.#offsetTop=this.#headerHeight+this.#stickySpacing,spacer.style.height=`${this.#offsetHeight}px`,this.style.setProperty("--container-height",`${this.#visualHeight}px`),container.style.setProperty("position","sticky"),container.style.setProperty("top",`${this.#offsetTop}px`),container.style.setProperty("height",`${this.#visualHeight}px`))})}#updateScrollTransform(){if(!this.#isDesktop()){this.#cleanUpSticky();return}const{imagesWrap,titlesWrap,titlesContainer,wrapper,container,sectionContainer}=this.refs;if(!imagesWrap||!titlesWrap||!titlesContainer||!container)return;const scrollTop=this.#lenis?this.#lenis.scroll:window.pageYOffset??document.documentElement.scrollTop,isSticky=scrollTop>=(this.#cachedStartPoint??0);if(prefersReducedMotion()||!isSticky){this._lastImgY!==0&&(this._lastImgY=0,imagesWrap.style.transform="translateY(0)"),this._lastTitY!==0&&(this._lastTitY=0,titlesWrap.style.transform="translateY(0)"),this.#setScrollStateClasses(0),this.#setActiveTitleByIndex(0);return}const viewportHeight=this.#cachedViewportHeight||window.innerHeight;if(this.#cachedStartPoint===null){const rect=(sectionContainer??this).getBoundingClientRect(),sectionTop=rect.top+scrollTop,sectionBottom=sectionTop+rect.height;if(this.#cachedStartPoint=sectionTop,this.#cachedEndPoint=sectionBottom-viewportHeight,this.#cachedScrollRange=this.#cachedEndPoint-this.#cachedStartPoint,wrapper&&this.#cachedScrollRange>0){const wrapperStyle=getComputedStyle(wrapper),paddingTop=parseFloat(wrapperStyle.paddingTop),paddingBottom=parseFloat(wrapperStyle.paddingBottom),paddingBlock=paddingTop+paddingBottom,wrapContentHeight=wrapper.clientHeight-paddingBlock,wrapperRect=wrapper.getBoundingClientRect(),wrapperContentTop=wrapperRect.top+paddingTop,wrapperContentBottom=wrapperRect.bottom-paddingBottom,titlesContainerRect=titlesContainer.getBoundingClientRect(),titlesVisibleHeight=Math.max(0,Math.min(titlesContainerRect.bottom,wrapperContentBottom)-Math.max(titlesContainerRect.top,wrapperContentTop)),imagesHeight=imagesWrap.scrollHeight,titlesHeight=titlesWrap.scrollHeight;this.#imagesWrapMaxTranslateY=-Math.max(0,imagesHeight-wrapContentHeight),this.#titlesWrapMaxTranslateY=-Math.max(0,titlesHeight-titlesVisibleHeight)}}if(this.#cachedScrollRange<=0){this._lastImgY!==0&&(this._lastImgY=0,imagesWrap.style.transform="translateY(0)"),this._lastTitY!==0&&(this._lastTitY=0,titlesWrap.style.transform="translateY(0)"),this.#setScrollStateClasses(0),this.#setActiveTitleByIndex(0);return}const progress=Math.max(0,Math.min(1,(scrollTop-this.#cachedStartPoint)/this.#cachedScrollRange)),imgY=Math.round(this.#imagesWrapMaxTranslateY*progress*10)/10,titY=Math.round(this.#titlesWrapMaxTranslateY*progress*10)/10;this._lastImgY!==imgY&&(this._lastImgY=imgY,imagesWrap.style.transform=`translateY(${imgY}px)`),this._lastTitY!==titY&&(this._lastTitY=titY,titlesWrap.style.transform=`translateY(${titY}px)`),this.#setScrollStateClasses(progress);const imgCount=Array.isArray(this.refs.images)?this.refs.images.length:0;if(imgCount>0){const activeIndex=Math.min(imgCount-1,Math.round(progress*(imgCount-1)));this.#setActiveTitleByIndex(activeIndex)}}#setScrollStateClasses(progress){const atBeginning=progress<=0,atEnd=progress>=1;this._wasBeginning!==atBeginning&&(this._wasBeginning=atBeginning,this.classList.toggle("is--beginning",atBeginning)),this._wasEnd!==atEnd&&(this._wasEnd=atEnd,this.classList.toggle("is--end",atEnd))}#setActiveTitleByIndex(activeIndex){const{titles}=this.refs;if(!Array.isArray(titles)||titles.length===0)return;const count=titles.length,index=Math.min(count-1,Math.max(0,activeIndex));if(this._lastActiveIndex===index)return;const prev=this._lastActiveIndex;prev!=null&&prev>=0&&prev<count&&(titles[prev].setAttribute("aria-current","false"),titles[prev].querySelector("em")?.classList.toggle("animate",!1)),titles[index].setAttribute("aria-current","true"),titles[index].querySelector("em")?.classList.toggle("animate",!0),this._lastActiveIndex=index}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;document.addEventListener("shopify:block:select",e=>{if(String(e.detail?.sectionId)!==String(this.sectionId))return;const indexRaw=e.target?.closest(".collection-highlight__part")?.dataset?.index,index=parseInt(indexRaw,10);Number.isNaN(index)||index<0||this.#onBlockSelect(index)},{signal})}#onBlockSelect(index){if(this.#setActiveTitleByIndex(index),!this.#isDesktop()){const{images:images2}=this.refs;(Array.isArray(images2)&&images2[index]?images2[index]:null)?.scrollIntoView({behavior:"smooth",block:"center"});return}const{sectionContainer,images}=this.refs,count=Array.isArray(images)?images.length:0;if(count===0)return;const rect=(sectionContainer??this).getBoundingClientRect(),scrollTop=this.#lenis?this.#lenis.scroll:window.pageYOffset??document.documentElement.scrollTop,viewportHe
1ight=window.innerHeight,sectionTop=rect.top+scrollTop,sectionHeight=rect.height,scrollRange=Math.max(0,sectionHeight-viewportHeight),progress=count>1?Math.min(1,Math.max(0,index/(count-1))):0,targetScroll=sectionTop+progress*scrollRange;this.#lenis?this.#lenis.scrollTo(targetScroll,{immediate:!1}):window.scrollTo({top:targetScroll,behavior:"smooth"}),this.#invalidateCache(),requestAnimationFrame(()=>this.#updateScrollTransform())}disconnectedCallback(){this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,mediaQueryMobile.removeEventListener("change",this.#mediaQueryChangeHandler),this.#rafId&&cancelAnimationFrame(this.#rafId),this.#initObserver?.disconnect(),this.#initObserver=null,this.#removeScrollListener(),this.#cleanUpObservers(),super.disconnectedCallback()}}customElements.get("collection-highlight-scrolling")||customElements.define("collection-highlight-scrolling",CollectionHighlightScrolling);class FeaturedCollection extends Component{connectedCallback(){super.connectedCallback();const{slider}=this.refs;slider&&(slider.swiperInstance?this.#initSliderNavigation():slider.addEventListener("carousel:ready",()=>{this.#initSliderNavigation()},{once:!0}))}updatedCallback(){super.updatedCallback?.();const{slider}=this.refs;slider&&slider.addEventListener("carousel:ready",()=>this.#initSliderNavigation(),{once:!0})}#initSliderNavigation(){const{slider,controls,next,prev}=this.refs;controls.classList.remove("hidden"),slider.swiperInstance.params.navigation.nextEl=next,slider.swiperInstance.params.navigation.prevEl=prev,slider.swiperInstance.navigation.init(),slider.swiperInstance.navigation.update()}}customElements.get("featured-collection")||customElements.define("featured-collection",FeaturedCollection);class LocalPickup extends Component{#activeFetch;connectedCallback(){super.connectedCallback();const closestSection=this.closest(".shopify-section, dialog"),variantUpdated=event=>{event.detail.data.newProduct&&(this.dataset.productUrl=event.detail.data.newProduct.url);const variantId=event.detail.resource?event.detail.resource.id:null,variantAvailable=event.detail.resource?event.detail.resource.available:null;variantId!==this.dataset.variantId&&(variantId&&variantAvailable?(this.classList.remove("hidden"),this.dataset.variantId=variantId,this.#fetchAvailability(variantId)):this.classList.add("hidden"))};closestSection?.addEventListener(ThemeEvents.variantUpdate,variantUpdated),this.disconnectedCallback=()=>{closestSection?.removeEventListener(ThemeEvents.variantUpdate,variantUpdated)}}#createAbortController(){return this.#activeFetch&&this.#activeFetch.abort(),this.#activeFetch=new AbortController,this.#activeFetch}#fetchAvailability=variantId=>{if(!variantId)return;const abortController=this.#createAbortController(),url=this.dataset.productUrl;fetch(`${url}?variant=${variantId}§ion_id=${this.dataset.sectionId}`,{signal:abortController.signal}).then(response=>response.text()).then(text=>{if(abortController.signal.aborted)return;const wrapper=new DOMParser().parseFromString(text,"text/html").querySelector(`local-pickup[data-variant-id="${variantId}"]`);wrapper?(this.classList.remove("hidden"),morph(this,wrapper)):this.classList.add("hidden")}).catch(_e=>{abortController.signal.aborted||this.classList.add("hidden")})}}customElements.get("local-pickup")||customElements.define("local-pickup",LocalPickup);class ScrollingCards extends Component{#shopifyAbortController;constructor(){super(),this.desktopScrollHandler=null,this.resizeHandler=null,this.rafId=null,this.resizeTimeout=null,this.lenis=null,this.intersectionObserver=null,this.resizeObserver=null,this.isInViewport=!1,this.cachedStartPoint=null,this.cachedEndPoint=null,this.cachedScrollRange=null,this.needsRecalculation=!0,this.cachedViewportHeight=null}connectedCallback(){super.connectedCallback(),this.scrollHandler=this.animateHeadings.bind(this);const updateLayout=isMobile=>{const{headingWrap,headings,scrollEl}=this.refs;if(!headings||!scrollEl)return;const firstTextEl=headings.querySelector(".text-block");if(!firstTextEl)return;const firstTextStyle=window.getComputedStyle(firstTextEl),lineHeight=parseFloat(firstTextStyle.lineHeight),contentHeight=headings.offsetHeight,doubleLineHeight=lineHeight*this.headingLinesToShow,wrapHeight=Math.min(doubleLineHeight,contentHeight);if(headingWrap.style.height=`${wrapHeight}px`,wrapHeight>=contentHeight){headings.style.transform="translate3d(0, 0, 0)",this.cleanup();return}this.headingsTranslateY=0-(contentHeight-wrapHeight),this.needsRecalculation=!0,this.cleanup(),isMobile?this.initMobileAnimation():this.initDesktopAnimation(),this.updateAnimationPosition()};requestAnimationFrame(()=>{updateLayout(mediaQueryMobile.matches)}),mediaQueryMobile.onchange=event=>{requestAnimationFrame(()=>{updateLayout(event.matches)})},this.setupResizeHandler(updateLayout,mediaQueryMobile),this.#registerDesignModeEvents(),this.boundFocusinHandler=this.#handleHeadingFocusin.bind(this),this.addEventListener("focusin",this.boundFocusinHandler)}setupResizeHandler(updateLayout,mqlMobile){this.cachedViewportHe
1ight=window.innerHeight,this.resizeHandler=()=>{this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.cachedViewportHeight=window.innerHeight,this.needsRecalculation=!0,requestAnimationFrame(()=>{updateLayout(mqlMobile.matches)})},150)},window.addEventListener("resize",this.resizeHandler,{passive:!0})}updateAnimationPosition(){const{headings,cards}=this.refs;if(!(!headings||!cards||cards.length===0))if(isMobileBreakpoint())this.animateHeadings();else{const firstColumn=cards[0],lastColumn=cards[cards.length-1];this.needsRecalculation=!0,this.updateDesktopAnimation(firstColumn,lastColumn,headings)}}get headingLinesToShow(){return 2}initDesktopAnimation(){const{headings,cards}=this.refs;if(!headings||!cards||cards.length===0)return;const firstColumn=cards[0],lastColumn=cards[cards.length-1];this.setupIntersectionObserver(firstColumn,lastColumn);const updateAnimation=()=>{this.isInViewport&&this.updateDesktopAnimation(firstColumn,lastColumn,headings)};this.lenis=getLenis(),this.lenis?(this.desktopScrollHandler=updateAnimation,this.lenis.on("scroll",this.desktopScrollHandler)):(this.desktopScrollHandler=()=>{if(this.isInViewport){if(!this.lenis){const retryLenis=getLenis();if(retryLenis){this.lenis=retryLenis,window.removeEventListener("scroll",this.desktopScrollHandler),this.desktopScrollHandler=updateAnimation,this.lenis.on("scroll",this.desktopScrollHandler);return}}this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{updateAnimation(),this.rafId=null})}},window.addEventListener("scroll",this.desktopScrollHandler,{passive:!0})),requestAnimationFrame(()=>{this.updateDesktopAnimation(firstColumn,lastColumn,headings)})}setupIntersectionObserver(firstColumn,lastColumn){const options={root:null,rootMargin:"50% 0px",threshold:0};this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{this.isInViewport=entry.isIntersecting,this.isInViewport&&(this.needsRecalculation=!0)})},options),this.intersectionObserver.observe(this);let resizeRafId=null;this.resizeObserver=new ResizeObserver(()=>{resizeRafId||(resizeRafId=requestAnimationFrame(()=>{this.needsRecalculation=!0,resizeRafId=null}))}),firstColumn&&this.resizeObserver.observe(firstColumn),lastColumn&&this.resizeObserver.observe(lastColumn)}updateDesktopAnimation(firstColumn,lastColumn,headings){if(!this.isInViewport)return;const scrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,viewportHeight=this.cachedViewportHeight||window.innerHeight;if(this.needsRecalculation||this.cachedStartPoint===null){const firstRect=firstColumn.getBoundingClientRect(),lastRect=lastColumn.getBoundingClientRect(),firstTop=firstRect.top+scrollTop,lastBottom=lastRect.bottom+scrollTop;this.cachedStartPoint=firstTop,this.cachedEndPoint=lastBottom-viewportHeight,this.cachedScrollRange=this.cachedEndPoint-this.cachedStartPoint,this.needsRecalculation=!1}if(this.cachedScrollRange<=0){this._lastHeadingY!==0&&(this._lastHeadingY=0,headings.style.transform="translate3d(0, 0, 0)");return}const progress=Math.max(0,Math.min(1,(scrollTop-this.cachedStartPoint)/this.cachedScrollRange)),y=Math.round(this.headingsTranslateY*progress*10)/10;this._lastHeadingY!==y&&(this._lastHeadingY=y,headings.style.transform=`translate3d(0, ${y}px, 0)`)}initMobileAnimation(){const{scrollEl}=this.refs;scrollEl&&(this._cachedMaxScroll=scrollEl.scrollWidth-scrollEl.clientWidth,scrollEl.addEventListener("scroll",this.scrollHandler,{passive:!0}))}cleanup(){this.desktopScrollHandler&&(this.lenis?this.lenis.off("scroll",this.desktopScrollHandler):window.removeEventListener("scroll",this.desktopScrollHandler),this.desktopScrollHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.resizeObserver&&(this.resizeObserver.disconnect(),this.resizeObserver=null),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.refs.scrollEl&&this.refs.scrollEl.removeEventListener("scroll",this.scrollHandler),this.cachedStartPoint=null,this.cachedEndPoint=null,this.cachedScrollRange=null,this.needsRecalculation=!0}animateHeadings(){const{scrollEl,headings}=this.refs;if(!scrollEl||!headings)return;const scrollLeft=Math.ceil(scrollEl.scrollLeft),maxScroll=this._cachedMaxScroll??scrollEl.scrollWidth-scrollEl.clientWidth;if(maxScroll<=0){this._lastMobileY!==0&&(this._lastMobileY=0,headings.style.transform="translate3d(0, 0, 0)");return}const scrolledRatio=scrollLeft/maxScroll,y=Math.ceil(this.headingsTranslateY*scrolledRatio);this._lastMobileY!==y&&(this._lastMobileY=y,headings.style.transform=`translate3d(0, ${y}px, 0)`)}disconnectedCallback(){this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,super.disconnectedCallback(),this.boundFocusinHandler&&(this.removeEventListener("focusin",this.boundFocusinHandler),this.boundFocusinHandler=null),this.cleanup()}get sectionId(){return this.dataset.sectionId||""}#handleHeadingFocusin(e){const{target}=e;target.closest(".block-scrolling__headings")&&this.#scrollToHeadingBlock(target)}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;document.addEventListener("shopify:block:select",e=>{if(e.detail.sectionId!=this.sectionId)return;const{target}=e;if(target.closest(".block-scrolling__headings")){this.#scrollToHeadingBlock(target);return}const cardEl=target.closest(".scrolling-cards__card");if(isMobileBreakpoint()&&cardEl){const{cards,scrollEl}=this.refs;if(Array.from(cards).indexOf(cardEl)>=0){const maxScroll=scrollEl.scrollWidth-scrollEl.clientWidth;if(maxScroll>0){const targetLeft=cardEl.offsetLeft-(scrollEl.clientWidth-cardEl.offsetWidth)/2;scrollEl.scrollTo({left:Math.max(0,Math.min(targetLeft,maxScroll)),behavior:"smooth"})}this.scrollIntoView({behavior:"smooth",block:"center"})}}},{signal})}#scrollToHeadingBlock(target){const{headings:headingsContainer,cards,scrollEl}=this.refs,selectedTextBlock=target.closest(".text-block"),index=selectedTextBlock?Array.from(headingsContainer.children).indexOf(selectedTextBlock):0,N=Math.max(1,headingsContainer.children.length);if(isMobileBreakpoint()){if(scrollEl){const maxScroll=scrollEl.scrollWidth-scrollEl.clientWidth;if(maxScroll>0){let ratio;if(index===0)ratio=1;else if(index===N-1)ratio=0;else{const containerRect=headingsContainer.getBoundingClientRect(),textRect=selectedTextBlock.getBoundingClientRect();ratio=(containerRect.height-(textRect.top-containerRect.top+textRect.height/2))/containerRect.height}ratio=1-Math.max(0,Math.min(1,ratio));const targetLeft=Math.max(0,Math.min(maxScroll*ratio,maxScroll));scrollEl.scrollTo({left:targetLeft,behavior:"smooth"})}}}else if(cards&&cards.length>0){const firstColumn=cards[0],lastColumn=cards[cards.length-1],scrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,firstRect=firstColumn.getBoundingClientRect(),lastRect=lastColumn.getBoundingClientRect(),firstTop=firstRect.top+scrollTop,lastBottom=lastRect.bottom+scrollTop,viewportHe
1ight=window.innerHeight,startPoint=firstTop,scrollRange=lastBottom-viewportHeight-startPoint;if(scrollRange>0){const progress=N>1?index/(N-1):0,targetScrollTop=startPoint+progress*scrollRange,lenis=getLenis();lenis?lenis.scrollTo(targetScrollTop,{lerp:.1}):window.scrollTo({top:targetScrollTop,behavior:"smooth"})}}else this.scrollIntoView({behavior:"smooth",block:"center"})}}customElements.get("scrolling-cards")||customElements.define("scrolling-cards",ScrollingCards);class ScrollingCardLayered extends Component{constructor(){super(),this.scrollHandler=null,this.resizeHandler=null,this.rafId=null,this.resizeTimeout=null,this.lenis=null,this.cardData=null,this.previousTransforms=new Map,this.intersectionObserver=null,this.isInViewport=!1,this.cachedViewportHeight=null}connectedCallback(){super.connectedCallback();const mqlMobile=window.matchMedia("screen and (max-width: 767px)"),init=()=>{requestAnimationFrame(()=>{requestAnimationFrame(()=>{const style=getComputedStyle(this);this.stickySpacing=parseFloat(style.getPropertyValue("--sticky-spacing"))*10,this.widthReduced=parseFloat(style.getPropertyValue("--width-reduced"))*10,this.cleanup(),this.initAnimation()})})};init(mqlMobile.matches),mqlMobile.onchange=event=>init(event.matches)}initAnimation(){const{cards}=this.refs;if(!Array.isArray(cards)||cards.length===0){this.cardData=null;return}const cardCount=cards.length,lastCard=cards[cardCount-1],headerHeight=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))+20+(cards.length-1)*this.stickySpacing,cardWidths=[],scaleRatios=[];for(let index=0;index<cardCount;index++)if(cardWidths[index]=cards[index].offsetWidth,index<cardCount-1){const cardWidth=cardWidths[index],newWidth=cardWidth-(cardCount-index-1)*this.widthReduced;scaleRatios[index]=newWidth/cardWidth}const lenisInstance=getLenis(),currentScrollTop=lenisInstance?lenisInstance.scroll:window.pageYOffset||document.documentElement.scrollTop,cardTopsAbsolute=[];for(let index=0;index<cardCount;index++)cardTopsAbsolute[index]=cards[index].getBoundingClientRect().top+currentScrollTop;this.cachedViewportHeight=window.visualViewport?window.visualViewport.height:document.documentElement.clientHeight||window.innerHeight,this.cardData={cards,cardCount,lastCard,headerHeight,cardWidths,scaleRatios,cardTopsAbsolute,lastCardTopAbsolute:cardTopsAbsolute[cardCount-1]},this.setupIntersectionObserver();const updateAnimation=()=>{!this.isInViewport||!this.cardData||this.updateAnimation()};this.lenis=getLenis(),this.lenis?(this.scrollHandler=updateAnimation,this.lenis.on("scroll",this.scrollHandler)):(this.scrollHandler=()=>{if(!(!this.isInViewport||!this.cardData)){if(!this.lenis){const retryLenis=getLenis();if(retryLenis){this.lenis=retryLenis,window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=updateAnimation,this.lenis.on("scroll",this.scrollHandler);return}}this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.updateAnimation(),this.rafId=null})}},window.addEventListener("scroll",this.scrollHandler,{passive:!0})),requestAnimationFrame(()=>{this.cardData&&this.updateAnimation()}),this.setupResizeHandler()}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{this.isInViewport=entry.isIntersecting})},{rootMargin:"50% 0px",threshold:0}),this.intersectionObserver.observe(this)}updateAnimation(){if(!this.cardData)return;const{cards,cardCount,headerHeight,scaleRatios,cardTopsAbsolute,lastCardTopAbsolute}=this.cardData,scrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,viewportHeight=this.cachedViewportHeight||window.innerHeight,firstCardAnimationStart=lastCardTopAbsolute-headerHeight-viewportHeight*3,lastCardAnimationEnd=lastCardTopAbsolute+viewportHeight*2;if(scrollTop<firstCardAnimationStart||scrollTop>lastCardAnimationEnd){for(let index=0;index<cardCount-1;index++){const card=cards[index];this.previousTransforms.get(card)!=="scale3d(1, 1, 1)"&&(card.style.transform="scale3d(1, 1, 1)",this.previousTransforms.set(card,"scale3d(1, 1, 1)")),card.style.getPropertyValue("--offset-top")&&card.style.removeProperty("--offset-top")}return}const stickyStartPoint=lastCardTopAbsolute-headerHeight,stickyEndPoint=lastCardTopAbsolute,isInStickyRange=scrollTop>=stickyStartPoint&&scrollTop<=stickyEndPoint;for(let index=0;
1index<cardCount-1;index++){const card=cards[index],scaleRatio=scaleRatios[index],nextCardTop=cardTopsAbsolute[index+1],endPoint=lastCardTopAbsolute-headerHeight,startPoint=nextCardTop-viewportHeight,scrollRange=endPoint-startPoint;let newTransform;if(scrollRange<=0)newTransform="scale3d(1, 1, 1)";else{const progress=Math.max(0,Math.min(1,(scrollTop-startPoint)/scrollRange)),scale=1+(scaleRatio-1)*progress;newTransform=`scale3d(${scale}, ${scale}, 1)`}this.previousTransforms.get(card)!==newTransform&&(card.style.transform=newTransform,this.previousTransforms.set(card,newTransform))}if(isInStickyRange){const currentLastCardTop=Math.max(lastCardTopAbsolute-scrollTop,0);for(let index=0;index<cardCount-1;index++){const card=cards[index],newValue=`${currentLastCardTop-(cardCount-index-1)*this.stickySpacing}px`;card.style.getPropertyValue("--offset-top")!==newValue&&card.style.setProperty("--offset-top",newValue)}}else for(let index=0;index<cardCount-1;index++){const card=cards[index];card.style.getPropertyValue("--offset-top")&&card.style.removeProperty("--offset-top")}}setupResizeHandler(){this.resizeHandler=()=>{this.resizeTimeout&&clearTimeout(this.resizeTimeout),this.resizeTimeout=setTimeout(()=>{this.cachedViewportHeight=window.visualViewport?window.visualViewport.height:document.documentElement.clientHeight||window.innerHeight,requestAnimationFrame(()=>{if(!this.cardData)return;const{cards,cardCount}=this.cardData,cardWidths=[],scaleRatios=[];for(let index=0;index<cardCount;index++)if(cardWidths[index]=cards[index].offsetWidth,index<cardCount-1){const cardWidth=cardWidths[index],newWidth=cardWidth-(cardCount-index-1)*this.widthReduced;scaleRatios[index]=newWidth/cardWidth}this.cardData.cardWidths=cardWidths,this.cardData.scaleRatios=scaleRatios,this.cardData.headerHeight=parseFloat(getComputedStyle(document.documentElement).getPropertyValue("--header-height"))+20+(cardCount-1)*this.stickySpacing;const currentScrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,cardTopsAbsolute=[];for(let index=0;index<cardCount;index++)cardTopsAbsolute[index]=cards[index].getBoundingClientRect().top+currentScrollTop;this.cardData.cardTopsAbsolute=cardTopsAbsolute,this.cardData.lastCardTopAbsolute=cardTopsAbsolute[cardCount-1],this.updateAnimation()})},150)},window.addEventListener("resize",this.resizeHandler,{passive:!0})}cleanup(){this.scrollHandler&&(this.lenis?this.lenis.off("scroll",this.scrollHandler):window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.resizeHandler&&(window.removeEventListener("resize",this.resizeHandler),this.resizeHandler=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.resizeTimeout&&(clearTimeout(this.resizeTimeout),this.resizeTimeout=null),this.cardData=null,this.previousTransforms.clear()}disconnectedCallback(){super.disconnectedCallback(),this.cleanup()}}customElements.get("scrolling-card-layered")||customElements.define("scrolling-card-layered",ScrollingCardLayered);class ImageComparison extends Component{constructor(){super(),this.startDragHandler=this.#onStartDrag.bind(this),this.dragHandler=this.#onDrag.bind(this),this.stopDragHandler=this.#onStopDrag.bind(this)}get isHorizontal(){return this.dataset.direction==="horizontal"}connectedCallback(){super.connectedCallback(),this.#init(),prefersReducedMotion()||this.#bindInView()}#bindInView(){const{trigger}=this.refs;inView(trigger,()=>{this.#enter()},{rootMargin:"0px 0px -50px 0px"})}#enter(){this.setAttribute("is-visible",""),this.classList.add("is-animating"),setTimeout(()=>{this.classList.remove("is-animating")},1e3)}#init(){const{rangeButton,rangeButtonIcon}=this.refs;this.offset=31,requestAnimationFrame(()=>{this.offset=rangeButtonIcon?rangeButtonIcon.offsetWidth/2:this.offset}),rangeButton.addEventListener("touchstart",this.startDragHandler),rangeButton.addEventListener("mousedown",this.startDragHandler)}#onStartDrag(event){event.preventDefault(),document.documentElement.classList.add("scroll-locked"),this.classList.add("is-dragging"),event.type==="mousedown"?(document.addEventListener("mousemove",this.dragHandler),document.addEventListener("mouseup",this.stopDragHandler)):event.type==="touchstart"&&(document.addEventListener("touchmove",this.dragHandler,{passive:!1}),document.addEventListener("touchend",this.stopDragHandler))}
1#onStopDrag(){this.classList.remove("is-dragging"),document.removeEventListener("mousemove",this.dragHandler),document.removeEventListener("mouseup",this.stopDragHandler),document.removeEventListener("touchmove",this.dragHandler),document.removeEventListener("touchend",this.stopDragHandler);const lenis=getLenis();lenis?(lenis.start(),requestAnimationFrame(()=>{requestAnimationFrame(()=>{document.documentElement.classList.remove("scroll-locked")})})):document.documentElement.classList.remove("scroll-locked")}#onDrag(e){e.preventDefault();const event=e.touches&&e.touches[0]||e,rect=this.getBoundingClientRect();let x,distance;this.isHorizontal?(x=event.clientX-rect.left,distance=this.clientWidth,isRTL()&&(x=distance-x)):(x=event.clientY-rect.top,distance=this.clientHeight);const max=distance-this.offset,min=this.offset,mousePercent=Math.max(min,Math.min(x,max))*100/distance;this.style.setProperty("--percent",mousePercent+"%")}}customElements.get("image-comparison")||customElements.define("image-comparison",ImageComparison);class ComparisonGallery extends Component{#preventClick=!1;#activeIndex=-1;#abortController=new AbortController;#resizeObserver=null;#rafId=null;#shopifyAbortController;connectedCallback(){super.connectedCallback();const{thumbnails}=this.refs;thumbnails&&(this.#setupListeners(),this.#observeActiveContent(),requestAnimationFrame(()=>{this.setActiveTab(0)})),this.#registerDesignModeEvents()}updatedCallback(){super.updatedCallback?.();const{thumbnails}=this.refs;thumbnails&&(this.#abortController.abort(),this.#abortController=new AbortController,this.#setupListeners(),this.#observeActiveContent(),requestAnimationFrame(()=>{this.setActiveTab(0)}))}disconnectedCallback(){this.#cancelScheduledUpdate(),this.#resizeObserver?.disconnect(),this.#resizeObserver=null,this.#abortController.abort(),this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,super.disconnectedCallback()}get sectionId(){const{sectionId}=this.dataset;if(!sectionId)throw new Error("Section id missing");return sectionId}#setupListeners(){const{thumbnails}=this.refs,{signal}=this.#abortController;"ontouchstart"in window?thumbnails.forEach(item=>{item.addEventListener("touchstart",e=>this.onTouchChange(e),{signal,passive:!0}),item.addEventListener("click",e=>this.onClick(e),{signal})}):thumbnails.forEach(item=>{item.addEventListener("click",e=>this.onThumbnailClick(e),{signal})}),window.matchMedia(mediaBreakpointMobile).addEventListener("change",()=>this.updateHeight(),{signal})}#observeActiveContent(){this.#resizeObserver?.disconnect();const{images,infos}=this.refs,currentImage=images[this.#activeIndex],currentInfo=infos[this.#activeIndex];!currentImage&&!currentInfo||(this.#resizeObserver=new ResizeObserver(()=>{this.updateHeight()}),currentImage&&this.#resizeObserver.observe(currentImage),currentInfo&&this.#resizeObserver.observe(currentInfo))}#cancelScheduledUpdate(){this.#rafId!=null&&(cancelAnimationFrame(this.#rafId),this.#rafId=null)}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;document.addEventListener("shopify:block:select",event=>{if(event.detail.sectionId!==this.sectionId)return;const{target}=event,el=target.closest(".comparison-gallery-item__part");if(!el)return;const index=Number(el.dataset.index);Number.isNaN(index)||this.setActiveTab(index)},{signal})}isActive(tab){return tab.getAttribute("aria-current")==="true"}updateHeight(){this.#cancelScheduledUpdate();const{imagesWrap,images,infosWrap,infos}=this.refs,currentImage=images[this.#activeIndex],currentInfo=infos[this.#activeIndex];!currentImage&&!currentInfo||(this.#rafId=requestAnimationFrame(()=>{if(this.#rafId=null,!this.isConnected)return;const imageH=currentImage?.offsetHeight,infoH=currentInfo?.offsetHeight;imageH!=null&&imagesWrap.style.setProperty("height",imageH+"px"),infoH!=null&&infosWrap.style.setProperty("height",infoH+"px")}))}setActiveTab(newIndex){this.#activeIndex=newIndex;const{images,thumbnails,infos}=this.refs,newThumbnail=thumbnails[newIndex],newImage=images[newIndex],newInfo=infos[newIndex];
1thumbnails.forEach(el=>el.setAttribute("aria-current",el===newThumbnail)),images.forEach(el=>el.setAttribute("aria-current",el===newImage)),infos.forEach(el=>el.setAttribute("aria-current",el===newInfo)),this.#observeActiveContent(),this.updateHeight()}getThumbnailEl(event){const{target}=event;return target.closest(".comparison-gallery-item__thumbnail")}onThumbnailClick(event){const thumbnailEl=this.getThumbnailEl(event);if(!thumbnailEl)return;const index=Number(thumbnailEl.dataset.index);this.isActive(thumbnailEl)||this.setActiveTab(index)}onTouchChange(event){const thumbnailEl=this.getThumbnailEl(event);if(!thumbnailEl)return;const index=Number(thumbnailEl.dataset.index);if(this.isActive(thumbnailEl)){this.#preventClick=!1;return}else this.#preventClick=!0;this.setActiveTab(index)}onClick(event){this.#preventClick&&event.preventDefault()}}customElements.get("comparison-gallery")||customElements.define("comparison-gallery",ComparisonGallery);class BaseMultiProductAddToCart extends Component{#timeout;constructor(){super()}getItems(){throw new Error("Subclass must implement getItems method")}getQuantiy(){return this.getItems().reduce((acc,item)=>acc+item.quantity,0)}getSubmitElement(){throw new Error("Subclass must implement getSubmitElement method")}getMessageElement(){throw new Error("Subclass must implement getMessageElement method")}onAddToCartClick(event){event?.preventDefault();const items=this.getItems();if(!items.length)return;const submitElement=this.getSubmitElement();if(submitElement.getAttribute("aria-disabled")==="true")return;submitElement.setAttribute("aria-disabled","true"),this.#showErrorMessage(),this.#toggleButtonLoading(!0);const shouldRedirectToCartAfterAdd=FoxTheme.template.name=="cart"||FoxTheme.settings.cartType!="drawer";let sectionsToUpdate=[];document.dispatchEvent(new CartGroupedSections(sectionsToUpdate));const body=JSON.stringify({items,sections:Array.from(sectionsToUpdate).join(","),sections_url:window.location.pathname}),fetchCfg=fetchConfig("json",{body});fetch(`${FoxTheme.routes.cart_add_url}`,fetchCfg).then(response=>response.json()).then(async response=>{if(response.status){this.dispatchEvent(new CartErrorEvent(this.id||"",response.message,response.description,response.errors)),document.dispatchEvent(new CustomEvent(ThemeEvents.productAjaxError,{detail:{errorMessage:response.description||response.message}})),this.#showErrorMessage(response.description);const sectionIds=[...new Set(sectionsToUpdate)],sectionsData={},sectionPromises=sectionIds.map(async sectionId=>{const sectionUrl=`${window.location.pathname.split("?")[0]}?section_id=${sectionId}`,res=await fetch(sectionUrl);sectionsData[sectionId]=await res.text()}),cartPromise=fetch(FoxTheme.routes.cart).then(res=>res.json());Promise.all([cartPromise,...sectionPromises]).then(([cart])=>{this.dispatchEvent(new CartUpdateEvent(cart,this.id,{itemCount:cart.item_count||0,sections:Object.keys(sectionsData).length>0?sectionsData:void 0}))}).catch(error=>{console.error("Failed to fetch cart count:",error)});return}else{if(shouldRedirectToCartAfterAdd){window.location=FoxTheme.routes.cart_url;return}this.dispatchEvent(new CartAddEvent(response,this.id,{itemCount:this.getQuantiy(),sections:response.sections})),document.dispatchEvent(new CustomEvent(ThemeEvents.productAjaxAdded,{detail:{product:response}}))}}).catch(e=>{console.error(e)}).finally(()=>{submitElement.removeAttribute("aria-disabled"),this.#toggleButtonLoading(!1)})}#showErrorMessage(message=!1){this.#timeout&&clearTimeout(this.#timeout);const messageElement=this.getMessageElement();messageElement?(messageElement.classList.toggle("hidden",!message),message&&(messageElement.textContent=message,this.#timeout=setTimeout(()=>{messageElement.classList.add("hidden")},5e3))):message&&alert(message)}#toggleButtonLoading(isLoading){const submitElement=this.getSubmitElement();submitElement&&submitElement.classList.toggle("btn--loading",isLoading)}}class ProductsBundle extends BaseMultiProductAddToCart{#abortController=new AbortController;constructor(){super()}connectedCallback(){super.connectedCallback();const{signal}=this.#abortController,{hotspots}=this.refs;this.onHoverHandler=this.#handleHover.bind(this),hotspots&&hotspots.forEac
1h(hotspot=>{["mouseover","mouseleave","focus","focusout"].forEach(eventName=>{hotspot.addEventListener(eventName,this.onHoverHandler,{signal})})}),this.#setButtonDisable()}disconnectedCallback(){super.disconnectedCallback(),this.#abortController.abort()}getItems(){const productForms=this.querySelectorAll(".product-card__form");return Array.from(productForms,form=>({id:form.querySelector("[name=id]")?.value,quantity:Number(form.querySelector("[name=quantity]")?.value)||1})).filter(item=>item.id)}getSubmitElement(){return this.refs.addAllToCart}getMessageElement(){return this.refs.addToCartTextError}#handleHover(event){const{type,target}=event,{productList}=this.refs,{products}=productList.refs,hotspot=target.closest('[ref="hotspots[]"]'),hotspotIndex=Number(hotspot.dataset.index),isEnter=type==="mouseover"||type==="focus";hotspot.classList.toggle("is-selected",isEnter),isMobileBreakpoint()||this.classList.toggle("is-hover",isEnter);let activeProduct=null;products.forEach(product=>{const productIndex=Number(product.dataset.index);product.classList.toggle("is-selected",hotspotIndex===productIndex),hotspotIndex===productIndex&&(activeProduct=product)}),isEnter&&(isMobileBreakpoint()?activeProduct&&this.#scrollToTop(activeProduct):typeof productList?.swiperInstance=="object"&&!productList?.swiperInstance?.visibleSlidesIndexes?.includes(hotspotIndex)&&productList.goToSlide(hotspotIndex))}#scrollToTop(target,offset=80){((selector,offset2)=>{window.scrollTo({behavior:"smooth",top:selector.getBoundingClientRect().top-document.body.getBoundingClientRect().top-offset2})})(target,offset)}#setButtonDisable(){const products=this.querySelectorAll("product-bundle-variant-selector"),{addAllToCart}=this.refs;products.length<1&&(addAllToCart.disabled=!0)}}customElements.get("products-bundle")||customElements.define("products-bundle",ProductsBundle);class ProductsBoughtTogether extends BaseMultiProductAddToCart{#abortController=new AbortController;constructor(){super(),this.variants=[]}connectedCallback(){if(super.connectedCallback(),!this.checkboxes.length)return;const{signal}=this.#abortController;this.onVariantChangeHandler=this.#onVariantChange.bind(this),this.onCheckboxChangeHandler=this.#onCheckboxChange.bind(this),this.onQuantityChangeHandler=this.#onQuantityChange.bind(this),this.addEventListener("variant-change",this.onVariantChangeHandler,{signal}),this.checkboxes.forEach(checkbox=>{checkbox.addEventListener("change",this.onCheckboxChangeHandler,{signal})}),this.quantityInputs.forEach(quantityInput=>{quantityInput.addEventListener("change",this.onQuantityChangeHandler,{signal})}),this.productCards.forEach(card=>{this.#updateProductCardLinePrice(card)})}disconnectedCallback(){super.disconnectedCallback(),this.#abortController.abort()}get checkboxSelector(){return".product-bought-together__checkbox"}get productCardSelector(){return".product-card"}get productCards(){return this._productCards=this._productCards||this.querySelectorAll(this.productCardSelector)}get checkboxes(){return this._checkboxes=this._checkboxes||this.querySelectorAll(this.checkboxSelector)}get quantityInputs(){return this._quantityInputs=this._quantityInputs||this.querySelectorAll("product-card [name='quantity']")}get checkedCheckboxes(){return Array.from(this.checkboxes).filter(checkbox=>checkbox.checked)}getItems(){return this.variants.map(variant=>({id:variant.id,quantity:variant.quantity}))}getSubmitElement(){return this.refs.addAllToCart}getMessageElement(){return this.refs.addToCartTextError}#onCheckboxChange(event){const{target:checkbox}=event,isSelected=checkbox.checked,productCard=checkbox.closest(this.productCardSelector),productId=productCard.dataset.productId;productCard.classList.toggle("is-selected",isSelected),isSelected?this.#addVariantFromProductCard(productCard):this.removeVariant(productId)}#onQuantityChange(event){const{target:quantityInput}=event,productCard=quantityInput.closest(this.productCardSelector);productCard.querySelector(this.checkboxSelector)?.checked?this.#addVariantFromProductCard(productCard):this.#updateProductCardLinePrice(productCard)}#onVariantChange(event){const{target}=event,productCard=target.closest(this.productCardSelector);productCard.querySelector(this.checkboxSelector).checked&&this.#addVariantFromProductCard(productCard)}#addVariantFromProductCard(productCard){const productId=productCard.dataset.productId,selectedOption=productCard.querySelector('[name="id"]').selectedOptions[0],variantId=selectedOption.value,baseUnitPrice=parseFloat(selectedOption.dataset.price),quantityInput=productCard.querySelector('[name="quantity"]'),quantity=quantityInput&&quantityInput.value!=""?parseInt(quantityInput.value):1,quantityOption=quantityInput?.selectedOptions?.[0],usesQuantityLinePricing=productCard.querySelector('[ref="priceContainer"]')?.dataset?.quantityBreaks==="true",rawLineTotal=quantityOption?.dataset?.linePrice,parsedLineTotal=rawLineTotal!=null&&rawLineTotal!==""?parseFloat(rawLineTotal):NaN,lineTotalCents=u
1sesQuantityLinePricing&&Number.isFinite(parsedLineTotal)?Math.round(parsedLineTotal):Math.round(baseUnitPrice*quantity),effectiveUnitPrice=quantity>0?lineTotalCents/quantity:baseUnitPrice;this.addVariant({productId,id:variantId,price:effectiveUnitPrice,quantity,lineTotalCents}),this.#updateProductCardLinePrice(productCard)}#updateProductCardLinePrice(productCard){const priceContainer=(productCard instanceof HTMLElement&&productCard.tagName.toLowerCase()==="product-card"?productCard:null).querySelector('[ref="priceContainer"]');if(!priceContainer)return;const selectedOption=productCard.querySelector('[name="id"]')?.selectedOptions?.[0];if(!selectedOption)return;const quantityInput=productCard.querySelector('[name="quantity"]'),quantityOption=quantityInput?.selectedOptions?.[0],quantity=quantityInput&&quantityInput.value!==""?parseInt(quantityInput.value):1,rawLine=quantityOption?.dataset?.linePrice,parsedLine=rawLine!=null&&rawLine!==""?parseFloat(rawLine):NaN,hasQuantityLineData=priceContainer.dataset.quantityBreaks==="true"&&Number.isFinite(parsedLine)&&parsedLine>=0;if(!hasQuantityLineData){if(priceContainer.classList.contains("volume-pricing--sale-badge"))return;const regularPriceElCheck=priceContainer.querySelector(".price__regular .price");if(regularPriceElCheck&&(regularPriceElCheck.textContent.includes("\u2013")||regularPriceElCheck.textContent.includes("from")))return}const unitPrice=parseFloat(selectedOption.dataset.price)||0,unitCompare=parseFloat(selectedOption.dataset.compareAtPrice)||0,moneyFormat=window.FoxTheme?.moneyFormat||"${{amount}}";let linePriceCents=Math.round(hasQuantityLineData?parsedLine:unitPrice*quantity),lineCompareCents=0;if(hasQuantityLineData){const rawCompareLine=quantityOption?.dataset?.compareLinePrice;rawCompareLine!=null&&rawCompareLine!==""&&(lineCompareCents=Math.round(parseFloat(rawCompareLine))||0)}else unitCompare>unitPrice&&(lineCompareCents=Math.round(unitCompare*quantity));const formattedPrice=formatCurrency(linePriceCents,moneyFormat),formattedCompare=lineCompareCents>linePriceCents?formatCurrency(lineCompareCents,moneyFormat):null,isOnSale=!!formattedCompare;priceContainer.classList.toggle("price--on-sale",isOnSale);const salePriceDiv=priceContainer.querySelector(".price__sale");if(salePriceDiv){const salePriceEl=salePriceDiv.querySelector(".price"),comparePriceEl=salePriceDiv.querySelector(".compare-at-price");salePriceEl&&(salePriceEl.textContent=formattedPrice),comparePriceEl&&formattedCompare&&(comparePriceEl.textContent=formattedCompare)}const regularPriceDiv=priceContainer.querySelector(".price__regular");if(regularPriceDiv){const regularPriceEl=regularPriceDiv.querySelector(".price");if(regularPriceEl){const isRangeText=regularPriceEl.textContent.includes("\u2013")||regularPriceEl.textContent.includes("from");(hasQuantityLineData||!isRangeText)&&(regularPriceEl.textContent=formattedPrice)}}}addVariant(variant){this.variants.some(v=>v.productId===variant.productId)?this.variants=this.variants.map(v=>v.productId===variant.productId?variant:v):this.variants.push(variant),this.#updateSummary()}removeVariant(productId){this.variants=this.variants.filter(v=>v.productId!==productId),this.#updateSummary()}updateVariant(productId,variant){this.variants=this.variants.map(v=>v.productId===productId?{...v,...variant}:v),this.#updateSummary()}#updateSummary(){this.#updateButtonState(),this.#updateCount(),this.#updateSubTotal()}#updateButtonState(){const{addAllToCart}=this.refs;this.variants.length>0?addAllToCart.removeAttribute("disabled"):addAllToCart.setAttribute("disabled","")}#updateCount(){const{itemCount}=this.refs,{itemCountOne,itemCountOther}=itemCount.dataset,checkedCount=this.variants.reduce((total,variant)=>total+variant.quantity,0);itemCount.textContent=checkedCount===1?itemCountOne.replace("{{ count }}",checkedCount):itemCountOther.replace("{{ count }}",checkedCount)}#updateSubTotal(){const{subTotal}=this.refs,totalPrice=this.variants.reduce((total,variant)=>typeof variant.lineTotalCents=="number"?total+variant.lineTotalCents:total+variant.price*variant.quantity,0);subTotal.textContent=formatCurrency(totalPrice)}}customElements.get("products-bought-together")||customElements.define("products-bought-together",ProductsBoughtTogether);class ProductBundleVariantSelector extends Component{constructor(){super()}connectedCallback(){super.connectedCallback();const{variantSelect}=this.refs;this.currentOptionIds=variantSelect?variantSelect.options[variantSelect.selectedIndex].dataset.optionsId:null,this.currentVariantId=variantSelect?variantSelect.value:null}get productId(){return this.dataset.productId}get productUrl(){return this.dataset.productUrl}get sectionId(){return this.dataset.sectionId}#isFormInputElement(element){return element instanceof HTMLInputElement||element instanceof HTMLSelectElement||element instanceof HTMLTextAreaElement}#clearVariantSyncElement(destination){if(this.#isFormInputElement(destination)){destination instanceof HTMLSelectElement?(destination.innerHTML="",destination.value="",destination.selectedIndex=-1):destination instanceof HTMLInputElement&&(destination.type==="checkbox"||destination.type==="radio")?destination.checked=!1:destination.value="";return}destination.innerHTML=""}#syncVariantSyncElement(source,destination){if(this.#isFormInputElement(destination)){if
1(destination instanceof HTMLSelectElement&&source instanceof HTMLSelectElement){const preservedValue2=destination.value;destination.innerHTML=source.innerHTML,[...destination.options].some(option=>option.value===preservedValue2)&&(destination.value=preservedValue2);return}const preservedValue=destination.value,preservedChecked=destination instanceof HTMLInputElement&&(destination.type==="checkbox"||destination.type==="radio")?destination.checked:null,replacement=source.cloneNode(!0);(replacement instanceof HTMLInputElement||replacement instanceof HTMLTextAreaElement)&&(preservedChecked!=null?replacement.checked=preservedChecked:preservedValue&&(replacement.value=preservedValue)),destination.replaceWith(replacement);return}destination.replaceWith(source)}#syncProductCardFromFetchedHtml(sourceRoot,destRoot){!sourceRoot||!destRoot||destRoot.querySelectorAll("[data-variant-sync]").forEach(destination=>{const syncKey=destination.dataset.variantSync;if(!syncKey)return;const source=sourceRoot.querySelector(`[data-variant-sync="${CSS.escape(syncKey)}"]`);if(!source){this.#clearVariantSyncElement(destination);return}this.#syncVariantSyncElement(source,destination)})}updateVariantFromSelect(variantSelect){this.currentOptionIds=variantSelect.options[variantSelect.selectedIndex].dataset.optionsId,this.currentVariantId=variantSelect.value}getVariantChangeFetchUrl(){return`${this.productUrl.split("?")[0]}?section_id=${this.sectionId}&option_values=${this.currentOptionIds}`}getProductCardFromSource(html){return html.querySelector(`.product-card__wrapper[data-product-id="${this.productId}"]`)}fetchAndSyncProductCard(){return fetch(this.getVariantChangeFetchUrl()).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html"),pcardSource=this.getProductCardFromSource(html),pcardDestination=this.closest(`.product-card__wrapper[data-product-id="${this.productId}"]`);this.#syncProductCardFromFetchedHtml(pcardSource,pcardDestination)}).catch(error=>{console.error(error)})}onVariantChange(event){this.updateVariantFromSelect(event.target),this.fetchAndSyncProductCard().then(()=>{this.dispatchEvent(new CustomEvent("variant-change",{bubbles:!0}))})}}customElements.get("product-bundle-variant-selector")||customElements.define("product-bundle-variant-selector",ProductBundleVariantSelector);class ProductsBundleSelection extends BaseMultiProductAddToCart{constructor(){super(),this.variants=[],this.preventDuplicateItems=this.dataset.preventDuplicateItems==="true",this.minItems=parseInt(this.dataset.minItems),this.maxItems=parseInt(this.dataset.maxItems),this.rawItems=this.querySelectorAll(".products-bundle-selection__bar-item")}connectedCallback(){super.connectedCallback();const{bundleBar}=this.refs,{bundleBarList,bundleBarSubmit}=bundleBar.refs;this.updateBundleBarInfo(),bundleBarList.addEventListener("click",this.onBundleBarItemRemoveClick.bind(this)),bundleBarSubmit.addEventListener("click",this.onSubmitClick.bind(this));const mqlMobile=window.matchMedia(mediaBreakpointMobile),updateOpen=isMobile=>{const shouldOpen=!isMobile,accordionEl=this.refs.bundleBar;if(!accordionEl||!accordionEl.refs)return;const details=accordionEl.querySelector("details");if(details.open===shouldOpen)return;const{item:items,summary:summaries,content:contents}=accordionEl.refs;let idx=-1;Array.isArray(items)&&(idx=items.indexOf(details));let item=Array.isArray(items)?items[idx]:items,summary=Array.isArray(summaries)?summaries[idx]:summaries,content=Array.isArray(contents)?contents[idx]:contents;!item||!summary||!content||accordionEl.toggleOpen({willOpen:shouldOpen,item,summary,content})};updateOpen(mqlMobile.matches),mqlMobile.onchange=event=>updateOpen(event.matches)}getItems(){return this.variants.map(variant=>({id:variant.id,quantity:variant.quantity}))}getSubmitElement(){return this.refs.bundleBar.refs.bundleBarSubmit}getMessageElement(){return this.refs.bundleBar.refs.addToCartTextError}onBundleBarItemRemoveClick(event){const removeBtn=event.target.closest(".products-bundle-selection__bar-item-remove");if(removeBtn){event.preventDefault();const index=removeBtn.closest(".products-bundle-selection__bar-item").dataset.variantIndex;this.removeFromBundle(index)}}onSubmitClick(event){event?.preventDefault(),!(this.getCount()<this.minItems)&&this.onAddToCartClick()}addToBundle(variant){if(this.getCount()+variant.quantity>this.maxItems){alert(this.dataset.limitMessage);return}if(this.preventDuplicateItems&&this.variants.some(v=>v.productId===variant.productId)){alert(this.dataset.duplicateMessage);return}this.variants.push(variant),this.updateBundleBar()}removeFromBundle(index){index>=0&&index<this.variants.length&&(this.variants.splice(index,1),this.updateBundleBar())}
1clearBundle(){this.variants=[],this.updateBundleBar()}getCount(){return this.variants.reduce((quantity,item)=>quantity+item.quantity,0)}updateBundleBar(){this.updateBundleBarInfo(),this.updateAddToBundleButtons();const{bundleBar}=this.refs,{bundleBarList}=bundleBar.refs;let variantIndex=0,variant=!1,variantRepeatTimes=0;const updatedItems=Array.from(this.rawItems).map(item=>{const wrapper=item.cloneNode(!0);if(wrapper.dataset.variantIndex=variantIndex,variantRepeatTimes>0?variantRepeatTimes--:(variant=this.variants[variantIndex],variantRepeatTimes=variant?variant.quantity-1:0),variantRepeatTimes==0&&variantIndex++,variant){const contentEl=wrapper.querySelector(".products-bundle-selection__bar-item-content");contentEl.innerHTML="",wrapper.classList.remove("is-placeholder"),wrapper.classList.add("is-product"),wrapper.setAttribute("data-variant-id",variant.id),contentEl.appendChild(variant.thumbnail.cloneNode(!0))}return wrapper});bundleBarList.innerHTML="",updatedItems.forEach(el=>bundleBarList.appendChild(el))}updateBundleBarInfo(){const{bundleBar}=this.refs,{bundleBarSubmit,bundleBarCount}=bundleBar.refs;this.getCount()>=this.minItems?bundleBarSubmit.removeAttribute("disabled"):bundleBarSubmit.setAttribute("disabled","true"),bundleBarCount.textContent=this.getCount()}updateAddToBundleButtons(context=this){if(!this.preventDuplicateItems)return;const forms=context.querySelectorAll("product-bundle-selection");forms&&forms.forEach(form=>{const productId=form.dataset.productId;let found=!1;for(const variant of this.variants)variant.productId==productId&&(found=!0);const{addToBundleButton}=form.refs;found?addToBundleButton.setAttribute("aria-disabled",!0):addToBundleButton.removeAttribute("aria-disabled")})}}customElements.get("products-bundle-selection")||customElements.define("products-bundle-selection",ProductsBundleSelection);class ProductBundleSelection extends ProductBundleVariantSelector{get bundleSelectionEl(){return this._bundleSelectionEl=this._bundleSelectionEl||this.closest("products-bundle-selection")}async handleVariantChange(event){this.updateVariantFromSelect(event.target);const{addToBundleButton}=this.refs,wasDisabled=addToBundleButton.getAttribute("aria-disabled")==="true";addToBundleButton.setAttribute("aria-disabled","true"),addToBundleButton.classList.add("btn--loading");try{await this.fetchAndSyncProductCard()}finally{wasDisabled?addToBundleButton.setAttribute("aria-disabled","true"):addToBundleButton.removeAttribute("aria-disabled"),addToBundleButton.classList.remove("btn--loading")}}handleAddToBundle(event){event.preventDefault();const{addToBundleButton}=this.refs;if(addToBundleButton.getAttribute("aria-disabled")=="true")return;const productCard=this.closest(".product-card"),thumbnailEl=productCard.querySelector(".product-card__image--first img"),thumbnail=thumbnailEl?thumbnailEl.cloneNode(!0):productCard.querySelector(".product-card__media .placeholder"),variant=this.querySelector('[name="id"]').selectedOptions[0],itemPrice=parseFloat(variant.dataset.price),quantityEl=this.querySelector('[name="quantity"]'),quantity=quantityEl&&quantityEl.value!=""?parseInt(quantityEl.value):1;this.bundleSelectionEl.addToBundle({productId:this.dataset.productId,id:variant.value,thumbnail,price:itemPrice,quantity})}}customElements.get("product-bundle-selection")||customElements.define("product-bundle-selection",ProductBundleSelection);class LookbookHotspots extends Component{#shopifyAbortController;#abortController=new AbortController;#activeIndex=-1;constructor(){super(),this.classes={isSelected:"is-selected"},this.clickOutsideHandler=this.#handleClickOutside.bind(this)}connectedCallback(){super.connectedCallback();const{signal}=this.#abortController,{hotspots}=this.refs;hotspots&&("ontouchstart"in window?hotspots.forEach(hotspot=>{hotspot.addEventListener("touchstart",this.#handleTouchChange.bind(this),{signal})}):hotspots.forEach(hotspot=>{["mouseenter","mouseleave","focus","blur"].forEach(eventName=>{hotspot.addEventListener(eventName,this.#handleMouseOver.bind(this),{signal})})}),this.#registerDesignModeEvents())}disconnectedCallback(){this.#abortController.abort(),this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,super.disconnectedCallback()}get sectionId(){return this.dataset.sectionId}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;["shopify:block:select","shopify:block:deselect"].forEach(eventName=>{document.addEventListener(eventName,event=>{if(event.detail.sectionId!=this.sectionId)return;const{type}=event,hotspotEl=this.#getHotspotEl(event),index=type==="shopify:block:select"?Number(hotspotEl.dataset.index):-1;this.#setActive(index)},{signal})})}#handleMouseOver(event){const{type}=event,hotspotEl=this.#getHotspotEl(event),index=type==="mouseenter"||type==="focus"?Number(hotspotEl.dataset.index):-1;this.#setActive(index)}#getHotspotEl(event){return event.target.closest(".hotspot-icon")}#getProductCardEl(event){return event.target.closest(".hotspot-icon__product")}#isActive(hotspotEl){return hotspotEl.classList.contains(this.classes.isSelected)}
1#setActive(newIndex){const{hotspots}=this.refs;hotspots.forEach(hotspot=>{const index=Number(hotspot.dataset.index);this.#toggleHotspot(hotspot,index===newIndex)}),this.#activeIndex=newIndex,newIndex!==-1?document.addEventListener("click",this.clickOutsideHandler):document.removeEventListener("click",this.clickOutsideHandler)}#handleClickOutside(event){this.#getHotspotEl(event)||this.#setActive(-1)}#handleTouchChange(event){if(this.#getProductCardEl(event))return;const hotspotEl=this.#getHotspotEl(event),index=this.#isActive(hotspotEl)?-1:Number(hotspotEl.dataset.index);this.#setActive(index)}#toggleHotspot(hotspotEl,isSelected){hotspotEl.classList.toggle(this.classes.isSelected,isSelected),isSelected&&this.#calculateCardPosition(hotspotEl)}#calculateCardPosition(hotspotEl){const productCardEl=hotspotEl.querySelector(".hotspot-icon__product");productCardEl.style.removeProperty("--card-offset-x"),productCardEl.style.removeProperty("--card-offset-y"),productCardEl.style.removeProperty("transform");const containerRect=this.getBoundingClientRect(),cardRect=productCardEl.getBoundingClientRect(),cardMargin=12,margin=8,overflowStart=cardRect.left<containerRect.left+margin,overflowEnd=cardRect.right>containerRect.right-margin,spaceBelow=containerRect.bottom-cardRect.bottom,spaceAbove=cardRect.top-containerRect.top,rtl=isRTL();let translateX=`${cardMargin}px`,translateY="-50%",offsetX,offsetY;overflowStart&&overflowEnd?(offsetX=rtl?"auto 50%":"50% auto",translateX="-50%"):overflowEnd?(offsetX=rtl?"100% auto":"auto 100%",translateX=rtl?`${cardMargin}px`:`-${cardMargin}px`):overflowStart&&(offsetX=rtl?"auto 100%":"100% auto",translateX=rtl?`-${cardMargin}px`:`${cardMargin}px`),spaceBelow<margin?(offsetY="auto 0",translateY=`-${cardMargin}px`):spaceAbove<margin&&(offsetY="0 auto",translateY=`${cardMargin}px`),offsetX&&productCardEl.style.setProperty("--card-offset-x",offsetX),offsetY&&productCardEl.style.setProperty("--card-offset-y",offsetY),productCardEl.style.transform=`translate(${translateX}, ${translateY})`}}customElements.get("lookbook-hotspots")||customElements.define("lookbook-hotspots",LookbookHotspots);class ShopTheLook extends Component{#abortController=new AbortController;#shopifyAbortController;constructor(){super()}connectedCallback(){super.connectedCallback();const{slider,hotspots}=this.refs,{signal}=this.#abortController;hotspots&&hotspots.forEach(hotspot=>{hotspot.addEventListener("mouseover",this.#handleHover.bind(this),{signal}),hotspot.addEventListener("click",this.#handleClick.bind(this),{signal})}),slider.swiperInstance?this.#registerSliderEvents():slider.addEventListener("carousel:ready",()=>{this.#registerSliderEvents()},{once:!0}),this.#registerDesignModeEvents()}#registerDesignModeEvents(){if(!(window.Shopify&&Shopify.designMode))return;this.#shopifyAbortController?.abort(),this.#shopifyAbortController=new AbortController;const{signal}=this.#shopifyAbortController;document.addEventListener("shopify:block:select",e=>{if(e.detail.sectionId!=this.sectionId)return;const{target}=e,hotspotEl=target.closest(".hotspot__element"),index=Number(hotspotEl.dataset.index);this.#setActiveItem(index)},{signal})}#registerSliderEvents(){const{slider}=this.refs;slider.swiperInstance&&slider.swiperInstance.on("realIndexChange",swiper=>{const{realIndex}=swiper;this.#setActiveItem(realIndex,!1)})}disconnectedCallback(){this.#shopifyAbortController?.abort(),this.#shopifyAbortController=void 0,super.disconnectedCallback(),this.#abortController.abort()}updatedCallback(){super.updatedCallback?.();const{slider}=this.refs;slider&&slider.addEventListener("carousel:ready",()=>this.#registerSliderEvents(),{once:!0})}#handleHover(event){const{currentTarget:target}=event,index=Number(target.dataset.index);this.#setActiveItem(index)}#setActiveItem(index,slideToActive=!0){const{hotspots,slider}=this.refs;hotspots.forEach(hotspot=>{hotspot.classList.toggle("is-selected",index===Number(hotspot.dataset.index))}),slideToActive&&typeof slider.swiperInstance=="object"&&slider.goToSlide(index)}#handleClick(event){if(!isMobileBreakpoint())return;event.preventDefault();const{target}=event,button=target.closest(".hotspot-icon");document.querySelector(`dialog[id="${button.getAttribute("aria-controls")}"]`).closest("dialog-component").showDialog()}get sectionId(){return this.dataset.sectionId}}customElements.get("shop-the-look")||customElements.define("shop-the-look",ShopTheLook);class LookbookCarousel extends CarouselComponent{#resizeObserver;#lastSyncedMediaIndex=null;constructor(){super(),this.selectedIndex=this.selectedIndex}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",`${index}`)}connectedCallback(){super.connectedCallback(),this.swiperInstance?this.#initAfterSwiperReady():this.addEventListener("carousel:ready",()=>{this.#initAfterSwiperReady()},{once:!0})}
1#initAfterSwiperReady(){this.#init(),this.#updateControlsScheme(this.refs.slides[0]),this.#resizeObserver=new ResizeObserver(()=>this.#updateControlHeight()),this.#resizeObserver.observe(this.refs.controls)}disconnectedCallback(){this.#resizeObserver?.disconnect(),this.#detachSwiperMediaListeners(),super.disconnectedCallback()}updatedCallback(){this.addEventListener("carousel:ready",()=>this.#initAfterSwiperReady(),{once:!0}),super.updatedCallback?.()}#detachSwiperMediaListeners(){const swiper=this.swiperInstance;!swiper||swiper.destroyed||(swiper.off("realIndexChange",this.#handleChange),swiper.off("slideChangeTransitionEnd",this.#handleSlideTransitionEnd))}#pauseSlideMedia(index){this.querySelectorAll(`[data-swiper-slide-index="${index}"]`).forEach(slide=>{slide.querySelector("deferred-media")?.pauseMedia()})}#playActiveSlideMedia(){const swiper=this.swiperInstance;if(!swiper||swiper.destroyed)return;const activeSlide=swiper.slides[swiper.activeIndex];if(!activeSlide)return;const deferredMedia=activeSlide.querySelector("deferred-media");deferredMedia&&deferredMedia.playMedia(),document.body.hasAttribute("data-motion-disabled")||activeSlide.querySelectorAll("motion-component").forEach(el=>{el.replay()})}#init(){if(typeof this.swiperInstance!="object")return;const{slides,activeIndex}=this.swiperInstance,runMotionReplay=()=>{slides[activeIndex]&&slides[activeIndex].querySelectorAll("motion-component[data-motion-hold]")?.forEach(el=>el.replay())},PAGE_TRANSITION_DURATION_MS=500,MOTION_OVERLAP_MS=200;if(document.body.classList.contains("page-transitions-enabled")){const pageTransition=document.querySelector("page-transition");if(pageTransition&&!pageTransition.hidden){const startDelay=Math.max(0,PAGE_TRANSITION_DURATION_MS-MOTION_OVERLAP_MS);let done=!1;const runOnce=()=>{done||(done=!0,runMotionReplay())};document.addEventListener(ThemeEvents.pageTransitionEnd,runOnce,{once:!0}),setTimeout(runOnce,startDelay)}else runMotionReplay()}else runMotionReplay();this.#detachSwiperMediaListeners(),this.#lastSyncedMediaIndex=this.swiperInstance.realIndex,this.swiperInstance.on("realIndexChange",this.#handleChange),this.swiperInstance.on("slideChangeTransitionEnd",this.#handleSlideTransitionEnd)}#handleChange=swiper=>{const{slides,realIndex,activeIndex}=swiper,previousIndex=this.#lastSyncedMediaIndex??this.selectedIndex;previousIndex!==realIndex&&this.#pauseSlideMedia(previousIndex),this.selectedIndex=realIndex,this.#lastSyncedMediaIndex=realIndex,this.#updateControlsScheme(slides[activeIndex])};#handleSlideTransitionEnd=()=>{this.#playActiveSlideMedia()};#updateControlsScheme(activeSlide){const{controls}=this.refs;if(!controls)return;const colorScheme=activeSlide.dataset.colorScheme;Array.from(controls.classList).filter(className=>className.startsWith("color-")).forEach(className=>controls.classList.remove(className)),colorScheme&&controls.classList.add(colorScheme)}#updateControlHeight(){const height=this.refs.controls.offsetHeight;this.style.setProperty("--control-height",`${height}px`)}}customElements.get("lookbook-carousel")||customElements.define("lookbook-carousel",LookbookCarousel);class LookbookSlidePopover extends Component{requiredRefs=["popover","dialogComponent"];static get observedAttributes(){return["open"]}get open(){return this.hasAttribute("open")}set open(value){value?this.setAttribute("open",""):this.removeAttribute("open")}connectedCallback(){super.connectedCallback(),this.init(),mediaQueryDesktop.addEventListener("change",this.#handleMediaChange);const{dialogComponent}=this.refs;dialogComponent&&dialogComponent.addEventListener(DialogCloseEvent.eventName,this.#handleDialogClose)}disconnectedCallback(){super.disconnectedCallback(),mediaQueryDesktop.removeEventListener("change",this.#handleMediaChange);const{dialogComponent}=this.refs;dialogComponent&&dialogComponent.removeEventListener(DialogCloseEvent.eventName,this.#handleDialogClose)}#handleMediaChange=()=>{this.init()};#getCarouselComponent(){return this.closest("lookbook-carousel")}#toggleCarouselDrag(enabled){const carousel=this.#getCarouselComponent();carousel?.swiperInstance&&(carousel.swiperInstance.allowTouchMove=enabled)}#handleDialogClose=()=>{this.#toggleCarouselDrag(!0)};init(){isDesktopBreakpoint()?this.open||(this.open=!0):this.open&&this.removeAttribute("open")}togglePopover(){this.open=!this.open}openPopover(){if(mediaQueryLarge.matches)this.open=!0;else{const{dialogComponent}=this.refs;dialogComponent&&(this.#toggleCarouselDrag(!1),dialogComponent.showDialog())}}
1closePopover(){this.open=!1}}customElements.get("lookbook-slide-popover")||customElements.define("lookbook-slide-popover",LookbookSlidePopover);class TestimonialParallax extends Component{#resizeHandler=null;constructor(){super(),this.scrollHandler=null,this.rafId=null,this.lenis=null,this.intersectionObserver=null,this.isInViewport=!1,this.viewportHeight=window.innerHeight}connectedCallback(){super.connectedCallback(),this.#update(),mediaQueryMobile.addEventListener("change",this.#update)}disconnectedCallback(){super.disconnectedCallback(),mediaQueryMobile.removeEventListener("change",this.#update),this.#destroy()}#update=()=>{isMobileBreakpoint()?this.#destroy():this.#init()};#init(){const{items}=this.refs;items?.length&&(this.viewportHeight=window.innerHeight,this.#resizeHandler=()=>{this.viewportHeight=window.innerHeight},window.addEventListener("resize",this.#resizeHandler,{passive:!0}),this.#setupIntersectionObserver(),this.#handleItemsAnimation())}#setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(entries=>{this.isInViewport=entries[0].isIntersecting,this.isInViewport&&requestAnimationFrame(()=>{this.#updateItemsAnimation()})},{rootMargin:"100px"}),this.intersectionObserver.observe(this)}#handleItemsAnimation(){const{items}=this.refs;if(items?.length){if(this.lenis=getLenis(),this.scrollHandler=()=>{this.isInViewport&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.#updateItemsAnimation(),this.rafId=null}))},this.lenis)this.lenis.on("scroll",this.scrollHandler);else{window.addEventListener("scroll",this.scrollHandler,{passive:!0});let retryCount=0;this.lenisRetryTimer=setInterval(()=>{retryCount++;const retryLenis=getLenis();retryLenis?(this.lenis=retryLenis,window.removeEventListener("scroll",this.scrollHandler),this.lenis.on("scroll",this.scrollHandler),clearInterval(this.lenisRetryTimer),this.lenisRetryTimer=null):retryCount>=10&&(clearInterval(this.lenisRetryTimer),this.lenisRetryTimer=null)},500)}requestAnimationFrame(()=>{this.#updateItemsAnimation()})}}#updateItemsAnimation(){const{items}=this.refs;if(!items?.length||!this.isInViewport)return;const scrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,viewportHeight=this.viewportHeight,measurements=[];for(const item of items){const{begin,end}=item.dataset;if(!begin||!end){measurements.push(null);continue}measurements.push({item,rect:item.getBoundingClientRect(),begin,end})}for(const m of measurements){if(!m)continue;const{item,rect,begin,end}=m,beginValue=parseFloat(begin),endValue=parseFloat(end),beginUnit=begin.includes("%")?"%":"px",endUnit=end.includes("%")?"%":"px",itemTop=rect.top+scrollTop,itemBottom=itemTop+rect.height,startPoint=itemTop-viewportHeight,scrollRange=itemBottom-startPoint;if(scrollRange<=0){const val=`translateY(${beginUnit==="%"?beginValue/100*rect.height:beginValue}${beginUnit==="%"?"%":"px"})`;item._lastTransform!==val&&(item._lastTransform=val,item.style.transform=val);continue}const progress=Math.max(0,Math.min(1,(scrollTop-startPoint)/scrollRange)),beginPx=beginUnit==="%"?beginValue/100*rect.height:beginValue,endPx=endUnit==="%"?endValue/100*rect.height:endValue,rounded=Math.round((beginPx+(endPx-beginPx)*progress)*10)/10;item._lastY!==rounded&&(item._lastY=rounded,item.style.transform=`translateY(${rounded}px)`)}}#destroy(){this.lenisRetryTimer&&(clearInterval(this.lenisRetryTimer),this.lenisRetryTimer=null),this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this.#resizeHandler&&(window.removeEventListener("resize",this.#resizeHandler),this.#resizeHandler=null),this.scrollHandler&&(this.lenis?this.lenis.off("scroll",this.scrollHandler):window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null),this.refs.items&&this.refs.items.forEach(item=>{item.style.transform=""})}}customElements.get("testimonial-parallax")||customElements.define("testimonial-parallax",TestimonialParallax);class ProductHighlightPoints extends TestimonialParallax{connectedCallback(){super.connectedCallback()}disconnectedCallback(){super.disconnectedCallback()}}customElements.get("product-highlight-points")||customElements.define("product-highlight-points",ProductHighlightPoints);class FlexCarousel extends CarouselComponent{connectedCallback(){super.connectedCallback(),this.swiperInstance?this.#init(
1):this.addEventListener("carousel:ready",()=>{this.#init()},{once:!0})}#init(){if(!this.swiperInstance)return;const EVENTS=["reachBeginning","reachEnd","fromEdge"];this.querySelectorAll(".edge__shadows").forEach(edgeEl=>{const swiper=edgeEl.getAttribute("ref")==="thumbnails"?this.thumbnailSwiper:this.swiperInstance;edgeEl.classList.add("is--active"),this.#updateShadow(edgeEl,swiper),EVENTS.forEach(evt=>{swiper.on(evt,()=>this.#updateShadow(edgeEl,swiper))})})}updatedCallback(){this.addEventListener("carousel:ready",()=>this.#init(),{once:!0}),super.updatedCallback?.()}#updateShadow(edgeEl,swiper){edgeEl.classList.toggle("is--beginning",swiper.isBeginning),edgeEl.classList.toggle("is--end",swiper.isEnd)}}customElements.define("flex-carousel",FlexCarousel),customElements.get("footer-details")||customElements.define("footer-details",class extends HTMLDetailsElement{constructor(){super()}get accordionEl(){return this._accordionEl=this._accordionEl||this.closest("accordion-component")}connectedCallback(){this.openDefault=this.dataset.openDefault==="true";const mqlTablet=window.matchMedia("screen and (max-width: 1023px)"),updateOpen=isTablet=>{const shouldOpen=isTablet?this.openDefault:!0;if(this.open===shouldOpen)return;const accordionEl=this.accordionEl;if(!accordionEl||!accordionEl.refs){console.warn("footer-details: accordion-component not found or refs not initialized");return}const{item:items,summary:summaries,content:contents}=accordionEl.refs;if(!items||!summaries||!contents){const item2=this.closest("details")||this,summary2=item2.querySelector("summary"),content2=item2.querySelector(".accordion__content");accordionEl.toggleOpen&&item2&&summary2&&content2&&accordionEl.toggleOpen({willOpen:shouldOpen,item:item2,summary:summary2,content:content2});return}let idx=-1;Array.isArray(items)&&(idx=items.indexOf(this));let item=Array.isArray(items)?items[idx]:items,summary=Array.isArray(summaries)?summaries[idx]:summaries,content=Array.isArray(contents)?contents[idx]:contents;!item||!summary||!content||accordionEl.toggleOpen({willOpen:shouldOpen,item,summary,content})};updateOpen(mqlTablet.matches),mqlTablet.onchange=event=>updateOpen(event.matches)}},{extends:"details"});class MarqueeComponent extends Component{requiredRefs=["inner"];#resizeObserver;#scrollStop=null;#inViewStop=null;#intersectionObserver=null;#initObserver=null;#initScheduled=!1;#initialized=!1;#previousWidth=0;static#PAUSE_OBSERVER_MARGIN="0px 0px 50px 0px";static#INIT_OBSERVER_MARGIN="300px 0px";static#MIN_COPIES=2;static#DURATION_MULTIPLIER=33;static#DURATION_MAX_RATIO=2.5;static#DEFAULT_DURATION="20s";static#DEFAULT_PARALLAX=.55;static#RESIZE_DEBOUNCE=200;connectedCallback(){super.connectedCallback(),!prefersReducedMotion()&&(this.isRTL=!1,this.#scheduleInit())}disconnectedCallback(){super.disconnectedCallback(),this.#cleanup()}#scheduleInit(){this.#initScheduled||(this.#initScheduled=!0,typeof IntersectionObserver<"u"?(this.#initObserver=new IntersectionObserver(entries=>{entries[0]?.isIntersecting&&(this.#initObserver?.disconnect(),this.#initObserver=null,this.#init())},{rootMargin:MarqueeComponent.#INIT_OBSERVER_MARGIN}),this.#initObserver.observe(this)):typeof requestIdleCallback<"u"?requestIdleCallback(()=>this.#init(),{timeout:1e3}):setTimeout(()=>this.#init(),100))}#init(){if(this.#initialized)return;this.#initialized=!0;const{inner}=this.refs;if(!inner)return;const item=inner.firstElementChild;item&&requestAnimationFrame(()=>{const height=this.offsetHeight,isRotated=this.classList.contains("marquee--rotated"),childWidth=this.#getChildWidthSync(inner),parentWidth=this.#getParentWidthSync();item.classList.add("animate"),this.#setAnimationDurationWithValues(childWidth,parentWidth),this.style.setProperty("--block-height",`${height}px`),isRotated?this._setRotateOffsetWithHeight(height):this.style.setProperty("--offset","0px"),this.#adjustItemCount(!1,childWidth,parentWidth,!0),this.#previousWidth=parentWidth,this.parallax?(this.#initParallax(),requestAnimationFrame(()=>{this.#adjustItemCount()})):this.#initPauseObserver(),this.#setupResizeObserver()})}#getChildWidthSync(inner){const item=inner?.firstElementChild;if(!item)return 1;const rect=item.getBoundingClientRect();return rect.right-rect.left}#getParentWidthSync(){const rect=this.getBoundingClientRect();return rect.right-rect.left}#setAnimationDurationWithValues(childWidth,parentWidth){const liquidDuration=this.duration;if(liquidDuration&&liquidDuration>0){this.style.setProperty("--duration",`${liquidDuration}s`);return}if(childWidth>0&&parentWidth>0){const ratio=Math.ceil(childWidth/parentWidth),duration=(MarqueeComponent.#DURATION_MULTIPLIER-16)*Math.min(MarqueeComponent.#DURATION_MAX_RATIO,ratio);this.style.setProperty("--duration",`${duration}s`)}else this.style.setProperty("--duration",MarqueeComponent.#DEFAULT_DURATION)}#cleanup(){this.#initObserver?.disconnect(),this.#initObserver=null,this.#resizeObserver?.disconnect(),window.removeEventListener("resize",this.#handleResize),this.#intersectionObserver?.disconnect(),this.#inViewStop?.(),this.#scrollStop?.(),this.#intersectionObserver=null,this.#inViewStop=null,this.#scrollStop=null}#setAnimationDuration(){const liquidDuration=this.duration;if(liquidDuration&&liquidDuration>0){this.style.setProperty("--duration",`${liquidDuration}s`);return}const{inner}=this.refs,childWidth=this.#getChildWidthSync(inner),parentWidth=this.#getParentWidthSync();this.#setAnimationDurationWithValues(childWidth,parentWidth)}#adjustItemCount(resetAll=!1,measuredChildWidth=null,measuredParentWidth=null,skipDurationRecalc=!1){const{inner}=this.refs;if(!inner)return;const currentCount=inner.children.length;if(currentCount===0)return;const originalItem=inner.firstElementChild;if(!originalItem)return;if(resetAll&¤tCount>1)for(;inner.children.length>1;)inner.lastElementChild?.remove();const childWidth=typeof measuredChildWidth=="number"&&measuredChildWidth>0?measuredChildWidth:this.#getChildWidthSync(inner),parentWidth=typeof measuredParentWidth=="number"&&measuredParentWidth>0?measuredParentWidth:this.#getParentWidthSync(),exactCount=this.#calculateNumberOfCopies(childWidth,parentWidth),finalCount=inner.children.length;if(exactCount>finalCount){const numberToAdd=exactCount-finalCount,fragment=document.createDocumentFragment();for(let i=0;i<numberToAdd;i++){const clone=originalItem.cloneNode(!0);this.#disableFocusableElements(clone),clone.setAttribute("aria-hidden","true"),clone.classList.add("animate"),fragment.appendChild(clone)}inner.appendChild(fragment),requestAnimationFrame(()=>{inner.querySelectorAll(".marquee__items:not(:first-child) .media").forEach(media=>{const img=media.querySelector("img.media__image");
1img&&img.complete&&img.naturalWidth>0&&(media.classList.remove("loading"),img.classList.contains("loading")&&(img.classList.remove("loading"),img.classList.add("loaded")))})})}else if(exactCount<finalCount){const itemsToRemove=Math.min(finalCount-exactCount,finalCount-1);this.#removeRepeatedItems(itemsToRemove)}!skipDurationRecalc&&!this.hasAttribute("data-duration")&&this.#setAnimationDuration()}#addRepeatedItems(numberOfCopies,templateItem=null){const{inner}=this.refs;if(!inner)return;const item=templateItem||inner.firstElementChild;if(item)for(let i=0;i<numberOfCopies;i++)this.#cloneItem(item,inner)}#removeRepeatedItems(numberOfCopies){const{inner}=this.refs;if(inner)for(let i=0;i<numberOfCopies;i++)inner.lastElementChild?.remove()}#cloneItem(item,container){const clone=item.cloneNode(!0);this.#disableFocusableElements(clone),clone.setAttribute("aria-hidden","true"),clone.classList.add("animate"),container.appendChild(clone),clone.querySelectorAll(".media").forEach(media=>{const img=media.querySelector("img.media__image");img&&img.complete&&img.naturalWidth>0&&(media.classList.remove("loading"),img.classList.contains("loading")&&(img.classList.remove("loading"),img.classList.add("loaded")))})}#getFocusableElements(wrapperEl){return wrapperEl.querySelectorAll("a[href], button:enabled, [tabindex]:not([tabindex^='-'])")}#disableFocusableElements(wrapperEl){const focusableElements=this.#getFocusableElements(wrapperEl);focusableElements&&focusableElements.forEach(el=>{el.setAttribute("tabindex","-1")})}#calculateNumberOfCopies(childWidth=null,parentWidth=null){const{inner}=this.refs,safeChildWidth=typeof childWidth=="number"&&childWidth>0?childWidth:this.#getChildWidthSync(inner),safeParentWidth=typeof parentWidth=="number"&&parentWidth>0?parentWidth:this.#getParentWidthSync();if(safeChildWidth<=0||safeParentWidth<=0)return MarqueeComponent.#MIN_COPIES;const baseCopies=Math.ceil(safeParentWidth/safeChildWidth);if(this.parallax){const parallaxValue=this.#parseParallaxValue(),parallaxTranslate=Math.abs(parallaxValue*100/(1+parallaxValue)),parallaxMultiplier=1.5,extraCopies=Math.ceil(parallaxTranslate/10)+4;return Math.ceil(baseCopies*parallaxMultiplier)+extraCopies}return baseCopies+2}#initParallax(){this.#createParallaxAnimation(),this.#initParallaxPauseObserver()}#createParallaxAnimation(){const parallaxValue=this.#parseParallaxValue();let translate=this.#calculateParallaxTranslate(parallaxValue);this.#scrollStop=scroll(animate(this.refs.inner,{transform:[`translateX(${translate}%)`,"translateX(0)"]},{easing:"linear"}),{target:this,offset:["start end","end start"]})}#parseParallaxValue(){const parallaxAttr=this.getAttribute("data-parallax");return!parallaxAttr||parallaxAttr==="false"?0:parallaxAttr==="true"?MarqueeComponent.#DEFAULT_PARALLAX:parseFloat(parallaxAttr)}#calculateParallaxTranslate(parallaxValue){let translate=parallaxValue*100/(1+parallaxValue);return this.direction==="reverse"||this.direction==="right"||(translate*=-1),this.isRTL&&(translate*=-1),translate}#initParallaxPauseObserver(){this.#intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?this.#resumeParallax():this.#pauseParallax()})},{rootMargin:MarqueeComponent.#PAUSE_OBSERVER_MARGIN}),this.#intersectionObserver.observe(this)}#pauseParallax(){this.classList.add("paused"),this.#scrollStop&&(this.#scrollStop(),this.#scrollStop=null)}#resumeParallax(){this.classList.remove("paused"),this.#scrollStop||this.#createParallaxAnimation()}#initPauseObserver(){this.#intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting?this.classList.remove("paused"):this.classList.add("paused")})},{rootMargin:MarqueeComponent.#PAUSE_OBSERVER_MARGIN}),this.#intersectionObserver.observe(this)}#setupResizeObserver(){this.#resizeObserver=new ResizeObserver(()=>this.#setHeight()),this.#resizeObserver.observe(this),window.addEventListener("resize",this.#handleResize)}#handleResize=debounce(()=>{const currentWidth=this.parentWidth;if(currentWidth===this.#previousWidth)return;this.#previousWidth=currentWidth;const{inner}=this.refs;if(!inner)return;inner.querySelectorAll(".marquee__items").forEach(el=>{el.classList.remove("animate"),el.style.transform=""}),this.parallax&&this.#scrollStop&&(this.#scrollStop(),this.#scrollStop=null,inner.style.transform=""),this.#adjustItemCount(!0,null,currentWidth),requestAnimationFrame(()=>{requestAnimationFrame(()=>{inner.querySelectorAll(".marquee__items").forEach(el=>{el.classList.add("animate"),el.style.transform=""}),this.parallax&&this.#createParallaxAnimation()})})},MarqueeComponent.#RESIZE_DEBOUNCE);#setHeight(){const height=this.offsetHeight,isRotated=this.classList.contains("marquee--rotated");this.style.setProperty("--block-height",`${height}px`),isRotated?this._setRotateOffsetWithHeight(height):this.style.setProperty("--offset","0px")}_setRotateOffsetWithHeight(blockHeight){let angleDeg=parseFloat(this.style.getPropertyValue("--angle-raw"))||parseFloat(this.style.getPropertyValue("--angle"))||0;if(angleDeg===0){this.style.setProperty("--offset","0px");return}angleDeg*=isRTL()?-1:1;const angleRad=Math.abs(angleDeg)*Math.PI/180,offset=blockHeight*Math.tan(angleRad);this.style.setProperty("--offset",`${offset}px`)}#setRotateOffset(){if(!this.classList.contains("marquee--rotated")){this.style.setProperty("--offset","0px");return}const angleDeg=parseFloat(this.style.getPropertyValue("--angle-raw"))||parseFloat(this.style.getPropertyValue("--angle"))||0;if(angleDeg===0){this.style.setProperty("--offset","0px");return}const angleRad=Math.abs(angleDeg)*Math.PI/180,offset=(this.offsetHeight||parseFloat(this.style.getPropertyValue("--block-height"))||0)*Math.tan(angleRad);this.style.setProperty("--offset",`${offset}px`)}
1onPause(){this.classList.add("paused"),this.parallax&&this.#scrollStop&&(this.#scrollStop(),this.#scrollStop=null)}onPlay(){this.classList.remove("paused"),this.parallax&&!this.#scrollStop&&this.#createParallaxAnimation()}get direction(){return this.getAttribute("data-direction")||"forward"}get duration(){if(!this.hasAttribute("data-duration"))return null;const value=parseFloat(this.getAttribute("data-duration"));return isNaN(value)?null:value}get parallax(){return isTouch()?!1:this.#parseParallaxValue()}get parentWidth(){const rect=this.getBoundingClientRect();return rect.right-rect.left}get childElementWidth(){const{inner}=this.refs,item=inner?.firstElementChild;if(!item)return 1;const rect=item.getBoundingClientRect();return rect.right-rect.left}}customElements.get("marquee-component")||customElements.define("marquee-component",MarqueeComponent);class TestimonialSplitContent extends CarouselComponent{connectedCallback(){super.connectedCallback(),this.swiperInstance?this.#init():this.addEventListener("carousel:ready",()=>{this.#init()},{once:!0})}disconnectedCallback(){super.disconnectedCallback()}updatedCallback(){this.addEventListener("carousel:ready",()=>this.#init(),{once:!0}),super.updatedCallback?.()}#init(){typeof this.swiperInstance=="object"&&(this.#updateControlsScheme(this.refs.slides[0]),this.swiperInstance.on("realIndexChange",this.#handleChange))}#handleChange=swiper=>{const{slides,realIndex,activeIndex}=swiper;this.selectedIndex=realIndex,this.#updateControlsScheme(slides[activeIndex])};#updateControlsScheme(activeSlide){const activeSlideInner=activeSlide.querySelector(".testimonial-split__content");if(this.wrapper){Array.from(this.wrapper.classList).filter(className=>className.startsWith("color-")).forEach(className=>this.wrapper.classList.remove(className));const colorScheme=`color-${activeSlideInner.dataset.colorScheme}`;colorScheme&&this.wrapper.classList.add(colorScheme)}}get wrapper(){return this.parentElement?.closest(".testimonials-split-slider__content")}}customElements.get("testimonial-split-content")||customElements.define("testimonial-split-content",TestimonialSplitContent);class TestimonialsSplitSlider extends Component{requiredRefs=["content"];constructor(){super(),this.selectedIndex=this.selectedIndex}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",`${index}`)}connectedCallback(){super.connectedCallback(),this.#init()}disconnectedCallback(){super.disconnectedCallback(),this.#cleanup()}updatedCallback(){super.updatedCallback?.();const{content}=this.refs;content&&content.addEventListener("carousel:ready",()=>this.#setupSync(),{once:!0})}#init(){const{content}=this.refs;content&&(content.swiperInstance?this.#setupSync():content.addEventListener("carousel:ready",()=>{this.#setupSync()},{once:!0}))}#setupSync(){const{content}=this.refs;content?.swiperInstance&&content.swiperInstance.on("realIndexChange",this.#handleSlideChange)}#handleSlideChange=swiper=>{const{realIndex}=swiper;this.selectedIndex=realIndex};#cleanup(){const{content}=this.refs;content?.swiperInstance&&content.swiperInstance.off("realIndexChange",this.#handleSlideChange)}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const{mediaItems}=this.refs;if(!mediaItems)return;const prevSlide=mediaItems[oldValue],currentSlide=mediaItems[newValue];prevSlide?.classList.remove("active"),currentSlide?.classList.add("active"),currentSlide&&!document.body.hasAttribute("data-motion-disabled")&¤tSlide.querySelectorAll("motion-component").forEach(el=>{el.replay()})}}}customElements.get("testimonials-split-slider")||customElements.define("testimonials-split-slider",TestimonialsSplitSlider);class MasonryComponent extends Component{#resizeObserver=null;#resizeHandler=null;#lastWidth=0;connectedCallback(){super.connectedCallback(),this.#resizeObserver=new ResizeNotifier(()=>{requestAnimationFrame(()=>{this.calculatePositioning()})}),this.#resizeObserver.observe(this),this.#resizeHandler=debounce(()=>{const currentWidth=window.innerWidth;currentWidth!==this.#lastWidth&&(this.#lastWidth=currentWidth,requestAnimationFrame(()=>{this.calculatePositioning()}))},150),window.addEventListener("resize",this.#resizeHandler,{passive:!0}),this.#lastWidth=window.innerWidth,requestAnimationFrame(()=>{this.calculatePositioning()})}disconnectedCallback(){super.disconnectedCallback(),this.#resizeObserver&&(this.#resizeObserver.disconnect(),this.#resizeObserver=null),this.#resizeHandler&&(this.#resizeHandler.cancel(),window.removeEventListener("resize",this.#resizeHandler),this.#resizeHandler=null)}get columnNumber(){const columns=window.getComputedStyle(this).getPropertyValue("--f-grid-columns");return columns&&parseInt(columns)||1}get rowGap(){const computedStyles=window.getComputedStyle(this),rowGap=computedStyles.getPropertyValue("--f-row-gap"),rowGapMobile=computedStyles.getPropertyValue("--f-row-gap-mobile"),temp=document.createElement("div");temp.style.position="absolute",temp.style.visibility="hidden",temp.style.rowGap=rowGap,temp.style.rowGapMobile=rowGapMobile,document.body.appendChild(temp);const resolvedValue=parseFloat(getComputedStyle(temp).rowGap),resolvedValueMobile=parseFloat(getComputedStyle(temp).rowGapMobile);return temp.remove(),isMobileBreakpoint()&&resolvedValueMobile?resolvedValueMobile||0:resolvedValue||0}
1disable(){Array.from(this.refs.items).forEach(item=>item.style.removeProperty("--offset-top"))}calculatePositioning(){this.disable(),!(this.columnNumber<=1)&&Array.from(this.refs.items).slice(this.columnNumber).forEach((col,i)=>{const prevItem=this.refs.items[i].children[0],currentItem=col.children[0],prevItemPos=prevItem.getBoundingClientRect().bottom,currentItemPos=currentItem.getBoundingClientRect().top,offsetTop=prevItemPos-currentItemPos+this.rowGap;col.style.setProperty("--offset-top",`${offsetTop}px`)})}}customElements.get("masonry-component")||customElements.define("masonry-component",MasonryComponent);class ShowMoreWrapperComponent extends Component{requiredRefs=["showMoreContent","showMoreButton"];#expanded=!1;#isAnimating=!1;#collapsedHeight=0;#animation;#animationSpeed=300;get#maxHeightThreshold(){const attrValue=this.getAttribute("data-max-height");if(attrValue){const parsed=parseFloat(attrValue);return isNaN(parsed)?70:parsed}return 70}#resizeObserver=null;#resizeHandler=null;#lastWidth=0;connectedCallback(){super.connectedCallback(),requestAnimationFrame(()=>{this.#init()}),this.#resizeObserver=new ResizeNotifier(()=>{requestAnimationFrame(()=>{this.#checkHeight()})}),this.#resizeObserver.observe(this.refs.showMoreContent),this.#resizeHandler=debounce(()=>{const currentWidth=window.innerWidth;currentWidth!==this.#lastWidth&&(this.#lastWidth=currentWidth,requestAnimationFrame(()=>{this.#checkHeight()}))},150),window.addEventListener("resize",this.#resizeHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),this.#resizeObserver&&(this.#resizeObserver.disconnect(),this.#resizeObserver=null),this.#resizeHandler&&(this.#resizeHandler.cancel(),window.removeEventListener("resize",this.#resizeHandler),this.#resizeHandler=null),this.#animation&&(this.#animation.cancel(),this.#animation=null)}#init(){this.#lastWidth=window.innerWidth,this.#checkHeight()}#checkHeight(){if(this.#isAnimating||this.#expanded)return;const{showMoreContent,showMoreButtonWrapper}=this.refs;if(!showMoreContent||!showMoreButtonWrapper)return;const svhHeight=(window.visualViewport?.height||window.innerHeight)*(this.#maxHeightThreshold/100);showMoreContent.scrollHeight>svhHeight?(showMoreButtonWrapper.classList.remove("hidden"),this.#collapsedHeight=svhHeight,this.#expanded||(showMoreContent.style.maxHeight=`${svhHeight}px`,showMoreContent.style.overflow="hidden")):(showMoreButtonWrapper.classList.add("hidden"),showMoreContent.style.removeProperty("max-height"),showMoreContent.style.removeProperty("overflow"),this.#expanded=!1)}#expand(){const{showMoreContent}=this.refs,startHeight=showMoreContent.offsetHeight,endHeight=showMoreContent.scrollHeight;return{startHeight,endHeight}}#collapse(){const{showMoreContent}=this.refs,startHeight=showMoreContent.offsetHeight,endHeight=this.#collapsedHeight;return{startHeight,endHeight}}#animateHeight(startHeight,endHeight){const{showMoreContent}=this.refs;this.#isAnimating=!0,showMoreContent.style.overflow="hidden",this.#animation?.cancel();const distance=Math.abs(endHeight-startHeight),duration=Math.min(Math.max(distance*.5,this.#animationSpeed),600);this.#animation=showMoreContent.animate({maxHeight:[`${startHeight}px`,`${endHeight}px`]},{duration,easing:"ease-in-out"}),this.#animation.onfinish=()=>this.#onAnimationFinish()}#onAnimationFinish(){const{showMoreContent,showMoreButtonWrapper}=this.refs;this.#expanded=!this.#expanded,this.#expanded?(showMoreContent.style.removeProperty("max-height"),showMoreContent.style.overflow="",showMoreButtonWrapper&&showMoreButtonWrapper.classList.add("show-more-button--expanded")):(showMoreContent.style.maxHeight=`${this.#collapsedHeight}px`,showMoreContent.style.overflow="hidden"),this.#updateButtonLabel(),this.#isAnimating=!1}#updateButtonLabel(){const{showMoreButton}=this.refs;if(!showMoreButton)return;const label=this.#expanded?showMoreButton.dataset.showLessLabel:showMoreButton.dataset.showMoreLabel;label&&showMoreButton.querySelectorAll(".btn__text, .btn__icon-text").forEach(el=>el.textContent=label)}#startToggle(willExpand){const{showMoreButton,showMoreButtonWrapper}=this.refs;this.dataset.expanded=willExpand?"true":"false",showMoreButton.setAttribute("aria-expanded",willExpand?"true":"false"),!willExpand&&showMoreButtonWrapper&&showMoreButtonWrapper.classList.remove("show-more-button--expanded");const{startHeight,endHeight}=willExpand?this.#expand():this.#collapse();this.#animateHeight(startHeight,endHeight)}#collapseWithScroll(){const target=this.closest(".section")||this;if(target.getBoundingClientRect().top>=-10){this.#startToggle(!1);return}this.#isAnimating=!0,target.scrollIntoView({behavior:"smooth",block:"start"});let done=!1;const startCollapse=()=>{done||(done=!0,document.removeEventListener("scrollend",startCollapse),this.#isAnimating=!1,this.#startToggle(!1))};document.addEventListener("scrollend",startCollapse,{once:!0}),setTimeout(startCollapse,800)}toggle=event=>{event.preventDefault();const{showMoreButton}=this.refs;!showMoreButton||this.#isAnimating||(this.#expanded?this.#collapseWithScroll():this.#startToggle(!0))}}customElements.get("show-more-wrapper-component")||customElements.define("show-more-wrapper-component",ShowMoreWrapperComponent);class IconBoxesSlider extends CarouselComponent{#loopResizeCleanup=null;connectedCallback(){super.connectedCallback(),this.addEventListener("carousel:ready",()=>
1{this.#init()})}disconnectedCallback(){this.#loopResizeCleanup&&(this.#loopResizeCleanup(),this.#loopResizeCleanup=null),super.disconnectedCallback()}#shouldDisableLoop(){const options=this.finalOptions||this.lastResolvedOptions;if(!options)return!1;const w=window.innerWidth||0,below=Number(options.destroyBelow),above=Number(options.destroyAbove);return!Number.isNaN(below)&&w<below||!Number.isNaN(above)&&w>above?!0:Number.isNaN(below)&&Number.isNaN(above)?w<=767:!1}#init(){const swiper=this.swiperInstance;if(swiper&&(swiper.params?.loop&&(swiper.params.loop=!1),this.#shouldDisableLoop()?this.#destroyLoop():this.#createLoop(),this.#setupLoopResponsive(),!this.#shouldDisableLoop())){requestAnimationFrame(()=>{if(!swiper||swiper.destroyed)return;const centeredSlides=swiper.params.centeredSlides||!1,slidesPerView=swiper.params.slidesPerView||1;let initialIndex=this.loopedSlides;if(centeredSlides){const originalSlides=swiper.slides.filter(slide=>!slide.classList.contains("swiper-slide-duplicate"));if(originalSlides.length>0){const firstOriginalIndex=swiper.getSlideIndex(originalSlides[0]);firstOriginalIndex>=0&&(initialIndex=firstOriginalIndex)}}swiper.slideTo(initialIndex,0,!1)}),swiper.on("slideChangeTransitionEnd",()=>{this.#loopFix()}),swiper.on("sliderMove",()=>{this.#loopFixDuringDrag()});const originalUpdateSlidesClasses=swiper.updateSlidesClasses;swiper.updateSlidesClasses=()=>{originalUpdateSlidesClasses.call(swiper),swiper.allowSlidePrev=!0,swiper.allowSlideNext=!0}}}#setupLoopResponsive(){this.#loopResizeCleanup&&(this.#loopResizeCleanup(),this.#loopResizeCleanup=null);let wasLoopDisabled=this.#shouldDisableLoop();const handleCarouselReady=()=>{wasLoopDisabled=this.#shouldDisableLoop()};this.addEventListener("carousel:ready",handleCarouselReady);const handleResize=()=>{const shouldDisableLoop=this.#shouldDisableLoop(),swiper=this.swiperInstance;shouldDisableLoop!==wasLoopDisabled&&(wasLoopDisabled=shouldDisableLoop,requestAnimationFrame(()=>{if(!swiper||swiper.destroyed){const container=this.refs?.container;container&&shouldDisableLoop&&Array.from(container.querySelectorAll(".swiper-slide-duplicate")).forEach(el=>{el.parentNode&&el.parentNode.removeChild(el)});return}shouldDisableLoop?this.#destroyLoop():(this.#createLoop(),requestAnimationFrame(()=>{if(!swiper||swiper.destroyed)return;const centeredSlides=swiper.params.centeredSlides||!1;let initialIndex=this.loopedSlides;if(centeredSlides){const originalSlides=swiper.slides.filter(slide=>!slide.classList.contains("swiper-slide-duplicate"));if(originalSlides.length>0){const firstOriginalIndex=swiper.getSlideIndex(originalSlides[0]);firstOriginalIndex>=0&&(initialIndex=firstOriginalIndex)}}swiper.slideTo(initialIndex,0,!1)}))}))};window.addEventListener("resize",handleResize),this.#loopResizeCleanup=()=>{window.removeEventListener("resize",handleResize),this.removeEventListener("carousel:ready",handleCarouselReady)}}#destroyLoop(){const swiper=this.swiperInstance;if(!swiper||swiper.destroyed){const container=this.refs?.container;container&&Array.from(container.querySelectorAll(".swiper-slide-duplicate")).forEach(el=>{el.parentNode&&el.parentNode.removeChild(el)});return}const{slidesEl}=swiper;Array.from(slidesEl.querySelectorAll(".swiper-slide-duplicate")).forEach(el=>{el.parentNode&&el.parentNode.removeChild(el)}),swiper.recalcSlides(),swiper.updateSlides()}#createLoop(){const swiper=this.swiperInstance;if(!swiper||swiper.params?.loop)return;const{slidesEl,params}=swiper;Array.from(slidesEl.querySelectorAll(".swiper-slide-duplicate")).forEach(el=>{el.parentNode&&el.parentNode.removeChild(el)});const originalSlides=Array.from(slidesEl.querySelectorAll(`.${params.slideClass}`)).filter(slide=>!slide.classList.contains("swiper-slide-duplicate"));if(originalSlides.length===0)return;originalSlides.forEach((slide,index)=>{slide.setAttribute("data-swiper-slide-index",index)});const slidesPerView=params.slidesPerView||1,slidesPerGroup=params.slidesPerGroup||1,loopAdditionalSlides=params.loopAdditionalSlides||0;let loopedSlides=slidesPerGroup;loopedSlides%slidesPerGroup!==0&&(loopedSlides+=slidesPerGroup-loopedSlides%slidesPerGroup),loopedSlides+=loopAdditionalSlides,loopedSlides<sli
1desPerView&&(loopedSlides=Math.ceil(slidesPerView/slidesPerGroup)*slidesPerGroup,loopedSlides+=loopAdditionalSlides),loopedSlides>originalSlides.length&¶ms.loopedSlidesLimit!==!1&&(loopedSlides=originalSlides.length),loopedSlides=Math.max(1,loopedSlides),this.loopedSlides=loopedSlides;const prependSlides=[],appendSlides=[],cols=originalSlides.length;for(let i=0;i<loopedSlides;i+=1){const appendIndex=i%cols;appendSlides.push(originalSlides[appendIndex]);const prependIndex=(cols-1-i%cols+cols)%cols;prependSlides.unshift(originalSlides[prependIndex])}for(let i=0;i<appendSlides.length;i+=1){const clone=appendSlides[i].cloneNode(!0);clone&&(clone.classList.add("swiper-slide-duplicate"),clone.setAttribute("data-swiper-slide-index",appendSlides[i].getAttribute("data-swiper-slide-index")),slidesEl.appendChild(clone))}for(let i=prependSlides.length-1;i>=0;i-=1){const clone=prependSlides[i].cloneNode(!0);clone&&(clone.classList.add("swiper-slide-duplicate"),clone.setAttribute("data-swiper-slide-index",prependSlides[i].getAttribute("data-swiper-slide-index")),slidesEl.prepend(clone))}swiper.recalcSlides(),swiper.updateSlides()}#loopFixDuringDrag(){const swiper=this.swiperInstance;if(!swiper||swiper.destroyed)return;const{slides,params,slidesGrid,snapGrid}=swiper,activeIndex=swiper.activeIndex,currentSlide=slides[activeIndex];if(!currentSlide)return;if(!currentSlide.classList.contains("swiper-slide-duplicate")){swiper.allowSlidePrev=!0,swiper.allowSlideNext=!0;return}const realIndex=parseInt(currentSlide.getAttribute("data-swiper-slide-index"),10);if(Number.isNaN(realIndex))return;const originalSlides=slides.filter(slide=>!slide.classList.contains("swiper-slide-duplicate"));if(originalSlides.length===0)return;const targetOriginalSlide=originalSlides.find(slide=>parseInt(slide.getAttribute("data-swiper-slide-index"),10)===realIndex);if(!targetOriginalSlide)return;const targetIndex=swiper.getSlideIndex(targetOriginalSlide);if(targetIndex<0||targetIndex===activeIndex)return;const grid=(params.centeredSlides||!1)&&snapGrid?snapGrid:slidesGrid,currentSlideTranslate=grid[activeIndex]||0,diff=(grid[targetIndex]||0)-currentSlideTranslate;swiper.touchEventsData&&(swiper.touchEventsData.startTranslate=swiper.touchEventsData.startTranslate-diff,swiper.touchEventsData.currentTranslate=swiper.touchEventsData.currentTranslate-diff,swiper.setTranslate(swiper.translate-diff)),swiper.updateActiveIndex(targetIndex),swiper.updateSlidesClasses(),swiper.allowSlidePrev=!0,swiper.allowSlideNext=!0}#loopFix(){const swiper=this.swiperInstance;if(!swiper||swiper.destroyed)return;const{slides,params,slidesGrid,snapGrid}=swiper,activeIndex=swiper.activeIndex,currentSlide=slides[activeIndex];if(!currentSlide)return;if(!currentSlide.classList.contains("swiper-slide-duplicate")){swiper.allowSlidePrev=!0,swiper.allowSlideNext=!0;return}const realIndex=parseInt(currentSlide.getAttribute("data-swiper-slide-index"),10);if(Number.isNaN(realIndex))return;const originalSlides=slides.filter(slide=>!slide.classList.contains("swiper-slide-duplicate"));if(originalSlides.length===0)return;const targetOriginalSlide=originalSlides.find(slide=>parseInt(slide.getAttribute("data-swiper-slide-index"),10)===realIndex);if(!targetOriginalSlide)return;const targetIndex=swiper.getSlideIndex(targetOriginalSlide);if(targetIndex<0||targetIndex===activeIndex)return;const grid=(params.centeredSlides||!1)&&snapGrid?snapGrid:slidesGrid,currentSlideTranslate=grid[activeIndex]||0,diff=(grid[targetIndex]||0)-currentSlideTranslate;swiper.touchEventsData&&(swiper.touchEventsData.startTranslate=swiper.touchEventsData.startTranslate-diff,swiper.touchEventsData.currentTranslate=swiper.touchEventsData.currentTranslate-diff),swiper.setTransition(0),requestAnimationFrame(()=>{swiper.destroyed||(swiper.slideTo(targetIndex,0,!1,!0),swiper.allowSlidePrev=!0,swiper.allowSlideNext=!0,requestAnimationFrame(()=>{swiper.destroyed||swiper.setTransition(params.speed||300)}))})}}customElements.get("icon-boxes-slider")||customElements.define("icon-boxes-slider",IconBoxesSlider);class ScrollProgressBar extends HTMLElement{constructor(){super(),this.mediaQuery=null,this.resizeObserver=null,this.scrollHandler=null,this.progressBar=null,this.targetPadding=0,this.initialProgress=0,this.mediaQueryHandler=null}get totalWidth(){return this.target?this.target.scrollWidth:0}get target(){return document.getElementById(this.getAttribute("target"))}connectedCallback(){if(this.mediaQuery=mediaQueryMobile,this.resizeObserver=new ResizeObserver(()=>{this.mediaQuery.matches&&this.init()}),this.mediaQueryHandler=event=>{event.matches?this.init():this.disable()},this.mediaQuery.addEventListener("change",this.mediaQueryHandler),!this.mediaQuery.matches){this.disable();return}this.init()}init(){if(!this.target){console.error("Target element not found");return}if(this.progressBar=this.querySelector(".progress-bar"),!this.progressBar){console.error("Progress bar element not found");return}const targetStyle=window.getComputedStyle(this.target);
1this.targetPadding=parseFloat(targetStyle.paddingLeft)+parseFloat(targetStyle.paddingRight),this.resizeObserver.observe(this.target);const viewportWidth=this.target.clientWidth-this.targetPadding;if(this.totalWidth<=viewportWidth){this.disable();return}this.initialProgress=0,this.calculateInitialProgress(),this.scrollHandler=()=>{requestAnimationFrame(()=>this.updateProgress())},this.target.addEventListener("scroll",this.scrollHandler,{passive:!0}),this.style.display="block",this.updateProgress()}disable(){this.scrollHandler&&this.target&&this.target.removeEventListener("scroll",this.scrollHandler),this.style.display="none",this.progressBar&&(this.progressBar.style.width="0%"),this.target&&this.resizeObserver.unobserve(this.target)}disconnectedCallback(){this.mediaQuery&&this.mediaQueryHandler&&this.mediaQuery.removeEventListener("change",this.mediaQueryHandler),this.resizeObserver&&this.resizeObserver.disconnect(),this.disable()}calculateInitialProgress(){if(!this.target||this.totalWidth===0){this.initialProgress=0;return}const viewportWidth=this.target.clientWidth-this.targetPadding;this.initialProgress=viewportWidth/this.totalWidth*100,this.updateProgress()}updateProgress(){if(!this.target||!this.progressBar)return;const factor=document.documentElement.dir==="rtl"||document.body.dir==="rtl"?-1:1,viewportWidth=this.target.clientWidth-this.targetPadding,scrolled=factor*this.target.scrollLeft,maxScroll=this.totalWidth-viewportWidth;if(maxScroll<=0)return;const scrollProgress=scrolled/maxScroll*(100-this.initialProgress),totalProgress=this.initialProgress+scrollProgress,clampedProgress=Math.min(100,Math.max(this.initialProgress,totalProgress));this.progressBar.style.width=`${clampedProgress}%`}}customElements.get("scroll-progress-bar")||customElements.define("scroll-progress-bar",ScrollProgressBar);class ProgressTimeline extends Component{constructor(){super(),this.scrollHandler=null,this.rafId=null,this.lenis=null,this.intersectionObserver=null,this.isInViewport=!1,this._cachedTop=null,this._cachedHeight=null,this._cachedViewportHeight=window.innerHeight}connectedCallback(){super.connectedCallback(),this.#init(),this.#initParallax()}disconnectedCallback(){super.disconnectedCallback(),this.#destroyParallax()}#init(){const spinningBadge=this.querySelector(".spinning-icon-badge-block");if(spinningBadge){const size=spinningBadge.offsetWidth;this.style.setProperty("--media-padding-top",`${size/2}px`)}}#initParallax(){const secondaryImage=this.querySelector(".timeline-media__image--secondary");secondaryImage&&(secondaryImage.style.transform="translateY(20%)"),this.#setupIntersectionObserver(),this.#handleParallaxAnimation()}#setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(entries=>{this.isInViewport=entries[0].isIntersecting,this.isInViewport&&requestAnimationFrame(()=>{this.#runScrollFrameUpdates()})},{rootMargin:"100px"}),this.intersectionObserver.observe(this)}#handleParallaxAnimation(){this.lenis=getLenis(),this.scrollHandler=()=>{this.isInViewport&&(this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=requestAnimationFrame(()=>{this.#runScrollFrameUpdates(),this.rafId=null}))},this._resizeHandler=()=>{this._cachedViewportHeight=window.innerHeight,this._cachedTop=null},window.addEventListener("resize",this._resizeHandler,{passive:!0}),this.lenis?this.lenis.on("scroll",this.scrollHandler):window.addEventListener("scroll",this.scrollHandler,{passive:!0}),requestAnimationFrame(()=>{this.#runScrollFrameUpdates()})}#ensureLenisForScroll(){if(this.lenis||!this.scrollHandler)return;const retryLenis=getLenis();retryLenis&&(this.lenis=retryLenis,window.removeEventListener("scroll",this.scrollHandler),this.lenis.on("scroll",this.scrollHandler))}#runScrollFrameUpdates(){this.#ensureLenisForScroll(),this.#updateParallax(),this.#updateTimelineProgress()}#updateTimelineProgress(){if(!this.isInViewport)return;const progressEls=this.querySelectorAll(".timeline-block__progress");if(!progressEls.length)return;const viewportH=this._cachedViewportHeight,halfScreen=viewportH*.5,hostRect=this.getBoundingClientRect(),visibleTop=Math.max(hostRect.top,0),visibleBottom=Math.min(hostRect.bottom,viewportH),visibleHeight=Math.max(0,visibleBottom-visibleTop),sectionTopPastViewport=hostRect.top<0;if(visibleHeight<=0){for(const el of progressEls)el.style.setProperty("--progress","0%");return}if(!sectionTopPastViewport&&visibleHeight<halfScreen){for(const el of progressEls)el.style.setProperty("--progress","0%");return}const refY=halfScreen;for(const el of progressEls){const block=el.closest(".timeline-block");if(!block||!block.nextElementSibling)continue;const rect=block.getBoundingClientRect(),h=rect.height;if(h<=0)continue;let t;refY<=rect.top?t=0:refY>=rect.bottom?t=1:t=(refY-rect.top)/h;const pct=Math.round(t*1e3)/10;el.style.setProperty("--progress",`${pct}%`)}}#updateParallax(){const secondaryImage=this.querySelector(".timeline-media__image--secondary");if(!secondaryImage||!this.isInViewport)return;if(!this.lenis){const retryLenis=getLenis();retryLenis&&(this.lenis=retryLenis,window.removeEventListener("scroll",this.scrollHandler),this.lenis.on("scroll",this.scrollHandler))}const scrollTop=this.lenis?this.lenis.scroll:window.pageYOffset||document.documentElement.scrollTop,viewportHe
1ight=this._cachedViewportHeight;if(this._cachedTop===null){const componentRect=this.getBoundingClientRect();this._cachedTop=componentRect.top+scrollTop,this._cachedHeight=componentRect.height}const componentTop=this._cachedTop,componentBottom=componentTop+this._cachedHeight,startPoint=componentTop-viewportHeight,scrollRange=componentBottom-startPoint;if(scrollRange<=0){secondaryImage._lastTransform!=="translateY(20%)"&&(secondaryImage._lastTransform="translateY(20%)",secondaryImage.style.transform="translateY(20%)");return}const progress=Math.max(0,Math.min(1,(scrollTop-startPoint)/scrollRange)),beginY=20,rounded=Math.round((beginY+(-20-beginY)*progress)*10)/10;secondaryImage._lastY!==rounded&&(secondaryImage._lastY=rounded,secondaryImage.style.transform=`translateY(${rounded}%)`)}#destroyParallax(){this.intersectionObserver&&(this.intersectionObserver.disconnect(),this.intersectionObserver=null),this._resizeHandler&&(window.removeEventListener("resize",this._resizeHandler),this._resizeHandler=null),this.scrollHandler&&(this.lenis?this.lenis.off("scroll",this.scrollHandler):window.removeEventListener("scroll",this.scrollHandler),this.scrollHandler=null),this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=null);const secondaryImage=this.querySelector(".timeline-media__image--secondary");secondaryImage&&isMobileBreakpoint()&&(secondaryImage.style.transform="")}}customElements.get("progress-timeline")||customElements.define("progress-timeline",ProgressTimeline);class ProductRecentlyViewed extends HTMLElement{constructor(){super(),hasLocalStorage()&&this.#addToRecentlyViewed()}#addToRecentlyViewed(){if(!this.dataset.productId)return;const productId=parseInt(this.dataset.productId),items=getLocalStorage(CookieManager.PRODUCT_RECENTLY_VIEWED)||[];items.includes(productId)&&items.splice(items.indexOf(productId),1),items.unshift(productId),setLocalStorage(CookieManager.PRODUCT_RECENTLY_VIEWED,items.slice(0,20))}}customElements.get("product-recently-viewed")||customElements.define("product-recently-viewed",ProductRecentlyViewed);class BackToTop extends Component{#lenis=null;constructor(){super(),this.toggleVisibilityHandler=this.#toggleVisibility.bind(this)}connectedCallback(){super.connectedCallback(),this.#lenis=getLenis(),this.#lenis?this.#lenis.on("scroll",this.toggleVisibilityHandler):window.addEventListener("scroll",this.toggleVisibilityHandler,{passive:!0})}disconnectedCallback(){super.disconnectedCallback(),this.#lenis?this.#lenis.off("scroll",this.toggleVisibilityHandler):window.removeEventListener("scroll",this.toggleVisibilityHandler)}backToTop(event){event?.preventDefault(),window.scrollTo({top:0,behavior:"smooth"})}#toggleVisibility(){const shouldVisible=(this.#lenis?this.#lenis.scroll:window.scrollY)>400;this._wasVisible!==shouldVisible&&(this._wasVisible=shouldVisible,this.classList.toggle("show",shouldVisible))}}customElements.define("back-to-top",BackToTop);class CounterComponent extends Component{requiredRefs=["numberDisplay","numberPlaceholder"];#inViewStop=null;#endVal=0;#thousandsSep=",";#decimalSep=".";#decimalPlaces=0;#durationMs=2e3;#rAF=null;#startTime=null;static#easeOutExpo(t,b,c,d){return c*(-Math.pow(2,-10*t/d)+1)*1024/1023+b}connectedCallback(){super.connectedCallback();const endVal=parseFloat(this.dataset.target,10);Number.isNaN(endVal)||endVal<0||(this.#endVal=endVal,this.#thousandsSep=this.dataset.thousandsSep??",",this.#decimalSep=this.dataset.decimalSep??".",this.#decimalPlaces=endVal%1!==0?2:0,this.#init(),mediaQueryMobile.addEventListener("change",this.#init.bind(this)),this.#inViewStop=inView(this,()=>this.#start(),{margin:"0px",amount:.1}))}disconnectedCallback(){this.#inViewStop?.(),this.#inViewStop=null,this.#rAF!=null&&cancelAnimationFrame(this.#rAF),this.#rAF=null,super.disconnectedCallback()}#init(){const{numberPlaceholder}=this.refs;requestAnimationFrame(()=>{numberPlaceholder.textContent=this.#formatValue(this.#endVal),this.style.minWidth=`${this.offsetWidth}px`})}#formatValue(val){const neg=val<0?"-":"",parts=Math.abs(val).toFixed(this.#decimalPlaces).split(".");let intPart=parts[0];const decPart=parts.length>
11?this.#decimalSep+parts[1]:"";return this.#thousandsSep!==""&&(intPart=intPart.replace(/\B(?=(\d{3})+(?!\d))/g,this.#thousandsSep)),neg+intPart+decPart}#printValue(val){const{numberDisplay}=this.refs;numberDisplay.textContent=this.#formatValue(val)}#count(timestamp){this.#startTime||(this.#startTime=timestamp);const progress=timestamp-this.#startTime,frameVal=CounterComponent.#easeOutExpo(progress,0,this.#endVal,this.#durationMs),clamped=Math.min(frameVal,this.#endVal),rounded=Number(clamped.toFixed(this.#decimalPlaces));this.#printValue(rounded),progress<this.#durationMs?this.#rAF=requestAnimationFrame(this.#count.bind(this)):(this.#printValue(this.#endVal),this.#rAF=null)}#start(){if(prefersReducedMotion()){this.#printValue(this.#endVal);return}this.#startTime=null,this.#rAF=requestAnimationFrame(this.#count.bind(this))}}customElements.define("counter-component",CounterComponent);class ParallaxComponent extends HTMLElement{#parallax=!1;#parallaxDirection="vertical";#parallaxMediaElements=[];#scrollStop=null;connectedCallback(){this.#parallax=this.dataset.parallax?parseFloat(this.dataset.parallax):!1,this.#parallaxDirection=this.dataset.parallaxDirection||"vertical",this.#parallaxMediaElements=Array.from(this.querySelectorAll("img, video, iframe, svg, deferred-media")),this.#init()}disconnectedCallback(){this.#scrollStop?.(),this.#scrollStop=null}#init(){if(prefersReducedMotion()||!this.#parallax)return;const{scale:parallaxScale,translate:parallaxTranslate}=this.#getParallaxValues(this.#parallax,this.#parallaxDirection);let parallaxTransformProperties={};this.#parallaxDirection==="vertical"?parallaxTransformProperties={transform:[`scale(${parallaxScale}) translateY(0)`,`scale(${parallaxScale}) translateY(${parallaxTranslate}%)`],transformOrigin:["bottom","bottom"]}:this.#parallaxDirection==="horizontal"?parallaxTransformProperties={transform:[`scale(${parallaxScale}) translateX(0)`,`scale(${parallaxScale}) translateX(${parallaxTranslate}%)`],transformOrigin:["right","right"]}:parallaxTransformProperties={transform:["scale(1)",`scale(${parallaxScale})`],transformOrigin:["center","center"]},this.#scrollStop=scroll(animate(this.#parallaxMediaElements,parallaxTransformProperties,{easing:"linear"}),{target:this,offset:["start end","end start"]})}#getParallaxValues(intensity,direction){if(direction==="zoom")return{scale:1+intensity*.35,translate:0};const translate=intensity*(direction==="horizontal"?30:45);return{scale:1+translate/100*(direction==="horizontal"?1.5:1.35),translate}}}customElements.define("parallax-component",ParallaxComponent); 2//# sourceMappingURL=/cdn/shop/t/26/assets/theme.js.map?v=29509262342422376931789446022
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.