1if(console.info(` ___ _ ___ ___ \r 2 / _ \\ ___ _ __ | |_ ( _ ) / _ \\ \r 3 / /_)/ / _ \\ | '__|| __| / _ \\ | | | |\r 4/ ___/ | (_) || | | |_ | (_) || |_| |\r 5\\/ \\___/ |_| \\__| \\___/ \\___/ \r 6 \r 7 https://www.port80webdesign.com`),typeof p80>"u")var p80={};class MediaQueryListener{constructor(){this.mediaTypes={small:"small",medium:"medium",large:"large",touch:"touch"},this.mediaQueries=[{query:window.matchMedia("(max-width: 749px)"),type:"small"},{query:window.matchMedia("(min-width: 750px) and (max-width: 989px"),type:"medium"},{query:window.matchMedia("(min-width: 990px)"),type:"large"},{query:window.matchMedia("(pointer: coarse)"),type:"touch"}],this.touchSupport=window.matchMedia("(pointer: coarse)").matches,this.queryChangeHandler=this.onQueryChange.bind(this),this.currentMediaQuery=this.mediaQueries.find(queryOption=>queryOption.query.matches&&queryOption.query.type!==this.mediaTypes.touch),this.mediaQueries.forEach(queryOption=>{queryOption.query.addEventListener("change",this.queryChangeHandler.bind(this,queryOption))}),document.addEventListener("DOMContentLoaded",this.publish())}onQueryChange(queryOption){if(!(queryOption&&queryOption.query&&queryOption.query.matches&&this.currentMediaQuery.type===queryOption.type)){if(queryOption.type!==this.mediaTypes.touch){const previousMedia=this.currentMediaQuery,newMedia=this.mediaQueries.find(queryOption2=>queryOption2.query.matches);if(previousMedia&&previousMedia.type===newMedia.type)return;this.currentMediaQuery=newMedia}else this.touchSupport=queryOption.query.matches;this.publish()}}publish(){typeof publish>"u"||publish(PUB_SUB_EVENTS.mediaQueryChange,{source:"MediaQueryListener",currentMedia:this.currentMediaQuery,touchSupport:this.touchSupport})}}p80.mediaQueryService=new MediaQueryListener;function getFocusableElements(container){return Array.from(container.querySelectorAll("summary, a[href], button:enabled, [tabindex]:not([tabindex^='-']), [draggable], area, input:not([type=hidden]):enabled, select:enabled, textarea:enabled, object, iframe, input, ajax-cart-toggle, cart-notification-modal-close"))}document.querySelectorAll('[id^="Details-"] summary').forEach(summary=>{summary.setAttribute("role","button"),summary.setAttribute("aria-expanded",summary.parentNode.hasAttribute("open")),summary.nextElementSibling.getAttribute("id")&&summary.setAttribute("aria-controls",summary.nextElementSibling.id),summary.addEventListener("click",event=>{event.currentTarget.setAttribute("aria-expanded",!event.currentTarget.closest("details").hasAttribute("open"))}),!summary.closest("header-drawer, menu-drawer")&&summary.parentElement.addEventListener("keyup",onKeyUpEscape)});const trapFocusHandlers={};function trapFocus(container,elementToFocus=container){var elements=getFocusableElements(container),first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=event=>{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.toUpperCase()==="TAB"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),elementToFocus.focus(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)}try{document.querySelector(":focus-visible")}catch{focusVisiblePolyfill()}function focusVisiblePolyfill(){const navKeys=["ARROWUP","ARROWDOWN","ARROWLEFT","ARROWRIGHT","TAB","ENTER","SPACE","ESCAPE","HOME","END","PAGEUP","PAGEDOWN"];let currentFocusedElement=null,mouseClick=null;window.addEventListener("keydown",event=>{navKeys.includes(event.code.toUpperCase())&&(mouseClick=!1)}),window.addEventListener("mousedown",event=>{mouseClick=!0}),window.addEventListener("focus",()=>{currentFocusedElement&¤tFocusedElement.classList.remove("focused"),!mouseClick&&(currentFocusedElement=document.activeElement,currentFocusedElement.classList.add("focused"))},!0)}function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-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()})}function removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}function onKeyUpEscape(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");if(!openDetailsElement)return;const summaryElement=openDetailsElement.querySelector("summary");openDetailsElement.removeAttribute("open"),summaryElement.setAttribute("aria-expanded",!1),summaryElement.focus()}class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
7w Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}quantityUpdateUnsubscriber=void 0;connectedCallback(){this.validateQtyRules(),this.quantityUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this))}disconnectedCallback(){this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber()}onInputChange(event){this.validateQtyRules()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"?this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min){const min=parseInt(this.input.min);this.querySelector(".quantity__button[name='minus']").classList.toggle("disabled",value<=min)}if(this.input.max){const max=parseInt(this.input.max);this.querySelector(".quantity__button[name='plus']").classList.toggle("disabled",value>=max)}}}customElements.define("quantity-input",QuantityInput);function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function throttle(fn,delay){let lastCall=0;return function(...args){const now=new Date().getTime();if(!(now-lastCall<delay))return lastCall=now,fn(...args)}}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}typeof window.Shopify>"u"&&(window.Shopify={}),Shopify.bind=function(fn,scope){return function(){return fn.apply(scope,arguments)}},Shopify.setSelectorByValue=function(selector,value){for(var i=0,count=selector.options.length;i<count;i++){var option=selector.options[i];if(value==option.value||value==option.innerHTML)return selector.selectedIndex=i,i}},Shopify.addListener=function(target,eventName,callback){target.addEventListener?target.addEventListener(eventName,callback,!1):target.attachEvent("on"+eventName,callback)},Shopify.postLink=function(path,options){options=options||{};var method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(var key in params){var hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",key),hiddenField.setAttribute("value",params[key]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},Shopify.CountryProvinceSelector=function(country_domid,province_domid,options){this.countryEl=document.getElementById(country_domid),this.provinceEl=document.getElementById(province_domid),this.provinceContainer=document.getElementById(options.hideElement||province_domid),Shopify.addListener(this.countryEl,"change",Shopify.bind(this.countryHandler,this)),this.initCountry(),this.initProvince()},Shopify.CountryProvinceSelector.prototype={initCountry:function(){var value=this.countryEl.getAttribute("data-default");Shopify.setSelectorByValue(this.countryEl,value),this.countryHandler()},initProvince:function(){var value=this.provinceEl.getAttribute("data-default");value&&this.provinceEl.options.length>0&&Shopify.setSelectorByValue(this.provinceEl,value)},countryHandler:function(e){var opt=this.countryEl.options[this.countryEl.selectedIndex],raw=opt.getAttribute("data-provinces"),provinces=JSON.parse(raw);if(this.clearOptions(this.provinceEl),provinces&&provinces.length==0)this.provinceContainer.style.display="none";else{for(var i=0;i<provinces.length;i++){var opt=document.createElement("option");opt.value=provinces[i][0],opt.innerHTML=provinces[i][1],this.provinceEl.appendChild(opt)}this.provinceContainer.style.display=""}},clearOptions:function(selector){for(;selector.firstChild;)selector.removeChild(selector.firstChild)},setOptions:function(selector,values){for(var i=0,count=values.length;i<values.length;i++){var opt=document.createElement("option");opt.value=values[i],opt.innerHTML=values[i],selector.appendChild(opt)}}};class MenuDrawer extends HTMLElement{constructor(){super(),this.mainDetailsToggle=this.querySelector("details"),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button:not(.localization-selector):not(.country-selector__close-button):not(.country-filter__reset-button)").forEach(button=>button.addEventListener("click",this.onCloseButtonClick.bind(this)))}onKeyUp(event){if(event.code.toUpperCase()!=="ESCAPE")return;const openDetailsElement=event.target.closest("details[open]");openDetailsElement&&(openDetailsElement===this.mainDetailsToggle?this.closeMenuDrawer(event,this.mainDetailsToggle.querySelector("summary")):this.closeSubmenu(openDetailsElement))}onSummaryClick(event){const summaryElement=event.currentTarget,detailsElement=summaryElement.parentNode,parentMenuElement=detailsElement.closest(".has-submenu"),isOpen=detailsElement.hasAttribute("open"),reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)");function addTrapFocus(){trapFocus(summaryElement.nextElementSibling,detailsElement.querySelector("button")),summaryElement.nextElementSibling.removeEventListener("transitionend",addTrapFocus)}detailsElement===this.mainDetailsToggle?(isOpen&&event.preventDefault(),isOpen?this.closeMenuDrawer(event,summaryElement):this.openMenuDrawer(summaryElement),window.matchMedia("(max-width: 990px)")&&document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)):setTimeout(()=>{detailsElement.classList.add("menu-opening"),summaryElement.setAttribute("aria-expanded",!0),parentMenuElement&&parentMenuElement.classList.add("submenu-open"),!reducedMotion||reducedMotion.matches?addTrapFocus():summaryElement.nextElementSibling.addEventListener("transitionend",addTrapFocus)},100)}openMenuDrawer(summaryElement){setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event,elementToFocus=!1){event!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
7s=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelectorAll(".submenu-open").forEach(submenu=>{submenu.classList.remove("submenu-open")}),document.body.classList.remove(`overflow-hidden-${this.dataset.breakpoint}`),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle),event instanceof KeyboardEvent&&elementToFocus?.setAttribute("aria-expanded",!1))}onFocusOut(){setTimeout(()=>{this.mainDetailsToggle.hasAttribute("open")&&!this.mainDetailsToggle.contains(document.activeElement)&&this.closeMenuDrawer()})}onCloseButtonClick(event){const detailsElement=event.currentTarget.closest("details");this.closeSubmenu(detailsElement)}closeSubmenu(detailsElement){const parentMenuElement=detailsElement.closest(".submenu-open");parentMenuElement&&parentMenuElement.classList.remove("submenu-open"),detailsElement.classList.remove("menu-opening"),detailsElement.querySelector("summary").setAttribute("aria-expanded",!1),removeTrapFocus(detailsElement.querySelector("summary")),this.closeAnimation(detailsElement)}closeAnimation(detailsElement){let animationStart;const handleAnimation=time=>{animationStart===void 0&&(animationStart=time),time-animationStart<400?window.requestAnimationFrame(handleAnimation):(detailsElement.removeAttribute("open"),detailsElement.closest("details[open]")&&trapFocus(detail
7sElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super()}openMenuDrawer(summaryElement){this.header=this.header||document.querySelector(".section-header"),this.borderOffset=this.borderOffset||this.closest(".header-wrapper").classList.contains("header-wrapper--border-bottom")?1:0,document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),this.header.classList.add("menu-open"),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),window.addEventListener("resize",this.onResize),trapFocus(this.mainDetailsToggle,summaryElement),document.body.classList.add(`overflow-hidden-${this.dataset.breakpoint}`)}closeMenuDrawer(event,elementToFocus){elementToFocus&&(super.closeMenuDrawer(event,elementToFocus),this.header.classList.remove("menu-open"),window.removeEventListener("resize",this.onResize))}onResize=()=>{this.header&&document.documentElement.style.setProperty("--header-bottom-position",`${parseInt(this.header.getBoundingClientRect().bottom-this.borderOffset)}px`),document.documentElement.style.setProperty("--viewport-height",`${window.innerHeight}px`)}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this,!1)),this.addEventListener("keyup",event=>{event.code.toUpperCase()==="ESCAPE"&&this.hide()}),this.classList.contains("media-modal")?this.addEventListener("pointerup",event=>{event.pointerType==="mouse"&&!event.target.closest("deferred-media, product-model")&&this.hide()}):this.addEventListener("click",event=>{event.target===this&&this.hide()})}connectedCallback(){this.moved||(this.moved=!0,document.body.appendChild(this))}show(opener){this.openedBy=opener;const popup=this.querySelector(".template-popup");document.body.classList.add("overflow-hidden"),this.setAttribute("open",""),popup&&popup.loadContent(),trapFocus(this,this.querySelector('[role="dialog"]')),window.pauseAllMedia()}hide(){document.body.classList.remove("overflow-hidden"),document.body.dispatchEvent(new CustomEvent("modalClosed")),this.removeAttribute("open"),removeTrapFocus(this.openedBy),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super()}connectedCallback(){this.bind()}bind(){const button=this.querySelector("button");button&&button.addEventListener("click",()=>{const modal=document.querySelector(this.getAttribute("data-modal"));modal&&modal.show(button)})}}customElements.define("modal-opener",ModalOpener);class DeferredMedia extends HTMLElement{constructor(){super();const poster=this.querySelector('[id^="Deferred-Poster-"]');poster&&poster.addEventListener("click",this.loadContent.bind(this))}loadContent(focus=!0){if(window.pauseAllMedia(),!this.getAttribute("loaded")){const content=document.createElement("div");content.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",!0);const deferredElement=this.appendChild(content.querySelector("video, model-viewer, iframe"));focus&&deferredElement.focus(),deferredElement.nodeName=="VIDEO"&&deferredElement.getAttribute("autoplay")&&deferredElement.play()}}}customElements.define("deferred-media",DeferredMedia);class SliderComponent extends HTMLElement{constructor(){if(super(),this.slider=this.querySelector('[id^="Slider-"]'),this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.enableSliderLooping=!1,this.currentPageElement=this.querySelector(".slider-counter--current"),this.pageTotalElement=this.querySelector(".slider-counter--total"),this.prevButton=this.querySelector('button[name="previous"]'),this.nextButton=this.querySelector('button[name="next"]'),!this.slider||!this.nextButton)return;this.initPages(),new ResizeObserver(entries=>this.initPages()).observe(this.slider),this.slider.addEventListener("scroll",this.update.bind(this)),this.prevButton.addEventListener("click",this.onButtonClick.bind(this)),this.nextButton.addEventListener("click",this.onButtonClick.bind(this))}initPages(){this.sliderItemsToShow=Array.from(this.sliderItems).filter(element=>element.clientWidth>0),!(this.sliderItemsToShow.length<2)&&(this.sliderItemOffset=this.sliderItemsToShow[1].offsetLeft-this.sliderItemsToShow[0].offsetLeft,this.slidesPerPage=Math.floor((this.slider.clientWidth-this.sliderItemsToShow[0].offsetLeft)/this.sliderItemOffset),this.totalPages=this.sliderItemsToShow.length-this.slidesPerPage+1,this.update())}resetPages(){this.sliderItems=this.querySelectorAll('[id^="Slide-"]'),this.initPages()}update(){if(!this.slider||!this.nextButton)return;const previousPage=this.currentPage;this.currentPage=Math.round(this.slider.scrollLeft/this.sliderItemOffset)+1,this.currentPageElement&&this.pageTotalElement&&(this.currentPageElement.textContent=this.currentPage,this.pageTotalElement.textContent=this.totalPages),!this.enableSliderLooping&&(this.isSlideVisible(this.sliderItemsToShow[0])&&this.slider.scrollLeft===0?this.prevButton.setAttribute("disabled","disabled"):this.prevButton.removeAttribute("disabled"),this.isSlideVisible(this.sliderItemsToShow[this.sliderItemsToShow.length-1])?this.nextButton.setAttribute("disabled","disabled"):this.nextButton.removeAttribute("disabled"))}isSlideVisible(element,offset=0){const lastVisibleSlide=this.slider.clientWidth+this.slider.scrollLeft-offset;return element.offsetLeft+element.clientWidth<=lastVisibleSlide&&element.offsetLeft>=this.slider.scrollLeft}onButtonClick(event){event.preventDefault();const step=event.currentTarget.dataset.step||1;this.slideScrollPosition=event.currentTarget.name==="next"?this.slider.scrollLeft+step*this.sliderItemOffset:this.slider.scrollLeft-step*this.sliderItemOffset,this.setSlidePosition(this.slideScrollPosition)}setSlidePosition(position){this.slider.scrollTo({left:position})}}customElements.define("slider-component",SliderComponent);class SlideshowComponent extends SliderComponent{constructor(){super(),this.sliderControlWrapper=this.querySelector(".slider-buttons"),this.enableSliderLooping=!0,this.sliderControlWrapper&&(this.sliderFirstItemNode=this.slider.querySelector(".slideshow__slide glide__slide"),this.sliderItemsToShow.length>0&&(this.currentPage=1),this.announcementBarSlider=this.querySelector(".announcement-bar-slider"),this.announcerBarAnimationDelay=this.announcementBarSlider?250:0,this.sliderControlLinksArray=Array.from(this.sliderControlWrapper.querySelectorAll(".slider-counter__link")),this.sliderControlLinksArray.forEach(link=>link.addEventListener("click",this.linkToSlide.bind(this))),this.slider.addEventListener("scroll",this.setSlideVisibility.bind(this)),this.setSlideVisibility(),this.announcementBarSlider&&(this.announcementBarArrowButtonWasClicked=!1,this.reducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)"),this.reducedMotion.addEventListener("change",()=>{this.slider.getAttribute("data-autoplay")==="true"&&this.setAutoPlay()}
7),[this.prevButton,this.nextButton].forEach(button=>{button.addEventListener("click",()=>{this.announcementBarArrowButtonWasClicked=!0},{once:!0})})),this.slider.getAttribute("data-autoplay")==="true"&&this.setAutoPlay())}setAutoPlay(){this.autoplaySpeed=this.slider.dataset.speed*1e3,this.addEventListener("mouseover",this.focusInHandling.bind(this)),this.addEventListener("mouseleave",this.focusOutHandling.bind(this)),this.addEventListener("focusin",this.focusInHandling.bind(this)),this.addEventListener("focusout",this.focusOutHandling.bind(this)),this.querySelector(".slideshow__autoplay")?(this.sliderAutoplayButton=this.querySelector(".slideshow__autoplay"),this.sliderAutoplayButton.addEventListener("click",this.autoPlayToggle.bind(this)),this.autoplayButtonIsSetToPlay=!0,this.play()):this.reducedMotion.matches||this.announcementBarArrowButtonWasClicked?this.pause():this.play()}onButtonClick(event){super.onButtonClick(event),this.wasClicked=!0;const isFirstSlide=this.currentPage===1,isLastSlide=this.currentPage===this.sliderItemsToShow.length;if(!isFirstSlide&&!isLastSlide){this.applyAnimationToAnnouncementBar(event.currentTarget.name);return}isFirstSlide&&event.currentTarget.name==="previous"?this.slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*this.sliderItemsToShow.length:isLastSlide&&event.currentTarget.name==="next"&&(this.slideScrollPosition=0),this.setSlidePosition(this.slideScrollPosition),this.applyAnimationToAnnouncementBar(event.currentTarget.name)}setSlidePosition(position){this.setPositionTimeout&&clearTimeout(this.setPositionTimeout),this.setPositionTimeout=setTimeout(()=>{this.slider.scrollTo({left:position})},this.announcerBarAnimationDelay)}update(){super.update(),this.sliderControlButtons=this.querySelectorAll(".slider-counter__link"),this.prevButton.removeAttribute("disabled"),this.sliderControlButtons.length&&(this.sliderControlButtons.forEach(link=>{link.classList.remove("slider-counter__link--active"),link.removeAttribute("aria-current")}),this.sliderControlButtons[this.currentPage-1].classList.add("slider-counter__link--active"),this.sliderControlButtons[this.currentPage-1].setAttribute("aria-current",!0))}autoPlayToggle(){this.togglePlayButtonState(this.autoplayButtonIsSetToPlay),this.autoplayButtonIsSetToPlay?this.pause():this.play(),this.autoplayButtonIsSetToPlay=!this.autoplayButtonIsSetToPlay}focusOutHandling(event){if(this.sliderAutoplayButton){const focusedOnAutoplayButton=event.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event.target);if(!this.autoplayButtonIsSetToPlay||focusedOnAutoplayButton)return;this.play()}else!this.reducedMotion.matches&&!this.announcementBarArrowButtonWasClicked&&this.play()}focusInHandling(event){this.sliderAutoplayButton?(event.target===this.sliderAutoplayButton||this.sliderAutoplayButton.contains(event.target))&&this.autoplayButtonIsSetToPlay?this.play():this.autoplayButtonIsSetToPlay&&this.pause():this.announcementBarSlider.contains(event.target)&&this.pause()}play(){this.slider.setAttribute("aria-live","off"),clearInterval(this.autoplay),this.autoplay=setInterval(this.autoRotateSlides.bind(this),this.autoplaySpeed)}pause(){this.slider.setAttribute("aria-live","polite"),clearInterval(this.autoplay)}togglePlayButtonState(pauseAutoplay){pauseAutoplay?(this.sliderAutoplayButton.classList.add("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.playSlideshow)):(this.sliderAutoplayButton.classList.remove("slideshow__autoplay--paused"),this.sliderAutoplayButton.setAttribute("aria-label",window.accessibilityStrings.pauseSlideshow))}autoRotateSlides(){const slideScrollPosition=this.currentPage===this.sliderItems.length?0:this.slider.scrollLeft+this.sliderItemOffset;this.setSlidePosition(slideScrollPosition),this.applyAnimationToAnnouncementBar()}setSlideVisibility(event){this.sliderItemsToShow.forEach((item,index)=>{const linkElements=item.querySelectorAll("a");index===this.currentPage-1?(linkElements.length&&linkElements.forEach(button=>{button.removeAttribute("tabindex")}),item.setAttribute("aria-hidden","false"),item.removeAttribute("tabindex")):(linkElements.length&&linkElements.forEac
7h(button=>{button.setAttribute("tabindex","-1")}),item.setAttribute("aria-hidden","true"),item.setAttribute("tabindex","-1"))}),this.wasClicked=!1}applyAnimationToAnnouncementBar(button="next"){if(!this.announcementBarSlider)return;const itemsCount=this.sliderItems.length,increment=button==="next"?1:-1,currentIndex=this.currentPage-1;let nextIndex=(currentIndex+increment)%itemsCount;nextIndex=nextIndex===-1?itemsCount-1:nextIndex;const nextSlide=this.sliderItems[nextIndex],currentSlide=this.sliderItems[currentIndex],animationClassIn="announcement-bar-slider--fade-in",animationClassOut="announcement-bar-slider--fade-out",isFirstSlide=currentIndex===0,isLastSlide=currentIndex===itemsCount-1,direction=button==="next"&&!isLastSlide||button==="previous"&&isFirstSlide?"next":"previous";currentSlide.classList.add(`${animationClassOut}-${direction}`),nextSlide.classList.add(`${animationClassIn}-${direction}`),setTimeout(()=>{currentSlide.classList.remove(`${animationClassOut}-${direction}`),nextSlide.classList.remove(`${animationClassIn}-${direction}`)},this.announcerBarAnimationDelay*2)}linkToSlide(event){event.preventDefault();const slideScrollPosition=this.slider.scrollLeft+this.sliderFirstItemNode.clientWidth*(this.sliderControlLinksArray.indexOf(event.currentTarget)+1-this.currentPage);this.slider.scrollTo({left:slideScrollPosition})}}customElements.define("slideshow-component",SlideshowComponent);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange),this.assemblyDataEl=this.querySelector("#assembly-json"),this.preorderDataEl=this.querySelector("#preorder-json"),this.preorderDateDataEl=this.querySelector("#preorder-date-json"),this.shippableDataEl=this.querySelector("#shippable-json"),this.specialOrderDataEl=this.querySelector("#special-order-json")}connectedCallback(){this.assemblyDataEl&&(this.getAssemblyData(),this.updateVariantAssembly()),this.preorderDataEl&&(this.getPreorderData(),this.updateVariantPreorder()),this.preorderDateDataEl&&(this.getPreorderDateData(),this.updateVariantPreorderDate()),this.shippableDataEl&&(this.getShippableData(),this.updateShippableState()),this.specialOrderDataEl&&(this.getSpecialOrderData(),this.updateSpecialOrder())}onVariantChange(event){this.updateOptions(),this.updateMasterId(),this.updateSelectedSwatchValue(event),this.toggleAddButton(!0,"",!1),this.updatePickupAvailability(),this.removeErrorMessage(),this.updateVariantStatuses(),this.updateCurrentColor(event),this.updateCurrentSkuVariant(),this.updateVariantAssembly(),this.updateVariantPreorder(),this.currentVariant?(this.updateURL(),this.updateVariantInput(),this.renderProductInfo(),this.updateShareUrl()):(this.toggleAddButton(!0,"",!0),this.setUnavailable()),this.updateStorePickup(),this.updateShippableState()}updateCurrentColor(event){const currentVariant=this.currentVariant;if(event.target.name.toLowerCase()!=="color")return;const currentColorEl=this.querySelector(".current-color");if(!currentColorEl)return;const optionNumber=currentColorEl.dataset.optionNumber;currentVariant[optionNumber]!=null&&(currentColorEl.textContent=currentVariant[optionNumber])}updateCurrentSkuVariant(){const productInfo=this.closest("product-info"),currentVariant=this.currentVariant;if(!currentVariant||!productInfo)return;const skuVariantEl=productInfo.querySelector("[data-sku-variant]");if(!skuVariantEl)return;let skuVariantText="";currentVariant.sku!=""&¤tVariant.public_title!=""?skuVariantText=`${currentVariant.sku} - ${currentVariant.public_title}`:currentVariant.sku!=""?skuVariantText=currentVariant.sku:currentVariant.public_title!=""&&(skuVariantText=currentVariant.public_title),skuVariantEl.textContent=`SKU: ${skuVariantText}`}updateStorePickup(){if(!this.currentVariant)return;window.updatePickupAvailability(this.currentVariant.id);const productInfo=this.closest("product-info");if(!productInfo)return;const modalOpener=productInfo.querySelector("your-store-modal-opener");modalOpener&&(modalOpener.updatePDPPickupNotice(),modalOpener.updatePDPAvailability())}updateOptions(){this.options=Array.from(this.querySelectorAll("select, fieldset"),element=>{if(element.tagName==="SELECT")return element.value;if(element.tagName==="FIELDSET")return Array.from(element.querySelectorAll("input")).find(radio=>radio.checked)?.value})}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateSelectedSwatchValue({target}){const{name,value,tagName}=target;if(tagName==="SELECT"&&target.selectedOptions.length){const swatchValue=target.selectedOptions[0].dataset.optionSwatchValue,selectedDropdownSwatchValue=this.querySelector(`[data-selected-dropdown-swatch="${name}"] > .swatch`);if(!selectedDropdownSwatchValue)return;swatchValue?(selectedDropdownSwatchValue.style.setProperty("--swatch--background",swatchValue),selectedDropdownSwatchValue.classList.remove("swatch--unavailable")):(selectedDropdownSwatchValue.style.setProperty("--swatch--background","unset"),selectedDropdownSwatchValue.classList.add("swatch--unavailable"))}else if(tagName==="INPUT"&&target.type==="radio"){const selectedSwatchValue=this.querySelector(`[data-selected-swatch-value="${name}"]`);selectedSwatchValue&&(selectedSwatchValue.innerHTML=value)}}updateURL(){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${this.dataset.url}?variant=${this.currentVariant.id}`)}updateShareUrl(){const shareButton=document.getElementById(`Share-${this.dataset.section}`);!shareButton||!shareButton.updateUrl||shareButton.updateUrl(`${window.shopUrl}${this.dataset.url}?variant=${this.currentVariant.id}`)}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #product-form-installment-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updateVariantStatuses(){const selectedOptionOneVariants=this.variantData.filter(variant=>this.querySelector(":checked").value===variant.option1),inputWrappers=[...this.querySelectorAll(".product-form__input")];
7inputWrappers.forEach((option,index)=>{if(index===0)return;const optionInputs=[...option.querySelectorAll('input[type="radio"], option')],previousOptionSelected=inputWrappers[index-1].querySelector(":checked").value,availableOptionInputsValue=selectedOptionOneVariants.filter(variant=>variant.available&&variant[`option${index}`]===previousOptionSelected).map(variantOption=>variantOption[`option${index+1}`]);this.setInputAvailability(optionInputs,availableOptionInputsValue)})}setInputAvailability(elementList,availableValuesList){elementList.forEach(element=>{const value=element.getAttribute("value"),availableElement=availableValuesList.includes(value);element.tagName==="INPUT"?element.classList.toggle("disabled",!availableElement):element.tagName==="OPTION"&&(element.innerText=availableElement?value:window.variantStrings.unavailable_with_option.replace("[value]",value))})}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant&&this.currentVariant.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}removeErrorMessage(){const section=this.closest("section");if(!section)return;const productForm=section.querySelector("product-form");productForm&&productForm.handleErrorMessage()}updateMedia(html){const mediaGallerySource=document.querySelector(`[id^="MediaGallery-${this.dataset.section}"] ul`),mediaGalleryDestination=html.querySelector(`[id^="MediaGallery-${this.dataset.section}"] ul`),refreshSourceData=()=>{const mediaGallerySourceItems=Array.from(mediaGallerySource.querySelectorAll("li[data-media-id]")),sourceSet=new Set(mediaGallerySourceItems.map(item=>item.dataset.mediaId)),sourceMap=new Map(mediaGallerySourceItems.map((item,index)=>[item.dataset.mediaId,{item,index}]));return[mediaGallerySourceItems,sourceSet,sourceMap]};if(mediaGallerySource&&mediaGalleryDestination){let[mediaGallerySourceItems,sourceSet,sourceMap]=refreshSourceData();const mediaGalleryDestinationItems=Array.from(mediaGalleryDestination.querySelectorAll("li[data-media-id]")),destinationSet=new Set(mediaGalleryDestinationItems.map(({dataset})=>dataset.mediaId));let shouldRefresh=!1;for(let i=mediaGalleryDestinationItems.length-1;i>=0;i--)sourceSet.has(mediaGalleryDestinationItems[i].dataset.mediaId)||(mediaGallerySource.prepend(mediaGalleryDestinationItems[i]),shouldRefresh=!0);for(let i=0;i<mediaGallerySourceItems.length;i++)destinationSet.has(mediaGallerySourceItems[i].dataset.mediaId)||(mediaGallerySourceItems[i].remove(),shouldRefresh=!0);shouldRefresh&&([mediaGallerySourceItems,sourceSet,sourceMap]=refreshSourceData()),mediaGalleryDestinationItems.forEach((destinationItem,destinationIndex)=>{const sourceData=sourceMap.get(destinationItem.dataset.mediaId);sourceData&&sourceData.index!==destinationIndex&&(mediaGallerySource.insertBefore(sourceData.item,mediaGallerySource.querySelector(`li:nth-of-type(${destinationIndex+1})`)),[mediaGallerySourceItems,sourceSet,sourceMap]=refreshSourceData())})}const mediaGalleryEl=document.querySelector(`[id^="MediaGallery-${this.dataset.section}"]`);mediaGalleryEl&&mediaGalleryEl.setActiveMedia(`${this.dataset.section}-${this.currentVariant.featured_media?.id}`);const modalContent=document.querySelector(`#ProductModal-${this.dataset.section} .product-media-modal__content`),newModalContent=html.querySelector("product-modal");modalContent&&newModalContent&&(modalContent.innerHTML=newModalContent.innerHTML)}renderProductInfo(){const requestedVariantId=this.currentVariant.id,sectionId=this.dataset.originalSection?this.dataset.originalSection:this.dataset.section;fetch(`${this.dataset.url}?variant=${requestedVariantId}§ion_id=${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`).then(response=>response.text()).then(responseText=>{if(this.currentVariant.id!==requestedVariantId)return;const html=new DOMParser().parseFromString(responseText,"text/html"),destination=document.getElementById(`price-${this.dataset.section}`),source=html.getElementById(`price-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),priceWithAssemblyDestination=document.getElementById(`price-with-assembly-${this.dataset.section}`),priceWithAssemblySource=html.getElementById(`price-with-assembly-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),skuSource=html.getElementById(`Sku-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),skuDestination=document.getElementById(`Sku-${this.dataset.section}`),inventorySource=html.getElementById(`Inventory-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),inventoryDestination=document.getElementById(`Inventory-${this.dataset.section}`),volumePricingSource=html.getElementById(`Volume-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`);this.updateMedia(html);const pricePerItemDestination=document.getElementById(`Price-Per-Item-${this.dataset.section}`),pricePerItemSource=html.getElementById(`Price-Per-Item-${this.dataset.originalSection?this.dataset.originalSection:this.dataset.section}`),volumePricingDestination=document.getElementById(`Volume-${this.dataset.section}`),qtyRules=document.getElementById(`Quantity-Rules-${this.dataset.section}`),volumeNote=document.getElementById(`Volume-Note-${this.dataset.section}`);volumeNote&&volumeNote.classList.remove("hidden"),volumePricingDestination&&volumePricingDestination.classList.remove("hidden"),qtyRules&&qtyRules.classList.remove("hidden"),source&&destination&&(destination.innerHTML=source.innerHTML),priceWithAssemblySource&&priceWithAssemblyDestination&&(priceWithAssemblyDestination.innerHTML=priceWithAssemblySource.innerHTML),inventorySource&&inventoryDestination&&(inventoryDestination.innerHTML=inventorySource.innerHTML),skuSource&&skuDestination&&(skuDestination.innerHTML=skuSource.innerHTML,skuDestination.classList.toggle("hidden",skuSource.classList.contains("hidden"))),volumePricingSource&&volumePricingDestination&&(volumePricingDestination.innerHTML=volumePricingSource.innerHTML),pricePerItemSource&&pricePerItemDestination&&(pricePerItemDestination.innerHTML=pricePerItemSource.innerHTML,pricePerItemDestination.classList.toggle("hidden",pricePerItemSource.classList.contains("hidden")));const price=document.getElementById(`price-${this.dataset.section}`);price&&price.classList.remove("hidden"),inventoryDestination&&inventoryDestination.classList.toggle("hidden",inventorySource.innerText==="");const addButtonUpdated=html.getElementById(`ProductSubmitButton-${sectionId}`);this.toggleAddButton(addButtonUpdated?addButtonUpdated.hasAttribute("disabled"):!0,window.variantStrings.soldOut),publish(PUB_SUB_EVENTS.variantChange,{data:{sectionId,html,variant:this.currentVariant}}
7),this.updateVariantAssembly(),this.updateVariantPreorder(),this.updateVariantPreorderDate(),this.updateSpecialOrder()})}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=document.getElementById(`product-form-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span');addButton&&(disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings.addToCart))}setUnavailable(){const button=document.getElementById(`product-form-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`),inventory=document.getElementById(`Inventory-${this.dataset.section}`),sku=document.getElementById(`Sku-${this.dataset.section}`),pricePerItem=document.getElementById(`Price-Per-Item-${this.dataset.section}`),volumeNote=document.getElementById(`Volume-Note-${this.dataset.section}`),volumeTable=document.getElementById(`Volume-${this.dataset.section}`),qtyRules=document.getElementById(`Quantity-Rules-${this.dataset.section}`);addButton&&(addButtonText.textContent=window.variantStrings.unavailable,price&&price.classList.add("hidden"),inventory&&inventory.classList.add("hidden"),sku&&sku.classList.add("hidden"),pricePerItem&&pricePerItem.classList.add("hidden"),volumeNote&&volumeNote.classList.add("hidden"),volumeTable&&volumeTable.classList.add("hidden"),qtyRules&&qtyRules.classList.add("hidden"))}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}getAssemblyData(){const assemblyDataEl=this.assemblyDataEl;if(assemblyDataEl&&(this.assemblyData=this.assemblyData||JSON.parse(assemblyDataEl.textContent),!!this.assemblyData))return this.assemblyData}updateVariantAssembly(){try{if(!this.assemblyData)return;const assemblyInputEl=this.querySelector("[data-assembly-fee]"),assemblyPlanInputEl=this.querySelector("[data-assembly-fee-plan]");if(!assemblyInputEl||(assemblyInputEl.value="",!assemblyPlanInputEl))return;assemblyPlanInputEl.value="";const productInfo=this.closest("product-info"),assemblyFeeNoticeEl=productInfo.querySelector(".assembly-fee--notice"),currentVariantId=this.currentVariant?.id||productInfo.querySelector('[name="id"]')?.value;if(assemblyFeeNoticeEl&&(assemblyFeeNoticeEl.innerHTML=""),!currentVariantId)return;const assemblyItem=this.assemblyData.find(item=>item.variant_id==currentVariantId);if(!assemblyItem)return;assemblyItem&&assemblyItem.assembly_message&&(assemblyInputEl.value=assemblyItem.assembly_message,assemblyPlanInputEl.value=`${assemblyItem.assembly_id}|${assemblyItem.assembly_price}|${assemblyItem.assembly_name}`),assemblyFeeNoticeEl&&(assemblyFeeNoticeEl.innerHTML=`<span class="alert-message alert-message--attention">${assemblyItem.assembly_message}</span>`);const assemblyFeePriceEl=productInfo.querySelector("price-with-assembly");if(!assemblyFeePriceEl)return;typeof assemblyFeePriceEl.updatePrice=="function"?assemblyFeePriceEl.updatePrice(Number(assemblyItem.price)||0,Number(assemblyItem.compare_at_price)||0,Number(assemblyItem.assembly_price)||0):customElements.whenDefined("price-with-assembly").then(()=>{assemblyFeePriceEl.updatePrice(Number(assemblyItem.price)||0,Number(assemblyItem.compare_at_price)||0,Number(assemblyItem.assembly_price)||0)})}catch(error){console.error("Error updating variant assembly:",error)}}getPreorderData(){const preorderDataEl=this.preorderDataEl;if(preorderDataEl&&(this.preorderButtonText=preorderDataEl.dataset.preorder,this.preorderData=this.preorderData||JSON.parse(preorderDataEl.textContent),!!this.preorderData))return this.preorderData}updateVariantPreorder(){try{if(!this.preorderData)return;const shipDateInputEl=this.querySelector("[data-ship-date]");if(!shipDateInputEl)return;shipDateInputEl.value="";const productInfo=this.closest("product-info"),inputId=productInfo.querySelector('[name="id"]'),currentVariantId=this.currentVariant?.id||inputId?.value;if(!currentVariantId)return;const preorderItem=this.preorderData.find(item=>item.variant_id==currentVariantId);if(!preorderItem)return;const addButtonText=productInfo.querySelector('[name="add"] > span'),availableDate=preorderItem.available_date,buttonText=this.preorderButtonText.replace("#date#",availableDate);addButtonText.textContent=buttonText,shipDateInputEl.value=availableDate}catch(error){console.error("Error updating preorder variant:",error)}}getPreorderDateData(){const preorderDateDataEl=this.preorderDateDataEl;if(preorderDateDataEl&&(this.preorderDateData=this.preorderDateData||JSON.parse(preorderDateDataEl.textContent),!!this.preorderDateData))return this.preorderDateData}updateVariantPreorderDate(){try{if(!this.preorderDateData)return;const preorderDateEtaInputEl=this.querySelector("[data-preorder-date-eta]");if(!preorderDateEtaInputEl)return;preorderDateEtaInputEl.value="";const productInfo=this.closest("product-info"),inputId=productInfo.querySelector('[name="id"]'),currentVariantId=this.currentVariant?.id||inputId?.value;if(!currentVariantId)return;const preorderDateItem=this.preorderDateData.find(item=>item.variant_id==currentVariantId);if(!preorderDateItem)return;const addButtonText=productInfo.querySelector('[name="add"] > span'),availableDate=preorderDateItem.pre_order_date,date=new Date(`${availableDate}
7T00:00`),month=date.toLocaleString("default",{month:"long"}),monthYear=date.toLocaleString("default",{month:"long",year:"numeric"});addButtonText.innerHTML=`<span class="preorder-date-1">PRE-ORDER</span><span class="preorder-date-2">ETA ${month}</span>`,preorderDateEtaInputEl.value=monthYear}catch(error){console.error("Error updating preorder date variant:",error)}}getSpecialOrderData(){const specialOrderDataEl=this.specialOrderDataEl;if(specialOrderDataEl&&(this.specialOrderData=this.specialOrderData||JSON.parse(specialOrderDataEl.textContent),!!this.specialOrderData))return this.specialOrderData}updateSpecialOrder(){try{if(!this.specialOrderData)return;const specialOrderInputEl=this.querySelector("[data-special-order]");if(!specialOrderInputEl)return;specialOrderInputEl.value="";const inputId=this.closest("product-info").querySelector('[name="id"]'),currentVariantId=this.currentVariant?.id||inputId?.value;if(!currentVariantId)return;const specialOrderItem=this.specialOrderData.find(item=>item.variant_id==currentVariantId);if(!specialOrderItem)return;const leadTime=specialOrderItem.spo_lead_time;specialOrderInputEl.value=`${leadTime} days lead time`;const legendLeadTimeEl=document.querySelectorAll("[data-legend-lead-time]");legendLeadTimeEl&&legendLeadTimeEl.forEach(legend=>legend.textContent=leadTime);const deliveryLeadTimeEl=document.querySelector('.delivery-avail__text>[data-available="yes"]');if(deliveryLeadTimeEl){const existingLeadTime=deliveryLeadTimeEl.querySelector("[data-lead-time]");existingLeadTime&&existingLeadTime.remove();const leadTimeSpan=document.createElement("span");leadTimeSpan.dataset.leadTime="",leadTimeSpan.textContent=`${leadTime} Day Lead Time.`,deliveryLeadTimeEl.appendChild(leadTimeSpan)}}catch(error){console.error("Error updating preorder variant:",error)}}getShippableData(){const shippableDataEl=this.shippableDataEl;if(shippableDataEl&&(this.shippableData=this.shippableData||JSON.parse(shippableDataEl.textContent),!!this.shippableData))return this.shippableData}updateShippableState(){try{if(!this.shippableData)return;const productInfo=this.closest("product-info"),inputId=productInfo.querySelector('[name="id"]'),shippableQtyBoolEl=productInfo.querySelector("#shippable_quantity_boolean"),currentVariantId=this.currentVariant?.id||inputId?.value,shippableStateEl=productInfo.querySelector(".delivery-avail__status");if(!shippableStateEl||(shippableStateEl.setAttribute("data-shippable","false"),!currentVariantId))return;const shippableItem=this.shippableData.find(item=>item.variant_id==currentVariantId);if(!shippableItem)return;const shippableState=shippableItem.shippable;shippableStateEl.setAttribute("data-shippable",shippableState);const deliveryLeadTimeEl=document.querySelector('.delivery-avail__text>[data-available="yes"]');if(deliveryLeadTimeEl){const existingLeadTime=deliveryLeadTimeEl.querySelector("[data-lead-time]");existingLeadTime&&existingLeadTime.remove()}shippableQtyBoolEl.value=shippableState==!0?"True":"False"}catch(error){console.error("Error updating preorder variant:",error)}}}customElements.define("variant-selects",VariantSelects);class ProductRecommendations extends HTMLElement{constructor(){super()}connectedCallback(){const handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector("product-recommendations");recommendations&&recommendations.innerHTML.trim().length&&(this.innerHTML=recommendations.innerHTML),!this.querySelector("slideshow-component")&&this.classList.contains("complementary-products")&&this.remove(),html.querySelector(".grid__item")&&this.classList.add("product-recommendations--loaded"),publish(PUB_SUB_EVENTS.glideUpdate,{id:this.id});const compareBar=document.querySelector("compare-bar");compareBar&&compareBar.initialize()}).catch(e=>{console.error(e)}))};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("product-recommendations",ProductRecommendations);class FreeShippingBar extends HTMLElement{constructor(){super()}connectedCallback(){if(this.currency=Shopify&&Shopify.currency?Shopify.currency.active:null,!this.currency){console.error("Currency code not specified.");return}this.freeShippingPending=this.querySelector("[data-free-shipping-pending]"),this.freeShippingPendingTotal=this.freeShippingPending?this.freeShippingPending.querySelector("[data-amount]"):null,this.freeShippingMet=this.querySelector("[data-free-shipping-met]"),this.progress=this.querySelector("progress"),this.threshold=this.getAttribute("data-threshold"),this.threshold&&(this.threshold=parseInt(this.threshold,10)),this.cartTotal=this.getAttribute("data-total"),this.cartTotal&&(this.cartTotal=parseInt(this.cartTotal,10)),this.updateShipping(),this.cartUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.cartUpdate,event=>{!event.cartData||typeof event.cartData.total_price>"u"||(this.cartTotal=event.cartData.total_price,this.updateShipping())})}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}updateShipping(){if(typeof this.threshold>"u"||this.threshold===null)return;const getLang=()=>navigator.languages!=null?navigator.languages[0]:navigator.language;if(typeof this.cartTotal>"u"||this.cartTotal===null){let defaultPrice=this.threshold;defaultPrice=defaultPrice/100,defaultPrice=defaultPrice.toLocaleStr
7ing(getLang(),{style:"currency",currency:this.currency}),this.freeShippingPendingTotal&&(this.freeShippingPendingTotal.textContent=defaultPrice),this.progress&&this.progress.setAttribute("value",0);return}this.cartTotal>=this.threshold?(this.freeShippingPending&&this.freeShippingPending.classList.add("hidden"),this.freeShippingMet&&this.freeShippingMet.classList.remove("hidden")):(this.freeShippingPending&&this.freeShippingPending.classList.remove("hidden"),this.freeShippingMet&&this.freeShippingMet.classList.add("hidden")),this.progress&&this.progress.setAttribute("value",this.cartTotal),this.freeShippingPendingTotal&&(this.freeShippingPendingTotal.textContent=this.formatThreshold())}formatThreshold(){if(typeof this.cartTotal>"u"||this.cartTotal===null||!this.currency)return;const getLang=()=>navigator.languages!=null?navigator.languages[0]:navigator.language;let price=this.threshold-this.cartTotal;return price<0&&(price=0),price=price/100,price=price.toLocaleString(getLang(),{style:"currency",currency:this.currency}),price}}customElements.define("free-shipping-bar",FreeShippingBar);class AccordionItem{constructor(element,config){this.mobileOnly=config&&config.mobileOnly||!1,this.details=element,this.summary=this.details.querySelector("summary"),this.content=this.details.querySelector(".p80-accordion__content"),this.open=!!this.details.open,this.onTransitionEndHandler=this.onTransitionEnd.bind(this),this.onClickHandler=this.onClick.bind(this),this.onKeyDownHandler=this.onKeyDown.bind(this),this.summary.addEventListener("click",this.onClickHandler),this.summary.addEventListener("keydown",this.onKeyDownHandler),this.toggleFocusable()}onClick(event){event?.preventDefault(),!(this.mobileOnly&&this.currentMediaQuery.type!==p80.mediaQueryService.mediaTypes.small)&&(this.details.open?this.yieldAndClose():this.yieldAndOpen())}onKeyDown(event){if(event?.code.toUpperCase()==="SPACE"||event?.code.toUpperCase()==="ENTER"){if(event?.preventDefault(),this.mobileOnly&&this.currentMediaQuery!==p80.mediaQueryService.mediaTypes.small)return;this.open()}}onTransitionEnd(event){if(event?.propertyName!=="height"||event?.target!==this.details){this.bindTransition();return}this.details.classList.remove("p80-accordion__item--opening","p80-accordion__item--closing"),this.details.open=!this.open,this.details.style.height=null,this.toggleFocusable()}toggleFocusable(){const focusable=getFocusableElements(this.content),summaryIndex=this.details.open&&this.mobileOnly&&this.currentMediaQuery.type!==p80.mediaQueryService.mediaTypes.small?-1:this.details.open?0:-1,index=this.details.open?0:-1;this.summary.setAttribute("tabindex",summaryIndex),focusable.forEach(element=>{element.setAttribute("tabindex",index)})}yieldToMain(){return new Promise(resolve=>{setTimeout(resolve,0)})}async yieldAndOpen(){this.details.style.height=`${this.details.offsetHeight}px`,this.open=!1,this.details.open=!0,this.bindTransition(),await this.yieldToMain(),this.details.classList.add("p80-accordion__item--opening"),this.details.style.height=`${this.summary.offsetHeight+this.content.offsetHeight}px`}async yieldAndClose(){this.open=!0,this.details.style.height=`${this.summary.offsetHeight+this.content.offsetHeight}px`,this.bindTransition(),await this.yieldToMain(),this.details.classList.add("p80-accordion__item--closing"),this.details.style.height=`${this.summary.offsetHeight}px`}bindTransition(){this.details.addEventListener("transitionend",this.onTransitionEndHandler,{once:!0})}unbind(){this.summary.removeEventListener("click",this.onClickHandler),this.summary.addEventListener("keydown",this.onKeyDownHandler)}}class Accordion extends HTMLElement{constructor(){super()}connectedCallback(){const accordions=Array.from(this.querySelectorAll("details"));this.mobileOnly=this.getAttribute("data-mobile-only")==="true",this.accordions=accordions.map(accordion=>new AccordionItem(accordion,{mobileOnly:this.mobileOnly})),this.currentMediaQuery=p80.mediaQueryService.currentMediaQuery,this.onMediaQueryChange(),this.mediaQueryChangeUnsubscriber=subscribe(PUB_SUB_EVENTS.mediaQueryChange,event=>{!event||!event.currentMedia||(this.currentMediaQuery=event.currentMedia,this.onMediaQueryChange())})}disconnectedCallback(){this.accordions.forEach(accordion=>{accordion.unbind()}),this.mediaQueryChangeUnsubscriber&&this.mediaQueryChangeUnsubscriber()}onMediaQueryChange(){this.accordions.forEach(accordion=>{if(accordion.currentMediaQuery=this.currentMediaQuery,this.mobileOnly){const open=this.currentMediaQuery.type!==p80.mediaQueryService.mediaTypes.small;accordion.details.open=open}accordion.toggleFocusable()})}}customElements.define("accordion-component",Accordion);class GlideComponent extends HTMLElement{static observedAttributes=["data-disable","data-animation-duration","data-auto-rotate","data-auto-rotate-duration","data-desktop-columns","data-tablet-columns","data-mobile-columns","data-focus-at","data-start-at","data-column-gap","data-wait-for-render","data-pagination-style","data-pagination-desktop","data-
7pagination-tablet","data-pagination-mobile"];constructor(){super(),this.connected=!1,this.bound=!1}connectedCallback(){if(this.connected=!0,this.currentMediaQuery=p80.mediaQueryService.currentMediaQuery,this.onResizeHandler=this.setHeight.bind(this),this.setConfiguration(),this.setSubscriptions(),this.disable){this.classList.add("glide-component--disabled"),this.classList.add("glide-component--loaded"),this.hideLoader(),this.autoResize&&(document.addEventListener("DOMContentLoaded",this.onResizeHandler),this.resizeObserver=new ResizeObserver(entries=>{this.onResizeHandler(entries)}),this.resizeObserver.observe(this.slider));return}this.onKeyUp=this.onKeyUp.bind(this),this.addEventListener("keyup",this.onKeyUp);const renderTasks=[this.initializeGlide.bind(this),this.generateBulletPagination.bind(this),this.generateArrowPagination.bind(this),this.generateNumberPagination.bind(this),this.setGlideBindings.bind(this),this.mountGlide.bind(this)];typeof Glide<"u"?this.yieldTasks(renderTasks):(this.onLoadHandler=this.yieldTasks.bind(this,renderTasks),document.addEventListener("DOMContentLoaded",this.onLoadHandler))}disconnectedCallback(){if(this.connected=!1,this.glideUpdateUnsubscriber&&this.glideUpdateUnsubscriber(),this.mediaQueryChangeUnsubscriber&&this.mediaQueryChangeUnsubscriber(),this.resizeObserver?.disconnect(),this.removeEventListener("keyup",this.onKeyUp),document.removeEventListener("DOMContentLoaded",this.onLoadHandler),this.glide)try{this.glide.destroy()}catch(e){console.info(e)}}attributeChangedCallback(name,oldValue,newValue){if(!this.connected)return;const tasks=[this.setConfiguration.bind(this),this.initializeGlide.bind(this),this.generateBulletPagination.bind(this),this.generateArrowPagination.bind(this),this.generateNumberPagination.bind(this),this.setGlideBindings.bind(this),this.mountGlide.bind(this)];oldValue!==newValue&&this.yieldTasks(tasks)}yieldToMain(){return new Promise(resolve=>{setTimeout(resolve,0)})}async yieldTasks(tasks){for(;tasks.length>0;)tasks.shift()(),await this.yieldToMain()}setSubscriptions(){this.glideUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.glideUpdate,event=>{event.id===this.id&&this.onUpdateBroadcast(event)}),this.mediaQueryChangeUnsubscriber=subscribe(PUB_SUB_EVENTS.mediaQueryChange,event=>{this.onMediaQueryChange(event)})}setConfiguration(){if(this.showLoader(),this.classList.remove("glide-component--loaded"),this.glide)try{this.glide.destroy()}catch(e){console.info(e)}this.disable=this.getAttribute("data-disable")==="true",this.slider=this.querySelector(".glide"),this.slides=this.querySelectorAll(".glide__slides > li"),this.glide=null,this.loader=this.querySelector(".slideshow__loader"),this.id=this.getAttribute("data-id")?this.getAttribute("data-id"):null;const animationDuration=this.getAttribute("data-duration");this.animationDuration=Number.isNaN(parseFloat(animationDuration,10))?400:parseFloat(animationDuration,10),this.autoRotate=this.getAttribute("data-auto-rotate")==="true";const autoRotateDuration=this.getAttribute("data-auto-rotate-duration");this.autoRotateDuration=Number.isNaN(parseFloat(autoRotateDuration,10))?0:parseFloat(autoRotateDuration,10);const desktopColumns=this.getAttribute("data-desktop-columns");this.desktopColumns=Number.isNaN(parseFloat(desktopColumns,10))?1:parseFloat(desktopColumns,10);const tabletColumns=this.getAttribute("data-tablet-columns");this.tabletColumns=Number.isNaN(parseFloat(tabletColumns,10))?1:parseFloat(tabletColumns,10);const mobileColumns=this.getAttribute("data-mobile-columns");this.mobileColumns=Number.isNaN(parseFloat(mobileColumns,10))?1:parseFloat(mobileColumns,10);const focusAt=this.getAttribute("data-focus-at");this.focusAt=focusAt==="center"?focusAt:Number.isNaN(parseFloat(focusAt,10))?0:parseFloat(focusAt,10);const startAt=this.getAttribute("data-start-at");this.startAt=Number.isNaN(parseInt(startAt,10))?0:parseInt(startAt,10);const columnGap=this.getAttribute("data-column-gap");this.columnGap=Number.isNaN(parseInt(columnGap,10))?24:parseInt(columnGap,10),this.columnGapMobile=this.columnGap*68/100,this.autoResize=this.getAttribute("data-auto-resize")==="true",this.waitForRender=this.getAttribute("data-wait-for-render")==="true",this.desktopPagination=this.getAttribute("data-pagination-desktop")==="true",this.tabletPagination=this.getAttribute("data-pagination-tablet")==="true",this.mobilePagination=this.getAttribute("data-pagination-mobile")==="true",this.paginationStyles={bullets:"bullets",numbers:"numbers",arrows:"arrows",arrowsBullets:"arrowsBullets"};const paginationStyle=this.getAttribute("data-pagination-style");this.paginationStyle=this.paginationStyles[paginationStyle]?this.paginationStyles[paginationStyle]:null}onMediaQueryChange(event){!event||!event.currentMedia||(this.currentMediaQuery=event.currentMedia)}setHeight(){const activeSlide=this.glide?this.slides[this.glide.index]:this.slides[0],activeMedia=activeSlide?.querySelectorAll(".slideshow__image"),activeText=activeSlide?.querySelector(".slideshow__content"),activeTextHeight=activeText?activeText.scrollHeight:0,activeImageHeight=(this.currentMediaQuery.type===p80.mediaQueryService.mediaTypes.small&&activeMedia[1]?activeMedia[1]:activeMedia[0]?activeMedia[0]:null)?.offsetHeight;if(!activeTextHeight||!activeImageHeight)return;const finalHeight=activeTextHeight>activeImageHeight?activeTextHeight:activeImageHeight;this.style.setProperty("--height",`${finalHeight}px`)}onKeyUp(event){if(!this.glide)return;const code=event.code?event.code:event.keyCode,right=[39,"ArrowRight"],left=[37,"ArrowLeft"],direction=right.includes(code)?">":left.includes(code)?"<":null;direction&&this.glide.go(direction)}generateBulletPagination(){if(this.querySelector(".glide__bullets")?.remove(),this.bullets=null,this.paginationStyle!==this.paginationStyles.arrows&&this.paginationStyle!==this.paginationStyles.bullets&&this.paginationStyle!==this.paginationStyles.arrowsBullets||this.paginationStyle===this.paginationStyles.arrows&&!this.mobilePagination)return;const container=document.createElement("div");container.classList.add("glide__bullets"),container.setAttribute("data-glide-el","controls[nav]"),(!this.mobilePagination||this.paginationStyle===this.paginationStyles.arrows)&&container.classList.add("large-up-hide"),!this.tabletPagination&&this.paginationStyle!==this.paginationStyles.arrows&&container.classList.add("medium-hide"),!this.desktopPagination&&this.paginationStyle!==this.paginationStyles.arrows&&container.classList.add("small-hide");const desktopBullets=this.slides.length-(Math.floor(this.desktopColumns)-1),tabletBullets=this.slides.length-(Math.floor(this.tabletColumns)-1),mobileBullets=this.slides.length-(Math.floor(this.mobileColumns)-1);
7this.slides.forEach((slide,index)=>{const count=index+1,bullet=document.createElement("button");count>desktopBullets&&bullet.classList.add("large-up-hide"),count>tabletBullets&&bullet.classList.add("medium-hide"),count>mobileBullets&&bullet.classList.add("small-hide"),bullet.classList.add("glide__bullet"),bullet.setAttribute("data-glide-dir",`=${index}`),bullet.setAttribute("title",`Slide ${count}`),container.appendChild(bullet)}),this.querySelector(".glide").appendChild(container),this.bullets=this.querySelector(".glide__bullets")}generateNumberPagination(){const pagination=this.querySelector(".glide__pagination"),oldPreviousButton=pagination?.querySelector('[aria-label="Previous"]'),oldNextButton=pagination?.querySelector('[aria-label="Next"]');if(oldPreviousButton?.removeEventListener("click",this.previousSlideHandler),oldNextButton?.removeEventListener("click",this.nextSlideHandler),pagination?.remove(),this.pagination=null,this.paginationStyle!==this.paginationStyles.numbers)return;const container=document.createElement("div");container.classList.add("glide__pagination"),this.desktopPagination||container.classList.add("large-up-hide"),this.tabletPagination||container.classList.add("medium-hide"),this.mobilePagination||container.classList.add("small-hide");const desktopPages=this.slides.length-(Math.floor(this.desktopColumns)-1),tabletPages=this.slides.length-(Math.floor(this.tabletColumns)-1),mobilePages=this.slides.length-(Math.floor(this.mobileColumns)-1),prevButton=document.createElement("button");prevButton.setAttribute("type","button"),prevButton.setAttribute("aria-label","Previous"),prevButton.innerHTML=window.icons.caret,prevButton.addEventListener("click",this.previousSlideHandler),container.appendChild(prevButton),document.createElement("p").setAttribute("data-count",!0);const defaultCount=document.createElement("span");defaultCount.textContent=this.startAt+1,container.appendChild(defaultCount);const divider=document.createElement("span");divider.textContent="/",container.appendChild(divider);const desktop=document.createElement("span");desktop.classList.add("small-hide","medium-hide"),desktop.textContent=`${desktopPages}`,container.appendChild(desktop);const tablet=document.createElement("span");tablet.classList.add("large-up-hide","small-hide"),tablet.textContent=`${tabletPages}`,container.appendChild(tablet);const mobile=document.createElement("span");mobile.classList.add("large-up-hide","medium-hide"),mobile.textContent=`${mobilePages}`,container.appendChild(mobile);const nextButton=document.createElement("button");nextButton.setAttribute("type","button"),nextButton.setAttribute("aria-label","Next"),nextButton.innerHTML=window.icons.caret,nextButton.addEventListener("click",this.nextSlideHandler),container.appendChild(nextButton),this.querySelector(".glide").appendChild(container),this.pagination=this.querySelector(".glide__pagination")}generateArrowPagination(){if(this.querySelector(".glide__controls")?.remove(),this.arrows=null,this.paginationStyle!==this.paginationStyles.arrows&&this.paginationStyle!==this.paginationStyles.arrowsBullets)return;const container=document.createElement("div");container.classList.add("glide__controls"),container.setAttribute("data-glide-el","controls"),this.desktopPagination||container.classList.add("large-up-hide"),container.classList.add("medium-hide"),container.classList.add("small-hide");const previous=document.createElement("button");previous.setAttribute("type","button"),previous.classList.add("glide__previous"),previous.setAttribute("data-glide-dir","<"),previous.setAttribute("aria-label",window.accessibilityStrings.previousSlide),previous.innerHTML=window.icons.chevron,container.appendChild(previous);const next=document.createElement("button");next.setAttribute("type","button"),next.classList.add("glide__next"),next.setAttribute("data-glide-dir",">"),next.setAttribute("aria-label",window.accessibilityStrings.nextSlide),next.innerHTML=window.icons.chevron,container.appendChild(next),this.querySelector(".glide").appendChild(container),this.arrows=this.querySelector(".glide__controls")}initializeGlide(){const component=this;this.glide=new Glide(component.slider,{type:"slider",bound:!0,animationDuration:component.animationDuration,focusAt:component.focusAt,startAt:component.startAt,perView:component.desktopColumns,gap:component.columnGap,autoplay:component.autoRotate?component.autoRotateDuration:!1,keyboard:!1,breakpoints:{750:{perView:component.mobileColumns,gap:component.columnGapM
7obile},990:{perView:component.tabletColumns},5e3:{perView:component.desktopColumns},9999:{perview:component.desktopColumns}}}),this.nextSlideHandler=()=>this.glide.go(">"),this.previousSlideHandler=()=>this.glide.go("<")}setGlideBindings(){this.glide.on("mount.after",()=>{this.glide.isMounted=!0}),this.glide.on("move.after",()=>{const currentSlideIndicator=this.pagination?.querySelector("span");currentSlideIndicator&&(currentSlideIndicator.textContent=this.glide.index+1),this.autoResize&&this.onResizeHandler()}),this.autoResize&&this.glide.on("resize",()=>{this.onResizeHandler()}),this.glide.on("build.after",()=>{this.autoResize&&this.onResizeHandler(),this.classList.add("glide-component--loaded"),this.hideLoader(),setTimeout(()=>{this.showPagination()},500)})}mountGlide(){this.glide.mount()}showPagination(){this.bullets?.classList.add("glide__bullets--visible"),this.pagination?.classList.add("glide__pagination--visible"),this.arrows?.classList.add("glide__controls--visible")}hidePagination(){this.bullets?.classList.remove("glide__bullets--visible"),this.pagination?.classList.remove("glide__pagination--visible"),this.arrows?.classList.remove("glide__controls--visible")}showLoader(){this.loader?.classList.add("slideshow__loader--visible")}hideLoader(){this.loader?.classList.remove("slideshow__loader--visible")}onUpdateBroadcast(event){if(this.waitForRender){this.waitForRender=!1,(!this.slides||!this.slides.length)&&(this.slides=this.querySelectorAll(".glide__slides > li"));const tasks=[this.initializeGlide.bind(this),this.generateBulletPagination.bind(this),this.generateArrowPagination.bind(this),this.generateNumberPagination.bind(this),this.setGlideBindings.bind(this),this.mountGlide.bind(this)];this.yieldTasks(tasks);return}if(this._needsRemount){if(this._needsRemount=!1,this.glide)try{this.glide.destroy()}catch(e){console.info(e)}this.glide=null,this.slides=this.querySelectorAll(".glide__slides > li");const tasks=[this.destroyGlideBindings.bind(this),this.initializeGlide.bind(this),this.generateBulletPagination.bind(this),this.generateArrowPagination.bind(this),this.generateNumberPagination.bind(this),this.setGlideBindings.bind(this),this.mountGlide.bind(this)];this.yieldTasks(tasks);return}this._needsRemount=!0}destroyGlideBindings(){this.glide&&(this.glide.off("mount.after"),this.glide.off("move.after"),this.glide.off("resize"),this.glide.off("build.after"))}}customElements.define("glide-component",GlideComponent);class StickyBarService{constructor(){this.loaded=!1,this.alignments={top:"top",bottom:"bottom"},this.elements=[],this.displayedElements={top:[],bottom:[]},this.footer=document.querySelector("footer"),this.watchEndElement=null;const tasks=[this.getHeaderHeight.bind(this),this.setRootMargins.bind(this),this.setHandlers.bind(this)];this.yieldTasks(tasks)}yieldToMain(){return new Promise(resolve=>{setTimeout(resolve,0)})}async yieldTasks(tasks){for(;tasks.length>0;)tasks.shift()(),await this.yieldToMain()}onLoad(){this.loaded=!0,this.setElementObservers()}onResize(entries){const previousHeaderHeight=this.headerHeight;this.getHeaderHeight(),this.setRootMargins();const alignmentsToUpdate=[];previousHeaderHeight!==this.headerHeight&&alignmentsToUpdate.push(this.alignments.top),this.setElementOffsets(alignmentsToUpdate),this.setElementObservers()}onIntersect(entries){entries.forEach(entry=>{if(entry.target.tagName.toLowerCase()==="footer"){entry.isIntersecting?this.hideElements([this.alignments.bottom]):this.showElements([this.alignments.bottom]);return}else if(entry.target.classList.contains(this.watchEndElement.replace(".",""))){entry.isIntersecting&&window.innerWidth>990?this.hideElements([this.alignments.top]):this.showElements([this.alignments.top]);return}const stickyBar=this.elements.find(element=>element.watchElement===entry.target),isVisible=entry.isIntersecting?!0:!(!entry.isIntersecting&&window.scrollY>=entry.boundingClientRect.top||entry.boundingClientRect.bottom<0);isVisible&&stickyBar.isVisible?this.disableElement(stickyBar):!isVisible&&!stickyBar.isVisible&&this.enableElement(stickyBar)})}setHandlers(){this.unsubscribeHandler=this.unsubscribe.bind(this),this.resizeHandler=this.onResize.bind(this),this.resizeObserver=new ResizeObserver(entries=>this.resizeHandler(entries)),this.intersectionHandler=this.onIntersect.bind(this),document.readyState=="complete"?this.onLoad():window.addEventListener("load",()=>this.onLoad())}setRootMargins(){this.rootMargin=`-${this.headerHeight}px 0px 0px 0px`}enableElement(element){const matchingElement=this.elements.find(el=>el===element);matchingElement&&(this.displayedElements[matchingElement.alignment]?.push(matchingElement),this.setElementOffsets([matchingElement.alignment]),matchingElement.classList.add("sticky-bar--visible"),matchingElement.isVisible=!0)}disableElement(element){const matchingElement=this.elements.find(el=>el===element);matchingElement&&(matchingElement.isVisible=!1,matchingElement.classList.remove("sticky-bar--visible"),this.displayedElements[matchingElement.alignment]=this.displayedElements[matchingElement.alignment]?.filter(el=>el!==element),this.setElementOffsets([matchingElement.alignment]))}
7hideElements(alignments){alignments?.length&&alignments.forEach(alignment=>{this.displayedElements[alignment]?.forEach(element=>{element.classList.remove("sticky-bar--visible")})})}showElements(alignments){alignments?.length&&alignments.forEach(alignment=>{this.displayedElements[alignment]?.forEach(element=>{element.classList.add("sticky-bar--visible")})})}setElementObservers(){this.intersectionObserver?.disconnect(),this.intersectionObserver=new IntersectionObserver(entries=>this.intersectionHandler(entries),{threshold:[0],rootMargin:this.rootMargin}),this.intersectionObserver?.observe(this.footer),this.watchEndElement&&this.intersectionObserver?.observe(document.querySelector(this.watchEndElement)),this.elements.forEach(element=>{this.loaded&&this.intersectionObserver.observe(element.watchElement)})}setElementOffsets(alignments){alignments?.length&&alignments.forEach(alignment=>{let offset=0;this.displayedElements[alignment]?.forEach((element,index)=>{offset+=element.offset,index===0&&(offset+=alignment===this.alignments.top?this.headerHeight:0),element.style.setProperty("--offset",`${offset}px`),offset+=element.offsetHeight})})}getHeaderHeight(){this.header=document.querySelector(".header-wrapper"),this.header&&(this.headerType=this.header.tagName.toLowerCase(),this.headerStickyType=this.header.getAttribute("data-sticky-type"),this.headerHeight=this.headerStickyType==="always"?this.header.offsetHeight:0)}subscribe(element){return this.elements.length||(this.getHeaderHeight(),this.resizeObserver.observe(this.header)),this.loaded&&this.intersectionObserver?.observe(element.watchElement),this.elements.push(element),element.watchEndElement&&(this.watchEndElement=element.watchEndElement),()=>this.unsubscribeHandler(element)}unsubscribe(element){element&&(this.elements=this.elements.filter(el=>el!==element),this.intersectionObserver?.unobserve(element.watchElement),this.elements.length||this.resizeObserver.disconnect())}}p80.stickyBarService=new StickyBarService;class StickyBar extends HTMLElement{constructor(){super()}connectedCallback(){this.isVisible=!1,this.watchEndElement=this.hasAttribute("data-watch-end-element")?this.getAttribute("data-watch-end-element"):null;const tasks=[this.setConfiguration.bind(this),this.initializeWatchElement.bind(this),this.subscribe.bind(this)];this.yieldTasks(tasks)}disconnectedCallback(){this.stickyBarUnsubscriber&&this.stickyBarUnsubscriber()}yieldToMain(){return new Promise(resolve=>{setTimeout(resolve,0)})}async yieldTasks(tasks){for(;tasks.length>0;)tasks.shift()(),await this.yieldToMain()}setConfiguration(){this.alignment=this.hasAttribute("data-alignment")?p80.stickyBarService.alignments[this.getAttribute("data-alignment")]:"top";const offsetSplit=this.getAttribute("data-offset")?.match(/^([-.\d]+(?:\.\d+)?)(.*)$/),offsetSize=offsetSplit?.length?offsetSplit[1]:null;this.offset=Number.isNaN(parseInt(offsetSize,10))?0:parseInt(offsetSize,10),this.offsetUnit=offsetSplit?.length?offsetSplit[2]:"px",this.classList.add(`sticky-bar--${this.alignment}`)}subscribe(){if(!this.watchElement){console.error("Watch element not found.");return}this.stickyBarUnsubscriber=p80.stickyBarService.subscribe(this)}initializeWatchElement(){if(this.watchElementId=this.hasAttribute("data-watch-element")?this.getAttribute("data-watch-element"):null,!this.watchElementId){console.error("No watch element selector set for the Sticky Bar"),this.classList.add("hidden");return}if(this.watchElement=document.querySelector(this.watchElementId),!this.watchElement){console.error(`Unable to find the watch element with the ID ${this.watchElementId}`),this.classList.add("hidden");return}}}customElements.define("sticky-bar",StickyBar);class VolumeDiscounts extends HTMLElement{constructor(){super()}connectedCallback(){if(this.currency=Shopify&&Shopify.currency?Shopify.currency.active:null,!this.currency){console.error("Currency code not specified.");return}this.tags=this.querySelector('[type="application/json"]').textContent,this.tags&&(this.tags=JSON.parse(this.tags),this.fixedTags=this.tags.filter(tag=>tag.includes("breakf")),this.percentageTags=this.tags.filter(tag=>tag.includes("breakp")),!(!this.fixedTags.length&&!this.percentageTags.length)&&(this.price=this.getAttribute("data-price"),this.price&&(this.price=parseInt(this.price,10),this.chart=this.querySelector("ul"),this.chart&&(this.textLength=0,this.variantChangeUnsubscriber=subscribe(PUB_SUB_EVENTS.variantChange,event=>{!event||!event.data||!event.data.variant||(this.price=event.data.variant.price,this.generate())}),this.generate()))))}disconnectedCallback(){this.variantChangeUnsubscriber&&this.variantChangeUnsubscriber()}
7generate(){this.chart.textContent="",this.percentageTags.forEach(tag=>{const tagData=this.formatTag(tag),listEntry=this.generateHTML(tagData);this.chart.appendChild(listEntry)}),this.fixedTags.forEach(tag=>{const tagData=this.formatTag(tag),listEntry=this.generateHTML(tagData);listEntry&&this.chart.appendChild(listEntry)}),this.textLength>22&&this.classList.add("paragraph-small"),this.classList.remove("hidden")}formatTag(tag){if(!tag)return;const splitTag=tag.split(":");return splitTag.length<3?void 0:{quantity:parseInt(splitTag[1],10),discount:parseInt(splitTag[2],10),type:splitTag[0]==="breakp"?"percentage":"fixed"}}generateHTML(tagData){if(!tagData||Object.keys(tagData).length<3)return;const entry=document.createElement("li"),label=document.createElement("span");label.textContent=`${window.variantStrings.volumeDiscountBuy} ${tagData.quantity}`;const priceWrapper=document.createElement("span");priceWrapper.classList.add("volume-discounts__pricing");const originalPrice=this.formatPrice(this.price);let discountPrice=tagData.type==="percentage"?this.price*(1-tagData.discount/100):tagData.discount;if(this.price<discountPrice)return null;const discountBadge=document.createElement("span");if(discountBadge.classList.add("volume-discounts__badge"),tagData.type==="percentage")discountBadge.textContent=window.variantStrings.volumeDiscountSave+` ${tagData.discount}%`;else{const percentage=Math.floor((this.price-tagData.discount)/this.price*100).toFixed(0);discountBadge.textContent=window.variantStrings.volumeDiscountSave+` ${percentage}%`}priceWrapper.appendChild(discountBadge);const originalPriceWrapper=document.createElement("span");originalPriceWrapper.classList.add("volume-discounts__original"),originalPriceWrapper.textContent=originalPrice,priceWrapper.appendChild(originalPriceWrapper),discountPrice=this.formatPrice(discountPrice),discountPrice=discountPrice+` ${window.variantStrings.volumeDiscountEach}`;const discountPriceWrapper=document.createElement("span");discountPriceWrapper.classList.add("volume-discounts__sale"),discountPriceWrapper.textContent=discountPrice,priceWrapper.appendChild(discountPriceWrapper),label.appendChild(priceWrapper),entry.appendChild(label);const textLength=originalPrice.length+discountPrice.length;return textLength>this.textLength&&(this.textLength=textLength),entry}formatPrice(price){if(!price)return;let formattedPrice=price/100;const getLang=()=>navigator.languages!=null?navigator.languages[0]:navigator.language;return formattedPrice=formattedPrice.toLocaleString(getLang(),{style:"currency",currency:this.currency}),formattedPrice}}customElements.define("volume-discounts",VolumeDiscounts);class CountDownTimer extends HTMLElement{static observedAttributes=["data-date"];constructor(){super()}connectedCallback(){this.initialize()}attributeChangedCallback(){this.initialize()}disconnectedCallback(){clearInterval(this.countDownInterval)}initialize(){this.daysElement=this.querySelector('[data-target="days"]'),this.hoursElement=this.querySelector('[data-target="hours"]'),this.minutesElement=this.querySelector('[data-target="minutes"]'),this.secondsElement=this.querySelector('[data-target="seconds"]'),this.countDownDate=this.getAttribute("data-date"),!(!this.daysElement||!this.hoursElement||!this.minutesElement||!this.secondsElement||!this.countDownDate)&&(this.setValues(),this.countDown())}setValues(){this.date=new Date(this.countDownDate).getTime(),this.second=1e3,this.minute=this.second*60,this.hour=this.minute*60,this.day=this.hour*24}countDown(){this.countDownInterval=setInterval(()=>{const now=new Date().getTime(),distance=this.date-now;this.daysElement.innerText=Math.floor(distance/this.day),this.hoursElement.innerText=Math.floor(distance%this.day/this.hour),this.minutesElement.innerText=Math.floor(distance%this.hour/this.minute),this.secondsElement.innerText=Math.floor(distance%this.minute/this.second),!(distance>0)&&clearInterval(this.countDownInterval)},1e3)}}customElements.define("count-down-timer",CountDownTimer);class AnchorMenu extends HTMLElement{constructor(){super(),this.accordionWrapper=this.hasAttribute("data-accordion-wrapper")?document.querySelector(this.getAttribute("data-accordion-wrapper")):null,this.menuLinks=this.hasAttribute("data-menu-links")?document.querySelectorAll(this.getAttribute("data-menu-links")):null,this.menuLinks&&this.menuLinks.forEach(menuItem=>menuItem.addEventListener("click",this.setActiveLink.bind(this)))}setActiveLink(event){this.menuLinks.forEach(item=>item.classList.remove("active")),event.target.classList.add("active"),this.accordionWrapper&&(this.accordionWrapper.querySelector(".accordion__title").textContent=event.target.textContent,this.accordionWrapper.removeAttribute("open"),this.accordionWrapper.querySelector("summary").setAttribute("aria-expanded","fal
7se"))}}customElements.define("anchor-menu",AnchorMenu);function initCollectionLinks(){document.querySelectorAll(['.mega-menu__content a[href*="/collections/"]','.menu-drawer__navigation a[href*="/collections/"]','#MainContent a[href*="/collections/"]'].join(",")).forEach(link=>{link.addEventListener("click",handleCollectionClick)})}function handleCollectionClick(event){const storeLocation=localStorage.getItem("storeLocation"),storeAvailability=localStorage.getItem("storeAvailability"),storeWay=localStorage.getItem("storeWay");if(storeWay==="all"||!event.target.href)return;const encodedStoreLocation=encodeURIComponent(storeLocation),pickupParams=`filters[pickup_in_store]=${encodedStoreLocation}`,viewParams=`filters[view_in_store]=${encodedStoreLocation}`,pwParams=storeAvailability=="view"?viewParams:pickupParams,onlineParams="filters[shippable_quantity_boolean]=True";let updateHref="";storeWay==="pickup"&&storeLocation?updateHref=event.target.href.includes("filter.")?`${event.target.href}&${pwParams}`:`${event.target.href}?${pwParams}`:storeWay==="online"&&(updateHref=event.target.href.includes("filter.")?`${event.target.href}&${onlineParams}`:`${event.target.href}?${onlineParams}`),updateHref&&(event.preventDefault(),window.location.href=updateHref)}document.addEventListener("DOMContentLoaded",function(){initCollectionLinks()}); 8//# sourceMappingURL=/cdn/shop/t/8/assets/global.js.map?v=63393142974107120571781042907
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.