1/* 2@license 3 Concept by RoarTheme (https://roartheme.co) 4 Access unminified JS in assets/theme.js 5 6 Use this event listener to run your own JS outside of this file. 7 Documentation - https://roartheme.co/blogs/concept/javascript-events-for-developers 8 9 document.addEventListener('page:loaded', function() { 10 // Page has loaded and theme assets are ready 11 }); 12*/window.theme=window.theme||{},window.Shopify=window.Shopify||{},theme.config={hasSessionStorage:!0,hasLocalStorage:!0,mqlSmall:!1,mediaQuerySmall:"screen and (max-width: 767px)",motionReduced:window.matchMedia("(prefers-reduced-motion: reduce)").matches,isTouch:"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,rtl:document.documentElement.getAttribute("dir")==="rtl"},theme.supportsPassive=!1;try{const opts=Object.defineProperty({},"passive",{get:function(){theme.supportsPassive=!0}});window.addEventListener("testPassive",null,opts),window.removeEventListener("testPassive",null,opts)}catch{}console.log(theme.settings.themeName+" theme ("+theme.settings.themeVersion+") by RoarTheme | Learn more at https://roartheme.co"),(function(){theme.DOMready=function(callback){document.readyState!="loading"?callback():document.addEventListener("DOMContentLoaded",callback)},theme.headerGroup={rounded:()=>Array.from(document.querySelectorAll(".shopify-section-group-header-group .section--rounded")),sections:()=>Array.from(document.querySelectorAll(".shopify-section-group-header-group")),init:()=>{let previousSection=null;const rounded=theme.headerGroup.rounded(),sections=theme.headerGroup.sections();sections.forEach((shopifySection,index)=>{const section=shopifySection.querySelector(".section");if(section){if(section.classList.remove("section--next-rounded"),section.classList.remove("section--first-rounded"),section.classList.remove("section--last-rounded"),section.classList.contains("section--rounded")&&(index===0&§ion.classList.add("section--first-rounded"),index===rounded.length-1&§ion.classList.add("section--last-rounded"),previousSection&&previousSection.classList.contains("section--rounded")&&previousSection.classList.add("section--next-rounded")),index===sections.length-1){const nextSection=document.querySelector(".main-content .shopify-section:first-child .section");nextSection&&nextSection.classList.contains("section--rounded")&§ion.classList.add("section--next-rounded")}previousSection=section}})}},theme.a11y={trapFocusHandlers:{},getFocusableElements:container=>Array.from(container.querySelectorAll('summary, a[href], button:enabled, [tabindex]:not([tabindex^="-"]), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe')),trapFocus:(container,elementToFocus=container)=>{const elements=theme.a11y.getFocusableElements(container),first=elements[0],last=elements[elements.length-1];theme.a11y.removeTrapFocus(),theme.a11y.trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",theme.a11y.trapFocusHandlers.keydown)},theme.a11y.trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",theme.a11y.trapFocusHandlers.keydown)},theme.a11y.trapFocusHandlers.keydown=function(event){event.code.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",theme.a11y.trapFocusHandlers.focusout),document.addEventListener("focusin",theme.a11y.trapFocusHandlers.focusin),elementToFocus.focus(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)},removeTrapFocus:(elementToFocus=null)=>{document.removeEventListener("focusin",theme.a11y.trapFocusHandlers.focusin),document.removeEventListener("focusout",theme.a11y.trapFocusHandlers.focusout),document.removeEventListener("keydown",theme.a11y.trapFocusHandlers.keydown),elementToFocus&&typeof elementToFocus.focus=="function"&&elementToFocus.focus()}},theme.utils={throttle:callback=>{let requestId=null,lastArgs;const later=context=>()=>{requestId=null,callback.apply(context,lastArgs)},throttled=(...args)=>{lastArgs=args,requestId===null&&(requestId=requestAnimationFrame(later(this)))};return throttled.cancel=()=>{cancelAnimationFrame(requestId),requestId=null},throttled},debounce:(fn,wait)=>{let timer;return(...args)=>{clearTimeout(timer),timer=setTimeout(()=>fn.apply(this,args),wait)}},waitForEvent:(element,eventName)=>new Promise(resolve=>{const done=event=>{event.target===element&&(element.removeEventListener(eventName,done),resolve(event))};element.addEventListener(eventName,done)}),fetchConfig:(type="json",method="POST")=>({method,headers:{"Content-Type":"application/json",Accept:`application/${type}`}}),postLink:(path,options)=>{options=options||{};const method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(const key in params){const hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},postLink2:(path,options)=>{options=options||{};const method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(const key in params)if(typeof params[key]=="string"){const hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}else for(const index in params[key])for(const key2 in params[key][index]){const hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",`${key}[${index}][${key2}]`),hiddenField.setAttribute("value",params[key][index][key2]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},sectionId:element=>element.hasAttribute("data-section-id")?element.getAttribute("data-section-id"):(element=element.classList.contains("shopify-section")?element:element.closest(".shopify-section"),element.i
12d.replace("shopify-section-","")),imageLoaded:imageOrArray=>imageOrArray?(imageOrArray=imageOrArray instanceof Element?[imageOrArray]:Array.from(imageOrArray),Promise.all(imageOrArray.map(image=>new Promise(resolve=>{image.tagName==="IMG"&&image.complete||!image.offsetParent?resolve():image.onload=()=>resolve()})))):Promise.resolve(),visibleMedia:media=>Array.from(media).find(item=>window.getComputedStyle(item).display!=="none"),externalLinksNewTab:()=>{theme.settings.externalLinksNewTab&&document.addEventListener("click",evt=>{const link=evt.target.tagName==="A"?evt.target:evt.target.closest("a");link&&link.tagName==="A"&&window.location.hostname!==new URL(link.href).hostname&&(link.target="_blank")})}},theme.HTMLUpdateUtility={viewTransition:(oldNode,newContent,preProcessCallbacks=[],postProcessCallbacks=[])=>{preProcessCallbacks?.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");theme.HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild,uniqueKey=Date.now();oldNode.querySelectorAll("[id], [form]").forEach(element=>{element.id&&(element.id=`${element.id}-${uniqueKey}`),element.form&&element.setAttribute("form",`${element.form.getAttribute("id")}-${uniqueKey}`)}),oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none",postProcessCallbacks?.forEach(callback=>callback(newNode)),setTimeout(()=>oldNode.remove(),500)},setInnerHTML:(element,html)=>{element.innerHTML=html,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}},theme.Currency={formatMoney:(cents,format="")=>{typeof cents=="string"&&(cents=cents.replace(".",""));const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||window.themeVariables.settings.moneyFormat;function defaultTo(value2,defaultValue){return value2==null||value2!==value2?defaultValue:value2}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultTo(precision,2),thousands=defaultTo(thousands,","),decimal=defaultTo(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);let parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}let value="";switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_space_separator":value=formatWithDelimiters(cents,2," ",".");break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'",".");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break;case"amount_no_decimals_with_apostrophe_separator":value=formatWithDelimiters(cents,0,"'");break;default:value=formatWithDelimiters(cents,2);break}return formatString.indexOf("with_comma_separator")!==-1,formatString.replace(placeholderRegex,value)}},theme.pubsub={PUB_SUB_EVENTS:{cartUpdate:"cartUpdate",quantityUpdate:"quantityUpdate",variantChange:"variantChange",cartError:"cartError",discountUpdate:"discountUpdate",facetUpdate:"facetUpdate",quantityRules:"quantityRules",quantityBoundries:"quantityBoundries",optionValueSelectionChange:"optionValueSelectionChange"},subscribers:{},subscribe:(eventName,callback)=>(theme.pubsub.subscribers[eventName]===void 0&&(theme.pubsub.subscribers[eventName]=[]),theme.pubsub.subscribers[eventName]=[...theme.pubsub.subscribers[eventName],callback],function(){theme.pubsub.subscribers[eventName]=theme.pubsub.subscribers[eventName].filter(cb=>cb!==callback)}),publish:(eventName,data)=>{theme.pubsub.subscribers[eventName]&&theme.pubsub.subscribers[eventName].forEach(callback=>{callback(data)})}},theme.scrollShadow={Updater:(function(){class Updater{constructor(targetElement){this.cb=()=>this.update(targetElement),this.rO=new ResizeObserver(this.cb),this.mO=new MutationObserver(()=>this.on(this.el))}on(element){this.el&&(this.el.removeEventListener("scroll",this.cb),this.rO.disconnect(),this.mO.disconnect()),element&&(element.nodeName==="TABLE"&&!/scroll|auto/.test(getComputedStyle(element).getPropertyValue("overflow"))&&(this.rO.observe(element),element=element.tBodies[0]),element.addEventListener("scroll",this.cb),[element,...element.children].forEac
12h(el=>this.rO.observe(el)),this.mO.observe(element,{childList:!0}),this.el=element)}update(targetElement){const scrollTop=this.el.scrollTop,scrollBottom=this.el.scrollHeight-this.el.offsetHeight-this.el.scrollTop,scrollLeft=this.el.scrollLeft,scrollRight=this.el.scrollWidth-this.el.offsetWidth-this.el.scrollLeft*(theme.config.rtl?-1:1);let cssText=`--t: ${Math.floor(scrollTop)>0?1:0}; --b: ${Math.floor(scrollBottom)>0?1:0}; --l: ${Math.floor(scrollLeft)>0?1:0}; --r: ${Math.floor(scrollRight)>0?1:0};`;if(this.el.nodeName==="TBODY"){const clientRect=this.el.getBoundingClientRect(),rootClientRect=this.el.parentElement.getBoundingClientRect();cssText+=`top: ${clientRect.top-rootClientRect.top}px; bottom: ${rootClientRect.bottom-clientRect.bottom}px; left: ${clientRect.left-rootClientRect.left}px; right: ${rootClientRect.right-clientRect.right}px;`}requestAnimationFrame(()=>{targetElement.style.cssText=cssText})}}return Updater})()},theme.cookiesEnabled=function(){let cookieEnabled=navigator.cookieEnabled;return cookieEnabled||(document.cookie="testcookie",cookieEnabled=document.cookie.indexOf("testcookie")!==-1),cookieEnabled},theme.isStorageSupported=function(type){if(window.self!==window.top)return!1;const testKey="test";let storage;type==="session"&&(storage=window.sessionStorage),type==="local"&&(storage=window.localStorage);try{return storage.setItem(testKey,"1"),storage.removeItem(testKey),!0}catch{return!1}},theme.getElementWidth=function(element,value){const style=window.getComputedStyle(element),text=document.createElement("span");text.style.fontFamily=style.fontFamily,text.style.fontSize=style.fontSize,text.style.fontWeight=style.fontWeight,text.style.visibility="hidden",text.style.position="absolute",text.innerHTML=value,document.body.appendChild(text);const width=text.getBoundingClientRect().width;return text.remove(),width},theme.HoverButton=(function(){class HoverButton2{constructor(container){this.container=container,this.onEnterHandler=this.onEnterHandler.bind(this),this.onLeaveHandler=this.onLeaveHandler.bind(this)}get btnFill(){return this.container.querySelector("[data-fill]")}load(){document.body.getAttribute("data-button-hover")!=="none"&&window.matchMedia("(any-hover: hover)").matches&&(this.container.addEventListener("pointerenter",this.onEnterHandler),this.container.addEventListener("pointerleave",this.onLeaveHandler))}onEnterHandler(event){event.pointerType!=="touch"&&this.btnFill&&Motion.animate(this.btnFill,{y:["76%","0%"]},{duration:.6})}onLeaveHandler(event){event.pointerType!=="touch"&&this.btnFill&&Motion.animate(this.btnFill,{y:"-76%"},{duration:.6})}unload(){this.container.removeEventListener("pointerenter",this.onEnterHandler),this.container.removeEventListener("pointerleave",this.onLeaveHandler)}}return HoverButton2})(),theme.MagnetButton=(function(){const config={magnet:10};class MagnetButton2{constructor(container){this.container=container,this.magnet=container.hasAttribute("data-magnet")?parseInt(container.getAttribute("data-magnet")):config.magnet,this.onMoveHandler=this.onMoveHandler.bind(this),this.onLeaveHandler=this.onLeaveHandler.bind(this)}get btnText(){return this.container.querySelector("[data-text]")}get bounding(){return this.container.getBoundingClientRect()}load(){document.body.getAttribute("data-button-hover")!=="none"&&window.matchMedia("(any-hover: hover)").matches&&(this.container.addEventListener("pointermove",this.onMoveHandler),this.container.addEventListener("pointerleave",this.onLeaveHandler))}onMoveHandler(event){event.pointerType!=="touch"&&(theme.config.motionReduced||this.magnet!==0&&(this.btnText?Motion.animate(this.btnText,{x:((event.clientX-this.bounding.left)/this.container.offsetWidth-.5)*this.magnet,y:((event.clientY-this.bounding.top)/this.container.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()}):Motion.animate(this.container,{x:((event.clientX-this.bounding.left)/this.container.offsetWidth-.5)*this.magnet,y:((event.clientY-this.bounding.top)/this.container.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()})))}onLeaveHandler(event){event.pointerType!=="touch"&&(theme.config.motionReduced||this.magnet!==0&&(this.btnText?Motion.animate(this.btnText,{x:0,y:0},{duration:1.5,easing:Motion.spring()}):Motion.animate(this.container,{x:0,y:0},{duration:1.5,easing:Motion.spring()})))}unload(){this.container.removeEventListener("pointermove",this.onMoveHandler),this.container.removeEventListener("pointerleave",this.onLeaveHandler)}}return MagnetButton2})(),theme.RevealButton=(function(){const config={magnet:25};class RevealButton{constructor(container){this.container=container,this.magnet=container.hasAttribute("data-magnet")?parseInt(container.getAttribute("data-magnet")):config.magnet,this.onMoveHandler=this.onMoveHandler.bind(this),this.onLeaveHandler=this.onLeaveHandler.bind(this)}get btnText(){return this.container.querySelector("[data-text]")}get btnReveal(){return this.container.querySelector("[data-reveal]")}get bounding(){return this.container.getBoundingClientRect()}load(){window.matchMedia("(any-hover: hover)").matches&&(this.container.addEventListener("pointermove",this.onMoveHandler),this.container.addEventListener("pointerleave",this.onLeaveHandler))}onMoveHandler(event){event.pointerType!=="touch"&&(this.btnReveal?Motion.animate(this.btnReveal,{opacity:1,x:((event.clientX-this.bounding.left)/this.container.offsetWidth-.5)*this.magnet,y:((event.clientY-this.bounding.top)/this.container.offsetHeight-.5)*this.magnet},{duration:.2,easing:"steps(2, start)"}):this.btnText?Motion.animate(this.btnText,{x:((event.clientX-this.bounding.left)/this.container.offsetWidth-.5)*this.magnet,y:((event.clientY-this.bounding.top)/this.container.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()}):Motion.animate(this.container,{x:((event.clientX-this.bounding.left)/this.container.offsetWidth-.5)*this.magnet,y:((event.clientY-this.bounding.top)/this.container.offsetHeight-.5)*this.magnet},{duration:1.5,easing:Motion.spring()}))}onLeaveHandler(event){event.pointerType!=="touch"&&(this.btnReveal?Motion.animate(this.btnReveal,{x:0,y:0,opacity:0}
12,{duration:.2,easing:[.61,1,.88,1]}):this.btnText?Motion.animate(this.btnText,{x:0,y:0},{duration:1.5,easing:Motion.spring()}):Motion.animate(this.container,{x:0,y:0},{duration:1.5,easing:Motion.spring()}))}unload(){this.container.removeEventListener("pointermove",this.onMoveHandler),this.container.removeEventListener("pointerleave",this.onLeaveHandler)}}return RevealButton})(),theme.Animation=(function(){class Animation{constructor(container){this.container=container}get immediate(){return this.container.hasAttribute("data-immediate")}get media(){return Array.from(this.container.querySelectorAll("img, iframe, svg, g-map"))}get type(){return this.container.hasAttribute("data-animate")?this.container.getAttribute("data-animate"):"fade-up"}get delay(){return this.container.hasAttribute("data-animate-delay")?parseInt(this.container.getAttribute("data-animate-delay"))/1e3:0}get paused(){return this.container.hasAttribute("paused")}beforeLoad(){if(!(this.type==="none"||this.paused))switch(this.type){case"fade-in":Motion.animate(this.container,{opacity:0},{duration:0});break;case"fade-up":Motion.animate(this.container,{transform:"translateY(min(2rem, 90%))",opacity:0},{duration:0});break;case"fade-up-large":Motion.animate(this.container,{transform:"translateY(90%)",opacity:0},{duration:0});break;case"zoom-out":Motion.animate(this.container,{transform:"scale(1.3)"},{duration:0});break}}async load(){if(!(this.type==="none"||this.paused)){switch(this.type){case"fade-in":await Motion.animate(this.container,{opacity:1},{duration:1.5,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"fade-up":await Motion.animate(this.container,{transform:"translateY(0)",opacity:1},{duration:1.5,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"fade-up-large":await Motion.animate(this.container,{transform:"translateY(0)",opacity:1},{duration:1,delay:this.delay,easing:[.16,1,.3,1]}).finished;break;case"zoom-out":await Motion.animate(this.container,{transform:"scale(1)"},{duration:1.3,delay:this.delay,easing:[.16,1,.3,1]}).finished;break}this.container.classList.add("animated")}}async reset(duration){if(this.type!=="none"){switch(this.type){case"fade-in":await Motion.animate(this.container,{opacity:0},{duration:duration||1.5,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"fade-up":await Motion.animate(this.container,{transform:"translateY(max(-2rem, -90%))",opacity:0},{duration:duration||1.5,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"fade-up-large":await Motion.animate(this.container,{transform:"translateY(-90%)",opacity:0},{duration:duration||1,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"zoom-out":await Motion.animate(this.container,{transform:"scale(0)"},{duration:duration||1.3,delay:this.delay,easing:duration?"none":[.16,1,.3,1]}).finished;break}this.container.classList.remove("animated")}}reload(){this.type!=="none"&&(this.container.removeAttribute("paused"),this.beforeLoad(),this.load())}unload(){}}return Animation})(),theme.Carousel=(function(){class Carousel{constructor(container,options,navigation){this.container=container,this.options=options,this.prevButton=navigation.previous,this.nextButton=navigation.next}load(){this.slider=new Flickity(this.container,this.options),this.onPrevButtonClickHandler=this.onPrevButtonClick.bind(this),this.onNextButtonClickHandler=this.onNextButtonClick.bind(this),this.prevButton.addEventListener("click",this.onPrevButtonClickHandler),this.nextButton.addEventListener("click",this.onNextButtonClickHandler),this.slider.on("dragStart",this.onDragStartHandler.bind(this)),this.slider.on("select",this.onSelectHandler.bind(this))}onDragStartHandler(){this.prevRemoveTransform(),this.nextRemoveTransform()}onSelectHandler(){this.slider.slides[this.slider.selectedIndex-1]?this.slider.slides[this.slider.selectedIndex+1]?(this.prevButton.disabled=!1,this.nextButton.disabled=!1):(this.prevButton.disabled=!1,this.nextButton.disabled=!0):(this.prevButton.disabled=!0,this.nextButton.disabled=!1)}onPrevButtonClick(event){event.preventDefault(),this.slider.previous(),this.nextRemoveTransform()}onNextButtonClick(event){event.preventDefault(),this.slider.next(),this.prevRemoveTransform()}prevRemoveTransform(){this.prevButton.style.transform=null,this.prevButton.querySelector("[data-fill]").style.transform=null}nextRemoveTransform(){this.nextButton.style.transform=null,this.nextButton.querySelector("[data-fill]").style.transform=null}unload(){this.slider&&this.slider.destroy(),this.prevButton?.removeEventListener("click",this.onPrevButtonClickHandler),this.nextButton?.removeEventListener("click",this.onNextButtonClickHandler)}}return Carousel})(),theme.initWhenVisible=class{#triggered=!1;#timeoutId=null;#callback;#handle;#events=["click","mousemove","keydown","touchstart","touchmove","wheel"];constructor(callback,delay=5e3){typeof callback=="function"&&(this.#callback=callback,this.#handle=this.#onInteraction.bind(this),this.#events.forEac
12h(eventType=>{window.addEventListener(eventType,this.#handle,{passive:!0})}),this.#timeoutId=setTimeout(()=>{this.#onInteraction({type:"timeout"})},delay))}#onInteraction(event){this.#triggered||(this.#triggered=!0,this.#callback(event),this.#cleanup())}#cleanup(){this.#events.forEach(eventType=>{window.removeEventListener(eventType,this.#handle)}),clearTimeout(this.#timeoutId),this.#timeoutId=null,this.#callback=null}};{const revealEvents=["click","mousemove","keydown","touchstart","touchmove","wheel"],reveal=()=>{revealEvents.forEach(type=>window.removeEventListener(type,reveal));const run=()=>document.body.removeAttribute("data-page-rendering");"requestIdleCallback"in window?requestIdleCallback(run,{timeout:1e3}):setTimeout(run,0)};revealEvents.forEach(type=>window.addEventListener(type,reveal,{passive:!0}))}theme.windowWidth=window.innerWidth,window.addEventListener("resize",()=>{const{innerWidth}=window;innerWidth!==theme.windowWidth&&(theme.windowWidth=innerWidth,document.dispatchEvent(new CustomEvent("window:resize")))}),theme.DOMready(theme.headerGroup.init),theme.DOMready(theme.utils.externalLinksNewTab),theme.config.hasSessionStorage=theme.isStorageSupported("session"),theme.config.hasLocalStorage=theme.isStorageSupported("local");const mql=window.matchMedia(theme.config.mediaQuerySmall);theme.config.mqlSmall=mql.matches,mql.onchange=mql2=>{mql2.matches?(theme.config.mqlSmall=!0,document.dispatchEvent(new CustomEvent("matchSmall"))):(theme.config.mqlSmall=!1,document.dispatchEvent(new CustomEvent("unmatchSmall")))},window.addEventListener("DOMContentLoaded",()=>{document.body.classList.add("loaded"),document.dispatchEvent(new CustomEvent("page:loaded"))}),window.addEventListener("pageshow",event=>{event.persisted&&document.body.classList.remove("unloading")}),window.addEventListener("beforeunload",()=>{document.body.classList.add("unloading")})})(),new theme.initWhenVisible(()=>{var e=!1,t;document.body.addEventListener("touchstart",function(i){if(!i.target.closest(".flickity-slider"))return e=!1;e=!0,t={x:i.touches[0].pageX,y:i.touches[0].pageY}},theme.supportsPassive?{passive:!0}:!1),document.body.addEventListener("touchmove",function(i){if(e&&i.cancelable){var n={x:i.touches[0].pageX-t.x,y:i.touches[0].pageY-t.y};Math.abs(n.x)>Flickity.defaults.dragThreshold&&i.preventDefault()}},theme.supportsPassive?{passive:!1}:!1)});const BaseElementMixin=Base=>class extends Base{connectedCallback(){this.eventsController??=new AbortController}disconnectedCallback(){if(this.eventsController?.abort(),this.eventsController=null,this._cleanups)for(;this._cleanups.length;)try{this._cleanups.pop()()}catch(error){console.error("[BaseElement] cleanup failed",error)}}on(target,type,handler,options={}){return this.eventsController??=new AbortController,target.addEventListener(type,handler,{...options,signal:this.eventsController.signal}),handler}registerCleanup(teardown){return typeof teardown=="function"&&(this._cleanups??=[]).push(teardown),teardown}};class BaseElement extends BaseElementMixin(HTMLElement){}class LoadingBar extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(document,"page:loaded",()=>{Motion.animate(this,{opacity:0},{duration:1}).finished.then(()=>{this.hidden=!0})})}}customElements.define("loading-bar",LoadingBar);class MouseCursor extends BaseElement{connectedCallback(){if(super.connectedCallback(),theme.config.isTouch)return;this.config={posX:0,posY:0};const onMouseMove=theme.utils.throttle(event=>{this.config.posX+=(event.clientX-this.config.posX)/4,this.config.posY+=(event.clientY-this.config.posY)/4,this.style.setProperty("--x",`${this.config.posX}px`),this.style.setProperty("--y",`${this.config.posY}px`)});this.on(document,"mousemove",onMouseMove,{passive:!0}),this.registerCleanup(()=>onMouseMove.cancel())}}customElements.define("mouse-cursor",MouseCursor);class CustomHeader extends BaseElement{get allowTransparent(){return!!document.querySelector(".shopify-section:first-child [allow-transparent-header]")}get headerSection(){return document.querySelector(".header-section")}connectedCallback(){if(super.connectedCallback(),this.init(),window.ResizeObserver){const resizeObserver=new ResizeObserver(this.setHeight.bind(this));resizeObserver.observe(this),this.registerCleanup(()=>resizeObserver.disconnect())}if(Shopify.designMode){const section=this.closest(".shopify-section");this.on(section,"shopify:section:load",this.init.bind(this)),this.on(section,"shopify:section:unload",this.init.bind(this)),this.on(section,"shopify:section:reorder",this.init.bind(this))}}init(){this.setHeight(),this.allowTransparent?(this.headerSection.classList.add("header-transparent"),this.headerSection.classList.add("no-animate"),setTimeout(()=>{this.headerSection.classList.remove("no-animate")},500)):this.headerSection.classList.remove("header-transparent")}setHeight(){requestAnimationFrame(()=>{document.documentElement.style.setProperty("--header-height",this.getBoundingClientRect().height.toFixed(1)+"px"),this.classList.contains("header--center")&&document.documentElement.style.getPropertyValue("--header-nav-height").length===0&&document.documentElement.style.setProperty("--header-nav-height",Math.round(document.getElementById("MenuToggle")?.clientHeight)+"px")})}}customElements.define("custom-header",CustomHeader,{extends:"header"});class StickyHeader extends CustomHeader{constructor(){super(),this.isScrolled=!1,this.buffer=10}get isAlwaysSticky(){return this.getAttribute("data-sticky-type")==="always"}connectedCallback(){super.connectedCallback(),this.currentScrollTop=0,this.firstScrollTop=window.scrollY,this.initialHeaderHeight=this.getBoundingClientRect().height,this.headerBounds=this.headerSection.getBoundingClientRect(),this.on(this.headerSection,"transitionend",event=>{(event.propertyName==="padding-block-end"||event.propertyName==="padding-bottom")&&this.updateStickyHeight()}),this.beforeInit()}beforeInit(){this.headerSection.classList.add("header-sticky"),this.headerSection.setAttribute("data-sticky-type",this.getAttribute("data-sticky-type")),this.isAlwaysSticky&&this.headerSection.classList.add("header-sticky");const onScroll=theme.utils.throttle(this.onScrollHandler.bind(this));this.on(window,"scroll",onScroll,{passive:!0}),this.registerCleanup(()=>onScroll.cancel())}updateStickyHeight(){this.isScrolled&&document.documentElement.style.setProperty("--sticky-header-height",this.getBoundingClientRect().height.toFixed(1)+"px")}onScrollHandler(){const scrollTop=window.scrollY,scrollThreshold=this.headerBounds.top+this.firstScrollTop+this.initialHeaderHeight,scrollThresholdNav=this.headerBounds.top+this.firstScrollTop+this.initialHeaderHeight*2,scrollDownThreshold=scrollThreshold+this.buffer,scrollUpThreshold=scrollThreshold-this.buffer;!this.isScrolled&&scrollTop>scrollDownThreshold?(this.isScrolled=!0,this.headerSection.classList.add("header-scrolled"),document.dispatchEvent(new CustomEvent("header:scrolled",{bubbles:!0,detail:{scrolled:!0}}))):this.isScrolled&&scrollTop<scrollUpThreshold&&(this.isScrolled=!1,this.headerSection.classList.remove("header-scrolled"),this.headerSection.classList.remove("header-nav-scrolled"),document.dispatchEvent(new CustomEvent("header:scrolled",{bubbles:!0,detail:{scrolled:!1}}))),this.isScrolled&&scrollTop>scrollThresholdNav&&(this.headerSection.classList.add("header-nav-scrolled"),this.headerSection.querySelectorAll("details").forEach(detail
12s=>{details.hasAttribute("open")&&(details.open=!1)})),scrollTop>this.headerBounds.bottom+this.firstScrollTop+100?scrollTop>this.currentScrollTop?this.headerSection.classList.add("header-hidden"):this.headerSection.classList.remove("header-hidden"):this.headerSection.classList.remove("header-hidden"),this.currentScrollTop=scrollTop}}customElements.define("sticky-header",StickyHeader,{extends:"header"});class RevealLink extends HTMLAnchorElement{constructor(){super(),this.revealButton=new theme.RevealButton(this),this.revealButton.load()}}customElements.define("reveal-link",RevealLink,{extends:"a"});class HoverLink extends BaseElementMixin(HTMLAnchorElement){constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load()}}customElements.define("hover-link",HoverLink,{extends:"a"});class MagnetLink extends HoverLink{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-link",MagnetLink,{extends:"a"});class HoverButton extends BaseElementMixin(HTMLButtonElement){constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load(),Motion.inView(this,this.init.bind(this))}connectedCallback(){super.connectedCallback(),this.type==="submit"&&this.form&&this.on(this.form,"submit",()=>this.setAttribute("aria-busy","true")),this.on(window,"pageshow",()=>this.removeAttribute("aria-busy"))}static get observedAttributes(){return["aria-busy"]}get contentElement(){return this._contentElement=this._contentElement||this.querySelector(".btn-text")}get animationElement(){return this._animationElement=this._animationElement||document.createRange().createContextualFragment(`
13 <span class="btn-loader"> 14 <span></span> 15 <span></span> 16 <span></span> 17 </span> 18 `).firstElementChild}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}init(){this.append(this.animationElement)}async attributeChangedCallback(name,oldValue,newValue){newValue==="true"?(Motion.timeline([[this.contentElement,{opacity:0},{duration:.15}],[this.animationElement,{opacity:1},{duration:.15}]]),this.loaderAnimation=Motion.animate(this.animationElement.children,{transform:["scale(1.6)","scale(0.6)"]},{duration:.35,delay:Motion.stagger(.35/2),direction:"alternate",repeat:1/0})):(this.loaderAnimation?.stop(),this.loaderAnimation=null,Motion.timeline([[this.animationElement,{opacity:0},{duration:.15}],[this.contentElement,{opacity:1},{duration:.15}]]))}}customElements.define("hover-button",HoverButton,{extends:"button"});class MagnetButton extends HoverButton{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-button",MagnetButton,{extends:"button"});class HoverElement extends HTMLElement{constructor(){super(),this.hoverButton=new theme.HoverButton(this),this.hoverButton.load()}}customElements.define("hover-element",HoverElement);class MagnetElement extends HoverElement{constructor(){super(),this.magnetButton=new theme.MagnetButton(this),this.magnetButton.load()}}customElements.define("magnet-element",MagnetElement);class AnimateElement extends HTMLElement{constructor(){super(),this.loadPromise=new Promise(resolve=>{this.resolveLoad=resolve})}connectedCallback(){if(theme.config.motionReduced){this.resolveLoad();return}if(this.animation=new theme.Animation(this),this.animation.beforeLoad(),this.animation.paused){this.resolveLoad();return}Motion.inView(this,async()=>{!this.immediate&&this.media&&await theme.utils.imageLoaded(this.media),setTimeout(this.resolveLoad,500),await this.animation.load(),this.parentElement.classList.add("animated")})}reset(){this.animation?.reset()}refresh(){this.animation?.reload()}}customElements.define("animate-element",AnimateElement);class AnimatePicture extends HTMLPictureElement{connectedCallback(){theme.config.motionReduced||(this.animation=new theme.Animation(this),this.animation.beforeLoad(),Motion.inView(this,async()=>{!this.immediate&&this.media&&await theme.utils.imageLoaded(this.media),await this.animation.load()}))}}customElements.define("animate-picture",AnimatePicture,{extends:"picture"});class AnnouncementBar extends BaseElement{constructor(){super(),this.selectedIndex=this.selectedIndex,!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"}):new theme.initWhenVisible(this.init.bind(this))}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get items(){return this._items=this._items||Array.from(this.children)}get autoplay(){return this.hasAttribute("autoplay")}get speed(){return this.hasAttribute("autoplay")?parseInt(this.getAttribute("autoplay-speed"))*1e3:5e3}init(){this.initialized||(this.initialized=!0,this.items.length>1&&(this.slider=new Flickity(this,{accessibility:!1,fade:!0,pageDots:!1,prevNextButtons:!1,wrapAround:!0,rightToLeft:theme.config.rtl,autoPlay:this.autoplay?this.speed:!1,on:{ready:function(){setTimeout(()=>this.element.setAttribute("loaded",""))}}}),this.slider.on("change",this.onChange.bind(this)),this.bindEvents()))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}bindEvents(){this.slider&&(this.on(this,"slider:previous",()=>this.slider.previous()),this.on(this,"slider:next",()=>this.slider.next()),this.on(this,"slider:play",()=>this.slider.playPlayer()),this.on(this,"slider:pause",()=>this.slider.pausePlayer()),Shopify.designMode&&this.on(this,"shopify:block:select",event=>this.slider.select(this.items.indexOf(event.target))))}disconnectedCallback(){super.disconnectedCallback(),this.slider&&this.slider.destroy()}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const focusableEvents="button, [href]",fromElement=this.items[parseInt(oldValue)],toElement=this.items[parseInt(newValue)];
18fromElement.querySelectorAll(focusableEvents).forEach(el=>{el.setAttribute("tabindex","-1")}),toElement.querySelectorAll(focusableEvents).forEach(el=>{el.removeAttribute("tabindex")})}}onChange(){this.selectedIndex=this.slider.selectedIndex,this.dispatchEvent(new CustomEvent("slider:change",{bubbles:!0,detail:{currentPage:this.slider.selectedIndex}}))}}customElements.define("announcement-bar",AnnouncementBar);class AccordionsDetails extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(this,"toggle",this.onToggle)}get items(){return this._items=this._items||Array.from(this.querySelectorAll('details[is="accordion-details"]'))}onToggle(event){const{current:target,open}=event.detail;if(this.items.forEach(item=>{item!==target&&item.close()}),open){let headerHeight=0;!theme.config.mqlSmall&&document.querySelector("header.header")&&(headerHeight=Math.round(document.querySelector("header.header").clientHeight)),setTimeout(()=>{window.scrollTo({top:target.getBoundingClientRect().top+window.scrollY-headerHeight,behavior:theme.config.motionReduced?"auto":"smooth"})},250)}}}customElements.define("accordions-details",AccordionsDetails);class AccordionDetails extends BaseElementMixin(HTMLDetailsElement){constructor(){super(),this._open=this.hasAttribute("open"),this.summaryElement=this.querySelector("summary"),this.contentElement=this.querySelector("summary + *"),this.setAttribute("aria-expanded",this._open?"true":"false")}connectedCallback(){super.connectedCallback(),this.on(this.summaryElement,"click",this.onSummaryClick.bind(this)),Shopify.designMode&&(this.on(this,"shopify:block:select",()=>{this.designModeActive&&(this.open=!0)}),this.on(this,"shopify:block:deselect",()=>{this.designModeActive&&(this.open=!1)}))}get designModeActive(){return!0}get controlledElement(){return this.closest("accordions-details")}static get observedAttributes(){return["open"]}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.setAttribute("aria-expanded",newValue===""?"true":"false")}get open(){return this._open}set open(value){value!==this._open&&(this._open=value,this.isConnected?this.transition(value):value?this.setAttribute("open",""):this.removeAttribute("open")),this.setAttribute("aria-expanded",value?"true":"false"),this.dispatchEventHandler()}onSummaryClick(event){event.preventDefault(),this.open=!this.open}close(){this._open=!1,this.transition(!1)}async transition(value){this.style.overflow="hidden",value?(this.setAttribute("open",""),await Motion.timeline([[this,{height:[`${this.summaryElement.clientHeight}px`,`${this.scrollHeight}px`]},{duration:.25,easing:"ease"}],[this.contentElement,{opacity:[0,1],transform:["translateY(10px)","translateY(0)"]},{duration:.15,at:"-0.1"}]]).finished):(await Motion.timeline([[this.contentElement,{opacity:0},{duration:.15}],[this,{height:[`${this.clientHeight}px`,`${this.summaryElement.clientHeight}px`]},{duration:.25,at:"<",easing:"ease"}]]).finished,this.removeAttribute("open")),this.style.height="auto",this.style.overflow="visible"}dispatchEventHandler(){(this.controlledElement??this).dispatchEvent(new CustomEvent("toggle",{bubbles:!0,detail:{current:this,open:this.open}}))}}customElements.define("accordion-details",AccordionDetails,{extends:"details"});class FooterDetails extends AccordionDetails{connectedCallback(){super.connectedCallback(),this.load(),this.on(document,"matchSmall",this.load.bind(this)),this.on(document,"unmatchSmall",this.load.bind(this))}get designModeActive(){return theme.config.mqlSmall}get openDefault(){return this.hasAttribute("data-opened")}load(){!theme.config.mqlSmall||this.openDefault?this.open=!0:this.open&&!this.openDefault&&(this.open=!1)}}customElements.define("footer-details",FooterDetails,{extends:"details"});class GestureElement extends BaseElement{constructor(){super(),this.config={thresholdY:Math.max(25,Math.floor(.15*window.innerHeight)),velocityThreshold:10,disregardVelocityThresholdY:Math.floor(.5*this.clientHeight),pressThreshold:8,diagonalSwipes:!1,diagonalLimit:Math.tan(45*1.5/180*Math.PI),longPressTime:500},Motion.inView(this,this.init.bind(this))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.on(this,"touchstart",this.onTouchStart.bind(this),theme.supportsPassive?{passive:!0}:!1),this.on(this,"touchmove",this.onTouchMove.bind(this),theme.supportsPassive?{passive:!0}:!1),this.on(this,"touchend",this.onTouchEnd.bind(this),theme.supportsPassive?{passive:!0}:!1))}fire(type,event){this.dispatchEvent(new CustomEvent(`gesture:${type}`,{detail:{originalEvent:event}}))}onTouchStart(event){this.thresholdY=this.config.thresholdY,this.disregardVelocityThresholdY=this.config.disregardVelocityThresholdY,this.touchStartY=event.changedTouches[0].screenY,this.touchMoveY=null,this.touchEndY=null,this.swipingDirection=null,this.longPressTimer=setTimeout(()=>this.fire("longpress",event),this.config.longPressTime),this.fire("panstart",event)}onTouchMove(event){const touchMoveY=event.changedTouches[0].screenY-(this.touchStartY??0);this.velocityY=touchMoveY-(this.touchMoveY??0),this.touchMoveY=touchMoveY;const absTouchMoveY=Math.abs(this.touchMoveY);this.swipingVertical=absTouchMoveY>this.thresholdY,this.swipingDirection=this.swipingVertical?"vertical":"pre-vertical",absTouchMoveY>this.config.pressThreshold&&clearTimeout(this.longPressTimer??void 0),this.fire("panmove",event)}onTouchEnd(event){this.touchEndY=event.changedTouches[0].screenY,this.fire("panend",event),clearTimeout(this.longPressTimer??void 0);const y=this.touchEndY-(this.touchStartY??0),absY=Math.abs(y);absY>this.thresholdY&&(this.swipedVertical=this.config.diagonalSwipes?y<=this.config.diagonalLimit:absY>this.thresholdY,this.swipedVertical&&(y<0?((this.velocityY??0)<-this.config.velocityThreshold||y<-this.disregardVelocityThresholdY)&&this.fire("swipeup",event):((this.velocityY??0)>this.config.velocityThreshold||y>this.disregardVelocityThresholdY)&&this.fire("swipedown",event)))}}customElements.define("gesture-element",GestureElement);class OverlayElement extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(this,"mousemove",this.onMouseMove),this.on(this,"mouseleave",this.onMouseLeave),this.on(this,"mousedown",this.onMouseDown),this.on(this,"mouseup",this.onMouseUp)}
18get cursor(){return document.querySelector("mouse-cursor")}onMouseMove(){this.cursor.classList.add("active"),this.cursor.setAttribute("aria-hidden","false")}onMouseLeave(){this.cursor.classList.remove("active"),this.cursor.setAttribute("aria-hidden","true")}onMouseDown(){this.cursor.classList.add("pressed")}onMouseUp(){this.cursor.classList.remove("pressed")}}customElements.define("overlay-element",OverlayElement);const lockLayerCount=new WeakMap;class ModalElement extends BaseElement{constructor(){super(),this.events={afterHide:"modal:afterHide",afterShow:"modal:afterShow",closeAll:"modal:closeAll"},this.classes={open:"has-modal-open",opening:"has-modal-opening"}}static get observedAttributes(){return["id","open"]}get shouldLock(){return!1}get shouldAppendToBody(){return!1}get shouldCloseAll(){return!1}get open(){return this.hasAttribute("open")}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get overlay(){return this._overlay=this._overlay||this.querySelector(".fixed-modal")}get gesture(){return this._gesture=this._gesture||this.querySelector("gesture-element")}get designMode(){return this.hasAttribute("shopify-design-mode")}get focusElement(){return this.querySelector("gesture-element")||this.querySelector("button")}connectedCallback(){if(super.connectedCallback(),this.controls.forEach(button=>this.on(button,"click",this.onButtonClick.bind(this))),this.on(document,"keyup",event=>event.code==="Escape"&&this.hide()),this.on(document,this.events.closeAll,()=>this.hide()),this.gesture&&(this.gestureConfig={animationFrame:null,moveY:0,maxGestureDistance:0,endPoint:0,layerHeight:null},this.gestureWrap=this.gesture.parentElement,setTimeout(()=>{this.on(this.gesture,"gesture:panstart",this.onPanStart.bind(this)),this.on(this.gesture,"gesture:panmove",this.onPanMove.bind(this)),this.on(this.gesture,"gesture:panend",this.onPanEnd.bind(this))},75)),Shopify.designMode&&this.designMode){const section=this.closest(".shopify-section");this.on(section,"shopify:section:select",event=>this.show(null,!event.detail.load)),this.on(section,"shopify:section:deselect",this.hide.bind(this))}}disconnectedCallback(){super.disconnectedCallback(),Shopify.designMode&&document.body.classList.remove(this.classes.open)}attributeChangedCallback(name,oldValue,newValue){name==="open"&&(this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true")),oldValue===null&&(newValue===""||newValue==="immediate")?(this.hidden=!1,this.removeAttribute("inert"),this.originalParentBeforeAppend=null,this.shouldAppendToBody&&this.parentElement!==document.body&&(this.originalParentBeforeAppend=this.parentElement,document.body.append(this)),(this.showTransition(newValue!=="immediate")||Promise.resolve()).then(()=>{this.afterShow(),this.dispatchEvent(new CustomEvent(this.events.afterShow,{bubbles:!0}))})):oldValue!==null&&newValue===null&&(this.setAttribute("inert",""),(this.hideTransition()||Promise.resolve()).then(()=>{this.afterHide(),this.hasAttribute("inert")&&(this.parentElement===document.body&&this.originalParentBeforeAppend&&(this.originalParentBeforeAppend.appendChild(this),this.originalParentBeforeAppend=null),this.dispatchEvent(new CustomEvent(this.events.afterHide,{bubbles:!0})),this.hidden=!0)})),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0})))}onButtonClick(event){event.preventDefault(),this.open?this.hide():this.show(event.currentTarget)}hide(){if(this.open)return this.beforeHide(),this.resetGesture(),this.removeAttribute("open"),theme.utils.waitForEvent(this,this.events.afterHide)}show(activeElement=null,animate=!0){if(!this.open)return this.shouldCloseAll&&document.dispatchEvent(new CustomEvent(this.events.closeAll),{bubbles:!0}),this.beforeShow(),this.activeElement=activeElement,this.setAttribute("open",animate?"":"immediate"),this.shouldLock&&document.body.classList.add(this.classes.opening),theme.utils.waitForEvent(this,this.events.afterShow)}beforeHide(){}beforeShow(){}afterHide(){setTimeout(()=>{theme.a11y.removeTrapFocus(this.activeElement),this.shouldLock&&(lockLayerCount.set(Mo
18dalElement,lockLayerCount.get(ModalElement)-1),document.body.classList.toggle(this.classes.open,lockLayerCount.get(ModalElement)>0))})}afterShow(){theme.a11y.trapFocus(this,this.focusElement),this.shouldLock&&(lockLayerCount.set(ModalElement,lockLayerCount.get(ModalElement)+1),document.body.classList.remove(this.classes.opening),document.body.classList.add(this.classes.open))}showTransition(){return setTimeout(()=>{this.setAttribute("active","")},75),new Promise(resolve=>{const computedStyle=window.getComputedStyle(this.overlay);if(!(computedStyle.transitionProperty!=="none"&&parseFloat(computedStyle.transitionDuration)>0)){resolve();return}this.overlay.addEventListener("transitionend",resolve,{once:!0})})}hideTransition(){return this.removeAttribute("active"),new Promise(resolve=>{const computedStyle=window.getComputedStyle(this.overlay);if(!(computedStyle.transitionProperty!=="none"&&parseFloat(computedStyle.transitionDuration)>0)){resolve();return}this.overlay.addEventListener("transitionend",resolve,{once:!0})})}resetGesture(){this.gesture&&(this.gestureWrap.style.transform="",this.gestureWrap.style.transition="",this.overlay.style.opacity="",this.overlay.style.transition="")}onPanStart(){this.removeTransition(this.gestureWrap,"transform"),this.hasAttribute("open")&&(this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.maxGestureDistance=this.gestureConfig.layerHeight-50,this.gestureConfig.endPoint=this.gestureConfig.layerHeight*.3)}onPanMove(){this.gestureConfig.animationFrame||(this.gestureConfig.animationFrame=requestAnimationFrame(()=>{const clamp=(a,min=0,max=1)=>Math.min(max,Math.max(min,a)),invlerp=(x,y,a)=>clamp((a-x)/(y-x));this.gestureWrap.style.transition="transform .1s linear",this.overlay.style.transition="opacity .1s linear",this.hasAttribute("open")&&(this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.moveY=this.gesture.touchMoveY,this.gestureConfig.maxGestureDistance=this.gestureConfig.layerHeight-50,this.gestureConfig.moveY>=0?(this.gestureWrap.style.transform=`translateY(${Math.min(this.gestureConfig.moveY,this.gestureConfig.maxGestureDistance)}px)`,this.overlay.style.opacity=invlerp(this.gestureConfig.layerHeight,0,this.gestureConfig.moveY)):(this.gestureWrap.style.transform="translateY(0)",this.gestureWrap.style.transition="",this.overlay.style.opacity="1")),this.gestureConfig.animationFrame=null}))}onPanEnd(){this.gestureConfig.animationFrame===null||cancelAnimationFrame(this.gestureConfig.animationFrame),this.gestureConfig.animationFrame=null,this.gestureWrap.style.transition="transform .1s linear",this.gestureConfig.layerHeight===null&&(this.gestureConfig.layerHeight=this.gestureWrap.getBoundingClientRect().height),this.gestureConfig.endPoint=this.gestureConfig.layerHeight*.3,this.hasAttribute("open")&&(this.gestureConfig.moveY=this.gesture.touchMoveY,this.gestureConfig.moveY<this.gestureConfig.endPoint?this.gestureWrap.style.transform="translateY(0)":(this.gestureWrap.style.transform=`translateY(${this.gestureConfig.layerHeight}px)`,this.gestureWrap.addEventListener(this.whichTransitionEvent(),()=>{this.hide()},{once:!0})))}removeTransition(node,transition){const match=node.style.transition.match(new RegExp("(?:^|,)\\s*"+transition+"(?:$|\\s|,)[^,]*","i"));if(match){const transitionArray=node.style.transition.split("");transitionArray.splice(match.index,match[0].length),node.style.transition=transitionArray.join("")}}whichTransitionEvent(){let t;const el=document.createElement("fakeelement"),transitions={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",MSTransition:"msTransitionEnd",OTransition:"oTransitionEnd",transition:"transitionEnd"};for(t in transitions)if(el.style[t]!==void 0)return transitions[t]}}customElements.define("modal-element",ModalElement),lockLayerCount.set(ModalElement,0);class DrawerElement extends ModalElement{constructor(){super(),this.events={afterHide:"drawer:afterHide",afterShow:"drawer:afterShow"}}get shouldLock(){return!0}get shouldAppendToBody(){return!0}}customElements.define("drawer-element",DrawerElement);class MenuDrawer extends DrawerElement{get menuItems(){return this._menuItems=this._menuItems||this.querySelectorAll(".drawer__menu:not(.active)>li")}beforeShow(){super.beforeShow(),setTimeout(()=>{Motion.animate(this.menuItems,{transform:["translateX(-20px)","translateX(0)"],opacity:[0,1]},{duration:.6,easing:[.075,.82,.165,1],delay:Motion.stagger(.1)}).finished.then(()=>
18{this.menuItems.forEach(item=>item.removeAttribute("style"))})},300)}beforeHide(){super.beforeHide(),setTimeout(()=>{this.querySelectorAll("details[is=menu-details]").forEach(subMenu=>{subMenu.onCloseButtonClick()})},300)}}customElements.define("menu-drawer",MenuDrawer);class ShareDrawer extends DrawerElement{get menuItems(){return this._menuItems=this._menuItems||this.querySelectorAll(".share-buttons>li")}get urlToShare(){const urlInput=this.querySelector("input[type=hidden]");return urlInput?urlInput.value:document.location.href}connectedCallback(){navigator.share?this.controls.forEach(button=>this.on(button,"click",this.shareTo.bind(this))):super.connectedCallback()}async shareTo(event){event.preventDefault();try{await navigator.share({url:this.urlToShare,title:document.title})}catch(error){error.name!=="AbortError"&&console.error(error)}}beforeShow(){super.beforeShow(),setTimeout(()=>{Motion.animate(this.menuItems,{transform:["translateY(2.5rem)","translateY(0)"],opacity:[0,1]},{duration:.6,easing:[.075,.82,.165,1],delay:Motion.stagger(.1)}).finished.then(()=>{this.menuItems.forEach(item=>item.removeAttribute("style"))})},300)}}customElements.define("share-drawer",ShareDrawer);class BackInStockDrawer extends DrawerElement{constructor(){super(),!theme.config.isTouch||Shopify.designMode?this.init():new theme.initWhenVisible(this.init.bind(this))}get submited(){return this.querySelector(".alert")!==null}init(){this.initialized||(this.initialized=!0,this.submited&&setTimeout(()=>{this.show()},1e3))}}customElements.define("back-in-stock-drawer",BackInStockDrawer);class MenuDetails extends BaseElementMixin(HTMLDetailsElement){connectedCallback(){super.connectedCallback(),this.on(this.summary,"click",this.onSummaryClick.bind(this)),this.on(this.closeButton,"click",this.onCloseButtonClick.bind(this))}get parent(){return this.closest("[data-parent]")}get summary(){return this.querySelector("summary")}get closeButton(){return this.querySelector("[data-close]")}get focusElement(){return this.summary.nextElementSibling.querySelector("button")}onSummaryClick(event){event.preventDefault(),this.setAttribute("open",""),this.activeElement=event.currentTarget,setTimeout(()=>{this.parent.classList.add("active"),this.classList.add("active"),this.summary.setAttribute("aria-expanded",!0),this.summary.setAttribute("tabindex","-1"),setTimeout(()=>{theme.a11y.trapFocus(this,this.focusElement)},100)},100)}onCloseButtonClick(){this.parent.classList.remove("active"),this.classList.remove("active"),this.summary.setAttribute("aria-expanded",!1),this.summary.removeAttribute("tabindex"),this.closeAnimation()}closeAnimation(){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?requestAnimationFrame(handleAnimation):(this.removeAttribute("open"),theme.a11y.removeTrapFocus(this.activeElement))};requestAnimationFrame(handleAnimation)}}customElements.define("menu-details",MenuDetails,{extends:"details"});class QuantityLabel extends HTMLLabelElement{connectedCallback(){this.querySelector(".quantity__rules-cart").append(this.animationElement)}static get observedAttributes(){return["aria-busy"]}get contentElement(){return this._contentElement=this._contentElement||this.querySelector(".quantity-cart")}get animationElement(){return this._animationElement=this._animationElement||document.createRange().createContextualFragment(`
19 <span class="btn-loader"> 20 <span></span> 21 <span></span> 22 <span></span> 23 </span> 24 `).firstElementChild}async attributeChangedCallback(name,oldValue,newValue){newValue==="true"?(Motion.timeline([[this.contentElement,{opacity:0},{duration:.15}],[this.animationElement,{opacity:1},{duration:.15}]]),this.loaderAnimation=Motion.animate(this.animationElement.children,{transform:["scale(1.6)","scale(0.6)"]},{duration:.35,delay:Motion.stagger(.35/2),direction:"alternate",repeat:1/0})):(this.loaderAnimation?.stop(),this.loaderAnimation=null,Motion.timeline([[this.animationElement,{opacity:0},{duration:.15}],[this.contentElement,{opacity:1},{duration:.15}]]))}}customElements.define("quantity-label",QuantityLabel,{extends:"label"});class QuantityInput extends BaseElement{get sectionId(){return this.getAttribute("data-section-id")}get productId(){return this.getAttribute("data-product-id")}get input(){return this.querySelector("input")}get value(){return this.input.value}connectedCallback(){super.connectedCallback(),this.buttons=Array.from(this.querySelectorAll("button")),this.changeEvent=ne
24w Event("change",{bubbles:!0}),this.on(this.input,"change",this.onInputChange.bind(this)),this.on(this.input,"focus",()=>setTimeout(()=>this.input.select())),this.buttons.forEach(button=>this.on(button,"click",this.onButtonClick.bind(this))),this.validateQtyRules();const quantityUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this));this.registerCleanup(quantityUpdateUnsubscriber);const quantityBoundriesUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.quantityBoundries,this.setQuantityBoundries.bind(this));this.registerCleanup(quantityBoundriesUnsubscriber);const quantityRulesUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.quantityRules,this.updateQuantityRules.bind(this));this.registerCleanup(quantityRulesUnsubscriber)}onButtonClick(event){if(event.preventDefault(),this.input.disabled)return;const previousValue=this.input.value;event.currentTarget.name==="plus"?parseInt(this.input.getAttribute("data-min"))>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.getAttribute("data-min"):this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.getAttribute("data-min")===previousValue&&event.currentTarget.name==="minus"&&(this.input.value=parseInt(this.input.min))}onInputChange(){this.input.value===""&&(this.input.value=parseInt(this.input.min)),this.validateQtyRules()}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min){const buttonMinus=this.querySelector('button[name="minus"]');buttonMinus&&buttonMinus.toggleAttribute("disabled",parseInt(value)<=parseInt(this.input.min))}if(this.input.max){const buttonPlus=this.querySelector('button[name="plus"]');buttonPlus&&buttonPlus.toggleAttribute("disabled",parseInt(value)>=parseInt(this.input.max))}}updateQuantityRules({data:{sectionId,productId,parsedHTML}}){if(sectionId!==this.sectionId||productId!==this.productId)return;const selectors=[".quantity__input",".quantity__rules",".quantity__label"],quantityFormUpdated=parsedHTML.getElementById(`QuantityForm-${sectionId}-${this.productId}`),quantityForm=this.closest(`#QuantityForm-${sectionId}-${this.productId}`);for(let selector of selectors){const current=quantityForm.querySelector(selector),updated=quantityFormUpdated.querySelector(selector);if(!(!current||!updated))if(selector===".quantity__input"){const attributes=["data-cart-quantity","data-min","data-max","step"];for(let attribute of attributes){const valueUpdated=updated.getAttribute(attribute);valueUpdated!==null?current.setAttribute(attribute,valueUpdated):current.removeAttribute(attribute)}}else current.innerHTML=updated.innerHTML}}setQuantityBoundries({data:{sectionId,productId}}){if(sectionId!==this.sectionId||productId!==this.productId)return;const data={cartQuantity:this.input.hasAttribute("data-cart-quantity")?parseInt(this.input.getAttribute("data-cart-quantity")):0,min:this.input.hasAttribute("data-min")?parseInt(this.input.getAttribute("data-min")):1,max:this.input.hasAttribute("data-max")?parseInt(this.input.getAttribute("data-max")):null,step:this.input.hasAttribute("step")?parseInt(this.input.getAttribute("step")):1};let min=data.min;const max=data.max===null?data.max:data.max-data.cartQuantity;max!==null&&(min=Math.min(min,max)),data.cartQuantity>=data.min&&(min=Math.min(min,data.step)),this.input.min=min,max?this.input.max=max:this.input.removeAttribute("max"),this.input.value=min,theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.quantityUpdate,void 0)}reset(){this.input.value=this.input.defaultValue}}customElements.define("quantity-input",QuantityInput);class CartCount extends BaseElement{connectedCallback(){super.connectedCallback();const cartUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.onCartUpdate.bind(this));this.registerCleanup(cartUpdateUnsubscriber)}get itemCount(){return parseInt(this.innerText)}onCartUpdate(event){event.cart.errors||(this.innerText=event.cart.item_count,this.hidden=this.itemCount===0)}}customElements.define("cart-count",CartCount);class RecentlyViewed extends HTMLElement{constructor(){if(super(),!theme.config.hasLocalStorage){this.hidden=!0;return}Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}init(){fetch(this.getAttribute("data-url")+this.getQueryString()).then(response=>response.text()).then(responseText=>{const recommendations=new DOMParser().parseFromString(responseText,"text/html").querySelector(".shopify-section").querySelector("recently-viewed");recommendations&&recommendations.innerHTML.trim().length?(this.innerHTML=recommendations.innerHTML,this.dispatchEvent(new CustomEvent("recentlyViewed:loaded"))):(this.closest(".recently-section")?.remove(),this.dispatchEvent(new CustomEvent("is-empty")))}).catch(e=>{console.error(e)})}getQueryString(){let recentlyViewed="[]";theme.config.hasLocalStorage&&(recentlyViewed=window.localStorage.getItem(`${theme.settings.themeName}:recently-viewed`)||"[]");const items=new Set(JSON.parse(recentlyViewed));return this.hasAttribute("data-product-id")&&items.delete(parseInt(this.getAttribute("data-product-id"))),Array.from(items.values(),item=>`id:${item}`).slice(0,this.hasAttribute("data-limit")?parseInt(this.getAttribute("data-limit")):4).join(" OR ")}}customElements.define("recently-viewed",RecentlyViewed);class ProductRecommendations extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}init(){fetch(this.getAttribute("data-url")).then(response=>response.text()).then(responseText=>{const sectionInnerHTML=new DOMParser().parseFromString(responseText,"text/html").querySelector(".shopify-section");if(sectionInnerHTML===null)return;const recommendations=sectionInnerHTML.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length?(this.innerHTML=recommendations.innerHTML,this.dispatchEvent(new CustomEvent("recommendations:loaded"))):(this.setAttribute("hidden",""),this.closest(".recommendations-section")?.remove(),this.dispatchEvent(new CustomEvent("is-empty")))}).catch(e=>{console.error(e)})}}customElements.define("product-recommendations",ProductRecommendations);class ProductComplementary extends HTMLElement{constructor(){super(),this.selectedIndex=this.selectedIndex}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get items(){return this._items=this._items||Array.from(this.children)}get container(){return this.closest("product-recommendations")}get prevButton(){return this.container.querySelector("[data-prev-button]")}get nextButton(){return this.container.querySelector("[data-next-button]")}connectedCallback(){this.innerHTML.trim().length?this.classList.contains("flickity")&&(this.carousel=new theme.Carousel(this,{accessibility:!1,prevNextButtons:!1,adaptiveHeight:!0,pageDots:!1,contain:!0,cellAlign:"center",rightToLeft:theme.config.rtl},{previous:this.prevButton,next:this.nextButton}),this.carousel.load(),this.carousel.slider.on("change",this.onChange.bind(this))):this.container.hidden=!0}disconnectedCallback(){this.carousel&&this.carousel.unload()}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const focusableEvents="button, [href]",fromElement=this.items[parseInt(oldValue)],toElement=this.items[parseInt(newValue)];
24fromElement.querySelectorAll(focusableEvents).forEach(el=>{el.setAttribute("tabindex","-1")}),toElement.querySelectorAll(focusableEvents).forEach(el=>{el.removeAttribute("tabindex")})}}onChange(){this.selectedIndex=this.carousel.slider.selectedIndex}}customElements.define("product-complementary",ProductComplementary);class MediaElement extends BaseElement{get parallax(){return this.hasAttribute("data-parallax")?parseFloat(this.getAttribute("data-parallax")):!1}get direction(){return this.hasAttribute("data-parallax-dir")?this.getAttribute("data-parallax-dir"):"vertical"}get media(){return Array.from(this.querySelectorAll("picture>img, video, iframe, svg, video-media, g-map"))}connectedCallback(){super.connectedCallback(),!(theme.config.motionReduced||!this.parallax)&&this.setupParallax()}setupParallax(){const[scale,translate]=[1+this.parallax,this.parallax*100/(1+this.parallax)];if(this.direction==="vertical"){const cancelParallax=Motion.scroll(Motion.animate(this.media,{transform:[`scale(${scale}) translateY(0)`,`scale(${scale}) translateY(${translate}%)`],transformOrigin:["bottom","bottom"]},{easing:"linear"}),{target:this,offset:["start end","end start"]});this.registerCleanup(cancelParallax)}else if(this.direction==="horizontal"){const cancelParallax=Motion.scroll(Motion.animate(this.media,{transform:[`scale(${scale}) translateX(0)`,`scale(${scale}) translateX(${translate}%)`],transformOrigin:["right","right"]},{easing:"linear"}),{target:this,offset:["start end","end start"]});this.registerCleanup(cancelParallax)}else{const cancelParallax=Motion.scroll(Motion.animate(this.media,{transform:["scale(1)",`scale(${scale})`],transformOrigin:["center","center"]},{easing:"linear"}),{target:this,offset:["start end","end start"]});this.registerCleanup(cancelParallax)}}}customElements.define("media-element",MediaElement);class SplitWords extends HTMLElement{constructor(){super(),this.loadPromise=new Promise(resolve=>{this.resolveLoad=resolve})}connectedCallback(){if(theme.config.motionReduced){this.resolveLoad();return}document.body.hasAttribute("data-title-animation")&&this.init()}
24async init(){Splitting({target:this,by:"words"})[0].words.forEach((item,index)=>{const wrapper=document.createElement("animate-element");wrapper.className="block",wrapper.setAttribute("data-animate",this.getAttribute("data-animate")),wrapper.setAttribute("data-animate-delay",(this.hasAttribute("data-animate-delay")?parseInt(this.getAttribute("data-animate-delay")):0)+index*30);for(const itemContent of item.childNodes)wrapper.appendChild(itemContent);item.appendChild(wrapper)}),this.classList.remove("js-invisible");const animateElements=this.querySelectorAll("animate-element");await Promise.all([...animateElements].map(el=>el.loadPromise)),this.resolveLoad()}}customElements.define("split-words",SplitWords);class HighlightedText extends HTMLElement{constructor(){super(),Motion.inView(this,this.init.bind(this))}get splitWords(){return this.closest("split-words")}async init(){this.splitWords&&await this.splitWords.loadPromise,this.classList.add("animated")}}customElements.define("highlighted-text",HighlightedText,{extends:"em"});class MarqueeElement extends BaseElement{constructor(){super(),!theme.config.motionReduced&&(!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"}):new theme.initWhenVisible(this.init.bind(this)))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}get childElement(){return this.firstElementChild}get speed(){return this.hasAttribute("data-speed")?parseInt(this.getAttribute("data-speed")):16}get maximum(){return this.hasAttribute("data-maximum")?parseInt(this.getAttribute("data-maximum")):this.childElementWidth>0?Math.ceil(this.parentWidth/this.childElementWidth)+2:0}get direction(){return this.hasAttribute("data-direction")?this.getAttribute("data-direction"):"left"}get parallax(){return!theme.config.isTouch&&this.hasAttribute("data-parallax")?parseFloat(this.getAttribute("data-parallax")):!1}get parentWidth(){return this.getWidth(this)}get childElementWidth(){return this.getWidth(this.childElement)}init(){if(!this.initialized){if(this.initialized=!0,this.childElementCount===1){this.childElement.classList.add("animated");const maximum=this.maximum;for(let index=0;index<maximum;index++)this.clone=this.childElement.cloneNode(!0),this.clone.setAttribute("aria-hidden","true"),this.clone.querySelectorAll("button, [href]").forEach(el=>{el.setAttribute("tabindex","-1")}),this.appendChild(this.clone),this.clone.querySelectorAll(".media").forEach(media=>media.classList.remove("loading"));this.style.setProperty("--duration",`${(33-this.speed)*Math.min(2.5,Math.ceil(this.childElementWidth/this.parentWidth))}s`)}if(this.parallax){let translate=this.parallax*100/(1+this.parallax);this.direction==="right"&&(translate=translate*-1),theme.config.rtl&&(translate=translate*-1);const cancelParallax=Motion.scroll(Motion.animate(this,{transform:[`translateX(${translate}%)`,"translateX(0)"]},{easing:"linear"}),{target:this,offset:["start end","end start"]});this.registerCleanup(cancelParallax)}else{const observer=new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.classList.remove("paused"):this.classList.add("paused")})},{rootMargin:"0px 0px 50px 0px"});observer.observe(this),this.registerCleanup(()=>observer.disconnect())}}}getWidth(element){const rect=element.getBoundingClientRect();return rect.right-rect.left}}customElements.define("marquee-element",MarqueeElement);class ScrolledImages extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get parallax(){return this.hasAttribute("data-parallax")?parseFloat(this.getAttribute("data-parallax")):!1}get template(){return this.querySelector("template")}get images(){return Array.from(this.template.content.querySelectorAll(".scrolled-images__item"))}init(){this.beforeInit(),!(theme.config.motionReduced||!this.parallax)&&this.setupParallax()}beforeInit(){const main=this.querySelector(".scrolled-images__main");for(let i=0;i<3;i++){let images=this.shuffle(this.images);if(images.length<8){let start=0;for(;images.length<8;)images.push(images[start].cloneNode(!0)),start++}const row=document.createElement("div");
24row.classList="scrolled-images__row",images.forEach(item=>row.appendChild(item.cloneNode(!0))),main.appendChild(row)}}setupParallax(){Array.from(this.querySelectorAll(".scrolled-images__row")).forEach((element,index)=>{let translate=-1*this.parallax*100/(1+this.parallax);if(theme.config.rtl&&(translate=translate*-1),index%2===0){const cancelParallax=Motion.scroll(Motion.animate(element,{transform:[`translateX(${translate}%)`,"translateX(0)"]},{easing:"linear"}),{target:this,offset:Motion.ScrollOffset.Any});this.registerCleanup(cancelParallax)}else{const cancelParallax=Motion.scroll(Motion.animate(element,{transform:["translateX(0)",`translateX(${translate}%)`]},{easing:"linear"}),{target:this,offset:Motion.ScrollOffset.Any});this.registerCleanup(cancelParallax)}})}shuffle(arr){return arr.sort(()=>Math.random()-.5)}}customElements.define("scrolled-images",ScrolledImages);class DropdownElement extends BaseElement{constructor(){super(),this.classes={bodyClass:"has-dropdown"},this.events={afterHide:"dropdown:afterHide",afterShow:"dropdown:afterShow"},this.detectHoverListener=this.detectHover.bind(this),this.controls.forEach(button=>{this.on(button,"click",this.onToggleClicked.bind(this)),this.on(button,"mouseenter",this.detectHoverListener),this.on(button,"mouseleave",this.detectHoverListener)}),this.detectClickOutsideListener=this.detectClickOutside.bind(this),this.detectEscKeyboardListener=this.detectEscKeyboard.bind(this),this.detectFocusOutListener=this.detectFocusOut.bind(this)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keyup",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),document.body.classList.remove(this.classes.bodyClass)}static get observedAttributes(){return["id","open"]}get open(){return this.hasAttribute("open")}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get container(){return this.querySelector("*:first-child")}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true"))}show(){return document.body.classList.add(this.classes.bodyClass),this.setAttribute("open",""),document.addEventListener("click",this.detectClickOutsideListener),document.addEventListener("keyup",this.detectEscKeyboardListener),document.addEventListener("focusout",this.detectFocusOutListener),this.afterShow(),theme.utils.waitForEvent(this,this.events.afterShow)}hide(){return document.body.classList.remove(this.classes.bodyClass),this.removeAttribute("open"),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keyup",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),this.afterHide(),theme.utils.waitForEvent(this,this.events.afterHide)}onToggleClicked(event){event?.preventDefault(),this.open?this.hide():this.show()}afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:["translateY(-105%)","translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]}),Motion.animate(this.container,{transform:"translateY(-105%)"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}detectClickOutside(event){this.parentElement.contains(event.target)||this.hide()}detectEscKeyboard(event){event.code==="Escape"&&this.hide()}detectFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&this.hide()}detectHover(event){theme.config.isTouch||(event.type==="mouseenter"?this.show():this.hide())}}customElements.define("dropdown-element",DropdownElement);class DropdownLocalization extends DropdownElement{afterShow(){Motion.animate(this,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]})}afterHide(){Motion.animate(this,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]})}}customElements.define("dropdown-localization",DropdownLocalization);const lockDropdownCount=new WeakMap;class DetailsDropdown extends BaseElementMixin(HTMLDetailsElement){constructor(){super(),this.classes={bodyClass:"has-dropdown-menu"},this.events={afterHide:"menu:afterHide",afterShow:"menu:afterShow"},this._open=this.hasAttribute("open"),this.detectClickOutsideListener=this.detectClickOutside.bind(this),this.detectEscKeyboardListener=this.detectEscKeyboard.bind(this),this.detectFocusOutListener=this.detectFocusOut.bind(this),this.hoverTimer=null,this.detectHoverListener=this.detectHover.bind(this)}connectedCallback(){super.connectedCallback(),this.on(this.summaryElement,"click",this.onSummaryClicked.bind(this)),this.on(this,"mouseenter",this.detectHoverListener),this.on(this,"mouseleave",this.detectHoverListener)}disconnectedCallback(){super.disconnectedCallback(),this._open&&(document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keyup",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),lockDropdownCount.set(DetailsDropdown,lockDropdownCount.get(DetailsDropdown)-1),document.body.classList.toggle(this.classes.bodyClass,lockDropdownCount.get(DetailsDropdown)>0))}set open(value){value!==this._open&&(this._open=value,this.isConnected?this.transition(value):(value?this.setAttribute("open",""):this.removeAttribute("open"),this.updateAriaExpanded(value)))}get summaryElement(){return this.firstElementChild}get contentElement(){return this.lastElementChild}get open(){return this._open}get trigger(){return this.hasAttribute("trigger")?this.getAttribute("trigger"):"click"}get level(){return this.hasAttribute("level")?this.getAttribute("level"):"top"}
24get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}onSummaryClicked(event){event.preventDefault(),!theme.config.isTouch&&this.trigger==="hover"&&this.summaryElement.hasAttribute("data-link")&&this.summaryElement.getAttribute("data-link").length>0?window.location.href=this.summaryElement.getAttribute("data-link"):this.open=!this.open}async transition(value){return this.updateAriaExpanded(value),value?(lockDropdownCount.set(DetailsDropdown,lockDropdownCount.get(DetailsDropdown)+1),document.body.classList.add(this.classes.bodyClass),this.setAttribute("open",""),this.summaryElement.setAttribute("open",""),theme.config.motionReduced?this.contentElement.setAttribute("open",""):setTimeout(()=>this.contentElement.setAttribute("open",""),100),document.addEventListener("click",this.detectClickOutsideListener),document.addEventListener("keyup",this.detectEscKeyboardListener),document.addEventListener("focusout",this.detectFocusOutListener),await this.transitionIn(),this.shouldReverse(),theme.utils.waitForEvent(this,this.events.afterShow)):(lockDropdownCount.set(DetailsDropdown,lockDropdownCount.get(DetailsDropdown)-1),document.body.classList.toggle(this.classes.bodyClass,lockDropdownCount.get(DetailsDropdown)>0),this.summaryElement.removeAttribute("open"),this.contentElement.removeAttribute("open"),document.removeEventListener("click",this.detectClickOutsideListener),document.removeEventListener("keyup",this.detectEscKeyboardListener),document.removeEventListener("focusout",this.detectFocusOutListener),await this.transitionOut(),this.open||this.removeAttribute("open"),theme.utils.waitForEvent(this,this.events.afterHide))}async transitionIn(){Motion.animate(this.contentElement,{opacity:[0,1],visibility:"visible"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1],delay:theme.config.motionReduced?0:.2});const translateY=this.level==="top"?"-105%":"2rem";return Motion.animate(this.contentElement.firstElementChild,{transform:[`translateY(${translateY})`,"translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}async transitionOut(){Motion.animate(this.contentElement,{opacity:0,visibility:"hidden"},{duration:theme.config.motionReduced?0:.3,easing:[.7,0,.2,1]});const translateY=this.level==="top"?"-105%":"2rem";return Motion.animate(this.contentElement.firstElementChild,{transform:`translateY(${translateY})`},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}detectClickOutside(event){!this.contains(event.target)&&!(event.target.closest("details")instanceof DetailsDropdown)&&(this.open=!1)}detectEscKeyboard(event){if(event.code==="Escape"){const targetMenu=event.target.closest("details[open]");targetMenu&&(targetMenu.open=!1)}}detectFocusOut(event){event.relatedTarget&&!this.contains(event.relatedTarget)&&(this.open=!1)}detectHover(event){this.trigger!=="hover"||theme.config.isTouch||(event.type==="mouseenter"?this.open=!0:this.open=!1)}shouldReverse(){this.contentElement.offsetLeft+this.contentElement.clientWidth*2>window.innerWidth&&this.contentElement.classList.add("should-reverse")}updateAriaExpanded(isOpen){this.summaryElement.setAttribute("aria-expanded",isOpen?"true":"false")}}customElements.define("details-dropdown",DetailsDropdown,{extends:"details"}),lockDropdownCount.set(DetailsDropdown,0);class DetailsMega extends DetailsDropdown{connectedCallback(){super.connectedCallback(),Shopify.designMode&&(this.on(this,"shopify:block:select",()=>this.open=!0),this.on(this,"shopify:block:deselect",()=>this.open=!1))}disconnectedCallback(){super.disconnectedCallback(),this._open&&document.body.classList.remove("with-mega")}async transitionIn(){return this.contentElement.querySelector("tabs-element")?.unload(),setTimeout(()=>{this.contentElement.querySelector("tabs-element")?.load()},theme.config.motionReduced?0:450),document.body.classList.add("with-mega"),Motion.animate(this.contentElement.firstElementChild,{visibility:"visible",transform:["translateY(-105%)","translateY(0)"]},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}async transitionOut(){return document.body.classList.remove("with-mega"),Motion.animate(this.contentElement.firstElementChild,{visibility:"hidden",transform:"translateY(-105%)"},{duration:theme.config.motionReduced?0:.6,easing:[.7,0,.2,1]}).finished}}customElements.define("details-mega",DetailsMega,{extends:"details"});class LocalizationListbox extends BaseElementMixin(HTMLFormElement){connectedCallback(){super.connectedCallback(),this.items.forEac
24h(item=>this.on(item,"click",this.onItemClick.bind(this)))}get items(){return this._items=this._items||Array.from(this.querySelectorAll("a"))}get input(){return this.querySelector('input[name="locale_code"], input[name="country_code"]')}get returnTo(){return this.querySelector('input[name="return_to"]')}onItemClick(event){event.preventDefault(),this.input.value=event.currentTarget.getAttribute("data-value"),this.returnTo.value=window.location.pathname,this.submit()}}customElements.define("localization-listbox",LocalizationListbox,{extends:"form"});class LocalizationForm extends BaseElementMixin(HTMLFormElement){constructor(){super(),!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this)):new theme.initWhenVisible(this.init.bind(this))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.on(this,"change",this.submit))}}customElements.define("localization-form",LocalizationForm,{extends:"form"});const cachedSectionsRenderingAPI=new Map;class APIButton extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this))}get sectionId(){return this.getAttribute("data-section-id")}get sectionRenderingId(){return this.getAttribute("data-id")}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){if(this.initialized||(this.initialized=!0,document.getElementById(this.sectionRenderingId)===null||document.getElementById(this.sectionRenderingId).hasAttribute("loaded")))return;const url=`${theme.routes.root_url}?section_id=${this.sectionId}`;cachedSectionsRenderingAPI.has(url)?this.renderSectionFromCache(url):this.renderSectionFromFetch(url),this.sectionsRenderingAPIListener=this.afterSectionsRenderingAPI.bind(this),this.on(document,"sectionsRenderingAPI:cached",this.sectionsRenderingAPIListener)}renderSectionFromCache(url){const responseText=cachedSectionsRenderingAPI.get(url);responseText.length&&this.updateSectionRendering(responseText)}renderSectionFromFetch(url){cachedSectionsRenderingAPI.set(url,""),fetch(url).then(response=>response.text()).then(responseText=>{this.updateSectionRendering(responseText),cachedSectionsRenderingAPI.set(url,responseText),document.dispatchEvent(new CustomEvent("sectionsRenderingAPI:cached",{detail:{url,sectionId:this.sectionId}}))}).catch(e=>{console.error(e)})}updateSectionRendering(responseText){const parsedHTML=new DOMParser().parseFromString(responseText,"text/html");document.getElementById(this.sectionRenderingId).replaceWith(parsedHTML.getElementById(this.sectionRenderingId)),document.removeEventListener("sectionsRenderingAPI:cached",this.sectionsRenderingAPIListener)}afterSectionsRenderingAPI(event){event.detail.sectionId===this.sectionId&&this.renderSectionFromCache(event.detail.url)}}customElements.define("api-button",APIButton);class StickyElement extends BaseElement{constructor(){super(),this.endScroll=window.innerHeight-this.offsetHeight-500,this.currPos=window.scrollY,this.screenHeight=window.innerHeight,this.stickyElementHeight=this.offsetHeight,this.bottomGap=this.offsetHeight<window.innerHeight?this.topGap:0,this.ticking=!1}connectedCallback(){super.connectedCallback(),this.on(window,"scroll",this.onScrollHandler.bind(this),{capture:!0,passive:!0})}get headerHeight(){let header=document.querySelector('.header-section header[is="sticky-header"]');return this.hasAttribute("aria-controls")&&(header=document.getElementById(this.getAttribute("aria-controls"))),header?header.getBoundingClientRect().height+this.topGap:this.offsetHeight<window.innerHeight?this.topGap:0}get topGap(){return this.hasAttribute("data-gap")?parseInt(this.getAttribute("data-gap")):20}get inset(){return parseFloat(this.style.getPropertyValue("--inset"))||0}onScrollHandler(){this.ticking||(requestAnimationFrame(()=>{window.getComputedStyle(this).position=="sticky"&&(this.screenHeight=window.innerHeight,this.stickyElementHeight=this.offsetHeight,this.positionStickySidebar()),this.ticking=!1}),this.ticking=!0)}positionStickySidebar(){this.endScroll=window.innerHeight-this.offsetHeight-this.bottomGap;const stickyElementTop=this.inset,scrollDelta=this.currPos-window.scrollY;if(this.stickyElementHeight+this.headerHeight+this.bottomGap>this.screenHeight){let newInset;
24window.scrollY<this.currPos?stickyElementTop<this.headerHeight?newInset=Math.min(stickyElementTop+scrollDelta,this.headerHeight):newInset=this.headerHeight:stickyElementTop>this.endScroll?newInset=Math.max(stickyElementTop+scrollDelta,this.endScroll):newInset=this.endScroll,Math.abs(newInset-stickyElementTop)>.5&&this.style.setProperty("--inset",`${newInset.toFixed(1)}px`)}else this.style.setProperty("--inset",`${this.headerHeight.toFixed(1)}px`);this.currPos=window.scrollY}}customElements.define("sticky-element",StickyElement);class ParallaxElement extends BaseElementMixin(HTMLDivElement){connectedCallback(){super.connectedCallback(),this.load(),this.on(document,"matchSmall",this.unload.bind(this)),this.on(document,"unmatchSmall",this.load.bind(this)),this.registerCleanup(()=>this.unload())}get mobileDisabled(){return!1}load(){theme.config.motionReduced||this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||this.motion()}motion(){this.cancelParallax=Motion.scroll(Motion.animate(this,{transform:[`translateY(${this.getAttribute("data-start")})`,`translateY(${this.getAttribute("data-stop")})`]}),{target:this,offset:Motion.ScrollOffset.Any})}unload(){this.cancelParallax&&(this.cancelParallax(),this.style.transform=null)}}customElements.define("parallax-element",ParallaxElement,{extends:"div"});class ParallaxOverlay extends BaseElement{connectedCallback(){super.connectedCallback(),this.load(),Shopify.designMode&&this.on(document,"shopify:section:unload",this.refresh.bind(this))}refresh(){let options={};options[this.getAttribute("data-target")]=this.getAttribute("data-stop"),Motion.animate(this,options,{duration:0})}load(){let options={};options[this.getAttribute("data-target")]=[this.getAttribute("data-start"),this.getAttribute("data-stop")];const cancelParallax=Motion.scroll(Motion.animate(this,options),{target:this.parentElement,offset:Motion.ScrollOffset.Enter});this.registerCleanup(cancelParallax)}}customElements.define("parallax-overlay",ParallaxOverlay);class FooterParallax extends ParallaxElement{connectedCallback(){super.connectedCallback(),Shopify.designMode&&this.on(document,"shopify:section:unload",this.refresh.bind(this))}get mobileDisabled(){return!0}motion(){this.cancelParallax=Motion.scroll(Motion.animate(this,{transform:["translateY(-50%)","translateY(0)"]}),{target:this,offset:Motion.ScrollOffset.Enter})}refresh(){theme.config.motionReduced||this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||setTimeout(()=>{Motion.animate(this,{transform:"translateY(0)"},{duration:0})})}}customElements.define("footer-parallax",FooterParallax,{extends:"div"});class FooterGroup extends BaseElement{connectedCallback(){super.connectedCallback(),this.init(),Shopify.designMode&&this.on(document,"shopify:section:load",this.init.bind(this))}get rounded(){return Array.from(this.querySelectorAll(".section--rounded"))}get sections(){return Array.from(this.querySelectorAll(".shopify-section"))}init(){this.sections.forEach((shopifySection,index)=>{const section=shopifySection.querySelector(".section");section&&(section.classList.remove("section--next-rounded"),section.style.zIndex=this.sections.length-index)}),this.rounded.forEach(section=>{let previousShopifySection=section.closest(".shopify-section").previousElementSibling;if(previousShopifySection===null&&(previousShopifySection=document.querySelector(".main-content .shopify-section:last-child")),previousShopifySection){const previousSection=previousShopifySection.querySelector(".section");previousSection&&previousSection.classList.add("section--next-rounded")}})}}customElements.define("footer-group",FooterGroup,{extends:"footer"});class CarouselElement extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get items(){return this._items=this._items||Array.from(this.children)}get watchCSS(){return this.hasAttribute("watch-css")}get initialIndex(){return parseInt(this.getAttribute("initial-index")||0)}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.items.length>1&&(this.carousel=new Flickity(this,{watchCSS:this.watchCSS,prevNextButtons:!1,adaptiveHeight:!0,wrapAround:!0,rightToLeft:theme.config.rtl,initialIndex:this.initialIndex}),this.carousel.on("change",this.onChange.bind(this)),this.bindEvents()))}bindEvents(){this.carousel&&(this.on(this,"control:select",event=>this.select(event.detail.index)),Shopify.designMode&&this.on(this,"shopify:block:select",event=>this.carousel.select(this.items.indexOf(event.target))))}disconnectedCallback(){super.disconnectedCallback(),this.carousel&&this.carousel.destroy()}select(index=0,immediate=!1){if(!immediate){const{selectedIndex,slides}=this.carousel;immediate=Math.abs(index-selectedIndex)>
243,index===0&&selectedIndex===slides.length-1&&(immediate=!1),index===slides.length-1&&selectedIndex===0&&(immediate=!1)}this.carousel.select(index,!1,immediate)}onChange(index){this.dispatchEvent(new CustomEvent("carousel:change",{bubbles:!0,detail:{index}}))}}customElements.define("carousel-element",CarouselElement);class TestimonialsElement extends CarouselElement{constructor(){super(),Motion.inView(this,()=>{setTimeout(()=>this.update(),600)})}update(){this.carousel&&this.carousel.select(0)}}customElements.define("testimonials-element",TestimonialsElement);class SecondaryMedia extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get template(){return this.previousElementSibling}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}disconnectedCallback(){super.disconnectedCallback(),this.carousel&&this.carousel.destroy()}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.hydrated||(this.hydrated=!0,this.appendChild(this.template.content.cloneNode(!0))),this.mediaCount=this.querySelectorAll(".media").length,this.items=Array.from(this.children),this.mediaCount>1&&(this.style.visibility="hidden",this.carousel=new Flickity(this,{accessibility:!1,draggable:!1,pageDots:!0,prevNextButtons:!1,wrapAround:!0,rightToLeft:theme.config.rtl,on:{ready:()=>{this.style.visibility="visible"}}}),this.mediaCount===2&&this.classList.add("without-dots"),this.carousel.on("change",this.onChange.bind(this)),this.bindEvents()))}bindEvents(){this.carousel&&(this.on(this,"mousemove",this.onMoveHandler),this.on(this,"mouseleave",this.onLeaveHandler))}onMoveHandler(event){if(this.mediaCount===2)return this.carousel.select(1);const{width}=this.carousel.size,mouseX=event.clientX-this.getBoundingClientRect().left;if(this.mediaCount===3)return mouseX<width/2?this.carousel.select(1):this.carousel.select(2);if(this.mediaCount===4)return mouseX<width/3?this.carousel.select(1):mouseX<2*width/3?this.carousel.select(2):this.carousel.select(3)}onLeaveHandler(){this.carousel.select(0)}onChange(){this.selectedIndex=this.carousel.selectedIndex}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const fromElement=this.items[parseInt(oldValue)],toElement=this.items[parseInt(newValue)];fromElement.tagName==="VIDEO-MEDIA"&&fromElement?.pause(),toElement.tagName==="VIDEO-MEDIA"&&toElement?.play()}}}customElements.define("secondary-media",SecondaryMedia);class MotionList extends HTMLElement{constructor(){super(),this.isMobile=theme.config.mqlSmall||theme.config.isTouch,this.motionReduced=theme.config.motionReduced||this.hasAttribute("motion-reduced"),!(this.motionReduced||this.initialized)&&(this.unload(),Motion.inView(this,this.load.bind(this)))}get items(){return Array.from(this.querySelectorAll(".card"))}get itemsToShow(){return Array.from(this.querySelectorAll(".card:not([style])"))}get initialized(){return this.hasAttribute("initialized")}getAnimationParams(){return{distance:this.isMobile?30:50,duration:this.motionReduced?.001:this.isMobile?.3:.5,staggerDelay:this.motionReduced?0:this.isMobile?.05:.1}}getVisibleItems(items){const viewportHeight=window.innerHeight+window.scrollY,visible=[],invisible=[];return items.forEach(item=>{const rect=item.getBoundingClientRect();rect.top<viewportHeight&&rect.bottom>0?visible.push(item):invisible.push(item)}),{visible,invisible}}unload(){const{distance}=this.getAnimationParams(),visibleItems=this.items;Motion.animate(visibleItems,{y:distance,opacity:0,visibility:"hidden"},{duration:0})}async load(){const{distance,duration,staggerDelay}=this.getAnimationParams(),{visible:visibleItems,invisible:inVisibleItems}=this.getVisibleItems(this.items);await Motion.animate(visibleItems,{y:[distance,0],opacity:[0,1],visibility:["hidden","visible"]},{duration,delay:Motion.stagger(staggerDelay)}).finished,Motion.animate(inVisibleItems,{y:[distance,0],opacity:[0,1],visibility:["hidden","visible"]},{duration}
24),this.items.forEach(item=>item.style.removeProperty("transform")),this.setAttribute("initialized","")}async reload(){const{distance,duration,staggerDelay}=this.getAnimationParams(),{visible:visibleItems,invisible:inVisibleItems}=this.getVisibleItems(this.itemsToShow);await Motion.animate(visibleItems,{y:[distance,0],opacity:[0,1],visibility:["hidden","visible"]},{duration,delay:Motion.stagger(staggerDelay)}).finished,Motion.animate(inVisibleItems,{y:[distance,0],opacity:[0,1],visibility:["hidden","visible"]},{duration}),this.items.forEach(item=>item.style.removeProperty("transform"))}}customElements.define("motion-list",MotionList);class LazyBackground extends HTMLElement{constructor(){super(),this.init()}get image(){const style=window.getComputedStyle(this);return style.backgroundImage?style.backgroundImage.slice(5,-2).replace("width=1","width=720"):!1}async init(){if(!this.image)return;const img=document.createElement("img");img.src=this.image,img.style.visibility="hidden",img.style.position="absolute",await theme.utils.imageLoaded(img),this.style.backgroundImage=`url(${this.image})`,img.remove()}}customElements.define("lazy-background",LazyBackground);class MenuToggle extends MagnetButton{connectedCallback(){super.connectedCallback(),this.on(this,"click",this.onClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get expanded(){return this.getAttribute("aria-expanded")==="true"}onClick(){this.setAttribute("aria-expanded",this.expanded?"false":"true"),this.controlledElement&&this.controlledElement.classList.toggle("active")}}customElements.define("menu-toggle",MenuToggle,{extends:"button"});class ScrollShadow extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this))}get template(){return this.querySelector("template")}connectedCallback(){super.connectedCallback(),this.initialized&&(this.bindEvents(),this.load())}init(){this.initialized||(this.initialized=!0,this.attachShadow({mode:"open"}),this.shadowRoot.appendChild(this.template.content.cloneNode(!0)),this.updater=new theme.scrollShadow.Updater(this.shadowRoot.children[1]),this.bindEvents(),this.load())}bindEvents(){this.on(this.shadowRoot,"slotchange",()=>this.load())}load(){this.updater.on(this.children[0])}disconnectedCallback(){super.disconnectedCallback(),this.updater?.on()}}customElements.define("scroll-shadow",ScrollShadow);class CustomSelect extends BaseElementMixin(HTMLSelectElement){connectedCallback(){super.connectedCallback(),this.onChange(),this.on(this,"change",this.onChange)}onChange(){this.value!==""||this.selectedIndex===-1?this.setAttribute("selected",""):this.removeAttribute("selected")}}customElements.define("custom-select",CustomSelect,{extends:"select"});let googleMapsPromise=null;class GMap extends HTMLElement{constructor(){super(),!(!this.hasAttribute("data-api-key")||!this.hasAttribute("data-map-address"))&&(Motion.inView(this,this.prepMapApi.bind(this),{margin:"600px 0px 600px 0px"}),window.gm_authFailure=()=>{Shopify.designMode&&window.mapError(theme.strings.authError)},window.mapError=(error,element)=>{const container=element?element.closest(".shopify-section"):document;container.querySelectorAll(".gmap--error").forEach(error2=>{error2.remove()}),container.querySelectorAll("g-map").forEach(map=>{const message=document.createElement("div");message.classList.add("rte","alert","alert--error","gmap--error"),message.innerHTML=error,map.closest(".with-map").prepend(message)})},window.gmNoop=()=>{})}prepMapApi(){this.loadScript().then(this.initMap.bind(this)).then(()=>{setTimeout(()=>{const container=this.closest(".banner__map");container&&container.previousElementSibling&&container.previousElementSibling.classList.remove("opacity-0")},1e3)})}loadScript(){return window.google?.maps?Promise.resolve():googleMapsPromise??=new Promise((resolve,reject)=>{const script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src=`https://maps.googleapis.com/maps/api/js?key=${this.getAttribute("data-api-key")}&callback=gmNoop`})}initMap(){new google.maps.Geocoder().geocode({address:this.getAttribute("data-map-address")},(results,status)=>{if(status!==google.maps.GeocoderStatus.OK){if(Shopify.designMode){let errorMessage;switch(status){case"ZERO_RESULTS":errorMessage=theme.strings.addressNoResults;break;case"OVER_QUERY_LIMIT":errorMessage=theme.strings.addressQueryLimit;break;case"REQUEST_DENIED":errorMessage=theme.strings.authError;break;default:errorMessage=theme.strings.addressError;break}window.mapError(errorMessage,this)}}else{const mapOptions={zoom:parseInt(this.getAttribute("data-zoom")),center:results[0].geometry.location,draggable:!0,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0},map=new google.maps.Map(this,mapOptions),center=map.getCenter();map.setCenter(center);const icon={path:"M22.6746 0C10.2174 0 0 8.79169 0 21.5118C0 31.2116 4.33864 38.333 9.26606 42.998C11.7232 45.3243 14.3387 47.0534 16.6674 48.2077C18.9384 49.3333 21.1148 50 22.6746 50C24.2345 50 26.4108 49.3333 28.6818 48.2077C31.0105 47.0534 33.626 45.3243 36.0832 42.998C41.0106 38.333 45.3492 31.2116 45.3492 21.5118C45.3492 8.79169 35.1318 0 22.6746 0ZM29.6514 22.6746C29.6514 26.5278 26.5278 29.6514 22.6746 29.6514C18.8214 29.6514 15.6978 26.5278 15.6978 22.6746C15.6978 18.8214 18.8214 15.6978 22.6746 15.6978C26.5278 15.6978 29.6514 18.8214 29.6514 22.6746Z",fillColor:this.getAttribute("data-marker-color"),fillOpacity:1,anchor:new google.maps.Point(15,55),strokeWeight:0,scale:.7};new google.maps.Marker({map,position:map.getCenter(),icon});const styledMapType=new google.maps.StyledMapType(JSON.parse(this.parentNode.querySelector("[data-gmap-style]").innerHTML));map.mapTypes.set("styled_map",styledMapType),map.setMapTypeId("styled_map")}})}}customElements.define("g-map",GMap);class GMapLocations extends BaseElementMixin(HTMLUListElement){connectedCallback(){super.connectedCallback(),this.selectedIndex=this.selectedIndex,this.buttons.forEach((button,index)=>this.on(button,"click",()=>this.selectedIndex=index)),Shopify.designMode&&this.on(this,"shopify:block:select",event=>this.selectedIndex=this.buttons.indexOf(event.target))}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.buttons.length-1).toString())}get buttons(){return this._buttons=this._buttons||Array.from(this.hasAttribute("selector")?this.querySelectorAll(this.getAttribute("selector")):this.children)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}attributeChangedCallback(name,oldValue,newValue){if(this.buttons.forEach((button,index)=>{button.classList.toggle("active",index===parseInt(newValue)),button.querySelector("[data-map-button]")?.classList.toggle("button--secondary",index!==parseInt(newValue))}),name==="selected-index"&&oldValue!==null&&oldValue!==newValue&&this.controlledElement){const button=this.buttons[parseInt(newValue)];this.controlledElement.setAttribute("data-map-address",button.getAttribute("data-map-address")),this.controlledElement.initMap()}}}customElements.define("g-map-locations",GMapLocations,{extends:"ul"});class PreviousButton extends HoverButton{connectedCallback(){super.connectedCallback(),this.load()}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}load(){this.onClickListener=this.onClick.bind(this),this.on(this,"click",this.onClickListener),this.controlledElement&&(this.updateStatusListener=this.updateStatus.bind(this),this.on(this.controlledElement,"slider:previousStatus",this.updateStatusListener))}unload(){this.removeEventListener("click",this.onClickListener),this.controlledElement&&this.controlledElement.removeEventListener("slider:previousStatus",this.updateStatusListener)}onClick(){(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:previous",{bubbles:!0,cancelable:!0}))}updateStatus(event){switch(event.detail.status){case"hidden":this.hidden=!0;break;case"disabled":this.disabled=!0;break;default:this.hidden=!1,this.disabled=!1}}}customElements.define("previous-button",PreviousButton,{extends:"button"});class NextButton extends HoverButton{connectedCallback(){super.connectedCallback(),this.load()}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}load(){this.onClickListener=this.onClick.bind(this),this.on(this,"click",this.onClickListener),this.controlledElement&&(this.updateStatusListener=this.updateStatus.bind(this),this.on(this.controlledElement,"slider:nextStatus",this.updateStatusListener))}unload(){this.removeEventListener("click",this.onClickListener),this.controlledElement&&this.controlledElement.removeEventListener("slider:nextStatus",this.updateStatusListener)}onClick(){(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:next",{bubbles:!0,cancelable:!0}))}updateStatus(event){switch(event.detail.status){case"hidden":this.hidden=!0;break;case"disabled":this.disabled=!0;break;default:this.hidden=!1,this.disabled=!1}}}customElements.define("next-button",NextButton,{extends:"button"});class SliderElement extends BaseElement{constructor(){super(),this.adjustHeight=this.adjustHeight.bind(this),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get looping(){return!1}get items(){return this._items=this._items||Array.from(this.hasAttribute("selector")?this.querySelectorAll(this.getAttribute("selector")):this.children)}get itemsToShow(){return Array.from(this.items).filter(element=>element.clientWidth>0)}get itemOffset(){return theme.config.rtl?this.itemsToShow.length>1?this.itemsToShow[0].offsetLeft-this.itemsToShow[1].offsetLeft:0:this.itemsToShow.length>1?this.itemsToShow[1].offsetLeft-this.itemsToShow[0].offsetLeft:0}get perPage(){let elementWidth=this.clientWidth;if(window.matchMedia("screen and (min-width: 1280px)").matches){const styles=window.getComputedStyle(this);elementWidth=this.clientWidth-parseFloat(styles.paddingLeft)-parseFloat(styles.paddingRight)}return Math.floor(elementWidth/this.itemOffset)}get isScrollable(){const style=window.getComputedStyle(this),hasScrollableOverflow=style.overflow==="scroll"||style.overflow==="auto"||style.overflowY==="scroll"||style.overflowY==="auto"||style.overflowX==="scroll"||style.overflowX==="auto",hasScrollableContent=this.scrollHeight>this.clientHeight||this.scrollWidth>this.clientWidth;return hasScrollableOverflow&&hasScrollableContent}get isSlider(){return this.scrollWidth>this.clientWidth+1}reset(){this._items=Array.from(this.hasAttribute("selector")?this.querySelectorAll(this.getAttribute("selector")):this.children)}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.hasPendingOnScroll=!1,this.currentPage=1,this.updateButtons(),this.updateTabindex(),this.on(this,"scroll",theme.utils.debounce(this.update.bind(this),50)),this.on(this,"scrollend",this.scrollend),this.on(this,"slider:previous",this.previous),this.on(this,"slider:next",this.next),this.on(document,"matchSmall",this.updateTabindex.bind(this)),this.on(document,"unmatchSmall",this.updateTabindex.bind(this)),this.hasAttribute("adaptive-height")&&(this.on(this,"slider:change",this.adjustHeight),this.on(window,"resize",theme.utils.debounce(this.adjustHeight,100)),this.adjustHeight()),Shopify.designMode&&this.on(this,"shopify:block:select",event=>event.target.scrollIntoView({behavior:"smooth"}
24)))}previous(){this.scrollPosition=this.scrollLeft-this.perPage*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition)}next(){this.scrollPosition=this.scrollLeft+this.perPage*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition)}select(selectedIndex,immediate=!1){this.scrollPosition=this.scrollLeft-(this.currentPage-selectedIndex)*this.itemOffset*(theme.config.rtl?-1:1),this.scrollToPosition(this.scrollPosition,immediate)}selected(selectedIndex){return this.itemsToShow[selectedIndex]}scrollend(){this.hasPendingOnScroll=!1,this.dispatchEventHandler()}update(){window.onscrollend===void 0&&clearTimeout(this.scrollendTimeout);const previousPage=this.currentPage;this.currentPage=Math.round(Math.abs(this.scrollLeft)/this.itemOffset)+1,this.currentPage!==previousPage&&(this.hasPendingOnScroll||this.dispatchEventHandler(),this.itemsToShow.forEach((sliderItem,index)=>{sliderItem.classList.toggle("selected",index+1===this.currentPage)})),window.onscrollend===void 0&&(this.scrollendTimeout=setTimeout(()=>{this.dispatchEvent(new CustomEvent("scrollend",{bubbles:!0,composed:!0}))},75)),!this.looping&&this.updateButtons()}updateButtons(){let previousDisabled=this.currentPage===1,nextDisabled=this.currentPage===this.itemsToShow.length;this.perPage>1&&(previousDisabled=previousDisabled||this.itemsToShow.length>0&&this.isVisible(this.itemsToShow[0])&&this.scrollLeft===0,nextDisabled=nextDisabled||this.itemsToShow.length>0&&this.isVisible(this.itemsToShow[this.itemsToShow.length-1])),this.dispatchEvent(new CustomEvent("slider:previousStatus",{bubbles:!0,detail:{status:previousDisabled?nextDisabled?"hidden":"disabled":"visible"}})),this.dispatchEvent(new CustomEvent("slider:nextStatus",{bubbles:!0,detail:{status:nextDisabled?previousDisabled?"hidden":"disabled":"visible"}}))}updateTabindex(){this.removeAttribute("tabindex"),this.isScrollable&&this.setAttribute("tabindex","0")}isVisible(element,offset=0){const lastVisibleSlide=this.clientWidth+this.scrollLeft-offset;return element.offsetLeft+element.clientWidth<=lastVisibleSlide&&element.offsetLeft>=this.scrollLeft}scrollToPosition(position,immediate=!1){this.hasPendingOnScroll=!immediate,this.scrollTo({left:position,behavior:immediate?"instant":theme.config.motionReduced?"auto":"smooth"})}dispatchEventHandler(){this.dispatchEvent(new CustomEvent("slider:change",{detail:{currentPage:this.currentPage,currentElement:this.itemsToShow[this.currentPage-1]}}))}adjustHeight(){if(!this.isSlider){this.style.maxHeight="";return}const currentElement=this.itemsToShow[this.currentPage-1];currentElement&¤tElement.clientHeight!==this.clientHeight&&(this.style.maxHeight=`${currentElement.clientHeight}px`)}}customElements.define("slider-element",SliderElement);class SliderDots extends BaseElement{constructor(){super(),new theme.initWhenVisible(this.init.bind(this))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return this._items=this._items||Array.from(this.children)}get itemsToShow(){return Array.from(this.items).filter(element=>element.clientWidth>0)}init(){this.initialized||(this.initialized=!0,this.controlledElement&&(this.on(this.controlledElement,"slider:change",this.onChange.bind(this)),this.items.forEach(item=>{this.on(item,"click",this.onButtonClick.bind(this))})))}reset(){this._items=Array.from(this.children)}onChange(event){this.transitionTo(parseInt(event.detail.currentPage)-1),this.itemsToShow.forEach(item=>{item.setAttribute("aria-current",parseInt(item.getAttribute("data-index"))===parseInt(event.detail.currentPage)?"true":"false")})}transitionTo(selectedIndex,immediate=!1){if(this.itemsToShow[selectedIndex]){const scrollElement=this.hasAttribute("align-selected")?this.closest(this.getAttribute("align-selected")):this;scrollElement?.scrollTo({left:this.itemsToShow[selectedIndex].offsetLeft-scrollElement.clientWidth/2+this.itemsToShow[selectedIndex].clientWidth/2,top:this.itemsToShow[selectedIndex].offsetTop-scrollElement.clientHeight/2-this.itemsToShow[selectedIndex].clientHeight/2,behavior:immediate?"instant":theme.config.motionReduced?"auto":"smooth"})}}onButtonClick(event){event.preventDefault();const target=event.currentTarget;this.itemsToShow.forEach(item=>{item.setAttribute("aria-current",item.getAttribute("data-index")===target.getAttribute("data-index")?"true":"false")}),this.controlledElement.select(parseInt(target.getAttribute("data-index")))}}
24customElements.define("slider-dots",SliderDots);class ProgressBar extends HTMLElement{constructor(){super(),!this.hasAttribute("style")&&Motion.inView(this,this.init.bind(this))}init(){this.style.setProperty("--progress",`${parseInt(this.getAttribute("data-value"))*.75*100/parseInt(this.getAttribute("data-max"))}%`)}}customElements.define("progress-bar",ProgressBar);const onYouTubePromise=new Promise(resolve=>{if(window.YT?.Player){resolve();return}const existingCallback=window.onYouTubeIframeAPIReady;window.onYouTubeIframeAPIReady=()=>{existingCallback?.(),resolve()}});class DeferredMedia extends BaseElement{connectedCallback(){if(super.connectedCallback(),this.posterElement&&this.on(this.posterElement,"click",this.onPosterClick.bind(this)),this.autoplay&&!this.autoplayArmed){const connection=navigator.connection;if(!(connection&&(connection.saveData||/2g/.test(connection.effectiveType||"")))){const arm=()=>{this.autoplayArmed||(this.autoplayArmed=!0,this.hasAttribute("data-inview-full")?new IntersectionObserver(entries=>{entries[entries.length-1].intersectionRatio>=.99?this.paused||this.play():this.pause()},{threshold:.99}).observe(this):Motion.inView(this,this.init.bind(this)))};document.readyState==="complete"?arm():this.on(window,"load",()=>{"requestIdleCallback"in window?requestIdleCallback(arm,{timeout:1e3}):setTimeout(arm,200)},{once:!0})}}}get posterElement(){return this.querySelector('[id^="DeferredPoster-"]')}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get autoplay(){return this.hasAttribute("autoplay")}get playing(){return this.hasAttribute("playing")}get player(){return this.playerProxy=this.playerProxy||new Proxy(this.playerTarget(),{get:(target,prop)=>async()=>{target=await target,this.playerHandler(target,prop)}})}static get observedAttributes(){return["playing"]}onPosterClick(event){event.preventDefault(),event.stopPropagation(),this.playing?(this.paused=!0,this.pause()):(this.paused=!1,this.play())}init(){return this.paused||this.play(),()=>{this.pause()}}play(){this.playing||this.player.play()}pause(){this.playing&&this.player.pause()}attributeChangedCallback(name,oldValue,newValue){if(name==="playing"){if(oldValue===null&&newValue==="")return this.dispatchEvent(new CustomEvent("video:play",{bubbles:!0}));if(newValue===null)return this.dispatchEvent(new CustomEvent("video:pause",{bubbles:!0}))}}}class VideoMedia extends DeferredMedia{playerTarget(){if(this.hasAttribute("host"))return this.setAttribute("loaded",""),this.closest(".media")?.classList.remove("loading"),new Promise(async resolve=>{const templateElement=this.querySelector("template");templateElement&&templateElement.replaceWith(templateElement.content.firstElementChild.cloneNode(!0));const muteVideo=this.hasAttribute("autoplay")||window.matchMedia("screen and (max-width: 1023px)").matches,script=document.createElement("script");if(script.type="text/javascript",this.getAttribute("host")==="youtube"){(!window.YT||!window.YT.Player)&&(script.src="https://www.youtube.com/iframe_api",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2})),await onYouTubePromise;const player=new YT.Player(this.querySelector("iframe"),{events:{onReady:()=>{muteVideo&&player.mute(),this._hostPlayer=player,resolve(player)},onStateChange:event=>{event.data===YT.PlayerState.PLAYING?this.setAttribute("playing",""):(event.data===YT.PlayerState.ENDED||event.data===YT.PlayerState.PAUSED)&&this.removeAttribute("playing")}}})}if(this.getAttribute("host")==="vimeo"){(!window.Vimeo||!window.Vimeo.Player)&&(script.src="https://player.vimeo.com/api/player.js",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2}));const player=new Vimeo.Player(this.querySelector("iframe"));muteVideo&&player.setMuted(!0),player.on("play",()=>{this.setAttribute("playing","")}),player.on("pause",()=>this.removeAttribute("playing")),player.on("ended",()=>this.removeAttribute("playing")),this._hostPlayer=player,resolve(player)}});{let video;const templateElement=this.querySelector("template");templateElement?(video=templateElement.content.firstElementChild.cloneNode(!0),video.addEventListener("loadedmetadata",()=>this.setLoadedState(),{once:!0}),templateElement.replaceWith(video)):video=this.querySelector("video"),video&&!templateElement&&(video.readyState>=1?this.setLoadedState():video.addEventListener("loadedmetadata",()=>this.setLoadedState(),{once:!0}));const player=video;return player?("requestVideoFrameCallback"in player?player.requestVideoFrameCallback(()=>this.setAttribute("rendered","")):player.addEventListener("canplay",()=>this.setAttribute("rendered",""),{once:!0}),player.addEventListener("play",()=>{this.setAttribute("playing",""),this.removeAttribute("suspended")}),player.addEventListener("pause",()=>{!player.seeking&&player.paused&&this.removeAttribute("playing")}),player.addEventListener("canplay",()=>{this.hasAttribute("autoplay")&&requestAnimationFrame(()=>{player.play().catch(error=>{if(error.name==="NotAllowedError"){this.setAttribute("suspended",""),this.setAttribute("rendered",""),player.controls=!0;const replacementImageSrc=player.previousElementSibling?.currentSrc;replacementImageSrc&&(player.poster=replacementImageSrc)}})})},{once:!0}),player):void 0}}playerHandler(target,prop){this.getAttribute("host")==="youtube"?target&&target.playVideo&&(prop==="play"?target.playVideo():target.pauseVideo()):prop==="play"&&!this.hasAttribute("host")?target.play().catch(error=>{if(error.name==="NotAllowedError"){this.setAttribute("suspended",""),this.setAttribute("rendered",""),target.controls=!0;const replacementImageSrc=target.previousElementSibling?.currentSrc;replacementImageSrc&&(target.poster=replacementImageSrc)}}):target[prop]()}setLoadedState(){this.setAttribute("loaded",""),this.closest(".media")?.classList.remove("loading")}disconnectedCallback(){super.disconnectedCallback(),this._hostPlayer&&(this._hostPlayer.destroy?.(),this._hostPlayer=null)}}customElements.define("video-media",VideoMedia);class ModelMedia extends DeferredMedia{connectedCallback(){super.connectedCallback(),this.closeElement&&this.on(this.closeElement,"click",this.onCloseClick.bind(this))}get closeElement(){return this.querySelector('[id^="DeferredPosterClose-"]')}onCloseClick(event){event.preventDefault(),event.stopPropagation(),this.modelViewerUI&&this.modelViewerUI.pause()}playerTarget(){return new Promise(()=>{this.setAttribute("loaded",""),Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.setupShopifyXR.bind(this)}
24,{name:"model-viewer-ui",version:"1.0",onLoad:this.setupModelViewerUI.bind(this)}])})}playerHandler(target,prop){target[prop]()}async setupShopifyXR(){if(!window.ShopifyXR){this._boundSetupShopifyXR=this._boundSetupShopifyXR||this.setupShopifyXR.bind(this),this.on(document,"shopify_xr_initialized",this._boundSetupShopifyXR);return}document.querySelectorAll('[id^="ProductJSON-"]').forEach(modelJSON=>{window.ShopifyXR.addModels(JSON.parse(modelJSON.textContent)),modelJSON.remove()}),window.ShopifyXR.setupXRElements()}setupModelViewerUI(errors){if(errors)return;const modelViewer=this.querySelector("model-viewer");modelViewer&&!modelViewer.hasAttribute("loaded")&&(modelViewer.setAttribute("loaded",""),this.on(modelViewer,"shopify_model_viewer_ui_toggle_play",this.modelViewerPlayed.bind(this)),this.on(modelViewer,"shopify_model_viewer_ui_toggle_pause",this.modelViewerPaused.bind(this)),this.modelViewerUI=new Shopify.ModelViewerUI(modelViewer))}modelViewerPlayed(){this.setAttribute("playing",""),this.closeElement.removeAttribute("hidden"),(this.controlledElement??this).dispatchEvent(new CustomEvent("modelViewer:play",{bubbles:!0}))}modelViewerPaused(){this.removeAttribute("playing"),this.closeElement.setAttribute("hidden",""),(this.controlledElement??this).dispatchEvent(new CustomEvent("modelViewer:pause",{bubbles:!0}))}}customElements.define("model-media",ModelMedia);class VariantPicker extends BaseElement{constructor(){super(),this.currentVariant=null,this.cachedVariantData=null,this.currentOptions=[],this.handleVariantChange=this.handleVariantChange.bind(this),this.handleOptionPreload=this.handleOptionPreload.bind(this)}get selectedOptionValues(){return Array.from(this.querySelectorAll("select option[selected], fieldset input:checked")).map(el=>el.getAttribute("data-option-value-id"))}get optionContainers(){return Array.from(this.querySelectorAll("select, fieldset"))}connectedCallback(){super.connectedCallback(),this.on(this,"change",this.handleVariantChange),this.on(this,"pointerenter",this.handleOptionPreload,{capture:!0}),this.scheduleOptionWarmup()}scheduleOptionWarmup(){if(this.optionWarmupDone)return;const productInfo=this.closest("product-info");if(!productInfo||productInfo.hasAttribute("data-original-section-id"))return;const connection=navigator.connection;if(connection&&(connection.saveData||/2g/.test(connection.effectiveType||"")))return;const warm=()=>{if(this.optionWarmupDone)return;this.optionWarmupDone=!0;let budget=12;this.optionContainers.forEach(container=>{container.querySelectorAll("input[data-option-value-id]:not(:checked), option[data-option-value-id]:not([selected])").forEach(input=>{if(budget--<=0)return;const optionValues=this.optionContainers.map(other=>other===container?input.getAttribute("data-option-value-id"):other.querySelector("option[selected], input:checked")?.getAttribute("data-option-value-id")).filter(Boolean);productInfo.preloadOptionValues?.(optionValues,input)})})},idle=()=>{"requestIdleCallback"in window?requestIdleCallback(warm,{timeout:5e3}):setTimeout(warm,2e3)};document.readyState==="complete"?idle():this.on(window,"load",idle,{once:!0})}handleOptionPreload(event){const input=event.target.matches?.("input[data-option-value-id]")?event.target:event.target.closest?.("label")?.control;if(!input||!input.matches("input[data-option-value-id]")||input.checked)return;const optionValues=this.optionContainers.map(container=>container.contains(input)?input.getAttribute("data-option-value-id"):container.querySelector("option[selected], input:checked")?.getAttribute("data-option-value-id")).filter(Boolean);this.closest("product-info, product-card-info")?.preloadOptionValues?.(optionValues,input)}handleVariantChange(event){const target=event.target;this.hasAttribute("data-dynamic-variants")&&this.hasVariantData()&&(this.syncCurrentOptions(target),this.findAndSetCurrentVariant(target),this.updateAvailableOptions(target)),this.markSelectedOption(target),this.publishSelectionChange(event,this.getActualInput(target))}markSelectedOption(target){target.tagName==="SELECT"&&target.selectedOptions.length&&(Array.from(target.options).find(opt=>opt.hasAttribute("selected"))?.removeAttribute("selected"),target.selectedOptions[0].setAttribute("selected",""))}getActualInput(target){return target.tagName==="SELECT"?target.selectedOptions[0]:target}hasVariantData(){return this.querySelector("[data-variants]")!==null}getVariantData(){if(this.cachedVariantData)return this.cachedVariantData;const data=this.querySelector("[data-variants]")?.textContent;return this.cachedVariantData=data?JSON.parse(data):[]}findAndSetCurrentVariant(target){this.currentVariant=this.findVariantByOptions(!0)||this.findClosestAvailableVariant(target)||this.findVariantByOptions(!1)||null}findVariantByOptions(requireAvailability){return this.getVariantData().find(variant=>{const matches=this.currentOptions.every((val,i)=>variant[`option${i+1}`]===val);return requireAvailability?matches&&variant.available:matches})}findClosestAvailableVariant(lastSelectedOption){if(!lastSelectedOption)return null;const lastIndex=parseInt(lastSelectedOption.getAttribute("data-option-index"));return this.getVariantData().filter(variant=>variant.available&&this.currentOptions.slice(0,lastIndex).every((val,i)=>variant[`option${i+1}`]===val)).reduce((best,variant)=>{if(!best)return variant;const bestScore=this.currentOptions.reduce((sum,val,i)=>best[`option${i+1}`]===val?sum+(3-i):sum,0);return this.currentOptions.reduce((sum,val,i)=>variant[`option${i+1}`]===val?sum+(3-i):sum,0)>bestScore?variant:best},null)}syncCurrentOptions(target){this.currentOptions=Array.from(this.querySelectorAll("select, fieldset")).map(el=>el.tagName==="SELECT"?el.value:Array.from(el.querySelectorAll("input")).find(radio=>radio===target||radio.checked)?.value)}updateAvailableOptions(lastSelectedOption){const firstValue=this.querySelector(":checked")?.value;if(!firstValue)return;const matchingVariants=this.getVariantData().filter(v=>v.option1===firstValue),groups=[...this.querySelectorAll("fieldset, .variant-wrapper")];groups.forEach((group,i)=>{if(i===0||lastSelectedOption.parentElement===group)return;const inputs=[...group.querySelectorAll('input[type="radio"], option')],prevValue=groups[i-1].querySelector(":checked")?.value,available=matchingVariants.filter(v=>v.available&&v[`option${i}
24`]===prevValue).map(v=>v[`option${i+1}`]);this.setInputStates(inputs,available)})}setInputStates(inputs,availableValues){inputs.forEach(input=>{const index=input.getAttribute("data-option-index"),value=input.getAttribute("value"),isAvailable=availableValues.includes(value),isCurrent=this.currentVariant?.[`option${index}`]===value;input.tagName==="INPUT"?(input.classList.toggle("disabled",!isAvailable),isCurrent&&(input.checked=!0)):isCurrent?input.setAttribute("selected",""):input.removeAttribute("selected")})}publishSelectionChange(event,target){theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.optionValueSelectionChange,{data:{event,target,selectedOptionValues:this.selectedOptionValues}})}}customElements.define("variant-picker",VariantPicker);const cachedProductInfo=new Map,PRODUCT_INFO_CACHE_LIMIT=50,warmedGalleryUrls=new Set;class ProductInfo extends BaseElement{pendingRequestUrl=null;preProcessHtmlCallbacks=[];postProcessHtmlCallbacks=[];get sectionId(){return this.hasAttribute("data-original-section-id")?this.getAttribute("data-original-section-id"):this.getAttribute("data-section-id")}get productId(){return this.getAttribute("data-product-id")}get productForm(){return document.forms[this.getAttribute("form")]}get productStickyForm(){return document.getElementById(`ProductStickyForm-${this.sectionId}-${this.productId}`)}get pickupAvailability(){return this.querySelector("pickup-availability")}get variantSelectors(){return this.querySelector("variant-picker")}get quantityInput(){return this.querySelector("quantity-input input")}connectedCallback(){super.connectedCallback(),this.initProductAnimation();const variantChangeUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.optionValueSelectionChange,this.handleOptionValueChange.bind(this));this.registerCleanup(variantChangeUnsubscriber),this.initQuantityHandlers(),this.dispatchEvent(new CustomEvent("product-info:loaded",{bubbles:!0}))}disconnectedCallback(){super.disconnectedCallback(),this.renderAbortController?.abort()}initProductAnimation(){theme.config.motionReduced||(this.animation=new theme.Animation(this),this.animation.beforeLoad(),Motion.inView(this,async()=>{!this.immediate&&this.media&&await theme.utils.imageLoaded(this.media),this.animation.load()}))}handleOptionValueChange({data:{event,target,selectedOptionValues}}){if(!this.contains(event.target))return;this.resetProductFormState();const productUrl=target.getAttribute("data-product-url")||this.pendingRequestUrl||this.getAttribute("data-product-url");if(this.pendingRequestUrl=productUrl,this.getAttribute("data-product-url")!==productUrl){window.location.href=productUrl;return}this.renderProductInfo({requestUrl:this.buildRequestUrlWithParams(productUrl,selectedOptionValues),targetId:target.tagName==="OPTION"?target.parentElement.id:target.id,callback:this.handleUpdateProductInfo()})}resetProductFormState(){this.productForm?.handleErrorMessage(),this.productForm?.toggleSubmitButton(!0,""),this.productStickyForm?.handleErrorMessage(),this.productStickyForm?.toggleSubmitButton(!0,"")}preloadOptionValues(selectedOptionValues,target){if(!selectedOptionValues.length)return;const productUrl=target.getAttribute("data-product-url")||this.getAttribute("data-product-url");if(this.getAttribute("data-product-url")!==productUrl)return;const requestUrl=this.buildRequestUrlWithParams(productUrl,selectedOptionValues),requestPromise=this.getProductInfoHTML(requestUrl);warmedGalleryUrls.has(requestUrl)||(warmedGalleryUrls.add(requestUrl),requestPromise.then(responseText=>this.warmGalleryFeaturedImage(responseText)).catch(()=>{}))}getProductInfoHTML(requestUrl){if(cachedProductInfo.has(requestUrl))return cachedProductInfo.get(requestUrl);const requestPromise=fetch(requestUrl).then(response=>{if(!response.ok)throw new Error(`Variant render failed with status ${response.status}`);return response.text()}).catch(error=>{throw cachedProductInfo.delete(requestUrl),error});return cachedProductInfo.set(requestUrl,requestPromise),cachedProductInfo.size>PRODUCT_INFO_CACHE_LIMIT&&cachedProductInfo.delete(cachedProductInfo.keys().next().value),requestPromise}renderProductInfo({requestUrl,targetId,callback}){this.renderAbortController?.abort(),this.renderAbortController=new AbortController;const{signal}=this.renderAbortController;this.getProductInfoHTML(requestUrl).then(responseText=>{if(signal.aborted)return;if(this.pendingRequestUrl=null,callback!==void 0){const parsedHTML=new DOMParser().parseFromString(responseText,"text/html");callback(parsedHTML,requestUrl)}const activeElement=document.getElementById(targetId);activeElement!==null&&(activeElement.hasAttribute("align-selected")&&activeElement.closest(activeElement.getAttribute("align-selected"))?.scrollTo({left:activeElement.offsetLeft,behavior:"instant"}),setTimeout(()=>{activeElement.focus({preventScroll:!0})},100))}).catch(error=>{error.name!=="AbortError"&&console.error(error)})}buildRequestUrlWithParams(url,optionValues){const params=[];return params.push(`section_id=${this.sectionId}`),optionValues.length&¶ms.push(`option_values=${optionValues.join(",")}`),`${url}?${params.join("&")}`}handleUpdateProductInfo(){return(parsedHTML,requestUrl)=>{const variant=this.getSelectedVariant(parsedHTML);if(this.pickupAvailability?.update(variant),this.updateOptionValues(parsedHTML),this.updateURL(variant),this.updateV
24ariantInputs(variant),!variant){requestUrl&&cachedProductInfo.delete(requestUrl),this.setUnavailable();return}this.updateGalleryFromDestination(parsedHTML),this.updateSourceFromDestination(parsedHTML,"Price"),this.updateSourceFromDestination(parsedHTML,"BuyButtonPrice"),this.updateSourceFromDestination(parsedHTML,"StickyPrice"),this.updateSourceFromDestination(parsedHTML,"Sku"),this.updateSourceFromDestination(parsedHTML,"Badges"),this.updateSourceFromDestination(parsedHTML,"Inventory"),this.updateSourceFromDestination(parsedHTML,"Volume"),this.updateSourceFromDestination(parsedHTML,"PricePerItem"),this.updateSourceFromDestination(parsedHTML,"BackInStock"),this.updateSourceFromDestination(parsedHTML,"ProductBundle"),this.updateQuantityRules(parsedHTML),this.updateSourceFromDestination(parsedHTML,"QuantityRules"),this.updateSourceFromDestination(parsedHTML,"QuantityRulesCart"),this.updateSourceFromDestination(parsedHTML,"VolumeNote"),this.productForm?.toggleSubmitButton(!variant.available,theme.variantStrings.soldOut),this.productStickyForm?.toggleSubmitButton(!variant.available,theme.variantStrings.soldOut),theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.variantChange,{data:{sectionId:this.sectionId,productId:this.productId,parsedHTML,variant}}),(this.productForm??document).dispatchEvent(new CustomEvent("variant:change",{detail:{variant}}))}}getSelectedVariant(productInfoNode){const selectedVariant=productInfoNode.querySelector("[data-selected-variant]")?.textContent;return selectedVariant?JSON.parse(selectedVariant):null}updateOptionValues(parsedHTML){const variantPicker=parsedHTML.getElementById(`VariantPicker-${this.sectionId}-${this.productId}`);variantPicker&&theme.HTMLUpdateUtility.viewTransition(this.variantSelectors,variantPicker,this.preProcessHtmlCallbacks)}updateURL(variant){const variantId=variant?.id;if(!variantId||this.getAttribute("data-update-url")==="false")return;const newUrl=new URL(window.location.href);newUrl.searchParams.set("variant",variantId),window.history.replaceState({path:newUrl.toString()},"",newUrl.toString())}updateVariantInputs(variant){const variantId=variant?.id;if(!variantId)return;document.querySelectorAll(`#ProductForm-${this.sectionId}-${this.productId}, #ProductFormInstallment-${this.sectionId}-${this.productId}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=variantId??"",input.setAttribute("data-min",variant.quantity_rule?.min||1),input.dispatchEvent(new Event("change",{bubbles:!0}))})}updateSourceFromDestination(parsedHTML,id){const source=parsedHTML.getElementById(`${id}-${this.sectionId}-${this.productId}`),destination=document.querySelector(`#${id}-${this.sectionId}-${this.productId}`);source&&destination&&(destination.innerHTML=source.innerHTML,destination.removeAttribute("hidden"))}get gallerySourceSectionId(){return this.sectionId}updateGalleryFromDestination(parsedHTML){const source=parsedHTML.getElementById(`ProductGallery-${this.gallerySourceSectionId}-${this.productId}`),destination=document.querySelector(`#ProductGallery-${this.sectionId}-${this.productId}`);if(!source||!destination)return;const signal=this.renderAbortController?.signal,swap=()=>{if(!signal?.aborted){if(destination.removeAttribute("aria-busy"),source.className&&destination.className!==source.className&&(destination.className=source.className),this.morphGalleryMedia(source,destination)){const slider=destination.sliderGallery;slider&&(slider.reset?.(),slider.scrollTo({left:0,top:0,behavior:"instant"}))}else destination.innerHTML=source.innerHTML;destination.removeAttribute("hidden"),destination.countMediaGallery?.()}},featuredItem=source.querySelector("[data-media-id]"),featuredImg=featuredItem?.querySelector("img");if(!featuredImg)return swap();const existingImg=destination.querySelector(`[data-media-id="${featuredItem.getAttribute("data-media-id")}"] img`);if(existingImg?.complete&&existingImg.naturalWidth>0)return swap();destination.setAttribute("aria-busy","true");const loader=new Image;loader.fetchPriority="high",loader.sizes=featuredImg.getAttribute("sizes")||"",loader.srcset=featuredImg.getAttribute("srcset")||"",loader.src=featuredImg.getAttribute("src")||"",Promise.race([loader.decode().catch(()=>{}),new Promise(resolve=>setTimeout(resolve,3e3))]).then(swap)}morphGalleryMedia(source,destination){const listsOf=root=>{const parents=[];return root.querySelectorAll("[data-media-id]").forEach(item=>{parents.includes(item.parentElement)||parents.push(item.parentElement)}),parents},sourceLists=listsOf(source),destinationLists=listsOf(destination);if(!sourceLists.length||sourceLists.length!==destinationLists.length)return!1;const pairs=[];for(let i=0;i<sourceLists.length;i++){const sourceList=sourceLists[i],destinationList=destinationLists[i];if(sourceList.tagName!==destinationList.tagName)return!1;const sourceDots=sourceList.closest("media-dots"),destinationDots=destinationList.closest("media-dots");if(!!sourceDots!=!!destinationDots)return!1;pairs.push(sourceDots?{oldDots:destinationDots,newDots:sourceDots}:{sourceList,destinationList})}
24return pairs.forEach(pair=>{if(pair.newDots){pair.oldDots.isConnected&&pair.oldDots.replaceWith(pair.newDots);return}const{sourceList,destinationList}=pair,before=Array.from(destinationList.children),keyed=new Map;before.forEach(child=>{const id=child.getAttribute?.("data-media-id");id&&keyed.set(id,child)});const after=Array.from(sourceList.children).map(newChild=>{const id=newChild.getAttribute?.("data-media-id"),existing=id?keyed.get(id):null;return existing?(Array.from(existing.attributes).forEach(attr=>{newChild.hasAttribute(attr.name)||existing.removeAttribute(attr.name)}),Array.from(newChild.attributes).forEach(attr=>{existing.getAttribute(attr.name)!==attr.value&&existing.setAttribute(attr.name,attr.value)}),existing):newChild});after.length===before.length&&after.every((node,index)=>node===before[index])||destinationList.replaceChildren(...after)}),!0}warmGalleryFeaturedImage(responseText){const connection=navigator.connection;if(connection&&(connection.saveData||/2g/.test(connection.effectiveType||"")))return;const img=new DOMParser().parseFromString(responseText,"text/html").getElementById(`ProductGallery-${this.gallerySourceSectionId}-${this.productId}`)?.querySelector("[data-media-id] img");if(!img||!img.getAttribute("src"))return;const loader=new Image;loader.fetchPriority="low",loader.sizes=img.getAttribute("sizes")||"",loader.srcset=img.getAttribute("srcset")||"",loader.src=img.getAttribute("src")}setUnavailable(){document.querySelector(`#ProductGallery-${this.sectionId}-${this.productId}`)?.removeAttribute("aria-busy"),this.productForm?.toggleSubmitButton(!0,theme.variantStrings.unavailable,!0),this.productStickyForm?.toggleSubmitButton(!0,theme.variantStrings.unavailable,!0);const selectors=["Price","BuyButtonPrice","StickyPrice","Inventory","Sku","Badges","PricePerItem","BackInStock","ProductBundle","VolumeNote","Volume","QuantityRules","QuantityRulesCart"].map(id=>`#${id}-${this.sectionId}-${this.productId}`).join(", ");document.querySelectorAll(selectors).forEach(selector=>selector.setAttribute("hidden",""))}initQuantityHandlers(){if(this.quantityInput&&(this.setQuantityBoundries(),!this.hasAttribute("data-original-section-id"))){const cartUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.fetchQuantityRules.bind(this));this.registerCleanup(cartUpdateUnsubscriber)}}setQuantityBoundries(){theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.quantityBoundries,{data:{sectionId:this.sectionId,productId:this.productId}})}fetchQuantityRules(){const currentVariantId=this.productForm?.variantIdInput?.value;currentVariantId&&(this.querySelector('label[is="quantity-label"]')?.setAttribute("aria-busy","true"),fetch(`${this.getAttribute("data-product-url")}?variant=${currentVariantId}§ion_id=${this.sectionId}`).then(response=>response.text()).then(responseText=>{const parsedHTML=new DOMParser().parseFromString(responseText,"text/html");this.updateQuantityRules(parsedHTML)}).catch(error=>{console.error(error)}).finally(()=>{this.querySelector('label[is="quantity-label"]')?.removeAttribute("aria-busy")}))}updateQuantityRules(parsedHTML){this.quantityInput&&(theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.quantityRules,{data:{sectionId:this.sectionId,productId:this.productId,parsedHTML}}),this.setQuantityBoundries())}}customElements.define("product-info",ProductInfo);class ProductForm extends BaseElementMixin(HTMLFormElement){connectedCallback(){super.connectedCallback(),this.variantIdInput.disabled=!1,this.on(this,"submit",this.onSubmitHandler)}get cartDrawer(){return document.querySelector("cart-drawer")}get submitButton(){return this._submitButton=this._submitButton||this.querySelector('[type="submit"]')}get submitButtons(){return this._submitButtons=this._submitButtons||document.querySelectorAll(`[type="submit"][form="${this.getAttribute("id")}"]`)}get hideErrors(){return this.getAttribute("data-hide-errors")==="true"}get variantIdInput(){return this.querySelector('[name="id"]')}get bundles(){return Array.from(document.querySelectorAll(`[form="${this.getAttribute("id")}"] input[name="bundles"]:checked`))}prepareFormData(formData){const bundles=this.bundles,bundlesLength=bundles.length,itemsArray=new Array(bundlesLength+1);for(let i=0;i<bundlesLength;i++){const reverseIndex=bundlesLength-1-i,bundle=bundles[reverseIndex];itemsArray[i]={id:bundle.value,quantity:bundle.getAttribute("data-min")}}const allFormData={items:itemsArray.slice(0,bundlesLength)},json={},formEntries=Array.from(formData.entries());for(const[name,value]of formEntries)if(name==="id"||name==="quantity"||name.includes("properties"))if(name==="id"||name==="quantity")json[name]=value;else{const property=/(?:^(properties\[))(.*?)(?:\])/.exec(name)[2];json.properties=json.properties||{},json.properties[property]=value}else allFormData[name]=value;return allFormData.items.push(json),allFormData}onSubmitHandler(event){const bundlesLength=this.bundles.length;if(!Shopify.designMode&&(document.body.classList.contains("template-cart")||theme.settings.cartType==="page")){bundlesLength>0&&(theme.utils.postLink2(theme.routes.cart_add_url,{parameters:{...this.prepareFormData(new FormData(this))}}),event.preventDefault());return}if(event.preventDefault(),this.submitButton.hasAttribute("aria-disabled"))return;this.activeElement=event.submitter||event.currentTarget,this.handleErrorMessage();let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:bundled-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const config=theme.utils.fetchConfig("javascript");config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"];const formData=new FormData(this);if(formData.append("sections",sectionsToBundle),formData.append("sections_url",window.location.pathname),config.body=formData,bundlesLength>0){const allFormData=this.prepareFormData(formData);config.body=JSON.stringify(allFormData),config.headers["Content-Type"]="application/json"}this.submitButton.setAttribute("aria-disabled","true"),this.submitButton.setAttribute("aria-busy","true"),fetch(theme.routes.cart_add_url,config).then(response=>response.json()).then(async parsedState=>{if(parsedState.status){theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartError,{source:"product-form",productVariantId:formData.get("id"),errors:parsedState.errors||parsedState.description,message:parsedState.message}),this.handleErrorMessage(parsedState.description),document.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:parsedState.description}}));const submitButtonText=this.submitButton.querySelector(".btn-text>span");submitButtonText&&submitButtonText.hasAttribute("data-sold-out")&&(submitButtonText.innerText=submitButtonText.getAttribute("data-sold-out"),this.submitButton.setAttribute("aria-disabled","true"),this.error=!0);const cartJson2=await(await fetch(theme.routes.cart_url,{...theme.utils.fetchConfig("json","GET")})).json();theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{source:"product-form",productVariantId:formData.get("id"),cart:cartJson2}),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{open:!1}}));return}if(Shopify.designMode&&(document.body.classList.contains("template-cart")||theme.settings.cartType==="page")){window.location.href=theme.routes.cart_url;return}const cartJson=await(await fetch(theme.routes.cart_url,{...theme.utils.fetchConfig("json","GET")})).json();cartJson.sections=parsedState.sections,theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{source:"product-form",productVariantId:formData.get("id"),cart:cartJson}),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:parsedState}})),this.cartDrawer?.show(this.activeElement)}).catch(error=>{console.error(error)}).finally(()=>{this.submitButton.removeAttribute("aria-busy"),this.submitButtons.forEach(submitButton=>submitButton.removeAttribute("aria-busy")),this.error||(this.submitButton.removeAttribute("aria-disabled"),this.submitButtons.forEach(submitButton=>submitButton.removeAttribute("aria-disabled")))})}handleErrorMessage(errorMessage=!1){this.hideErrors||(this.errorMessage=this.errorMessage||this.querySelector(".product-form__error-message"),this.errorMessage&&(this.errorMessage.toggleAttribute("hidden",!errorMessage),this.errorMessage.innerText=errorMessage))}toggleSubmitButton(disable=!0,text,unavailable=!1){if(!this.submitButton)return;this.submitButton.removeAttribute("loading"),this.submitButton.removeAttribute("unavailable"),this.error=!1,this.submitButton.removeAttribute("aria-disabled"),this.submitButtons.forEach(submitButton=>submitButton.removeAttribute("aria-disabled"));const submitButtonText=this.submitButton.querySelector(".btn-text"),submitButtonTextChild=this.submitButton.querySelector(".btn-text>span");disable?(this.submitButton.setAttribute("disabled",""),unavailable&&this.submitButton.setAttribute("unavailable",""),text?(submitButtonTextChild||submitButtonText).textContent=text:this.submitButton.setAttribute("loading","")):(this.submitButton.removeAttribute("disabled"),(submitButtonTextChild||submitButtonText).textContent=this.submitButton.hasAttribute("data-pre-order")?theme.variantStrings.preOrder:theme.variantStrings.addToCart)}}customElements.define("product-form",ProductForm,{extends:"form"});class ProductStickyForm extends BaseElement{connectedCallback(){if(super.connectedCallback(),this.onVariantChangedListener=this.onVariantChangedListener||this.onVariantChanged.bind(this),this.on(this.productForm??document,"variant:change",this.onVariantChangedListener),this.scopeFrom=document.querySelector(".quick-order-list")||document.getElementById(this.getAttribute("form")),this.scopeTo=document.querySelector(".footer-group"),!this.scopeFrom||!this.scopeTo)return;const intersectionObserver=new IntersectionObserver(this.handleIntersection.bind(this));intersectionObserver.observe(this.scopeFrom),intersectionObserver.observe(this.scopeTo),this.registerCleanup(()=>intersectionObserver.disconnect())}
24get productForm(){return document.forms[this.getAttribute("form")]}get submitButton(){return this._submitButton=this._submitButton||this.querySelector('[type="submit"]')}get productOptions(){return this._productOptions=this._productOptions||this.querySelector("[data-sticky-product-options]")}get productMedia(){return this._productMedia=this._productMedia||this.querySelector("[data-sticky-product-media]")}handleIntersection(entries){entries.forEach(entry=>{entry.target===this.scopeFrom&&(this.scopeFromPassed=entry.boundingClientRect.bottom<0),entry.target===this.scopeTo&&(this.scopeToReached=entry.isIntersecting)}),this.scopeFromPassed&&!this.scopeToReached?Motion.animate(this.firstElementChild,{opacity:1,visibility:"visible",transform:["translateY(15px)","translateY(0)"]},{duration:1,easing:[.16,1,.3,1]}):Motion.animate(this.firstElementChild,{opacity:0,visibility:"hidden",transform:["translateY(0)","translateY(15px)"]},{duration:1,easing:[.16,1,.3,1]})}onVariantChanged(event){this.updateProductMedia(event.detail.variant),this.updateProductOptions(event.detail.variant)}updateProductMedia(currentVariant){if(!currentVariant||!currentVariant.featured_media)return;const image=this.productMedia.querySelector("img"),newImage=new Image(currentVariant.featured_media.preview_image.width,currentVariant.featured_media.preview_image.height);newImage.alt=currentVariant.featured_media.alt,newImage.src=currentVariant.featured_media.preview_image.src,newImage.srcset=this.generateSrcset(currentVariant.featured_media.preview_image),newImage.sizes=image.sizes,this.productMedia.replaceChildren(newImage)}updateProductOptions(currentVariant){currentVariant&&(this.productOptions.innerText=currentVariant.title)}handleErrorMessage(errorMessage=!1){this.productForm?.hideErrors||(this.errorMessage=this.errorMessage||this.querySelector(".product-form__error-message"),this.errorMessage&&(this.errorMessage.toggleAttribute("hidden",!errorMessage),this.errorMessage.innerText=errorMessage))}toggleSubmitButton(disable=!0,text){if(!this.submitButton)return;const submitButtonText=this.submitButton.querySelector(".btn-text"),submitButtonTextChild=this.submitButton.querySelector(".btn-text>span");disable?(this.submitButton.setAttribute("disabled",""),text&&((submitButtonTextChild||submitButtonText).textContent=text)):(this.submitButton.removeAttribute("disabled"),(submitButtonTextChild||submitButtonText).textContent=this.submitButton.hasAttribute("data-pre-order")?theme.variantStrings.preOrder:theme.variantStrings.addToCart)}generateSrcset(image){return this.productMedia.getAttribute("data-widths").split(",").map(width=>parseInt(width)).filter(width=>width<=image.width).map(width=>`${image.src}&width=${width} ${width}w`).join(", ")}}customElements.define("product-sticky-form",ProductStickyForm);class ProductBundleDetails extends AccordionDetails{get productForm(){return document.forms[this.getAttribute("form")]}get bundles(){return Array.from(this.querySelectorAll('input[name="bundles"]:checked'))}connectedCallback(){super.connectedCallback();const cartUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.onCartUpdate.bind(this));this.registerCleanup(cartUpdateUnsubscriber),this.onBundleChangeListener=this.onBundleChange.bind(this),this.on(this,"change",this.onBundleChangeListener)}onCartUpdate(event){const bundles=this.bundles;bundles.length!==0&&event.source==="product-form"&&(bundles.forEach(input=>{input.disabled||(input.checked=!1)}),this.onBundleChange())}onBundleChange(){(this.productForm??document).dispatchEvent(new CustomEvent("bundle:change",{detail:{items:this.bundles.map(input=>({id:input.value,quantity:input.getAttribute("data-min"),price:input.getAttribute("data-price")}))}}))}}customElements.define("product-bundle-details",ProductBundleDetails,{extends:"details"});class ProductBundlePicker extends BaseElementMixin(HTMLLabelElement){constructor(){super(),this.handleVariantChange=this.handleVariantChange.bind(this)}connectedCallback(){super.connectedCallback(),this.on(this,"change",this.handleVariantChange)}handleVariantChange(event){const target=event.target;if(target.tagName!=="SELECT")return;const option=target.selectedOptions?.[0];if(!option)return;const value=option.value,price=option.getAttribute("data-price"),min=option.getAttribute("data-min"),imgSrc=option.getAttribute("data-img-src"),imgSrcset=option.getAttribute("data-img-srcset");this.updateCheckboxInput(value,price,min),this.updatePrice(price),this.updateImage(imgSrc,imgSrcset)}updateCheckboxInput(value,price,min){const input=this.querySelector('input[type="checkbox"]');input&&(input.value=value,input.setAttribute("data-price",price),input.setAttribute("data-min",min))}updatePrice(price){const priceElement=this.querySelector(".price__regular");if(!priceElement||!price)return;const format=theme.settings.currencyCodeEnabled?theme.settings.moneyWithCurrencyFormat:theme.settings.moneyFormat;priceElement.innerHTML=theme.Currency.formatMoney(price,format)}updateImage(src,srcset){const img=this.querySelector("img");img&&(src&&(img.src=src),srcset&&(img.srcset=srcset))}}customElements.define("product-bundle-picker",ProductBundlePicker,{extends:"label"});class ProductBuyPrice extends BaseElement{constructor(){super(),this.onBundleChangedListener=this.onBundleChanged.bind(this)}
24get productForm(){const formId=this.getAttribute("form");return formId?document.forms[formId]:null}get basePrice(){return parseInt(this.getAttribute("data-price"))||0}connectedCallback(){super.connectedCallback(),this.on(this.productForm??document,"bundle:change",this.onBundleChangedListener)}onBundleChanged(event){const{items}=event.detail,subtotal=items.reduce((total,item)=>{const price=parseInt(item.price)||0,quantity=parseInt(item.quantity)||0;return total+price*quantity},this.basePrice);this.updatePrice(subtotal)}updatePrice(amount){const format=theme.settings.currencyCodeEnabled?theme.settings.moneyWithCurrencyFormat:theme.settings.moneyFormat;this.innerHTML=theme.Currency.formatMoney(amount,format)}}customElements.define("product-buy-price",ProductBuyPrice);class MediaGallery extends BaseElement{constructor(){super(),Motion.inView(this,()=>{requestAnimationFrame(()=>{this.pauseAllMedia(),this.preloadAdjacentMedia()})})}connectedCallback(){super.connectedCallback(),this.on(this.productForm??document,"variant:change",this.onVariantChanged.bind(this)),this.on(this,"lightbox:open",event=>this.openZoom(event.detail.index)),this.on(this.sliderGallery,"slider:change",this.onSlideChange.bind(this)),this.lastViewportWidth=window.innerWidth,this.on(window,"resize",this.onWindowResize.bind(this)),this.registerCleanup(()=>{this._photoswipe?.destroy?.(),this._photoswipe=null}),this.registerCleanup(()=>clearTimeout(this.resizeSettleTimer)),this.countMediaGallery()}onWindowResize(){if(window.innerWidth!==this.lastViewportWidth){if(this.lastViewportWidth=window.innerWidth,!this.resizeActiveItem){const slider=this.sliderGallery;this.resizeActiveItem=slider?.itemsToShow?.[(slider.currentPage||1)-1]||null}clearTimeout(this.resizeSettleTimer),this.resizeSettleTimer=setTimeout(()=>{const item=this.resizeActiveItem;if(this.resizeActiveItem=null,!item||!item.isConnected||item.clientWidth===0)return;const slider=this.sliderGallery,first=slider.itemsToShow[0];first&&slider.scrollTo({left:item.offsetLeft-first.offsetLeft,behavior:"instant"})},200)}}get viewInSpaceButton(){return this.querySelector("[data-shopify-xr]")}get productForm(){return document.forms[this.getAttribute("form")]}get sliderGallery(){return this.querySelector("slider-element")}get mediaPreview(){return this.querySelector(".product__preview .product__media")}get photoswipe(){if(this._photoswipe)return this._photoswipe;const lightbox=new PhotoSwipeLightbox({arrowPrevSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="M17.5 7.5L10 15L17.5 22.5"/></svg>',arrowNextSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="M17.5 7.5L10 15L17.5 22.5"/></svg>',closeSVG:'<svg class="pswp__icn icon" stroke="currentColor" fill="none" viewBox="0 0 30 30"><path d="m7.5 22.5 15-15m-15 0 15 15"/></svg>',bgOpacity:1,pswpModule:()=>import(theme.settings.pswpModule),arrowPrevTitle:theme.strings.previous,arrowNextTitle:theme.strings.next,closeTitle:theme.strings.close,allowPanToNext:!1,allowMouseDrag:!0,wheelToZoom:!1,returnFocus:!0,zoom:!1});return lightbox.addFilter("thumbEl",(_thumbEl,data)=>data.thumbnailElement),lightbox.on("contentLoad",event=>{const{content}=event;(content.type==="video"||content.type==="external_video"||content.type==="model")&&(event.preventDefault(),content.element=document.createElement("div"),content.element.className="pswp__video-container",content.element.appendChild(content.data.domElement.cloneNode(!0)))}),lightbox.on("change",()=>{this.sliderGallery.select(lightbox.pswp.currIndex+1,!0)}),lightbox.on("close",()=>{const slideSelected=this.sliderGallery.selected(lightbox.pswp.currIndex);lightbox.pswp._lastActiveElement=slideSelected?slideSelected.querySelector("button"):document.activeElement}),lightbox.init(),this._photoswipe=lightbox}onVariantChanged(event){event.detail.variant.featured_media&&this.countMediaGallery()}onSlideChange(event){const activeMedia=event.detail.currentElement;this.playActiveMedia(activeMedia),this.preloadAdjacentMedia(event.detail.currentPage),this.viewInSpaceButton&&(activeMedia.getAttribute("data-media-type")==="model"?this.viewInSpaceButton.setAttribute("data-shopify-model3d-id",activeMedia.getAttribute("data-media-id")):this.viewInSpaceButton.setAttribute("data-shopify-model3d-id",this.viewInSpaceButton.getAttribute("data-shopify-model3d-default-id")))}setActiveMedia(mediaId){let activeMedia=this.sliderGallery.querySelector(`[data-media-id="${mediaId}"]`);activeMedia?.checkVisibility()===!1&&(activeMedia=activeMedia.nextElementSibling),activeMedia!==null&&activeMedia.scrollIntoView({block:"start",behavior:theme.config.motionReduced?"auto":"smooth"})}playActiveMedia(activeMedia){if(typeof activeMedia>"u")return;const deferredMedia=activeMedia.querySelector(".deferred-media");this.sliderGallery.querySelectorAll(".deferred-media").forEach(media=>{deferredMedia===media?media.play():media.pause()})}preloadAdjacentMedia(currentPage=1){const items=this.sliderGallery.itemsToShow,currentIndex=currentPage-1;
24[items[currentIndex-1],items[currentIndex+1]].forEach(media=>{media?.querySelectorAll('img[loading="lazy"], iframe[loading="lazy"]').forEach(el=>el.removeAttribute("loading"))})}pauseAllMedia(){this.sliderGallery.querySelectorAll("[data-media-id]").forEach((media,index)=>{if(index>0){const deferredMedia=media.querySelector(".deferred-media");deferredMedia&&typeof deferredMedia.pause=="function"&&deferredMedia.pause()}})}openZoom(index=0){let dataSource=this.sliderGallery.itemsToShow.map(media=>{const image=media.querySelector("img");if(media.getAttribute("data-media-type")==="image")return{thumbnailElement:image,src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:parseInt(image.getAttribute("width")),height:parseInt(image.getAttribute("height")),alt:image.alt,thumbCropped:!0};if(media.getAttribute("data-media-type")==="video"||media.getAttribute("data-media-type")==="external_video"||media.getAttribute("data-media-type")==="model"){const video=media.querySelector(".deferred-media");return{thumbnailElement:image,domElement:video,type:media.getAttribute("data-media-type"),src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:800,height:800/video.getAttribute("data-aspect-ratio"),alt:image.alt,thumbCropped:!0}}});if(this.mediaPreview&&this.mediaPreview.offsetParent&&this.mediaPreview.getAttribute("data-media-type")==="image"){const image=this.mediaPreview.querySelector("img");dataSource.push({thumbnailElement:image,src:image.src,srcset:image.srcset,msrc:image.currentSrc||image.src,width:parseInt(image.getAttribute("width")),height:parseInt(image.getAttribute("height")),alt:image.alt,thumbCropped:!0}),index===-1&&(index=dataSource.length-1)}this.photoswipe.loadAndOpen(index,dataSource)}countMediaGallery(){let mediaCount=0;this.sliderGallery.querySelectorAll("[data-media-id]").forEach(media=>{!media.classList.contains("xl:hidden")&&!media.hasAttribute("hidden")&&mediaCount++}),this.mediaPreview&&mediaCount++,mediaCount>1?this.classList.remove("with-only1"):this.classList.add("with-only1")}}customElements.define("media-gallery",MediaGallery);class MediaLightboxButton extends BaseElementMixin(HTMLButtonElement){connectedCallback(){super.connectedCallback(),this.on(this,"click",this.onButtonClick)}onButtonClick(){const media=this.closest("[data-media-id]"),sliderGallery=this.closest("slider-element"),openIndex=sliderGallery?sliderGallery.itemsToShow.indexOf(media):-1;this.dispatchEvent(new CustomEvent("lightbox:open",{bubbles:!0,detail:{index:openIndex}}))}}customElements.define("media-lightbox-button",MediaLightboxButton,{extends:"button"});class MediaHoverButton extends MediaLightboxButton{get zoomRatio(){return 2}onButtonClick(event){if(theme.config.isTouch)super.onButtonClick();else{const media=this.closest('[data-media-type="image"]');if(media){const image=media.querySelector("img");this.gallery=this.closest("slider-element"),this.magnify(image),this.moveWithHover(image,event)}}}createOverlay(image){const overlayImage=document.createElement("img");overlayImage.setAttribute("src",`${image.src}`);const overlay=document.createElement("media-hover-overlay");return this.prepareOverlay(overlay,overlayImage),this.toggleLoadingSpinner(image),overlayImage.onload=()=>{this.toggleLoadingSpinner(image),image.parentElement.insertBefore(overlay,image)},this.gallery&&this.gallery.classList.add("magnify"),overlay}prepareOverlay(container,image){container.setAttribute("class","media z-10 absolute top-0 left-0 w-full h-full"),container.setAttribute("aria-hidden","true"),container.style.backgroundImage=`url('${image.src}')`,container.style.cursor="zoom-out"}toggleLoadingSpinner(image){const loadingSpinner=image.parentElement;loadingSpinner.classList.toggle("loading"),loadingSpinner.classList.toggle("pointer-events-none")}moveWithHover(image,event){const ratio=image.height/image.width,container=event.target.getBoundingClientRect(),xPosition=event.clientX-container.left,yPosition=event.clientY-container.top,xPercent=`${xPosition/(image.clientWidth/100)}%`,yPercent=`${yPosition/(image.clientWidth*ratio/100)}%`;this.overlay.style.backgroundPosition=`${xPercent} ${yPercent}`,this.overlay.style.backgroundSize=`${image.width*this.zoomRatio}px`}magnify(image){this.overlay=this.createOverlay(image),this.overlay.onclick=()=>this.reset(),this.overlay.onmousemove=event=>this.moveWithHover(image,event),this.overlay.onmouseleave=()=>this.reset()}reset(){this.overlay.remove(),this.gallery&&this.gallery.classList.remove("magnify")}}customElements.define("media-hover-button",MediaHoverButton,{extends:"button"});class MediaDots extends SliderDots{connectedCallback(){super.connectedCallback(),this.on(document,"matchSmall",this.resetIndexe
24s.bind(this)),this.on(document,"unmatchSmall",this.resetIndexes.bind(this))}init(){super.init(),this.resetIndexes()}ensureIndexes(){this.querySelector("[data-index]")||this.resetIndexes()}onChange(event){this.ensureIndexes(),super.onChange(event)}onButtonClick(event){this.ensureIndexes(),super.onButtonClick(event)}resetIndexes(){let newIndex=1;this.itemsToShow.forEach((item,index)=>{item.setAttribute("data-index",newIndex),item.setAttribute("aria-current",index===0?"true":"false"),newIndex++})}}customElements.define("media-dots",MediaDots);class XModal extends ModalElement{get shouldLock(){return!0}get shouldAppendToBody(){return!0}}customElements.define("x-modal",XModal);class LogoList extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get childElement(){return this.firstElementChild}get speed(){return this.hasAttribute("data-speed")?parseInt(this.getAttribute("data-speed")):16}get maximum(){return this.hasAttribute("data-maximum")?parseInt(this.getAttribute("data-maximum")):this.childElementWidth>0?Math.ceil(this.parentWidth/this.childElementWidth)+2:0}get direction(){return this.hasAttribute("data-direction")?this.getAttribute("data-direction"):"left"}get parentWidth(){return this.getWidth(this)}get childElementWidth(){return this.getWidth(this.childElement)}disconnectedCallback(){super.disconnectedCallback(),this.marquee&&(this.pause(),this.marquee.destroy())}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){if(!this.initialized){if(this.initialized=!0,this.childElementCount===1){this.cloned=!0,this.childElement.classList.add("animated");const maximum=this.maximum;for(let index=0;index<maximum;index++)this.clone=this.childElement.cloneNode(!0),this.clone.setAttribute("aria-hidden",!0),this.appendChild(this.clone),this.clone.querySelectorAll(".media").forEach(media=>media.classList.remove("loading"))}this.cloned&&(theme.config.isTouch?this.style.setProperty("--duration",`${33-this.speed}s`):(this.marquee=new Flickity(this,{prevNextButtons:!1,pageDots:!1,wrapAround:!0,freeScroll:!0,rightToLeft:this.direction==="right"}),this.marquee.x=0,this.play(),this.bindEvents()))}}bindEvents(){this.marquee&&(this.on(this,"mouseenter",this.pause),this.on(this,"mouseleave",this.play))}play(){this.marquee.x-=this.speed*.1,this.marquee.settle(this.marquee.x),this.requestId=requestAnimationFrame(this.play.bind(this))}pause(){this.requestId&&(cancelAnimationFrame(this.requestId),this.requestId=void 0)}getWidth(element){const rect=element.getBoundingClientRect();return rect.right-rect.left}}customElements.define("logo-list",LogoList);class TextScrolling extends BaseElement{constructor(){super(),this.items.forEach(item=>{const header=item.querySelector(".heading"),stopScroll=Motion.scroll(Motion.animate(header,{opacity:[0,0,1,1,1,0,0]}),{target:header,offsets:["33vh","66vh"]});this.registerCleanup(stopScroll)})}get items(){return this._items=this._items||Array.from(this.children)}}customElements.define("text-scrolling",TextScrolling);class TabsElement extends BaseElement{connectedCallback(){super.connectedCallback(),this.selectedIndex=this.selectedIndex,this.buttons.forEach((button,index)=>this.on(button,"click",()=>this.selectedIndex=index)),Shopify.designMode&&this.on(this,"shopify:block:select",event=>this.selectedIndex=this.buttons.indexOf(event.target))}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.buttons.length-1).toString())}get buttons(){return this._buttons=this._buttons||Array.from(this.querySelectorAll('button[role="tab"]'))}get indicators(){return this._indicators=this._indicators||Array.from(this.querySelectorAll(".indicators"))}load(){const toButton=this.buttons[parseInt(this.selectedIndex)];if(toButton===void 0)return;const toPanel=document.getElementById(toButton.getAttribute("aria-controls"));Motion.animate(toPanel,{transform:["translateY(2rem)","translateY(0)"],opacity:[0,1]},{duration:theme.config.motionReduced?0:.15});const motionList=toPanel.querySelector("motion-list");motionList&&motionList.initialized&&motionList.load()}unload(){const fromButton=this.buttons[parseInt(this.selectedIndex)];if(fromButton===void 0)return;const fromPanel=document.getElementById(fromButton.getAttribute("aria-controls"));Motion.animate(fromPanel,{transform:["translateY(0)","translateY(2rem)"],opacity:[1,0]},{duration:theme.config.motionReduced?0:.15});const motionList=fromPanel.querySelector("motion-list");motionList&&motionList.initialized&&motionList.unload()}attributeChangedCallback(name,oldValue,newValue){if(this.buttons.forEach((button,index)=>{button.classList.toggle("button--primary",index===parseInt(newValue)),button.classList.toggle("button--secondary",index!==parseInt(newValue)),button.disabled=index===parseInt(newValue)}
24),this.indicators.forEach((indicators,index)=>{indicators.hidden=index!==parseInt(newValue),index===parseInt(newValue)&&indicators.querySelectorAll("button").forEach(button=>{button?.unload(),button?.load()})}),name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const fromButton=this.buttons[parseInt(oldValue)],toButton=this.buttons[parseInt(newValue)];this.transition(document.getElementById(fromButton.getAttribute("aria-controls")),document.getElementById(toButton.getAttribute("aria-controls")))}}async transition(fromPanel,toPanel){fromPanel&&await Motion.animate(fromPanel,{transform:["translateY(0)","translateY(2rem)"],opacity:[1,0]},{duration:theme.config.motionReduced?0:.15}).finished,fromPanel.hidden=!0,toPanel.hidden=!1,Motion.animate(toPanel,{transform:["translateY(2rem)","translateY(0)"],opacity:[0,1]},{duration:theme.config.motionReduced?0:.15});const motionList=toPanel.querySelector("motion-list");motionList&&motionList.initialized&&motionList.load(),theme.a11y.trapFocus(this,toPanel.querySelector("slider-element")||toPanel.querySelector("a"))}}customElements.define("tabs-element",TabsElement);class CountdownTimer extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}get date(){return this._date=this._date||new Date(this.getAttribute("data-expires"))}get isCompact(){return this.getAttribute("data-compact")==="true"||this.getAttribute("data-compact")==="mobile"&&theme.config.mqlSmall}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){this.initialized||(this.initialized=!0,this.calculate(),this.timerInterval=setInterval(this.calculate.bind(this),1e3),this.registerCleanup(()=>clearInterval(this.timerInterval)))}calculate(){const now=new Date,countTo=new Date(this.date),timeDifference=countTo-now;if(timeDifference<0){this.complete();return}const secondsInADay=3600*1e3*24,secondsInAHour=3600*1e3,days=Math.floor(timeDifference/secondsInADay*1),hours=Math.floor(timeDifference%secondsInADay/secondsInAHour*1),mins=Math.floor(timeDifference%secondsInADay%secondsInAHour/(60*1e3)*1),secs=Math.floor(timeDifference%secondsInADay%secondsInAHour%(60*1e3)/1e3*1);if(this.isCompact){const dayHTML=days>0?`<div class="countdown__item"><p>${days}${theme.dateStrings.d}</p></div>`:"",hourHTML=`<div class="countdown__item"><p>${hours}${theme.dateStrings.h}</p></div>`,minHTML=`<div class="countdown__item"><p>${mins}${theme.dateStrings.m}</p></div>`,secHTML=`<div class="countdown__item"><p>${secs}${theme.dateStrings.s}</p></div>`;this.innerHTML=dayHTML+hourHTML+minHTML+secHTML}else{const dayHTML=days>0?`<div class="countdown__item"><p>${days}</p><span>${days===1?theme.dateStrings.day:theme.dateStrings.days}</span></div>`:"",hourHTML=`<div class="countdown__item"><p>${hours}</p><span>${hours===1?theme.dateStrings.hour:theme.dateStrings.hours}</span></div>`,minHTML=`<div class="countdown__item"><p>${mins}</p><span>${mins===1?theme.dateStrings.minute:theme.dateStrings.minutes}</span></div>`,secHTML=`<div class="countdown__item"><p>${secs}</p><span>${secs===1?theme.dateStrings.second:theme.dateStrings.seconds}</span></div>`;this.innerHTML=dayHTML+hourHTML+minHTML+secHTML}}complete(){this.timerInterval&&clearInterval(this.timerInterval),this.hidden=!0}}customElements.define("countdown-timer",CountdownTimer);class ImageComparison extends BaseElement{constructor(){super(),Motion.inView(this,async()=>{await theme.utils.imageLoaded(this.media),this.init()})}get button(){return this.querySelector("button")}get bounding(){return this.getBoundingClientRect()}get horizontal(){return this.getAttribute("data-layout")==="horizontal"}get media(){return Array.from(this.querySelectorAll("img, svg"))}init(){this.active=!1,this.on(this.button,"touchstart",this.startHandler.bind(this),theme.supportsPassive?{passive:!1}:!1),this.on(document.body,"touchend",this.endHandler.bind(this),theme.supportsPassive?{passive:!0}:!1),this.on(document.body,"touchmove",this.onHandler.bind(this),theme.supportsPassive?{passive:!0}:!1),this.on(this.button,"mousedown",this.startHandler.bind(this)),this.on(document.body,"mouseup",this.endHandler.bind(this)),this.on(document.body,"mousemove",this.onHandler.bind(this)),setTimeout(()=>this.animate(),1e3)}animate(){this.setAttribute("animate",""),this.classList.add("animated"),setTimeout(()=>{this.classList.remove("animated")},1e3)}startHandler(event){event.preventDefault(),this.active=!0,this.classList.add("scrolling")}endHandler(){this.active=!1,this.classList.remove("scrolling")}onHandler(e){if(!this.active)return;const event=e.touches&&e.touches[0]||e;let x=this.horizontal?event.pageX-(this.bounding.left+window.scrollX):event.pageY-(this.bounding.top+window.scrollY);this.scrollIt(x)}scrollIt(x){const distance=this.horizontal?this.clientWidth:this.clientHeight,max=distance-20,mousePercent=Math.max(20,Math.min(x,max))*100/distance;this.style.setProperty("--percent",mousePercent+"%")}}customElements.define("image-comparison",ImageComparison);class LookbookElement extends BaseElement{constructor(){super(),Motion.inView(this,async()=>{await theme.utils.imageLoaded(this.media),this.init()})}get media(){return Array.from(this.querySelectorAll("img, svg"))}get items(){return this._items=this._items||Array.from(this.querySelectorAll(".hotspot"))}
24init(){if(this.items.forEach(item=>{this.on(item,"mouseenter",event=>{this.select(this.items.indexOf(event.target))})}),this.items.forEach(item=>{this.on(item,"keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),this.select(this.items.indexOf(event.target)))})}),Shopify.designMode){const section=this.closest(".shopify-section");this.on(section,"shopify:section:select",this.animate.bind(this)),this.on(section,"shopify:section:deselect",this.closeAll.bind(this)),this.on(this,"shopify:block:select",event=>this.open(this.items.indexOf(event.target)))}setTimeout(()=>this.animate(),1e3)}animate(){this.openAll(),this.timer=setTimeout(()=>this.closeAll(),3e3)}open(selectedIndex){this.items.forEach((item,index)=>item.classList.toggle("active",selectedIndex===index))}openAll(){this.items.forEach(item=>item.classList.add("active"))}closeAll(){this.items.forEach(item=>item.classList.remove("active")),clearTimeout(this.timer)}select(selectedIndex){const selectedItem=this.items[selectedIndex];!selectedItem||selectedItem.getAttribute("aria-current")==="true"||(this.items.forEach((item,index)=>item.setAttribute("aria-current",selectedIndex===index?"true":"false")),this.dispatchEvent(new CustomEvent("lookbook:change",{bubbles:!0,detail:{index:selectedIndex}})))}}customElements.define("lookbook-element",LookbookElement);class ShopTheLook extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(this.lookbook,"lookbook:change",event=>this.carousel.select(event.detail.index)),this.on(this.carousel,"carousel:change",event=>this.lookbook.select(event.detail.index))}get lookbook(){return this.querySelector("lookbook-element")}get carousel(){return this.querySelector("carousel-element")}}customElements.define("shop-the-look",ShopTheLook);class SpinningText extends HTMLElement{constructor(){super(),!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"}):new theme.initWhenVisible(this.init.bind(this))}get string(){let string=this.getAttribute("data-string");return string=string.replace(/ +/g," "),"\u2022"+string.replace(/ +/g,"\u2022")}init(){if(this.initialized)return;this.initialized=!0;const canTrig=CSS.supports("(top: calc(sin(1) * 1px))"),OPTIONS={TEXT:this.string,SIZE:2,SPACING:2},HEADING=document.createElement("div"),chars=OPTIONS.TEXT.split("");this.style.setProperty("--char-count",chars.length);let charsHtml="";for(let c=0;c<chars.length;c++)charsHtml+=`<span aria-hidden="true" class="split-char" style="--char-index: ${c};">${chars[c]}</span>`;charsHtml+=`<span class="sr-only">${OPTIONS.TEXT}</span>`,HEADING.innerHTML=charsHtml,HEADING.classList="split-chars",this.style.setProperty("--font-size",OPTIONS.SIZE),this.style.setProperty("--character-width",OPTIONS.SPACING),this.style.setProperty("--radius",canTrig?"calc((var(--character-width) / sin(var(--inner-angle))) * -1ch)":`calc( 25 (${OPTIONS.SPACING} / ${Math.sin(360/this.children.length/(180/Math.PI))}) 26 * -1ch 27 )`),this.appendChild(HEADING)}}customElements.define("spinning-text",SpinningText);class SlideshowElement extends BaseElement{constructor(){super(),this.selectedIndex=this.selectedIndex,Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"})}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get items(){return this._items=this._items||Array.from(this.children)}get autoplay(){return this.hasAttribute("autoplay")}get speed(){return this.hasAttribute("autoplay")?parseInt(this.getAttribute("autoplay-speed"))*1e3:5e3}get adaptiveHeightProperty(){return!1}init(){if(this.initialized)return;this.initialized=!0;const that=this;if(this.items.length>1)this.slider=new Flickity(this,{accessibility:!1,pageDots:!1,prevNextButtons:!1,wrapAround:!0,rightToLeft:theme.config.rtl,autoPlay:this.autoplay?this.speed:!1,adaptiveHeightProperty:this.adaptiveHeightProperty,on:{ready:function(){const{selectedElement}=this;that.onReady(selectedElement)}}}),this.slider.on("change",this.onChange.bind(this)),this.bindEvents();else if(this.items.length===1){const selectedElement=this.firstChild;that.onReady(selectedElement)}}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}bindEvents(){this.slider&&(this.on(this,"slider:previous",()=>this.slider.previous()),this.on(this,"slider:next",()=>this.slider.next()),this.on(this,"slider:play",()=>this.slider.playPlayer()),this.on(this,"slider:pause",()=>this.slider.pausePlayer()),Shopify.designMode&&this.on(this,"shopify:block:select",event=>this.slider.select(this.items.indexOf(event.target))))}disconnectedCallback(){super.disconnectedCallback(),this.slider&&this.slider.destroy()}attributeChangedCallback(name,oldValue,newValue){if(name==="selected-index"&&oldValue!==null&&oldValue!==newValue){const fromElement=this.items[parseInt(oldValue)],toElement=this.items[parseInt(newValue)];toElement.querySelector("animate-element")?.refresh(),fromElement.getAttribute("data-type")==="video"&&theme.utils.visibleMedia(fromElement.querySelectorAll("video-media"))?.pause(),toElement.getAttribute("data-type")==="video"&&theme.utils.visibleMedia(toElement.querySelectorAll("video-media"))?.play()}}onChange(){this.selectedIndex=this.slider.selectedIndex,this.dispatchEvent(new CustomEvent("slider:change",{bubbles:!0,detail:{currentPage:this.slider.selectedIndex}}))}select(selectedIndex){this.slider.select(selectedIndex)}onReady(selectedElement){selectedElement.getAttribute("data-type")==="video"&&theme.utils.visibleMedia(selectedElement.querySelectorAll("video-media"))?.play(),!theme.config.isTouch&&document.body.hasAttribute("data-page-transition")&&selectedElement.querySelector("animate-element")?.refresh()}}customElements.define("slideshow-element",SlideshowElement);class SlideshowHero extends SlideshowElement{constructor(){super(),this.onScrollListener=theme.utils.throttle(this.onScrollHandler.bind(this))}connectedCallback(){super.connectedCallback(),this.on(window,"scroll",this.onScrollListener,{passive:!0}),this.registerCleanup(()=>this.onScrollListener.cancel())}get adaptiveHeightProperty(){return!0}get heroSection(){return this.closest(".hero-section")}get nextSection(){let nextSibling=this.heroSection.nextElementSibling;for(let i=0;i<20&&!(nextSibling.classList.contains("shopify-section")&&!nextSibling.classList.contains("header-section"));i++)nextSibling=nextSibling.nextElementSibling;return nextSibling&&nextSibling.nodeType!=1&&(nextSibling=document.getElementById("PageContainer")),nextSibling}onScrollHandler(){const bounding=this.nextSection.getBoundingClientRect();this.heroSection.classList.toggle("hero-scrolled",bounding.y<-30)}}customElements.define("slideshow-hero",SlideshowHero);class SlideshowWords extends BaseElement{constructor(){super(),this.selectedIndex=this.selectedIndex,this.controlledElement&&this.on(this.controlledElement,"slider:change",event=>this.selectedIndex=event.detail.currentPage)}static get observedAttributes(){return["selected-index"]}get selectedIndex(){return parseInt(this.getAttribute("selected-index"))||0}set selectedIndex(index){this.setAttribute("selected-index",Math.min(Math.max(index,0),this.items.length-1).toString())}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return this._items=this._items||Array.from(this.children)}attributeChangedCallback(name,oldValue,newValue){name==="selected-index"&&oldValue!==null&&oldValue!==newValue&&this.transition(this.items[parseInt(oldValue)],this.items[parseInt(newValue)])}transition(fromElement,toElement){const fromWords=Array.from(fromElement.querySelectorAll("animate-element")),toWords=Array.from(toElement.querySelectorAll("animate-element"));fromWords.forEach(element=>element.reset()),setTimeout(()=>
27{this.items.forEach(item=>{item.setAttribute("aria-current",parseInt(item.getAttribute("data-index"))===parseInt(this.selectedIndex)?"true":"false")}),toWords.forEach(element=>element.refresh())},500+30*fromWords.length)}}customElements.define("slideshow-words",SlideshowWords,{extends:"nav"});class SlideshowParallax extends BaseElementMixin(HTMLDivElement){constructor(){super(),this.load()}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get mobileDisabled(){return!1}load(){theme.config.motionReduced||this.mobileDisabled&&(theme.config.isTouch||theme.config.mqlSmall)||this.motion()}motion(){const cancelParallax=Motion.scroll(Motion.animate(this,{transform:[`translateY(${this.getAttribute("data-start")})`,`translateY(${this.getAttribute("data-stop")})`]}),{target:this.controlledElement??document.body,offset:Motion.ScrollOffset.Exit});this.registerCleanup(cancelParallax)}}customElements.define("slideshow-parallax",SlideshowParallax,{extends:"div"});class ControlButton extends BaseElementMixin(HTMLButtonElement){constructor(){super(),this.pauseLabel=this.getAttribute("data-pause-label"),this.playLabel=this.getAttribute("data-play-label")}connectedCallback(){super.connectedCallback(),this.on(this,"click",this.onClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get paused(){return this.hasAttribute("paused")}static get observedAttributes(){return["paused"]}attributeChangedCallback(name,oldValue,newValue){if(name==="paused"){if(this.updateAriaLabel(),oldValue===null&&newValue==="")return(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:pause",{bubbles:!0}));if(newValue===null)return(this.controlledElement??this).dispatchEvent(new CustomEvent("slider:play",{bubbles:!0}))}}onClick(){this.paused?this.removeAttribute("paused"):this.setAttribute("paused","")}updateAriaLabel(){this.setAttribute("aria-label",this.paused?this.playLabel:this.pauseLabel)}}customElements.define("control-button",ControlButton,{extends:"button"});class QuickView extends XModal{get selector(){return".quick-view__content"}connectedCallback(){super.connectedCallback();const cartUpdateUnsubscriber=theme.pubsub.subscribe(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.hide.bind(this));this.registerCleanup(cartUpdateUnsubscriber)}beforeShow(){super.beforeShow(),this.quickview()}afterShow(){super.afterShow(),document.dispatchEvent(new CustomEvent("quickview:open",{detail:{productUrl:this.getAttribute("data-product-url")}}))}afterHide(){super.afterHide(),this.quickviewAbortController?.abort();const drawerContent=this.querySelector(this.selector);drawerContent.innerHTML=""}quickview(){const drawerContent=this.querySelector(this.selector),sectionUrl=`${this.getAttribute("data-product-url").split("?")[0]}?view=modal`;this.quickviewAbortController?.abort(),this.quickviewAbortController=new AbortController;const{signal}=this.quickviewAbortController;fetch(sectionUrl,{signal}).then(response=>response.text()).then(responseText=>{setTimeout(()=>{if(signal.aborted)return;const parsedHTML=new DOMParser().parseFromString(responseText,"text/html"),productElement=(parsedHTML.getElementById("MainContent")||parsedHTML).querySelector(this.selector);if(!productElement){console.error("[QuickView] Missing content in response:",sectionUrl),this.hide();return}this.setInnerHTML(drawerContent,productElement.innerHTML),theme.a11y.trapFocus(this,this.focusElement),window.Shopify&&Shopify.PaymentButton&&Shopify.PaymentButton.init(),document.dispatchEvent(new CustomEvent("quickview:loaded",{detail:{productUrl:this.getAttribute("data-product-url")}}))},200)}).catch(e=>{e.name!=="AbortError"&&console.error(e)})}setInnerHTML(element,innerHTML){element.innerHTML=innerHTML,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}}customElements.define("quick-view",QuickView);class FiltersToggle extends HoverButton{constructor(){if(super(),theme.config.hasLocalStorage){const expanded=window.localStorage.getItem(`${theme.settings.themeName}:filters-toggle`)||"false";this.onToggle(expanded==="true")}}connectedCallback(){super.connectedCallback(),this.on(this,"click",this.onClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get expanded(){return this.getAttribute("aria-expanded")==="true"}onClick(){this.onToggle(this.expanded)}onToggle(expanded){this.setAttribute("aria-expanded",expanded?"fal
27se":"true"),this.controlledElement&&this.controlledElement.classList.toggle("xl:block",!expanded),theme.config.hasLocalStorage&&window.localStorage.setItem(`${theme.settings.themeName}:filters-toggle`,expanded)}}customElements.define("filters-toggle",FiltersToggle,{extends:"button"});class RevealBanner extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){if(this.initialized)return;this.initialized=!0;const tracker=this.querySelector(".reveal-banner__tracker"),stopMediaReveal=Motion.scroll(Motion.animate(this.querySelectorAll(".banner__media"),{clipPath:["inset(20% 35% 0% 35% round var(--rounded-block))","inset(0% 0%)"]},{easing:"linear"}),{target:tracker,offset:Motion.ScrollOffset.Enter});this.registerCleanup(stopMediaReveal);const tracker2nd=this.querySelector(".reveal-banner__tracker2nd");if(tracker2nd){const stopContentReveal=Motion.scroll(Motion.timeline([[this.querySelector(".banner__overlay"),{opacity:[0,1]},{easing:"linear"}],[this.querySelector(".banner__content"),{opacity:[0,1],visibility:["hidden","visible"],transform:["translateY(10%)","translateY(0)"]},{easing:"linear",at:"<"}]]),{target:tracker2nd,offset:Motion.ScrollOffset.Enter});this.registerCleanup(stopContentReveal)}}}customElements.define("reveal-banner",RevealBanner);class TestimonialParallax extends ParallaxElement{get mobileDisabled(){return!0}}customElements.define("testimonial-parallax",TestimonialParallax,{extends:"div"});class SplittingBanner extends BaseElement{constructor(){super(),Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"})}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){if(this.initialized)return;this.initialized=!0;const splitting=this.splitResult=this.splitResult||Splitting({target:this.querySelector(".splitting"),by:"chars",whitespace:!0}),wrapper=this.querySelector(".splitting-wrapper"),tracker=this.querySelector(".reveal-banner__tracker"),stopCharsReveal=Motion.scroll(Motion.timeline([[splitting[0].chars,{opacity:[.3,1]},{delay:theme.config.motionReduced?0:Motion.stagger(.1)}]]),{target:tracker,offset:Motion.ScrollOffset.Enter});this.registerCleanup(stopCharsReveal);const stopWrapperFade=Motion.scroll(Motion.animate(wrapper,{opacity:theme.config.mqlSmall?[1,0,0]:[1,1,0]},{easing:"linear"}),{target:tracker,offset:Motion.ScrollOffset.Exit});this.registerCleanup(stopWrapperFade);const tracker2nd=this.querySelector(".reveal-banner__tracker2nd");if(tracker2nd){const stopButtonReveal=Motion.scroll(Motion.animate(this.querySelector(".button-wrapper"),{opacity:[0,1,1],transform:["translateY(100%)","translateY(0)"]},{easing:"linear"}),{target:tracker2nd,offset:Motion.ScrollOffset.Enter});this.registerCleanup(stopButtonReveal)}}}customElements.define("splitting-banner",SplittingBanner);class ProductCardInfo extends ProductInfo{constructor(){super(),this._sectionId="ProductCard-template"}get pickerType(){return this.getAttribute("data-picker-type")}buildRequestUrlWithParams(url,optionValues){const params=[];return params.push("view=bundle-card"),optionValues.length&¶ms.push(`option_values=${optionValues.join(",")}`),`${url}?${params.join("&")}`}updateSourceFromDestination(parsedHTML,id){const source=parsedHTML.getElementById(`${id}-${this._sectionId}-${this.productId}`),destination=document.querySelector(`#${id}-${this.sectionId}-${this.productId}`);source&&destination&&(destination.innerHTML=source.innerHTML,destination.removeAttribute("hidden"))}get gallerySourceSectionId(){return this._sectionId}updateOptionValues(parsedHTML){const variantPicker=parsedHTML.getElementById(`VariantPicker-${this._sectionId}-${this.productId}-${this.pickerType}`);variantPicker&&theme.HTMLUpdateUtility.viewTransition(this.variantSelectors,variantPicker,this.preProcessHtmlCallbacks)}getSelectedVariant(productInfoNode){const selectedVariant=productInfoNode.querySelector(`product-card-info[data-product-id="${this.productId}"] [data-selected-variant]`)?.textContent;return selectedVariant?JSON.parse(selectedVariant):null}}customElements.define("product-card-info",ProductCardInfo);class ProductBundleForm extends BaseElementMixin(HTMLFormElement){connectedCallback(){super.connectedCallback(),this.querySelector('[name="id"]').disabled=!1,this.on(this,"submit",this.onSubmitHandler)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get submitButton(){return this._submitButton=this._submitButton||this.querySelector('[type="submit"]')}getSelectedVariant(){const selectedVariant=this.querySelector("[data-selected-variant]")?.textContent;return selectedVariant?JSON.parse(selectedVariant):null}onSubmitHandler(event){if(event.preventDefault(),this.submitButton.hasAttribute("aria-disabled"))return;const product=this.closest(".product-card"),variant=this.getSelectedVariant();variant.default_featured_media=this.hasAttribute("data-product-image")?this.getAttribute("data-product-image"):"",this.submitButton.removeAttribute("aria-busy"),(this.controlledElement??this).dispatchEvent(new CustomEvent("bundle:added",{bubbles:!0,detail:{product,variant}}
27))}handleErrorMessage(){}toggleSubmitButton(disable=!0,text){if(!this.submitButton)return;const submitButtonText=this.submitButton.querySelector(".btn-text"),submitButtonTextChild=this.submitButton.querySelector(".btn-text>span");disable?(this.submitButton.setAttribute("disabled",""),text&&((submitButtonTextChild||submitButtonText).textContent=text)):(this.submitButton.removeAttribute("disabled"),(submitButtonTextChild||submitButtonText).textContent=theme.variantStrings.addToBundle)}}customElements.define("product-bundle-form",ProductBundleForm,{extends:"form"});class ProductBundleRemoveButton extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(this,"click",event=>{const variant=event.target.closest("[data-product-bundle-variant]");(this.controlledElement??this).dispatchEvent(new CustomEvent("bundle:removed",{bubbles:!0,detail:{variant}}))})}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}}customElements.define("product-bundle-remove-button",ProductBundleRemoveButton);class ProductBundleToggleButton extends BaseElement{connectedCallback(){super.connectedCallback(),this.on(this,"click",()=>{this.controlledElement.classList.toggle("active")})}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}}customElements.define("product-bundle-toggle-button",ProductBundleToggleButton);class ProductBundle extends BaseElement{constructor(){super(),this.template,this.bundleCount=0}connectedCallback(){super.connectedCallback(),this.on(this,"bundle:added",this.onAddHandler.bind(this)),this.on(this,"bundle:removed",this.onRemoveHandler.bind(this)),this.on(this,"change",theme.utils.debounce(this.onChangeHandler.bind(this),300)),this.on(this.submitButton,"click",this.onSubmitHandler.bind(this))}get bundleMin(){return this.hasAttribute("data-minimum")?parseInt(this.getAttribute("data-minimum")):3}get bundleMax(){const minimum=this.bundleMin,maximum=this.hasAttribute("data-maximum")?parseInt(this.getAttribute("data-maximum")):3;return maximum>minimum?maximum:minimum}get variants(){return Array.from(this.querySelectorAll("[data-product-bundle-variant]"))}get submitButton(){return this.querySelector("[data-product-bundle-submit]")}get cartDrawer(){return document.querySelector("cart-drawer")}get preventDuplicate(){return this.hasAttribute("data-prevent-duplicate")}get template(){return this._template=this._template||this.querySelector("[data-product-bundle-variant][available]").cloneNode(!0)}onChangeHandler(){this.updateTotal(),this.updateTotalWithCurrency(),this.updateProgressBar()}onSubmitHandler(event){if(!this.variants.every(variant=>{const target=variant.querySelector("quantity-input").input,inputValue=parseInt(target.value);let message="";return inputValue<parseInt(target.getAttribute("data-min"))?message=theme.quickOrderListStrings.minError.replace("[min]",target.getAttribute("data-min")):inputValue>parseInt(target.max)?message=theme.quickOrderListStrings.maxError.replace("[max]",target.max):inputValue%parseInt(target.step)!==0&&(message=theme.quickOrderListStrings.stepError.replace("[step]",target.step)),message?(target.setCustomValidity(message),target.reportValidity(),target.value=target.defaultValue,target.select(),!1):!0}))return;const data={items:this.variants.map(variant=>({id:variant.getAttribute("data-variant-id"),quantity:variant.querySelector("quantity-input").value||1}))};if(document.body.classList.contains("template-cart")||theme.settings.cartType==="page"){theme.utils.postLink2(theme.routes.cart_add_url,{parameters:{...data}});return}if(event.preventDefault(),this.submitButton.hasAttribute("aria-disabled"))return;this.activeElement=event.submitter||event.currentTarget,this.handleErrorMessage();let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:bundled-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const body=JSON.stringify({...data,sections:sectionsToBundle,sections_url:window.location.pathname});this.error=!1,this.submitButton.setAttribute("aria-disabled","true"),this.submitButton.setAttribute("aria-busy","true"),fetch(theme.routes.cart_add_url,{...theme.utils.fetchConfig("javascript"),body}).then(response=>response.json()).then(async parsedState=>{if(parsedState.status){this.handleErrorMessage(parsedState.description),document.dispatchEvent(new CustomEvent("ajaxProduct:error",{detail:{errorMessage:parsedState.description}}));const submitButtonText=this.submitButton.querySelector(".btn-text>span");submitButtonText&&submitButtonText.hasAttribute("data-sold-out")&&(submitButtonText.innerText=submitButtonText.getAttribute("data-sold-out"),this.submitButton.setAttribute("aria-disabled","true"),this.error=!0);const cartJson2=await(await fetch(theme.routes.cart_url,{...theme.utils.fetchConfig("json","GET")})).json();theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{source:"product-bundle",cart:cartJson2}),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{open:!1}})),this.resetVariants();return}const cartJson=await(await fetch(theme.routes.cart_url,{...theme.utils.fetchConfig("json","GET")})).json();cartJson.sections=parsedState.sections,theme.pubsub.publish(theme.pubsub.PUB_SUB_EVENTS.cartUpdate,{source:"product-bundle",cart:cartJson}),document.dispatchEvent(new CustomEvent("ajaxProduct:added",{detail:{product:parsedState}})),this.cartDrawer?.show(this.activeElement),this.resetVariants()}).catch(error=>{console.error(error)}).finally(()=>{this.submitButton.removeAttribute("aria-busy"),this.error||this.submitButton.removeAttribute("aria-disabled")})}handleErrorMessage(errorMessage=!1){this.hideErrors||(this.errorMessage=this.errorMessage||this.querySelector(".product-form__error-message"),this.errorMessage&&(this.errorMessage.toggleAttribute("hidden",!errorMessage),this.errorMessage.innerText=errorMessage))}onAddHandler(event){this.addVariant(event.detail.product,event.detail.variant),this.updateTotal(),this.updateTotalWithCurrency(),this.updateProgressBar()}onRemoveHandler(event){this.clearVariant(event.detail.variant),this.reorderVariants(),this.updateTotal(),this.updateTotalWithCurrency(),this.updateProgressBar()}updateTotal(){let subtotal=0;
27this.variants.forEach(variant=>{if(!variant.hasAttribute("available")){const price=variant.querySelector("[data-product-bundle-variant-price]"),quantityInput=variant.querySelector("quantity-input");subtotal+=parseInt(price.getAttribute("data-price"))*parseInt(quantityInput.value)}});const element=this.querySelector("[data-product-bundle-total]");element.innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyFormat)}updateTotalWithCurrency(){let subtotal=0;this.variants.forEach(variant=>{if(!variant.hasAttribute("available")){const price=variant.querySelector("[data-product-bundle-variant-price]"),quantityInput=variant.querySelector("quantity-input");subtotal+=parseInt(price.getAttribute("data-price"))*parseInt(quantityInput.value)}});const element=this.querySelector("[data-product-bundle-total-with-currency]");element.innerHTML=theme.Currency.formatMoney(subtotal,theme.settings.moneyWithCurrencyFormat)}updateProgressBar(){const percent=100*this.bundleCount/this.bundleMin;this.querySelector("[data-product-bundle-progress-bar]").style.setProperty("--progress",`${percent}%`)}addVariant(product,variant){this.bundleCount++,this.bundleCount>=this.bundleMin&&(this.submitButton.disabled=!1),this.bundleCount>=this.bundleMax&&this.closest(".product-bundle-wrapper").setAttribute("locked","");let variantElement=this.getAvailableAvriant();if(variantElement===null&&(variantElement=this.template.cloneNode(!0),variantElement.style.order=this.bundleCount,this.querySelector(".product-bundle__body").appendChild(variantElement)),variantElement){const preview_image=variant.featured_media?variant.featured_media.preview_image.src:variant.default_featured_media,media=variantElement.querySelector("[data-product-bundle-variant-media]");preview_image.length>0&&(media.removeAttribute("aria-hidden"),media.innerHTML=`<img src="${this.getResizedImageSrc(preview_image,180)}" srcset="${this.getResizedImageSrc(preview_image,180)} 180w, ${this.getResizedImageSrc(preview_image,360)} 360w, ${this.getResizedImageSrc(preview_image,540)} 540w" loading="lazy" is="lazy-image" />`);const content=variantElement.querySelector("[data-product-bundle-variant-content]");content.innerHTML=` 28 <div class="flex flex-col gap-1"> 29 <p class="horizontal-product__title font-medium text-base leading-tight">${product.querySelector("[data-product-bundle-title]").textContent}</p> 30 ${variant.options.length>0?` 31 <ul class="grid gap-1d5"> 32 ${variant.options.map(option=>{if(option!=="Default Title")return`<li class="text-xs text-opacity leading-tight">${option}</li>`}).join("")} 33 </ul> 34 `:""} 35 </div> 36 <div class="price text-sm flex flex-wrap gap-1d5" data-price="${variant.price}" data-product-bundle-variant-price> 37 ${theme.Currency.formatMoney(variant.price,theme.settings.moneyFormat)} 38 </div>`,variantElement.product=product,variantElement.setAttribute("data-variant-id",variant.id),variantElement.removeAttribute("available"),this.preventDuplicate&&product.setAttribute("locked","")}}clearVariant(variant){this.preventDuplicate&&variant.product.removeAttribute("locked"),variant.setAttribute("available",""),variant.removeAttribute("data-variant-id"),variant.querySelector("[data-product-bundle-variant-media]").innerHTML="",variant.querySelector("[data-product-bundle-variant-media]").classList.remove("loading"),variant.querySelector("[data-product-bundle-variant-media]").setAttribute("aria-hidden","true"),variant.querySelector("[data-product-bundle-variant-content]").innerHTML='<span class="horizontal-product__skeleton"></span><span class="horizontal-product__skeleton"></span>',variant.querySelector("quantity-input").reset(),this.bundleCount--,this.bundleCount<this.bundleMin?this.submitButton.disabled=!0:variant.remove(),this.bundleCount<this.bundleMax&&this.closest(".product-bundle-wrapper").removeAttribute("locked")}reorderVariants(){let order=0,minimum=Math.max(this.bundleMin,this.bundleCount)*-1;
38this.variants.forEach(variant=>{variant.style.order=variant.hasAttribute("available")?order++:minimum++})}resetVariants(){this.variants.forEach(variant=>{this.clearVariant(variant)}),this.reorderVariants(),this.updateTotal(),this.updateTotalWithCurrency(),this.updateProgressBar()}getAvailableAvriant(){return this.querySelector("[data-product-bundle-variant][available]")}getResizedImageSrc(src,size){return`${src}${src.includes("?")?"&":"?"}width=${size}&height=${size}`.replace(/\n|\r|\s/g,"")}}customElements.define("product-bundle",ProductBundle);class NumberCounter extends HTMLElement{constructor(){super(),!theme.config.motionReduced&&(!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"}):new theme.initWhenVisible(this.init.bind(this)))}init(){if(this.initialized)return;this.initialized=!0;const matches=this.textContent.trim().match(/\d+(?:[,. ]\d+)*/),toReplace=matches[0].replace(/[,\. ]+/,"");Motion.animate(progress=>{const formattedString=Math.round(progress*parseInt(toReplace)).toString();this.textContent=progress===1?matches[0]:formattedString},{duration:parseFloat(this.getAttribute("data-duration")),easing:[.16,1,.3,1]})}}customElements.define("number-counter",NumberCounter);class ScrollingBanner extends BaseElement{constructor(){super(),!theme.config.isTouch||Shopify.designMode?Motion.inView(this,this.init.bind(this),{margin:"600px 0px 600px 0px"}):new theme.initWhenVisible(this.init.bind(this))}get media(){return this._media=this._media||Array.from(this.querySelectorAll(".image-with-text__image>.media"))}get stickyElement(){return this.querySelector("sticky-element")}init(){this.initialized||(this.initialized=!0,this.detectScrollListener=theme.utils.throttle(this.onScrollHandler.bind(this)),this.mql=window.matchMedia("screen and (min-width: 1024px)"),this.mql.matches&&this.load(),this.mql.onchange=mql=>{mql.matches?this.load():this.unload()})}setMediaHeight(){let height=0;this.media.forEach(media=>{height+=media.getBoundingClientRect().height}),this.style.setProperty("--scrolling-height",`${height.toFixed(1)}px`)}onScrollHandler(){const scrollTop=window.scrollY;if(this.currentScrollTop===scrollTop)return;this.currentScrollTop=scrollTop;const offsetTop=this.getBoundingClientRect().top-parseFloat(this.stickyElement.inset),mediaElements=this.media,mediaCount=mediaElements.length;if(offsetTop<0){let activeIndex=1;for(let i=1;i<mediaCount;i++){const media=mediaElements[i],mediaHeight=media.getBoundingClientRect().height,mediaScrollTop=mediaHeight*(i-1);if(Math.abs(offsetTop)>mediaScrollTop){activeIndex=i;let progress=100-Math.floor((Math.abs(offsetTop)-mediaScrollTop)/mediaHeight*100);progress>95&&(progress=100),progress<5&&(progress=0),media.style.clipPath=`polygon(0 ${progress}%, 100% ${progress}%, 100% 100%, 0 100%)`,this.updateControlledElement(media,progress)}else media.style.clipPath=""}for(let i=activeIndex+1;i<mediaCount;i++){const media=mediaElements[i];this.updateControlledElement(media,100)}}else for(let i=1;i<mediaCount;i++){const media=mediaElements[i];media.style.clipPath="",this.updateControlledElement(media,100)}}updateControlledElement(media,progress){const controlledElement=media.hasAttribute("aria-controls")?document.getElementById(media.getAttribute("aria-controls")):null;controlledElement&&(progress===100&&controlledElement.classList.add("opacity-0","pointer-events-none"),progress===0&&controlledElement.classList.remove("opacity-0","pointer-events-none"))}load(){this.setMediaHeight(),window.addEventListener("scroll",this.detectScrollListener,{passive:!0})}unload(){window.removeEventListener("scroll",this.detectScrollListener),this.style.removeProperty("--scrolling-height"),this.media.forEach(media=>{media.style.clipPath=""})}disconnectedCallback(){super.disconnectedCallback(),window.removeEventListener("scroll",this.detectScrollListener),this.detectScrollListener?.cancel?.(),this.mql&&(this.mql.onchange=null)}}customElements.define("scrolling-banner",ScrollingBanner);class SecondaryVideo extends BaseElementMixin(HTMLDivElement){connectedCallback(){super.connectedCallback(),!(theme.config.motionReduced||theme.config.isTouch)&&this.videoMedia&&(this.on(this,"mouseenter",this.onEnterHandler),this.on(this,"mouseleave",this.onLeaveHandler))}get videoMedia(){return this.querySelector("video-media")}onEnterHandler(){const media=this.videoMedia;media&&media.hasAttribute("autoplay")&&media.play()}onLeaveHandler(){const media=this.videoMedia;media&&media.pause()}}customElements.define("secondary-video",SecondaryVideo,{extends:"div"});class SocialFeed extends XModal{constructor(){super(),this.onKeyup=this.onKeyup.bind(this)}get shouldCloseAll(){return!0}get lookbook(){return this.querySelector("lookbook-element")}get previousButton(){return this.querySelector('button[data-button="previous"]')}get nextButton(){return this.querySelector('button[data-button="next"]')}connectedCallback(){super.connectedCallback(),this.on(this,"keyup",this.onKeyup)}beforeShow(){super.beforeShow(),this.lookbook.closeAll()}async afterShow(){super.afterShow(),Motion.inView(this.lookbook,async()=>{await theme.utils.imageLoaded(this.lookbook.media),this.lookbook.animate()})}onKeyup(event){if(event.code==="ArrowLeft"||event.code==="ArrowRight"){const button=event.code==="ArrowLeft"?this.previousButton:this.nextButton;button&&!button.disabled&&(event.preventDefault(),button.dispatchEvent(new Event("click")))}}}customElements.define("social-feed",SocialFeed);class SocialFeedButton extends BaseElementMixin(HTMLButtonElement){connectedCallback(){super.connectedCallback(),this.on(this,"click",this.onButtonClick)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}onButtonClick(){this.controlledElement&&this.controlledElement.show()}}customElements.define("social-feed-button",SocialFeedButton,{extends:"button"});class IconsCarousel extends BaseElementMixin(HTMLDivElement){constructor(){super(),this.onUpdateTabindex(),this.onUpdateTabindex=this.onUpdateTabindex.bind(this),this.onEnterListener=this.onEnterHandler.bind(this),this.onLeaveListener=this.onLeaveHandler.bind(this)}get isScrollable(){const style=window.getComputedStyle(this),hasScrollableOverflow=style.overflow==="scroll"||style.overflow==="auto"||style.overflowY==="scroll"||style.overflowY==="auto"||style.overflowX==="scroll"||style.overflowX==="auto",hasScrollableContent=this.scrollHeight>this.clientHeight||this.scrollWidth>this.clientWidth;return hasScrollableOverflow&&hasScrollableContent}connectedCallback(){super.connectedCallback(),!theme.config.isTouch&&(this.on(this,"mouseenter",this.onEnterListener),this.on(this,"mouseleave",this.onLeaveListener),this.on(document,"matchSmall",this.onUpdateTabindex),this.on(document,"unmatchSmall",this.onUpdateTabindex))}onEnterHandler(){const scrollWidth=this.scrollWidth*(theme.config.rtl?-1:1);this.scrollTo({left:scrollWidth,behavior:theme.config.motionReduced?"auto":"smooth"})}onLeaveHandler(){this.scrollTo({left:0,behavior:theme.config.motionReduced?"auto":"smooth"})}onUpdateTabindex(){this.removeAttribute("tabindex"),this.isScrollable&&this.setAttribute("tabindex","0")}}customElements.define("icons-carousel",IconsCarousel,{extends:"div"});class ComparisonTable extends BaseElement{constructor(){super(),this.highlighted=!1,this.tableSticky=this.querySelector(".comparison-table__sticky"),this.tableSticky&&Motion.inView(this,this.init.bind(this))}get items(){return Array.from(this.querySelectorAll(".comparison-table__row"))}connectedCallback(){super.connectedCallback(),this.initialized&&(this.initialized=!1,this.init())}init(){if(this.initialized)return;this.initialized=!0,this.on(this,"scroll",theme.utils.throttle(this.onScrollHandler.bind(this))),this.on(this.tableSticky,"scroll",theme.utils.throttle(this.onStickyScrollHandler.bind(this)));const stopSticky=Motion.scroll(({y})=>{y.current>=y.targetOffset+this.tableSticky.clientHeight/2&&y.progress<.85?this.tableSticky.classList.add("active"):this.tableSticky.classList.remove("active")},{target:this,offset:["0 start","end 0"]});this.registerCleanup(stopSticky)}onScrollHandler(event){this.tableSticky.scrollTo({left:event.target.scrollLeft})}onStickyScrollHandler(event){this.scrollTo({left:event.target.scrollLeft})}
38highlight(){this.items.forEach(item=>{if(["thead","tfoot","sticky"].every(className=>!item.classList.contains(className)))if(this.highlighted){const columns=Array.from(item.querySelectorAll(".comparison-table__column")),first_column=columns[0];let highlighted=!1;columns.forEach(column=>{first_column.innerHTML!=column.innerHTML&&(highlighted=!0)}),item.classList.toggle("info",highlighted)}else item.classList.remove("info")})}}customElements.define("comparison-table",ComparisonTable);class ProductComparison extends BaseElementMixin(HTMLSelectElement){connectedCallback(){super.connectedCallback(),this.oldValue=this.value,this.on(this,"change",this.onChange)}get sectionId(){return this.getAttribute("data-section-id")}get column(){return this.getAttribute("data-column")}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return Array.from(this.controlledElement.querySelectorAll('select[is="product-comparison"]'))}get selectedArr(){return this.items.map(item=>item!==this?item.value:this.oldValue)}onChange(){const index=this.selectedArr.indexOf(this.value);if(index!==-1){this.changeSelected(this.value);const sibling=this.items[index];sibling&&(sibling.value=this.oldValue,sibling.dispatchEvent(new Event("change")))}else this.changeSelected(this.value);this.oldValue=this.value}changeSelected(productId){const blockJSON=theme.ProductComparisonJSON[this.sectionId]?.[productId];if(typeof blockJSON>"u")return;const column=this.items.indexOf(this)+1;for(let index=1;index<=25;index++){const element=this.controlledElement.querySelector(`[data-column="${column}"][data-index="${index}"]`);if(element){const heading=blockJSON[`heading_${index}`],value=blockJSON[`value_${index}`];element.innerHTML=heading.length?`<p class="h6 leading-tight tracking-none">${heading}</p>${this.unescape(value)}`:this.unescape(value)}}
38const product=this.controlledElement.querySelector(`[data-product="${column}"]`);product&&(product.innerHTML=document.getElementById(`ProductComparisonInfo-${this.sectionId}-${productId}`).innerHTML);const productSticky=this.controlledElement.querySelector(`[data-product-sticky="${column}"]`);productSticky&&(productSticky.innerHTML=document.getElementById(`ProductComparisonInfo-${this.sectionId}-${productId}`).innerHTML);const productAction=this.controlledElement.querySelector(`[data-product-action="${column}"]`);productAction&&(productAction.innerHTML=document.getElementById(`ProductComparisonAction-${this.sectionId}-${productId}`).innerHTML),this.controlledElement&&this.controlledElement.highlight()}unescape(input){return new DOMParser().parseFromString(input,"text/html").documentElement.textContent}}customElements.define("product-comparison",ProductComparison,{extends:"select"});class ComparisonHighlight extends BaseElementMixin(HTMLInputElement){connectedCallback(){super.connectedCallback(),this.on(this,"change",this.onChange)}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get items(){return Array.from(this.controlledElement.querySelectorAll(".comparison-table__row"))}onChange(){this.controlledElement&&(this.controlledElement.highlighted=this.checked,this.controlledElement.highlight())}}customElements.define("comparison-highlight",ComparisonHighlight,{extends:"input"});class ScrollSpy extends BaseElement{get scrollspyLinks(){return Array.from(this.querySelectorAll(".scrollspy-link"))}get backToTopButton(){return this.querySelector(".back-to-top")}get headerHeight(){let header=document.querySelector('.header-section header[is="sticky-header"]');return this.hasAttribute("aria-controls")&&(header=document.getElementById(this.getAttribute("aria-controls"))),header?header.getBoundingClientRect().height+this.topGap:this.offsetHeight<window.innerHeight?this.topGap:0}get topGap(){return this.hasAttribute("data-gap")?parseInt(this.getAttribute("data-gap")):20}get showHighlight(){return this.hasAttribute("data-highlight")}connectedCallback(){if(super.connectedCallback(),this.scrollspyLinks.forEach(link=>{this.on(link,"click",this.handleScrollspyLinkClick.bind(this))}),this.backToTopButton&&this.on(this.backToTopButton,"click",this.handleBackToTopClick.bind(this)),this.showHighlight){const onScroll=theme.utils.throttle(this.updateActiveLink.bind(this));this.on(window,"scroll",onScroll,{passive:!0}),this.registerCleanup(()=>onScroll.cancel()),this.updateActiveLink()}}handleScrollspyLinkClick(event){event.preventDefault();const link=event.currentTarget,targetIds=link.hasAttribute("data-target")?link.getAttribute("data-target").split(","):[],section=document.getElementById(targetIds[0]);if(section){const sectionTop=window.scrollY+section.getBoundingClientRect().top-this.headerHeight;window.scrollTo({top:sectionTop,behavior:theme.config.motionReduced?"auto":"smooth"})}}handleBackToTopClick(){window.scrollTo({top:0,behavior:theme.config.motionReduced?"auto":"smooth"})}updateActiveLink(){let current="";this.scrollspyLinks.forEach(link=>{(link.hasAttribute("data-target")?link.getAttribute("data-target").split(","):[]).forEach(targetId=>{const section=document.getElementById(targetId);if(section){const sectionTop=section.offsetTop-0,sectionBottom=sectionTop+section.offsetHeight;window.pageYOffset>=sectionTop&&window.pageYOffset<sectionBottom&&(current=targetId)}})}),this.scrollspyLinks.forEach(link=>{const targetIds=link.hasAttribute("data-target")?link.getAttribute("data-target").split(","):[];let active=!1;targetIds.forEach(targetId=>{targetId!==""&&targetId===current&&(active=!0)}),active?(link.setAttribute("aria-current","location"),link.classList.add("active")):(link.removeAttribute("aria-current"),link.classList.remove("active"))})}}customElements.define("scroll-spy",ScrollSpy,{extends:"nav"}); 39//# sourceMappingURL=/cdn/shop/t/30/assets/theme.js.map?v=130568254513685431671784100181
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.