PageSourceSearch

https://toupsandco.com/cdn/shop/t/203/assets/theme.dev.js?v=174889137357660644761790288915

js toupsandco.com collected 2026-10-03 23:44:46 UTC 293,756 bytes, 16 lines download raw bytes

1/*
2 * @license
3 * Broadcast Theme (c) Invisible Themes
4 *
5 * This file is included for advanced development by
6 * Shopify Agencies.  Modified versions of the theme
7 * code are not supported by Shopify or Invisible Themes.
8 *
9 * In order to use this file you will need to change
10 * theme.js to theme.dev.js in /layout/theme.liquid
11 *
12 */(function(scrollLock,themeAddresses,themeCurrency,Rellax,Flickity,FlickityFade,themeImages){"use strict";window.theme=window.theme||{},window.theme.sizes={mobile:480,small:750,large:990,widescreen:1400},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();window.initialWindowHeight=Math.min(window.screen.height,window.innerHeight);function readHeights(){const h={};return h.windowHeight=Math.min(window.screen.height,window.innerHeight),h.footerHeight=getHeight('[data-section-type*="footer"]'),h.headerHeight=getHeight("[data-header-height]"),h.collectionNavHeight=getHeight("[data-collection-nav]"),h.logoHeight=getFooterLogoWithPadding(),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars()}function setVars(){const{windowHeight,headerHeight,logoHeight,footerHeight,collectionNavHeight}=readHeights();document.documentElement.style.setProperty("--full-height",`${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("--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`)}function resizeVars(){const{windowHeight,headerHeight,logoHeight,footerHeight,collectionNavHeight}=readHeights(),currentScreenOrientation=getScreenOrientation();(currentScreenOrientation!==screenOrientation||window.innerWidth>window.theme.sizes.mobile)&&(document.documentElement.style.setProperty("--full-height",`${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("--collection-nav-height",`${collectionNavHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}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`)}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}let isCompleted=!1,docComplete=!1;function preloadImages(){document.onreadystatechange=()=>{document.readyState==="complete"&&(docComplete=!0,initImagesPreloader())},requestIdleCallback(initImagesPreloader)}function initImagesPreloader(){setTimeout(()=>{if(isCompleted)return;if(!docComplete){initImagesPreloader();return}const lazyImages=document.querySelectorAll('img[loading="lazy"]');
12lazyImages.length&&lazyImages.forEach(image=>{}),isCompleted=!0},3e3)}function debounce(fn,time){let timeout;return function(){if(fn){const functionCall=()=>fn.apply(this,arguments);clearTimeout(timeout),timeout=setTimeout(functionCall,time)}}}function getWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function getWindowHeight(){return window.innerHeight||document.documentElement.clientHeight||document.body.clientHeight}function isDesktop(){return getWindowWidth()>=window.theme.sizes.small}function isMobile(){return getWindowWidth()<window.theme.sizes.small}let lastWindowWidth=getWindowWidth(),lastWindowHeight=getWindowHeight();function dispatch$1(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),lastWindowWidth!==getWindowWidth()&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),lastWindowWidth=getWindowWidth()),lastWindowHeight!==getWindowHeight()&&(document.dispatchEvent(new CustomEvent("theme:resize:height",{bubbles:!0})),lastWindowHeight=getWindowHeight())}function resizeListener(){window.addEventListener("resize",debounce(function(){dispatch$1()},50))}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimer=0;function dispatch(){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){setTimeout(()=>{scrollLockTimer&&clearTimeout(scrollLockTimer),scrollLock.disablePageScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")})}function unlock(e){const timeout=e.detail;timeout?scrollLockTimer=setTimeout(removeScrollLock,timeout):removeScrollLock()}function removeScrollLock(){scrollLock.clearQueueScrollLocks(),scrollLock.enablePageScroll(),document.documentElement.removeAttribute("data-scroll-locked")}function scrollListener(){let timeout;window.addEventListener("scroll",function(){timeout&&window.cancelAnimationFrame(timeout),timeout=window.requestAnimationFrame(function(){dispatch()})},{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")}),reloadSubscriptionScripts()}function reloadSubscriptionScripts(){const buyBoxWidgets=document.querySelectorAll(".product-quick-add__form"),stayAIWidget=[...buyBoxWidgets].filter(widget=>widget.querySelector(".rtx-subscription"));!stayAIWidget||stayAIWidget.length<=0||[...buyBoxWidgets].forEach(widget=>{widget.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})})}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 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"),toggleElement=document.querySelector(`#${toggleID}`),removeExpandingClass=()=>{toggleElement.classList.remove("expanding"),toggleElement.removeEventListener("transitionend",removeExpandingClass)},addExpandingClass=()=>{toggleElement.classList.add("expanding"),toggleElement.removeEventListener("transitionstart",addExpandingClass)};toggleElement.addEventListener("transitionstart",addExpandingClass),toggleElement.addEventListener("transitionend",removeExpandingClass),toggleElement.classList.toggle("expanded")})})}function loading(){document.body.classList.add("is-loaded")}const classes$H={loading:"is-loading"},selectors$Y={img:"img.is-loading"};function loadedImagesEventHook(){document.addEventListener("load",e=>
12{e.target.tagName=="IMG"&&e.target.classList.contains(classes$H.loading)&&(e.target.classList.remove(classes$H.loading),e.target.parentNode.classList.remove(classes$H.loading))},!0)}function removeLoadingClassFromLoadedImages(container){container.querySelectorAll(selectors$Y.img).forEach(img=>{img.complete&&(img.classList.remove(classes$H.loading),img.parentNode.classList.remove(classes$H.loading))})}function isVisible(el){var style=window.getComputedStyle(el);return style.display!=="none"&&style.visibility!=="hidden"}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)&&isVisible(element))})}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.code==="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!="string")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]+">
12"+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 selectors$X={inputSearch:'input[type="search"]',focusedElements:'[aria-selected="true"] a',resetButton:'button[type="reset"]'},classes$G={hidden:"hidden"};class HeaderSearchForm extends HTMLElement{constructor(){super(),this.input=this.querySelector(selectors$X.inputSearch),this.resetButton=this.querySelector(selectors$X.resetButton),this.input&&(this.input.form.addEventListener("reset",this.onFormReset.bind(this)),this.input.addEventListener("input",debounce(event=>{this.onChange(event)},300).bind(this)))}toggleResetButton(){const resetIsHidden=this.resetButton.classList.contains(classes$G.hidden);this.input.value.length>0&&resetIsHidden?this.resetButton.classList.remove(classes$G.hidden):this.input.value.length===0&&!resetIsHidden&&this.resetButton.classList.add(classes$G.hidden)}onChange(){this.toggleResetButton()}shouldResetForm(){return!document.querySelector(selectors$X.focusedElements)}onFormReset(event){event.preventDefault(),this.shouldResetForm()&&(this.input.value="",this.toggleResetButton(),event.target.querySelector(selectors$X.inputSearch).focus())}}customElements.define("header-search-form",HeaderSearchForm);const selectors$W={allVisibleElements:'[role="option"]',ariaSelected:'[aria-selected="true"]',header:"[data-header-height]",popularSearches:"[data-popular-searches]",predictiveSearch:"predictive-search",predictiveSearchResults:"[data-predictive-search-results]",predictiveSearchStatus:"[data-predictive-search-status]",searchInput:'input[type="search"]',searchPopdown:"[data-popdown]",searchResultsLiveRegion:"[data-predictive-search-live-region-count-value]",searchResultsGroupsWrapper:"[data-search-results-groups-wrapper]",searchForText:"[data-predictive-search-search-for-text]",sectionPredictiveSearch:"#shopify-section-predictive-search",selectedLink:'[aria-selected="true"] a',selectedOption:'[aria-selected="true"] a, button[aria-selected="true"]'};class PredictiveSearch extends HeaderSearchForm{constructor(){super(),this.a11y=a11y,this.abortController=new AbortController,this.allPredictiveSearchInstances=document.querySelectorAll(selectors$W.predictiveSearch),this.cachedResults={},this.input=this.querySelector(selectors$W.searchInput),this.isOpen=!1,this.predictiveSearchResults=this.querySelector(selectors$W.predictiveSearchResults),this.searchPopdown=this.closest(selectors$W.searchPopdown),this.popularSearches=this.searchPopdown?.querySelector(selectors$W.popularSearches),this.searchTerm=""}connectedCallback(){this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.form.addEventListener("submit",this.onFormSubmit.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.addEventListener("keyup",this.onKeyup.bind(this)),this.addEventListener("keydown",this.onKeydown.bind(this))}getQuery(){return this.input.value.trim()}onChange(){super.onChange();const newSearchTerm=this.getQuery();if((!this.searchTerm||!newSearchTerm.startsWith(this.searchTerm))&&this.querySelector(selectors$W.searchResultsGroupsWrapper)?.remove(),this.updateSearchForTerm(this.searchTerm,newSearchTerm),this.searchTerm=newSearchTerm,!this.searchTerm.length){this.reset();return}this.getSearchResults(this.searchTerm)}onFormSubmit(event){(!this.getQuery().length||this.querySelector(selectors$W.selectedLink))&&event.preventDefault()}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&(this.searchTerm="",this.abortController.abort(),this.abortController=new AbortController,this.closeResults(!0))}shouldResetForm(){return!document.querySelector(selectors$W.selectedLink)}onFocus(){const currentSearchTerm=this.getQuery();currentSearchTerm.length&&(this.searchTerm!==currentSearchTerm?this.onChange():this.getAttribute("results")==="true"?this.open():this.getSearchResults(this.searchTerm))}onFocusOut(){setTimeout(()=>{this.contains(document.activeElement)||this.close()})}onKeyup(event){switch(this.getQuery().length||this.close(!0),event.preventDefault(),event.code){case"ArrowUp":this.switchOption("up");break;case"ArrowDown":this.switchOption("down");break;case"Enter":this.selectOption();break}}onKeydown(event){(event.code==="ArrowUp"||event.code==="ArrowDown")&&event.preventDefault()}updateSearchForTerm(previousTerm,newTerm){const searchForTextElement=this.querySelector(selectors$W.searchForText),currentButtonText=searchForTextElement?.innerText;if(currentButtonText){if(currentButtonText.match(new RegExp(previousTerm,"g"))?.length>1)return;const newButtonText=currentButtonText.replace(previousTerm,newTerm);searchForTextElement.innerText=newButtonText}}switchOption(direction){if(!this.getAttribute("open"))return;const moveUp=direction==="up",selectedElement=this.querySelector(selectors$W.ariaSelected),allVisibleElements=Array.from(this.querySelectorAll(selectors$W.allVisibleElements)).filter(element=>element.offsetParent!==null);let activeElementIndex=0;if(moveUp&&!selectedElement)return;let selectedElementIndex=-1,i=0;for(;selectedElementIndex===-1&&i<=allVisibleElements.length;)allVisibleElements[i]===selectedElement&&(selectedElementIndex=i),i++;if(this.statusElement.textContent="",!moveUp&&selectedElement?activeElementIndex=selectedElementIndex===allVisibleElements.length-1?0:selectedElementIndex+1:moveUp&&(activeElementIndex=selectedElementIndex===0?allVisibleElements.length-1:selectedElementIndex-1),activeElementIndex===selectedElementIndex)return;const activeElement=allVisibleElements[activeElementIndex];activeElement.setAttribute("aria-selected",!0),selectedElement&&selectedElement.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",activeElement.id)}selectOption(){const selectedOption=this.querySelector(selectors$W.selectedOption);selectedOption&&selectedOption.click()}getSearchResults(searchTerm){const queryKey=searchTerm.replace(" ","-").toLowerCase();if(this.setLiveRegionLoadingState(),this.cachedResults[queryKey]){this.renderSearchResults(this.cachedResults[queryKey]);return}fetch(`${theme.routes.predictive_search_url}?q=${encodeURIComponent(searchTerm)}&section_id=predictive-search`,{signal:this.abortController.signal}).then(response=>{if(!response.ok){var error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector(selectors$W.sectionPredictiveSearch).innerHTML;
12this.allPredictiveSearchInstances.forEach(predictiveSearchInstance=>{predictiveSearchInstance.cachedResults[queryKey]=resultsMarkup}),this.renderSearchResults(resultsMarkup)}).catch(error=>{if(error?.code!==20)throw this.close(),error})}setLiveRegionLoadingState(){this.statusElement=this.statusElement||this.querySelector(selectors$W.predictiveSearchStatus),this.loadingText=this.loadingText||this.getAttribute("data-loading-text"),this.setLiveRegionText(this.loadingText),this.setAttribute("loading",!0)}setLiveRegionText(statusText){this.statusElement.setAttribute("aria-hidden","false"),this.statusElement.textContent=statusText,setTimeout(()=>{this.statusElement.setAttribute("aria-hidden","true")},1e3)}renderSearchResults(resultsMarkup){this.predictiveSearchResults.innerHTML=resultsMarkup,this.setAttribute("results",!0),this.setLiveRegionResults(),this.open()}setLiveRegionResults(){this.removeAttribute("loading"),this.setLiveRegionText(this.querySelector(selectors$W.searchResultsLiveRegion).textContent)}open(){this.setAttribute("open",!0),this.input.setAttribute("aria-expanded",!0),this.isOpen=!0}close(clearSearchTerm=!1){this.closeResults(clearSearchTerm),this.isOpen=!1}closeResults(clearSearchTerm=!1){clearSearchTerm&&(this.input.value="",this.removeAttribute("results"));const selected=this.querySelector(selectors$W.ariaSelected);selected&&selected.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",""),this.removeAttribute("loading"),this.removeAttribute("open"),this.input.setAttribute("aria-expanded",!1),this.resultsMaxHeight=!1,this.predictiveSearchResults?.removeAttribute("style")}reset(){this.predictiveSearchResults.innerHTML="",this.input.val="",this.a11y.removeTrapFocus(),this.popularSearches&&(this.input.dispatchEvent(new Event("blur",{bubbles:!1})),this.a11y.trapFocus(this.searchPopdown,{elementToFocus:this.input}))}}const selectors$V={popoutList:"[data-popout-list]",popoutToggle:"[data-popout-toggle]",popoutToggleText:"[data-popout-toggle-text]",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",productGridImage:"[data-product-image]",productGrid:"[data-product-grid-item]",section:"[data-section-type]"},classes$F={listVisible:"popout-list--visible",visible:"is-visible",active:"is-active",selectPopoutTop:"select-popout--top"},attributes$u={ariaExpanded:"aria-expanded",ariaCurrent:"aria-current",dataValue:"data-value",popoutToggleText:"data-popout-toggle-text",submit:"submit"};class Popout extends HTMLElement{constructor(){super()}connectedCallback(){this.popoutList=this.querySelector(selectors$V.popoutList),this.popoutToggle=this.querySelector(selectors$V.popoutToggle),this.popoutToggleText=this.querySelector(selectors$V.popoutToggleText),this.popoutInput=this.querySelector(selectors$V.popoutInput),this.popoutOptions=this.querySelectorAll(selectors$V.popoutOptions),this.productGrid=this.popoutList.closest(selectors$V.productGrid),this.fireSubmitEvent=this.hasAttribute(attributes$u.submit),this.popupToggleFocusoutEvent=evt=>this.onPopupToggleFocusout(evt),this.popupListFocusoutEvent=evt=>this.onPopupListFocusout(evt),this.popupToggleClickEvent=evt=>this.onPopupToggleClick(evt),this.keyUpEvent=evt=>this.onKeyUp(evt),this.bodyClickEvent=evt=>this.onBodyClick(evt),this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popupListMaxWidth()}onPopupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(attributes$u.ariaExpanded)==="true";if(this.productGrid){const productGridItemImage=this.productGrid.querySelector(selectors$V.productGridImage);productGridItemImage&&productGridItemImage.classList.toggle(classes$F.visible,!ariaExpanded),this.popoutList.style.maxHeight=`${Math.abs(this.popoutToggle.getBoundingClientRect().bottom-this.productGrid.getBoundingClientRect().bottom)}px`}evt.currentTarget.setAttribute(attributes$u.ariaExpanded,!ariaExpanded),this.popoutList.classList.toggle(classes$F.listVisible),this.popupListMaxWidth(),this.toggleListPosition(),document.body.addEventListener("click",this.bodyClickEvent)}onPopupToggleFocusout(evt){this.contains(evt.relatedTarget)||this._hideList()}onPopupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);
12this.popoutList.classList.contains(classes$F.listVisible)&&!childInFocus&&this._hideList()}toggleListPosition(){const ariaExpanded=this.querySelector(selectors$V.popoutToggle).getAttribute(attributes$u.ariaExpanded)==="true",windowHeight=window.innerHeight,bottom=this.popoutList.getBoundingClientRect().bottom,removeTopClass=()=>{this.classList.remove(classes$F.selectPopoutTop),this.popoutList.removeEventListener("transitionend",removeTopClass)};ariaExpanded?windowHeight<bottom&&this.classList.add(classes$F.selectPopoutTop):this.popoutList.addEventListener("transitionend",removeTopClass)}popupListMaxWidth(){this.popoutList.style.maxWidth=`${parseInt(document.body.clientWidth-this.popoutList.getBoundingClientRect().left)}px`}popupOptionsClick(evt){if(evt.target.closest(selectors$V.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(attributes$u.dataValue)&&(attrValue=evt.currentTarget.getAttribute(attributes$u.dataValue)),this.popoutInput.value=attrValue,this.fireSubmitEvent)this._submitForm(attrValue);else{const currentTarget=evt.currentTarget.parentElement,listTargetElement=this.popout
12List.querySelector(`.${classes$F.active}`),targetAttribute=this.popoutList.querySelector(`[${attributes$u.ariaCurrent}]`);this.popoutInput.dispatchEvent(new Event("change")),listTargetElement&&(listTargetElement.classList.remove(classes$F.active),currentTarget.classList.add(classes$F.active)),this.popoutInput.name=="quantity"&&!currentTarget.nextSibling&&this.classList.add(classes$F.active),targetAttribute&&targetAttribute.hasAttribute(`${attributes$u.ariaCurrent}`)&&(targetAttribute.removeAttribute(`${attributes$u.ariaCurrent}`),evt.currentTarget.setAttribute(`${attributes$u.ariaCurrent}`,"true")),attrValue!==""&&(this.popoutToggleText.textContent=attrValue,this.popoutToggleText.hasAttribute(attributes$u.popoutToggleText)&&this.popoutToggleText.getAttribute(attributes$u.popoutToggleText)!==""&&this.popoutToggleText.setAttribute(attributes$u.popoutToggleText,attrValue)),this.onPopupToggleFocusout(evt),this.onPopupListFocusout(evt)}}}onKeyUp(evt){evt.code==="Escape"&&(this._hideList(),this.popoutToggle.focus())}onBodyClick(evt){const isOption=this.contains(evt.target);this.popoutList.classList.contains(classes$F.listVisible)&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClickEvent)}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("click",evt=>this.popupOptionsClick(evt))})}_onFocusOut(){this.addEventListener("keyup",this.keyUpEvent),this.popoutToggle.addEventListener("focusout",this.popupToggleFocusoutEvent),this.popoutList.addEventListener("focusout",this.popupListFocusoutEvent)}_submitForm(){const form=this.closest("form");form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$F.listVisible),this.popoutToggle.setAttribute(attributes$u.ariaExpanded,!1),this.toggleListPosition(),document.body.removeEventListener("click",this.bodyClickEvent)}}class QuantityCounter extends HTMLElement{constructor(){super()}connectedCallback(){this.input=this.querySelector("input"),this.changeEvent=ne
12w Event("change",{bubbles:!0}),this.buttonClickEvent=this.onButtonClick.bind(this),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.buttonClickEvent))}onButtonClick(event){event.preventDefault();const previousValue=this.input.value,button=event.target.nodeName=="BUTTON"?event.target:event.target.closest("button");button.name==="increase"&&this.input.stepUp(),button.name==="decrease"&&this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.name=="updates[]"&&this.updateCart()}updateCart(){this.quantityValue!==""&&this.dispatchEvent(new CustomEvent("theme:cart:update",{bubbles:!0,detail:{id:this.input.dataset.id,quantity:this.input.value}}))}}const selectors$U={aos:"[data-aos]:not(.aos-animate)",aosAnchor:"[data-aos-anchor]"},classes$E={aosAnimate:"aos-animate"},observerConfig={attributes:!1,childList:!0,subtree:!0},mutationCallback=mutationList=>{for(const mutation of mutationList)if(mutation.type==="childList"){const element=mutation.target,elementsToAnimate=element.querySelectorAll(selectors$U.aos),anchors=element.querySelectorAll(selectors$U.aosAnchor);elementsToAnimate.length&&elementsToAnimate.forEach(element2=>{aosItemObserver.observe(element2)}),anchors.length&&initAnchorObservers(anchors)}},aosItemObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{entry.isIntersecting&&(entry.target.classList.add(classes$E.aosAnimate),observer.unobserve(entry.target))})},{root:null,rootMargin:"0px",threshold:[0,.1,.25,.5,.75,1]}),aosAnchorObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.intersectionRatio>.1){const elementsToAnimate=entry.target.querySelectorAll(selectors$U.aos);elementsToAnimate.length&&elementsToAnimate.forEach(item=>{item.classList.add(classes$E.aosAnimate)}),observer.unobserve(entry.target)}})},{root:null,rootMargin:"0px",threshold:[.1,.25,.5,.75,1]});function bodyMutationObserver(){new MutationObserver(mutationCallback).observe(document.body,observerConfig)}function elementsIntersectionObserver(){const elementsToAnimate=document.querySelectorAll(selectors$U.aos);elementsToAnimate.length&&elementsToAnimate.forEach(element=>{aosItemObserver.observe(element)})}function anchorsIntersectionObserver(){const anchors=document.querySelectorAll(selectors$U.aosAnchor);anchors.length&&initAnchorObservers(anchors)}function initAnchorObservers(anchors){let anchorContainers=[];anchors.length&&anchors.forEach(anchor=>{const containerId=anchor.dataset.aosAnchor;if(containerId&&anchorContainers.indexOf(containerId)===-1){const container=document.querySelector(containerId);container&&(aosAnchorObserver.observe(container),anchorContainers.push(containerId))}})}function initAnimations(){elementsIntersectionObserver(),anchorsIntersectionObserver(),bodyMutationObserver()}class DeferredImage extends HTMLElement{constructor(){super()}connectedCallback(){this.closest(".shopify-section").addEventListener("mouseover",()=>{this.classList.remove("hidden")},{once:!0})}}const selectors$T={deferredMediaButton:"[data-deferred-media-button]",media:"video, model-viewer, iframe",youtube:'[data-host="youtube"]',vimeo:'[data-host="vimeo"]'};class DeferredMedia extends HTMLElement{constructor(){super(),this.querySelector(selectors$T.deferredMediaButton)?.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(this.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div"),templateContent=this.querySelector("template").content.firstElementChild.cloneNode(!0);content.appendChild(templateContent),this.setAttribute("loaded",!0);const mediaElement=this.appendChild(content.querySelector(selectors$T.media));focus&&mediaElement.focus(),mediaElement.nodeName=="VIDEO"&&mediaElement.getAttribute("autoplay")&&mediaElement.play()}}pauseAllMedia(){document.querySelectorAll(selectors$T.youtube).forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(selectors$T.vimeo).forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}}window.requestIdleCallback=window.requestIdleCallback||function(cb){var start=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(id){clearTimeout(id)},window.theme.settings.enableAnimations&&initAnimations(),resizeListener(),scrollListener(),isTouch(),setVars(),loadedImagesEventHook(),window.addEventListener("DOMContentLoaded",()=>{setVarsOnResize(),ariaToggle(document),floatLabels(document),wrapElements(document),removeLoadingClassFromLoadedImages(document),loading(),window.fastNetworkAndCPU&&preloadImages(),requestIdleCallback(()=>{Shopify.visualPreviewMode&&document.documentElement.classList.add("preview-mode")})}),document.addEventListener("shopify:section:load",e=>{const container=e.target;floatLabels(container),wrapElements(container),ariaToggle(document),setVarsOnResize()}),customElements.get("popout-select")||customElements.define("popout-select",Popout),customElements.get("quantity-counter")||customElements.define("quantity-counter",QuantityCounter),customElements.get("predictive-search")||customElements.define("predictive-search",PredictiveSearch),customElements.get("deferred-image")||customElements.define("deferred-image",DeferredImage),customElements.get("deferred-media")||customElements.define("deferred-media",DeferredMedia);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 today=new Date,expiresDate=new Date;expiresDate.setTime(today.getTime()+36e5*24*90);const cookie={configuration:{expires:expiresDate.toGMTString(),path:"/",domain:window.location.hostname,sameSite:"none",secure:!0},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}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`},read:function(){let recentlyViewed=[],cookieValue=null;return 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(" ")),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(error){console.log(error)}},moveAlong=(shown,productHandleQueue2,wrapper2,section)=>{productHandleQueue2.length&&shown<config.howManyToShow?fetch(`${window.theme.routes.root}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){let 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];config.handle&&(productHandle=config.handle);const 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())})()};function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;const selectors$S={templateNoShipping:"[data-template-no-shipping]",getRates:".get-rates",addressContainer:"#address_container",addressCountry:"#address_country",addressProvince:"#address_province",addressZip:"#address_zip",wrapper:"#wrapper-response",template:"#shipping-calculator-response-template"},attributes$t={templateNoShipping:"data-template-no-shipping",default:"data-default"},classes$D={error:"error",center:"center",success:"success",disabled:"disabled",getRatesTrigger:"get-rates--trigger"},texts={error:"Error : country is not supported.",feedback:"We do not ship to this destination.",feedbackLabel:"Error : "};class ShippingCalculator extends HTMLElement{constructor(){super(),this.getRatesButton=this.querySelector(selectors$S.getRates),this.fieldsContainer=this.querySelector(selectors$S.addressContainer),this.selectCountry=this.querySelector(selectors$S.addressCountry),this.selectProvince=this.querySelector(selectors$S.addressProvince),this.template=this.querySelector(selectors$S.template),this.wrapper=this.querySelector(selectors$S.wrapper),this.onCountryChangeEvent=()=>this.onCountryChange(),this.onButtonClickEvent=()=>this.onButtonClick()}connectedCallback(){const htmlEl=document.querySelector("html");let locale="en";if(htmlEl.hasAttribute("lang")&&htmlEl.getAttribute("lang")!==""&&(locale=htmlEl.getAttribute("lang")),this.fieldsContainer&&themeAddresses.AddressForm(this.fieldsContainer,locale,{shippingCountriesOnly:!0}),this.selectCountry&&this.selectCountry.hasAttribute(attributes$t.default)&&this.selectProvince&&this.selectProvince.hasAttribute(attributes$t.default)&&this.selectCountry.addEventListener("change",this.onCountryChangeEvent),this.getRatesButton&&(this.getRatesButton.addEventListener("click",this.onButtonClickEvent),theme.settings.customerLoggedIn&&this.getRatesButton.classList.contains(classe
12s$D.getRatesTrigger))){const zipElem=document.querySelector(selectors$S.addressZip);zipElem&&zipElem.value&&this.getRatesButton.dispatchEvent(new Event("click"))}}disconnectedCallback(){this.selectCountry&&this.selectCountry.hasAttribute(attributes$t.default)&&this.selectProvince&&this.selectProvince.hasAttribute(attributes$t.default)&&this.selectCountry.removeEventListener("change",this.onCountryChangeEvent),this.getRatesButton&&this.getRatesButton.removeEventListener("click",this.onButtonClickEvent)}onCountryChange(){this.selectCountry.removeAttribute(attributes$t.default),this.selectProvince.removeAttribute(attributes$t.default)}onButtonClick(){for(this.disableButtons();this.wrapper.firstChild;)this.wrapper.removeChild(this.wrapper.firstChild);hideElement(this.wrapper);const shippingAddress={};let elemCountryVal=this.selectCountry.value,elemProvinceVal=this.selectProvince.value;const elemCountryData=this.selectCountry.getAttribute(attributes$t.default);elemCountryVal===""&&elemCountryData&&elemCountryData!==""&&(elemCountryVal=elemCountryData);const elemProvinceData=this.selectProvince.getAttribute(attributes$t.default);elemProvinceVal===""&&elemProvinceData&&elemProvinceData!==""&&(elemProvinceVal=elemProvinceData),shippingAddress.zip=document.querySelector(selectors$S.addressZip).value||"",shippingAddress.country=elemCountryVal||"",shippingAddress.province=elemProvinceVal||"",this.getCartShippingRatesForDestination(shippingAddress)}formatRate(cents){return cents==="0.00"?window.theme.strings.free:themeCurrency.formatMoney(cents,theme.moneyFormat)}render(response){if(this.template&&this.wrapper){this.wrapper.innerHTML="";let ratesList="",ratesText="",successClass=`${classes$D.error} ${classes$D.center}`,markup=this.template.innerHTML;const rateRegex=/[^[\]]+(?=])/g;if(response.rates&&response.rates.length){let rateTemplate=rateRegex.exec(markup)[0];
12response.rates.forEach(rate=>{let rateHtml=rateTemplate;rateHtml=rateHtml.replace(/\|\|rateName\|\|/,rate.name),rateHtml=rateHtml.replace(/\|\|ratePrice\|\|/,this.formatRate(rate.price)),ratesList+=rateHtml})}if(response.success){successClass=`${classes$D.success} ${classes$D.center}`;const createdNewElem=document.createElement("div");createdNewElem.innerHTML=this.template.innerHTML;const noShippingElem=createdNewElem.querySelector(selectors$S.templateNoShipping);response.rates.length<1&&noShippingElem&&(ratesText=noShippingElem.getAttribute(attributes$t.templateNoShipping))}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),this.wrapper.innerHTML+=markup,fadeIn(this.wrapper)}}enableButtons(){this.getRatesButton.removeAttribute("disabled"),this.getRatesButton.classList.remove(classes$D.disabled),this.getRatesButton.textContent=theme.strings.shippingCalcSubmitButton}disableButtons(){this.getRatesButton.setAttribute("disabled","disabled"),this.getRatesButton.classList.add(classes$D.disabled),this.getRatesButton.textContent=theme.strings.shippingCalcSubmitButtonDisabled}getCartShippingRatesForDestination(shippingAddress){const encodedShippingAddressData=encodeURI(getUrlString({shipping_address:shippingAddress})),url=`${theme.routes.cart_url}/shipping_rates.json?${encodedShippingAddressData}`;fetch(url).then(this.handleErrors).then(response=>response.text()).then(response=>{const rates=JSON.parse(response).shipping_rates;this.onCartShippingRatesUpdate(rates,shippingAddress)}).catch(error=>{this.onError(error.json)})}fullMessagesFromErrors(errors){const fullMessages=[];for(const error in errors)for(const message of errors[error])fullMessages.push(message);return fullMessages}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}onError(data){this.enableButtons();let feedback="";data.message?feedback=data.message+"("+data.status+"): "+data.description:feedback=texts.feedbackLabel+this.fullMessagesFromErrors(data).join("; "),feedback===texts.error&&(feedback=texts.feedback),this.render({rates:[],errorFeedback:feedback,success:!1})}onCartShippingRatesUpdate(rates,shippingAddress){this.enableButtons();let readableAddress="";shippingAddress.zip&&(readableAddress+=shippingAddress.zip+", "),shippingAddress.province&&(readableAddress+=shippingAddress.province+", "),readableAddress+=shippingAddress.country,this.render({rates,address:readableAddress,success:!0})}}const throttle=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now=Date.now();next=clearTimeout(next),!prev2||now-prev2>=wait?(fn.apply(null,args),prev2=now):next=setTimeout(invokeFn.bind(null,...args),wait-(now-prev2))}},classes$C={animated:"is-animated",active:"is-active",added:"is-added",disabled:"is-disabled",error:"has-error",headerStuck:"js__header__stuck",hidden:"is-hidden",hiding:"is-hiding",loading:"is-loading",open:"is-open",removed:"is-removed",success:"is-success",visible:"is-visible",focused:"is-focused",expanded:"is-expanded",updated:"is-updated",variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable"},selectors$R={apiContent:"[data-api-content]",apiLineItems:"[data-api-line-items]",apiUpsellItems:"[data-api-upsell-items]",apiCartPrice:"[data-api-cart-price]",animation:"[data-animation]",additionalCheckoutButtons:".additional-checkout-buttons",buttonHolder:"[data-foot-holder]",buttonSkipUpsellProduct:"[data-skip-upsell-product]",cartBarAdd:"[data-add-to-cart-bar]",cartCloseError:"[data-cart-error-close]",cartDrawer:"[data-cart-drawer]",cartDrawerClose:"[data-cart-drawer-close]",cartEmpty:"[data-cart-empty]",cartErrors:"[data-cart-errors]",cartItemRemove:"[data-item-remove]",cartPage:"[data-cart-page]",cartForm:"[data-cart-form]",cartTermsCheckbox:"[data-cart-acceptance-checkbox]",cartCheckoutButtonWrapper:"[data-cart-checkout-buttons]",cartCheckoutButton:"[data-cart-checkout-button]",cartToggle:"[data-cart-toggle]",cartTotal:"[data-cart-total]",errorMessage:"[data-error-message]",formCloseError:"[data-close-error]",formErrorsContainer:"[data-cart-errors-container]",formWrapper:"[data-form-wrapper]",freeShipping:"[data-free-shipping]",freeShippingGraph:"[data-progress-graph]",freeShippingProgress:"[data-progress-bar]",headerWrapper:"[data-header-wrapper]",item:"[data-item]",itemsHolder:"[data-items-holder]",leftToSpend:"[data-left-to-spend]",navDrawer:"[data-drawer]",outerSection:"[data-section-id]",priceHolder:"[data-cart-price-holder]",quickAddHolder:"[data-quick-add-h
12older]",quickAddModal:"[data-quick-add-modal]",qtyInput:'input[name="updates[]"]',upsellProductsHolder:"[data-upsell-products]",upsellWidget:"[data-upsell-widget]",termsErrorMessage:"[data-terms-error-message]"},attributes$s={cartToggle:"data-cart-toggle",cartTotal:"data-cart-total",disabled:"disabled",drawerUnderlay:"data-drawer-underlay",freeShipping:"data-free-shipping",freeShippingLimit:"data-free-shipping-limit",item:"data-item",itemIndex:"data-item-index",itemTitle:"data-item-title",quickAddHolder:"data-quick-add-holder",quickAddVariant:"data-quick-add-variant"};class CartDrawer{constructor(){window.location.pathname.endsWith("/password")||this.init()}init(){this.cartPage=document.querySelector(selectors$R.cartPage),this.cartForm=document.querySelector(selectors$R.cartForm),this.cartDrawer=document.querySelector(selectors$R.cartDrawer),this.cartDrawerClose=document.querySelector(selectors$R.cartDrawerClose),this.cartEmpty=document.querySelector(selectors$R.cartEmpty),this.cartTermsCheckbox=document.querySelector(selectors$R.cartTermsCheckbox),this.cartCheckoutButtonWrapper=document.querySelector(selectors$R.cartCheckoutButtonWrapper),this.cartCheckoutButton=document.querySelector(selectors$R.cartCheckoutButton),this.buttonHolder=document.querySelector(selectors$R.buttonHolder),this.itemsHolder=document.querySelector(selectors$R.itemsHolder),this.priceHolder=document.querySelector(selectors$R.priceHolder),this.items=document.querySelectorAll(selectors$R.item),this.cartTotal=document.querySelector(selectors$R.cartTotal),this.freeShipping=document.querySelectorAll(selectors$R.freeShipping),this.cartErrorHolder=document.querySelector(selectors$R.cartErrors),this.cartCloseErrorMessage=document.querySelector(selectors$R.cartCloseError),this.headerWrapper=document.querySelector(selectors$R.headerWrapper),this.accessibility=a11y,this.navDrawer=document.querySelector(selectors$R.navDrawer),this.upsellProductsHolder=document.querySelector(selectors$R.upsellProductsHolder),this.subtotal=window.theme.subtotal,this.cart=this.cartDrawer||this.cartPage,this.cartAddEvent=this.cartAddEvent.bind(this),this.addToCart=this.addToCart.bind(this),this.updateProgress=this.updateProgress.bind(this),document.addEventListener("theme:cart:add",this.cartAddEvent),document.addEventListener("theme:announcement:init",this.updateProgress),this.skipUpsellProductsArray=[],this.skipUpsellProductEvent(),this.checkSkippedUpsellProductsFromStorage(),this.toggleCartUpsellWidgetVisibility(),this.circumference=28*Math.PI,this.freeShippingLimit=this.freeShipping.length?Number(this.freeShipping[0].getAttribute(attributes$s.freeShippingLimit))*100*window.Shopify.currency.rate:0,this.freeShippingMessageHandle(this.subtotal),this.updateProgress(),this.cart&&(this.build=this.build.bind(this),this.updateCart=this.updateCart.bind(this),this.productAddCallback=this.productAddCallback.bind(this),this.openCartDrawer=this.openCartDrawer.bind(this),this.closeCartDrawer=this.closeCartDrawer.bind(this),this.toggleCartDrawer=this.toggleCartDrawer.bind(this),this.openCartDrawerOnProductAdded=this.openCartDrawerOnProductAdded.bind(this),this.animateItems=this.animateItems.bind(this),this.showAnimatedItems=this.showAnimatedItems.bind(this),this.formSubmitHandler=throttle(this.formSubmitHandler.bind(this),50),this.cartPage&&this.showAnimatedItems(),this.hasItemsInCart=this.hasItemsInCart.bind(this),this.cartCount=this.getCartItemCount(),this.toggleClassesOnContainers=this.toggleClassesOnContainers.bind(this),this.totalItems=this.items.length,this.cartDrawerIsOpen=!1,this.cartDrawerEnabled=theme.settings.cartDrawerEnabled,this.cartUpdateFailed=!1,this.cartEvents(),this.cartToggleEvents(),this.cartRemoveEvents(),this.cartUpdateEvents(),document.addEventListener("theme:cart:toggle",this.toggleCartDrawer),document.addEventListener("theme:quick-add:open",this.closeCartDrawer),document.addEventListener("theme:product:add",this.productAddCallback),document.addEventListener("theme:product:add-error",this.productAddCallback),document.addEventListener("theme:product:added",this.openCartDrawerOnProductAdded))}
12cartUpdateEvents(){this.items=document.querySelectorAll(selectors$R.item),this.items.forEach(item=>{item.addEventListener("theme:cart:update",event=>{this.updateCart({id:event.detail.id,quantity:event.detail.quantity},item)})})}cartRemoveEvents(){document.querySelectorAll(selectors$R.cartItemRemove).forEach(button=>{const item=button.closest(selectors$R.item);button.addEventListener("click",event=>{event.preventDefault(),!button.classList.contains(classes$C.disabled)&&this.updateCart({id:button.dataset.id,quantity:0},item)})}),this.cartCloseErrorMessage&&this.cartCloseErrorMessage.addEventListener("click",event=>{event.preventDefault(),this.cartErrorHolder.classList.remove(classes$C.expanded)})}cartAddEvent(event){let formData="",button=event.detail.button;if(button.hasAttribute("disabled"))return;const form=button.closest("form");if(!form.checkValidity()){form.reportValidity();return}formData=new FormData(form),!(form!==null&&form.querySelector('[type="file"]'))&&(event.preventDefault(),this.addToCart(formData,button))}cartEvents(){this.cartTermsCheckbox&&(this.cartTermsCheckbox.removeEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.removeEventListener("click",this.formSubmitHandler),this.cartForm.removeEventListener("submit",this.formSubmitHandler),this.cartTermsCheckbox.addEventListener("change",this.formSubmitHandler),this.cartCheckoutButtonWrapper.addEventListener("click",this.formSubmitHandler),this.cartForm.addEventListener("submit",this.formSubmitHandler))}formSubmitHandler(){const termsAccepted=document.querySelector(selectors$R.cartTermsCheckbox).checked,termsError=document.querySelector(selectors$R.termsErrorMessage);if(termsAccepted)termsError.classList.remove(classes$C.expanded),this.cartCheckoutButton.removeAttribute(attributes$s.disabled);else{if(document.querySelector(selectors$R.termsErrorMessage).length>0)return;termsError.innerText=theme.strings.cartAcceptanceError,this.cartCheckoutButton.setAttribute(attributes$s.disabled,!0),termsError.classList.add(classes$C.expanded)}}formErrorsEvents(errorContainer){errorContainer.querySelector(selectors$R.formCloseError)?.addEventListener("click",e=>{e.preventDefault(),errorContainer&&errorContainer.classList.remove(classes$C.visible)})}getCart(){fetch(theme.routes.cart_url+"?section_id=api-cart-items").then(this.cartErrorsHandler).then(response=>response.text()).then(response=>{const element=document.createElement("div");element.innerHTML=response;const cleanResponse=element.querySelector(selectors$R.apiContent);this.build(cleanResponse)}).catch(error=>console.log(error))}addToCart(formData,button){this.cart&&this.cart.classList.add(classes$C.loading);const quickAddHolder=button?.closest(selectors$R.quickAddHolder);this.cartDrawerEnabled&&(button&&(button.classList.add(classes$C.loading),button.disabled=!0),quickAddHolder&&quickAddHolder.classList.add(classes$C.visible)),fetch(theme.routes.cart_add_url,{method:"POST",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"application/javascript"},body:formData}).then(response=>response.json()).then(response=>{if(response.status){this.addToCartError(response,button),button&&(button.classList.remove(classes$C.loading),button.disabled=!1);return}this.cartDrawerEnabled&&(button&&(button.classList.remove(classes$C.loading),button.classList.add(classes$C.added),button.dispatchEvent(new CustomEvent("theme:product:add",{detail:{response,button},bubbles:!0}))),this.getCart())}).catch(error=>{this.addToCartError(error,button),this.enableCartButtons()})}updateCart(updateData={},currentItem=null){this.cart.classList.add(classes$C.loading);let updatedQuantity=updateData.quantity;currentItem!==null&&(updatedQuantity?currentItem.classList.add(classes$C.loading):currentItem.classList.add(classes$C.removed)),this.disableCartButtons();const newItem=this.cart.querySelector(`[${attributes$s.item}="${updateData.id}"]`)||currentItem,lineIndex=newItem?.hasAttribute(attributes$s.itemIndex)?parseInt(newItem.getAttribute(attributes$s.itemIndex)):0,itemTitle=newItem?.hasAttribute(attributes$s.itemTitle)?newItem.getAttribute(attributes$s.itemTitle):null;if(lineIndex===0)return;const data={line:lineIndex,quantity:updatedQuantity};
12fetch(theme.routes.cart_change_url,{method:"post",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(data)}).then(response=>response.text()).then(state=>{if(JSON.parse(state).errors){this.cartUpdateFailed=!0,this.updateErrorText(itemTitle),this.toggleErrorMessage(),this.resetLineItem(currentItem),this.enableCartButtons();return}this.getCart()}).catch(error=>{console.log(error),this.enableCartButtons()})}resetLineItem(item){const qtyInput=item.querySelector(selectors$R.qtyInput),qty=qtyInput.getAttribute("value");qtyInput.value=qty,item.classList.remove(classes$C.loading)}disableCartButtons(){const inputs=this.cart.querySelectorAll("input"),buttons=this.cart.querySelectorAll(`button, ${selectors$R.cartItemRemove}`);inputs.length&&inputs.forEach(item=>{item.classList.add(classes$C.disabled),item.blur(),item.disabled=!0}),buttons.length&&buttons.forEach(item=>{item.setAttribute(attributes$s.disabled,!0)})}enableCartButtons(){const inputs=this.cart.querySelectorAll("input"),buttons=this.cart.querySelectorAll(`button, ${selectors$R.cartItemRemove}`);inputs.length&&inputs.forEach(item=>{item.classList.remove(classes$C.disabled),item.disabled=!1}),buttons.length&&buttons.forEach(item=>{item.removeAttribute(attributes$s.disabled)}),this.cart.classList.remove(classes$C.loading)}updateErrorText(itemTitle){this.cartErrorHolder.querySelector(selectors$R.errorMessage).innerText=itemTitle}toggleErrorMessage(){this.cartErrorHolder&&(this.cartErrorHolder.classList.toggle(classes$C.expanded,this.cartUpdateFailed),this.cartUpdateFailed=!1)}cartErrorsHandler(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}addToCartError(data,button){const isCartError=data&&typeof data.description=="string"&&data.description.trim()!=="",fallbackError=window.theme&&theme.strings&&theme.strings.cartAddError||"Sorry, we couldn't add that to your cart. Please try again.",errorMessage=isCartError?data.message:fallbackError,errorDescription=isCartError?data.description:fallbackError,errorText=isCartError?`${data.message}: ${data.description}`:fallbackError;if(this.cartDrawerEnabled&&this.closeCartDrawer(),button!==null){let errorContainer=(button.closest(selectors$R.outerSection)||button.closest(selectors$R.quickAddHolder)||button.closest(selectors$R.quickAddModal))?.querySelector(selectors$R.formErrorsContainer);const buttonUpsellHolder=button.closest(selectors$R.quickAddHolder);buttonUpsellHolder&&buttonUpsellHolder.querySelector(selectors$R.formErrorsContainer)&&(errorContainer=buttonUpsellHolder.querySelector(selectors$R.formErrorsContainer)),errorContainer&&(errorContainer.innerHTML=`<div class="errors">${errorText}<button type="button" class="errors__close" data-close-error><svg aria-hidden="true" focusable="false" role="presentation" width="24px" height="24px" stroke-width="1" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" color="currentColor" class="icon icon-cancel"><path d="M6.758 17.243L12.001 12m5.243-5.243L12 12m0 0L6.758 6.757M12.001 12l5.243 5.243" stroke="currentColor" stroke-width="1" stroke-linecap="round" stroke-linejoin="round"></path></svg></button></div>`,errorContainer.classList.add(classes$C.visible),this.formErrorsEvents(errorContainer)),button.dispatchEvent(new CustomEvent("theme:product:add-error",{detail:{response:data,button},bubbles:!0}))}const quickAddHolder=button?.closest(selectors$R.quickAddHolder);quickAddHolder&&quickAddHolder.dispatchEvent(new CustomEvent("theme:cart:error",{bubbles:!0,detail:{message:errorMessage,description:errorDescription,holder:quickAddHolder}})),this.cart?.classList.remove(classes$C.loading)}productAddCallback(event){let buttons=[],quickAddHolder=null;const hasError=event.type=="theme:product:add-error",buttonATC=event.detail.button,cartBarButtonATC=document.querySelector(selectors$R.cartBarAdd);buttons.push(buttonATC),quickAddHolder=buttonATC.closest(selectors$R.quickAddHolder),cartBarButtonATC&&buttons.push(cartBarButtonATC),buttons.forEach(button=>{button.classList.remove(classes$C.loading),hasError||button.classList.add(classes$C.added)}),setTimeout(()=>{buttons.forEach(button=>{button.classList.remove(classes$C.added),button.closest(selectors$R.formWrapper)?.classList.contains(classe
12s$C.variantSoldOut)||button.closest(selectors$R.formWrapper)?.classList.contains(classes$C.variantUnavailable)||(button.disabled=!1)}),quickAddHolder?.classList.remove(classes$C.visible)},1e3)}openCartDrawerOnProductAdded(){this.cartDrawerIsOpen?this.showAnimatedItems():this.openCartDrawer()}openCartDrawer(){this.cartDrawer&&(this.cartDrawerIsOpen=!0,this.onBodyClickEvent=this.onBodyClickEvent||this.onBodyClick.bind(this),document.body.addEventListener("click",this.onBodyClickEvent),document.dispatchEvent(new CustomEvent("theme:cart:open",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.cartDrawer.classList.add(classes$C.open),this.observeAdditionalCheckoutButtons(),setTimeout(this.showAnimatedItems),this.accessibility.trapFocus(this.cartDrawer,{elementToFocus:this.cartDrawer.querySelector(selectors$R.cartDrawerClose)}))}closeCartDrawer(){this.cartDrawer&&this.cartDrawer.classList.contains(classes$C.open)&&(this.cartDrawerIsOpen=!1,document.dispatchEvent(new CustomEvent("theme:cart:close",{bubbles:!0})),this.resetAnimatedItems(),this.itemsHolder.classList.remove(classes$C.updated),this.cartEmpty.classList.remove(classes$C.updated),this.cartErrorHolder.classList.remove(classes$C.expanded),this.cartDrawer.querySelectorAll(selectors$R.animation).forEach(item=>{const removeHidingClass=()=>{item.classList.remove(classes$C.hiding),item.removeEventListener("animationend",removeHidingClass)};item.classList.add(classes$C.hiding),item.addEventListener("animationend",removeHidingClass)}),this.cartDrawer.classList.remove(classes$C.open),this.accessibility.removeTrapFocus(),document.body.removeEventListener("click",this.onBodyClickEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})))}toggleCartDrawer(){this.cartDrawerIsOpen?this.closeCartDrawer():this.openCartDrawer()}cartToggleEvents(){this.cartDrawer&&(this.cartDrawerClose.addEventListener("click",e=>{e.preventDefault(),this.closeCartDrawer()}),this.cartDrawer.addEventListener("keyup",event=>{event.code==="Escape"&&this.closeCartDrawer()}))}onBodyClick(event){event.target.hasAttribute(attributes$s.drawerUnderlay)&&this.closeCartDrawer()}toggleClassesOnContainers(){const hasItemsInCart=this.hasItemsInCart();this.cartEmpty.classList.toggle(classes$C.hidden,hasItemsInCart),this.buttonHolder.classList.toggle(classes$C.hidden,!hasItemsInCart),this.itemsHolder.classList.toggle(classes$C.hidden,!hasItemsInCart)}build(data){const cartItemsData=data.querySelector(selectors$R.apiLineItems),upsellItemsData=data.querySelector(selectors$R.apiUpsellItems),cartEmptyData=cartItemsData===null&&upsellItemsData===null,priceData=data.querySelector(selectors$R.apiCartPrice),cartTotal=data.querySelector(selectors$R.cartTotal);this.priceHolder&&priceData&&(this.priceHolder.innerHTML=priceData.innerHTML),cartEmptyData?(this.itemsHolder.innerHTML=data,this.upsellProductsHolder.innerHTML=""):(this.itemsHolder.innerHTML=cartItemsData.innerHTML,this.upsellProductsHolder.innerHTML=upsellItemsData.innerHTML,this.skipUpsellProductEvent(),this.checkSkippedUpsellProductsFromStorage(),this.toggleCartUpsellWidgetVisibility()),this.newTotalItems=cartItemsData&&cartItemsData.querySelectorAll(selectors$R.item).length?cartItemsData.querySelectorAll(selectors$R.item).length:0,this.subtotal=cartTotal&&cartTotal.hasAttribute(attributes$s.cartTotal)?parseInt(cartTotal.getAttribute(attributes$s.cartTotal)):0,this.cartCount=this.getCartItemCount(),document.dispatchEvent(new CustomEvent("theme:cart:change",{bubbles:!0,detail:{cartCount:this.cartCount}})),this.cartTotal.innerHTML=this.subtotal===0?window.theme.strings.free:themeCurrency.formatMoney(this.subtotal,theme.moneyWithCurrencyFormat),this.cart.classList.remove(classes$C.loading),this.totalItems!==this.newTotalItems&&(this.totalItems=this.newTotalItems,this.toggleClassesOnContainers()),this.cartDrawerIsOpen&&this.itemsHolder.classList.add(classes$C.updated),this.hasItemsInCart()||this.cartEmpty.querySelectorAll(selectors$R.animation).forEach(item=>{item.classList.remove(classes$C.animated)}),this.freeShippingMessageHandle(this.subtotal),this.cartRemoveEvents(),this.cartUpdateEvents(),this.toggleErrorMessage(),this.enableCartButtons(),this.updateProgress(),document.dispatchEvent(new CustomEvent("theme:product:added",{bubbles:!0})),this.cartDrawer||this.showAnimatedItems()}getCartItemCount(){return Array.from(this.cart.querySelectorAll(selectors$R.qtyInput)).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0)}hasItemsInCart(){return this.totalItems>0}freeShippingMessageHandle(total){this.freeShipping.length&&this.freeShipping.forEach(message=>{const hasQualifiedShippingMessage=message.hasAttribute(attributes$s.freeShipping)&&message.getAttribute(attributes$s.freeShipping)==="true"&&total>=0;message.classList.toggle(classes$C.success,hasQualifiedShippingMessage&&total>=this.freeShippingLimit)})}updateProgress(){if(this.freeShipping=document.querySelectorAll(selectors$R.freeShipping),!this.freeShipping.length)return;const percentValue=isNaN(this.subtotal/this.freeShippingLimit)?100:this.subtotal/this.freeShippingLimit,percent=Math.min(percentValue*100,100),dashoffset=this.circumference-percent/100*this.circumference/2,leftToSpend=themeCurrency.formatMoney(this.freeShippingLimit-this.subtotal,theme.moneyFormat);this.freeShipping.forEach(item=>{const progressBar=item.querySelector(selectors$R.freeShippingProgress),progressGraph=item.querySelector(selectors$R.freeShippingGraph),leftToSpendMessage=item.querySelector(selectors$R.leftToSpend);leftToSpendMessage&&(leftToSpendMessage.innerHTML=leftToSpend.replace(".00","")),progressBar&&(progressBar.value=percent),progressGraph&&progressGraph.style.setProperty("--stroke-dashoffset",`${dashoffset}`)})}skipUpsellProductEvent(){if(this.upsellProductsHolder===null)return;const skipButtons=this.upsellProductsHolder.querySelectorAll(selectors$R.buttonSkipUpsellProduct);skipButtons.length&&skipButtons.forEach(button=>{button.addEventListener("click",event=>{event.preventDefault();const productID=button.closest(selectors$R.quickAddHolder).getAttribute(attributes$s.quickAddHolder);this.skipUpsellProductsArray.includes(productID)||this.skipUpsellProductsArray.push(productID),window.sessionStorage.setItem("skip_upsell_products",this.skipUpsellProductsArray),this.removeUpsellProduct(productID),this.toggleCartUpsellWidgetVisibility()})})}checkSkippedUpsellProductsFromStorage(){const skippedUpsellItemsFromStorage=window.sessionStorage.getItem("skip_upsell_products");skippedUpsellItemsFromStorage&&skippedUpsellItemsFromStorage.split(",").forEach(productID=>{this.skipUpsellProductsArray.includes(productID)||this.skipUpsellProductsArray.push(productID),this.removeUpsellProduct(productID)})}removeUpsellProduct(productID){if(!this.upsellProductsHolder)return;const upsellProduct=this.upsellProductsHolder.querySelector(`[${attributes$s.quickAddHolder}="${productID}"]`);upsellProduct&&upsellProduct.parentNode.remove()}toggleCartUpsellWidgetVisibility(){if(!this.upsellProductsHolder)return;const upsellItems=this.upsellProductsHolder.querySelectorAll(selectors$R.quickAddHolder),upsellWidget=this.upsellProductsHolder.closest(selectors$R.upsellWidget);upsellWidget&&upsellWidget.classList.toggle(classes$C.hidden,!upsellItems.length)}observeAdditionalCheckoutButtons(){const additionalCheckoutButtons=this.cartDrawer.querySelector(selectors$R.additionalCheckoutButtons);if(additionalCheckoutButtons){const observer=new MutationObserver(()=>{this.accessibility.trapFocus(this.cartDrawer,{elementToFocus:this.cartDrawer.querySelector(selectors$R.cartDrawerClose)}),observer.disconnect()});observer.observe(additionalCheckoutButtons,{subtree:!0,childList:!0})}}resetAnimatedItems(){this.cart.querySelectorAll(selectors$R.animation).forEac
12h(item=>{item.classList.remove(classes$C.animated),item.classList.remove(classes$C.hiding)})}showAnimatedItems(){requestAnimationFrame(this.animateItems)}animateItems(){this.cart.querySelectorAll(selectors$R.animation).forEach(item=>{item.classList.add(classes$C.animated)})}}window.cart=new CartDrawer,customElements.get("shipping-calculator")||customElements.define("shipping-calculator",ShippingCalculator);const classes$B={focus:"is-focused"},selectors$Q={inPageLink:"[data-skip-content]",linkesWithOnlyHash:'a[href="#"]'};class Accessibility{constructor(){this.init()}init(){this.a11y=a11y,this.html=document.documentElement,this.body=document.body,this.inPageLink=document.querySelector(selectors$Q.inPageLink),this.linkesWithOnlyHash=document.querySelectorAll(selectors$Q.linkesWithOnlyHash),this.a11y.focusHash(),this.a11y.bindInPageLinks(),this.clickEvents(),this.focusEvents()}clickEvents(){this.inPageLink&&this.inPageLink.addEventListener("click",event=>{event.preventDefault()}),this.linkesWithOnlyHash&&this.linkesWithOnlyHash.forEach(item=>{item.addEventListener("click",event=>{event.preventDefault()})})}focusEvents(){document.addEventListener("mousedown",()=>{this.body.classList.remove(classes$B.focus)}),document.addEventListener("keyup",event=>{event.code==="Tab"&&this.body.classList.add(classes$B.focus)})}}window.accessibility=new Accessibility;const selectors$P={inputSearch:'input[type="search"]'};class MainSearch extends HeaderSearchForm{constructor(){super(),this.allSearchInputs=document.querySelectorAll(selectors$P.inputSearch),this.setupEventListeners()}setupEventListeners(){let allSearchForms=[];this.allSearchInputs.forEach(input=>allSearchForms.push(input.form)),this.input.addEventListener("focus",this.onInputFocus.bind(this)),!(allSearchForms.length<2)&&(allSearchForms.forEach(form=>form.addEventListener("reset",this.onFormReset.bind(this))),this.allSearchInputs.forEach(input=>input.addEventListener("input",this.onInput.bind(this))))}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&this.keepInSync("",this.input)}onInput(event){const target=event.target;this.keepInSync(target.value,target)}onInputFocus(){isDesktop()||this.scrollIntoView({behavior:"smooth"})}keepInSync(value,target){this.allSearchInputs.forEach(input=>{input!==target&&(input.value=value)})}}customElements.define("main-search",MainSearch);const selectors$O={details:"details",popdown:"[data-popdown]",popdownClose:"[data-popdown-close]",popdownToggle:"[data-popdown-toggle]",input:'input:not([type="hidden"])'},attributes$r={popdownUnderlay:"data-popdown-underlay"};class SearchPopdown extends HTMLElement{constructor(){super(),this.popdown=this.querySelector(selectors$O.popdown),this.popdownContainer=this.querySelector(selectors$O.details),this.popdownToggle=this.querySelector(selectors$O.popdownToggle),this.popdownClose=this.querySelector(selectors$O.popdownClose),this.a11y=a11y}connectedCallback(){this.popdownContainer.addEventListener("keyup",event=>event.code.toUpperCase()==="ESCAPE"&&this.close()),this.popdownClose.addEventListener("click",this.close.bind(this)),this.popdownToggle.addEventListener("click",this.onPopdownToggleClick.bind(this)),this.popdownToggle.setAttribute("role","button"),this.popdown.addEventListener("transitionend",event=>{event.propertyName=="visibility"&&this.popdownContainer.hasAttribute("open")&&this.popdownContainer.getAttribute("open")=="false"&&this.popdownContainer.removeAttribute("open")})}onPopdownToggleClick(event){event.preventDefault(),event.target.closest(selectors$O.details).hasAttribute("open")?this.close():this.open(event)}onBodyClick(event){(!this.contains(event.target)||event.target.hasAttribute(attributes$r.popdownUnderlay))&&this.close()}open(event){this.onBodyClickEvent=this.onBodyClickEvent||this.onBodyClick.bind(this),event.target.closest(selectors$O.details).setAttribute("open",""),document.body.addEventListener("click",this.onBodyClickEvent),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),requestAnimationFrame(()=>{event.target.closest(selectors$O.details).setAttribute("open","true"),this.a11y.trapFocus(this.popdown,{elementToFocus:this.popdown.querySelector(selectors$O.input)})})}close(){this.a11y.removeTrapFocus(),this.popdownContainer.setAttribute("open","false"),document.body.removeEventListener("click",this.onBodyClickEvent),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}}customElements.define("header-search-popdown",SearchPopdown);const selectors$N={collapsible:"[data-collapsible]",trigger:"[data-collapsible-trigger]",body:"[data-collapsible-body]",content:"[data-collapsible-content]"},attributes$q={open:"open",single:"single"};class CollapsibleElements extends HTMLElement{constructor(){super(),this.collapsibles=this.querySelectorAll(selectors$N.collapsible),this.single=this.hasAttribute(attributes$q.single)}
12connectedCallback(){this.collapsibles.forEach(collapsible=>{const trigger=collapsible.querySelector(selectors$N.trigger),body=collapsible.querySelector(selectors$N.body);trigger.addEventListener("click",event=>this.onCollapsibleClick(event)),body.addEventListener("transitionend",event=>{event.target===body&&(collapsible.getAttribute(attributes$q.open)=="true"&&this.setBodyHeight(body,"auto"),collapsible.getAttribute(attributes$q.open)=="false"&&(collapsible.removeAttribute(attributes$q.open),this.setBodyHeight(body,"")))})})}open(collapsible){if(collapsible.getAttribute("open")=="true")return;const body=collapsible.querySelector(selectors$N.body),content=collapsible.querySelector(selectors$N.content);collapsible.setAttribute("open",!0),this.setBodyHeight(body,content.offsetHeight)}close(collapsible){if(!collapsible.hasAttribute("open"))return;const body=collapsible.querySelector(selectors$N.body),content=collapsible.querySelector(selectors$N.content);this.setBodyHeight(body,content.offsetHeight),collapsible.setAttribute("open",!1),requestAnimationFrame(()=>{requestAnimationFrame(()=>{this.setBodyHeight(body,0)})})}setBodyHeight(body,contentHeight){body.style.height=contentHeight!=="auto"&&contentHeight!==""?`${contentHeight}px`:contentHeight}onCollapsibleClick(event){event.preventDefault();const collapsible=(event.target.matches(selectors$N.trigger)?event.target:event.target.closest(selectors$N.trigger)).closest(selectors$N.collapsible);this.single&&this.collapsibles.forEach(otherCollapsible=>{otherCollapsible.hasAttribute(attributes$q.open)&&otherCollapsible!=collapsible&&requestAnimationFrame(()=>{this.close(otherCollapsible)})}),collapsible.hasAttribute(attributes$q.open)?this.close(collapsible):this.open(collapsible),collapsible.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"accordion"}}))}}customElements.get("collapsible-elements")||customElements.define("collapsible-elements",CollapsibleElements);const selectors$M={templateAddresses:".template-addresses",addressNewForm:"#AddressNewForm",btnNew:".address-new-toggle",btnEdit:".address-edit-toggle",btnDelete:".address-delete",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"},classes$A={hidden:"hidden"};class Addresses{constructor(section){this.section=section,this.addressNewForm=this.section.querySelector(selectors$M.addressNewForm),this.init()}init(){if(this.addressNewForm){const section=this.section,newAddressForm=this.addressNewForm;this.customerAddresses();const newButtons=section.querySelectorAll(selectors$M.btnNew);newButtons.length&&newButtons.forEach(element=>{element.addEventListener("click",function(){newAddressForm.classList.toggle(classes$A.hidden)})});const editButtons=section.querySelectorAll(selectors$M.btnEdit);editButtons.length&&editButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$M.dataFormId);section.querySelector(`${selectors$M.editAddress}_${formId}`).classList.toggle(classes$A.hidden)})});const deleteButtons=section.querySelectorAll(selectors$M.btnDelete);deleteButtons.length&&deleteButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$M.dataFormId),confirmMessage=this.getAttribute(selectors$M.dataConfirmMessage);confirm(confirmMessage)&&Shopify.postLink(window.theme.routes.addresses_url+"/"+formId,{parameters:{_method:"delete"}})})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$M.addressCountryNew,selectors$M.addressProvinceNew,{hideElement:selectors$M.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$M.addressCountryOption).forEach(element=>{const formId=element.getAttribute(selectors$M.dataFormId),countrySelector=`${selectors$M.addressCountry}_${formId}`,provinceSelector=`${selectors$M.addressProvince}_${formId}`,containerSelector=`${selectors$M.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}}const template$1=document.querySelector(selectors$M.templateAddresses);template$1&&new Addresses(template$1);const selectors$L={accountTemplateLogged:".customer-logged-in",account:".account",accountSidebarMobile:".account-sidebar--mobile"};class Account{constructor(section){this.section=section,this.init()}init(){this.section.querySelector(selectors$L.account)&&this.accountMobileSidebar()}accountMobileSidebar(){this.section.querySelector(selectors$L.accountSidebarMobile)&&this.section.querySelector(selectors$L.accountSidebarMobile).addEventListener("click",function(){const nextElem=this.nextElementSibling;nextElem&&nextElem.tagName==="UL"&&nextElem.classList.toggle("visible")})}}const template=document.querySelector(selectors$L.accountTemplateLogged);template&&new Account(template);const selectors$K={form:"[data-account-form]",showReset:"[data-show-reset]",hideReset:"[data-hide-reset]",recover:"[data-recover-password]",recoverSuccess:"[data-recover-success]",login:"[data-login-form]",recoverHash:"#recover",hideClass:"is-hidden"};class Login{constructor(form){this.form=form,this.showButton=form.querySelector(selectors$K.showReset),this.hideButton=form.querySelector(selectors$K.hideReset),this.recover=form.querySelector(selectors$K.recover),this.recoverSuccess=form.querySelector(selectors$K.recoverSuccess),this.login=form.querySelector(selectors$K.login),this.init()}init(){window.location.hash==selectors$K.recoverHash||this.recoverSuccess?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$K.hideClass),this.recover.classList.remove(selectors$K.hideClass),window.location.hash=selectors$K.recoverHash,!1}hideRecoverPasswordForm(){return this.recover.classList.add(selectors$K.hideClass),this.login.classList.remove(selectors$K.hideClass),window.location.hash="",!1}}const loginForm=document.querySelector(selectors$K.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$J={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:[]}
12,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$J.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.warn(e)}}callFunctions(key,e=null){this.callStack[key].forEach(func=>{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}}function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(selectors$J.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+selectors$J.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$J.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$J.type)===null?!1:container.getAttribute(selectors$J.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].c
12onstructor===Section&&(types=types.map(function(Section2){return Section2.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers)&&containers.length>0?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$J.id+'="'+id+'"]');container!==null&&load(container.getAttribute(selectors$J.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$J.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$J.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$I={tooltip:"data-tooltip",tooltipStopMouseEnter:"data-tooltip-stop-mouseenter"},classes$z={tooltipDefault:"tooltip-default",visible:"is-visible",hiding:"is-hiding"};let sections$n={};class Tooltip{constructor(el,options={}){this.tooltip=el,this.tooltip.hasAttribute(selectors$I.tooltip)&&(this.label=this.tooltip.getAttribute(selectors$I.tooltip),this.class=options.class||classes$z.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("theme:tooltip:init",this.addPinEvent),document.addEventListener("theme:tooltip:close",this.removePinEvent)}addPin(stopMouseEnter=!1){const tooltipTarget=document.querySelector(`.${this.class}`);if(tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$I.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 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-getWindowWidth();tooltipTargetWindowDifference>0&&(tooltipTargetPositionLeft-=tooltipTargetWindowDifference),tooltipTargetPositionLeft<0&&(tooltipTargetPositionLeft=0),tooltipTargetArrow.style.left=`${tooltipRect.left+tooltipWidth/2}px`,tooltipTarget.style.setProperty("--tooltip-top",`${tooltipTargetPositionTop}px`),tooltipTargetInner.style.transform=`translateX(${tooltipTargetPositionLeft}px)`,tooltipTarget.classList.remove(classes$z.hiding),tooltipTarget.classList.add(classes$z.visible),document.addEventListener("theme:scroll",this.removePinEvent)}}removePin(event,stopMouseEnter=!1,hideTransition=!1){const tooltipTarget=document.querySelector(`.${this.class}
12`),tooltipVisible=tooltipTarget.classList.contains(classes$z.visible);tooltipTarget&&(stopMouseEnter&&!this.tooltip.hasAttribute(selectors$I.tooltipStopMouseEnter)||!stopMouseEnter)&&(tooltipVisible&&(hideTransition||event.detail.hideTransition)&&(tooltipTarget.classList.add(classes$z.hiding),this.hideTransitionTimeout&&clearTimeout(this.hideTransitionTimeout),this.hideTransitionTimeout=setTimeout(()=>{tooltipTarget.classList.remove(classes$z.hiding)},this.transitionSpeed)),tooltipTarget.classList.remove(classes$z.visible),document.removeEventListener("theme:scroll",this.removePinEvent))}unload(){this.tooltip.removeEventListener("mouseenter",this.addPinMouseEvent),this.tooltip.removeEventListener("mouseleave",this.removePinMouseEvent),this.tooltip.removeEventListener("theme:tooltip:init",this.addPinEvent),document.removeEventListener("theme:tooltip:close",this.removePinEvent),document.removeEventListener("theme:scroll",this.removePinEvent)}}const tooltipSection={onLoad(){sections$n[this.id]=[],this.container.querySelectorAll(`[${selectors$I.tooltip}]`).forEach(el=>{sections$n[this.id].push(new Tooltip(el))})},onUnload:function(){sections$n[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}};var sections$m={};const parallaxHero={onLoad(){sections$m[this.id]=[],this.container.querySelectorAll("[data-parallax-wrapper]").forEach(frame=>{const inner=frame.querySelector("[data-parallax-img]");sections$m[this.id].push(new Rellax(inner,{center:!0,round:!0,frame}))}),window.addEventListener("load",()=>{sections$m[this.id].forEach(image=>{typeof image.refresh=="function"&&image.refresh()})})},onUnload:function(){sections$m[this.id].forEach(image=>{typeof image.destroy=="function"&&image.destroy()})}};register("article",[tooltipSection,parallaxHero]);const selectors$H={aos:"[data-aos]",collectionImage:".collection-item__image",columnImage:"[data-column-image]",flickityNextArrow:".flickity-button.next",flickityPrevArrow:".flickity-button.previous",link:"a:not(.btn)",productItemImage:".product-item__image",slide:"[data-slide]",slideValue:"data-slide",slider:"[data-slider]",sliderThumb:"[data-slider-thumb]"},attributes$p={arrowPositionMiddle:"data-arrow-position-middle",equalizeHeight:"data-equalize-height",slideIndex:"data-slide-index",sliderOptions:"data-options",slideTextColor:"data-slide-text-color"},classes$y={aosAnimate:"aos-animate",desktop:"desktop",focused:"is-focused",flickityResize:"flickity-resize",flickityResizing:"flickity-resizing",flickityEnabled:"flickity-enabled",heroContentTransparent:"hero__content--transparent",initialized:"is-initialized",isLoading:"is-loading",isSelected:"is-selected",mobile:"mobile",sliderInitialized:"js-slider--initialized"},sections$l={};class Slider{constructor(container,slideshow=null){this.container=container,this.slideshow=slideshow||this.container.querySelector(selectors$H.slider),this.slideshow&&(this.slideshowSlides=this.slideshow.querySelectorAll(selectors$H.slide),!(this.slideshowSlides.length<=1)&&(this.sliderThumbs=this.container.querySelectorAll(selectors$H.sliderThumb),this.multipleSlides=this.slideshow.hasAttribute(attributes$p.slidesLargeDesktop),this.isHeightEqualized=this.slideshow.getAttribute(attributes$p.equalizeHeight)==="true",this.slideshow.hasAttribute(attributes$p.sliderOptions)&&(this.customOptions=JSON.parse(decodeURIComponent(this.slideshow.getAttribute(attributes$p.sliderOptions)))),this.flkty=null,this.init()))}init(){this.slideshow.classList.add(classes$y.isLoading),this.sliderOptions={contain:!0,wrapAround:!0,adaptiveHeight:!0,...this.customOptions,on:{ready:()=>{requestAnimationFrame(()=>{this.slideshow.classList.add(classes$y.initialized),this.slideshow.classList.remove(classes$y.isLoading),this.slideshow.parentNode.dispatchEvent(new CustomEvent("theme:slider:loaded",{bubbles:!0,detail:{slider:this}}))}),this.slideActions(),this.sliderOptions.prevNextButtons&&this.positionArrows()},change:index=>{const slide=this.slideshowSlides[index];if(!slide||this.sliderOptions.groupCells)return;const elementsToAnimate=slide.querySelectorAll(selectors$H.aos);elementsToAnimate.length&&elementsToAnimate.forEach(el=>{el.classList.remove(classes$y.aosAnimate),requestAnimationFrame(()=>{el.classList.add(classes$y.aosAnimate)})})},resize:()=>{this.sliderOptions.prevNextButtons&&this.positionArrows()}}},this.sliderOptions.fade&&(this.flkty=new FlickityFade(this.slideshow,this.sliderOptions)),this.sliderOptions.fade||(this.flkty=new Flickity(this.slideshow,this.sliderOptions)),this.isHeightEqualized&&this.equalizeHeight(),this.flkty.on("change",()=>this.slideActions(!0)),this.sliderThumbs.length&&this.sliderThumbs.forEac
12h(element=>{element.addEventListener("click",e=>{e.preventDefault();const slideIndex=[...element.parentElement.children].indexOf(element);this.flkty.select(slideIndex)})}),this.flkty||this.slideshow.classList.remove(classes$y.isLoading)}resetSlider(){this.slideshow&&(this.flkty&&this.flkty.isActive?this.flkty.select(0,!1,!0):this.slideshow.scrollTo({left:0,behavior:"auto"}))}slideActions(changeEvent=!1){const currentSlide=this.slideshow.querySelector(`.${classes$y.isSelected}`),currentSlideTextColor=currentSlide.getAttribute(attributes$p.slideTextColor),currentSlideLink=currentSlide.querySelector(selectors$H.link),buttons=this.slideshow.querySelectorAll(`${selectors$H.slide} a, ${selectors$H.slide} button`);if(document.body.classList.contains(classes$y.focused)&&currentSlideLink&&this.sliderOptions.groupCells&&changeEvent&&currentSlideLink.focus(),buttons.length&&buttons.forEach(button=>{const slide=button.closest(selectors$H.slide);if(slide){const tabIndex=slide.classList.contains(classes$y.isSelected)?0:-1;button.setAttribute("tabindex",tabIndex)}}),currentSlideTextColor!=="rgba(0,0,0,0)"&&currentSlideTextColor!==""&&this.slideshow.style.setProperty("--text",currentSlideTextColor),this.sliderThumbs.length&&this.sliderThumbs.length===this.slideshowSlides.length&&currentSlide.hasAttribute(attributes$p.slideIndex)){const slideIndex=parseInt(currentSlide.getAttribute(attributes$p.slideIndex)),currentThumb=this.container.querySelector(`${selectors$H.sliderThumb}.${classes$y.isSelected}`);currentThumb&&currentThumb.classList.remove(classes$y.isSelected),this.sliderThumbs[slideIndex].classList.add(classes$y.isSelected)}}positionArrows(){if(this.slideshow.hasAttribute(attributes$p.arrowPositionMiddle)&&this.sliderOptions.prevNextButtons){const itemImage=this.slideshow.querySelector(selectors$H.collectionImage)||this.slideshow.querySelector(selectors$H.productItemImage)||this.slideshow.querySelector(selectors$H.columnImage);if(!itemImage)return;this.slideshow.querySelector(selectors$H.flickityPrevArrow).style.top=itemImage.clientHeight/2+"px",this.slideshow.querySelector(selectors$H.flickityNextArrow).style.top=itemImage.clientHeight/2+"px"}}equalizeHeight(){Flickity.prototype._createResizeClass=function(){requestAnimationFrame(()=>{this.element.classList.add(classes$y.flickityResize)})},this.flkty._createResizeClass();const resize=Flickity.prototype.resize;Flickity.prototype.resize=function(){this.element.classList.remove(classes$y.flickityResize),this.element.classList.add(classes$y.flickityResizing),resize.call(this),requestAnimationFrame(()=>{this.element.classList.remove(classes$y.flickityResizing),this.element.classList.add(classes$y.flickityResize)})}}onUnload(){this.slideshow&&this.flkty&&(this.flkty.options.watchCSS=!1,this.flkty.destroy())}onBlockSelect(evt){if(!this.slideshow)return;const slide=this.slideshow.querySelector(`[${selectors$H.slideValue}="${evt.detail.blockId}"]`);if(!slide)return;let slideIndex=parseInt(slide.getAttribute(attributes$p.slideIndex));this.multipleSlides&&!this.slideshow.classList.contains(classes$y.sliderInitialized)&&(slideIndex=0),this.slideshow.classList.add(classes$y.isSelected),this.flkty&&this.slideshow.classList.contains(classes$y.flickityEnabled)&&(this.flkty.selectCell(slideIndex),this.flkty.stopPlayer())}onBlockDeselect(){this.slideshow&&(this.slideshow.classList.remove(classes$y.isSelected),this.flkty&&this.sliderOptions.hasOwnProperty("autoPlay")&&this.sliderOptions.autoPlay&&this.flkty.playPlayer())}}const slider={onLoad(){sections$l[this.id]=[],this.container.querySelectorAll(selectors$H.slider).forEach(el=>{sections$l[this.id].push(new Slider(this.container,el))})},onUnload(){sections$l[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections$l[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$l[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(e)})}};register("blog-section",[slider]),register("hero",parallaxHero),register("double",slider);const selectors$G={headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},scrollTo=elementTop=>{const headerHeight=document.querySelector(selectors$G.headerSticky)&&document.querySelector(selectors$G.headerHeight)?document.querySelector(selectors$G.headerHeight).getBoundingClientRect().height:0;window.scrollTo({top:elementTop+window.scrollY-headerHeight,left:0,behavior:"smooth"})};class PopupCookie{constructor(name,value,daysToExpire=7){const today=new Date,expiresDate=new Date;expiresDate.setTime(today.getTime()+36e5*24*daysToExpire),this.configuration={expires:expiresDate.toGMTString(),path:"/",domain:window.location.hostname,sameSite:"none",secure:!0},this.name=name,this.value=value}write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}; sameSite=${this.configuration.sameSite}; secure=${this.configuration.secure}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}}const selectors$F={newsletterForm:"[data-newsletter-form]",newsletterHeading:"[data-newsletter-heading]",newsletterPopup:"[data-newsletter]"},classes$x={success:"has-success",error:"has-error",hidden:"hidden"},attributes$o={cookieNameAttribute:"data-cookie-name"},sections$k={};class NewsletterCheckForResult{constructor(newsletter){this.sessionStorage=window.sessionStorage,this.newsletter=newsletter,this.popup=this.newsletter.closest(selectors$F.newsletterPopup),this.popup&&(this.cookie=new PopupCookie(this.popup.getAttribute(attributes$o.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(),e.stopImmediatePropagation(),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$F.newsletterHeading),submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,submissionFailure=window.location.search.indexOf("accepts_marketing")!==-1;submissionSuccess?(newsletter.classList.remove(classes$x.error),newsletter.classList.add(classes$x.success),newsletterHeading&&(newsletterHeading.classList.add(classes$x.hidden),newsletter.classList.remove(classes$x.hidden)),this.popup&&this.cookie.write()):submissionFailure&&(newsletter.classList.remove(classes$x.success),newsletter.classList.add(classes$x.error),newsletterHeading&&(newsletterHeading.classList.add(classes$x.hidden),newsletter.classList.remove(classes$x.hidden))),(submissionSuccess||submissionFailure)&&window.addEventListener("load",()=>{this.scrollToForm(newsletter)})}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();rect.top>=0&&rect.left>=0&&rect.bottom<=getWindowHeight()&&rect.right<=getWindowWidth()||setTimeout(()=>{scrollTo(newsletter.getBoundingClientRect().top)},500)}unload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}}const newsletterCheckForResultSection={onLoad(){sections$k[this.id]=[],this.container.querySelectorAll(selectors$F.newsletterForm).forEach(form=>{sections$k[this.id].push(new NewsletterCheckForResult(form))})}
12,onUnload(){sections$k[this.id].forEach(form=>{typeof form.unload=="function"&&form.unload()})}};register("footer",[parallaxHero,newsletterCheckForResultSection]);const selectors$E={section:"[data-section-type]",collectionSidebar:"[data-collection-sidebar]",collectionSidebarSlideOut:"[data-collection-sidebar-slide-out]",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",rangeMinDefault:"data-se-min",rangeMaxDefault:"data-se-max",productsContainer:"[data-products-grid]",product:"[data-product-grid-item]",filterUpdateUrlButton:"[data-filter-update-url]",activeFilters:"[data-active-filters]",activeFiltersCount:"data-active-filters-count",sort:"data-sort-enabled",collectionNav:"[data-collection-nav]",showMoreOptions:"[data-show-more]",linkHidden:"[data-link-hidden]"},classes$w={hidden:"hidden",loading:"is-loading",focused:"is-focused"};class CollectionFiltersForm extends HTMLElement{constructor(){super(),this.container=this.closest(selectors$E.section),this.sidebar=this.container.querySelector(selectors$E.collectionSidebar),this.collectionSidebarSlideOut=this.container.querySelector(selectors$E.collectionSidebarSlideOut),this.sort=this.container.querySelector(`[${selectors$E.sort}]`),this.productsContainer=this.container.querySelector(selectors$E.productsContainer),this.collectionNav=this.container.querySelector(selectors$E.collectionNav),this.form=this.querySelector(selectors$E.form),this.showMoreOptions=this.querySelectorAll(selectors$E.showMoreOptions),this.accessibility=a11y,this.filterUpdateFromUrlEvent=e=>this.filterUpdateFromUrl(e),this.submitFormEvent=e=>this.submitForm(e),this.updatePriceEvent=debounce(e=>this.updatePrice(e),500),this.updateRangeEvent=e=>this.updateRange(e),this.showMoreEvent=e=>this.showMore(e)}connectedCallback(){this.form&&(this.sidebar.addEventListener("input",this.updatePriceEvent),this.sidebar.addEventListener("theme:range:update",this.updateRangeEvent)),this.sidebar&&this.sidebar.addEventListener("click",this.filterUpdateFromUrlEvent),this.productsContainer&&this.productsContainer.addEventListener("click",this.filterUpdateFromUrlEvent),this.sort&&this.container.addEventListener("theme:filter:sort-update",this.submitFormEvent),(this.sidebar||this.sort)&&window.addEventListener("popstate",this.submitFormEvent),this.showMoreOptions.length&&this.showMoreOptions.forEach(element=>{element.addEventListener("click",this.showMoreEvent)})}showMore(e){e.preventDefault(),e.target.parentElement.classList.add(classes$w.hidden),e.target.parentElement.previousElementSibling.querySelectorAll(selectors$E.linkHidden).forEach((link,index)=>{link.classList.remove(classes$w.hidden);const input=link.querySelector(selectors$E.input);index===0&&document.body.classList.contains(classes$w.focused)&&input&&(this.collectionSidebarSlideOut||isMobile()?(this.accessibility.removeTrapFocus(),this.accessibility.trapFocus(this.sidebar,{elementToFocus:input})):input.focus())})}updatePrice(e){const type=e.type,target=e.target;if((type===selectors$E.input||type===selectors$E.select||type===selectors$E.label||type===selectors$E.textarea)&&this.form&&typeof this.form.submit=="function"){const priceMin=this.form.querySelector(selectors$E.priceMin),priceMax=this.form.querySelector(selectors$E.priceMax);priceMin&&priceMax&&(target.hasAttribute(selectors$E.priceMinValue)&&!priceMax.value?priceMax.value=priceMax.placeholder:target.hasAttribute(selectors$E.priceMaxValue)&&!priceMin.value&&(priceMin.value=priceMin.placeholder)),this.submitForm(e)}}filterUpdateFromUrl(e){const target=e.target;if(target.matches(selectors$E.filterUpdateUrlButton)||target.closest(selectors$E.filterUpdateUrlButton)&&target){e.preventDefault();const button=target.matches(selectors$E.filterUpdateUrlButton)?target:target.closest(selectors$E.filterUpdateUrlButton);this.submitForm(e,button.getAttribute("href"))}}submitForm(e,replaceHref=""){this.sort=this.container.querySelector(`[${selectors$E.sort}]`);const sortValue=this.sort?this.sort.getAttribute(selectors$E.sort):"";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("page="))for(const key in filterUrlParams)(key.includes("filter.")||key==="page")&&filterUrl.delete(key);if(this.form){const formData=new FormData(this.form),formParams=new URLSearchParams(formData),rangeMin=this.form.querySelector(selectors$E.rangeMin),rangeMax=this.form.querySelector(selectors$E.rangeMax),rangeMinDefaultValue=rangeMin&&rangeMin.hasAttribute(selectors$E.rangeMinDefault)?rangeMin.getAttribute(selectors$E.rangeMinDefault):"",rangeMaxDefaultValue=rangeMax&&rangeMax.hasAttribute(selectors$E.rangeMaxDefault)?rangeMax.getAttribute(selectors$E.rangeMaxDefault):"";let priceFilterDefaultCounter=0;
12for(let[key,val]of formParams.entries())key.includes("filter.")&&val&&(filterUrl.append(key,val),(val===rangeMinDefaultValue&&key==="filter.v.price.gte"||val===rangeMaxDefaultValue&&key==="filter.v.price.lte")&&(priceFilterDefaultCounter+=1));priceFilterDefaultCounter===2&&(filterUrl.delete("filter.v.price.gte"),filterUrl.delete("filter.v.price.lte"))}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("theme:filter:sort",{bubbles:!1}));this.productsContainer&&(this.productsContainer.classList.add(classes$w.loading),fetch(`${window.location.pathname}${window.location.search}`).then(response=>response.text()).then(data=>{if(this.productsContainer.innerHTML=new DOMParser().parseFromString(data,"text/html").querySelector(selectors$E.productsContainer).innerHTML,this.sidebar){this.sidebar.innerHTML=new DOMParser().parseFromString(data,"text/html").querySelector(selectors$E.collectionSidebar).innerHTML;const activeFiltersCountContainer=this.sidebar.querySelector(`[${selectors$E.activeFiltersCount}]`),activeFiltersContainer=this.container.querySelectorAll(selectors$E.activeFilters);if(activeFiltersCountContainer&&activeFiltersContainer.length){const activeFiltersCount=parseInt(activeFiltersCountContainer.getAttribute(selectors$E.activeFiltersCount));activeFiltersContainer.forEach(counter=>{counter.textContent=activeFiltersCount,counter.classList.toggle(classes$w.hidden,activeFiltersCount<1)})}this.sidebar.dispatchEvent(new CustomEvent("theme:filter:update",{bubbles:!0}))}this.collectionNav&&scrollTo(this.productsContainer.getBoundingClientRect().top-this.collectionNav.offsetHeight),setTimeout(()=>{this.productsContainer.classList.remove(classes$w.loading)},500)}).catch(error=>{console.log(error)}))}updateRange(e){if(this.form&&typeof this.form.submit=="function"){const rangeMin=this.form.querySelector(selectors$E.rangeMin),rangeMax=this.form.querySelector(selectors$E.rangeMax),priceMin=this.form.querySelector(selectors$E.priceMin),priceMax=this.form.querySelector(selectors$E.priceMax);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$E.rangeMinValue)&&rangeMax.hasAttribute(selectors$E.rangeMaxValue)){const priceMinValue=parseInt(priceMin.placeholder),priceMaxValue=parseInt(priceMax.placeholder),rangeMinValue=parseInt(rangeMin.getAttribute(selectors$E.rangeMinValue)),rangeMaxValue=parseInt(rangeMax.getAttribute(selectors$E.rangeMaxValue));(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=rangeMinValue,priceMax.value=rangeMaxValue,this.submitForm(e))}}}disconnectedCallback(){this.form&&(this.sidebar.removeEventListener("input",this.updatePriceEvent),this.sidebar.removeEventListener("theme:range:update",this.updateRangeEvent)),this.sidebar&&this.sidebar.removeEventListener("click",this.filterUpdateFromUrlEvent),this.productsContainer&&this.productsContainer.removeEventListener("click",this.filterUpdateFromUrlEvent),this.sort&&this.container.removeEventListener("theme:filter:sort-update",this.submitFormEvent),(this.sidebar||this.sort)&&window.removeEventListener("popstate",this.submitFormEvent),this.showMoreOptions.length&&this.showMoreOptions.forEach(element=>{element.removeEventListener("click",this.showMoreEvent)})}}const selectors$D={sidebar:"[data-collection-sidebar]",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$v={initialized:"is-initialized"};class RangeSlider extends HTMLElement{constructor(){super(),this.sidebar=this.closest(selectors$D.sidebar),this.sidebarTransitionEvent=event=>this.onSidebarTransitionEnd(event),this.resizeEvent=()=>{this.connectedCallback(),this.sidebar.addEventListener("transitionend",this.sidebarTransitionEvent)},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.querySelector(selectors$D.rangeDotLeft),this.touchRight=this.querySelector(selectors$D.rangeDotRight),this.lineSpan=this.querySelector(selectors$D.rangeLine),this.min=parseFloat(this.getAttribute(selectors$D.dataMin)),this.max=parseFloat(this.getAttribute(selectors$D.dataMax)),this.step=0,this.normalizeFact=26,document.addEventListener("theme:resize:width",this.resizeEvent)}connectedCallback(){let defaultMinValue=this.min;this.hasAttribute(selectors$D.dataMinValue)&&(defaultMinValue=parseFloat(this.getAttribute(selectors$D.dataMinValue)));let defaultMaxValue=this.max;this.hasAttribute(selectors$D.dataMaxValue)&&(defaultMaxValue=parseFloat(this.getAttribute(selectors$D.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.getAttribute(selectors$D.dataStep)&&(this.step=Math.abs(parseFloat(this.getAttribute(selectors$D.dataStep)))),this.reset(),this.maxX=this.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.touchRight.addEventListener("touchstart",this.onStartEvent,{passive:!0}),this.classList.add(classes$v.initialized)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.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.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.setAttribute(selectors$D.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.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.setAttribute(selectors$D.dataMaxValue,maxValue)}onStart(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:event.currentTarget===this.touchRight&&(this.x=this.touchRight.offsetLeft),this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,document.addEventListener("mousemove",this.onMoveEvent),document.addEventListener("mouseup",this.onStopEvent),document.addEventListener("touchmove",this.onMoveEvent,{passive:!0}),document.addEventListener("touchend",this.onStopEvent,{passive:!0})}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.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.getAttribute("on-change")&&new Function("min, max",this.getAttribute("on-change"))(this.getAttribute(selectors$D.dataMinValue),this.getAttribute(selectors$D.dataMaxValue)),this.onChange(this.getAttribute(selectors$D.dataMinValue),this.getAttribute(selectors$D.dataMaxValue))}onStop(){document.removeEventListener("mousemove",this.onMoveEvent),document.removeEventListener("mouseup",this.onStopEvent),document.removeEventListener("touchmove",this.onMoveEvent),document.removeEventListener("touchend",this.onStopEvent),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.getAttribute(selectors$D.dataMinValue),this.getAttribute(selectors$D.dataMaxValue))}onChange(min,max){const rangeHolder=this.closest(selectors$D.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$D.priceMin),priceMax=rangeHolder.querySelector(selectors$D.priceMax);priceMin&&priceMax&&(priceMin.value=min,priceMax.value=max)}}onChanged(min,max){this.hasAttribute(selectors$D.dataFilterUpdate)&&this.dispatchEvent(new CustomEvent("theme:range:update",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.setAttribute(selectors$D.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.setAttribute(selectors$D.dataMaxValue,maxValue)}onSidebarTransitionEnd(event){event.target==this.sidebar&&event.propertyName=="min-width"&&(this.sidebar.removeEventListener("transitionend",this.sidebarTransitionEvent),this.connectedCallback())}disconnectedCallback(){this.sidebar.removeEventListener("transitionend",this.sidebarTransitionEvent),this.resizeEvent&&document.removeEventListener("theme:resize:width",this.resizeEvent)}}const selectors$C={dataSort:"data-sort-enabled",sortLinks:"[data-sort-link]",sortValue:"data-value",sortButton:"[data-popout-toggle]",sortButtonText:"[data-sort-button-text]",collectionSidebar:"[data-collection-sidebar]",collectionSidebarSlideOut:"[data-collection-sidebar-slide-out]",collectionSidebarCloseButton:"[data-collection-sidebar-close]",groupTagsButton:"[data-aria-toggle]",collectionNav:"[data-collection-nav]",animation:"[data-animation]"}
12,classes$u={animated:"drawer--animated",hiding:"is-hiding",expanded:"expanded",noMobileAnimation:"no-mobile-animation",active:"is-active",focused:"is-focused"};let sections$j={};class Collection{constructor(section){this.container=section.container,this.sort=this.container.querySelector(`[${selectors$C.dataSort}]`),this.sortButton=this.container.querySelector(selectors$C.sortButton),this.sortLinks=this.container.querySelectorAll(selectors$C.sortLinks),this.collectionSidebar=this.container.querySelector(selectors$C.collectionSidebar),this.collectionSidebarCloseButtons=this.container.querySelectorAll(selectors$C.collectionSidebarCloseButton),this.groupTagsButton=this.container.querySelector(selectors$C.groupTagsButton),this.collectionNav=this.container.querySelector(selectors$C.collectionNav),this.accessibility=a11y,this.groupTagsButtonClickEvent=evt=>this.groupTagsButtonClick(evt),this.collectionSidebarCloseEvent=evt=>this.collectionSidebarClose(evt),this.onSortButtonClickEvent=e=>this.onSortButtonClick(e),this.onSortCheckEvent=e=>this.onSortCheck(e),this.sidebarResizeEvent=()=>this.toggleSidebarSlider(),this.init()}init(){this.sort&&this.initSort(),this.groupTagsButton!==null&&(document.addEventListener("theme:resize:width",this.sidebarResizeEvent),this.groupTagsButton.addEventListener("click",this.groupTagsButtonClickEvent),this.collectionSidebar&&setTimeout(()=>{this.collectionSidebar.classList.remove(classes$u.noMobileAnimation)},1e3),new MutationObserver(mutationList=>{for(const mutation of mutationList)mutation.type==="attributes"&&mutation.target.getAttribute("aria-expanded")=="true"&&this.showSidebarCallback()}).observe(this.groupTagsButton,{attributes:!0,childList:!1,subtree:!1})),this.collectionSidebarCloseButtons.length&&this.collectionSidebarCloseButtons.forEach(button=>{button.addEventListener("click",this.collectionSidebarCloseEvent)}),this.container.addEventListener("keyup",function(evt){evt.code==="Escape"&&this.hideSidebar()}.bind(this)),this.collectionSidebar&&(this.collectionSidebar.addEventListener("transitionend",()=>{this.collectionSidebar.classList.contains(classes$u.expanded)||this.collectionSidebar.classList.remove(classes$u.animated)}),this.toggleSidebarSlider(),this.collectionSidebar.addEventListener("theme:filter:update",()=>{const sidebarCloseButtons=this.container.querySelectorAll(selectors$C.collectionSidebarCloseButton);sidebarCloseButtons.length&&sidebarCloseButtons.forEach(button=>{button.addEventListener("click",this.collectionSidebarCloseEvent)})}))}sortActions(link,submitForm=!0){const sort=link?link.getAttribute(selectors$C.sortValue):"";this.sort.setAttribute(selectors$C.dataSort,sort);const sortButtonText=this.sort.querySelector(selectors$C.sortButtonText),sortActive=this.sort.querySelector(`.${classes$u.active}`);if(sortButtonText){const linkText=link?link.textContent.trim():"";sortButtonText.textContent=linkText}sortActive&&sortActive.classList.remove(classes$u.active),this.sort.classList.toggle(classes$u.active,link),link&&(link.parentElement.classList.add(classes$u.active),submitForm&&link.dispatchEvent(new CustomEvent("theme:filter:sort-update",{bubbles:!0,detail:{href:sort}})))}onSortButtonClick(e){e.preventDefault(),this.sortButton&&this.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$C.sortValue}="${val}"]`);if(key.includes("sort_by")&&linkSort){link=linkSort;break}}}this.sortActions(link,!1)}initSort(){this.sortLinks.forEach(link=>{link.addEventListener("click",this.onSortButtonClickEvent)}),this.sort.addEventListener("theme:filter:sort",this.onSortCheckEvent),this.sortButton&&this.sortButton.addEventListener("click",()=>{const isFiltersSidebarOpen=this.collectionSidebar.classList.contains(classes$u.expanded);isMobile()&&isFiltersSidebarOpen&&this.hideSidebar()})}showSidebarCallback(){const collectionSidebarSlideOut=this.container.querySelector(selectors$C.collectionSidebarSlideOut),isScrollLocked=document.documentElement.hasAttribute("data-scroll-locked"),isMobileView=isMobile();this.collectionSidebar.classList.add(classes$u.animated),collectionSidebarSlideOut===null&&!isMobileView&&isScrollLocked&&(this.accessibility.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))),(isMobileView||collectionSidebarSlideOut!==null)&&(collectionSidebarSlideOut&&this.accessibility.trapFocus(this.collectionSidebar,{elementToFocus:this.collectionSidebar.querySelector(selectors$C.collectionSidebarCloseButton)}),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})))}hideSidebar(){const collectionSidebarSlideOut=this.container.querySelector(selectors$C.collectionSidebarSlideOut),isScrollLocked=document.documentElement.hasAttribute("data-scroll-locked");
12this.groupTagsButton.setAttribute("aria-expanded","false"),this.collectionSidebar.classList.remove(classes$u.expanded),collectionSidebarSlideOut&&this.accessibility.removeTrapFocus(),isScrollLocked&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}toggleSidebarSlider(){isMobile()?this.hideSidebar():this.collectionSidebar.classList.contains(classes$u.expanded)&&this.showSidebarCallback()}collectionSidebarClose(evt){evt.preventDefault(),this.hideSidebar(),document.body.classList.contains(classes$u.focused)&&this.groupTagsButton&&this.groupTagsButton.focus()}groupTagsButtonClick(){document.documentElement.hasAttribute("data-scroll-locked")&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}onUnload(){this.groupTagsButton!==null&&(document.removeEventListener("theme:resize:width",this.sidebarResizeEvent),this.groupTagsButton.removeEventListener("click",this.groupTagsButtonClickEvent)),this.collectionSidebarCloseButtons.length&&this.collectionSidebarCloseButtons.forEach(button=>{button.removeEventListener("click",this.collectionSidebarCloseEvent)}),this.sort&&(this.sortLinks.forEach(link=>{link.removeEventListener("click",this.onSortButtonClickEvent)}),this.sort.removeEventListener("theme:filter:sort",this.onSortCheckEvent))}}register("collection",[slider,parallaxHero,{onLoad(){sections$j[this.id]=new Collection(this)},onUnload(){sections$j[this.id].onUnload()}},tooltipSection]),customElements.get("collection-filters-form")||customElements.define("collection-filters-form",CollectionFiltersForm),customElements.get("range-slider")||customElements.define("range-slider",RangeSlider);const selectors$B={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]",clone:"data-clone"},attributes$n={speed:"data-marquee-speed"},classes$t={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$B.scale),this.text=this.frame.querySelector(selectors$B.text),this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$t.comparitor),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$t.unloaded),this.checkWidthEvent=this.checkWidth.bind(this),this.listen()}listen(){this.frame.addEventListener("theme:marquee:refresh",this.checkWidthEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2,speed=this.frame.getAttribute(attributes$n.speed)?this.frame.getAttribute(attributes$n.speed):settings$2.textAnimationTime;if(this.frame.clientWidth-padding<this.comparitor.clientWidth||this.stopClone){if(this.text.classList.add(classes$t.animation),this.scale.childElementCount===1){if(this.clone=this.text.cloneNode(!0),this.clone.setAttribute(selectors$B.clone,""),this.scale.appendChild(this.clone),this.stopClone)for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(selectors$B.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$t.animation);let clone=this.scale.querySelector(`[${selectors$B.clone}]`);clone&&this.scale.removeChild(clone),this.text.classList.remove(classes$t.animation)}}}const selectors$A={barSlide:"[data-slide]",frame:"[data-ticker-frame]",header:"[data-header-wrapper]",slider:"[data-slider]",marquee:"[data-marquee]",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]"},classes$s={tickerAnimated:"ticker--animated",mobile:"mobile",desktop:"desktop"},attributes$m={slide:"data-slide",stop:"data-stop",style:"style",targetReferrer:"data-target-referrer"};class AnnouncementBar extends HTMLElement{constructor(){super(),this.locationPath=location.href,this.slides=this.querySelectorAll(selectors$A.barSlide),this.frames=this.querySelectorAll(selectors$A.frame),this.slider=this.querySelector(selectors$A.slider),this.marquee=this.querySelector(selectors$A.marquee),this.enableSlider=(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)>=theme.sizes.small,this.initSliderEvent=event=>this.initSlider(event),this.tickerResizeEvent=event=>this.onTickerResize(event)}connectedCallback(){this.removeAnnouncement(),this.slider&&this.initSliders(),this.marquee&&this.initTickers(!0),this.addEventListener("theme:block:select",e=>{this.onBlockSelect(e)}),this.addEventListener("theme:block:deselect",e=>{this.onBlockDeselect(e)}),document.dispatchEvent(new CustomEvent("theme:announcement:init",{bubbles:!0}))}removeAnnouncement(){for(let index=0;
12index<this.slides.length;index++){const element=this.slides[index];element.hasAttribute(attributes$m.targetReferrer)&&this.locationPath.indexOf(element.getAttribute(attributes$m.targetReferrer))===-1&&!window.Shopify.designMode&&element.parentNode.removeChild(element)}}initSliders(){this.initSlider(),document.addEventListener("theme:resize:width",this.initSliderEvent),this.addEventListener("theme:slider:loaded",()=>{this.initTickers()})}initSlider(event){const windowWidth=window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth;if(windowWidth>=theme.sizes.small&&this.enableSlider||windowWidth<theme.sizes.small&&!this.enableSlider){let slidesSelector="";this.slider.flkty?.destroy(),windowWidth>=theme.sizes.small&&this.enableSlider?(this.enableSlider=!1,slidesSelector=`${selectors$A.barSlide}:not(.${classes$s.mobile})`):windowWidth<theme.sizes.small&&!this.enableSlider&&(this.enableSlider=!0,slidesSelector=`${selectors$A.barSlide}:not(.${classes$s.desktop})`),this.slider=new Slider(this,this.querySelector(selectors$A.slider),slidesSelector),this.slider.flkty?.reposition()}this.slider.flkty||this.initTickers()}initTickers(stopClone=!1){this.frames.forEach(element=>{new Ticker(element,stopClone)}),document.addEventListener("theme:resize:width",this.tickerResizeEvent)}onTickerResize(){this.frames.forEach(element=>{element.dispatchEvent(new CustomEvent("theme:marquee:refresh"))})}toggleTicker(e,isStopped){const tickerScale=this.querySelector(selectors$A.tickerScale),element=this.querySelector(`[${attributes$m.slide}="${e.detail.blockId}"]`);isStopped&&element&&(tickerScale.setAttribute(attributes$m.stop,""),tickerScale.querySelectorAll(selectors$A.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes$s.tickerAnimated),textHolder.style.transform=`translate3d(${-(element.offsetLeft-element.clientWidth)}px, 0, 0)`})),!isStopped&&element&&(tickerScale.querySelectorAll(selectors$A.tickerText).forEach(textHolder=>{textHolder.classList.add(classes$s.tickerAnimated),textHolder.removeAttribute(attributes$m.style)}),tickerScale.removeAttribute(attributes$m.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)}disconnectedCallback(){document.removeEventListener("theme:resize:width",this.initSliderEvent),document.removeEventListener("theme:resize:width",this.tickerResizeEvent)}}customElements.get("announcement-bar")||customElements.define("announcement-bar",AnnouncementBar);const selectors$z={body:"body",drawerWrappper:"[data-drawer]",drawerInner:"[data-drawer-inner]",underlay:"[data-drawer-underlay]",stagger:"[data-stagger-animation]",wrapper:"[data-header-wrapper]",drawerToggle:"data-drawer-toggle",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])'},classes$r={animated:"drawer--animated",open:"is-open",isFocused:"is-focused",headerStuck:"js__header__stuck"};let sections$i={};class Drawer{constructor(el){this.drawer=el,this.drawerWrapper=this.drawer.closest(selectors$z.drawerWrappper),this.drawerInner=this.drawer.querySelector(selectors$z.drawerInner),this.underlay=this.drawer.querySelector(selectors$z.underlay),this.wrapper=this.drawer.closest(selectors$z.wrapper),this.key=this.drawer.dataset.drawer,this.btnSelector=`[${selectors$z.drawerToggle}='${this.key}']`,this.buttons=document.querySelectorAll(this.btnSelector),this.staggers=this.drawer.querySelectorAll(selectors$z.stagger),this.body=document.querySelector(selectors$z.body),this.accessibility=a11y,this.initWatchFocus=evt=>this.watchFocus(evt),this.showDrawer=this.showDrawer.bind(this),this.hideDrawer=this.hideDrawer.bind(this),this.connectToggle(),this.connectDrawer(),this.closers()}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$r.open)?this.drawer.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!0}
12)):this.drawer.dispatchEvent(new CustomEvent("theme:drawer:open",{bubbles:!0}))}),this.drawerInner&&this.drawerInner.addEventListener("transitionend",event=>{event.target==this.drawerInner&&(this.drawer.classList.contains(classes$r.open)||(this.drawer.classList.remove(classes$r.animated),document.dispatchEvent(new CustomEvent("theme:sliderule:close",{bubbles:!1}))))}),document.addEventListener("theme:cart:open",this.hideDrawer),document.addEventListener("theme:drawer:close",this.hideDrawer),document.addEventListener("theme:drawer:open",this.showDrawer)}watchFocus(evt){!this.wrapper.contains(evt.target)&&this.body.classList.contains(classes$r.isFocused)&&this.hideDrawer()}closers(){this.wrapper.addEventListener("keyup",function(evt){evt.code==="Escape"&&(this.hideDrawer(),this.buttons[0].focus())}.bind(this)),this.underlay.addEventListener("click",()=>{this.hideDrawer()})}showDrawer(){this.drawerInner&&this.drawerInner.querySelector(this.btnSelector)&&(this.accessibility.removeTrapFocus(),this.drawerInner.addEventListener("transitionend",event=>{event.target==this.drawerInner&&this.drawer.classList.contains(classes$r.open)&&this.accessibility.trapFocus(this.drawerInner,{elementToFocus:this.drawerInner.querySelector(this.btnSelector)})})),this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!0)}),this.drawer.classList.add(classes$r.open),this.drawer.classList.add(classes$r.animated),this.drawer.querySelector(selectors$z.focusable).focus(),document.addEventListener("focusin",this.initWatchFocus),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}))}hideDrawer(){this.drawer.classList.contains(classes$r.open)&&(this.accessibility.removeTrapFocus(),this.body.classList.contains(classes$r.isFocused)&&this.buttons.length&&this.buttons[0].focus(),this.buttons.forEach(el=>{el.setAttribute("aria-expanded",!1)}),this.drawer.classList.remove(classes$r.open),document.removeEventListener("focusin",this.initWatchFocus),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})))}onUnload(){document.removeEventListener("theme:cart:open",this.hideDrawer),document.removeEventListener("theme:drawer:close",this.hideDrawer),document.removeEventListener("theme:drawer:open",this.showDrawer)}}const drawer={onLoad(){sections$i[this.id]=[],this.container.querySelectorAll(selectors$z.drawerWrappper).forEach(el=>{sections$i[this.id].push(new Drawer(el))})},onUnload(){sections$i[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}},selectors$y={headerWrapper:"[data-header-wrapper]",header:"[data-header-wrapper] header",pageHeader:".page-header"},classes$q={stuck:"js__header__stuck",sticky:"has-header-sticky",headerGroup:"shopify-section-group-header-group"},attributes$l={stickyHeader:"data-header-sticky",scrollLock:"data-scroll-locked"};let sections$h={};class Sticky{constructor(el){this.wrapper=el,this.sticks=this.wrapper.hasAttribute(attributes$l.stickyHeader),document.body.classList.toggle(classes$q.sticky,this.sticks),this.sticks&&(this.isStuck=!1,this.cls=this.wrapper.classList,this.headerOffset=document.querySelector(selectors$y.pageHeader)?.offsetTop,this.headerHeight=document.querySelector(selectors$y.header).clientHeight,this.updateHeaderOffset=this.updateHeaderOffset.bind(this),this.scrollEvent=e=>this.onScroll(e),this.listen(),this.stickOnLoad())}listen(){document.addEventListener("theme:scroll",this.scrollEvent),document.addEventListener("shopify:section:load",this.updateHeaderOffset),document.addEventListener("shopify:section:unload",this.updateHeaderOffset)}onScroll(e){e.detail.down?!this.isStuck&&e.detail.position>this.headerOffset&&this.stickSimple():e.detail.position<=this.headerOffset&&this.unstickSimple()}updateHeaderOffset(event){event.target.classList.contains(classes$q.headerGroup)&&setTimeout(()=>{this.headerOffset=document.querySelector(selectors$y.pageHeader)?.offsetTop})}stickOnLoad(){window.scrollY>this.headerOffset&&this.stickSimple()}stickSimple(){this.cls.add(classes$q.stuck),this.isStuck=!0}unstickSimple(){document.documentElement.hasAttribute(attributes$l.scrollLock)||(this.cls.remove(classes$q.stuck),this.isStuck=!1)}unload(){document.removeEventListener("theme:scroll",this.scrollEvent),document.removeEventListener("shopify:section:load",this.updateHeaderOffset),document.removeEventListener("shopify:section:unload",this.updateHeaderOffset)}}const stickyHeader={onLoad(){sections$h=new Sticky(this.container)},onUnload:function(){typeof sections$h.unload=="function"&&sections$h.unload()}},selectors$x={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
12([tabindex="-1"])'},classes$p={isVisible:"is-visible",meganavVisible:"meganav--visible",meganavIsTransitioning:"meganav--is-transitioning"};let sections$g={},disclosures={};class HoverDisclosure{constructor(el){this.disclosure=el,this.wrapper=el.closest(selectors$x.wrapper),this.key=this.disclosure.id,this.trigger=document.querySelector(`[${selectors$x.disclosureToggle}='${this.key}']`),this.link=this.trigger.querySelector(selectors$x.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$p.meganavIsTransitioning),this.grandparent?this.wrapper.classList.add(classes$p.meganavVisible):this.wrapper.classList.remove(classes$p.meganavVisible),this.trigger.setAttribute("aria-expanded",!0),this.trigger.classList.add(classes$p.isVisible),this.disclosure.classList.add(classes$p.isVisible),this.transitionTimeout&&clearTimeout(this.transitionTimeout),this.transitionTimeout=setTimeout(()=>{this.wrapper.classList.remove(classes$p.meganavIsTransitioning)},200)}hideDisclosure(){this.disclosure.classList.remove(classes$p.isVisible),this.trigger.classList.remove(classes$p.isVisible),this.trigger.setAttribute("aria-expanded",!1),this.wrapper.classList.remove(classes$p.meganavVisible,classes$p.meganavIsTransitioning)}staggerChildAnimations(){this.disclosure.querySelectorAll(selectors$x.stagger).forEach((el,index)=>{el.style.transitionDelay=`${index*50+10}ms`}),this.disclosure.querySelectorAll(selectors$x.staggerPair).forEach((child,i)=>{const d1=i*100;child.style.transitionDelay=`${d1}ms`,child.parentElement.querySelectorAll(selectors$x.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$p.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.code==="Escape"&&this.hideDisclosure()})}}const hoverDisclosure={onLoad(){sections$g[this.id]=[],disclosures=this.container.querySelectorAll(selectors$x.disclosureWrappper),disclosures.forEach(el=>{sections$g[this.id].push(new HoverDisclosure(el))})},onBlockSelect(evt){sections$g[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$g[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}},selectors$w={count:"data-cart-count"};class Totals{constructor(el){this.section=el,this.counts=this.section.querySelectorAll(`[${selectors$w.count}]`),this.cartCount=null,this.listen()}listen(){document.addEventListener("theme:cart:change",event=>{this.cartCount=event.detail.cartCount,this.update()})}update(){this.cartCount!==null&&this.counts.forEach(count=>{count.setAttribute(selectors$w.count,this.cartCount),count.innerHTML=this.cartCount<10?`${this.cartCount}`:"9+"})}}const headerTotals={onLoad(){new Totals(this.container)}},selectors$v={slideruleOpen:"data-sliderule-open",slideruleClose:"data-sliderule-close",sliderulePane:"data-sliderule-pane",slideruleWrappper:"[data-sliderule]",drawerContent:"[data-drawer-content]",focusable:'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])',dataAnimates:"data-animates",children:`:scope > [data-animates],
13             :scope > * > [data-animates],
14             :scope > * > * >[data-animates],
15             :scope > * > .sliderule-grid  > *`},classes$o={isVisible:"is-visible",isHiding:"is-hiding",isHidden:"is-hidden",focused:"is-focused",scrolling:"is-scrolling"};let sections$f={};class HeaderMobileSliderule{constructor(el){this.sliderule=el,this.key=this.sliderule.id;const btnSelector=`[${selectors$v.slideruleOpen}='${this.key}']`;this.exitSelector=`[${selectors$v.slideruleClose}='${this.key}']`,this.trigger=document.querySelector(btnSelector),this.exit=document.querySelectorAll(this.exitSelector),this.pane=document.querySelector(`[${selectors$v.sliderulePane}]`),this.children=this.sliderule.querySelectorAll(selectors$v.children),this.drawerContent=document.querySelector(selectors$v.drawerContent),this.cachedButton=null,this.accessibility=a11y,this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.closeSliderule=this.closeSliderule.bind(this),this.clickEvents(),this.keyboardEvents(),document.addEventListener("theme:sliderule:close",this.closeSliderule)}clickEvents(){this.trigger.addEventListener("click",()=>{this.cachedButton=this.trigger,this.showSliderule()}),this.exit.forEach(element=>{element.addEventListener("click",()=>{this.hideSliderule()})})}keyboardEvents(){this.sliderule.addEventListener("keyup",evt=>{evt.stopPropagation(),evt.code==="Escape"&&this.hideSliderule()})}trapFocusSliderule(showSliderule=!0){const trapFocusButton=showSliderule?this.sliderule.querySelector(this.exitSelector):this.cachedButton;this.accessibility.removeTrapFocus(),trapFocusButton&&this.drawerContent&&this.accessibility.trapFocus(this.drawerContent,{elementToFocus:document.body.classList.contains(classe
15s$o.focused)?trapFocusButton:null})}hideSliderule(close=!1){const newPosition=parseInt(this.pane.dataset.sliderulePane,10)-1;this.pane.setAttribute(selectors$v.sliderulePane,newPosition),this.pane.classList.add(classes$o.isHiding),this.sliderule.classList.add(classes$o.isHiding);const hiddenSelector=close?`[${selectors$v.dataAnimates}].${classes$o.isHidden}`:`[${selectors$v.dataAnimates}="${newPosition}"]`,hiddenItems=this.pane.querySelectorAll(hiddenSelector);hiddenItems.length&&hiddenItems.forEach(element=>{element.classList.remove(classes$o.isHidden)});const children=close?this.pane.querySelectorAll(`.${classes$o.isVisible}, .${classes$o.isHiding}`):this.children;children.forEach((element,index)=>{const lastElement=children.length-1==index;element.classList.remove(classes$o.isVisible),close&&(element.classList.remove(classes$o.isHiding),this.pane.classList.remove(classes$o.isHiding));const removeHidingClass=()=>{parseInt(this.pane.getAttribute(selectors$v.sliderulePane))===newPosition&&this.sliderule.classList.remove(classes$o.isVisible),this.sliderule.classList.remove(classes$o.isHiding),this.pane.classList.remove(classes$o.isHiding),lastElement&&(this.accessibility.removeTrapFocus(),close||this.trapFocusSliderule(!1)),element.removeEventListener("animationend",removeHidingClass)};window.theme.settings.enableAnimations?element.addEventListener("animationend",removeHidingClass):removeHidingClass()})}showSliderule(){let lastScrollableFrame=null;const parent=this.sliderule.closest(`.${classes$o.isVisible}`);let lastScrollableElement=this.pane;parent&&(lastScrollableElement=parent),lastScrollableElement.scrollTo({top:0,left:0,behavior:"smooth"}),lastScrollableElement.classList.add(classes$o.scrolling);const lastScrollableIsScrolling=()=>{lastScrollableElement.scrollTop<=0?(lastScrollableElement.classList.remove(classes$o.scrolling),lastScrollableFrame&&cancelAnimationFrame(lastScrollableFrame)):lastScrollableFrame=requestAnimationFrame(lastScrollableIsScrolling)};lastScrollableFrame=requestAnimationFrame(lastScrollableIsScrolling),this.sliderule.classList.add(classes$o.isVisible);const oldPosition=parseInt(this.pane.dataset.sliderulePane,10),newPosition=oldPosition+1;this.pane.setAttribute(selectors$v.sliderulePane,newPosition);const hiddenItems=this.pane.querySelectorAll(`[${selectors$v.dataAnimates}="${oldPosition}"]`);hiddenItems.length&&hiddenItems.forEach((element,index)=>{const lastElement=hiddenItems.length-1==index;element.classList.add(classes$o.isHiding);const removeHidingClass=()=>{element.classList.remove(classes$o.isHiding),parseInt(this.pane.getAttribute(selectors$v.sliderulePane))!==oldPosition&&element.classList.add(classes$o.isHidden),lastElement&&this.trapFocusSliderule(),element.removeEventListener("animationend",removeHidingClass)};window.theme.settings.enableAnimations?element.addEventListener("animationend",removeHidingClass):removeHidingClass()})}closeSliderule(){this.pane&&this.pane.hasAttribute(selectors$v.sliderulePane)&&parseInt(this.pane.getAttribute(selectors$v.sliderulePane))>0&&(this.hideSliderule(!0),parseInt(this.pane.getAttribute(selectors$v.sliderulePane))>0&&this.pane.setAttribute(selectors$v.sliderulePane,0))}onUnload(){document.removeEventListener("theme:sliderule:close",this.closeSliderule)}}const headerMobileSliderule={onLoad(){sections$f[this.id]=[],this.container.querySelectorAll(selectors$v.slideruleWrappper).forEach(el=>{sections$f[this.id].push(new HeaderMobileSliderule(el))})},onUnload(){sections$f[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}},selectors$u={wrapper:"[data-header-wrapper]",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",deadLink:'.navlink[href="#"]',cartToggleButton:"[data-cart-toggle]",firstSectionOverlayHeader:".main-content > .shopify-section.section-overlay-header:first-of-type"},classes$n={transparent:"has-header-transparent",firstSectionOverlayHeader:"has-first-section-overlay-header"},attributes$k={transparent:"data-header-transparent"};let sections$e={};class Header{constructor(el){this.wrapper=el,this.style=this.wrapper.dataset.style,this.desktop=this.wrapper.querySelector(selectors$u.desktop),this.deadLinks=document.querySelectorAll(selectors$u.deadLink),this.resizeObserver=null,this.checkWidth=this.checkWidth.bind(this),this.killDeadLinks(),this.style!=="drawer"&&this.desktop&&(this.minWidth=this.getMinWidth(),this.listenWidth()),this.cartToggleEvent();const firstSectionOverlayHeader=document.querySelector(selectors$u.firstSectionOverlayHeader);document.body.classList.toggle(classes$n.transparent,this.wrapper.hasAttribute(attributes$k.transparent)),document.body.classList.toggle(classes$n.firstSectionOverlayHeader,firstSectionOverlayHeader)}listenWidth(){"ResizeObserver"in window?(this.resizeObserver=new ResizeObserver(this.checkWidth),this.resizeObserver.observe(this.wrapper)):document.addEventListener("theme:resize",this.checkWidth)}killDeadLinks(){this.deadLinks.forEach(el=>{el.onclick=e=>{e.preventDefault()}})}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;
15return 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}cartToggleEvent(){const cartToggleButtons=this.wrapper.querySelectorAll(selectors$u.cartToggleButton);cartToggleButtons.length&&cartToggleButtons.forEach(button=>{button.addEventListener("click",e=>{e.preventDefault(),document.dispatchEvent(new CustomEvent("theme:cart:toggle",{bubbles:!0}))})})}unload(){"ResizeObserver"in window?this.resizeObserver?.unobserve(this.wrapper):document.removeEventListener("theme:resize",this.checkWidth)}}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}register("header",[{onLoad(){sections$e=new Header(this.container)},onUnload(){typeof sections$e.unload=="function"&&sections$e.unload()}},drawer,headerMobileSliderule,stickyHeader,hoverDisclosure,headerTotals]);const selectors$t={scrollElement:"[data-block-scroll]",flickityEnabled:"flickity-enabled"},sections$d={};class BlockScroll{constructor(el){this.container=el.container}onBlockSelect(evt){const scrollElement=this.container.querySelector(selectors$t.scrollElement);if(scrollElement&&!scrollElement.classList.contains(selectors$t.flickityEnabled)){const currentElement=evt.srcElement;currentElement&&scrollElement.scrollTo({top:0,left:currentElement.offsetLeft,behavior:"smooth"})}}}const blockScroll={onLoad(){sections$d[this.id]=new BlockScroll(this)},onBlockSelect(e){sections$d[this.id].onBlockSelect(e)}},selectors$s={slider:"[data-slider-mobile]",slide:"[data-slide]",thumb:"[data-slider-thumb]",sliderContainer:"[data-slider-container]",popupContainer:"[data-popup-container]",popupClose:"[data-popup-close]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},classes$m={isAnimating:"is-animating",isSelected:"is-selected",isOpen:"is-open"},attributes$j={thumbValue:"data-slider-thumb"},sections$c={};class Look{constructor(section){this.container=section.container,this.slider=this.container.querySelector(selectors$s.slider),this.slides=this.container.querySelectorAll(selectors$s.slide),this.thumbs=this.container.querySelectorAll(selectors$s.thumb),this.popupContainer=this.container.querySelector(selectors$s.popupContainer),this.popupClose=this.container.querySelectorAll(selectors$s.popupClose),this.popupCloseByEvent=this.popupCloseByEvent.bind(this),this.init()}init(){this.slider&&this.slides.length&&this.thumbs.length&&(this.popupContainer.addEventListener("transitionend",e=>{e.target==this.popupContainer&&(this.popupContainer.classList.remove(classes$m.isAnimating),e.target.classList.contains(classes$m.isOpen)?this.popupOpenCallback():this.popupCloseCallback())}),this.popupContainer.addEventListener("transitionstart",e=>{e.target==this.popupContainer&&this.popupContainer.classList.add(classes$m.isAnimating)}),this.popupClose.forEach(button=>{button.addEventListener("click",()=>{this.popupContainer.classList.remove(classes$m.isOpen),this.scrollUnlock()})}),this.thumbs.forEach((thumb,i)=>{thumb.addEventListener("click",e=>{e.preventDefault();const idx=thumb.hasAttribute(attributes$j.thumbValue)&&thumb.getAttribute(attributes$j.thumbValue)!==""?parseInt(thumb.getAttribute(attributes$j.thumbValue)):i,slide=this.slides[idx];if(isMobile()){const parentPadding=parseInt(window.getComputedStyle(this.slider).paddingLeft),slideLeft=slide.offsetLeft;this.slider.scrollTo({top:0,left:slideLeft-parentPadding,behavior:"auto"}),this.scrollLock(),this.popupContainer.classList.add(classes$m.isAnimating,classes$m.isOpen)}else{const headerHeight=document.querySelector(selectors$s.headerSticky)&&document.querySelector(selectors$s.headerHeight)?document.querySelector(selectors$s.headerHeight).getBoundingClientRect().height:0,slideTop=slide.getBoundingClientRect().top,slideHeightHalf=slide.offsetHeight/2,windowHeight=window.innerHeight,windowHeightHalf=windowHeight/2,sliderContainer=this.container.querySelector(selectors$s.sliderContainer);let scrollTarget=slideTop+slideHeightHalf-windowHeightHalf+window.scrollY;if(sliderContainer){const sliderContainerTop=sliderContainer.getBoundingClientRect().top+window.scrollY,sliderContainerHeight=sliderContainer.offsetHeight,sliderContainerBottom=sliderContainerTop+sliderContainerHeight;
15scrollTarget<sliderContainerTop?scrollTarget=sliderContainerTop-headerHeight:scrollTarget+windowHeight>sliderContainerBottom&&(scrollTarget=sliderContainerBottom-windowHeight)}window.scrollTo({top:scrollTarget,left:0,behavior:"smooth"})}})}))}popupCloseByEvent(){this.popupContainer.classList.remove(classes$m.isOpen)}popupOpenCallback(){document.addEventListener("theme:quick-add:open",this.popupCloseByEvent,{once:!0}),document.addEventListener("theme:product:added",this.popupCloseByEvent,{once:!0})}popupCloseCallback(){document.removeEventListener("theme:quick-add:open",this.popupCloseByEvent,{once:!0}),document.removeEventListener("theme:product:added",this.popupCloseByEvent,{once:!0})}scrollLock(){document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}))}scrollUnlock(){document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}}register("look",[{onLoad(){sections$c[this.id]=new Look(this)}},blockScroll]);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$r={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 ProductFormReader{constructor(element,product,options){this.element=element,this.product=this._validateProductObject(product),this.variantElement=this.element.querySelector(selectors$r.idInput),options=options||{},this._listeners=new Listeners,this._listeners.add(this.element,"submit",this._onSubmit.bind(this,options)),this.optionInputs=this._initInputs(selectors$r.optionInput,options.onOptionChange),this.planInputs=this._initInputs(selectors$r.planInput,options.onPlanChange),this.quantityInputs=this._initInputs(selectors$r.quantityInput,options.onQuantityChange),this.propertyInputs=this._initInputs(selectors$r.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]}
15plan(variant){let plan={allocation:null,group:null,detail:null};const sellingPlanChecked=this.element.querySelector(`${selectors$r.planInput}:checked`);if(!sellingPlanChecked)return null;const sellingPlanCheckedValue=sellingPlanChecked.value,id=sellingPlanCheckedValue&&sellingPlanCheckedValue!==""?sellingPlanCheckedValue:null;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.propertyInputs,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 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$q={scrollbarAttribute:"data-scrollbar",scrollbar:"data-scrollbar-slider",scrollbarSlideFullWidth:"data-scrollbar-slide-fullwidth",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]"},classes$l={hidden:"is-hidden"},settings$1={delay:200};class NativeScrollbar{constructor(scrollbar){this.scrollbar=scrollbar,this.arrowNext=this.scrollbar.parentNode.querySelector(selectors$q.scrollbarArrowNext),this.arrowPrev=this.scrollbar.parentNode.querySelector(selectors$q.scrollbarArrowPrev),this.scrollbar.hasAttribute(selectors$q.scrollbarAttribute)&&(this.init(),this.resize()),this.scrollbar.hasAttribute(selectors$q.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$q.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2)+this.scrollbar.scrollLeft;this.move(position),this.arrowPrev.classList.remove(classes$l.hidden),this.toggleNextArrow()}goToPrev(){const moveWith=this.scrollbar.hasAttribute(selectors$q.scrollbarSlideFullWidth)?this.scrollbar.getBoundingClientRect().width:this.scrollbar.getBoundingClientRect().width/2,position=this.scrollbar.scrollLeft-moveWith;this.move(position),this.arrowNext.classList.remove(classes$l.hidden),this.togglePrevArrow()}toggleNextArrow(){setTimeout(()=>{this.arrowNext.classList.toggle(classes$l.hidden,Math.round(this.scrollbar.scrollLeft+this.scrollbar.getBoundingClientRect().width+1)>=this.scrollbar.scrollWidth)},settings$1.delay)}togglePrevArrow(){setTimeout(()=>{this.arrowPrev.classList.toggle(classes$l.hidden,this.scrollbar.scrollLeft<=0)},settings$1.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 selectors$p={gridSwatchForm:"[data-grid-swatch-form]",input:"[data-swatch-input]",productItem:"[data-product-grid-item]",productInfo:"[data-product-information]",sectionId:"[data-section-id]",productImage:"[data-product-image]",swatchButton:"[data-swatch-button]",swatchLink:"[data-swatch-link]",template:"[data-swatch-template]"},classes$k={visible:"is-visible",hidden:"hidden",stopEvents:"no-events",swatch:"swatch"},attributes$i={image:"data-swatch-image",handle:"data-swatch-handle",label:"data-swatch-label",scrollbar:"data-scrollbar",swatchCount:"data-swatch-count",tooltip:"data-tooltip",variant:"data-swatch-variant",variantName:"data-swatch-variant-name",variantTitle:"data-variant-title"};class RadioSwatch extends HTMLElement{constructor(){super()}connectedCallback(){this.hasAttribute(attributes$i.tooltip)&&new Tooltip(this)}}class GridSwatch extends HTMLElement{constructor(){super(),this.productItemMouseLeaveEvent=()=>this.hideVariantImages(),this.showVariantImageEvent=swatchButton=>this.showVariantImage(swatchButton)}connectedCallback(){this.handle=this.getAttribute(attributes$i.handle),this.productItem=this.closest(selectors$p.productItem),this.productInfo=this.closest(selectors$p.productInfo),this.productImage=this.productItem.querySelector(selectors$p.productImage),this.template=document.querySelector(selectors$p.template).innerHTML;const label=this.getAttribute(attributes$i.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())})}
15init(){this.innerHTML="",this.count=0,this.swatches.forEach(swatch=>{let variant=null,variantAvailable=!1,image="";for(const productVariant of this.product.variants){const optionWithSwatch=productVariant.options.includes(swatch);if(!variant&&optionWithSwatch&&(variant=productVariant),optionWithSwatch&&productVariant.featured_media){image=productVariant.featured_media.preview_image.src,variant=productVariant;break}}for(const productVariant of this.product.variants)if(productVariant.options.includes(swatch)&&productVariant.available){variantAvailable=!0;break}if(variant){const swatchTemplate=document.createElement("div");swatchTemplate.innerHTML=this.template;const swatchButton=swatchTemplate.querySelector(selectors$p.swatchButton),swatchLink=swatchTemplate.querySelector(selectors$p.swatchLink),swatchHandle=swatch.trim().toLowerCase().replaceAll(" ","-"),variantTitle=variant.title.replaceAll('"',"'");swatchButton.style=`--animation-delay: ${100*this.count/1e3}s`,swatchButton.classList.add(`${classes$k.swatch}-${swatchHandle}`),swatchButton.dataset.tooltip=swatch,swatchButton.dataset.swatchVariant=variant.id,swatchButton.dataset.swatchVariantName=variantTitle,swatchButton.dataset.swatchImage=image,swatchButton.dataset.variant=variant.id,swatchButton.style.setProperty("--swatch",`var(--${swatchHandle})`),swatchLink.href=getUrlWithVariant(this.product.url,variant.id),swatchLink.innerText=swatch,swatchLink.dataset.swatch=swatch,swatchLink.disabled=!variantAvailable,this.innerHTML+=swatchTemplate.innerHTML,this.count++}}),this.swatchCount=this.productInfo.querySelector(`[${attributes$i.swatchCount}]`),this.swatchElements=this.querySelectorAll(selectors$p.swatchLink),this.swatchForm=this.productInfo.querySelector(selectors$p.gridSwatchForm),this.hideSwatchesTimer=0,this.swatchCount.hasAttribute(attributes$i.swatchCount)&&(this.swatchCount.innerText=`${this.count} ${this.count>1?theme.strings.otherColor:theme.strings.oneColor}`,this.swatchCount.addEventListener("mouseenter",()=>{this.hideSwatchesTimer&&clearTimeout(this.hideSwatchesTimer),this.productInfo.classList.add(classes$k.stopEvents),this.swatchForm.classList.add(classes$k.visible)}),this.productInfo.addEventListener("mouseleave",()=>{this.hideSwatchesTimer=setTimeout(()=>{this.productInfo.classList.remove(classes$k.stopEvents),this.swatchForm.classList.remove(classes$k.visible)},100)})),this.hasAttribute(attributes$i.scrollbar)&&new NativeScrollbar(this),this.showDeferredImage(),this.bindSwatchButtonEvents()}showDeferredImage(){const deferredImages=this.productItem.querySelectorAll(`[${attributes$i.variantTitle}]`);deferredImages.length&&this.productItem.addEventListener("mouseenter",()=>{deferredImages.forEach(image=>{image.classList.remove(classes$k.hidden)})},{once:!0})}bindSwatchButtonEvents(){this.querySelectorAll(selectors$p.swatchButton)?.forEach(swatchButton=>{swatchButton.addEventListener("mouseenter",this.showVariantImageEvent),swatchButton.hasAttribute(attributes$i.tooltip)&&new Tooltip(swatchButton)}),this.productItem.addEventListener("mouseleave",this.productItemMouseLeaveEvent)}showVariantImage(event){const variantName=event.target.getAttribute(attributes$i.variantName)?.replaceAll('"',"'"),variantImages=this.productImage.querySelectorAll(`[${attributes$i.variantTitle}]`),variantImageSelected=this.productImage.querySelector(`[${attributes$i.variantTitle}="${variantName}"]`);variantImages?.forEach(image=>{image.classList.remove(classes$k.visible)}),variantImageSelected?.classList.add(classes$k.visible)}hideVariantImages(){this.productImage.querySelectorAll(`[${attributes$i.variantTitle}].${classes$k.visible}`)?.forEach(image=>{image.classList.remove(classes$k.visible)})}}const selectors$o={productCutline:"[data-product-cutline]",productLink:"[data-product-link]",productGridItem:"[data-product-grid-item]",productInfo:"[data-product-information]",productImage:"[data-product-image-default]",productImageSibling:"[data-product-image-sibling]",productPrice:"[data-product-price]",siblingsInnerHolder:"[data-sibling-inner]",siblingCount:"[data-sibling-count]",siblingHolder:"[data-sibling-holder]",siblingFieldset:"[data-sibling-fieldset]",siblingLink:"[data-sibling-link]",tooltip:"[data-tooltip]"},classes$j={visible:"is-visible",fade:"is-fade",stopEvents:"no-events",active:"is-active"}
15,attributes$h={siblingAddedImage:"data-sibling-added-image",siblingCutline:"data-sibling-cutline",siblingImage:"data-sibling-image",siblingLink:"data-sibling-link",siblingPrice:"data-sibling-price",productLink:"data-product-link"};class SiblingSwatches{constructor(swatches,product){this.swatches=swatches,this.product=product,this.productLinks=this.product.querySelectorAll(selectors$o.productLink),this.productCutline=this.product.querySelector(selectors$o.productCutline),this.productPrice=this.product.querySelector(selectors$o.productPrice),this.productImage=this.product.querySelector(selectors$o.productImage),this.productImageSibling=this.product.querySelector(selectors$o.productImageSibling),this.init()}init(){this.cacheDefaultValues(),this.product.addEventListener("mouseleave",()=>this.resetProductValues()),this.swatches.forEach(swatch=>{swatch.addEventListener("mouseenter",event=>this.showSibling(event))}),this.productLinks.length&&this.swatches.forEach(swatch=>{swatch.addEventListener("click",()=>{this.productLinks[0].click()})})}cacheDefaultValues(){this.productLinkValue=this.productLinks[0].hasAttribute(attributes$h.productLink)?this.productLinks[0].getAttribute(attributes$h.productLink):"",this.productPriceValue=this.productPrice.innerHTML,this.productCutline&&(this.productCutlineValue=this.productCutline.innerHTML)}resetProductValues(){this.product.classList.remove(classes$j.active),this.productLinkValue&&this.productLinks.forEach(productLink=>{productLink.href=this.productLinkValue}),this.productPrice&&(this.productPrice.innerHTML=this.productPriceValue),this.productCutline&&this.productCutline&&(this.productCutline.innerHTML=this.productCutlineValue),this.hideSiblingImage()}showSibling(event){const swatch=event.target,siblingLink=swatch.hasAttribute(attributes$h.siblingLink)?swatch.getAttribute(attributes$h.siblingLink):"",siblingPrice=swatch.hasAttribute(attributes$h.siblingPrice)?swatch.getAttribute(attributes$h.siblingPrice):"",siblingCutline=swatch.hasAttribute(attributes$h.siblingCutline)?swatch.getAttribute(attributes$h.siblingCutline):"",siblingImage=swatch.hasAttribute(attributes$h.siblingImage)?swatch.getAttribute(attributes$h.siblingImage):"";siblingLink&&this.productLinks.forEach(productLink=>{productLink.href=siblingLink}),siblingPrice&&(this.productPrice.innerHTML=siblingPrice),siblingCutline?this.productCutline.innerHTML=siblingCutline:this.productCutline.innerHTML="",siblingImage&&this.showSiblingImage(siblingImage)}showSiblingImage(siblingImage){if(!this.productImageSibling)return;const ratio=window.devicePixelRatio||1,pixels=this.productImage.offsetWidth*ratio,widthRounded=Math.ceil(pixels/180)*180,imageSrc=themeImages.getSizedImageUrl(siblingImage,`${widthRounded}x`),imageExists=this.productImageSibling.querySelector(`[src="${imageSrc}"]`),showCurrentImage=()=>{this.productImageSibling.classList.add(classes$j.visible),this.productImageSibling.querySelector(`[src="${imageSrc}"]`).classList.add(classes$j.fade)},swapImages=()=>{this.productImageSibling.querySelectorAll("img").forEach(image=>{image.classList.remove(classes$j.fade)}),requestAnimationFrame(showCurrentImage)};if(imageExists)swapImages();else{const imageTag=document.createElement("img");imageTag.src=imageSrc,this.productCutline&&(imageTag.alt=this.productCutline.innerText),imageTag.addEventListener("load",()=>{this.productImageSibling.append(imageTag),swapImages()})}}hideSiblingImage(){this.productImageSibling&&(this.productImageSibling.classList.remove(classes$j.visible),this.productImageSibling.querySelectorAll("img").forEach(image=>{image.classList.remove(classes$j.fade)}))}}class ProductSiblings extends HTMLElement{constructor(){super()}connectedCallback(){this.product=this.closest(selectors$o.productGridItem),this.siblingScrollbar=this.querySelector(selectors$o.siblingsInnerHolder),this.siblingCount=this.querySelector(selectors$o.siblingCount),this.siblingFieldset=this.querySelector(selectors$o.siblingFieldset),this.siblingLinks=this.querySelectorAll(selectors$o.siblingLink),this.productInfo=this.closest(selectors$o.productInfo),this.productLink=this.closest(selectors$o.link),this.hideSwatchesTimer=0,this.initScrollbar(),this.siblingCount&&this.siblingFieldset&&this.productInfo&&(this.siblingCount.addEventListener("mouseenter",()=>this.showSiblings()),this.productInfo.addEventListener("mouseleave",()=>
15this.hideSiblings())),this.siblingLinks.length&&new SiblingSwatches(this.siblingLinks,this.product),this.querySelectorAll(selectors$o.tooltip).forEach(tooltip=>{new Tooltip(tooltip)})}showSiblings(){this.hideSwatchesTimer&&clearTimeout(this.hideSwatchesTimer),this.productLink&&this.productLink.classList.add(classes$j.stopEvents),this.siblingFieldset.classList.add(classes$j.visible)}hideSiblings(){this.hideSwatchesTimer=setTimeout(()=>{this.productLink&&this.productLink.classList.remove(classes$j.stopEvents),this.siblingFieldset.classList.remove(classes$j.visible)},100)}initScrollbar(){this.siblingScrollbar&&new NativeScrollbar(this.siblingScrollbar)}}const selectors$n={body:"body",dataRelatedSectionElem:"[data-related-section]",dataTabsHolder:"[data-tabs-holder]",dataTab:"data-tab",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]"},classes$i={current:"current",hidden:"hidden",aosAnimate:"aos-animate",aosNoTransition:"aos-no-transition",focused:"is-focused"},sections$b={};class GlobalTabs{constructor(holder){this.container=holder,this.body=document.querySelector(selectors$n.body),this.accessibility=window.accessibility,this.container&&(this.scrollbarHolder=this.container.querySelectorAll(selectors$n.scrollbarHolder),this.init(),this.initNativeScrollbar())}init(){const tabsNavList=this.container.querySelectorAll(selectors$n.tabsLi);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(selectors$n.dataTab)),tab=this.container.querySelector(`${selectors$n.tabContent}-${tabId}`);element.addEventListener("click",()=>{this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.code==="Space"||event.code==="Enter")&&this.body.classList.contains(classes$i.focused)&&this.tabChange(element,tab)})})}tabChange(element,tab){if(element.classList.contains(classes$i.current))return;const currentTab=this.container.querySelector(`${selectors$n.tabsLi}.${classes$i.current}`),currentTabContent=this.container.querySelector(`${selectors$n.tabContent}.${classes$i.current}`);currentTab?.classList.remove(classes$i.current),currentTabContent?.classList.remove(classes$i.current),element.classList.add(classes$i.current),tab.classList.add(classes$i.current),element.classList.contains(classes$i.hidden)&&tab.classList.add(classes$i.hidden),this.accessibility.a11y.removeTrapFocus(),this.container.dispatchEvent(new CustomEvent("theme:tab:change",{bubbles:!0})),element.dispatchEvent(new CustomEvent("theme:form:sticky",{bubbles:!0,detail:{element:"tab"}})),this.animateItems(tab)}animateItems(tab,animated=!0){const animatedItems=tab.querySelectorAll(selectors$n.dataAos);animatedItems.length&&animatedItems.forEach(animatedItem=>{animatedItem.classList.remove(classes$i.aosAnimate),animated&&(animatedItem.classList.add(classes$i.aosNoTransition),requestAnimationFrame(()=>{animatedItem.classList.remove(classes$i.aosNoTransition),animatedItem.classList.add(classes$i.aosAnimate)}))})}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}checkRecentTab(){const tabLink=this.container.querySelector(selectors$n.tabLinkRecent);if(tabLink){tabLink.classList.remove(classes$i.hidden);const tabLinkIdx=parseInt(tabLink.getAttribute(selectors$n.dataTab)),tabContent=this.container.querySelector(`${selectors$n.tabContent}[${selectors$n.dataTabIndex}="${tabLinkIdx}"]`);tabContent&&(tabContent.classList.remove(classes$i.hidden),this.animateItems(tabContent,!1)),this.initNativeScrollbar()}}hideRelatedTab(){const relatedSection2=this.container.querySelector(selectors$n.dataRelatedSectionElem);if(!relatedSection2)return;const parentTabContent=relatedSection2.closest(`${selectors$n.tabContent}.${classes$i.current}`);if(!parentTabContent)return;const parentTabContentIdx=parseInt(parentTabContent.getAttribute(selectors$n.dataTabIndex)),tabsNavList=this.container.querySelectorAll(selectors$n.tabsLi);if(tabsNavList.length>parentTabContentIdx){const nextTabsNavLink=tabsNavList[parentTabContentIdx].nextSibling;nextTabsNavLink&&(tabsNavList[parentTabContentIdx].classList.add(classes$i.hidden),nextTabsNavLink.dispatchEvent(new Event("click")),this.initNativeScrollbar())}}onBlockSelect(evt){const element=this.container.querySelector(`${selectors$n.tabLink}[${selectors$n.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$b[this.id]=[],this.container.querySelectorAll(selectors$n.dataTabsHolder).forEach(holder=>{sections$b[this.id].push(new GlobalTabs(holder))})}
15,onBlockSelect(e){sections$b[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}},selectors$m={ariaLabel:"aria-label",dataMediaId:"data-media-id",dataTallLayout:"data-tall-layout",dataThumb:"data-thumb",dataThumbIndex:"data-thumb-index",deferredMediaButton:"[data-deferred-media-button]",focusedElement:"model-viewer, video, iframe, button, [href], input, [tabindex]",isActive:".is-active",mediaType:"data-type",mobileSliderDisabled:"data-slideshow-disabled-mobile",productSlideshow:"[data-product-slideshow]",productThumbs:"[data-product-thumbs]",thumb:"[data-thumb-item]",thumbLink:"[data-thumb-link]",thumbSlider:"[data-thumbs-slider]",quickAddModal:"[data-quick-add-modal]",zoomElement:"[data-zoom-wrapper]"},classes$h={active:"is-active",focused:"is-focused",dragging:"is-dragging",selected:"is-selected",sliderEnabled:"flickity-enabled",mediaHidden:"media--hidden"},attributes$g={ariaCurrent:"aria-current",sliderOptions:"data-options"};let sections$a={};class InitSlider{constructor(section,modalHolder=null){this.container=modalHolder||section.container,this.tallLayout=this.container.getAttribute(selectors$m.dataTallLayout)==="true",this.slideshow=this.container.querySelector(selectors$m.productSlideshow),this.thumbSlider=this.container.querySelector(selectors$m.thumbSlider),this.thumbLinks=this.container.querySelectorAll(selectors$m.thumbLink),this.mobileSliderDisabled=this.container.getAttribute(selectors$m.mobileSliderDisabled)==="true",this.initSliderMobileEvent=()=>this.initSliderMobile(),this.initSliderDesktopEvent=()=>this.initSliderDesktop(),this.slideshow&&this.slideshow.hasAttribute(attributes$g.sliderOptions)&&(this.customOptions=JSON.parse(decodeURIComponent(this.slideshow.getAttribute(attributes$g.sliderOptions)))),this.flkty=null,this.init()}init(){this.slideshow&&(this.tallLayout?this.mobileSliderDisabled||(this.initSliderMobile(),document.addEventListener("theme:resize:width",this.initSliderMobileEvent)):this.mobileSliderDisabled?(this.initSliderDesktop(),document.addEventListener("theme:resize:width",this.initSliderDesktopEvent)):this.createSlider())}initSliderMobile(){isMobile()?this.createSlider():this.destroySlider()}initSliderDesktop(){isMobile()?this.destroySlider():this.createSlider()}destroySlider(){this.slideshow.classList.contains(classes$h.sliderEnabled)&&this.flkty.destroy()}createSlider(){if(!this.slideshow||this.mobileSliderDisabled&&isMobile())return;const sliderOptions={autoPlay:!1,pageDots:!1,wrapAround:!0,...this.customOptions},instance=this,firstSlide=this.slideshow.querySelectorAll(`[${selectors$m.mediaType}]`)[0];let options={...sliderOptions,on:{ready:function(){const slides=this.element;slides.addEventListener("keyup",e=>{if(e.code==="Enter"){const zoomElement=slides.querySelector(`.${classes$h.selected} ${selectors$m.zoomElement}`);zoomElement&&(zoomElement.dispatchEvent(new Event("click",{bubbles:!1})),window.accessibility.lastElement=slides)}}),instance.sliderThumbs(this),instance.accessibilityActions(this)}}};if(this.flkty=new FlickityFade(this.slideshow,options),this.flkty.resize(),firstSlide){const firstType=firstSlide.getAttribute(selectors$m.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.thumbSlider){const selectedElem=instance.thumbSlider.querySelector(selectors$m.isActive),currentSlide=instance.thumbSlider.querySelector(`${selectors$m.thumb} [${selectors$m.dataThumbIndex}="${index}"]`);if(selectedElem){const selectedElemThumb=selectedElem.querySelector(`[${selectors$m.dataThumbIndex}]`);lastSLideIdx=Array.from(selectedElem.parentElement.children).indexOf(selectedElem),selectedElem.classList.remove(classes$h.active),selectedElemThumb&&selectedElemThumb.setAttribute(attributes$g.ariaCurrent,!1)}currentSlide&&(currentSlide.parentElement.classList.add(classes$h.active),currentSlide.setAttribute(attributes$g.ariaCurrent,!0)),instance.scrollToThumb()}const currentMedia=this.cells[lastSLideIdx].element,newMedia=this.selectedElement;currentMedia.dispatchEvent(new CustomEvent("theme:media:hidden")),newMedia.classList.remove(classes$h.mediaHidden)}),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$m.mediaType),isFocusEnabled=document.body.classList.contains(classe
15s$h.focused);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(classes$h.mediaHidden)}),currentMedia.dispatchEvent(new CustomEvent("theme:media:visible"));const deferredMedia=currentMedia.querySelector("deferred-media");deferredMedia&&deferredMedia.getAttribute("loaded")!==!0&&currentMedia.querySelector(selectors$m.deferredMediaButton).dispatchEvent(new Event("click",{bubbles:!1})),instance.accessibilityActions(this)}),this.flkty.on("dragStart",(event,pointer)=>{event.target.classList.add(classes$h.dragging)}),this.flkty.on("dragEnd",(event,pointer)=>{const draggedElem=this.flkty.element.querySelector(`.${classes$h.dragging}`);draggedElem&&draggedElem.classList.remove(classes$h.dragging)})}accessibilityActions(slider2){const slides=slider2.slides;slides.length&&slides.forEach(element=>{const slide=element.cells[0].element,focusedElements=slide.querySelectorAll(selectors$m.focusedElement);slide.classList.contains(classes$h.selected)?slide.removeAttribute("tabindex"):slide.setAttribute("tabindex","-1"),focusedElements.length&&focusedElements.forEach(focusedElement=>{slide.classList.contains(classes$h.selected)?focusedElement.removeAttribute("tabindex"):focusedElement.setAttribute("tabindex","-1")})})}scrollToThumb(){const thumbs=this.thumbSlider;if(thumbs){const thumb=thumbs.querySelector(selectors$m.isActive);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,thumbHeight=thumb.offsetHeight,thumbRightPos=thumbPosLeft+thumbWidth,thumbBottomPos=thumbPosTop+thumbHeight,topCheck=thumbsScrollTop>thumbPosTop,bottomCheck=thumbBottomPos>thumbsPositionBottom,leftCheck=thumbsScrollLeft>thumbPosLeft,rightCheck=thumbRightPos>thumbsPositionRight,verticalCheck=bottomCheck||topCheck,horizontalCheck=rightCheck||leftCheck,isMobileView=isMobile();if(verticalCheck||horizontalCheck){let scrollTopPosition=thumbPosTop-thumbsHeight+thumbHeight,scrollLeftPosition=thumbPosLeft-thumbsWidth+thumbWidth;topCheck&&(scrollTopPosition=thumbPosTop),rightCheck&&isMobileView&&(scrollLeftPosition+=parseInt(window.getComputedStyle(thumbs).paddingRight)),leftCheck&&(scrollLeftPosition=thumbPosLeft,isMobileView&&(scrollLeftPosition-=parseInt(window.getComputedStyle(thumbs).paddingLeft))),thumbs.scrollTo({top:scrollTopPosition,left:scrollLeftPosition,behavior:"smooth"})}}}sliderThumbs(slider2){this.thumbLinks.length&&this.thumbLinks.forEach(item=>{item.addEventListener("click",e=>{e.preventDefault();const slideIdx=item.hasAttribute(selectors$m.dataThumbIndex)?parseInt(item.getAttribute(selectors$m.dataThumbIndex)):0;this.flkty.select(slideIdx)}),item.addEventListener("keyup",e=>{if(e.code==="Enter"){const mediaId=item.getAttribute(selectors$m.dataMediaId),mediaElem=slider2.element.querySelector(`[${selectors$m.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")))}})})}onUnload(){this.tallLayout?this.mobileSliderDisabled||document.removeEventListener("theme:resize:width",this.initSliderMobileEvent):this.mobileSliderDisabled&&document.removeEventListener("theme:resize:width",this.initSliderDesktopEvent)}}const initSlider={onLoad(){sections$a[this.id]=new InitSlider(this)},onUnload(e){sections$a[this.id].onUnload(e)}},classes$g={added:"is-added",animated:"is-animated",disabled:"is-disabled",error:"has-error",loading:"is-loading",open:"is-open",overlayText:"product-item--overlay-text",visible:"is-visible",siblingLinkCurrent:"sibling__link--current",focused:"is-focused"},settings={errorDelay:3e3},selectors$l={animation:"[data-animation]",apiContent:"[data-api-content]",buttonQuickAdd:"[data-quick-add-btn]",buttonAddToCart:"[data-add-to-cart]",cartDrawer:"[data-cart-drawer]",cartLineItems:"[data-line-items]",dialog:"dialog",focusable:'button, [href], select, textarea, [tabindex]:not
15([tabindex="-1"])',messageError:"[data-message-error]",modalButton:"[data-quick-add-modal-handle]",modalContainer:"[data-product-upsell-container]",modalContent:"[data-product-upsell-ajax]",modalClose:"[data-quick-add-modal-close]",productGridItem:"data-product-grid-item",productInformationHolder:"[data-product-information]",quickAddHolder:"[data-quick-add-holder]",quickAddModal:"[data-quick-add-modal]",quickAddModalTemplate:"[data-quick-add-modal-template]"},attributes$f={closing:"closing",productId:"data-product-id",modalHandle:"data-quick-add-modal-handle",siblingSwapper:"data-sibling-swapper",quickAddHolder:"data-quick-add-holder"};class QuickAddProduct extends HTMLElement{constructor(){super(),this.container=this,this.quickAddHolder=this.container.querySelector(selectors$l.quickAddHolder),this.quickAddHolder&&(this.modal=null,this.currentModal=null,this.productId=this.quickAddHolder.getAttribute(attributes$f.quickAddHolder),this.modalButton=this.quickAddHolder.querySelector(selectors$l.modalButton),this.handle=this.modalButton?.getAttribute(attributes$f.modalHandle),this.cartDrawer=document.querySelector(selectors$l.cartDrawer),this.buttonQuickAdd=this.quickAddHolder.querySelector(selectors$l.buttonQuickAdd),this.buttonATC=this.quickAddHolder.querySelector(selectors$l.buttonAddToCart),this.button=this.modalButton||this.buttonATC,this.modalClose=this.modalClose.bind(this),this.modalCloseOnProductAdded=this.modalCloseOnProductAdded.bind(this),this.isAnimating=!1,this.modalButtonClickEvent=this.modalButtonClickEvent.bind(this),this.quickAddLoadingToggle=this.quickAddLoadingToggle.bind(this))}connectedCallback(){this.modalButton&&this.modalButton.addEventListener("click",this.modalButtonClickEvent),this.buttonATC&&this.buttonATC.addEventListener("click",e=>{console.log("BUTTON ATC QA"),e.preventDefault(),document.dispatchEvent(new CustomEvent("theme:cart:add",{detail:{button:this.buttonATC}}))}),this.quickAddHolder&&(this.quickAddHolder.addEventListener("animationend",this.quickAddLoadingToggle),this.errorHandler())}modalButtonClickEvent(e){e.preventDefault();const isSiblingSwapper=this.modalButton.hasAttribute(attributes$f.siblingSwapper),isSiblingLinkCurrent=this.modalButton.classList.contains(classes$g.siblingLinkCurrent);isSiblingLinkCurrent||(this.modalButton.classList.add(classes$g.loading),this.modalButton.disabled=!0,isSiblingSwapper&&!isSiblingLinkCurrent&&(this.currentModal=e.target.closest(selectors$l.quickAddModal),this.currentModal.classList.add(classes$g.loading)),this.renderModal())}modalCreate(response){const cachedModal=document.querySelector(`${selectors$l.quickAddModal}[${attributes$f.productId}="${this.productId}"]`);if(cachedModal)this.modal=cachedModal,this.modalOpen();else{const modalTemplate=this.quickAddHolder.querySelector(selectors$l.quickAddModalTemplate);if(!modalTemplate)return;const htmlObject=document.createElement("div");htmlObject.innerHTML=modalTemplate.innerHTML,document.body.appendChild(htmlObject.querySelector(selectors$l.quickAddModal)),modalTemplate.remove(),this.modal=document.querySelector(`${selectors$l.quickAddModal}[${attributes$f.productId}="${this.productId}"]`),this.modal.querySelector(selectors$l.modalContent).innerHTML=new DOMParser().parseFromString(response,"text/html").querySelector(selectors$l.apiContent).innerHTML,this.modalCreatedCallback()}}modalOpen(){typeof this.modal.show=="function"&&this.modal.show(),this.modal.setAttribute("open",!0),this.modal.removeAttribute("inert"),this.currentModal&&this.currentModal.dispatchEvent(new CustomEvent("theme:modal:close",{bubbles:!1})),(this.modal.querySelector("[autofocus]")||this.modal.querySelector(selectors$l.focusable)).focus(),this.quickAddHolder.classList.add(classes$g.disabled),this.modalButton&&(this.modalButton.classList.remove(classes$g.loading),this.modalButton.disabled=!1),requestAnimationFrame(()=>{this.modal.querySelectorAll(selectors$l.animation).forEach(item=>{item.classList.add(classes$g.animated)})}),document.dispatchEvent(new CustomEvent("theme:quick-add:open",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),document.addEventListener("theme:product:added",this.modalCloseOnProductAdded,{once:!0})}modalClose(){if(this.isAnimating)return;if(!this.modal.hasAttribute(attributes$f.closing)){this.modal.setAttribute(attributes$f.closing,""),this.isAnimating=!0;return}typeof this.modal.close=="function"?this.modal.close():this.modal.removeAttribute("open"),this.modal.removeAttribute(attributes$f.closing),this.modal.setAttribute("inert",""),this.modal.classList.remove(classes$g.loading),this.modalButton&&(this.modalButton.disabled=!1),this.quickAddHolder&&this.quickAddHolder.classList.contains(classe
15s$g.disabled)&&this.quickAddHolder.classList.remove(classes$g.disabled),this.resetAnimatedItems();const hasOpenDrawer=this.cartDrawer&&this.cartDrawer.classList.contains(classes$g.open),hasOpenModal=document.querySelector("dialog[open]");!hasOpenDrawer&&!hasOpenModal&&document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),document.removeEventListener("theme:product:added",this.modalCloseOnProductAdded)}modalEvents(){this.modal.querySelector(selectors$l.modalClose)?.addEventListener("click",e=>{e.preventDefault(),this.modalClose()}),this.modal.addEventListener("click",event=>{event.target.nodeName==="DIALOG"&&event.type==="click"&&this.modalClose()}),this.modal.addEventListener("keydown",event=>{event.code=="Escape"&&(event.preventDefault(),this.modalClose())}),this.modal.addEventListener("theme:modal:close",()=>{this.modalClose()}),this.modal.addEventListener("animationend",event=>{event.target===this.modal&&(this.isAnimating=!1,this.modal.hasAttribute(attributes$f.closing)&&(this.modalClose(),document.body.classList.contains(classes$g.focused)&&this.buttonQuickAdd&&(this.buttonQuickAdd.addEventListener("transitionend",()=>{this.buttonQuickAdd.focus(),this.buttonQuickAdd.classList.remove(classes$g.visible)},{once:!0}),this.buttonQuickAdd.classList.add(classes$g.visible))))})}modalCloseOnProductAdded(){this.resetQuickAddButtons(),this.modal&&this.modal.hasAttribute("open")&&this.modalClose()}quickAddLoadingToggle(e){e.target==this.quickAddHolder&&this.quickAddHolder.classList.remove(classes$g.disabled)}errorHandler(){this.quickAddHolder.addEventListener("theme:cart:error",event=>{const holder=event.detail.holder,parentProduct=holder.closest(`[${selectors$l.productGridItem}]`);if(!parentProduct)return;const errorMessageHolder=holder.querySelector(selectors$l.messageError),hasOverlayText=parentProduct.classList.contains(classes$g.overlayText),productInfo=parentProduct.querySelector(selectors$l.productInformationHolder),button=holder.querySelector(selectors$l.buttonAddToCart);button&&(button.classList.remove(classes$g.added,classes$g.loading),holder.classList.add(classes$g.error)),errorMessageHolder&&(errorMessageHolder.innerText=event.detail.description),hasOverlayText&&productInfo.classList.add(classes$g.hidden),setTimeout(()=>{this.resetQuickAddButtons(),hasOverlayText&&productInfo.classList.remove(classes$g.hidden)},settings.errorDelay)})}resetQuickAddButtons(){this.quickAddHolder&&this.quickAddHolder.classList.remove(classes$g.visible,classes$g.error),this.buttonQuickAdd&&(this.buttonQuickAdd.classList.remove(classes$g.added),this.buttonQuickAdd.disabled=!1)}renderModal(){this.modal?this.modalOpen():window.fetch(`${window.theme.routes.root}products/${this.handle}?section_id=api-product-upsell`).then(this.upsellErrorsHandler).then(response=>response.text()).then(response=>{this.modalCreate(response)})}modalCreatedCallback(){this.modalEvents(),this.modalOpen(),new InitSlider(null,this.modal),wrapElements(this.modal)}upsellErrorsHandler(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}resetAnimatedItems(){this.modal?.querySelectorAll(selectors$l.animation).forEach(item=>{item.classList.remove(classes$g.animated)})}}register("product-grid",[slider,tabs]),customElements.get("quick-add-product")||customElements.define("quick-add-product",QuickAddProduct),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("grid-swatch")||customElements.define("grid-swatch",GridSwatch),customElements.get("product-siblings")||customElements.define("product-siblings",ProductSiblings);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})}},selectors$k={complementaryProducts:"complementary-products",quickAddProduct:"quick-add-product"},classes$f={loaded:"is-loaded"},attributes$e={url:"data-url"};class ComplementaryProducts extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),this.hasAttribute(attributes$e.url)&&this.getAttribute(attributes$e.url)!==""&&fetch(this.getAttribute(attributes$e.url)).then(response=>response.text()).then(text=>{const html=document.createElement("div");
15html.innerHTML=text;const recommendations=html.querySelector(selectors$k.complementaryProducts);recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),html.querySelector(`${selectors$k.complementaryProducts} ${selectors$k.quickAddProduct}`)&&this.classList.add(classes$f.loaded)}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}const selectors$j={fields:'input:not([type="checkbox"]):not([type="hidden"]), textarea',fieldEmail:'input[type="email"]',fieldCheckbox:'input[type="checkbox"]',form:"[data-form-wrapper]"};class RecipientForm extends HTMLElement{constructor(){super(),this.fieldCheckbox=this.querySelector(selectors$j.fieldCheckbox),this.fieldEmail=this.querySelector(selectors$j.fieldEmail),this.fields=this.querySelectorAll(selectors$j.fields),this.form=this.closest(selectors$j.form),this.onChangeEvent=event=>this.onChange(event)}connectedCallback(){this.fieldCheckbox&&(this.fieldCheckbox.addEventListener("change",this.onChangeEvent),this.form&&this.form.addEventListener("theme:product:add",()=>{this.fieldCheckbox.checked=!1,this.fieldCheckbox.dispatchEvent(new Event("change"))}))}clearInputValues(){this.fields.length&&this.fields.forEach(field=>{field.value=""})}onChange(event){this.fieldEmail.required=!!event.target.checked,event.target.checked||this.clearInputValues()}disconnectedCallback(){this.fieldCheckbox.removeEventListener("change",this.onChangeEvent)}}const selectors$i={slideshow:"[data-product-slideshow]",dataStickyEnabled:"data-sticky-enabled",productPage:".product__page",formWrapper:"[data-form-wrapper]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},classes$e={sticky:"is-sticky"};window.theme.variables={productPageSticky:!1};const sections$9={};class ProductSticky{constructor(section){this.section=section,this.container=section.container,this.stickyEnabled=this.container.getAttribute(selectors$i.dataStickyEnabled)==="true",this.formWrapper=this.container.querySelector(selectors$i.formWrapper),this.stickyScrollTop=0,this.scrollLastPosition=0,this.stickyDefaultTop=0,this.currentPoint=0,this.defaultTopBottomSpacings=30,this.scrollTop=window.scrollY,this.scrollDirectionDown=!0,this.requestAnimationSticky=null,this.stickyFormLoad=!0,this.stickyFormLastHeight=null,this.onChangeCounter=0,this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),setTimeout(()=>{this.init()},50)}init(){this.stickyEnabled&&(this.stickyScrollCheck(),document.addEventListener("theme:resize",this.resizeEvent)),this.initSticky()}initSticky(){theme.variables.productPageSticky&&(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()),this.formWrapper.addEventListener("theme:form:sticky",e=>{this.removeAnimationFrame(),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))}),document.addEventListener("theme:scroll",this.scrollEvent))}scrollEvents(e){this.scrollTop=e.detail.position,this.scrollDirectionDown=e.detail.down,this.requestAnimationSticky||(this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition()))}resizeEvents(e){this.stickyScrollCheck(),document.removeEventListener("theme:scroll",this.scrollEvent),this.initSticky()}stickyScrollCheck(){const targetFormWrapper=this.container.querySelector(`${selectors$i.productPage} ${selectors$i.formWrapper}`);if(targetFormWrapper)if(isDesktop()){const form=this.container.querySelector(selectors$i.formWrapper),slideshow=this.container.querySelector(selectors$i.slideshow);if(!form||!slideshow)return;const productCopyHeight=form.offsetHeight,productImagesHeight=slideshow.offsetHeight;productCopyHeight<productImagesHeight?(theme.variables.productPageSticky=!0,targetFormWrapper.classList.add(classes$e.sticky)):(theme.variables.productPageSticky=!1,targetFormWrapper.classList.remove(classes$e.sticky))}else theme.variables.productPageSticky=!1,targetFormWrapper.classList.remove(classes$e.sticky)}calculateStickyPosition(e=null){if(document.documentElement.hasAttribute("data-scroll-locked")){this.removeAnimationFrame();return}const isAccordion=!!(e&&e.detail&&e.detail.element&&e.detail.element==="accordion"),formWrapperHeight=this.formWrapper.offsetHeight,heightDifference=window.innerHeight-formWrapperHeight-this.defaultTopBottomSpacings,scrollDifference=Math.abs(this.scrollTop-this.scrollLastPosition);this.scrollDirectionDown?this.stickyScrollTop-=scrollDifference:this.stickyScrollTop+=scrollDifference,this.stickyFormLoad&&(document.querySelector(selectors$i.headerSticky)&&document.querySelector(selectors$i.headerHeight)?this.stickyDefaultTop=parseInt(document.querySelector(selectors$i.headerHeight).getBoundingClientRect().height):this.stickyDefaultTop=this.defaultTopBottomSpacings,this.stickyScrollTop=this.stickyDefaultTop),this.stickyScrollTop=Math.min(Math.max(this.stickyScrollTop,heightDifference),this.stickyDefaultTop);const differencePoint=this.stickyScrollTop-this.currentPoint;this.currentPoint=this.stickyFormLoad?this.stickyScrollTop:this.currentPoint+differencePoint*.5,this.formWrapper.style.setProperty("--sticky-top",`${this.currentPoint}px`),this.scrollLastPosition=this.scrollTop,this.stickyFormLoad=!1,isAccordion&&this.onChangeCounter<=10||isAccordion&&this.stickyFormLastHeight!==formWrapperHeight||this.stickyScrollTop!==this.currentPoint&&this.requestAnimationSticky?(isAccordion&&(this.onChangeCounter+=1),isAccordion&&this.stickyFormLastHeight!==formWrapperHeight&&(this.onChangeCounter=11),this.requestAnimationSticky=requestAnimationFrame(()=>this.calculateStickyPosition(e))):this.requestAnimationSticky&&this.removeAnimationFrame(),this.stickyFormLastHeight=formWrapperHeight}removeAnimationFrame(){this.requestAnimationSticky&&(cancelAnimationFrame(this.requestAnimationSticky),this.requestAnimationSticky=null,this.onChangeCounter=0)}onUnload(){this.stickyEnabled&&document.removeEventListener("theme:resize",this.resizeEvent),theme.variables.productPageSticky&&document.removeEventListener("theme:scroll",this.scrollEvent)}}const productStickySection={onLoad(){sections$9[this.id]=new ProductSticky(this)},onUnload(){sections$9[this.id].onUnload()}},selectors$h={section:"data-section-type",shareButton:"[data-share-button]",shareMessage:"[data-share-message]"},classes$d={visible:"is-visible"};class ShareButton extends HTMLElement{constructor(){super(),this.container=this.closest(`[${selectors$h.section}]`),this.shareButton=this.querySelector(selectors$h.shareButton),this.shareMessage=this.querySelector(selectors$h.shareMessage),this.urlToShare=this.shareButton.dataset.shareUrl?this.shareButton.dataset.shareUrl:document.location.href,this.init(),this.updateShareLink()}init(){navigator.share?this.shareButton.addEventListener("click",()=>{navigator.share({url:this.urlToShare,title:document.title})}):this.shareButton.addEventListener("click",this.copyToClipboard.bind(this))}updateShareLink(){this.container.getAttribute(selectors$h.section)=="product"&&this.container.addEventListener("theme:variant:change",event=>{event.detail.variant&&(this.urlToShare=`${this.urlToShare.split("?")[0]}?variant=${event.detail.variant.id}`)})}copyToClipboard(){navigator.clipboard.writeText(this.urlToShare).then(()=>{this.shareMessage.classList.add(classes$d.visible);const removeVisibleClass=()=>{this.shareMessage.classList.remove(classes$d.visible),this.shareMessage.removeEventListener("animationend",removeVisibleClass)};this.shareMessage.addEventListener("animationend",removeVisibleClass)})}}const selectors$g={optionPosition:"data-option-position",optionInput:'[name^="options"], [data-popout-option]',optionInputCurrent:'[name^="options"]:checked, [name^="options"][type="hidden"]',selectOptionValue:"data-value",popout:"[data-popout]"},classes$c={soldOut:"sold-out",unavailable:"unavailable",sale:"sale"};class SelloutVariants{constructor(section,productJSON){this.container=section,this.productJSON=productJSON,this.optionElements=this.container.querySelectorAll(selectors$g.optionInput),this.productJSON&&this.optionElements.length&&this.init()}init(){this.update()}
15update(){this.getCurrentState(),this.optionElements.forEach(el=>{const parent=el.closest(`[${selectors$g.optionPosition}]`);if(!parent)return;const val=el.value||el.getAttribute(selectors$g.selectOptionValue),positionString=parent.getAttribute(selectors$g.optionPosition),position=parseInt(positionString,10)-1,selectPopout=el.closest(selectors$g.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$c.soldOut,classes$c.unavailable),el.parentNode.classList.remove(classes$c.sale),selectPopout&&selectPopout.classList.remove(classes$c.soldOut,classes$c.unavailable,classes$c.sale),typeof found>"u"?(el.classList.add(classes$c.unavailable),selectPopout&&selectPopout.classList.add(classes$c.unavailable)):found&&found.available===!1&&(el.classList.add(classes$c.soldOut),selectPopout&&selectPopout.classList.add(classes$c.soldOut)),found&&found.compare_at_price>found.price&&theme.settings.variantOnSale&&el.parentNode.classList.add(classes$c.sale)})}getCurrentState(){this.selections=[];const options=this.container.querySelectorAll(selectors$g.optionInputCurrent);options.length&&options.forEach(element=>{const elemValue=element.value;elemValue&&elemValue!==""&&this.selections.push(elemValue)})}}const selectors$f={product:"[data-product]",productForm:"[data-product-form]",addToCart:"[data-add-to-cart]",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",subPrices:"[data-subscription-watch-price]",subSelectors:"[data-subscription-selectors]",subsToggle:"[data-toggles-group]",subsChild:"data-group-toggle",subDescription:"[data-plan-description]",section:"[data-section-type]",quickAddModal:"[data-quick-add-modal]",priceOffWrap:"[data-price-off]",priceOffType:"[data-price-off-type]",priceOffAmount:"[data-price-off-amount]",remainingCount:"[data-remaining-count]",remainingMax:"[data-remaining-max]",remainingWrapper:"[data-remaining-wrapper]",remainingJSON:"[data-product-remaining-json]",optionValue:"[data-option-value]",optionPosition:"[data-option-position]",installment:"[data-product-form-installment]",inputId:'input[name="id"]'},classes$b={hidden:"hidden",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"},attributes$d={dataTallLayout:"data-tall-layout",remainingMaxAttr:"data-remaining-max",dataEnableHistoryState:"data-enable-history-state",optionPosition:"data-option-position",dataImageId:"data-image-id",quickAddButton:"data-quick-add-btn"};class ProductForm extends HTMLElement{constructor(){super()}connectedCallback(){if(this.cartAddEvents(),this.container=this.closest(selectors$f.section)||this.closest(selectors$f.quickAddModal),!this.container)return;if(this.sectionId=this.container.dataset.sectionId,this.tallLayout=this.container.getAttribute(attributes$d.dataTallLayout)==="true",this.product=this.container.querySelector(selectors$f.product),this.productForm=this.container.querySelector(selectors$f.productForm),this.installmentForm=this.container.querySelector(selectors$f.installment),this.sellout=null,this.priceOffWrap=this.container.querySelector(selectors$f.priceOffWrap),this.priceOffAmount=this.container.querySelector(selectors$f.priceOffAmount),this.priceOffType=this.container.querySelector(selectors$f.priceOffType),this.planDescription=this.container.querySelector(selectors$f.subDescription),this.remainingWrapper=this.container.querySelector(selectors$f.remainingWrapper),this.remainingWrapper){const remainingMaxWrap=this.container.querySelector(selectors$f.remainingMax);remainingMaxWrap&&(this.remainingMaxInt=parseInt(remainingMaxWrap.getAttribute(attributes$d.remainingMaxAttr),10),this.remainingCount=this.container.querySelector(selectors$f.remainingCount),this.remainingJSONWrapper=this.container.querySelector(selectors$f.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(attributes$d.dataEnableHistoryState)==="true",this.hasUnitPricing=this.container.querySelector(selectors$f.unitWrapper),this.subSelectors=this.container.querySelector(selectors$f.subSelectors),this.subPrices=this.container.querySelector(selectors$f.subPrices),this.isPreOrder=this.container.querySelector(selectors$f.isPreOrder);let productJSON=null;const productElemJSON=this.container.querySelector(selectors$f.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")}cartAddEvents(){this.buttonATC=this.querySelector(selectors$f.addToCart),this.buttonATC&&this.buttonATC.addEventListener("click",e=>{e.preventDefault(),document.dispatchEvent(new CustomEvent("theme:cart:add",{detail:{button:this.buttonATC},bubbles:!1}))})}destroy(){this.productForm.destroy()}linkForm(){this.productForm=new ProductFormReader(this.container,this.productJSON,{onOptionChange:this.onOptionChange.bind(this),onPlanChange:this.onPlanChange.bind(this)}),this.pushState(this.productForm.getFormState(),!0),this.subsToggleListeners()}onOptionChange(evt){this.pushState(evt.dataset),this.updateProductImage(evt)}onPlanChange(evt){this.subPrices&&this.pushState(evt.dataset)}pushState(formState,init=!1){this.productState=this.setProductState(formState),this.updateAddToCartState(formState),this.updateProductPrices(formState),this.updateSaleText(formState),this.updateSubscriptionText(formState),this.updateRemaining(formState),this.updateLegend(formState),this.fireHookEvent(formState),this.sellout?.update(formState),this.enableHistoryState&&!init&&this.updateHistoryState(formState)}updateAddToCartState(formState){const variant=formState.variant;let addText=theme.strings.addToCart;
15const priceWrapper=this.container.querySelectorAll(selectors$f.priceWrapper),addToCart=this.container.querySelectorAll(selectors$f.addToCart),addToCartText=this.container.querySelectorAll(selectors$f.addToCartText),formWrapper=this.container.querySelectorAll(selectors$f.formWrapper);if(this.installmentForm&&variant){const installmentInput=this.installmentForm.querySelector(selectors$f.inputId);installmentInput.value=variant.id,installmentInput.dispatchEvent(new Event("change",{bubbles:!0}))}this.isPreOrder&&(addText=theme.strings.preOrder),priceWrapper.length&&variant&&priceWrapper.forEach(element=>{element.classList.remove(classes$b.hidden)}),addToCart.length&&addToCart.forEach(element=>{element.hasAttribute(attributes$d.quickAddButton)||(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$b.variantSoldOut,classes$b.variantUnavailable):(element.classList.add(classes$b.variantSoldOut),element.classList.remove(classes$b.variantUnavailable));const formSelect=element.querySelector(selectors$f.originalSelectorId);formSelect&&(formSelect.value=variant.id);const inputId=element.querySelector(`${selectors$f.inputId}[form]`);inputId&&(inputId.value=variant.id,inputId.dispatchEvent(new Event("change")))}else element.classList.add(classes$b.variantUnavailable),element.classList.remove(classes$b.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(this.remainingWrapper?.classList.remove(classes$b.remainingIn,classes$b.remainingOut,classes$b.remainingUnavailable,classes$b.remainingLow),variant&&this.remainingWrapper&&this.remainingJSON){const remaining=this.remainingJSON[variant.id];(remaining==="out"||remaining<1)&&this.remainingWrapper.classList.add(classes$b.remainingOut),(remaining==="in"||remaining>=this.remainingMaxInt)&&this.remainingWrapper.classList.add(classes$b.remainingIn),(remaining==="low"||remaining>0&&remaining<this.remainingMaxInt)&&(this.remainingWrapper.classList.add(classes$b.remainingLow),this.remainingCount&&(this.remainingCount.innerHTML=remaining))}else!variant&&this.remainingWrapper&&this.remainingWrapper.classList.add(classes$b.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$f.subsToggle).forEach(toggle=>{toggle.addEventListener("change",function(e){const val=e.target.value.toString(),selected=this.container.querySelector(`[${selectors$f.subsChild}="${val}"]`),groups=this.container.querySelectorAll(`[${selectors$f.subsChild}]`);if(selected){selected.classList.remove(classes$b.hidden);const first=selected.querySelector('[name="selling_plan"]');first.checked=!0,first.dispatchEvent(new Event("change"))}groups.forEach(group=>{group!==selected&&(group.classList.add(classes$b.hidden),group.querySelectorAll('[name="selling_plan"]').forEach(plan=>{plan.checked=!1,plan.dispatchEvent(new Event("change"))}))})}.bind(this))})}updateSaleText(formState){this.productState.planSale?this.updateSaleTextSubscription(formState):this.productState.onSale?this.updateSaleTextStandard(formState):this.priceOffWrap&&this.priceOffWrap.classList.add(classes$b.hidden)}updateSaleTextStandard(formState){if(this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.sale||"sale"),this.priceOffAmount&&this.priceOffWrap){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$b.hidden)}}updateSubscriptionText(formState){formState.plan&&this.planDescription?(this.planDescription.innerHTML=formState.plan.detail.description,this.planDescription.classList.remove(classes$b.hidden)):this.planDescription&&this.planDescription.classList.add(classes$b.hidden)}updateSaleTextSubscription(formState){if(this.priceOffType&&(this.priceOffType.innerHTML=window.theme.strings.subscription||"subscripton"),this.priceOffAmount&&this.priceOffWrap){const adjustment=formState.plan.detail.price_adjustments[0],discount=adjustment.value;
15adjustment&&adjustment.value_type==="percentage"?this.priceOffAmount.innerHTML=`${discount}%`:this.priceOffAmount.innerHTML=themeCurrency.formatMoney(discount,theme.moneyFormat).replace(/\.\d+$/,""),this.priceOffWrap.classList.remove(classes$b.hidden)}}updateProductPrices(formState){const variant=formState.variant,plan=formState.plan;this.container.querySelectorAll(selectors$f.priceWrapper).forEach(wrap2=>{const comparePriceEl=wrap2.querySelector(selectors$f.comparePrice),productPriceEl=wrap2.querySelector(selectors$f.productPrice),comparePriceText=wrap2.querySelector(selectors$f.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$b.hidden),comparePriceText.classList.remove(classes$b.hidden),productPriceEl.classList.add(classes$b.productPriceSale)):(comparePriceEl.classList.add(classes$b.hidden),comparePriceText.classList.add(classes$b.hidden),productPriceEl.classList.remove(classes$b.productPriceSale)),comparePriceEl.innerHTML=themeCurrency.formatMoney(comparePrice,theme.moneyFormat).replace(/\.\d+$/,"")),productPriceEl.innerHTML=price===0?window.theme.strings.free:themeCurrency.formatMoney(price,theme.moneyFormat).replace(/\.\d+$/,"")}),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$f.unitPrice).innerHTML=formattedPrice,this.container.querySelector(selectors$f.unitBase).innerHTML=base,showElement(this.container.querySelector(selectors$f.unitWrapper))}else hideElement(this.container.querySelector(selectors$f.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(`[${attributes$d.dataImageId}="${variant.featured_media.id}"]`),newImageParent=newImg?.closest(selectors$f.productSlide);if(newImageParent){const newImagePos=Array.from(newImageParent.parentElement.children).indexOf(newImageParent),slider2=this.container.querySelector(selectors$f.productSlideshow),isDesktopView=isDesktop();if(slider2&&slider2.classList.contains(selectors$f.sliderEnabled)?FlickityFade.data(slider2).select(newImagePos):slider2&&!isDesktopView&&slider2.scrollTo({top:0,left:newImageParent.offsetLeft,behavior:"smooth"}),isDesktopView&&this.tallLayout){const newImgTop=newImg.getBoundingClientRect().top;if(newImagePos===0&&newImgTop+window.scrollY>window.pageYOffset)return;document.dispatchEvent(new CustomEvent("theme:tooltip:close",{bubbles:!1,detail:{hideTransition:!1}})),scrollTo(newImgTop)}}}}updateLegend(formState){const variant=formState.variant;if(variant){const optionValues=this.container.querySelectorAll(selectors$f.optionValue);
15optionValues.length&&optionValues.forEach(optionValue=>{const selectorWrapper=optionValue.closest(selectors$f.optionPosition);if(selectorWrapper){const optionPosition=selectorWrapper.getAttribute(attributes$d.optionPosition),optionIndex=parseInt(optionPosition,10)-1,selectedOptionValue=variant.options[optionIndex];let colorDescription="";document.querySelectorAll(".index-product .radio__button--input").forEach(input=>{input.value===selectedOptionValue&&input.dataset.colorDescription&&(colorDescription=input.dataset.colorDescription)}),optionValue.innerHTML=`${selectedOptionValue} <span class="color__description">${colorDescription}</span>`}})}}}const selectors$e={dialog:"dialog",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])',buttonModalOpen:"[data-modal-open]",buttonModalClose:"[data-modal-close]"},attributes$c={closing:"closing"};class ProductModal extends HTMLElement{constructor(){super()}connectedCallback(){this.modal=this.querySelector(selectors$e.dialog),this.buttonModalOpen=this.querySelector(selectors$e.buttonModalOpen),this.buttonModalClose=this.querySelector(selectors$e.buttonModalClose),this.focusTarget=this.modal.querySelector("[autofocus]")||this.modal.querySelector(selectors$e.focusable),this.isAnimating=!1,this.modalEvents()}modalOpen(){typeof this.modal.showModal=="function"&&this.modal.showModal(),this.modal.setAttribute("open",!0),this.modal.removeAttribute("inert"),this.focusTarget?.focus(),document.dispatchEvent(new CustomEvent("theme:modal:open",{bubbles:!0}))}modalClose(){if(!this.isAnimating){if(!this.modal.hasAttribute(attributes$c.closing)){this.modal.setAttribute(attributes$c.closing,""),this.isAnimating=!0;return}typeof this.modal.close=="function"?this.modal.close():this.modal.removeAttribute("open"),this.modal.removeAttribute(attributes$c.closing),this.modal.setAttribute("inert","")}}modalEvents(){this.buttonModalOpen.addEventListener("click",e=>{e.preventDefault(),this.modalOpen()}),this.buttonModalClose.addEventListener("click",e=>{e.preventDefault(),this.modalClose()}),this.modal.addEventListener("click",event=>{event.target.nodeName==="DIALOG"&&event.type==="click"&&this.modalClose()}),this.modal.addEventListener("keydown",event=>{event.code=="Escape"&&(event.preventDefault(),this.modalClose())}),this.modal.addEventListener("theme:modal:close",()=>{this.modalClose()}),this.modal.addEventListener("animationend",event=>{event.target===this.modal&&(this.isAnimating=!1,this.modal.hasAttribute(attributes$c.closing)&&this.modalClose())})}}class ProductModel extends DeferredMedia{constructor(){super()}loadContent(){super.loadContent(),Shopify.loadFeatures([{name:"model-viewer-ui",version:"1.0",onLoad:this.setupModelViewerUI.bind(this)}])}setupModelViewerUI(errors){errors||(this.modelViewerUI=new Shopify.ModelViewerUI(this.querySelector("model-viewer")))}}window.ProductModel={loadShopifyXR(){Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.setupShopifyXR.bind(this)}])},setupShopifyXR(errors){if(!errors){if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",()=>this.setupShopifyXR());return}document.querySelectorAll('[id^="ModelJSON-"]').forEach(modelJSON=>{window.ShopifyXR.addModels(JSON.parse(modelJSON.textContent)),modelJSON.remove()}),window.ShopifyXR.setupXRElements()}}},window.addEventListener("DOMContentLoaded",()=>{window.ProductModel&&window.ProductModel.loadShopifyXR()});const selectors$d={pickupContainer:"data-store-availability-container",shopifySection:".shopify-section",drawer:"[data-pickup-drawer]",drawerOpen:"[data-pickup-drawer-open]",drawerClose:"[data-pickup-drawer-close]",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])',section:"[data-section-type]"},classes$a={isHidden:"hidden"},attributes$b={closing:"closing"};class PickupAvailability extends HTMLElement{constructor(){super()}connectedCallback(){this.container=this.closest(selectors$d.section),this.drawer=null,this.buttonDrawerOpen=null,this.buttonDrawerClose=null,this.a11y=a11y,this.isAnimating=!1,this.container.addEventListener("theme:variant:change",event=>this.fetchPickupAvailability(event)),this.fetchPickupAvailability()}fetchPickupAvailability(event){if(event&&!event.detail.variant||event&&event.detail.variant&&!event.detail.variant.available){this.classList.add(classes$a.isHidden);return}const variantID=event&&event.detail.variant?event.detail.variant.id:this.getAttribute(selectors$d.pickupContainer);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$d.shopifySection).innerHTML;if(this.innerHTML=pickupAvailabilityHTML,this.drawer=this.querySelector(selectors$d.drawer),!this.drawer){this.classList.add(classes$a.isHidden);return}this.classList.remove(classes$a.isHidden),this.drawerEvents()}).catch(e=>{console.error(e)})}openDrawer(){this.drawer&&(typeof this.drawer.showModal=="function"&&this.drawer.showModal(),this.drawer.setAttribute("open",!0),this.drawer.removeAttribute("inert"),this.drawer.dis
15patchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),(this.drawer.querySelector("[autofocus]")||this.drawer.querySelector(selectors$d.focusable)).focus(),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})))}closeDrawer(){if(!this.isAnimating){if(!this.drawer.hasAttribute(attributes$b.closing)){this.drawer.setAttribute(attributes$b.closing,""),this.isAnimating=!0;return}typeof this.drawer.close=="function"?this.drawer.close():this.drawer.removeAttribute("open"),this.drawer.removeAttribute(attributes$b.closing),this.drawer.setAttribute("inert",""),document.querySelector("dialog[open]")||document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}}drawerEvents(){this.querySelector(selectors$d.drawerOpen)?.addEventListener("click",()=>{this.openDrawer(),window.accessibility.lastElement=this.buttonDrawerOpen}),this.drawer.querySelector(selectors$d.drawerClose)?.addEventListener("click",e=>{e.preventDefault(),this.closeDrawer()}),this.drawer.addEventListener("click",event=>{event.target.nodeName==="DIALOG"&&event.type==="click"&&this.closeDrawer()}),this.drawer.addEventListener("keydown",event=>{event.code==="Escape"&&(event.preventDefault(),this.closeDrawer())}),this.drawer.addEventListener("animationend",event=>{event.target===this.drawer&&(this.isAnimating=!1,this.drawer.hasAttribute(attributes$b.closing)&&this.closeDrawer())})}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}}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(data=>{resolve(data)}).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$c={popupContainer:".pswp",popupCloseBtn:".pswp__custom-close",popupIframe:"iframe, video",popupThumbs:".pswp__thumbs",popupButtons:".pswp__button, .pswp__caption-close"},classes$9={current:"is-current",customLoader:"pswp--custom-loader",customOpen:"pswp--custom-opening",loader:"pswp__loader",popupCloseButton:"pswp__button--close",isFocused:"is-focused"},attributes$a={dataOptionClasses:"data-pswp-option-classes",ariaCurrent:"aria-current"},loaderHTML=`<div class="${classes$9.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$c.popupContainer)[0],this.popup=null,this.popupThumbs=null,this.popupThumbsContainer=this.pswpElement.querySelector(selectors$c.popupThumbs),this.closeBtn=this.pswpElement.querySelector(selectors$c.popupCloseBtn),this.keyupCloseEvent=e=>this.keyupClose(e),this.a11y=a11y;const defaultOptions={history:!1,focus:!1,mainClass:""};this.options=options!==""?options:defaultOptions,this.init()}init(){this.pswpElement.classList.add(classes$9.customOpen),this.initLoader(),loadScript({url:window.theme.assets.photoswipe}).then(()=>this.loadPopup()).catch(e=>console.error(e))}
15initLoader(){if(this.pswpElement.classList.contains(classes$9.customLoader)&&this.options!==""&&this.options.mainClass){this.pswpElement.setAttribute(attributes$a.dataOptionClasses,this.options.mainClass);let loaderElem=document.createElement("div");loaderElem.innerHTML=loaderHTML,loaderElem=loaderElem.firstChild,this.pswpElement.appendChild(loaderElem)}else this.pswpElement.setAttribute(attributes$a.dataOptionClasses,"")}loadPopup(){const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;this.pswpElement.classList.contains(classes$9.customLoader)&&this.pswpElement.classList.remove(classes$9.customLoader),this.pswpElement.classList.remove(classes$9.customOpen),this.popup=new PhotoSwipe(this.pswpElement,PhotoSwipeUI,this.items,this.options),this.popup.init(),this.thumbsActions(),document.body.classList.contains(classes$9.isFocused)&&setTimeout(()=>{this.a11y.trapFocus(this.pswpElement,{elementToFocus:this.closeBtn})},200),this.popup.listen("close",()=>this.onClose()),this.options&&this.options.closeElClasses&&this.options.closeElClasses.length&&this.options.closeElClasses.forEach(closeClass=>{const closeElement=this.pswpElement.querySelector(`.pswp__${closeClass}`);closeElement&&closeElement.addEventListener("keyup",this.keyupCloseEvent)})}thumbsActions(){!this.popupThumbsContainer||!this.popupThumbsContainer.children.length||(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$c.popupThumbs} > *`),this.popupThumbs.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault();const lastCurrentElement=element.parentElement.querySelector(`.${classes$9.current}`);lastCurrentElement.classList.remove(classes$9.current),lastCurrentElement.setAttribute(attributes$a.ariaCurrent,!1),element.classList.add(classes$9.current),element.setAttribute(attributes$a.ariaCurrent,!0),this.popup.goTo(i)})}),this.popup.listen("imageLoadComplete",()=>this.setCurrentThumb()),this.popup.listen("beforeChange",()=>this.setCurrentThumb()))}stopDisabledScroll(e){e.stopPropagation()}keyupClose(e){e.code==="Enter"&&this.popup.close()}onClose(){const popupIframe=this.pswpElement.querySelector(selectors$c.popupIframe);if(popupIframe&&popupIframe.parentNode.removeChild(popupIframe),this.popupThumbsContainer&&this.popupThumbsContainer.firstChild)for(;this.popupThumbsContainer.firstChild;)this.popupThumbsContainer.removeChild(this.popupThumbsContainer.firstChild);this.pswpElement.setAttribute(attributes$a.dataOptionClasses,"");const loaderElem=this.pswpElement.querySelector(`.${classes$9.loader}`);loaderElem&&this.pswpElement.removeChild(loaderElem),this.options&&this.options.closeElClasses&&this.options.closeElClasses.length&&this.options.closeElClasses.forEach(closeClass=>{const closeElement=this.pswpElement.querySelector(`.pswp__${closeClass}`);closeElement&&closeElement.removeEventListener("keyup",this.keyupCloseEvent)}),this.a11y.removeTrapFocus(),window.accessibility.lastElement&&document.body.classList.contains(classes$9.isFocused)&&requestAnimationFrame(()=>{window.accessibility.lastElement.focus()})}setCurrentThumb(){const lastCurrentThumb=this.pswpElement.querySelector(`${selectors$c.popupThumbs} > .${classes$9.current}`);if(lastCurrentThumb&&(lastCurrentThumb.classList.remove(classes$9.current),lastCurrentThumb.setAttribute(attributes$a.ariaCurrent,!1)),!this.popupThumbs)return;const currentThumb=this.popupThumbs[this.popup.getCurrentIndex()];currentThumb.classList.add(classes$9.current),currentThumb.setAttribute(attributes$a.ariaCurrent,!0),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>
15currentThumbLeft){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",pswpThumbsTemplate:"[data-pswp-thumbs-template]",thumbs:".pswp__thumbs",caption:"[data-zoom-caption]"},classes$8={variantSoldOut:"variant--soldout",variantUnavailable:"variant--unavailable",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.init()}init(){this.zoomWrappers.length&&this.zoomWrappers.forEach((element,i)=>{element.addEventListener("click",e=>{e.preventDefault(),this.createZoom(i),window.accessibility.lastElement=element}),element.addEventListener("keyup",e=>{e.code==="Enter"&&(e.preventDefault(),this.createZoom(i),window.accessibility.lastElement=element)})})}createZoom(indexImage){const thumbs=this.container.querySelector(selectors$b.pswpThumbsTemplate)?.innerHTML;let items=[],counter=0;this.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}),this.zoomWrappers.length===counter){const options={history:!1,focus:!1,index:indexImage,mainClass:counter===1?`${classes$8.popupClass} ${classes$8.popupClassNoThumbs}`:`${classes$8.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$8.variantSoldOut}`)?targetContainer.classList.add(classes$8.variantSoldOut):targetContainer.classList.remove(classes$8.variantSoldOut),this.zoomCaptionElem.closest(`.${classes$8.variantUnavailable}`)?targetContainer.classList.add(classes$8.variantUnavailable):targetContainer.classList.remove(classes$8.variantUnavailable)),captionHtml=captionHtml.replaceAll(classes$8.popupTitle,classes$8.popupTitleNew),targetContainer.innerHTML=captionHtml,!1}}const selectors$a={addToCart:"[data-add-to-cart]",priceWrapper:"[data-price-wrapper]",productImage:"[data-product-image]",productJson:"[data-product-json]",form:"[data-product-form]",dataSectionId:"data-section-id",dataCartBar:"data-cart-bar",cartBar:"#cart-bar",cartBarAdd:"data-add-to-cart-bar",cartBarScroll:"data-cart-bar-scroll",productSubmitAdd:".product__submit__add",toggleTruncateHolder:"[data-truncated-holder]",toggleTruncateButton:"[data-truncated-button]",toggleTruncateContent:"[data-truncated-content]",toggleTruncateContentAttr:"data-truncated-content",formWrapper:"[data-form-wrapper]",productVariants:"[data-product-variants]",slider:"[data-slider]",sliderIndex:"data-slider-index"},classes$7={expanded:"is-expanded",visible:"is-visible",loading:"is-loading",added:"is-added"},attributes$9={enableImageZoom:"data-image-zoom-enable"},sections$8={};class Product{constructor(section){this.section=section,this.container=section.container,this.id=this.container.getAttribute(selectors$a.dataSectionId),this.sliders=this.container.querySelectorAll(selectors$a.slider),this.slider=[],this.truncateElementHolder=this.container.querySelector(selectors$a.toggleTruncateHolder),this.truncateElement=this.container.querySelector(selectors$a.toggleTruncateContent),this.formWrapper=this.container.querySelector(selectors$a.formWrapper),this.cartBarExist=this.container.getAttribute(selectors$a.dataCartBar)==="true",this.cartBar=this.container.querySelector(selectors$a.cartBar),this.scrollToTop=this.scrollToTop.bind(this),this.scrollEvent=e=>this.scrollEvents(e),this.resizeEvent=e=>this.resizeEvents(e),this.unlockTimer=0,this.accessibility=a11y,this.container.hasAttribute(attributes$9.enableImageZoom)&&new Zoom(this.section),this.truncateElementHolder&&this.truncateElement&&(setTimeout(()=>this.truncateText(),50),document.addEventListener("theme:resize",this.resizeEvent));const productJson=this.container.querySelector(selectors$a.productJson);if(productJson&&!productJson.innerHTML||!productJson)return;const productJsonHandle=JSON.parse(productJson.innerHTML).handle;let recentObj={};productJsonHandle&&(recentObj={handle:productJsonHandle}),Shopify.Products.recordRecentlyViewed(recentObj),this.form=this.container.querySelector(selectors$a.form),this.sliders.length&&this.sliders.forEac
15h((slider2,index)=>{slider2.setAttribute(selectors$a.sliderIndex,index),this.slider.push(new Slider(this.container,slider2))}),this.cartBarExist&&(this.initCartBar(),document.addEventListener("theme:scroll",this.scrollEvent))}scrollEvents(e){this.cartBarExist&&this.cartBarScroll()}resizeEvents(e){this.truncateText()}truncateText(){if(this.truncateElementHolder.classList.contains(classes$7.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$a.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$a.toggleTruncateContentAttr),showElement(truncateAppendedElement),ellipsis(truncateAppendedElement,5,{replaceStr:"",delimiter:" "}),hideElement(truncateAppendedElement),this.truncateElement.innerHTML!==truncateAppendedElement.innerHTML?this.truncateElementHolder.classList.add(classes$7.expanded):(truncateAppendedElement.remove(),this.truncateElementHolder.classList.remove(classes$7.expanded)),this.toggleTruncatedContent(this.truncateElementHolder)}toggleTruncatedContent(holder){const toggleButton=holder.querySelector(selectors$a.toggleTruncateButton);toggleButton&&toggleButton.addEventListener("click",e=>{e.preventDefault(),holder.classList.remove(classes$7.expanded),holder.classList.add(classes$7.visible)})}initCartBar(){this.cartBarBtn=this.cartBar.querySelector(selectors$a.productSubmitAdd),this.cartBarBtn&&(this.cartBarBtn.addEventListener("click",e=>{e.preventDefault(),e.currentTarget.hasAttribute(selectors$a.cartBarAdd)?(theme.settings.cartDrawerEnabled&&(e.currentTarget.classList.add(classes$7.loading),e.currentTarget.setAttribute("disabled","disabled")),this.form.querySelector(selectors$a.addToCart).dispatchEvent(new Event("click",{bubbles:!0}))):e.currentTarget.hasAttribute(selectors$a.cartBarScroll)&&this.scrollToTop()}),this.cartBarBtn.hasAttribute(selectors$a.cartBarAdd)&&document.addEventListener("theme:product:add-error",this.scrollToTop))}scrollToTop(){const productVariants=this.container.querySelector(selectors$a.productVariants),scrollTargetTop=(isDesktop()?this.container:productVariants||this.form).getBoundingClientRect().top;scrollTo(isDesktop()?scrollTargetTop:scrollTargetTop-10)}cartBarScroll(){const scrolled=window.pageYOffset,element=theme.variables.productPageSticky&&this.formWrapper?this.formWrapper:this.form;if(element&&this.cartBar){const formOffset=element.offsetTop,formHeight=element.offsetHeight,checkPosition=scrolled>formOffset+formHeight;this.cartBar.classList.toggle(classes$7.visible,checkPosition)}}onUnload(){document.removeEventListener("theme:product:add-error",this.scrollToTop),this.truncateElementHolder&&this.truncateElement&&document.removeEventListener("theme:resize",this.resizeEvent),this.cartBarExist&&document.removeEventListener("theme:scroll",this.scrollEvent)}onBlockSelect(e){const slider2=e.srcElement.closest(selectors$a.slider);if(slider2&&this.slider.length){const sliderIndex=slider2.hasAttribute(selectors$a.sliderIndex)?slider2.getAttribute(selectors$a.sliderIndex):0;if(!this.slider[sliderIndex])return;this.slider[sliderIndex].onBlockSelect(e)}}onBlockDeselect(e){const slider2=e.srcElement.closest(selectors$a.slider);if(slider2&&this.slider.length){const sliderIndex=slider2.hasAttribute(selectors$a.sliderIndex)?slider2.getAttribute(selectors$a.sliderIndex):0;if(!this.slider[sliderIndex])return;this.slider[sliderIndex].onBlockDeselect(e)}}}register("product",[{onLoad(){sections$8[this.id]=new Product(this)},onUnload(e){sections$8[this.id].onUnload(e)},onBlockSelect(e){sections$8[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$8[this.id].onBlockDeselect(e)}},tooltipSection,tabs,productStickySection,initSlider]),customElements.get("complementary-products")||customElements.define("complementary-products",ComplementaryProducts),customElements.get("pickup-availability")||customElements.define("pickup-availability",PickupAvailability),customElements.get("product-form")||customElements.define("product-form",ProductForm),
15customElements.get("product-modal")||customElements.define("product-modal",ProductModal),customElements.get("product-model")||customElements.define("product-model",ProductModel),customElements.get("product-siblings")||customElements.define("product-siblings",ProductSiblings),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("recipient-form")||customElements.define("recipient-form",RecipientForm),customElements.get("share-button")||customElements.define("share-button",ShareButton);const selectors$9={apiRelatedProductsTemplate:"[data-api-related-template]",relatedSection:"[data-related-section]",relatedProduct:"[data-product-grid-item]",recentlyViewed:"[data-recent-wrapper]",recentlyViewedWrapper:"[data-recently-viewed-wrapper]",productItem:".product-item",slider:"[data-slider]"},attributes$8={limit:"data-limit",minimum:"data-minimum",productId:"data-product-id"},classes$6={isHidden:"is-hidden"},sections$7={};class Related{constructor(section){this.section=section,this.sectionId=section.id,this.container=section.container,this.related(),this.recent()}related(){const relatedSection2=this.container.querySelector(selectors$9.relatedSection);if(!relatedSection2)return;const productId=relatedSection2.getAttribute(attributes$8.productId),limit=relatedSection2.getAttribute(attributes$8.limit),requestUrl=`${window.theme.routes.product_recommendations_url}?section_id=api-product-recommendation&limit=${limit}&product_id=${productId}&intent=related`;fetch(requestUrl).then(response=>response.text()).then(data=>{const relatedContent=document.createElement("div");relatedContent.innerHTML=new DOMParser().parseFromString(data,"text/html").querySelector(selectors$9.apiRelatedProductsTemplate).innerHTML,relatedContent.querySelector(selectors$9.relatedProduct)?(relatedSection2.innerHTML=relatedContent.innerHTML,relatedSection2.querySelectorAll(selectors$9.relatedProduct).length>4&&relatedSection2.querySelector(selectors$9.slider)&&new Slider(relatedSection2)):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$9.recentlyViewed),howManyToshow=recentlyViewed?parseInt(recentlyViewed.getAttribute(attributes$8.limit)):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$9.recentlyViewed),recentlyViewedWrapper=container.querySelector(selectors$9.recentlyViewedWrapper),recentProducts=wrapper.querySelectorAll(selectors$9.productItem),minimumNumberProducts=recentlyViewedHolder.hasAttribute(attributes$8.minimum)?parseInt(recentlyViewedHolder.getAttribute(attributes$8.minimum)):4,checkRecentInRelated=!recentlyViewedWrapper&&recentProducts.length>0,checkRecentOutsideRelated=recentlyViewedWrapper&&recentProducts.length>=minimumNumberProducts;(checkRecentInRelated||checkRecentOutsideRelated)&&(checkRecentOutsideRelated&&recentlyViewedWrapper.classList.remove(classes$6.isHidden),fadeIn(recentlyViewedHolder),recentlyViewedHolder.dispatchEvent(new CustomEvent("theme:tab:check",{bubbles:!0})),recentProducts.length>4&&recentlyViewedHolder.querySelector(selectors$9.slider)&&new Slider(recentlyViewedHolder))}})}}register("related",[{onLoad(){sections$7[this.id]=new Related(this)}},tabs]),register("reviews",[slider,blockScroll]);const sections$6={},selectors$8={sliderLogos:"[data-slider-logos]",sliderText:"[data-slider-text]",slide:"[data-slide]",slideIndex:"[data-slide-index]"},classes$5={isSelected:"is-selected",flickityEnabled:"flickity-enabled"},attributes$7={slideData:"data-slide",slideIndex:"data-slide-index"};class LogoList{constructor(section){this.container=section.container,this.slideshowNav=this.container.querySelector(selectors$8.sliderLogos),this.slideshowText=this.container.querySelector(selectors$8.sliderText),this.setSlideshowNavStateOnResize=()=>this.setSlideshowNavState(),this.flkty=null,this.flktyNav=null,this.initSlideshowText(),this.initSlideshowNav()}initSlideshowText(){if(!this.slideshowText)return;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,accessibility:!1,on:{ready:()=>this.sliderAccessibility(),change:()=>this.sliderAccessibility()}});const textSlides=this.slideshowText.querySelectorAll(selectors$8.slide);
15if(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`}})}}sliderAccessibility(){const buttons=this.slideshowText.querySelectorAll(`${selectors$8.slide} a, ${selectors$8.slide} button`);buttons.length&&buttons.forEach(button=>{const slide=button.closest(selectors$8.slide);if(slide){const tabIndex=slide.classList.contains(classes$5.isSelected)?0:-1;button.setAttribute("tabindex",tabIndex)}})}initSlideshowNav(){this.slideshowNav&&(this.logoSlides=this.slideshowNav.querySelectorAll(selectors$8.slideIndex),this.logoSlides.length&&this.logoSlides.forEach(logoItem=>{logoItem.addEventListener("click",e=>{e.preventDefault();const index=parseInt(logoItem.getAttribute(attributes$7.slideIndex)),hasSlider=this.slideshowNav.classList.contains(classes$5.flickityEnabled);if(this.flkty&&this.flkty.select(index),hasSlider)this.flktyNav.select(index),this.slideshowNav.classList.contains(classes$5.isSelected)||this.flktyNav.playPlayer();else{const selectedSlide=this.slideshowNav.querySelector(`.${classes$5.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$5.isSelected),logoItem.classList.add(classes$5.isSelected)}})}),this.setSlideshowNavState(),document.addEventListener("theme:resize",this.setSlideshowNavStateOnResize))}setSlideshowNavState(){const slides=this.slideshowNav.querySelectorAll(selectors$8.slide),slidesWidth=slides.length*200,sliderInitialized=this.slideshowNav.classList.contains(classes$5.flickityEnabled);if(slidesWidth>getWindowWidth()){if(!sliderInitialized){const selectedSlide=this.slideshowNav.querySelector(`.${classes$5.isSelected}`);selectedSlide&&selectedSlide.classList.remove(classes$5.isSelected),slides[0].classList.add(classes$5.isSelected),this.flktyNav=new Flickity(this.slideshowNav,{autoPlay:4e3,prevNextButtons:!1,contain:!1,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(),slides[0].classList.add(classes$5.isSelected),this.flkty&&this.flkty.select(0))}onBlockSelect(evt){if(!this.slideshowNav)return;const slide=this.slideshowNav.querySelector(`[${attributes$7.slideData}="${evt.detail.blockId}"]`),slideIndex=parseInt(slide.getAttribute(attributes$7.slideIndex));this.slideshowNav.classList.contains(classes$5.flickityEnabled)?(this.flktyNav.select(slideIndex),this.flktyNav.stopPlayer(),this.slideshowNav.classList.add(classes$5.isSelected)):slide.dispatchEvent(new Event("click"))}onBlockDeselect(){this.slideshowNav&&this.slideshowNav.classList.contains(classes$5.flickityEnabled)&&(this.flktyNav.playPlayer(),this.slideshowNav.classList.remove(classes$5.isSelected))}onUnload(){this.slideshowNav&&(this.slideshowNav.classList.contains(classes$5.flickityEnabled)&&this.flktyNav.destroy(),this.flkty&&this.flkty.destroy(),document.removeEventListener("theme:resize",this.setSlideshowNavStateOnResize))}}register("logos",[{onLoad(){sections$6[this.id]=new LogoList(this)},onUnload(e){sections$6[this.id].onUnload(e)},onBlockSelect(e){sections$6[this.id].onBlockSelect(e)},onBlockDeselect(e){sections$6[this.id].onBlockDeselect(e)}},blockScroll]);const attributes$6={videoPlay:"data-video-play"};class VideoPopup extends HTMLElement{constructor(){super()}connectedCallback(){this.videoPlay=this.querySelectorAll(`[${attributes$6.videoPlay}]`),this.videoPlay?.forEach(button=>{button.addEventListener("click",e=>{const button2=e.currentTarget;if(button2.getAttribute(attributes$6.videoPlay).trim()!==""){e.preventDefault();const items=[{html:button2.getAttribute(attributes$6.videoPlay)}];new LoadPhotoswipe(items),window.accessibility.lastElement=button2}})})}}
15const selectors$7={videoTemplate:"[data-video-template]"},classes$4={loading:"is-loading"},attributes$5={videoId:"data-video-id"};class VideoBackground extends HTMLElement{constructor(){super()}connectedCallback(){this.videoId=this.getAttribute(attributes$5.videoId),this.videoTemplate=this.querySelector(selectors$7.videoTemplate),this.video=null,this.videoId&&(this.addEventListener("touchstart",()=>{this.video?.play()},{passive:!0}),this.renderVideo())}renderVideo(){this.videoTemplateObserver=new IntersectionObserver((entries,observer)=>{entries.forEach(entry=>{if(entry.isIntersecting){const content=this.videoTemplate.innerHTML;this.innerHTML=content,this.classList.remove(classes$4.loading),this.video=this.querySelector("video"),this.observeVideoPlayToggle(),observer.unobserve(entry.target)}})},{root:null,rootMargin:"300px",threshold:[0,.1,.25,.5,.75,1]}),this.videoTemplateObserver.observe(this)}observeVideoPlayToggle(){if(!this.video)return;const options={rootMargin:"0px",threshold:[0,1]};this.videoPlayObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{const isVisible2=entry.isIntersecting;isVisible2&&typeof this.video.play=="function"&&this.video.play(),!isVisible2&&typeof this.video.pause=="function"&&this.video.pause()})},options),this.videoPlayObserver.observe(this.video)}disconnectedCallback(){this.videoTemplateObserver&&this.videoTemplateObserver.disconnect(),this.videoPlayObserver&&this.videoPlayObserver.disconnect()}}register("featured-video",[parallaxHero]),customElements.get("video-background")||customElements.define("video-background",VideoBackground),customElements.get("video-popup")||customElements.define("video-popup",VideoPopup),register("slideshow",[slider,parallaxHero]);const selectors$6={imagesHolder:"[data-images-holder]",imageHolder:"[data-image-holder]",imageElement:"[data-image-element]",imagesButton:"[data-images-button]",dataStartPosition:"data-start-position"},sections$5={};class CompareImages{constructor(section){this.imagesHolder=section,this.imagesHolder&&(this.imageHolder=this.imagesHolder.querySelector(selectors$6.imageHolder),this.imageElement=this.imagesHolder.querySelector(selectors$6.imageElement),this.imagesButton=this.imagesHolder.querySelector(selectors$6.imagesButton),this.startPosition=this.imagesHolder.hasAttribute(selectors$6.dataStartPosition)?this.imagesHolder.getAttribute(selectors$6.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,{passive:!0})}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$5[this.id]=[],this.container.querySelectorAll(selectors$6.imagesHolder).forEach(el=>{sections$5[this.id].push(new CompareImages(el))})}
15,onUnload(){sections$5[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}};register("custom-content",[slider,parallaxHero,compareImages,newsletterCheckForResultSection]),customElements.get("video-background")||customElements.define("video-background",VideoBackground),customElements.get("video-popup")||customElements.define("video-popup",VideoPopup);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}
15,{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")}}register("map",{onLoad(){allMaps[this.id]=new Map(this)},onUnload(){typeof allMaps[this.id].unload=="function"&&allMaps[this.id].unload()}});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();return new google.maps.Marker({map,position:center}),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)})})}const 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$5={largePromo:"[data-large-promo]",largePromoInner:"[data-large-promo-inner]",trackingInner:"[data-tracking-consent-inner]",tracking:"[data-tracking-consent]",trackingAccept:"[data-confirm-cookies]",cartBar:"cart-bar",close:"[data-close-modal]",modalUnderlay:"[data-modal-underlay]",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$3={hidden:"hidden",hasValue:"has-value",cartBarVisible:"cart-bar-visible",isVisible:"is-visible",success:"has-success",selected:"selected",hasBlockSelected:"has-block-selected",mobile:"mobile",desktop:"desktop",bottom:"bottom"},attributes$4={enable:"data-enable"};let sections$4={};class DelayShow{constructor(holder,element,callback=null){if(this.element=element,this.delay=holder.getAttribute(selectors$5.delayAttribite),this.isSubmitted=window.location.href.indexOf("accepts_marketing")!==-1||window.location.href.indexOf("customer_posted=true")!==-1,this.callback=callback,this.showPopupOnScrollEvent=()=>this.showPopupOnScroll(),(this.delay==="always"||this.isSubmitted)&&this.always(),this.delay&&this.delay.includes("delayed")&&!this.isSubmitted){const seconds=this.delay.includes("_")?parseInt(this.delay.split("_")[1]):10;this.delayed(seconds)}this.delay==="bottom"&&!this.isSubmitted&&this.bottom(),this.delay==="idle"&&!this.isSubmitted&&this.idle()}always(){fadeIn(this.element,null,this.callback)}delayed(seconds=10){setTimeout(()=>{fadeIn(this.element,null,this.callback)},seconds*1e3)}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)}
15,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()}bottom(){document.addEventListener("theme:scroll",this.showPopupOnScrollEvent)}showPopupOnScroll(){window.scrollY+window.innerHeight>=document.body.clientHeight&&(fadeIn(this.element,null,this.callback),document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent))}onUnload(){document.removeEventListener("theme:scroll",this.showPopupOnScrollEvent)}}class TargetReferrer{constructor(el){if(this.el=el,this.locationPath=location.href,!this.el.hasAttribute(selectors$5.dataTargetReferrer))return!1;this.init()}init(){this.locationPath.indexOf(this.el.getAttribute(selectors$5.dataTargetReferrer))===-1&&!window.Shopify.designMode&&this.el.parentNode.removeChild(this.el)}}class LargePopup{constructor(el){this.popup=el,this.modal=this.popup.querySelector(selectors$5.largePromoInner),this.close=this.popup.querySelector(selectors$5.close),this.underlay=this.popup.querySelector(selectors$5.modalUnderlay),this.form=this.popup.querySelector(selectors$5.newsletterForm),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$5.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$3.mobile),targetDesktop=this.popup.classList.contains(classes$3.desktop),isMobileView=!isDesktop();let targetMatches=!0;if((targetMobile&&!isMobileView||targetDesktop&&isMobileView)&&(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$3.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})))}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$3.selected),this.popup.parentNode.classList.add(classes$3.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.scrollUnlock(),this.popup.classList.remove(classes$3.selected),this.popup.parentNode.classList.remove(classes$3.hasBlockSelected))}}class Tracking{constructor(el){this.popup=el,this.modal=document.querySelector(selectors$5.tracking),this.acceptButton=this.modal.querySelector(selectors$5.trackingAccept),this.enable=this.modal.getAttribute(attributes$4.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$3.selected),this.popup.parentNode.classList.add(classes$3.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.modal),this.popup.classList.remove(classes$3.selected),this.popup.parentNode.classList.remove(classes$3.hasBlockSelected))}}class PromoText{constructor(el){this.popup=el,this.close=this.popup.querySelector(selectors$5.close),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$5.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$3.selected),this.popup.parentNode.classList.add(classes$3.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.popup),this.popup.classList.remove(classes$3.selected),this.popup.parentNode.classList.remove(classes$3.hasBlockSelected))}}class NewsletterPopup{constructor(el){this.popup=el,this.holder=this.popup.querySelector(selectors$5.newsletterPopupHolder),this.close=this.popup.querySelector(selectors$5.newsletterClose),this.heading=this.popup.querySelector(selectors$5.newsletterHeading),this.newsletterField=this.popup.querySelector(selectors$5.newsletterField),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$5.cookieNameAttribute),"newsletter_is_closed"),this.form=this.popup.querySelector(selectors$5.newsletterForm),this.isTargeted=new TargetReferrer(this.popup),this.resetClassTimer=0,this.init()}init(){const cookieExists=this.cookie.read()!==!1,submissionSuccess=window.location.search.indexOf("?customer_posted=true")!==-1,isPositionBottom=[...this.holder.classList].toString().includes(classes$3.bottom);submissionSuccess&&(this.delay=0),(!cookieExists||window.Shopify.designMode)&&(this.show(),this.form.classList.contains(classe
15s$3.success)&&this.checkForSuccess()),isPositionBottom&&this.observeCartBar()}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()}observeCartBar(){if(this.cartBar=document.getElementById(selectors$5.cartBar),!this.cartBar)return;const config={attributes:!0,childList:!1,subtree:!1};let isVisible2=this.cartBar.classList.contains(classes$3.isVisible);document.body.classList.toggle(classes$3.cartBarVisible,isVisible2);const callback=mutationList=>{for(const mutation of mutationList)mutation.type==="attributes"&&(isVisible2=mutation.target.classList.contains(classes$3.isVisible),document.body.classList.toggle(classes$3.cartBarVisible,isVisible2))};this.observer=new MutationObserver(callback),this.observer.observe(this.cartBar,config)}showForm(){this.heading.addEventListener("click",event=>{event.preventDefault(),this.heading.classList.add(classes$3.hidden),this.form.classList.remove(classes$3.hidden),this.newsletterField.focus()}),this.heading.addEventListener("keyup",event=>{event.code==="Enter"&&this.heading.dispatchEvent(new Event("click"))})}closePopup(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.holder),this.cookie.write()})}inputField(){const setClass=()=>{this.resetClassTimer&&clearTimeout(this.resetClassTimer),this.newsletterField.value!==""&&this.holder.classList.add(classes$3.hasValue)},unsetClass=()=>{this.resetClassTimer&&clearTimeout(this.resetClassTimer),this.resetClassTimer=setTimeout(()=>{this.holder.classList.remove(classes$3.hasValue)},2e3)};this.newsletterField.addEventListener("input",setClass),this.newsletterField.addEventListener("focus",setClass),this.newsletterField.addEventListener("focusout",unsetClass)}onBlockSelect(evt){this.popup.contains(evt.target)&&(fadeIn(this.holder),this.popup.classList.add(classes$3.selected),this.popup.parentNode.classList.add(classes$3.hasBlockSelected))}onBlockDeselect(evt){this.popup.contains(evt.target)&&(fadeOut(this.holder),this.popup.classList.remove(classes$3.selected),this.popup.parentNode.classList.remove(classes$3.hasBlockSelected))}onUnload(){this.observer&&this.observer.disconnect()}}register("popups",[{onLoad(){sections$4[this.id]=[],this.container.querySelectorAll(selectors$5.largePromo).forEach(el=>{sections$4[this.id].push(new LargePopup(el))}),this.container.querySelectorAll(selectors$5.tracking).forEach(el=>{sections$4[this.id].push(new Tracking(el))}),this.container.querySelectorAll(selectors$5.newsletterPopup).forEach(el=>{sections$4[this.id].push(new NewsletterPopup(el))}),this.container.querySelectorAll(selectors$5.promoPopup).forEach(el=>{sections$4[this.id].push(new PromoText(el))})},onBlockSelect(evt){sections$4[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$4[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})},onUnload(){sections$4[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})}},newsletterCheckForResultSection]);const selectors$4={passwordLogin:"[data-password-login]",passwordModal:"[data-password-modal]",modalBody:"[data-modal-body]",close:"[data-modal-close]",loginErrors:"#login_form .errors"},classes$2={open:"is-open"};class Password{constructor(section){this.container=section.container,this.passwordLogin=this.container.querySelectorAll(selectors$4.passwordLogin),this.modal=this.container.querySelector(selectors$4.passwordModal),this.modalBody=this.container.querySelector(selectors$4.modalBody),this.closeButtons=this.container.querySelectorAll(selectors$4.close),this.a11y=a11y,this.loginErrors=this.container.querySelector(selectors$4.loginErrors),this.init()}init(){this.passwordLogin.length&&this.modal&&this.modalBody&&(this.passwordLogin.forEach(passwordLogin=>{passwordLogin.addEventListener("click",e=>{e.preventDefault(),this.openModal()})}),this.closeButtons.length&&this.closeButtons.forEach(closeButton=>{closeButton.addEventListener("click",e=>{e.preventDefault(),this.closeModal()})}),this.loginErrors&&this.openModal())}openModal(){fadeIn(this.modal,"block",()=>{this.modal.classList.add(classes$2.open)}),this.scrollLock()}closeModal(){fadeOut(this.modal),this.modal.classList.remove(classes$2.open),this.scrollUnlock()}scrollLock(){window.getComputedStyle(this.modal).display!=="none"&&(this.a11y.trapFocus(this.modal),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})))}scrollUnlock(){this.a11y.removeTrapFocus(),document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}}register("password-template",{onLoad(){new Password(this)}}),register("list-collections",[slider,blockScroll]),register("columns",[blockScroll,slider]),register("newsletter",newsletterCheckForResultSection),register("before-after",[compareImages]);const selectors$3={scrollToElement:"[data-scroll-to]",tooltip:"[data-tooltip]",collapsibleTrigger:"[data-collapsible-trigger]"},attributes$3={open:"open",dataScrollTo:"data-scroll-to",tooltipStopMousenterValue:"data-tooltip-stop-mouseenter"},sections$3={};class ScrollToElement{constructor(section){this.section=section,this.container=section.container,this.scrollToButtons=this.container.querySelectorAll(selectors$3.scrollToElement),this.scrollToButtons.length&&this.init()}init(){this.scrollToButtons.forEach(element=>{element.addEventListener("click",()=>{const target=this.container.querySelector(element.getAttribute(attributes$3.dataScrollTo));!target||element.tagName==="A"||this.scrollToElement(target)})})}scrollToElement(element){scrollTo(element.getBoundingClientRect().top+1);const collapsibleElement=element.nextElementSibling.matches("details")?element.nextElementSibling:null;if(collapsibleElement){const collapsibleTrigger=collapsibleElement?.querySelector(selectors$3.collapsibleTrigger);collapsibleElement.hasAttribute(attributes$3.open)||collapsibleTrigger?.dispatchEvent(new Event("click"))}const tooltips=document.querySelectorAll(`${selectors$3.tooltip}:not([${attributes$3.tooltipStopMousenterValue}])`);tooltips.length&&tooltips.forEach(tooltip=>{tooltip.setAttribute(attributes$3.tooltipStopMousenterValue,""),setTimeout(()=>{tooltip.removeAttribute(attributes$3.tooltipStopMousenterValue)},1e3)})}}const scrollToElement={onLoad(){sections$3[this.id]=new ScrollToElement(this)}},selectors$2={scrollSpy:"[data-scroll-spy]",headerSticky:"[data-header-sticky]"}
15,classes$1={selected:"is-selected"},attributes$2={scrollSpy:"data-scroll-spy",mobile:"data-scroll-spy-mobile",desktop:"data-scroll-spy-desktop"},sections$2={};class ScrollSpy{constructor(section){this.section=section,this.container=section.container,this.scrollSpyAnchors=this.container.querySelectorAll(selectors$2.scrollSpy),this.loopAnchors=this.loopAnchors.bind(this),this.observers=[],this.init()}init(){this.loopAnchors(),document.addEventListener("theme:resize:width",this.loopAnchors)}loopAnchors(){this.scrollSpyAnchors.length&&this.scrollSpyAnchors.forEach(anchor=>{this.toggleObserver(anchor)})}toggleObserver(anchor){const anchorSpy=this.container.querySelector(anchor.getAttribute(attributes$2.scrollSpy));if(!anchorSpy)return;this.observers[anchorSpy.id]&&this.observers[anchorSpy.id].unobserve(anchorSpy);const isDesktopView=isDesktop();(!isDesktopView&&anchor.hasAttribute(attributes$2.mobile)||isDesktopView&&anchor.hasAttribute(attributes$2.desktop)||!anchor.hasAttribute(attributes$2.desktop)&&!anchor.hasAttribute(attributes$2.mobile))&&this.runObserver(anchorSpy)}runObserver(anchorSpy){let{headerHeight}=readHeights();const stickyHeader2=!!document.querySelector(selectors$2.headerSticky);headerHeight=stickyHeader2?headerHeight:0;const options={rootMargin:stickyHeader2?headerHeight*-1+"px 0px 0px 0px":"0px",threshold:[.5,1]};this.observers[anchorSpy.id]=new IntersectionObserver(entries=>{entries.forEach(entry=>{const anchorOld=this.container.querySelector(`[${attributes$2.scrollSpy}].${classes$1.selected}`),anchorNew=this.container.querySelector(`[${attributes$2.scrollSpy}="#${entry.target.id}"]`);entry.intersectionRatio>.5&&entry.boundingClientRect.top-headerHeight<=entry.boundingClientRect.height&&(anchorOld?.classList.remove(classes$1.selected),anchorNew?.classList.add(classes$1.selected))})},options),this.observers[anchorSpy.id].observe(anchorSpy)}onUnload(){document.removeEventListener("theme:resize:width",this.loopAnchors),this.observers.length&&this.observers.forEach(observer=>{observer.disconnect()})}}const scrollSpy={onLoad(){sections$2[this.id]=new ScrollSpy(this)},onUnload(){sections$2[this.id].onUnload()}};register("sidebar",[scrollToElement,scrollSpy]);const selectors$1={button:"[data-hover-target]",image:"[data-collection-image]"},attributes$1={target:"data-hover-target"},classes={visible:"is-visible",selected:"is-selected"};let sections$1={};class CollectionsHover{constructor(section){this.container=section.container,this.buttons=this.container.querySelectorAll(selectors$1.button),this.init()}init(){this.buttons.length&&this.buttons.forEach(button=>{button.addEventListener("mouseenter",e=>{const targetId=e.currentTarget.getAttribute(attributes$1.target);this.updateState(targetId)})})}updateState(targetId){const button=this.container.querySelector(`[${attributes$1.target}="${targetId}"]`),target=this.container.querySelector(`#${targetId}:not(.${classes.visible})`),buttonSelected=this.container.querySelector(`${selectors$1.button}.${classes.selected}`),imageVisible=this.container.querySelector(`${selectors$1.image}.${classes.visible}`);target&&isDesktop()&&(imageVisible?.classList.remove(classes.visible),buttonSelected?.classList.remove(classes.selected),target.classList.add(classes.visible),button.classList.add(classes.selected))}onBlockSelect(e){this.updateState(e.target.id)}}register("collections-hover",[{onLoad(){sections$1[this.id]=new CollectionsHover(this)},onBlockSelect(e){sections$1[this.id].onBlockSelect(e)}},scrollSpy]);const selectors={image:"[data-featured-image]",imagesHolder:"[data-featured-aside]",contentHolder:"[data-featured-content]",wrapper:"[data-featured-wrapper]",headerSticky:"[data-header-sticky]",headerHeight:"[data-header-height]"},attributes={horizontalScroll:"data-horizontal-scroll"},sections={};class FeaturedProduct{constructor(section){this.container=section.container,this.horizontalScroll=this.container.hasAttribute(attributes.horizontalScroll),this.images=this.container.querySelectorAll(selectors.image),this.imagesHolder=this.container.querySelector(selectors.imagesHolder),this.contentHolder=this.container.querySelector(selectors.contentHolder),this.wrapper=this.container.querySelector(selectors.wrapper),this.headerHeight=this.getHeaderHeight(),this.calculateHorizontalPositionEvent=e=>this.calculateHorizontalPosition(e),this.calculateHeightEvent=()=>this.calculateHeight(),this.init()}init(){this.horizontalScroll&&this.imagesHolder&&document.addEventListener("theme:scroll",this.calculateHorizontalPositionEvent),this.wrapper&&this.contentHolder&&this.images.length&&(this.calculateHeight(),document.addEventListener("theme:resize:width",this.calculateHeightEvent))}calculateHorizontalPosition(e){let scrollTop=e.detail.position+this.headerHeight;const windowBottom=scrollTop+window.innerHeight,elemTop=this.imagesHolder.offsetTop,elemHeight=this.imagesHolder.offsetHeight,elemBottom=elemTop+elemHeight+this.headerHeight,elemBottomTop=elemHeight-(window.innerHeight-this.headerHeight);let percent=0;scrollTop>=elemTop&&windowBottom<=elemBottom?percent=(scrollTop-elemTop)/elemBottomTop*100:scrollTop<elemTop?percent=0:percent=100,percent*=this.images.length-1,this.container.style.setProperty("--translateX",`${percent*-1}%`)}calculateHeight(){this.container.style.removeProperty("--min-height"),this.container.style.setProperty("--min-height",`${this.wrapper.offsetHeight+this.contentHolder.offsetHeight}px`),this.headerHeight=this.getHeaderHeight()}getHeaderHeight(){return document.querySelector(selectors.headerSticky)&&document.querySelector(selectors.headerHeight)?parseInt(document.querySelector(selectors.headerHeight).getBoundingClientRect().height):0}onUnload(){this.horizontalScroll&&this.imagesHolder&&document.removeEventListener("theme:scroll",this.calculateHorizontalPositionEvent),this.wrapper&&this.contentHolder&&this.images.length&&document.removeEventListener("theme:resize:width",this.calculateHeightEvent)}}register("featured-product",[{onLoad(){sections[this.id]=new FeaturedProduct(this)},onUnload(e){sections[this.id].onUnload(e)}}]),document.addEventListener("DOMContentLoaded",function(){load("*");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)})),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
15orts-cookies"))})(themeVendor.ScrollLock,themeVendor.themeAddresses,themeVendor.themeCurrency,themeVendor.Rellax,themeVendor.Flickity,themeVendor.FlickityFade,themeVendor.themeImages);
16//# sourceMappingURL=/cdn/shop/t/203/assets/theme.dev.js.map?v=174889137357660644761790288915

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.