PageSourceSearch

https://mcconnells.com/cdn/shop/t/29/assets/theme.js?v=119526926868240263541788330149

js mcconnells.com collected 2026-10-03 19:12:19 UTC 318,537 bytes, 12 lines download raw bytes

1/*
2* @license
3* Broadcast Theme (c) Invisible Themes
4*
5* Modified versions of the theme code
6* are not supported by Groupthought.
7*
8*/(function(AOS,bodyScrollLock,themeAddresses,themeCurrency,Sqrl,themeImages,Flickity,FlickityFade,Rellax){"use strict";window.theme=window.theme||{},window.theme.sizes={mobile:480,small:750,large:990,widescreen:1400},window.theme.keyboardKeys={TAB:9,ENTER:13,ESCAPE:27,SPACE:32,LEFTARROW:37,RIGHTARROW:39},window.theme.focusable='button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])';function floatLabels(container){container.querySelectorAll(".form-field").forEach(element=>{const label=element.querySelector("label"),input=element.querySelector("input, textarea");label&&input&&(input.addEventListener("keyup",event=>{event.target.value!==""?label.classList.add("label--float"):label.classList.remove("label--float")}),input.value&&input.value.length&&label.classList.add("label--float"))})}let screenOrientation=getScreenOrientation();function readHeights(){const h={};return h.windowHeight=Math.min(window.screen.height,window.innerHeight),h.announcementHeight=getHeight('[data-section-type*="announcement"] [data-bar-top]'),h.footerHeight=getHeight('[data-section-type*="footer"]'),h.menuHeight=getHeight("[data-header-height]"),h.headerHeight=h.menuHeight+h.announcementHeight,h.collectionNavHeight=getHeight("[data-collection-nav]"),h.logoHeight=getFooterLogoWithPadding(),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars()}function setVars(){const{windowHeight,announcementHeight,headerHeight,logoHeight,menuHeight,footerHeight,collectionNavHeight}=readHeights(),newsletterSmallLeft=document.querySelector("[data-newsletter-holder].newsletter--top-left"),announcementHigh=document.querySelector("#MainContent > .shopify-section:first-child > [data-announcement-wrapper]"),cookiePopup=document.querySelector("[data-tracking-consent]"),articleSocials=document.querySelector("[data-article-socials]");let defaultOuter=16;document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--three-quarters",`${windowHeight*(3/4)}px`),document.documentElement.style.setProperty("--two-thirds",`${windowHeight*(2/3)}px`),document.documentElement.style.setProperty("--one-half",`${windowHeight/2}px`),document.documentElement.style.setProperty("--one-third",`${windowHeight/3}px`),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--collection-nav-height",`${collectionNavHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.querySelector("[data-tracking-consent].popup-cookies--bottom")&&document.documentElement.style.setProperty("--cookie-bar-height",`${document.querySelector("[data-tracking-consent].popup-cookies--bottom").offsetHeight}px`),document.documentElement.style.setProperty("--newsletter-small-height",newsletterSmallLeft?`${newsletterSmallLeft.offsetHeight}px`:"0px"),document.documentElement.style.setProperty("--announcement-height-high",announcementHigh?`${announcementHigh.offsetHeight}px`:"0px"),document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),cookiePopup&&cookiePopup.offsetHeight>0?defaultOuter=cookiePopup.offsetHeight+Number(getComputedStyle(cookiePopup).bottom.replace("px","")):articleSocials&&articleSocials.offsetHeight>0&&(defaultOuter+=articleSocials.offsetHeight),document.documentElement.style.setProperty("--mobile-newsletter-with-cookie-height",`${defaultOuter}px`)}function resizeVars(){const{windowHeight,announcementHeight,headerHeight,logoHeight,menuHeight,footerHeight,collectionNavHeight}=readHeights(),newsletterSmallLeft=document.querySelector("[data-newsletter-holder].newsletter--top-left"),announcementHigh=document.querySelector("#MainContent > .shopify-section:first-child >
8 [data-announcement-wrapper]"),cookiePopup=document.querySelector("[data-tracking-consent]"),articleSocials=document.querySelector("[data-article-socials]"),currentScreenOrientation=getScreenOrientation();let defaultOuter=16;currentScreenOrientation!==screenOrientation&&(document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--three-quarters",`${windowHeight*(3/4)}px`),document.documentElement.style.setProperty("--two-thirds",`${windowHeight*(2/3)}px`),document.documentElement.style.setProperty("--one-half",`${windowHeight/2}px`),document.documentElement.style.setProperty("--one-third",`${windowHeight/3}px`),screenOrientation=currentScreenOrientation),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--collection-nav-height",`${collectionNavHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--content-min",`${windowHeight-headerHeight-footerHeight}px`),document.querySelector("[data-tracking-consent].popup-cookies--bottom")&&document.documentElement.style.setProperty("--cookie-bar-height",`${document.querySelector("[data-tracking-consent].popup-cookies--bottom").offsetHeight}px`),document.documentElement.style.setProperty("--newsletter-small-height",newsletterSmallLeft?`${newsletterSmallLeft.offsetHeight}px`:"0px"),document.documentElement.style.setProperty("--announcement-height-high",announcementHigh?`${announcementHigh.offsetHeight}px`:"0px"),cookiePopup&&cookiePopup.offsetHeight>0?defaultOuter=cookiePopup.offsetHeight+Number(getComputedStyle(cookiePopup).bottom.replace("px","")):articleSocials&&articleSocials.offsetHeight>0&&(defaultOuter+=articleSocials.offsetHeight),document.documentElement.style.setProperty("--mobile-newsletter-with-cookie-height",`${defaultOuter}px`)}function getScreenOrientation(){if(window.matchMedia("(orientation: portrait)").matches)return"portrait";if(window.matchMedia("(orientation: landscape)").matches)return"landscape"}function getHeight(selector){const el=document.querySelector(selector);return el?el.offsetHeight:0}function getFooterLogoWithPadding(){const height=getHeight("[data-footer-logo]");return height>0?height+20:0}function getScrollbarWidth(){const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth}function singles(frame,wrappers){let padding=64,tallest=0;wrappers.forEach(wrap2=>{if(wrap2.offsetHeight>tallest){const getMarginTop=parseInt(window.getComputedStyle(wrap2).marginTop),getMarginBottom=parseInt(window.getComputedStyle(wrap2).marginBottom),getMargin=getMarginTop+getMarginBottom;getMargin>padding&&(padding=getMargin),tallest=wrap2.offsetHeight}});const images=frame.querySelectorAll("[data-overflow-background]");[frame,...images].forEach(el=>{el.style.setProperty("min-height",`calc(${tallest+padding}px + var(--header-padding))`)})}function doubles(section){if(window.innerWidth<window.theme.sizes.small){section.querySelectorAll("[data-overflow-frame]").forEach(singleframe=>{const wrappers=singleframe.querySelectorAll("[data-overflow-content]");singles(singleframe,wrappers)});return}const padding=parseInt(getComputedStyle(section).getPropertyValue("--outer"))*2;let tallest=0;const frames=section.querySelectorAll("[data-overflow-frame]");section.querySelectorAll("[data-overflow-content]").forEach(content=>{content.offsetHeight>tallest&&(tallest=content.offsetHeight)});const images=section.querySelectorAll("[data-overflow-background]");
8[...frames,...images].forEach(el=>{el.style.setProperty("min-height",`${tallest+padding}px`)}),section.style.setProperty("min-height",`${tallest+padding+2}px`)}function preventOverflow(container){const singleFrames=container.querySelectorAll(".js-overflow-container");singleFrames&&singleFrames.forEach(frame=>{const wrappers=frame.querySelectorAll(".js-overflow-content");singles(frame,wrappers),document.addEventListener("theme:resize",()=>{singles(frame,wrappers)})});const doubleSections=container.querySelectorAll("[data-overflow-wrapper]");doubleSections&&doubleSections.forEach(section=>{doubles(section),document.addEventListener("theme:resize",()=>{doubles(section)})})}function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}let lastWindowWidth=window.innerWidth,lastWindowHeight=window.innerHeight;function dispatch(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),lastWindowWidth=window.innerWidth),lastWindowHeight!==window.innerHeight&&(document.dispatchEvent(new CustomEvent("theme:resize:height",{bubbles:!0})),lastWindowHeight=window.innerHeight)}function resizeListener(){window.addEventListener("resize",debounce(function(){dispatch()},50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimeout=0;function dispatch$1(){const position=window.pageYOffset;position>prev?(down=!0,up=!1):position<prev?(down=!1,up=!0):(up=null,down=null),prev=position,document.dispatchEvent(new CustomEvent("theme:scroll",{detail:{up,down,position},bubbles:!1})),up&&!wasUp&&document.dispatchEvent(new CustomEvent("theme:scroll:up",{detail:{position},bubbles:!1})),down&&!wasDown&&document.dispatchEvent(new CustomEvent("theme:scroll:down",{detail:{position},bubbles:!1})),wasDown=down,wasUp=up}function lock(e){bodyScrollLock.disableBodyScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")}function unlock(){if(scrollLockTimeout=setTimeout(()=>{document.body.removeAttribute("data-drawer-closing")},20),document.body.hasAttribute("data-drawer-closing")){document.body.removeAttribute("data-drawer-closing"),scrollLockTimeout&&clearTimeout(scrollLockTimeout);return}else document.body.setAttribute("data-drawer-closing","");document.documentElement.removeAttribute("data-scroll-locked"),bodyScrollLock.clearAllBodyScrollLocks()}function scrollListener(){let timeout;window.addEventListener("scroll",function(){timeout&&window.cancelAnimationFrame(timeout),timeout=window.requestAnimationFrame(function(){dispatch$1()})},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}const wrap=(toWrap,wrapperClass="",wrapperOption)=>{const wrapper=wrapperOption||document.createElement("div");return wrapper.classList.add(wrapperClass),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap)};function wrapElements(container){container.querySelectorAll(".rte table").forEach(table=>{wrap(table,"rte__table-wrapper")}),container.querySelectorAll('.rte iframe[src*="youtube.com/embed"], .rte iframe[src*="player.vimeo"], .rte iframe#admin_bar_iframe').forEach(frame=>{wrap(frame,"rte__video-wrapper")})}function isTouchDevice(){return"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0}function isTouch(){isTouchDevice()?(document.documentElement.className=document.documentElement.className.replace("no-touch","supports-touch"),window.theme.touch=!0):window.theme.touch=!1}function lazyImageBackgrounds(){document.addEventListener("lazyloaded",function(e){const lazyImage=e.target.parentNode;lazyImage.classList.contains("lazy-image")&&(lazyImage.style.backgroundImage="none")})}function ariaToggle(container){const toggleButtons=container.querySelectorAll("[data-aria-toggle]");toggleButtons.length&&toggleButtons.forEach(element=>{element.addEventListener("click",function(event){event.preventDefault();const currentTarget=event.currentTarget;currentTarget.setAttribute("aria-expanded",currentTarget.getAttribute("aria-expanded")=="false"?"true":"false");const toggleID=currentTarget.getAttribute("aria-controls");document.querySelector(`#${toggleID}`).classList.toggle("expanding"),document.querySelector(`#${toggleID}`).classList.toggle("expanded"),setTimeout(function(){document.querySelector(`#${toggleID}`).classList.remove("expanding")},500)})})}function loading(){document.body.classList.add("is-loaded")}window.theme.settings.enableAnimations&&AOS.init({once:!0,offset:50,duration:1e3,startEvent:"load"}),resizeListener(),scrollListener(),isTouch(),lazyImageBackgroun
8ds(),ariaToggle(document),window.addEventListener("load",()=>{setVarsOnResize(),floatLabels(document),preventOverflow(document),wrapElements(document),loading()}),document.addEventListener("shopify:section:load",e=>{const container=e.target;floatLabels(container),preventOverflow(container),wrapElements(container),ariaToggle(document)}),(function(){function n(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect();return t2.top>=0&&t2.bottom<=r2&&t2.left>=0&&t2.right<=i2}function t(n2){var i2=window.innerWidth||document.documentElement.clientWidth,r2=window.innerHeight||document.documentElement.clientHeight,t2=n2.getBoundingClientRect(),u=t2.left>=0&&t2.left<=i2||t2.right>=0&&t2.right<=i2,f=t2.top>=0&&t2.top<=r2||t2.bottom>=0&&t2.bottom<=r2;return u&&f}function i(n2,i2){function r2(){var r3=t(n2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,n2))}var u=t(n2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}function r(t2,i2){function r2(){var r3=n(t2);r3!=u&&(u=r3,typeof i2=="function"&&i2(r3,t2))}var u=n(t2);window.addEventListener("load",r2),window.addEventListener("resize",r2),window.addEventListener("scroll",r2)}window.visibilityHelper={isElementTotallyVisible:n,isElementPartiallyVisible:t,inViewportPartially:i,inViewportTotally:r}})();const showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)};Shopify.Products=(function(){const config={howManyToShow:4,howManyToStoreInMemory:10,wrapperId:"recently-viewed-products",section:null,onComplete:null};let productHandleQueue=[],wrapper=null,howManyToShowItems=null;const cookie={configuration:{expires:90,path:"/",domain:window.location.hostname},name:"shopify_recently_viewed",write:function(recentlyViewed){const recentlyViewedString=recentlyViewed.join(" ");document.cookie=`${this.name}=${recentlyViewedString}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`},read:function(){let recentlyViewed=[],cookieValue=null;const templateProduct=document.querySelector("#template-product");if(document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(cookieValue=document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]),cookieValue!==null&&(recentlyViewed=cookieValue.split(" ")),templateProduct){const currentProduct=templateProduct.getAttribute("data-product-handle");if(recentlyViewed.indexOf(currentProduct)!=-1){const currentProductIndex=recentlyViewed.indexOf(currentProduct);recentlyViewed.splice(currentProductIndex,1)}}return recentlyViewed},destroy:function(){document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`},remove:function(productHandle){const recentlyViewed=this.read(),position=recentlyViewed.indexOf(productHandle);position!==-1&&(recentlyViewed.splice(position,1),this.write(recentlyViewed))}},finalize=(wrapper2,section)=>{showElement(wrapper2,!0);const cookieItemsLength=cookie.read().length;if(Shopify.recentlyViewed&&howManyToShowItems&&cookieItemsLength&&cookieItemsLength<howManyToShowItems&&wrapper2.children.length){let allClassesArr=[],addClassesArr=[],objCounter=0;for(const property in Shopify.recentlyViewed){objCounter+=1;const objArr=Shopify.recentlyViewed[property].split(" "),propertyIdx=parseInt(property.split("_")[1]);allClassesArr=[...allClassesArr,...objArr],(cookie.read().length===propertyIdx||objCounter===Object.keys(Shopify.recentlyViewed).length&&!addClassesArr.length)&&(addClassesArr=[...addClassesArr,...objArr])}for(let i=0;i<wrapper2.children.length;i++){const element=wrapper2.children[i];allClassesArr.length&&element.classList.remove(...allClassesArr),addClassesArr.length&&element.classList.add(...addClassesArr)}}if(config.onComplete)try{config.onComplete(wrapper2,section)}catch{console.log("error")}},moveAlong=(shown,productHandleQueue2,wrapper2,section)=>{productHandleQueue2.length&&shown<config.howManyToShow?fetch("/products/"+productHandleQueue2[0]+"?section_id=api-product-grid-item").then(response=>response.text()).then(product=>{const aosDelay=shown*150,aosImageDuration=shown*100+800,aosTextDuration=shown*50+800,anchorAnimation=wrapper2.id?`#${wrapper2.id}`:"",fresh=document.createElement("div");let productReplaced=product.includes("||itemIndex||")?product.replaceAll("||itemIndex||",shown):product;productReplaced=productReplaced.includes("||itemAosDelay||")?productReplaced.replaceAll("||itemAosDelay||",aosDelay):productReplaced,productReplaced=productReplaced.includes("||itemAosImageDuration||")?productReplaced.replaceAll("||itemAosImageDuration||",aosImageDuration):productReplaced,productReplaced=productReplaced.includes("||itemAosTextDuration||")?productReplaced.replaceAll("||itemAosTextDuration||",aosTextDuration):productReplaced,productReplaced=productReplaced.includes("||itemAnimationAnchor||")?productReplaced.replaceAll("||itemAnimationAnchor||",anchorAnimation):productReplaced,fresh.innerHTML=productReplaced,wrapper2.innerHTML+=fresh.querySelector("[data-api-content]").innerHTML,productHandleQueue2.shift(),shown++,moveAlong(shown,productHandleQueue2,wrapper2,section)}).catch(()=>{cookie.remove(productHandleQueue2[0]),productHandleQueue2.shift(),moveAlong(shown,productHandleQueue2,wrapper2,section)}):finalize(wrapper2,section)};return{showRecentlyViewed:function(params){const paramsNew=params||{},shown=0;Object.assign(config,paramsNew),productHandleQueue=cookie.read(),wrapper=document.querySelector(`#${config.wrapperId}`),howManyToShowItems=config.howManyToShow,config.howManyToShow=Math.min(productHandleQueue.length,config.howManyToShow),config.howManyToShow&&wrapper&&moveAlong(shown,productHandleQueue,wrapper,config.section)},getConfig:function(){return config},clearList:function(){cookie.destroy()},recordRecentlyViewed:function(params){Object.assign(config,params||{});let recentlyViewed=cookie.read();if(window.location.pathname.indexOf("/products/")!==-1){const productHandle=decodeURIComponent(window.location.pathname).match(/\/products\/([a-z0-9\-]|[\u3000-\u303F]|[\u3040-\u309F]|[\u30A0-\u30FF]|[\uFF00-\uFFEF]|[\u4E00-\u9FAF]|[\u2605-\u2606]|[\u2190-\u2195]|[\u203B]|[\w\u0430-\u044f]|[\u0400-\u04FF]|[\u0900-\u097F]|[\u0590-\u05FF\u200f\u200e]|[\u0621-\u064A\u0660-\u0669 ])+/)[0].split("/products/")[1],position=recentlyViewed.indexOf(productHandle);position===-1?(recentlyViewed.unshift(productHandle),recentlyViewed=recentlyViewed.splice(0,config.howManyToStoreInMemory)):(recentlyViewed.splice(position,1),recentlyViewed.unshift(productHandle)),cookie.write(recentlyViewed)}},hasProducts:cookie.read().length>0}})();const getUrlString=(params,keys=[],isArray=!1)=>{const p=Object.keys(params).map(key=>{let val=params[key];if(Object.prototype.toString.call(val)==="[object Object]"||Array.isArray(val))return Array.isArray(params)?keys.push(""):keys.push(key),getUrlString(val,keys,Array.isArray(val));{let tKey=key;return keys.length>0&&(tKey=(isArray?keys:[...keys,key]).reduce((str,k)=>str===""?k:`${str}[${k}]`,"")),isArray?`${tKey}[]=${val}`:`${tKey}=${val}`}}).join("&");return keys.pop(),p},hideElement=elem=>{elem&&(elem.style.display="none")},fadeIn=(el,display,callback=null)=>{el.style.opacity=0,el.style.display=display||"block";let flag=!0;(function fade(){let val=parseFloat(el.style.opacity);(val+=.1)>1||(el.style.opacity=val,requestAnimationFrame(fade)),parseInt(val)===1&&flag&&typeof callback=="function"&&(flag=!1,callback())})()};typeof Shopify.Cart>"u"&&(Shopify.Cart={}),Shopify.Cart.ShippingCalculator=(function(){const _config={submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,templateId:"shipping-calculator-response-template",wrapperId:"wrapper-response",customerIsLoggedIn:!1},_render=function(response){const template2=document.querySelector(`#${_config.templateId}`),wrapper=document.querySelector(`#${_config.wrapperId}`);if(template2&&wrapper){wrapper.innerHTML="";let ratesList="",ratesText="",successClass="error center",markup=template2.innerHTML;const rateRegex=/[^[\]]+(?=])/g;if(response.rates&&response.rates.length){let rateTemplate=rateRegex.exec(markup)[0];
8response.rates.forEach(rate=>{let rateHtml=rateTemplate;rateHtml=rateHtml.replace(/\|\|rateName\|\|/,rate.name),rateHtml=rateHtml.replace(/\|\|ratePrice\|\|/,Shopify.Cart.ShippingCalculator.formatRate(rate.price)),ratesList+=rateHtml})}if(response.success){successClass="success center";const createdNewElem=document.createElement("div");createdNewElem.innerHTML=template2.innerHTML;const noShippingElem=createdNewElem.querySelector("[data-template-no-shipping]");response.rates.length<1&&noShippingElem&&(ratesText=noShippingElem.getAttribute("data-template-no-shipping"))}else ratesText=response.errorFeedback;markup=markup.replace(rateRegex,"").replace("[]",""),markup=markup.replace(/\|\|ratesList\|\|/g,ratesList),markup=markup.replace(/\|\|successClass\|\|/g,successClass),markup=markup.replace(/\|\|ratesText\|\|/g,ratesText),wrapper.innerHTML+=markup}},_enableButtons=function(){const getRatesButton=document.querySelector(".get-rates");getRatesButton.removeAttribute("disabled"),getRatesButton.classList.remove("disabled"),getRatesButton.value=_config.submitButton},_disableButtons=function(){const getRatesButton=document.querySelector(".get-rates");getRatesButton.setAttribute("disabled","disabled"),getRatesButton.classList.add("disabled"),getRatesButton.value=_config.submitButtonDisabled},_getCartShippingRatesForDestination=function(shipping_address){const encodedShippingAddressData=encodeURI(getUrlString({shipping_address})),url=`${window.theme.routes.cart}/shipping_rates.json?${encodedShippingAddressData}`,request=new XMLHttpRequest;request.open("GET",url,!0),request.onload=function(){if(this.status>=200&&this.status<400){const rates=JSON.parse(this.response).shipping_rates;_onCartShippingRatesUpdate(rates,shipping_address)}else _onError(this)},request.onerror=function(){_onError(this)},request.send()},_fullMessagesFromErrors=function(errors){const fullMessages=[];for(const error in errors)for(const message of errors[error])fullMessages.push(error+" "+message);return fullMessages},_onError=function(XMLHttpRequest){hideElement(document.querySelector("#estimated-shipping"));const shippingChild=document.querySelector("#estimated-shipping em");if(shippingChild)for(;shippingChild.firstChild;)shippingChild.removeChild(shippingChild.firstChild);_enableButtons();let feedback="";const data=eval("("+XMLHttpRequest.responseText+")");data.message?feedback=data.message+"("+data.status+"): "+data.description:feedback="Error : "+_fullMessagesFromErrors(data).join("; "),feedback==="Error : country is not supported."&&(feedback="We do not ship to this destination."),_render({rates:[],errorFeedback:feedback,success:!1}),showElement(document.querySelector(`#${_config.wrapperId}`))},_onCartShippingRatesUpdate=function(rates,shipping_address){_enableButtons();let readable_address="";shipping_address.zip&&(readable_address+=shipping_address.zip+", "),shipping_address.province&&(readable_address+=shipping_address.province+", "),readable_address+=shipping_address.country;const shippingChild2=document.querySelector("#estimated-shipping em");rates.length&&shippingChild2&&(shippingChild2.textContent=rates[0].price=="0.00"?window.theme.strings.free:themeCurrency.formatMoney(rates[0].price,theme.moneyFormat)),_render({rates,address:readable_address,success:!0});const fadeElements=document.querySelectorAll(`#${_config.wrapperId}, #estimated-shipping`);fadeElements.length&&fadeElements.forEach(element=>{fadeIn(element)})},_init=function(){const getRatesButton=document.querySelector(".get-rates"),fieldsContainer=document.querySelector("#address_container"),selectCountry=document.querySelector("#address_country"),selectProvince=document.querySelector("#address_province"),htmlEl=document.querySelector("html");let locale="en";if(htmlEl.hasAttribute("lang")&&htmlEl.getAttribute("lang")!==""&&(locale=htmlEl.getAttribute("lang")),fieldsContainer&&themeAddresses.AddressForm(fieldsContainer,locale,{shippingCountriesOnly:!0}),selectCountry&&selectCountry.hasAttribute("data-default")&&selectProvince&&selectProvince.hasAttribute("data-default")&&selectCountry.addEventListener("change",function(){selectCountry.removeAttribute("data-default"),selectProvince.removeAttribute("data-default")}),getRatesButton&&(getRatesButton.addEventListener("click",function(e){_disableButtons();const wrapper=document.querySelector(`#${_config.wrapperId}`);for(;wrapper.firstChild;)wrapper.removeChild(wrapper.firstChild);hideElement(wrapper);const shippingAddress={};let elemCountryVal=selectCountry.value,elemProvinceVal=selectProvince.value;const elemCountryData=selectCountry.getAttribute("data-default-fullname");elemCountryVal===""&&elemCountryData&&elemCountryData!==""&&(elemCountryVal=elemCountryData);const elemProvinceData=selectProvince.getAttribute("data-default-fullname");elemProvinceVal===""&&elemProvinceData&&elemProvinceData!==""&&(elemProvinceVal=elemProvinceData),shippingAddress.zip=document.querySelector("#address_zip").value||"",shippingAddress.country=elemCountryVal||"",shippingAddress.province=elemProvinceVal||"",_getCartShippingRatesForDestination(shippingAddress)}),_config.customerIsLoggedIn&&getRatesButton.classList.contains("get-rates--trigger"))){const zipElem=document.querySelector("#address_zip");zipElem&&zipElem.value&&getRatesButton.dispatchEvent(new Event("click"))}};return{show:function(params){params=params||{},Object.assign(_config,params),document.addEventListener("DOMContentLoaded",function(){_init()})},getConfig:function(){return _config},formatRate:function(cents){return cents==="0.00"?window.theme.strings.free:themeCurrency.formatMoney(cents,theme.moneyFormat)}}})();function forceFocus(element,options){options=options||{};var savedTabIndex=element.tabIndex;element.tabIndex=-1,element.dataset.tabIndex=savedTabIndex,element.focus(),typeof options.className<"u"&&element.classList.add(options.className),element.addEventListener("blur",callback);function callback(event){event.target.removeEventListener(event.type,callback),element.tabIndex=savedTabIndex,delete element.dataset.tabIndex,typeof options.className<"u"&&element.classList.remove(options.className)}}function focusHash(options){options=options||{};var hash=window.location.hash,element=document.getElementById(hash.slice(1));if(element&&options.ignore&&element.matches(options.ignore))return!1;hash&&element&&forceFocus(element,options)}function bindInPageLinks(options){options=options||{};var links=Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]'));function queryCheck(selector){return document.getElementById(selector)!==null}return links.filter(function(link){if(link.hash==="#"||link.hash===""||options.ignore&&link.matches(options.ignore)||!queryCheck(link.hash.substr(1)))return!1;var element=document.querySelector(link.hash);return element?(link.addEventListener("click",function(){forceFocus(element,options)}),!0):!1})}function focusable(container){var elements=Array.prototype.slice.call(container.querySelectorAll("[tabindex],[draggable],a[href],area,button:enabled,input:not([type=hidden]):enabled,object,select:enabled,textarea:enabled"));return elements.filter(function(element){return!!(element.offsetWidth||element.offsetHeight||element.getClientRects().length)})}var trapFocusHandlers={};function trapFocus(container,options){options=options||{};var elements=focusable(container),elementToFocus=options.elementToFocus||container,first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=function(event){container!==event.target&&!container.contains(event.target)&&first&&first===event.target&&first.focus(),!(event.target!==container&&event.target!==last&&event.target!==first)&&document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.keyCode===window.theme.keyboardKeys.TAB&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),forceFocus(elementToFocus,options)}function removeTrapFocus(){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown)}function accessibleLinks(elements,options){if(typeof elements!="str
8ing")throw new TypeError(elements+" is not a String.");if(elements=document.querySelectorAll(elements),elements.length===0)return;options=options||{},options.messages=options.messages||{};var messages={newWindow:options.messages.newWindow||"Opens in a new window.",external:options.messages.external||"Opens external website.",newWindowExternal:options.messages.newWindowExternal||"Opens external website in a new window."},prefix=options.prefix||"a11y",messageSelectors={newWindow:prefix+"-new-window-message",external:prefix+"-external-message",newWindowExternal:prefix+"-new-window-external-message"};function generateHTML(messages2){var container=document.createElement("ul"),htmlMessages=Object.keys(messages2).reduce(function(html,key){return html+="<li id="+messageSelectors[key]+">"+messages2[key]+"</li>"},"");container.setAttribute("hidden",!0),container.innerHTML=htmlMessages,document.body.appendChild(container)}function externalSite(link){return link.hostname!==window.location.hostname}elements.forEach(function(link){var target=link.getAttribute("target"),rel=link.getAttribute("rel"),isExternal=externalSite(link),isTargetBlank=target==="_blank",missingRelNoopener=rel===null||rel.indexOf("noopener")===-1;if(isTargetBlank&&missingRelNoopener){var relValue=rel===null?"noopener":rel+" noopener";link.setAttribute("rel",relValue)}isExternal&&isTargetBlank?link.setAttribute("aria-describedby",messageSelectors.newWindowExternal):isExternal?link.setAttribute("aria-describedby",messageSelectors.external):isTargetBlank&&link.setAttribute("aria-describedby",messageSelectors.newWindow)}),generateHTML(messages)}var a11y=Object.freeze({__proto__:null,forceFocus,focusHash,bindInPageLinks,focusable,trapFocus,removeTrapFocus,accessibleLinks});const slideDown=(target,duration=500,showDisplay="block",checkHidden=!0)=>{let display=window.getComputedStyle(target).display;if(checkHidden&&display!=="none")return;target.style.removeProperty("display"),display==="none"&&(display=showDisplay),target.style.display=display;let height=target.offsetHeight;target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,target.offsetHeight,target.style.boxSizing="border-box",target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.height=height+"px",target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),window.setTimeout(()=>{target.style.removeProperty("height"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideUp=(target,duration=500)=>{target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.boxSizing="border-box",target.style.height=target.offsetHeight+"px",target.offsetHeight,target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,window.setTimeout(()=>{target.style.display="none",target.style.removeProperty("height"),target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property")},duration)},slideToggle=(target,duration=500,showDisplay="block")=>window.getComputedStyle(target).display==="none"?slideDown(target,duration,showDisplay):slideUp(target,duration);function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;function fetchProduct(handle){const requestRoute=`${window.theme.routes.root}products/${handle}.js`;return window.fetch(requestRoute).then(response=>response.json()).catch(e=>{console.error(e)})}const selectors={saleClass:"sale",soldClass:"sold-out",doubleImage:"double__image"};function formatPrices(product){const on_sale=product.price<=product.compare_at_price_min;let classes2=on_sale?selectors.saleClass:"";if(classes2+=product.available?"":selectors.soldClass,product.price=product.price===0?window.theme.strings.free:themeCurrency.formatMoney(product.price,theme.moneyFormat),product.price_with_from=product.price,product.price_varies){const min=product.price_min===0?window.theme.strings.free:themeCurrency.formatMoney(product.price_min,theme.moneyFormat);product.price_with_from=`<small>${window.theme.strings.from}</small> ${min}`}let double_class="";return product.media!==void 0&&product.media.length>1&&(double_class+=selectors.doubleImage),{...product,classes:classe
8s2,on_sale,double_class,sold_out:!product.available,sold_out_translation:window.theme.strings.soldOut,compare_at_price:themeCurrency.formatMoney(product.compare_at_price,theme.moneyFormat),compare_at_price_max:themeCurrency.formatMoney(product.compare_at_price_max,theme.moneyFormat),compare_at_price_min:themeCurrency.formatMoney(product.compare_at_price_min,theme.moneyFormat),price_max:themeCurrency.formatMoney(product.price_max,theme.moneyFormat),price_min:themeCurrency.formatMoney(product.price_min,theme.moneyFormat),unit_price:themeCurrency.formatMoney(product.unit_price,theme.moneyFormat)}}const selectors$1={template:"[pair-product-template]",pairProducts:"[data-pair-products]",upsellButton:"[data-upsell-btn]",upsellButtonText:"[data-upsell-btn-text]"};class PairWithProduct{constructor(handle){this.handle=handle,this.document=document,this.template=this.document.querySelector(selectors$1.template).innerHTML,this.pairProducts=this.document.querySelector(selectors$1.pairProducts),this.resizeEventUpsell=()=>this.calcUpsellButtonDemensions(),this.variant=null,this.variantObject=null,this.init()}init(){if(this.handle.includes("_")){const parts=this.handle.split("_");this.handle=parts[0],this.variant=parts[1]}fetchProduct(this.handle).then(response=>{if(response===void 0){this.document.dispatchEvent(new CustomEvent("upsell-product-error"));return}const formatted=formatPrices(response);let availableVariant=!1;this.variant!==null&&formatted.variants.filter(variant=>(variant.id===Number(this.variant)&&variant.available&&(this.variantObject=variant,availableVariant=!0),variant)),formatted.available&&this.variant===null?this.renderPairProduct(formatted):availableVariant?this.renderPairProduct(formatted):(this.pairProducts.innerHTML="",this.document.dispatchEvent(new CustomEvent("upsell-unavailable")))}).catch(e=>{console.error(e)})}renderPairProduct(formatted){const productMarkup=this.renderProduct(formatted);this.pairProducts.innerHTML=productMarkup,this.upsellButtonDemensions()}upsellButtonDemensions(){this.calcUpsellButtonDemensions(),document.addEventListener("theme:resize",this.resizeEventUpsell)}calcUpsellButtonDemensions(){const upsellButtonText=this.pairProducts.querySelector(selectors$1.upsellButtonText),button=this.pairProducts.querySelector(selectors$1.upsellButton);upsellButtonText&&button.style.setProperty("--btn-text-width",`${upsellButtonText.clientWidth}px`)}renderProduct(currentProduct){let media=null,image="",firstAvailableVariant="",hasVariants=!0,hasUnitPrice=!1;if(currentProduct.media!==void 0&&(media=currentProduct.media[0]),this.variantObject!==null&&this.variantObject.featured_media!==void 0&&(media=this.variantObject.featured_media),media?image={thumb:themeImages.getSizedImageUrl(media.preview_image.src,"480x480")}:image={thumb:window.theme.assets.no_image},currentProduct.options[0].name==="Title"&&currentProduct.options.length===1&&currentProduct.options[0].values[0]==="Default Title"&&(hasVariants=!1),this.variantObject===null)for(let index=0;index<currentProduct.variants.length;index++){const variant=currentProduct.variants[index];if(variant.available){const title2=variant.title.replaceAll("/","<span>&nbsp;</span>");hasUnitPrice=variant.unit_price!==void 0,firstAvailableVariant={...formatPrices(variant),title:title2,hasUnitPrice};break}}if(this.variantObject!==null){const title2=this.variantObject.title.replaceAll("/","<span>&nbsp;</span>");hasUnitPrice=this.variantObject.unit_price!==void 0,firstAvailableVariant={...formatPrices(this.variantObject),title:title2,hasUnitPrice}}if(firstAvailableVariant==="")return"";const title=currentProduct.title.replace(/(<([^>]+)>)/gi,"");firstAvailableVariant.unit_price_measurement&&(firstAvailableVariant.unitValue=firstAvailableVariant.unit_price_measurement.reference_unit,firstAvailableVariant.unit_price_measurement.reference_value!==1&&(firstAvailableVariant.unitCount=firstAvailableVariant.unit_price_measurement.reference_value));const updateValues={...currentProduct,title,image,firstAvailableVariant,hasVariants,addToCartText:theme.strings.upsellAddToCart,unitPrice
8Label:theme.strings.unitPrice,unitPriceSeparator:theme.strings.unitPriceSeparator};return Sqrl.render(this.template,{product:updateValues})}}const selectors$2={quantityHolder:"[data-quantity-holder]",quantityField:"[data-quantity-field]",quantityButton:"[data-quantity-button]",quantityMinusButton:"[data-quantity-minus]",quantityPlusButton:"[data-quantity-plus]",quantityReadOnly:"read-only",isDisabled:"is-disabled"};class QuantityCounter{constructor(holder,inCart=!1){this.holder=holder,this.quantityUpdateCart=inCart}init(){this.settings=selectors$2,this.quantity=this.holder.querySelector(this.settings.quantityHolder),this.quantity&&(this.field=this.quantity.querySelector(this.settings.quantityField),this.buttons=this.quantity.querySelectorAll(this.settings.quantityButton),this.increaseButton=this.quantity.querySelector(this.settings.quantityPlusButton),this.quantityValue=Number(this.field.value||0),this.cartItemID=this.field.getAttribute("data-id"),this.maxValue=Number(this.field.getAttribute("max"))>0?Number(this.field.getAttribute("max")):null,this.minValue=Number(this.field.getAttribute("min"))>0?Number(this.field.getAttribute("min")):0,this.disableIncrease=this.disableIncrease.bind(this),this.emptyField=!1,this.updateQuantity=this.updateQuantity.bind(this),this.decrease=this.decrease.bind(this),this.increase=this.increase.bind(this),this.disableIncrease(),this.quantity.classList.contains(this.settings.quantityReadOnly)||(this.changeValueOnClick(),this.changeValueOnInput()))}changeValueOnClick(){const that=this;this.buttons.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault();const clickedElement=event.target,isDescrease=clickedElement.matches(that.settings.quantityMinusButton)||clickedElement.closest(that.settings.quantityMinusButton),isIncrease=clickedElement.matches(that.settings.quantityPlusButton)||clickedElement.closest(that.settings.quantityPlusButton);isDescrease&&that.decrease(),isIncrease&&that.increase(),that.updateQuantity()})})}changeValueOnInput(){const that=this;this.field.addEventListener("input",function(){that.quantityValue=this.value,this.value===""&&(that.emptyField=!0),that.updateQuantity()},this)}updateQuantity(){this.maxValue<this.quantityValue&&this.maxValue!==null&&(this.quantityValue=this.maxValue),this.minValue>this.quantityValue&&(this.quantityValue=this.minValue),this.field.value=this.quantityValue,this.disableIncrease(),document.dispatchEvent(new CustomEvent("popout:updateValue")),this.quantityUpdateCart&&this.updateCart()}decrease(){if(this.quantityValue>this.minValue){this.quantityValue--;return}this.quantityValue=0}increase(){this.quantityValue++}disableIncrease(){this.increaseButton.classList.toggle(this.settings.isDisabled,this.quantityValue>=this.maxValue&&this.maxValue!==null)}updateCart(){const event=new CustomEvent("update-cart",{bubbles:!0,detail:{id:this.cartItemID,quantity:this.quantityValue,valueIsEmpty:this.emptyField}});this.holder.dispatchEvent(event)}}const settings={cartDrawerEnabled:window.theme.settings.cartDrawerEnabled,times:{timeoutAddProduct:1e3,closeDropdownAfter:5e3},classes:{hidden:"is-hidden",added:"is-added",htmlClasses:"has-open-cart-dropdown",open:"is-open",active:"is-active",visible:"is-visible",loading:"is-loading",disabled:"is-disabled",success:"is-success",error:"has-error",headerStuck:"js__header__stuck",drawerVisible:"drawer--visible"},attributes:{transparent:"data-header-transparent",upsellButton:"data-upsell-btn"},elements:{html:"html",outerSection:"[data-section-id]",cartDropdown:"[data-cart-dropdown]",cartDropdownBody:"[data-cart-dropdown-body]",emptyMessage:"[data-empty-message]",buttonHolder:"[data-foot-holder]",itemsHolder:"[data-items-holder]",item:"[data-item]",cartToggleElement:"[data-cart-toggle]",cartItemRemove:"[data-item-remove]",cartCount:"[data-cart-count]",cartCountValue:"data-cart-count",clickedElementForExpanding:"[data-expand-button]",cartWidget:"[data-cart-widget]",cartTotal:"[data-cart-total]",cartMessage:"[data-cart-message]",cartMessageValue:"data-cart-message",buttonAddToCart:"[data-add-to-cart]",formErrorsContainer:"[data-cart-errors-container]",cartErrors:"[data-cart-errors]",cartCloseError:"[data-cart-error-close]",formCloseError:"[data-close-error]",quickAddHolder:"[data-quick-add-h
8older]",cartProgress:"[data-cart-progress]",cartOriginalTotal:"[data-cart-original-total]",cartOriginaTotalPrice:"[data-cart-original-total-price]",cartDiscountsHolder:"[data-cart-discounts-holder]",headerWrapper:"[data-header-wrapper]",burgerButton:"[data-drawer-toggle]",upsellHolder:"[data-upsell-holder]",errorMessage:"[data-error-message]",navDrawer:"[data-drawer]",pairProductsHolder:"[data-pair-products-holder]",pairProducts:"[data-pair-products]",pairProductsScript:"[data-pair-products-script]",buttonSkipPairProduct:"[data-skip-pair-product]",productIDAttribute:"data-product-id",leftToSpend:"[data-left-to-spend]"},cartTotalDiscountsTemplate:"[data-cart-total-discount]"};class CartDrawer{constructor(){window.location.pathname.endsWith("/password")||this.init()}init(){this.settings=settings,this.document=document,this.html=this.document.querySelector(this.settings.elements.html),this.cartDropdown=this.document.querySelector(this.settings.elements.cartDropdown),this.cartDropdownBody=this.document.querySelector(this.settings.elements.cartDropdownBody),this.emptyMessage=this.document.querySelector(this.settings.elements.emptyMessage),this.buttonHolder=this.document.querySelector(this.settings.elements.buttonHolder),this.itemsHolder=this.document.querySelector(this.settings.elements.itemsHolder),this.items=this.document.querySelectorAll(this.settings.elements.item),this.counterHolders=this.document.querySelectorAll(this.settings.elements.cartCount),this.cartTotal=this.document.querySelector(this.settings.elements.cartTotal),this.cartMessage=this.document.querySelectorAll(this.settings.elements.cartMessage),this.cartOriginalTotal=this.document.querySelector(this.settings.elements.cartOriginalTotal),this.cartOriginaTotalPrice=this.document.querySelector(this.settings.elements.cartOriginaTotalPrice),this.cartDiscountHolder=this.document.querySelector(this.settings.elements.cartDiscountsHolder),this.clickedElementForExpanding=this.document.querySelectorAll(this.settings.elements.clickedElementForExpanding),this.cartTotalDiscountTemplate=this.document.querySelector(this.settings.cartTotalDiscountsTemplate).innerHTML,this.cartErrorHolder=this.document.querySelector(this.settings.elements.cartErrors),this.cartCloseErrorMessage=this.document.querySelector(this.settings.elements.cartCloseError),this.headerWrapper=this.document.querySelector(this.settings.elements.headerWrapper),this.accessibility=a11y,this.navDrawer=this.document.querySelector(this.settings.elements.navDrawer),this.pairProductsHolder=this.document.querySelector(this.settings.elements.pairProductsHolder),this.pairProducts=this.document.querySelector(this.settings.elements.pairProducts),this.form=null,this.build=this.build.bind(this),this.addToCart=this.addToCart.bind(this),this.updateCart=this.updateCart.bind(this),this.openCartDropdown=this.openCartDropdown.bind(this),this.closeCartDropdown=this.closeCartDropdown.bind(this),this.toggleCartDropdown=this.toggleCartDropdown.bind(this),this.hasItemsInCart=this.hasItemsInCart.bind(this),this.toggleClassesOnContainers=this.toggleClassesOnContainers.bind(this),this.cartDropdownIsBuilded=this.items.length>0,this.totalItems=this.cartDropdownIsBuilded,this.cartDropdownIsOpen=!1,this.cartDiscounts=0,this.cartDrawerEnabled=this.settings.cartDrawerEnabled,this.cartLimitErrorIsHidden=!0,this.eventToggleCart(),this.expandEvents(),this.cartEvents(),this.cartEventAdd(),this.initQuantity(),this.customEventAddProduct(),this.estimateShippingCalculator(),this.cartMessage.length>0&&(this.cartFreeLimitShipping=Number(this.cartMessage[0].getAttribute("data-limit"))*100,this.subtotal=0,this.circumference=28*Math.PI,this.cartBarProgress()),this.pairWithArray=window.pairWithProducts,this.sessionStorage=window.sessionStorage,this.getEnablePairProducts(),this.renderPairProducts(),this.pairProductSkipEvent(),this.document.addEventListener("upsell-unavailable",()=>{this.checkPairProductIsSoldOut()})}initQuantity(){this.items=this.document.querySelectorAll(this.settings.elements.item),this.items.forEach(item=>{new QuantityCounter(item,!0).init(),this.customEventsHandle(item)})}expandEvents(){const holders=this.document.querySelectorAll(this.settings.elements.cartWidget);this.clickedElementForExpanding.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault();const holder=this.document.querySelector(item.getAttribute("href"));item.classList.toggle(this.settings.classes.active),slideToggle(holder,400),holders.length>
81&&holders.forEach(content=>{if(content!==holder.parentElement){const buttonExpand=content.querySelector(this.settings.elements.clickedElementForExpanding);buttonExpand.classList.remove(this.settings.classes.active),slideUp(buttonExpand.nextElementSibling,400)}})})})}customEventsHandle(holder){holder.addEventListener("update-cart",debounce(event=>{this.updateCart({id:event.detail.id,quantity:event.detail.quantity},holder,event.detail.valueIsEmpty)},500))}customEventAddProduct(){this.html.addEventListener("cart:add-to-cart",debounce(event=>{let formData=`id=${event.detail.data.id}&quantity=${event.detail.data.quantity||1}`;event.detail.data.selling_plan&&(formData+=`&selling_plan=${event.detail.data.selling_plan}`),this.addToCart(formData,event.detail)},500))}cartEvents(){const that=this;this.document.querySelectorAll(that.settings.elements.cartItemRemove).forEach(item=>{item.addEventListener("click",function(event){event.preventDefault(),!this.classList.contains(settings.classes.disabled)&&(this.classList.add(settings.classes.disabled),that.updateCart({id:this.getAttribute("data-id"),quantity:0}))})}),this.cartCloseErrorMessage&&this.cartCloseErrorMessage.addEventListener("click",event=>{event.preventDefault(),slideUp(this.cartErrorHolder,400)})}cartEventAdd(){this.document.addEventListener("click",event=>{const clickedElement=event.target;if(clickedElement.matches(this.settings.elements.buttonAddToCart)||clickedElement.closest(this.settings.elements.buttonAddToCart)&&clickedElement){let formData="",button=clickedElement.matches(this.settings.elements.buttonAddToCart)?clickedElement:clickedElement.closest(this.settings.elements.buttonAddToCart);
8if(button.hasAttribute(this.settings.elements.productIDAttribute)?formData=`id=${Number(button.getAttribute(this.settings.elements.productIDAttribute))}`:(this.form=clickedElement.closest("form"),formData=new FormData(this.form),formData=new URLSearchParams(formData).toString()),this.form!==null&&this.form.querySelector('[type="file"]')||(event.preventDefault(),clickedElement.hasAttribute("disabled")||clickedElement.parentNode.hasAttribute("disabled")))return;this.addToCart(formData,null,button),this.html.dispatchEvent(new CustomEvent("cart:add-item",{bubbles:!0,detail:{selector:clickedElement}}))}})}estimateShippingCalculator(){Shopify.Cart.ShippingCalculator.show({submitButton:theme.strings.shippingCalcSubmitButton,submitButtonDisabled:theme.strings.shippingCalcSubmitButtonDisabled,customerIsLoggedIn:theme.settings.customerLoggedIn,moneyFormat:theme.moneyWithCurrencyFormat})}coder71cart(){console.log("GET CART CODER71");var chkqty=0,isIceCreamExists=0,isMerchExists=0,isPintExists=0,note=0,uu="",isIcecream=0;fetch(theme.routes.root+"cart.js").then(response=>response.json()).then(response=>{response.items.forEach(function(item,index){uu+=item.variant_id+":"+item.quantity+",",item.product_type=="Pint Club"&&isPintExists++,item.product_type=="Fine Ice Creams"&&(isIcecream++,isIceCreamExists++,chkqty+=parseInt(item.quantity)),isIcecream>0&&$(".cartBoxOffer").show(),jQuery.getJSON("/products/"+item.handle+".js",function(product){product.tags.includes("Bundle")&&isMerchExists++,cart.note!==null&&note==0&&(uu=uu+"?note="+cart.note,note++),console.log("Ice Cream: "+isIceCreamExists+", Merch: "+isMerchExists+", Pint Club: "+isPintExists),isIceCreamExists>0&&isMerchExists>0?($(".js-ajax-checkout-button").attr("data-href","/cart/"+uu.replace(/(^,)|(,$)/g,"")),$(".js-ajax-checkout-button").css("opacity","1"),$(".js-ajax-checkout-button").removeClass("disable_link_2"),$(".incompleted").hide(),$(".completed").show()):isMerchExists>0?($(".js-ajax-checkout-button").attr("data-href","/cart/"+uu.replace(/(^,)|(,$)/g,"")),$(".js-ajax-checkout-button").attr("type","submit"),$(".js-ajax-checkout-button").css("opacity","1"),$(".js-ajax-checkout-button").removeClass("disable_link_2"),$(".incompleted").hide(),$(".completed").hide()):isIceCreamExists>0?parseInt(chkqty)>4?($(".js-ajax-checkout-button").attr("data-href","/cart/"+uu.replace(/(^,)|(,$)/g,"")),$(".js-ajax-checkout-button").attr("type","submit"),$(".js-ajax-checkout-button").css("opacity","1"),$(".js-ajax-checkout-button").removeClass("disable_link_2"),$(".incompleted").hide(),$(".completed").show()):($(".js-ajax-checkout-button").addClass("disable_link_2"),$(".js-ajax-checkout-button").css("opacity","0.2"),$(".js-ajax-checkout-button").attr("href","javascript:void(0);"),$(".js-ajax-checkout-button").attr("type","button"),$(".incompleted .circle").text(5-parseInt(chkqty)),$(".incompleted").show(),$(".completed").hide()):($(".js-ajax-checkout-button").attr("data-href","/cart/"+uu.replace(/(^,)|(,$)/g,"")),$(".js-ajax-checkout-button").attr("type","submit"),$(".js-ajax-checkout-button").css("opacity","1"),$(".js-ajax-checkout-button").removeClass("disable_link_2"),$(".incompleted").hide(),$(".completed").hide())})}),response.items.length==0&&($(".circle").text("5"),$(".incompleted").hide())})}getCart(){fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>(this.updateCounter(response.item_count),this.newTotalItems=response.items.length,this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),fetch(theme.routes.cart+"?section_id=api-cart-items"))).then(response=>response.text()).then(response=>{const element=document.createElement("div");element.innerHTML=response,element.querySelector(this.settings.elements.pairProductsScript)?this.pairWithArray=JSON.parse(element.querySelector(this.settings.elements.pairProductsScript).innerText.split("=")[1].replace(";","")):this.pairWithArray=void 0,this.getEnablePairProducts(),this.renderPairProducts();const cleanResponse=element.querySelector("[data-api-content]").innerHTML;this.build(cleanResponse),this.coder71cart()}).catch(error=>console.log(error))}addToCart(data2,quickAddHolder=null,button=null,json=null){this.form===null&&quickAddHolder!==null&&quickAddHolder.label&&(this.form=quickAddHolder.label.parentNode.querySelector("form")),this.cartDrawerEnabled&&button&&button.classList.add(this.settings.classes.loading),fetch(theme.routes.root+"cart/add.js",{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded"},body:data2}).then(response=>response.json()).then(response=>{if(button&&button.setAttribute("disabled","disabled"),response.status){quickAddHolder!==null?this.addToCartError(response,quickAddHolder.element,button):this.addToCartError(response,null,button);return}this.cartDrawerEnabled?(quickAddHolder!==null&&quickAddHolder.label&&(quickAddHolder.label.classList.remove(this.settings.classes.hidden,this.settings.classes.loading),quickAddHolder.label.classList.add(this.settings.classes.added)),this.getCart(),setTimeout(()=>{button!==null&&(button.classList.remove(this.settings.classes.loading),button.removeAttribute("disabled"),button.classList.add(this.settings.classes.success),document.dispatchEvent(new CustomEvent("product:bar:button",{bubbles:!1})),button.closest(this.settings.elements.pairProductsHolder)&&setTimeout(()=>{button.classList.remove(this.settings.classes.success)},this.settings.times.timeoutAddProduct*2)),this.cartDropdown&&(this.openCartDropdown(),this.cartDropdownIsOpen=!0)},this.settings.times.timeoutAddProduct)):window.location=theme.routes.cart}).catch(error=>console.log(error))}updateCart(updateData={},holder=null,valueIsEmpty=!1){let newCount=null,oldCount=null,newItem=null,settedQuantity=updateData.quantity;holder!==null&&holder.closest(this.settings.elements.item).classList.add(this.settings.classes.loading),this.items.forEac
8h(item=>{const itemInput=item.querySelector("input"),itemButtons=item.querySelectorAll("button");item.classList.add(this.settings.classes.disabled),itemInput.blur(),itemInput.disabled=!0,itemButtons.length&&itemButtons.forEach(itemButton=>{itemButton.disabled=!0})}),fetch(theme.routes.root+"cart.js").then(this.handleErrors).then(response=>response.json()).then(response=>{const matchKeys=item=>item.key===updateData.id,index=response.items.findIndex(matchKeys);oldCount=response.item_count,newItem=response.items[index].title;const data2={line:`${index+1}`,quantity:settedQuantity};return fetch(theme.routes.root+"cart/change.js",{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify(data2)})}).then(this.handleErrors).then(response=>response.json()).then(response=>{newCount=response.item_count,valueIsEmpty&&(settedQuantity=1),settedQuantity!==0&&(this.cartLimitErrorIsHidden=newCount!==oldCount,this.toggleLimitError(newItem)),this.updateCounter(newCount),this.buildTotalPrice(response),this.freeShippingMessageHandle(response.total_price),this.cartDiscounts=response.total_discount,this.cartMessage.length>0&&(this.subtotal=response.total_price,this.updateProgress()),this.getCart()}).catch(error=>console.log(error))}toggleLimitError(itemTitle){this.cartErrorHolder.querySelector(this.settings.elements.errorMessage).innerText=itemTitle,this.cartLimitErrorIsHidden?slideUp(this.cartErrorHolder,400):slideDown(this.cartErrorHolder,400)}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}addToCartError(data2,quickAddHolder,button){let errorContainer=null;if(this.cartDrawerEnabled&&button&&button.closest(this.settings.elements.cartDropdown)!==null&&!button.closest(this.settings.elements.cartDropdown)&&this.closeCartDropdown(),button!==null){errorContainer=button.closest(this.settings.elements.outerSection).querySelector(this.settings.elements.formErrorsContainer);const buttonUpsellHolder=button.closest(this.settings.elements.upsellHolder);buttonUpsellHolder&&buttonUpsellHolder.querySelector(this.settings.elements.formErrorsContainer)&&(errorContainer=buttonUpsellHolder.querySelector(this.settings.elements.formErrorsContainer)),button.classList.remove(this.settings.classes.loading),button.removeAttribute("disabled"),document.dispatchEvent(new CustomEvent("product:bar:button",{bubbles:!1}))}errorContainer&&(errorContainer.innerHTML=`<div class="errors">${data2.message}: ${data2.description}<span class="errors__close" data-close-error><svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-close-thin" viewBox="0 0 27 27"><g stroke="#979797" fill="none" fill-rule="evenodd" stroke-linecap="square"><path d="M.5.5l26 26M26.5.5l-26 26"></path></g></svg></span></div>`,errorContainer.classList.add(this.settings.classes.visible),document.dispatchEvent(new CustomEvent("product:bar:error",{bubbles:!1}))),quickAddHolder&&this.html.dispatchEvent(new CustomEvent("cart:add-to-error",{bubbles:!0,detail:{message:data2.message,description:data2.description,holder:quickAddHolder}})),this.document.addEventListener("click",event=>{const clickedElement=event.target;(clickedElement.matches(this.settings.elements.formCloseError)||clickedElement.closest(this.settings.elements.formCloseError))&&(event.preventDefault(),errorContainer&&errorContainer.classList.remove(this.settings.classes.visible))})}openCartDropdown(){document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDropdown})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.cartDropdownBody})),this.html.classList.add(this.settings.classes.htmlClasses),this.cartDropdown.classList.add(this.settings.classes.open),this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.cartDropdown,{elementToFocus:this.cartDropdown.querySelector("a:first-child, input:first-child")}),this.cartDropdownIsBuilded||this.getCart(),this.observeAdditionalCheckoutButtons()}closeCartDropdown(){if(this.document.dispatchEvent(new CustomEvent("theme:cart-close",{bubbles:!0})),this.accessibility.removeTrapFocus(),slideUp(this.cartErrorHolder,400),this.html.classList.contains("is-focused")){const button=this.document.querySelector(`${this.settings.elements.cartToggleElement}[data-focus-element]`);setTimeout(()=>{button.focus()},200)}const upsellButton=this.document.querySelector(`[${this.settings.attributes.upsellButton}].${this.settings.classes.success}`);upsellButton&&setTimeout(()=>{upsellButton.classList.remove(this.settings.classes.success)},2e3),this.html.classList.remove(this.settings.classes.htmlClasses),this.cartDropdown.classList.remove(this.settings.classes.open),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}toggleCartDropdown(){this.cartDropdownIsOpen=!this.cartDropdownIsOpen,this.cartDropdownIsOpen?this.openCartDropdown():this.closeCartDropdown()}eventToggleCart(){this.document.addEventListener("click",event=>{const clickedElement=event.target,isNotCartButton=!(clickedElement.matches(this.settings.elements.cartToggleElement)||clickedElement.closest(this.settings.elements.cartToggleElement)),isNotCartDropdownOrCartDropdownChild=!(clickedElement.matches(this.settings.elements.cartDropdown)||clickedElement.closest(this.settings.elements.cartDropdown)),isNotPairProduct=!(clickedElement.matches(this.settings.elements.buttonSkipPairProduct)||clickedElement.closest(this.settings.elements.buttonSkipPairProduct));clickedElement.matches(this.settings.elements.cartToggleElement)||clickedElement.closest(this.settings.elements.cartToggleElement)?(event.preventDefault(),this.toggleCartDropdown()):this.cartDropdownIsOpen&&isNotCartButton&&isNotCartDropdownOrCartDropdownChild&&isNotPairProduct&&(this.cartDropdownIsOpen=!1,this.closeCartDropdown())})}toggleClassesOnContainers(){const that=this;this.emptyMessage.classList.toggle(that.settings.classes.hidden,that.hasItemsInCart()),this.buttonHolder.classList.toggle(that.settings.classes.hidden,!that.hasItemsInCart()),this.itemsHolder.classList.toggle(that.settings.classes.hidden,!that.hasItemsInCart())}build(data2){this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers()),this.itemsHolder.innerHTML=data2,this.cartEvents(),this.initQuantity()}updateCounter(countItems){this.counterHolders.length&&this.counterHolders.forEac
8h(holder=>{holder.innerHTML=countItems,holder.setAttribute(settings.elements.cartCountValue,countItems)})}hasItemsInCart(){return this.totalItems>0}buildTotalPrice(data2){if(data2.original_total_price>data2.total_price&&data2.cart_level_discount_applications.length>0?(this.cartOriginalTotal.classList.remove(this.settings.classes.hidden),this.cartOriginaTotalPrice.innerHTML=data2.original_total_price===0?window.theme.strings.free:themeCurrency.formatMoney(data2.original_total_price,theme.moneyFormat)):this.cartOriginalTotal.classList.add(this.settings.classes.hidden),this.cartTotal.innerHTML=data2.total_price===0?window.theme.strings.free:themeCurrency.formatMoney(data2.total_price,theme.moneyWithCurrencyFormat),data2.cart_level_discount_applications.length>0){const discountsMarkup=this.buildCartTotalDiscounts(data2.cart_level_discount_applications);this.cartDiscountHolder.classList.remove(this.settings.classes.hidden),this.cartDiscountHolder.innerHTML=discountsMarkup}else this.cartDiscountHolder.classList.add(this.settings.classes.hidden)}buildCartTotalDiscounts(discounts){let discountMarkup="";return discounts.forEach(discount=>{discountMarkup+=Sqrl.render(this.cartTotalDiscountTemplate,{discountTitle:discount.title,discountTotalAllocatedAmount:themeCurrency.formatMoney(discount.total_allocated_amount,theme.moneyFormat)})}),discountMarkup}freeShippingMessageHandle(total){this.cartMessage.length>0&&this.document.querySelectorAll(this.settings.elements.cartMessage).forEach(message=>{const hasQualifiedShippingMessage=message.hasAttribute(this.settings.elements.cartMessageValue)&&message.getAttribute(this.settings.elements.cartMessageValue)==="true"&&total!==0;message.classList.toggle(this.settings.classes.success,hasQualifiedShippingMessage&&total>=this.cartFreeLimitShipping),message.classList.toggle(this.settings.classes.hidden,total===0||!hasQualifiedShippingMessage)})}cartBarProgress(progress=null){this.document.querySelectorAll(this.settings.elements.cartProgress).forEach(element=>{this.setProgress(element,progress===null?element.getAttribute("data-percent"):progress)})}setProgress(holder,percent){const offset=this.circumference-percent/100*this.circumference/2;holder.style.strokeDashoffset=offset}updateProgress(){const newPercentValue=this.subtotal/this.cartFreeLimitShipping*100,leftToSpend=themeCurrency.formatMoney(this.cartFreeLimitShipping-this.subtotal,theme.moneyFormat);this.document.querySelectorAll(this.settings.elements.leftToSpend).forEach(element=>{element.innerHTML=leftToSpend.replace(".00","")}),this.cartBarProgress(newPercentValue>100?100:newPercentValue)}renderPairProducts(){if(this.pairProductsHolder!==null){if(this.pairWithArray===void 0||this.pairWithArray.length<=0){this.pairProductsHolder.classList.add(this.settings.classes.hidden);return}new PairWithProduct(this.pairWithArray[0]),this.document.addEventListener("upsell-product-error",()=>{this.checkPairProductIsSoldOut()}),this.pairProductsHolder.classList.remove(this.settings.classes.hidden)}}getEnablePairProducts(){this.pairWithArray!==void 0&&this.sessionStorage!==void 0&&this.sessionStorage.getItem("pair_products")!==null&&(this.pairWithArray=this.pairWithArray.filter(handle=>this.sessionStorage.getItem("pair_products").indexOf(`,${handle},`)===-1))}pairProductSkipEvent(){this.pairProductsHolder!==null&&this.pairProductsHolder.addEventListener("click",event=>{const target=event.target;(target.matches(this.settings.elements.buttonSkipPairProduct)||target.closest(this.settings.elements.buttonSkipPairProduct))&&(event.preventDefault(),this.sessionStorage!==void 0&&this.sessionStorage.setItem("pair_products",this.sessionStorage.getItem("pair_products")!==null?`${this.sessionStorage.getItem("pair_products")},${this.pairWithArray[0]},`:`,${this.pairWithArray[0]},`),this.getEnablePairProducts(),this.pairWithArray.length<=0?this.pairProductsHolder.classList.add(this.settings.classes.hidden):new PairWithProduct(this.pairWithArray[0]))})}checkPairProductIsSoldOut(){this.sessionStorage!==void 0&&(this.sessionStorage.setItem("pair_products",this.sessionStorage.getItem("pair_products")!==null?`${this.sessionStorage.getItem("pair_products")},${this.pairWithArray[0]},`:`,${this.pairWithArray[0]},`),this.getEnablePairProducts(),this.pairWithArray.length<=0?this.pairProductsHolder.classList.add(this.settings.classes.hidden):this.renderPairProducts())}observeAdditionalCheckoutButtons(){const additionalCheckoutButtons=this.cartDropdown.querySelector(".additional-checkout-buttons");if(additionalCheckoutButtons){const observer=new MutationObserver(()=>{this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.cartDropdown,{elementToFocus:this.cartDropdown.querySelector("a:first-child, input
8:first-child")}),observer.disconnect()});observer.observe(additionalCheckoutButtons,{subtree:!0,childList:!0})}}}window.cart=new CartDrawer,window.cart.coder71cart();const settings$1={elements:{html:"html",body:"body",inPageLink:"[data-skip-content]",linkesWithOnlyHash:'a[href="#"]',triggerFocusElement:"[data-focus-element]",cartDropdown:"#cart-dropdown",search:"#search-popdown",accordionContent:".accordion-content",tabs:".tabs",accordionDataToggle:"data-accordion-toggle"},classes:{focus:"is-focused",open:"is-open",accordionToggle:"accordion-toggle",tabLink:"tab-link"}};class Accessibility{constructor(){this.init()}init(){this.settings=settings$1,this.window=window,this.document=document,this.a11y=a11y,this.cart=this.window.cart,this.inPageLink=this.document.querySelector(this.settings.elements.inPageLink),this.linkesWithOnlyHash=this.document.querySelectorAll(this.settings.elements.linkesWithOnlyHash),this.html=this.document.querySelector(this.settings.elements.html),this.body=this.document.querySelector(this.settings.elements.body),this.cartDropdown=this.document.querySelector(this.settings.elements.cartDropdown),this.lastFocused=null,this.isFocused=!1,this.a11y.focusHash(),this.a11y.bindInPageLinks(),this.clickEvents(),this.focusEvents(),this.focusEventsOff(),this.closeExpandedElements()}clickEvents(){this.inPageLink&&this.inPageLink.addEventListener("click",event=>{event.preventDefault()}),this.linkesWithOnlyHash&&this.linkesWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){this.document.addEventListener("keyup",event=>{event.keyCode===window.theme.keyboardKeys.TAB&&(this.body.classList.add(this.settings.classes.focus),this.isFocused=!0)}),this.document.addEventListener("keyup",event=>{if(!this.isFocused)return;const target=event.target,pressEnterOrSpace=event.keyCode===window.theme.keyboardKeys.ENTER||event.keyCode===window.theme.keyboardKeys.SPACE,targetElement=target.matches(this.settings.elements.triggerFocusElement)||target.closest(this.settings.elements.triggerFocusElement),isAccordion=target.classList.contains(this.settings.classes.accordionToggle)||target.parentNode.classList.contains(this.settings.classes.accordionToggle)||target.hasAttribute(this.settings.elements.accordionDataToggle)||target.parentNode.hasAttribute(this.settings.elements.accordionDataToggle),isTab=target.classList.contains(this.settings.classes.tabLink)||target.parentNode.classList.contains(this.settings.classes.tabLink),isSearchModal=target.hasAttribute("data-popdown-toggle")||target.closest(this.settings.elements.triggerFocusElement)&&target.closest(this.settings.elements.triggerFocusElement).hasAttribute("data-popdown-toggle");if(pressEnterOrSpace&&targetElement){this.lastFocused===null&&(this.lastFocused=target);let container=this.document.querySelector(this.settings.elements.cartDropdown);if(isSearchModal&&(container=this.document.querySelector(this.settings.elements.search)),isAccordion&&(container=target.nextElementSibling,target.click()),isTab){const selector=`.tab-content-${target.getAttribute("data-tab")}`;container=this.document.querySelector(selector),target.click()}container.querySelector("a, input")&&!isAccordion&&!isTab&&this.a11y.trapFocus(container,{elementToFocus:container.querySelector("a:first-child, input:first-child")})}}),this.html.addEventListener("cart:add-item",event=>{this.lastFocused=event.detail.selector})}focusEventsOff(){this.document.addEventListener("mousedown",()=>{this.body.classList.remove(this.settings.classes.focus),this.isFocused=!1})}closeExpandedElements(){document.addEventListener("keyup",event=>{if(event.keyCode!==window.theme.keyboardKeys.ESCAPE)return;this.a11y.removeTrapFocus(),this.html.classList.contains(this.cart.settings.classes.htmlClasses)&&(this.cart.toggleCartDropdown(),this.html.classList.remove(this.cart.settings.classes.htmlClasses),this.cartDropdown.classList.remove(this.cart.settings.classes.open));const accordionContents=document.querySelectorAll(this.settings.elements.accordionContent);if(accordionContents.length)for(let i=0;i<accordionContents.length;i++){if(accordionContents[i].style.display!=="block")continue;accordionContents[i].previousElementSibling.classList.remove(this.settings.classes.open),slideUp(accordionContents[i])}this.lastFocused!==null&&setTimeout(()=>{this.lastFocused.focus(),this.lastFocused=null},600)})}}window.accessibility=new Accessibility,theme.ProductModel=(function(){let modelJsonSections={},models={},xrButtons={};const selectors2={productMediaWrapper:"[data-product-single-media-wrapper]",productSlideshow:"[data-product-slideshow]",productXr:"[data-shopify-xr]",dataMediaId:"data-media-id",dataModelId:"data-model-id",dataModel3d:"data-shopify-model3d-id",modelViewer:"model-viewer",modelJson:"#ModelJson-",classMediaHidden:"media--hidden",deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]"},classes2={isLoading:"is-loading"};function init(mediaContainer,sectionId){modelJsonSections[sectionId]={loaded:!1};const deferredMediaButton=mediaContainer.querySelector(selectors2.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",loadContent.bind(this,mediaContainer,sectionId))}function loadContent(mediaContainer,sectionId){if(mediaContainer.querySelector(selectors2.deferredMedia).getAttribute("loaded"))return;mediaContainer.classList.add(classes2.isLoading);const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const modelViewerElement=content.querySelector("model-viewer"),deferredMedia=mediaContainer.querySelector(selectors2.deferredMedia);deferredMedia.appendChild(modelViewerElement).focus(),deferredMedia.setAttribute("loaded",!0);const mediaId=mediaContainer.dataset.mediaId,modelId=modelViewerElement.dataset.modelId,xrButton=mediaContainer.closest(selectors2.productSlideshow).parentElement.querySelector(selectors2.productXr);xrButtons[sectionId]={element:xrButton,defaultId:modelId},models[mediaId]={modelId,mediaId,sectionId,container:mediaContainer,element:modelViewerElement},window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr}
8,{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}])}function setupShopifyXr(errors){if(errors){console.warn(errors);return}if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(const sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){const modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;const modelJson=document.querySelector(`${selectors2.modelJson}${sectionId}`);modelJson&&(window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0)}window.ShopifyXR.setupXRElements()}function setupModelViewerUi(errors){if(errors){console.warn(errors);return}for(const key in models)if(models.hasOwnProperty(key)){const model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.element)),setupModelViewerListeners(model)}}function setupModelViewerListeners(model){const xrButton=xrButtons[model.sectionId];model.container.addEventListener("mediaVisible",function(){xrButton.element.setAttribute(selectors2.dataModel3d,model.modelId),pauseOtherMedia(model.mediaId),!window.theme.touch&&model.modelViewerUi.play()}),model.container.addEventListener("mediaHidden",function(){model.modelViewerUi.pause()}),model.container.addEventListener("xrLaunch",function(){model.modelViewerUi.pause()}),model.element.addEventListener("load",()=>{model.container.classList.remove(classes2.isLoading),pauseOtherMedia(model.mediaId)}),model.element.addEventListener("shopify_model_viewer_ui_toggle_play",function(){pauseOtherMedia(model.mediaId)})}function pauseOtherMedia(mediaId){const mediaIdString=`[${selectors2.dataMediaId}="${mediaId}"]`,currentMedia=document.querySelector(`${selectors2.productMediaWrapper}${mediaIdString}`),otherMedia=document.querySelectorAll(`${selectors2.productMediaWrapper}:not(${mediaIdString})`);currentMedia.classList.remove(selectors2.classMediaHidden),otherMedia.length&&otherMedia.forEach(element=>{element.dispatchEvent(new CustomEvent("mediaHidden")),element.classList.add(selectors2.classMediaHidden)})}function removeSectionModels(sectionId){for(const key in models)models.hasOwnProperty(key)&&models[key].sectionId===sectionId&&delete models[key];delete modelJsonSections[sectionId],delete theme.mediaInstances[sectionId]}return{init,loadContent,removeSectionModels}})();const selectors$3={templateAddresses:".template-addresses",addressNewForm:"#AddressNewForm",btnNew:".address-new-toggle",btnEdit:".address-edit-toggle",btnDelete:".address-delete",classHide:"hide",dataFormId:"data-form-id",dataConfirmMessage:"data-confirm-message",editAddress:"#EditAddress",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:".address-country-option",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$3.addressNewForm),this.init()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$3.btnNew);newButtons.length&&newButtons.forEach(element=>{element.addEventListener("click",function(){newAddressForm.classList.toggle(selectors$3.classHide)})});const editButtons=section.querySelectorAll(selectors$3.btnEdit);editButtons.length&&editButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$3.dataFormId);section.querySelector(`${selectors$3.editAddress}_${formId}`).classList.toggle(selectors$3.classHide)})});const deleteButtons=section.querySelectorAll(selectors$3.btnDelete);deleteButtons.length&&deleteButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$3.dataFormId),confirmMessage=this.getAttribute(selectors$3.dataConfirmMessage);confirm(confirmMessage)&&Shopify.postLink(window.theme.routes.addresses_url+"/"+formId,{parameters:{_method:"delete"}})})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$3.addressCountryNew,selectors$3.addressProvinceNew,{hideElement:selectors$3.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$3.addressCountryOption).forEac
8h(element=>{const formId=element.getAttribute(selectors$3.dataFormId),countrySelector=`${selectors$3.addressCountry}_${formId}`,provinceSelector=`${selectors$3.addressProvince}_${formId}`,containerSelector=`${selectors$3.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}}const template=document.querySelector(selectors$3.templateAddresses);template&&new Addresses(template);const selectors$4={accountTemplateLogged:".customer-logged-in",account:".account",accountSidebarMobile:".account-sidebar--mobile"};class Account{constructor(section){this.section=section,this.init()}init(){this.section.querySelector(selectors$4.account)&&this.accountMobileSidebar()}accountMobileSidebar(){this.section.querySelector(selectors$4.accountSidebarMobile).addEventListener("click",function(){const nextElem=this.nextElementSibling;nextElem&&nextElem.tagName==="UL"&&nextElem.classList.toggle("visible")})}}const template$1=document.querySelector(selectors$4.accountTemplateLogged);template$1&&new Account(template$1);const selectors$5={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",login:"[data-login-form]",recoverHash:"#recover",hideClass:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$5.showReset),this.hideButton=form.querySelector(selectors$5.hideReset),this.recover=form.querySelector(selectors$5.recover),this.login=form.querySelector(selectors$5.login),this.init()}init(){window.location.hash==selectors$5.recoverHash?this.showRecoverPasswordForm():this.hideRecoverPasswordForm(),this.showButton.addEventListener("click",function(e){e.preventDefault(),this.showRecoverPasswordForm()}.bind(this),!1),this.hideButton.addEventListener("click",function(e){e.preventDefault(),this.hideRecoverPasswordForm()}.bind(this),!1)}showRecoverPasswordForm(){return this.login.classList.add(selectors$5.hideClass),this.recover.classList.remove(selectors$5.hideClass),window.location.hash=selectors$5.recoverHash,!1}hideRecoverPasswordForm(){return this.recover.classList.add(selectors$5.hideClass),this.login.classList.remove(selectors$5.hideClass),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$5.form);loginForm&&new Login(loginForm),window.Shopify=window.Shopify||{},window.Shopify.theme=window.Shopify.theme||{},window.Shopify.theme.sections=window.Shopify.theme.sections||{},window.Shopify.theme.sections.registered=window.Shopify.theme.sections.registered||{},window.Shopify.theme.sections.instances=window.Shopify.theme.sections.instances||[];const registered=window.Shopify.theme.sections.registered,instances=window.Shopify.theme.sections.instances,selectors$6={id:"data-section-id",type:"data-section-type"};class Registration{constructor(type=null,components=[]){this.type=type,this.components=validateComponentsArray(components),this.callStack={onLoad:[],onUnload:[],onSelect:[],onDeselect:[],onBlockSelect:[],onBlockDeselect:[],onReorder:[]},components.forEach(comp=>{for(const[key,value]of Object.entries(comp)){const arr=this.callStack[key];Array.isArray(arr)&&typeof value=="function"?arr.push(value):(console.warn(`Unregisted function: '${key}' in component: '${this.type}'`),console.warn(value))}})}getStack(){return this.callStack}}class Section{constructor(container,registration){this.container=validateContainerElement(container),this.id=container.getAttribute(selectors$6.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.warn(e)}}callFunctions(key,e=null){this.callStack[key].forEach(func=>
8{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}}function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(selectors$6.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+selectors$6.id+" attribute.");return container}function validateComponentsArray(value){if(typeof value<"u"&&typeof value!="object"||value===null)throw new TypeError("Theme Sections: The components object provided is not a valid");return value}function register(type,components){if(typeof type!="string")throw new TypeError("Theme Sections: The first argument for .register must be a string that specifies the type of the section being registered");if(typeof registered[type]<"u")throw new Error('Theme Sections: A section of type "'+type+'" has already been registered. You cannot register the same section type twice');Array.isArray(components)||(components=[components]);const section=new Registration(type,components);return registered[type]=section,registered}function load(types,containers){types=normalizeType(types),typeof containers>"u"&&(containers=document.querySelectorAll("["+selectors$6.type+"]")),containers=normalizeContainers(containers),types.forEach(function(type){const registration=registered[type];typeof registration>"u"||(containers=containers.filter(function(container){return isInstance(container)||container.getAttribute(selectors$6.type)===null?!1:container.getAttribute(selectors$6.type)!==type?!0:(instances.push(new Section(container,registration)),!1)}))})}function reorder(selector){var instancesToReorder=getInstances(selector);instancesToReorder.forEach(function(instance){instance.onReorder()})}function unload(selector){var instancesToUnload=getInstances(selector);instancesToUnload.forEach(function(instance){var index=instances.map(function(e){return e.id}).indexOf(instance.id);instances.splice(index,1),instance.onUnload()})}function getInstances(selector){var filteredInstances=[];if(NodeList.prototype.isPrototypeOf(selector)||Array.isArray(selector))var firstElement=selector[0];if(selector instanceof Element||firstElement instanceof Element){var containers=normalizeContainers(selector);containers.forEach(function(container){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.container===container}))})}else if(typeof selector=="string"||typeof firstElement=="string"){var types=normalizeType(selector);types.forEach(function(type){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.type===type}))})}return filteredInstances}function getInstanceById(id){for(var instance,i=0;i<instances.length;i++)if(instances[i].id===id){instance=instances[i];break}return instance}function isInstance(selector){return getInstances(selector).length>0}function normalizeType(types){return types==="*"?types=Object.keys(registered):typeof types=="string"?types=[types]:types.constructor===Section?types=[types.prototype.type]:Array.isArray(types)&&types[0].constructor===Section&&(types=types.map(function(Section2){return Section2.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers)&&containers.length>
80?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$6.id+'="'+id+'"]');container!==null&&load(container.getAttribute(selectors$6.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$6.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&reorder(container)}),document.addEventListener("shopify:section:unload",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$6.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&unload(container)}),document.addEventListener("shopify:section:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onSelect(event)}),document.addEventListener("shopify:section:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onDeselect(event)}),document.addEventListener("shopify:block:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockSelect(event)}),document.addEventListener("shopify:block:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockDeselect(event)}));const selectors$7={collectionImage:".collection-item__image",columnImage:".column__image__wrapper",aos:"[data-aos]",flickityNextArrow:".flickity-button.next",flickityPrevArrow:".flickity-button.previous",heroContent:".hero__content",heroContentWrapper:".hero__content__wrapper",nextArrow:"[data-next-arrow]",prevArrow:"[data-prev-arrow]",productItemImage:".product-item__image",slide:"[data-slide]",slideValue:"data-slide",slider:"[data-slider]",sliderThumb:"[data-slider-thumb]",sliderThumbClick:"[data-slider-thumb-click]",slideshowSlideImg:".slide-image-img"},attributes={adaptiveHeight:"data-adaptive-height",arrowPositionMiddle:"data-arrow-position-middle",arrows:"data-arrows",aspectRatio:"data-aspectratio",autoplay:"data-autoplay",autoplaySpeed:"data-speed",cellAlign:"data-cell-align",dots:"data-dots",draggable:"data-draggable",equalizeHeight:"data-equalize-height",fade:"data-fade",groupCells:"data-group-cells",infinite:"data-infinite",percentPosition:"data-percent-position",setHeight:"data-set-height",slideIndex:"data-slide-index",sliderAnimate:"data-slider-animate",sliderAnimateOnce:"data-slider-animate-once",sliderStartIndex:"data-slider-start-index",slidesDesktop:"data-slides-desktop",slidesLargeDesktop:"data-slides-large-desktop",slidesMobileDesktop:"data-slides-mobile",slidesTabletDesktop:"data-slides-tablet",watchCss:"data-watch-css",slideTextColor:"data-slide-text-color"},classes={aosAnimated:"aos-animated",flickityResize:"flickity-resize",heroContentTransparent:"hero__content--transparent",isSelected:"is-selected",sliderArrowsHidden:"flickity-button-hide",sliderInitialized:"js-slider--initialized",aosAnimate:"aos-animate"},sections={};class Slider{constructor(container,slideshow=null){this.container=container,this.slideshow=slideshow||this.container.querySelector(selectors$7.slider),this.slideshow&&(this.slideshowSlides=this.slideshow.querySelectorAll(selectors$7.slide),this.sliderPrev=this.container.querySelector(selectors$7.prevArrow),this.sliderNext=this.container.querySelector(selectors$7.nextArrow),this.sliderThumbs=this.container.querySelectorAll(selectors$7.sliderThumb),this.sliderThumbsClick=this.container.querySelectorAll(selectors$7.sliderThumbClick),this.showDots=this.slideshow.getAttribute(attributes.dots)!="hidden",this.showArrows=this.slideshow.getAttribute(attributes.arrows)==="true",this.autoPlay=this.slideshow.getAttribute(attributes.autoplay)==="true",this.autoPlaySpeed=this.slideshow.getAttribute(attributes.autoplaySpeed),this.infinite=this.slideshow.getAttribute(attributes.infinite)!=="false",this.setMinHeightFlag=this.slideshow.getAttribute(attributes.setHeight)==="true",this.watchCss=this.slideshow.getAttribute(attributes.watchCss)==="true",this.adaptiveHeight=this.slideshow.getAttribute(attributes.adaptiveHeight)!=="false",this.cellAlignLeft=this.slideshow.getAttribute(attributes.cellAlign)==="left",this.cellAlignRight=this.slideshow.getAttribute(attributes.cellAlign)==="right",this.draggable=this.slideshow.getAttribute(attributes.draggable)!=="false",this.percentPosition=this.slideshow.getAttribute(attributes.percentPosition)!=="false",this.multipleSlides=this.slideshow.hasAttribute(attributes.slidesLargeDesktop),this.sliderStartIndex=this.slideshow.hasAttribute(attributes.sliderStartIndex),this.groupCells=this.slideshow.getAttribute(attributes.groupCells)==="true",this.sliderAnimate=this.slideshow.getAttribute(attributes.sliderAnimate)==="true",this.sliderAnimateOnce=this.slideshow.getAttribute(attributes.sliderAnimateOnce)==="true",this.dataEqualizeHeight=this.slideshow.getAttribute(attributes.equalizeHeight)==="true",this.fade=this.slideshow.getAttribute(attributes.fade)==="true",this.resizeEvent=debounce(()=>this.resizeEvents(),100),this.resizeEventAlt=debounce(()=>this.addRemoveSlidesForDevices(),100),this.resetSliderEvent=()=>this.resetSlider(),this.flkty=null,this.init())}init(){this.setMinHeight();const sliderOptions={initialIndex:this.sliderStartIndex?parseInt(this.slideshow.getAttribute(attributes.sliderStartIndex)):0,autoPlay:this.autoPlay&&this.autoPlaySpeed?parseInt(this.autoPlaySpeed):!1,contain:!0,pageDots:this.showDots,prevNextButtons:this.showArrows,adaptiveHeight:this.adaptiveHeight,wrapAround:this.infinite,percentPosition:this.percentPosition,watchCSS:this.watchCss,cellAlign:this.cellAlignLeft?"left"
8:this.cellAlignRight?"right":"center",groupCells:this.groupCells,draggable:this.draggable?">1":!1,on:{ready:()=>{this.sliderAnimate&&this.sliderAnimateOnce&&!this.autoPlay&&this.slideshow.querySelector(`.${classes.isSelected}`).classList.add(classes.aosAnimated),setTimeout(()=>{this.slideshow.parentNode.dispatchEvent(new CustomEvent("theme:slider:loaded",{bubbles:!0,detail:{slider:this}}))},10),this.slideActions(),this.slideshow.classList.contains(classes.isSelected)&&this.slideshow.classList.remove(classes.isSelected),this.showArrows&&(this.initArrows(),this.positionArrows())},resize:()=>{this.showArrows&&this.positionArrows()}}};this.fade&&(sliderOptions.fade=!0,this.flkty=new FlickityFade(this.slideshow,sliderOptions)),this.fade||(this.flkty=new Flickity(this.slideshow,sliderOptions)),this.dataEqualizeHeight&&this.equalizeHeight(),this.sliderPrev&&this.sliderPrev.addEventListener("click",e=>{e.preventDefault(),this.flkty.previous(!0)}),this.sliderNext&&this.sliderNext.addEventListener("click",e=>{e.preventDefault(),this.flkty.next(!0)}),this.flkty.on("change",()=>this.slideActions()),this.addRemoveSlidesForDevices(),window.addEventListener("resize",this.resizeEventAlt),this.sliderAnimate&&this.flkty.on("settle",()=>this.sliderSettle()),(this.setMinHeightFlag||this.multipleSlides)&&window.addEventListener("resize",this.resizeEvent),this.sliderThumbsClick.length&&this.sliderThumbsClick.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const slideIndex=[...element.parentElement.children].indexOf(element);this.flkty.select(slideIndex)})}),this.container.addEventListener("theme:tab:change",this.resetSliderEvent)}sliderSettle(){let animatedItems=this.slideshow.querySelectorAll(`.${classes.isSelected} ${selectors$7.aos}`);this.sliderAnimateOnce&&(animatedItems=this.slideshow.querySelectorAll(`.${classes.isSelected}:not(.${classes.aosAnimated}) .${classes.aosAnimated}`)),animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.add(classes.aosAnimate),this.sliderAnimateOnce&&animatedItem.closest(`.${classes.isSelected}`).classList.add(classes.aosAnimated)})}resetSlider(){this.slideshow&&(this.flkty&&this.flkty.isActive?this.flkty.select(0,!1,!0):this.slideshow.scrollTo({left:0,behavior:"auto"}))}addRemoveSlidesForDevices(){if(this.hasDiffSlidesForMobileDesktop=Array.prototype.filter.call(this.slideshowSlides,slide=>{if(slide.classList.contains("desktop")||slide.classList.contains("mobile"))return slide}).length>0,!this.hasDiffSlidesForMobileDesktop)return;const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;let selectorSlides=null;windowWidth<theme.sizes.small?selectorSlides=`${selectors$7.slide}.mobile, ${selectors$7.slide}:not(.desktop)`:selectorSlides=`${selectors$7.slide}.desktop, ${selectors$7.slide}:not(.mobile)`,this.flkty.options.cellSelector=selectorSlides,this.flkty.selectCell(0,!1,
8!0),this.flkty.reloadCells(),this.flkty.reposition(),this.flkty.resize(),this.slideActions()}resizeEvents(){this.setMinHeight(),this.multipleSlides&&(this.showArrows&&this.initArrows(),this.flkty.resize(),this.slideshow.classList.contains(classes.sliderInitialized)||this.flkty.select(0))}slideActions(){const currentSlide=this.slideshow.querySelector(`.${classes.isSelected}`),currentSlideTextColor=currentSlide.getAttribute(attributes.slideTextColor);if(currentSlideTextColor!=="rgba(0,0,0,0)"&&currentSlideTextColor!==""&&this.slideshow.style.setProperty("--text",currentSlideTextColor),this.setMinHeight(),this.sliderAnimate){let animatedItems=this.slideshow.querySelectorAll(`.${classes.isSelected} .${classes.aosAnimate}`);this.sliderAnimateOnce&&(animatedItems=this.slideshow.querySelectorAll(`.${classes.isSelected}:not(.${classes.aosAnimated}) .${classes.aosAnimate}`)),animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.remove(classes.aosAnimate),this.sliderAnimateOnce&&animatedItem.classList.add(classes.aosAnimated)})}if(this.sliderThumbs.length&&this.sliderThumbs.length===this.slideshowSlides.length&&currentSlide.hasAttribute(attributes.slideIndex)){const slideIndex=parseInt(currentSlide.getAttribute(attributes.slideIndex)),currentThumb=this.container.querySelector(`${selectors$7.sliderThumb}.${classes.isSelected}`);currentThumb&&currentThumb.classList.remove(classes.isSelected),this.sliderThumbs[slideIndex].classList.add(classes.isSelected)}}setMinHeight(){this.setMinHeightFlag&&this.slideshowSlides.forEach(element=>{const slideImageImg=element.querySelector(selectors$7.slideshowSlideImg);let slideAspectRatio="";slideImageImg&&slideImageImg.hasAttribute(attributes.aspectRatio)&&(slideAspectRatio=slideImageImg.getAttribute(attributes.aspectRatio));let slideTextContentHeight=0,getMargin=0;const slideTextContent=element.querySelector(selectors$7.heroContent);if(slideTextContent){const getMarginTop=parseInt(window.getComputedStyle(slideTextContent).marginTop),getMarginBottom=parseInt(window.getComputedStyle(slideTextContent).marginBottom);getMargin=getMarginTop+getMarginBottom,slideTextContentHeight=slideTextContent.offsetHeight+getMargin}const slideWidth=parseInt(getComputedStyle(element,null).width.replace("px",""));let slideHeight=parseInt(slideWidth/slideAspectRatio)||0;const isCurrentSlide=element.classList.contains(classes.isSelected);slideTextContentHeight>slideHeight&&(slideHeight=slideTextContentHeight);const minHeightValue=`calc(${slideHeight}px + var(--header-padding))`;element.style.setProperty("min-height",minHeightValue);const heroContentWrapper=element.querySelector(selectors$7.heroContentWrapper);heroContentWrapper&&heroContentWrapper.style.setProperty("min-height",minHeightValue),isCurrentSlide&&this.slideshow.parentElement.style.setProperty("min-height",minHeightValue)})}positionArrows(){if(this.slideshow.hasAttribute(attributes.arrowPositionMiddle)&&this.showArrows){const itemImage=this.slideshow.querySelector(selectors$7.collectionImage)||this.slideshow.querySelector(selectors$7.productItemImage)||this.slideshow.querySelector(selectors$7.columnImage);if(!itemImage)return;this.slideshow.querySelector(selectors$7.flickityPrevArrow).style.top=itemImage.clientHeight/2+"px",this.slideshow.querySelector(selectors$7.flickityNextArrow).style.top=itemImage.clientHeight/2+"px"}}initArrows(){if(!this.multipleSlides)return;const slidesNumberCustom=parseInt(this.slideshow.getAttribute(attributes.slidesLargeDesktop)),windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,desktopSlides=this.slideshow.hasAttribute(attributes.slidesDesktop)?parseInt(this.slideshow.getAttribute(attributes.slidesDesktop)):3,tabletSlides=this.slideshow.hasAttribute(attributes.slidesTabletDesktop)?parseInt(this.slideshow.getAttribute(attributes.slidesTabletDesktop)):2,mobileSlides=this.slideshow.hasAttribute(attributes.slidesMobileDesktop)?parseInt(this.slideshow.getAttribute(attributes.slidesMobileDesktop)):1,largeDesktopCheck=windowWidth>1339&&this.slideshowSlides.length>slidesNumberCustom,desktopCheck=windowWidth<=1339&&windowWidth>1023&&this.slideshowSlides.length>desktopSlides,tabletCheck=windowWidth<=1023&&windowWidth>749&&this.slideshowSlides.length>tabletSlides,mobileCheck=windowWidth<=749&&this.slideshowSlides.length>mobileSlides,flag=!!(largeDesktopCheck||desktopCheck||tabletCheck||mobileCheck);this.slideshow.classList.toggle(classes.sliderArrowsHidden,!flag),this.slideshow.classList.toggle(classes.sliderInitialized,flag)}equalizeHeight(){Flickity.prototype._createResizeClass=function(){setTimeout(()=>{this.element.classList.add(classes.flickityResize)})},Flickity.createMethods.push("_createResizeClass");const resize=Flickity.prototype.resize;Flickity.prototype.resize=function(){this.element.classList.remove(classes.flickityResize),resize.call(this),this.element.classList.add(classes.flickityResize)},this.flkty.resize()}onUnload(){(this.setMinHeightFlag||this.multipleSlides)&&window.removeEventListener("resize",this.resizeEvent),this.slideshow&&this.flkty&&(this.flkty.options.watchCSS=!1,this.flkty.destroy()),this.container.removeEventListener("theme:tab:change",this.resetSliderEvent)}onBlockSelect(evt){if(!this.slideshow)return;const slide=this.slideshow.querySelector(`[${selectors$7.slideValue}="${evt.detail.blockId}"]`);if(!slide)return;let slideIndex=parseInt(slide.getAttribute(attributes.slideIndex));
8this.multipleSlides&&!this.slideshow.classList.contains(classes.sliderInitialized)&&(slideIndex=0),this.slideshow.classList.add(classes.isSelected),this.flkty.selectCell(slideIndex),this.flkty.stopPlayer()}onBlockDeselect(){this.slideshow&&(this.slideshow.classList.remove(classes.isSelected),this.autoPlay&&this.flkty.playPlayer())}}const slider={onLoad(){sections[this.id]=[],this.container.querySelectorAll(selectors$7.slider).forEach(el=>{sections[this.id].push(new Slider(this.container,el))})},onUnload(){sections[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(e)})}},throttle=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now=Date.now();next=clearTimeout(next),!prev2||now-prev2>=wait?(fn.apply(null,args),prev2=now):next=setTimeout(invokeFn.bind(null,...args),wait-(now-prev2))}},selectors$8={tooltip:"data-tooltip",tooltipStopMouseEnter:"data-tooltip-stop-mouseenter"},classes$1={tooltipDefault:"tooltip-default",visible:"is-visible",hiding:"is-hiding"};let sections$1={};class Tooltip{constructor(el,options={}){this.tooltip=el,this.tooltip.hasAttribute(selectors$8.tooltip)&&(this.label=this.tooltip.getAttribute(selectors$8.tooltip),this.class=options.class||classes$1.tooltipDefault,this.transitionSpeed=options.transitionSpeed||200,this.hideTransitionTimeout=0,this.addPinEvent=()=>this.addPin(),this.addPinMouseEvent=()=>this.addPin(!0),this.removePinEvent=event=>throttle(this.removePin(event),50),this.removePinMouseEvent=event=>this.removePin(event,!0,!0),this.init())}init(){if(!document.querySelector(`.${this.class}`)){const tooltipTemplate=`<div class="${this.class}__arrow"></div><div class="${this.class}__inner"><div class="${this.class}__text"></div></div>`,tooltipElement=document.createElement("div");tooltipElement.className=this.class,tooltipElement.innerHTML=tooltipTemplate,document.body.appendChild(tooltipElement)}this.tooltip.addEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.addEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.addEventListener("tooltip:init",this.addPinEvent),document.addEventListener("tooltip:close",this.removePinEvent)}addPin(stopMouseEnter=!1){const tooltipTarget=document.querySelector(`.${this.class}`);if(tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$8.tooltipStopMouseEnter)||!stopMouseEnter)){const tooltipTargetArrow=tooltipTarget.querySelector(`.${this.class}__arrow`),tooltipTargetInner=tooltipTarget.querySelector(`.${this.class}__inner`),tooltipTargetText=tooltipTarget.querySelector(`.${this.class}__text`);tooltipTargetText.textContent=this.label;const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,tooltipTargetWidth=tooltipTargetInner.offsetWidth,tooltipRect=this.tooltip.getBoundingClientRect(),tooltipTop=tooltipRect.top,tooltipWidth=tooltipRect.width,tooltipHeight=tooltipRect.height,tooltipTargetPositionTop=tooltipTop+tooltipHeight+window.scrollY;let tooltipTargetPositionLeft=tooltipRect.left-tooltipTargetWidth/2+tooltipWidth/2;const tooltipTargetWindowDifference=tooltipTargetPositionLeft+tooltipTargetWidth-windowWidth;tooltipTargetWindowDifference>0&&(tooltipTargetPositionLeft-=tooltipTargetWindowDifference),tooltipTargetPositionLeft<0&&(tooltipTargetPositionLeft=0),tooltipTargetArrow.style.left=`${tooltipRect.left+tooltipWidth/2}px`,tooltipTarget.style.top=`${tooltipTargetPositionTop}px`,tooltipTargetInner.style.transform=`translateX(${tooltipTargetPositionLeft}px)`,tooltipTarget.classList.remove(classes$1.hiding),tooltipTarget.classList.add(classes$1.visible),document.addEventListener("theme:scroll",this.removePinEvent)}}removePin(event,stopMouseEnter=!1,hideTransition=!1){const tooltipTarget=document.querySelector(`.${this.class}`),tooltipVisible=tooltipTarget.classList.contains(classes$1.visible);tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$8.tooltipStopMouseEnter)||!stopMouseEnter)&&(tooltipVisible&&(hideTransition||event.detail.hideTransition)&&(tooltipTarget.classList.add(classes$1.hiding),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{tooltipTarget.classList.remove(classes$1.hiding)},this.transitionSpeed)),tooltipTarget.classList.remove(classes$1.visible),document.removeEventListener("theme:scroll",this.removePinEvent))}unload(){this.tooltip.removeEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.removeEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.removeEventListener("tooltip:init",this.addPinEvent),document.removeEventListener("tooltip:close",this.removePinEvent),document.removeEventListener("theme:scroll",this.removePinEvent)}}const tooltipSection={onLoad(){sections$1[this.id]=[],this.container.querySelectorAll(`[${selectors$8.tooltip}]`).forEach(el=>{sections$1[this.id].push(new Tooltip(el))})}
8,onUnload:function(){sections$1[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}},selectors$9={copyClipboard:"[data-copy-clipboard]",tooltip:"data-tooltip"},classes$2={visible:"is-visible"},sections$2={};class CopyClipboard{constructor(section){this.container=section.container,this.copyButtons=this.container.querySelectorAll(selectors$9.copyClipboard),this.copyButtons.length&&this.init()}init(){this.copyButtons.forEach(el=>{el.addEventListener("click",function(e){e.preventDefault();const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,copyText=this.getAttribute("href");this.style.position="static";let inputElem=document.createElement("input");inputElem.type="text",this.appendChild(inputElem);const newInput=this.querySelector("input");newInput.value=copyText,newInput.select(),newInput.setSelectionRange(0,99999),document.execCommand("copy"),this.style.removeProperty("position"),this.removeChild(newInput),this.hasAttribute(selectors$9.tooltip)&&windowWidth>=theme.sizes.small&&(this.classList.add(classes$2.visible),this.dispatchEvent(new CustomEvent("tooltip:init",{bubbles:!0})),setTimeout(()=>{this.classList.remove(classes$2.visible),document.dispatchEvent(new CustomEvent("tooltip:close",{bubbles:!1,detail:{hideTransition:!0}}))},2e3))})})}}const copyClipboard={onLoad(){sections$2[this.id]=new CopyClipboard(this)}};var sections$3={};const parallaxHero={onLoad(){sections$3[this.id]=[],this.container.querySelectorAll("[data-parallax-wrapper]").forEach(frame=>{const inner=frame.querySelector("[data-parallax-img]");sections$3[this.id].push(new Rellax(inner,{center:!0,round:!0,frame}))}),window.addEventListener("load",()=>{sections$3[this.id].forEach(image=>{typeof image.refresh=="function"&&image.refresh()})})},onUnload:function(){sections$3[this.id].forEach(image=>{typeof image.destroy=="function"&&image.destroy()})}},selectors$a={sidebar:".sidebar",widgetCategories:".widget--categories",widgetLinksEl:".widget__links",widgetLinks:".widget__links .has-sub-nav > a",widgetLinksSub:".widget__links .submenu > li > a",listEl:"li",linkEl:"a",articleSingle:".article--single",sidebarContents:".sidebar__contents",hasSubNav:".has-sub-nav"},classes$3={open:"open",active:"active",submenu:"submenu"},sections$4={};class Article{constructor(section){this.container=section.container,this.sidebar=this.container.querySelector(selectors$a.sidebar),this.widgetCategories=this.container.querySelector(selectors$a.widgetCategories),this.resizeEvent=()=>this.categories(),this.init()}init(){this.sidebar&&this.sidebarNav()}sidebarNav(){this.navStates(),this.container.addEventListener("click",e=>{const checkLinkTag=e.target.tagName.toLowerCase()===selectors$a.linkEl,checkLinkParent=e.target.closest(`${selectors$a.listEl}${selectors$a.hasSubNav}`),checkLinkClosest=e.target.closest(selectors$a.widgetLinksEl),checkLink=checkLinkTag&&checkLinkParent&&checkLinkClosest,submenu=e.target.nextElementSibling;!((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small)&&checkLink&&submenu&&(submenu.parentElement.classList.toggle(classes$3.active),submenu.classList.toggle(classes$3.open),submenu.setAttribute("aria-expanded",submenu.classList.contains(classes$3.open)),slideToggle(submenu),e.preventDefault())}),this.widgetCategories&&(this.widgetCategoriesNext=this.widgetCategories.nextSibling,this.widgetCategoriesParentNode=this.widgetCategories.parentNode,this.categories(),document.addEventListener("theme:resize",this.resizeEvent))}navStates(){const links=this.container.querySelectorAll(`${selectors$a.widgetLinks}, ${selectors$a.widgetLinksSub}`);links.length&&links.forEach(element=>{const href=element.getAttribute("href"),location2=window.location.pathname;if(href===location2){const elementClosest=element.closest(selectors$a.hasSubNav);if(element.closest("li").classList.add(classes$3.active),!elementClosest)return;elementClosest.classList.add(classes$3.active);const submenu=elementClosest.querySelector(`.${classes$3.submenu}`);submenu&&(submenu.classList.toggle(classes$3.open),submenu.setAttribute("aria-expanded",submenu.classList.contains(classe
8s$3.open)),showElement(submenu))}})}categories(){const isMobile=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small,widgetCategories=document.querySelector(selectors$a.widgetCategories);isMobile?document.querySelector(selectors$a.articleSingle).prepend(widgetCategories):this.widgetCategoriesParentNode.insertBefore(widgetCategories,this.widgetCategoriesNext)}onUnload(){this.widgetCategories&&document.removeEventListener("theme:resize",this.resizeEvent)}}const articleSection={onLoad(){sections$4[this.id]=new Article(this)},onUnload(e){sections$4[this.id].onUnload(e)}};register("article",[articleSection,slider,tooltipSection,copyClipboard,parallaxHero]),register("blog-template",[slider]),register("hero",parallaxHero);const selectors$b={popoutWrapper:"[data-popout]",popoutList:"[data-popout-list]",popoutToggle:"[data-popout-toggle]",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",popoutPrevent:"data-popout-prevent",popoutQuantity:"data-quantity-field",dataValue:"data-value",ariaExpanded:"aria-expanded",ariaCurrent:"aria-current",productGridImage:"[data-product-image]",productGrid:"[data-product-grid-item]"},classes$4={listVisible:"popout-list--visible",currentSuffix:"--current",popoutAlternative:"popout-container--alt",visible:"is-visible"};let sections$5={};class Popout{constructor(popout){this.container=popout,this.popoutList=this.container.querySelector(selectors$b.popoutList),this.popoutToggle=this.container.querySelector(selectors$b.popoutToggle),this.popoutInput=this.container.querySelector(selectors$b.popoutInput),this.popoutOptions=this.container.querySelectorAll(selectors$b.popoutOptions),this.productGrid=this.popoutList.closest(selectors$b.productGrid),this.popoutPrevent=this.container.getAttribute(selectors$b.popoutPrevent)==="true",this.popupToggleFocusoutEvent=evt=>this.popupToggleFocusout(evt),this.popupListFocusoutEvent=evt=>this.popupListFocusout(evt),this.popupToggleClickEvent=evt=>this.popupToggleClick(evt),this.containerKeyupEvent=evt=>this.containerKeyup(evt),this.popupOptionsClickEvent=evt=>this.popupOptionsClick(evt),this._connectOptionsDispatchEvent=evt=>this._connectOptionsDispatch(evt),this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popupListMaxWidth(),this.popoutInput&&this.popoutInput.hasAttribute(selectors$b.popoutQuantity)&&document.addEventListener("popout:updateValue",this.updatePopout.bind(this))}unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>
8{element.removeEventListener("clickDetails",this.popupOptionsClickEvent),element.removeEventListener("click",this._connectOptionsDispatchEvent)}),this.popoutToggle.removeEventListener("click",this.popupToggleClickEvent),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.removeEventListener("focusout",this.popupListFocusoutEvent),this.container.removeEventListener("keyup",this.containerKeyupEvent)}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(selectors$b.ariaExpanded)==="true";if(this.productGrid){const productGridItemImage=this.productGrid.querySelector(selectors$b.productGridImage);productGridItemImage&&productGridItemImage.classList.toggle(classes$4.visible,!ariaExpanded),this.popoutList.style.maxHeight=`${Math.abs(this.popoutToggle.getBoundingClientRect().bottom-this.productGrid.getBoundingClientRect().bottom)}px`}evt.currentTarget.setAttribute(selectors$b.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$4.listVisible),this.popupListMaxWidth()}popupToggleFocusout(evt){this.container.contains(evt.relatedTarget)||this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$4.listVisible)&&!childInFocus&&this._hideList()}popupListMaxWidth(){this.popoutList.style.maxWidth=`${parseInt(document.body.clientWidth-this.popoutList.getBoundingClientRect().left)}px`}popupOptionsClick(evt){if(evt.target.closest(selectors$b.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(selectors$b.dataValue)&&(attrValue=evt.currentTarget.getAttribute(selectors$b.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(selectors$b.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));
8const currentElement=this.popoutList.querySelector(`[class*="${classes$4.currentSuffix}"]`);let targetClass=classes$4.currentSuffix;if(currentElement&&currentElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$4.currentSuffix)){targetClass=currentElementClass;break}}const listTargetElement=this.popoutList.querySelector(`.${targetClass}`);listTargetElement&&(listTargetElement.classList.remove(`${targetClass}`),evt.currentTarget.parentElement.classList.add(`${targetClass}`));const targetAttribute=this.popoutList.querySelector(`[${selectors$b.ariaCurrent}]`);targetAttribute&&targetAttribute.hasAttribute(`${selectors$b.ariaCurrent}`)&&(targetAttribute.removeAttribute(`${selectors$b.ariaCurrent}`),evt.currentTarget.setAttribute(`${selectors$b.ariaCurrent}`,"true")),attrValue!==""&&(this.popoutToggle.textContent=attrValue),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}}updatePopout(){const targetElement=this.popout
8List.querySelector(`[${selectors$b.dataValue}="${this.popoutInput.value}"]`);targetElement?(targetElement.dispatchEvent(new CustomEvent("clickDetails",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!0}})),targetElement.parentElement.nextSibling||this.container.classList.add(classes$4.popoutAlternative)):this.container.classList.add(classes$4.popoutAlternative)}containerKeyup(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this._hideList(),this.popoutToggle.focus())}bodyClick(evt){const isOption=this.container.contains(evt.target);this.popoutList.classList.contains(classes$4.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClickEvent)}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("clickDetails",this.popupOptionsClickEvent),element.addEventListener("click",this._connectOptionsDispatchEvent)})}_connectOptionsDispatch(evt){const event=new CustomEvent("clickDetails",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!1}});evt.target.dispatchEvent(event)||evt.preventDefault()}_onFocusOut(){this.popoutToggle.addEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.addEventListener("focusout",this.popupListFocusoutEvent),this.container.addEventListener("keyup",this.containerKeyupEvent),document.body.addEventListener("click",this.bodyClick.bind(this))}_submitForm(){const form=this.container.closest("form");form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$4.listVisible),this.popoutToggle.setAttribute(selectors$b.ariaExpanded,!1)}}const popoutSection={onLoad(){sections$5[this.id]=[],this.container.querySelectorAll(selectors$b.popoutWrapper).forEach(wrapper=>{sections$5[this.id].push(new Popout(wrapper))})},onUnload(){sections$5[this.id].forEach(popout=>{typeof popout.unload=="function"&&popout.unload()})}},selectors$c={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},scrollTo=elementTop=>{const headerHeight=document.querySelector(selectors$c.headerSticky)&&document.querySelector(selectors$c.headerHeight)?document.querySelector(selectors$c.headerHeight).getBoundingClientRect().height:0;window.scrollTo({top:elementTop+window.scrollY-headerHeight,left:0,behavior:"smooth"})};class PopupCookie{constructor(name,value,expires){this.configuration={expires,path:"/",domain:window.location.hostname},this.name=name,this.value=value}write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}}const selectors$d={newsletterForm:"[data-newsletter-form]",newsletterHeading:"[data-newsletter-heading]",newsletterPopup:"[data-newsletter]"},classes$5={success:"has-success",error:"not-success",hide:"hide"},attributes$1={cookieNameAttribute:"data-cookie-name"},sections$6={};class NewsletterCheckForResult{constructor(newsletter){this.sessionStorage=window.sessionStorage,this.newsletter=newsletter,this.popup=this.newsletter.closest(selectors$d.newsletterPopup),this.popup&&(this.cookie=new PopupCookie(this.popup.getAttribute(attributes$1.cookieNameAttribute),"user_has_closed",null)),this.stopSubmit=!0,this.isChallengePage=!1,this.formID=null,this.checkForChallengePage(),this.newsletterSubmit=e=>this.newsletterSubmitEvent(e),this.isChallengePage||this.init()}init(){this.newsletter.addEventListener("submit",this.newsletterSubmit),this.showMessage()}newsletterSubmitEvent(e){this.stopSubmit&&(e.preventDefault(),this.removeStorage(),this.writeStorage(),this.stopSubmit=!1,this.newsletter.submit())}checkForChallengePage(){this.isChallengePage=window.location.pathname==="/challenge"}writeStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem("newsletter_form_id",this.newsletter.id)}readStorage(){this.formID=this.sessionStorage.getItem("newsletter_form_id")}removeStorage(){this.sessionStorage.removeItem("newsletter_form_id")}showMessage(){if(this.readStorage(),this.newsletter.id===this.formID){const newsletter=document.getElementById(this.formID),newsletterHeading=newsletter.parentElement.querySelector(selectors$d.newsletterHeading),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$5.error),newsletter.classList.add(classes$5.success),newsletterHeading&&newsletterHeading.classList.add(classes$5.hide),this.popup&&this.cookie.write()):submissionFailure&&(newsletter.classList.remove(classes$5.success),newsletter.classList.add(classes$5.error),newsletterHeading&&newsletterHeading.classList.add(classes$5.hide)),(submissionSuccess||submissionFailure)&&window.addEventListener("load",()=>{this.scrollToForm(newsletter)})}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)||setTimeout(()=>{scrollTo(newsletter.getBoundingClientRect().top)},500)}unload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}}const newsletterCheckForResultSection={onLoad(){sections$6[this.id]=[],this.container.querySelectorAll(selectors$d.newsletterForm).forEach(form=>{sections$6[this.id].push(new NewsletterCheckForResult(form))})}
8,onUnload(){sections$6[this.id].forEach(form=>{typeof form.unload=="function"&&form.unload()})}};register("footer",[popoutSection,parallaxHero,newsletterCheckForResultSection]);function Listeners(){this.entries=[]}Listeners.prototype.add=function(element,event,fn){this.entries.push({element,event,fn}),element.addEventListener(event,fn)},Listeners.prototype.removeAll=function(){this.entries=this.entries.filter(function(listener){return listener.element.removeEventListener(listener.event,listener.fn),!1})};function getVariantFromSerializedArray(product,collection){_validateProductStructure(product);var optionArray=_createOptionArrayFromOptionCollection(product,collection);return getVariantFromOptionArray(product,optionArray)}function getVariantFromOptionArray(product,options){_validateProductStructure(product),_validateOptionsArray(options);var result=product.variants.filter(function(variant){return options.every(function(option,index){return variant.options[index]===option})});return result[0]||null}function _createOptionArrayFromOptionCollection(product,collection){_validateProductStructure(product),_validateSerializedArray(collection);var optionArray=[];return collection.forEach(function(option){for(var i=0;i<product.options.length;i++){var name=product.options[i].name||product.options[i];if(name.toLowerCase()===option.name.toLowerCase()){optionArray[i]=option.value;break}}}),optionArray}function _validateProductStructure(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(Object.keys(product).length===0&&product.constructor===Object)throw new Error(product+" is empty.")}function _validateSerializedArray(collection){if(!Array.isArray(collection))throw new TypeError(collection+" is not an array.");if(collection.length===0)throw new Error(collection+" is empty.");if(collection[0].hasOwnProperty("name")){if(typeof collection[0].name!="string")throw new TypeError("Invalid value type passed for name of option "+collection[0].name+". Value should be string.")}else throw new Error(collection[0]+"does not contain name key.")}function _validateOptionsArray(options){if(Array.isArray(options)&&typeof options[0]=="object")throw new Error(options+"is not a valid array of options.")}var selectors$e={idInput:'[name="id"]',planInput:'[name="selling_plan"]',optionInput:'[name^="options"]',quantityInput:'[name="quantity"]',propertyInput:'[name^="properties"]'};function getUrlWithVariant(url,id){return/variant=/.test(url)?url.replace(/(variant=)[^&]+/,"$1"+id):/\?/.test(url)?url.concat("&variant=").concat(id):url.concat("?variant=").concat(id)}class ProductForm{constructor(element,product,options){this.element=element,this.form=this.element.tagName=="FORM"?this.element:this.element.querySelector("form"),this.product=this._validateProductObject(product),this.variantElement=this.element.querySelector(selectors$e.idInput),options=options||{},this._listeners=new Listeners,this._listeners.add(this.element,"submit",this._onSubmit.bind(this,options)),this.optionInputs=this._initInputs(selectors$e.optionInput,options.onOptionChange),this.planInputs=this._initInputs(selectors$e.planInput,options.onPlanChange),this.quantityInputs=this._initInputs(selectors$e.quantityInput,options.onQuantityChange),this.propertyInputs=this._initInputs(selectors$e.propertyInput,options.onPropertyChange)}destroy(){this._listeners.removeAll()}options(){return this._serializeInputValues(this.optionInputs,function(item){var regex=/(?:^(options\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}variant(){const opts=this.options();return opts.length?getVariantFromSerializedArray(this.product,opts):this.product.variants[0]}plan(variant){let plan={allocation:null,group:null,detail:null};const id=new FormData(this.form).get("selling_plan");return id&&variant&&(plan.allocation=variant.selling_plan_allocations.find(function(item){return item.selling_plan_id.toString()===id.toString()})),plan.allocation&&(plan.group=this.product.selling_plan_groups.find(function(item){return item.id.toString()===plan.allocation.selling_plan_group_id.toString()})),plan.group&&(plan.detail=plan.group.selling_plans.find(function(item){return item.id.toString()===id.toString()})),plan&&plan.allocation&&plan.detail&&plan.allocation?plan:null}properties(){return this._serializeInputValues(this.propertyInput
8s,function(item){var regex=/(?:^(properties\[))(.*?)(?:\])/;return item.name=regex.exec(item.name)[2],item})}quantity(){return this.quantityInputs[0]?Number.parseInt(this.quantityInputs[0].value,10):1}getFormState(){const variant=this.variant();return{options:this.options(),variant,properties:this.properties(),quantity:this.quantity(),plan:this.plan(variant)}}_setIdInputValue(variant){variant&&variant.id?this.variantElement.value=variant.id.toString():this.variantElement.value="",this.variantElement.dispatchEvent(new Event("change"))}_onSubmit(options,event){event.dataset=this.getFormState(),options.onFormSubmit&&options.onFormSubmit(event)}_onOptionChange(event){this._setIdInputValue(event.dataset.variant)}_onFormEvent(cb){return typeof cb>"u"?Function.prototype.bind():function(event){event.dataset=this.getFormState(),this._setIdInputValue(event.dataset.variant),cb(event)}.bind(this)}_initInputs(selector,cb){var elements=Array.prototype.slice.call(this.element.querySelectorAll(selector));return elements.map(function(element){return this._listeners.add(element,"change",this._onFormEvent(cb)),element}.bind(this))}_serializeInputValues(inputs,transform){return inputs.reduce(function(options,input){return(input.checked||input.type!=="radio"&&input.type!=="checkbox")&&options.push(transform({name:input.name,value:input.value})),options},[])}_validateProductObject(product){if(typeof product!="object")throw new TypeError(product+" is not an object.");if(typeof product.variants[0].options>"u")throw new TypeError("Product object is invalid. Make sure you use the product object that is output from {{ product | json }} or from the http://[your-product-url].js route");return product}}function getScript(url,callback,callbackError){let head=document.getElementsByTagName("head")[0],done=!1,script=document.createElement("script");script.src=url,script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")?(done=!0,callback()):callbackError()},head.appendChild(script)}const loaders={};window.isYoutubeAPILoaded=!1,window.isVimeoAPILoaded=!1;function loadScript(options={}){if(options.type||(options.type="json"),options.url)return loaders[options.url]?loaders[options.url]:getScriptWithPromise(options.url,options.type);if(options.json)return loaders[options.json]?Promise.resolve(loaders[options.json]):window.fetch(options.json).then(response=>response.json()).then(response=>(loaders[options.json]=response,response));if(options.name){const key="".concat(options.name,options.version);return loaders[key]?loaders[key]:loadShopifyWithPromise(options)}else return Promise.reject()}function getScriptWithPromise(url,type){const loader=new Promise((resolve,reject)=>{type==="text"?fetch(url).then(response=>response.text()).then(data2=>{resolve(data2)}).catch(error=>{reject(error)}):getScript(url,function(){resolve()},function(){reject()})});return loaders[url]=loader,loader}function loadShopifyWithPromise(options){const key="".concat(options.name,options.version),loader=new Promise((resolve,reject)=>{try{window.Shopify.loadFeatures([{name:options.name,version:options.version,onLoad:err=>{onLoadFromShopify(resolve,reject,err)}}])}catch(err){reject(err)}});return loaders[key]=loader,loader}function onLoadFromShopify(resolve,reject,err){return err?reject(err):resolve()}const selectors$f={elements:{scrollbarAttribute:"data-scrollbar",scrollbar:"data-scrollbar-slider",scrollbarSlideFullWidth:"data-scrollbar-slide-fullwidth",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]"},classes:{hide:"is-hidden"},times:{delay:200}};class NativeScrollbar{constructor(scrollbar){this.scrollbar=scrollbar,this.arrowNext=this.scrollbar.parentNode.querySelector(selectors$f.elements.scrollbarArrowNext),this.arrowPrev=this.scrollbar.parentNode.querySelector(selectors$f.elements.scrollbarArrowPrev),this.scrollbar.hasAttribute(selectors$f.elements.scrollbarAttribute)&&(this.init(),this.resize()),this.scrollbar.hasAttribute(selectors$f.elements.scrollbar)&&this.scrollToVisibleElement()}init(){this.arrowNext&&this.arrowPrev&&(this.toggleNextArrow(),this.events())}resize(){document.addEventListener("theme:resize",()=>{this.toggleNextArrow()})}events(){this.arrowNext.addEventListener("click",event=>{event.preventDefault(),this.goToNext()}),this.arrowPrev.addEventListener("click",event=>{event.preventDefault(),this.goToPrev()}),this.scrollbar.addEventListener("scroll",()=>{this.togglePrevArrow(),this.toggleNextArrow()})}goToNext(){const position=(this.scrollbar.hasAttribute(selectors$f.elements.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2)+this.scrollbar.scrollLeft;this.move(position),this.arrowPrev.classList.remove(selectors$f.classes.hide),this.toggleNextArrow()}goToPrev(){const moveWith=this.scrollbar.hasAttribute(selectors$f.elements.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2,position=this.scrollbar.scrollLeft-moveWith;this.move(position),this.arrowNext.classList.remove(selectors$f.classes.hide),this.togglePrevArrow()}toggleNextArrow(){setTimeout(()=>{this.arrowNext.classList.toggle(selectors$f.classes.hide,Math.round(this.scrollbar.scrollLeft+this.scrollbar.getBoundingClientRect().width+1)>=this.scrollbar.scrollWidth)},selectors$f.times.delay)}togglePrevArrow(){setTimeout(()=>{this.arrowPrev.classList.toggle(selectors$f.classes.hide,this.scrollbar.scrollLeft<=0)},selectors$f.times.delay)}scrollToVisibleElement(){[].forEach.call(this.scrollbar.children,element=>{element.addEventListener("click",event=>{event.preventDefault(),this.move(element.offsetLeft-element.clientWidth)})})}move(offsetLeft){this.scrollbar.scrollTo({top:0,left:offsetLeft,behavior:"smooth"})}}const defaults={color:"ash"},selectors$g={formGridSwatch:"[data-grid-swatch-form]",swatch:"data-swatch",outerGrid:"[data-product-grid-item]",slide:"[data-grid-slide]",image:"data-swatch-image",variant:"data-swatch-variant",variantName:"data-swatch-variant-name",button:"[data-swatch-button]",link:"[data-grid-link]",wrapper:"[data-grid-swatches]",template:"[data-swatch-template]",handle:"data-swatch-handle",label:"data-swatch-label",tooltip:"data-tooltip",swatchCount:"data-swatch-count",scrollbar:"data-scrollbar",dataVariantTitle:"data-variant-title"},classes$6={visible:"is-visible",stopEvents:"no-events"};class ColorMatch{constructor(options={}){this.settings={...defaults,...options},this.match=this.init()}getColor(){return this.match}
8init(){return loadScript({json:window.theme.assets.swatches}).then(colors=>this.matchColors(colors,this.settings.color)).catch(e=>{console.log("failed to load swatch colors script"),console.log(e)})}matchColors(colors,name){let bg="#E5E5E5",img=null;const path=window.theme.assets.base||"/",comparisonName=name.toLowerCase().replace(/\s/g,""),array=colors.colors;if(array){let indexArray=null;if(array.filter((colorObj,index)=>{if(Object.keys(colorObj).toString().toLowerCase().replace(/\s/g,"")===comparisonName)return indexArray=index,colorObj}).length&&indexArray!==null){const value=Object.values(array[indexArray])[0];bg=value,(value.includes(".jpg")||value.includes(".jpeg")||value.includes(".png")||value.includes(".svg"))&&(img=`${path}${value}`,bg="#888888")}}return{color:this.settings.color,path:img,hex:bg}}}class Swatch{constructor(element){this.element=element,this.colorString=element.getAttribute(selectors$g.swatch),this.image=element.getAttribute(selectors$g.image),this.variant=element.getAttribute(selectors$g.variant),this.variantName=element.getAttribute(selectors$g.variantName),this.tooltip=this.element.closest(`[${selectors$g.tooltip}]`),new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.init()})}init(){this.setStyles(),this.variant&&this.handleEvents(),this.tooltip&&new Tooltip(this.tooltip)}setStyles(){this.colorMatch.hex&&this.element.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch.path&&(this.element.style.setProperty("background-image",`url(${this.colorMatch.path})`),this.element.style.setProperty("background-size","cover"),this.element.style.setProperty("background-position","center center"))}handleEvents(){this.outer=this.element.closest(selectors$g.outerGrid),this.outer&&(this.slide=this.outer.querySelector(selectors$g.slide),this.linkElement=this.outer.querySelector(selectors$g.link),this.linkElementAll=this.outer.querySelectorAll(selectors$g.link),this.linkDestination=getUrlWithVariant(this.linkElement.getAttribute("href"),this.variant),this.button=this.element.closest(selectors$g.button),this.button.closest(selectors$g.formGridSwatch)&&this.button.addEventListener("mouseenter",function(){this.changeImage()}.bind(this)),this.button.closest(selectors$g.formGridSwatch)||this.button.addEventListener("click",function(){this.changeImage()}.bind(this)))}changeImage(){if(this.linkElementAll.forEach(link=>{link.setAttribute("href",this.linkDestination)}),this.slide.setAttribute("src",this.linkDestination),this.image){let widthRounded=Math.ceil(this.slide.offsetWidth/180)*180,sizedImage=themeImages.getSizedImageUrl(this.image,`${widthRounded}x`);window.fetch(sizedImage).then(response=>response.blob()).then(blob=>{var objectURL=URL.createObjectURL(blob);const variantName=this.variantName.replaceAll('"',"'"),imageTarget=this.slide.querySelector(`[${selectors$g.dataVariantTitle}="${variantName}"]`);if(imageTarget){const imageVisible=this.slide.querySelector(`[${selectors$g.dataVariantTitle}].${classes$6.visible}`);imageVisible&&imageVisible.classList.remove(classes$6.visible),imageTarget.classList.add(classes$6.visible)}else this.slide.style.setProperty("background-color","#fff"),this.slide.style.setProperty("background-image",`url("${objectURL}")`)}).catch(error=>{console.log(`Error: ${error}`)})}}}class GridSwatch{constructor(wrap2,container){this.counterSwatches=wrap2.parentNode.previousElementSibling,this.template=document.querySelector(selectors$g.template).innerHTML,this.wrap=wrap2,this.container=container,this.handle=wrap2.getAttribute(selectors$g.handle);const label=wrap2.getAttribute(selectors$g.label).trim().toLowerCase();fetchProduct(this.handle).then(product=>{this.product=product,this.colorOption=product.options.find(function(element){return element.name.toLowerCase()===label||null}),this.colorOption&&(this.swatches=this.colorOption.values,this.init())})}init(){this.wrap.innerHTML="",this.count=0,this.swatches.forEach(swatch=>{let variant=null,variantAvailable=!1;for(const productVariant of this.product.variants)if(!variant&&productVariant.options.includes(swatch)&&(variant=productVariant),productVariant.options.includes(swatch)&&productVariant.available){variantAvailable=!0;break}if(variant){this.count++;const image=variant.featured_media?variant.featured_media.preview_image.src:"";this.wrap.innerHTML+=Sqrl.render(this.template,{color:swatch,uniq:`${this.product.id}-${variant.id}`,variant:variant.id,variantName:variant.title.replaceAll('"',"'"),available:variantAvailable,image})}}),this.swatchElements=this.wrap.querySelectorAll(`[${selectors$g.swatch}]`),this.counterSwatches.hasAttribute(selectors$g.swatchCount)&&(this.counterSwatches.innerText=`${this.count} ${this.count>1?theme.strings.otherColor:theme.strings.oneColor}`,this.counterSwatches.addEventListener("mouseenter",()=>{this.wrap.closest(selectors$g.link).classList.add(classes$6.stopEvents),this.counterSwatches.nextElementSibling.classList.add(classes$6.visible)}),this.counterSwatches.closest(selectors$g.outerGrid).addEventListener("mouseleave",()=>{this.wrap.closest(selectors$g.link).classList.remove(classes$6.stopEvents),this.counterSwatches.nextElementSibling.classList.remove(classes$6.visible)})),this.wrap.hasAttribute(selectors$g.scrollbar)&&new NativeScrollbar(this.wrap),this.swatchElements.forEac
8h(el=>{new Swatch(el)})}}const makeGridSwatches=section=>{section.container.querySelectorAll(selectors$g.wrapper).forEach(wrap2=>{new GridSwatch(wrap2,void 0)})},swatchSection={onLoad(){this.swatches=[],this.container.querySelectorAll(`[${selectors$g.swatch}]`).forEach(el=>{this.swatches.push(new Swatch(el))})}},swatchGridSection={onLoad(){makeGridSwatches(this)}},selectors$h={elements:{html:"html",body:"body",apiContent:"[data-api-content]",sectionId:"data-section-id",sectionOuter:"[data-section-id]",productGridItem:"data-product-grid-item",formQuickAdd:"[data-form-quick-add]",quickAddLabel:"data-quick-add-label",quickCollectionHande:"data-collection-handle",selectOption:"[data-select-option]:not([data-quick-add-button])",holderFormQuickAdd:"[data-quick-add-holder]",goToNextElement:"data-go-to-next",quickAddElement:"data-quick-add-button",productJson:"[data-product-json]",productOptionsJson:"[data-product-options-json]",quickAddFormHolder:"[data-quick-add-form-holder]",featuredImageHolder:"[data-grid-slide]",productImagesHolder:"[data-product-image]",productInformationHolder:"[data-product-information]",scrollbarHolder:"[data-scrollbar]",radioOption:"[data-radio-option]",popoutWrapper:"[data-popout]",popupList:"[data-popout-list]",popupoutOption:"[data-popout-option]",popupoutOptionValue:"data-value",popupoutToggle:"[data-popout-toggle]",optionPosition:"data-option-position",swatch:"data-swatch",backButton:"[data-back-button]",messageError:"[data-message-error]",idInput:'[name="id"]',buttonQuickAddMobile:"[data-button-quick-add-mobile]",ariaExpanded:"aria-expanded",input:"input",dataVariantTitle:"data-variant-title"},classes:{active:"is-active",select:"is-selected",disable:"is-disable",hide:"is-hidden",added:"is-added",loading:"is-loading",visible:"is-visible",error:"has-error",focus:"is-focused",popupoutVisible:"popout-list--visible"},times:{debounce:500,delay:400,delaySmall:200,delayMedium:2e3,delayLarge:5e3},imageSize:"800x800"},attributes$2={tabindex:"tabindex"},instances$1=[];class QuickAddProduct{constructor(el){this.cart=window.cart,this.a11y=a11y,this.themeAccessibility=window.accessibility,this.document=document,this.html=this.document.querySelector(selectors$h.elements.html),this.body=this.document.querySelector(selectors$h.elements.body),this.productGridItem=el,this.holder=this.productGridItem.querySelector(selectors$h.elements.holderFormQuickAdd),this.quickAddLabel=this.productGridItem.querySelector(`[${selectors$h.elements.quickAddLabel}]`),this.quickAddFormHolder=this.productGridItem.querySelector(selectors$h.elements.quickAddFormHolder),this.featuredImageHolder=this.productGridItem.querySelector(selectors$h.elements.featuredImageHolder),this.productInformationHolder=this.productGridItem.querySelector(selectors$h.elements.productInformationHolder),this.buttonQuickAddMobile=this.productGridItem.querySelector(selectors$h.elements.buttonQuickAddMobile),this.sectionOuter=this.productGridItem.closest(selectors$h.elements.sectionOuter),this.sectionId=this.sectionOuter.getAttribute(selectors$h.elements.sectionId),this.productJSON=null,this.productOptionsJSON=null,this.productForm=null,this.selectedOptions=[],this.filteredOptions=[],this.enableMobileMode=!1,this.accessibilityStopEvent=!1,this.quickAddFormIsLoaded=!1,theme.settings.enableQuickAdd?(this.accessibility(),this.show(),this.hide(),this.errorHandle()):this.productGridItem&&this.productGridItem.addEventListener("mouseenter",()=>this.addVariantImages())}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}getForm(){if(this.quickAddFormIsLoaded)return;this.quickAddFormIsLoaded=!0;const root=theme.routes.root==="/"?"":theme.routes.root;fetch(root+"/products/"+this.quickAddLabel.getAttribute(selectors$h.elements.quickAddLabel)+"?section_id=api-quick-add").then(response=>response.text()).then(data2=>{const fresh=document.createElement("div");fresh.innerHTML=data2;const cleanResponse=fresh.querySelector(selectors$h.elements.apiContent).innerHTML,unique=`${this.quickAddLabel.getAttribute(selectors$h.elements.quickCollectionHande)}-${this.sectionId}`;this.quickAddFormHolder.innerHTML=cleanResponse.replaceAll("||collection-index||",unique),this.loadForm()}).catch(e=>{console.warn(e)})}loadForm(){this.form=this.quickAddFormHolder.querySelector(selectors$h.elements.formQuickAdd),this.selectOption=this.quickAddFormHolder.querySelectorAll(selectors$h.elements.selectOption),this.productElemJSON=this.quickAddFormHolder.querySelector(selectors$h.elements.productJson),this.productOptionsElemJSON=this.quickAddFormHolder.querySelector(selectors$h.elements.productOptionsJson),this.scrollbarHolder=this.quickAddFormHolder.querySelectorAll(selectors$h.elements.scrollbarHolder),this.popoutWrapper=this.quickAddFormHolder.querySelectorAll(selectors$h.elements.popoutWrapper),this.swatches=this.quickAddFormHolder.querySelectorAll(`[${selectors$h.elements.swatch}]`),this.backButtons=this.quickAddFormHolder.querySelectorAll(selectors$h.elements.backButton),this.swatches.length&&(this.swatches.forEac
8h(swatch=>{new Swatch(swatch)}),this.changeVariantImageOnHover()),this.popoutWrapper.length&&this.popoutWrapper.forEach(wrapper=>{new Popout(wrapper)}),this.initNativeScrollbar(),this.initGoToBack();const hasProductJSON=this.productElemJSON&&this.productElemJSON.innerHTML!=="",hasProductOptionsJSON=this.productOptionsElemJSON&&this.productOptionsElemJSON.innerHTML!=="";hasProductJSON&&hasProductOptionsJSON?(this.productJSON=JSON.parse(this.productElemJSON.innerHTML),this.productOptionsJSON=JSON.parse(this.productOptionsElemJSON.innerHTML),this.initForm()):console.error("Missing product JSON or product options with values JSON")}initForm(){this.filterFirstOptionValues(),this.productForm=new ProductForm(this.form,this.productJSON,{onOptionChange:this.onOptionChange.bind(this)}),this.enableMobileMode?(this.addFirstVariantIsDefault(this.buttonQuickAddMobile.hasAttribute(selectors$h.elements.quickAddElement)),this.buttonQuickAddMobile.classList.add(selectors$h.classes.hide),this.buttonQuickAddMobile.classList.remove(selectors$h.classes.loading),this.quickAddLabel.classList.add(selectors$h.classes.hide),this.toggleClasses()):this.quickAddLabel.classList.remove(selectors$h.classes.disable,selectors$h.classes.hide)}onOptionChange(event){const targetElement=event.target,optionHolder=targetElement.closest(selectors$h.elements.selectOption),position=Number(optionHolder.getAttribute(selectors$h.elements.optionPosition)),firstOptionValue=event.dataset.variant?event.dataset.variant.options[position-1]:event.dataset.options[position-1],focusedIsEnable=this.body.classList.contains(selectors$h.classes.focus);this.changeVariantImage(event.dataset.variant),!(focusedIsEnable&&this.accessibilityStopEvent)&&(this.selectedOptions.push(event.target.value),optionHolder.classList.add(selectors$h.classes.select),this.filterAvailableOptions(firstOptionValue,position),targetElement.hasAttribute(selectors$h.elements.goToNextElement)&&(optionHolder.classList.remove(selectors$h.classes.active),optionHolder.nextElementSibling.classList.add(selectors$h.classes.active)),targetElement.hasAttribute(selectors$h.elements.quickAddElement)&&event.dataset.variant.available&&(theme.settings.cartDrawerEnabled&&(this.quickAddLabel.classList.remove(selectors$h.classes.hide),this.quickAddLabel.classList.add(selectors$h.classes.loading)),this.html.dispatchEvent(new CustomEvent("cart:add-to-cart",{bubbles:!0,detail:{element:this.holder,label:this.quickAddLabel,data:{id:event.dataset.variant.id,quantity:1}}})),setTimeout(()=>{this.selectedOptions=[],this.resetInputsOfInstance()},selectors$h.times.delayMedium),optionHolder.classList.remove(selectors$h.classes.active)),focusedIsEnable&&targetElement.hasAttribute(selectors$h.elements.goToNextElement)&&this.accessibilityTrapFocus(optionHolder.nextElementSibling),this.accessibilityStopEvent=!1)}initGoToBack(){this.backButtons.length&&this.backButtons.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const isFocused=this.body.classList.contains(selectors$h.classes.focus);this.selectedOptions.pop();const optionHolder=button.closest(selectors$h.elements.selectOption);let previousHolder=optionHolder.previousElementSibling.matches(selectors$h.elements.selectOption)?optionHolder.previousElementSibling:this.quickAddLabel;if(previousHolder===this.quickAddLabel&&isFocused&&(this.themeAccessibility.lastFocused=this.quickAddLabel),previousHolder===this.quickAddLabel&&this.enableMobileMode&&(previousHolder=this.buttonQuickAddMobile),previousHolder!==this.quickAddLabel){isFocused&&this.accessibilityTrapFocus(previousHolder);const inputs=optionHolder.querySelectorAll(selectors$h.elements.input),selects=optionHolder.querySelectorAll(selectors$h.elements.popupoutOption),previousInputs=previousHolder.querySelectorAll(selectors$h.elements.input),previousSelects=previousHolder.querySelectorAll(selectors$h.elements.popupoutOption);inputs&&inputs.forEach(input=>{input.checked=!1}),selects&&selects.forEach(option=>{option.classList.remove(selectors$h.classes.visible)}),previousInputs&&previousInputs.forEach(input=>{input.checked=!1}
8),previousSelects&&previousSelects.forEach(option=>{option.classList.remove(selectors$h.classes.visible)})}previousHolder!==this.buttonQuickAddMobile&&(isFocused&&this.accessibilityTrapFocus(previousHolder),previousHolder.classList.add(selectors$h.classes.active,selectors$h.classes.select)),previousHolder===this.buttonQuickAddMobile&&this.holder.classList.remove(selectors$h.classes.visible),previousHolder.classList.remove(selectors$h.classes.hide),optionHolder.classList.remove(selectors$h.classes.active,selectors$h.classes.select),isFocused&&previousHolder.focus()})})}toggleClasses(){this.holder.classList.add(selectors$h.classes.visible),this.selectOption&&this.selectOption.length&&this.quickAddFormHolder.innerHTML!=="&nbsp;"&&(this.quickAddLabel.classList.add(selectors$h.classes.hide),Array.from(this.selectOption).filter(option=>option.classList.contains(selectors$h.classes.active)).length===0&&(this.selectOption[0].classList.add(selectors$h.classes.active),this.body.classList.contains(selectors$h.classes.focus)&&this.accessibilityStopEvent&&setTimeout(()=>{this.accessibilityTrapFocus(this.selectOption[0])},selectors$h.times.delaySmall)))}addFirstVariantIsDefault(targetHasQuickAddAttribute){const firstVariant=this.productJSON.variants[0];if(targetHasQuickAddAttribute&&firstVariant.available){theme.settings.cartDrawerEnabled&&(this.quickAddLabel.classList.remove(selectors$h.classes.hide),this.quickAddLabel.classList.add(selectors$h.classes.loading));const sellingPlanId=firstVariant.selling_plan_allocations&&firstVariant.selling_plan_allocations.length?firstVariant.selling_plan_allocations[0].selling_plan_id:null;this.html.dispatchEvent(new CustomEvent("cart:add-to-cart",{bubbles:!0,detail:{element:this.holder,label:this.quickAddLabel,data:{id:firstVariant.id,quantity:1,selling_plan:sellingPlanId}}}))}}show(){this.buttonQuickAddMobile&&this.buttonQuickAddMobile.addEventListener("click",()=>{this.enableMobileMode=!0,this.buttonQuickAddMobile.classList.add(selectors$h.classes.loading),this.quickAddFormHolder.innerHTML==="&nbsp;"&&!this.quickAddFormIsLoaded?this.getForm():(this.toggleClasses(),this.buttonQuickAddMobile.classList.remove(selectors$h.classes.loading),this.buttonQuickAddMobile.classList.add(selectors$h.classes.hide),this.holder.classList.add(selectors$h.classes.visible)),this.productJSON!==null&&this.addFirstVariantIsDefault(this.buttonQuickAddMobile.hasAttribute(selectors$h.elements.quickAddElement))}),this.productGridItem&&this.productGridItem.addEventListener("mouseenter",()=>{this.enableMobileMode=!1,this.hideOtherHolders(),this.quickAddFormHolder&&this.quickAddFormHolder.innerHTML==="&nbsp;"&&!this.quickAddFormIsLoaded&&this.getForm(),this.addVariantImages()}),this.quickAddLabel&&(this.quickAddLabel.addEventListener("focusin",()=>{this.enableMobileMode=!1,this.quickAddFormHolder.innerHTML==="&nbsp;"&&!this.quickAddFormIsLoaded&&this.getForm()}),this.quickAddLabel.addEventListener("click",()=>{this.enableMobileMode=!1,!(this.quickAddLabel.classList.contains(selectors$h.classes.added)||this.quickAddLabel.classList.contains(selectors$h.classes.disable)||this.productJSON===null)&&(this.selectedOptions=[],this.addFirstVariantIsDefault(this.quickAddLabel.hasAttribute(selectors$h.elements.quickAddElement)),this.quickAddFormHolder.innerHTML!=="&nbsp;"&&this.toggleClasses(),this.addVariantImages())})),this.productInformationHolder.addEventListener("mouseenter",()=>{this.featuredImageHolder.closest(selectors$h.elements.productImagesHolder).classList.remove(selectors$h.classes.visible)})}hide(){(this.quickAddLabel||this.buttonQuickAddMobile)&&(theme.settings.cartDrawerEnabled?this.document.addEventListener("theme:cart-close",()=>{setTimeout(()=>{this.resetButtonsOfInstance()},selectors$h.times.delayLarge)}):setTimeout(()=>{this.resetButtonsOfInstance()},selectors$h.times.delayLarge))}accessibility(){this.productGridItem.addEventListener("keyup",event=>{event.keyCode===window.theme.keyboardKeys.TAB&&(this.accessibilityStopEvent=!0),event.keyCode===window.theme.keyboardKeys.ENTER&&(this.accessibilityStopEvent=!1,(event.target.hasAttribute(selectors$h.elements.popupoutOptionValue)?event.target.closest(selectors$h.elements.popupList).nextElementSibling:event.target).dispatchEvent(new Event("change")))})}accessibilityTrapFocus(container){this.a11y.removeTrapFocus(),this.a11y.trapFocus(container,{elementToFocus:container.querySelector(selectors$h.elements.backButton)})}filterAvailableOptions(value,optionIndex,enableCheck=!0){const variants=this.productJSON.variants.filter(variant=>{if(variant.options.length>1){let available=[];
8if(this.selectedOptions.forEach((option,index)=>{available.push(variant[`option${optionIndex}`]===value&&variant.options[index]===option&&variant.available)}),!available.includes(!1)&&available.length>0)return variant}else return variant[`option${optionIndex}`]===value&&variant.available});this.productOptionsJSON.forEach(option=>{if(option.position!==optionIndex){const filteredObject={};filteredObject.name=option.name,filteredObject.position=option.position,filteredObject.values=[],option.values.forEach(value2=>{variants.filter(variant=>variant[`option${option.position}`]===value2).length&&filteredObject.values.push(value2)}),this.filteredOptions=[...this.filteredOptions,filteredObject]}}),enableCheck&&(this.disableUnavailableValues(),this.filteredOptions=[])}filterFirstOptionValues(){this.productOptionsJSON[0].values.forEach(value=>{if(this.productJSON.variants.filter(variant=>variant.option1===value&&variant.available).length===0&&this.selectOption[0]!==void 0){const inputsArr=this.selectOption[0].querySelectorAll("input"),elementsArr=this.selectOption[0].querySelectorAll(`[${selectors$h.elements.popupoutOptionValue}]`);let currentInput=null,currentOption=null;if(inputsArr.length){for(const input of inputsArr)if(input.value===value){currentInput=input;break}}if(elementsArr.length){for(const element of elementsArr)if(element.getAttribute(selectors$h.elements.popupoutOptionValue)===value){currentOption=element;break}}currentInput&&(currentInput.checked=!1,currentInput.disabled=!0),currentOption&&currentOption.classList.add(selectors$h.classes.disable)}})}disableUnavailableValues(){this.selectOption&&this.selectOption.forEach(option=>{const inputs=option.querySelectorAll(selectors$h.elements.input),selects=option.querySelectorAll(selectors$h.elements.popupoutOption);inputs.forEach(input=>{option.classList.contains(selectors$h.classes.select)||(input.checked=!1,input.disabled=!0),this.filteredOptions.forEach(data2=>{data2.values.includes(input.value)&&(input.disabled=!1)})}),selects.forEach(item=>{option.classList.contains(selectors$h.classes.select)||(item.setAttribute(attributes$2.tabindex,-1),item.classList.add(selectors$h.classes.disable)),this.filteredOptions.forEach(data2=>{data2.values.includes(item.getAttribute(`${selectors$h.elements.popupoutOptionValue}`))&&(item.classList.remove(selectors$h.classes.disable),item.setAttribute(attributes$2.tabindex,0))})})})}changeVariantImageOnHover(){this.swatches.forEach(swatch=>{swatch.addEventListener("mouseover",()=>{for(let index=0;index<this.productJSON.variants.length;index++){const variant=this.productJSON.variants[index];if(variant.featured_media!==void 0&&variant.options[this.selectedOptions.length]===swatch.getAttribute(selectors$h.elements.swatch)){this.changeVariantImage(variant);break}}})})}changeVariantImage(currentVariant){const imageExists=currentVariant&&currentVariant.featured_media&&currentVariant.featured_media!==void 0,currentVariantTitle=currentVariant.title.replaceAll('"',"'");if(imageExists){const imageTarget=this.featuredImageHolder.querySelector(`[${selectors$h.elements.dataVariantTitle}="${currentVariantTitle}"]`);if(imageTarget){const imageVisible=this.featuredImageHolder.querySelector(`[${selectors$h.elements.dataVariantTitle}].${selectors$h.classes.visible}`);imageVisible&&imageVisible.classList.remove(selectors$h.classes.visible),imageTarget.classList.add(selectors$h.classes.visible)}else{const currentImage=themeImages.getSizedImageUrl(currentVariant.featured_media.preview_image.src,selectors$h.imageSize);this.featuredImageHolder.style.setProperty("background-image",`url(${currentImage})`)}this.featuredImageHolder.closest(selectors$h.elements.productImagesHolder).classList.add(selectors$h.classes.visible)}}addVariantImages(){const images=this.productGridItem.querySelectorAll(`[${selectors$h.elements.dataVariantTitle}][style*="display: none;"]`);images.length&&images.forEach(image=>{image.style.removeProperty("display")})}resetOptions(option){option.querySelectorAll(selectors$h.elements.input).forEach(input=>{input.checked=!1,input.disabled=!1}),option.querySelectorAll(selectors$h.elements.popupoutOption).forEac
8h(option2=>{option2.classList.remove(selectors$h.classes.disable),option2.setAttribute(attributes$2.tabindex,1)})}hideOtherHolders(){const otherHolderFormQuickAdd=this.document.querySelectorAll(selectors$h.elements.holderFormQuickAdd);otherHolderFormQuickAdd&&otherHolderFormQuickAdd.forEach(holder=>{if(holder!==this.holder){holder.classList.remove(selectors$h.classes.visible);const selectToggleButton=holder.querySelector(selectors$h.elements.popupoutToggle);selectToggleButton&&(selectToggleButton.setAttribute(selectors$h.elements.ariaExpanded,!1),selectToggleButton.nextElementSibling.classList.remove(selectors$h.classes.popupoutVisible)),this.popoutWrapper&&holder.closest(`[${selectors$h.elements.productGridItem}]`).querySelector(selectors$h.elements.productImagesHolder).classList.remove(selectors$h.classes.visible)}})}resetInputsOfInstance(){this.selectOption&&(this.quickAddLabel.classList.remove(selectors$h.classes.hide),this.initNativeScrollbar(),this.selectOption.forEach(option=>{option.classList.remove(selectors$h.classes.active,selectors$h.classes.select);const selectToggleButton=option.querySelector(selectors$h.elements.popupoutToggle);selectToggleButton&&(selectToggleButton.innerText=theme.strings.selectValue,selectToggleButton.setAttribute(selectors$h.elements.ariaExpanded,!1)),this.resetOptions(option)}),this.filterFirstOptionValues(),this.filteredOptions=[])}resetButtonsOfInstance(){this.quickAddLabel.classList.remove(selectors$h.classes.select,selectors$h.classes.added,selectors$h.classes.visible),this.buttonQuickAddMobile.classList.remove(selectors$h.classes.hide)}errorHandle(){this.html.addEventListener("cart:add-to-error",event=>{const holder=event.detail.holder,errorMessageHolder=holder.querySelector(selectors$h.elements.messageError);holder.querySelector(`[${selectors$h.elements.quickAddLabel}]`).classList.remove(selectors$h.classes.visible,selectors$h.classes.added,selectors$h.classes.loading),holder.classList.add(selectors$h.classes.error),errorMessageHolder.innerText=event.detail.description,setTimeout(()=>{holder.classList.remove(selectors$h.classes.error),holder.classList.add(selectors$h.classes.visible),holder.previousElementSibling.classList.remove(selectors$h.classes.hide)},selectors$h.times.delayLarge)})}}const quickAddProduct={onLoad(){this.container.querySelectorAll(`[${selectors$h.elements.productGridItem}]`).forEach(item=>{instances$1.push(new QuickAddProduct(item))})}},selectors$i={rangeSlider:"[data-range-slider]",rangeDotLeft:"[data-range-left]",rangeDotRight:"[data-range-right]",rangeLine:"[data-range-line]",rangeHolder:"[data-range-holder]",dataMin:"data-se-min",dataMax:"data-se-max",dataMinValue:"data-se-min-value",dataMaxValue:"data-se-max-value",dataStep:"data-se-step",dataFilterUpdate:"data-range-filter-update",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]"},classes$7={initialized:"is-initialized"};class RangeSlider{constructor(section){this.container=section.container,this.slider=section.querySelector(selectors$i.rangeSlider),this.resizeFilters=()=>this.init(),this.slider&&(this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.startX=0,this.x=0,this.touchLeft=this.slider.querySelector(selectors$i.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$i.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$i.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$i.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$i.dataMax)),this.step=0,this.normalizeFact=26,this.init())}init(){let defaultMinValue=this.min;this.slider.hasAttribute(selectors$i.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$i.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$i.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$i.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$i.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$i.dataStep)))),this.reset(),document.addEventListener("theme:resize",this.resizeFilters),this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent),this.touchRight.addEventListener("touchstart",this.onStartEvent),this.slider.classList.add(classes$7.initialized)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.startX=0,this.x=0}setMinValue(minValue){const ratio=(minValue-this.min)/(this.max-this.min);this.touchLeft.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact)))+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$i.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact))+this.normalizeFact)+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$i.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:this.x=this.touchRight.offsetLeft,this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,this.slider.addEventListener("mousemove",this.onMoveEvent),this.slider.addEventListener("mouseup",this.onStopEvent),this.slider.addEventListener("touchmove",this.onMoveEvent),this.slider.addEventListener("touchend",this.onStopEvent)}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.x<this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10?this.x=this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10:this.x>this.maxX&&(this.x=this.maxX),this.selectedTouch.style.left=this.x+"px"),this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.calculateValue(),this.slider.getAttribute("on-change")&&new Function("min, max",this.slider.getAttribute("on-change"))(this.slider.getAttribute(selectors$i.dataMinValue),this.slider.getAttribute(selectors$i.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$i.dataMinValue),this.slider.getAttribute(selectors$i.dataMaxValue))}onStop(event){this.slider.removeEventListener("mousemove",this.onMoveEvent),this.slider.removeEventListener("mouseup",this.onStopEvent),this.slider.removeEventListener("touchmove",this.onMoveEvent),this.slider.removeEventListener("touchend",this.onStopEvent),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$i.dataMinValue),this.slider.getAttribute(selectors$i.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$i.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$i.priceMin),priceMax=rangeHolder.querySelector(selectors$i.priceMax);priceMin&&priceMax&&(priceMin.value=min,priceMax.value=max)}}onChanged(min,max){this.slider.hasAttribute(selectors$i.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("filter:update:range",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.slider.setAttribute(selectors$i.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$i.dataMaxValue,maxValue)}onUnload(){this.resizeFilters&&document.removeEventListener("theme:resize",this.resizeFilters)}}const selectors$j={collectionSidebar:"[data-collection-sidebar]",form:"[data-collection-filters-form]",input:"input",select:"select",label:"label",textarea:"textarea",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]",priceMinValue:"data-field-price-min",priceMaxValue:"data-field-price-max",rangeMin:"[data-se-min-value]",rangeMax:"[data-se-max-value]",rangeMinValue:"data-se-min-value",rangeMaxValue:"data-se-max-value",productsContainer:"[data-products-grid]",product:"[data-product-grid-item]",filterUpdateUrlButton:"[data-filter-update-url]",dataActiveFilters:"[data-active-filters]",dataActiveFiltersCount:"data-active-filters-count",dataSort:"data-sort-enabled",collectionNav:"[data-collection-nav]"},classes$8={hidden:"hidden",loading:"is-loading"};let sections$7={};class FiltersForm{constructor(section){this.section=section,this.container=this.section.container,this.sidebar=this.container.querySelector(selectors$j.collectionSidebar),this.form=this.container.querySelector(selectors$j.form),this.sort=this.container.querySelector(`[${selectors$j.dataSort}]`),this.productsContainer=this.container.querySelector(selectors$j.productsContainer),this.collectionNav=this.container.querySelector(selectors$j.collectionNav),this.init()}init(){this.form&&(this.initRangeSlider(),this.sidebar.addEventListener("input",debounce(e=>{const type=e.type,target=e.target;if((type===selectors$j.input||type===selectors$j.select||type===selectors$j.label||type===selectors$j.textarea)&&this.form&&typeof this.form.submit=="function"){const priceMin=this.form.querySelector(selectors$j.priceMin),priceMax=this.form.querySelector(selectors$j.priceMax);priceMin&&priceMax&&(target.hasAttribute(selectors$j.priceMinValue)&&!priceMax.value?priceMax.value=priceMax.placeholder:target.hasAttribute(selectors$j.priceMaxValue)&&!priceMin.value&&(priceMin.value=priceMin.placeholder)),this.submitForm(e)}},500)),this.sidebar.addEventListener("filter:update:range",e=>this.updateRange(e))),this.sidebar&&this.sidebar.addEventListener("click",e=>this.filterUpdateFromUrl(e)),this.productsContainer&&this.productsContainer.addEventListener("click",e=>this.filterUpdateFromUrl(e)),this.sort&&this.container.addEventListener("filter:submit:form",e=>this.submitForm(e)),(this.sidebar||this.sort)&&window.addEventListener("popstate",e=>this.submitForm(e))}initRangeSlider(){new RangeSlider(this.form)}filterUpdateFromUrl(e){const target=e.target;if(target.matches(selectors$j.filterUpdateUrlButton)||target.closest(selectors$j.filterUpdateUrlButton)&&target){e.preventDefault();const button=target.matches(selectors$j.filterUpdateUrlButton)?target:target.closest(selectors$j.filterUpdateUrlButton);this.submitForm(e,button.getAttribute("href"))}}submitForm(e,replaceHref=""){this.sort=this.container.querySelector(`[${selectors$j.dataSort}]`);const sortValue=this.sort?this.sort.getAttribute(selectors$j.dataSort):"";if(!e||e&&e.type!=="popstate")if(replaceHref===""){let filterUrl=new window.URL(window.location.href).searchParams;const filterUrlParams=Object.fromEntries(filterUrl),filterUrlRemoveString=filterUrl.toString();if(filterUrlRemoveString.includes("filter.")||filterUrlRemoveString.includes("sort_by"))for(const key in filterUrlParams)(key.includes("filter.")||key.includes("sort_by"))&&filterUrl.delete(key);if(this.form){const formData=new FormData(this.form),formParams=new URLSearchParams(formData);
8for(let[key,val]of formParams.entries())key.includes("filter.")&&val&&filterUrl.append(key,val)}if(sortValue||e&&e.detail&&e.detail.href){const sortString=sortValue||e.detail.href;filterUrl.set("sort_by",sortString)}const filterUrlString=filterUrl.toString(),filterNewParams=filterUrlString?`?${filterUrlString}`:location.pathname;window.history.pushState(null,"",filterNewParams)}else window.history.pushState(null,"",replaceHref);else this.sort&&this.sort.dispatchEvent(new CustomEvent("filter:sort:check",{bubbles:!1}));this.productsContainer&&(this.productsContainer.classList.add(classes$8.loading),fetch(`${window.location.pathname}${window.location.search}`).then(response=>response.text()).then(data2=>{if(this.productsContainer.innerHTML=new DOMParser().parseFromString(data2,"text/html").querySelector(selectors$j.productsContainer).innerHTML,this.sidebar){this.sidebar.innerHTML=new DOMParser().parseFromString(data2,"text/html").querySelector(selectors$j.collectionSidebar).innerHTML;const activeFiltersCountContainer=this.sidebar.querySelector(`[${selectors$j.dataActiveFiltersCount}]`),activeFiltersContainer=this.container.querySelector(selectors$j.dataActiveFilters);if(activeFiltersCountContainer&&activeFiltersContainer){const activeFiltersCount=parseInt(activeFiltersCountContainer.getAttribute(selectors$j.dataActiveFiltersCount));activeFiltersContainer.textContent=activeFiltersCount,activeFiltersContainer.classList.toggle(classes$8.hidden,activeFiltersCount<1)}}this.form&&(this.form=this.container.querySelector(selectors$j.form),this.initRangeSlider()),new Collection(this.section).onUnload(!1);const products=this.productsContainer.querySelectorAll(selectors$j.product);products.length&&products.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(this.section),document.dispatchEvent(new CustomEvent("tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),this.collectionNav&&scrollTo(this.collectionNav.getBoundingClientRect().top),setTimeout(()=>{this.productsContainer.classList.remove(classes$8.loading)},500)}).catch(()=>{console.log("error")}))}updateRange(e){if(this.form&&typeof this.form.submit=="function"){const rangeMin=this.form.querySelector(selectors$j.rangeMin),rangeMax=this.form.querySelector(selectors$j.rangeMax),priceMin=this.form.querySelector(selectors$j.priceMin),priceMax=this.form.querySelector(selectors$j.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$j.rangeMinValue)&&rangeMax.hasAttribute(selectors$j.rangeMaxValue)){const priceMinValue=parseInt(priceMin.placeholder),priceMaxValue=parseInt(priceMax.placeholder),rangeMinValue=parseInt(rangeMin.getAttribute(selectors$j.rangeMinValue)),rangeMaxValue=parseInt(rangeMax.getAttribute(selectors$j.rangeMaxValue));(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=rangeMinValue,priceMax.value=rangeMaxValue,this.submitForm(e))}}}unload(){this.form&&document.removeEventListener("theme:resize",this.resizeEvent)}}const collectionFiltersForm={onLoad(){sections$7[this.id]=new FiltersForm(this)},onUnload:function(){sections$7[this.id]&&typeof sections$7[this.id].unload=="function"&&sections$7[this.id].unload()}},selectors$k={dataSort:"data-sort-enabled",sortLinks:"[data-sort-link]",sortValue:"data-value",sortButton:"[data-popout-toggle]",sortButtonText:"[data-sort-button-text]",collectionSidebarHeading:"[data-collection-sidebar-heading]",collectionSidebar:"[data-collection-sidebar]",collectionSidebarSlider:"[data-collection-sidebar-slider]",collectionSidebarSlideOut:"[data-collection-sidebar-slide-out]",collectionSidebarCloseButton:"[data-collection-sidebar-close]",showMoreOptions:"[data-show-more]",groupTagsButton:"[data-aria-toggle]",collectionNav:"[data-collection-nav]",linkAdd:"[data-link-add]",linkRemove:"[data-link-remove]",linkHidden:"[data-link-hidden]",swatch:"data-swatch"},classes$9={expanded:"expanded",expanding:"expanding",noMobileAnimation:"no-mobile-animation",hidden:"is-hidden",active:"is-active",sortActive:"popout-list__item--current",sortPopoutActive:"popout--active"};let sections$8={};class Collection{constructor(section){this.container=section.container,this.sort=this.container.querySelector(`[${selectors$k.dataSort}]`),this.sortLinks=this.container.querySelectorAll(selectors$k.sortLinks),this.collectionSidebar=this.container.querySelector(selectors$k.collectionSidebar),this.collectionSidebarCloseButton=this.container.querySelector(selectors$k.collectionSidebarCloseButton),this.groupTagsButton=this.container.querySelector(selectors$k.groupTagsButton),this.collectionNav=this.container.querySelector(selectors$k.collectionNav),this.showMoreOptions=this.container.querySelectorAll(selectors$k.showMoreOptions),this.collectionSidebarHeading=this.container.querySelectorAll(selectors$k.collectionSidebarHeading),this.swatches=this.container.querySelectorAll(`[${selectors$k.swatch}]`),this.groupTagsButtonClickEvent=evt=>this.groupTagsButtonClick(evt),this.collectionSidebarCloseEvent=evt=>this.collectionSidebarClose(evt),this.collectionSidebarScrollEvent=()=>this.collectionSidebarScroll(),this.onClickEvent=e=>this.onClick(e),this.onSortCheckEvent=e=>this.onSortCheck(e),this.sidebarResizeEvent=()=>this.toggleSidebarSlider(),this.init()}init(){this.sort&&this.initSort(),this.groupTagsButton!==null&&(this.toggleSidebarSlider(),document.addEventListener("theme:resize",this.sidebarResizeEvent),this.groupTagsButton.addEventListener("click",this.groupTagsButtonClickEvent),setTimeout(()=>{this.collectionSidebar.classList.remove(classes$9.noMobileAnimation)},1e3)),this.collectionSidebarCloseButton!==null&&this.collectionSidebarCloseButton.addEventListener("click",this.collectionSidebarCloseEvent),this.container.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&this.hideSidebar()}.bind(this)),this.showMoreOptions&&this.showMoreOptions.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault(),element.parentElement.classList.add(classes$9.hidden),element.parentElement.previousElementSibling.querySelectorAll(selectors$k.linkHidden).forEac
8h(link=>{link.classList.remove(classes$9.hidden)})})}),this.collectionSidebarHeading&&this.collectionSidebarHeading.forEach(element=>{element.addEventListener("click",event=>{event.preventDefault(),element.classList.toggle(classes$9.active),slideToggle(element.nextElementSibling),element.nextElementSibling.nextElementSibling&&slideToggle(element.nextElementSibling.nextElementSibling)})}),this.swatches&&this.swatches.forEach(swatch=>{new Swatch(swatch)}),this.showSidebarCallback(!0)}collectionSidebarScroll(){document.dispatchEvent(new CustomEvent("tooltip:close",{bubbles:!1,detail:{hideTransition:!1}}))}sortActions(link,submitForm=!0){const sort=link?link.getAttribute(selectors$k.sortValue):"";this.sort.setAttribute(selectors$k.dataSort,sort);const sortButtonText=this.sort.querySelector(selectors$k.sortButtonText),sortActive=this.sort.querySelector(`.${classes$9.sortActive}`);if(sortButtonText){const linkText=link?link.textContent.trim():"";sortButtonText.textContent=linkText}sortActive&&sortActive.classList.remove(classes$9.sortActive),this.sort.classList.toggle(classes$9.sortPopoutActive,link),link&&(link.parentElement.classList.add(classes$9.sortActive),submitForm&&link.dispatchEvent(new CustomEvent("filter:submit:form",{bubbles:!0,detail:{href:sort}})))}onClick(e){e.preventDefault();const sortButton=this.sort.querySelector(selectors$k.sortButton);sortButton&&sortButton.dispatchEvent(new Event("click")),this.sortActions(e.currentTarget)}onSortCheck(e){let link=null;if(window.location.search.includes("sort_by")){const urlParams=new window.URL(window.location.href).searchParams;for(const[key,val]of urlParams.entries()){const linkSort=this.sort.querySelector(`[${selectors$k.sortValue}="${val}"]`);if(key.includes("sort_by")&&linkSort){link=linkSort;break}}}this.sortActions(link,!1)}initSort(){this.sortLinks.forEach(link=>{link.addEventListener("click",this.onClickEvent)}),this.sort.addEventListener("filter:sort:check",this.onSortCheckEvent)}showSidebarCallback(onLoad=!1){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,collectionSidebarSlider=this.container.querySelector(selectors$k.collectionSidebarSlider),collectionSidebarSlideOut=this.container.querySelector(selectors$k.collectionSidebarSlideOut),collectionSidebarScrollable=collectionSidebarSlider||collectionSidebarSlideOut;if(!onLoad){if(collectionSidebarSlideOut===null)if(windowWidth<theme.sizes.small){const scrollTopPosition=this.collectionNav?this.collectionNav.getBoundingClientRect().top:this.groupTagsButton.getBoundingClientRect().top;scrollTo(scrollTopPosition)}else document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}));(windowWidth<theme.sizes.small||collectionSidebarSlideOut!==null)&&document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:collectionSidebarScrollable}))}collectionSidebarScrollable&&collectionSidebarScrollable.addEventListener("scroll",this.collectionSidebarScrollEvent)}hideSidebar(){const collectionSidebarSlider=this.container.querySelector(selectors$k.collectionSidebarSlider),collectionSidebarSlideOut=this.container.querySelector(selectors$k.collectionSidebarSlideOut),collectionSidebarScrollable=collectionSidebarSlider||collectionSidebarSlideOut;this.groupTagsButton.setAttribute("aria-expanded","false"),this.collectionSidebar.classList.add(classes$9.expanding),this.collectionSidebar.classList.remove(classes$9.expanded),collectionSidebarScrollable&&collectionSidebarScrollable.removeEventListener("scroll",this.collectionSidebarScrollEvent),setTimeout(()=>{this.collectionSidebar.classList.remove(classes$9.expanding)},500),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}toggleSidebarSlider(){(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small?this.hideSidebar():this.collectionSidebar.classList.contains(classes$9.expanded)&&this.showSidebarCallback()}collectionSidebarClose(evt){evt.preventDefault(),this.hideSidebar()}groupTagsButtonClick(){this.collectionSidebar.classList.contains(classe
8s$9.expanded)?this.showSidebarCallback():document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}onUnload(){document.removeEventListener("theme:resize",this.sidebarResizeEvent)}}const collectionSection={onLoad(){sections$8[this.id]=new Collection(this)},onUnload(){sections$8[this.id].onUnload()}};register("collection",[slider,parallaxHero,quickAddProduct,collectionSection,popoutSection,swatchGridSection,collectionFiltersForm,tooltipSection]);const selectors$l={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone"},attributes$3={speed:"data-marquee-speed"},classes$a={animation:"ticker--animated",unloaded:"ticker--unloaded",comparitor:"ticker__comparitor"},settings$2={textAnimationTime:1.63,space:100};class Ticker{constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$l.scale),this.text=this.frame.querySelector(selectors$l.text),this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$a.comparitor),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$a.unloaded),this.resizeEvent=debounce(()=>this.checkWidth(),100),this.listen()}unload(){document.removeEventListener("theme:resize",this.resizeEvent)}listen(){document.addEventListener("theme:resize",this.resizeEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2,speed=this.frame.getAttribute(attributes$3.speed)?this.frame.getAttribute(attributes$3.speed):settings$2.textAnimationTime;if(this.frame.clientWidth-padding<this.comparitor.clientWidth||this.stopClone){if(this.text.classList.add(classes$a.animation),this.scale.childElementCount===1){if(this.clone=this.text.cloneNode(!0),this.clone.setAttribute(selectors$l.clone,""),this.scale.appendChild(this.clone),this.stopClone)for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(selectors$l.clone,""),this.scale.appendChild(cloneSecond)}const animationTimeFrame=(this.text.clientWidth/settings$2.space*Number(speed)).toFixed(2);this.scale.style.setProperty("--animation-time",`${animationTimeFrame}s`)}}else{this.text.classList.add(classes$a.animation);let clone=this.scale.querySelector(`[${selectors$l.clone}]`);clone&&this.scale.removeChild(clone),this.text.classList.remove(classes$a.animation)}}}const selectors$m={bar:"[data-bar]",barSlide:"[data-slide]",frame:"[data-ticker-frame]",header:"[data-header-wrapper]",slider:"[data-slider]",slideValue:"data-slide",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]",dataTargetReferrer:"data-target-referrer"},sections$9={};class Bar{constructor(holder){this.barHolder=holder,this.locationPath=location.href,this.slides=this.barHolder.querySelectorAll(selectors$m.barSlide),this.slider=this.barHolder.querySelector(selectors$m.slider),this.init()}init(){this.removeAnnouncement(),this.slider&&this.initSliders(),this.slider||this.initTickers(!0)}removeAnnouncement(){for(let index=0;index<this.slides.length;index++){const element=this.slides[index];element.hasAttribute(selectors$m.dataTargetReferrer)&&this.locationPath.indexOf(element.getAttribute(selectors$m.dataTargetReferrer))===-1&&!window.Shopify.designMode&&element.parentNode.removeChild(element)}}initSliders(){this.slider=new Slider(this.barHolder),this.slider.flkty.reposition(),this.barHolder.addEventListener("theme:slider:loaded",()=>{this.initTickers()})}initTickers(stopClone=!1){this.barHolder.querySelectorAll(selectors$m.frame).forEach(element=>{new Ticker(element,stopClone)})}toggleTicker(e,isStoped){const tickerScale=document.querySelector(selectors$m.tickerScale),element=document.querySelector(`[${selectors$m.slideValue}="${e.detail.blockId}"]`);isStoped&&element&&(tickerScale.setAttribute("data-stop",""),tickerScale.querySelectorAll(selectors$m.tickerText).forEach(textHolder=>{textHolder.classList.remove("ticker--animated"),textHolder.style.transform=`translate3d(${-(element.offsetLeft-element.clientWidth)}px, 0, 0)`})),!isStoped&&element&&(tickerScale.querySelectorAll(selectors$m.tickerText).forEach(textHolder=>{textHolder.classList.add("ticker--animated"),textHolder.removeAttribute("style")}),tickerScale.removeAttribute("data-stop"))}onBlockSelect(e){this.slider?this.slider.onBlockSelect(e):this.toggleTicker(e,!0)}onBlockDeselect(e){this.slider?this.slider.onBlockDeselect(e):this.toggleTicker(e,!1)}}const bar={onLoad(){sections$9[this.id]=[];const element=this.container.querySelector(selectors$m.bar);element&&sections$9[this.id].push(new Bar(element))},onBlockSelect(e){sections$9[this.id].length&&sections$9[this.id].forEac
8h(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$9[this.id].length&&sections$9[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockDeselect(e)})}};register("announcement",[bar]);const selectors$n={body:"body",drawerWrappper:"[data-drawer]",drawerInner:"[data-drawer-inner]",underlay:"[data-drawer-underlay]",stagger:"[data-stagger-animation]",wrapper:"[data-header-transparent]",transparent:"data-header-transparent",drawerToggle:"data-drawer-toggle",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])'},classes$b={isVisible:"drawer--visible",isFocused:"is-focused",headerStuck:"js__header__stuck"};let sections$a={};class Drawer{constructor(el){this.drawer=el,this.drawerWrapper=this.drawer.closest(selectors$n.drawerWrappper),this.drawerInner=this.drawer.querySelector(selectors$n.drawerInner),this.underlay=this.drawer.querySelector(selectors$n.underlay),this.wrapper=this.drawer.closest(selectors$n.wrapper),this.key=this.drawer.dataset.drawer;const btnSelector=`[${selectors$n.drawerToggle}='${this.key}']`;this.buttons=document.querySelectorAll(btnSelector),this.staggers=this.drawer.querySelectorAll(selectors$n.stagger),this.body=document.querySelector(selectors$n.body),this.initWatchFocus=evt=>this.watchFocus(evt),this.connectToggle(),this.connectDrawer(),this.closers(),this.staggerChildAnimations()}connectToggle(){this.buttons.forEach(btn=>{btn.addEventListener("click",()=>{this.drawer.dispatchEvent(new CustomEvent("theme:drawer:toggle",{bubbles:!1}))})})}connectDrawer(){this.drawer.addEventListener("theme:drawer:toggle",()=>{this.drawer.classList.contains(classes$b.isVisible)?this.drawer.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!0})):this.drawer.dispatchEvent(new CustomEvent("theme:drawer:open",{bubbles:!0}))}),document.addEventListener("theme:drawer:close",this.hideDrawer.bind(this)),document.addEventListener("theme:drawer:open",this.showDrawer.bind(this))}staggerChildAnimations(){this.staggers.forEach(el=>{el.querySelectorAll(":scope > * > [data-animates]").forEach((child,index)=>{child.style.transitionDelay=`${index*50+10}ms`})})}watchFocus(evt){!this.wrapper.contains(evt.target)&&this.body.classList.contains(classes$b.isFocused)&&this.hideDrawer()}closers(){this.wrapper.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this.hideDrawer(),this.buttons[0].focus())}.bind(this)),this.underlay.addEventListener("click",()=>{this.hideDrawer()})}showDrawer(){document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!0),el.classList.add(classes$b.isVisible)}),this.drawer.classList.add(classes$b.isVisible),this.drawer.querySelector(selectors$n.focusable).focus(),this.wrapper.setAttribute(selectors$n.transparent,!1),document.addEventListener("focusin",this.initWatchFocus),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.drawerInner}))}hideDrawer(){this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!0),el.classList.remove(classes$b.isVisible)}),this.drawer.classList.remove(classes$b.isVisible),document.removeEventListener("focusin",this.initWatchFocus),this.wrapper.classList.contains(classes$b.headerStuck)||this.wrapper.setAttribute(selectors$n.transparent,theme.settings.transparentHeader),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:sliderule:close",{bubbles:!1}))}}const drawer={onLoad(){sections$a[this.id]=[],this.container.querySelectorAll(selectors$n.drawerWrappper).forEach(el=>{sections$a[this.id].push(new Drawer(el))})}},selectors$o={announcement:"[data-announcement-wrapper]",headerWrapper:"[data-header-wrapper]",header:"[data-header-wrapper] header"},classes$c={stuck:"js__header__stuck",stuckAnimated:"js__header__stuck--animated",triggerAnimation:"js__header__stuck--trigger-animation",stuckBackdrop:"js__header__stuck__backdrop",headerIsNotVisible:"is-not-visible",hasStickyHeader:"has-sticky-header"},attributes$4={transparent:"data-header-transparent",stickyHeader:"data-header-sticky",scrollLock:"data-scroll-locked"};let sections$b={};class Sticky{constructor(el){this.wrapper=el,this.type=this.wrapper.dataset.headerSticky,this.sticks=!1,this.static=!0,this.wrapper.hasAttribute(attributes$4.stickyHeader)&&(this.sticks=!0,this.static=!1),this.win=window,this.animated=this.type==="directional",this.currentlyStuck=!1,this.cls=this.wrapper.classList;const announcementEl=document.querySelector(selectors$o.announcement),announcementHeight=announcementEl?announcementEl.clientHeight:0;this.headerHeight=document.querySelector(selectors$o.header).clientHeight,this.blur=this.headerHeight+announcementHeight,this.stickDown=this.headerHeight+announcementHeight,this.stickUp=announcementHeight,this.scrollEventStatic=()=>this.checkIsVisible(),this.scrollEventListen=e=>this.listenScroll(e),this.scrollEventUpListen=()=>this.scrollUpDirectional(),this.scrollEventDownListen=()=>this.scrollDownDirectional(),this.wrapper.getAttribute(attributes$4.transparent)!=="false"&&(this.blur=announcementHeight),this.sticks&&(this.stickDown=announcementHeight,this.scrollDownInit(),document.body.classList.add(classes$c.hasStickyHeader)),this.static&&document.addEventListener("theme:scroll",this.scrollEventStatic),this.listen()}unload(){(this.sticks||this.animated)&&document.removeEventListener("theme:scroll",this.scrollEventListen),this.animated&&(document.removeEventListener("theme:scroll:up",this.scrollEventUpListen),document.removeEventListener("theme:scroll:down",this.scrollEventDownListen)),this.static&&document.removeEventListener("theme:scroll",this.scrollEventStatic)}listen(){(this.sticks||this.animated)&&document.addEventListener("theme:scroll",this.scrollEventListen),this.animated&&(document.addEventListener("theme:scroll:up",this.scrollEventUpListen),document.addEventListener("theme:scroll:down",this.scrollEventDownListen))}listenScroll(e){e.detail.down?(!this.currentlyStuck&&e.detail.position>this.stickDown&&this.stickSimple(),!this.currentlyBlurred&&e.detail.position>this.blur&&this.addBlur()):(e.detail.position<=this.stickUp&&this.unstickSimple(),e.detail.position<=this.blur&&this.removeBlur())}stickSimple(){this.animated&&this.cls.add(classes$c.stuckAnimated),this.cls.add(classes$c.stuck),this.wrapper.setAttribute(attributes$4.transparent,!1),this.currentlyStuck=!0}unstickSimple(){document.documentElement.hasAttribute(attributes$4.scrollLock)||(this.cls.remove(classes$c.stuck),this.wrapper.setAttribute(attributes$4.transparent,theme.settings.transparentHeader),this.animated&&this.cls.remove(classes$c.stuckAnimated),this.currentlyStuck=!1)}scrollDownInit(){window.scrollY>this.stickDown&&this.stickSimple(),window.scrollY>this.blur&&this.addBlur()}stickDirectional(){this.cls.add(classes$c.triggerAnimation)}unstickDirectional(){this.cls.remove(classes$c.triggerAnimation)}scrollDownDirectional(){this.unstickDirectional()}scrollUpDirectional(){window.scrollY<=this.stickDown?this.unstickDirectional():this.stickDirectional()}addBlur(){this.cls.add(classes$c.stuckBackdrop),this.currentlyBlurred=!0}
8removeBlur(){this.cls.remove(classes$c.stuckBackdrop),this.currentlyBlurred=!1}checkIsVisible(){const header2=document.querySelector(selectors$o.headerWrapper),isHeaderSticky=header2.getAttribute(attributes$4.stickyHeader),currentScroll=this.win.pageYOffset;isHeaderSticky||header2.classList.toggle(classes$c.headerIsNotVisible,currentScroll>=this.headerHeight)}}const stickyHeader={onLoad(){sections$b=new Sticky(this.container)},onUnload:function(){typeof sections$b.unload=="function"&&sections$b.unload()}},selectors$p={disclosureToggle:"data-hover-disclosure-toggle",disclosureWrappper:"[data-hover-disclosure]",link:"[data-top-link]",wrapper:"[data-header-wrapper]",stagger:"[data-stagger]",staggerPair:"[data-stagger-first]",staggerAfter:"[data-stagger-second]",focusable:'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'},classes$d={isVisible:"is-visible",meganavVisible:"meganav--visible",meganavIsTransitioning:"meganav--is-transitioning"};let sections$c={},disclosures={};class HoverDisclosure{constructor(el){this.disclosure=el,this.wrapper=el.closest(selectors$p.wrapper),this.key=this.disclosure.id,this.trigger=document.querySelector(`[${selectors$p.disclosureToggle}='${this.key}']`),this.link=this.trigger.querySelector(selectors$p.link),this.grandparent=this.trigger.classList.contains("grandparent"),this.transitionTimeout=0,this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.connectHoverToggle(),this.handleTablets(),this.staggerChildAnimations()}onBlockSelect(evt){this.disclosure.contains(evt.target)&&this.showDisclosure(evt)}onBlockDeselect(evt){this.disclosure.contains(evt.target)&&this.hideDisclosure()}showDisclosure(e){e&&e.type&&e.type==="mouseenter"&&this.wrapper.classList.add(classes$d.meganavIsTransitioning),this.grandparent?this.wrapper.classList.add(classes$d.meganavVisible):this.wrapper.classList.remove(classes$d.meganavVisible),this.trigger.setAttribute("aria-expanded",!0),this.trigger.classList.add(classes$d.isVisible),this.disclosure.classList.add(classes$d.isVisible),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.wrapper.classList.remove(classes$d.meganavIsTransitioning)},200)}hideDisclosure(){this.disclosure.classList.remove(classes$d.isVisible),this.trigger.classList.remove(classes$d.isVisible),this.trigger.setAttribute("aria-expanded",!1),this.wrapper.classList.remove(classes$d.meganavVisible,classes$d.meganavIsTransitioning)}staggerChildAnimations(){this.disclosure.querySelectorAll(selectors$p.stagger).forEach((el,index)=>{el.style.transitionDelay=`${index*50+10}ms`}),this.disclosure.querySelectorAll(selectors$p.staggerPair).forEach((child,i)=>{const d1=i*150;child.style.transitionDelay=`${d1}ms`,child.parentElement.querySelectorAll(selectors$p.staggerAfter).forEach((grandchild,i2)=>{const d2=(i2+1)*20;grandchild.style.transitionDelay=`${d1+d2}ms`})})}handleTablets(){this.trigger.addEventListener("touchstart",function(e){this.disclosure.classList.contains(classes$d.isVisible)||(e.preventDefault(),this.showDisclosure(e))}.bind(this),{passive:!0})}connectHoverToggle(){this.trigger.addEventListener("mouseenter",e=>this.showDisclosure(e)),this.link.addEventListener("focus",e=>this.showDisclosure(e)),this.trigger.addEventListener("mouseleave",()=>this.hideDisclosure()),this.trigger.addEventListener("focusout",e=>{this.trigger.contains(e.relatedTarget)||this.hideDisclosure()}),this.disclosure.addEventListener("keyup",evt=>{evt.which===window.theme.keyboardKeys.ESCAPE&&this.hideDisclosure()})}}const hoverDisclosure={onLoad(){sections$c[this.id]=[],disclosures=this.container.querySelectorAll(selectors$p.disclosureWrappper),disclosures.forEach(el=>{sections$c[this.id].push(new HoverDisclosure(el))})},onBlockSelect(evt){sections$c[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$c[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}},selectors$q={count:"data-cart-count"};class Totals{constructor(el){this.section=el,this.counts=this.section.querySelectorAll(`[${selectors$q.count}]`),this.cart=null,this.listen()}listen(){document.addEventListener("theme:cart:change",function(event){this.cart=event.detail.cart,this.update()}.bind(this))}
8update(){this.cart&&this.counts.forEach(count=>{count.setAttribute(selectors$q.count,this.cart.item_count),count.innerHTML=`${this.cart.item_count}`})}}const headerTotals={onLoad(){new Totals(this.container)}},selectors$r={append:"[data-predictive-search-append]",input:"data-predictive-search-input",productTemplate:"[product-grid-item-template]",productWrapper:"[data-product-wrap]",productWrapperOuter:"[data-product-wrap-outer]",titleTemplate:"[data-predictive-search-title-template]",titleWrapper:"[data-search-title-wrap]",dirtyClass:"dirty",loadingClass:"is-loading",searchPopdown:"search-popdown"};class SearchPredictive{constructor(input){this.input=input,this.key=this.input.getAttribute(selectors$r.input);const appendSelector=`[id='${this.key}']`;this.append=document.querySelector(appendSelector),this.productTemplate=document.querySelector(selectors$r.productTemplate).innerHTML,this.titleTemplate=document.querySelector(selectors$r.titleTemplate).innerHTML,this.titleWrapper=document.querySelector(selectors$r.titleWrapper),this.productWrapper=this.append.querySelector(selectors$r.productWrapper),this.productWrapperOuter=this.append.querySelector(selectors$r.productWrapperOuter),this.popdown=document.getElementById(selectors$r.searchPopdown),this.result=null,this.accessibility=a11y,this.initSearch()}initSearch(){this.input.addEventListener("input",debounce(function(event){const val=event.target.value;val&&val.length>1?(this.productWrapperOuter.classList.add(selectors$r.loadingClass),this.render(val)):(this.reset(),this.append.classList.remove(selectors$r.dirtyClass))}.bind(this),300)),this.input.addEventListener("clear",this.reset.bind(this))}render(terms){fetch(`/search/suggest.json?q=${encodeURIComponent(terms)}&resources[type]=product&resources[limit]=8&resources[options][unavailable_products]=last`).then(this.handleErrors).then(response=>response.json()).then(response=>(this.result=response.resources.results,this.fetchProducts(response.resources.results.products))).then(response=>{this.injectTitle(terms),setTimeout(()=>{this.reset(!1),this.productWrapperOuter.classList.remove(selectors$r.loadingClass),this.injectProduct(response),this.append.classList.add(selectors$r.dirtyClass),this.accessibility.trapFocus(this.popdown),this.input.focus()},1e3)}).catch(e=>{console.error(e)})}reset(clearTerms=!0){this.productWrapper.innerHTML="",this.append.classList.remove(selectors$r.dirtyClass),this.input.val="",this.accessibility.removeTrapFocus(),clearTerms&&(this.titleWrapper.innerHTML="")}injectTitle(terms){let title=window.theme.strings.noResultsFor,count="";this.result&&this.result.products.length>0&&(count=this.result.products.length,title=window.theme.strings.resultsFor),this.titleWrapper.innerHTML=Sqrl.render(this.titleTemplate,{count,title,query:terms})}injectProduct(productHTML){this.productWrapper.innerHTML+=productHTML}fetchProducts(products){const promises=[];return products.forEach(product=>{promises.push(fetchProduct(product.handle).then(productJSON=>{const formatted=formatPrices(productJSON);return this.renderProduct(formatted)}))}),Promise.all(promises).then(result=>{let str="";return result.forEach(render=>{str+=render}),str})}renderProduct(product){let media=null,mediaHover=null,image="",secondImage="";product.media!==void 0&&(media=product.media[0],mediaHover=product.media[1]),media?image={thumb:themeImages.getSizedImageUrl(media.preview_image.src,"800x800"),alt:media.preview_image.src}:image={thumb:window.theme.assets.no_image,alt:""},mediaHover&&(secondImage={thumb:themeImages.getSizedImageUrl(mediaHover.preview_image.src,"800x800"),alt:mediaHover.preview_image.src});const stripHtmlRegex=/(<([^>]+)>)/gi,title=product.title.replace(stripHtmlRegex,""),updateValues={...product,title,image,secondImage};return Sqrl.render(this.productTemplate,{product:updateValues})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const selectors$s={body:"body",popdownTrigger:"data-popdown-toggle",close:"[data-close-popdown]",input:"[data-predictive-search-input]"}
8,classes$e={isVisible:"is-visible"};let sections$d={};class SearchPopdownTriggers{constructor(trigger){this.trigger=trigger,this.key=this.trigger.getAttribute(selectors$s.popdownTrigger),this.search=null;const popdownSelector=`[id='${this.key}']`;this.document=document,this.popdown=document.querySelector(popdownSelector),this.input=this.popdown.querySelector(selectors$s.input),this.close=this.popdown.querySelector(selectors$s.close),this.body=document.querySelector(selectors$s.body),this.accessibility=a11y,this.initTriggerEvents(),this.initPopdownEvents()}initTriggerEvents(){this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.trigger.addEventListener("click",evt=>{evt.preventDefault(),this.body.classList.contains("is-focused")||this.showPopdown()}),this.trigger.addEventListener("keyup",evt=>{(evt.which===window.theme.keyboardKeys.SPACE||evt.which===window.theme.keyboardKeys.ENTER)&&this.body.classList.contains("is-focused")&&this.showPopdown()})}initPopdownEvents(){this.search=new SearchPredictive(this.input),this.popdown.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&this.hidePopdown()}.bind(this)),this.close.addEventListener("click",function(){this.hidePopdown()}.bind(this)),this.document.addEventListener("click",event=>{const clickedElement=event.target,isNotSearchExpandButton=!(clickedElement.matches(`[${selectors$s.popdownTrigger}]`)||clickedElement.closest(`[${selectors$s.popdownTrigger}]`)),isNotSearchPopdownChild=!(clickedElement.matches(`#${this.key}`)||clickedElement.closest(`#${this.key}`));isNotSearchExpandButton&&isNotSearchPopdownChild&&this.popdown.classList.contains(classes$e.isVisible)&&this.hidePopdown()})}hidePopdown(){this.popdown.classList.remove(classes$e.isVisible),this.input.form.reset(),this.input.dispatchEvent(new CustomEvent("clear",{bubbles:!1})),this.accessibility.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.body.classList.contains("is-focused")&&setTimeout(()=>{this.trigger.focus()},200)}showPopdown(){document.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.popdown})),this.popdown.classList.add(classes$e.isVisible);const val=this.input.value;this.input.value="",this.input.value=val,this.accessibility.trapFocus(this.popdown),this.input.focus()}}const searchPopdown={onLoad(){sections$d[this.id]=[],this.container.querySelectorAll(`[${selectors$s.popdownTrigger}]`).forEach(el=>{sections$d[this.id].push(new SearchPopdownTriggers(el))})}},selectors$t={slideruleOpen:"data-sliderule-open",slideruleClose:"data-sliderule-close",sliderulePane:"data-sliderule-pane",slideruleWrappper:"[data-sliderule]",focusable:'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',dataAnimates:"data-animates",children:`:scope > [data-animates], 
9             :scope > * > [data-animates], 
10             :scope > * > * >[data-animates],
11             :scope > * > .sliderule-grid  > *`},classes$f={isVisible:"is-visible",isHiding:"is-hiding",isHidden:"is-hidden"};let sections$e={};class HeaderMobileSliderule{constructor(el){this.sliderule=el,this.wrapper=el.closest(selectors$t.wrapper),this.key=this.sliderule.id;const btnSelector=`[${selectors$t.slideruleOpen}='${this.key}']`,exitSelector=`[${selectors$t.slideruleClose}='${this.key}']`;this.trigger=document.querySelector(btnSelector),this.exit=document.querySelectorAll(exitSelector),this.pane=document.querySelector(`[${selectors$t.sliderulePane}]`),this.children=this.sliderule.querySelectorAll(selectors$t.children),this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.clickEvents(),this.staggerChildAnimations(),document.addEventListener("theme:sliderule:close",this.closeSliderule.bind(this))}clickEvents(){this.trigger.addEventListener("click",function(){this.showSliderule()}.bind(this)),this.exit.forEach(element=>{element.addEventListener("click",function(){this.hideSliderule()}.bind(this))})}keyboardEvents(){this.trigger.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.SPACE&&this.showSliderule()}.bind(this)),this.sliderule.addEventListener("keyup",function(evt){evt.which===window.theme.keyboardKeys.ESCAPE&&(this.hideSliderule(),this.buttons[0].focus())}.bind(this))}staggerChildAnimations(reverse=!1){(reverse?Array.prototype.slice.call(this.children).slice().reverse():this.children).forEac
11h((child,index)=>{child.style.transitionDelay=`${index*50+10}ms`})}hideSliderule(close=!1){const paneStyle=window.getComputedStyle(this.pane),paneTransitionDuration=parseFloat(paneStyle.getPropertyValue("transition-duration"))*1e3,children=close?this.pane.querySelectorAll(`.${classes$f.isVisible}`):this.children;this.pane.style.setProperty("--sliderule-height","auto"),this.staggerChildAnimations(!0),this.pane.classList.add(classes$f.isHiding),this.sliderule.classList.add(classes$f.isHiding),this.sliderule.classList.remove(classes$f.isVisible),children.forEach(el=>{el.classList.remove(classes$f.isVisible)});const newPosition=parseInt(this.pane.dataset.sliderulePane,10)-1;this.pane.setAttribute(selectors$t.sliderulePane,newPosition);const hidedSelector=close?`[${selectors$t.dataAnimates}].${classes$f.isHidden}`:`[${selectors$t.dataAnimates}="${newPosition}"].${classes$f.isHidden}`,hidedItems=this.pane.querySelectorAll(hidedSelector);hidedItems.length&&hidedItems.forEach(element=>{element.classList.remove(classes$f.isHidden)}),setTimeout(()=>{this.pane.classList.remove(classes$f.isHiding),this.sliderule.classList.remove(classes$f.isHiding),this.staggerChildAnimations()},paneTransitionDuration)}showSliderule(){this.pane.style.setProperty("--sliderule-height","auto"),this.sliderule.classList.add(classes$f.isVisible),this.children.forEach(el=>{el.classList.add(classes$f.isVisible)});const oldPosition=parseInt(this.pane.dataset.sliderulePane,10),newPosition=oldPosition+1;this.pane.setAttribute(selectors$t.sliderulePane,newPosition);const hidedItems=this.pane.querySelectorAll(`[${selectors$t.dataAnimates}="${oldPosition}"]`);if(hidedItems.length){const hidedItemsTransition=parseFloat(window.getComputedStyle(hidedItems[0]).getPropertyValue("transition-duration"))*1e3;setTimeout(()=>{hidedItems.forEach(element=>{element.classList.add(classes$f.isHidden)})},hidedItemsTransition)}const newHeight=parseInt(this.trigger.nextElementSibling.offsetHeight);this.pane.style.setProperty("--sliderule-height",`${newHeight}px`)}closeSliderule(){this.pane&&this.pane.hasAttribute(selectors$t.sliderulePane)&&parseInt(this.pane.getAttribute(selectors$t.sliderulePane))>0&&(this.hideSliderule(!0),parseInt(this.pane.getAttribute(selectors$t.sliderulePane))>0&&this.pane.setAttribute(selectors$t.sliderulePane,0))}}const headerMobileSliderule={onLoad(){sections$e[this.id]=[],this.container.querySelectorAll(selectors$t.slideruleWrappper).forEach(el=>{sections$e[this.id].push(new HeaderMobileSliderule(el))})}},selectors$u={wrapper:"[data-header-wrapper]",html:"html",style:"data-header-style",widthContentWrapper:"[data-takes-space-wrapper]",widthContent:"[data-child-takes-space]",desktop:"[data-header-desktop]",cloneClass:"js__header__clone",showMobileClass:"js__show__mobile",backfill:"[data-header-backfill]",transparent:"data-header-transparent",overrideBorder:"header-override-border",firstSectionHasImage:".main-content > .shopify-section:first-child [data-overlay-header]",preventTransparentHeader:".main-content > .shopify-section:first-child [data-prevent-transparent-header]",deadLink:'.navlink[href="#"]'};let sections$f={};class Header{constructor(el){this.wrapper=el,this.html=document.querySelector(selectors$u.html),this.style=this.wrapper.dataset.style,this.desktop=this.wrapper.querySelector(selectors$u.desktop),this.isTransparentHeader=this.wrapper.getAttribute(selectors$u.transparent)!=="false",this.overlayedImages=document.querySelectorAll(selectors$u.firstSectionHasImage),this.deadLinks=document.querySelectorAll(selectors$u.deadLink),this.headerUpdateEvent=debounce(()=>this.checkForImage(),500),this.resizeEventWidth=()=>this.checkWidth(),this.resizeEventOverlay=()=>this.subtractAnnouncementHeight(),this.killDeadLinks(),this.style!=="drawer"&&this.desktop&&(this.minWidth=this.getMinWidth(),this.listenWidth()),this.checkForImage(),this.listenSectionEvents()}checkForImage(){this.overlayedImages=document.querySelectorAll(selectors$u.firstSectionHasImage);let preventTransparentHeader=document.querySelectorAll(selectors$u.preventTransparentHeader).length;this.overlayedImages.length&&!preventTransparentHeader&&this.isTransparentHeader?(this.listenOverlay(),this.wrapper.setAttribute(selectors$u.transparent,!0),document.querySelector(selectors$u.backfill).style.display="none",theme.settings.transparentHeader=!0):(this.wrapper.setAttribute(selectors$u.transparent,!1),document.querySelector(selectors$u.backfill).style.display="block",theme.settings.transparentHeader=!1),this.overlayedImages.length&&!preventTransparentHeader&&!this.isTransparentHeader&&this.wrapper.classList.add(selectors$u.overrideBorder),this.subtractAnnouncementHeight()}listenOverlay(){document.addEventListener("theme:resize",this.resizeEventOverlay),this.subtractAnnouncementHeight()}listenWidth(){document.addEventListener("theme:resize",this.resizeEventWidth),this.checkWidth()}listenSectionEvents(){document.addEventListener("shopify:section:load",this.headerUpdateEvent),document.addEventListener("shopify:section:unload",this.headerUpdateEvent),document.addEventListener("shopify:section:reorder",this.headerUpdateEvent)}killDeadLinks(){this.deadLinks.forEach(el=>{el.onclick=e=>{e.preventDefault()}})}subtractAnnouncementHeight(){const{windowHeight,announcementHeight,headerHeight}=readHeights();
11this.overlayedImages.forEach(el=>{theme.settings.transparentHeader?el.style.setProperty("--full-screen",`${windowHeight-announcementHeight}px`):el.style.setProperty("--full-screen",`${windowHeight-headerHeight}px`),el.classList.add("has-overlay")})}checkWidth(){document.body.clientWidth<this.minWidth?this.wrapper.classList.add(selectors$u.showMobileClass):this.wrapper.classList.remove(selectors$u.showMobileClass)}getMinWidth(){const comparitor=this.wrapper.cloneNode(!0);comparitor.classList.add(selectors$u.cloneClass),document.body.appendChild(comparitor);const widthWrappers=comparitor.querySelectorAll(selectors$u.widthContentWrapper);let minWidth=0,spaced=0;return widthWrappers.forEach(context=>{const wideElements=context.querySelectorAll(selectors$u.widthContent);let thisWidth=0;wideElements.length===3?thisWidth=_sumSplitWidths(wideElements):thisWidth=_sumWidths(wideElements),thisWidth>minWidth&&(minWidth=thisWidth,spaced=wideElements.length*20)}),document.body.removeChild(comparitor),minWidth+spaced}unload(){document.removeEventListener("theme:resize",this.resizeEventWidth),document.removeEventListener("theme:resize",this.resizeEventOverlay),document.removeEventListener("shopify:section:load",this.headerUpdateEvent),document.removeEventListener("shopify:section:unload",this.headerUpdateEvent),document.removeEventListener("shopify:section:reorder",this.headerUpdateEvent)}}function _sumSplitWidths(nodes){let arr=[];return nodes.forEach(el=>{el.firstElementChild&&arr.push(el.firstElementChild.clientWidth)}),arr[0]>arr[2]?arr[2]=arr[0]:arr[0]=arr[2],arr.reduce((a,b)=>a+b)}function _sumWidths(nodes){let width=0;return nodes.forEach(el=>{width+=el.clientWidth}),width}const header={onLoad(){sections$f=new Header(this.container),setVarsOnResize()},onUnload(){typeof sections$f.unload=="function"&&sections$f.unload()}};register("header",[header,drawer,popoutSection,headerMobileSliderule,stickyHeader,hoverDisclosure,headerTotals,searchPopdown]);const selectors$v={slider:"[data-slider]",slide:"[data-slide]",thumb:"[data-slider-thumb]"},classes$g={isSelected:"is-selected"},sections$g={};class Look{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$v.slider),this.slides=this.container.querySelectorAll(selectors$v.slide),this.thumbs=this.container.querySelectorAll(selectors$v.thumb),this.slider&&this.slides.length&&this.thumbs.length&&(this.resizeEvent=()=>this.checkPosition(),this.slider.addEventListener("scroll",this.resizeEvent),document.addEventListener("theme:resize",this.resizeEvent),this.thumbs.forEach((thumb,i)=>{thumb.addEventListener("click",()=>{if((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small){const parentPadding=parseInt(window.getComputedStyle(this.slider).paddingLeft),thumbLeft=this.slides[i].offsetLeft;this.slider.scrollTo({top:0,left:thumbLeft-parentPadding,behavior:"smooth"})}})}))}checkPosition(){if((window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small){const sliderWidth=this.slider.offsetWidth,sliderPositionRight=this.slider.scrollLeft+sliderWidth;this.slides.forEach((slide,i)=>{const slideWidth=slide.offsetWidth,slidePositionRight=slide.offsetLeft+slideWidth;let nextSlideCheck=!1;const nextSlide=this.slides[i+1];if(nextSlide){const nextSlidePositionWidth=nextSlide.offsetWidth,nextSlidePositionRight=nextSlide.offsetLeft+nextSlidePositionWidth;sliderPositionRight>=nextSlidePositionRight&&(nextSlideCheck=!0)}this.thumbs[i].classList.toggle(classes$g.isSelected,sliderPositionRight>=slidePositionRight&&!nextSlideCheck)})}}onUnload(){this.slider&&this.slides.length&&this.thumbs.length&&(document.removeEventListener("theme:resize",this.resizeEvent),this.slider.removeEventListener("scroll",this.resizeEvent))}}const lookSection={onLoad(){sections$g[this.id]=new Look(this)},onUnload(e){sections$g[this.id].onUnload(e)}};register("look",[lookSection,slider,quickAddProduct,swatchGridSection]);const selectors$w={body:"body",dataRelatedSectionElem:"[data-related-section]",dataTabsHolder:"[data-tabs-holder]",dataTabIndex:"data-tab-index",dataAos:"[data-aos]",blockId:"data-block-id",tabsLi:"[data-tab]",tabLink:".tab-link",tabLinkRecent:".tab-link__recent",tabContent:".tab-content",scrollbarHolder:"[data-scrollbar]",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]",productModal:"[data-product-modal]"},classes$h={current:"current",hide:"hide",alt:"alt",aosAnimate:"aos-animate",aosNoTransition:"aos-no-transition"},attributes$5={dataTab:"data-tab",dataTabStartIndex:"data-start-index"},sections$h={};class GlobalTabs{constructor(holder){this.container=holder,this.body=document.querySelector(selectors$w.body),this.accessibility=window.accessibility,this.container&&(this.scrollbarHolder=this.container.querySelectorAll(selectors$w.scrollbarHolder),this.init(),this.initNativeScrollbar())}init(){const ctx=this.container,tabsNavList=ctx.querySelectorAll(selectors$w.tabsLi),firstTabLink=ctx.querySelector(`${selectors$w.tabLink}-${ctx.hasAttribute(attributes$5.dataTabStartIndex)?ctx.getAttribute(attributes$5.dataTabStartIndex):0}`),firstTabContent=ctx.querySelector(`${selectors$w.tabContent}-${ctx.hasAttribute(attributes$5.dataTabStartIndex)?ctx.getAttribute(attributes$5.dataTabStartIndex):0}`);firstTabContent&&firstTabContent.classList.add(classes$h.current),firstTabLink&&firstTabLink.classList.add(classes$h.current),this.checkVisibleTabLinks(),this.container.addEventListener("theme:tab:check",()=>this.checkRecentTab()),this.container.addEventListener("theme:tab:hide",()=>this.hideRelatedTab()),tabsNavList.length&&tabsNavList.forEach(element=>{const tabId=parseInt(element.getAttribute(attributes$5.dataTab)),tab=ctx.querySelector(`${selectors$w.tabContent}-${tabId}`);element.addEventListener("click",()=>{this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.which===window.theme.keyboardKeys.SPACE||event.which===window.theme.keyboardKeys.ENTER)&&this.body.classList.contains("is-focused")&&this.tabChange(element,tab)})})}
11tabChange(element,tab){if(element.classList.contains(classes$h.current))return;this.container.querySelector(`${selectors$w.tabsLi}.${classes$h.current}`).classList.remove(classes$h.current),this.container.querySelector(`${selectors$w.tabContent}.${classes$h.current}`).classList.remove(classes$h.current),element.classList.add(classes$h.current),tab.classList.add(classes$h.current),element.classList.contains(classes$h.hide)&&tab.classList.add(classes$h.hide),this.checkVisibleTabLinks(),this.accessibility.a11y.removeTrapFocus(),this.container.dispatchEvent(new CustomEvent("theme:tab:change",{bubbles:!0})),this.animateItems(tab)}animateItems(tab,animated=!0){const animatedItems=tab.querySelectorAll(selectors$w.dataAos);animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.remove(classes$h.aosAnimate),animated&&(animatedItem.classList.add(classes$h.aosNoTransition),setTimeout(()=>{animatedItem.classList.remove(classes$h.aosNoTransition),animatedItem.classList.add(classes$h.aosAnimate)}))})}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}checkVisibleTabLinks(){const tabsNavList=this.container.querySelectorAll(selectors$w.tabsLi),tabsNavListHided=this.container.querySelectorAll(`${selectors$w.tabLink}.${classes$h.hide}`);tabsNavList.length-tabsNavListHided.length<2?this.container.classList.add(classes$h.alt):this.container.classList.remove(classes$h.alt)}checkRecentTab(){const tabLink=this.container.querySelector(selectors$w.tabLinkRecent);if(tabLink){tabLink.classList.remove(classes$h.hide);const tabLinkIdx=parseInt(tabLink.getAttribute(attributes$5.dataTab)),tabContent=this.container.querySelector(`${selectors$w.tabContent}[${selectors$w.dataTabIndex}="${tabLinkIdx}"]`);tabContent&&(tabContent.classList.remove(classes$h.hide),this.animateItems(tabContent,!1)),this.checkVisibleTabLinks(),this.initNativeScrollbar()}}hideRelatedTab(){const relatedSection2=this.container.querySelector(selectors$w.dataRelatedSectionElem);if(!relatedSection2)return;const parentTabContent=relatedSection2.closest(`${selectors$w.tabContent}.${classes$h.current}`);if(!parentTabContent)return;const parentTabContentIdx=parseInt(parentTabContent.getAttribute(selectors$w.dataTabIndex)),tabsNavList=this.container.querySelectorAll(selectors$w.tabsLi);if(tabsNavList.length>parentTabContentIdx){const nextTabsNavLink=tabsNavList[parentTabContentIdx].nextSibling;nextTabsNavLink&&(tabsNavList[parentTabContentIdx].classList.add(classes$h.hide),nextTabsNavLink.dispatchEvent(new Event("click")),this.initNativeScrollbar())}}onBlockSelect(evt){const element=this.container.querySelector(`${selectors$w.tabLink}[${selectors$w.blockId}="${evt.detail.blockId}"]`);element&&(element.dispatchEvent(new Event("click")),element.parentNode.scrollTo({top:0,left:element.offsetLeft-element.clientWidth,behavior:"smooth"}))}}const tabs={onLoad(){sections$h[this.id]=[],this.container.querySelectorAll(selectors$w.dataTabsHolder).forEach(holder=>{sections$h[this.id].push(new GlobalTabs(holder))})},onBlockSelect(e){sections$h[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}};register("product-grid",[slider,quickAddProduct,swatchGridSection,tabs]);const tokensReducer=(acc,token)=>{const{el,elStyle,elHeight,rowsLimit,rowsWrapped,options}=acc;let oldBuffer=acc.buffer,newBuffer=oldBuffer;if(rowsWrapped===rowsLimit+1)return{...acc};const textBeforeWrap=oldBuffer;let newRowsWrapped=rowsWrapped,newHeight=elHeight;return el.innerHTML=newBuffer=oldBuffer.length?`${oldBuffer}${options.delimiter}${token}${options.replaceStr}`:`${token}${options.replaceStr}`,parseFloat(elStyle.height)>parseFloat(elHeight)&&(newRowsWrapped++,newHeight=elStyle.height,newRowsWrapped===rowsLimit+1)?(el.innerHTML=newBuffer=textBeforeWrap[textBeforeWrap.length-1]==="."&&options.replaceStr==="..."?`${textBeforeWrap}..`:`${textBeforeWrap}${options.replaceStr}`,{...acc,elHeight:newHeight,rowsWrapped:newRowsWrapped}):(el.innerHTML=newBuffer=textBeforeWrap.length?`${textBeforeWrap}${options.delimiter}${token}`:`${token}`,{...acc,buffer:newBuffer,elHeight:newHeight,rowsWrapped:newRowsWrapped})},ellipsis=(selector="",rows=1,options={})=>{const opts={...{replaceStr:"...",debounceDelay:250,delimiter:" "},...options},elements=selector&&(selector instanceof NodeList?selector:selector.nodeType===1?[selector]:document.querySelectorAll(selector));for(let i=0;i<elements.length;i++){const el=elements[i],elementHtml=el.innerHTML,commentRegex=/<!--[\s\S]*?-->/g,splittedText=elementHtml.replace(commentRegex,"").split(opts.delimiter);el.innerHTML="";const elStyle=window.getComputedStyle(el);splittedText.reduce(tokensReducer,{el,buffer:el.innerHTML,elStyle,elHeight:0,rowsLimit:rows,rowsWrapped:0,options:opts})}},fadeOut=(el,callback=null)=>{el.style.opacity=1,(function fade(){(el.style.opacity-=.1)<0?el.style.display="none":requestAnimationFrame(fade),parseFloat(el.style.opacity)===0&&typeof callback=="function"&&callback()})()},selectors$x={productSlideshow:"[data-product-slideshow]",productThumbs:"[data-product-thumbs]",sliderThumb:"[data-thumb-item]",dataTallLayout:"data-tall-layout",mediaType:"data-type",dataMediaId:"data-media-id",dataThumb:"data-thumb",dataThumbIndex:"data-thumb-index",deferredMediaButton:"[data-deferred-media-button]",ariaLabel:"aria-label",dataThumbnail:"[data-thumbnail]",productSlideThumb:".js-product-slide-thumb",classSelected:"is-active",classMediaHidden:"media--hidden",sliderEnabled:"flickity-enabled",focusEnabled:"is-focused",thumbsSlider:"[data-thumbs-slider]"},classes$i={dragging:"is-dragging"},thumbIcons={model:'<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-media-model" viewBox="0 0 26 26"><path class="icon-media-model-outline" d="M.5 25v.5h25V.5H.5z" fill="none"/><path class="icon-media-model-element" d="M19.13 8.28L14 5.32a2 2 0 0 0-2 0l-5.12 3a2 2 0 0 0-1 1.76V16a2 2 0 0 0 1 1.76l5.12 3a2 2 0 0 0 2 0l5.12-3a2 2 0 0 0 1-1.76v-6a2 2 0 0 0-.99-1.72zm-6.4 11.1l-5.12-3a.53.53 0 0 1-.26-.38v-6a.53.53 0 0 1 .27-.46l5.12-3a.53.53 0 0 1 .53 0l5.12 3-4.72 2.68a1.33 1.33 0 0 0-.67 1.2v6a.53.53 0 0 1-.26 0z" opacity=".6" style="isolation:isolate"/></svg>',video:'<svg aria-hidden="true" focusable="false" role="presentation" class="icon icon-media-video" viewB
11ox="0 0 26 26"><path fill-rule="evenodd" clip-rule="evenodd" d="M1 25h24V1H1v24z"/><path class="icon-media-video-outline" d="M.5 25v.5h25V.5H.5V25z"/><path class="icon-media-video-element" fill-rule="evenodd" clip-rule="evenodd" d="M9.718 6.72a1 1 0 0 0-1.518.855v10.736a1 1 0 0 0 1.562.827l8.35-5.677a1 1 0 0 0-.044-1.682l-8.35-5.06z" opacity=".6"/></svg>'};class InitSlider{constructor(section){this.container=section.container,this.tallLayout=this.container.getAttribute(selectors$x.dataTallLayout)==="true",this.slideshow=this.container.querySelector(selectors$x.productSlideshow),this.thumbs=this.container.querySelector(selectors$x.productThumbs),this.mobileSliderEnable=this.container.getAttribute(selectors$x.mobileSliderEnable)==="true",this.flkty=null,this.init()}init(){this.tallLayout?(this.initSliderMobile(),document.addEventListener("theme:resize",()=>{this.initSliderMobile()})):this.createSlider()}initSliderMobile(){(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small?this.createSlider():this.destroySlider()}destroySlider(){this.slideshow.classList.contains(selectors$x.sliderEnabled)&&this.flkty.destroy(),this.thumbs&&(this.thumbs.innerHTML="")}createSlider(){if(!this.slideshow)return;const instance=this,firstSlide=this.slideshow.querySelectorAll(`[${selectors$x.mediaType}]`)[0];if(this.flkty=new FlickityFade(this.slideshow,{autoPlay:!1,prevNextButtons:!1,contain:!0,pageDots:!1,adaptiveHeight:!0,wrapAround:!0,fade:!0,on:{ready:function(){instance.sliderThumbs(this)}}}),this.flkty.resize(),firstSlide){const firstType=firstSlide.getAttribute(selectors$x.mediaType);(firstType==="model"||firstType==="video"||firstType==="external_video")&&(this.flkty.options.draggable=!1,this.flkty.updateDraggable())}this.flkty.on("change",function(index){let lastSLideIdx=index;if(instance.thumbs){const selectedElem=instance.thumbs.querySelector(`.${selectors$x.classSelected}`),currentSlide=instance.thumbs.querySelector(`${selectors$x.sliderThumb} [${selectors$x.dataThumbIndex}="${index}"]`);selectedElem&&(lastSLideIdx=Array.from(selectedElem.parentElement.children).indexOf(selectedElem),selectedElem.classList.remove(selectors$x.classSelected)),currentSlide&&currentSlide.parentElement.classList.add(selectors$x.classSelected),instance.scrollToThumb()}const currentMedia=this.cells[lastSLideIdx].element,newMedia=this.selectedElement;currentMedia.dispatchEvent(new CustomEvent("mediaHidden")),newMedia.classList.remove(selectors$x.classMediaHidden)}),this.flkty.on("settle",function(){const currentMedia=this.selectedElement,otherMedia=Array.prototype.filter.call(currentMedia.parentNode.children,function(child){return child!==currentMedia}),mediaType=currentMedia.getAttribute(selectors$x.mediaType),isFocusEnabled=document.body.classList.contains(selectors$x.focusEnabled);mediaType==="model"||mediaType==="video"||mediaType==="external_video"?(instance.flkty.options.draggable=!1,instance.flkty.updateDraggable()):(instance.flkty.options.draggable=!0,instance.flkty.updateDraggable()),isFocusEnabled&&currentMedia.dispatchEvent(new Event("focus")),otherMedia.length&&otherMedia.forEach(element=>{element.classList.add(selectors$x.classMediaHidden)}),currentMedia.dispatchEvent(new CustomEvent("mediaVisible"));const deferredMedia=currentMedia.querySelector("deferred-media");deferredMedia&&deferredMedia.getAttribute("loaded")!==!0&&currentMedia.querySelector(selectors$x.deferredMediaButton).dispatchEvent(new Event("click",{bubbles:!1}))}),this.flkty.on("dragStart",(event,pointer)=>{event.target.classList.add(classes$i.dragging)}),this.flkty.on("dragEnd",(event,pointer)=>{const draggedElem=this.flkty.element.querySelector(`.${classes$i.dragging}`);draggedElem&&draggedElem.classList.remove(classes$i.dragging)}),this.container.addEventListener("click",e=>{const target=e.target;if(target.matches(selectors$x.productSlideThumb)||target.closest(selectors$x.productSlideThumb)){e.preventDefault();const selector=target.matches(selectors$x.productSlideThumb)?target:target.closest(selectors$x.productSlideThumb),slideIdx=selector.hasAttribute(selectors$x.dataThumbIndex)?parseInt(selector.getAttribute(selectors$x.dataThumbIndex)):0;this.flkty.select(slideIdx)}})}scrollToThumb(){const thumbs=this.container.querySelector(selectors$x.thumbsSlider);if(thumbs){const thumb=thumbs.querySelector(`.${selectors$x.classSelected}`);if(!thumb)return;const thumbsScrollTop=thumbs.scrollTop,thumbsScrollLeft=thumbs.scrollLeft,thumbsWidth=thumbs.offsetWidth,thumbsHeight=thumbs.offsetHeight,thumbsPositionBottom=thumbsScrollTop+thumbsHeight,thumbsPositionRight=thumbsScrollLeft+thumbsWidth,thumbPosTop=thumb.offsetTop,thumbPosLeft=thumb.offsetLeft,thumbWidth=thumb.offsetWidth,thumbHe
11ight=thumb.offsetHeight,thumbRightPos=thumbPosLeft+thumbWidth,thumbBottomPos=thumbPosTop+thumbHeight,topCheck=thumbsScrollTop>thumbPosTop,bottomCheck=thumbBottomPos>thumbsPositionBottom,leftCheck=thumbsScrollLeft>thumbPosLeft,rightCheck=thumbRightPos>thumbsPositionRight;if(bottomCheck||topCheck||(rightCheck||leftCheck)){const isMobile=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<theme.sizes.small;let scrollTopPosition=thumbPosTop-thumbsHeight+thumbHeight,scrollLeftPosition=thumbPosLeft-thumbsWidth+thumbWidth;topCheck&&(scrollTopPosition=thumbPosTop),rightCheck&&isMobile&&(scrollLeftPosition+=parseInt(window.getComputedStyle(thumbs).paddingRight)),leftCheck&&(scrollLeftPosition=thumbPosLeft,isMobile&&(scrollLeftPosition-=parseInt(window.getComputedStyle(thumbs).paddingLeft))),thumbs.scrollTo({top:scrollTopPosition,left:scrollLeftPosition,behavior:"smooth"})}}}sliderThumbs(thisEl){const slides=thisEl.slides;if(this.thumbs&&slides.length){let slidesHtml="";slides.forEach((element,i)=>{const slide=element.cells[0].element,type=slide.getAttribute(selectors$x.mediaType),mediaId=slide.getAttribute(selectors$x.dataMediaId),thumb=slide.getAttribute(selectors$x.dataThumb);let thumbAlt="";const thumbIcon=thumbIcons[type]?thumbIcons[type]:"";let selected="";slide.querySelector(`[${selectors$x.ariaLabel}]`)&&(thumbAlt=slide.querySelector(`[${selectors$x.ariaLabel}]`).getAttribute(selectors$x.ariaLabel)),thumbAlt===""&&slide.hasAttribute(selectors$x.ariaLabel)&&(thumbAlt=slide.getAttribute(selectors$x.ariaLabel)),slide.setAttribute("tabindex","-1"),(slide.classList.contains(selectors$x.classSelected)||i===0)&&(selected=selectors$x.classSelected),slidesHtml+=`<div class="thumb ${selected}" data-thumb-item><a href="${thumb}" class="thumb__link thumb__link--${type} js-product-slide-thumb" data-thumb-index="${i}" data-thumbnail data-media-id="${mediaId}"><img class="thumb__link__image lazyload" alt="${thumbAlt}" data-widths="[180, 360, 540, 720, 900, 1080, 1296, 1512, 1728, 2048, 2450, 2700, 3000, 3350, 3750, 4100]" data-sizes="auto" src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" data-src="${thumb}">${thumbIcon}</a></div>`}),slidesHtml!==""&&(slidesHtml=`<div class="thumbs-holder" data-thumbs-slider>${slidesHtml}</div>`,this.thumbs.innerHTML=slidesHtml)}const productThumbImages=this.container.querySelectorAll(selectors$x.dataThumbnail);productThumbImages.length&&productThumbImages.forEach(element=>{element.addEventListener("click",function(e){e.preventDefault()}),element.addEventListener("keyup",function(e){if(e.keyCode===window.theme.keyboardKeys.ENTER){const mediaId=this.getAttribute(selectors$x.dataMediaId),mediaElem=thisEl.element.querySelector(`[${selectors$x.dataMediaId}="${mediaId}"]`).querySelectorAll('model-viewer, video, iframe, button, [href], input, [tabindex]:not([tabindex="-1"])')[0];mediaElem&&(mediaElem.dispatchEvent(new Event("focus")),mediaElem.dispatchEvent(new Event("select")))}})})}}const selectors$y={dataEnableSound:"data-enable-sound",dataEnableBackground:"data-enable-background",dataEnableAutoplay:"data-enable-autoplay",dataEnableLoop:"data-enable-loop",dataVideoId:"data-video-id",dataVideoType:"data-video-type",videoIframe:"[data-video-id]"},classes$j={loaded:"loaded"};class LoadVideoVimeo{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$y.videoIframe),this.player&&(this.videoID=this.player.getAttribute(selectors$y.dataVideoId),this.videoType=this.player.getAttribute(selectors$y.dataVideoType),this.enableBackground=this.player.getAttribute(selectors$y.dataEnableBackground)==="true",this.disableSound=this.player.getAttribute(selectors$y.dataEnableSound)==="false",this.enableAutoplay=this.player.getAttribute(selectors$y.dataEnableAutoplay)!=="false",this.enableLoop=this.player.getAttribute(selectors$y.dataEnableLoop)!=="false",this.videoType=="vimeo"&&this.init())}init(){this.loadVimeoPlayer()}loadVimeoPlayer(){const oembedUrl="https://vimeo.com/api/oembed.json",vimeoUrl="https://vimeo.com/"+this.videoID;let paramsString="";const state=this.player,params={url:vimeoUrl,background:this.enableBackgroun
11d,muted:this.disableSound,autoplay:this.enableAutoplay,loop:this.enableLoop};for(let key in params)paramsString+=encodeURIComponent(key)+"="+encodeURIComponent(params[key])+"&";fetch(`${oembedUrl}?${paramsString}`).then(response=>response.json()).then(function(data2){state.innerHTML=data2.html,setTimeout(function(){state.parentElement.classList.add(classes$j.loaded)},1e3)}).catch(function(){console.log("error")})}}const selectors$z={dataSectionId:"data-section-id",dataEnableSound:"data-enable-sound",dataHideOptions:"data-hide-options",dataCheckPlayerVisibility:"data-check-player-visibility",dataVideoId:"data-video-id",dataVideoType:"data-video-type",videoIframe:"[data-video-id]",videoWrapper:".video-wrapper",youtubeWrapper:"[data-youtube-wrapper]"},classes$k={loaded:"loaded"},players=[];class LoadVideoYT{constructor(container){this.container=container,this.player=this.container.querySelector(selectors$z.videoIframe),this.player&&(this.videoOptionsVars={},this.videoID=this.player.getAttribute(selectors$z.dataVideoId),this.videoType=this.player.getAttribute(selectors$z.dataVideoType),this.videoType=="youtube"&&(this.checkPlayerVisibilityFlag=this.player.getAttribute(selectors$z.dataCheckPlayerVisibility)==="true",this.playerID=this.player.querySelector(selectors$z.youtubeWrapper)?this.player.querySelector(selectors$z.youtubeWrapper).id:this.player.id,this.player.hasAttribute(selectors$z.dataHideOptions)&&(this.videoOptionsVars={cc_load_policy:0,iv_load_policy:3,modestbranding:1,playsinline:1,autohide:0,controls:0,branding:0,showinfo:0,rel:0,fs:0,wmode:"opaque"}),this.init(),this.container.addEventListener("touchstart",function(e){if(e.target.matches(selectors$z.videoWrapper)||e.target.closest(selectors$z.videoWrapper)){const playerID=e.target.querySelector(selectors$z.videoIframe).id;players[playerID].playVideo()}})))}init(){window.isYoutubeAPILoaded?this.loadYoutubePlayer():loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadYoutubePlayer())}loadYoutubePlayer(){const currentYoutubeOptions={...{height:"720",width:"1280",playerVars:this.videoOptionsVars,events:{onReady:event=>{const eventIframe=event.target.getIframe(),id=eventIframe.id,enableSound=document.querySelector(`#${id}`).getAttribute(selectors$z.dataEnableSound)==="true";eventIframe.setAttribute("tabindex","-1"),enableSound?event.target.unMute():event.target.mute(),event.target.playVideo(),this.checkPlayerVisibilityFlag&&(this.checkPlayerVisibility(id),window.addEventListener("scroll",throttle(()=>{this.checkPlayerVisibility(id)},150)))},onStateChange:event=>{event.data==0&&event.target.playVideo(),event.data==1&&event.target.getIframe().parentElement.classList.add(classes$k.loaded)}}}};currentYoutubeOptions.videoId=this.videoID,this.videoID.length&&YT.ready(()=>{players[this.playerID]=new YT.Player(this.playerID,currentYoutubeOptions)}),window.isYoutubeAPILoaded=!0}checkPlayerVisibility(id){let playerID;if(typeof id=="string")playerID=id;else if(id.data!=null)playerID=id.data.id;else return;const playerElement=document.getElementById(playerID+"-container");if(!playerElement)return;const player=players[playerID],box=playerElement.getBoundingClientRect();let isVisible=visibilityHelper.isElementPartiallyVisible(playerElement)||visibilityHelper.isElementTotallyVisible(playerElement);box.top<0&&playerElement.clientHeight+box.top>=0&&(isVisible=!0),isVisible&&player&&typeof player.playVideo=="function"?player.playVideo():!isVisible&&player&&typeof player.pauseVideo=="function"&&player.pauseVideo()}onUnload(){const playerID="youtube-"+this.container.getAttribute(selectors$z.dataSectionId);players[playerID]&&players[playerID].destroy()}}const selectors$A={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupCustomIframe:".pswp__custom-iframe",popupThumbs:".pswp__thumbs",dataOptionClasses:"data-pswp-option-classes",popupButtons:".pswp__button, .pswp__caption-close",dataVideoType:"data-video-type"},classes$l={current:"is-current",customLoader:"pswp--custom-loader",customOpen:"pswp--custom-opening",loader:"pswp__loader",popupCloseButton:"pswp__button--close"},loaderHTML=`<div class="${classes$l.loader}"><div class="loader pswp__loader-line"><div class="loader-indeterminate"></div></div></div>`;class LoadPhotoswipe{constructor(items,options=""){this.items=items,this.pswpElement=document.querySelectorAll(selectors$A.popupContainer)[0],this.popup=null,this.popupThumbs=null,this.isVideo=!1,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$A.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$A.popupCloseBtn),this.a11y=a11y;const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options!==""?options:defaultOptions,this.init()}init(){this.pswpElement.classList.add(classes$l.customOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}
11initLoader(){if(this.pswpElement.classList.contains(classes$l.customLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(selectors$A.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(selectors$A.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$l.customLoader)&&this.pswpElement.classList.remove(classes$l.customLoader),this.pswpElement.classList.remove(classes$l.customOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.init(),this.initVideo(),this.thumbsActions(),this.isVideo&&this.hideUnusedButtons(),setTimeout(()=>{this.a11y.trapFocus(this.pswpElement,{elementToFocus:this.closeBtn})},200),this.popup.listen("close",()=>this.onClose()),this.closeBtn&&this.closeBtn.addEventListener("click",()=>this.popup.close())}initVideo(){const videoContainer=this.pswpElement.querySelector(selectors$A.popupCu
11stomIframe);if(videoContainer){const videoType=videoContainer.getAttribute(selectors$A.dataVideoType);this.isVideo=!0,videoType=="youtube"?new LoadVideoYT(videoContainer.parentElement):videoType=="vimeo"&&new LoadVideoVimeo(videoContainer.parentElement)}}thumbsActions(){this.popupThumbsContainer&&this.popupThumbsContainer.firstChild&&(this.popupThumbsContainer.addEventListener("wheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("mousewheel",e=>this.stopDisabledScroll(e)),this.popupThumbsContainer.addEventListener("DOMMouseScroll",e=>this.stopDisabledScroll(e)),this.popupThumbs=this.pswpElement.querySelectorAll(`${selectors$A.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),element.parentElement.querySelector(`.${classes$l.current}`).classList.remove(classes$l.current),element.classList.add(classes$l.current),this.popup.goTo(i)})}),this.popup.listen("imageLoadComplete",()=>this.setCurrentThumb()),this.popup.listen("beforeChange",()=>this.setCurrentThumb()))}hideUnusedButtons(){this.pswpElement.querySelectorAll(selectors$A.popupButtons).forEach(element=>{element.classList.contains(classes$l.popupCloseButton)||(element.style.display="none")})}stopDisabledScroll(e){e.stopPropagation()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$A.popupIframe);if(popupIframe&&popupIframe.parentNode.removeChild(popupIframe),this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)for(;this.popupThumbsContainer.firstChild;)this.popupThumbsContainer.removeChild(this.popupThumbsContainer.firstChild);this.pswpElement.setAttribute(selectors$A.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$l.loader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),this.a11y.removeTrapFocus(),window.accessibility.lastElement&&setTimeout(()=>{window.accessibility.lastElement.focus()},200)}setCurrentThumb(){const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$A.popupThumbs} > .${classes$l.current}`);if(lastCurrentThumb&&lastCurrentThumb.classList.remove(classes$l.current),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$l.current),this.scrollThumbs(currentThumb)}scrollThumbs(currentThumb){const thumbsContainerLeft=this.popupThumbsContainer.scrollLeft,thumbsContainerWidth=this.popupThumbsContainer.offsetWidth,thumbsContainerPos=thumbsContainerLeft+thumbsContainerWidth,currentThumbLeft=currentThumb.offsetLeft,currentThumbWidth=currentThumb.offsetWidth,currentThumbPos=currentThumbLeft+currentThumbWidth;if(thumbsContainerPos<=currentThumbPos||thumbsContainerPos>currentThumbLeft){const currentThumbMarginLeft=parseInt(window.getComputedStyle(currentThumb).marginLeft);this.popupThumbsContainer.scrollTo({top:0,left:currentThumbLeft-currentThumbMarginLeft,behavior:"smooth"})}}}const selectors$B={zoomWrapper:"[data-zoom-wrapper]",dataImageSrc:"data-image-src",dataImageWidth:"data-image-width",dataImageHeight:"data-image-height",dataImageZoomEnable:"data-image-zoom-enable",thumbs:".pswp__thumbs",caption:"[data-zoom-caption]"},classes$m={variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable",popupThumb:"pswp__thumb",popupClass:"pswp-zoom-gallery",popupClassNoThumbs:"pswp-zoom-gallery--single",popupTitle:"product__title",popupTitleNew:"product__title pswp__title"};class Zoom{constructor(section){this.container=section.container,this.zoomWrappers=this.container.querySelectorAll(selectors$B.zoomWrapper),this.thumbsContainer=document.querySelector(selectors$B.thumbs),this.zoomCaptionElem=this.container.querySelector(selectors$B.caption),this.zoomEnable=this.container.getAttribute(selectors$B.dataImageZoomEnable)==="true",this.zoomEnable&&this.init()}init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),this.createZoom(i)}),element.addEventListener("keyup",e=>{e.keyCode===window.theme.keyboardKeys.ENTER&&(e.preventDefault(),this.createZoom(i))})})}createZoom(indexImage){let items=[],counter=0,thumbs="";
11this.zoomWrappers.forEach(elementImage=>{const imgSrc=elementImage.getAttribute(selectors$B.dataImageSrc);if(counter+=1,items.push({src:imgSrc,w:parseInt(elementImage.getAttribute(selectors$B.dataImageWidth)),h:parseInt(elementImage.getAttribute(selectors$B.dataImageHeight)),msrc:imgSrc}),thumbs+=`<a href="#" class="${classes$m.popupThumb}" style="background-image: url('${imgSrc}')"></a>`,this.zoomWrappers.length===counter){const options={history:!1,focus:!1,index:indexImage,mainClass:counter===1?`${classes$m.popupClass} ${classes$m.popupClassNoThumbs}`:`${classes$m.popupClass}`,showHideOpacity:!0,howAnimationDuration:150,hideAnimationDuration:250,closeOnScroll:!1,closeOnVerticalDrag:!1,captionEl:!0,closeEl:!0,closeElClasses:["caption-close","title"],tapToClose:!1,clickToCloseNonZoomable:!1,maxSpreadZoom:2,loop:!0,spacing:0,allowPanToNext:!0,pinchToClose:!1,addCaptionHTMLFn:(item,captionEl,isFake)=>{this.zoomCaption(item,captionEl,isFake)},getThumbBoundsFn:()=>{const imageLocation=this.zoomWrappers[indexImage],pageYScroll=window.pageYOffset||document.documentElement.scrollTop,rect=imageLocation.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};new LoadPhotoswipe(items,options),this.thumbsContainer&&thumbs!==""&&(this.thumbsContainer.innerHTML=thumbs)}})}zoomCaption(item,captionEl){let captionHtml="";const targetContainer=captionEl.children[0];return this.zoomCaptionElem&&(captionHtml=this.zoomCaptionElem.innerHTML,this.zoomCaptionElem.closest(`.${classes$m.variantSoldOut}`)?targetContainer.classList.add(classes$m.variantSoldOut):targetContainer.classList.remove(classes$m.variantSoldOut),this.zoomCaptionElem.closest(`.${classes$m.variantUnavailable}`)?targetContainer.classList.add(classes$m.variantUnavailable):targetContainer.classList.remove(classes$m.variantUnavailable)),captionHtml=captionHtml.replaceAll(classes$m.popupTitle,classes$m.popupTitleNew),targetContainer.innerHTML=captionHtml,!1}}const hosts={html5:"html5",youtube:"youtube",vimeo:"vimeo"},selectors$C={deferredMedia:"[data-deferred-media]",deferredMediaButton:"[data-deferred-media-button]",productMediaWrapper:"[data-product-single-media-wrapper]",productMediaSlider:"[data-product-single-media-slider]",mediaContainer:"[data-video]",mediaId:"data-media-id",dataTallLayout:"data-tall-layout"},classes$n={mediaHidden:"media--hidden"};theme.mediaInstances={};class Video{constructor(section){this.section=section,this.container=section.container,this.id=section.id,this.tallLayout=this.container.getAttribute(selectors$C.dataTallLayout)==="true",this.players={},this.init()}init(){this.container.querySelectorAll(selectors$C.mediaContainer).forEach(mediaContainer=>{const deferredMediaButton=mediaContainer.querySelector(selectors$C.deferredMediaButton);deferredMediaButton&&deferredMediaButton.addEventListener("click",this.loadContent.bind(this,mediaContainer))})}loadContent(mediaContainer){if(mediaContainer.querySelector(selectors$C.deferredMedia).getAttribute("loaded"))return;const content=document.createElement("div");content.appendChild(mediaContainer.querySelector("template").content.firstElementChild.cloneNode(!0));const mediaId=mediaContainer.dataset.mediaId,element=content.querySelector("video, iframe"),host=this.hostFromVideoElement(element),deferredMedia=mediaContainer.querySelector(selectors$C.deferredMedia);deferredMedia.appendChild(element).focus(),deferredMedia.setAttribute("loaded",!0),this.players[mediaId]={mediaId,sectionId:this.id,c
11ontainer:mediaContainer,element,host,ready:()=>this.createPlayer(mediaId)};const video=this.players[mediaId];switch(video.host){case hosts.html5:this.loadVideo(video,hosts.html5);break;case hosts.vimeo:window.isVimeoAPILoaded?this.loadVideo(video,hosts.vimeo):loadScript({url:"https://player.vimeo.com/api/player.js"}).then(()=>this.loadVideo(video,hosts.vimeo));break;case hosts.youtube:window.isYoutubeAPILoaded?this.loadVideo(video,hosts.youtube):loadScript({url:"https://www.youtube.com/iframe_api"}).then(()=>this.loadVideo(video,hosts.youtube));break}}hostFromVideoElement(video){if(video.tagName==="VIDEO")return hosts.html5;if(video.tagName==="IFRAME"){if(/^(https?:\/\/)?(www\.)?(youtube\.com|youtube-nocookie\.com|youtu\.?be)\/.+$/.test(video.src))return hosts.youtube;if(video.src.includes("vimeo.com"))return hosts.vimeo}return null}loadVideo(video,host){video.host===host&&video.ready()}createPlayer(mediaId){const video=this.players[mediaId];switch(video.host){case hosts.html5:video.element.play(),video.element.addEventListener("play",()=>this.pauseOtherMedia(mediaId)),video.element.play(),video.container.addEventListener("mediaHidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("mediaVisible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId);break;case hosts.vimeo:this.players[mediaId].player=new Vimeo.Player(video.element),this.players[mediaId].player.play(),window.isVimeoAPILoaded=!0,video.container.addEventListener("mediaHidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("mediaVisible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId);break;case hosts.youtube:if(video.host==hosts.youtube&&video.player)return;YT.ready(()=>{const videoId=video.container.dataset.videoId;this.players[mediaId].player=new YT.Player(video.element,{videoId,events:{onReady:event=>event.target.playVideo()}}),window.isYoutubeAPILoaded=!0,video.container.addEventListener("mediaHidden",event=>this.onHidden(event)),video.container.addEventListener("xrLaunch",event=>this.onHidden(event)),video.container.addEventListener("mediaVisible",event=>this.onVisible(event)),this.tallLayout&&this.observeVideo(video,mediaId)});break}}observeVideo(video,mediaId){new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.intersectionRatio!=1?this.pauseVideo(video):(this.playVideo(video),this.pauseOtherMedia(mediaId))})},{threshold:1}).observe(video.element)}playVideo(video){video.player&&video.player.playVideo?video.player.playVideo():video.element&&video.element.play?video.element.play():video.player&&video.player.play&&video.player.play()}pauseVideo(video){video.player&&video.player.pauseVideo?video.player.pauseVideo():video.element&&video.element.pause?video.element.pause():video.player&&video.player.pause&&video.player.pause()}onHidden(event){typeof event.target.dataset.mediaId<"u"&&this.pauseVideo(this.players[event.target.dataset.mediaId])}onVisible(event){typeof event.target.dataset.mediaId<"u"&&this.playVideo(this.players[event.target.dataset.mediaId])}pauseOtherMedia(mediaId){const mediaIdString=`[${selectors$C.mediaId}="${mediaId}"]`,otherMedia=document.querySelectorAll(`${selectors$C.productMediaWrapper}:not(${mediaIdString})`);document.querySelector(`${selectors$C.productMediaWrapper}${mediaIdString}`).classList.remove(classes$n.mediaHidden),otherMedia.length&&otherMedia.forEach(element=>{element.dispatchEvent(new CustomEvent("mediaHidden")),element.classList.add(classes$n.mediaHidden)})}}theme.mediaInstances={};const selectors$D={videoPlayer:"[data-video]",modelViewer:"[data-model]",sliderEnabled:"flickity-enabled"},classes$o={mediaHidden:"media--hidden"};class Media{constructor(section){this.section=section,this.id=section.id,this.container=section.container}init(){this.detect3d(),this.launch3d(),new Video(this.section),new Zoom(this.section),new InitSlider(this.section)}detect3d(){const modelViewerElements=this.container.querySelectorAll(selectors$D.modelViewer);
11modelViewerElements.length&&modelViewerElements.forEach(element=>{theme.ProductModel.init(element,this.id)})}launch3d(){document.addEventListener("shopify_xr_launch",()=>{this.container.querySelector(`${selectors$D.modelViewer}:not(.${classes$o.mediaHidden})`).dispatchEvent(new CustomEvent("xrLaunch"))})}}const selectors$E={pickupContainer:"data-store-availability-container",shopifySection:".shopify-section",drawer:"[data-pickup-drawer]",drawerBody:"[data-pickup-drawer-body]",drawerOpen:"[data-pickup-drawer-open]",drawerClose:"[data-pickup-drawer-close]",body:"body"},classes$p={isOpen:"is-open",isHidden:"hidden"};let sections$i={};class PickupAvailability{constructor(section){this.container=section.container,this.drawer=null,this.drawerBody=null,this.buttonDrawerOpen=null,this.buttonDrawerClose=null,this.body=document.querySelector(selectors$E.body),this.a11y=a11y,this.container.addEventListener("theme:variant:change",event=>this.fetchPickupAvailability(event)),this.closeEvent()}fetchPickupAvailability(event){const container=this.container.querySelector(`[${selectors$E.pickupContainer}]`);if(!container)return;if(event&&!event.detail.variant||event&&event.detail.variant&&!event.detail.variant.available){container.classList.add(classes$p.isHidden);return}const variantID=event&&event.detail.variant?event.detail.variant.id:container.getAttribute(selectors$E.pickupContainer);this.drawer=this.body.querySelector(selectors$E.drawer),this.drawer&&this.body.removeChild(this.drawer),variantID&&fetch(`${window.theme.routes.root}variants/${variantID}/?section_id=api-pickup-availability`).then(this.handleErrors).then(response=>response.text()).then(text=>{const pickupAvailabilityHTML=new DOMParser().parseFromString(text,"text/html").querySelector(selectors$E.shopifySection).innerHTML;if(container.innerHTML=pickupAvailabilityHTML,this.drawer=this.container.querySelector(selectors$E.drawer),!this.drawer){container.classList.add(classes$p.isHidden);return}this.clone=this.drawer.cloneNode(!0),this.body.appendChild(this.clone),container.classList.remove(classes$p.isHidden),container.removeChild(this.drawer),this.drawer=this.body.querySelector(selectors$E.drawer),this.drawerBody=this.body.querySelector(selectors$E.drawerBody),this.buttonDrawerOpen=this.body.querySelector(selectors$E.drawerOpen),this.buttonDrawerClose=this.body.querySelectorAll(selectors$E.drawerClose),this.buttonDrawerOpen&&this.buttonDrawerOpen.addEventListener("click",()=>{this.openDrawer(),window.accessibility.lastElement=this.buttonDrawerOpen}),this.buttonDrawerClose.length&&this.buttonDrawerClose.forEach(element=>{element.addEventListener("click",()=>this.closeDrawer())}),this.drawer.addEventListener("keyup",evt=>{evt.which===window.theme.keyboardKeys.ESCAPE&&this.closeDrawer()})}).catch(e=>{console.error(e)})}openDrawer(){this.drawer&&(this.drawer.classList.add(classes$p.isOpen),this.drawer.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.drawerBody})),setTimeout(()=>{const elementToFocus=this.drawer.querySelector(selectors$E.drawerClose);this.a11y.removeTrapFocus(),this.a11y.trapFocus(this.drawer,{elementToFocus})},200))}closeDrawer(){this.drawer&&(this.drawer.classList.remove(classes$p.isOpen),this.drawer.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0,detail:this.drawerBody})),this.a11y.removeTrapFocus(),window.accessibility.lastElement&&setTimeout(()=>{window.accessibility.lastElement.focus()},200))}closeEvent(){document.addEventListener("click",event=>{const clickedElement=event.target;!clickedElement.matches(selectors$E.drawerOpen)&&!clickedElement.closest(selectors$E.drawer)&&this.closeDrawer()})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}const pickupAvailability={onLoad(){sections$i[this.id]=new PickupAvailability(this)}},selectors$F={form:"[data-product-form]",optionPosition:"data-option-position",optionInput:'[name^="options"], [data-popout-option]',selectOptionValue:"data-value",popout:"[data-popout]"},classes$q={soldOut:"sold-out",unavailable:"unavailable"};class SelloutVariants{constructor(section,productJSON){this.container=section,this.productJSON=productJSON,this.formSelector=this.container.querySelector(selectors$F.form),this.form=this.formSelector&&this.formSelector.tagName=="FORM"?this.formSelector:this.formSelector.querySelector("form"),this.formData=new FormData(this.form),this.optionElements=this.container.querySelectorAll(selectors$F.optionInput),this.productJSON&&this.form&&this.init()}init(){this.update()}
11update(){this.getCurrentState(),this.optionElements.forEach(el=>{const parent=el.closest(`[${selectors$F.optionPosition}]`);if(!parent)return;const val=el.value||el.getAttribute(selectors$F.selectOptionValue),positionString=parent.getAttribute(selectors$F.optionPosition),position=parseInt(positionString,10)-1,selectPopout=el.closest(selectors$F.popout);let newVals=[...this.selections];newVals[position]=val;const found=this.productJSON.variants.find(element=>{let perfectMatch=!0;for(let index=0;index<newVals.length;index++)element.options[index]!==newVals[index]&&(perfectMatch=!1);return perfectMatch});el.classList.remove(classes$q.soldOut,classes$q.unavailable),selectPopout&&selectPopout.classList.remove(classes$q.soldOut,classes$q.unavailable),typeof found>"u"?(el.classList.add(classes$q.unavailable),selectPopout&&selectPopout.classList.add(classes$q.unavailable)):found&&found.available===!1&&(el.classList.add(classes$q.soldOut),selectPopout&&selectPopout.classList.add(classes$q.soldOut))})}getCurrentState(){this.formData=new FormData(this.form),this.selections=[];for(var value of this.formData.entries())value[0].includes("options[")&&this.selections.push(value[1])}}const selectors$G={product:"[data-product]",productForm:"[data-product-form]",addToCart:"[data-add-to-cart]:not([data-upsell-btn])",addToCartText:"[data-add-to-cart-text]",comparePrice:"[data-compare-price]",comparePriceText:"[data-compare-text]",formWrapper:"[data-form-wrapper]",originalSelectorId:"[data-product-select]",priceWrapper:"[data-price-wrapper]",productSlideshow:"[data-product-slideshow]",productImage:"[data-product-image]",productJson:"[data-product-json]",productPrice:"[data-product-price]",unitPrice:"[data-product-unit-price]",unitBase:"[data-product-base]",unitWrapper:"[data-product-unit]",isPreOrder:"[data-product-preorder]",sliderEnabled:"flickity-enabled",productSlide:".product__slide",dataTallLayout:"data-tall-layout",dataEnableHistoryState:"data-enable-history-state",subPrices:"[data-subscription-watch-price]",subSelectors:"[data-subscription-selectors]",subsToggle:"[data-toggles-group]",subsChild:"data-group-toggle",subDescription:"[data-plan-description]",priceOffWrap:"[data-price-off]",priceOffType:"[data-price-off-type]",priceOffAmount:"[data-price-off-amount]",dataImageId:"data-image-id",idInput:'[name="id"]',remainingCount:"[data-remaining-count]",remainingMax:"[data-remaining-max]",remainingMaxAttr:"data-remaining-max",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]"},classes$r={hide:"hide",variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable",productPriceSale:"product__price--sale",remainingLow:"count-is-low",remainingIn:"count-is-in",remainingOut:"count-is-out",remainingUnavailable:"count-is-unavailable"};class ProductAddForm{constructor(section){if(this.section=section,this.container=section.container,this.tallLayout=this.container.getAttribute(selectors$G.dataTallLayout)==="true",this.product=this.container.querySelector(selectors$G.product),this.productForm=this.container.querySelector(selectors$G.productForm),this.sellout=null,!this.product||!this.productForm)return;if(this.priceOffWrap=this.container.querySelector(selectors$G.priceOffWrap),this.priceOffAmount=this.container.querySelector(selectors$G.priceOffAmount),this.priceOffType=this.container.querySelector(selectors$G.priceOffType),this.planDecription=this.container.querySelector(selectors$G.subDescription),this.remainingWrapper=this.container.querySelector(selectors$G.remainingWrapper),this.remainingWrapper){const remainingMaxWrap=this.container.querySelector(selectors$G.remainingMax);if(!remainingMaxWrap)return;this.remainingMaxInt=parseInt(remainingMaxWrap.getAttribute(selectors$G.remainingMaxAttr),10),this.remainingCount=this.container.querySelector(selectors$G.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$G.remainingJSON),this.remainingJSON=null,this.remainingJSONWrapper&&this.remainingJSONWrapper.innerHTML!==""?this.remainingJSON=JSON.parse(this.remainingJSONWrapper.innerHTML):console.warn("Missing product quantity JSON")}this.enableHistoryState=this.container.getAttribute(selectors$G.dataEnableHistoryState)==="true",this.hasUnitPricing=this.container.querySelector(selectors$G.unitWrapper),this.subSelectors=this.container.querySelector(selectors$G.subSelectors),this.subPrices=this.container.querySelector(selectors$G.subPrices),this.isPreOrder=this.container.querySelector(selectors$G.isPreOrder),new QuantityCounter(this.container).init(),this.init()}init(){let productJSON=null;const productElemJSON=this.container.querySelector(selectors$G.productJson);productElemJSON&&(productJSON=productElemJSON.innerHTML),productJSON?(this.productJSON=JSON.parse(productJSON),this.linkForm(),this.sellout=new SelloutVariants(this.container,this.productJSON)):console.error("Missing product JSON")}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductForm(this.productForm,this.productJSON,{onOptionChange:this.onOptionChange.bind(this),onPlanChange:this.onPlanChange.bind(this)}),this.pushState(this.productForm.getFormState()),this.subsToggleListeners()}onOptionChange(evt){this.pushState(evt.dataset),this.updateProductImage(evt)}onPlanChange(evt){this.subPrices&&this.pushState(evt.dataset)}pushState(formState){this.productState=this.setProductState(formState),this.updateAddToCartState(formState),this.updateProductPrices(formState),this.updateSaleText(formState),this.updateSubscriptionText(formState),this.updateRemaining(formState),this.fireHookEvent(formState),this.sellout?.update(formState),this.enableHistoryState&&this.updateHistoryState(formState)}updateAddToCartState(formState){const variant=formState.variant;let addText=theme.strings.addToCart;
11const priceWrapper=this.container.querySelectorAll(selectors$G.priceWrapper),addToCart=this.container.querySelectorAll(selectors$G.addToCart),addToCartText=this.container.querySelectorAll(selectors$G.addToCartText),formWrapper=this.container.querySelectorAll(selectors$G.formWrapper);this.isPreOrder&&(addText=theme.strings.preOrder),priceWrapper.length&&variant&&priceWrapper.forEach(element=>{element.classList.remove(classes$r.hide)}),addToCart.length&&addToCart.forEach(element=>{variant&&variant.available?element.disabled=!1:element.disabled=!0}),addToCartText.length&&addToCartText.forEach(element=>{variant?variant.available?element.innerHTML=addText:element.innerHTML=theme.strings.soldOut:element.innerHTML=theme.strings.unavailable}),formWrapper.length&&formWrapper.forEach(element=>{if(variant){variant.available?element.classList.remove(classes$r.variantSoldOut,classes$r.variantUnavailable):(element.classList.add(classes$r.variantSoldOut),element.classList.remove(classes$r.variantUnavailable));const formSelect=element.querySelector(selectors$G.originalSelectorId);formSelect&&(formSelect.value=variant.id)}else element.classList.add(classes$r.variantUnavailable),element.classList.remove(classes$r.variantSoldOut)})}updateHistoryState(formState){const variant=formState.variant,plan=formState.plan,location2=window.location.href;if(variant&&location2.includes("/product")){const url=new window.URL(location2),params=url.searchParams;params.set("variant",variant.id),plan&&plan.detail&&plan.detail.id&&this.productState.hasPlan?params.set("selling_plan",plan.detail.id):params.delete("selling_plan"),url.search=params.toString();const urlString=url.toString();window.history.replaceState({path:urlString},"",urlString)}}updateRemaining(formState){const variant=formState.variant;if(variant&&this.remainingWrapper&&this.remainingJSON&&this.remainingCount){const newQuantity=this.remainingJSON[variant.id];newQuantity&&newQuantity<=this.remainingMaxInt&&newQuantity>0?(this.remainingWrapper.classList.remove(classes$r.remainingIn,classes$r.remainingOut,classes$r.remainingUnavailable),this.remainingWrapper.classList.add(classes$r.remainingLow),this.remainingCount.innerHTML=newQuantity):this.productState.soldOut?(this.remainingWrapper.classList.remove(classes$r.remainingLow,classes$r.remainingIn,classes$r.remainingUnavailable),this.remainingWrapper.classList.add(classes$r.remainingOut)):this.productState.available&&(this.remainingWrapper.classList.remove(classes$r.remainingLow,classes$r.remainingOut,classes$r.remainingUnavailable),this.remainingWrapper.classList.add(classes$r.remainingIn))}else this.remainingWrapper&&(this.remainingWrapper.classList.remove(classes$r.remainingIn,classes$r.remainingOut,classes$r.remainingLow),this.remainingWrapper.classList.add(classes$r.remainingUnavailable))}getBaseUnit(variant){return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}subsToggleListeners(){this.container.querySelectorAll(selectors$G.subsToggle).forEach(toggle=>{toggle.addEventListener("change",function(e){const val=e.target.value.toString(),selected=this.container.querySelector(`[${selectors$G.subsChild}="${val}"]`),groups=this.container.querySelectorAll(`[${selectors$G.subsChild}]`);if(selected){selected.classList.remove(classes$r.hide);const first=selected.querySelector('[name="selling_plan"]');first.checked=!0,first.dispatchEvent(new Event("change"))}groups.forEach(group=>{group!==selected&&(group.classList.add(classes$r.hide),group.querySelectorAll('[name="selling_plan"]').forEach(plan=>{plan.checked=!1,plan.dispatchEvent(new Event("change"))}))})}.bind(this))})}updateSaleText(formState){this.productState.planSale?this.updateSaleTextSubscription(formState):this.productState.onSale?this.updateSaleTextStandard(formState):this.priceOffWrap&&this.priceOffWrap.classList.add(classes$r.hide)}updateSaleTextStandard(formState){this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.sale||"sale");const variant=formState.variant,discountFloat=(variant.compare_at_price-variant.price)/variant.compare_at_price,discountInt=Math.floor(discountFloat*100);this.priceOffAmount.innerHTML=`${discountInt}%`,this.priceOffWrap.classList.remove(classes$r.hide)}updateSubscriptionText(formState){formState.plan&&this.planDecription?(this.planDecription.innerHTML=formState.plan.detail.description,this.planDecription.classList.remove(classes$r.hide)):this.planDecription&&this.planDecription.classList.add(classes$r.hide)}updateSaleTextSubscription(formState){this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.subscription||"subscripton");const adjustment=formState.plan.detail.price_adjustments[0],discount=adjustment.value;
11adjustment&&adjustment.value_type==="percentage"?this.priceOffAmount.innerHTML=`${discount}%`:this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat),this.priceOffWrap.classList.remove(classes$r.hide)}updateProductPrices(formState){const variant=formState.variant,plan=formState.plan;this.container.querySelectorAll(selectors$G.priceWrapper).forEach(wrap2=>{const comparePriceEl=wrap2.querySelector(selectors$G.comparePrice),productPriceEl=wrap2.querySelector(selectors$G.productPrice),comparePriceText=wrap2.querySelector(selectors$G.comparePriceText);let comparePrice="",price="";this.productState.available&&(comparePrice=variant.compare_at_price,price=variant.price),this.productState.hasPlan&&(price=plan.allocation.price),this.productState.planSale&&(comparePrice=plan.allocation.compare_at_price,price=plan.allocation.price),comparePriceEl&&(this.productState.onSale||this.productState.planSale?(comparePriceEl.classList.remove(classes$r.hide),comparePriceText.classList.remove(classes$r.hide),productPriceEl.classList.add(classes$r.productPriceSale)):(comparePriceEl.classList.add(classes$r.hide),comparePriceText.classList.add(classes$r.hide),productPriceEl.classList.remove(classes$r.productPriceSale)),comparePriceEl.innerHTML=themeCurrency.formatMoney(comparePrice,theme.moneyFormat)),productPriceEl.innerHTML=price===0?window.theme.strings.free:themeCurrency.formatMoney(price,theme.moneyFormat)}),this.hasUnitPricing&&this.updateProductUnits(formState)}updateProductUnits(formState){const variant=formState.variant,plan=formState.plan;let unitPrice=null;if(variant&&variant.unit_price&&(unitPrice=variant.unit_price),plan&&plan.allocation&&plan.allocation.unit_price&&(unitPrice=plan.allocation.unit_price),unitPrice){const base=this.getBaseUnit(variant),formattedPrice=themeCurrency.formatMoney(unitPrice,theme.moneyFormat);this.container.querySelector(selectors$G.unitPrice).innerHTML=formattedPrice,this.container.querySelector(selectors$G.unitBase).innerHTML=base,showElement(this.container.querySelector(selectors$G.unitWrapper))}else hideElement(this.container.querySelector(selectors$G.unitWrapper))}fireHookEvent(formState){const variant=formState.variant;this.container.dispatchEvent(new CustomEvent("theme:variant:change",{detail:{variant},bubbles:!0}))}setProductState(dataset){const variant=dataset.variant,plan=dataset.plan,productState={available:!0,soldOut:!1,onSale:!1,showUnitPrice:!1,requiresPlan:!1,hasPlan:!1,planPerDelivery:!1,planSale:!1};return!variant||variant.requires_selling_plan&&!plan?productState.available=!1:(variant.available||(productState.soldOut=!0),variant.compare_at_price>variant.price&&(productState.onSale=!0),variant.unit_price&&(productState.showUnitPrice=!0),this.product&&this.product.requires_selling_plan&&(productState.requiresPlan=!0),plan&&this.subPrices&&(productState.hasPlan=!0,plan.allocation.per_delivery_price!==plan.allocation.price&&(productState.planPerDelivery=!0),variant.price>plan.allocation.price&&(productState.planSale=!0))),productState}updateProductImage(evt){const variant=evt.dataset.variant;if(variant&&variant.featured_media){const newImg=this.container.querySelector(`${selectors$G.productImage}[${selectors$G.dataImageId}="${variant.featured_media.id}"]`),newImageParent=newImg.closest(selectors$G.productSlide);if(newImageParent){const newImagePos=Array.from(newImageParent.parentElement.children).indexOf(newImageParent),slider2=this.container.querySelector(selectors$G.productSlideshow);if(slider2&&slider2.classList.contains(selectors$G.sliderEnabled)&&FlickityFade.data(slider2).select(newImagePos),!theme.variables.bpSmall&&this.tallLayout){const newImgTop=newImg.getBoundingClientRect().top;if(newImagePos===0&&newImgTop+window.scrollY>window.pageYOffset)return;document.dispatchEvent(new CustomEvent("tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),scrollTo(newImgTop)}}}}}const productFormSection={onLoad(){this.section=new ProductAddForm(this)}},selectors$H={elements:{accordionHolder:"[data-accordion-holder]",accordion:"[data-accordion]",accordionToggle:"[data-accordion-toggle]",accordionBody:"[data-accordion-body]",accordionExpandValue:"data-accordion-expand",accordionBlockValue:"data-block-id"},classes:{open:"is-open"}},sections$j={};class GlobalAccordions{constructor(el){this.container=el.container,this.accordion=this.container.querySelector(selectors$H.elements.accordion),this.accordionToggles=this.container.querySelectorAll(selectors$H.elements.accordionToggle),this.accordionTogglesLength=this.accordionToggles.length,this.accordionBody=this.container.querySelector(selectors$H.elements.accordionBody),this.accordionTogglesLength&&this.accordionBody&&this.accordionEvents()}
11accordionEvents(){this.accordionToggles.forEach(element=>{element.addEventListener("click",throttle(event=>{event.preventDefault();const targetAccordionBody=element.parentElement.querySelector(selectors$H.elements.accordionBody);targetAccordionBody&&this.onAccordionToggle(element,targetAccordionBody)},800))}),this.accordion.getAttribute(selectors$H.elements.accordionExpandValue)==="true"&&(this.accordionToggles[0].classList.add(selectors$H.classes.open),showElement(this.accordionToggles[0].parentElement.querySelector(selectors$H.elements.accordionBody)))}closeOtherAccordions(element,slide=!0){let otherElements=[...this.accordionToggles];const holder=this.container.closest(selectors$H.elements.accordionHolder);holder&&(otherElements=[...holder.querySelectorAll(selectors$H.elements.accordionToggle)]),otherElements.filter(otherElement=>{const otherElementAccordionBody=otherElement.parentElement.querySelector(selectors$H.elements.accordionBody);otherElement!==element&&otherElement.classList.contains(selectors$H.classes.open)&&otherElementAccordionBody&&this.onAccordionClose(otherElement,otherElementAccordionBody,slide)})}onAccordionOpen(element,body,slide=!0){element.classList.add(selectors$H.classes.open),slideDown(body),this.closeOtherAccordions(element,slide)}onAccordionClose(element,body,slide=!0){element.classList.remove(selectors$H.classes.open),slide?slideUp(body):hideElement(body)}onAccordionToggle(element,body){element.classList.toggle(selectors$H.classes.open),slideToggle(body),this.closeOtherAccordions(element)}onBlockToggle(evt,blockSelect=!0){const targetAccordionToggle=this.container.querySelector(`${selectors$H.elements.accordionToggle}[${selectors$H.elements.accordionBlockValue}="${evt.detail.blockId}"]`);if(!targetAccordionToggle)return;const targetAccordionBody=targetAccordionToggle.parentElement.querySelector(selectors$H.elements.accordionBody);targetAccordionBody&&(blockSelect?this.onAccordionOpen(targetAccordionToggle,targetAccordionBody,!1):this.onAccordionClose(targetAccordionToggle,targetAccordionBody))}onSelectToggle(sectionSelect=!0){this.accordionBody&&this.accordionTogglesLength&&this.accordionTogglesLength<2&&(sectionSelect?this.onAccordionOpen(this.accordionToggles[0],this.accordionBody,!1):this.onAccordionClose(this.accordionToggles[0],this.accordionBody))}onSelect(){this.onSelectToggle(!0)}onDeselect(){this.onSelectToggle(!1)}onBlockSelect(evt){this.onBlockToggle(evt,!0)}onBlockDeselect(evt){this.onBlockToggle(evt,!1)}}const accordions={onLoad(){sections$j[this.id]=new GlobalAccordions(this)},onSelect(){sections$j[this.id].onSelect()},onDeselect(){sections$j[this.id].onDeselect()},onBlockSelect(e){sections$j[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$j[this.id].onBlockDeselect(e)}},selectors$I={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]",scrollToElement:"[data-scroll-to]",scrollToElementValue:"data-scroll-to",scrollToLinks:"[data-scroll-to-links]",scrollSpy:"[data-scroll-spy]",accordionHolder:"[data-accordion-holder]",accordionToggle:"[data-accordion-toggle]",tooltip:"[data-tooltip]",tooltipStopMousenterValue:"data-tooltip-stop-mouseenter"},classes$s={open:"is-open",selected:"is-selected"},sections$k={};class ScrollToElement{constructor(section){this.section=section,this.container=section.container,this.scrollToButtons=this.container.querySelectorAll(selectors$I.scrollToElement),this.scrollSpyElement=this.container.querySelector(selectors$I.scrollSpy),this.scrollToButtons.length&&this.init(),this.scrollSpyElement&&this.scrollSpy()}init(){this.scrollToButtons.forEach(element=>{element.addEventListener("click",e=>{e.preventDefault();const target=document.querySelector(element.getAttribute(selectors$I.scrollToElementValue));if(!target)return;const accordionToggle=target.querySelector(selectors$I.accordionToggle);let timeoutFlag=!1;const scrollToLinks=element.closest(selectors$I.scrollToLinks);if(scrollToLinks&&!element.closest(selectors$I.scrollSpy)){const selectedItems=scrollToLinks.querySelectorAll(`.${classes$s.selected}`);
11selectedItems.length&&selectedItems.forEach(selectedItem=>{selectedItem.classList.remove(classes$s.selected)}),element.classList.add(classes$s.selected)}if(accordionToggle){const accordionHolder=accordionToggle.closest(selectors$I.accordionHolder);!accordionToggle.classList.contains(classes$s.open)&&accordionHolder&&accordionHolder.querySelector(`${selectors$I.accordionToggle}.${classes$s.open}`)&&(timeoutFlag=!0),accordionToggle.classList.contains(classes$s.open)||accordionToggle.dispatchEvent(new Event("click"))}timeoutFlag?setTimeout(()=>this.scrollToElement(target),500):this.scrollToElement(target)})})}scrollToElement(element){scrollTo(element.getBoundingClientRect().top);const tooltips=document.querySelectorAll(`${selectors$I.tooltip}:not([${selectors$I.tooltipStopMousenterValue}])`);tooltips.length&&tooltips.forEach(tooltip=>{tooltip.setAttribute(selectors$I.tooltipStopMousenterValue,""),setTimeout(()=>{tooltip.removeAttribute(selectors$I.tooltipStopMousenterValue)},1e3)})}scrollSpy(){const buttons=this.scrollSpyElement.querySelectorAll(selectors$I.scrollToElement);if(!buttons)return;const headerHeight=document.querySelector(selectors$I.headerSticky)&&document.querySelector(selectors$I.headerHeight)?document.querySelector(selectors$I.headerHeight).getBoundingClientRect().height:0;window.addEventListener("scroll",()=>{const scrollPos=document.documentElement.scrollTop||document.body.scrollTop;buttons.forEach(element=>{const target=document.querySelector(element.getAttribute(selectors$I.scrollToElementValue));target.offsetTop-headerHeight<=scrollPos&&(this.scrollSpyElement.querySelector(`.${classes$s.selected}`).classList.remove(classes$s.selected),this.scrollSpyElement.querySelector(`[${selectors$I.scrollToElementValue}="#${target.id}"]`).classList.add(classes$s.selected))})})}}const scrollToElement={onLoad(){sections$k[this.id]=new ScrollToElement(this)}};window.theme.variables={productPageSticky:!1,bpSmall:!1};const selectors$J={addToCart:"[data-add-to-cart]",priceWrapper:"[data-price-wrapper]",slideshow:"[data-product-slideshow]",productImage:"[data-product-image]",productJson:"[data-product-json]",form:"[data-product-form]",thumbs:"[data-product-thumbs]",dataSectionId:"data-section-id",dataTallLayout:"data-tall-layout",dataStickyEnabled:"data-sticky-enabled",dataCartBar:"data-cart-bar",dataProductShare:"[data-product-share]",dataProductShareValue:"data-product-share",dataProductShareTitleValue:"data-product-share-title",productPage:".product__page",formWrapper:".form__wrapper",cartBar:"#cart-bar",productSubmitAdd:".product__submit__add",cartBarAdd:"data-add-to-cart-bar",cartBarScroll:"data-cart-bar-scroll",templateProduct:"#template-product",siteFooterWrapper:".site-footer-wrapper",toggleTruncateHolder:"[data-truncated-holder]",toggleTruncateButton:"[data-truncated-button]",toggleTruncateContent:"[data-truncated-content]",toggleTruncateContentAttr:"data-truncated-content",upsellButton:"[data-upsell-btn]",upsellButtonText:"[data-upsell-btn-text]",dataModalButton:"data-product-popup",modalScrollContainer:"[data-tabs-holder]",formWrapper:"[data-form-wrapper]"},classes$t={expanded:"is-expanded",sticky:"is-sticky",visible:"is-visible",loading:"is-loading",siteFooterPush:"site-footer--push",hasPopup:"has-popup"},sections$l={};class Product{constructor(section){this.section=section,this.container=section.container,this.id=this.container.getAttribute(selectors$J.dataSectionId),this.tallLayout=this.container.getAttribute(selectors$J.dataTallLayout)==="true",this.stickyEnabled=this.container.getAttribute(selectors$J.dataStickyEnabled)==="true",this.thumbs=this.container.querySelector(selectors$J.thumbs),this.shareButton=this.container.querySelector(selectors$J.dataProductShare),this.upsellButton=this.container.querySelector(selectors$J.upsellButton),this.truncateElementHolder=this.container.querySelector(selectors$J.toggleTruncateHolder),this.truncateElement=this.container.querySelector(selectors$J.toggleTruncateContent),this.modalButton=this.container.querySelectorAll(`[${selectors$J.dataModalButton}]`),this.formWrapper=this.container.querySelector(selectors$J.formWrapper),this.resizeEventTruncate=()=>this.truncateText(),this.resizeEventSticky=()=>this.stickyScrollCheck(),this.resizeEventUpsell=()=>this.calcUpsellButtonDemensions(),this.scrollEvent=()=>this.scrollTop(),this.unlockTimer=0,this.accessibility=a11y,Shopify.Products.recordRecentlyViewed(),this.shareToggle(),this.truncateElementHolder&&this.truncateElement&&(setTimeout(this.resizeEventTruncate,50),document.addEventListener("theme:resize",this.resizeEventTruncate));const productJson=this.container.querySelector(selectors$J.productJson);if(productJson&&!productJson.innerHTML||!productJson){new QuantityCounter(this.container).init();return}this.form=this.container.querySelector(selectors$J.form),this.init(),this.stickyEnabled&&this.stickyScroll(),this.container.getAttribute(selectors$J.dataCartBar)==="true"&&this.initCartBar(),this.upsellButton&&this.upsellButtonDemensions(),this.modalButton.length>0&&this.productPopup()}init(){theme.mediaInstances[this.id]=new Media(this.section),theme.mediaInstances[this.id].init()}productPopup(){this.modalButton.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault();const modal=document.querySelector(`#${button.getAttribute(selectors$J.dataModalButton)}
11`),modalScrollContainer=modal.querySelector(selectors$J.modalScrollContainer);window.getComputedStyle(modal).display!=="none"&&(fadeOut(modal),this.formWrapper.classList.remove(classes$t.hasPopup),this.accessibility.removeTrapFocus(),this.unlockTimer&&clearTimeout(this.unlockTimer),this.unlockTimer=setTimeout(()=>{document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))},300)),window.getComputedStyle(modal).display==="none"&&(fadeIn(modal),this.formWrapper.classList.add(classes$t.hasPopup),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:modalScrollContainer})),this.accessibility.trapFocus(modal))})})}upsellButtonDemensions(){this.calcUpsellButtonDemensions(),document.addEventListener("theme:resize",this.resizeEventUpsell)}calcUpsellButtonDemensions(){const upsellButtonText=this.upsellButton.querySelector(selectors$J.upsellButtonText);upsellButtonText&&this.upsellButton.style.setProperty("--btn-text-width",`${upsellButtonText.clientWidth}px`)}stickyScroll(){this.stickyScrollCheck(),document.addEventListener("theme:resize",this.resizeEventSticky)}stickyScrollCheck(){const isDesktop=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.small,form=this.container.querySelector(selectors$J.formWrapper),targetFormWrapper=this.container.querySelector(`${selectors$J.productPage} ${selectors$J.formWrapper}`);if(isDesktop){const slideshow=this.container.querySelector(selectors$J.slideshow);if(!form||!slideshow)return;const productCopyHeight=form.offsetHeight,productImagesHeight=slideshow.offsetHeight;productCopyHeight<productImagesHeight||productCopyHeight<window.innerHeight?(theme.variables.productPageSticky=!0,targetFormWrapper.classList.add(classes$t.sticky)):(theme.variables.productPageSticky=!1,targetFormWrapper.classList.remove(classes$t.sticky))}else targetFormWrapper.classList.remove(classes$t.sticky)}truncateText(){if(this.truncateElementHolder.classList.contains(classes$t.visible))return;const styles2=this.truncateElement.querySelectorAll("style");styles2.length&&styles2.forEach(style=>{this.truncateElementHolder.prepend(style)});const truncateElementCloned=this.truncateElement.cloneNode(!0),truncateElementClass=this.truncateElement.getAttribute(selectors$J.toggleTruncateContentAttr),truncateNextElement=this.truncateElement.nextElementSibling;truncateNextElement&&truncateNextElement.remove(),this.truncateElement.parentElement.append(truncateElementCloned);const truncateAppendedElement=this.truncateElement.nextElementSibling;truncateAppendedElement.classList.add(truncateElementClass),truncateAppendedElement.removeAttribute(selectors$J.toggleTruncateContentAttr),showElement(truncateAppendedElement),ellipsis(truncateAppendedElement,5,{replaceStr:"",delimiter:" "}),hideElement(truncateAppendedElement),this.truncateElement.innerHTML!==truncateAppendedElement.innerHTML?this.truncateElementHolder.classList.add(classes$t.expanded):(truncateAppendedElement.remove(),this.truncateElementHolder.classList.remove(classes$t.expanded)),this.toggleTruncatedContent(this.truncateElementHolder)}toggleTruncatedContent(holder){const toggleButton=holder.querySelector(selectors$J.toggleTruncateButton);toggleButton&&toggleButton.addEventListener("click",e=>{e.preventDefault(),holder.classList.remove(classes$t.expanded),holder.classList.add(classes$t.visible)})}shareToggle(){this.shareButton&&this.shareButton.addEventListener("click",function(){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(navigator.share&&windowWidth<=1024){const shareTitle=this.hasAttribute(selectors$J.dataProductShareTitleValue)?this.getAttribute(selectors$J.dataProductShareTitleValue):window.location.hostname,shareUrl=this.hasAttribute(selectors$J.dataProductShareValue)?this.getAttribute(selectors$J.dataProductShareValue):window.location.href;navigator.share({title:shareTitle,url:shareUrl}).then(()=>{console.log("Thanks for sharing!")}).catch(console.error)}else this.parentElement.classList.toggle(classes$t.expanded)})}initCartBar(){const cartBar=document.querySelector(selectors$J.cartBar),cartBarBtn=cartBar.querySelector(selectors$J.productSubmitAdd);cartBarBtn&&(cartBarBtn.addEventListener("click",e=>{e.preventDefault(),e.target.hasAttribute(selectors$J.cartBarAdd)?(theme.settings.cartDrawerEnabled&&(e.target.classList.add(classes$t.loading),e.target.setAttribute("disabled","disabled")),this.form.querySelector(selectors$J.addToCart).dispatchEvent(new Event("click",{bubbles:!0}))):e.target.hasAttribute(selectors$J.cartBarScroll)&&this.scrollToTop()}),cartBarBtn.hasAttribute(selectors$J.cartBarAdd)&&document.addEventListener("product:bar:error",()=>this.scrollToTop()),theme.settings.cartDrawerEnabled&&document.addEventListener("product:bar:button",()=>
11{cartBarBtn&&cartBarBtn.classList.contains(classes$t.loading)&&(cartBarBtn.classList.remove(classes$t.loading),cartBarBtn.removeAttribute("disabled"))})),this.cartBar=cartBar,document.addEventListener("theme:scroll",this.scrollEvent)}scrollToTop(){const scrollTarget=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=window.theme.sizes.small?this.container:this.form;scrollTo(scrollTarget.getBoundingClientRect().top)}scrollTop(){const scrolled=window.pageYOffset,siteFooter=document.querySelector(selectors$J.siteFooterWrapper);if(this.form&&this.cartBar){const formOffset=this.form.offsetTop,formHeight=this.form.offsetHeight,checkPosition=scrolled>formOffset+formHeight;this.cartBar.classList.toggle(classes$t.visible,checkPosition),siteFooter.classList.toggle(classes$t.siteFooterPush,checkPosition),siteFooter.style.marginBottom=siteFooter.classList.contains(classes$t.siteFooterPush)?`${this.cartBar.offsetHeight}px`:"0"}}onUnload(){this.truncateElementHolder&&this.truncateElement&&document.removeEventListener("theme:resize",this.resizeEventTruncate),this.stickyEnabled&&document.removeEventListener("theme:resize",this.resizeEventSticky),this.upsellButton&&document.removeEventListener("theme:resize",this.resizeEventUpsell),this.container.getAttribute(selectors$J.dataCartBar)==="true"&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productSection={onLoad(){sections$l[this.id]=new Product(this)},onUnload(e){sections$l[this.id].onUnload(e)}};register("product",[productSection,pickupAvailability,productFormSection,swatchSection,tooltipSection,popoutSection,tabs,accordions,copyClipboard,scrollToElement]);const selectors$K={dataRelatedSectionElem:"[data-related-section]",dataRelatedProduct:"[data-product-grid-item]",dataProductId:"data-product-id",dataLimit:"data-limit",dataMinimum:"data-minimum",recentlyViewed:"[data-recent-wrapper]",recentlyViewedWrapper:"[data-recently-viewed-wrapper]",recentlyProduct:"#recently-viewed-products",dataProductItem:".product-item",slider:"[data-slider]"},classes$u={isHidden:"is-hidden"};class Related{constructor(section){this.section=section,this.sectionId=section.id,this.container=section.container,this.init(),this.recent()}init(){const relatedSection2=this.container.querySelector(selectors$K.dataRelatedSectionElem);if(!relatedSection2)return;const self=this,productId=relatedSection2.getAttribute(selectors$K.dataProductId),limit=relatedSection2.getAttribute(selectors$K.dataLimit),requestUrl=`${window.theme.routes.product_recommendations_url}?section_id=related&limit=${limit}&product_id=${productId}`;fetch(requestUrl).then(function(response){return response.text()}).then(function(data2){const createdElement=document.createElement("div");createdElement.innerHTML=data2;const inner=createdElement.querySelector(selectors$K.dataRelatedSectionElem);if(inner.querySelector(selectors$K.dataRelatedProduct)){const innerHtml=inner.innerHTML;hideElement(relatedSection2),relatedSection2.innerHTML=innerHtml,slideDown(relatedSection2);const relatedProducts=relatedSection2.querySelectorAll(selectors$K.dataRelatedProduct);relatedProducts.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(self.section),relatedProducts.length>4&&relatedSection2.querySelector(selectors$K.slider)&&new Slider(relatedSection2)}else relatedSection2.dispatchEvent(new CustomEvent("theme:tab:hide",{bubbles:!0}))}).catch(function(){relatedSection2.dispatchEvent(new CustomEvent("theme:tab:hide",{bubbles:!0}))})}recent(){const recentlyViewed=this.container.querySelector(selectors$K.recentlyViewed),howManyToshow=recentlyViewed?parseInt(recentlyViewed.getAttribute(selectors$K.dataLimit)):4;Shopify.Products.showRecentlyViewed({howManyToShow:howManyToshow,wrapperId:`recently-viewed-products-${this.sectionId}`,section:this.section,onComplete:(wrapper,section)=>{const container=section.container,recentlyViewedHolder=container.querySelector(selectors$K.recentlyViewed),recentlyViewedWrapper=container.querySelector(selectors$K.recentlyViewedWrapper),recentProducts=wrapper.querySelectorAll(selectors$K.dataProductItem),minimumNumberProducts=recentlyViewedHolder.hasAttribute(selectors$K.dataMinimum)?parseInt(recentlyViewedHolder.getAttribute(selectors$K.dataMinimum)):4,checkRecentInRelated=!recentlyViewedWrapper&&recentProducts.length>0,checkRecentOutsideRelated=recentlyViewedWrapper&&recentProducts.length>=minimumNumberProducts;(checkRecentInRelated||checkRecentOutsideRelated)&&(checkRecentOutsideRelated&&recentlyViewedWrapper.classList.remove(classes$u.isHidden),fadeIn(recentlyViewedHolder),recentlyViewedHolder.dis
11patchEvent(new CustomEvent("theme:tab:check",{bubbles:!0})),recentProducts.forEach(item=>{new QuickAddProduct(item)}),makeGridSwatches(section),recentProducts.length>4&&recentlyViewedHolder.querySelector(selectors$K.slider)&&new Slider(recentlyViewedHolder))}})}}const relatedSection={onLoad(){this.section=new Related(this),this.container.querySelectorAll(selectors$K.dataRelatedProduct).forEach(item=>{new QuickAddProduct(item)})}};register("related",[relatedSection,popoutSection,tabs]),register("reviews",accordions);const selectors$L={scrollElement:"[data-block-scroll]",flickityEnabled:"flickity-enabled"},sections$m={};class BlockScroll{constructor(el){this.container=el.container}onBlockSelect(evt){const scrollElement=this.container.querySelector(selectors$L.scrollElement);if(scrollElement&&!scrollElement.classList.contains(selectors$L.flickityEnabled)){const currentElement=evt.srcElement;currentElement&&scrollElement.scrollTo({top:0,left:currentElement.offsetLeft,behavior:"smooth"})}}}const blockScroll={onLoad(){sections$m[this.id]=new BlockScroll(this)},onBlockSelect(e){sections$m[this.id].onBlockSelect(e)}},sections$n={},selectors$M={logo:"[data-slider-logo]",text:"[data-slider-text]",slide:"[data-slide]",slideData:"data-slide",asNavFor:"#nav-for-",slideIndex:"data-slide-index",flickityEnabled:"flickity-enabled"},classes$v={isSelected:"is-selected"};class LogoList{constructor(section){this.container=section.container,this.slideshowNav=this.container.querySelector(selectors$M.logo),this.slideshowNav&&(this.slideshowText=this.container.querySelector(selectors$M.text),this.logoSlides=this.slideshowNav.querySelectorAll(selectors$M.slide),this.resizeEvent=debounce(()=>this.setSlideshowNavState(),200),this.flkty=null,this.flktyNav=null,this.init())}init(){if(this.slideshowText){this.flkty=new FlickityFade(this.slideshowText,{fade:!0,autoPlay:!1,prevNextButtons:!1,cellAlign:"left",contain:!0,pageDots:!1,wrapAround:!1,selectedAttraction:.2,friction:.6,draggable:!1});const textSlides=this.slideshowText.querySelectorAll(selectors$M.slide);if(textSlides.length){let maxHeight=-1;textSlides.forEach(element=>{const elementHeight=parseFloat(getComputedStyle(element,null).height.replace("px",""));elementHeight>maxHeight&&(maxHeight=elementHeight)}),textSlides.forEach(element=>{const elementHeight=parseFloat(getComputedStyle(element,null).height.replace("px",""));if(elementHeight<maxHeight){const calculateMargin=Math.ceil((maxHeight-elementHeight)/2);element.style.margin=`${calculateMargin}px 0`}})}}this.logoSlides.forEach(element=>{element.addEventListener("click",e=>{const index=parseInt(e.currentTarget.getAttribute(selectors$M.slideIndex)),hasSlider=this.slideshowNav.classList.contains(selectors$M.flickityEnabled);if(this.flkty&&this.flkty.select(index),hasSlider)this.flktyNav.select(index),this.slideshowNav.classList.contains(classes$v.isSelected)||this.flktyNav.playPlayer();else{const selectedSlide=this.slideshowNav.querySelector(`.${classes$v.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$v.isSelected),e.currentTarget.classList.add(classes$v.isSelected)}})}),this.initSlideshowNav()}onUnload(){if(!this.slideshowNav)return;this.slideshowNav.classList.contains(selectors$M.flickityEnabled)&&this.flktyNav.destroy(),this.flkty&&this.flkty.destroy(),window.removeEventListener("resize",this.resizeEvent)}onBlockSelect(evt){if(!this.slideshowNav)return;const slide=this.slideshowNav.querySelector(`[${selectors$M.slideData}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(selectors$M.slideIndex));this.slideshowNav.classList.contains(selectors$M.flickityEnabled)?(this.flktyNav.select(slideIndex),this.flktyNav.stopPlayer(),this.slideshowNav.classList.add(classes$v.isSelected)):slide.dispatchEvent(new Event("click"))}onBlockDeselect(){this.slideshowNav&&this.slideshowNav.classList.contains(selectors$M.flickityEnabled)&&(this.flktyNav.playPlayer(),this.slideshowNav.classList.remove(classes$v.isSelected))}setSlideshowNavState(){const slidesCount=this.slideshowNav.querySelectorAll(selectors$M.slide).length,slideWidth=200,windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,slidesWidth=slidesCount*slideWidth,sliderInitialized=this.slideshowNav.classList.contains(selectors$M.flickityEnabled);if(slidesWidth>windowWidth){if(!sliderInitialized){const selectedSlide=this.slideshowNav.querySelector(`.${classes$v.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$v.isSelected),this.logoSlides[0].classList.add(classes$v.isSelected),this.flktyNav=new Flickity(this.slideshowNav,{autoPlay:4e3,prevNextButtons:!1,contain:!0,pageDots:!1,wrapAround:!0,watchCSS:!0,selectedAttraction:.05,friction:.8,initialIndex:0}),this.flkty&&(this.flkty.select(0),this.flktyNav.on("change",index=>this.flkty.select(index)))}}else sliderInitialized&&(this.flktyNav.destroy(),this.logoSlides[0].classList.add(classes$v.isSelected),this.flkty&&this.flkty.select(0))}initSlideshowNav(){this.setSlideshowNavState(),window.addEventListener("resize",this.resizeEvent)}}const LogoListSection={onLoad(){sections$n[this.id]=new LogoList(this)},onUnload(e){sections$n[this.id].onUnload(e)},onBlockSelect(e){sections$n[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$n[this.id].onBlockDeselect(e)}};register("logos",[LogoListSection,blockScroll]);
11const selectors$N={videoPlay:"[data-video-play]",videoPlayValue:"data-video-play"};class VideoPlay{constructor(section,selector=selectors$N.videoPlay,selectorValue=selectors$N.videoPlayValue){this.container=section,this.videoPlay=this.container.querySelectorAll(selector),this.videoPlay.length&&this.videoPlay.forEach(element=>{element.addEventListener("click",e=>{const button=e.currentTarget;if(button.hasAttribute(selectorValue)&&button.getAttribute(selectorValue).trim()!==""){e.preventDefault();const items=[{html:button.getAttribute(selectorValue)}];new LoadPhotoswipe(items),window.accessibility.lastElement=button}})})}}const videoPlay={onLoad(){new VideoPlay(this.container)}},selectors$O={video:"[data-video-id]"},sections$o={};class Video$1{constructor(section){this.section=section,this.container=section.container,this.video=this.container.querySelector(selectors$O.video),this.init()}init(){this.video&&this.container.addEventListener("touchstart",()=>{this.video.play()})}}const videoSection={onLoad(){sections$o[this.id]=new Video$1(this)}};register("featured-video",[videoSection,videoPlay,parallaxHero]),register("slideshow",[slider,parallaxHero]);const selectors$P={imagesHolder:"[data-images-holder]",imageHolder:"[data-image-holder]",imageElement:"[data-image-element]",imagesButton:"[data-images-button]",dataStartPosition:"data-start-position"},sections$p={};class CompareImages{constructor(section){this.imagesHolder=section,this.imagesHolder&&(this.imageHolder=this.imagesHolder.querySelector(selectors$P.imageHolder),this.imageElement=this.imagesHolder.querySelector(selectors$P.imageElement),this.imagesButton=this.imagesHolder.querySelector(selectors$P.imagesButton),this.startPosition=this.imagesHolder.hasAttribute(selectors$P.dataStartPosition)?this.imagesHolder.getAttribute(selectors$P.dataStartPosition):0,this.startX=0,this.x=0,this.changeValuesEvent=event=>this.changeValues(event),this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.init(),document.addEventListener("theme:resize",this.changeValuesEvent))}init(){this.changeValues(),this.imagesButton.addEventListener("mousedown",this.onStartEvent),this.imagesButton.addEventListener("touchstart",this.onStartEvent)}changeValues(event){const imagesHolderWidth=this.imagesHolder.offsetWidth,buttonWidth=this.imagesButton.offsetWidth;if((!event||event&&event.type!=="touchmove"&&event.type!=="mousemove")&&(this.imageElement.style.width=`${imagesHolderWidth}px`,this.imageHolder.style.width=`${100-parseInt(this.startPosition)}%`,this.startPosition!==0)){const newButtonPositionPixels=imagesHolderWidth*parseInt(this.startPosition)/100;this.x=newButtonPositionPixels-buttonWidth/2}this.x>imagesHolderWidth-buttonWidth?this.x=imagesHolderWidth-buttonWidth:this.x<0&&(this.x=0),this.imagesButton.style.left=`${this.x/imagesHolderWidth*100}%`,this.imageHolder.style.width=`${100-(this.x+buttonWidth/2)/imagesHolderWidth*100}%`}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=this.imagesButton.offsetLeft,this.startX=eventTouch.pageX-this.x,this.imagesHolder.addEventListener("mousemove",this.onMoveEvent),this.imagesHolder.addEventListener("mouseup",this.onStopEvent),this.imagesHolder.addEventListener("touchmove",this.onMoveEvent),this.imagesHolder.addEventListener("touchend",this.onStopEvent)}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.changeValues(event)}onStop(event){this.imagesHolder.removeEventListener("mousemove",this.onMoveEvent),this.imagesHolder.removeEventListener("mouseup",this.onStopEvent),this.imagesHolder.removeEventListener("touchmove",this.onMoveEvent),this.imagesHolder.removeEventListener("touchend",this.onStopEvent)}onUnload(){this.changeValuesEvent&&document.removeEventListener("theme:resize",this.changeValuesEvent)}}const compareImages={onLoad(){sections$p[this.id]=[],this.container.querySelectorAll(selectors$P.imagesHolder).forEach(el=>{sections$p[this.id].push(new CompareImages(el))})}
11,onUnload(){sections$p[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}};register("custom-content",[slider,videoPlay,parallaxHero,quickAddProduct,swatchGridSection,compareImages,newsletterCheckForResultSection]);var styles={};styles.basic=[],styles.light=[{featureType:"administrative",elementType:"labels",stylers:[{visibility:"simplified"},{lightness:"64"},{hue:"#ff0000"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f0f0f0"},{visibility:"simplified"}]},{featureType:"landscape.natural.landcover",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.terrain",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{lightness:"100"}]},{featureType:"poi.park",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{saturation:"-41"},{color:"#e8ede7"}]},{featureType:"poi.park",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:"-100"}]},{featureType:"road",elementType:"labels",stylers:[{lightness:"25"},{gamma:"1.06"},{saturation:"-100"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{gamma:"10.00"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.01"},{visibility:"simplified"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{gamma:"10.00"},{lightness:"100"},{weight:"0.4"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"simplified"},{weight:"0.01"},{lightness:"39"}]},{featureType:"road.local",elementType:"labels.text.stroke",stylers:[{weight:"0.50"},{gamma:"10.00"},{lightness:"100"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#cfe5ee"},{visibility:"on"}]}],styles.white_label=[{featureType:"all",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"all",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"administrative",elementType:"labels",stylers:[{gamma:"3.86"},{lightness:"100"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#cccccc"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#e4e4e4"},{visibility:"on"}]}],styles.dark_label=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"simplified"},{lightness:"-82"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{invert_lightness:!0}
11,{weight:"7.15"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17},{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}];function mapStyle(key){return styles[key]}window.theme.allMaps=window.theme.allMaps||{};let allMaps=window.theme.allMaps;window.theme.mapAPI=window.theme.mapAPI||null;class Map{constructor(section){this.container=section.container,this.mapContainer=this.container.querySelector("[data-map-container]"),this.key=this.container.getAttribute("data-api-key"),this.styleString=this.container.getAttribute("data-style")||"",this.zoomString=this.container.getAttribute("data-zoom")||14,this.address=this.container.getAttribute("data-address"),this.enableCorrection=this.container.getAttribute("data-latlong-correction"),this.lat=this.container.getAttribute("data-lat"),this.long=this.container.getAttribute("data-long"),this.key&&this.initMaps()}initMaps(){loadAPI(this.key).then(()=>this.enableCorrection==="true"&&this.lat!==""&&this.long!==""?new google.maps.LatLng(this.lat,this.long):geocodeAddressPromise(this.address)).then(center=>{const zoom=parseInt(this.zoomString,10),styles2=mapStyle(this.styleString),mapOptions={zoom,styles:styles2,center,draggable:!0,clickableIcons:!1,scrollwheel:!1,zoomControl:!1,disableDefaultUI:!0};return createMap(this.mapContainer,mapOptions)}).then(map=>{this.map=map,allMaps[this.id]=map}).catch(e=>{console.log("Failed to load Google Map"),console.log(e)})}unload(){typeof window.google<"u"&&google.maps.event.clearListeners(this.map,"resize")}}const mapSection={onLoad(){allMaps[this.id]=new Map(this)},onUnload(){typeof allMaps[this.id].unload=="function"&&allMaps[this.id].unload()}};register("map",mapSection);function loadAPI(key){if(window.theme.mapAPI===null){const urlKey=`https://maps.googleapis.com/maps/api/js?key=${key}`;window.theme.mapAPI=loadScript({url:urlKey})}return window.theme.mapAPI}function createMap(container,options){var map=new google.maps.Map(container,options),center=map.getCenter(),marker=new google.maps.Marker({map,position:center});return google.maps.event.addDomListener(window,"resize",function(){google.maps.event.trigger(map,"resize"),map.setCenter(center)}),map}function geocodeAddressPromise(address){return new Promise((resolve,reject)=>{var geocoder=new google.maps.Geocoder;geocoder.geocode({address},function(results,status){if(status=="OK"){var latLong={lat:results[0].geometry.location.lat(),lng:results[0].geometry.location.lng()};resolve(latLong)}else reject(status)})})}register("search",[quickAddProduct,swatchGridSection]);const selectors$Q={largePromo:"[data-large-promo]",largePromoInner:"[data-large-promo-inner]",trackingInner:"[data-tracking-consent-inner]",tracking:"[data-tracking-consent]",trackingAccept:"[data-confirm-cookies]",close:"[data-close-modal]",modalUnderlay:"[data-modal-underlay]",modalBody:"[data-modal-body]",newsletterPopup:"[data-newsletter]",newsletterPopupHolder:"[data-newsletter-holder]",newsletterClose:"[data-newsletter-close]",newsletterHeading:"[data-newsletter-heading]",newsletterField:"[data-newsletter-field]",promoPopup:"[data-promo-text]",newsletterForm:"[data-newsletter-form]",delayAttribite:"data-popup-delay",cookieNameAttribute:"data-cookie-name",dataTargetReferrer:"data-target-referrer"},classes$w={hide:"hide",hasValue:"has-value",success:"has-success",selected:"selected",hasBlockSelected:"has-block-selected",mobile:"mobile",desktop:"desktop"},attributes$6={enable:"data-enable"};let sections$q={};class DelayShow{constructor(holder,element,callback=null){if(this.element=element,this.delay=holder.getAttribute(selectors$Q.delayAttribite),this.isSubmitted=window.location.href.indexOf("accepts_marketing")!==-1||window.location.href.indexOf("customer_posted=true")!==-1,this.callback=callback,(this.delay==="always"||this.isSubmitted)&&this.always(),this.delay&&this.delay.includes("delayed")&&!this.isSubmitted){const seconds=this.delay.includes("_")?parseInt(this.delay.split("_")[1]):10;this.delayed(seconds)}this.delay==="bottom"&&!this.isSubmitted&&this.bottom(),this.delay==="idle"&&!this.isSubmitted&&this.idle()}always(){fadeIn(this.element,null,this.callback)}delayed(seconds=10){setTimeout(()=>{fadeIn(this.element,null,this.callback)},seconds*1e3)}bottom(){let faded=!1;window.addEventListener("scroll",()=>{window.scrollY+window.innerHeight>=document.body.clientHeight&&!faded&&(fadeIn(this.element,null,this.callback),faded=!0)})}idle(){let timer=0,idleTime=6e4;const documentEvents=["mousemove","mousedown","click","touchmove","touchstart","touchend","keydown","keypress"],windowEvents=["load","resize","scroll"],startTimer=()=>{timer=setTimeout(()=>{timer=0,fadeIn(this.element,null,this.callback)}
11,idleTime),documentEvents.forEach(eventType=>{document.addEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.addEventListener(eventType,resetTimer)})},resetTimer=()=>{timer&&clearTimeout(timer),documentEvents.forEach(eventType=>{document.removeEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.removeEventListener(eventType,resetTimer)}),startTimer()};startTimer()}}class TargetReferrer{constructor(el){if(this.el=el,this.locationPath=location.href,!this.el.hasAttribute(selectors$Q.dataTargetReferrer))return!1;this.init()}init(){this.locationPath.indexOf(this.el.getAttribute(selectors$Q.dataTargetReferrer))===-1&&!window.Shopify.designMode&&this.el.parentNode.removeChild(this.el)}}class LargePopup{constructor(el){this.popup=el,this.modal=this.popup.querySelector(selectors$Q.largePromoInner),this.modalBody=this.popup.querySelector(selectors$Q.modalBody),this.close=this.popup.querySelector(selectors$Q.close),this.underlay=this.popup.querySelector(selectors$Q.modalUnderlay),this.form=this.popup.querySelector(selectors$Q.newsletterForm),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$Q.cookieNameAttribute),"user_has_closed"),this.isTargeted=new TargetReferrer(this.popup),this.a11y=a11y,this.init()}init(){const cookieExists=this.cookie.read()!==!1,targetMobile=this.popup.classList.contains(classes$w.mobile),targetDesktop=this.popup.classList.contains(classes$w.desktop);let targetMatches=!0;if((targetMobile&&window.innerWidth>=theme.sizes.small||targetDesktop&&window.innerWidth<theme.sizes.small)&&(targetMatches=!1),!targetMatches){this.scrollUnlock();return}(!cookieExists||window.Shopify.designMode)&&(window.Shopify.designMode||new DelayShow(this.popup,this.modal,()=>this.scrollLock()),this.form&&this.form.classList.contains(classes$w.success)&&this.checkForSuccess(),this.initClosers())}checkForSuccess(){fadeIn(this.modal,null,()=>this.scrollLock()),this.cookie.write()}initClosers(){this.close.addEventListener("click",this.closeModal.bind(this)),this.underlay.addEventListener("click",this.closeModal.bind(this))}closeModal(e){e.preventDefault(),fadeOut(this.modal),this.cookie.write(),this.scrollUnlock()}scrollLock(){window.getComputedStyle(this.popup).display!=="none"&&(this.a11y.trapFocus(this.modal),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.modalBody})))}scrollUnlock(){this.a11y.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.modal,null,()=>this.scrollLock()),this.popup.classList.add(classes$w.selected),this.popup.parentNode.classList.add(classes$w.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.scrollUnlock(),this.popup.classList.remove(classes$w.selected),this.popup.parentNode.classList.remove(classes$w.hasBlockSelected))}}class Tracking{constructor(el){this.popup=el,this.modal=document.querySelector(selectors$Q.tracking),this.acceptButton=this.modal.querySelector(selectors$Q.trackingAccept),this.enable=this.modal.getAttribute(attributes$6.enable)==="true",this.showPopup=!1,window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error=>{if(error)throw error;const userCanBeTracked=window.Shopify.customerPrivacy.userCanBeTracked(),userTrackingConsent=window.Shopify.customerPrivacy.getTrackingConsent();this.showPopup=!userCanBeTracked&&userTrackingConsent==="no_interaction"&&this.enable,window.Shopify.designMode&&(this.showPopup=!0),this.init()})}init(){this.showPopup&&fadeIn(this.modal),this.clickEvents()}clickEvents(){this.acceptButton.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!0,()=>fadeOut(this.modal)),document.documentElement.style.setProperty("--cookie-bar-height","0px")}),document.addEventListener("trackingConsentAccepted",()=>{})}onBlockSelect(evt){this.popup.contains(evt.target)&&this.showPopup&&(fadeIn(this.modal),this.popup.classList.add(classes$w.selected),this.popup.parentNode.classList.add(classes$w.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.popup.classList.remove(classes$w.selected),this.popup.parentNode.classList.remove(classes$w.hasBlockSelected))}}class PromoText{constructor(el){this.popup=el,this.close=this.popup.querySelector(selectors$Q.close),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$Q.cookieNameAttribute),"user_has_closed"),this.isTargeted=new TargetReferrer(this.popup),this.init()}init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?fadeIn(this.popup):new DelayShow(this.popup,this.popup),this.clickEvents())}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.popup),this.cookie.write()})}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.popup),this.popup.classList.add(classes$w.selected),this.popup.parentNode.classList.add(classes$w.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.popup),this.popup.classList.remove(classes$w.selected),this.popup.parentNode.classList.remove(classes$w.hasBlockSelected))}}class NewsletterPopup{constructor(el){this.popup=el,this.holder=this.popup.querySelector(selectors$Q.newsletterPopupHolder),this.close=this.popup.querySelector(selectors$Q.newsletterClose),this.heading=this.popup.querySelector(selectors$Q.newsletterHeading),this.newsletterField=this.popup.querySelector(selectors$Q.newsletterField),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$Q.cookieNameAttribute),"newsletter_is_closed"),this.form=this.popup.querySelector(selectors$Q.newsletterForm),this.isTargeted=new TargetReferrer(this.popup),this.init()}init(){const cookieExists=this.cookie.read()!==!1;window.location.search.indexOf("?customer_posted=true")!==-1&&(this.delay=0),(!cookieExists||window.Shopify.designMode)&&(this.show(),this.form.classList.contains(classe
11s$w.success)&&this.checkForSuccess())}show(){window.Shopify.designMode?fadeIn(this.holder):new DelayShow(this.popup,this.holder),this.showForm(),this.inputField(),this.closePopup()}checkForSuccess(){fadeIn(this.holder),this.cookie.write()}showForm(){this.heading.addEventListener("click",event=>{event.preventDefault(),this.heading.classList.add(classes$w.hide),this.newsletterField.focus()}),this.heading.addEventListener("keyup",event=>{event.keyCode===window.theme.keyboardKeys.ENTER&&this.heading.click()})}closePopup(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.holder),this.cookie.write()})}inputField(){this.newsletterField.addEventListener("input",()=>{this.newsletterField.value!==""&&this.holder.classList.add(classes$w.hasValue,this.newsletterField.value!=="")}),this.newsletterField.addEventListener("focus",()=>{this.newsletterField.value!==""&&this.holder.classList.add(classes$w.hasValue,this.newsletterField.value!=="")}),this.newsletterField.addEventListener("focusout",()=>{setTimeout(()=>{this.holder.classList.remove(classes$w.hasValue)},2e3)})}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.holder),this.popup.classList.add(classes$w.selected),this.popup.parentNode.classList.add(classes$w.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.holder),this.popup.classList.remove(classes$w.selected),this.popup.parentNode.classList.remove(classes$w.hasBlockSelected))}}const popupSection={onLoad(){sections$q[this.id]=[],this.container.querySelectorAll(selectors$Q.largePromo).forEach(el=>{sections$q[this.id].push(new LargePopup(el))}),this.container.querySelectorAll(selectors$Q.tracking).forEach(el=>{sections$q[this.id].push(new Tracking(el))}),this.container.querySelectorAll(selectors$Q.newsletterPopup).forEach(el=>{sections$q[this.id].push(new NewsletterPopup(el))}),this.container.querySelectorAll(selectors$Q.promoPopup).forEach(el=>{sections$q[this.id].push(new PromoText(el))})},onBlockSelect(evt){sections$q[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$q[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}};register("popups",[popupSection,newsletterCheckForResultSection]);const selectors$R={loginToggle:"#AdminLoginToggle",newsletterToggle:"#NewsletterToggle",login:"#AdminLogin",signup:"#CustomerSignup",errors:".errors",contactErrors:"#contact_form .errors",loginErrors:"#login_form .errors"};class Password{constructor(section){this.container=section.container,this.loginToggle=this.container.querySelector(selectors$R.loginToggle),this.newsletterToggle=this.container.querySelector(selectors$R.newsletterToggle),this.login=this.container.querySelector(selectors$R.login),this.signup=this.container.querySelector(selectors$R.signup),this.errors=this.container.querySelector(selectors$R.errors),this.contactErrors=this.container.querySelector(selectors$R.contactErrors),this.loginErrors=this.container.querySelector(selectors$R.loginErrors),this.init()}init(){this.loginToggle.addEventListener("click",e=>{e.preventDefault(),slideDown(this.login),hideElement(this.signup),this.errors&&hideElement(this.errors)}),this.newsletterToggle.addEventListener("click",e=>{e.preventDefault(),hideElement(this.login),slideDown(this.signup),this.errors&&hideElement(this.errors)}),this.contactErrors&&(hideElement(this.login),slideDown(this.signup)),this.loginErrors&&(slideDown(this.login),hideElement(this.signup))}}const passwordSection={onLoad(){new Password(this)}};register("password-template",passwordSection),register("faq",accordions),register("list-collections",[slider,quickAddProduct,swatchGridSection,blockScroll]),register("columns-with-image",[slider,blockScroll,videoPlay]),register("newsletter",newsletterCheckForResultSection),register("before-after",[compareImages]),register("sidebar",[accordions,scrollToElement]),document.addEventListener("DOMContentLoaded",function(){load("*"),document.body.getAttribute("data-animations")==="true"&&AOS.init({once:!0,offset:0});const scrollTopButton=document.querySelector("[data-scroll-top-button]");scrollTopButton&&(scrollTopButton.addEventListener("click",()=>{window.scrollTo({top:0,left:0,behavior:"smooth"})}),document.addEventListener("theme:scroll",()=>{scrollTopButton.classList.toggle("is-visible",window.pageYOffset>window.innerHeight)})),document.addEventListener("lazyloaded",function(event){const lazyImage=event.target.parentNode;lazyImage.classList.contains("lazy-image")&&(lazyImage.style.backgroundImage="none")}),window.self!==window.top&&document.querySelector("html").classList.add("iframe"),"scrollBehavior"in document.documentElement.style||loadScript({url:window.theme.assets.smoothscroll})}),window.navigator.cookieEnabled&&(document.documentElement.className=document.documentElement.className.replace("supports-no-cookies","supp
11orts-cookies"))})(themeVendor.AOS,themeVendor.BodyScrollLock,themeVendor.themeAddresses,themeVendor.themeCurrency,themeVendor.Sqrl,themeVendor.themeImages,themeVendor.Flickity,themeVendor.FlickityFade,themeVendor.Rellax);
12//# sourceMappingURL=/cdn/shop/t/29/assets/theme.js.map?v=119526926868240263541788330149

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.