function initLazyScript(element,callback,threshold=500){"IntersectionObserver"in window?new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&typeof callback=="function"&&(callback(),observer.unobserve(entry.target))})},{rootMargin:`0px 0px ${threshold}px 0px`}).observe(element):callback()}theme.stickyHeaderHeight=()=>{const v=getComputedStyle(document.documentElement).getPropertyValue("--theme-sticky-header-height");return v&&parseInt(v,10)||0},theme.getOffsetTopFromDoc=el=>el.getBoundingClientRect().top+window.scrollY,theme.getOffsetLeftFromDoc=el=>el.getBoundingClientRect().left+window.scrollX,theme.getScrollParent=node=>{const overflowY=node instanceof HTMLElement&&window.getComputedStyle(node).overflowY,isScrollable=overflowY!=="visible"&&overflowY!=="hidden";return node?isScrollable&&node.scrollHeight>node.clientHeight?node:theme.getScrollParent(node.parentNode)||document.scrollingElement||window:null},theme.scrollToRevealElement=el=>{const scrollContainer=theme.getScrollParent(el),scrollTop=scrollContainer===window?window.scrollY:scrollContainer.scrollTop,scrollVisibleHeight=scrollContainer===window?window.innerHeight:scrollContainer.clientHeight,elTop=theme.getOffsetTopFromDoc(el),elBot=elTop+el.offsetHeight,inViewTop=scrollTop+theme.stickyHeaderHeight(),inViewBot=scrollTop+scrollVisibleHeight-50;(elTopinViewBot)&&scrollContainer.scrollTo({top:elTop-100-theme.stickyHeaderHeight(),left:0,behavior:"smooth"})},theme.getEmptyOptionSelectors=formContainer=>{console.log("HHHHHHHH");const emptySections=[];return formContainer.querySelectorAll('[data-selector-type="dropdown"].option-selector').forEach(el=>{el.querySelector('[aria-selected="true"][data-value]:not([data-value=""])')||emptySections.push(el)}),formContainer.querySelectorAll('[data-selector-type="listed"].option-selector').forEach(el=>{el.querySelector("input:checked")||emptySections.push(el)}),emptySections},theme.suffixIds=(container,prefix)=>{const suffixCandidates=["id","for","aria-describedby","aria-controls"];for(let i=0;iel.setAttribute(suffixCandidates[i],el.getAttribute(suffixCandidates[i])+prefix))},theme.addDelegateEventListener=(element,eventName,selector,callback,addEventListenerParams=null)=>{const cb=evt=>{const el=evt.target.closest(selector);el&&element.contains(el)&&callback.call(el,evt,el)};return element.addEventListener(eventName,cb,addEventListenerParams),cb},theme.hideAndRemove=el=>{el.querySelectorAll("input").forEach(input=>{input.disabled=!0});const wrapper=document.createElement("div");wrapper.className="merge-remove-wrapper",el.parentNode.insertBefore(wrapper,el),wrapper.appendChild(el),el.classList.add("merge-remove-item"),wrapper.style.height=`${wrapper.clientHeight}px`;const cs=getComputedStyle(el),fadeDuration=parseFloat(cs.getPropertyValue("--fade-duration"))*1e3,slideDuration=parseFloat(cs.getPropertyValue("--slide-duration"))*1e3;setTimeout(()=>{wrapper.classList.add("merge-remove-wrapper--fade"),setTimeout(()=>{wrapper.classList.add("merge-remove-wrapper--slide"),setTimeout(()=>wrapper.remove(),slideDuration)},fadeDuration)},10)},theme.insertAndReveal=(el,target,iaeCmd,delay)=>{const initialDelay=delay||10;el.classList.add("merge-add-wrapper"),target.insertAdjacentElement(iaeCmd,el),el.style.height=`${el.firstElementChild.clientHeight}px`;const cs=getComputedStyle(el),fadeDuration=parseFloat(cs.getPropertyValue("--fade-duration"))*1e3,slideDuration=parseFloat(cs.getPropertyValue("--slide-duration"))*1e3;setTimeout(()=>{el.classList.add("merge-add-wrapper--slide"),setTimeout(()=>{el.classList.add("merge-add-wrapper--fade"),setTimeout(()=>{el.style.height="",el.classList.remove("merge-add-wrapper","merge-add-wrapper--slide","merge-add-wrapper--fade")},fadeDuration)},slideDuration)},initialDelay)},theme.mergeNodes=(newContent,targetContainer)=>{try{newContent.querySelectorAll("[data-merge]").forEach(newEl=>{const targetEl=targetContainer.querySelector(`[data-merge="${newEl.dataset.merge}"]`);(!newEl.dataset.mergeCache||!targetEl.dataset.mergeCache||newEl.dataset.mergeCache!==targetEl.dataset.mergeCache)&&(targetEl.innerHTML=newEl.innerHTML,(newEl.dataset.mergeCache||targetEl.dataset.mergeCache)&&(targetEl.dataset.mergeCache=newEl.dataset.mergeCache))}),newContent.querySelectorAll("[data-merge-attributes]").forEach(newEl=>{const targetEl=targetContainer.querySelector(`[data-merge-attributes="${newEl.dataset.mergeAttributes}"]`),newElAttributeNames=newEl.getAttributeNames();for(let i=0;i{const targetList=targetContainer.querySelector(`[data-merge-list="${newList.dataset.mergeList}"]`);let targetListItems=Array.from(targetList.querySelectorAll("[data-merge-list-item]"));const newListItems=Array.from(newList.querySelectorAll("[data-merge-list-item]"));targetListItems.forEach(targetListItem=>{newListItems.find(item=>item.dataset.mergeListItem===targetListItem.dataset.mergeListItem)||theme.hideAndRemove(targetListItem)}),targetListItems=Array.from(targetList.querySelectorAll("[data-merge-list-item]:not(.merge-remove-item)"));for(let i=0;iitem.dataset.mergeListItem===newListItem.dataset.mergeListItem);matchedItem?(!newListItem.dataset.mergeCache||!matchedItem.dataset.mergeCache||newListItem.dataset.mergeCache!==matchedItem.dataset.mergeCache)&&(matchedItem.innerHTML=newListItem.innerHTML,newListItem.dataset.mergeCache&&(matchedItem.dataset.mergeCache=newListItem.dataset.mergeCache)):(i===0?theme.insertAndReveal(newListItem,targetList,"afterbegin",500):i>=targetListItems.length?theme.insertAndReveal(newListItem,targetList,"beforeend",500):theme.insertAndReveal(newListItem,targetListItems[i],"beforebegin",500),targetListItems.splice(i,0,newListItem))}})}catch{window.location.reload()}},theme.showQuickPopup=(message,origin)=>{const offsetLeft=theme.getOffsetLeftFromDoc(origin),offsetTop=theme.getOffsetTopFromDoc(origin),originLeft=origin.getBoundingClientRect().left,popup=document.createElement("div");popup.className="simple-popup simple-popup--hidden",popup.innerHTML=message,popup.style.left=`${offsetLeft}px`,popup.style.top=`${offsetTop}px`,document.body.appendChild(popup);let marginLeft=-(popup.clientWidth-origin.clientWidth)/2;originLeft+marginLeft<0&&(marginLeft-=originLeft+marginLeft-2);const offsetRight=offsetLeft+marginLeft+popup.clientWidth+5;offsetRight>window.innerWidth&&(marginLeft-=offsetRight-window.innerWidth),popup.style.marginTop=-popup.clientHeight-10,popup.style.marginLeft=marginLeft,setTimeout(()=>{popup.classList.remove("simple-popup--hidden")},10),setTimeout(()=>{popup.classList.add("simple-popup--hidden")},3500),setTimeout(()=>{popup.remove()},4e3)},theme.manuallyLoadImages=container=>{container.querySelectorAll("img[data-manual-src]").forEach(el=>{el.src=el.dataset.manualSrc,el.removeAttribute("data-manual-src"),el.dataset.manualSrcset&&(el.srcset=el.dataset.manualSrcset,el.removeAttribute("data-manual-srcset"))})},theme.whenComponentLoaded=(component,callback)=>{const components=Symbol.iterator in Object(component)?[...component]:[component];if(!components.find(c=>!c.hasAttribute("loaded"))){callback();return}const onMutation=(mutationList,observer2)=>{for(let i=0;i!c.hasAttribute("loaded"))||(observer2.disconnect(),callback.call()))},observer=new MutationObserver(onMutation);components.forEach(c=>observer.observe(c,{attributes:!0,attributeFilter:["loaded"]}))};function debounce(fn,wait=300){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}window.addEventListener("resize",debounce(()=>{window.dispatchEvent(new CustomEvent("on:debounced-resize"))})),(()=>{const{mediaQueries}=theme;if(!mediaQueries)return;const mqKeys=Object.keys(mediaQueries),mqLists={};theme.mediaMatches={};const handleMqChange=()=>{const newMatches=mqKeys.reduce((acc,media)=>(acc[media]=!!(mqLists[media]&&mqLists[media].matches),acc),{});Object.keys(newMatches).forEach(key=>{theme.mediaMatches[key]=newMatches[key]}),window.dispatchEvent(new CustomEvent("on:breakpoint-change"))};mqKeys.forEach(mq=>{mqLists[mq]=window.matchMedia(mediaQueries[mq]),theme.mediaMatches[mq]=mqLists[mq].matches;try{mqLists[mq].addEventListener("change",handleMqChange)}catch{mqLists[mq].addListener(handleMqChange)}})})();function setHeaderHeight(){const header=document.querySelector(".js-header-height");if(!header)return;let height=header.offsetHeight;const announcement=document.querySelector(".cc-announcement"),announcementHeight=announcement?announcement.offsetHeight:0;height+=announcementHeight,document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--header-height",`${height}px`)}function setScrollbarWidth(){document.documentElement.style.setProperty("--scrollbar-width",`${window.innerWidth-document.documentElement.clientWidth}px`)}function setDimensionVariables(){setHeaderHeight(),setScrollbarWidth()}document.addEventListener("DOMContentLoaded",setDimensionVariables),window.addEventListener("resize",debounce(setDimensionVariables,400));function pauseAllMedia(el=document){el.querySelectorAll(".js-youtube, .js-vimeo, video").forEach(video=>{const component=video.closest("video-component");component&&component.dataset.background==="true"||(video.matches(".js-youtube")?video.contentWindow.postMessage('{ "event": "command", "func": "pauseVideo", "args": "" }',"*"):video.matches(".js-vimeo")?video.contentWindow.postMessage('{ "method": "pause" }',"*"):video.pause())}),el.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}class DeferredMedia extends HTMLElement{constructor(){super();const loadBtn=this.querySelector(".js-load-media");loadBtn?loadBtn.addEventListener("click",this.loadContent.bind(this)):this.addObserver()}addObserver(){if(!("IntersectionObserver"in window))return;const observer=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&(this.loadContent(!1,!1,"observer"),observer.unobserve(this))})},{rootMargin:"0px 0px 1000px 0px"});observer.observe(this)}loadContent(focus=!0,pause=!0,loadTrigger="click"){if(pause&&pauseAllMedia(),this.getAttribute("loaded")!==null)return;this.loadTrigger=loadTrigger;const content=this.querySelector("template").content.firstElementChild.cloneNode(!0);this.appendChild(content),this.setAttribute("loaded","");const deferredEl=this.querySelector("video, model-viewer, iframe");deferredEl&&focus&&deferredEl.focus()}}customElements.define("deferred-media",DeferredMedia);class DetailsDisclosure extends HTMLElement{constructor(){super(),this.disclosure=this.querySelector("details"),this.toggle=this.querySelector("summary"),this.panel=this.toggle.nextElementSibling,this.init()}init(){window.getComputedStyle(this.panel).transitionDuration!=="0s"&&(this.toggle.addEventListener("click",this.handleToggle.bind(this)),this.disclosure.addEventListener("transitionend",this.handleTransitionEnd.bind(this)))}handleToggle(evt){evt.preventDefault(),this.disclosure.open?this.close():this.open()}handleTransitionEnd(evt){evt.target===this.panel&&(this.disclosure.classList.contains("is-closing")&&(this.disclosure.classList.remove("is-closing"),this.disclosure.open=!1),this.panel.removeAttribute("style"))}addContentHeight(){this.panel.style.height=`${this.panel.scrollHeight}px`}open(){this.panel.style.height="0",this.disclosure.open=!0,this.addContentHeight()}close(){this.addContentHeight(),this.disclosure.classList.add("is-closing"),setTimeout(()=>{this.panel.style.height="0"})}}if(customElements.define("details-disclosure",DetailsDisclosure),!customElements.get("gift-card-recipient")){class GiftCardRecipient extends HTMLElement{connectedCallback(){this.recipientEmail=this.querySelector('[name="properties[Recipient email]"]'),this.recipientEmailLabel=this.querySelector(`label[for="${this.recipientEmail.id}"]`),this.recipientName=this.querySelector('[name="properties[Recipient name]"]'),this.recipientMessage=this.querySelector('[name="properties[Message]"]'),this.recipientSendOn=this.querySelector('[name="properties[Send on]"]'),this.recipientOffsetProperty=this.querySelector('[name="properties[__shopify_offset]"]'),this.recipientEmailLabel&&this.recipientEmailLabel.dataset.jsLabel&&(this.recipientEmailLabel.innerText=this.recipientEmailLabel.dataset.jsLabel),this.recipientOffsetProperty&&(this.recipientOffsetProperty.value=new Date().getTimezoneOffset().toString(),this.recipientOffsetProperty.removeAttribute("disabled")),this.recipientCheckbox=this.querySelector(".gift-card-recipient__checkbox"),this.recipientCheckbox.addEventListener("change",()=>this.synchronizeProperties()),this.synchronizeProperties()}synchronizeProperties(){this.recipientCheckbox.checked?(this.recipientEmail.setAttribute("required",""),this.recipientEmail.removeAttribute("disabled"),this.recipientName.removeAttribute("disabled"),this.recipientMessage.removeAttribute("disabled"),this.recipientSendOn.removeAttribute("disabled"),this.recipientOffsetProperty&&this.recipientOffsetProperty.removeAttribute("disabled")):(this.recipientEmail.removeAttribute("required"),this.recipientEmail.setAttribute("disabled",""),this.recipientName.setAttribute("disabled",""),this.recipientMessage.setAttribute("disabled",""),this.recipientSendOn.setAttribute("disabled",""),this.recipientOffsetProperty&&this.recipientOffsetProperty.setAttribute("disabled",""))}}customElements.define("gift-card-recipient",GiftCardRecipient)}const trapFocusHandlers={};function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function trapFocus(container,elementToFocus=container){const focusableEls=Array.from(container.querySelectorAll('summary, a[href], area[href], button:not([disabled]), input:not([type=hidden]):not([disabled]), select:not([disabled]), textarea:not([disabled]), object, iframe, audio[controls], video[controls], [tabindex]:not([tabindex^="-"])')),firstEl=focusableEls[0],lastEl=focusableEls[focusableEls.length-1];removeTrapFocus(),trapFocusHandlers.focusin=evt=>{evt.target!==container&&evt.target!==lastEl&&evt.target!==firstEl||document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=()=>{document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=evt=>{evt.code==="Tab"&&(evt.target===lastEl&&!evt.shiftKey&&(evt.preventDefault(),firstEl.focus()),(evt.target===container||evt.target===firstEl)&&evt.shiftKey&&(evt.preventDefault(),lastEl.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),(elementToFocus||container).focus()}class Modal extends HTMLElement{constructor(){super(),this.addEventListener("click",this.handleClick.bind(this))}handleClick(evt){evt.target!==this&&!evt.target.matches(".js-close-modal")||this.close()}open(opener){this.scrollY=window.scrollY,document.body.classList.add("fixed"),document.body.style.top=`-${this.scrollY}px`,this.setAttribute("open",""),this.openedBy=opener,trapFocus(this),window.pauseAllMedia(),this.keyupHandler=evt=>evt.key==="Escape"&&this.close(),this.addEventListener("keyup",this.keyupHandler),this.querySelectorAll("table").forEach(table=>{const wrapper=document.createElement("div");wrapper.className="scrollable-table",table.parentNode.insertBefore(wrapper,table),wrapper.appendChild(table)})}close(){document.body.style.top="",document.body.classList.remove("fixed"),window.scrollTo(0,this.scrollY),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia(),this.removeEventListener("keyup",this.keyupHandler)}}customElements.define("modal-dialog",Modal);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.getElementById(this.dataset.modal);modal&&modal.open(button)})}}customElements.define("modal-opener",ModalOpener);class SideDrawer extends HTMLElement{constructor(){super(),this.overlay=document.querySelector(".js-overlay")}handleClick(evt){(evt.target.matches(".js-close-drawer")||evt.target===this.overlay)&&this.close()}open(opener,elementToFocus,callback){this.dispatchEvent(new CustomEvent(`on:${this.dataset.name}:before-open`,{bubbles:!0})),this.scrollY=window.scrollY,document.body.classList.add("fixed"),document.body.style.top=`-${this.scrollY}px`,document.documentElement.style.height="100vh",this.overlay.classList.add("is-visible"),this.setAttribute("open",""),this.setAttribute("aria-hidden","false"),this.opener=opener,trapFocus(this,elementToFocus),this.clickHandler=this.clickHandler||this.handleClick.bind(this),this.keyupHandler=evt=>{evt.key!=="Escape"||evt.target.closest(".cart-drawer-popup")||this.close()},this.addEventListener("click",this.clickHandler),this.addEventListener("keyup",this.keyupHandler),this.overlay.addEventListener("click",this.clickHandler);const transitionDuration=parseFloat(getComputedStyle(this).getPropertyValue("--longest-transition-in-ms"));setTimeout(()=>{callback&&callback(),this.dispatchEvent(new CustomEvent(`on:${this.dataset.name}:after-open`,{bubbles:!0}))},transitionDuration)}close(callback){this.dispatchEvent(new CustomEvent(`on:${this.dataset.name}:before-close`,{bubbles:!0})),this.removeAttribute("open"),this.setAttribute("aria-hidden","true"),this.overlay.classList.remove("is-visible"),removeTrapFocus(this.opener),document.documentElement.style.height="",document.body.style.top="",document.body.classList.remove("fixed"),window.scrollTo(0,this.scrollY),this.removeEventListener("click",this.clickHandler),this.removeEventListener("keyup",this.keyupHandler),this.overlay.removeEventListener("click",this.clickHandler);const transitionDuration=parseFloat(getComputedStyle(this).getPropertyValue("--longest-transition-in-ms"));setTimeout(()=>{callback&&callback(),this.dispatchEvent(new CustomEvent(`on:${this.dataset.name}:after-close`,{bubbles:!0}))},transitionDuration)}}customElements.define("side-drawer",SideDrawer);class BuyButtons extends HTMLElement{constructor(){super(),window.initLazyScript(this,this.initLazySection.bind(this))}initLazySection(){this.dynamicPaymentButtonTemplate=this.querySelector(".dynamic-payment-button-template"),this.dynamicPaymentButtonTemplate&&(this.variantIdInput=this.querySelector('[name="id"]'),this.variantIdInput.value?this.tryInitDynamicPaymentButton():(this.boundTryInitDynamicPaymentButtonOnChange=this.tryInitDynamicPaymentButton.bind(this),this.variantIdInput.addEventListener("change",this.boundTryInitDynamicPaymentButtonOnChange)))}tryInitDynamicPaymentButton(){this.variantIdInput.value&&(this.boundTryInitDynamicPaymentButtonOnChange&&this.variantIdInput.removeEventListener("change",this.boundTryInitDynamicPaymentButtonOnChange),this.dynamicPaymentButtonTemplate.insertAdjacentHTML("afterend",this.dynamicPaymentButtonTemplate.innerHTML),this.dynamicPaymentButtonTemplate.remove(),Shopify.PaymentButton&&Shopify.PaymentButton.init())}}customElements.define("buy-buttons",BuyButtons);const CartForm=class extends HTMLElement{connectedCallback(){this.enableAjaxUpdate=this.dataset.ajaxUpdate,this.enableAjaxUpdate&&(this.sectionId=this.dataset.sectionId,this.boundRefresh=this.refresh.bind(this),document.addEventListener("on:cart:change",this.boundRefresh),theme.addDelegateEventListener(this,"click",".cart-item__remove",evt=>{evt.preventDefault(),this.adjustItemQuantity(evt.target.closest(".cart-item"),{to:0})}),theme.addDelegateEventListener(this,"click",".quantity-down",evt=>{evt.preventDefault(),this.adjustItemQuantity(evt.target.closest(".cart-item"),{decrease:!0})}),theme.addDelegateEventListener(this,"click",".quantity-up",evt=>{evt.preventDefault(),this.adjustItemQuantity(evt.target.closest(".cart-item"),{increase:!0})}),theme.addDelegateEventListener(this,"change",".cart-item__quantity-input",evt=>{this.adjustItemQuantity(evt.target.closest(".cart-item"),{currentValue:!0})}))}disconnectedCallback(){this.enableAjaxUpdate&&document.removeEventListener("on:cart:change",this.boundRefresh)}refresh(){this.classList.add("cart-form--refreshing"),fetch(`${window.Shopify.routes.root}?section_id=${this.sectionId}`).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(response=>{this.refreshFromHtml(response)})}refreshFromHtml(html){const frag=document.createDocumentFragment(),newContent=document.createElement("div");frag.appendChild(newContent),newContent.innerHTML=html,newContent.querySelectorAll("[data-cc-animate]").forEach(el=>el.removeAttribute("data-cc-animate")),theme.mergeNodes(newContent,this),this.classList.remove("cart-form--refreshing"),this.querySelectorAll(".merge-item-refreshing").forEach(el=>el.classList.remove("merge-item-refreshing")),this.dispatchEvent(new CustomEvent("on:cart:after-merge",{bubbles:!0,cancelable:!1})),theme.settings.afterAddToCart==="drawer"&&this.closest(".drawer")&&!this.closest(".drawer").hasAttribute("open")&&document.dispatchEvent(new CustomEvent("theme:open-cart-drawer",{bubbles:!0,cancelable:!1}))}adjustItemQuantity(item,change){const quantityInput=item.querySelector(".cart-item__quantity-input");let newQuantity=parseInt(quantityInput.value,10);typeof change.to<"u"?(newQuantity=change.to,quantityInput.value=newQuantity):change.increase?(newQuantity+=quantityInput.step||1,quantityInput.value=newQuantity):change.decrease?(newQuantity-=quantityInput.step||1,quantityInput.value=newQuantity):change.currentValue,quantityInput.max&&parseInt(quantityInput.value,10)>parseInt(quantityInput.max,10)&&(newQuantity=quantityInput.max,quantityInput.value=newQuantity,theme.showQuickPopup(theme.strings.cartItemsQuantityError.replace("[QUANTITY]",quantityInput.max),quantityInput)),clearTimeout(this.adjustItemQuantityTimeout),this.adjustItemQuantityTimeout=setTimeout(()=>{const updateParam={updates:{}};this.querySelectorAll(".cart-item__quantity-input:not([disabled])").forEach(el=>{updateParam.updates[el.dataset.key]=el.value,el.value!==el.dataset.initialValue&&el.closest("[data-merge-list-item]").classList.add("merge-item-refreshing")}),fetch(theme.routes.cartUpdate,{method:"POST",body:JSON.stringify(updateParam),headers:{"Content-Type":"application/json"}}).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);document.dispatchEvent(new CustomEvent("on:cart:change",{bubbles:!0,cancelable:!1}))}).catch(error=>{console.log(error.message),this.dispatchEvent(new CustomEvent("on:cart:error",{bubbles:!0,detail:{error:error.message}})),window.location.reload()})},newQuantity===0?10:700)}};window.customElements.define("cart-form",CartForm);const CCCartCrossSell=class extends HTMLElement{init(){this.productList=this.querySelector(".product-grid"),this.dataset.from&&fetch(this.dataset.from).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(response=>{const frag=document.createDocumentFragment(),newContent=document.createElement("div");frag.appendChild(newContent),newContent.innerHTML=response;const pl=newContent.querySelector(".product-grid");pl?(this.productList.innerHTML=pl.innerHTML,this.querySelectorAll(".product-block").forEach(el=>el.classList.add("slider__item")),this.querySelectorAll("carousel-slider").forEach(el=>el.refresh())):this.classList.add("hidden")})}};window.customElements.define("cc-cart-cross-sell",CCCartCrossSell);const CCFetchedContent=class extends HTMLElement{connectedCallback(){fetch(this.dataset.url).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(response=>{const frag=document.createDocumentFragment(),fetchedContent=document.createElement("div");frag.appendChild(fetchedContent),fetchedContent.innerHTML=response;const replacementContent=fetchedContent.querySelector(`[data-id="${this.dataset.id}"]`);replacementContent&&(this.innerHTML=replacementContent.innerHTML)})}};window.customElements.define("cc-fetched-content",CCFetchedContent);function throttle(fn,wait=300){let throttleTimeoutId=-1,tick=!1;return()=>{clearTimeout(throttleTimeoutId),throttleTimeoutId=setTimeout(fn,wait),tick||(fn.call(),tick=!0,setTimeout(()=>{tick=!1},wait))}}const FilterContainer=class extends HTMLElement{constructor(){super(),this.section=this.closest(".shopify-section"),this.filters=this.querySelector(".filters");const utilityBar=document.querySelector(".utility-bar");if(utilityBar&&(this.utilBarClone=utilityBar.cloneNode(!0),this.utilBarClone.classList.add("utility-bar--sticky-mobile-copy"),this.utilBarClone.removeAttribute("data-ajax-container"),utilityBar.insertAdjacentElement("afterend",this.utilBarClone),theme.suffixIds(this.utilBarClone,"dupe"),this.previousScrollTop=window.scrollY,this.throttledCheckStickyScroll=throttle(this.checkStickyScroll.bind(this),200)),this.filters){if(this.allowAutoApplyHideUnavailable=this.filters.dataset.autoApplyHideUnavailable==="true",this.allowAutoApplyHideUnavailable&&(theme.addDelegateEventListener(this,"change",".filter-group__checkbox, .cc-price-range__input",(evt,delEl)=>{if(this.allowAutoApplyHideUnavailable&&(delEl.type==="checkbox"&&delEl.checked||delEl.type==="text"&&delEl.value)){const toEnable=this.filters.querySelector('[name="filter.v.availability"][value="1"]');toEnable&&(toEnable.checked=!0,toEnable.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1})))}}),theme.addDelegateEventListener(this,"change",".filter-group--availability .filter-toggle__input",(evt,delEl)=>{delEl.checked&&delEl.value==="1"&&(this.allowAutoApplyHideUnavailable=!1)})),this.dataset.ajaxFiltering==="true"){const debouncedAjaxLoadForm=debounce(this.ajaxLoadForm.bind(this),700);theme.addDelegateEventListener(this,"change","#CollectionFilterForm",debouncedAjaxLoadForm),theme.addDelegateEventListener(this,"submit","#CollectionFilterForm",debouncedAjaxLoadForm)}else theme.addDelegateEventListener(this,"change","#CollectionFilterForm",(_evt,delEl)=>delEl.submit());this.initFiltersEtc()}this.dataset.ajaxFiltering==="true"&&theme.addDelegateEventListener(this.section,"click",".link-dropdown__link, .filter-group__applied-item, .filter-group__clear-link, .pagination a",(evt,delEl)=>{evt.preventDefault(),this.ajaxLoadUrl(delEl.href)})}connectedCallback(){this.throttledCheckStickyScroll&&window.addEventListener("scroll",this.throttledCheckStickyScroll),this.dataset.ajaxFiltering==="true"&&(this.boundAjaxPopState=this.ajaxPopState.bind(this),window.addEventListener("popstate",this.boundAjaxPopState)),this.section.querySelector(".layout-switchers")&&(this.boundSwitchGridLayout=theme.addDelegateEventListener(this.section,"click",".layout-switch",this.switchGridLayout.bind(this))),this.delegatedToggleFiltersCallback=theme.addDelegateEventListener(this.section,"click","[data-toggle-filters]",evt=>{evt.preventDefault(),this.classList.toggle("filter-container--show-filters-desktop"),this.classList.toggle("filter-container--show-filters-mobile");const isNowVisible=this.classList.contains("filter-container--show-filters-desktop");this.section.querySelectorAll(".toggle-btn[data-toggle-filters]").forEach(el=>{el.classList.toggle("toggle-btn--revealed-desktop",isNowVisible)})})}disconnectedCallback(){this.boundCheckStickyScroll&&window.removeEventListener("scroll",this.throttledCheckStickyScroll),this.boundAjaxPopState&&window.removeEventListener("popstate",this.boundAjaxPopState)}initFiltersEtc(){this.classList.add("filter-container--mobile-initialised"),window.location.href.indexOf("?")>=0&&document.querySelectorAll("#sort-dropdown-options .link-dropdown__link").forEach(el=>{const queryTerms=window.location.href.split("?")[1].split("&");let newHref=el.href;queryTerms.forEach(term=>{term.indexOf("sort_by=")===-1&&(newHref+=`&${term}`)}),el.href=newHref})}switchGridLayout(evt){evt.preventDefault(),evt.target.classList.contains("layout-switch--one-column")?this.querySelectorAll(".product-grid").forEach(el=>{el.classList.remove("product-grid--per-row-mob-2"),el.classList.add("product-grid--per-row-mob-1")}):this.querySelectorAll(".product-grid").forEach(el=>{el.classList.remove("product-grid--per-row-mob-1"),el.classList.add("product-grid--per-row-mob-2")}),evt.target.classList.add("layout-switch--active"),(evt.target.nextElementSibling||evt.target.previousElementSibling).classList.remove("layout-switch--active")}checkStickyScroll(){const utilityBarOffsetY=theme.getOffsetTopFromDoc(this.section.querySelector(".utility-bar"));window.innerWidth<768&&this.previousScrollTop>window.scrollY&&window.scrollY>utilityBarOffsetY?document.body.classList.add("utility-bar-sticky-mobile-copy-reveal"):document.body.classList.remove("utility-bar-sticky-mobile-copy-reveal"),this.previousScrollTop=window.scrollY}ajaxLoadForm(evt){evt.type==="submit"&&evt.preventDefault();const queryVals=[];this.filters.querySelectorAll("input, select").forEach(input=>{(input.type!=="checkbox"&&input.type!=="radio"||input.checked)&&input.value!==""&&queryVals.push([input.name,encodeURIComponent(input.value)])});let newUrl=window.location.pathname;queryVals.forEach(value=>{newUrl+=`&${value[0]}=${value[1]}`}),newUrl=newUrl.replace("&","?"),this.ajaxLoadUrl.call(this,newUrl)}ajaxPopState(){this.ajaxLoadUrl.call(this,document.location.href,!0)}ajaxLoadUrl(url,noPushState){if(!noPushState){let fullUrl=url;fullUrl.slice(0,1)==="/"&&(fullUrl=`${window.location.protocol}//${window.location.host}${fullUrl}`),window.history.pushState({path:fullUrl},"",fullUrl)}let fetchUrl=url;this.dataset.filterSectionId&&(fetchUrl=`${url}${url.indexOf("?")>=0?"&":"?"}section_id=${this.dataset.filterSectionId}`);const refreshContainerSelector="[data-ajax-container]",ajaxContainers=this.section.querySelectorAll(refreshContainerSelector);ajaxContainers.forEach(el=>el.classList.add("ajax-loading")),this.ajaxLoadUrlFetchAbortController&&this.ajaxLoadUrlFetchAbortController.abort("Existing request not needed"),this.ajaxLoadUrlFetchAbortController=new AbortController,fetch(fetchUrl,{method:"get",signal:this.ajaxLoadUrlFetchAbortController.signal}).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(response=>{document.activeElement&&(this.activeElementId=document.activeElement.id);const scrollContainer=this.querySelector(".filters");let elAboveScrollTopData=null;if(scrollContainer&&getComputedStyle(scrollContainer).overflow==="auto"){const allFilterChildren=scrollContainer.querySelectorAll(".filters *");let elAboveScrollTop=allFilterChildren[0];for(let i=1;ielAboveScrollTop.offsetTop&&(elAboveScrollTop=allFilterChildren[i]);else break;if(elAboveScrollTop.offsetTop===0)elAboveScrollTop=!1;else{elAboveScrollTopData={selector:"",textContent:elAboveScrollTop.textContent,extraScrollOffset:scrollContainer.scrollTop-elAboveScrollTop.offsetTop};const attributeNames=elAboveScrollTop.getAttributeNames();for(let i=0;ia!=="filter-group__item--disabled").forEach(cl=>{elAboveScrollTopData.selector+=`.${cl}`}):elAboveScrollTopData.selector+=`[${attrName}="${CSS.escape(elAboveScrollTop.getAttribute(attrName))}"]`}}}const template=document.createElement("template");if(template.innerHTML=response,template.content.querySelectorAll(refreshContainerSelector).forEach((el,index)=>{ajaxContainers[index].innerHTML=el.innerHTML}),this.initFiltersEtc(),elAboveScrollTopData&&this.querySelectorAll(elAboveScrollTopData.selector).forEach(el=>{el.textContent===elAboveScrollTopData.textContent&&(scrollContainer.scrollTop=el.offsetTop+elAboveScrollTopData.extraScrollOffset)}),this.utilBarClone){const from=document.querySelector(".utility-bar:not(.utility-bar--sticky-mobile-copy) .utility-bar__centre"),to=this.utilBarClone.querySelector(".utility-bar__centre");from&&to&&(to.innerHTML=from.innerHTML)}if(ajaxContainers.forEach(el=>el.classList.remove("ajax-loading")),this.activeElementId){const el=document.getElementById(this.activeElementId);el&&el.focus()}const scrollToY=theme.getOffsetTopFromDoc(this.section.querySelector("[data-ajax-scroll-to]"))-document.querySelector(".section-header").clientHeight;window.scrollTo({top:scrollToY,behavior:"smooth"})}).catch(error=>{console.warn(error)})}};window.customElements.define("filter-container",FilterContainer);const GalleryViewer=class extends HTMLElement{connectedCallback(){this.initialised||(this.initialised=!0,this.classList.add("gallery-viewer--pre-reveal"),this.zoomContainer=this.querySelector(".gallery-viewer__zoom-container"),this.thumbContainer=this.querySelector(".gallery-viewer__thumbs"),this.controlsContainer=this.querySelector(".gallery-viewer__controls"),this.previousBtn=this.querySelector(".gallery-viewer__prev"),this.nextBtn=this.querySelector(".gallery-viewer__next"),this.wheelZoomMultiplier=-.001,this.pinchZoomMultiplier=.003,this.touchPanModifier=1,this.currentZoomImage=null,this.currentTransform={panX:0,panY:0,zoom:1},this.pinchTracking={isTracking:!1,lastPinchDistance:0},this.touchTracking={isTracking:!1,lastTouchX:0,lastTouchY:0},theme.addDelegateEventListener(this,"click",".gallery-viewer__thumb",this.onThumbClick.bind(this)),this.addEventListener("touchend",this.stopTrackingTouch.bind(this)),this.addEventListener("touchmove",this.trackInputMovement.bind(this)),this.addEventListener("mousemove",this.trackInputMovement.bind(this)),this.addEventListener("wheel",this.trackWheel.bind(this)),this.thumbContainer.addEventListener("touchmove",evt=>evt.stopPropagation()),this.previousBtn.addEventListener("click",this.selectPreviousThumb.bind(this)),this.nextBtn.addEventListener("click",this.selectNextThumb.bind(this)),this.zoomContainer.addEventListener("click",this.onZoomContainerClick.bind(this)),new ResizeObserver(()=>this.setInitialImagePosition()).observe(this)),document.documentElement.classList.add("gallery-viewer-open"),this.addEventListener("keyup",this.handleKeyup.bind(this)),setTimeout(()=>this.classList.remove("gallery-viewer--pre-reveal"),10)}disconnectedCallback(){document.documentElement.classList.remove("gallery-viewer-open")}static createEl(type,className,appendTo,innerHTML){const el=document.createElement(type);return el.className=className,type==="a"&&(el.href="#"),appendTo&&appendTo.insertAdjacentElement("beforeend",el),innerHTML&&(el.innerHTML=innerHTML),el}init(currentFullUrl){this.selectThumb([...this.thumbContainer.children].find(el=>el.dataset.zoomUrl===currentFullUrl)||this.thumbContainer.firstElementChild)}panZoomImageFromCoordinate(inputX,inputY){const doPanX=this.currentZoomImage.clientWidth>this.clientWidth,doPanY=this.currentZoomImage.clientHeight>this.clientHeight;if(doPanX||doPanY){const midX=this.clientWidth/2,midY=this.clientHeight/2,offsetFromCentreX=inputX-midX,offsetFromCentreY=inputY-midY;let finalOffsetX=0,finalOffsetY=0;if(doPanX){const offsetMultiplierX=(this.currentZoomImage.clientWidth-this.clientWidth)/2/midX;finalOffsetX=Math.round(-offsetFromCentreX*offsetMultiplierX)}if(doPanY){const offsetMultiplierY=(this.currentZoomImage.clientHeight-this.clientHeight)/2/midY;finalOffsetY=Math.round(-offsetFromCentreY*offsetMultiplierY)}this.currentTransform.panX=finalOffsetX,this.currentTransform.panY=finalOffsetY,this.alterCurrentPanBy(0,0),this.updateImagePosition()}}alterCurrentPanBy(x,y){this.currentTransform.panX+=x;let panXMax=(this.currentZoomImage.naturalWidth*this.currentTransform.zoom-this.clientWidth)/2;panXMax=Math.max(panXMax,0),this.currentTransform.panX=Math.min(this.currentTransform.panX,panXMax),this.currentTransform.panX=Math.max(this.currentTransform.panX,-panXMax),this.currentTransform.panY+=y;let panYMax=(this.currentZoomImage.naturalHeight*this.currentTransform.zoom-this.clientHeight)/2;panYMax=Math.max(panYMax,0),this.currentTransform.panY=Math.min(this.currentTransform.panY,panYMax),this.currentTransform.panY=Math.max(this.currentTransform.panY,-panYMax),this.updateImagePosition()}setCurrentTransform(panX,panY,zoom){this.currentTransform.panX=panX,this.currentTransform.panY=panY,this.currentTransform.zoom=zoom,this.alterCurrentTransformZoomBy(0)}alterCurrentTransformZoomBy(delta){this.currentTransform.zoom+=delta;const maxZoomX=this.clientWidth/this.currentZoomImage.naturalWidth,maxZoomY=this.clientHeight/this.currentZoomImage.naturalHeight;this.currentTransform.zoom=Math.max(this.currentTransform.zoom,Math.min(maxZoomX,maxZoomY)),this.currentTransform.zoom=Math.min(this.currentTransform.zoom,1),this.alterCurrentPanBy(0,0),this.updateImagePosition()}setInitialImagePosition(){this.currentZoomImage.style.top=`${this.clientHeight/2-this.currentZoomImage.clientHeight/2}px`,this.currentZoomImage.style.left=`${this.clientWidth/2-this.currentZoomImage.clientWidth/2}px`,this.setCurrentTransform(0,0,0),this.classList.toggle("gallery-viewer--zoomable",this.currentZoomImage.naturalWidth>this.clientWidth||this.currentZoomImage.naturalHeight>this.clientHeight)}updateImagePosition(){this.currentZoomImage.style.transform=`translate3d(${this.currentTransform.panX}px, ${this.currentTransform.panY}px, 0) scale(${this.currentTransform.zoom})`}selectThumb(thumb){[...thumb.parentElement.children].forEach(el=>{el===thumb?el.classList.add("gallery-viewer__thumb--active"):el.classList.remove("gallery-viewer__thumb--active")}),this.zoomContainer.classList.add("gallery-viewer__zoom-container--loading"),this.currentZoomImage=GalleryViewer.createEl("img","gallery-viewer__zoom-image"),this.currentZoomImage.alt="",this.currentZoomImage.style.visibility="hidden",this.currentZoomImage.onload=()=>{this.zoomContainer.classList.remove("gallery-viewer__zoom-container--loading"),this.currentZoomImage.style.visibility="",this.setInitialImagePosition()},this.currentZoomImage.src=thumb.dataset.zoomUrl,this.zoomContainer.replaceChildren(this.currentZoomImage)}selectPreviousThumb(evt){if(evt&&evt.preventDefault(),this.thumbContainer.childElementCount<2)return;let previous=this.thumbContainer.querySelector(".gallery-viewer__thumb--active").previousElementSibling;for(;!previous||!previous.offsetParent;)previous?previous=previous.previousElementSibling:previous=this.thumbContainer.lastElementChild;this.selectThumb(previous)}selectNextThumb(evt){if(evt&&evt.preventDefault(),this.thumbContainer.childElementCount<2)return;let next=this.thumbContainer.querySelector(".gallery-viewer__thumb--active").nextElementSibling;for(;!next||!next.offsetParent;)next?next=next.nextElementSibling:next=this.thumbContainer.firstElementChild;this.selectThumb(next)}stopTrackingTouch(){this.pinchTracking.isTracking=!1,this.touchTracking.isTracking=!1}trackInputMovement(evt){if(evt.preventDefault(),evt.type==="touchmove"&&evt.touches.length>0){const touch1=evt.touches[0];if(this.touchTracking.isTracking?(this.alterCurrentPanBy((touch1.clientX-this.touchTracking.lastTouchX)*this.touchPanModifier,(touch1.clientY-this.touchTracking.lastTouchY)*this.touchPanModifier),this.touchTracking.lastTouchX=touch1.clientX,this.touchTracking.lastTouchY=touch1.clientY):(this.touchTracking.isTracking=!0,this.touchTracking.lastTouchX=touch1.clientX,this.touchTracking.lastTouchY=touch1.clientY),evt.touches.length===2){const touch2=evt.touches[1],pinchDistance=Math.sqrt((touch1.clientX-touch2.clientX)**2+(touch1.clientY-touch2.clientY)**2);if(!this.pinchTracking.isTracking)this.pinchTracking.lastPinchDistance=pinchDistance,this.pinchTracking.isTracking=!0;else{const pinchDelta=pinchDistance-this.pinchTracking.lastPinchDistance;this.alterCurrentTransformZoomBy(pinchDelta*this.pinchZoomMultiplier),this.pinchTracking.lastPinchDistance=pinchDistance}}else this.pinchTracking.isTracking=!1}else this.panZoomImageFromCoordinate(evt.clientX,evt.clientY)}trackWheel(evt){evt.preventDefault(),evt.deltaY!==0&&this.alterCurrentTransformZoomBy(evt.deltaY*this.wheelZoomMultiplier)}onThumbClick(evt,thumb){evt.preventDefault(),this.selectThumb(thumb)}onZoomContainerClick(evt){evt.preventDefault(),this.currentTransform.zoom===1?(this.currentTransform.zoom=0,this.alterCurrentTransformZoomBy(0)):(this.currentTransform.zoom=1,this.alterCurrentTransformZoomBy(0),this.panZoomImageFromCoordinate(evt.clientX,evt.clientY))}handleKeyup(evt){switch(evt.key){case"ArrowLeft":evt.preventDefault(),this.selectPreviousThumb();break;case"ArrowRight":evt.preventDefault(),this.selectNextThumb();break}}};window.customElements.define("gallery-viewer",GalleryViewer);const LinkDropdown=class extends HTMLElement{constructor(){super(),this.open=!1,this.button=this.querySelector(".link-dropdown__button"),this.button.addEventListener("click",this.toggle.bind(this))}connectedCallback(){this.open&&this.addDismissListener()}disconnectedCallback(){this.open&&this.removeDismissListener()}toggle(evt,isDismiss){isDismiss||(evt.preventDefault(),evt.stopPropagation());const doExpand=this.button.getAttribute("aria-expanded")==="false";this.button.setAttribute("aria-expanded",doExpand),this.button.style.width=`${this.button.clientWidth}px`;let newWidth=null;const optsBox=this.button.nextElementSibling;this.button.closest(".link-dropdown").classList.contains("link-dropdown--left-aligned")||(doExpand?(newWidth=optsBox.clientWidth,document.querySelector("html[dir=rtl]")?newWidth+=parseInt(getComputedStyle(optsBox).left,10):newWidth+=parseInt(getComputedStyle(optsBox).right,10),newWidth-=parseInt(getComputedStyle(optsBox.querySelector(".link-dropdown__link")).paddingInlineStart,10)):newWidth=parseInt(getComputedStyle(this.button).paddingInlineEnd,10)+Math.ceil(this.button.querySelector(".link-dropdown__button-text").getBoundingClientRect().width),setTimeout(()=>{this.button.style.width=`${newWidth}px`},10)),doExpand?(this.open=!0,this.addDismissListener()):(this.open=!1,this.removeDismissListener())}addDismissListener(){this.dismissCallback=this.toggle.bind(this,!0),document.addEventListener("click",this.dismissCallback)}removeDismissListener(){document.removeEventListener("click",this.dismissCallback),this.dismissCallback=null}};window.customElements.define("link-dropdown",LinkDropdown);const MainNavigation=class extends HTMLElement{constructor(){super(),this.navHoverDelay=250,this.navLastOpenDropdown=null,this.navOpenTimeoutId=-1,this.querySelectorAll(".navigation__tier-1 > .navigation__item--with-children").forEach(el=>{el.addEventListener("mouseenter",this.onNavParentHoverIn.bind(this))}),this.querySelectorAll(".navigation__tier-1 > .navigation__item--with-children").forEach(el=>{el.addEventListener("mouseleave",this.onNavParentHoverOut.bind(this))}),theme.addDelegateEventListener(this,"touchstart",".navigation__tier-1 > .navigation__item--with-children > .navigation__link",(evt,el)=>{this.handleTouch(evt,el)},{passive:!0}),theme.addDelegateEventListener(this,"touchend",".navigation__tier-1 > .navigation__item--with-children > .navigation__link",(evt,el)=>{this.handleTouch(evt,el)}),theme.addDelegateEventListener(this,"click",".navigation__tier-1 > .navigation__item--with-children > .navigation__link",this.onNavParentHoverIn.bind(this)),theme.addDelegateEventListener(this,"keydown",".navigation__tier-1 > .navigation__item--with-children > .navigation__link",this.onNavKeydown.bind(this)),this.querySelectorAll('.navigation__link[href="#"][aria-haspopup="true"]').forEach(el=>{el.addEventListener("click",evt=>{evt.preventDefault(),evt.currentTarget.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0}))})}),this.addEventListener("mouseenter",this.handleNavHover.bind(this)),this.addEventListener("mouseleave",this.handleNavHover.bind(this))}ensureDropdownsInPageBounds(){this.querySelectorAll(".navigation__item--with-small-menu > .navigation__child-tier").forEach(el=>{const parentBcr=el.parentElement.getBoundingClientRect(),childBcr=el.getBoundingClientRect(),diff=window.innerWidth-(parentBcr.left+childBcr.width);diff<25&&el.style.setProperty("--nav-side-offset",`${diff-25}px`)})}connectedCallback(){const debouncedEnsureDropdownsInPageBounds=debounce(this.ensureDropdownsInPageBounds.bind(this),300);if(debouncedEnsureDropdownsInPageBounds(),this.resizeObserver=new ResizeObserver(entries=>{for(let i=0;i{el.addEventListener("mouseenter",boundOnProxyNavEnterSmallMenu),this.proxyTier1NavBoundEvents.push({element:el,name:"mouseenter",fn:boundOnProxyNavEnterSmallMenu})}),this.proxyTier1NavBoundEvents.push({element:this.proxyTier1Nav,name:"touchstart",fn:theme.addDelegateEventListener(this.proxyTier1Nav,"touchstart",".navigation__item--with-small-menu",this.onProxyNavEnterSmallMenu.bind(this),{passive:!0})});const onProxyNavEnterLeaveLargeMenu=evt=>{const elIndex=[...evt.currentTarget.parentNode.children].indexOf(evt.currentTarget);this.querySelectorAll(".navigation__tier-1 > .navigation__item")[elIndex].dispatchEvent(new Event(evt.type))};this.proxyTier1Nav.querySelectorAll(".navigation__tier-1 > .navigation__item--with-children").forEach(el=>{el.addEventListener("mouseenter",onProxyNavEnterLeaveLargeMenu),this.proxyTier1NavBoundEvents.push({element:el,name:"mouseenter",fn:onProxyNavEnterLeaveLargeMenu}),el.addEventListener("mouseleave",onProxyNavEnterLeaveLargeMenu),this.proxyTier1NavBoundEvents.push({element:el,name:"mouseleave",fn:onProxyNavEnterLeaveLargeMenu})});const eventNames=["touchstart","touchend","click"];for(let i=0;i .navigation__item--with-children > .navigation__link",(evt,el)=>{const elIndex=[...el.parentNode.parentNode.children].indexOf(el.parentNode),proxiedLink=this.querySelectorAll(".navigation__tier-1 > .navigation__item")[elIndex].firstElementChild;this.handleTouch(evt,proxiedLink)},{passive:eventName==="touchstart"})})}this.proxyTier1NavBoundEvents.push({element:this.proxyTier1Nav,name:"keydown",fn:theme.addDelegateEventListener(this.proxyTier1Nav,"keydown",".navigation__tier-1 > .navigation__item--with-children > .navigation__link",(evt,el)=>{if(evt.key==="Enter"){const elIndex=[...el.parentNode.parentNode.children].indexOf(el.parentNode),proxiedLink=this.querySelectorAll(".navigation__tier-1 > .navigation__item")[elIndex].firstElementChild;el.setAttribute("aria-expanded",!proxiedLink.parentElement.classList.contains("navigation__item--show-children")),this.onNavKeydown(evt,proxiedLink)}})});const boundHandleNavHover=this.handleNavHover.bind(this);this.proxyTier1Nav.addEventListener("mouseenter",boundHandleNavHover),this.proxyTier1Nav.addEventListener("mouseleave",boundHandleNavHover),this.proxyTier1NavBoundEvents.push({element:this.proxyTier1Nav,name:"mouseenter",fn:boundHandleNavHover}),this.proxyTier1NavBoundEvents.push({element:this.proxyTier1Nav,name:"mouseleave",fn:boundHandleNavHover})}const tDiv=document.createElement("div");tDiv.innerHTML=this.querySelector(".mobile-navigation-drawer-template").innerHTML,this.mobileDrawer=tDiv.firstElementChild;const mobileDrawerFooter=this.mobileDrawer.querySelector(".mobile-navigation-drawer__footer"),annBarMenu=document.querySelector(".announcement-bar .inline-menu");if(annBarMenu){const clone=annBarMenu.cloneNode(!0);clone.classList.remove("desktop-only"),mobileDrawerFooter.appendChild(clone)}const annBarLocalizations=document.querySelector(".announcement-bar .header-localization");if(annBarLocalizations){const clone=annBarLocalizations.cloneNode(!0);clone.classList.remove("desktop-only"),mobileDrawerFooter.appendChild(clone),clone.querySelector("form").addEventListener("change",evt=>{const input=evt.target.previousElementSibling;input&&input.tagName==="INPUT"&&(input.value=evt.detail.selectedValue,evt.currentTarget.submit())})}const annBarSocial=document.querySelector(".announcement-bar .social");if(annBarSocial){const clone=annBarSocial.cloneNode(!0);clone.classList.remove("desktop-only"),mobileDrawerFooter.appendChild(clone)}theme.suffixIds(this.mobileDrawer,"MobileNav"),document.querySelector(".section-header").insertAdjacentElement("afterend",this.mobileDrawer),theme.addDelegateEventListener(this.mobileDrawer,"click",".navigation__tier-1 > .navigation__item > .navigation__children-toggle",(evt,delEl)=>{evt.preventDefault(),delEl.parentElement.classList.add("navigation__item--open"),this.mobileDrawer.classList.add("mobile-navigation-drawer--child-open"),this.mobileDrawer.querySelector(".mobile-nav-title").innerText=delEl.previousElementSibling.innerText,delEl.nextElementSibling.style.top=`${Math.ceil(this.mobileDrawer.querySelector(".navigation__mobile-header").clientHeight+1)}px`,this.mobileDrawer.closest(".mobile-navigation-drawer").scrollTo({top:0,left:0,behavior:"instant"})}),this.mobileDrawer.dataset.mobileExpandWithEntireLink==="true"?theme.addDelegateEventListener(this.mobileDrawer,"click",".navigation__item--with-children > .navigation__link",(evt,delEl)=>{evt.preventDefault(),delEl.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0,cancelable:!0}))}):theme.addDelegateEventListener(this.mobileDrawer,"click",'.navigation__item--with-children > .navigation__link[href="#"]',(evt,delEl)=>{evt.preventDefault(),delEl.nextElementSibling.dispatchEvent(new Event("click",{bubbles:!0,cancelable:!0}))}),theme.addDelegateEventListener(this.mobileDrawer,"click",".mobile-nav-back",evt=>{evt.preventDefault(),this.mobileDrawer.classList.remove("mobile-navigation-drawer--child-open"),this.mobileDrawer.querySelectorAll(".navigation__tier-1 > .navigation__item--open").forEach(el=>{el.classList.remove("navigation__item--open")})}),theme.addDelegateEventListener(this.mobileDrawer,"click",".navigation__tier-2 > .navigation__item > .navigation__children-toggle",(evt,delEl)=>{evt.preventDefault(),!delEl.parentElement.classList.contains("navigation__item--open")?(delEl.parentElement.classList.add("navigation__item--open"),delEl.nextElementSibling.style.height=`${delEl.nextElementSibling.firstElementChild.clientHeight}px`):(delEl.parentElement.classList.remove("navigation__item--open"),delEl.nextElementSibling.style.height="")})}handleNavHover(evt){this.closest(".section-header").classList.toggle("section-header--nav-hover",evt.type==="mouseenter")}onNavParentHoverIn(evt){const dropdownContainer=evt.currentTarget;clearTimeout(this.navOpenTimeoutId),clearTimeout(dropdownContainer.dataset.navCloseTimeoutId);const openSiblings=[...dropdownContainer.parentNode.children].filter(child=>child!==dropdownContainer&&child.classList.contains("navigation__item--show-children"));openSiblings.filter(el=>el!==this.navLastOpenDropdown).forEach(el=>el.classList.remove("navigation__item--show-children")),this.navLastOpenDropdown=dropdownContainer;const timeoutDelay=openSiblings.length===0?0:this.navHoverDelay,newNavOpenTimeoutId=setTimeout(()=>{[...dropdownContainer.parentNode.children].forEach(el=>{el===dropdownContainer?el.classList.add("navigation__item--show-children"):el.classList.remove("navigation__item--show-children")}),dropdownContainer.closest(".section-header").classList.add("section-header--nav-open")},timeoutDelay);this.navOpenTimeoutId=newNavOpenTimeoutId,dropdownContainer.dataset.navOpenTimeoutId=newNavOpenTimeoutId,dropdownContainer.firstElementChild.setAttribute("aria-expanded",!0)}onNavParentHoverOut(evt){const dropdownContainer=evt.currentTarget;clearTimeout(dropdownContainer.dataset.navOpenTimeoutId),dropdownContainer.dataset.navCloseTimeoutId=setTimeout(()=>{dropdownContainer.classList.remove("navigation__item--show-children"),dropdownContainer.closest(".section-header").classList.remove("section-header--nav-open")},this.navHoverDelay),dropdownContainer.firstElementChild.setAttribute("aria-expanded",!1)}handleTouch(evt,link){window.innerWidth>767&&(evt.type==="touchstart"?link.dataset.touchstartedAt=evt.timeStamp.toString():evt.type==="touchend"?evt.timeStamp-parseInt(link.dataset.touchstartedAt,10)<1e3&&(link.dataset.touchOpenTriggeredAt=evt.timeStamp.toString(),link.parentElement.classList.contains("navigation__item--show-children")?link.parentElement.dispatchEvent(new Event("mouseleave")):(this.querySelectorAll(".navigation__item--show-children").forEach(el=>el.dispatchEvent(new Event("mouseleave"))),link.parentElement.dispatchEvent(new Event("mouseenter"))),evt.preventDefault(),evt.stopPropagation()):evt.type==="click"&&link.dataset.touchOpenTriggeredAt&&evt.timeStamp-parseInt(link.dataset.touchOpenTriggeredAt,10)<1e3&&(evt.preventDefault(),evt.stopPropagation()))}onNavKeydown(evt,el){evt.key==="Enter"&&(el.parentElement.classList.contains("navigation__item--show-children")?el.parentElement.dispatchEvent(new Event("mouseleave")):el.parentElement.dispatchEvent(new Event("mouseenter")),evt.preventDefault())}onProxyNavEnterSmallMenu(evt,delEl){const el=delEl||evt.currentTarget,elIndex=[...el.parentNode.children].indexOf(el),dropdown=this.querySelectorAll(".navigation__tier-1 > .navigation__item")[elIndex].querySelector(".navigation__tier-2-container");document.querySelector('html[dir="rtl"]')?dropdown.style.right=`${dropdown.offsetParent.clientWidth-(theme.getOffsetLeftFromDoc(el)+el.clientWidth)}px`:dropdown.style.left=`${theme.getOffsetLeftFromDoc(el)}px`}disconnectedCallback(){if(this.mobileDrawer.remove(),this.proxyTier1NavBoundEvents)for(let i=0;i1&&(this.initImagePagination(),this.monitorSwatchSelection(),this.initCustomLazyLoading())}initCustomLazyLoading(){setTimeout(()=>{this.querySelector(".product-block__image--show-on-hover").classList.remove("product-block__image--inactivated")},1e3),this.boundLazyLoadAll=this.lazyLoadAll.bind(this),this.addEventListener("mouseenter",this.boundLazyLoadAll),this.addEventListener("touchstart",this.boundLazyLoadAll,{passive:!0})}lazyLoadAll(){this.querySelectorAll(".product-block__image--inactivated").forEach(el=>el.classList.remove("product-block__image--inactivated")),this.removeEventListener("mouseenter",this.boundLazyLoadAll),this.removeEventListener("touchstart",this.boundLazyLoadAll)}getImageAt(index){return this.images[(index%this.images.length+this.images.length)%this.images.length]}incrementActiveImage(increment){let index=0;for(let i=0;i{el.classList.toggle("product-block__image--active",el===newActiveImage),el.classList.toggle("product-block__image--show-on-hover",el===hoverImage)}),this.querySelectorAll(".product-block__image-dot").forEach((el,iter)=>{el.classList.toggle("product-block__image-dot--active",iter===index)})}initImagePagination(){if(this.querySelector(".image-page-button--next").addEventListener("click",evt=>{evt.preventDefault(),this.incrementActiveImage(1)}),this.querySelector(".image-page-button--previous").addEventListener("click",evt=>{evt.preventDefault(),this.incrementActiveImage(-1)}),!this.closest(".carousel, .product-grid--scrollarea")){const touchContainer=this.querySelector(".image-cont--with-secondary-image");touchContainer.addEventListener("touchstart",evt=>{theme.productBlockTouchTracking=!0,theme.productBlockTouchStartX=evt.touches[0].clientX,theme.productBlockTouchStartY=evt.touches[0].clientY},{passive:!0}),touchContainer.addEventListener("touchmove",evt=>{if(theme.productBlockTouchTracking&&Math.abs(evt.touches[0].clientY-theme.productBlockTouchStartY)<30){const deltaX=evt.touches[0].clientX-theme.productBlockTouchStartX;deltaX>25?(this.incrementActiveImage(-1),theme.productBlockTouchTracking=!1):deltaX<-25&&(this.incrementActiveImage(1),theme.productBlockTouchTracking=!1)}},{passive:!0}),touchContainer.addEventListener("touchend",()=>{theme.productBlockTouchTracking=!1})}}onSelectSwatch(evt){evt.preventDefault();let index=-1;for(let i=0;i{const url=new URL(el.href),params=new URLSearchParams(url.search);params.set(optionName,optionValue),el.href=`${url.pathname}?${params}`,el.rel="nofollow"})}monitorSwatchSelection(){this.querySelectorAll("[data-media].product-block-options__item").forEach(el=>{el.addEventListener("mouseenter",this.onSelectSwatch.bind(this)),el.addEventListener("click",this.onSelectSwatch.bind(this))})}};window.customElements.define("product-block",ProductBlock);const MediaGallery=class extends HTMLElement{constructor(){if(super(),this.section=this.closest(".js-product"),this.mainImageContainer=this.querySelector(".main-image"),this.slideshow=this.mainImageContainer.querySelector(".main-image carousel-slider"),this.collage=this.querySelector(".product-media-collage"),this.xrButton=this.querySelector("[data-shopify-xr]"),this.variantPicker=this.section.querySelector("variant-picker"),this.mediaGroupingEnabled=this.variantPicker&&this.hasAttribute("data-media-grouping-enabled")&&this.getMediaGroupData(),this.mediaLists=[this.querySelectorAll(".main-image .slider__item"),this.querySelectorAll(".product-media-collage__item"),this.querySelectorAll(".thumbnails .slider__item")],this.variantPicker){const toLoad=[this.variantPicker];this.slideshow.offsetParent&&toLoad.push(this.slideshow);const thumbnailSlider=this.querySelector("carousel-slider.thumbnails");thumbnailSlider&&thumbnailSlider.offsetParent&&toLoad.push(thumbnailSlider),theme.whenComponentLoaded(toLoad,this.setFromVariantPicker.bind(this))}this.hasAttribute("data-zoom-enabled")&&(this.galleryModal=this.querySelector(".js-media-zoom-template").content.firstElementChild.cloneNode(!0),this.mediaLists.push(this.galleryModal.querySelectorAll(".gallery-viewer__thumb")),theme.addDelegateEventListener(this,"click",".show-gallery",this.openGalleryViewer.bind(this)),this.hasAttribute("data-zoom-preload")&&(this.mainImageContainer.addEventListener("mouseover",MediaGallery.hoverMainImage.bind(this)),this.mainImageContainer.addEventListener("touchstart",MediaGallery.hoverMainImage.bind(this)))),this.section.addEventListener("on:carousel-slider:select",this.selectMainMedia.bind(this)),theme.addDelegateEventListener(this,"click",".thumbnail",this.selectThumbnail.bind(this)),this.section.addEventListener("on:variant:change",this.onVariantChange.bind(this)),setTimeout(()=>{this.slideshow.offsetParent&&this.slideshow.querySelectorAll(".theme-img").forEach(el=>{el.loading="eager"})},3e3)}setFromVariantPicker(){if(this.mediaGroupingEnabled)this.setMediaGroupOnFirstLoad();else{const variant=this.variantPicker.getSelectedVariant();variant&&variant.featured_media&&this.setActiveMedia(variant.featured_media.id,!0,!0)}}setMediaGroupOnFirstLoad(){console.log("HI"),this.setActiveMediaGroup(this.getMediaGroupFromOptionSelectors());const variant=this.variantPicker.getSelectedVariant();if(variant&&variant.featured_media){this.setActiveMedia(variant.featured_media.id,!0,!0);return}this.setActiveMedia(this.querySelector(".thumbnails .slider__item:not([hidden])").dataset.mediaId,!1,!0)}static hoverMainImage(evt){MediaGallery.loadImage(evt.currentTarget.querySelector(".slider__item.is-active a.show-gallery"))}openGalleryViewer(evt,imageLink){evt.preventDefault(),this.galleryModal.parentElement||document.body.appendChild(this.galleryModal),this.galleryModal.open(imageLink);const viewer=this.galleryModal.querySelector("gallery-viewer");viewer.init(imageLink.getAttribute("href")),viewer.focus(),this.hasAttribute("data-zoom-preload")&&this.mediaLists[0].forEach(sliderItem=>{MediaGallery.loadImage(sliderItem.querySelector("a.show-gallery"))})}static loadImage(anchor){if(!anchor||anchor.hasAttribute("data-loading")||anchor.hasAttribute("data-loaded"))return;anchor.setAttribute("data-loading","");const image=new Image(5e3);image.addEventListener("load",()=>{anchor.removeAttribute("data-loading"),anchor.setAttribute("data-loaded","")},{once:!0}),image.src=anchor.href}onVariantChange(evt){this.mediaGroupingEnabled&&this.setActiveMediaGroup(this.getMediaGroupFromOptionSelectors(evt)),evt.detail.variant&&evt.detail.variant.featured_media?this.setActiveMedia(evt.detail.variant.featured_media.id,!0):this.mediaGroupChanged&&this.setActiveMedia(this.querySelector(".thumbnails .slider__item:not([hidden])").dataset.mediaId,!0)}getMediaGroupFromOptionSelectors(evt){return evt?evt.detail.selectedOptions[this.getMediaGroupData().groupOptionIndex]:this.variantPicker.getSelectedOptions()[this.getMediaGroupData().groupOptionIndex]}getMediaGroupData(){if(typeof this.variantMediaData>"u"){const dataEl=this.querySelector(".js-data-variant-media");dataEl?this.variantMediaData=JSON.parse(dataEl.textContent):this.variantMediaData=!1}return this.variantMediaData}setActiveMediaGroup(groupName){if(console.log("setActiveMediaGroup"),this.mediaGroupChanged=this.currentMediaGroup!==groupName,this.currentMediaGroup=groupName,!this.mediaGroupChanged)return;if(!groupName){this.mediaLists.forEach(list=>{list.forEach(mediaItem=>{mediaItem.hidden=!1})});return}const mediaGroupData=this.getMediaGroupData();this.mediaLists.forEach(list=>{let appended=!1;if(list.forEach(el=>{const mediaItemGroup=mediaGroupData.media[el.dataset.mediaId].group;el.classList.add(mediaItemGroup),(mediaItemGroup===groupName||mediaItemGroup===!0)&&!appended?(el.parentElement.prepend(el),appended=!0):el.parentElement.append(el)}),[...list].forEach(el=>{}),[...list].filter(el=>el.hidden).forEach(el=>el.parentElement.append(el)),list.length>0){const slider=list[0].closest("carousel-slider");slider&&slider.offsetParent&&slider.refresh()}})}setActiveMedia(mediaId,scrollToItem=!0,firstLoad=!1){const strMediaId=mediaId.toString(),mediaEl=this.mainImageContainer.querySelector(`[data-media-id="${strMediaId}"]`);if(scrollToItem&&(this.slideshow.hasAttribute("loaded")&&this.slideshow.offsetParent&&this.slideshow.scrollToElement(mediaEl,"instant"),this.collage&&this.collage.offsetParent&&!firstLoad)){const collageMediaEl=this.collage.querySelector(`[data-media-id="${strMediaId}"]`);collageMediaEl&&(theme.scrollToRevealElement(collageMediaEl),clearTimeout(this.collage.dataset.highlightTimeoutId),this.mediaGroupChanged?this.collage.querySelectorAll(".product-media-collage__item--highlight-off").forEach(el=>{el.classList.remove("product-media-collage__item--highlight-off")}):(this.collage.querySelectorAll(".product-media-collage__item").forEach(el=>{el===collageMediaEl?el.classList.remove("product-media-collage__item--highlight-off"):el.classList.add("product-media-collage__item--highlight-off")}),this.collage.dataset.highlightTimeoutId=setTimeout(()=>{this.collage.querySelectorAll(".product-media-collage__item--highlight-off").forEach(el=>{el.classList.remove("product-media-collage__item--highlight-off")})},1200)))}if(this.mediaLists.forEach(list=>{list.forEach(mediaItem=>{if(mediaItem.dataset.mediaId===strMediaId){mediaItem.classList.add("is-active");const carousel=mediaItem.closest("carousel-slider");carousel&&carousel.offsetParent&&carousel.scrollToElement(mediaItem)}else mediaItem.classList.remove("is-active")})}),window.pauseAllMedia(),mediaEl){const deferredMedia=mediaEl.querySelector("deferred-media, product-model");deferredMedia&&deferredMedia.loadContent(!0);const playableMedia=mediaEl.querySelector("video");playableMedia&&playableMedia.play()}this.xrButton&&this.mediaIsModel(mediaId)&&(this.xrButton.dataset.shopifyModel3dId=mediaId),document.dispatchEvent(new CustomEvent("on:media-gallery:change",{bubbles:!0,cancelable:!1}))}mediaIsModel(mediaId){return!!this.querySelector(`.product-media--model[data-model-id="${mediaId}"]`)}selectThumbnail(evt,thumbnail){evt.preventDefault(),this.setActiveMedia(thumbnail.parentNode.dataset.mediaId,!0)}selectMainMedia(evt){evt.detail.slide.dataset.mediaId&&this.setActiveMedia(evt.detail.slide.dataset.mediaId,!1)}};window.customElements.define("media-gallery",MediaGallery);const ProductForm=class extends HTMLElement{constructor(){if(super(),this.form=this.querySelector(".js-product-form"),this.form){const idInput=this.form.querySelector('[name="id"]');idInput.disabled=!1,idInput.required=!0,theme.settings.afterAddToCart!=="no-js"&&(this.submitBtn=this.querySelector('[name="add"]'),this.form.addEventListener("submit",this.handleSubmit.bind(this)))}}async handleSubmit(evt){if(evt.preventDefault(),this.submitBtn.getAttribute("aria-disabled")==="true"||(this.setErrorMsgState(),!this.validate()))return;this.submitBtn.setAttribute("aria-disabled","true"),this.submitBtn.classList.add("is-loading");const formData=new FormData(this.form),sectionsToUpdate=["page-header","cart-drawer"].map(sel=>document.querySelector(sel)).filter(el=>el),sectionIds=sectionsToUpdate.map(el=>el.dataset.sectionId);formData.append("sections_url",window.location.pathname),formData.append("sections",sectionIds.join(","));const fetchRequestOpts={method:"POST",headers:{Accept:"application/javascript","X-Requested-With":"XMLHttpRequest"},body:formData};try{const response=await fetch(theme.routes.cartAdd,fetchRequestOpts),data=await response.json();let error=typeof data.description=="string"?data.description:data.message;if(data.errors&&typeof data.errors=="object"&&(error=Object.entries(data.errors).map(item=>item[1].join(", "))),data.status&&this.setErrorMsgState(error),!response.ok)throw new Error(response.status);if(document.querySelector(".template-cart")){const cartForm=document.querySelector("cart-form");cartForm&&cartForm.enableAjaxUpdate&&cartForm.refresh()}else if(theme.settings.afterAddToCart==="page")setTimeout(()=>{window.location.href=theme.routes.cart},300);else if(data.sections&§ionsToUpdate.length===Object.keys(data.sections).length?sectionsToUpdate.forEach(el=>{el.updateFromCartChange(data.sections[el.dataset.sectionId])}):this.dispatchEvent(new CustomEvent("on:cart:change",{bubbles:!0})),theme.settings.afterAddToCart==="notification"){const notification=document.getElementById("AddedNotification").content.firstElementChild.cloneNode(!0);notification.dataset.productTitle=data.product_title;let notificationContainer=document.querySelector(".pageheader--sticky");notificationContainer||(notificationContainer=document.querySelector("body")),notificationContainer.appendChild(notification)}else theme.settings.afterAddToCart==="drawer"&&document.querySelector(".js-cart-drawer").open();this.dispatchEvent(new CustomEvent("on:cart:add",{bubbles:!0,detail:{variantId:data.variant_id}})),this.submitBtn.classList.add("is-success"),this.submitBtn.removeAttribute("aria-disabled"),setTimeout(()=>{this.submitBtn.classList.remove("is-loading"),this.submitBtn.classList.remove("is-success")},2e3)}catch(error){console.log(error),this.dispatchEvent(new CustomEvent("on:cart:error",{bubbles:!0,detail:{error:this.errorMsg.textContent}})),this.dispatchEvent(new CustomEvent("on:cart:change",{bubbles:!0})),this.submitBtn.classList.remove("is-loading"),this.submitBtn.classList.remove("is-success"),this.submitBtn.removeAttribute("aria-disabled")}}setErrorMsgState(error=!1){this.errorMsg=this.errorMsg||this.querySelector(".js-form-error"),this.errorMsg&&(this.errorMsg.hidden=!error,error&&(this.errorMsg.innerHTML="",(Array.isArray(error)?error:[error]).forEach((err,index)=>{index>0&&this.errorMsg.insertAdjacentHTML("beforeend","
"),this.errorMsg.insertAdjacentText("beforeend",err)})))}validate(){console.log("valiadte");let isValid=!0;return this.querySelectorAll("variant-picker .option-selector").forEach(el=>{if(el.dataset.selectorType==="listed")el.querySelector("input").reportValidity()||(isValid=!1);else if(el.querySelectorAll(".label__prefix").forEach(label=>label.remove()),el.querySelectorAll(".label--contains-error").forEach(label=>label.classList.remove("label--contains-error")),!el.querySelector('.custom-select .js-option[aria-selected="true"]')){const label=el.querySelector(".label");label.setAttribute("aria-live","polite"),label.classList.add("label--contains-error");const labelPrefix=document.createElement("span");labelPrefix.innerText=`${theme.strings.productsProductChooseA} `,labelPrefix.className="label__prefix",label.prepend(labelPrefix),theme.scrollToRevealElement(el),isValid=!1}}),isValid}};window.customElements.define("product-form",ProductForm);class ProductInventory extends HTMLElement{constructor(){super(),window.initLazyScript(this,this.initLazySection.bind(this))}initLazySection(){this.threshold=parseInt(this.dataset.threshold,10),this.productInventory=this.querySelector(".product-inventory"),this.inventoryNotice=this.querySelector(".product-inventory__status"),this.variantInventory=this.getVariantInventory(),this.closest(".js-product").addEventListener("on:variant:change",this.handleVariantChange.bind(this))}getVariantInventory(){const dataEl=this.querySelector('[type="application/json"]');return this.variantInventory||JSON.parse(dataEl.textContent)}handleVariantChange(evt){this.updateInventory(evt.detail.variant?this.variantInventory.find(v=>v.id===evt.detail.variant.id):null)}updateInventory(inventory){if(!inventory){this.productInventory.hidden=!0;return}const count=inventory.inventory_quantity,showCount=this.dataset.showInventoryCount==="always"||this.dataset.showInventoryCount==="low"&&count<=this.threshold;let notice=null;showCount?count<=this.threshold?notice=this.dataset.textXLeftLow.replace("[QTY]",count):notice=this.dataset.textXLeftOk.replace("[QTY]",count):count<=this.threshold?notice=this.dataset.textLow:notice=this.dataset.textOk,this.productInventory.classList.toggle("product-inventory--low",count<=this.threshold),this.productInventory.classList.toggle("product-inventory--ok",count>this.threshold),this.inventoryNotice.innerText=notice,this.productInventory.hidden=!1}}if(customElements.define("product-inventory",ProductInventory),!customElements.get("quantity-wrapper")){class QuantityWrapper extends HTMLElement{connectedCallback(){this.addEventListener("click",this.handleClick.bind(this))}handleClick(evt){const btn=evt.target.closest("[data-quantity]");if(btn){evt.preventDefault();const input=this.querySelector('[name="quantity"]');let change=btn.dataset.quantity==="up"?1:-1;input.step&&(change*=parseInt(input.step,10)),input.value=Math.max(1,parseInt(input.value,10)+change),input.dispatchEvent(new CustomEvent("change",{bubbles:!0,cancelable:!1}))}}}customElements.define("quantity-wrapper",QuantityWrapper)}theme.settings.quickbuyStyle!=="off"&&(theme.quickbuy={quickbuyResizeObserver:null,init:()=>{theme.quickbuy.quickbuyResizeObserver=new ResizeObserver(entries=>{for(let i=0;i{const productUrl=delEl.href;if(window.innerWidth>=768){evt.preventDefault(),theme.quickbuy.currentRequestAbortController&&theme.quickbuy.currentRequestAbortController.abort("Existing request not needed"),theme.quickbuy.currentRequestAbortController=new AbortController;const block=delEl.closest(".product-block"),slider=delEl.closest(".collection-slider");let detailCont=null,quickbuyCont=null,sliderRow=null;if(slider){if(sliderRow=slider.closest(".collection-slider-row"),!sliderRow.querySelector(".quickbuy-container"))return;quickbuyCont=sliderRow.querySelector(".quickbuy-container")}else theme.quickbuy.setBlockHeights(block),quickbuyCont=block.querySelector(".quickbuy-container");if(detailCont=quickbuyCont.querySelector(".inner"),block.classList.toggle("expanded"),block.classList.contains("expanded")){if(quickbuyCont.dispatchEvent(new CustomEvent("on:quickbuy:before-open",{bubbles:!0})),slider){const otherExpanded=Array.from(slider.querySelectorAll(".product-block.expanded")).filter(el=>el!==block);otherExpanded.forEach(el=>el.classList.remove("expanded")),otherExpanded.length===0&&(quickbuyCont.style.height=0)}else[...block.parentElement.children].forEach(el=>{el!==block&&el.classList.contains("expanded")&&theme.quickbuy.contractDetail(el,!0)});theme.quickbuy.quickbuyResizeObserver.disconnect(),theme.quickbuy.quickbuyResizeObserver.observe(detailCont),detailCont.innerHTML='
',fetch(productUrl,{method:"get",signal:theme.quickbuy.currentRequestAbortController.signal}).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.text()}).then(response=>{const tmpl=document.createElement("template");tmpl.innerHTML=response;const newDetail=tmpl.content.querySelector(".quickbuy-content").cloneNode(!0);newDetail.querySelectorAll(".more").forEach(el=>{el.href=productUrl}),newDetail.querySelectorAll(".product-title").forEach(el=>{el.innerHTML=`${el.innerHTML}`,el.firstElementChild.href=productUrl}),newDetail.querySelectorAll(".show-gallery").forEach(el=>{el.classList.remove("show-gallery"),el.href=productUrl}),newDetail.querySelectorAll(".not-in-quickbuy").forEach(el=>{el.remove()}),newDetail.querySelectorAll(".only-in-quickbuy").forEach(el=>{el.classList.remove("only-in-quickbuy")}),newDetail.querySelectorAll(".sticky-content-container").forEach(el=>{el.classList.remove("sticky-content-container")}),newDetail.querySelectorAll("pickup-availability").forEach(el=>{el.remove()}),newDetail.querySelectorAll('variant-picker[data-update-url="true"]').forEach(el=>{el.dataset.updateUrl=!1}),newDetail.querySelectorAll("noscript").forEach(el=>el.remove()),newDetail.querySelectorAll(".media-gallery .main-image carousel-slider").forEach(el=>{el.classList.remove("mobile-only")}),newDetail.querySelectorAll(".product-media-collage").forEach(el=>{el.remove()}),newDetail.querySelectorAll(".media-gallery .thumbnails").forEach(el=>{el.classList.remove("mobile-only")}),["media-gallery--layout-carousel-beside","media-gallery--layout-columns-1","media-gallery--layout-columns-2","media-gallery--layout-collage-1","media-gallery--layout-collage-2"].forEach(cl=>{newDetail.querySelectorAll(`.${cl}`).forEach(el=>{el.classList.remove(cl),el.classList.add("media-gallery--layout-carousel-under")})}),tmpl.content.querySelectorAll('.section-main-product link[rel="stylesheet"]').forEach(el=>{document.querySelector(`link[rel="stylesheet"][href="${el.getAttribute("href")}"]`)||document.head.insertAdjacentHTML("beforeend",el.outerHTML)}),tmpl.content.querySelectorAll(".section-main-product script[src]").forEach(el=>{if(!document.querySelector(`script[src="${el.getAttribute("src")}"]`)){const scr=document.createElement("script");scr.src=el.getAttribute("src"),scr.defer="defer",document.head.appendChild(scr)}}),detailCont.innerHTML="",detailCont.appendChild(newDetail),quickbuyCont.dispatchEvent(new CustomEvent("on:quickbuy:after-open",{bubbles:!0}))}).catch(error=>{console.warn(error)});const closeButton=quickbuyCont.querySelector(".close-detail");closeButton.removeAttribute("tabindex"),closeButton.addEventListener("click",theme.quickbuy.onCloseClick);const scrollOffset=-120-theme.stickyHeaderHeight();slider?window.scrollTo({top:theme.getOffsetTopFromDoc(quickbuyCont)+scrollOffset,behavior:"smooth"}):(theme.quickbuy.saveProductGridSpacingData(),window.scrollTo({top:parseFloat(block.dataset.qbScrollTo||theme.getOffsetTopFromDoc(quickbuyCont))+scrollOffset,behavior:"smooth"}))}else{slider?(quickbuyCont.style.height="0px",setTimeout(()=>{quickbuyCont.style.height==="0px"&&(detailCont.innerHTML="")},parseFloat(getComputedStyle(quickbuyCont).transitionDuration)*1e3)):theme.quickbuy.contractDetail(block),setTimeout(()=>{window.scrollTo({top:theme.getOffsetTopFromDoc(block)-theme.stickyHeaderHeight()-20,behavior:"smooth"})},100);const closeButton=quickbuyCont.querySelector(".close-detail");closeButton.setAttribute("tabindex","-1"),closeButton.removeEventListener("click",theme.quickbuy.onCloseClick)}}})},debouncedQuickbuyResizeTimeoutID:-1,debouncedQuickbuyResize:qbInner=>{clearTimeout(theme.quickbuy.debouncedQuickbuyResizeTimeoutID),theme.quickbuy.debouncedQuickbuyResizeTimeoutID=setTimeout(()=>{const qbc=qbInner.closest(".quickbuy-container"),block=qbc.closest(".product-block");if(block&&block.classList.contains("expanded")){const targetHeight=qbInner.clientHeight;block.style.paddingBottom=`${targetHeight+20}px`,qbc.style.height=`${targetHeight}px`}qbInner.childElementCount>0&&(qbc.style.height=`${qbInner.clientHeight}px`)},100)},contractDetail:(block,instant)=>{theme.quickbuy.quickbuyResizeObserver.disconnect(),clearTimeout(theme.quickbuy.debouncedQuickbuyResizeTimeoutID),block.classList.remove("expanded");const quickbuyCont=block.querySelector(".quickbuy-container");instant&&(quickbuyCont.style.transitionDuration="0ms",block.style.transitionDuration="0ms"),quickbuyCont.style.height=0,block.style.paddingBottom=0;const msToClose=parseFloat(getComputedStyle(quickbuyCont).transitionDuration)*1e3;setTimeout(()=>{quickbuyCont.style.height==="0px"&&(quickbuyCont.querySelector(".inner").innerHTML=""),instant&&(quickbuyCont.style.transitionDuration="",block.style.transitionDuration="")},msToClose),quickbuyCont.dispatchEvent(new CustomEvent("on:quickbuy:after-close",{bubbles:!0}))},saveProductGridSpacingData:()=>{document.querySelectorAll(".product-grid").forEach(el=>{const blocks=el.querySelectorAll(".product-block .block-inner");if(blocks.length<=1)return;let row=0,currTop=0,runningHeight=0;const gutter=parseFloat(getComputedStyle(el).rowGap),rowOffsets=[theme.getOffsetTopFromDoc(blocks[0])];blocks.forEach((block,index)=>{block.clientHeight>runningHeight&&(runningHeight=block.clientHeight);const currOffsetTop=theme.getOffsetTopFromDoc(block);index===0?currTop=currOffsetTop:currOffsetTop>currTop&&(row+=1,currTop=currOffsetTop,rowOffsets.push(gutter+runningHeight+rowOffsets[row-1]),runningHeight=0),block.dataset.gridRow=row}),blocks.forEach(block=>{block.dataset.qbScrollTo=rowOffsets[block.dataset.gridRow]+block.clientHeight})})},setBlockHeights:block=>{const list=block.closest(".product-grid");if(!list)return;let tallest=0;const blockTop=block.offsetTop,blocksInThisRow=[...list.querySelectorAll(".product-block")].filter(el=>el.offsetTop===blockTop);blocksInThisRow.forEach(el=>{const elInnerHeight=el.querySelector(".block-inner .block-inner-inner").clientHeight;elInnerHeight>tallest&&(tallest=elInnerHeight)}),blocksInThisRow.forEach(el=>{el.querySelector(".block-inner").style.setProperty("--qb-block-height",`${tallest}px`)})},onCloseClick:evt=>{evt.preventDefault(),evt.stopPropagation();const slider=evt.target.closest(".collection-slider-row");slider?slider.querySelector(".product-block.expanded .quickbuy-toggle").dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0})):evt.target.closest(".product-block").querySelector(".quickbuy-toggle").dispatchEvent(new CustomEvent("click",{bubbles:!0,cancelable:!0}))}},theme.quickbuy.init());class CarouselSlider extends HTMLElement{constructor(){if(super(),this.slides=[...this.querySelectorAll(".slider__item:not([hidden])")],this.slides.length<2){this.setCarouselState(!1);return}window.initLazyScript(this,this.init.bind(this))}init(){this.slider=this.querySelector(".slider"),this.grid=this.querySelector(".slider__grid"),this.nav=this.querySelector(".slider-nav"),this.rtl=document.dir==="rtl",this.nav&&(this.prevBtn=this.querySelector('button[name="prev"]'),this.nextBtn=this.querySelector('button[name="next"]')),this.initSlider(),window.addEventListener("on:debounced-resize",this.handleResize.bind(this)),this.setAttribute("loaded","")}initSlider(){this.gridWidth=this.grid.clientWidth,this.slideSpan=this.getWindowOffset(this.slides[1])-this.getWindowOffset(this.slides[0]),this.currentIndex=Math.round(this.slider.scrollLeft/this.slideSpan)||0,this.slideGap=this.slideSpan-this.slides[0].clientWidth,this.slidesPerPage=Math.round((this.gridWidth+this.slideGap)/this.slideSpan),this.slidesToScroll=theme.settings.sliderItemsPerNav==="page"?this.slidesPerPage:1,this.totalPages=this.slides.length-this.slidesPerPage+1,this.setCarouselState(this.totalPages>1),this.dataset.dynamicHeight==="true"&&this.updateDynamicHeight(),this.addListeners(),!(this.totalPages<2||!this.nav)&&(this.sliderStart=this.getWindowOffset(this.slider),this.sliderStart||(this.sliderStart=(this.slider.clientWidth-this.gridWidth)/2),this.sliderEnd=this.sliderStart+this.gridWidth,window.matchMedia("(pointer: fine)").matches&&this.slider.classList.add("is-grabbable"),this.setButtonStates())}refresh(){if(this.hasAttribute("loaded")&&(this.removeListeners(),this.style.removeProperty("--current-slide-height")),this.slides=[...this.querySelectorAll(".slider__item:not([hidden])")],this.slides.length<2){this.setCarouselState(!1);return}this.init()}addListeners(){this.scrollHandler=debounce(this.handleScroll.bind(this),100),this.slider.addEventListener("scroll",this.scrollHandler),this.nav&&(this.navClickHandler=this.handleNavClick.bind(this),this.nav.addEventListener("click",this.navClickHandler)),window.matchMedia("(pointer: fine)").matches&&(this.mousedownHandler=this.handleMousedown.bind(this),this.mouseupHandler=this.handleMouseup.bind(this),this.mousemoveHandler=this.handleMousemove.bind(this),this.slider.addEventListener("mousedown",this.mousedownHandler),this.slider.addEventListener("mouseup",this.mouseupHandler),this.slider.addEventListener("mouseleave",this.mouseupHandler),this.slider.addEventListener("mousemove",this.mousemoveHandler))}removeListeners(){this.slider.removeEventListener("scroll",this.scrollHandler),this.nav&&this.nav.removeEventListener("click",this.navClickHandler),window.matchMedia("(pointer: fine)").matches&&(this.slider.removeEventListener("mousedown",this.mousedownHandler),this.slider.removeEventListener("mouseup",this.mouseupHandler),this.slider.removeEventListener("mouseleave",this.mouseupHandler),this.slider.removeEventListener("mousemove",this.mousemoveHandler))}handleScroll(){const previousIndex=this.currentIndex;this.currentIndex=Math.round(Math.abs(this.slider.scrollLeft)/this.slideSpan),this.nav&&this.setButtonStates(),this.dataset.dynamicHeight==="true"&&this.updateDynamicHeight(),this.dataset.dispatchEvents==="true"&&previousIndex!==this.currentIndex&&this.dispatchEvent(new CustomEvent("on:carousel-slider:select",{bubbles:!0,detail:{index:this.currentIndex,slide:this.slides[this.currentIndex]}}))}handleMousedown(evt){this.mousedown=!0,this.startX=evt.pageX-this.sliderStart,this.scrollPos=this.slider.scrollLeft,this.slider.classList.add("is-grabbing")}handleMouseup(){this.mousedown=!1,this.slider.classList.remove("is-grabbing")}handleMousemove(evt){if(!this.mousedown)return;evt.preventDefault();const x=evt.pageX-this.sliderStart;this.slider.scrollLeft=this.scrollPos-(x-this.startX)*2}handleNavClick(evt){evt.target.matches(".slider-nav__btn")&&(evt.target.name==="next"&&!this.rtl||evt.target.name==="prev"&&this.rtl?this.scrollPos=this.slider.scrollLeft+this.slidesToScroll*this.slideSpan:this.scrollPos=this.slider.scrollLeft-this.slidesToScroll*this.slideSpan,this.slider.scrollTo({left:this.scrollPos,behavior:"smooth"}))}handleResize(){this.nav&&this.removeListeners(),this.initSlider()}scrollToElement(el,transition){this.getSlideVisibility(el)||(this.scrollPos=el.offsetLeft,this.slider.scrollTo({left:this.scrollPos,behavior:transition||"smooth"}))}updateDynamicHeight(){this.style.setProperty("--current-slide-height",`${this.slides[this.currentIndex].firstElementChild.clientHeight}px`)}getWindowOffset(el){return this.rtl?window.innerWidth-el.getBoundingClientRect().right:el.getBoundingClientRect().left}getSlideVisibility(el){const slideStart=this.getWindowOffset(el),slideEnd=Math.floor(slideStart+this.slides[0].clientWidth);return slideStart>=this.sliderStart&&slideEnd<=this.sliderEnd}setCarouselState(active){active?(this.removeAttribute("inactive"),this.gridWidth!==this.grid.clientWidth&&this.handleBreakpointChange()):this.setAttribute("inactive","")}setButtonStates(){this.prevBtn.disabled=this.getSlideVisibility(this.slides[0])&&this.slider.scrollLeft===0,this.nextBtn.disabled=this.getSlideVisibility(this.slides[this.slides.length-1])}}customElements.define("carousel-slider",CarouselSlider);const TermsAgreement=class extends HTMLElement{connectedCallback(){this.delegatedEvent=theme.addDelegateEventListener(document,"click",'#cartform [name="checkout"], .additional-checkout-buttons input, a[href*="/checkout"]',this.handleFormSubmittingEvent.bind(this))}disconnectedCallback(){document.removeEventListener("click",this.delegatedEvent)}handleFormSubmittingEvent(evt){this.querySelector("input:checked")||(evt.preventDefault(),theme.showQuickPopup(theme.strings.cartTermsConfirmation,this.querySelector('[type="checkbox"]')))}};window.customElements.define("terms-agreement",TermsAgreement);const ToggleTarget=class extends HTMLElement{constructor(){super(),this.addEventListener("click",this.toggleOpen.bind(this)),this.addEventListener("keyup",this.handleKeyUp.bind(this)),this.dataset.toggleCloseLabel&&(this.dataset.toggleOpenLabel=this.innerHTML)}handleKeyUp(evt){evt.key==="Enter"&&this.toggleOpen(evt)}toggleOpen(evt){evt.preventDefault();const target=document.querySelector(this.dataset.toggleTarget),transCont=target.querySelector(".toggle-target-container"),doCollapse=!target.classList.contains("toggle-target--hidden"),transitionDuration=parseFloat(getComputedStyle(target).transitionDuration)*1e3;target.classList.contains("toggle-target--in-transition")||(doCollapse?(this.classList.add("toggle-target-toggler--is-hidden"),target.classList.add("toggle-target--in-transition","toggle-target--hiding"),target.style.height=`${transCont.clientHeight}px`,target.style.opacity=1,this.dataset.toggleCloseLabel&&(this.innerHTML=this.dataset.toggleOpenLabel),setTimeout(()=>{target.style.height=0,target.style.opacity=0,setTimeout(()=>{target.classList.add("toggle-target--hidden"),target.classList.remove("toggle-target--in-transition","toggle-target--hiding"),target.style.height="",target.style.opacity=""},transitionDuration)},10)):(this.classList.remove("toggle-target-toggler--is-hidden"),target.classList.add("toggle-target--in-transition","toggle-target--revealing"),target.style.height=0,target.style.opacity=0,target.style.display="block",this.dataset.toggleCloseLabel&&(this.innerHTML=this.dataset.toggleCloseLabel),setTimeout(()=>{target.style.height=`${transCont.clientHeight}px`,target.style.opacity=1,setTimeout(()=>{target.classList.remove("toggle-target--hidden","toggle-target--in-transition","toggle-target--revealing"),target.style.height="",target.style.opacity="",target.style.display=""},transitionDuration)},10)))}};window.customElements.define("toggle-target",ToggleTarget);class VariantContent extends HTMLElement{constructor(){super(),this.childElementCount>0&&this.closest(".js-product").addEventListener("on:variant:change",this.handleVariantChange.bind(this))}handleVariantChange(evt){[...this.childNodes].filter(el=>el.tagName!=="SCRIPT").forEach(el=>el.remove()),this.querySelectorAll(":not(script)").forEach(el=>el.remove());const contentToShow=this.querySelector(`[data-variant="${evt.detail.variant?evt.detail.variant.id:""}"]`);contentToShow&&this.insertAdjacentHTML("beforeend",contentToShow.innerHTML)}}customElements.define("variant-content",VariantContent);const AnnouncementBar=class extends HTMLElement{constructor(){super(),this.announcements=this.querySelectorAll(".announcement"),this.announcements.length>1&&(this.backgrounds=Array.from(this.querySelectorAll(".announcement-bg")),this.changeDelay=5e3,this.currentAnnouncement=0,this.querySelector(".announcement-bar__middle").addEventListener("focusin",this.pauseAnnouncements.bind(this)),this.querySelector(".announcement-bar__middle").addEventListener("focusout",this.playAnnouncements.bind(this)),this.querySelector(".announcement-button--previous").addEventListener("click",this.previousAnnouncement.bind(this)),this.querySelector(".announcement-button--next").addEventListener("click",this.nextAnnouncement.bind(this)),this.observer=new IntersectionObserver(this.handleIntersect.bind(this)),this.observer.observe(this))}handleIntersect(entries){entries.forEach(entry=>{entry.target===this&&(entry.isIntersecting?this.playAnnouncements(this):this.pauseAnnouncements(this))})}playAnnouncements(){this.announcements.length>1&&(this.announcementInterval=setInterval(()=>{this.setCurrentAnnouncement(this.currentAnnouncement+1)},this.changeDelay))}pauseAnnouncements(){this.announcementInterval&&clearInterval(this.announcementInterval)}setCurrentAnnouncement(newIndex){this.currentAnnouncement=newIndex%this.announcements.length,this.announcements.forEach((announcement,index)=>{const background=this.backgrounds.find(bg=>bg.dataset.index===index.toString());index!==this.currentAnnouncement?(announcement.classList.add("announcement--inactive"),background&&background.classList.remove("is-active")):(announcement.classList.remove("announcement--inactive"),background&&background.classList.add("is-active"))});const headingColor=this.announcements[this.currentAnnouncement].style.getPropertyValue("--heading-color"),textColor=this.announcements[this.currentAnnouncement].style.getPropertyValue("--text-color"),linkColor=this.announcements[this.currentAnnouncement].style.getPropertyValue("--link-color");headingColor&&this.style.setProperty("--heading-color",headingColor),textColor&&this.style.setProperty("--text-color",textColor),linkColor&&this.style.setProperty("--link-color",linkColor)}previousAnnouncement(){this.setCurrentAnnouncement(this.currentAnnouncement-1)}nextAnnouncement(){this.setCurrentAnnouncement(this.currentAnnouncement+1)}};window.customElements.define("announcement-bar",AnnouncementBar);const ImageWithTextOverlay=class extends HTMLElement{constructor(){if(super(),this.fullHeightContainer=this.classList.contains("height--full")?this:this.querySelector(".height--full"),this.fullHeightContainer){if(this.closest(".shopify-section").previousElementSibling)return;const ph=document.querySelector(".pageheader");if(!ph){this.fullHeightContainer.classList.add("height--full-ignore-header-height");return}const thisOffsetTop=theme.getOffsetTopFromDoc(this);if(theme.getOffsetTopFromDoc(ph)-5>thisOffsetTop){this.fullHeightContainer.classList.add("height--full-ignore-header-height");return}this.fullHeightContainer.classList.add("height--full-minus-header-height"),this.checkForHeaderHeightSubtraction();const handleResize=debounce(this.checkForHeaderHeightSubtraction.bind(this),300);this.resizeObserver=new ResizeObserver(entries=>{for(let i=0;i{height-=el.clientHeight}):height-=document.querySelector(".section-header").clientHeight,this.fullHeightContainer.style.setProperty("--image-height",`${height}px`)}};window.customElements.define("image-with-text-overlay",ImageWithTextOverlay);const PageHeader=class extends HTMLElement{constructor(){super(),this.querySelector(".main-search")&&theme.addDelegateEventListener(this,"click",".show-search-link",evt=>{evt.preventDefault(),document.body.classList.add("show-search"),setTimeout(()=>{this.querySelector(".main-search__input").focus()},500)}),theme.inlineNavigationCheck(),theme.settings.cartType==="drawer"&&document.querySelector(".js-cart-drawer")&&this.querySelector(".cart-link")&&theme.addDelegateEventListener(this,"click",".cart-link",evt=>{evt.preventDefault(),document.querySelector(".js-cart-drawer").open()}),window.Shopify.designMode&&document.body.classList.contains("reveal-mobile-nav")&&theme.openMobileNav(),setTimeout(()=>theme.manuallyLoadImages(this),250)}connectedCallback(){this.section=document.querySelector(".section-header"),this.transparentPageheader=document.querySelector(".pageheader--transparent-permitted"),this.setTransparency(),this.setSticky(),this.setHeaderHeightProperty(),window.addEventListener("scroll",this.afterScroll.bind(this)),this.refreshHeader=()=>{fetch(`${window.location.origin}?sections=header`).then(response=>response.json()).then(data=>{const template=document.createElement("template");template.innerHTML=data.header;const selectorsForRefresh=["#pageheader .logo-area__right__inner .cart-link .cart-link__icon .cart-link__count"];for(let i=0;i{for(let i=0;i{for(let i=0;i4&&!this.querySelector(".related-collection-links__expander")){Array.from(btns).slice(3).forEach(el=>el.classList.add("hidden"));const expander=document.createElement("a");expander.className="btn btn--tertiary related-collection-links__expander",expander.href="#",expander.innerText=this.dataset.expanderBtnText,expander.addEventListener("click",evt=>{evt.preventDefault(),this.resizeObserver.disconnect(),[...evt.currentTarget.parentElement.children].forEach(el=>el.classList.remove("hidden")),evt.currentTarget.remove()}),this.insertAdjacentElement("beforeend",expander)}}else{const expander=this.querySelector(".related-collection-links__expander");expander&&([...expander.parentElement.children].forEach(el=>el.classList.remove("hidden")),expander.remove())}}};window.customElements.define("related-collection-link-buttons",RelatedCollectionLinkButtons),window.initLazyScript=initLazyScript,theme.Shopify||(theme.Shopify={});try{theme.Shopify.features=JSON.parse(document.documentElement.querySelector("#shopify-features").textContent)}catch{theme.Shopify.features={}}document.addEventListener("DOMContentLoaded",()=>{const internalLinksSmoothScroll=evt=>{const link=evt.target.tagName==="A"?evt.target:evt.target.closest("a");if(link&&link.getAttribute("href")&&link.getAttribute("href").length>1&&link.getAttribute("href")[0]==="#"){const target=document.querySelector(link.getAttribute("href"));target&&target.offsetParent&&(evt.preventDefault(),theme.scrollToRevealElement(target))}};theme.settings.internalLinksSmoothScroll&&document.addEventListener("click",internalLinksSmoothScroll);const tabCheck=evt=>{evt.code==="Tab"&&(document.body.classList.add("tab-used"),document.removeEventListener("keydown",tabCheck),document.removeEventListener("click",internalLinksSmoothScroll))};document.addEventListener("keydown",tabCheck),theme.settings.externalLinksNewTab&&document.addEventListener("click",evt=>{const link=evt.target.tagName==="A"?evt.target:evt.target.closest("a");link&&link.href&&link.tagName==="A"&&window.location.hostname!==new URL(link.href).hostname&&(link.target="_blank")}),theme.addDelegateEventListener(document,"click",".mobile-nav-toggle",evt=>{evt.preventDefault(),document.body.classList.contains("enable-mobile-nav-transition")?(document.body.classList.remove("reveal-mobile-nav","reveal-mobile-nav--revealed"),setTimeout(()=>{document.body.classList.remove("enable-mobile-nav-transition")},750)):theme.openMobileNav()}),theme.openMobileNav=()=>{document.body.classList.add("enable-mobile-nav-transition"),setTimeout(()=>{document.body.classList.add("reveal-mobile-nav");const cs=getComputedStyle(document.querySelector(".mobile-navigation-drawer .navigation__tier-1 > .navigation__item > .navigation__link")),delayS=parseFloat(cs.transitionDelay.split(",")[0])+parseFloat(cs.transitionDuration.split(",")[0]);setTimeout(()=>{document.body.classList.add("reveal-mobile-nav--revealed")},delayS*1e3),theme.manuallyLoadImages(document.querySelector(".mobile-navigation-drawer"))},10)};const shade=document.querySelector(".page-shade");shade&&shade.addEventListener("click",evt=>{evt.preventDefault(),document.body.classList.remove("reveal-mobile-nav","show-search"),setTimeout(()=>{document.body.classList.remove("enable-mobile-nav-transition")},750)})}),window.onpageshow=()=>{fetch(`${theme.routes.cart}.js`,{method:"GET",headers:{"Content-Type":"application/json"}}).then(response=>{if(!response.ok)throw new Error(`HTTP error! Status: ${response.status}`);return response.json()}).then(async data=>{const{items}=data,cartString=items.map(item=>`${item.key}|${item.quantity}`).join(","),cartUint8=new TextEncoder().encode(cartString),cartHashBuffer=await crypto.subtle.digest("SHA-256",cartUint8),cartHash=Array.from(new Uint8Array(cartHashBuffer)).map(x=>x.toString(16).padStart(2,"0")).join("").toString(),cartHashFromDom=document.querySelector(".cart-link").dataset.hash;cartHash!==cartHashFromDom&&document.dispatchEvent(new CustomEvent("on:cart:change",{bubbles:!0,cancelable:!1}))}).catch(error=>{console.log(error.message)})}; //# sourceMappingURL=/cdn/shop/t/9/assets/main.js.map?v=114880878807275946131734682258