1function 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"))}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),setTimeout(()=>{elementToFocus.focus()})}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&&video.contentWindow&&video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video&&video.contentWindow&&video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video:not([data-autoplay-video-id])").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
1w 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.headerContent=document.querySelector("menu-drawer-container"),this.addEventListener("keyup",this.onKeyUp.bind(this)),this.bindEvents()}bindEvents(){this.querySelectorAll("summary").forEach(summary=>summary.addEventListener("click",this.onSummaryClick.bind(this))),this.querySelectorAll("button:not(.localization-selector)").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)):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)}closeMenuDrawer(event,elementToFocus=!1){event!==void 0&&(this.mainDetailsToggle.classList.remove("menu-opening"),this.mainDetailsToggle.querySelectorAll("details").forEach(detail
1s=>{details.removeAttribute("open"),details.classList.remove("menu-opening")}),this.mainDetailsToggle.querySelectorAll(".submenu-open").forEach(submenu=>{submenu.classList.remove("submenu-open")}),removeTrapFocus(elementToFocus),this.closeAnimation(this.mainDetailsToggle))}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
1sElement.closest("details[open]"),detailsElement.querySelector("summary")))};window.requestAnimationFrame(handleAnimation)}}customElements.define("menu-drawer",MenuDrawer);class HeaderDrawer extends MenuDrawer{constructor(){super(),this.header=this.header||document.getElementById("shopify-section-header"),this.screenSizeCheck(),window.addEventListener("resize",this.screenSizeCheck.bind(this))}openMenuDrawer(summaryElement){this.header.classList.add("menu-open"),setTimeout(()=>{this.mainDetailsToggle.classList.add("menu-opening")}),summaryElement.setAttribute("aria-expanded",!0),trapFocus(this.mainDetailsToggle,summaryElement),this.screenWidth<1050&&document.body.classList.add("overlay-mobile")}closeMenuDrawer(event,elementToFocus){super.closeMenuDrawer(event,elementToFocus),this.header.classList.remove("menu-open"),document.body.classList.remove("overlay-mobile")}screenSizeCheck(event,elementToFocus){this.screenWidth=window.innerWidth,this.screenWidth>=1050&&(document.body.classList.remove("overlay-mobile"),this.header.classList.remove("menu-open"),this.closeMenuDrawer(event,elementToFocus))}}customElements.define("header-drawer",HeaderDrawer);class ModalDialog extends HTMLElement{constructor(){super(),this.querySelector('[id^="ModalClose-"]').addEventListener("click",this.hide.bind(this,!1)),document.body.addEventListener("keyup",event=>{const isOpenModal=this.hasAttribute("open");event.code.toUpperCase()==="ESCAPE"&&isOpenModal&&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("overlay"),this.setAttribute("open",""),popup&&popup.loadContent();const dialog=this.querySelector('[role="dialog"]');dialog&&(dialog.setAttribute("aria-hidden","false"),trapFocus(this,dialog)),window.pauseAllMedia()}hide(){document.body.classList.remove("overlay"),document.body.dispatchEvent(new CustomEvent("modalClosed")),this.removeAttribute("open");const dialog=this.querySelector('[role="dialog"]');dialog&&dialog.setAttribute("aria-hidden","true"),window.pauseAllMedia()}}customElements.define("modal-dialog",ModalDialog);class ModalOpener extends HTMLElement{constructor(){super();const button=this.querySelector("button:not(.btn-autoplay-video)");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()}}}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)),this.detectiOS()}detectiOS(){(/iPad|iPhone|iPod/.test(navigator.platform)||navigator.platform==="MacIntel"&&navigator.maxTouchPoints>1)&&this.classList.add("is-ios")}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.currentPage!=previousPage&&this.dispatchEvent(new CustomEvent("slideChanged",{detail:{currentPage:this.currentPage,currentElement:this.sliderItemsToShow[this.currentPage-1]}})),!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.slider.scrollTo({left:this.slideScrollPosition})}}customElements.define("slider-component",SliderComponent);class VariantSelects extends HTMLElement{constructor(){super(),this.addEventListener("change",this.onVariantChange),this.getVariantData(),this.getProductOptionsData()}onVariantChange(){this.updateOptions(),this.updateMasterId(),this.toggleAddButton(!1,"",!1),this.removeErrorMessage(),this.updateV
1ariantLabel(),this.currentVariant?(this.updateMedia(),this.updateURL(),this.updateVariantInput()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())}updateOptions(){this.options=Array.from(this.querySelectorAll("select"),select=>select.value)}updateMasterId(){this.currentVariant=this.variantData.find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateMedia(){if(!this.currentVariant||!this.currentVariant.featured_media)return;const mediaGallery=document.getElementById(`MediaGallery-${this.dataset.section}`);if(!mediaGallery||mediaGallery.dataset.variantGalleries==="true"&&!!mediaGallery.querySelector(`.product-media-item[data-variant-ids*="|${this.currentVariant.id}|"][data-media-id*="-vg"]`))return;const mediaId=`${this.dataset.section}-${this.currentVariant.featured_media.id}`;if(!mediaGallery.querySelector(`[data-media-id="${mediaId}"]`)){console.warn("[media-gallery] no slide rendered for variant featured media; gallery unchanged:",mediaId);return}mediaGallery.setActiveMedia(mediaId,!0);const modalContent=document.querySelector(`#ProductModal-${this.dataset.section} .product-media-modal-content`);if(!modalContent)return;const newMediaModal=modalContent.querySelector(`[data-media-id="${this.currentVariant.featured_media.id}"]`);newMediaModal&&modalContent.prepend(newMediaModal)}updateURL(){!this.currentVariant||this.dataset.updateUrl==="false"||window.history.replaceState({},"",`${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}))})}updateVariantLabel(){this.querySelectorAll(".product-form-selected-option").forEach(item=>{let optionPosition=item.getAttribute("data-position")-1,variantName=this.currentVariant.options[optionPosition],servingSize=variantServingSize[this.currentVariant.id];item.innerHTML=variantName,servingSize&&(item.innerHTML=servingSize)})}removeErrorMessage(){const section=this.closest("section");if(!section)return;const productForm=section.querySelector("product-form");productForm&&productForm.handleErrorMessage()}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}`);addButton&&(addButtonText.textContent=window.variantStrings.unavailable,price&&price.classList.add("visibility-hidden"))}getVariantData(){const jsonProductVariantsElement=this.querySelector('#json-product-variants[type="application/json"]');return!this.variantData&&jsonProductVariantsElement&&(this.variantData=JSON.parse(jsonProductVariantsElement.textContent).map(variant=>{const onSale=variant.compare_at_price!==null&&variant.compare_at_price>variant.price;return{...variant,onSale}})),Array.isArray(this.variantData)?this.variantData:[]}getProductOptionsData(){const jsonProductOptions=this.querySelector('#json-product-options[type="application/json"]');return!this.productOptions&&jsonProductOptions!==null&&(this.productOptions=JSON.parse(jsonProductOptions.textContent)),Array.isArray(this.productOptions)?this.productOptions:[]}}customElements.define("variant-selects",VariantSelects);class VariantRadios extends VariantSelects{constructor(){super(),this.statusClasses={unavailable:"unavailable",outOfStock:"out-of-stock"},this.swatches=Array.from(this.querySelectorAll('input[type="radio"]')),this.swatches.forEac
1h(swatch=>{this.variantData.filter(variant=>variant.options.includes(swatch.value)&&variant.available).length||swatch.classList.add(this.statusClasses.outOfStock)})}updateOptions(){const fieldsets=Array.from(this.querySelectorAll("fieldset"));this.options=fieldsets.map((fieldset,index)=>{const optionInputs=Array.from(fieldset.querySelectorAll("input")),checkedOptionInput=optionInputs.find(radio=>radio.checked);return optionInputs.forEach(input=>{input===checkedOptionInput?(input.checked=!0,input.setAttribute("checked","checked"),input.dataset.selectedValue=input.value):(input.checked=!1,input.removeAttribute("checked"),input.dataset.selectedValue="")}),fieldset.dataset.selectedValue=checkedOptionInput?checkedOptionInput.value:"",checkedOptionInput?checkedOptionInput.value:null}),this.dispatchEvent(new CustomEvent("optionsUpdated",{detail:this.options}))}onVariantChange(event){this.updateOptions(),this.updateMasterId(),this.updateURL(),this.getVariantBadges(),this.updateVariantInput(),this.updateMedia(),this.updateVariantLabel(),this.updateSwatchState(event),this.emitVariantChange({...this.currentVariant,statusClasses:this.statusClasses})}emitVariantChange(detail){this.dispatchEvent(new CustomEvent("variantChange",{detail}))}getVariantBadges(){const newBadgeHTML='<span class="badge badge-new subtitle new-badge">new</span>',lowStockHTML='<span class="badge badge-low-stock subtitle">low stock</span>',outOfStockHTML='<span class="badge badge-sold-out subtitle">sold out</span>';document.querySelectorAll(".badge-wrapper").forEach(badges=>{badges.innerHTML="";const existingNewBadge=badges.querySelector(".new-badge"),existingLowStockBadge=badges.querySelector(".badge-low-stock"),existingOutOfStockBadge=badges.querySelector(".badge-sold-out");variantNewBadges[this.currentVariant.id]===!0||variantNewBadges[this.currentVariant.id]==="true"?badges.insertAdjacentHTML("afterbegin",newBadgeHTML):existingNewBadge&&existingNewBadge.remove(),variantStock[this.currentVariant.id]>0&&variantStock[this.currentVariant.id]<=10?badges.insertAdjacentHTML("beforeend",lowStockHTML):existingLowStockBadge&&existingLowStockBadge.remove(),variantStock[this.currentVariant.id]==0?badges.insertAdjacentHTML("beforeend",outOfStockHTML):existingOutOfStockBadge&&existingOutOfStockBadge.remove()})}updateSwatchState(event){this.resetSwatchesState();const clickedOptionIndex=event.target.dataset.optionIndex,clickedOptionValue=event.target.value,otherSelectedOptions=this.options.filter(option=>option===clickedOptionValue);this.swatches.forEach(swatch=>{this.variantData.filter(variant=>variant.options.includes(swatch.value)&&variant.available).length||swatch.classList.add(this.statusClasses.outOfStock)}),this.swatches.filter(swatch=>swatch.dataset.optionIndex!==clickedOptionIndex).forEach(swatch=>{otherSelectedOptions.forEach(option=>{this.variantData.filter(variant=>variant.options.includes(option)&&variant.options.includes(swatch.value)&&variant.available).length||swatch.classList.add(this.statusClasses.outOfStock)})})}intialSwatchState(optionIndex){this.updateOptions(),this.updateMasterId();const mockEvent={target:{dataset:{optionIndex:optionIndex.toString()},value:this.options[optionIndex-1].toString()}};this.updateSwatchState(mockEvent)}resetSwatchesState(){this.swatches.forEach(swatch=>{Object.values(this.statusClasses).forEach(status=>swatch.classList.remove(status))})}}customElements.define("variant-radios",VariantRadios);class PDPPrice extends HTMLElement{constructor(){super();const variantRadios=document.getElementById(`VariantRadios-${this.dataset.sectionId}`);variantRadios&&variantRadios.addEventListener("variantChange",this.onVariantChange.bind(this)),this.getCurrencyData(),this.priceContainer=this.querySelectorAll(".price-container"),this.salePrice=this.querySelectorAll(".price-item.price-item-sale"),this.regularPrice=this.querySelectorAll(".price-item.price-item-regular"),this.discountAmount=this.querySelectorAll(".badge-sale"),this.proDiscount=this.currencyData.pro_discount&&!Number.isNaN(Number(this.currencyData.pro_discount))&&Number(this.currencyData.pro_discount)<1?Number(this.currencyData.pro_discount):1,this.proCustomer=this.proDiscount<1,this.eligibleForProDiscount=this.currencyData.product_eligible_for_pro_discount==="true"&&this.currencyData.show_pro_discount==="true"}onVariantChange(e){const{compare_at_price,price}=e.detail,on_sale=compare_at_price!==null&&compare_at_price>price,regular_price=on_sale?compare_at_price:price,discountAmount=on_sale?compare_at_price-price:null,percentOff=on_sale?Math.round((compare_at_price-price)*100/compare_at_price):0;this.salePrice.forEach(salePrice=>{salePrice.innerText=this.proCustomer&&this.eligibleForProDiscount?this.formatPrice(regular_price*this.proDiscount):this.formatPrice(price)}),this.regularPrice.forEach(regularPrice=>{regularPrice.innerHTML=window.store_wide_discount?`
2 <span>${this.formatPrice(on_sale?compare_at_price:price-price*(window.store_wide_discount/100))}</span> 3 <s> 4 ${this.formatPrice(price)} 5 </s> 6 `:this.formatPrice(price)}),this.setPriceClasses(e.detail)}setPriceClasses(variant){variant.available===!1?this.classList.add("price-sold-out"):this.classList.remove("price-sold-out");const on_sale=variant.compare_at_price!==null&&variant.compare_at_price>variant.price,saleCartHTML='<span class="sale-cart-message paragraph-sm">Discount applied automatically in cart</span>',existingSaleCartHTML=document.querySelector(".sale-cart-message"),existingSaleBadgeHTML=document.querySelector(".badge-sale"),price=this.querySelector(".price-regular");if(variantPercentOff[variant.id]){existingSaleBadgeHTML&&existingSaleBadgeHTML.remove();let variantPercentOffHTML=`<span class="badge badge-sale subtitle">${variantPercentOff[variant.id]}</span>`;price.insertAdjacentHTML("beforeend",variantPercentOffHTML)}else existingSaleBadgeHTML&&existingSaleBadgeHTML.remove();variantSale[variant.id]?(existingSaleCartHTML&&existingSaleCartHTML.remove(),this.insertAdjacentHTML("beforeend",saleCartHTML)):existingSaleCartHTML&&existingSaleCartHTML.remove(),on_sale?this.classList.add("price-on-sale"):this.proCustomer===!0&&this.eligibleForProDiscount===!0?this.classList.add("price-on-sale"):this.classList.remove("price-on-sale")}getCurrencyData(){return this.currencyData=this.currencyData||JSON.parse(this.querySelector('#json-currency-data[type="application/json"]').textContent),this.currencyData}formatPrice(price){const{currency_code_enabled,money_format,money_with_currency_format}=this.currencyData,options={style:"decimal",minimumFractionDigits:2,maximumFractionDigits:2},formatted_price=new Intl.NumberFormat(window.Shopify.locale,options).format(Number(price)/100);return(currency_code_enabled?money_with_currency_format:money_format).replace("{{amount}}",formatted_price)}}customElements.define("pdp-price",PDPPrice); 7//# sourceMappingURL=/cdn/shop/t/123/assets/global.js.map?v=16119970576008723941789142591
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.