1(function(){if(typeof Shopify<"u"&&Shopify.designMode)return;let viewportH=window.innerHeight,lazyToMark=[];document.querySelectorAll(".shopify-section").forEach(function(section){if(!section.querySelector("[x-data],[x-show],[x-bind],[x-on],[x-intersect],[x-transition],[data-fade-on-intersect],[x-cloak]"))return;section.getBoundingClientRect().top>=viewportH&&lazyToMark.push(section)}),lazyToMark.forEach(function(section){section.setAttribute("x-ignore",""),section.setAttribute("data-alpine-lazy","")}),document.addEventListener("alpine:initialized",function(){let lazyEls=document.querySelectorAll("[data-alpine-lazy]");if(!lazyEls.length)return;let sectionObserver=new IntersectionObserver(function(entries,obs){entries.forEach(function(entry){if(!entry.isIntersecting)return;let el=entry.target;obs.unobserve(el),el.removeAttribute("x-ignore"),delete el._x_ignore,el.hasAttribute("x-data")||el.setAttribute("x-data","{}"),Alpine.initTree(el),window._fadeObserver&&window._fadeObserver.observe(el)})},{rootMargin:"300px 0px"});lazyEls.forEach(function(el){sectionObserver.observe(el)})})})();const installMediaQueryWatcher=(mediaQuery,changedCallback)=>{const mq=window.matchMedia(mediaQuery);mq.addEventListener("change",e=>changedCallback(e.matches)),changedCallback(mq.matches)},deferScriptLoad=(name,src,onload,requestVisualChange=!1)=>{(events=>{const loadScript=()=>{events.forEach(type=>window.removeEventListener(type,loadScript)),clearTimeout(autoloadScript);const initScript=()=>{const script=document.createElement("script");script.setAttribute("src",src),script.setAttribute("defer",""),script.onload=()=>{window.Maximize.loadedScript.push(name),document.dispatchEvent(new CustomEvent(name+" loaded")),onload()},document.head.appendChild(script)};requestVisualChange?window.requestIdleCallback?requestIdleCallback(initScript):requestAnimationFrame(initScript):initScript()};let autoloadScript;if(Shopify.designMode)loadScript();else{const wait=window.innerWidth>=MIN_DEVICE_WIDTH.tablet?2e3:5e3;events.forEach(type=>window.addEventListener(type,loadScript,{once:!0,passive:!0})),autoloadScript=setTimeout(()=>{loadScript()},wait)}})(["touchstart","mouseover","wheel","scroll","keydown"])},getSectionInnerHTML=(html,selector=".shopify-section")=>new DOMParser().parseFromString(html,"text/html").querySelector(selector)?.innerHTML,xParseJSON=jsonString=>(jsonString=String.raw`${jsonString}`,jsonString=jsonString.replaceAll("\\","\\\\").replaceAll('\\"','"'),JSON.parse(jsonString));requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xDarkMode",{isToggling:!1,toggleThemeMode(){this.isToggling||(this.isToggling=!0,requestAnimationFrame(()=>{document.documentElement.classList.add("show-icon-toggle-loading"),requestAnimationFrame(()=>{document.documentElement.classList.add("disable-transition-effect");const isDark=document.documentElement.classList.contains("dark");localStorage.maximize_theme=isDark?0:1,document.documentElement.classList.toggle("dark",!isDark),document.documentElement.classList.remove("show-icon-toggle-loading"),requestAnimationFrame(()=>{document.documentElement.classList.remove("disable-transition-effect"),this.isToggling=!1})})}))}}),Alpine.store("xHelper",{countdown(configs,callback){let endDate=new Date(configs.end_year,configs.end_month-1,configs.end_day,configs.end_hour,configs.end_minute);const endTime=endDate.getTime()+(-1*configs.timezone*60-endDate.getTimezoneOffset())*60*1e3;let startTime;if(configs.start_year){let startDate=new Date(configs.start_year,configs.start_month-1,configs.start_day,configs.start_hour,configs.start_minute);startTime=startDate.getTime()+(-1*configs.timezone*60-startDate.getTimezoneOffset())*60*1e3}else startTime=new Date().getTime();let x=setInterval(function(){let now=new Date().getTime(),distance=endTime-now;if(distance<0||startTime>now)callback(!1,0,0,0,0),clearInterval(x);else{let days=Math.floor(distance/864e5),hours=Math.floor(distance%(1e3*60*60*24)/(1e3*60*60)),minutes=Math.floor(distance%(1e3*60*60)/(1e3*60)),seconds=Math.floor(distance%(1e3*60)/1e3);minutes=minutes<10?"0"+minutes:minutes,seconds=seconds<10?"0"+seconds:seconds,callback(!0,seconds,minutes,hours,days)}},1e3)},countdownByTime(startTime=Date.now(),endTime,callback){const x=setInterval(()=>{const now=Date.now(),distance=endTime-now;if(distance<0||startTime>now){callback(!1,0,0,0,0),clearInterval(x);return}const days=Math.floor(distance/MS_PER_DAY),hours=Math.floor(distance%MS_PER_DAY/MS_PER_HOUR);let minutes=Math.floor(distance%MS_PER_HOUR/MS_PER_MINUTE),seconds=Math.floor(distance%MS_PER_MINUTE/MS_P
1ER_SECOND);minutes=minutes<10?"0"+minutes:minutes,seconds=seconds<10?"0"+seconds:seconds,callback(!0,seconds,minutes,hours,days)},1e3)},canShow(configs){let endDate=new Date(configs.end_year,configs.end_month-1,configs.end_day,configs.end_hour,configs.end_minute);const endTime=endDate.getTime()+(-1*configs.timezone*60-endDate.getTimezoneOffset())*60*1e3;let startTime;if(configs.start_year){let startDate=new Date(configs.start_year,configs.start_month-1,configs.start_day,configs.start_hour,configs.start_minute);startTime=startDate.getTime()+(-1*configs.timezone*60-startDate.getTimezoneOffset())*60*1e3}else startTime=new Date().getTime();let now=new Date().getTime();return!(endTime-now<0||startTime>now)},handleTime(configs){let endDate=new Date(configs.end_year,configs.end_month-1,configs.end_day,configs.end_hour,configs.end_minute);const endTime=endDate.getTime()+(-1*configs.timezone*60-endDate.getTimezoneOffset())*60*1e3;let startTime;if(configs.start_year){let startDate=new Date(configs.start_year,configs.start_month-1,configs.start_day,configs.start_hour,configs.start_minute);startTime=startDate.getTime()+(-1*configs.timezone*60-startDate.getTimezoneOffset())*60*1e3}else startTime=new Date().getTime();let now=new Date().getTime(),distance=endTime-now;return{startTime,endTime,now,distance}},setPosition(destinationId,elementId,needRemove=!1){let destinationElem=document.querySelector(destinationId),movedElem=document.querySelector(elementId);if(destinationElem&&movedElem){destinationElem.innerHTML=movedElem.innerHTML,needRemove&&movedElem.remove(),window._fadeObserver&&(destinationElem.querySelectorAll("[data-fade-on-intersect]").forEach(function(el){el.removeAttribute("data-fade-observed")}),window._fadeObserver.observe(destinationElem));
1const resizeEvent=new CustomEvent("resize");window.dispatchEvent(resizeEvent)}},dragToScroll(el,checkCanDrag=!1){const container=el;let isDragging=!1,startX,scrollLeft,canDrag=!0;if(container&&(container.addEventListener("mousedown",e=>{isDragging=!0,startX=e.pageX-container.offsetLeft,scrollLeft=container.scrollLeft}),container.addEventListener("mousemove",e=>{if(!isDragging||!canDrag)return;e.preventDefault();const walk=e.pageX-container.offsetLeft-startX;container.scrollLeft=scrollLeft-walk,requestAnimationFrame(()=>{Math.abs(walk)>THRESHOLD.startScroll&&(container.dataset.dragStartedScroll="true")})}),container.addEventListener("mouseup",()=>{canDrag&&(isDragging=!1,requestAnimationFrame(()=>{container.removeAttribute("data-drag-started-scroll")}))}),container.addEventListener("mouseleave",()=>{isDragging&&(isDragging=!1)}),checkCanDrag)){const updateCursorContainer=()=>{container.scrollWidth>container.clientWidth?(container.classList.add("cursor-grab","select-none"),canDrag=!0):(container.classList.remove("cursor-grab","select-none"),canDrag=!1)};updateCursorContainer(),window.addEventListener("resize",debounce(()=>{updateCursorContainer()},TIMEOUT.resize))}}}),Alpine.data("xScrollNav",()=>({isRtl:window.Maximize.rtl,linkList:"",show:!1,isAtStart:!0,isAtEnd:!1,navContentEl:null,navContentWidth:0,navButtonWidth:0,activeIndex:0,__debounce(func,wait){let timeout;return function(...args){clearTimeout(timeout),timeout=setTimeout(()=>func.apply(this,args),wait)}},init(){this.linkList=this.$el.querySelector(".link-list"),this.linkList.addEventListener("scroll",()=>{this.__debounce(this.checkScroll(),20)}
1),this.navContentEl=this.linkList.closest(".nav-content"),this.navContentWidth=this.navContentEl.offsetWidth;const navButtons=this.$el.getElementsByClassName("scroll-nav");Alpine.nextTick(()=>{const updateNavButtonWidth=()=>{this.navButtonWidth=0,Array.from(navButtons).forEach(button=>{this.navButtonWidth==0&&(this.navButtonWidth=button.getBoundingClientRect().width)})};installMediaQueryWatcher(`(min-width: ${MIN_DEVICE_WIDTH.tablet}px)`,updateNavButtonWidth)}),this.checkNavIsOverflow();let _self=this,_visObs=new IntersectionObserver(function(entries){entries.forEach(function(entry){entry.isIntersecting&&(_self.checkNavIsOverflow(),_visObs.unobserve(entry.target))})});_visObs.observe(this.$el),window.addEventListener("resize",()=>{this.__debounce(this.checkNavIsOverflow(),300),this.__debounce(this.checkScroll(),20)})},checkNavIsOverflow(){this.navContentWidth=this.navContentEl.offsetWidth,this.linkList.scrollWidth>this.navContentWidth?this.show=!0:this.show=!1},scrollToLeft(){const multiplier=window.innerWidth<MIN_DEVICE_WIDTH.tablet?.5:.3;this.linkList.scroll({top:0,left:this.linkList.scrollLeft-(this.isRtl?-(this.navContentWidth*multiplier):this.navContentWidth*multiplier),behavior:"smooth"}),this.checkScroll()},scrollToRight(){const multiplier=window.innerWidth<MIN_DEVICE_WIDTH.tablet?.5:.3;this.linkList.scroll({top:0,left:this.linkList.scrollLeft+(this.isRtl?-(this.navContentWidth*multiplier):this.navContentWidth*multiplier),behavior:"smooth"}),this.checkScroll()},checkScroll(){setTimeout(()=>{const{scrollWidth,offsetWidth,scrollLeft}=this.linkList;this.isScrollable=scrollWidth>offsetWidth;const endOffset=scrollWidth-offsetWidth;this.isRtl?(this.isAtStart=Math.abs(scrollLeft)<=1,this.isAtEnd=Math.abs(scrollLeft)>=endOffset-2):(this.isAtStart=scrollLeft<=1,this.isAtEnd=scrollLeft+offsetWidth>=scrollWidth-2)},300)},scrollToActiveItem(activeItem,hasEdgeGap){const activeChild=activeItem||this.linkList.querySelector(".block-text-button__wrapper.is-active");if(!activeChild)return;const childRect=activeChild.getBoundingClientRect(),linkListRect=this.linkList.getBoundingClientRect();let offsetLeft=this.linkList.scrollLeft;this.isRtl?offsetLeft+=childRect.right-linkListRect.right:offsetLeft+=childRect.left-linkListRect.left,hasEdgeGap&&this.navButtonWidth&&(offsetLeft+=this.navButtonWidth*2*(this.isRtl?1:-1)),this.linkList.scroll({left:offsetLeft,behavior:"smooth"}),this.checkScroll()}})),Alpine.store("xMaximizePopup",{isOpen:!1,handleOpen:function(activeElement){this.isOpen=!0,window.Maximize.isShowPopupOverlay&&document.body.classList.add("overflow-y-hidden"),activeElement&&setTimeout(()=>{document.querySelector(`${activeElement}`)?.focus()},500)},handleClose:function(){Alpine.store("xFocusElement").removeTrapFocus(),setTimeout(()=>{this.isOpen=!1,window.Maximize.isShowPopupOverlay&&document.body.classList.remove("overflow-y-hidden")},500)}}),Alpine.store("xMaximizeDrawer",{isOpen:!1,activeDrawerElement:!1,durationTime:0,drawerCloseElement:!1,handleOpen:function(drawerContainer){const drawerContainerEle=document.querySelector(drawerContainer);drawerContainerEle&&(this.activeDrawerElement=drawerContainerEle,this.durationTime=DURATION.DRAWER_TRANSITION,drawerContainerEle.classList.add("is-open"),this.isOpen=!0,document.body.classList.add("overflow-y-hidden")),this.drawerCloseElement||(this.drawerCloseElement=this.activeDrawerElement)},handleClose:function(isCloseAllDrawer=!0){Alpine.store("xFocusElement").removeTrapFocus(),this.isOpen=!1,this.activeDrawerElement&&this.activeDrawerElement.classList.remove("is-open"),isCloseAllDrawer?setTimeout(()=>{this.activeDrawerElement===this.drawerCloseElement||!this.activeDrawerElement?(document.body.classList.remove("overflow-y-hidden"),this.drawerCloseElement=!1):this.drawerCloseElement=this.activeDrawerElement,this.activeDrawerElement=!1},this.durationTime):this.activeDrawerElement=this.drawerCloseElement}}),Alpine.store("xFocusElement",{focusableElements:['button, [href], input:not([hidden]), select, textarea, [tabindex]:not([tabindex^="-"]), a:not([aria-disabled="true"])'],listeners:{},activeElement:null,isFocusable(el){if(!el)return!1;const style=getComputedStyle(el);if(!el.offsetParent||style.visibility==="hidden"||style.display==="none")return!1;const tabindex=el.getAttribute("tabindex");return!(tabindex!==null&&parseInt(tabindex,10)===-1)},trapFocus(containerSelector,elementFocusSelector){const container=document.getElementById(containerSelector),elementFocus=document.getElementById(elementFocusSelector);if(document.activeElement!==document.body&&!container.contains(document.activeElement)&&(this.activeElement=document.activeElement),this.listeners=this.listeners||{},container){const elements=Array.from(container.querySelectorAll(this.focusableElements));let firstEl=null,lastEl=null;for(let i=0;i<=elements.length-1;i++)if(this.isFocusable(elements[i])){firstEl=elements[i];break}for(let i=elements.length-1;i>=0;i--)if(this.isFocusable(elements[i])){lastEl=elements[i];break}this.removeTrapFocus(),this.listeners.focusin=event=>{event.target!==container&&event.target!==lastEl&&event.target!==firstEl||document.addEventListener("keydown",this.listeners.keydown)},this.listeners.focusout=()=>{document.removeEventListener("keydown",this.listeners.keydown)},this.listeners.keydown=e=>{e.code.toUpperCase()==="TAB"&&(e.target===lastEl&&!e.shiftKey&&(e.preventDefault(),firstEl.focu
1s()),(e.target===firstEl||e.target==container)&&e.shiftKey&&(e.preventDefault(),lastEl.focus()))},document.addEventListener("focusout",this.listeners.focusout),document.addEventListener("focusin",this.listeners.focusin),elementFocus?.focus()}},removeTrapFocus(elementToFocus=null){document.removeEventListener("focusin",this.listeners.focusin),document.removeEventListener("focusout",this.listeners.focusout),document.removeEventListener("keydown",this.listeners.keydown),elementToFocus?elementToFocus.focus():this.activeElement?.focus()}}),Alpine.data("xTruncateText",()=>({truncateEl:"",truncateInnerEl:"",truncated:!1,truncatable:!1,label:"",expanded:!1,load(truncateEl){const truncateRect=truncateEl.getBoundingClientRect();truncateEl.style.setProperty("--truncate-height",`${truncateRect.height}px`)},setTruncate(element){element.offsetHeight<element.scrollHeight||element.offsetWidth<element.scrollWidth?(this.truncated=!0,this.truncatable=!0,this.expanded=!1):(this.truncated=!1,this.truncatable=!1,this.expanded=!0)},open(el,newLabel){const truncateEl=el.closest(".truncate-container").querySelector(".truncate-text");if(this.expanded=!0,this.label=newLabel,truncateEl.classList.contains("truncate-expanded"))this.truncated=!0;else{const truncateInnerEl=truncateEl.querySelector(".truncate-inner");window.requestAnimationFrame(()=>{const truncateInnerRect=truncateInnerEl.getBoundingClientRect();truncateEl.style.setProperty("--truncate-height-expanded",`${truncateInnerRect.height}px`),truncateEl.classList.add("truncate-expanded")}),this.truncated=!1}},close(el,newLabel,isPopup=!1){this.label=newLabel;const truncateEl=el.closest(".truncate-container").querySelector(".truncate-text"),isInViewport=()=>{const rect=truncateEl.getBoundingClientRect();return rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)};if(this.truncated=!0,!isInViewport()){if(isPopup){const drawerContent=el.closest(".drawer__content"),scrollPosition=truncateEl.getBoundingClientRect().top+drawerContent.scrollTop-100;drawerContent.scrollTo({top:scrollPosition,behavior:"smooth"})}else{const scrollPosition=truncateEl.getBoundingClientRect().top+window.scrollY-100;window.scrollTo({top:scrollPosition,behavior:"smooth"})}truncateEl.style.transition="none",setTimeout(()=>{truncateEl.style.transition=""},1e3)}truncateEl.classList.remove("truncate-expanded"),this.expanded=!1}}))})});const quantityRuleUtils={get strings(){return window.Maximize&&window.Maximize.quantityRuleStrings||{}},ruleArgsForVariant(variant){const qr=variant&&variant.quantity_rule;return qr?[qr.min,qr.max,qr.increment]:[1,null,1]},normalizeRule(min,max,increment){if(!window.Maximize.isB2BCustomer)return{min:1,max:null,increment:1};let m=parseInt(min),inc=parseInt(increment);(!Number.isInteger(m)||m<1)&&(m=1),(!Number.isInteger(inc)||inc<1)&&(inc=1),m=Math.ceil(m/inc)*inc;let mx=parseInt(max);return(max==null||max===""||max==="null"||!Number.isInteger(mx))&&(mx=null),mx!==null&&(mx=Math.floor(mx/inc)*inc),mx!==null&&mx<m&&(mx=m),{min:m,max:mx,increment:inc}},roundToIncrement(value,rule){const{min,max,increment}=rule;if(increment<=1){let v=value<min?min:value;return max!==null&&v>max&&(v=max),v}let snapped=min+Math.round((value-min)/increment)*increment;return snapped<min&&(snapped=min),max!==null&&snapped>max&&(snapped=min+Math.floor((max-min)/increment)*increment),snapped},normalizeQuantity(value,rule){let v=parseInt(value);return Number.isInteger(v)||(v=rule.min),v<rule.min?rule.min:this.roundToIncrement(v,rule)},step(value,rule,direction){const v=parseInt(value);if(!Number.isInteger(v))return rule.min;let next;if(this.isValid(v,rule))next=v+direction*rule.increment;else{const offset=(v-rule.min)/rule.increment;next=rule.min+(direction>0?Math.ceil(offset):Math.floor(offset))*rule.increment}return next<rule.min&&(next=rule.min),rule.max!==null&&next>rule.max&&(next=rule.max),next},isValid(value,rule){const v=parseInt(value);return!Number.isInteger(v)||v<rule.min||rule.max!==null&&v>rule.max?!1:(v-rule.min)%rule.increment===0},buildError(value,rule){const s=this.strings,v=parseInt(value);if(!Number.isInteger(v)||v<rule.min)return(s.min||"").replace("[min]",rule.min);if(rule.max!==null&&v>rule.max)return(s.max||"").replace("[max]",rule.max);const lower=rule.min+Math.floor((v-rule.min)/rule.increment)*rule.increment;let upper=lower+rule.increment;return rule.max!==null&&upper>rule.max&&(upper=rule.max),(s.step||"").replace("[lower]",lower).replace("[upper]",upper)},normalizeOnLeave(component,el){const rule=component.rule;if(this.isValid(el.value,rule)){component.__emitQuantityError("");return}const message=this.buildError(el.value,rule),snapped=this.normalizeQuantity(el.value,rule);component.qty=snapped,el.value!==String(snapped)&&(el.value=snapped),this.__emitErrorTimed(component,message)},__emitErrorTimed(component,message,autoHideMs=3e3){component.$nextTick(()=>{component.__emitQuantityError(message),component.__errorHideTimer=setTimeout(()=>component.__emitQuantityError(""),autoHideMs)})},validateNow(component,el){const rule=component.rule;return this.isValid(el.value,rule)?(component.__emitQuantityError(""),!0):(component.__emitQuantityError(this.buildError(el.value,rule)),!1)},priceForQuantity(basePrice,priceBreaks,qty){if(!Array.isArray(priceBreaks)||!priceBreaks.length)return basePrice;const quantity=parseInt(qty);if(!Number.isInteger(quantity))return basePrice;let price=basePrice,bestMin=-1;return priceBreaks.forEach(priceBreak=>{const min=parseInt(priceBreak&&priceBreak.minimumQuantity);!Number.isInteger(min)||min>quantity||min>bestMin&&(bestMin=min,price=priceBreak.price)}),price},showPriceTier(containers,qty){if(!containers||!containers.length)return;const quantity=parseInt(qty);
1containers.forEach(container=>{const tiers=container.querySelectorAll("[data-price-tier]");if(!tiers.length)return;let active=null;if(Number.isInteger(quantity)){let activeMin=-1;tiers.forEach(tier=>{const min=parseInt(tier.dataset.priceTier);!Number.isInteger(min)||min>quantity||min>activeMin&&(activeMin=min,active=tier)})}active||(active=tiers[0]),tiers.forEach(tier=>{tier.hidden=tier!==active})})}};requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xQuantitySelector",(sectionId,currentVariantId,productUrl,isQtyPriceBreak=!1,min=1,max=null,increment=1,errorScope="")=>{const initialRule=quantityRuleUtils.normalizeRule(min,max,increment);return{qty:initialRule.min,min:initialRule.min,max:initialRule.max,increment:initialRule.increment,currentVariantId,get rule(){return{min:this.min,max:this.max,increment:this.increment}},setRule(m,mx,inc){const r=quantityRuleUtils.normalizeRule(m,mx,inc);this.min=r.min,this.max=r.max,this.increment=r.increment},init(){this.$watch("qty",newValue=>{this.$refs.quantity_input&&(this.$refs.quantity_input.value=newValue),window.Maximize.isB2BCustomer&&quantityRuleUtils.isValid(newValue,this.rule)&&this.__emitQuantityError(""),this.__syncPriceToQuantity(newValue)}),this.__syncPriceToQuantity(this.qty)},handleInit(){const inputValue=this.$refs.quantity_input&&this.$refs.quantity_input.value,parsedInput=parseInt(inputValue);this.qty=quantityRuleUtils.isValid(parsedInput,this.rule)?parsedInput:this.min,document.addEventListener(`${PRODUCT_EVENT.updatedVariant}${sectionId}`,event=>{const{currentVariant}=event.detail;currentVariant&¤tVariant.id&&(this.currentVariantId=currentVariant.id),window.Maximize.isB2BCustomer&&this.setRule(...quantityRuleUtils.ruleArgsForVariant(currentVariant)),this.$refs.quantity_input&&(this.$refs.quantity_input.value=this.min),this.qty=this.min}),document.addEventListener(`${CART_EVENT.cartUpdate}`,()=>{fetch(`${productUrl}?variant=${this.currentVariantId}§ion_id=${sectionId}`).then(response=>response.text()).then(responseText=>{const html=new DOMParser().parseFromString(responseText,"text/html"),oldElement=document.querySelector(`.section--${sectionId} .quantity-selector__quantity-in-cart[data-current-variant-id="${this.currentVariantId}"]`),newElement=html.querySelector(`.section--${sectionId} .quantity-selector__quantity-in-cart[data-current-variant-id="${this.currentVariantId}"]`);oldElement&&newElement&&(oldElement.innerHTML=newElement.innerHTML)}).catch(e=>console.error(e))}),isQtyPriceBreak&&document.addEventListener(`QUANTITY_EVENT.volumnPricingChange-${sectionId}`,event=>{this.qty=quantityRuleUtils.normalizeQuantity(event.detail.quantity,this.rule)})},__syncPriceToQuantity(quantity){const group=errorScope||sectionId;quantityRuleUtils.showPriceTier(document.querySelectorAll(`[data-price-group="${group}"]`),quantity)},minus(){this.qty=quantityRuleUtils.step(this.qty,this.rule,-1)},plus(){this.qty=quantityRuleUtils.step(this.qty,this.rule,1)},normalizeOnLeave(el){window.Maximize.isB2BCustomer&&quantityRuleUtils.normalizeOnLeave(this,el)},validateNow(el){return window.Maximize.isB2BCustomer?quantityRuleUtils.validateNow(this,el):!0},__emitQuantityError(message){clearTimeout(this.__errorHideTimer),document.dispatchEvent(new CustomEvent(`quantity-rule-error:${errorScope||sectionId}`,{detail:{message}}))}}}),Alpine.data("xSection",(sectionId,container)=>({sectionId,loading:!0,show_more:!0,firstLoadData(){let url=`${window.location.pathname}?section_id=${this.sectionId}`;fetch(url,{method:"GET"}).then(response=>response.text()).then(()=>{this.loading=!1})}}))})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xQuantitySelectorAtc",(productId,index,min=1,max=null,increment=1,cardId="")=>({qty:1,min:1,max:null,increment:1,productId,index,hasQuantityRuleInfo:!0,get quantityKey(){return`${this.productId}-${this.index}`},get rule(){return{min:this.min,max:this.max,increment:this.increment}},setRule(m,mx,inc){const r=quantityRuleUtils.normalizeRule(m,mx,inc);this.min=r.min,this.max=r.max,this.increment=r.increment}
1,init(){window.Maximize.isB2BCustomer&&this.setRule(min,max,increment);const stored=Alpine.store("productQuantity").get(this.quantityKey);this.qty=quantityRuleUtils.isValid(stored,this.rule)?stored:this.min,Alpine.store("productQuantity").set(this.quantityKey,this.qty),this.__syncPriceToQuantity(this.qty),this.$watch(()=>Alpine.store("productQuantity").get(this.quantityKey),newValue=>{newValue!==this.qty&&(this.qty=newValue)}),this.$watch("qty",newValue=>{Alpine.store("productQuantity").set(this.quantityKey,newValue),this.updateWrapperDataset(newValue),this.__syncPriceToQuantity(newValue),window.Maximize.isB2BCustomer&&quantityRuleUtils.isValid(newValue,this.rule)&&this.__emitQuantityError("")}),cardId&&window.Maximize.isB2BCustomer&&document.addEventListener(`${PRODUCT_EVENT.swatchChange}${cardId}`,event=>{const detail=event.detail||{},qr=detail.quantity_rule;if(qr)this.setRule(qr.min,qr.max,qr.increment),this.hasQuantityRuleInfo=!0;else{const variant=detail.currentVariant;this.setRule(...quantityRuleUtils.ruleArgsForVariant(variant)),this.hasQuantityRuleInfo=!!variant&&variant.available!==!1}this.qty=this.min})},updateWrapperDataset(newValue){const wrapper=this.$el.closest(".product-card__wrapper");wrapper&&(wrapper.dataset.quantity=newValue)},__syncPriceToQuantity(quantity){cardId&&quantityRuleUtils.showPriceTier(document.querySelectorAll(`[data-price-group="${cardId}"]`),quantity)},minus(){this.qty=quantityRuleUtils.step(this.qty,this.rule,-1)},plus(){this.qty=quantityRuleUtils.step(this.qty,this.rule,1)},normalizeOnLeave(el){window.Maximize.isB2BCustomer&&quantityRuleUtils.normalizeOnLeave(this,el)},validateNow(el){return window.Maximize.isB2BCustomer?quantityRuleUtils.validateNow(this,el):!0},__emitQuantityError(message){clearTimeout(this.__errorHideTimer),cardId&&document.dispatchEvent(new CustomEvent(`quantity-rule-error:${cardId}`,{detail:{message}}))}})),Alpine.store("productQuantity",{quantities:{},set(key,value){this.quantities[key]=Math.max(1,parseInt(value)||1)},get(key){return this.quantities[key]||1}})})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xSwiffy",{swiffySlider:null,load(el,configs){this.swiffySlider=el;const swiffy=new SwiffySlider(el,configs);configs.handleArrow&&this.handleArrowButton(swiffy,el),configs.hotspot&&this.handleHotspot(swiffy,configs),configs.paginationBar&&this.handlePaginationBar(swiffy,configs),configs.progressBar&&this.handleProgressBar(swiffy,configs)},handleHotspot(swiffy,configs){const hotspots=document.getElementById(configs.hotspot).getElementsByClassName("x-hotspot");for(let i=0;i<hotspots.length;i++)hotspots[i].addEventListener("mouseenter",function(e){swiffy.slideTo(i)});this.swiffySlider.addEventListener("maximize:swiffy-slider:slide",function(e){const{oldActiveSlideIndex,newActiveSlideIndex}=e.detail;hotspots[oldActiveSlideIndex].classList.remove("active-hotspot"),hotspots[newActiveSlideIndex].classList.add("active-hotspot")})},handleProgressBar(swiffy,configs){let bar=swiffy.sliderElement.querySelector(".swiffy-slide-progress-bar");swiffy.sliderElement.addEventListener("maximize:swiffy-slider:slide",function(e){const{oldActiveSlideIndex,newActiveSlideIndex}=e.detail;let end=configs.progressBar,rate=100*(newActiveSlideIndex/end);if(bar){let rateBar=rate+Number(bar.style.width.replace("%","")),maxRate=100-Number(bar.style.width.replace("%",""));rateBar>100&&(rate=maxRate),document.querySelector("body").classList.contains("rtl")?bar.style.marginRight=rate+"%":bar.style.marginLeft=rate+"%"}})},handleArrowButton(swiffy,el){const nextButton=el.querySelector(".arrow-next"),prevButton=el.querySelector(".arrow-prev");nextButton&&nextButton.addEventListener("click",function(e){swiffy.slide()}),prevButton&&prevButton.addEventListener("click",function(e){swiffy.slide(!1)})},handlePaginationBar(swiffy,configs){swiffy.sliderElement.addEventListener("maximize:swiffy-slider:slide",event=>{const newActiveSlideIndex=Number(event.detail.newActiveSlideIndex);if(configs.paginationBar=="number_bar")event.detail.el.querySelector(".current-active-index")&&(event.detail.el.querySelector(".current-active-index").textContent=newActiveSlideIndex+1);else if(configs.paginationBar=="image")try{let imagePaginationList=event.detail.el.querySelectorAll(".pagination-active-image"),newActivePagination=newActiveSlideIndex<imagePaginationList.length-1?newActiveSlideIndex+1:0;imagePaginationList.forEach((imagePagination,index)=>{imagePagination.classList.toggle("active",index===newActivePagination)})}catch(e){console.error(e)}this.handleLoadingProgress(event.detail.el,configs)})}
1,handleLoadingProgress(el,configs){if(configs.paginationBar=="image"){const overlay=el.querySelector(".pagination-image-ovelay");if(!overlay)return;overlay.classList.remove("active"),overlay.restartTimeout=setTimeout(()=>{overlay.classList.add("active")},300)}else{const loadingEl=el.querySelector(".slider-autoplay-loading");if(!configs.autoPlay||!loadingEl)return;loadingEl.classList.remove("active"),loadingEl.restartTimeout=setTimeout(()=>{loadingEl.classList.add("active")},300)}}}),Alpine.store("xProductCard",{loadedChooseOptions:{},async loadChooseOptions(url,el,optionId,index,isShowQuantity=!1){const productCardWrapper=el.closest(".product-card__wrapper");if(!productCardWrapper)return;let listOptionValuesIdSelected=productCardWrapper.dataset.listOptionValuesIdSelected?productCardWrapper.dataset.listOptionValuesIdSelected.split(",").map(v=>v.trim()).filter(Boolean):[],urlProduct=`${url}?option_values=${listOptionValuesIdSelected.join(",")}§ion_id=choose-option&page=${index}`,destinationElm=productCardWrapper.querySelector(".choose-option"),loadingEl=productCardWrapper.querySelector(".icon-loading");const renderQuantity=()=>{const quantityContainer=destinationElm.querySelector("#ChooseOptionQuantity");isShowQuantity?quantityContainer&&quantityContainer.classList.remove("hidden"):quantityContainer&&quantityContainer.remove()};if(this.loadedChooseOptions[urlProduct])return destinationElm.innerHTML=this.loadedChooseOptions[urlProduct],renderQuantity(),setTimeout(()=>{this.focusChooseOption(destinationElm)},500),!0;try{loadingEl&&loadingEl.classList.remove("hidden");const content=await(await fetch(urlProduct)).text();let parsedContent=new DOMParser().parseFromString(content,"text/html").getElementById("ChooseOptionContent").innerHTML;parsedContent&&(destinationElm&&(destinationElm.innerHTML=parsedContent,renderQuantity()),Shopify.designMode||(this.loadedChooseOptions[urlProduct]=parsedContent)),loadingEl&&loadingEl.classList.add("hidden")}catch(error){console.error(error)}this.focusChooseOption(destinationElm)},focusChooseOption(el){const closeButton=el.querySelector(".btn-close-choose-option");closeButton&&closeButton.focus({preventScroll:!0})},handleCardHover(el){const swiffy=new SwiffySlider(el,{});let cardImage=swiffy.sliderElement.querySelector(".slider-container");if(window.innerWidth>
1=MIN_DEVICE_WIDTH.desktop){let mouseMoveRafId;const onMouseMove=e=>{mouseMoveRafId&&cancelAnimationFrame(mouseMoveRafId),mouseMoveRafId=requestAnimationFrame(()=>{let left=e.offsetX,width=cardImage.getBoundingClientRect().width;window.Maximize.rtl&&(left=width-left);let spacing=left/width,index=Math.floor(spacing*swiffy.slides.length);swiffy.dispatchEventSlide(swiffy.activeSlideIndex),swiffy.updateActiveSlide(index)})};let mouseLeaveRafId;const onMouseLeave=()=>{mouseLeaveRafId&&cancelAnimationFrame(mouseLeaveRafId),mouseLeaveRafId=requestAnimationFrame(()=>{swiffy.dispatchEventSlide(swiffy.activeSlideIndex),swiffy.updateActiveSlide(0)})};cardImage.addEventListener("mousemove",onMouseMove),cardImage.addEventListener("mouseleave",onMouseLeave)}}})})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xModalSearch",(type,desktopMaximumResults,mobileMaximumResults,productTypeSelected)=>({_keyDebounce:"",searchAbortController:null,searchRequestId:0,_syncRafId:null,result:"",query:"",cachedResults:{},openResults:!1,isFocusedSearchForm:!1,productTypeSelected,showSuggest:!0,loading:!1,loadingProductType:!1,isFirstLoading:!0,init(){this.$watch("isFocusedSearchForm",val=>{val&&this.syncSearchLayout()});const applyWrapperHeight=()=>{const searchBarEl=this.$refs.search_bar_fixed,searchBoxWrapper=this.$refs.open_search?.querySelector(".search-box-wrapper");searchBarEl&&searchBoxWrapper&&(searchBoxWrapper.style.height=searchBarEl.offsetHeight+"px")};window.requestIdleCallback?(requestIdleCallback(applyWrapperHeight),this.isFirstLoading=!1):(setTimeout(applyWrapperHeight,200),this.isFirstLoading=!1),window.matchMedia("(min-width: 1024px)").addEventListener("change",applyWrapperHeight)},open(){this.isFocusedSearchForm=!0,setTimeout(()=>{this.$refs.input_search.focus()},50),this.$refs.close_button&&this.$refs.close_button.classList.remove("hidden"),this.result.length>0&&(this.openResults=!0),document.body.classList.add("overflow-hidden"),Alpine.store("xFocusElement").activeElement=this.$el},close(){this.$refs.close_button&&this.$refs.close_button.classList.add("hidden"),document.body.classList.remove("overflow-hidden"),Alpine.store("xFocusElement").removeTrapFocus(),this.isFocusedSearchForm=!1,this.openResults=!1,this.searchAbortController&&this.searchAbortController.abort()},handleChangeInput(){if(this.query=this.$el.value,this.query===""){this.showSuggest=!0,this.openResults=!1,this.result="",this.loading=!1,this.searchAbortController&&this.searchAbortController.abort();return}this.showSuggest=!1,this.getSearchResult(this.query)},handleChangeProductType(){this.query!==""&&this.getSearchResult(this.query)},getSearchResult(query){this.isFocusedSearchForm||(this.isFocusedSearchForm=!0),this.openResults=!0;const limit=window.innerWidth>=MIN_DEVICE_WIDTH.tablet?desktopMaximumResults:mobileMaximumResults,searchQuery=this.productTypeSelected!==productTypeSelected?`${this.productTypeSelected} AND ${query}`:query,queryKey=`${searchQuery.replace(" ","-").toLowerCase()}_${limit}`;if(this.searchAbortController&&this.searchAbortController.abort(),this.cachedResults[queryKey]){this.result=this.cachedResults[queryKey],this.loading=!1;return}const searchParams=new URLSearchParams({q:searchQuery,"resources[type]":type,"resources[options][fields]":"author,body,product_type,tag,title,variants.barcode,variants.sku,variants.title,vendor","resources[limit]":limit,section_id:"predictive-search"}),requestId=this.searchRequestId+1;this.searchRequestId=requestId,this.searchAbortController=new AbortController,this.loading=!0,fetch(`${Shopify.routes.root}search/suggest?${searchParams.toString()}`,{signal:this.searchAbortController.signal}).then(response=>{if(!response.ok)throw new Error("");return response.text()}).then(response=>{if(requestId!==this.searchRequestId)return;const text=new DOMParser().parseFromString(response,"text/html");this.result=text.querySelector("#shopify-section-predictive-search")?.innerHTML,this.cachedResults[queryKey]=this.result}).catch(error=>{if(error.name!=="AbortError")throw error}).finally(()=>{requestId===this.searchRequestId&&(this.loading=!1,this.searchAbortController=null)})},fetchRefinedSearch(){this.loadingProductType!=="loaded"&&(this.loadingProductType="loading",fetch(`${Shopify.routes.root}?section_id=product-type`).then(response=>{if(!response.ok)throw new Error("");return response.text()}).then(responseText=>{const dataHTML=new DOMParser().parseFromString(responseText,"text/html"),selectOptionWrapper=this.$root.querySelector(".select-options-wrapper"),selectElement=this.$root.querySelector("select-element");selectOptionWrapper&&(selectOptionWrapper.innerHTML=dataHTML.querySelector(".select-options-wrapper")?.innerHTML),selectElement&&(selectElement.optionSelected=selectElement.querySelector('.select-option[aria-selected="true"]'),selectElement.optionsList=selectElement.querySelector(".select-options"),selectElement.handleAddEventItem())}).finally(()=>{this.loadingProductType="loaded"}))},syncSearchLayout(){Alpine.nextTick(()=>{this.$refs.search_content&&(this._syncRafId&&cancelAnimationFrame(this._syncRafId),this._syncRafId=requestAnimationFrame(()=>{const top=this.$refs.search_bar_fixed.getBoundingClientRect().bottom;top>0&&this.$refs.search_content.style.setProperty("--input-search-to-top",`${top}px`),this._syncRafId=null}))})},setProductType(el,defaultType){this.productTypeSelected=defaultType?productTypeSelected:el.textContent.trim(),this.query!=""&&this.get
1SearchResult(this.query)},focusForm(){this.$refs.close_button&&(document.body.classList.add("overflow-hidden"),this.$refs.close_button.classList.remove("hidden")),this.$root.classList.contains("main-search-form")||this.open(),this.$el.value===""?(this.showSuggest=!0,this.isFocusedSearchForm=!0):(this.query=this.$el.value,this.isFocusedSearchForm=!0,this.openResults=!0,this.showSuggest=!1,this.getSearchResult(this.query))},handleKeyUpModal(event){if(event.key==="Escape"||event.key==="Esc"){event.preventDefault();return}event.key==="Tab"||event.key==="Shift"||(this.query=this.$el.value,clearTimeout(this._keyDebounce),this._keyDebounce=setTimeout(()=>{this.open(),this.query!=""?this.showSuggest=!1:(this.showSuggest=!0,this.result="")},300))}})),Alpine.data("xFreeShipping",sectionId=>({init(){document.addEventListener(`${CART_EVENT.cartUpdate}`,e=>{fetch(`${window.location.pathname}?section_id=${sectionId}`).then(response=>response.text()).then(response=>{const newContent=new DOMParser().parseFromString(response,"text/html").getElementById("announcement-free-shipping");this.$el.innerHTML=newContent.innerHTML})})}})),Alpine.data("xCollapsibleTab",initIsOpen=>({isOpenCollapsible:initIsOpen,init(){if(!initIsOpen){let collapsibleContentEle=this.$el.querySelector(".collapsible-tab__content");collapsibleContentEle&&collapsibleContentEle.classList.remove("hidden")}},handleToggleTab:function(){this.isOpenCollapsible=!this.isOpenCollapsible}})),Alpine.data("xMediaModel",()=>({MAX_RETRIES_WAIT_SCROLL_END:50,loaded:!1,handleInit(){this.loaded=!0,window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:this.__setUpShopifyXR.bind(this)}])},handleLoadModel(){let container=this.$el.parentNode;const content=document.createElement("div");content.appendChild(container.querySelector("template").content.firstElementChild.cloneNode(!0)),this.$el.classList.add("hidden"),container.appendChild(content.querySelector("model-viewer")),this.__loadViewerUI()},handlePauseViewer(){this.$el.modelViewerUI&&this.$el.modelViewerUI.pause()},__setUpShopifyXR(){const setup=()=>{document.querySelectorAll('[id^="ProductJSON-"]').forEach(modelJSON=>{window.ShopifyXR.addModels(JSON.parse(modelJSON.textContent)),modelJSON.remove()}),window.ShopifyXR.setupXRElements()};if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",()=>{setup()});return}setup()},__loadViewerUI(){window.Shopify.loadFeatures([{name:"model-viewer-ui",version:"1.0",onLoad:this.__setUpViewerUI.bind(this)}])},__setUpViewerUI(errors){errors||(this.$el.parentNode.modelViewerUI=new Shopify.ModelViewerUI(this.$el.parentNode.querySelector("model-viewer")))},waitScrollEndedOnDesktop(callback){let count=0;const isMobile=window.innerWidth<MIN_DEVICE_WIDTH.tablet,galleryWrapperDataset=this.$el.closest(".media-gallery__wrapper")?.dataset,intervalId=setInterval(()=>{if(isMobile||galleryWrapperDataset?.isScrollingOnDesktop!="true"||count>=this.MAX_RETRIES_WAIT_SCROLL_END){galleryWrapperDataset&&(galleryWrapperDataset.isScrollingOnDesktop="false"),clearInterval(intervalId),callback();return}count++},TIMEOUT.scrollIdle)},initModelInSlideEffect(){this.waitScrollEndedOnDesktop(()=>{const mediaitem=this.$el.closest(".media-gallery__media-item");this.loaded||!mediaitem.classList.contains("is-active-in-two-columns")||(this.handleInit(),this.handleLoadModel())}),document.addEventListener(`${PRODUCT_MEDIA_EVENT.show_model}-${this.$el.dataset.mediaId}`,event=>{this.loaded||(window.innerWidth>=MIN_DEVICE_WIDTH.tablet?this.waitScrollEndedOnDesktop(()=>{this.loaded||(this.handleInit(),this.handleLoadModel())}):(this.handleInit(),this.handleLoadModel()))})}}))})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xCustomerEvent",{fire(eventName,el,data){if(Shopify.designMode)return;const formatedData=data||xParseJSON(el.dataset.customEvent);Shopify.analytics.publish(eventName,formatedData)}}),Alpine.store("xEstimateDelivery",{hour:0,minute:0,notification:"",countdownCutOffTime(cutOffTime,hrsText,minusText){if(this.notification!="")return;const now=new Date,currentHour=now.getHours(),currentMinute=now.getMinutes(),cutOffHour=cutOffTime.length>=3?parseInt(cutOffTime.slice(0,-2),10):0,cutOffMinute=cutOffTime.length>
1=3?parseInt(cutOffTime.slice(-2),10):0,current=new Date(now.getFullYear(),now.getMonth(),now.getDate(),currentHour,currentMinute),cutOff=new Date(now.getFullYear(),now.getMonth(),now.getDate(),cutOffHour,cutOffMinute);current>=cutOff&&cutOff.setDate(cutOff.getDate()+1);const diffMs=cutOff-current;return this.hour=Math.floor(diffMs/1e3/60/60),this.minute=Math.floor(diffMs/1e3/60%60),this.hour>0?this.notification=this.hour+" "+hrsText+" "+this.minute+" "+minusText:this.notification=this.minute+" "+minusText}})})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xScrollPromotion",{load(el){let scroll=el.getElementsByClassName("el_animate");for(let i=0;i<scroll.length;i++)scroll[i].classList.add("animate-scroll-banner")}})})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xResizeHandler",{callbacks:[],triggerResize:null,debounce(func,delay){let timer;return function(...args){clearTimeout(timer),timer=setTimeout(()=>func.apply(this,args),delay)}},register(callback,allowDuplicateFuntc,...params){allowDuplicateFuntc?this.callbacks.push({callback,params}):this.callbacks.find(item=>item.callback===callback)||this.callbacks.push({callback,params})},unregister(callback){this.callbacks=this.callbacks.filter(item=>item.callback!==callback)},init(){this.triggerResize=this.debounce(()=>{this.callbacks.forEach(({callback,params})=>{callback(...params)})},50),window.addEventListener("resize",this.triggerResize)}})})});function maximizeParseJSON(jsonString){return jsonString=String.raw`${jsonString}`,jsonString=jsonString.replaceAll("\\","\\\\").replaceAll('\\"','"'),JSON.parse(jsonString)}requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xProductDrawer",()=>({isShowDrawer:!1,openDrawer(idBlockDrawer){this.isShowDrawer=!0,Alpine.store("xMaximizeDrawer").handleOpen(idBlockDrawer)},closeDrawer(closeQuickView=!1){Alpine.store("xFocusElement").removeTrapFocus(),this.isShowDrawer=!1;let closeAllDrawer=!0;const isShowQuickView=Alpine.store("xQuickView")&&Alpine.store("xQuickView").show;isShowQuickView&&(!closeQuickView||window.innerWidth<MIN_DEVICE_WIDTH.tablet)&&(closeAllDrawer=!1),Alpine.store("xMaximizeDrawer").handleClose(closeAllDrawer),isShowQuickView&&closeQuickView&&window.innerWidth>=MIN_DEVICE_WIDTH.tablet&&Alpine.store("xQuickView").close()}}))})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.store("xStoreMap",{currentStoreSelected:JSON.parse(localStorage.getItem("currentStoreSelected"))?.selectedStore||"",getStore(){if(this.currentStoreSelected)return this.currentStoreSelected.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")},getStoreText(){if(this.currentStoreSelected!=="")return this.currentStoreSelected},checkAvailability(storeAvailabilities){let store=this.getStore();if(storeAvailabilities)return storeAvailabilities[store]},dispatchEventOpenPopup(){document.dispatchEvent(new CustomEvent(`${STORE_MAP_EVENT.openPopup}`))}})})}),requestAnimationFrame(()=>{document.addEventListener("alpine:init",()=>{Alpine.data("xContactForm",formId=>({isFormValid:!1,formId,emailTouched:!1,get form(){return this.$el?this.$el.querySelector(`#${this.formId}`):null},get emailInput(){return this.form?this.form.querySelector('input[name="contact[email]"]'):null},get emailValidationMessage(){return this.form?this.form.querySelector(`.contact-form__email-error-${this.formId}`):null},init(){this.form&&(this.validateForm(),this.emailInput&&this.emailInput.addEventListener("input",()=>{this.emailTouched=!0,this.validateForm()}),this.$el.addEventListener(SELECT_ELEMENT_EVENT.change,()=>{this.validateForm()}),this.initRequestTypeNote())},validateForm(){const form=this.form;if(!form)return;let isValid=!0;if(form.querySelectorAll("input[required], textarea[required]").forEach(field=>{field.classList.contains("input-checkbox")||field.classList.contains("content")&&field.closest(".multi-select")||(!field.value||!field.value.trim())&&(isValid=!1)}),this.emailInput){const isEmpty=!this.emailInput.value.trim(),isRequired=this.emailInput.hasAttribute("required"),validation=validateEmail(this.emailInput.value),isRequiredError=isEmpty&&isRequired,isFormatError=validation.isInvalid,hasError=isRequiredError||isFormatError||validation.isError,errorMessage=isRequiredError?window.Maximize?.formTranslations?.emailRequiredMessage:isFormatError?window.Maximize?.formTranslations?.emailInvalidMessage:"";hasError&&(isValid=!1),this.showMessage(this.emailTouched&&hasError,this.emailValidationMessage,errorMessage)}else{this.isFormValid=!1;return}form.querySelectorAll(".multi-select").forEach(group=>{const contentInput=group.querySelector(".content");
1if(!(contentInput&&contentInput.hasAttribute("required")))return;group.querySelectorAll(".input-checkbox:checked").length===0&&(isValid=!1)}),this.isFormValid=isValid},showMessage(isShow,element,message){element&&(isShow?(element.textContent=message,element.classList.remove("hidden")):element.classList.add("hidden"))},initRequestTypeNote(){const requestTypeRadios=this.form.querySelectorAll(".request-type-radio"),noteSpan=this.form.querySelector(".request-type_note");!requestTypeRadios.length||!noteSpan||(requestTypeRadios.forEach(radio=>{radio.addEventListener("change",()=>this.updateNoteRequestType())}),this.updateNoteRequestType())},updateNoteRequestType(){const noteSpan=this.form.querySelector(".request-type_note");if(!noteSpan)return;const selected=this.form.querySelector(".request-type-radio:checked");if(!selected)return;const text=selected.value==="Return"?noteSpan.dataset.returnText:noteSpan.dataset.cancelText;noteSpan.textContent=text||""}}))})});function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultOption(precision,2),thousands=defaultOption(thousands,","),decimal=defaultOption(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);let parts=number.split("."),dollars=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),cents=parts[1]?decimal+parts[1]:"";return dollars+cents}function defaultOption(opt,def){return typeof opt>"u"?def:opt}function formatMoney(amount,formatString){let placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,value;switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(amount,2);break;case"amount_no_decimals":value=formatWithDelimiters(amount,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(amount,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(amount,0,".",",");break}return formatString.replace(placeholderRegex,value)}window.formatMoney=formatMoney;function debounce(func,wait){let timeout;return function(...args){clearTimeout(timeout),timeout=setTimeout(()=>func.apply(this,args),wait)}}function validateEmail(email){const VALID_REGEX_EMAIL=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)+$/;return email===""?{isError:!0,isRequired:!0}:email.match(VALID_REGEX_EMAIL)?{isError:!1}:{isError:!0,isInvalid:!0}}function getValueCssVariable(varName,element=document.documentElement,shouldConvertToFloat=!1){const value=getComputedStyle(element).getPropertyValue(varName).trim();if(!shouldConvertToFloat)return value;if(!value)return 0;const rootFontSize=parseFloat(getComputedStyle(document.documentElement).fontSize),elementFontSize=parseFloat(getComputedStyle(element).fontSize),numericValue=parseFloat(value);return isNaN(numericValue)?0:value.endsWith("ms")?numericValue:value.endsWith("s")?numericValue*MS_PER_SECOND:value.endsWith("rem")?numericValue*rootFontSize:value.endsWith("em")?numericValue*elementFontSize:numericValue}(function(){let SELECTOR="[data-highlight-class],[data-fade-on-intersect]",observer=new IntersectionObserver(function(entries,obs){entries.forEach(function(entry){if(!entry.isIntersecting)return;let el=entry.target;if(obs.unobserve(el),el.dataset.highlightClass){let delay=parseInt(el.dataset.highlightDelay,10)||0;delay?setTimeout(function(){el.classList.add(el.dataset.highlightClass)},delay):el.classList.add(el.dataset.highlightClass)}"fadeOnIntersect"in el.dataset&&el.classList.add("is-visible")})},{rootMargin:"0px 0px -20px 0px"});function applyInViewport(root){let vh=window.innerHeight,toShow=[],toObserve=[];(root||document).querySelectorAll(SELECTOR).forEach(function(el){if(el.dataset.fadeObserved)return;let rect=el.getBoundingClientRect();rect.top<vh&&rect.bottom>0?toShow.push(el):toObserve.push(el)}),toShow.forEach(function(el){el.dataset.fadeObserved="1",el.classList.add("is-visible","transition-none"),el.dataset.highlightClass&&el.classList.add(el.dataset.highlightClass)}),toObserve.forEach(function(el){el.dataset.fadeObserved="1",observer.observe(el)})}function observeAll(root){(root||document).querySelectorAll(SELECTOR).forEac
1h(function(el){el.dataset.fadeObserved||(el.dataset.fadeObserved="1",observer.observe(el))})}applyInViewport(),document.addEventListener("alpine:initialized",function(){observeAll(),window.xCartHelper&&window.xCartHelper.handleSharedCart(),requestAnimationFrame(function(){let header=document.querySelector(".opacity-main-header");header&&header.classList.remove("opacity-main-header")})}),new MutationObserver(function(mutations){for(let i=0;i<mutations.length;i++){let added=mutations[i].addedNodes;for(let j=0;j<added.length;j++){let node=added[j];node.nodeType===1&&(node.matches(SELECTOR)&&!node.dataset.fadeObserved&&(node.dataset.fadeObserved="1",observer.observe(node)),node.firstElementChild&&node.querySelectorAll(SELECTOR).forEach(function(el){el.dataset.fadeObserved||(el.dataset.fadeObserved="1",observer.observe(el))}))}}}).observe(document.body,{childList:!0,subtree:!0}),window._fadeObserver={observe:observeAll}})(),(function(){if(!document.querySelector(".pickup-message__wrapper"))return;function parsePipeList(str){return(str||"").split("|||").map(function(s){return s.trim()}).filter(Boolean)}function parseAvailMap(str){let map={};return parsePipeList(str).forEach(function(entry){let idx=entry.lastIndexOf("::");idx!==-1&&(map[entry.slice(0,idx)]=entry.slice(idx+2)==="true")}),map}function applyStore(storeName){document.querySelectorAll(".pickup-message__wrapper[data-pickup-locs]").forEach(function(el){if(!storeName){el.style.display="none";return}if(!parsePipeList(el.dataset.pickupLocs).includes(storeName)){el.style.display="none";return}let isAvail=parseAvailMap(el.dataset.pickupAvail)[storeName]===!0;el.style.display="",el.querySelector(".pickup-msg-avail").style.display=isAvail?"":"none",el.querySelector(".pickup-msg-unavail").style.display=isAvail?"none":"",el.querySelectorAll(".pickup-store-name").forEach(function(s){s.textContent=storeName})})}let saved=JSON.parse(localStorage.getItem("currentStoreSelected")||"null");saved&&saved.selectedStore&&applyStore(saved.selectedStore),document.addEventListener("maximize:store-changed",function(e){applyStore(e.detail.store||"")})})();function updateElements(rootEl,dataHTML,selector){const oldElements=rootEl.querySelectorAll(selector),newElements=dataHTML.querySelectorAll(selector),single=newElements.length===1;oldElements.forEach((oldEl,i)=>{const newEl=single?newElements[0]:newElements[i];oldEl&&newEl&&(oldEl.innerHTML=newEl.innerHTML)})} 2//# sourceMappingURL=/cdn/shop/t/41/assets/theme.js.map?v=95089347091857122521787724761
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.