/* * @license * Palo Alto Theme (c) Invisible Themes * * Modified versions of the theme code * are not supported by Groupthought. * */(function(scrollLock,Flickity,Sqrl,themeCurrency,Ajaxinate,AOS){"use strict";window.theme=window.theme||{},window.theme.sizes={mobile:480,small:768,large:1024,widescreen:1440},window.theme.keyboardKeys={TAB:"Tab",ENTER:"Enter",ESCAPE:"Escape",SPACE:"Space",LEFTARROW:"ArrowLeft",RIGHTARROW:"ArrowRight"},window.theme.focusable='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}const selectors={body:"body",main:"[data-main]",header:"[data-site-header]",shopifySection:".shopify-section",preventTransparentHeader:"[data-prevent-transparent-header]"},classes={transparentHeader:"transparent-header",siteHeaderTransparent:"site-header--transparent",hasTransparentHeader:"has-transparent-header"},attributes={dataTransparent:"data-transparent"},initTransparentHeader=()=>{const body=document.querySelector(selectors.body),header=body.querySelector(selectors.header),headerTransparent=header.getAttribute(attributes.dataTransparent)==="true",firstSection=body.querySelector(selectors.main).children[0];if(!firstSection)return;const preventTransparentHeader=firstSection.querySelector(`${selectors.preventTransparentHeader}:first-of-type`);isHeaderTransparent=headerTransparent&&firstSection.classList.contains(classes.transparentHeader)&&!preventTransparentHeader,isHeaderTransparent?(header.classList.add(classes.siteHeaderTransparent),body.classList.add(classes.hasTransparentHeader)):(header.classList.remove(classes.siteHeaderTransparent),body.classList.remove(classes.hasTransparentHeader))},selectors$1={header:"[data-site-header]",pageContainer:"[data-page-container]",templateListCollections:".template-list-collections",collectionFilters:"[data-collection-filters]"},classes$1={hasScrolled:"has-scrolled",headerSticky:"header--sticky",headerRelative:"header--relative"},setMainSpacing=()=>{document.body.classList.remove(classes$1.hasScrolled);const pageContainer=document.querySelector(selectors$1.pageContainer),header=document.querySelector(selectors$1.header),headerSection2=header.parentNode,isHeaderSticky=header.dataset.position=="fixed",isListCollectionsTemplate=document.querySelector(selectors$1.templateListCollections),hasCollectionFilters=document.querySelector(selectors$1.collectionFilters),headerHeight=isHeaderTransparent?0:parseInt(header.clientHeight);window.initialHeaderHeight=parseInt(header.dataset.height),pageContainer.style.paddingTop=headerHeight+"px",isHeaderSticky&&!hasCollectionFilters?headerSection2.classList.add(classes$1.headerSticky):headerSection2.classList.remove(classes$1.headerSticky),!isHeaderSticky&&isListCollectionsTemplate&&headerSection2.classList.add(classes$1.headerRelative),document.dispatchEvent(new CustomEvent("theme:scroll"),{bubbles:!1})};let screenOrientation=getScreenOrientation();function readHeights(){const h={};return h.windowHeight=Math.min(window.screen.height,window.innerHeight),h.footerHeight=getHeight('[data-section-type*="footer"]'),h.headerHeight=getHeight("[data-header-height]"),h.announcementBarHeight=getHeight("[data-announcement-bar]"),h.collectionStickyBarHeight=getHeight("[data-collection-sticky-bar]"),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars()}function setVars(){const{windowHeight,headerHeight,announcementBarHeight,footerHeight,collectionStickyBarHeight}=readHeights(),contentFullHeight=window.isHeaderTransparent&&checkFirstSectionTransparency()?windowHeight-announcementBarHeight:windowHeight-headerHeight-announcementBarHeight;document.documentElement.style.setProperty("--full-height",`${windowHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${contentFullHeight}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.documentElement.style.setProperty("--collection-sticky-bar-height",`${collectionStickyBarHeight}px`)}function resizeVars(){const{windowHeight,headerHeight,announcementBarHeight,footerHeight,collectionStickyBarHeight}=readHeights(),currentScreenOrientation=getScreenOrientation(),contentFullHeight=window.isHeaderTransparent&&checkFirstSectionTransparency()?windowHeight-announcementBarHeight:windowHeight-headerHeight-announcementBarHeight;currentScreenOrientation!==screenOrientation&&(document.documentElement.style.setProperty("--full-height",`${windowHeight}px`),screenOrientation=currentScreenOrientation),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${contentFullHeight}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.documentElement.style.setProperty("--collection-sticky-bar-height",`${collectionStickyBarHeight}px`)}function getHeight(selector){const el=document.querySelector(selector);return el?el.clientHeight:0}function checkFirstSectionTransparency(){return document.querySelector("[data-main]").firstElementChild.classList.contains("transparent-header")}function getScreenOrientation(){if(window.matchMedia("(orientation: portrait)").matches)return"portrait";if(window.matchMedia("(orientation: landscape)").matches)return"landscape"}const selectors$2={overflowBackground:"[data-overflow-background]",overflowFrame:"[data-overflow-frame]",overflowContent:"[data-overflow-content]",overflowContainer:"[data-overflow-container]",overflowWrapper:"[data-overflow-wrapper]"};function singles(frame,wrappers){let tallest=0;wrappers.forEach(wrap2=>{tallest=wrap2.offsetHeight>tallest?wrap2.offsetHeight:tallest});const images=frame.querySelectorAll(selectors$2.overflowBackground);[frame,...images].forEach(el=>{el.style.setProperty("min-height",`calc(${tallest}px + var(--header-height))`)})}function doubles(section){if(window.innerWidth{const wrappers=singleframe.querySelectorAll(selectors$2.overflowContent);singles(singleframe,wrappers)});return}let tallest=0;const frames=section.querySelectorAll(selectors$2.overflowFrame);section.querySelectorAll(selectors$2.overflowContent).forEach(content=>{content.offsetHeight>tallest&&(tallest=content.offsetHeight)});const images=section.querySelectorAll(selectors$2.overflowBackground);[...frames,...images].forEach(el=>{el.style.setProperty("min-height",`${tallest}px`)}),section.style.setProperty("min-height",`${tallest}px`)}function preventOverflow(container){const singleFrames=container.querySelectorAll(selectors$2.overflowContainer);singleFrames&&singleFrames.forEach(frame=>{const wrappers=frame.querySelectorAll(selectors$2.overflowContent);singles(frame,wrappers),document.addEventListener("theme:resize",()=>{singles(frame,wrappers)})});const doubleSections=container.querySelectorAll(selectors$2.overflowWrapper);doubleSections&&doubleSections.forEach(section=>{doubles(section),document.addEventListener("theme:resize",()=>{doubles(section)})})}window.lastWindowWidth=window.innerWidth;function dispatchResizeEvent(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),window.lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),window.lastWindowWidth=window.innerWidth)}function resizeListener(){window.addEventListener("resize",debounce(dispatchResizeEvent,50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimer=0;const classes$2={quickViewVisible:"js-quick-view-visible",cartDrawerOpen:"js-drawer-open-cart"};function dispatchScrollEvent(){const position=window.pageYOffset;position>prev?(down=!0,up=!1):position{scrollLockTimer&&clearTimeout(scrollLockTimer),scrollLock.disablePageScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")})}function unlock(e){const timeout=e.detail;timeout?scrollLockTimer=setTimeout(removeScrollLock,timeout):removeScrollLock()}function removeScrollLock(){document.body.classList.contains(classes$2.quickViewVisible)||document.body.classList.contains(classes$2.cartDrawerOpen)||(scrollLock.clearQueueScrollLocks(),scrollLock.enablePageScroll(),document.documentElement.removeAttribute("data-scroll-locked"))}function scrollListener(){let timeout;window.addEventListener("scroll",function(){timeout&&window.cancelAnimationFrame(timeout),timeout=window.requestAnimationFrame(function(){dispatchScrollEvent()})},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}const wrap=(toWrap,wrapperClass="",wrapperOption)=>{const wrapper=wrapperOption||document.createElement("div");return wrapper.classList.add(wrapperClass),wrapper.setAttribute("data-scroll-lock-scrollable",""),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap)};function wrapElements(container){document.querySelectorAll("table").forEach(table=>{wrap(table,"table-wrapper")})}function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function isTouch(){isTouchDevice()?(document.documentElement.className=document.documentElement.className.replace("no-touch","supports-touch"),window.theme.touch=!0):window.theme.touch=!1}function loading(){document.documentElement.classList.remove("is-loading")}resizeListener(),scrollListener(),isTouch();const headerFunctions=debounce(()=>{initTransparentHeader(),setMainSpacing()},300);window.addEventListener("load",()=>{setVarsOnResize(),preventOverflow(document),wrapElements(),loading()}),document.addEventListener("shopify:section:load",e=>{const container=e.target;window.dispatchEvent(new Event("resize"),{bubbles:!0}),preventOverflow(container),wrapElements(),setVarsOnResize(),headerFunctions()}),document.addEventListener("shopify:section:reorder",()=>{headerFunctions()}),document.addEventListener("shopify:section:unload",()=>{headerFunctions()}),document.addEventListener("theme:resize:width",setMainSpacing),function(){function n(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect();return t2.top>=0&&t2.bottom<=r2&&t2.left>=0&&t2.right<=i2}function t(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect(),u=t2.left>=0&&t2.left<=i2||t2.right>=0&&t2.right<=i2,f=t2.top>=0&&t2.top<=r2||t2.bottom>=0&&t2.bottom<=r2;return u&&f}function i(n2,i2){function r2(){var r3=t(n2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,n2))}var u=t(n2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}function r(t2,i2){function r2(){var r3=n(t2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,t2))}var u=n(t2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}window.visibilityHelper={isElementTotallyVisible:n,isElementPartiallyVisible:t,inViewportPartially:i,inViewportTotally:r}}(),window.Shopify=window.Shopify||{},window.Shopify.theme=window.Shopify.theme||{},window.Shopify.theme.sections=window.Shopify.theme.sections||{},window.Shopify.theme.sections.registered=window.Shopify.theme.sections.registered||{},window.Shopify.theme.sections.instances=window.Shopify.theme.sections.instances||[];const registered=window.Shopify.theme.sections.registered,instances=window.Shopify.theme.sections.instances,attributes$1={id:"data-section-id",type:"data-section-type"};class Registration{constructor(type=null,components=[]){this.type=type,this.components=validateComponentsArray(components),this.callStack={onLoad:[],onUnload:[],onSelect:[],onDeselect:[],onBlockSelect:[],onBlockDeselect:[],onReorder:[]},components.forEach(comp=>{for(const[key,value]of Object.entries(comp)){const arr=this.callStack[key];Array.isArray(arr)&&typeof value=="function"?arr.push(value):(console.warn(`Unregisted function: '${key}' in component: '${this.type}'`),console.warn(value))}})}getStack(){return this.callStack}}class Section{constructor(container,registration){this.container=validateContainerElement(container),this.id=container.getAttribute(attributes$1.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.warn(e)}}callFunctions(key,e=null){this.callStack[key].forEach(func=>{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}}function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(attributes$1.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+attributes$1.id+" attribute.");return container}function validateComponentsArray(value){if(typeof value<"u"&&typeof value!="object"||value===null)throw new TypeError("Theme Sections: The components object provided is not a valid");return value}function register(type,components){if(typeof type!="string")throw new TypeError("Theme Sections: The first argument for .register must be a string that specifies the type of the section being registered");if(typeof registered[type]<"u")throw new Error('Theme Sections: A section of type "'+type+'" has already been registered. You cannot register the same section type twice');Array.isArray(components)||(components=[components]);const section=new Registration(type,components);return registered[type]=section,registered}function load(types,containers){types=normalizeType(types),typeof containers>"u"&&(containers=document.querySelectorAll("["+attributes$1.type+"]")),containers=normalizeContainers(containers),types.forEach(function(type){const registration=registered[type];typeof registration>"u"||(containers=containers.filter(function(container){return isInstance(container)||container.getAttribute(attributes$1.type)===null?!1:container.getAttribute(attributes$1.type)!==type?!0:(instances.push(new Section(container,registration)),!1)}))})}function reorder(selector){var instancesToReorder=getInstances(selector);instancesToReorder.forEach(function(instance){instance.onReorder()})}function unload(selector){var instancesToUnload=getInstances(selector);instancesToUnload.forEach(function(instance){var index=instances.map(function(e){return e.id}).indexOf(instance.id);instances.splice(index,1),instance.onUnload()})}function getInstances(selector){var filteredInstances=[];if(NodeList.prototype.isPrototypeOf(selector)||Array.isArray(selector))var firstElement=selector[0];if(selector instanceof Element||firstElement instanceof Element){var containers=normalizeContainers(selector);containers.forEach(function(container){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.container===container}))})}else if(typeof selector=="string"||typeof firstElement=="string"){var types=normalizeType(selector);types.forEach(function(type){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.type===type}))})}return filteredInstances}function getInstanceById(id){for(var instance,i=0;i0}function normalizeType(types){return types==="*"?types=Object.keys(registered):typeof types=="string"?types=[types]:types.constructor===Section?types=[types.prototype.type]:Array.isArray(types)&&types[0].constructor===Section&&(types=types.map(function(Section2){return Section2.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers)&&containers.length>0?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$1.id+'="'+id+'"]');container!==null&&load(container.getAttribute(attributes$1.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$1.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&reorder(container)}),document.addEventListener("shopify:section:unload",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+attributes$1.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&unload(container)}),document.addEventListener("shopify:section:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onSelect(event)}),document.addEventListener("shopify:section:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onDeselect(event)}),document.addEventListener("shopify:block:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockSelect(event)}),document.addEventListener("shopify:block:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockDeselect(event)}));const throttle=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now=Date.now();next=clearTimeout(next),!prev2||now-prev2>=wait?(fn.apply(null,args),prev2=now):next=setTimeout(invokeFn.bind(null,...args),wait-(now-prev2))}},slideUp=(target,duration=500)=>{target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.boxSizing="border-box",target.style.height=target.offsetHeight+"px",target.offsetHeight,target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,window.setTimeout(()=>{target.style.display="none",target.style.removeProperty("height"),target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideDown=(target,duration=500,showDisplay="block",checkHidden=!0)=>{let display=window.getComputedStyle(target).display;if(checkHidden&&display!=="none")return;target.style.removeProperty("display"),display==="none"&&(display=showDisplay),target.style.display=display;let height=target.offsetHeight;target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,target.offsetHeight,target.style.boxSizing="border-box",target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.height=height+"px",target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),window.setTimeout(()=>{target.style.removeProperty("height"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)};function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;const selectors$3={single:"[data-collapsible-single]",trigger:"[data-collapsible-trigger]",content:"[data-collapsible-content]"},classes$3={isExpanded:"is-expanded"},attributes$2={expanded:"aria-expanded",controls:"aria-controls",triggerMobile:"data-collapsible-trigger-mobile",transitionOverride:"data-collapsible-transition-override"},settings={animationDelay:500},sections={};class Collapsible{constructor(container){this.container=container,this.single=this.container.querySelector(selectors$3.single),this.triggers=this.container.querySelectorAll(selectors$3.trigger),this.resetHeightTimer=0,this.isTransitioning=!1,this.transitionOverride=this.container.hasAttribute(attributes$2.transitionOverride),this.collapsibleToggleEvent=event=>throttle(this.collapsibleToggle(event),1250),this.init()}init(){this.triggers.forEach(trigger=>{trigger.addEventListener("click",this.collapsibleToggleEvent),trigger.addEventListener("keyup",this.collapsibleToggleEvent)})}collapsibleToggle(e){e.preventDefault();const trigger=e.target.matches(selectors$3.trigger)?e.target:e.target.closest(selectors$3.trigger),dropdownId=trigger.getAttribute(attributes$2.controls),dropdown=document.getElementById(dropdownId),triggerMobile=trigger.hasAttribute(attributes$2.triggerMobile),isExpanded=trigger.classList.contains(classes$3.isExpanded),isSpace=e.code===theme.keyboardKeys.SPACE,isEscape=e.code===theme.keyboardKeys.ESCAPE,isMobile=window.innerWidth{const isExpanded2=otherTrigger.classList.contains(classes$3.isExpanded);if(trigger==otherTrigger||!isExpanded2)return;const dropdownId2=otherTrigger.getAttribute(attributes$2.controls),dropdown2=document.getElementById(dropdownId2);this.closeItem(dropdown2,otherTrigger)}),isExpanded?this.closeItem(dropdown,trigger):this.openItem(dropdown,trigger))}openItem(dropdown,trigger){let dropdownHeight=dropdown.querySelector(selectors$3.content).offsetHeight;this.setDropdownHeight(dropdown,dropdownHeight,trigger,!0),trigger.classList.add(classes$3.isExpanded),trigger.setAttribute(attributes$2.expanded,!0),trigger.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"accordion"}}))}closeItem(dropdown,trigger){let dropdownHeight=dropdown.querySelector(selectors$3.content).offsetHeight;requestAnimationFrame(()=>{dropdownHeight=0,this.setDropdownHeight(dropdown,dropdownHeight,trigger,!1),trigger.classList.remove(classes$3.isExpanded)}),this.setDropdownHeight(dropdown,dropdownHeight,trigger,!1),trigger.classList.remove(classes$3.isExpanded),trigger.setAttribute(attributes$2.expanded,!1)}setDropdownHeight(dropdown,dropdownHeight,trigger,isExpanded){dropdown.style.height=`${dropdownHeight}px`,dropdown.setAttribute(attributes$2.expanded,isExpanded),dropdown.classList.toggle(classes$3.isExpanded,isExpanded),this.resetHeightTimer&&clearTimeout(this.resetHeightTimer),dropdownHeight==0&&(this.resetHeightTimer=setTimeout(()=>{dropdown.style.height=""},settings.animationDelay)),isExpanded?this.resetHeightTimer=setTimeout(()=>{dropdown.style.height="auto",this.isTransitioning=!1},settings.animationDelay):this.isTransitioning=!1,setTimeout(()=>{trigger.disabled=!1},settings.animationDelay)}onUnload(){this.triggers.forEach(trigger=>{trigger.removeEventListener("click",this.collapsibleToggleEvent),trigger.removeEventListener("keyup",this.collapsibleToggleEvent)})}}const collapsible={onLoad(){sections[this.id]=new Collapsible(this.container)},onUnload(){sections[this.id].onUnload()}},selectors$4={quantityHolder:"[data-quantity-holder]",quantityField:"[data-quantity-field]",quantityButton:"[data-quantity-button]",quantityMinusButton:"[data-quantity-minus]",quantityPlusButton:"[data-quantity-plus]"},classes$4={quantityReadOnly:"read-only",isDisabled:"is-disabled"};class QuantityCounter{constructor(holder,inCart=!1){this.holder=holder,this.quantityUpdateCart=inCart}init(){this.quantity=this.holder.querySelector(selectors$4.quantityHolder),this.quantity&&(this.field=this.quantity.querySelector(selectors$4.quantityField),this.buttons=this.quantity.querySelectorAll(selectors$4.quantityButton),this.increaseButton=this.quantity.querySelector(selectors$4.quantityPlusButton),this.quantityValue=Number(this.field.value||0),this.cartItemID=this.field.getAttribute("data-id"),this.maxValue=Number(this.field.getAttribute("max"))>0?Number(this.field.getAttribute("max")):null,this.minValue=Number(this.field.getAttribute("min"))>0?Number(this.field.getAttribute("min")):0,this.disableIncrease=this.disableIncrease.bind(this),this.emptyField=!1,this.updateQuantity=this.updateQuantity.bind(this),this.decrease=this.decrease.bind(this),this.increase=this.increase.bind(this),this.disableIncrease(),this.quantity.classList.contains(classes$4.quantityReadOnly)||(this.changeValueOnClick(),this.changeValueOnInput()))}changeValueOnClick(){this.buttons.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault();const clickedElement=event.target,isDescrease=clickedElement.matches(selectors$4.quantityMinusButton)||clickedElement.closest(selectors$4.quantityMinusButton),isIncrease=clickedElement.matches(selectors$4.quantityPlusButton)||clickedElement.closest(selectors$4.quantityPlusButton);isDescrease&&this.decrease(),isIncrease&&this.increase(),this.updateQuantity()})})}changeValueOnInput(){this.field.addEventListener("input",e=>{this.quantityValue=this.field.value,this.value===""&&(this.emptyField=!0),this.updateQuantity()})}updateQuantity(){this.maxValuethis.quantityValue&&(this.quantityValue=this.minValue),this.field.value=this.quantityValue,this.disableIncrease(),document.dispatchEvent(new CustomEvent("theme:cart:update")),this.quantityUpdateCart&&this.updateCart()}decrease(){if(this.quantityValue>this.minValue){this.quantityValue--;return}this.quantityValue=0}increase(){this.quantityValue++}disableIncrease(){this.increaseButton.classList.toggle(classes$4.isDisabled,this.quantityValue>=this.maxValue&&this.maxValue!==null)}updateCart(){const event=new CustomEvent("theme:cart:update",{bubbles:!0,detail:{id:this.cartItemID,quantity:this.quantityValue,valueIsEmpty:this.emptyField}});this.holder.dispatchEvent(event)}}const a11y={state:{firstFocusable:null,lastFocusable:null,trigger:null},trapFocus:function(options2){var focusableElements=Array.from(options2.container.querySelectorAll('button, [href], input, select, textarea, [tabindex]:not([tabindex^="-"])')).filter(function(element){var width=element.offsetWidth,height=element.offsetHeight;return width!==0&&height!==0&&getComputedStyle(element).getPropertyValue("display")!=="none"});focusableElements=focusableElements.filter(function(element){return!element.classList.contains("deferred-media__poster")}),this.state.firstFocusable=focusableElements[0],this.state.lastFocusable=focusableElements[focusableElements.length-1],options2.elementToFocus||(options2.elementToFocus=this.state.firstFocusable||options2.container),this._setupHandlers(),document.addEventListener("focusin",this._onFocusInHandler),document.addEventListener("focusout",this._onFocusOutHandler),options2.container.setAttribute("tabindex","-1"),options2.elementToFocus.focus()},removeTrapFocus:function(options2){const focusVisible=!document.body.classList.contains("no-outline");options2&&options2.container&&options2.container.removeAttribute("tabindex"),document.removeEventListener("focusin",this._onFocusInHandler),this.state.trigger&&focusVisible&&this.state.trigger.focus()},_manageFocus:function(evt){evt.code===theme.keyboardKeys.TAB&&(evt.target===this.state.lastFocusable&&!evt.shiftKey&&(evt.preventDefault(),this.state.firstFocusable.focus()),evt.target===this.state.firstFocusable&&evt.shiftKey&&(evt.preventDefault(),this.state.lastFocusable.focus()))},_onFocusOut:function(){document.removeEventListener("keydown",this._manageFocusHandler)},_onFocusIn:function(evt){evt.target!==this.state.lastFocusable&&evt.target!==this.state.firstFocusable||document.addEventListener("keydown",this._manageFocusHandler)},_setupHandlers:function(){this._onFocusInHandler||(this._onFocusInHandler=this._onFocusIn.bind(this)),this._onFocusOutHandler||(this._onFocusOutHandler=this._onFocusIn.bind(this)),this._manageFocusHandler||(this._manageFocusHandler=this._manageFocus.bind(this))}};function getScript(url,callback,callbackError){let head=document.getElementsByTagName("head")[0],done=!1,script=document.createElement("script");script.src=url,script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")?(done=!0,callback()):callbackError()},head.appendChild(script)}const loaders={};window.isYoutubeAPILoaded=!1,window.isVimeoAPILoaded=!1;function loadScript(options2={}){if(options2.type||(options2.type="json"),options2.url)return loaders[options2.url]?loaders[options2.url]:getScriptWithPromise(options2.url,options2.type);if(options2.json)return loaders[options2.json]?Promise.resolve(loaders[options2.json]):window.fetch(options2.json).then(response=>response.json()).then(response=>(loaders[options2.json]=response,response));if(options2.name){const key="".concat(options2.name,options2.version);return loaders[key]?loaders[key]:loadShopifyWithPromise(options2)}else return Promise.reject()}function getScriptWithPromise(url,type){const loader=new Promise((resolve,reject)=>{type==="text"?fetch(url).then(response=>response.text()).then(data=>{resolve(data)}).catch(error=>{reject(error)}):getScript(url,function(){resolve()},function(){reject()})});return loaders[url]=loader,loader}function loadShopifyWithPromise(options2){const key="".concat(options2.name,options2.version),loader=new Promise((resolve,reject)=>{try{window.Shopify.loadFeatures([{name:options2.name,version:options2.version,onLoad:err=>{onLoadFromShopify(resolve,reject,err)}}])}catch(err){reject(err)}});return loaders[key]=loader,loader}function onLoadFromShopify(resolve,reject,err){return err?reject(err):resolve()}const selectors$5={videoIframe:"[data-video-id]"},classes$5={loaded:"loaded"},attributes$3={dataEnableSound:"data-enable-sound",dataEnableBackground:"data-enable-background",dataEnableAutoplay:"data-enable-autoplay",dataEnableLoop:"data-enable-loop",dataVideoId:"data-video-id",dataVideoType:"data-video-type"};class LoadVideoVimeo{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$5.videoIframe),this.player&&(this.videoID=this.player.getAttribute(attributes$3.dataVideoId),this.videoType=this.player.getAttribute(attributes$3.dataVideoType),this.enableBackground=this.player.getAttribute(attributes$3.dataEnableBackground)==="true",this.disableSound=this.player.getAttribute(attributes$3.dataEnableSound)==="false",this.enableAutoplay=this.player.getAttribute(attributes$3.dataEnableAutoplay)!=="false",this.enableLoop=this.player.getAttribute(attributes$3.dataEnableLoop)!=="false",this.videoType=="vimeo"&&this.init())}init(){this.loadVimeoPlayer()}loadVimeoPlayer(){const oembedUrl="https://vimeo.com/api/oembed.json",vimeoUrl="https://vimeo.com/"+this.videoID;let paramsString="";const state=this.player,params={url:vimeoUrl,background:this.enableBackground,muted:this.disableSound,autoplay:this.enableAutoplay,loop:this.enableLoop};for(let key in params)paramsString+=encodeURIComponent(key)+"="+encodeURIComponent(params[key])+"&";fetch(`${oembedUrl}?${paramsString}`).then(response=>response.json()).then(function(data){state.innerHTML=data.html,setTimeout(function(){state.parentElement.classList.add(classes$5.loaded)},1e3)}).catch(function(){console.log("error")})}}const selectors$6={videoIframe:"[data-video-id]",videoWrapper:".video-wrapper",youtubeWrapper:"[data-youtube-wrapper]"},attributes$4={dataSectionId:"data-section-id",dataEnableSound:"data-enable-sound",dataHideOptions:"data-hide-options",dataCheckPlayerVisibility:"data-check-player-visibility",dataVideoId:"data-video-id",dataVideoType:"data-video-type"},classes$6={loaded:"loaded"},players=[];class LoadVideoYT{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$6.videoIframe),this.player&&(this.videoOptionsVars={},this.videoID=this.player.getAttribute(attributes$4.dataVideoId),this.videoType=this.player.getAttribute(attributes$4.dataVideoType),this.videoType=="youtube"&&(this.checkPlayerVisibilityFlag=this.player.getAttribute(attributes$4.dataCheckPlayerVisibility)==="true",this.playerID=this.player.querySelector(selectors$6.youtubeWrapper)?this.player.querySelector(selectors$6.youtubeWrapper).id:this.player.id,this.player.hasAttribute(selectors$6.dataHideOptions)&&(this.videoOptionsVars={cc_load_policy:0,iv_load_policy:3,modestbranding:1,playsinline:1,autohide:0,controls:0,branding:0,showinfo:0,rel:0,fs:0,wmode:"opaque"}),this.init(),this.container.addEventListener("touchstart",function(e){if(e.target.matches(selectors$6.videoWrapper)||e.target.closest(selectors$6.videoWrapper)){const playerID=e.target.querySelector(selectors$6.videoIframe).id;players[playerID].playVideo()}})))}init(){window.isYoutubeAPILoaded?this.loadYoutubePlayer():loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadYoutubePlayer())}loadYoutubePlayer(){const currentYoutubeOptions={...{height:"720",width:"1280",playerVars:this.videoOptionsVars,events:{onReady:event=>{const eventIframe=event.target.getIframe(),id=eventIframe.id,enableSound=document.querySelector(`#${id}`).getAttribute(attributes$4.dataEnableSound)==="true";eventIframe.setAttribute("tabindex","-1"),enableSound?event.target.unMute():event.target.mute(),event.target.playVideo(),this.checkPlayerVisibilityFlag&&(this.checkPlayerVisibility(id),window.addEventListener("scroll",throttle(()=>{this.checkPlayerVisibility(id)},150)))},onStateChange:event=>{event.data==0&&event.target.playVideo(),event.data==1&&event.target.getIframe().parentElement.classList.add(classes$6.loaded)}}}};currentYoutubeOptions.videoId=this.videoID,this.videoID.length&&YT.ready(()=>{players[this.playerID]=new YT.Player(this.playerID,currentYoutubeOptions)}),window.isYoutubeAPILoaded=!0}checkPlayerVisibility(id){let playerID;if(typeof id=="string")playerID=id;else if(id.data!=null)playerID=id.data.id;else return;const playerElement=document.getElementById(playerID+"-container");if(!playerElement)return;const player=players[playerID],box=playerElement.getBoundingClientRect();let isVisible=visibilityHelper.isElementPartiallyVisible(playerElement)||visibilityHelper.isElementTotallyVisible(playerElement);box.top<0&&playerElement.clientHeight+box.top>=0&&(isVisible=!0),isVisible&&player&&typeof player.playVideo=="function"?player.playVideo():!isVisible&&player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}onUnload(){const playerID="youtube-"+this.container.getAttribute(attributes$4.dataSectionId);players[playerID]&&players[playerID].destroy()}}const selectors$7={notificationForm:"[data-notification-form]",notification:"[data-notification]",popupClose:"[data-popup-close]"},classes$7={popupSuccess:"pswp--success",notificationPopupVisible:"notification-popup-visible"};class LoadNotification{constructor(popup,pswpElement){this.popup=popup,this.pswpElement=pswpElement,this.notificationForm=null,this.notificationStopSubmit=!0,this.sessionStorage=window.sessionStorage;const notificationWrapper=this.pswpElement.querySelector(selectors$7.notification);this.outerCloseEvent=e=>{notificationWrapper.contains(e.target)||this.popup.close()},this.init()}init(){this.popup.listen("preventDragEvent",(e,isDown,preventObj)=>{preventObj.prevent=!1});const notificationFormSuccess=window.location.search.indexOf("?customer_posted=true")!==-1;this.notificationForm=this.pswpElement.querySelector(selectors$7.notificationForm);const closeBtn=this.pswpElement.querySelector(selectors$7.popupClose);document.body.classList.add(classes$7.notificationPopupVisible),this.pswpElement.addEventListener("mousedown",()=>{this.popup.framework.unbind(window,"pointermove pointerup pointercancel",this.popup)}),notificationFormSuccess&&this.pswpElement.classList.add(classes$7.popupSuccess),this.notificationForm.addEventListener("submit",e=>this.notificationSubmitEvent(e)),this.pswpElement.addEventListener("click",this.outerCloseEvent),closeBtn.addEventListener("click",()=>{this.popup.close()}),this.popup.listen("destroy",()=>{this.notificationRemoveStorage(),this.pswpElement.removeEventListener("click",this.outerCloseEvent),document.body.classList.remove(classes$7.notificationPopupVisible)})}notificationSubmitEvent(e){this.notificationStopSubmit&&(e.preventDefault(),this.notificationRemoveStorage(),this.notificationWriteStorage(),this.notificationStopSubmit=!1,this.notificationForm.submit())}notificationWriteStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem("notification_form_id",this.notificationForm.id)}notificationRemoveStorage(){this.sessionStorage.removeItem("notification_form_id")}}function flickitySmoothScrolling(slider2){const flkty=Flickity.data(slider2);flkty&&(flkty.on("dragStart",(event,pointer)=>{document.ontouchmove=function(e){e.preventDefault()}}),flkty.on("dragEnd",(event,pointer)=>{document.ontouchmove=function(e){return!0}}))}const hosts={html5:"html5",youtube:"youtube",vimeo:"vimeo"},selectors$8={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productMediaWrapper:"[data-product-single-media-wrapper]",mediaContainer:"[data-video]",mediaHidden:".media--hidden"},classes$8={mediaHidden:"media--hidden"},attributes$5={loaded:"loaded",sectionId:"data-section-id",dataAutoplayVideo:"data-autoplay-video",mediaId:"data-media-id"};class ProductVideo{constructor(container){this.container=container,this.id=this.container.getAttribute(attributes$5.sectionId),this.autoplayVideo=this.container.getAttribute(attributes$5.dataAutoplayVideo)==="true",this.players={},this.init()}init(){this.container.querySelectorAll(selectors$8.mediaContainer).forEach(mediaContainer=>{const deferredMediaButton=mediaContainer.querySelector(selectors$8.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",this.loadContent.bind(this,mediaContainer)),this.autoplayVideo&&this.loadContent(mediaContainer)})}loadContent(mediaContainer){if(mediaContainer.querySelector(selectors$8.deferredMedia).getAttribute(attributes$5.loaded))return;const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const mediaId=mediaContainer.dataset.mediaId,element=content.querySelector("video, iframe"),host=this.hostFromVideoElement(element),deferredMedia=mediaContainer.querySelector(selectors$8.deferredMedia);deferredMedia.appendChild(element),deferredMedia.setAttribute("loaded",!0),this.players[mediaId]={mediaId,sectionId:this.id,container:mediaContainer,element,host,ready:()=>{this.createPlayer(mediaId)}};const video=this.players[mediaId];switch(video.host){case hosts.html5:this.loadVideo(video,hosts.html5);break;case hosts.vimeo:window.isVimeoAPILoaded?this.loadVideo(video,hosts.vimeo):loadScript({url:"https://player.vimeo.com/api/player.js"}).then(()=>this.loadVideo(video,hosts.vimeo));break;case hosts.youtube:window.isYoutubeAPILoaded?this.loadVideo(video,hosts.youtube):loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadVideo(video,hosts.youtube));break}}hostFromVideoElement(video){if(video.tagName==="VIDEO")return hosts.html5;if(video.tagName==="IFRAME"){if(/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src))return hosts.youtube;if(video.src.includes("vimeo.com"))return hosts.vimeo}return null}loadVideo(video,host){video.host===host&&video.ready()}createPlayer(mediaId){const video=this.players[mediaId];switch(video.host){case hosts.html5:video.element.addEventListener("play",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),video.element.addEventListener("pause",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),this.autoplayVideo&&this.observeVideo(video,mediaId);break;case hosts.vimeo:video.player=new Vimeo.Player(video.element),video.player.play(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}),window.isVimeoAPILoaded=!0,video.player.on("play",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),video.player.on("pause",()=>{video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),this.autoplayVideo&&this.observeVideo(video,mediaId);break;case hosts.youtube:if(video.host==hosts.youtube&&video.player)return;YT.ready(()=>{const videoId=video.container.dataset.videoId;video.player=new YT.Player(video.element,{videoId,events:{onReady:event=>{event.target.playVideo(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})},onStateChange:event=>{event.data==1&&video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}),event.data==2&&video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0}),event.data==0&&video.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}}}),window.isYoutubeAPILoaded=!0,this.autoplayVideo&&this.observeVideo(video,mediaId)});break}video.container.addEventListener("theme:media:visible",event=>this.onVisible(event)),video.container.addEventListener("theme:media:hidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event))}observeVideo(video){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{const outsideViewport=entry.intersectionRatio==0,isVisible=!video.element.closest(selectors$8.mediaHidden);outsideViewport?this.pauseVideo(video):isVisible&&this.playVideo(video)})},{threshold:0}).observe(video.element)}playVideo(video){video.player&&video.player.playVideo?video.player.playVideo():video.element&&video.element.play?video.element.play():video.player&&video.player.play&&video.player.play(),video.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}pauseVideo(video){video.player&&video.player.pauseVideo?video.player.playerInfo.playerState=="1"&&video.player.pauseVideo():video.player&&video.player.pause?video.player.pause():video.element&&!video.element.paused&&video.element?.pause()}onHidden(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];this.pauseVideo(video)}}onVisible(event){if(typeof event.target.dataset.mediaId<"u"){const mediaId=event.target.dataset.mediaId,video=this.players[mediaId];setTimeout(()=>{this.playVideo(video)},50),this.pauseOtherMedia(mediaId)}}pauseOtherMedia(mediaId){const currentMedia=`[${attributes$5.mediaId}="${mediaId}"]`,otherMedia=document.querySelectorAll(`${selectors$8.productMediaWrapper}:not(${currentMedia})`);otherMedia.length&&otherMedia.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$8.mediaHidden)})}}const showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)},hideElement=elem=>{elem&&(elem.style.display="none")},selectors$9={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},scrollTo=elementTop=>{const headerHeight=document.querySelector(selectors$9.headerSticky)&&document.querySelector(selectors$9.headerHeight)?document.querySelector(selectors$9.headerHeight).getBoundingClientRect().height:0;window.scrollTo({top:elementTop+window.scrollY-headerHeight,left:0,behavior:"smooth"})};function Listeners(){this.entries=[]}Listeners.prototype.add=function(element,event,fn){this.entries.push({element,event,fn}),element.addEventListener(event,fn)},Listeners.prototype.removeAll=function(){this.entries=this.entries.filter(function(listener){return listener.element.removeEventListener(listener.event,listener.fn),!1})};function getVariantFromSerializedArray(product,collection){_validateProductStructure(product);var optionArray=_createOptionArrayFromOptionCollection(product,collection);return getVariantFromOptionArray(product,optionArray)}function getVariantFromOptionArray(product,options2){_validateProductStructure(product),_validateOptionsArray(options2);var result=product.variants.filter(function(variant){return options2.every(function(option,index){return variant.options[index]===option})});return result[0]||null}function _createOptionArrayFromOptionCollection(product,collection){_validateProductStructure(product),_validateSerializedArray(collection);var optionArray=[];return collection.forEach(function(option){for(var i=0;i"u"?Function.prototype.bind():function(event){event.dataset=this.getFormState(),this._setIdInputValue(event.dataset.variant),cb(event)}.bind(this)}_initInputs(selector,cb){var elements=Array.prototype.slice.call(this.element.querySelectorAll(selector));return elements.map(function(element){return this._listeners.add(element,"change",this._onFormEvent(cb)),element}.bind(this))}_serializeInputValues(inputs,transform){return inputs.reduce(function(options2,input){return(input.checked||input.type!=="radio"&&input.type!=="checkbox")&&options2.push(transform({name:input.name,value:input.value})),options2},[])}_validateProductObject(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(typeof product.variants[0].options>"u")throw new TypeError("Product object is invalid. Make sure you use the product object that is output from {{ product | json }} or from the http://[your-product-url].js route");return product}}const selectors$b={list:"[data-store-availability-list]"},defaults={close:".js-modal-close",open:".js-modal-open-store-availability-modal",openClass:"modal--is-active",openBodyClass:"modal--is-visible",closeModalOnClick:!1,scrollIntoView:!1};class Modals{constructor(id,options2){if(this.modal=document.getElementById(id),!this.modal)return!1;this.nodes={parents:[document.querySelector("html"),document.body]},this.config=Object.assign(defaults,options2),this.modalIsOpen=!1,this.focusOnOpen=this.config.focusOnOpen?document.getElementById(this.config.focusOnOpen):this.modal,this.openElement=document.querySelector(this.config.open),this.a11y=a11y,this.init()}init(){this.openElement.addEventListener("click",this.open.bind(this)),this.modal.querySelector(this.config.close).addEventListener("click",this.closeModal.bind(this))}open(evt){let externalCall=!1;if(evt?evt.preventDefault():externalCall=!0,this.modalIsOpen&&!externalCall){this.closeModal();return}this.modal.classList.add(this.config.openClass),this.nodes.parents.forEach(node=>{node.classList.add(this.config.openBodyClass)}),this.modalIsOpen=!0;const scrollableElement=document.querySelector(selectors$b.list);document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:scrollableElement})),this.config.scrollIntoView&&this.scrollIntoView(),this.bindEvents(),this.a11y.trapFocus({container:this.modal})}closeModal(){if(!this.modalIsOpen)return;document.activeElement.blur(),this.modal.classList.remove(this.config.openClass);var self=this;this.nodes.parents.forEach(function(node){node.classList.remove(self.config.openBodyClass)}),this.modalIsOpen=!1,this.openElement.focus(),this.unbindEvents(),this.a11y.removeTrapFocus({container:this.modal});const timeout=400;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:timeout}))}bindEvents(){this.keyupHandler=this.keyupHandler.bind(this),this.clickHandler=this.clickHandler.bind(this),document.body.addEventListener("keyup",this.keyupHandler),document.body.addEventListener("click",this.clickHandler)}unbindEvents(){document.body.removeEventListener("keyup",this.keyupHandler),document.body.removeEventListener("click",this.clickHandler)}keyupHandler(event){event.code===theme.keyboardKeys.ESCAPE&&this.closeModal()}clickHandler(event){this.config.closeModalOnClick&&!this.modal.contains(event.target)&&!event.target.matches(this.config.open)&&this.closeModal()}scrollIntoView(){this.focusOnOpen.scrollIntoView({behavior:"smooth"})}}const selectors$c={body:"body",storeAvailabilityModal:"[data-store-availability-modal]",storeAvailabilityModalOpen:"[data-store-availability-modal-open]",storeAvailabilityModalClose:"[data-store-availability-modal-close]",storeAvailabilityModalProductTitle:"[data-store-availability-modal-product__title]"},classes$9={openClass:"store-availabilities-modal--active"};class StoreAvailability{constructor(container){this.container=container}updateContent(variantId,productTitle){this._fetchStoreAvailabilities(variantId,productTitle)}clearContent(){this.container.innerHTML=""}_initModal(){return new Modals("StoreAvailabilityModal",{close:selectors$c.storeAvailabilityModalClose,open:selectors$c.storeAvailabilityModalOpen,closeModalOnClick:!0,openClass:classes$9.openClass,scrollIntoView:!1})}_fetchStoreAvailabilities(variantId,productTitle){const variantSectionUrl="/variants/"+variantId+"/?section_id=store-availability";this.clearContent();const self=this;fetch(variantSectionUrl).then(function(response){return response.text()}).then(function(storeAvailabilityHTML){const body=document.querySelector(selectors$c.body);let storeAvailabilityModal=body.querySelector(selectors$c.storeAvailabilityModal);if(storeAvailabilityModal&&storeAvailabilityModal.remove(),self.container.innerHTML=storeAvailabilityHTML,self.container.innerHTML=self.container.firstElementChild.innerHTML,self.container.firstElementChild.innerHTML.trim()===""){self.clearContent();return}self.container.querySelector(selectors$c.storeAvailabilityModalOpen)&&(self.modal=self._initModal(),self._updateProductTitle(productTitle),storeAvailabilityModal=self.container.querySelector(selectors$c.storeAvailabilityModal),storeAvailabilityModal&&body.appendChild(storeAvailabilityModal))})}_updateProductTitle(productTitle){const storeAvailabilityModalProductTitle=this.container.querySelector(selectors$c.storeAvailabilityModalProductTitle);storeAvailabilityModalProductTitle.textContent=productTitle}}const selectors$d={form:"[data-product-form]",optionPosition:"[data-option-position]",optionInput:'[name^="options"], [data-popout-option]'},classes$a={soldOut:"sold-out",unavailable:"unavailable"},attributes$6={optionPosition:"data-option-position",selectOptionValue:"data-value"};class SelloutVariants{constructor(container,productJSON){this.container=container,this.productJSON=productJSON,this.form=this.container.querySelector(selectors$d.form),this.formData=new FormData(this.form),this.optionElements=this.container.querySelectorAll(selectors$d.optionInput),this.productJSON&&this.form&&this.init()}init(){this.update()}update(){this.getCurrentState(),this.optionElements.forEach(el=>{const val=el.value||el.getAttribute(attributes$6.selectOptionValue),optionSelector=el.closest(selectors$d.optionPosition);if(!optionSelector)return;const positionString=optionSelector.getAttribute(attributes$6.optionPosition),position=parseInt(positionString,10)-1;let newVals=[...this.selections];newVals[position]=val;const found=this.productJSON.variants.find(element=>{let perfectMatch=!0;for(let index=0;index"u"?el.parentElement.classList.add(classes$a.unavailable):found?.available===!1&&el.parentElement.classList.add(classes$a.soldOut)})}getCurrentState(){this.formData=new FormData(this.form),this.selections=[];for(var value of this.formData.entries())value[0].includes("options[")&&this.selections.push(value[1])}}const settings$1={templateIndex:1},classes$b={popupNotification:"pswp--notification pswp--not-close-btn"},attributes$7={notificationPopup:"data-notification-popup"},options={history:!1,focus:!1,mainClass:classes$b.popupNotification,closeOnVerticalDrag:!1};class NotificationPopup{constructor(button){this.button=button,this.a11y=a11y,this.notificationPopupHtml=this.button.getAttribute(attributes$7.notificationPopup),this.notificationPopupHtml.trim()!==""&&this.init()}init(){const items=[{html:this.notificationPopupHtml}];this.a11y.state.trigger=this.button,new LoadPhotoswipe(items,options,settings$1.templateIndex)}}const selectors$e={product:"[data-product]",productForm:"[data-product-form]",addToCart:"[data-add-to-cart]",addToCartText:"[data-add-to-cart-text]",buyItNow:"[data-buy-it-now]",comparePrice:"[data-compare-price]",formWrapper:"[data-form-wrapper]",header:"[data-site-header]",originalSelectorId:"[data-product-select]",preOrderTag:"_preorder",priceWrapper:"[data-price-wrapper]",priceOffWrap:"[data-price-off]",priceOffType:"[data-price-off-type]",priceOffAmount:"[data-price-off-amount]",productSlide:"[data-product-slide]",productImage:"[data-product-image]",productMediaSlider:"[data-product-single-media-slider]",productJson:"[data-product-json]",productPrice:"[data-product-price]",unitPrice:"[data-product-unit-price]",unitBase:"[data-product-base]",unitWrapper:"[data-product-unit]",subPrices:"[data-subscription-watch-price]",subSelectors:"[data-subscription-selectors]",subsToggle:"[data-toggles-group]",subsChild:"data-group-toggle",subDescription:"[data-plan-description]",remainingCount:"[data-remaining-count]",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]",idInput:'[name="id"]',storeAvailabilityContainer:"[data-store-availability-container]",upsellButton:"[data-upsell-btn]",sectionNode:".shopify-section",quickViewItem:"[data-quick-view-item]"},classes$c={hidden:"hidden",variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailabe",productPriceSale:"product__price--sale",priceWrapperHidden:"product__price--hidden",remainingLow:"count-is-low",remainingIn:"count-is-in",remainingOut:"count-is-out",remainingUnavailable:"count-is-unavailable"},attributes$8={productImageId:"data-image-id",tallLayout:"data-tall-layout",dataEnableHistoryState:"data-enable-history-state",notificationPopup:"data-notification-popup"};class ProductAddForm{constructor(container){if(this.container=container,this.product=this.container.querySelector(selectors$e.product),this.productForm=this.container.querySelector(selectors$e.productForm),this.tallLayout=this.container.getAttribute(attributes$8.tallLayout)==="true",!this.product||!this.productForm){new QuantityCounter(this.container).init();return}this.storeAvailabilityContainer=this.container.querySelector(selectors$e.storeAvailabilityContainer),this.enableHistoryState=this.container.getAttribute(attributes$8.dataEnableHistoryState)==="true",this.hasUnitPricing=this.container.querySelector(selectors$e.unitWrapper),this.subSelectors=this.container.querySelector(selectors$e.subSelectors),this.subPrices=this.container.querySelector(selectors$e.subPrices),this.priceOffWrap=this.container.querySelector(selectors$e.priceOffWrap),this.priceOffAmount=this.container.querySelector(selectors$e.priceOffAmount),this.priceOffType=this.container.querySelector(selectors$e.priceOffType),this.planDecription=this.container.querySelector(selectors$e.subDescription),this.latestVariantId="",this.latestVariantTitle="",this.sellout=null,this.sessionStorage=window.sessionStorage,this.remainingWrapper=this.container.querySelector(selectors$e.remainingWrapper),this.remainingWrapper&&(this.remainingMaxInt=parseInt(this.remainingWrapper.dataset.remainingMax,10),this.remainingCount=this.container.querySelector(selectors$e.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$e.remainingJSON),this.remainingJSON=null,this.remainingJSONWrapper&&this.remainingJSONWrapper.innerHTML!==""&&(this.remainingJSON=JSON.parse(this.remainingJSONWrapper.innerHTML))),this.storeAvailabilityContainer&&(this.storeAvailability=new StoreAvailability(this.storeAvailabilityContainer)),new QuantityCounter(this.container).init(),this.init()}init(){let productJSON=null;const productElemJSON=this.container.querySelector(selectors$e.productJson);productElemJSON&&(productJSON=productElemJSON.innerHTML),productJSON?(this.productJSON=JSON.parse(productJSON),this.linkForm(),this.sellout=new SelloutVariants(this.container,this.productJSON)):console.error("Missing product JSON")}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductForm(this.productForm,this.productJSON,{onOptionChange:this.onOptionChange.bind(this),onPlanChange:this.onPlanChange.bind(this)}),this.pushState(this.productForm.getFormState()),this.subsToggleListeners()}onOptionChange(evt){this.pushState(evt.dataset),this.updateProductImage(evt)}onPlanChange(evt){this.subPrices&&this.pushState(evt.dataset)}pushState(formState){this.productState=this.setProductState(formState),this.updateAddToCartState(formState),this.updateProductPrices(formState),this.updateSaleText(formState),this.updateSubscriptionText(formState),this.fireHookEvent(formState),this.updateRemaining(formState),this.sellout?.update(formState),this.enableHistoryState&&this.updateHistoryState(formState),this.storeAvailability&&(formState.variant?this.storeAvailability.updateContent(formState.variant.id,this.productForm.product.title):this.storeAvailability.clearContent())}updateAddToCartState(formState){const variant=formState.variant,priceWrapper=this.container.querySelectorAll(selectors$e.priceWrapper),addToCart=this.container.querySelectorAll(selectors$e.addToCart),addToCartText=this.container.querySelectorAll(selectors$e.addToCartText),formWrapper=this.container.querySelectorAll(selectors$e.formWrapper),buyItNow=this.container.querySelector(selectors$e.buyItNow);let addText=theme.strings.add_to_cart;this.productJSON.tags.includes(selectors$e.preOrderTag)&&(addText=theme.strings.preorder),priceWrapper.length&&priceWrapper.forEach(element=>{variant?element.classList.remove(classes$c.priceWrapperHidden):element.classList.add(classes$c.priceWrapperHidden)}),addToCart.length&&addToCart.forEach(element=>{if(!element.matches(selectors$e.upsellButton)&&(element.disabled=!0,buyItNow&&buyItNow.classList.add(classes$c.hidden),variant&&(element.disabled=!1,variant.available&&buyItNow&&buyItNow.classList.remove(classes$c.hidden),element.hasAttribute(attributes$8.notificationPopup)))){const notificationFormId=element.id.replace("AddToCart","NotificationForm"),formID=this.sessionStorage.getItem("notification_form_id");let notificationFormSubmitted=!1,variantId=variant.id,variantTitle=variant.title;if(formID){const sessionId=formID.substring(0,formID.lastIndexOf("--")),sessionVariantId=formID.split("--").slice(-1)[0];notificationFormSubmitted=notificationFormId===sessionId,notificationFormSubmitted&&(this.latestVariantId=variantId,this.latestVariantTitle=variantTitle,variantId=Number(sessionVariantId),this.productJSON.variants.forEach(variant2=>{variant2.id===variantId&&(variantTitle=variant2.title)}))}let notificationPopupHtml=element.getAttribute(attributes$8.notificationPopup);this.latestVariantId!=""&&this.latestVariantTitle!=""&&(notificationPopupHtml=notificationPopupHtml.replaceAll(this.latestVariantId,variantId),notificationPopupHtml=notificationPopupHtml.replaceAll(this.latestVariantTitle,variantTitle)),element.setAttribute(attributes$8.notificationPopup,notificationPopupHtml),notificationFormSubmitted&&(this.scrollToForm(this.product.closest(selectors$e.sectionNode)),new NotificationPopup(element)),this.latestVariantId=variantId,this.latestVariantTitle=variantTitle}}),addToCartText.length&&addToCartText.forEach(element=>{if(variant){if(variant.available)element.innerHTML=addText;else if(element.innerHTML=theme.strings.sold_out,element.parentNode.hasAttribute(attributes$8.notificationPopup)){if(element.closest(selectors$e.quickViewItem))return;element.innerHTML=`${theme.strings.sold_out} - ${theme.strings.newsletter_product_availability}`}}else element.innerHTML=theme.strings.unavailable}),formWrapper.length&&formWrapper.forEach(element=>{if(variant){variant.available?element.classList.remove(classes$c.variantSoldOut,classes$c.variantUnavailable):(element.classList.add(classes$c.variantSoldOut),element.classList.remove(classes$c.variantUnavailable));const formSelect=element.querySelector(selectors$e.originalSelectorId);formSelect&&(formSelect.value=variant.id)}else element.classList.add(classes$c.variantUnavailable),element.classList.remove(classes$c.variantSoldOut)})}updateHistoryState(formState){const variant=formState.variant,plan=formState.plan,location2=window.location.href;if(variant&&location2.includes("/product")){const url=new window.URL(location2),params=url.searchParams;params.set("variant",variant.id),plan&&plan.detail&&plan.detail.id&&this.productState.hasPlan?params.set("selling_plan",plan.detail.id):params.delete("selling_plan"),url.search=params.toString();const urlString=url.toString();window.history.replaceState({path:urlString},"",urlString)}}updateRemaining(formState){const variant=formState.variant,remainingClasses=[classes$c.remainingIn,classes$c.remainingOut,classes$c.remainingUnavailable,classes$c.remainingLow];if(variant&&this.remainingWrapper&&this.remainingJSON){const remaining=this.remainingJSON[variant.id];(remaining==="out"||remaining<1)&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$c.remainingOut)),(remaining==="in"||remaining>=this.remainingMaxInt)&&(this.remainingWrapper.classList.remove(...remainingClasses),this.remainingWrapper.classList.add(classes$c.remainingIn)),(remaining==="low"||remaining>0&&remaining{toggle.addEventListener("change",function(e){const val=e.target.value.toString(),selected=this.container.querySelector(`[${selectors$e.subsChild}="${val}"]`),groups=this.container.querySelectorAll(`[${selectors$e.subsChild}]`);if(selected){selected.classList.remove(classes$c.hidden);const first=selected.querySelector('[name="selling_plan"]');first.checked=!0,first.dispatchEvent(new Event("change"))}groups.forEach(group=>{group!==selected&&(group.classList.add(classes$c.hidden),group.querySelectorAll('[name="selling_plan"]').forEach(plan=>{plan.checked=!1,plan.dispatchEvent(new Event("change"))}))})}.bind(this))})}updateSaleText(formState){this.productState.planSale?this.updateSaleTextSubscription(formState):this.productState.onSale?this.updateSaleTextStandard(formState):this.priceOffWrap&&this.priceOffWrap.classList.add(classes$c.hidden)}updateSaleTextStandard(formState){if(!this.priceOffType)return;this.priceOffType.innerHTML=window.theme.strings.sale_badge_text||"sale";const variant=formState.variant;if(window.theme.settings.savingBadgeType&&window.theme.settings.savingBadgeType==="percentage"){const discountFloat=(variant.compare_at_price-variant.price)/variant.compare_at_price,discountInt=Math.floor(discountFloat*100);this.priceOffAmount.innerHTML=`${discountInt}%`}else{const discount=variant.compare_at_price-variant.price;this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat)}this.priceOffWrap.classList.remove(classes$c.hidden)}updateSaleTextSubscription(formState){this.priceOffType.innerHTML=window.theme.strings.subscription||"subscripton";const variant=formState.variant,adjustment=formState.plan.detail.price_adjustments[0],discount=adjustment.value;adjustment&&adjustment.value_type==="percentage"?this.priceOffAmount.innerHTML=`${discount}%`:adjustment&&adjustment.value_type==="price"?this.priceOffAmount.innerHTML=themeCurrency.formatMoney(variant.price-adjustment.value,theme.moneyFormat):this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat),this.priceOffWrap.classList.remove(classes$c.hidden)}updateSubscriptionText(formState){formState.plan&&this.planDecription&&formState.plan.detail.description!==null?(this.planDecription.innerHTML=formState.plan.detail.description,this.planDecription.classList.remove(classes$c.hidden)):this.planDecription&&this.planDecription.classList.add(classes$c.hidden)}updateProductPrices(formState){const variant=formState.variant,plan=formState.plan;this.container.querySelectorAll(selectors$e.priceWrapper).forEach(wrap2=>{const comparePriceEl=wrap2.querySelector(selectors$e.comparePrice),productPriceEl=wrap2.querySelector(selectors$e.productPrice);let comparePrice="",price="";this.productState.available&&(comparePrice=variant.compare_at_price,price=variant.price),this.productState.hasPlan&&(price=plan.allocation.price),this.productState.planSale&&(comparePrice=plan.allocation.compare_at_price,price=plan.allocation.price),comparePriceEl&&(this.productState.onSale||this.productState.planSale?(comparePriceEl.classList.remove(classes$c.hidden),productPriceEl.classList.add(classes$c.productPriceSale)):(comparePriceEl.classList.add(classes$c.hidden),productPriceEl.classList.remove(classes$c.productPriceSale)),comparePriceEl.innerHTML=theme.settings.currency_code_enable?themeCurrency.formatMoney(comparePrice,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(comparePrice,theme.moneyFormat)),price===0?productPriceEl.innerHTML=window.theme.strings.free:productPriceEl.innerHTML=theme.settings.currency_code_enable?themeCurrency.formatMoney(price,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(price,theme.moneyFormat)}),this.hasUnitPricing&&this.updateProductUnits(formState)}updateProductUnits(formState){const variant=formState.variant,plan=formState.plan;let unitPrice=null;if(variant&&variant.unit_price&&(unitPrice=variant.unit_price),plan&&plan.allocation&&plan.allocation.unit_price&&(unitPrice=plan.allocation.unit_price),unitPrice){const base=this.getBaseUnit(variant),formattedPrice=unitPrice===0?window.theme.strings.free:themeCurrency.formatMoney(unitPrice,theme.moneyFormat);this.container.querySelector(selectors$e.unitPrice).innerHTML=formattedPrice,this.container.querySelector(selectors$e.unitBase).innerHTML=base,showElement(this.container.querySelector(selectors$e.unitWrapper))}else hideElement(this.container.querySelector(selectors$e.unitWrapper))}fireHookEvent(formState){const variant=formState.variant;this.container.dispatchEvent(new CustomEvent("theme:variant:change",{detail:{variant},bubbles:!0}))}setProductState(dataset){const variant=dataset.variant,plan=dataset.plan,productState={available:!0,soldOut:!1,onSale:!1,showUnitPrice:!1,requiresPlan:!1,hasPlan:!1,planPerDelivery:!1,planSale:!1};return!variant||variant.requires_selling_plan&&!plan?productState.available=!1:(variant.available||(productState.soldOut=!0),variant.compare_at_price>variant.price&&(productState.onSale=!0),variant.unit_price&&(productState.showUnitPrice=!0),this.product&&this.product.requires_selling_plan&&(productState.requiresPlan=!0),plan&&this.subPrices&&(productState.hasPlan=!0,plan.allocation.per_delivery_price!==plan.allocation.price&&(productState.planPerDelivery=!0),variant.price>plan.allocation.price&&(productState.planSale=!0))),productState}updateProductImage(evt){const variant=evt.dataset.variant;if(!variant||!variant?.featured_media)return;const newImg=this.container.querySelector(`${selectors$e.productImage}[${attributes$8.productImageId}="${variant.featured_media.id}"]`),newImageParent=newImg?.closest(selectors$e.productSlide);if(newImageParent){const newImagePos=parseInt([...newImageParent.parentElement.children].indexOf(newImageParent)),imgSlider=this.container.querySelector(selectors$e.productMediaSlider),flkty=Flickity.data(imgSlider);if(flkty&&flkty.isActive){const variantSlide=imgSlider.querySelector(`[data-id="${variant.featured_media.id}"]`);if(variantSlide){const slideIndex=parseInt([...variantSlide.parentNode.children].indexOf(variantSlide));flkty.select(slideIndex)}return}if(this.tallLayout){const newImgTop=newImg.getBoundingClientRect().top;if(newImagePos===0&&newImgTop+window.scrollY>window.pageYOffset)return;document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),scrollTo(newImgTop)}}}scrollToForm(section){const headerHeight=document.querySelector(selectors$e.header).dataset.height;visibilityHelper.isElementPartiallyVisible(section)||visibilityHelper.isElementTotallyVisible(section)||setTimeout(()=>{const sectionTop=section.getBoundingClientRect().top-headerHeight;window.scrollTo({top:sectionTop,left:0,behavior:"smooth"})},400)}}const productFormSection={onLoad(){this.section=new ProductAddForm(this.container)}};function getSizedImageUrl(src,size){if(size===null)return src;if((typeof src>"u"||src===null)&&(src=window.theme.assets.noImage),size==="master")return removeProtocol(src);const match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif|webp)(\?v=\d+)?$/i);if(match){const prefix=src.split(match[0]),suffix=match[0];return removeProtocol(`${prefix[0]}_${size}${suffix}`)}else return null}function removeProtocol(path){return path.replace(/http(s)?:/,"")}function fetchProduct(handle){const requestRoute=`${theme.routes.root}products/${handle}.js`;return window.fetch(requestRoute).then(response=>response.json()).catch(e=>{console.error(e)})}const defaults$1={color:"ash"},selectors$f={swatch:"[data-swatch]",swatchColor:"[data-swatch-color]",template:"[data-swatch-template]",productBlock:"[data-product-block]",productImage:"[data-product-image]",productImageSecondary:"[data-product-image-secondary]",productImageHover:"[data-product-image-hover]",productId:"[data-product-id]",quickView:"[data-button-quick-view]",gridImage:"[data-grid-image]",link:"[data-grid-link]",loadHovers:"[data-load-hovers]"},classes$d={mediaVisible:"product__media--featured-visible",mediaHoverVisible:"product__media__hover-img--visible",noImage:"swatch__link--no-image"},attributes$9={swatch:"data-swatch",handle:"data-swatch-handle",label:"data-swatch-label",image:"data-swatch-image",imageId:"data-swatch-image-id",variant:"data-swatch-variant",index:"data-swatch-index",productId:"data-product-id",swatchVariant:"data-swatch-variant",variandId:"data-variant-id",href:"href",bgSet:"data-bgset",aspectRatio:"data-aspectratio",dataFetchedImage:"data-fetched-image",dataFetchedImageIndex:"data-fetched-image-index",dataGridImageDefault:"data-grid-image-default",dataGridImageTarget:"data-grid-image-target",dataGridImageTargetDefault:"data-grid-image-target-default"};let swatches={};class ColorMatch{constructor(options2={}){this.settings={...defaults$1,...options2},this.match=this.init()}getColor(){return this.match}init(){return loadScript({json:theme.assets.swatches}).then(colors=>this.matchColors(colors,this.settings.color)).catch(e=>{console.log("failed to load swatch colors script"),console.log(e)})}matchColors(colors,name){let bg="#E5E5E5",img=null;const path=theme.assets.base||"/",comparisonName=name.toLowerCase().replace(/\s/g,""),array=colors.colors;if(array){let indexArray=null;if(array.filter((colorObj,index)=>{if(Object.keys(colorObj).toString().toLowerCase().replace(/\s/g,"")===comparisonName)return indexArray=index,colorObj}).length&&indexArray!==null){const value=Object.values(array[indexArray])[0];bg=value,(value.includes(".jpg")||value.includes(".jpeg")||value.includes(".png")||value.includes(".svg"))&&(img=`${path}${value}`,bg="#888888")}}return{color:this.settings.color,path:img,hex:bg}}}class Swatch{constructor(element){this.element=element,this.swatchLink=this.element.nextElementSibling,this.colorString=element.getAttribute(attributes$9.swatch),this.image=this.element.getAttribute(attributes$9.image),this.imageId=this.element.getAttribute(attributes$9.imageId),this.variant=this.element.getAttribute(attributes$9.variant),this.outer=this.element.closest(selectors$f.productBlock),this.gridImage=null,this.imageDefault=null,this.hoverImages=[],this.loadHovers=null,new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.init()})}init(){this.setStyles(),this.variant&&this.outer&&(this.handleHovers(),this.handleClicks()),!this.image&&this.swatchLink&&this.swatchLink.classList.add(classes$d.noImage)}setStyles(){this.colorMatch&&this.colorMatch.hex&&this.element.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch&&this.colorMatch.path&&this.element.style.setProperty("background-image",`url(${this.colorMatch.path})`)}handleHovers(){this.swatchLink.addEventListener("mouseenter",()=>{if(this.imageReplace=null,this.imageId&&!this.outer.querySelector(`[${attributes$9.dataGridImageTarget}="${this.imageId}"]`)&&(this.gridImage=this.outer.querySelector(selectors$f.gridImage),this.image&&this.gridImage)){const ratio=window.devicePixelRatio||1,pixels=this.gridImage.offsetWidth*ratio,widthRounded=Math.ceil(pixels/180)*180;if((this.gridImage.hasAttribute(attributes$9.dataGridImageTargetDefault)?this.gridImage.getAttribute(attributes$9.dataGridImageTargetDefault):"")===this.imageId&&this.gridImage.hasAttribute(attributes$9.dataGridImageDefault)){this.imageReplace=this.gridImage.getAttribute(attributes$9.dataGridImageDefault);return}if(this.element.hasAttribute(attributes$9.dataFetchedImage))this.imageReplace=this.element.getAttribute(attributes$9.dataFetchedImage);else{const sizedImage=getSizedImageUrl(this.image,`${widthRounded}x`);window.fetch(sizedImage).then(response=>response.blob()).then(blob=>{const objectURL=URL.createObjectURL(blob);this.imageReplace=`url("${objectURL}")`,this.element.setAttribute(attributes$9.dataFetchedImage,this.imageReplace),this.element.hasAttribute(attributes$9.index)&&this.outer.hasAttribute(attributes$9.dataFetchedImageIndex)&&parseInt(this.element.getAttribute(attributes$9.index))===parseInt(this.outer.getAttribute(attributes$9.dataFetchedImageIndex))&&(this.replaceImages(),this.outer.removeAttribute(attributes$9.dataFetchedImageIndex))}).catch(error=>{console.log(`Error: ${error}`)})}}if(this.loadHovers=this.outer.querySelector(selectors$f.loadHovers),this.loadHovers&&!this.loadHovers?.hasAttribute("data-loaded")){const content=document.createElement("div");content.appendChild(this.loadHovers.querySelector("template").content.firstElementChild.cloneNode(!0)),this.loadHovers.appendChild(content),this.loadHovers.setAttribute("data-loaded",!0)}})}handleClicks(){this.swatchLink.addEventListener("click",event=>{event.preventDefault(),this.updateImagesAndLinksOnEvent()}),this.swatchLink.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ENTER&&(event.preventDefault(),this.updateImagesAndLinksOnEvent())})}updateImagesAndLinksOnEvent(){this.updateLinks(),this.replaceImages()}updateLinks(){this.linkElements=this.outer.querySelectorAll(selectors$f.link),this.quickView=this.outer.querySelector(selectors$f.quickView),this.linkElements.length&&this.linkElements.forEach(element=>{const destination=getUrlWithVariant(element.getAttribute("href"),this.variant);element.setAttribute("href",destination)}),this.quickView&&theme.settings.quickBuy==="quick_buy"&&this.quickView.setAttribute(attributes$9.variandId,this.variant)}replaceImages(){if(this.imageSecondary=this.outer.querySelector(selectors$f.productImageSecondary),this.outer.removeAttribute(attributes$9.dataFetchedImageIndex),!this.imageReplace&&this.element.hasAttribute(attributes$9.index)&&this.outer.setAttribute(attributes$9.dataFetchedImageIndex,parseInt(this.element.getAttribute(attributes$9.index))),this.imageReplace&&this.gridImage&&this.imageId){this.gridImage.setAttribute(attributes$9.dataGridImageTarget,this.imageId),this.gridImage.hasAttribute(attributes$9.dataGridImageDefault)||this.gridImage.setAttribute(attributes$9.dataGridImageDefault,window.getComputedStyle(this.gridImage).backgroundImage);const onAnimationEnd=()=>{requestAnimationFrame(()=>{this.gridImage.style.setProperty("background-image",this.imageReplace),requestAnimationFrame(()=>{this.imageSecondary.classList.remove(classes$d.mediaVisible)})}),this.imageSecondary.removeEventListener("animationend",onAnimationEnd)};requestAnimationFrame(()=>{this.imageSecondary.classList.add(classes$d.mediaVisible),this.imageSecondary.style.setProperty("background-image",this.imageReplace)}),this.imageSecondary.addEventListener("animationend",onAnimationEnd)}theme.settings.productGridHover==="image"&&(this.hoverImages=this.outer.querySelectorAll(selectors$f.productImageHover)),this.hoverImages.length>1&&this.hoverImages.forEach(hoverImage=>{hoverImage.classList.remove(classes$d.mediaHoverVisible),hoverImage.getAttribute(attributes$9.variandId)===this.variant?hoverImage.classList.add(classes$d.mediaHoverVisible):this.hoverImages[0].classList.add(classes$d.mediaHoverVisible)})}}class GridSwatch extends HTMLElement{constructor(){super(),this.handle=this.getAttribute(attributes$9.handle),this.label=this.getAttribute(attributes$9.label).trim().toLowerCase(),fetchProduct(this.handle).then(product=>{this.product=product,this.colorOption=product.options.find(element=>element.name.toLowerCase()===this.label||null),this.colorOption&&(this.swatches=this.colorOption.values,this.init())})}init(){this.swatchElements=this.querySelectorAll(selectors$f.swatch),this.swatchElements.forEach(el=>{new Swatch(el)})}}const makeSwatches=container=>{swatches=[],container.querySelectorAll(selectors$f.swatch).forEach(el=>{swatches.push(new Swatch(el))})},swatchSection={onLoad(){makeSwatches(this.container)}},selectors$g={form:"form",popoutWrapper:"[data-popout]",popoutList:"[data-popout-list]",popoutToggle:"[data-popout-toggle]",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",popoutText:"[data-popout-text]",ariaCurrent:"[aria-current]",productGridImage:"[data-product-image]",productGrid:"[data-product-grid-item]"},classes$e={listVisible:"select-popout__list--visible",popoutAlternative:"select-popout--alt",currentSuffix:"--current",visible:"is-visible"},attributes$a={ariaCurrent:"aria-current",ariaExpanded:"aria-expanded",dataValue:"data-value",popoutPrevent:"data-popout-prevent",popoutQuantity:"data-quantity-field",quickViewItem:"data-quick-view-item"};let sections$1={};class Popout{constructor(popout){this.popout=popout,this.popoutList=this.popout.querySelector(selectors$g.popoutList),this.popoutToggle=this.popout.querySelector(selectors$g.popoutToggle),this.popoutText=this.popout.querySelector(selectors$g.popoutText),this.popoutInput=this.popout.querySelector(selectors$g.popoutInput),this.popoutOptions=this.popout.querySelectorAll(selectors$g.popoutOptions),this.popoutPrevent=this.popout.getAttribute(attributes$a.popoutPrevent)==="true",this.popupToggleFocusoutEvent=evt=>this.popupToggleFocusout(evt),this.popupListFocusoutEvent=evt=>this.popupListFocusout(evt),this.popupToggleClickEvent=evt=>this.popupToggleClick(evt),this.popoutKeyupEvent=evt=>this.popoutKeyup(evt),this.popupOptionsClickEvent=evt=>this.popupOptionsClick(evt),this._connectOptionsDispatchEvent=evt=>this._connectOptionsDispatch(evt),this.bodyClick=this.bodyClick.bind(this),this.updatePopout=this.updatePopout.bind(this),this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popoutInput&&this.popoutInput.hasAttribute(attributes$a.popoutQuantity)&&document.addEventListener("theme:cart:update",this.updatePopout)}unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.removeEventListener("theme:popout:click",this.popupOptionsClickEvent),element.removeEventListener("click",this._connectOptionsDispatchEvent)}),this.popoutToggle.removeEventListener("click",this.popupToggleClickEvent),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.removeEventListener("focusout",this.popupListFocusoutEvent),this.popout.removeEventListener("keyup",this.popoutKeyupEvent),document.removeEventListener("theme:cart:update",this.updatePopout),document.body.removeEventListener("click",this.bodyClick)}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(attributes$a.ariaExpanded)==="true";if(this.popoutList.closest(selectors$g.productGrid)){const productGridItemImage=this.popoutList.closest(selectors$g.productGrid).querySelector(selectors$g.productGridImage);productGridItemImage&&productGridItemImage.classList.toggle(classes$e.visible,!ariaExpanded)}evt.currentTarget.setAttribute(attributes$a.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$e.listVisible)}popupToggleFocusout(evt){if(!evt.relatedTarget)return;const popoutLostFocus=this.popout.contains(evt.relatedTarget),popoutFromQuickView=evt.relatedTarget.hasAttribute(attributes$a.quickViewItem);!popoutLostFocus&&!popoutFromQuickView&&this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$e.listVisible)&&!childInFocus&&this._hideList()}popupOptionsClick(evt){if(evt.target.closest(selectors$g.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(attributes$a.dataValue)&&(attrValue=evt.currentTarget.getAttribute(attributes$a.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(attributes$a.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));const currentElement=this.popoutList.querySelector(`[class*="${classes$e.currentSuffix}"]`);let targetClass=classes$e.currentSuffix;if(currentElement&¤tElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$e.currentSuffix)){targetClass=currentElementClass;break}}const listTargetElement=this.popoutList.querySelector(`.${targetClass}`);listTargetElement&&(listTargetElement.classList.remove(`${targetClass}`),evt.currentTarget.parentElement.classList.add(`${targetClass}`));const targetAttribute=this.popoutList.querySelector(selectors$g.ariaCurrent);targetAttribute&&(targetAttribute.removeAttribute(attributes$a.ariaCurrent),evt.currentTarget.setAttribute(attributes$a.ariaCurrent,"true")),attrValue!==""&&(this.popoutText.textContent=attrValue),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}}updatePopout(){const targetElement=this.popoutList.querySelector(`[${attributes$a.dataValue}="${this.popoutInput.value}"]`);targetElement?(targetElement.dispatchEvent(new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!0}})),targetElement.parentElement.nextSibling||this.popout.classList.add(classes$e.popoutAlternative)):this.popout.classList.add(classes$e.popoutAlternative)}popoutKeyup(event){event.code===theme.keyboardKeys.ESCAPE&&(this._hideList(),this.popoutToggle.focus())}bodyClick(event){const isOption=this.popout.contains(event.target);this.popoutList.classList.contains(classes$e.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClickEvent)}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("theme:popout:click",this.popupOptionsClickEvent),element.addEventListener("click",this._connectOptionsDispatchEvent)})}_connectOptionsDispatch(evt){const event=new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!1}});evt.target.dispatchEvent(event)||evt.preventDefault()}_onFocusOut(){this.popoutToggle.addEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.addEventListener("focusout",this.popupListFocusoutEvent),this.popout.addEventListener("keyup",this.popoutKeyupEvent),document.body.addEventListener("click",this.bodyClick)}_submitForm(){const form=this.popout.closest(selectors$g.form);form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$e.listVisible),this.popoutToggle.setAttribute(attributes$a.ariaExpanded,!1)}}const popoutSection={onLoad(){sections$1[this.id]=[],this.container.querySelectorAll(selectors$g.popoutWrapper).forEach(wrapper=>{sections$1[this.id].push(new Popout(wrapper))})},onUnload(){sections$1[this.id].forEach(popout=>{typeof popout.unload=="function"&&popout.unload()})}},selectors$h={addToCart:"[data-add-to-cart]",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",popupClose:"[data-popup-close]",popout:"[data-popout]",quickViewInner:"[data-quick-view-inner]",quickViewItemHolder:"[data-quick-view-item-holder]",product:"[data-product]",productForm:"[data-product-form]",productMediaSlider:"[data-product-single-media-slider]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productJSON:"[data-product-json]",quickViewFootInner:"[data-quick-view-foot-inner]",shopTheLookThumb:"[data-shop-the-look-thumb]"},classes$f={hasMediaActive:"has-media-active",isActive:"is-active",isLoading:"is-loading",mediaHidden:"media--hidden",noOutline:"no-outline",notificationPopupVisible:"notification-popup-visible",popupQuickViewAnimateIn:"popup-quick-view--animate-in",popupQuickViewAnimateOut:"popup-quick-view--animate-out",popupQuickViewAnimated:"popup-quick-view--animated",popupQuickView:"popup-quick-view",jsQuickViewVisible:"js-quick-view-visible",jsQuickViewFromCart:"js-quick-view-from-cart"},attributes$b={id:"id",mediaId:"data-media-id",sectionId:"data-section-id",handle:"data-handle",loaded:"loaded",tabindex:"tabindex",quickViewOnboarding:"data-quick-view-onboarding",hotspot:"data-hotspot",hotspotRef:"data-hotspot-ref"},ids={addToCartFormId:"AddToCartForm--",addToCartId:"AddToCart--"};class LoadQuickview{constructor(popup,pswpElement){this.popup=popup,this.pswpElement=pswpElement,this.quickViewFoot=this.pswpElement.querySelector(selectors$h.quickViewFootInner),this.quickViewInner=this.pswpElement.querySelector(selectors$h.quickViewInner),this.product=this.pswpElement.querySelectorAll(selectors$h.product),this.flkty=[],this.videos=[],this.productForms=[],this.productMediaSliders=this.pswpElement.querySelectorAll(selectors$h.productMediaSlider),this.deferredMedias=this.pswpElement.querySelectorAll(selectors$h.deferredMedia),this.buttonsShopTheLookThumb=this.pswpElement.querySelectorAll(selectors$h.shopTheLookThumb),this.quickViewItemHolders=this.pswpElement.querySelectorAll(selectors$h.quickViewItemHolder),this.popupCloseButtons=this.quickViewInner.querySelectorAll(selectors$h.popupClose),this.a11y=a11y,this.prevent3dModelSubmitEvent=event=>this.prevent3dModelSubmit(event),this.closeOnAnimationEndEvent=event=>this.closeOnAnimationEnd(event),this.closeOnEscapeEvent=event=>this.closeOnEscape(event),this.outerCloseEvent=event=>{this.quickViewInner.contains(event.target)||this.closePopup(event)},this.product.forEach((item,index)=>{item.hasAttribute(attributes$b.quickViewOnboarding)||this.initItems(item,index)}),this.init()}handleDraggable(slider2,draggableStatus){slider2&&(slider2.options.draggable=!!draggableStatus,slider2.updateDraggable())}initItems(item,index){this.addFormSuffix(item),this.initProductSlider(item,index),this.initProductVideo(item),this.initProductModel(item),this.initShopifyXrLaunch(item),makeSwatches(item);const popoutElements=item.querySelectorAll(selectors$h.popout);let popouts={};popoutElements.length&&popoutElements.forEach((popout,index2)=>{popouts[index2]=new Popout(popout)});const productForm=new ProductAddForm(item.parentNode);this.productForms.push(productForm),Shopify.PaymentButton&&Shopify.PaymentButton.init(),item.classList.remove(classes$f.isLoading)}init(){document.addEventListener("submit",this.prevent3dModelSubmitEvent),this.popupCloseButtons.forEach(popupClose=>{popupClose.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.SPACE)&&this.closePopup(event)}),popupClose.addEventListener("click",event=>{this.closePopup(event)})}),this.pswpElement.addEventListener("click",this.outerCloseEvent),document.dispatchEvent(new CustomEvent("theme:popup:open",{bubbles:!0})),this.popup.listen("preventDragEvent",(e,isDown,preventObj)=>{preventObj.prevent=!1}),this.pswpElement.addEventListener("mousedown",()=>{this.popup.framework.unbind(window,"pointermove pointerup pointercancel",this.popup)}),this.popup.listen("initialZoomInEnd",()=>{document.body.classList.add(classes$f.jsQuickViewVisible),this.a11y.trapFocus({container:this.quickViewInner})}),this.pswpElement.addEventListener("animationend",this.closeOnAnimationEndEvent),this.popup.listen("destroy",()=>{this.flkty.length>0&&requestAnimationFrame(()=>{this.flkty.forEach(slider2=>slider2.pausePlayer())}),document.body.classList.remove(classes$f.jsQuickViewVisible),document.removeEventListener("keyup",this.closeOnEscapeEvent),document.addEventListener("keyup",this.closeOnEscapeEvent),this.pswpElement.removeEventListener("click",this.outerCloseEvent),this.pswpElement.removeEventListener("animationend",this.closeOnAnimationEndEvent),document.removeEventListener("submit",this.prevent3dModelSubmitEvent),this.deferredMedias.forEach(deferredMedia=>{deferredMedia.removeAttribute(attributes$b.loaded)})}),document.addEventListener("keyup",this.closeOnEscapeEvent),document.addEventListener("theme:cart:added",()=>{this.pswpElement.classList.contains(classes$f.popupQuickView)&&this.pswpElement.classList.add(classes$f.popupQuickViewAnimateOut)}),this.animateInQuickview(),this.initShopTheLookListeners()}initShopTheLookListeners(){this.buttonsShopTheLookThumb?.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const thumb=event.target.matches(selectors$h.shopTheLookThumb)?event.target:event.target.closest(selectors$h.shopTheLookThumb),holder=this.pswpElement.querySelector(`[${attributes$b.hotspot}="${thumb.getAttribute(attributes$b.hotspotRef)}"]`);thumb.classList.contains(classes$f.isActive)||!holder||(this.flkty.length>0&&requestAnimationFrame(()=>{this.flkty.forEach(slider2=>{slider2.resize();const allMediaItems=this.quickViewInner.querySelectorAll(selectors$h.productMediaWrapper);allMediaItems.length&&allMediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$f.mediaHidden)})})}),holder.classList.add(classes$f.isActive),this.quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$f.isActive)}))})})}prevent3dModelSubmit(event){event.submitter.closest(selectors$h.deferredMedia)&&event.submitter.closest(selectors$h.productForm)&&event.preventDefault()}closeQuickviewOnMobile(){window.innerWidth{this.handleAnimatedState(event)}),this.pswpElement.addEventListener("animationend",event=>{this.handleAnimatedState(event,!0)})}handleAnimatedState(event,isMobileAnimation=!1){if(event.animationName=="quickViewAnimateInUp"){if(isMobileAnimation&&window.innerWidth>=window.theme.sizes.small)return;this.pswpElement.classList.add(classes$f.popupQuickViewAnimated),this.pswpElement.classList.remove(classes$f.popupQuickViewAnimateIn),document.body.classList.remove(classes$f.jsQuickViewFromCart)}}closePopup(event){event?.preventDefault(),this.pswpElement.classList.add(classes$f.popupQuickViewAnimateOut),this.productForms.length>0&&this.productForms.forEach(form=>{form.destroy()})}closeOnAnimationEnd(event){(event.animationName=="quickViewAnimateOutRight"||event.animationName=="quickViewAnimateOutDown")&&(this.popup.template.classList.remove(classes$f.popupQuickViewAnimateOut,classes$f.popupQuickViewAnimated),this.popup.close())}closeOnEscape(event){const isQuickViewVisible=document.body.classList.contains(classes$f.jsQuickViewVisible),isNotificationVisible=document.body.classList.contains(classes$f.notificationPopupVisible);event.code===theme.keyboardKeys.ESCAPE&&isQuickViewVisible&&!isNotificationVisible&&this.closePopup(event)}initProductSlider(item,index){const slider2=item.querySelector(selectors$h.productMediaSlider),mediaItems=item.querySelectorAll(selectors$h.productMediaWrapper);if(mediaItems.length>1){const itemSlider=new Flickity(slider2,{wrapAround:!0,cellAlign:"left",pageDots:!1,prevNextButtons:!0,adaptiveHeight:!1,pauseAutoPlayOnHover:!1,selectedAttraction:.2,friction:1,autoPlay:!1,on:{ready:()=>{slider2.setAttribute(attributes$b.tabindex,"-1"),requestAnimationFrame(()=>{itemSlider.resize()})},settle:()=>{const currentSlide=itemSlider.selectedElement,mediaId=currentSlide.getAttribute(attributes$b.mediaId);currentSlide.setAttribute(attributes$b.tabindex,"0"),itemSlider.cells.forEach(slide=>{slide.element!==currentSlide&&slide.element.setAttribute(attributes$b.tabindex,"-1")}),this.switchMedia(item,mediaId)}}});this.flkty.push(itemSlider),mediaItems.length&&mediaItems.forEach(element=>{element.addEventListener("theme:media:play",()=>{this.handleDraggable(this.flkty[index],!1),element.closest(selectors$h.productMediaSlider).classList.add(classes$f.hasMediaActive)}),element.addEventListener("theme:media:pause",()=>{this.handleDraggable(this.flkty[index],!0),element.closest(selectors$h.productMediaSlider).classList.remove(classes$f.hasMediaActive)})}),flickitySmoothScrolling(slider2)}}switchMedia(item,mediaId){const allMediaItems=this.quickViewInner.querySelectorAll(selectors$h.productMediaWrapper),selectedMedia=item.querySelector(`${selectors$h.productMediaWrapper}[${attributes$b.mediaId}="${mediaId}"]`),isFocusEnabled=!document.body.classList.contains(classes$f.noOutline);allMediaItems.length&&allMediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$f.mediaHidden)}),isFocusEnabled&&selectedMedia.focus(),selectedMedia.closest(selectors$h.productMediaSlider).classList.remove(classes$f.hasMediaActive),selectedMedia.classList.remove(classes$f.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0});const deferredMedia=selectedMedia.querySelector(selectors$h.deferredMedia);deferredMedia&&deferredMedia.getAttribute(attributes$b.loaded)!=="true"&&selectedMedia.querySelector(selectors$h.deferredMediaButton).dispatchEvent(new Event("click"))}initProductVideo(item){const videos=new ProductVideo(item);this.videos.push(videos)}initProductModel(item){const sectionId=item.getAttribute(attributes$b.sectionId),modelItems=item.querySelectorAll(selectors$h.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,sectionId)})}initShopifyXrLaunch(item){document.addEventListener("shopify_xr_launch",()=>{item.querySelector(`${selectors$h.productModel}:not(.${classes$f.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}addFormSuffix(item){const sectionId=item.getAttribute(attributes$b.sectionId),productObject=JSON.parse(item.querySelector(selectors$h.productJSON).innerHTML),formSuffix=`${sectionId}-${productObject.handle}`,productForm=item.querySelector(selectors$h.productForm),addToCart=item.querySelector(selectors$h.addToCart);productForm.setAttribute(attributes$b.id,ids.addToCartFormId+formSuffix),addToCart.setAttribute(attributes$b.id,ids.addToCartId+formSuffix)}}const settings$2={unlockScrollDelay:400},selectors$i={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupCustomIframe:".pswp__custom-iframe",popupThumbs:".pswp__thumbs",popupButtons:".pswp__button, .pswp__caption-close",product:"[data-product]",productJSON:"[data-product-json]"},classes$g={current:"is-current",customLoader:"pswp--custom-loader",customOpen:"pswp--custom-opening",loader:"pswp__loader",opened:"pswp--open",popupCloseButton:"pswp__button--close",notificationPopup:"pswp--notification",quickviewPopup:"popup-quick-view",isCartDrawerOpen:"js-drawer-open-cart",quickViewAnimateOut:"popup-quick-view--animate-out"},attributes$c={dataOptionClasses:"data-pswp-option-classes",dataVideoType:"data-video-type"},loaderHTML=`
`;class LoadPhotoswipe{constructor(items,options2="",templateIndex=0,triggerButton=null){this.items=items,this.triggerBtn=triggerButton,this.pswpElements=document.querySelectorAll(selectors$i.popupContainer),this.pswpElement=this.pswpElements[templateIndex],this.popup=null,this.popupThumbs=null,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$i.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$i.popupCloseBtn);const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options2!==""?options2:defaultOptions,this.onCloseCallback=()=>this.onClose(),this.dispatchPopupInitEventCallback=()=>this.dispatchPopupInitEvent(),this.setCurrentThumbCallback=()=>this.setCurrentThumb(),this.a11y=a11y,this.init()}init(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.pswpElement.classList.add(classes$g.customOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}initLoader(){if(this.pswpElement.classList.contains(classes$g.customLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(attributes$c.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(attributes$c.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$g.customLoader)&&this.pswpElement.classList.remove(classes$g.customLoader),this.pswpElement.classList.remove(classes$g.customOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.listen("afterInit",this.dispatchPopupInitEventCallback),this.popup.listen("imageLoadComplete",this.setCurrentThumbCallback),this.popup.listen("beforeChange",this.setCurrentThumbCallback),this.popup.listen("close",this.onCloseCallback),this.popup.init(),this.initPopupCallback()}initPopupCallback(){this.isVideo&&this.hideUnusedButtons(),this.initVideo(),this.thumbsActions(),this.a11y.trapFocus({container:this.pswpElement}),this.pswpElement.classList.contains(classes$g.quickviewPopup)&&new LoadQuickview(this.popup,this.pswpElement),this.pswpElement.classList.contains(classes$g.notificationPopup)&&new LoadNotification(this.popup,this.pswpElement),this.closePopup=()=>{this.pswpElement.classList.contains(classes$g.quickviewPopup)?this.pswpElement.classList.add(classes$g.quickViewAnimateOut):this.popup.close()},this.closeBtn&&this.closeBtn.addEventListener("click",this.closePopup),document.addEventListener("theme:cart:added",this.closePopup)}dispatchPopupInitEvent(){this.triggerBtn&&this.triggerBtn.dispatchEvent(new CustomEvent("theme:popup:init",{bubbles:!0}))}initVideo(){const videoContainer=this.pswpElement.querySelector(selectors$i.popupCustomIframe);if(videoContainer){const videoType=videoContainer.getAttribute(attributes$c.dataVideoType);this.isVideo=!0,videoType=="youtube"?new LoadVideoYT(videoContainer.parentElement):videoType=="vimeo"&&new LoadVideoVimeo(videoContainer.parentElement)}}thumbsActions(){this.popupThumbsContainer&&this.popupThumbsContainer.firstChild&&(this.popupThumbsContainer.addEventListener("wheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("mousewheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("DOMMouseScroll",e=>this.stopDisabledScroll(e)),this.popupThumbs=this.pswpElement.querySelectorAll(`${selectors$i.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),element.parentElement.querySelector(`.${classes$g.current}`).classList.remove(classes$g.current),element.classList.add(classes$g.current),this.popup.goTo(i)})}))}hideUnusedButtons(){this.pswpElement.querySelectorAll(selectors$i.popupButtons).forEach(element=>{element.classList.contains(classes$g.popupCloseButton)||(element.style.display="none")})}stopDisabledScroll(e){e.stopPropagation()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$i.popupIframe);if(popupIframe&&popupIframe.parentNode.removeChild(popupIframe),this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)for(;this.popupThumbsContainer.firstChild;)this.popupThumbsContainer.removeChild(this.popupThumbsContainer.firstChild);this.pswpElement.setAttribute(attributes$c.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$g.loader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),document.body.classList.contains(classes$g.isCartDrawerOpen)||this.a11y.removeTrapFocus(),document.removeEventListener("theme:cart:added",this.closePopup),setTimeout(()=>{const recentlyOpenedPopups=this.recentlyOpenedPopupsCount(),isCartDrawerOpen=document.body.classList.contains(classes$g.isCartDrawerOpen);recentlyOpenedPopups===0&&!isCartDrawerOpen&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},settings$2.unlockScrollDelay)}recentlyOpenedPopupsCount(){let count=0;return this.pswpElements.forEach(popup=>{popup.classList.contains(classes$g.opened)&&(count+=1)}),count}setCurrentThumb(){if(this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)return;const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$i.popupThumbs} > .${classes$g.current}`);if(lastCurrentThumb&&lastCurrentThumb.classList.remove(classes$g.current),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$g.current),this.scrollThumbs(currentThumb)}scrollThumbs(currentThumb){const thumbsContainerLeft=this.popupThumbsContainer.scrollLeft,thumbsContainerWidth=this.popupThumbsContainer.offsetWidth,thumbsContainerPos=thumbsContainerLeft+thumbsContainerWidth,currentThumbLeft=currentThumb.offsetLeft,currentThumbWidth=currentThumb.offsetWidth,currentThumbPos=currentThumbLeft+currentThumbWidth;if(thumbsContainerPos<=currentThumbPos||thumbsContainerPos>currentThumbLeft){const currentThumbMarginLeft=parseInt(window.getComputedStyle(currentThumb).marginLeft);this.popupThumbsContainer.scrollTo({top:0,left:currentThumbLeft-currentThumbMarginLeft,behavior:"smooth"})}}}const settings$3={templateIndex:0},selectors$j={buttonQuickView:"[data-button-quick-view]",quickViewItemsTemplate:"[data-quick-view-items-template]",cartDrawer:"[data-cart-drawer]",shopTheLookQuickViewButton:"[data-shop-the-look-quick-view-button]",shopTheLookThumb:"[data-shop-the-look-thumb]",quickViewItemHolder:"[data-quick-view-item-holder]"},classes$h={loading:"is-loading",isActive:"is-active",quickViewFromCart:"js-quick-view-from-cart",mainClass:"popup-quick-view pswp--not-close-btn",shopTheLookPopupClass:"popup-quick-view popup-quick-view--shop-the-look pswp--not-close-btn"},attributes$d={loaded:"data-loaded",handle:"data-handle",variantId:"data-variant-id",shopTheLookQuickView:"data-shop-the-look-quick-view",hotspot:"data-hotspot",quickButtonInit:"data-initialized"},options$1={history:!1,focus:!1,mainClass:classes$h.mainClass,showHideOpacity:!1,closeOnVerticalDrag:!1,closeOnScroll:!1,modal:!1,escKey:!1};class QuickViewPopup{constructor(container){this.container=container,this.a11y=a11y,this.buttonsQuickView=this.container.querySelectorAll(selectors$j.buttonQuickView),this.buttonsShopTheLookQuickView=this.container.querySelectorAll(selectors$j.shopTheLookQuickViewButton),this.popupInitCallback=trigger=>this.popupInit(trigger),this.buttonsQuickView?.forEach(button=>{button.hasAttribute(attributes$d.quickButtonInit)||(button.addEventListener("click",event=>this.initPhotoswipe(event)),button.addEventListener("theme:popup:init",()=>{button.classList.remove(classes$h.loading),button.hasAttribute(attributes$d.shopTheLookQuickView)&&this.popupInitCallback(button)}),button.setAttribute(attributes$d.quickButtonInit,""))}),this.buttonsShopTheLookQuickView?.forEach(button=>{button.addEventListener("click",()=>{this.buttonsQuickView[0]?.dispatchEvent(new Event("click"))})})}popupInit(trigger){const holder=this.loadPhotoswipe.pswpElement.querySelector(`[${attributes$d.hotspot}="${trigger.getAttribute(attributes$d.hotspot)}"]`),quickViewItemHolders=this.loadPhotoswipe.pswpElement.querySelectorAll(selectors$j.quickViewItemHolder);holder.classList.add(classes$h.isActive),quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$h.isActive)}),this.toggleQuickViewButtonsLoadingClasses(!0),this.toggleQuickViewThumbsLoadingClasses(!0);const onAnimationInEnd=event=>{event.animationName==="quickViewAnimateInUp"&&requestAnimationFrame(()=>{this.toggleQuickViewThumbsLoadingClasses(!1)}),event.animationName==="quickViewAnimateOutDown"&&this.loadPhotoswipe.pswpElement.removeEventListener("animationend",onAnimationInEnd)};this.loadPhotoswipe.pswpElement.addEventListener("animationend",onAnimationInEnd),this.loadPhotoswipe?.popup?.listen("destroy",()=>{this.toggleQuickViewButtonsLoadingClasses(!1),this.toggleQuickViewThumbsLoadingClasses(!1)})}toggleQuickViewButtonsLoadingClasses(isLoading=!0){if(isLoading){this.buttonsQuickView?.forEach(element=>{element.classList.add(classes$h.loading)});return}this.buttonsQuickView?.forEach(element=>{element.classList.remove(classes$h.loading)})}toggleQuickViewThumbsLoadingClasses(isLoading=!0){if(this.buttonsShopTheLookThumb=this.loadPhotoswipe?.pswpElement.querySelectorAll(selectors$j.shopTheLookThumb),isLoading){this.buttonsShopTheLookThumb?.forEach(element=>{element.classList.add(classes$h.loading)});return}this.buttonsShopTheLookThumb?.forEach(element=>{element.classList.remove(classes$h.loading)})}initPhotoswipe(event){event.preventDefault();const button=event.target.matches(selectors$j.buttonQuickView)?event.target:event.target.closest(selectors$j.buttonQuickView),isMobile=window.innerWidth{element.classList.add(classes$h.loading)});const XMLS=new XMLSerializer,quickViewItemsTemplate=this.container.querySelector(selectors$j.quickViewItemsTemplate).content.firstElementChild.cloneNode(!0),itemsData=XMLS.serializeToString(quickViewItemsTemplate);this.loadPhotoswipeWithTemplate(itemsData,button)}else this.loadPhotoswipeFromFetch(productUrl,button)}loadPhotoswipeWithTemplate(data,button){const items=[{html:data}];this.loadPhotoswipe=new LoadPhotoswipe(items,options$1,settings$3.templateIndex,button)}loadPhotoswipeFromFetch(url,button){fetch(url).then(response=>response.text()).then(data=>{const items=[{html:data}];this.loadPhotoswipe=new LoadPhotoswipe(items,options$1,settings$3.templateIndex,button)}).catch(error=>console.log("error: ",error))}}const settings$4={cartDrawerEnabled:window.theme.settings.cartType==="drawer",timers:{addProductTimeout:1e3,itemRemovalDelay:500},animations:{data:"data-aos",method:"fade-up"}},selectors$k={outerSection:"[data-section-id]",aos:"[data-aos]",additionalCheckoutButtons:"[data-additional-checkout-button]",apiContent:"[data-api-content]",apiLineItems:"[data-api-line-items]",apiUpsellItems:"[data-api-upsell-items]",buttonAddToCart:"[data-add-to-cart]",upsellButtonByHandle:"[data-handle]",cartCloseError:"[data-cart-error-close]",cartDrawer:"[data-cart-drawer]",cartDrawerTemplate:"[data-cart-drawer-template]",cartDrawerToggle:"[data-cart-drawer-toggle]",cartDrawerBody:"[data-cart-drawer-body]",cartErrors:"[data-cart-errors]",cartForm:"[data-cart-form]",cartTermsCheckbox:"[data-cart-acceptance-checkbox]",cartCheckoutButtonWrapper:"[data-cart-checkout-buttons]",cartCheckoutButton:"[data-cart-checkout-button]",cartTotalDiscountsTemplate:"[data-cart-total-discount]",cartItemRemove:"[data-item-remove]",cartItemQty:"[data-quantity-field]",cartItemsQty:"[data-cart-items-qty]",cartTotal:"[data-cart-total]",cartMessage:"[data-cart-message]",cartMessageDefault:"[data-message-default]",cartPage:"[data-cart-page]",cartProgress:"[data-cart-message-progress]",cartOriginalTotal:"[data-cart-original-total]",cartOriginalTotalPrice:"[data-cart-original-total-price]",cartDiscountsHolder:"[data-cart-discounts-holder]",emptyMessage:"[data-empty-message]",buttonHolder:"[data-foot-holder]",item:"[data-cart-item]",itemsHolder:"[data-items-holder]",itemsWrapper:"[data-items-wrapper]",formCloseError:"[data-close-error]",formErrorsContainer:"[data-cart-errors-container]",upsellHolder:"[data-upsell-holder]",errorMessage:"[data-error-message]",termsErrorMessage:"[data-terms-error-message]",pairProductsHolder:"[data-pair-products-holder]",pairProducts:"[data-pair-products]",productIDAttribute:"data-product-id",leftToSpend:"[data-left-to-spend]",quickBuyForm:"[data-quickbuy-form]",productMediaContainer:"[data-product-media-container]",formWrapper:"[data-form-wrapper]",productForm:"[data-product-form]",popupQuickView:".popup-quick-view",popupClose:"[data-popup-close]",error:"[data-error]",quickViewOnboarding:"[data-quick-view-onboarding]",flickityEnabled:".flickity-enabled"},classes$i={hidden:"hidden",added:"is-added",isHidden:"is-hidden",cartDrawerOpen:"js-drawer-open-cart",open:"is-open",visible:"is-visible",loading:"is-loading",disabled:"is-disabled",success:"is-success",error:"has-error",cartItems:"cart-toggle-has-items",variantSoldOut:"variant--soldout",removed:"is-removed",aosAnimate:"aos-animate",updated:"is-updated",noOutline:"no-outline",productGridImageError:"product-grid-item__image--error"},attributes$e={shippingMessageLimit:"data-limit",cartMessageValue:"data-cart-message",cartTotalPrice:"data-cart-total-price",ariaExpanded:"aria-expanded",disabled:"disabled",value:"value",dataId:"data-id",focusElement:"data-focus-element",upsellButton:"data-upsell-btn",notificationPopup:"data-notification-popup",sectionId:"data-section-id"};let sections$2={};class CartDrawer{constructor(){window.location.pathname!=="/password"&&this.init()}init(){this.cartToggleButtons=document.querySelectorAll(selectors$k.cartDrawerToggle),this.cartPage=document.querySelector(selectors$k.cartPage),this.cartDrawer=document.querySelector(selectors$k.cartDrawer),this.cart=this.cartDrawer||this.cartPage,this.assignArguments(),this.flktyUpsell=null,this.form=null,this.collapsible=null,this.a11y=a11y,this.build=this.build.bind(this),this.addToCart=this.addToCart.bind(this),this.updateCart=this.updateCart.bind(this),this.openCartDrawer=this.openCartDrawer.bind(this),this.closeCartDrawer=this.closeCartDrawer.bind(this),this.toggleCartDrawer=this.toggleCartDrawer.bind(this),this.formSubmitHandler=throttle(this.formSubmitHandler.bind(this),50),this.closeCartError=debounce(()=>slideUp(this.cartErrorHolder,400),250),this.cartDrawerCloseEvent=null,this.hasItemsInCart=this.hasItemsInCart.bind(this),this.isCartPage=this.cartDrawer===null,this.showAnimations=document.body.dataset.animations==="true",this.toggleClassesOnContainers=this.toggleClassesOnContainers.bind(this),this.totalItems=0,this.isCartDrawerOpen=!1,this.isCartDrawerLoaded=!1,this.cartDiscounts=0,this.cartDrawerEnabled=settings$4.cartDrawerEnabled,this.cartLimitErrorIsHidden=!0,this.cartAnimationTimer=0,this.cartEvents(),this.cartAddEvent(),this.cartDrawerToggleEvents(),this.initQuantity(),this.buttonHolder&&(this.collapsible=new Collapsible(this.buttonHolder)),this.isCartPage&&this.renderPairProducts(),document.addEventListener("theme:popup:open",this.closeCartDrawer)}assignArguments(){this.cartDrawerBody=document.querySelector(selectors$k.cartDrawerBody),this.emptyMessage=document.querySelector(selectors$k.emptyMessage),this.buttonHolder=document.querySelector(selectors$k.buttonHolder),this.itemsHolder=document.querySelector(selectors$k.itemsHolder),this.cartItemsQty=document.querySelector(selectors$k.cartItemsQty),this.itemsWrapper=document.querySelector(selectors$k.itemsWrapper),this.items=document.querySelectorAll(selectors$k.item),this.cartTotal=document.querySelector(selectors$k.cartTotal),this.cartMessage=document.querySelectorAll(selectors$k.cartMessage),this.cartOriginalTotal=document.querySelector(selectors$k.cartOriginalTotal),this.cartOriginalTotalPrice=document.querySelector(selectors$k.cartOriginalTotalPrice),this.cartTotalDiscountTemplate=document.querySelector(selectors$k.cartTotalDiscountsTemplate).innerHTML,this.cartErrorHolder=document.querySelector(selectors$k.cartErrors),this.cartCloseErrorMessage=document.querySelector(selectors$k.cartCloseError),this.pairProductsHolder=document.querySelector(selectors$k.pairProductsHolder),this.pairProducts=document.querySelector(selectors$k.pairProducts),this.upsellHolders=document.querySelectorAll(selectors$k.upsellHolder),this.cartTermsCheckbox=document.querySelector(selectors$k.cartTermsCheckbox),this.cartCheckoutButtonWrapper=document.querySelector(selectors$k.cartCheckoutButtonWrapper),this.cartCheckoutButton=document.querySelector(selectors$k.cartCheckoutButton),this.cartForm=document.querySelector(selectors$k.cartForm),this.cartItemCount=0,this.button=null,this.cartMessage.length>0&&(this.cartFreeLimitShipping=Number(this.cartMessage[0].getAttribute(attributes$e.shippingMessageLimit))*100*window.Shopify.currency.rate,this.subtotal=Number(this.cartMessage[0].getAttribute(attributes$e.cartTotalPrice))),this.updateProgress()}initQuantity(){this.items=document.querySelectorAll(selectors$k.item),this.items.length&&this.items.forEach(item=>{new QuantityCounter(item,!0).init(),this.customEventsHandle(item)})}customEventsHandle(holder){holder.addEventListener("theme:cart:update",debounce(event=>{this.updateCart({id:event.detail.id,quantity:event.detail.quantity},holder,event.detail.valueIsEmpty)},250))}cartEvents(){const cartItemRemove=document.querySelectorAll(selectors$k.cartItemRemove);cartItemRemove.length&&(this.totalItems=cartItemRemove.length,cartItemRemove.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault();const cartItem=item.closest(selectors$k.item);this.updateCart({id:item.getAttribute(attributes$e.dataId),quantity:0},cartItem)})})),this.cartCloseErrorMessage&&(this.cartCloseErrorMessage.removeEventListener("click",this.closeCartError),this.cartCloseErrorMessage.addEventListener("click",this.closeCartError)),this.cartTermsCheckbox&&(this.cartTermsCheckbox.removeEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.removeEventListener("click",this.formSubmitHandler),this.cartForm.removeEventListener("submit",this.formSubmitHandler),this.cartTermsCheckbox.addEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.addEventListener("click",this.formSubmitHandler),this.cartForm.addEventListener("submit",this.formSubmitHandler))}cartAddEvent(){document.addEventListener("click",event=>{const clickedElement=event.target,isButtonATC=clickedElement?.matches(selectors$k.buttonAddToCart),getButtonATC=clickedElement?.closest(selectors$k.buttonAddToCart);if(isButtonATC||getButtonATC){event.preventDefault(),this.button=isButtonATC?clickedElement:getButtonATC,this.form=clickedElement.closest("form"),this.formWrapper=this.button.closest(selectors$k.formWrapper);const isVariantSoldOut=this.formWrapper?.classList.contains(classes$i.variantSoldOut),isButtonDisabled=this.button.hasAttribute(attributes$e.disabled),isQuickViewOnboarding=this.button.closest(selectors$k.quickViewOnboarding),hasProductId=this.button.hasAttribute(selectors$k.productIDAttribute),hasNotificationPopup=this.button.hasAttribute(attributes$e.notificationPopup),hasFileInput=this.form?.querySelector('[type="file"]');let formData="";if(isButtonDisabled||hasFileInput||isQuickViewOnboarding)return;if(isVariantSoldOut&&hasNotificationPopup){new NotificationPopup(this.button);return}hasProductId?formData=`id=${Number(this.button.getAttribute(selectors$k.productIDAttribute))}`:(formData=new FormData(this.form),formData=new URLSearchParams(formData).toString()),this.addToCart(formData),document.dispatchEvent(new CustomEvent("theme:cart:add",{bubbles:!0,detail:{selector:clickedElement}}))}})}getCart(){this.cartDrawer&&!this.isCartDrawerLoaded&&this.renderCartDrawer(!1),fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>(this.cartItemCount=response.item_count,this.newTotalItems=response.items.length,this.buildTotalPrice(response),this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),fetch(theme.routes.root+"cart?section_id=api-cart-items"))).then(response=>response.text()).then(response=>{const element=document.createElement("div");element.innerHTML=response,this.cartToggleButtons.forEach(button=>{button.classList.remove(classes$i.cartItems),this.newTotalItems>0&&button.classList.add(classes$i.cartItems)});const cleanResponse=element.querySelector(selectors$k.apiContent);this.build(cleanResponse),this.updateItemsQuantity(this.cartItemCount)}).catch(error=>console.log(error))}addToCart(data){this.cartDrawerEnabled&&this.button&&(this.button.classList.add(classes$i.loading),this.button.setAttribute(attributes$e.disabled,!0)),fetch(theme.routes.root+"cart/add.js",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded"},body:data}).then(response=>response.json()).then(response=>{if(this.button.disabled=!0,this.addLoadingClass(),response.status){this.addToCartError(response),this.removeLoadingClass();return}this.cartDrawerEnabled?this.getCart():window.location=theme.routes.cart_url}).catch(error=>console.log(error))}updateCart(updateData={},holder=null,valueIsEmpty=!1){let newCount=null,oldCount=null,newItem=null,quantity=updateData.quantity;this.addLoadingClass(),quantity==0&&holder&&(holder.classList.add(classes$i.removed),setTimeout(()=>{holder.remove()},settings$4.timers.itemRemovalDelay)),this.items.forEach(item=>{item.classList.add(classes$i.disabled),item.querySelector("input").blur(),item.querySelectorAll("input, button").forEach(el=>{el.setAttribute("disabled",!0)})}),fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>{const matchKeys=item=>item.key===updateData.id,index=response.items.findIndex(matchKeys);oldCount=response.item_count,newItem=response.items[index].title;const data={line:`${index+1}`,quantity};return fetch(theme.routes.root+"cart/change.js",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(data)})}).then(this.handleErrors).then(response=>response.json()).then(response=>{newCount=response.item_count,this.cartItemCount=newCount,valueIsEmpty&&(quantity=1),quantity!==0&&(this.cartLimitErrorIsHidden=newCount!==oldCount,this.toggleLimitError(newItem)),this.buildTotalPrice(response),this.cartDiscounts=response.total_discount,this.updateItemsQuantity(this.cartItemCount),this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),this.getCart()}).catch(error=>console.log(error))}toggleLimitError(itemTitle){this.cartErrorHolder.querySelector(selectors$k.errorMessage).innerText=itemTitle,this.cartLimitErrorIsHidden?slideUp(this.cartErrorHolder,400):slideDown(this.cartErrorHolder,400)}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}addToCartError(data){const buttonQuickBuyForm=this.button.closest(selectors$k.quickBuyForm),buttonUpsellHolder=this.button.closest(selectors$k.upsellHolder),isFocusEnabled=!document.body.classList.contains(classes$i.noOutline);let errorContainer=(this.button.closest(selectors$k.productForm)?this.button.closest(selectors$k.productForm):this.button.closest(selectors$k.upsellHolder)).querySelector(selectors$k.formErrorsContainer);buttonUpsellHolder&&(errorContainer=buttonUpsellHolder.querySelector(selectors$k.formErrorsContainer)),this.cartDrawerEnabled&&this.button&&this.button.closest(selectors$k.cartDrawer)!==null&&!this.button.closest(selectors$k.cartDrawer)&&this.closeCartDrawer(),this.button.classList.remove(classes$i.loading),this.button.removeAttribute(attributes$e.disabled);const closeErrorButton=buttonQuickBuyForm?"":` `;if(errorContainer.innerHTML=`
${data.message}: ${data.description} ${closeErrorButton}
`,buttonQuickBuyForm){const productMediaContainer=errorContainer.closest(selectors$k.productMediaContainer);productMediaContainer.classList.add(classes$i.productGridImageError),errorContainer.querySelector(selectors$k.error).addEventListener("animationend",()=>{productMediaContainer.classList.remove(classes$i.productGridImageError),errorContainer.innerHTML="",isFocusEnabled||document.activeElement.blur()})}else errorContainer.classList.add(classes$i.visible),errorContainer.addEventListener("transitionend",()=>{this.resizeSliders(errorContainer)}),this.handleCloseErrorMessages(errorContainer)}handleCloseErrorMessages(container){container.querySelector(selectors$k.formCloseError).addEventListener("click",event=>{const clickedElement=event.target;(clickedElement.matches(selectors$k.formCloseError)||clickedElement.closest(selectors$k.formCloseError))&&(event.preventDefault(),container.classList.remove(classes$i.visible),container.querySelector(selectors$k.error).addEventListener("transitionend",()=>{container.innerHTML="",this.resizeSliders(clickedElement)}))})}resizeSliders(element){const slider2=element.closest(selectors$k.flickityEnabled);if(!slider2)return;const flkty=Flickity.data(slider2);requestAnimationFrame(()=>flkty.resize())}renderCartDrawer(alwaysOpen=!0){const cartDrawerTemplate=document.querySelector(selectors$k.cartDrawerTemplate);cartDrawerTemplate&&(this.cartDrawer.innerHTML=cartDrawerTemplate.innerHTML,this.assignArguments(),this.initQuantity(),this.cartEvents(),this.buttonHolder&&(this.collapsible=new Collapsible(this.buttonHolder)),this.cartDrawerToggle=this.cartDrawer.querySelector(selectors$k.cartDrawerToggle),this.cartDrawerToggle.addEventListener("click",this.cartDrawerToggleClickEvent),this.isCartDrawerLoaded=!0,this.renderPairProducts(),document.dispatchEvent(new CustomEvent("theme:cart:loaded",{bubbles:!0})),alwaysOpen&&this.openCartDrawer())}openCartDrawer(){if(!this.isCartDrawerOpen){if(!this.isCartDrawerLoaded){this.renderCartDrawer();return}document.dispatchEvent(new CustomEvent("theme:cart:open",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDrawer})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDrawerBody})),document.body.classList.add(classes$i.cartDrawerOpen),this.cartDrawer.classList.add(classes$i.open),this.cartDrawer.querySelectorAll(selectors$k.aos).forEach(item=>{item.classList.add(classes$i.aosAnimate)}),this.cartToggleButtons.forEach(button=>{button.setAttribute(attributes$e.ariaExpanded,!0)}),this.a11y.trapFocus({container:this.cartDrawer}),this.observeAdditionalCheckoutButtons(),this.isCartDrawerOpen=!0}}closeCartDrawer(){if(!this.isCartDrawerOpen)return;document.dispatchEvent(new CustomEvent("theme:cart:close",{bubbles:!0})),this.cartAnimationTimer&&clearTimeout(this.cartAnimationTimer),this.cartAnimationTimer=setTimeout(()=>{this.cartDrawer.querySelectorAll(selectors$k.aos).forEach(item=>{item.classList.remove(classes$i.aosAnimate)})},300),slideUp(this.cartErrorHolder,400),this.a11y.removeTrapFocus(),this.cartToggleButtons.forEach(button=>{button.setAttribute(attributes$e.ariaExpanded,!1)}),document.body.classList.remove(classes$i.cartDrawerOpen),this.cartDrawer.classList.remove(classes$i.open),this.itemsHolder.classList.remove(classes$i.updated),!document.body.classList.contains(classes$i.noOutline)||requestAnimationFrame(()=>{document.activeElement.blur()});const timeout=400;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:timeout})),this.isCartDrawerOpen=!1}toggleCartDrawer(){this.isCartDrawerOpen?this.closeCartDrawer():this.openCartDrawer()}cartDrawerToggleEvents(){this.cartDrawer&&(this.cartDrawer.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&this.closeCartDrawer()}),this.cartDrawerToggleClickEvent=event=>{event.preventDefault();const button=event.target;button.getAttribute(attributes$e.ariaExpanded)==="false"&&(this.a11y.state.trigger=button),this.toggleCartDrawer()},this.cartDrawerCloseEvent=event=>{const isCartDrawerToggle=event.target.matches(selectors$k.cartDrawerToggle),isCartDrawerChild=document.querySelector(selectors$k.cartDrawer).contains(event.target),isPopupQuickView=event.target.closest(selectors$k.popupQuickView);!isCartDrawerToggle&&!isCartDrawerChild&&!isPopupQuickView&&this.closeCartDrawer()},this.cartToggleButtons.forEach(button=>{button.addEventListener("click",this.cartDrawerToggleClickEvent)}),document.addEventListener("mousedown",this.cartDrawerCloseEvent))}toggleClassesOnContainers(){const that=this;this.emptyMessage.classList.toggle(classes$i.hidden,that.hasItemsInCart()),this.buttonHolder.classList.toggle(classes$i.hidden,!that.hasItemsInCart()),this.itemsHolder.classList.toggle(classes$i.hidden,!that.hasItemsInCart()),this.cartItemsQty.classList.toggle(classes$i.hidden,!that.hasItemsInCart())}build(data){const cartItemsData=data.querySelector(selectors$k.apiLineItems),upsellItemsData=data.querySelector(selectors$k.apiUpsellItems),cartEmptyData=cartItemsData===null&&upsellItemsData===null;this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers()),this.isCartDrawerOpen&&this.itemsHolder.classList.add(classes$i.updated),cartEmptyData?(this.itemsHolder.innerHTML=data,this.pairProductsHolder&&(this.pairProductsHolder.innerHTML="")):(this.itemsHolder.innerHTML=cartItemsData.innerHTML,this.pairProductsHolder&&(this.pairProductsHolder.innerHTML=upsellItemsData.innerHTML),this.renderPairProducts()),this.cartEvents(),this.initQuantity(),this.resetButtonClasses(),this.removeLoadingClass(),document.dispatchEvent(new CustomEvent("theme:cart:added",{bubbles:!0})),this.cartDrawer&&this.openCartDrawer()}hasItemsInCart(){return this.totalItems>0}buildTotalPrice(data){const cartDiscountsHolder=document.querySelector(selectors$k.cartDiscountsHolder);if(data.original_total_price>data.total_price&&data.cart_level_discount_applications.length>0?(this.cartOriginalTotal.classList.remove(classes$i.hidden),data.original_total_price===0?this.cartOriginalTotalPrice.innerHTML=window.theme.strings.free:this.cartOriginalTotalPrice.innerHTML=themeCurrency.formatMoney(data.original_total_price,theme.moneyWithCurrencyFormat)):this.cartOriginalTotal.classList.add(classes$i.hidden),this.cartTotal.innerHTML=data.total_price===0?window.theme.strings.free:themeCurrency.formatMoney(data.total_price,theme.moneyWithCurrencyFormat),data.cart_level_discount_applications.length>0){const discountsMarkup=this.buildCartTotalDiscounts(data.cart_level_discount_applications);cartDiscountsHolder.classList.remove(classes$i.hidden),cartDiscountsHolder.innerHTML=discountsMarkup}else cartDiscountsHolder.classList.add(classes$i.hidden)}buildCartTotalDiscounts(discounts){let discountMarkup="";return discounts.forEach(discount=>{discountMarkup+=Sqrl.render(this.cartTotalDiscountTemplate,{discountTitle:discount.title,discountTotalAllocatedAmount:themeCurrency.formatMoney(discount.total_allocated_amount,theme.moneyFormat)})}),discountMarkup}freeShippingMessageHandle(total){this.cartMessage.length>0&&document.querySelectorAll(selectors$k.cartMessage).forEach(message=>{const hasFreeShipping=message.hasAttribute(attributes$e.cartMessageValue)&&message.getAttribute(attributes$e.cartMessageValue)==="true"&&total!==0,cartMessageDefault=message.querySelector(selectors$k.cartMessageDefault);message.classList.toggle(classes$i.success,total>=this.cartFreeLimitShipping&&hasFreeShipping),message.classList.toggle(classes$i.isHidden,total===0),cartMessageDefault.classList.toggle(classes$i.isHidden,total>=this.cartFreeLimitShipping)})}updateProgress(){const newPercentValue=this.subtotal/this.cartFreeLimitShipping*100,leftToSpend=theme.settings.currency_code_enable?themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyWithCurrencyFormat):themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyFormat);this.cartMessage.length>0&&document.querySelectorAll(selectors$k.cartMessage).forEach(message=>{const cartMessageProgressItems=message.querySelectorAll(selectors$k.cartProgress),leftToSpendMessage=message.querySelector(selectors$k.leftToSpend);leftToSpendMessage&&(leftToSpendMessage.innerHTML=leftToSpend.replace(".00","").replace(",00","")),cartMessageProgressItems.length&&cartMessageProgressItems.forEach((cartMessageProgress,index)=>{cartMessageProgress.classList.toggle(classes$i.isHidden,this.subtotal/this.cartFreeLimitShipping>=1),cartMessageProgress.style.setProperty("--progress-width",`${newPercentValue}%`),index===0&&cartMessageProgress.setAttribute(attributes$e.value,newPercentValue)}),this.freeShippingMessageHandle(this.subtotal)})}renderPairProducts(){if(this.flktyUpsell=null,this.pairProductsHolder=document.querySelector(selectors$k.pairProductsHolder),this.pairProducts=document.querySelector(selectors$k.pairProducts),this.upsellHolders=document.querySelectorAll(selectors$k.upsellHolder),this.pairProductsHolder===null||this.pairProductsHolder===void 0)return;const that=this;if(this.upsellHolders.length>1){this.flktyUpsell=new Flickity(this.pairProducts,{wrapAround:!0,pageDots:!0,adaptiveHeight:!0,prevNextButtons:!1,on:{ready:function(){new QuickViewPopup(that.cart),this.reloadCells(),this.resize()}}});return}new QuickViewPopup(this.cart)}updateItemsQuantity(itemsQty){let oneItemText=theme.strings.cart_items_one,manyItemsText=theme.strings.cart_items_many;oneItemText=oneItemText.split("}}")[1],manyItemsText=manyItemsText.split("}}")[1],this.cartItemsQty&&(this.cartItemsQty.textContent=itemsQty===1?`${itemsQty} ${oneItemText}`:`${itemsQty} ${manyItemsText}`)}observeAdditionalCheckoutButtons(){const additionalCheckoutButtons=this.cart.querySelector(selectors$k.additionalCheckoutButtons);if(additionalCheckoutButtons){const observer=new MutationObserver(()=>{this.a11y.removeTrapFocus(),this.a11y.trapFocus({container:this.cart}),observer.disconnect()});observer.observe(additionalCheckoutButtons,{subtree:!0,childList:!0})}}formSubmitHandler(){const termsAccepted=document.querySelector(selectors$k.cartTermsCheckbox).checked,termsError=document.querySelector(selectors$k.termsErrorMessage);if(termsAccepted)slideUp(termsError,400),this.cartCheckoutButton.removeAttribute(attributes$e.disabled);else{if(document.querySelector(selectors$k.termsErrorMessage).length>0)return;termsError.innerText=theme.strings.cart_acceptance_error,this.cartCheckoutButton.setAttribute(attributes$e.disabled,!0),slideDown(termsError,400)}}resetButtonClasses(){const buttons=document.querySelectorAll(selectors$k.buttonAddToCart);buttons&&buttons.forEach(button=>{button.classList.contains(classes$i.loading)&&(button.classList.remove(classes$i.loading),button.classList.add(classes$i.success),setTimeout(()=>{button.removeAttribute(attributes$e.disabled),button.classList.remove(classes$i.success)},settings$4.timers.addProductTimeout))})}addLoadingClass(){this.cartDrawer?this.cartDrawer.classList.add(classes$i.loading):this.itemsWrapper&&this.itemsWrapper.classList.add(classes$i.loading)}removeLoadingClass(){this.cartDrawer?this.cartDrawer.classList.remove(classes$i.loading):this.itemsWrapper&&this.itemsWrapper.classList.remove(classes$i.loading)}unload(){this.cartDrawerToggle&&this.cartDrawerToggle.removeEventListener("click",this.cartDrawerToggleClickEvent),this.cartToggleButtons.forEach(button=>{button.removeEventListener("click",this.cartDrawerToggleClickEvent)}),document.removeEventListener("mousedown",this.cartDrawerCloseEvent),this.collapsible!==null&&this.collapsible.onUnload()}}register("cart-template",{onLoad(){sections$2[this.id]=new CartDrawer},onUnload(){typeof sections$2[this.id].unload=="function"&§ions$2[this.id].unload()}});const selectors$l={drawer:"[data-drawer]",drawerToggle:"[data-drawer-toggle]",scroller:"[data-scroll]"},classes$j={open:"is-open",drawerOpen:"js-drawer-open"},attributes$f={ariaExpanded:"aria-expanded",ariaControls:"aria-controls"};class Drawer{constructor(){this.drawers=document.querySelectorAll(selectors$l.drawer),this.drawerToggleButtons=document.querySelectorAll(selectors$l.drawerToggle),this.a11y=a11y,this.drawerToggleEvent=throttle(event=>{this.toggle(event)},150),this.keyPressCloseEvent=throttle(event=>{event.code===theme.keyboardKeys.ESCAPE&&this.close(event)},150),this.drawerCloseEvent=event=>{const activeDrawer=document.querySelector(`${selectors$l.drawer}.${classes$j.open}`);if(!activeDrawer)return;const isDrawerToggle=event.target.matches(selectors$l.drawerToggle),isDrawerChild=activeDrawer?activeDrawer.contains(event.target):!1;!isDrawerToggle&&!isDrawerChild&&this.close(event)},this.initListeners()}initListeners(){this.drawerToggleButtons.forEach(button=>{button.addEventListener("click",this.drawerToggleEvent)}),this.drawers.forEach(drawer=>{drawer.addEventListener("keyup",this.keyPressCloseEvent),this.collapsible=new Collapsible(drawer)}),document.addEventListener("click",this.drawerCloseEvent)}toggle(e){e.preventDefault();const drawer=document.querySelector(`#${e.target.getAttribute(attributes$f.ariaControls)}`);if(!drawer)return;drawer.classList.contains(classes$j.open)?this.close():this.open(e)}open(e){const drawerOpenButton=e.target,drawer=document.querySelector(`#${e.target.getAttribute(attributes$f.ariaControls)}`);if(!drawer)return;const drawerScroller=drawer.querySelector(selectors$l.scroller)||drawer;document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:drawerScroller})),document.dispatchEvent(new CustomEvent("theme:drawer:open"),{bubbles:!0}),document.body.classList.add(classes$j.drawerOpen),drawer.classList.add(classes$j.open),drawerOpenButton.setAttribute(attributes$f.ariaExpanded,!0),setTimeout(()=>{this.a11y.state.trigger=drawerOpenButton,this.a11y.trapFocus({container:drawer})})}close(){if(!document.body.classList.contains(classes$j.drawerOpen))return;const drawer=document.querySelector(`${selectors$l.drawer}.${classes$j.open}`);this.drawerToggleButtons.forEach(button=>{button.setAttribute(attributes$f.ariaExpanded,!1)});const timeout=400;document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:timeout})),this.a11y.removeTrapFocus({container:drawer}),drawer.classList.remove(classes$j.open),document.body.classList.remove(classes$j.drawerOpen),document.dispatchEvent(new CustomEvent("theme:drawer:close"),{bubbles:!0})}unload(){this.close(),this.drawerToggleButtons.forEach(button=>{button.removeEventListener("click",this.drawerToggleEvent)}),this.drawers.forEach(drawer=>{drawer.removeEventListener("keyup",this.keyPressCloseEvent)}),document.removeEventListener("click",this.drawerCloseEvent),this.collapsible&&this.collapsible.onUnload()}}Sqrl.filters.define("handle",function(str){str=str.toLowerCase();for(var toReplace=['"',"'","\\","(",")","[","]"],i=0;i{window.scrollTo({top:0,left:0,behavior:"smooth"})}),document.addEventListener("scroll",throttle(()=>{scrollTopButton.classList.toggle(classes$k.isVisible,window.pageYOffset>window.innerHeight)},150))),theme.ProductModel=function(){let modelJsonSections={},models={},xrButtons={};const selectors2={productMediaWrapper:"[data-product-single-media-wrapper]",mediaGroup:"[data-product-single-media-group]",productXr:"[data-shopify-xr]",mediaId:"data-media-id",model3d:"data-shopify-model3d-id",modelViewer:"model-viewer",modelJson:"#ModelJson-",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]"},classes2={isLoading:"is-loading",mediaHidden:"media--hidden"};function init(mediaContainer,sectionId){modelJsonSections[sectionId]={loaded:!1};const deferredMediaButton=mediaContainer.querySelector(selectors2.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",loadContent.bind(this,mediaContainer,sectionId))}function loadContent(mediaContainer,sectionId){if(mediaContainer.querySelector(selectors2.deferredMedia).getAttribute("loaded"))return;mediaContainer.classList.add(classes2.isLoading);const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const modelViewerElement=content.querySelector("model-viewer"),deferredMedia=mediaContainer.querySelector(selectors2.deferredMedia);deferredMedia.appendChild(modelViewerElement),deferredMedia.setAttribute("loaded",!0);const mediaId=mediaContainer.dataset.mediaId,modelId=modelViewerElement.dataset.modelId,xrButton=mediaContainer.closest(selectors2.mediaGroup).parentElement.querySelector(selectors2.productXr);xrButtons[sectionId]={element:xrButton,defaultId:modelId},models[mediaId]={modelId,mediaId,sectionId,container:mediaContainer,element:modelViewerElement},window.ShopifyXR?setupModelViewerUi():window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr},{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}])}function setupShopifyXr(errors){if(errors){console.warn(errors);return}if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(const sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){const modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;const modelJson=document.querySelector(`${selectors2.modelJson}${sectionId}`);modelJson&&(window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0)}window.ShopifyXR.setupXRElements()}function setupModelViewerUi(errors){if(errors){console.warn(errors);return}for(const key in models)if(models.hasOwnProperty(key)){const model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.element),setupModelViewerListeners(model))}}function setupModelViewerListeners(model){const xrButton=xrButtons[model.sectionId];model.container.addEventListener("theme:media:visible",function(){xrButton.element.setAttribute(selectors2.model3d,model.modelId),!window.theme.touch&&(model.modelViewerUi.play(),model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0}))}),model.container.addEventListener("theme:media:hidden",function(){model.modelViewerUi.pause()}),model.container.addEventListener("xrLaunch",function(){model.modelViewerUi.pause()}),model.element.addEventListener("load",()=>{xrButton.element.setAttribute(selectors2.model3d,model.modelId),model.container.classList.remove(classes2.isLoading),model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})}),model.element.addEventListener("shopify_model_viewer_ui_toggle_play",function(){pauseOtherMedia(model.mediaId),setTimeout(()=>{model.container.dispatchEvent(new CustomEvent("theme:media:play"),{bubbles:!0})},50)}),model.element.addEventListener("shopify_model_viewer_ui_toggle_pause",function(){model.container.dispatchEvent(new CustomEvent("theme:media:pause"),{bubbles:!0})}),pauseOtherMedia(model.mediaId)}function pauseOtherMedia(mediaId){const currentMedia=`[${selectors2.mediaId}="${mediaId}"]`,otherMedia=document.querySelectorAll(`${selectors2.productMediaWrapper}:not(${currentMedia})`);otherMedia.length&&otherMedia.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes2.mediaHidden)})}function removeSectionModels(sectionId){for(const key in models)models.hasOwnProperty(key)&&models[key].sectionId===sectionId&&delete models[key];delete modelJsonSections[sectionId],delete theme.mediaInstances[sectionId]}return{init,loadContent,removeSectionModels}}();const selectors$n={rangeSlider:"[data-range-slider]",rangeDotLeft:"[data-range-left]",rangeDotRight:"[data-range-right]",rangeLine:"[data-range-line]",rangeHolder:"[data-range-holder]",dataMin:"data-se-min",dataMax:"data-se-max",dataMinValue:"data-se-min-value",dataMaxValue:"data-se-max-value",dataStep:"data-se-step",dataFilterUpdate:"data-range-filter-update",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]"},classes$l={isInitialized:"is-initialized"};class RangeSlider{constructor(container){this.container=container,this.init(),this.initListener=()=>this.init(),document.addEventListener("theme:filters:init",this.initListener)}init(){if(this.slider=this.container.querySelector(selectors$n.rangeSlider),!this.slider)return;this.resizeFilters=debounce(this.reset.bind(this),50),this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.startX=0,this.x=0,this.touchLeft=this.slider.querySelector(selectors$n.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$n.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$n.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$n.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$n.dataMax)),this.step=0,this.normalizeFact=20;let defaultMinValue=this.min;this.slider.hasAttribute(selectors$n.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$n.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$n.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$n.dataMaxValue))),defaultMinValuethis.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$n.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$n.dataStep)))),this.reset(),window.addEventListener("theme:resize",this.resizeFilters),this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.touchRight.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.slider.classList.add(classes$l.isInitialized)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.startX=0,this.x=0,this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact}setMinValue(minValue){const ratio=(minValue-this.min)/(this.max-this.min);this.touchLeft.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact)))+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$n.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact))+this.normalizeFact)+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$n.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:event.currentTarget===this.touchRight&&(this.x=this.touchRight.offsetLeft),this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,document.addEventListener("mousemove",this.onMoveEvent),document.addEventListener("mouseup",this.onStopEvent),document.addEventListener("touchmove",this.onMoveEvent,{passive:!0}),document.addEventListener("touchend",this.onStopEvent,{passive:!0})}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.xthis.maxX&&(this.x=this.maxX),this.selectedTouch.style.left=this.x+"px"),this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.calculateValue(),this.slider.getAttribute("on-change")&&new Function("min, max",this.slider.getAttribute("on-change"))(this.slider.getAttribute(selectors$n.dataMinValue),this.slider.getAttribute(selectors$n.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$n.dataMinValue),this.slider.getAttribute(selectors$n.dataMaxValue))}onStop(event){document.removeEventListener("mousemove",this.onMoveEvent),document.removeEventListener("mouseup",this.onStopEvent),document.removeEventListener("touchmove",this.onMoveEvent,{passive:!0}),document.removeEventListener("touchend",this.onStopEvent,{passive:!0}),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$n.dataMinValue),this.slider.getAttribute(selectors$n.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$n.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$n.priceMin),priceMax=rangeHolder.querySelector(selectors$n.priceMax);priceMin&&priceMax&&(priceMin.value=parseInt(min),priceMax.value=parseInt(max))}}onChanged(min,max){this.slider.hasAttribute(selectors$n.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("theme:filter:range-update",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.slider.setAttribute(selectors$n.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$n.dataMaxValue,maxValue)}unload(){document.removeEventListener("theme:filters:init",this.initListener),window.removeEventListener("theme:resize",this.resizeFilters)}}const selectors$o={slider:"[data-slider]",productMediaContainer:"[data-product-media-container]",productMediaSlider:"[data-product-media-slideshow]",productMediaSlide:"[data-product-media-slideshow-slide]",progressBar:"[data-product-slideshow-progress]",flickityButton:".flickity-button",popupProduct:"[data-product]",popupClose:"[data-popup-close]"},classes$m={fill:"fill",quickViewVisible:"js-quick-view-visible"},sections$3={};class ProductGrid{constructor(container){this.container=container,this.body=document.body,this.sliders=this.container.querySelectorAll(selectors$o.slider),theme.settings.productGridHover==="slideshow"&&!window.theme.touch&&this.productGridSlideshow(),new QuickViewPopup(this.container)}productGridSlideshow(){const productMediaSlider=this.container.querySelectorAll(selectors$o.productMediaSlider),linkedImages=this.container.querySelectorAll(selectors$o.productMediaContainer);productMediaSlider.length&&productMediaSlider.forEach(slider2=>{const mediaContainer=slider2.closest(selectors$o.productMediaContainer),progressBar=mediaContainer.querySelector(selectors$o.progressBar),countImages=slider2.querySelectorAll(selectors$o.productMediaSlide).length,autoplaySpeed=2200,draggable=!this.sliders.length;let flkty=new Flickity.data(slider2),timer=0,cellSelector=selectors$o.productMediaSlide;!flkty.isActive&&countImages>1&&(flkty=new Flickity(slider2,{draggable,cellSelector,contain:!0,wrapAround:!0,imagesLoaded:!0,lazyLoad:!0,pageDots:!1,prevNextButtons:!1,adaptiveHeight:!1,pauseAutoPlayOnHover:!1,selectedAttraction:.2,friction:1,on:{ready:()=>{this.container.style.setProperty("--autoplay-speed",`${autoplaySpeed}ms`)},change:()=>{timer&&clearTimeout(timer),progressBar.classList.remove(classes$m.fill),requestAnimationFrame(()=>{progressBar.classList.add(classes$m.fill)}),timer=setTimeout(()=>{progressBar.classList.remove(classes$m.fill)},autoplaySpeed)},dragEnd:()=>{flkty.playPlayer()}}}),window.theme.touch||(mediaContainer.addEventListener("mouseenter",()=>{progressBar.classList.add(classes$m.fill),timer&&clearTimeout(timer),timer=setTimeout(()=>{progressBar.classList.remove(classes$m.fill)},autoplaySpeed),flkty.options.autoPlay=autoplaySpeed,flkty.playPlayer()}),mediaContainer.addEventListener("mouseleave",()=>{flkty.stopPlayer(),timer&&clearTimeout(timer),progressBar.classList.remove(classes$m.fill)})))}),linkedImages.length&&linkedImages.forEach(item=>{item.addEventListener("click",e=>{e.target.matches(selectors$o.flickityButton)&&e.preventDefault()})})}popupClose(){const popupProduct=document.querySelector(selectors$o.popupProduct);popupProduct&&popupProduct.querySelector(selectors$o.popupClose).dispatchEvent(new Event("click"))}onBlockSelect(){this.body.classList.contains(classes$m.quickViewVisible)&&this.popupClose()}onDeselect(){this.body.classList.contains(classes$m.quickViewVisible)&&this.popupClose()}onUnload(){this.body.classList.contains(classes$m.quickViewVisible)&&this.popupClose()}}const productGrid={onLoad(){sections$3[this.id]=new ProductGrid(this.container)},onBlockSelect(){sections$3[this.id].onBlockSelect()},onDeselect(){sections$3[this.id].onDeselect()},onUnload(){sections$3[this.id].onUnload()}},selectors$p={ajaxinateContainer:"#AjaxinateLoop",ajaxinatePagination:"#AjaxinatePagination"};let sections$4={};class Ajaxify{constructor(container){this.container=container,this.endlessScroll=null,theme.settings.enableInfinityScroll&&this.init()}init(){this.loadMoreFix(),this.endlessScroll=new Ajaxinate({container:selectors$p.ajaxinateContainer,pagination:selectors$p.ajaxinatePagination,method:"scroll"})}loadMoreFix(){Ajaxinate.prototype.loadMore=function(){this.request=new XMLHttpRequest,this.request.onreadystatechange=function(){if(!this.request.responseXML||!this.request.readyState===4||!this.request.status===200)return;const newContainer=this.request.responseXML.querySelector(this.settings.container),newPagination=this.request.responseXML.querySelector(this.settings.pagination);this.containerElement.insertAdjacentHTML("beforeend",newContainer.innerHTML),typeof newPagination>"u"||newPagination===null?this.removePaginationElement():(this.paginationElement.innerHTML=newPagination.innerHTML,this.settings.callback&&typeof this.settings.callback=="function"&&this.settings.callback(this.request.responseXML),this.initialize())}.bind(this),this.request.open("GET",this.nextPageUrl,!0),this.request.responseType="document",this.request.send()}}unload(){this.endlessScroll&&this.endlessScroll.destroy()}}const ajaxify={onLoad(){sections$4=new Ajaxify(this.container)},onUnload:function(){typeof sections$4.unload=="function"&§ions$4.unload()}},settings$5={loadingTimeout:300},selectors$q={buttons:"button",toggleFilters:"[data-toggle-filters]",closeFilters:"[data-close-filters]",openFilters:"[data-open-filters]",collectionWrapper:"[data-collection-wrapper]",collapsibleTrigger:"[data-collapsible-trigger]",sortToggle:"[data-sort-toggle]",collectionSortOptions:"[data-collection-sort-options]",inputs:"input, select, label, textarea",inputSort:"[data-input-sort]",filters:"[data-collection-filters]",filtersWrapper:"[data-collection-filters-wrapper]",filtersList:"[data-collection-filters-list]",filtersStickyBar:"[data-collection-sticky-bar]",filter:"[data-collection-filter]",filterTag:"[data-collection-filter-tag]",filterTagButton:"[data-collection-filter-tag-button]",filtersForm:"[data-collection-filters-form]",filterResetButton:"[data-filter-reset-button]",filterTagClearButton:"[data-filter-tag-reset-button]",popupsSection:'[data-section-type="popups"]',productGrid:"[data-collection-products]",productMediaSlideshow:"[data-product-media-slideshow]",productMediaSlide:"[data-product-media-slideshow-slide]",productsCount:"[data-products-count]",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]",rangeMin:"[data-se-min-value]",rangeMax:"[data-se-max-value]",rangeMinValue:"data-se-min-value",rangeMaxValue:"data-se-max-value",rangeMinDefault:"data-se-min",rangeMaxDefault:"data-se-max",searchForm:"[data-search-form]"},classes$n={isActive:"is-active",isExpanded:"is-expanded",isVisible:"is-visible",isLoading:"is-loading",popupVisible:"popup--visible",collectionFiltersVisible:"collection__filters--visible",collectionSortOptionWrapperVisible:"collection__sort__option-wrapper--visible"},attributes$g={filterActive:"data-filter-active",preventScrollLock:"data-prevent-scroll-lock",filtersDefaultState:"data-filters-default-state"},sections$5={};class Filters{constructor(container){this.container=container,this.sectionId=container.dataset.sectionId,this.enableFilters=container.dataset.enableFilters==="true",this.filterMode=container.dataset.filterMode,this.collectionHandle=this.container.dataset.collection,this.productGrid=this.container.querySelector(selectors$q.productGrid),this.productsCount=this.container.querySelector(selectors$q.productsCount),this.groupTagFilters=this.container.querySelectorAll(selectors$q.filter),this.filters=this.container.querySelector(selectors$q.filters),this.filterTriggers=this.container.querySelectorAll(selectors$q.collapsibleTrigger),this.filtersStickyBar=this.container.querySelector(selectors$q.filtersStickyBar),this.filtersForm=this.container.querySelector(selectors$q.filtersForm),this.searchForm=this.container.querySelector(selectors$q.searchForm),this.inputSort=this.container.querySelectorAll(selectors$q.inputSort),this.sortToggle=this.container.querySelector(selectors$q.sortToggle),this.collectionSortOptions=this.container.querySelector(selectors$q.collectionSortOptions),this.a11y=a11y,this.filterData=[],this.rangeSlider=null,this.sortDropdownEvent=()=>this.sortDropdownToggle(),this.onTabHandlerEvent=event=>this.onTabHandler(event),this.updateCollectionFormSortEvent=event=>this.updateCollectionFormSort(event),this.bodyClickEvent=event=>this.bodyClick(event),this.onFilterResetClick=this.onFilterResetClick.bind(this),this.onFilterTagResetClick=this.onFilterTagResetClick.bind(this),this.onFilterTagClearClick=this.onFilterTagClearClick.bind(this),this.onFilterToggleClick=this.onFilterToggleClick.bind(this),this.onKeyUpHandler=this.onKeyUpHandler.bind(this),this.updateRangeEvent=this.updateRange.bind(this),this.debouncedSubmitEvent=debounce(event=>{this.onSubmitHandler(event)},500),this.debouncedSortEvent=debounce(event=>{this.onSortChange(event)},500),this.productGridEvents={},this.filters&&(this.hideFiltersDrawer=this.hideFiltersDrawer.bind(this),this.showFiltersDrawer=this.showFiltersDrawer.bind(this),this.resizeEvent=()=>this.filtersResizeEvents(),this.filtersResizeEvents(),document.addEventListener("theme:resize:width",this.resizeEvent)),this.initTagFilters(),this.initFacetedFilters(),this.bindToggleButtonsEvents(),this.bindFilterButtonsEvents(),this.initProductGridEvents(theme.settings.enableInfinityScroll),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),setVars(),window.addEventListener("popstate",this.onHistoryChange.bind(this)),this.sortToggle?.addEventListener("click",this.sortDropdownEvent),document.addEventListener("click",this.bodyClickEvent)}initFacetedFilters(){this.filterMode=="tag"||this.filterMode=="group"||!this.enableFilters||(this.rangeSlider=new RangeSlider(this.container))}updateRange(){const rangeMin=this.filtersForm.querySelector(selectors$q.rangeMin),rangeMax=this.filtersForm.querySelector(selectors$q.rangeMax),priceMin=this.filtersForm.querySelector(selectors$q.priceMin),priceMax=this.filtersForm.querySelector(selectors$q.priceMax);if(rangeMin.hasAttribute(selectors$q.rangeMinValue)&&rangeMax.hasAttribute(selectors$q.rangeMaxValue)){const priceMinValue=parseFloat(priceMin.placeholder,10),priceMaxValue=parseFloat(priceMax.placeholder,10),rangeMinValue=parseFloat(rangeMin.getAttribute(selectors$q.rangeMinValue),10),rangeMaxValue=parseFloat(rangeMax.getAttribute(selectors$q.rangeMaxValue),10);(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=parseInt(rangeMinValue),priceMax.value=parseInt(rangeMaxValue),this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0})))}}onSubmitHandler(event){event.preventDefault();const formData=new FormData(this.filtersForm),searchParams=new URLSearchParams(formData),rangeMin=this.filtersForm.querySelector(selectors$q.rangeMin),rangeMax=this.filtersForm.querySelector(selectors$q.rangeMax),priceMin=this.filtersForm.querySelector(selectors$q.priceMin),priceMax=this.filtersForm.querySelector(selectors$q.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$q.rangeMinDefault)&&rangeMax.hasAttribute(selectors$q.rangeMaxDefault)){const rangeMinDefault=parseFloat(rangeMin.getAttribute(selectors$q.rangeMinDefault),10),rangeMaxDefault=parseFloat(rangeMax.getAttribute(selectors$q.rangeMaxDefault),10),priceMinValue=priceMin.value?parseFloat(priceMin.value,10):rangeMinDefault,priceMaxValue=priceMax.value?parseFloat(priceMax.value,10):rangeMaxDefault;priceMinValue<=rangeMinDefault&&priceMaxValue>=rangeMaxDefault&&(searchParams.delete("filter.v.price.gte"),searchParams.delete("filter.v.price.lte"))}this.renderSection(searchParams.toString(),event)}onHistoryChange(event){if(!this.filters)return;const searchParams=event.state?.searchParams||"";this.renderSection(searchParams,null,!1)}renderSection(searchParams,event,updateURLHash=!0){this.startLoading();const url=`${window.location.pathname}?section_id=${this.sectionId}&${searchParams}`,filterDataUrl=element=>element.url===url;this.filterData.some(filterDataUrl)?this.renderSectionFromCache(filterDataUrl,event):this.renderSectionFromFetch(url,event),updateURLHash&&this.updateURLHash(searchParams)}renderSectionFromFetch(url){fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText;this.filterData=[...this.filterData,{html,url}],this.inputSort=this.container.querySelectorAll(selectors$q.inputSort),this.renderFilters(html),this.bindFilterButtonsEvents(),this.hideFiltersOnMobile(),this.renderProductGrid(html),this.updateProductsCount(html),this.finishLoading(),this.mobileFiltersScrollLock()})}renderSectionFromCache(filterDataUrl,event){const html=this.filterData.find(filterDataUrl).html;this.renderFilters(html,event),this.hideFiltersOnMobile(),this.renderProductGrid(html),this.updateProductsCount(html),this.finishLoading(),this.mobileFiltersScrollLock()}renderProductGrid(html){const newProductGrid=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$q.productGrid);newProductGrid&&(this.productGrid.innerHTML=newProductGrid.innerHTML,this.initProductGridEvents(theme.settings.enableInfinityScroll))}updateProductsCount(html){const newProductsCount=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$q.productsCount);newProductsCount&&(this.productsCount.innerHTML=newProductsCount.innerHTML)}renderFilters(html){const newFilters=new DOMParser().parseFromString(html,"text/html").querySelector(selectors$q.filters);newFilters&&(this.filters.innerHTML=newFilters.innerHTML,this.filtersForm=document.querySelector(selectors$q.filtersForm),this.bindFilterButtonsEvents(),this.bindToggleButtonsEvents(),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),document.dispatchEvent(new CustomEvent("theme:filters:init",{bubbles:!0})))}updateURLHash(searchParams){history.pushState({searchParams},"",`${window.location.pathname}${searchParams&&"?".concat(searchParams)}`)}bindFilterButtonsEvents(){this.inputSort.length>0&&this.inputSort.forEach(input=>{input.addEventListener("change",this.updateCollectionFormSortEvent)}),!(this.filterMode=="tag"||this.filterMode=="group"||!this.enableFilters)&&(this.container.querySelectorAll(selectors$q.filterResetButton).forEach(button=>{button.addEventListener("click",this.onFilterResetClick,{once:!0})}),this.filtersForm&&(this.filtersForm.addEventListener("input",this.debouncedSubmitEvent.bind(this)),this.filtersForm.addEventListener("theme:filter:range-update",this.updateRangeEvent)),this.collectionSortOptions&&this.collectionSortOptions.addEventListener("keyup",this.onTabHandlerEvent))}onFilterResetClick(event){event.preventDefault(),this.renderSection(new URL(event.currentTarget.href).searchParams.toString())}bindToggleButtonsEvents(){this.container.querySelectorAll(selectors$q.toggleFilters).forEach(button=>{button.addEventListener("click",this.onFilterToggleClick)}),this.container.querySelectorAll(selectors$q.closeFilters).forEach(button=>{button.addEventListener("click",this.hideFiltersDrawer)}),this.container.querySelectorAll(selectors$q.openFilters).forEach(button=>{button.addEventListener("click",this.showFiltersDrawer)}),this.container.querySelector(selectors$q.collectionWrapper).addEventListener("keyup",this.onKeyUpHandler)}onTabHandler(event){if(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER){const newSortValue=event.target.previousElementSibling.value;this.filtersForm.querySelectorAll(selectors$q.inputSort).forEach(input=>{input.checked&&(input.checked=!1),input.value===newSortValue&&(input.checked=!0)}),this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0})),event.target.dispatchEvent(new Event("click",{bubbles:!0}))}}onKeyUpHandler(event){event.code===theme.keyboardKeys.ESCAPE&&this.hideFiltersDrawer()}onFilterToggleClick(event){event.preventDefault(),setVars(),this.filters.classList.contains(classes$n.collectionFiltersVisible)?this.hideFiltersDrawer():this.showFiltersDrawer()}sortDropdownToggle(){this.collectionSortOptions&&this.collectionSortOptions.classList.toggle(classes$n.collectionSortOptionWrapperVisible)}bodyClick(event){if(!this.collectionSortOptions)return;const isSortBar=this.sortToggle.contains(event.target);this.collectionSortOptions.classList.contains(classes$n.collectionSortOptionWrapperVisible)&&!isSortBar&&this.sortDropdownToggle()}updateCollectionFormSort(event){const target=event.target,newSortValue=target.value,secondarySortBy=target.closest(selectors$q.collectionSortOptions);this.container.querySelectorAll(selectors$q.inputSort).forEach(input=>{input.value===newSortValue&&(input.checked=!0)}),secondarySortBy!==null&&this.filtersForm.dispatchEvent(new Event("input",{bubbles:!0}))}showFiltersDrawer(){const instance=this;this.a11y.state.trigger=document.querySelector(selectors$q.toggleFilters),this.a11y.trapFocus({container:instance.filters}),this.mobileFiltersScrollLock()}mobileFiltersScrollLock(){if(window.innerWidth{filterTriggers.forEach(element=>{const isFilterActive=element.getAttribute(attributes$g.filterActive)==="true";element.classList.contains(classes$n.isExpanded)&&!isFilterActive&&element.dispatchEvent(new Event("click"))})})}showFiltersOnDesktop(){const filterTriggers=this.container.querySelectorAll(selectors$q.collapsibleTrigger);this.container.getAttribute(attributes$g.filtersDefaultState)==="open"&&filterTriggers.forEach(element=>{element.classList.contains(classes$n.isExpanded)||element.dispatchEvent(new Event("click"))})}hideFiltersDrawer(){let filtersVisible=this.filters.classList.contains(classes$n.collectionFiltersVisible),loading2=this.container.classList.contains(classes$n.isLoading);filtersVisible&&(this.filters.classList.remove(classes$n.collectionFiltersVisible),this.a11y.removeTrapFocus()),loading2||document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$5.loadingTimeout}))}filtersResizeEvents(){window.innerWidth>=theme.sizes.large?(this.showFiltersOnDesktop(),this.hideFiltersDrawer()):this.hideFiltersOnMobile()}initTagFilters(){this.filterMode!="tag"&&this.filterMode!="group"||!this.enableFilters||(this.tags=this.container.dataset.tags.split("+").filter(item=>item),this.bindFilterTagButtonsEvents(),this.bindSortChangeEvent())}renderTagFiltersProducts(url){this.startLoading(),typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),fetch(url).then(response=>response.text()).then(responseText=>{const html=responseText,parsedData=new DOMParser().parseFromString(html,"text/html"),productsHTML=parsedData.querySelector(selectors$q.productGrid).innerHTML,filtersHTML=parsedData.querySelector(selectors$q.filters).innerHTML;this.productGrid.innerHTML=productsHTML,this.filters.innerHTML=filtersHTML,this.inputSort=this.container.querySelectorAll(selectors$q.inputSort),this.filtersForm=document.querySelector(selectors$q.filtersForm),this.filterData=[...this.filterData,{html,url}],this.alreadyClicked=!1,this.bindFilterTagButtonsEvents(),this.bindFilterButtonsEvents(),this.bindSortChangeEvent(),this.bindToggleButtonsEvents(),this.initProductGridEvents(theme.settings.enableInfinityScroll),this.updateProductsCount(html),this.mobileFiltersScrollLock(),this.hideFiltersOnMobile(),makeSwatches(this.container),this.collapsible=new Collapsible(this.container),history.replaceState&&window.history.pushState({path:url},"",url)}).catch(error=>{this.finishLoading(),console.log(`Error: ${error}`)})}bindFilterTagButtonsEvents(){this.container.querySelectorAll(selectors$q.filterTagButton).forEach(button=>{button.addEventListener("click",this.onFilterTagButtonClick.bind(this))}),this.container.querySelectorAll(selectors$q.filterTagClearButton).forEach(button=>{button.addEventListener("click",this.onFilterTagClearClick)}),this.container.querySelectorAll(selectors$q.filterResetButton).forEach(button=>{button.addEventListener("click",this.onFilterTagResetClick)})}bindSortChangeEvent(){this.container.querySelectorAll(selectors$q.inputSort).forEach(input=>{input.addEventListener("input",this.debouncedSortEvent.bind(this))})}onFilterTagButtonClick(event){if(event.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0;const button=event.currentTarget,selectedTag=button.dataset.tag;if(button.parentNode.classList.contains(classes$n.isActive)){let tagIndex=this.tags.indexOf(selectedTag);button.parentNode.classList.remove(classes$n.isActive),tagIndex>-1&&this.tags.splice(tagIndex,1)}else button.parentNode.classList.add(classes$n.isActive),this.tags.push(selectedTag);let url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.container.querySelector(selectors$q.filter).classList.remove(classes$n.isExpanded),this.container.querySelector(selectors$q.filter).setAttribute("aria-expanded",!1),this.container.setAttribute("data-tags","["+this.tags+"]"),this.renderTagFiltersProducts(url)}onFilterTagClearClick(event){if(event.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0;const selectedTag=event.currentTarget.dataset.tag,tagIndex=this.tags.indexOf(selectedTag);tagIndex>-1&&this.tags.splice(tagIndex,1);const url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.container.setAttribute("data-tags","["+this.tags+"]"),this.renderTagFiltersProducts(url)}onSortChange(){let url=this.collectionHandle+"/"+this.tags.join("+")+"?sort_by="+this.getSortValue();this.renderTagFiltersProducts(url)}getSortValue(){let sortValue="";return this.inputSort.forEach(input=>{input.checked&&(sortValue=input.value)}),sortValue}onFilterTagResetClick(event){if(event?.preventDefault(),this.alreadyClicked)return;this.alreadyClicked=!0,this.container.querySelectorAll(selectors$q.filterTag).forEach(element=>{element.classList.remove(classes$n.isActive)}),this.container.querySelectorAll(selectors$q.filter).forEach(element=>{element.classList.remove(classes$n.isExpanded),element.setAttribute("aria-expanded",!1)}),this.tags=[],this.container.setAttribute("data-tags","");let url=this.collectionHandle+"/?sort_by="+this.getSortValue();this.renderTagFiltersProducts(url)}getProductsOffsetTop(){return this.productGrid.getBoundingClientRect().top-document.body.getBoundingClientRect().top-this.filtersStickyBar.offsetHeight}getStickyBarOffsetTop(){return this.filtersStickyBar.getBoundingClientRect().top-document.body.getBoundingClientRect().top}initProductGridEvents(infinityScroll){if(this.productGridEvents=new ProductGrid(this.container),infinityScroll){this.initInfinityScroll();return}setTimeout(()=>{this.finishLoading()},settings$5.loadingTimeout*1.5)}initInfinityScroll(){typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),this.endlessCollection=new Ajaxify(this.container),this.endlessCollection.endlessScroll.settings.callback=()=>{this.initProductGridEvents(!1)}}startLoading(){this.container.classList.add(classes$n.isLoading),window.innerWidth>=theme.sizes.large&&document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}));let productsTop=this.getProductsOffsetTop();window.scrollTo({top:productsTop,left:0,behavior:"smooth"})}finishLoading(){const popups2=document.querySelectorAll(`${selectors$q.popupsSection} .${classes$n.popupVisible}`),isPopupActive=popups2.length>0;if(this.container.classList.remove(classes$n.isLoading),isPopupActive){let preventScrollPopupsCount=0;[...popups2].forEach(popup=>{popup.hasAttribute(attributes$g.preventScrollLock)&&(preventScrollPopupsCount+=1)}),preventScrollPopupsCount===popups2.length&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$5.loadingTimeout}))}else window.innerWidth>=theme.sizes.large&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:settings$5.loadingTimeout}))}onDeselect(){this.productGridEvents&&this.productGridEvents.onDeselect()}onUnload(){typeof this.endlessCollection=="object"&&this.endlessCollection.unload(),this.productGridEvents&&this.productGridEvents.onUnload(),this.collapsible&&this.collapsible.onUnload(),this.rangeSlider&&this.rangeSlider.unload(),this.filters&&document.removeEventListener("theme:resize:width",this.resizeEvent),document.removeEventListener("click",this.bodyClickEvent),this.groupTagFilters.length>0&&this.onFilterTagResetClick()}}const filters={onLoad(){sections$5[this.id]=new Filters(this.container)},onDeselect(){sections$5[this.id].onDeselect()},onUnload(){sections$5[this.id].onUnload()}};register("collection-template",filters);const selectors$r={templateAddresses:".template-customers-addresses",accountForm:"[data-form]",addressNewForm:"[data-form-new]",btnNew:"[data-button-new]",btnEdit:"[data-button-edit]",btnDelete:"[data-button-delete]",btnCancel:"[data-button-cancel]",editAddress:"data-form-edit",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:"[data-country-option]",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer",requiredInputs:'input[type="text"]:not(.optional)'},attributes$h={dataFormId:"data-form-id"},classes$o={hidden:"is-hidden",validation:"validation--showup"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$r.addressNewForm),this.accountForms=this.section.querySelectorAll(selectors$r.accountForm),this.init(),this.validate()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$r.btnNew);newButtons.length&&newButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),button.classList.add(classes$o.hidden),newAddressForm.classList.remove(classes$o.hidden)})});const editButtons=section.querySelectorAll(selectors$r.btnEdit);editButtons.length&&editButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(attributes$h.dataFormId);section.querySelector(`[${selectors$r.editAddress}="${formId}"]`).classList.toggle(classes$o.hidden)})});const deleteButtons=section.querySelectorAll(selectors$r.btnDelete);deleteButtons.length&&deleteButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault();const formId=this.getAttribute(attributes$h.dataFormId);confirm(theme.strings.delete_confirm)&&Shopify.postLink("/account/addresses/"+formId,{parameters:{_method:"delete"}})})});const cancelButtons=section.querySelectorAll(selectors$r.btnCancel);cancelButtons.length&&cancelButtons.forEach(button=>{button.addEventListener("click",function(e){e.preventDefault(),this.closest(selectors$r.accountForm).classList.add(classes$o.hidden),document.querySelector(selectors$r.btnNew).classList.remove(classes$o.hidden)})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$r.addressCountryNew,selectors$r.addressProvinceNew,{hideElement:selectors$r.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$r.addressCountryOption).forEach(element=>{const formId=element.getAttribute(attributes$h.dataFormId),countrySelector=`${selectors$r.addressCountry}_${formId}`,provinceSelector=`${selectors$r.addressProvince}_${formId}`,containerSelector=`${selectors$r.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}validate(){this.accountForms.forEach(accountForm=>{const form=accountForm.querySelector("form"),inputs=form.querySelectorAll(selectors$r.requiredInputs);form.addEventListener("submit",event=>{let isEmpty=!1;inputs.forEach(input=>{input.value?input.nextElementSibling.classList.remove(classes$o.validation):(input.nextElementSibling.classList.add(classes$o.validation),isEmpty=!0)}),isEmpty&&event.preventDefault()})})}}const template=document.querySelector(selectors$r.templateAddresses);template&&new Addresses(template);const selectors$s={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",login:"[data-login-form]",recoverSuccess:"[data-recover-success]",recoverSuccessText:"[data-recover-success-text]",recoverHash:"#recover"},classes$p={hidden:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$s.showReset),this.hideButton=form.querySelector(selectors$s.hideReset),this.recover=form.querySelector(selectors$s.recover),this.login=form.querySelector(selectors$s.login),this.success=form.querySelector(selectors$s.recoverSuccess),this.successText=form.querySelector(selectors$s.recoverSuccessText),this.init()}init(){window.location.hash==selectors$s.recoverHash?this.showRecoverPasswordForm():this.hideRecoverPasswordForm(),this.success&&this.successText.classList.remove(classes$p.hidden),this.showButton.addEventListener("click",e=>{e.preventDefault(),this.showRecoverPasswordForm()},!1),this.hideButton.addEventListener("click",e=>{e.preventDefault(),this.hideRecoverPasswordForm()},!1)}showRecoverPasswordForm(){return this.recover.classList.remove(classes$p.hidden),this.login.classList.add(classes$p.hidden),window.location.hash=selectors$s.recoverHash,!1}hideRecoverPasswordForm(){return this.login.classList.remove(classes$p.hidden),this.recover.classList.add(classes$p.hidden),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$s.form);loginForm&&new Login(loginForm),register("search-template",filters);const selectors$t={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone"},attributes$i={speed:"data-marquee-speed"},classes$q={animationClass:"ticker--animated",unloadedClass:"ticker--unloaded",comparitorClass:"ticker__comparitor"},settings$6={moveTime:1.63,space:100};class Ticker{constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$t.scale),this.text=this.frame.querySelector(selectors$t.text),this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$q.comparitorClass),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$q.unloadedClass),this.resizeEvent=debounce(()=>this.checkWidth(),100),this.listen()}listen(){document.addEventListener("theme:resize:width",this.resizeEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2;if(this.frame.clientWidth-padding{setTimeout(()=>{this.slider.dispatchEvent(new CustomEvent("slider-is-loaded",{bubbles:!0,detail:{slider:this}}))},10)}}}),this.flkty.reposition()}this.slider.addEventListener("slider-is-loaded",()=>{this.initTickers()})}initTickers(stopClone=!1){this.barHolder.querySelectorAll(selectors$u.frame).forEach(element=>{new Ticker(element,stopClone);const slides=element.querySelectorAll(selectors$u.barSlide);if(slides.length!==0){const slidesMobile=element.querySelectorAll(`${selectors$u.barSlide}.${classes$r.mobile}`),slidesDesktop=element.querySelectorAll(`${selectors$u.barSlide}.${classes$r.desktop}`);slides.length===slidesMobile.length?element.parentNode.classList.add(classes$r.mobile):slides.length===slidesDesktop.length&&element.parentNode.classList.add(classes$r.desktop)}})}toggleTicker(e,isStoped){const tickerScale=e.target.closest(selectors$u.tickerScale),element=document.querySelector(`[${attributes$j.slide}="${e.detail.blockId}"]`);isStoped&&element&&(tickerScale.setAttribute(attributes$j.stop,""),tickerScale.querySelectorAll(selectors$u.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes$r.tickerAnimated),textHolder.style.transform=`translate3d(${-(element.offsetLeft-parseInt(getComputedStyle(element).marginLeft,10))}px, 0, 0)`})),!isStoped&&element&&(tickerScale.querySelectorAll(selectors$u.tickerText).forEach(textHolder=>{textHolder.classList.add(classes$r.tickerAnimated),textHolder.removeAttribute(attributes$j.style)}),tickerScale.removeAttribute(attributes$j.stop))}tickerAnimationPause(){let hoverTimer=0,isHovered=!1;const tickerContainer=this.barHolder.querySelector(selectors$u.topBarSlide);tickerContainer.addEventListener("mouseenter",()=>{isHovered=!0,hoverTimer=setTimeout(()=>{isHovered&&tickerContainer.querySelectorAll(selectors$u.tickerText).forEach(element=>{element.style.animationPlayState="paused"}),clearTimeout(hoverTimer)},500)}),tickerContainer.addEventListener("mouseleave",()=>{isHovered=!1,tickerContainer.querySelectorAll(selectors$u.tickerText).forEach(element=>{element.style.animationPlayState="running"})})}onBlockSelect(evt){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));this.slider&&this.flkty!==null&&(this.flkty.select(index),this.flkty.pausePlayer()),this.slider||this.toggleTicker(evt,!0)}onBlockDeselect(evt){this.slider&&this.flkty!==null&&this.flkty.unpausePlayer(),this.slider||this.toggleTicker(evt,!1)}onUnload(){document.removeEventListener("theme:resize:width",this.initSlider.bind(this))}}const bar={onLoad(){sections$6[this.id]=[];const element=this.container.querySelector(selectors$u.bar);element&§ions$6[this.id].push(new AnnouncementBar(element))},onBlockSelect(e){sections$6[this.id].length&§ions$6[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$6[this.id].length&§ions$6[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockDeselect(e)})}};register("announcement-bar",bar),register("marquee",bar);const selectors$v={trigger:"[data-collapsible-trigger]"},classes$s={isExpanded:"is-expanded"};register("accordions",[{onBlockSelect(e){const trigger=e.target.querySelector(selectors$v.trigger);trigger.classList.contains(classes$s.isExpanded)||trigger.dispatchEvent(new Event("click"))}},collapsible]);const selectors$w={button:"[data-share-button]",tooltip:"[data-share-button-tooltip]"},classes$t={visible:"is-visible",hiding:"is-hiding"},sections$7={};class ShareButton{constructor(container){this.container=container,this.button=this.container.querySelector(selectors$w.button),this.tooltip=this.container.querySelector(selectors$w.tooltip),this.transitionSpeed=200,this.hideTransitionTimeout=0,this.init()}init(){this.button&&this.button.addEventListener("click",()=>{let targetUrl=window.location.href;this.button.dataset.shareLink&&(targetUrl=this.button.dataset.shareLink),this.tooltip.classList.contains(classes$t.visible)||navigator.clipboard.writeText(targetUrl).then(()=>{this.tooltip.classList.add(classes$t.visible),setTimeout(()=>{this.tooltip.classList.add(classes$t.hiding),this.tooltip.classList.remove(classes$t.visible),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{this.tooltip.classList.remove(classes$t.hiding)},this.transitionSpeed)},1500)})})}}const shareButton={onLoad(){sections$7[this.id]=new ShareButton(this.container)}};register("article",[shareButton]);const selectors$x={banner:"[data-banner]",slider:"[data-slider]",sliderMedia:"[data-banners-media]"},attributes$k={index:"data-index",singleImage:"data-slider-single-image"};let sections$8={};class BannerWithTextColumns{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$x.slider),this.singleImageEnabled=this.slider?.hasAttribute(attributes$k.singleImage),this.banners=this.container.querySelectorAll(selectors$x.banner),this.links=this.container.querySelectorAll("a"),this.sliderMedia=this.container.querySelector(selectors$x.sliderMedia),this.flkty=null,this.flktyMedia=null,this.sliderResizeEvent=()=>this.resizeSlider(),this.slider&&(this.initSliders(),document.addEventListener("theme:resize:width",this.sliderResizeEvent))}initSliders(){if(this.slider.children.length<=1)return;let isDraggable=window.innerWidth1&&(this.flktyMedia=new Flickity(this.sliderMedia,{draggable:!1,wrapAround:!1,fade:!0,prevNextButtons:!1,adaptiveHeight:!1,pageDots:!1,setGallerySize:!1}),flickitySmoothScrolling(this.sliderMedia)),this.flkty=new Flickity(this.slider,{draggable:isDraggable,prevNextButtons:!1,pageDots:!0,cellAlign:"left",adaptiveHeight:!1,imagesLoaded:!0,lazyLoad:!0,on:{ready:()=>{this.links.forEach(link=>{link.addEventListener("focus",()=>{const selectedIndex=Number(link.closest(selectors$x.banner).getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&this.syncContent(selectedIndex)})}),this.banners.forEach(slide=>{slide.addEventListener("mouseenter",()=>{const selectedIndex=Number(slide.getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&!window.theme.touch&&this.syncContent(selectedIndex)}),slide.addEventListener("pointerup",()=>{const selectedIndex=Number(slide.getAttribute(attributes$k.index));window.innerWidth>=theme.sizes.small&&window.theme.touch&&this.syncContent(selectedIndex)})})},change:index=>{window.innerWidth{element.addEventListener("click",e=>{if(element.hasAttribute(attributes$l.videoPlayValue)&&element.getAttribute(attributes$l.videoPlayValue).trim()!==""){e.preventDefault();const items=[{html:element.getAttribute(attributes$l.videoPlayValue)}];this.a11y.state.trigger=element,new LoadPhotoswipe(items)}})})}}const videoPlay={onLoad(){new VideoPlay(this.container)}},selectors$z={slider:"[data-slider]",sliderItem:"[data-slider-item]",sliderItemImage:"[data-media-container]",links:"a, button",flickityButton:".flickity-button"},classes$u={carouselInactive:"carousel--inactive"},attributes$m={tabIndex:"tabindex"},sections$9={};class ColumnsWithImage{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$z.slider),this.flkty=null,this.gutter=0,this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.listen()}initSlider(){this.slider.classList.remove(classes$u.carouselInactive),this.flkty=new Flickity(this.slider,{pageDots:!1,cellAlign:"left",groupCells:!0,contain:!0,on:{ready:()=>{this.setSliderArrowsPosition(this.slider),setTimeout(()=>{this.changeTabIndex()},0)},change:()=>{this.changeTabIndex()}}})}destroySlider(){this.slider.classList.add(classes$u.carouselInactive),this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}checkSlidesSize(){const sliderItemStyle=this.container.querySelector(selectors$z.sliderItem).currentStyle||window.getComputedStyle(this.container.querySelector(selectors$z.sliderItem));this.gutter=parseInt(sliderItemStyle.marginRight);const containerWidth=this.slider.offsetWidth,itemsWidth=this.getItemsWidth(),itemsOverflowViewport=containerWidth=theme.sizes.small&&itemsOverflowViewport?this.initSlider():this.destroySlider()}changeTabIndex(){const selectedElementsIndex=this.flkty.selectedIndex;this.flkty.slides.forEach((slide,index)=>{slide.cells.forEach(cell=>{cell.element.querySelectorAll(selectors$z.links).forEach(link=>{link.setAttribute(attributes$m.tabIndex,selectedElementsIndex===index?"0":"-1")})})})}getItemsWidth(){let itemsWidth=0;const slides=this.slider.querySelectorAll(selectors$z.sliderItem);return slides.length&&slides.forEach(item=>{itemsWidth+=item.offsetWidth+this.gutter}),itemsWidth}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize))}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$z.flickityButton),image=slider2.querySelector(selectors$z.sliderItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize)}}register("columns-with-image",[{onLoad(){sections$9[this.id]=new ColumnsWithImage(this)},onUnload(e){sections$9[this.id].onUnload(e)},onBlockSelect(e){sections$9[this.id].onBlockSelect(e)}},videoPlay]);const selectors$A={formMessageClose:"[data-form-message-close]",formMessageWrapper:"[data-form-message]"},classes$v={hideDown:"hide-down",notificationVisible:"notification-visible"};let sections$a={};class ContactForm{constructor(section){this.container=section.container,this.closeButton=this.container.querySelector(selectors$A.formMessageClose),this.messageWrapper=this.container.querySelector(selectors$A.formMessageWrapper),this.messageWrapper&&(this.hidePopups(),this.closeFormMessage(),this.autoHideMessage())}hidePopups(){document.body.classList.add(classes$v.notificationVisible)}showPopups(){document.body.classList.remove(classes$v.notificationVisible)}closeFormMessage(){this.closeButton.addEventListener("click",this.closeMessage.bind(this))}closeMessage(e){e.preventDefault(),this.messageWrapper.classList.add(classes$v.hideDown),this.showPopups()}autoHideMessage(){setTimeout(()=>{this.messageWrapper.classList.add(classes$v.hideDown),this.showPopups()},1e4)}}register("contact-form",{onLoad(){sections$a[this.id]=new ContactForm(this)}});class PopupCookie{constructor(name,value){this.configuration={expires:null,path:"/",domain:window.location.hostname,sameSite:"none",secure:!0},this.name=name,this.value=value}write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`)}}const selectors$B={newsletterForm:"[data-newsletter-form]",popup:"[data-popup]"},classes$w={success:"has-success",error:"has-error"},attributes$n={storageNewsletterFormId:"newsletter_form_id"},sections$b={};class Newsletter{constructor(newsletter){this.newsletter=newsletter,this.sessionStorage=window.sessionStorage,this.popup=this.newsletter.closest(selectors$B.popup),this.stopSubmit=!0,this.isChallengePage=!1,this.formID=null,this.formIdSuccess=null,this.checkForChallengePage(),this.newsletterSubmit=e=>this.newsletterSubmitEvent(e),this.isChallengePage||this.init()}init(){this.newsletter.addEventListener("submit",this.newsletterSubmit),this.showMessage()}newsletterSubmitEvent(e){this.stopSubmit&&(e.preventDefault(),this.removeStorage(),this.writeStorage(),this.stopSubmit=!1,this.newsletter.submit())}checkForChallengePage(){this.isChallengePage=window.location.pathname===theme.routes.root+"challenge"}writeStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem(attributes$n.storageNewsletterFormId,this.newsletter.id)}readStorage(){this.formID=this.sessionStorage.getItem(attributes$n.storageNewsletterFormId)}removeStorage(){this.sessionStorage.removeItem(attributes$n.storageNewsletterFormId)}showMessage(){if(this.readStorage(),this.newsletter.id===this.formID){const newsletter=document.getElementById(this.formID),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$w.error),newsletter.classList.add(classes$w.success),this.popup&&(this.cookie=new PopupCookie(this.popup.dataset.cookieName,"user_has_closed"),this.cookie.write())):submissionFailure&&(newsletter.classList.remove(classes$w.success),newsletter.classList.add(classes$w.error)),(submissionSuccess||submissionFailure)&&this.scrollToForm(newsletter)}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();visibilityHelper.isElementPartiallyVisible(newsletter)||visibilityHelper.isElementTotallyVisible(newsletter)||setTimeout(()=>{window.scrollTo({top:rect.top,left:0,behavior:"smooth"})},400)}onUnload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}}const newsletterSection={onLoad(){sections$b[this.id]=[],this.container.querySelectorAll(selectors$B.newsletterForm).forEach(form=>{sections$b[this.id].push(new Newsletter(form))})},onUnload(){sections$b[this.id].forEach(form=>{typeof form.onUnload=="function"&&form.onUnload()})}},selectors$C={product:"[data-product]",productSlider:"[data-slider]",productSlide:"[data-slide]",productGridItemImage:"[data-product-media-container]",flickityButton:".flickity-button",item:"[data-slide]",links:"a, button"},attributes$o={tabIndex:"tabindex"},sections$c={};class CustomContent{constructor(container){this.container=container,this.product=this.container.querySelectorAll(selectors$C.product),this.productSlider=this.container.querySelectorAll(selectors$C.productSlider),this.checkSliderOnResize=()=>this.checkSlider(),this.flkty=[],this.videoObj=[],this.quickViewObj=[],this.listen()}checkSlider(){window.innerWidth>=theme.sizes.small?this.productSlider.forEach(slider2=>{this.initProductSlider(slider2)}):this.productSlider.forEach(slider2=>{this.destroyProductSlider(slider2)})}initProductSlider(slider2){const slidesCount=slider2.querySelectorAll(selectors$C.productSlide).length,sliderId=slider2.dataset.slider;slidesCount>1&&(this.flkty[sliderId]===void 0||!this.flkty[sliderId].isActive?this.flkty[sliderId]=new Flickity(slider2,{prevNextButtons:!0,pageDots:!0,wrapAround:!0,on:{ready:()=>{this.setSliderArrowsPosition(slider2)},change:index=>{this.flkty[sliderId].cells.forEach((slide,i)=>{slide.element.querySelectorAll(selectors$C.links).forEach(link=>{link.setAttribute(attributes$o.tabIndex,i===index?"0":"-1")})})}}}):this.setSliderArrowsPosition(slider2))}destroyProductSlider(slider2){const sliderId=slider2.dataset.slider;typeof this.flkty[sliderId]=="object"&&this.flkty[sliderId].destroy()}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$C.flickityButton),image=slider2.querySelector(selectors$C.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}listen(){this.checkSlider(),document.addEventListener("theme:resize:width",this.checkSliderOnResize)}onUnload(){if(this.flkty)for(const key in this.flkty)this.flkty.hasOwnProperty(key)&&this.flkty[key].destroy();document.removeEventListener("theme:resize:width",this.checkSliderOnResize)}}register("custom-content",[{onLoad(){sections$c[this.id]=new CustomContent(this.container)},onUnload(e){sections$c[this.id].onUnload(e)}},newsletterSection,videoPlay,productGrid]);const selectors$D={slider:"[data-slider]",sliderItem:"[data-slide]",productGridItemImage:"[data-product-media-container]",links:"a, button",flickityButton:".flickity-button"},classes$x={carousel:"carousel",carouselInactive:"carousel--inactive",isLastSlideVisible:"is-last-slide-visible"},attributes$p={sliderId:"data-slider-id",showImage:"data-slider-show-image",tabIndex:"tabindex"},sections$d={};class GridSlider{constructor(container){this.container=container,this.columns=parseInt(this.container.dataset.columns),this.sliders=this.container.querySelectorAll(selectors$D.slider),this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.resetSliderEvent=e=>this.resetSlider(e),this.flkty=[],this.listen(),this.handleLastSlideOverlayOnMobile()}initSlider(slider2){const sliderId=slider2.getAttribute(attributes$p.sliderId);slider2.classList.remove(classes$x.carouselInactive),this.flkty[sliderId]===void 0||!this.flkty[sliderId].isActive?(this.flkty[sliderId]=new Flickity(slider2,{pageDots:!1,cellSelector:selectors$D.sliderItem,cellAlign:"left",groupCells:!0,contain:!0,wrapAround:!1,adaptiveHeight:!1,on:{ready:()=>{this.setSliderArrowsPosition(slider2),setTimeout(()=>{this.changeTabIndex(slider2)},0)},change:()=>{this.changeTabIndex(slider2)}}}),this.handleLastSlideOverlayOnTablet(slider2)):this.setSliderArrowsPosition(slider2)}destroySlider(slider2){const sliderId=slider2.getAttribute(attributes$p.sliderId);slider2.classList.contains(classes$x.carousel)&&slider2.classList.add(classes$x.carouselInactive),typeof this.flkty[sliderId]=="object"&&this.flkty[sliderId].destroy()}resetSlider(e){const slider2=e.target,sliderId=slider2.getAttribute(attributes$p.sliderId);typeof this.flkty[sliderId]=="object"?this.flkty[sliderId].select(0,!1,!0):slider2.scrollTo({left:0,behavior:"instant"})}checkSlidesSize(){this.sliders.length&&this.sliders.forEach(slider2=>{const columns=this.columns,isDesktop=window.innerWidth>=theme.sizes.large,isTablet=window.innerWidth>=theme.sizes.small&&window.innerWidthcolumns||isTablet&&itemsCount>2?this.initSlider(slider2):this.destroySlider(slider2)})}changeTabIndex(slider2){const sliderId=slider2.getAttribute(attributes$p.sliderId),selectedElementsIndex=this.flkty[sliderId].selectedIndex;this.flkty[sliderId].slides.forEach((slide,index)=>{slide.cells.forEach(cell=>{cell.element.querySelectorAll(selectors$D.links).forEach(link=>{link.setAttribute(attributes$p.tabIndex,selectedElementsIndex===index?"0":"-1")})})})}setSliderArrowsPosition(slider2){const arrows=slider2.querySelectorAll(selectors$D.flickityButton),image=slider2.querySelector(selectors$D.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}handleLastSlideOverlayOnTablet(slider2){const sliderId=slider2.getAttribute(attributes$p.sliderId);this.flkty[sliderId].on("select",()=>{if(!(window.innerWidth>=theme.sizes.small&&window.innerWidth{slider2.addEventListener("scroll",event=>{if(!(window.innerWidth{slider2.addEventListener("theme:tab:change",this.resetSliderEvent)}))}onBlockSelect(evt){const slider2=evt.target.closest(selectors$D.slider),flkty=Flickity.data(slider2)||null;if(slider2)if(flkty!==null&&flkty.isActive){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);flkty.select(groupIndex)}else{const sliderStyle=slider2.currentStyle||window.getComputedStyle(slider2),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;slider2.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){if(this.flkty)for(const key in this.flkty)this.flkty.hasOwnProperty(key)&&this.flkty[key].destroy();document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize),this.sliders.length&&this.sliders.forEach(slider2=>{slider2.removeEventListener("theme:tab:change",this.resetSliderEvent)})}}const gridSlider={onLoad(){sections$d[this.id]=[],this.container.querySelectorAll(selectors$D.slider).forEach(el=>{sections$d[this.id].push(new GridSlider(this.container))})},onUnload(){sections$d[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections$d[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}};register("featured-collection",[productGrid,gridSlider]),register("featured-video",videoPlay);const selectors$E={trigger:"[data-collapsible-trigger-mobile]"},classes$y={isExpanded:"is-expanded"};register("footer",[popoutSection,newsletterSection,collapsible,{onBlockSelect(e){const trigger=e.target.querySelector(selectors$E.trigger);trigger&&!trigger.classList.contains(classes$y.isExpanded)&&trigger.dispatchEvent(new Event("click"))},onBlockDeselect(e){const trigger=e.target.querySelector(selectors$E.trigger);trigger&&trigger.classList.contains(classes$y.isExpanded)&&trigger.dispatchEvent(new Event("click"))}}]);const selectors$F={disclosureWrappper:"[data-hover-disclosure]",header:"[data-site-header]",link:"[data-top-link]",headerBackground:"[data-header-background]",navItem:"[data-nav-item]"},classes$z={isVisible:"is-visible",grandparent:"grandparent",headerMenuOpened:"site-header--menu-opened",hasScrolled:"has-scrolled"},attributes$q={disclosureToggle:"data-hover-disclosure-toggle",ariaHasPopup:"aria-haspopup",ariaExpanded:"aria-expanded",ariaControls:"aria-controls"};let sections$e={};class HoverDisclosure{constructor(el){this.disclosure=el,this.header=el.closest(selectors$F.header),this.key=this.disclosure.id,this.trigger=document.querySelector(`[${attributes$q.disclosureToggle}='${this.key}']`),this.link=this.trigger.querySelector(selectors$F.link),this.grandparent=this.trigger.classList.contains(classes$z.grandparent),this.background=document.querySelector(selectors$F.headerBackground),this.trigger.setAttribute(attributes$q.ariaHasPopup,!0),this.trigger.setAttribute(attributes$q.ariaExpanded,!1),this.trigger.setAttribute(attributes$q.ariaControls,this.key),this.dropdown=this.trigger.querySelector(selectors$F.disclosureWrappper),this.connectHoverToggle(),this.handleTablets()}showDisclosure(){this.hasScrolled=document.body.classList.contains(classes$z.hasScrolled),this.headerHeight=this.hasScrolled?window.hasScrolledHeaderHeight:this.header.offsetHeight,this.grandparent?(this.dropdown.style.height="auto",this.dropdownHeight=this.dropdown.offsetHeight):this.dropdownHeight=this.headerHeight,this.background.style.setProperty("--header-background-height",`${this.dropdownHeight}px`),this.trigger.setAttribute(attributes$q.ariaExpanded,!0),this.trigger.classList.add(classes$z.isVisible),this.header.classList.add(classes$z.headerMenuOpened)}hideDisclosure(){this.background.style.removeProperty("--header-background-height"),this.trigger.classList.remove(classes$z.isVisible),this.trigger.setAttribute(attributes$q.ariaExpanded,!1),this.header.classList.remove(classes$z.headerMenuOpened)}handleTablets(){this.trigger.addEventListener("touchstart",e=>{if(!this.trigger.classList.contains(classes$z.isVisible)){e.preventDefault();const activeNavItems=this.header.querySelectorAll(`.${classes$z.isVisible}${selectors$F.navItem}`);if(activeNavItems.length>0){activeNavItems.forEach(item=>{if(item!==this.trigger){item.dispatchEvent(new Event("mouseleave",{bubbles:!0}));const onTransitionEnd=()=>{requestAnimationFrame(()=>{this.showDisclosure()}),item.removeEventListener("transitionend",onTransitionEnd)};item.addEventListener("transitionend",onTransitionEnd)}});return}this.showDisclosure()}})}connectHoverToggle(){this.trigger.addEventListener("mouseenter",()=>this.showDisclosure()),this.link.addEventListener("focus",()=>this.showDisclosure()),this.trigger.addEventListener("mouseleave",()=>this.hideDisclosure()),this.trigger.addEventListener("focusout",event=>{this.trigger.contains(event.relatedTarget)||this.hideDisclosure()}),this.disclosure.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&this.hideDisclosure()})}onBlockSelect(event){this.disclosure.contains(event.target)&&this.showDisclosure(event)}onBlockDeselect(event){this.disclosure.contains(event.target)&&this.hideDisclosure()}}const hoverDisclosure={onLoad(){sections$e[this.id]=[],this.container.querySelectorAll(selectors$F.disclosureWrappper).forEach(el=>{sections$e[this.id].push(new HoverDisclosure(el))})},onBlockSelect(evt){sections$e[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$e[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}},bgset=(image,imageAspectRatio)=>{let bgset2="";return image.indexOf("no-image")!=-1&&image.indexOf("2048x.gif")!=-1&&(imageAspectRatio=1),bgset2+=image.replace("_2048x.","_180x.")+" 180w "+Math.round(180/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_360x.")+" 360w "+Math.round(360/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_540x.")+" 540w "+Math.round(540/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_720x.")+" 720w "+Math.round(720/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_900x.")+" 900w "+Math.round(900/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_1080x.")+" 1080w "+Math.round(1080/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_1296x.")+" 1296w "+Math.round(1296/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_1512x.")+" 1512w "+Math.round(1512/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_1728x.")+" 1728w "+Math.round(1728/imageAspectRatio)+"h,",bgset2+=image.replace("_2048x.","_1950x.")+" 1950w "+Math.round(1950/imageAspectRatio)+"h,",bgset2+=image+" 2048w "+Math.round(2048/imageAspectRatio)+"h",bgset2};function formatPrices(product){const onSale=product.price<=product.compare_at_price_min,soldOut=!product.available,showSoldOut=theme.settings.showSoldBadge,showSale=theme.settings.showSaleBadge,showSavingBadge=theme.settings.showSavingBadge,savingBadgeType=theme.settings.savingBadgeType;let soldBadgeText=!1,saleBadgeText=!1,savingBadgeText=!1,price=product.price,priceCompare=product.compare_at_price,priceDifference=priceCompare-price;return showSavingBadge&&(product.variants.length>1&&product.variants.forEach(variant=>{const variantPriceDifference=variant.compare_at_price-variant.price;variantPriceDifference>priceDifference&&(priceDifference=variantPriceDifference,price=variant.price,priceCompare=variant.compare_at_price)}),priceDifference>0&&(savingBadgeType==="percentage"?price=`${Math.round(((-(price/priceCompare)+1)*100).toFixed(2))}%`:price=themeCurrency.formatMoney(priceDifference,theme.moneyFormat),savingBadgeText=theme.strings.saving_badge.replace("{{ discount }}",price),product.variants.length>1&&(savingBadgeText=theme.strings.saving_up_to_badge.replace("{{ discount }}",price)))),showSoldOut&&soldOut&&(soldBadgeText=theme.strings.sold_out),showSale&&onSale&&!soldOut&&!savingBadgeText&&(saleBadgeText=theme.strings.sale_badge_text),{...product,soldBadgeText,saleBadgeText,savingBadgeText,compare_at_price_max:themeCurrency.formatMoney(product.compare_at_price_max,theme.moneyFormat),compare_at_price_min:themeCurrency.formatMoney(product.compare_at_price_min,theme.moneyFormat),price_max:themeCurrency.formatMoney(product.price_max,theme.moneyFormat),price_min:themeCurrency.formatMoney(product.price_min,theme.moneyFormat),unit_price:themeCurrency.formatMoney(product.unit_price,theme.moneyFormat)}}const selectors$G={body:"body",header:"[data-site-header]",search:"[data-nav-search]",searchOpen:"[data-nav-search-open]",searchClose:"[data-nav-search-close]",searchForm:"[data-nav-search-form]",searchContainer:"[data-nav-search-container]",searchScroller:"[data-nav-search-scroller]",searchResultsContainer:"[data-nav-search-results]",searchInput:"[data-nav-search-input]",popularSearchLink:"[data-popular-search-link]",productTemplate:"[product-grid-item-template]",productsWrapper:"[data-products-wrap]",noresultTemplate:"[noresult-item-template]",resultsPagination:"[data-results-pagination]",navItem:"[data-nav-item]"},classes$A={pushUp:"push-up",cartDrawerOpen:"js-drawer-open-cart",drawerOpen:"js-drawer-open",isSearching:"is-searching",isSearchVisible:"is-search-visible",navSearchIsVisible:"nav-search--is-visible",loading:"loading",isPaginationVisible:"is-pagination-visible",isVisible:"is-visible",noOutline:"no-outline"},attributes$r={ariaExpanded:"aria-expanded"};let sections$f={};class NavSearch{constructor(container){this.container=container,this.searchInput=this.container.querySelector(selectors$G.searchInput),this.searchClose=this.container.querySelector(selectors$G.searchClose),this.searchContainer=this.container.querySelector(selectors$G.searchContainer),this.popularLinks=this.container.querySelectorAll(selectors$G.popularSearchLink),this.scrollableElement=this.container.querySelector(selectors$G.searchScroller),this.searchResultsContainer=this.container.querySelector(selectors$G.searchResultsContainer),this.searchForm=this.container.querySelector(selectors$G.searchForm),this.resultsPagination=this.container.querySelector(selectors$G.resultsPagination),this.productTemplate=document.querySelector(selectors$G.productTemplate).innerHTML,this.productsWrapper=document.querySelector(selectors$G.productsWrapper),this.noresultTemplate=document.querySelector(selectors$G.noresultTemplate).innerHTML,this.searchOpen=document.querySelectorAll(selectors$G.searchOpen),this.bodySelector=document.querySelector(selectors$G.body),this.headerSelector=document.querySelector(selectors$G.header),this.result=null,this.openSearchTimeout=0,this.linkOpened=null,this.a11y=a11y,this.init()}init(){this.initListeners(),this.initSearch()}initSearch(){this.searchInput.addEventListener("input",debounce(event=>{const val=event.target.value;val&&val.length>1?(this.searchContainer.classList.add(classes$A.isSearching,classes$A.pushUp),this.fetchProductSuggestions(val)):this.reset()},300)),this.searchInput.addEventListener("clear",this.reset.bind(this))}initListeners(){return this.container.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&(event.stopImmediatePropagation(),this.close())}),this.searchOpen.forEach(searchButton=>{searchButton.addEventListener("click",event=>{event.preventDefault(),this.open(),this.linkOpened=event.target})}),this.searchClose.addEventListener("click",event=>{event.preventDefault(),this.close()}),this.popularLinks.forEach(popularLink=>{popularLink.addEventListener("click",event=>{event.preventDefault();const searchText=event.target.textContent;this.searchInput.value=searchText,window.location.href=`${theme.routes.search_url}?type=product&q=${searchText}&options[prefix]=last`})}),this.linkOpened}open(){const isNavDrawerOpen=this.bodySelector.classList.contains(classes$A.drawerOpen),isCartDrawerOpen=this.bodySelector.classList.contains(classes$A.cartDrawerOpen);isNavDrawerOpen||isCartDrawerOpen?(typeof window.drawer.close=="function"&&window.drawer.close(),this.openSearchTimeout&&clearTimeout(this.openSearchTimeout),this.openSearchTimeout=setTimeout(this.openSearch.bind(this),400)):this.openSearch()}openSearch(){const activeNavItem=this.headerSelector.querySelector(`.${classes$A.isVisible}${selectors$G.navItem}`);this.headerSelector.classList.add(classes$A.isSearchVisible),this.container.classList.add(classes$A.navSearchIsVisible),this.container.setAttribute(attributes$r.ariaExpanded,!0),document.dispatchEvent(new CustomEvent("theme:search:open",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.scrollableElement})),setTimeout(()=>{activeNavItem&&activeNavItem.dispatchEvent(new Event("mouseleave",{bubbles:!0})),this.a11y.trapFocus({container:this.container,elementToFocus:this.searchInput})},100)}close(){const isSearchVisible=this.headerSelector.classList.contains(classes$A.isSearchVisible),isFocusEnabled=!document.body.classList.contains(classes$A.noOutline);isSearchVisible&&(this.reset(),this.headerSelector.classList.remove(classes$A.isSearchVisible),this.container.classList.remove(classes$A.navSearchIsVisible),this.container.setAttribute(attributes$r.ariaExpanded,!1),document.dispatchEvent(new CustomEvent("theme:search:close",{bubbles:!0})),isFocusEnabled&&(this.a11y.removeTrapFocus({container:this.container}),setTimeout(()=>{this.a11y.trapFocus({container:this.headerSelector,elementToFocus:this.linkOpened})},100)),setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},250))}reset(clearTerms=!0){this.productsWrapper.innerHTML="",this.searchInput.val="",this.a11y.removeTrapFocus(),clearTerms&&(this.searchContainer.classList.remove([classes$A.isSearching,classes$A.pushUp]),this.searchResultsContainer.classList.remove(classes$A.isPaginationVisible))}fetchProductSuggestions(terms){fetch(`/search/suggest.json?q=${encodeURIComponent(terms)}&resources[type]=product&resources[limit]=10&resources[options][unavailable_products]=last`).then(this.handleErrors).then(response=>response.json()).then(response=>(this.result=response.resources.results,this.fetchProducts(this.result.products))).then(response=>{this.productsWrapper.innerHTML="",this.searchResultsContainer.classList.remove(classes$A.isPaginationVisible),response===""?this.injectHTML(this.productsWrapper,this.renderNoResult()):(this.injectHTML(this.productsWrapper,response),this.result.products.length>9&&(this.resultsPagination.getElementsByTagName("a")[0].href=`${theme.routes.search_url}?type=product&q=${terms}&options[prefix]=last`,this.searchResultsContainer.classList.add(classes$A.isPaginationVisible)),this.a11y.removeTrapFocus({container:this.container}),this.a11y.trapFocus({container:this.container,elementToFocus:this.searchInput})),this.searchContainer.classList.remove(classes$A.isSearching)}).catch(e=>{console.error(e)})}injectHTML(target,pageHTML){target.innerHTML+=pageHTML}renderNoResult(){const updateValues={text:theme.strings.no_results};return Sqrl.render(this.noresultTemplate,{item:updateValues})}fetchProducts(products){const promises=[];return products.forEach(product=>{promises.push(fetchProduct(product.handle).then(productJSON=>{const formatted=formatPrices(productJSON);return this.renderProduct(formatted)}))}),Promise.all(promises).then(result=>{let str="";return result.forEach(render=>{str+=render}),str})}renderProduct(product){const stripHtmlRegex=/(<([^>]+)>)/gi,title=product.title.replace(stripHtmlRegex,"");let media=null,image="";if(product.media!==void 0&&(media=product.media[0]),media){let layout=!1;theme.settings.gridImageSize=="contain"&&(layout=media.preview_image.aspect_ratio>theme.settings.gridImageAspectRatio?"landscape":"portrait"),image={thumb:bgset(getSizedImageUrl(media.preview_image.src,"2048x"),media.preview_image.aspect_ratio),aspectRatio:media.preview_image.aspect_ratio,layout}}else image={thumb:theme.assets.no_image,alt:"",aspectRatio:1};const updateValues={...product,title,image};return Sqrl.render(this.productTemplate,{product:updateValues})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const navSearch={onLoad(){sections$f[this.id]=[],document.querySelectorAll(selectors$G.search).forEach(search=>{sections$f[this.id].push(new NavSearch(search))})}},selectors$H={header:"[data-site-header]",announcementBar:"[data-announcement-wrapper]",collectionFilters:"[data-collection-filters]",logo:"[data-logo]",mobileNavDropdownTrigger:"[data-collapsible-trigger]",nav:"[data-nav]",navIcons:"[data-nav-icons]",navItem:"[data-nav-item]",navLinkMobile:"[data-nav-link-mobile]",wrapper:"[data-wrapper]",headerBackground:"[data-header-background]",cartPage:"[data-cart-page]"},classes$B={jsDrawerOpenAll:["js-drawer-open","js-drawer-open-cart","js-quick-view-visible"],headerTransparent:"site-header--transparent",headerLoading:"site-header--loading",headerHovered:"site-header--hovered",headerMenuOpened:"site-header--menu-opened",hasScrolled:"has-scrolled",hideHeader:"hide-header",navCompress:"nav--compress",headerSticky:"header--sticky",isVisible:"is-visible",noOutline:"no-outline"},sections$g={};class Header{constructor(container){this.container=container,this.background=document.querySelector(selectors$H.headerBackground),this.header=container,this.headerSection=container.parentNode,this.headerWrapper=container.querySelector(selectors$H.wrapper),this.logo=container.querySelector(selectors$H.logo),this.nav=container.querySelector(selectors$H.nav),this.navIcons=container.querySelector(selectors$H.navIcons),this.headerStateEvent=event=>this.headerState(event),this.handleTouchstartEvent=event=>this.handleTouchstart(event),this.updateBackgroundHeightEvent=event=>this.updateBackgroundHeight(event),this.hasScrolled=!1,this.hasCollectionFilters=document.querySelector(selectors$H.collectionFilters),initTransparentHeader(),setMainSpacing(),this.controlNav(),this.initMobileNav(),window.addEventListener("load",this.controlNav.bind(this)),document.addEventListener("theme:resize:width",this.controlNav.bind(this)),this.hasCollectionFilters?this.header.classList.remove(classes$B.headerLoading):this.initStickyHeader(),this.handleBackgroundEvents(),document.querySelector(selectors$H.cartPage)||(window.cart=new CartDrawer),window.drawer=new Drawer,document.body.addEventListener("touchstart",this.handleTouchstartEvent)}handleTouchstart(event){const isInHeader=this.header.contains(event.target),activeNavItem=this.header.querySelector(`.${classes$B.isVisible}${selectors$H.navItem}`);!isInHeader&&activeNavItem&&activeNavItem.dispatchEvent(new Event("mouseleave",{bubbles:!0}))}initStickyHeader(){this.position=this.header.dataset.position,this.position==="fixed"?this.headerSection.classList.add(classes$B.headerSticky):this.headerSection.classList.remove(classes$B.headerSticky),this.header.classList.remove(classes$B.headerLoading),this.headerState(),document.addEventListener("theme:scroll",this.headerStateEvent)}headerState(event){const headerHeight=parseInt(this.header.dataset.height||this.header.offsetHeight),announcementBar=document.querySelector(selectors$H.announcementBar),announcementHeight=announcementBar?announcementBar.offsetHeight:0,pageOffset=headerHeight+announcementHeight,currentScrollTop=window.pageYOffset||document.documentElement.scrollTop,scrollUp=event&&event.detail&&event.detail.up;let tempHeight=headerHeight;if(this.position==="fixed"&&(currentScrollTop>pageOffset?(document.body.classList.add(classes$B.hasScrolled),this.hasScrolled=!0,this.header.classList.remove(classes$B.headerTransparent),tempHeight=window.hasScrolledHeaderHeight):(document.body.classList.remove(classes$B.hasScrolled),this.hasScrolled=!1,tempHeight=headerHeight,window.isHeaderTransparent&&this.header.classList.add(classes$B.headerTransparent)),document.documentElement.style.getPropertyValue("--header-height")!==`${tempHeight}px`&&document.documentElement.style.setProperty("--header-height",`${tempHeight}px`),currentScrollTop=window.theme.sizes.large,isFocusEnabled=!document.body.classList.contains(classes$B.noOutline),isNotTabbingOnDesktop=isDesktop&&!isFocusEnabled;if(event){if(event.type==="mouseenter"){let popupsVisible=!1;if(classes$B.jsDrawerOpenAll.forEach(popupClass=>{document.body.classList.contains(popupClass)&&(popupsVisible=!0)}),popupsVisible)return;this.headerHeight=this.hasScrolled?window.hasScrolledHeaderHeight:this.header.offsetHeight,this.header.classList.add(classes$B.headerHovered),this.header.classList.contains(classes$B.headerMenuOpened)||this.background.style.setProperty("--header-background-height",`${this.headerHeight}px`);return}event.type==="focusout"&&!isDesktop||event.type==="theme:search:close"&&!isNotTabbingOnDesktop||requestAnimationFrame(()=>{const focusOutOfHeader=document.activeElement.closest(selectors$H.header)===null;event.type==="focusout"&&!focusOutOfHeader||(this.header.classList.remove(classes$B.headerHovered),this.background.style.setProperty("--header-background-height","0px"),isFocusEnabled||document.activeElement.blur())})}}controlNav(){this.nav.classList.remove(classes$B.navCompress);const gap=20,isNavCentered=this.header.dataset.navAlignment==="center",isNavLeft=this.header.dataset.navAlignment==="left",headerWrapperStyles=this.headerWrapper.currentStyle||window.getComputedStyle(this.headerWrapper),headerWidth=this.headerWrapper.clientWidth-parseFloat(headerWrapperStyles.paddingLeft)-parseFloat(headerWrapperStyles.paddingRight),logoWidth=this.logo?this.logo.offsetWidth:0,navIconsWidth=this.navIcons?this.navIcons.offsetWidth:0;let maxNavWidth=headerWidth-logoWidth-navIconsWidth-gap,navItemsWidth=this.getNavItemsWidth();isNavCentered&&(maxNavWidth=headerWidth-(Math.max(logoWidth,navIconsWidth)+gap)*2),isNavLeft&&(maxNavWidth=(headerWidth-(logoWidth+gap*2))/2),navItemsWidth>maxNavWidth?this.nav.classList.add(classes$B.navCompress):this.nav.classList.remove(classes$B.navCompress)}getNavItemsWidth(){let navItemsWidth=0;const navItems=this.nav.querySelectorAll(selectors$H.navItem);return navItems.length&&navItems.forEach(item=>{navItemsWidth+=Math.ceil(item.offsetWidth)}),navItemsWidth}initMobileNav(){if(theme.settings.mobileMenuBehaviour==="link")return;const navMobileLinks=this.headerSection.querySelectorAll(selectors$H.navLinkMobile);navMobileLinks.length&&navMobileLinks.forEach(link=>{link.addEventListener("click",e=>{const hasDropdown=link.parentNode.querySelectorAll(selectors$H.mobileNavDropdownTrigger).length,dropdownTrigger=link.nextElementSibling;hasDropdown&&(e.preventDefault(),dropdownTrigger.dispatchEvent(new Event("click"),{bubbles:!0}))})})}onUnload(){document.body.classList.remove(...classes$B.jsDrawerOpenAll),document.removeEventListener("theme:scroll",this.headerStateEvent),document.removeEventListener("theme:resize:width",this.controlNav),document.removeEventListener("theme:cart:close",this.updateBackgroundHeightEvent),document.removeEventListener("theme:search:close",this.updateBackgroundHeightEvent),document.body.removeEventListener("touchstart",this.handleTouchstartEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),typeof window.cart.unload=="function"&&window.cart.unload(),typeof window.drawer.unload=="function"&&window.drawer.unload()}}register("header",[{onLoad(){sections$g[this.id]=new Header(this.container)},onUnload(){sections$g[this.id].onUnload()}},hoverDisclosure,navSearch]);const selectors$I={slider:"[data-slider]"};let sections$h={};class IconsRow{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$I.slider)}onBlockSelect(evt){const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}register("icons-row",{onLoad(){sections$h[this.id]=new IconsRow(this)},onBlockSelect(e){sections$h[this.id].onBlockSelect(e)}});const selectors$J={item:"[data-accordion-item]",button:"[data-accordion-button]"},classes$C={isExpanded:"is-expanded"},sections$i={};class ImageAccordions{constructor(section){this.container=section.container,this.imageAccordionsItems=this.container.querySelectorAll(selectors$J.item),this.buttons=this.container.querySelectorAll(selectors$J.button),this.accordionExpandEvent=item=>this.accordionExpand(item),this.accordionFocusEvent=item=>this.accordionFocus(item),this.init()}init(){this.imageAccordionsItems.forEach(item=>{item.addEventListener("mouseenter",this.accordionExpandEvent.bind(this,item))}),this.buttons.forEach(button=>{button.addEventListener("focusin",this.accordionFocusEvent.bind(this,button))})}accordionExpand(item){item.classList.contains(classes$C.isExpanded)||(this.imageAccordionsItems.forEach(item2=>{item2.classList.remove(classes$C.isExpanded)}),item.classList.add(classes$C.isExpanded))}accordionFocus(button){button.closest(selectors$J.item).dispatchEvent(new Event("mouseenter"))}onBlockSelect(evt){const element=evt.target;element&&element.dispatchEvent(new Event("mouseenter"))}}register("image-accordions",{onLoad(){sections$i[this.id]=new ImageAccordions(this)},onBlockSelect(evt){sections$i[this.id].onBlockSelect(evt)}}),register("image-with-text",videoPlay),register("list-collections",gridSlider);const sections$j={},selectors$K={slider:"[data-slider-gallery]",sliderNav:"[data-slider-info]",item:"[data-slide-item]"};class Locations{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$K.slider),this.sliderNav=this.container.querySelector(selectors$K.sliderNav),this.initSlider()}initSlider(){const slidesCount=this.container.querySelectorAll(selectors$K.item).length;let flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null;slidesCount<=1||(flkty=new Flickity(this.slider,{fade:!0,wrapAround:!0,adaptiveHeight:!0,prevNextButtons:!1,pageDots:!1}),flickitySmoothScrolling(this.slider),flktyNav=new Flickity(this.sliderNav,{fade:!0,wrapAround:!0,imagesLoaded:!0,lazyLoad:!0,asNavFor:this.slider,prevNextButtons:!0,pageDots:!1}),flktyNav.on("change",()=>{flkty.selectCell(flktyNav.selectedIndex)}),flkty.on("change",()=>{flktyNav.selectCell(flkty.selectedIndex)}))}onBlockSelect(evt){const flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null,index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));flkty!==null&&flkty.select(index),flktyNav!==null&&flktyNav.select(index)}}register("locations",{onLoad(){sections$j[this.id]=new Locations(this)},onBlockSelect(e){sections$j[this.id].onBlockSelect(e)}});const sections$k={},selectors$L={slider:"[data-slider]",sliderItem:"[data-slide-item]",pointer:"[data-pointer]",productGridItemImage:"[data-product-media-container]",quickViewItemHolder:"[data-quick-view-item-holder]",flickityButton:".flickity-button",links:"a, button"},attributes$s={pointer:"data-pointer",hotspot:"data-hotspot",tabIndex:"tabindex"},classes$D={pointerSelected:"pointer--selected",isSelected:"is-selected",isActive:"is-active",popupOpen:"pswp--open"};class Look{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$L.slider),this.slides=this.container.querySelectorAll(selectors$L.sliderItem),this.pointers=this.container.querySelectorAll(selectors$L.pointer),this.flkty=null,this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.pointersInit=event=>this.dotPointers(event),this.pointersOver=()=>this.dotPointerIn(),this.pointersOut=()=>this.dotPointerOut(),this.debouncedBlockSelectCallback=debounce(event=>this.debouncedBlockSelect(event),500),this.quickViewPopup=new QuickViewPopup(this.container),this.listen()}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize)),this.pointers.length>0&&this.pointers.forEach(pointer=>{pointer.addEventListener("click",this.pointersInit),pointer.addEventListener("mouseover",this.pointersOver),pointer.addEventListener("mouseleave",this.pointersOut)})}checkSlidesSize(){const isDesktop=window.innerWidth>=theme.sizes.small;if(isDesktop){this.slides.length>2?this.initSlider():(this.destroySlider(),this.slidesTabIndex());return}if(!isDesktop&&this.slides.length>1){this.initSlider();return}this.destroySlider()}initSlider(){if(this.flkty===null){this.flkty=new Flickity(this.slider,{prevNextButtons:!0,wrapAround:!0,adaptiveHeight:!1,cellAlign:"left",groupCells:!1,contain:!0,on:{ready:()=>{this.slidesTabIndex(),this.setSliderArrowsPosition(),this.dotPointers()},change:()=>{this.slidesTabIndex(),this.dotPointers()}}});return}this.setSliderArrowsPosition()}setSliderArrowsPosition(){if(!(window.innerWidth>=theme.sizes.small))return;const arrows=this.slider.querySelectorAll(selectors$L.flickityButton),image=this.slider.querySelector(selectors$L.productGridItemImage);arrows.length&&image&&arrows.forEach(arrow=>{arrow.style.top=`${image.offsetHeight/2}px`})}slidesTabIndex(){if(this.slides.length<3){this.slider.querySelectorAll(selectors$L.links).forEach(link=>{link.setAttribute(attributes$s.tabIndex,"0")});return}const slider2=Flickity.data(this.slider);slider2.cells.forEach(slide=>{slide.element.querySelectorAll(selectors$L.links).forEach(link=>{link.setAttribute(attributes$s.tabIndex,"-1")})}),slider2.cells.forEach(slide=>{slide.element.classList.contains(classes$D.isSelected)&&(slide.element.querySelectorAll(selectors$L.links).forEach(link=>{link.setAttribute(attributes$s.tabIndex,"0")}),(slide.element.nextSibling?slide.element.nextSibling:slide.element.parentNode.firstChild).querySelectorAll(selectors$L.links).forEach(link=>{link.setAttribute(attributes$s.tabIndex,"0")}))})}destroySlider(){typeof this.flkty=="object"&&this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}dotPointers(event){if(this.pointers.length===0)return;if(this.pointers.forEach(button=>{button.classList.remove(classes$D.pointerSelected)}),event){const dotIndex=event.target.getAttribute(attributes$s.pointer);this.flkty?.select(dotIndex);return}const slideIndex=this.flkty==null?0:this.flkty.selectedIndex;slideIndex>=0&&this.pointers[slideIndex].classList.add(classes$D.pointerSelected)}dotPointerIn(){this.pointers.forEach(pointer=>{pointer.style.setProperty("--look-animation","none")})}dotPointerOut(){this.pointers.forEach(pointer=>{pointer.style.removeProperty("--look-animation")})}triggerClick(target){requestAnimationFrame(()=>target.dispatchEvent(new Event("click")))}destroyQuickViewPopup(){const pswpElement=this.quickViewPopup?.loadPhotoswipe?.pswpElement;pswpElement&&pswpElement.classList.contains(classes$D.popupOpen)&&this.quickViewPopup.loadPhotoswipe.popup.close()}onBlockSelect(event){this.debouncedBlockSelectCallback(event)}debouncedBlockSelect(event){const pswpElement=this.quickViewPopup?.loadPhotoswipe?.pswpElement;if(!pswpElement){setTimeout(()=>this.triggerClick(event.target),400);return}setTimeout(()=>{if(pswpElement.classList.contains(classes$D.popupOpen)){const holder=this.quickViewPopup.loadPhotoswipe.pswpElement.querySelector(`[${attributes$s.hotspot}="${event.target.getAttribute(attributes$s.hotspot)}"]`),quickViewItemHolders=this.quickViewPopup.loadPhotoswipe.pswpElement.querySelectorAll(selectors$L.quickViewItemHolder);holder.classList.add(classes$D.isActive),quickViewItemHolders.forEach(element=>{element!==holder&&element.classList.remove(classes$D.isActive)})}else this.triggerClick(event.target)})}onUnload(){this.destroyQuickViewPopup(),document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize)}onDeselect(){this.destroyQuickViewPopup()}}register("look",{onLoad(){sections$k[this.id]=new Look(this)},onUnload(){sections$k[this.id].onUnload()},onBlockSelect(event){sections$k[this.id].onBlockSelect(event)},onDeselect(){sections$k[this.id].onDeselect()}});const selectors$M={grid:"[data-grid]"};register("mosaic",{onBlockSelect(e){const grid=e.target.closest(selectors$M.grid),wrapperStyle=grid.currentStyle||window.getComputedStyle(grid),wrapperPadding=parseInt(wrapperStyle.paddingLeft),blockPositionLeft=e.target.offsetLeft-wrapperPadding;grid.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}),register("newsletter",newsletterSection),register("overlapping-images",videoPlay);const selectors$N={toggleAdmin:"[data-toggle-admin]",toggleNewsletter:"[data-toggle-newsletter]",adminForm:"[data-form-admin]",newsletterForm:"[data-form-newsletter]"};let sections$l={};class Password{constructor(section){this.container=section.container,this.toggleAdmin=this.container.querySelector(selectors$N.toggleAdmin),this.toggleNewsletter=this.container.querySelector(selectors$N.toggleNewsletter),this.adminForm=this.container.querySelector(selectors$N.adminForm),this.newsletterForm=this.container.querySelector(selectors$N.newsletterForm),this.adminErrors=this.adminForm.querySelector(".errors"),this.newsletterErrors=this.newsletterForm.querySelector(".errors"),this.init()}init(){this.toggleAdmin.addEventListener("click",e=>{e.preventDefault(),this.showPasswordForm()}),this.toggleNewsletter.addEventListener("click",e=>{e.preventDefault(),this.hidePasswordForm()}),window.location.hash=="#login"||this.adminErrors?this.showPasswordForm():this.hidePasswordForm()}showPasswordForm(){showElement(this.adminForm),hideElement(this.newsletterForm),window.location.hash="#login"}hidePasswordForm(){showElement(this.newsletterForm),hideElement(this.adminForm),window.location.hash=""}}register("password-template",{onLoad(){sections$l[this.id]=new Password(this)}});const selectors$O={largePromo:"[data-large-promo]",largePromoInner:"[data-large-promo-inner]",tracking:"[data-tracking-consent]",trackingInner:"[data-tracking-consent-inner]",trackingAccept:"[data-confirm-cookies]",popupBar:"[data-popup-bar]",popupBarHolder:"[data-popup-bar-holder]",popupBarToggle:"[data-popup-bar-toggle]",popupBody:"[data-popup-body]",popupClose:"[data-popup-close]",popupUnderlay:"[data-popup-underlay]",newsletterForm:"[data-newsletter-form]"},attributes$t={cookieName:"data-cookie-name",targetReferrer:"data-target-referrer",preventScrollLock:"data-prevent-scroll-lock"},classes$E={success:"has-success",error:"has-error",selected:"selected",hasBlockSelected:"has-block-selected",expanded:"popup--expanded",visible:"popup--visible",mobile:"mobile",desktop:"desktop",popupBar:"popup--bar",barIsVisible:"popup-bar-is-visible"};let sections$m={},scrollLockTimer$1=0,activePopups=0,popups=[];class DelayShow{constructor(popupContainer,popup){if(this.popupContainer=popupContainer,this.popup=popup,this.popupBody=popup.querySelector(selectors$O.popupBody),this.delay=popupContainer.dataset.popupDelay,this.isSubmitted=window.location.href.indexOf("accepts_marketing")!==-1||window.location.href.indexOf("customer_posted=true")!==-1,this.a11y=a11y,this.showPopupOnScrollEvent=()=>this.showPopupOnScroll(),(this.delay==="always"||this.isSubmitted)&&this.always(),this.delay&&this.delay.includes("delayed")&&!this.isSubmitted){const seconds=this.delay.includes("_")?parseInt(this.delay.split("_")[1]):10;this.delayed(seconds)}this.delay==="bottom"&&!this.isSubmitted&&this.bottom(),this.delay==="idle"&&!this.isSubmitted&&this.idle()}always(){this.showPopup()}delayed(seconds=10){setTimeout(()=>{this.showPopup()},seconds*1e3)}bottom(){document.addEventListener("theme:scroll",this.showPopupOnScrollEvent)}idle(){if(!(this.checkPopupTarget()===!0))return;let timer=0,idleTime=6e4;const documentEvents=["mousemove","mousedown","click","touchmove","touchstart","touchend","keydown","keypress"],windowEvents=["load","resize","scroll"],startTimer=()=>{timer=setTimeout(()=>{timer=0,this.showPopup()},idleTime),documentEvents.forEach(eventType=>{document.addEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.addEventListener(eventType,resetTimer)})},resetTimer=()=>{timer&&clearTimeout(timer),documentEvents.forEach(eventType=>{document.removeEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.removeEventListener(eventType,resetTimer)}),startTimer()};startTimer()}showPopup(){const popupElement={id:this.popup.id,body:this.popupBody};if(popups.push(popupElement),this.checkPopupTarget()===!0){if(activePopups+=1,this.popup.classList.add(classes$E.visible),this.popup.classList.contains(classes$E.popupBar)&&document.body.classList.add(classes$E.barIsVisible),this.a11y.trapFocus({container:this.popupBody}),this.popup.hasAttribute(attributes$t.preventScrollLock))return!1;this.scrollLock()}}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$E.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$E.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth=document.body.clientHeight&&(this.showPopup(),document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent))}onUnload(){document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent)}}class TargetReferrer{constructor(el){if(this.popupContainer=el,this.locationPath=location.href,!this.popupContainer.hasAttribute(attributes$t.targetReferrer))return!1;this.locationPath.indexOf(this.popupContainer.getAttribute(attributes$t.targetReferrer))===-1&&!window.Shopify.designMode&&this.popupContainer.parentNode.removeChild(this.popupContainer)}}class LargePopup{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$O.largePromoInner),this.popupBody=this.popup.querySelector(selectors$O.popupBody),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$O.popupClose),this.underlay=this.popup.querySelector(selectors$O.popupUnderlay),this.form=this.popup.querySelector(selectors$O.newsletterForm),this.cookie=new PopupCookie(this.popupContainer.dataset.cookieName,"user_has_closed"),this.isTargeted=new TargetReferrer(this.popupContainer),this.a11y=a11y,this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?this.showPopup():new DelayShow(this.popupContainer,this.popup),this.form&&setTimeout(()=>{this.form.classList.contains(classes$E.success)&&(this.showPopupIfNoCookie(),activePopups-=1)}),this.initClosers())}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$E.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$E.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth{event.code===theme.keyboardKeys.ESCAPE&&this.closePopup(event)})}closePopup(event){event.preventDefault(),this.hidePopup(),this.cookie.write()}scrollLock(){this.resetScrollUnlock(),this.a11y.trapFocus({container:this.popupBody}),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popupBody}))}scrollUnlock(){this.resetScrollUnlock(),scrollLockTimer$1=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)}resetScrollUnlock(){scrollLockTimer$1&&clearTimeout(scrollLockTimer$1)}showPopup(){const isTargetValid=this.checkPopupTarget()===!0,popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),isTargetValid&&(activePopups+=1,this.popup.classList.add(classes$E.visible),this.scrollLock())}hidePopup(){this.popup.classList.remove(classes$E.visible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(activePopups-=1,popups.splice(popupIndex,1),activePopups==1&&document.body.classList.contains(classes$E.barIsVisible))this.scrollUnlock();else if(activePopups<1)this.scrollUnlock(),this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&!this.popup.classList.contains(classes$E.visible)&&(this.popup.classList.add(classes$E.selected),this.popupContainer.classList.add(classes$E.hasBlockSelected),this.showPopup())}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$E.selected),this.popupContainer.classList.remove(classes$E.hasBlockSelected),this.hidePopup())}onUnload(){this.scrollUnlock()}onDeselect(){this.popup.classList.remove(classes$E.selected),this.popupContainer.classList.remove(classes$E.hasBlockSelected),this.hidePopup()}}class Tracking{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$O.trackingInner),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$O.popupClose),this.acceptButton=this.popup.querySelector(selectors$O.trackingAccept),this.enable=this.popupContainer.dataset.enable==="true",this.a11y=a11y,window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{if(error)throw error;const userCanBeTracked=window.Shopify.customerPrivacy.userCanBeTracked(),userTrackingConsent=window.Shopify.customerPrivacy.getTrackingConsent();this.enableTracking=!userCanBeTracked&&userTrackingConsent==="no_interaction"&&this.enable,window.Shopify.designMode&&(this.enableTracking=!0),this.init()})}init(){this.enableTracking&&this.showPopup(),this.clickEvents()}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!1,()=>this.hidePopup())}),this.acceptButton.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!0,()=>this.hidePopup())}),document.addEventListener("trackingConsentAccepted",()=>{console.log("trackingConsentAccepted event fired")})}showPopup(){const popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),this.popup.classList.add(classes$E.visible),this.a11y.trapFocus({container:this.popup})}hidePopup(){this.popup.classList.remove(classes$E.visible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(popups.splice(popupIndex,1),activePopups<1)this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&this.enableTracking&&!this.popup.classList.contains(classes$E.visible)&&(this.showPopup(),this.popup.classList.add(classes$E.selected),this.popup.parentNode.classList.add(classes$E.hasBlockSelected))}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$E.selected),this.popupContainer.classList.remove(classes$E.hasBlockSelected),this.hidePopup())}onDeselect(){this.popup.classList.remove(classes$E.selected),this.popupContainer.classList.remove(classes$E.hasBlockSelected),this.hidePopup()}}class PopupBar{constructor(el){this.popupContainer=el,this.popup=this.popupContainer.querySelector(selectors$O.popupBarHolder),this.popupBody=this.popup.querySelector(selectors$O.popupBody),this.popupId=this.popup.id,this.close=this.popup.querySelector(selectors$O.popupClose),this.underlay=this.popup.querySelector(selectors$O.popupUnderlay),this.toggle=this.popup.querySelector(selectors$O.popupBarToggle),this.cookie=new PopupCookie(this.popupContainer.dataset.cookieName,"user_has_closed"),this.form=this.popup.querySelector(selectors$O.newsletterForm),this.isTargeted=new TargetReferrer(this.popupContainer),this.a11y=a11y,this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?this.showPopup():new DelayShow(this.popupContainer,this.popup),this.initPopupToggleButton(),this.initClosers(),this.form&&setTimeout(()=>{this.form.classList.contains(classes$E.success)&&this.showPopupIfNoCookie(),this.form.classList.contains(classes$E.error)&&this.toggle.dispatchEvent(new Event("click"))}))}checkPopupTarget(){const targetMobile=this.popup.parentNode.classList.contains(classes$E.mobile),targetDesktop=this.popup.parentNode.classList.contains(classes$E.desktop);return!(targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth{event.preventDefault(),this.popup.classList.toggle(classes$E.expanded),this.popup.classList.contains(classes$E.expanded)?this.scrollLock():this.scrollUnlock()})}showPopup(){const popupElement={id:this.popupId,body:this.popup};popups.push(popupElement),this.a11y.trapFocus({container:this.popupBody}),this.checkPopupTarget()===!0&&(activePopups+=1,document.body.classList.add(classes$E.barIsVisible),this.popup.classList.add(classes$E.visible))}hidePopup(){this.popup.classList.remove(classes$E.visible),document.body.classList.remove(classes$E.barIsVisible);const popupIndex=popups.findIndex(x=>x.id===this.popupId);if(popups.splice(popupIndex,1),activePopups>=1&&(activePopups-=1),activePopups<1)this.scrollUnlock(),this.a11y.removeTrapFocus();else if(popups.length>0){const nextPopup=popups[popups.length-1].body;this.a11y.trapFocus({container:nextPopup})}}initClosers(){this.close.addEventListener("click",this.closePopup.bind(this)),this.underlay.addEventListener("click",()=>this.toggle.dispatchEvent(new Event("click"))),this.popupContainer.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.ESCAPE&&(this.popup.classList.remove(classes$E.expanded),this.scrollUnlock())})}closePopup(event){event.preventDefault(),this.cookie.write(),this.hidePopup()}scrollLock(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popupBody}))}scrollUnlock(){this.resetScrollUnlock(),scrollLockTimer$1=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)}resetScrollUnlock(){scrollLockTimer$1&&clearTimeout(scrollLockTimer$1)}onBlockSelect(evt){this.popupContainer.contains(evt.target)&&!this.popup.classList.contains(classes$E.visible)&&(this.showPopup(),this.popup.classList.add(classes$E.expanded),this.popup.classList.add(classes$E.selected),this.popup.parentNode.classList.add(classes$E.hasBlockSelected),this.resetScrollUnlock(),this.scrollLock())}onBlockDeselect(evt){this.popupContainer.contains(evt.target)&&(this.popup.classList.remove(classes$E.expanded),this.popup.classList.remove(classes$E.selected),this.popup.parentNode.classList.remove(classes$E.hasBlockSelected),this.hidePopup())}onUnload(){this.scrollUnlock()}onDeselect(){this.popup.classList.remove(classes$E.expanded),this.popup.classList.remove(classes$E.selected),this.popup.parentNode.classList.remove(classes$E.hasBlockSelected),this.hidePopup()}}register("popups",[{onLoad(){sections$m[this.id]=[],window.Shopify.designMode&&(activePopups=0);const popupsLarge=this.container.querySelectorAll(selectors$O.largePromo);popupsLarge.length&&popupsLarge.forEach(el=>{sections$m[this.id].push(new LargePopup(el))});const popupBars=this.container.querySelectorAll(selectors$O.popupBar);popupBars.length&&popupBars.forEach(el=>{sections$m[this.id].push(new PopupBar(el))});const cookiesPopups=this.container.querySelectorAll(selectors$O.tracking);cookiesPopups.length&&cookiesPopups.forEach(el=>{sections$m[this.id].push(new Tracking(el))})},onDeselect(){sections$m[this.id].forEach(el=>{typeof el.onDeselect=="function"&&el.onDeselect()})},onBlockSelect(evt){sections$m[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$m[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})},onUnload(evt){sections$m[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload(evt)})}},newsletterSection]);const selectors$P={pressItems:"[data-press-items]",logoSlider:"[data-logo-slider]",logoSlide:"[data-logo-slide]",links:"a, button"},attributes$u={logoSlide:"data-logo-index",tabIndex:"tabindex"};let sections$n={};class Press{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$P.pressItems),this.sliderNav=this.container.querySelector(selectors$P.logoSlider),this.sliderResizeEvent=()=>this.checkSlides(),this.initSlider(),this.checkSlides(),window.addEventListener("load",this.resizeSlider.bind(this)),document.addEventListener("theme:resize:width",this.sliderResizeEvent)}checkSlides(){const containerWidth=this.container.offsetWidth,slides=this.container.querySelectorAll(selectors$P.logoSlide),sliderNav=Flickity.data(this.sliderNav)||null;sliderNav!==null&&(sliderNav.options.draggable=!1,sliderNav.options.wrapAround=!1,sliderNav.options.contain=!0,this.getSlidesWidth()>containerWidth&&slides.length>2&&(sliderNav.options.draggable=!0,sliderNav.options.wrapAround=!0,sliderNav.options.contain=!1),sliderNav.resize(),sliderNav.updateDraggable())}getSlidesWidth(){const slides=this.container.querySelectorAll(selectors$P.logoSlide);let slidesTotalWidth=0;return slides.length&&slides.forEach(slide=>{slidesTotalWidth+=slide.offsetWidth}),slidesTotalWidth}initSlider(){let flkty=Flickity.data(this.slider)||null,flktyNav=Flickity.data(this.sliderNav)||null;flkty=new Flickity(this.slider,{fade:!0,wrapAround:!0,adaptiveHeight:!0,prevNextButtons:!1,pageDots:!1}),flktyNav=new Flickity(this.sliderNav,{draggable:!1,wrapAround:!1,contain:!0,imagesLoaded:!0,lazyLoad:!0,asNavFor:this.slider,prevNextButtons:!1,adaptiveHeight:!1,pageDots:!1,on:{ready:()=>{this.container.querySelectorAll(selectors$P.logoSlide).forEach(slide=>{slide.addEventListener("keyup",event=>{if(event.code===theme.keyboardKeys.ENTER||event.code===theme.keyboardKeys.SPACE){const selectedIndex=Number(slide.getAttribute(attributes$u.logoSlide));flkty.selectCell(selectedIndex)}})})}}}),flickitySmoothScrolling(this.slider),flickitySmoothScrolling(this.sliderNav),flktyNav.on("change",index=>{flkty.selectCell(index)}),flkty.on("change",index=>{flktyNav.selectCell(index),flkty.cells.forEach((slide,i)=>{slide.element.querySelectorAll(selectors$P.links).forEach(link=>{link.setAttribute(attributes$u.tabIndex,i===index?"0":"-1")})})})}resizeSlider(){const hasSlider=Flickity.data(this.slider);hasSlider&&hasSlider.resize()}onBlockSelect(evt){const slider2=Flickity.data(this.slider)||null,sliderNav=Flickity.data(this.sliderNav)||null,index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));slider2!==null&&slider2.select(index),sliderNav!==null&&sliderNav.select(index)}onUnload(){document.removeEventListener("theme:resize:width",this.sliderResizeEvent)}}register("press",{onLoad(){sections$n[this.id]=new Press(this)},onUnload(e){sections$n[this.id].onUnload(e)},onBlockSelect(e){sections$n[this.id].onBlockSelect(e)}});const selectors$Q={slideshow:"[data-product-single-media-slider]",productInfo:"[data-product-info]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},classes$F={sticky:"is-sticky"},attributes$v={stickyEnabled:"data-sticky-enabled"};window.theme.variables={productPageSticky:!1};const sections$o={};class ProductSticky{constructor(section){this.container=section.container,this.stickyEnabled=this.container.getAttribute(attributes$v.stickyEnabled)==="true",this.productInfo=this.container.querySelector(selectors$Q.productInfo),this.stickyScrollTop=0,this.scrollLastPosition=0,this.stickyDefaultTop=0,this.currentPoint=0,this.defaultTopBottomSpacings=30,this.scrollTop=window.scrollY,this.scrollDirectionDown=!0,this.requestAnimationSticky=null,this.stickyFormLoad=!0,this.stickyFormLastHeight=null,this.onChangeCounter=0,this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),this.init()}init(){this.stickyEnabled&&(this.stickyScrollCheck(),document.addEventListener("theme:resize",this.resizeEvent)),this.initSticky()}initSticky(){theme.variables.productPageSticky&&(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()),this.productInfo.addEventListener("theme:form:sticky",e=>{this.removeAnimationFrame(),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))}),document.addEventListener("theme:scroll",this.scrollEvent))}scrollEvents(e){e.detail!==null&&(this.scrollTop=e.detail.position,this.scrollDirectionDown=e.detail.down),this.requestAnimationSticky||(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()))}resizeEvents(){this.stickyScrollCheck(),document.removeEventListener("theme:scroll",this.scrollEvent),this.initSticky()}stickyScrollCheck(){const isDesktop=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.large,targetProductInfo=this.container.querySelector(selectors$Q.productInfo);if(targetProductInfo)if(isDesktop){const productInfo=this.container.querySelector(selectors$Q.productInfo),slideshow=this.container.querySelector(selectors$Q.slideshow);if(!productInfo||!slideshow)return;const productCopyHeight=productInfo.offsetHeight,productImagesHeight=slideshow.offsetHeight;productCopyHeightthis.calculateStickyPosition(e))):this.requestAnimationSticky&&this.removeAnimationFrame(),this.stickyFormLastHeight=productInfoHeight}removeAnimationFrame(){this.requestAnimationSticky&&(cancelAnimationFrame(this.requestAnimationSticky),this.requestAnimationSticky=null,this.onChangeCounter=0)}onUnload(){this.stickyEnabled&&document.removeEventListener("theme:resize",this.resizeEvent),theme.variables.productPageSticky&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productStickySection={onLoad(){sections$o[this.id]=new ProductSticky(this)},onUnload(){sections$o[this.id].onUnload()}},selectors$R={tooltip:"[data-tooltip]",tooltipContainer:"[data-tooltip-container]"},classes$G={root:"tooltip-default",visible:"is-visible",hiding:"is-hiding"},attributes$w={tooltip:"data-tooltip",tooltipContainer:"data-tooltip-container",tooltipStopMouseEnter:"data-tooltip-stop-mouseenter"},sections$p={};class Tooltip{constructor(el){this.tooltip=el,this.tooltip.hasAttribute(attributes$w.tooltip)&&(this.rootClass=classes$G.root,this.label=this.tooltip.getAttribute(attributes$w.tooltip),this.transitionSpeed=200,this.hideTransitionTimeout=0,this.addPinEvent=()=>this.addPin(),this.addPinMouseEvent=()=>this.addPin(!0),this.removePinEvent=event=>throttle(this.removePin(event),50),this.removePinMouseEvent=event=>this.removePin(event,!0,!0),this.init())}init(){if(!document.querySelector(selectors$R.tooltipContainer)){const tooltipTemplate=`
`,tooltipElement=document.createElement("div");tooltipElement.className=this.rootClass,tooltipElement.setAttribute(attributes$w.tooltipContainer,""),tooltipElement.innerHTML=tooltipTemplate,document.body.appendChild(tooltipElement)}this.tooltip.addEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.addEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.addEventListener("theme:tooltip:init",this.addPinEvent),document.addEventListener("theme:tooltip:close",this.removePinEvent)}addPin(stopMouseEnter=!1){const tooltipTarget=document.querySelector(selectors$R.tooltipContainer);if(tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(attributes$w.tooltipStopMouseEnter)||!stopMouseEnter)){const tooltipTargetInner=tooltipTarget.querySelector(`.${this.rootClass}__inner`),tooltipTargetText=tooltipTarget.querySelector(`.${this.rootClass}__text`);tooltipTargetText.textContent=this.label;const tooltipTargetWidth=tooltipTargetInner.offsetWidth,tooltipRect=this.tooltip.getBoundingClientRect(),tooltipTop=tooltipRect.top,tooltipWidth=tooltipRect.width,tooltipHeight=tooltipRect.height,tooltipTargetPositionTop=tooltipTop+tooltipHeight+window.scrollY;let tooltipTargetPositionLeft=tooltipRect.left-tooltipTargetWidth/2+tooltipWidth/2;const tooltipTargetWindowDifference=tooltipTargetPositionLeft+tooltipTargetWidth-window.innerWidth;tooltipTargetWindowDifference>0&&(tooltipTargetPositionLeft-=tooltipTargetWindowDifference),tooltipTargetPositionLeft<0&&(tooltipTargetPositionLeft=0),tooltipTarget.style.transform=`translate(${tooltipTargetPositionLeft}px, ${tooltipTargetPositionTop}px)`,tooltipTarget.classList.remove(classes$G.hiding),tooltipTarget.classList.add(classes$G.visible),document.addEventListener("theme:scroll",this.removePinEvent)}}removePin(event,stopMouseEnter=!1,hideTransition=!1){const tooltipTarget=document.querySelector(selectors$R.tooltipContainer),tooltipVisible=tooltipTarget.classList.contains(classes$G.visible);tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(attributes$w.tooltipStopMouseEnter)||!stopMouseEnter)&&(tooltipVisible&&(hideTransition||event.detail.hideTransition)&&(tooltipTarget.classList.add(classes$G.hiding),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{tooltipTarget.classList.remove(classes$G.hiding)},this.transitionSpeed)),tooltipTarget.classList.remove(classes$G.visible),document.removeEventListener("theme:scroll",this.removePinEvent))}unload(){this.tooltip.removeEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.removeEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.removeEventListener("theme:tooltip:init",this.addPinEvent),document.removeEventListener("theme:tooltip:close",this.removePinEvent),document.removeEventListener("theme:scroll",this.removePinEvent)}}const tooltip={onLoad(){sections$p[this.id]=[],this.container.querySelectorAll(selectors$R.tooltip).forEach(tooltip2=>{sections$p[this.id].push(new Tooltip(tooltip2))})},onUnload(){sections$p[this.id].forEach(tooltip2=>{typeof tooltip2.unload=="function"&&tooltip2.unload()})}},selectors$S={mediaContainer:"[data-product-single-media-group]",productMediaSlider:"[data-product-single-media-slider]",zoomWrapper:"[data-zoom-wrapper]"},classes$H={popupClass:"pswp-zoom-gallery",popupClassNoThumbs:"pswp-zoom-gallery--single",isMoving:"is-moving"},attributes$x={dataImageWidth:"data-image-width",dataImageHeight:"data-image-height"};class Zoom{constructor(container){this.container=container,this.mediaContainer=this.container.querySelector(selectors$S.mediaContainer),this.slider=this.container.querySelector(selectors$S.productMediaSlider),this.zoomWrappers=this.container.querySelectorAll(selectors$S.zoomWrapper),this.zoomEnable=this.mediaContainer.dataset.gallery==="true",this.a11y=a11y,this.zoomEnable&&this.init()}init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),this.slider&&this.slider.classList.contains(classes$H.isMoving)||(this.a11y.state.trigger=element,this.createZoom(i))})})}createZoom(indexImage){const instance=this;let items=[],counter=0;this.zoomWrappers.forEach(elementImage=>{const imgSrc=elementImage.getAttribute("href"),imgWidth=parseInt(elementImage.getAttribute(attributes$x.dataImageWidth)),imgHeight=parseInt(elementImage.getAttribute(attributes$x.dataImageHeight));if(items.push({src:imgSrc,w:imgWidth,h:imgHeight,msrc:imgSrc}),counter+=1,instance.zoomWrappers.length===counter){let popupClass=`${classes$H.popupClass}`;counter===1&&(popupClass=`${classes$H.popupClass} ${classes$H.popupClassNoThumbs}`);const options2={barsSize:{top:60,bottom:60},history:!1,focus:!1,index:indexImage,mainClass:popupClass,showHideOpacity:!0,showAnimationDuration:250,hideAnimationDuration:250,closeOnScroll:!1,closeOnVerticalDrag:!1,captionEl:!1,closeEl:!0,closeElClasses:["caption-close"],tapToClose:!1,clickToCloseNonZoomable:!1,maxSpreadZoom:2,loop:!0,spacing:0,allowPanToNext:!0,pinchToClose:!1};new LoadPhotoswipe(items,options2)}})}}const selectors$T={complementaryProducts:"[data-complementary-products]",buttonQuickView:"[data-button-quick-view]"},attributes$y={url:"data-url"};class ComplementaryProducts extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),this.hasAttribute(attributes$y.url)&&this.getAttribute(attributes$y.url)!==""&&fetch(this.getAttribute(attributes$y.url)).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(selectors$T.complementaryProducts);recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),html.querySelector(selectors$T.buttonQuickView)&&new QuickViewPopup(this)}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}const selectors$U={option:"[data-option]",popout:"[data-popout]",productMediaSlider:"[data-product-single-media-slider]",productMediaThumb:"[data-thumbnail-id]",productMediaThumbs:"[data-product-single-media-thumbs]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productSingleThumbnailLink:".product-single__thumbnail-link",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",modalScrollContainer:"[data-tabs-holder]",formWrapper:"[data-form-wrapper]",tooltip:"[data-tooltip]",productRating:"[data-product-rating]",productReviews:"#shopify-product-reviews",links:"a, button",upsellProduct:"[data-upsell-holder]",upsellProductSlider:"[data-upsell-slider]"},classes$I={featuredProduct:"featured-product",featuredProductOnboarding:"featured-product--onboarding",hasMediaActive:"has-media-active",isSelected:"is-selected",mediaHidden:"media--hidden",noOutline:"no-outline",hasPopup:"has-popup",isMoving:"is-moving"},attributes$z={mediaId:"data-media-id",sectionId:"data-section-id",thumbId:"data-thumbnail-id",dataTallLayout:"data-tall-layout",loaded:"loaded",tabindex:"tabindex"},sections$q={};class Product{constructor(section){this.container=section.container,this.sectionId=this.container.getAttribute(attributes$z.sectionId),this.tallLayout=this.container.getAttribute(attributes$z.dataTallLayout)==="true",this.formWrapper=this.container.querySelector(selectors$U.formWrapper),this.flkty=null,this.flktyNav=null,this.isFlickityDragging=!1,this.enableHistoryState=!this.container.classList.contains(classes$I.featuredProduct),this.tooltips=[],this.checkSliderOnResize=()=>this.checkSlider(),this.flktyNavOnResize=()=>this.resizeFlickityNav(),this.scrollToReviews(),new QuickViewPopup(this.container),!this.container.classList.contains(classes$I.featuredProductOnboarding)&&(new Zoom(this.container),this.productSlider(),this.initUpsellSlider(),this.initMediaSwitch(),this.initProductVideo(),this.initProductModel(),this.initShopifyXrLaunch())}productSlider(){this.checkSlider(),document.addEventListener("theme:resize:width",this.checkSliderOnResize)}checkSlider(){if(!this.tallLayout||window.innerWidth<=theme.sizes.large){this.initProductSlider();return}this.destroyProductSlider()}resizeFlickityNav(){this.flktyNav!==null&&this.flktyNav.resize()}initProductSlider(){const slider2=this.container.querySelector(selectors$U.productMediaSlider),thumbs=this.container.querySelector(selectors$U.productMediaThumbs),media=this.container.querySelectorAll(selectors$U.productMediaWrapper);if(media.length>1&&(this.flkty=new Flickity(slider2,{wrapAround:!0,pageDots:!1,adaptiveHeight:!0,on:{ready:()=>{slider2.setAttribute(attributes$z.tabindex,"-1"),media.forEach(item=>{if(!item.classList.contains(classes$I.isSelected)){const links=item.querySelectorAll(selectors$U.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$z.tabindex,"-1")})}})},dragStart:()=>{slider2.classList.add(classes$I.isMoving)},dragMove:()=>{this.isFlickityDragging=!0},staticClick:()=>{this.isFlickityDragging=!1},settle:index=>{const mediaId=this.flkty.selectedElement.getAttribute(attributes$z.mediaId);this.flkty.cells.forEach((slide,i)=>{const links=slide.element.querySelectorAll(selectors$U.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$z.tabindex,i===index?"0":"-1")})}),this.switchMedia(mediaId),slider2.classList.remove(classes$I.isMoving)}}}),media.length&&media.forEach(el=>{el.addEventListener("theme:media:play",()=>{this.flkty.options.draggable=!1,this.flkty.updateDraggable(),el.closest(selectors$U.productMediaSlider).classList.add(classes$I.hasMediaActive)}),el.addEventListener("theme:media:pause",()=>{this.flkty.options.draggable=!0,this.flkty.updateDraggable(),el.closest(selectors$U.productMediaSlider).classList.remove(classes$I.hasMediaActive)})}),flickitySmoothScrolling(slider2),thumbs!==null)){this.flktyNav=new Flickity(thumbs,{asNavFor:slider2,contain:!0,pageDots:!1,prevNextButtons:!1,resize:!0,on:{ready:()=>{thumbs.setAttribute(attributes$z.tabindex,"-1")}}}),this.flktyNav!==null&&document.addEventListener("theme:resize:width",this.flktyNavOnResize),flickitySmoothScrolling(thumbs);const thumbLinks=this.container.querySelectorAll(selectors$U.productSingleThumbnailLink);thumbLinks.length&&thumbLinks.forEach(el=>{el.addEventListener("click",e=>{e.preventDefault()})})}}destroyProductSlider(){this.flkty!==null&&(this.flkty.destroy(),this.flktyNav.destroy(),this.flkty=null,this.flktyNav=null)}initUpsellSlider(){const slider2=this.container.querySelector(selectors$U.upsellProductSlider);if(this.container.querySelectorAll(selectors$U.upsellProduct).length>1){const flktyUpsell=new Flickity(slider2,{wrapAround:!0,pageDots:!0,adaptiveHeight:!0,prevNextButtons:!1});flktyUpsell.on("change",index=>{flktyUpsell.cells.forEach((slide,i)=>{const links=slide.element.querySelectorAll(selectors$U.links);links.length&&links.forEach(link=>{link.setAttribute(attributes$z.tabindex,i===index?"0":"-1")})})})}}handleMediaFocus(event){if(event.code!==theme.keyboardKeys.ENTER&&event.code!==theme.keyboardKeys.TAB)return;const mediaId=event.currentTarget.getAttribute(attributes$z.thumbId),activeSlide=this.container.querySelector(`[${attributes$z.mediaId}="${mediaId}"]`),slideIndex=parseInt([...activeSlide.parentNode.children].indexOf(activeSlide)),slider2=this.container.querySelector(selectors$U.productMediaSlider),sliderNav=this.container.querySelector(selectors$U.productMediaThumbs),flkty=Flickity.data(slider2)||null,flktyNav=Flickity.data(sliderNav)||null;flkty&&flkty.isActive&&slideIndex>-1&&event.code===theme.keyboardKeys.ENTER&&flkty.select(slideIndex),flktyNav&&flktyNav.isActive&&slideIndex>-1&&flktyNav.select(slideIndex)}switchMedia(mediaId){const mediaItems=document.querySelectorAll(`${selectors$U.productMediaWrapper}`),selectedMedia=this.container.querySelector(`${selectors$U.productMediaWrapper}[${attributes$z.mediaId}="${mediaId}"]`),isFocusEnabled=!document.body.classList.contains(classes$I.noOutline);mediaItems.length&&mediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$I.mediaHidden)}),isFocusEnabled&&selectedMedia.focus(),selectedMedia.closest(selectors$U.productMediaSlider).classList.remove(classes$I.hasMediaActive),selectedMedia.classList.remove(classes$I.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0});const deferredMedia=selectedMedia.querySelector(selectors$U.deferredMedia);deferredMedia&&deferredMedia.getAttribute(attributes$z.loaded)!=="true"&&selectedMedia.querySelector(selectors$U.deferredMediaButton).dispatchEvent(new Event("click"))}initMediaSwitch(){const productThumbImages=this.container.querySelectorAll(selectors$U.productMediaThumb);productThumbImages.length&&productThumbImages.forEach(el=>{el.addEventListener("keyup",this.handleMediaFocus.bind(this)),el.addEventListener("click",e=>{e.preventDefault()})})}initProductVideo(){this.videos=new ProductVideo(this.container)}initProductModel(){const modelItems=this.container.querySelectorAll(selectors$U.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,this.sectionId)})}initShopifyXrLaunch(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$U.productModel}:not(.${classes$I.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}onUnload(){this.flktyNav!==null&&document.removeEventListener("theme:resize:width",this.flktyNavOnResize),document.removeEventListener("theme:resize:width",this.checkSliderOnResize)}scrollToReviews(){const productRating=this.container.querySelector(selectors$U.productRating),events=["click","keydown"];productRating&&events.forEach(eventName=>{productRating.addEventListener(eventName,event=>{if(event.code!==theme.keyboardKeys.ENTER||event.type!="click"){const reviewsContainer=document.querySelector(selectors$U.productReviews);if(!reviewsContainer)return;reviewsContainer.scrollIntoView({behavior:"smooth"})}})})}}const productSection={onLoad(){sections$q[this.id]=new Product(this)},onUnload:function(){sections$q[this.id].onUnload()}};register("product-template",[productFormSection,productSection,swatchSection,shareButton,collapsible,tooltip,popoutSection,productStickySection]),register("featured-product",[productFormSection,productSection,swatchSection,shareButton,collapsible,tooltip,popoutSection,productStickySection]),customElements.get("complementary-products")||customElements.define("complementary-products",ComplementaryProducts);const classes$J={isDisabled:"is-disabled"},attributes$A={circleTextParallax:"data-circle-text-parallax"};class CircleText{constructor(el){this.circleText=el,this.rotateDegree=70,this.adjustRotateDegree=this.rotateDegree/2,this.scrollEvent=()=>this.updateParallax(),this.init()}init(){this.circleText.hasAttribute(attributes$A.circleTextParallax)&&document.addEventListener("theme:scroll",this.scrollEvent)}updateParallax(){if(this.circleText.classList.contains(classes$J.isDisabled))return;const windowHeight=Math.round(window.innerHeight),scrollTop=Math.round(window.scrollY),scrollBottom=scrollTop+windowHeight,elementOffsetTopPoint=Math.round(this.circleText.getBoundingClientRect().top+scrollTop),elementHeight=this.circleText.offsetHeight,isBottomOfElementPassed=elementOffsetTopPoint+elementHeight0&&(this.circleText.style.transform=`rotate(${this.adjustRotateDegree+angle}deg)`)}}unload(){document.removeEventListener("theme:scroll",this.scrollEvent)}}const attributes$B={href:"href",mediaId:"data-media-id"},selectors$V={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productContentWrapper:"[data-product-content-wrapper]",productMediaWrapper:"[data-product-single-media-wrapper]",productModel:"[data-model]",productLink:"[data-product-link]",productSingleMediaImage:"[data-product-single-media-image]",sliderContents:"[data-slider-contents]",sliderImages:"[data-slider-images]",tabButton:"[data-tab-button]",tabItem:"[data-tab-item]",circleText:"[data-circle-text]"},classes$K={aosAnimate:"aos-animate",tabButtonActive:"products-list__nav__button--active",tabItemActive:"products-list__item--active",mediaHidden:"media--hidden",isDisabled:"is-disabled"},sections$r={};class ProductsList{constructor(section){this.container=section.container,this.sectionId=this.container.dataset.sectionId,this.tabButtons=this.container.querySelectorAll(selectors$V.tabButton),this.tabItems=this.container.querySelectorAll(selectors$V.tabItem),this.slidersImages=this.container.querySelectorAll(selectors$V.sliderImages),this.slidersContents=this.container.querySelectorAll(selectors$V.sliderContents),this.videos={},this.flktyImages=[],this.flktyContent=[],this.sliderResizeEvent=()=>this.resizeSlider(),this.initButtons(),this.initSliders(),this.initProductVideo(),this.initProductModel(),this.initShopifyXrLaunch(),this.initCircleText(),this.listen()}listen(){(this.slidersImages.length>0||this.slidersContents.length>0)&&document.addEventListener("theme:resize",this.sliderResizeEvent)}resizeSlider(){this.flktyImages.length>0&&requestAnimationFrame(()=>{this.flktyImages.forEach(flktyImages=>flktyImages.resize())}),this.flktyContent.length>0&&requestAnimationFrame(()=>{this.flktyContent.forEach(flktyContent=>flktyContent.resize())})}initButtons(){this.tabButtons.length&&this.tabButtons.forEach(tabButton=>{tabButton.addEventListener("click",e=>{if(tabButton.classList.contains(classes$K.tabButtonActive))return;const currentTabAnchor=tabButton.getAttribute(attributes$B.href),currentTab=this.container.querySelector(currentTabAnchor),currentMedia=currentTab.querySelector(selectors$V.productMediaWrapper),mediaId=currentMedia?currentMedia.dataset.mediaId:null,currentCircleText=currentTab.querySelector(selectors$V.circleText);this.tabButtons.forEach(button=>{button.classList.remove(classes$K.tabButtonActive)}),this.tabItems.forEach(item=>{const circleText=item.querySelector(selectors$V.circleText);item.classList.remove(classes$K.tabItemActive),circleText?.classList.add(classes$K.isDisabled),theme.settings.animations&&item.querySelectorAll(`.${classes$K.aosAnimate}`).forEach(element=>{element.classList.remove(classes$K.aosAnimate),setTimeout(()=>{element.classList.add(classes$K.aosAnimate)})})}),tabButton.classList.add(classes$K.tabButtonActive),currentTab.classList.add(classes$K.tabItemActive),document.dispatchEvent(new Event("theme:resize")),currentCircleText&&(currentCircleText.classList.remove(classes$K.isDisabled),document.dispatchEvent(new Event("theme:scroll"))),mediaId?this.switchMedia(mediaId):this.pauseAllMedia(),e.preventDefault()})})}initSliders(){this.slidersImages.forEach((sliderImages,idx)=>{const contentsElement=sliderImages.closest(selectors$V.tabItem).querySelector(selectors$V.sliderContents),flktyImages=new Flickity(sliderImages,{fade:!0,pageDots:!1,prevNextButtons:!0,wrapAround:!0,adaptiveHeight:!0,asNavFor:contentsElement,on:{change:index=>{this.flktyContent.length>0&&this.flktyContent[idx].select(index)}}});flktyImages.on("settle",index=>{const elements=sliderImages.querySelectorAll(selectors$V.productMediaWrapper);for(let i=0;i{const flktyContent=new Flickity(sliderContent,{fade:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,adaptiveHeight:!0});flktyContent.on("settle",index=>{const elements=sliderContent.querySelectorAll(selectors$V.productContentWrapper);for(let i=0;i{element.removeAttribute("tabindex")}):elements[i].querySelectorAll(selectors$V.productLink).forEach(element=>{element.setAttribute("tabindex","-1")})}),this.flktyContent.push(flktyContent)})}initProductVideo(){this.videos=new ProductVideo(this.container)}initProductModel(){const modelItems=this.container.querySelectorAll(selectors$V.productModel);modelItems.length&&modelItems.forEach(element=>{theme.ProductModel.init(element,this.sectionId)})}initShopifyXrLaunch(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$V.productModel}:not(.${classes$K.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}switchMedia(mediaId){const selectedMedia=this.container.querySelector(`${selectors$V.productMediaWrapper}[${attributes$B.mediaId}="${mediaId}"]`),isFocusEnabled=!document.body.classList.contains(classes$K.noOutline);this.pauseAllMedia(),isFocusEnabled&&selectedMedia.focus(),selectedMedia.classList.remove(classes$K.mediaHidden),selectedMedia.dispatchEvent(new CustomEvent("theme:media:visible"),{bubbles:!0});const deferredMedia=selectedMedia.querySelector(selectors$V.deferredMedia);deferredMedia&&deferredMedia.getAttribute(attributes$B.loaded)!=="true"&&selectedMedia.querySelector(selectors$V.deferredMediaButton).dispatchEvent(new Event("click"))}pauseAllMedia(){const mediaItems=document.querySelectorAll(`${selectors$V.productMediaWrapper}`);mediaItems.length&&mediaItems.forEach(media=>{media.dispatchEvent(new CustomEvent("theme:media:hidden"),{bubbles:!0}),media.classList.add(classes$K.mediaHidden)})}initCircleText(){this.container.querySelectorAll(selectors$V.circleText).forEach(circleText=>{new CircleText(circleText)})}onBlockSelect(evt){evt.target.dispatchEvent(new Event("click"))}onUnload(){(this.slidersImages.length>0||this.slidersContents.length>0)&&document.removeEventListener("theme:resize",this.sliderResizeEvent)}}register("products-list",{onLoad(){sections$r[this.id]=new ProductsList(this)},onUnload(){sections$r[this.id].onUnload()},onBlockSelect(e){sections$r[this.id].onBlockSelect(e)}});const selectors$W={product:"[data-product-block]",relatedProducts:"[data-related-products]"},attributes$C={sectionId:"data-section-id",productId:"data-product-id",limit:"data-limit"},sections$s={};class RelatedProducts{constructor(container){this.container=container,this.relatedProducts=this.container.querySelector(selectors$W.relatedProducts),this.init()}init(){const sectionId=this.container.getAttribute(attributes$C.sectionId),productId=this.container.getAttribute(attributes$C.productId),limit=this.container.getAttribute(attributes$C.limit),requestUrl=`${theme.routes.product_recommendations_url}?section_id=${sectionId}&limit=${limit}&product_id=${productId}`;fetch(requestUrl).then(response=>response.text()).then(data=>{const createdElement=document.createElement("div");createdElement.innerHTML=data;const inner=createdElement.querySelector(selectors$W.relatedProducts);inner.querySelectorAll(selectors$W.product).length&&(this.relatedProducts.innerHTML=inner.innerHTML,this.productGrid=new ProductGrid(this.container),this.gridSlider=new GridSlider(this.container))})}onDeselect(){this.productGrid&&this.productGrid.onDeselect()}onUnload(){this.productGrid&&this.productGrid.onUnload(),this.gridSlider&&this.gridSlider.onUnload()}}register("related-products",{onLoad(){sections$s[this.id]=new RelatedProducts(this.container)},onDeselect(){sections$s[this.id].onDeselect()},onUnload(){sections$s[this.id].onUnload()}});const sections$t={},selectors$X={slider:"[data-slider]",sliderItem:"[data-item]",buttonProductsShow:"[data-button-show]",buttonProductsHide:"[data-button-hide]",itemProducts:"[data-item-products]",itemProductSlider:"[data-item-products-slider]",itemProduct:"[data-item-product]",links:"a, button"},classes$L={itemActive:"blog-item--active",itemProductsVisible:"blog-item__products--visible",featuredBlogSlider:"shoppable-blog__slider",flickityEnabled:"flickity-enabled",isSelected:"is-selected"},attributes$D={slider:"data-slider",slidePosition:"data-slide-position",sectionId:"data-section-id",tabIndex:"tabindex"};class ShoppableBlog{constructor(section){this.container=section.container,this.flkty=null,this.slider=this.container.querySelector(selectors$X.slider),this.checkSlidesSizeOnResize=()=>this.checkSlidesSize(),this.isFullWidth=this.container.hasAttribute(attributes$D.fullWidth),this.gutter=0,this.a11y=a11y,this.clickOutsideItemEvent=e=>{if(!(e.target.matches(selectors$X.sliderItem)||e.target.closest(selectors$X.sliderItem))){const sliderItem=this.container.querySelectorAll(selectors$X.sliderItem);sliderItem.length&&sliderItem.forEach(item=>{const itemProducts=item.querySelector(selectors$X.itemProducts);itemProducts&&(itemProducts.classList.remove(classes$L.itemProductsVisible),this.changeTabIndex(itemProducts)),item.classList.remove(classes$L.itemActive)})}},this.bindButtons(),this.listen()}initSlider(){this.flkty=new Flickity(this.slider,{prevNextButtons:!0,pageDots:!1,cellAlign:"left",wrapAround:!1,groupCells:!0,contain:!0,on:{ready:()=>{this.handleFocus()}}}),this.flkty.on("change",()=>{const slides=this.container.querySelectorAll(selectors$X.sliderItem);this.handleFocus(),slides.length&&slides.forEach(el=>{const itemProducts=el.querySelector(selectors$X.itemProducts);el.classList.remove(classes$L.itemActive),itemProducts&&el.querySelector(selectors$X.itemProducts).classList.remove(classes$L.itemProductsVisible)}),this.flkty&&!this.flkty.options.draggable&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable())})}destroySlider(){this.flkty!==null&&(this.flkty.destroy(),this.flkty=null)}checkSlidesSize(){const sliderItemStyle=this.container.querySelector(selectors$X.sliderItem).currentStyle||window.getComputedStyle(this.container.querySelector(selectors$X.sliderItem));this.gutter=parseInt(sliderItemStyle.marginRight);const containerWidth=this.slider.offsetWidth+this.gutter,itemsWidth=this.getItemsWidth(),itemsOverflowViewport=containerWidth=theme.sizes.small&&itemsOverflowViewport?this.initSlider():this.destroySlider()}getItemsWidth(){let itemsWidth=0;const slides=this.slider.querySelectorAll(selectors$X.sliderItem);return slides.length&&slides.forEach(item=>{itemsWidth+=item.offsetWidth+this.gutter}),itemsWidth}bindButtons(){const itemProductSlider=this.container.querySelectorAll(selectors$X.itemProductSlider),buttonProductsShow=this.container.querySelectorAll(selectors$X.buttonProductsShow),buttonProductsHide=this.container.querySelectorAll(selectors$X.buttonProductsHide);buttonProductsShow.length&&buttonProductsShow.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault(),this.container.querySelectorAll(selectors$X.sliderItem).forEach(item2=>{const itemProducts2=item2.querySelector(selectors$X.itemProducts);item2.classList.remove(classes$L.itemActive),itemProducts2&&(itemProducts2.classList.remove(classes$L.itemProductsVisible),this.changeTabIndex(itemProducts2))});const item=button.closest(selectors$X.sliderItem),itemProducts=item.querySelector(selectors$X.itemProducts);if(item.classList.add(classes$L.itemActive),itemProducts){itemProducts.classList.add(classes$L.itemProductsVisible),this.changeTabIndex(itemProducts,"enable");const itemProductsSlider=itemProducts.querySelector(selectors$X.itemProductSlider),allSlides=itemProductsSlider.querySelectorAll(selectors$X.itemProduct);if(itemProductsSlider.classList.contains(classes$L.flickityEnabled)){const currentSlideIndex=itemProductsSlider.querySelector(`.${classes$L.isSelected}`).getAttribute(attributes$D.slidePosition);allSlides.forEach((slide,i)=>{slide.setAttribute(attributes$D.tabIndex,i===currentSlideIndex?"0":"-1")})}}this.flkty!==null&&(this.flkty.options.draggable=!1,this.flkty.updateDraggable()),this.a11y.state.trigger=button})}),buttonProductsHide.length&&buttonProductsHide.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault();const item=button.closest(selectors$X.sliderItem),itemProducts=item.querySelector(selectors$X.itemProducts);item.classList.remove(classes$L.itemActive),itemProducts&&(itemProducts.classList.remove(classes$L.itemProductsVisible),this.changeTabIndex(itemProducts)),this.flkty!==null&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable()),this.a11y.state.trigger.focus()})}),itemProductSlider.length&&itemProductSlider.forEach(slider2=>{if(slider2.querySelectorAll(selectors$X.itemProduct).length>1){const flktyProducts=new Flickity(slider2,{prevNextButtons:!0,contain:!0,pageDots:!1,wrapAround:!0,on:{change:index=>{flktyProducts.cells.forEach((slide,i)=>{slide.element.querySelectorAll(selectors$X.links).forEach(link=>{link.setAttribute(attributes$D.tabIndex,i===index?"0":"-1")})})}}})}}),this.slider.addEventListener("keyup",event=>{if(event.code===theme.keyboardKeys.ESCAPE){const sliderItem=event.target.hasAttribute(attributes$D.slider)?event.target.querySelectorAll(selectors$X.sliderItem):event.target.closest(selectors$X.slider).querySelectorAll(selectors$X.sliderItem);sliderItem.length&&(sliderItem.forEach(item=>{const itemProducts=item.querySelector(selectors$X.itemProducts);item.classList.remove(classes$L.itemActive),itemProducts&&(itemProducts.classList.remove(classes$L.itemProductsVisible),this.changeTabIndex(itemProducts))}),this.flkty&&(this.flkty.options.draggable=!0,this.flkty.updateDraggable())),this.a11y.state.trigger.focus()}})}handleFocus(){const sliderItems=this.container.querySelectorAll(selectors$X.sliderItem);sliderItems.length&&sliderItems.forEach(item=>{const selected=item.classList.contains(classes$L.isSelected),itemProducts=item.querySelector(selectors$X.itemProducts);selected?(this.changeTabIndex(item,"enable"),itemProducts&&this.changeTabIndex(itemProducts)):(this.changeTabIndex(item),itemProducts&&itemProducts.classList.remove(classes$L.itemProductsVisible))})}listen(){this.slider&&(this.checkSlidesSize(),document.addEventListener("theme:resize:width",this.checkSlidesSizeOnResize)),document.addEventListener("mousedown",this.clickOutsideItemEvent)}changeTabIndex(items,state=""){const tabIndex=state==="enable"?"0":"-1";items.querySelectorAll(selectors$X.links).forEach(link=>{link.setAttribute(attributes$D.tabIndex,tabIndex)})}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.checkSlidesSizeOnResize),document.removeEventListener("mousedown",this.clickOutsideItemEvent)}}register("shoppable-blog",{onLoad(){sections$t[this.id]=new ShoppableBlog(this)},onUnload(e){sections$t[this.id].onUnload(e)},onBlockSelect(e){sections$t[this.id].onBlockSelect(e)}});const selectors$Y={arrowScrollDown:"[data-scroll-down]",header:"[data-site-header]",item:"[data-slide]",links:"a, button",main:"[data-main]",slider:"[data-slider]"},attributes$E={style:"data-style",currentStyle:"data-current-style",tabIndex:"tabindex",slidePosition:"data-slide-position"},classes$M={headerFixed:"site-header--fixed"},sections$u={};class Slider{constructor(section){this.container=section.container,this.header=document.querySelector(selectors$Y.header),this.flkty=null,this.initSlider(),this.initZoomAnimation(),this.bindScrollButton()}initSlider(){const slidesCount=this.container.querySelectorAll(selectors$Y.item).length,duration=parseInt(this.container.dataset.duration),pageDots=this.container.dataset.pageDots==="true"&&slidesCount>1,prevNextButtons=this.container.dataset.navArrows==="true"&&slidesCount>1;let autoplay=this.container.dataset.autoplay==="true";if(autoplay&&(autoplay=duration),slidesCount>1)this.flkty=new Flickity(this.container,{fade:!0,cellSelector:selectors$Y.item,autoPlay:autoplay,wrapAround:!0,adaptiveHeight:!0,setGallerySize:!0,imagesLoaded:!0,pageDots,prevNextButtons,on:{ready:()=>{const currentStyle=this.container.querySelector(`${selectors$Y.item}[${attributes$E.slidePosition}="1"]`).getAttribute(attributes$E.style);this.container.setAttribute(attributes$E.currentStyle,currentStyle),requestAnimationFrame(()=>{this.flkty.resize()})},change:index=>{const currentStyle=this.flkty.selectedElement.getAttribute(attributes$E.style);this.container.setAttribute(attributes$E.currentStyle,currentStyle),this.flkty.cells.forEach((slide,i)=>{slide.element.querySelectorAll(selectors$Y.links).forEach(link=>{link.setAttribute(attributes$E.tabIndex,i===index?"0":"-1")})})}}}),flickitySmoothScrolling(this.container);else if(slidesCount===1){const currentStyle=this.container.querySelector(selectors$Y.item).getAttribute(attributes$E.style);this.container.setAttribute(attributes$E.currentStyle,currentStyle)}}initZoomAnimation(){if(this.container.dataset.zoomAnimation!=="true")return;const observedElement=this.container,firstSection=document.body.querySelector(selectors$Y.main).children[0],isFirstSection=this.container.parentNode===firstSection,hasTransparentHeader=this.header.dataset.transparent=="true",renderZoomEffect=()=>{const headerHeight=isFirstSection&hasTransparentHeader?0:parseInt(this.header.dataset.height||this.header.offsetHeight),rect=observedElement.getBoundingClientRect(),sectionHeight=observedElement.offsetHeight,scrolledPercentage=(isFirstSection?headerHeight-rect.top:headerHeight-rect.top+window.innerHeight)/sectionHeight;let transitionSpeed=.1;isFirstSection&&(transitionSpeed*=1.5);let scale=1+scrolledPercentage*transitionSpeed;scale=scale>1?scale:1,observedElement.style.setProperty("--scale",scale)};renderZoomEffect(),this.zoomOnScrollEvent=throttle(renderZoomEffect,5);const observerOptions={root:null,rootMargin:"0px",threshold:0},intersectionCallback=entry=>{entry[0].isIntersecting?window.addEventListener("scroll",this.zoomOnScrollEvent):window.removeEventListener("scroll",this.zoomOnScrollEvent)};new IntersectionObserver(intersectionCallback,observerOptions).observe(observedElement)}bindScrollButton(){const arrowDown=this.container.querySelector(selectors$Y.arrowScrollDown);arrowDown&&arrowDown.addEventListener("click",e=>{e.preventDefault();const headerHeight=this.header.classList.contains(classes$M.headerFixed)?60:0,scrollToPosition=parseInt(Math.ceil(this.container.offsetTop+this.container.offsetHeight-headerHeight));window.scrollTo({top:scrollToPosition,left:0,behavior:"smooth"})})}onBlockSelect(evt){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target));this.flkty!==null&&(this.flkty.select(index),this.flkty.pausePlayer())}onBlockDeselect(evt){evt.target.closest(selectors$Y.slider).dataset.autoplay==="true"&&this.flkty!==null&&this.flkty.playPlayer()}onReorder(){this.flkty!==null&&this.flkty.resize()}onUnload(){this.flkty!==null&&(this.flkty.destroy(),this.flkty=null),this.zoomOnScrollEvent!==null&&window.removeEventListener("scroll",this.zoomOnScrollEvent)}}register("slider",[{onLoad(){sections$u[this.id]=new Slider(this)},onReorder(e){sections$u[this.id].onReorder(e)},onUnload(e){sections$u[this.id].onUnload(e)},onBlockSelect(e){sections$u[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$u[this.id].onBlockDeselect(e)}},videoPlay]),register("subcollections",gridSlider);const selectors$Z={scrollbar:"[data-custom-scrollbar]",scrollbarItems:"[data-custom-scrollbar-items]",scrollbarThumb:"[data-custom-scrollbar-thumb]"};class CustomScrollbar{constructor(container){this.container=container,this.scrollbarItems=container.querySelector(selectors$Z.scrollbarItems),this.scrollbar=container.querySelector(selectors$Z.scrollbar),this.scrollbarThumb=container.querySelector(selectors$Z.scrollbarThumb),this.trackWidth=0,this.calcScrollbarEvent=()=>this.calculateScrollbar(),this.onScrollbarChangeEvent=e=>this.onScrollbarChange(e),this.scrollbar&&this.scrollbarItems&&(this.events(),this.calculateScrollbar(),this.scrollbarItems.children.length&&this.calculateTrack(this.scrollbarItems.children[0]))}calculateTrack(element){const thumbScale=element.clientWidth/this.scrollbarThumb.parentElement.clientWidth,thumbPosition=element.offsetLeft/this.scrollbarThumb.parentElement.clientWidth;this.scrollbar.style.setProperty("--thumb-scale",thumbScale),this.scrollbar.style.setProperty("--thumb-position",`${this.trackWidth*thumbPosition}px`)}calculateScrollbar(){if(this.scrollbarItems.children.length){const childrenArr=[...this.scrollbarItems.children];this.trackWidth=0,childrenArr.forEach(element=>{this.trackWidth+=element.getBoundingClientRect().width+parseInt(window.getComputedStyle(element).marginRight)}),this.scrollbar.style.setProperty("--track-width",`${this.trackWidth}px`)}}onScrollbarChange(e){e&&e.detail&&e.detail.element&&this.container.contains(e.detail.element)&&this.calculateTrack(e.detail.element)}events(){document.addEventListener("theme:resize:width",this.calcScrollbarEvent),document.addEventListener("theme:custom-scrollbar:change",this.onScrollbarChangeEvent)}unload(){document.removeEventListener("theme:resize:width",this.calcScrollbarEvent),document.removeEventListener("theme:custom-scrollbar:change",this.onScrollbarChangeEvent)}}const selectors$_={tabLink:"[data-tab-link]",tabContent:"[data-tab-content]",scrollable:"[data-custom-scrollbar]",scrollableHolder:"[data-custom-scrollbar-holder]",slider:"[data-slider]",tabsContents:"[data-tabs-contents]"},classes$N={current:"current",hide:"hide",alt:"alt",aosAnimate:"aos-animate",aosInit:"aos-init"},attributes$F={tabLink:"data-tab-link",tabContent:"data-tab-content",tabStartIndex:"data-start-index"},sections$v={};class Tabs{constructor(container){this.container=container,this.tabsContents=container.querySelector(selectors$_.tabsContents),this.animateElementsTimer=null,this.container&&(this.scrollable=this.container.querySelector(`${selectors$_.scrollable}`),this.init(),this.initCustomScrollbar())}init(){const tabsNavList=this.container.querySelectorAll(selectors$_.tabLink),firstTabLink=this.container.querySelector(`[${attributes$F.tabLink}="${this.container.hasAttribute(attributes$F.tabStartIndex)?this.container.getAttribute(attributes$F.tabStartIndex):0}"]`),firstTabContent=this.container.querySelector(`[${attributes$F.tabContent}="${this.container.hasAttribute(attributes$F.tabStartIndex)?this.container.getAttribute(attributes$F.tabStartIndex):0}"]`);firstTabContent&&firstTabContent.classList.add(classes$N.current),firstTabLink&&firstTabLink.classList.add(classes$N.current),this.checkVisibleTabLinks(),tabsNavList.length&&tabsNavList.forEach(element=>{const tabId=parseInt(element.getAttribute(attributes$F.tabLink)),tab=this.container.querySelector(`[${attributes$F.tabContent}="${tabId}"]`);element.addEventListener("click",()=>{this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.code===theme.keyboardKeys.SPACE||event.code===theme.keyboardKeys.ENTER)&&this.tabChange(element,tab)})})}initCustomScrollbar(){this.scrollable&&(this.customScrollbar=new CustomScrollbar(this.container))}tabChange(element,tab){if(element.classList.contains(classes$N.current))return;const parent=element.closest(selectors$_.scrollableHolder)?element.closest(selectors$_.scrollableHolder):element.parentElement,parentPadding=parseInt(window.getComputedStyle(parent).getPropertyValue("padding-left")),lastActiveTab=this.container.querySelector(`${selectors$_.tabContent}.${classes$N.current}`),lastActiveTabLink=this.container.querySelector(`${selectors$_.tabLink}.${classes$N.current}`),slider2=tab.querySelector(selectors$_.slider);lastActiveTab.classList.remove(classes$N.current),lastActiveTabLink.classList.remove(classes$N.current),element.classList.add(classes$N.current),tab.classList.add(classes$N.current),slider2&&slider2.dispatchEvent(new CustomEvent("theme:tab:change",{bubbles:!1})),parent.scrollTo({top:0,left:element.offsetLeft-parent.offsetWidth/2+element.offsetWidth/2+parentPadding,behavior:"smooth"}),element.dispatchEvent(new CustomEvent("theme:custom-scrollbar:change",{bubbles:!0,detail:{element}})),theme.settings.animations&&(this.tabsContents.querySelectorAll(`.${classes$N.aosInit}`).forEach(element2=>{element2.classList.remove(classes$N.aosAnimate)}),this.animateElementsTimer&&clearTimeout(this.animateElementsTimer),this.animateElementsTimer=setTimeout(()=>{tab.querySelectorAll(`.${classes$N.aosInit}`).forEach(element2=>{element2.classList.add(classes$N.aosAnimate)})},150)),element.classList.contains(classes$N.hide)&&tab.classList.add(classes$N.hide),this.checkVisibleTabLinks()}checkVisibleTabLinks(){const tabsNavList=this.container.querySelectorAll(selectors$_.tabLink),tabsNavListHidden=this.container.querySelectorAll(`${selectors$_.tabLink}.${classes$N.hide}`);tabsNavList.length-tabsNavListHidden.length<2?this.container.classList.add(classes$N.alt):this.container.classList.remove(classes$N.alt)}onBlockSelect(evt){const element=evt.target;element&&(element.dispatchEvent(new Event("click")),element.parentNode.scrollTo({top:0,left:element.offsetLeft-element.clientWidth,behavior:"smooth"}))}onUnload(){this.customScrollbar&&this.customScrollbar.unload()}}register("tab-collections",[productGrid,gridSlider,{onLoad(){sections$v[this.id]=new Tabs(this.container)},onBlockSelect(e){sections$v[this.id].onBlockSelect(e)},onUnload(){sections$v[this.id].onUnload()}}]);const sections$w={},selectors$$={slider:"[data-slider]",item:"[data-item]"},classes$O={flickityEnabled:"flickity-enabled"},attributes$G={sectionId:"data-section-id"};class Testimonials{constructor(section){this.container=section.container,this.sectionId=this.container.getAttribute(attributes$G.sectionId),this.slider=this.container.querySelector(selectors$$.slider),this.sliderResizeEvent=()=>this.initSlider(),this.flkty=null,this.initSlider(),document.addEventListener("theme:resize:width",this.sliderResizeEvent)}initSlider(){const slidesCount=this.slider.querySelectorAll(selectors$$.item).length;let flickityEnabled=this.slider.classList.contains(classes$O.flickityEnabled);if(slidesCount==2&&window.innerWidth>=theme.sizes.small||slidesCount==1||window.innerWidththis.flkty.size.width||this.flkty.destroy()}onBlockSelect(evt){if(this.flkty!==null){const index=parseInt([...evt.target.parentNode.children].indexOf(evt.target)),slidesPerPage=parseInt(this.flkty.slides[0].cells.length),groupIndex=Math.floor(index/slidesPerPage);this.flkty.select(groupIndex)}else{const sliderStyle=this.slider.currentStyle||window.getComputedStyle(this.slider),sliderPadding=parseInt(sliderStyle.paddingLeft),blockPositionLeft=evt.target.offsetLeft-sliderPadding;this.slider.scrollTo({top:0,left:blockPositionLeft,behavior:"smooth"})}}onUnload(){document.removeEventListener("theme:resize:width",this.sliderResizeEvent)}}register("testimonials",{onLoad(){sections$w[this.id]=new Testimonials(this)},onUnload(e){sections$w[this.id].onUnload(e)},onBlockSelect(e){sections$w[this.id].onBlockSelect(e)}});const classes$P={noOutline:"no-outline"},selectors$10={inPageLink:"[data-skip-content]",linkesWithOnlyHash:'a[href="#"]'};class Accessibility{constructor(){this.init()}init(){this.body=document.body,this.inPageLink=document.querySelector(selectors$10.inPageLink),this.linkesWithOnlyHash=document.querySelectorAll(selectors$10.linkesWithOnlyHash),this.isFocused=!1,this.focusHash(),this.bindInPageLinks(),this.clickEvents(),this.focusEvents(),this.focusEventsOff()}clickEvents(){this.inPageLink&&this.inPageLink.addEventListener("click",event=>{event.preventDefault()}),this.linkesWithOnlyHash&&this.linkesWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){document.addEventListener("keyup",event=>{event.code===theme.keyboardKeys.TAB&&(this.body.classList.remove(classes$P.noOutline),this.isFocused=!0)})}focusEventsOff(){document.addEventListener("mousedown",()=>{this.body.classList.add(classes$P.noOutline),this.isFocused=!1})}forceFocus(element,options2){options2=options2||{};var savedTabIndex=element.tabIndex;element.tabIndex=-1,element.dataset.tabIndex=savedTabIndex,element.focus(),typeof options2.className<"u"&&element.classList.add(options2.className),element.addEventListener("blur",callback);function callback(event){event.target.removeEventListener(event.type,callback),element.tabIndex=savedTabIndex,delete element.dataset.tabIndex,typeof options2.className<"u"&&element.classList.remove(options2.className)}}focusHash(options2){options2=options2||{};let hash=window.location.hash;typeof theme.settings.newHash<"u"&&(hash=theme.settings.newHash,window.location.hash=`#${hash}`);const element=document.getElementById(hash.slice(1));if(element&&options2.ignore&&element.matches(options2.ignore))return!1;hash&&element&&this.forceFocus(element,options2)}bindInPageLinks(options2){options2=options2||{};const links=Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]'));function queryCheck(selector){return document.getElementById(selector)!==null}return links.filter(link=>{if(link.hash==="#"||link.hash===""||options2.ignore&&link.matches(options2.ignore)||!queryCheck(link.hash.substr(1)))return!1;var element=document.querySelector(link.hash);return element?(link.addEventListener("click",()=>{this.forceFocus(element,options2)}),!0):!1})}}const getScrollbarWidth=()=>{const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth};document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),document.addEventListener("DOMContentLoaded",function(){load("*"),document.body.dataset.animations==="true"&&AOS.init({once:!0,offset:50,duration:600,startEvent:"load"}),new Accessibility,!customElements.get("product-grid-item-swatch")&&window.theme.settings.enableColorSwatchesCollection&&customElements.define("product-grid-item-swatch",GridSwatch),"scrollBehavior"in document.documentElement.style||loadScript({url:theme.assets.smoothscroll})})})(themeVendor.ScrollLock,themeVendor.Flickity,themeVendor.Sqrl,themeVendor.themeCurrency,themeVendor.ajaxinate,themeVendor.AOS); //# sourceMappingURL=/cdn/shop/t/17/assets/theme.js.map?v=169869040944599966851679589435