1window.FoxTheme=window.FoxTheme||{},FoxTheme.config={hasLocalStorage:!1,mqlMobile:!1,mqlTablet:!1,mediaQueryMobile:"screen and (max-width: 767px)",mediaQueryTablet:"screen and (max-width: 1023px)",motionReduced:window.matchMedia("(prefers-reduced-motion: reduce)").matches,isTouch:"ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0,isRTL:document.documentElement.getAttribute("dir")==="rtl"},console.log("%c"+window.FoxTheme.settings.themeName+" theme (v"+window.FoxTheme.settings.themeVersion+") by Foxecom | Learn more https://foxecom.com/products/sleek-shopify-theme","font-size: 14px; color: #FF5C00;"),(function(){try{const key="sleek:test";window.localStorage.setItem(key,"test"),window.localStorage.removeItem(key),FoxTheme.config.hasLocalStorage=!0}catch{}FoxTheme.DOMready=function(callback){document.readyState!="loading"?callback():document.addEventListener("DOMContentLoaded",callback)},FoxTheme.a11y={trapFocusHandlers:{},getFocusableElements:container=>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")),trapFocus:(container,elementToFocus=container)=>{var elements=FoxTheme.a11y.getFocusableElements(container),first=elements[0],last=elements[elements.length-1];FoxTheme.a11y.removeTrapFocus(),FoxTheme.a11y.trapFocusHandlers.focusin=event=>{event.target!==container&&event.target!==last&&event.target!==first||document.addEventListener("keydown",FoxTheme.a11y.trapFocusHandlers.keydown)},FoxTheme.a11y.trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",FoxTheme.a11y.trapFocusHandlers.keydown)},FoxTheme.a11y.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",FoxTheme.a11y.trapFocusHandlers.focusout),document.addEventListener("focusin",FoxTheme.a11y.trapFocusHandlers.focusin),elementToFocus.focus(),elementToFocus.tagName==="INPUT"&&["search","text","email","url"].includes(elementToFocus.type)&&elementToFocus.value&&elementToFocus.setSelectionRange(0,elementToFocus.value.length)},removeTrapFocus:(elementToFocus=null)=>{document.removeEventListener("focusin",FoxTheme.a11y.trapFocusHandlers.focusin),document.removeEventListener("focusout",FoxTheme.a11y.trapFocusHandlers.focusout),document.removeEventListener("keydown",FoxTheme.a11y.trapFocusHandlers.keydown),elementToFocus&&elementToFocus.focus()}},FoxTheme.utils={throttle:callback=>{let requestId=null,lastArgs;const later=context=>()=>{requestId=null,callback.apply(context,lastArgs)},throttled=(...args)=>{lastArgs=args,requestId===null&&(requestId=requestAnimationFrame(later(this)))};return throttled.cancel=()=>{cancelAnimationFrame(requestId),requestId=null},throttled},setScrollbarWidth:()=>{const scrollbarWidth=window.innerWidth-document.body.clientWidth;scrollbarWidth>0&&document.documentElement.style.setProperty("--scrollbar-width",`${scrollbarWidth}px`)},waitForEvent:(element,eventName)=>new Promise(resolve=>{const eventHandler=event=>{event.target===element&&(element.removeEventListener(eventName,eventHandler),resolve(event))};element.addEventListener(eventName,eventHandler)}),queryDomNodes:(selectors={},context=document)=>Object.entries(selectors).reduce((acc,[name,selector])=>{const findOne=typeof selector=="string",queryMethod=findOne?"querySelector":"querySelectorAll",sl=findOne?selector:selector[0];return acc[name]=context&&context[queryMethod](sl),!findOne&&acc[name]&&(acc[name]=[...acc[name]]),acc},{}),addEventDelegate:({context=document.documentElement,event="click",
1selector,handler,capture=!1})=>{const listener=function(e){for(let target=e.target;target&&target!==this;target=target.parentNode)if(target.matches(selector)){handler.call(target,e,target);break}};return context.addEventListener(event,listener,capture),()=>{context.removeEventListener(event,listener,capture)}},getSectionId:element=>element.hasAttribute("data-section-id")?element.dataset.sectionId:(element.classList.contains("shopify-section")||(element=element.closest(".shopify-section")),element.id.replace("shopify-section-","")),debounce:(fn,wait)=>{let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}},fetchConfig:(type="json",method="POST")=>({method,headers:{"Content-Type":"application/json",Accept:`application/${type}`}}),setStorage(key,value,expiryInDays){if(!FoxTheme.config.hasLocalStorage)return;const item={value,expiry:new Date().getTime()+expiryInDays*864e5};window.localStorage.setItem(key,JSON.stringify(item))},getStorage(key){if(!FoxTheme.config.hasLocalStorage)return null;const itemStr=window.localStorage.getItem(key);if(!itemStr)return null;const item=JSON.parse(itemStr);return new Date().getTime()>item.expiry?(window.localStorage.removeItem(key),null):item.value},postLink:(path,options)=>{options=options||{};const method=options.method||"post",params=options.parameters||{},form=document.createElement("form");form.setAttribute("method",method),form.setAttribute("action",path);for(const key in params)for(const index in params[key])for(const key2 in params[key][index]){const hiddenField=document.createElement("input");hiddenField.setAttribute("type","hidden"),hiddenField.setAttribute("name",`${key}[${index}][${key2}]`),hiddenField.setAttribute("value",params[key][index][key2]),form.appendChild(hiddenField)}document.body.appendChild(form),form.submit(),document.body.removeChild(form)},imageReady:imageOrArray=>imageOrArray?(imageOrArray=imageOrArray instanceof Element?[imageOrArray]:Array.from(imageOrArray),Promise.all(imageOrArray.map(image=>new Promise(resolve=>{image.tagName==="IMG"&&image.complete||!image.offsetParent?resolve():image.onload=()=>resolve()})))):Promise.resolve(),displayedMedia:media=>Array.from(media).find(item=>window.getComputedStyle(item).display!=="none"),getGridColumnGap:container=>{const gapByDevice={},gapCSSVariables={desktop:"--column-gap",tabletLarge:"--column-gap-tablet-large",tablet:"--column-gap-tablet",mobile:"--column-gap-mobile"},computedStyles=window.getComputedStyle(container);for(const[device,cssVar]of Object.entries(gapCSSVariables)){const match=computedStyles.getPropertyValue(cssVar).trim().match(/^(\d*\.?\d+)(px|rem)$/);let numericGap=0;if(match){const[originalValue,numberStr,unit]=match;numericGap=unit==="rem"?parseFloat(numberStr)*10:parseFloat(numberStr)}gapByDevice[device]=numericGap}return gapByDevice}},FoxTheme.pubsub={PUB_SUB_EVENTS:{cartUpdate:"cart-update",quantityUpdate:"quantity-update",quantityRules:"quantity-rules",quantityBoundries:"quantity-boundries",variantChange:"variant-change",cartError:"cart-error",facetUpdate:"facet-update",optionValueSelectionChange:"option-value-selection-change"},subscribers:{},subscribe:(eventName,callback)=>(FoxTheme.pubsub.subscribers[eventName]===void 0&&(FoxTheme.pubsub.subscribers[eventName]=[]),FoxTheme.pubsub.subscribers[eventName]=[...FoxTheme.pubsub.subscribers[eventName],callback],function(){FoxTheme.pubsub.subscribers[eventName]=FoxTheme.pubsub.subscribers[eventName].filter(cb=>cb!==callback)}),publish:(eventName,data)=>{FoxTheme.pubsub.subscribers[eventName]&&FoxTheme.pubsub.subscribers[eventName].forEach(callback=>{callback(data)})}},FoxTheme.focusVisiblePolyfill=function(){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)},FoxTheme.Carousel=(function(){class Carousel{constructor(container,options,modules=null){this.container=container;let defaultModules=[FoxTheme.Swiper.Navigation,FoxTheme.Swiper.Pagination,FoxTheme.Swiper.Keyboard,FoxTheme.Swiper.Mousewheel];modules&&(defaultModules=defaultModules.concat(modules)),this.options={modules:defaultModules,...options}}init(){this.slider=new FoxTheme.Swiper.Swiper(this.container,this.options)}}return Carousel})(),FoxTheme.delayUntilInteraction=(function(){class ScriptLoader{constructor(callback,delay=5e3){this.loadScriptTimer=setTimeout(callback,delay),this.userInteractionEvents=["mouseover","mousemove","keydown","touchstart","touchend","touchmove","wheel"],this.onScriptLoader=this.triggerScriptLoader.bind(this,callback),this.userInteractionEvents.forEac
1h(event=>{window.addEventListener(event,this.onScriptLoader,{passive:!0})})}triggerScriptLoader(callback){callback(),clearTimeout(this.loadScriptTimer),this.userInteractionEvents.forEach(event=>{window.removeEventListener(event,this.onScriptLoader,{passive:!0})})}}return ScriptLoader})(),FoxTheme.Currency=(function(){const moneyFormat="${{amount}}";function formatMoney(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));let value="";const placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||moneyFormat;function formatWithDelimiters(number,precision,thousands,decimal){if(thousands=thousands||",",decimal=decimal||".",isNaN(number)||number===null)return 0;number=(number/100).toFixed(precision);const parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break;case"amount_with_apostrophe_separator":value=formatWithDelimiters(cents,2,"'");break}return formatString.replace(placeholderRegex,value)}function getBaseUnit(variant){if(variant&&!(!variant.unit_price_measurement||!variant.unit_price_measurement.reference_value))return variant.unit_price_measurement.reference_value===1?variant.unit_price_measurement.reference_unit:variant.unit_price_measurement.reference_value+variant.unit_price_measurement.reference_unit}return{formatMoney,getBaseUnit}})(),new FoxTheme.delayUntilInteraction(()=>{document.body.removeAttribute("data-initializing")}),FoxTheme.DOMready(FoxTheme.utils.setScrollbarWidth);const mql=window.matchMedia(FoxTheme.config.mediaQueryMobile);FoxTheme.config.mqlMobile=mql.matches,mql.onchange=event=>{event.matches?(FoxTheme.config.mqlMobile=!0,document.dispatchEvent(new CustomEvent("matchMobile"))):(FoxTheme.config.mqlMobile=!1,document.dispatchEvent(new CustomEvent("unmatchMobile")))};const mqlTablet=window.matchMedia(FoxTheme.config.mediaQueryTablet);FoxTheme.config.mqlTablet=mqlTablet.matches,mqlTablet.onchange=event=>{event.matches?(FoxTheme.config.mqlTablet=!0,document.dispatchEvent(new CustomEvent("matchTablet"))):(FoxTheme.config.mqlTablet=!1,document.dispatchEvent(new CustomEvent("unmatchTablet")))}})();try{document.querySelector(":focus-visible")}catch{FoxTheme.focusVisiblePolyfill()}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()})}class HTMLUpdateUtility{static viewTransition(oldNode,newContent,preProcessCallbacks=[],postProcessCallbacks=[]){if(!oldNode||!newContent)return;preProcessCallbacks?.forEach(callback=>callback(newContent));const newNodeWrapper=document.createElement("div");HTMLUpdateUtility.setInnerHTML(newNodeWrapper,newContent.outerHTML);const newNode=newNodeWrapper.firstChild,uniqueKey=Date.now();oldNode.querySelectorAll("[id], [form]").forEach(element=>{element.id&&(element.id=`${element.id}-${uniqueKey}`),element.form&&element.setAttribute("form",`${element.form.getAttribute("id")}-${uniqueKey}`)}),oldNode.parentNode.insertBefore(newNode,oldNode),oldNode.style.display="none",postProcessCallbacks?.forEach(callback=>callback(newNode)),setTimeout(()=>oldNode.remove(),500)}static setInnerHTML(element,html){element.innerHTML=html,element.querySelectorAll("script").forEach(oldScriptTag=>{const newScriptTag=document.createElement("script");
1Array.from(oldScriptTag.attributes).forEach(attribute=>{newScriptTag.setAttribute(attribute.name,attribute.value)}),newScriptTag.appendChild(document.createTextNode(oldScriptTag.innerHTML)),oldScriptTag.parentNode.replaceChild(newScriptTag,oldScriptTag)})}}class PageTransition extends HTMLElement{constructor(){super(),window.addEventListener("beforeunload",()=>{document.body.classList.add("page-loading")}),window.addEventListener("DOMContentLoaded",()=>{FoxTheme.Motion.animate(this,{visibility:"hidden",opacity:0},{duration:1}),document.body.classList.add("page-loaded"),document.dispatchEvent(new CustomEvent("page:loaded"))}),window.addEventListener("pageshow",event=>{event.persisted&&document.body.classList.remove("page-loading")})}}customElements.define("page-transition",PageTransition);const clearModalComponentCount=new WeakMap;class ModalComponent extends HTMLElement{constructor(){super(),this.events={handleAfterHide:"modal:handleAfterHide",handleAfterShow:"modal:handleAfterShow"},this.classes={show:"modal-show",showing:"modal-showing"}}static get observedAttributes(){return["id","open"]}get isLockingNeeded(){return!1}get requiresBodyAppended(){return!1}get controls(){return Array.from(document.querySelectorAll(`[aria-controls="${this.id}"]`))}get designMode(){return this.hasAttribute("shopify-design-mode")}get open(){return this.hasAttribute("open")}get overlay(){return this._overlay||(this._overlay=this.querySelector(".fixed-overlay")),this._overlay}get focusElement(){const button=this.querySelector("button");return button||FoxTheme.a11y.getFocusableElements(this)[0]||this}connectedCallback(){if(this.abortController=new AbortController,this.controls.forEach(button=>{button.addEventListener("click",this.onButtonClick.bind(this),{signal:this.abortController.signal})}),document.addEventListener("keyup",event=>{event.code==="Escape"&&this.hide()},{signal:this.abortController.signal}),this.designMode&&Shopify.designMode){const section=this.closest(".shopify-section");section.addEventListener("shopify:section:select",event=>{this.show(null,!event.detail.load)},{signal:this.abortController.signal}),section.addEventListener("shopify:section:deselect",()=>{this.hide()},{signal:this.abortController.signal})}}disconnectedCallback(){this.abortController.abort()}attributeChangedCallback(name,oldValue,newValue){name==="open"&&(this.controls.forEach(button=>button.setAttribute("aria-expanded",newValue===null?"false":"true")),oldValue===null&&(newValue===""||newValue==="immediate")?(this.hidden=!1,this.removeAttribute("inert"),this.parentElementBeforeAppend=null,this.requiresBodyAppended&&this.parentElement!==document.body&&(this.parentElementBeforeAppend=this.parentElement,document.body.append(this)),(this.handleShowTransition(newValue!=="immediate")||Promise.resolve()).then(()=>{this.handleAfterShow(),this.dispatchEvent(new CustomEvent(this.events.handleAfterShow,{bubbles:!0}))})):oldValue!==null&&newValue===null&&(this.setAttribute("inert",""),(this.handleHideTransition()||Promise.resolve()).then(()=>{this.handleAfterHide(),this.hasAttribute("inert")&&(this.parentElement===document.body&&this.parentElementBeforeAppend&&(this.parentElementBeforeAppend.appendChild(this),this.parentElementBeforeAppend=null),this.dispatchEvent(new CustomEvent(this.events.handleAfterHide,{bubbles:!0})),this.hidden=!0)})),this.dispatchEvent(new CustomEvent("toggle",{bubbles:!0})))}onButtonClick(event){event.preventDefault(),this.open?this.hide():this.show(event.currentTarget)}hide(){if(this.open)return this.removeAttribute("open"),FoxTheme.utils.waitForEvent(this,this.events.handleAfterHide)}show(activeElement=null,animate=!0){if(this.shouleBeShow()&&!this.open)return this.prepareToShow(),this.activeElement=activeElement,this.setAttribute("open",animate?"":"immediate"),this.isLockingNeeded&&document.body.classList.add(this.classes.showing),FoxTheme.utils.waitForEvent(this,this.events.handleAfterShow)}handleAfterHide(){setTimeout(()=>{if(FoxTheme.a11y.removeTrapFocus(this.activeElement),this.isLockingNeeded){const currentModalCount=clearModalComponentCount.get(ModalComponent)-1;
1clearModalComponentCount.set(ModalComponent,currentModalCount),document.body.classList.toggle(this.classes.show,currentModalCount>0)}})}handleAfterShow(){if(FoxTheme.a11y.trapFocus(this,this.focusElement),this.isLockingNeeded){const currentLockCount=clearModalComponentCount.get(ModalComponent)+1;clearModalComponentCount.set(ModalComponent,currentLockCount),document.body.classList.remove(this.classes.showing),document.body.classList.add(this.classes.show)}}shouleBeShow(){return!0}prepareToShow(){}handleShowTransition(){return setTimeout(()=>{this.setAttribute("active","")},75),new Promise(resolve=>{this.overlay.addEventListener("transitionend",resolve,{once:!0})})}handleHideTransition(){return this.removeAttribute("active"),new Promise(resolve=>{this.overlay.addEventListener("transitionend",resolve,{once:!0})})}}customElements.define("modal-component",ModalComponent),clearModalComponentCount.set(ModalComponent,0);class BasicModal extends ModalComponent{constructor(){super()}get isLockingNeeded(){return!0}get requiresBodyAppended(){return!0}}customElements.define("basic-modal",BasicModal);class DrawerComponent extends ModalComponent{constructor(){super(),this.events={handleAfterHide:"drawer:handleAfterHide",handleAfterShow:"drawer:handleAfterShow"}}get isLockingNeeded(){return!0}get requiresBodyAppended(){return!0}}customElements.define("drawer-component",DrawerComponent);class AccordionDetails extends HTMLDetailsElement{constructor(){super(),this.initAccordion()}initAccordion(){this.isOpen=this.hasAttribute("open"),this.summaryElement=this.querySelector("summary"),this.contentElement=this.querySelector("summary + *"),this.setAttribute("aria-expanded",this.isOpen?"true":"false"),this.summaryElement.addEventListener("click",this.toggleAccordion.bind(this)),Shopify.designMode&&this.designModeEventSetup()}static get observedAttributes(){return["open"]}get open(){return this.isOpen}set open(value){value!==this.isOpen&&(this.isOpen=value,this.isConnected?this.animateAccordion(value):value?this.setAttribute("open",""):this.removeAttribute("open"),this.setAttribute("aria-expanded",value?"true":"false"),this.setAttribute("aria-controls",this.contentElement.id),this.handleAfterToggle())}handleAfterToggle(){}handleAfterAnimated(){}toggleAccordion(event){event.preventDefault(),this.open=!this.open}close(){this.isOpen=!1,this.animateAccordion(!1)}async animateAccordion(isOpen){this.style.overflow="hidden",isOpen?(this.setAttribute("open",""),await Fo
1xTheme.Motion.timeline([[this,{height:[`${this.summaryElement.clientHeight+1}px`,`${this.scrollHeight+1}px`]},{duration:.25,easing:"ease"}],[this.contentElement,{opacity:[0,1],transform:["translateY(10px)","translateY(0)"]},{duration:.15,at:"<"}]]).finished):(await FoxTheme.Motion.timeline([[this.contentElement,{opacity:0},{duration:.15}],[this,{height:[`${this.clientHeight+1}px`,`${this.summaryElement.clientHeight+1}px`]},{duration:.25,at:"<",easing:"ease"}]]).finished,this.removeAttribute("open")),this.style.height="auto",this.style.overflow="visible",this.handleAfterAnimated()}designModeEventSetup(){this.addEventListener("shopify:block:select",()=>{this.open=!0}),this.addEventListener("shopify:block:deselect",()=>{this.open=!1})}attributeChangedCallback(name,oldValue,newValue){name==="open"&&this.setAttribute("aria-controls",this.contentElement.id)}}customElements.define("accordion-details",AccordionDetails,{extends:"details"});class AccordionGroup extends AccordionDetails{constructor(){super()}handleAfterToggle(){this.isOpen&&(this.closest(".accordion-parent")||document).querySelectorAll('details[is="accordion-group"]').forEach(details=>{details!==this&&(details.open=!1)})}}customElements.define("accordion-group",AccordionGroup,{extends:"details"});class ProgressBar extends HTMLElement{constructor(){super(),!this.hasAttribute("style")&&(this.dataset.from&&this.initProgress(),FoxTheme.Motion.inView(this,this.init.bind(this)))}init(){this.setPercentage(this.dataset.value,this.dataset.max)}initProgress(){this.setPercentage(this.dataset.from,this.dataset.max)}setPercentage(val1,val2){this.style.setProperty("--percent",`${parseInt(val1)/parseInt(val2)*100}%`)}}customElements.define("progress-bar",ProgressBar);class CartCount extends HTMLElement{constructor(){super()}cartUpdateUnsubscriber=void 0;connectedCallback(){this.cartUpdateUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.cartUpdate,this.onCartUpdate.bind(this))}disconnectedCallback(){this.cartUpdateUnsubscriber&&this.cartUpdateUnsubscriber()}get itemCount(){return parseInt(this.innerText)}onCartUpdate(event){if(event.cart.errors)return;event.cart.item_count>99?(this.innerHTML='<span class="text-sm">99+</span>',this.classList.add("cart-count--small-medium")):(this.innerText=event.cart.item_count,this.classList.remove("cart-count--small-medium")),this.hidden=this.itemCount===0;const method=this.itemCount===0?"remove":"add";document.documentElement.classList[method]("cart-has-items")}}customElements.define("cart-count",CartCount);class QuantityInput extends HTMLElement{quantityUpdateUnsubscriber=void 0;quantityBoundriesUnsubscriber=void 0;quantityRulesUnsubscriber=void 0;constructor(){super()}get sectionId(){return this.getAttribute("data-section-id")}get productId(){return this.getAttribute("data-product-id")}get input(){return this.querySelector("input")}get value(){return this.input.value}connectedCallback(){this.abortController=new AbortController,this.buttons=Array.from(this.querySelectorAll("button")),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.input.addEventListener("focus",()=>setTimeout(()=>this.input.select())),this.buttons.forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)),{signal:this.abortController.signal}),this.validateQtyRules(),this.quantityUpdateUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this)),this.quantityBoundriesUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.quantityBoundries,this.setQuantityBoundries.bind(this)),this.quantityRulesUnsubscriber=FoxTheme.pubsub.subscribe(FoxTheme.pubsub.PUB_SUB_EVENTS.quantityRules,this.updateQuantityRules.bind(this)),this.currentValue=this.value}disconnectedCallback(){this.abortController.abort(),this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber(),this.quantityBoundriesUnsubscriber&&this.quantityBoundriesUnsubscriber(),this.quantityRulesUnsubscriber&&this.quantityRulesUnsubscriber()}onButtonClick(event){const previousValue=this.input.value;event.currentTarget.name==="plus"?parseInt(this.input.getAttribute("data-min"))>parseInt(this.input.step)&&this.input.value==0?this.input.value=this.input.getAttribute("data-min"):this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent),this.input.getAttribute("data-min")===previousValue&&event.currentTarget.name==="minus"&&(this.input.value=parseInt(this.input.min))}onInputChange(){this.input.value===""&&(this.input.value=parseInt(this.input.min)),setTimeout(()=>{this.validateQtyRules()},350)}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min){const buttonMinus=this.querySelector('button[name="minus"]');buttonMinus&&buttonMinus.toggleAttribute("disabled",parseInt(value)<=parseInt(this.input.min))}if(this.input.max){const buttonPlus=this.querySelector('button[name="plus"]');buttonPlus&&buttonPlus.toggleAttribute("disabled",parseInt(value)>=parseInt(this.input.max))}else{const buttonPlus=this.querySelector('button[name="plus"]');buttonPlus&&buttonPlus.removeAttribute("disabled")}}updateQuantityRules({data:{sectionId,productId,parsedHTML}}){if(sectionId!==this.sectionId||productId!==this.productId)return;const findElementById=(container,id)=>{let element=container.getElementById?container.getElementById(id):container.querySelector(`#${id}`);if(!element){const templates=container.querySelectorAll("template");for(const template of templates)if(element=template.content.getElementById?template.content.getElementById(id):template.content.querySelector(`#${id}`),element)break}return element},selectors=[".quantity__input",".quantity__rules",".quantity__label"],quantityFormUpdated=findElementById(parsedHTML,`QuantityForm-${sectionId}`),quantityForm=this.closest(`#QuantityForm-${sectionId}`);if(!quantityFormUpdated){console.warn(`QuantityForm-${sectionId} not found in parsedHTML`);return}for(let selector of selectors){const current=quantityForm.querySelector(selector),updated=quantityFormUpdated.querySelector(selector);if(!(!current||!updated))if(selector===".quantity__input"){const attributes=["data-cart-quantity","data-min","data-max","step"];for(let attribute of attributes){const valueUpdated=updated.getAttribute(attribute);valueUpdated!==null?current.setAttribute(attribute,valueUpdated):current.removeAttribute(attribute)}}else current.innerHTML=updated.innerHTML}}setQuantityBoundries({data:{sectionId,productId}}){if(sectionId!==this.sectionId||productId!==this.productId)return;const data={cartQuantity:this.input.hasAttribute("data-cart-quantity")?parseInt(this.input.getAttribute("data-cart-quantity")):0,min:this.input.hasAttribute("data-min")?parseInt(this.input.getAttribute("data-min")):1,max:this.input.hasAttribute("data-max")?parseInt(this.input.getAttribute("data-max")):null,step:this.input.hasAttribute("step")?parseInt(this.input.getAttribute("step")):1};let min=data.min;const max=data.max===null?data.max:data.max-data.cartQuantity;max!==null&&(min=Math.min(min,max)),data.cartQuantity>=data.min&&(min=Math.min(min,data.step)),this.input.min=min,max?this.input.max=max:this.input.removeAttribute("max"),this.input.value=min,FoxTheme.pubsub.publish(FoxTheme.pubsub.PUB_SUB_EVENTS.quantityUpdate,void 0)}}customElements.define("quantity-input",QuantityInput);class QuantitySelector extends HTMLElement{constructor(){super()}connectedCallback(){this.abortController=new AbortController,this.input=this.querySelector("input"),this.buttons=Array.from(this.querySelectorAll("button")),this.changeEvent=ne
1w Event("change",{bubbles:!0}),this.buttons.forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)),{signal:this.abortController.signal})}disconnectedCallback(){this.abortController.abort()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.currentTarget.name==="plus"?this.input.quantity=this.input.quantity+1:this.input.quantity=this.input.quantity-1,previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}}customElements.define("quantity-selector",QuantitySelector);const onYouTubeApiLoaded=new Promise(resolve=>{window.onYouTubeIframeAPIReady=()=>resolve()});class VideoElement extends HTMLElement{constructor(){super(),this.posterElement&&this.posterElement.addEventListener("click",this.handlePosterClick.bind(this)),this.autoplay&&FoxTheme.Motion.inView(this,()=>(this.paused||this.play(),()=>{this.pause()}))}get posterElement(){return this.querySelector('[id^="DeferredPoster-"]')}get controlledElement(){return this.hasAttribute("aria-controls")?document.getElementById(this.getAttribute("aria-controls")):null}get autoplay(){return this.hasAttribute("autoplay")}get playing(){return this.hasAttribute("playing")}get player(){return this.playerProxy=this.playerProxy||new Proxy(this.initializePlayer(),{get:(target,prop)=>async()=>{target=await target,this.handlePlayerAction(target,prop)}})}static get observedAttributes(){return["playing"]}handlePosterClick(event){event.preventDefault(),event.stopPropagation(),this.playing?(this.paused=!0,this.pause()):(this.paused=!1,this.play())}play(){this.playing||this.player.play()}pause(){this.playing&&this.player.pause()}attributeChangedCallback(name,oldValue,newValue){if(name==="playing"){if(oldValue===null&&newValue==="")return this.dispatchEvent(new CustomEvent("video:play",{bubbles:!0}));if(newValue===null)return this.dispatchEvent(new CustomEvent("video:pause",{bubbles:!0}))}}initializePlayer(){if(this.hasAttribute("source"))return this.setAttribute("loaded",""),this.closest(".media")?.classList.remove("loading"),new Promise(async resolve=>{const templateElement=this.querySelector("template");templateElement&&templateElement.replaceWith(templateElement.content.firstElementChild.cloneNode(!0));const muteVideo=this.hasAttribute("autoplay")||window.matchMedia("screen and (max-width: 1023px)").matches,script=document.createElement("script");if(script.type="text/javascript",this.getAttribute("source")==="youtube"){(!window.YT||!window.YT.Player)&&(script.src="https://www.youtube.com/iframe_api",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2})),await onYouTubeApiLoaded;const player=new YT.Player(this.querySelector("iframe"),{events:{onReady:()=>{muteVideo&&player.mute(),resolve(player)},onStateChange:event=>{event.data===YT.PlayerState.PLAYING?this.setAttribute("playing",""):(event.data===YT.PlayerState.ENDED||event.data===YT.PlayerState.PAUSED)&&this.removeAttribute("playing")}}})}if(this.getAttribute("source")==="vimeo"){(!window.Vimeo||!window.Vimeo.Player)&&(script.src="https://player.vimeo.com/api/player.js",document.head.appendChild(script),await new Promise(resolve2=>{script.onload=resolve2}));const player=new Vimeo.Player(this.querySelector("iframe"));muteVideo&&player.setMuted(!0),player.on("play",()=>{this.setAttribute("playing","")}),player.on("pause",()=>this.removeAttribute("playing")),player.on("ended",()=>this.removeAttribute("playing")),resolve(player)}});{this.appendChild(this.querySelector("template").content.firstElementChild.cloneNode(!0)),this.setAttribute("loaded",""),this.closest(".media")?.classList.remove("loading");const player=this.querySelector("video");return player.addEventListener("play",()=>{this.setAttribute("playing",""),this.removeAttribute("suspended")}),player.addEventListener("pause",()=>{!player.seeking&&player.paused&&this.removeAttribute("playing")}),player}}handlePlayerAction(target,prop){this.getAttribute("source")==="youtube"?prop==="play"?target.playVideo():target.pauseVideo():prop==="play"&&!this.hasAttribute("source")?target.play().catch(error=>{if(error.name==="NotAllowedError"){this.setAttribute("suspended",""),target.controls=!0;const replacementImageSrc=target.previousElementSibling?.currentSrc;replacementImageSrc&&(target.poster=replacementImageSrc)}}):target[prop]()}}customElements.define("video-element",VideoElement);class LocalizationForm extends HTMLElement{constructor(){super(),this.elements={input:this.querySelector('input[name="locale_code"], input[name="country_code"]'),button:this.querySelector("button"),panel:this.querySelector(".disclosure-list")},this.elements.panel.removeAttribute("hidden"),this.elements.button.addEventListener("click",this.openSelector.bind(this)),this.elements.button.addEventListener("focusout",this.closeSelector.bind(this)),this.addEventListener("keyup",this.onContainerKeyUp.bind(this)),this.querySelectorAll("a").forEach(item=>item.addEventListener("click",this.onItemClick.bind(this))),this.handleDropdownPos()}handleDropdownPos(){const offsetButton=this.elements.button.getBoundingClientRect().right;window.innerWidth-offsetButton<220&&this.elements.button.nextElementSibling&&this.elements.button.nextElementSibling.classList.add("disclosure-list__right")}hidePanel(){this.elements.button.setAttribute("aria-expanded","fal
1se"),this.removeAttribute("open")}onContainerKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(this.hidePanel(),this.elements.button.focus())}onItemClick(event){event.preventDefault();const form=this.querySelector("form");this.elements.input.value=event.currentTarget.dataset.value,form&&form.submit()}openSelector(){this.elements.button.focus(),this.toggleAttribute("open"),this.elements.button.setAttribute("aria-expanded",(this.elements.button.getAttribute("aria-expanded")==="false").toString())}closeSelector(event){const shouldClose=event.relatedTarget&&event.relatedTarget.nodeName==="BUTTON"||event.relatedTarget&&!event.relatedTarget.classList.contains("disclosure-list__option");(event.relatedTarget===null||shouldClose)&&this.hidePanel(shouldClose)}}customElements.define("localization-form",LocalizationForm);class GridList extends HTMLElement{constructor(){super(),!(FoxTheme.config.motionReduced||this.hasAttribute("motion-reduced"))&&(this.hideGridItems(),FoxTheme.Motion.inView(this,this.showGridItems.bind(this),{margin:"0px 0px -50px 0px"}))}get gridItems(){return this.querySelectorAll(".f-column")}get visibleGridItems(){return this.querySelectorAll(".f-column:not([style])")}hideGridItems(){FoxTheme.Motion.animate(this.gridItems,{transform:"translateY(3.5rem)",opacity:.01,visibility:"hidden"},{duration:0})}showGridItems(){FoxTheme.Motion.animate(this.gridItems,{transform:["translateY(3.5rem)","translateY(0)"],opacity:[.01,1],visibility:["hidden","visible"]},{duration:.5,delay:FoxTheme.config.motionReduced?0:FoxTheme.Motion.stagger(.1),easing:[0,0,.3,1]})}reShowVisibleGridItems(){FoxTheme.Motion.animate(this.visibleGridItems,{transform:["translateY(3.5rem)","translateY(0)"],opacity:[.01,1],visibility:["hidden","visible"]},{duration:.5,delay:FoxTheme.config.motionReduced?0:FoxTheme.Motion.stagger(.1),easing:[0,0,.3,1]})}}customElements.define("grid-list",GridList);class AnnouncementBar extends HTMLElement{constructor(){super(),this.announcementItemsWrapper=this.querySelector(".swiper-wrapper"),FoxTheme.Motion.inView(this,this.initializeCarousel.bind(this),{margin:"200px 0px 200px 0px"})}getNextSlideButton(){return this.querySelector(".swiper-button-next")}getPrevSlideButton(){return this.querySelector(".swiper-button-prev")}get getSlideItems(){return this._cachedSlideItems=this._cachedSlideItems||Array.from(this.announcementItemsWrapper.children)}isAutoplayEnabled(){return this.hasAttribute("autoplay")}getAutoplaySpeed(){return this.hasAttribute("autoplay")?parseInt(this.getAttribute("autoplay-speed"))*1e3:5e3}initializeCarousel(){this.getSlideItems.length>1&&(this.carousel=new FoxTheme.Carousel(this,{navigation:{nextEl:this.getNextSlideButton(),prevEl:this.getPrevSlideButton()},loop:!0,autoplay:this.isAutoplayEnabled()?{delay:this.getAutoplaySpeed(),pauseOnMouseEnter:!0}:!1},FoxTheme.Swiper.Autoplay),this.carousel&&this.carousel.init(),Shopify.designMode&&this.addEventListener("shopify:block:select",event=>{this.carousel.slider.slideToLoop(this.getSlideItems.indexOf(event.target))}))}}customElements.define("announcement-bar",AnnouncementBar);class SelectElement extends HTMLElement{constructor(){super(),FoxTheme.Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"}),this.select=this.querySelector("select"),this.select&&this.select.addEventListener("change",this.handleSelectChange.bind(this))}init(){const style=window.getComputedStyle(this),value=this.select.options[this.select.selectedIndex].text,text=document.createElement("span");text.style.fontFamily=style.fontFamily,text.style.fontSize=style.fontSize,text.style.fontWeight=style.fontWeight,text.style.visibility="hidden",text.style.position="absolute",text.innerHTML=value,document.body.appendChild(text);const width=text.clientWidth;this.style.setProperty("--width",`${width}px`),text.remove()}handleSelectChange(){this.init()}}customElements.define("select-element",SelectElement);class ProductBundleVariantSelector extends HTMLElement{constructor(){super(),this.cssClasses={soldOut:"f-price--sold-out",onSale:"f-price--on-sale",noCompare:"f-price--no-compare"},this.priceElement=this.querySelector(".f-price"),this.variantSelect=this.querySelector("select"),this.variantSelect&&this.variantSelect.addEventListener("change",this.handleVariantChange.bind(this))}handleVariantChange(event){const variantSelect=event.target,selectedVariant=variantSelect.options[variantSelect.selectedIndex],compareAtPrice=parseInt(selectedVariant.dataset.compare_at_price||0),price=parseInt(selectedVariant.dataset.price||0),available=selectedVariant.dataset.available==="true",priceVaries=variantSelect.dataset.price_varies==="true",compareAtPriceVaries=variantSelect.dataset.compare_at_price_varies==="true";
1this.priceElement.classList.remove(this.cssClasses.soldOut),this.priceElement.classList.remove(this.cssClasses.onSale),this.priceElement.classList.remove(this.cssClasses.noCompare),available?compareAtPrice>price&&available&&this.priceElement.classList.add(this.cssClasses.onSale):this.priceElement.classList.add(this.cssClasses.soldOut),!priceVaries&&compareAtPriceVaries&&this.priceElement.classList.add(this.cssClasses.noCompare);const regularPriceElement=this.querySelector(".f-price__regular");regularPriceElement.querySelector(".f-price-item--regular").innerHTML=`${FoxTheme.Currency.formatMoney(price,FoxTheme.settings.moneyFormat)}`;const salePriceElement=this.querySelector(".f-price__sale");salePriceElement.querySelector(".f-price-item--regular").innerHTML=`<s>${FoxTheme.Currency.formatMoney(compareAtPrice,FoxTheme.settings.moneyFormat)}</s>`,salePriceElement.querySelector(".f-price-item--sale").innerHTML=`${FoxTheme.Currency.formatMoney(price,FoxTheme.settings.moneyFormat)}`}}customElements.define("product-bundle-variant-selector",ProductBundleVariantSelector);class ProductsBundle extends HTMLElement{constructor(){super(),this.cssClasses={hover:"is-hover",active:"is-active"},this.cartDrawerElement=document.querySelector("cart-drawer"),this.addToCartButtonElement=this.querySelector("button"),this.addToCartButtonElement&&this.addToCartButtonElement.addEventListener("click",this.handleButtonClick.bind(this)),this.productBundleBlocks=this.querySelectorAll("[data-block-id]"),this.productBundleBlocks.forEach(block=>block.addEventListener("mouseenter",this.handleBlockHover.bind(this,"enter"))),this.productBundleBlocks.forEach(block=>block.addEventListener("mouseleave",this.handleBlockHover.bind(this,"leave")))}handleBlockHover(type,event){type==="enter"?(this.classList.add(this.cssClasses.hover),this.toggleBlockActive(event.target,!0)):(this.classList.remove(this.cssClasses.hover),this.toggleBlockActive(null,!1))}toggleBlockActive(target,isActive){this.productBundleBlocks.forEach(block=>{target?block.dataset.blockId===target.dataset.blockId?block.classList.add(this.cssClasses.active):block.classList.remove(this.cssClasses.active):block.classList.remove(this.cssClasses.active)})}handleButtonClick(event){event.preventDefault(),this.lastClickedElement=event.submitter||event.currentTarget;const items={items:[...this.querySelectorAll('[name="id"]')].map(e=>e.value).map(e=>({id:e,quantity:1}))};if(document.body.classList.contains("cart-template")||FoxTheme.settings.cartType!="drawer"){FoxTheme.utils.postLink(FoxTheme.routes.cart_add_url,{parameters:{...items}});return}this.showErrorMessage(),this.toggleButtonLoading(!0);let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:grouped-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const body=JSON.stringify({...items,sections:sectionsToBundle,section_url:window.pathname});fetch(`${FoxTheme.routes.cart_add_url}`,{...FoxTheme.utils.fetchConfig("javascript"),body}).then(response=>response.json()).then(async parsedState=>{if(parsedState.status){this.showErrorMessage(parsedState.description);return}if(parsedState.status===422)document.dispatchEvent(new CustomEvent("product-ajax:error",{detail:{errorMessage:parsedState.description}}));else{const cartJson=await(await fetch(`${FoxTheme.routes.cart_url}`,{...FoxTheme.utils.fetchConfig()})).json();cartJson.sections=parsedState.sections,FoxTheme.pubsub.publish(FoxTheme.pubsub.PUB_SUB_EVENTS.cartUpdate,{cart:cartJson}),document.dispatchEvent(new CustomEvent("product-ajax:added",{detail:{product:parsedState}})),this.cartDrawerElement&&this.cartDrawerElement.show(this.lastClickedElement)}}).catch(e=>{console.error(e)}).finally(()=>{this.toggleButtonLoading(!1)})}showErrorMessage(errorMessage=!1){this.errorMessageElement=this.errorMessageElement||this.querySelector(".product-form__error-message"),this.errorMessageElement?(this.errorMessageElement.hidden=!errorMessage,errorMessage&&(this.errorMessageElement.textContent=errorMessage)):errorMessage&&alert(errorMessage)}toggleButtonLoading(status){status?(this.addToCartButtonElement.classList.add("btn--loading"),this.addToCartButtonElement.setAttribute("disabled",!0)):(this.addToCartButtonElement.classList.remove("btn--loading"),this.addToCartButtonElement.removeAttribute("disabled"))}}customElements.define("products-bundle",ProductsBundle);class ProductRecentlyViewed extends HTMLElement{constructor(){if(super(),FoxTheme.config.hasLocalStorage){const productId=parseInt(this.dataset.productId),cookieName="sleektheme:recently-viewed",items=JSON.parse(window.localStorage.getItem(cookieName)||"[]");items.includes(productId)&&items.splice(items.indexOf(productId),1),items.unshift(productId),window.localStorage.setItem(cookieName,JSON.stringify(items.slice(0,20)))}}}customElements.define("product-recently-viewed",ProductRecentlyViewed);class MotionElement extends HTMLElement{constructor(){super(),this.preInitialize()}connectedCallback(){FoxTheme.Motion.inView(this,async()=>
1{!this.isInstant&&this.media&&await FoxTheme.utils.imageReady(this.media),this.initialize()},{margin:"0px 0px -50px 0px"})}get isHold(){return this.hasAttribute("hold")}get isInstant(){return this.hasAttribute("data-instantly")}get mediaElements(){return Array.from(this.querySelectorAll("img, iframe, svg"))}get animationType(){return this.dataset.motion||"fade-up"}get animationDelay(){return parseInt(this.dataset.motionDelay||0)/1e3}preInitialize(){if(!this.isHold)switch(this.animationType){case"fade-in":FoxTheme.Motion.animate(this,{opacity:.01},{duration:0});break;case"fade-up":FoxTheme.Motion.animate(this,{transform:"translateY(2.5rem)",opacity:.01},{duration:0});break;case"zoom-in":FoxTheme.Motion.animate(this,{transform:"scale(0.8)"},{duration:0});break;case"zoom-in-lg":FoxTheme.Motion.animate(this,{transform:"scale(0)"},{duration:0});break;case"zoom-out":FoxTheme.Motion.animate(this,{transform:"scale(1.3)"},{duration:0});break;case"zoom-out-sm":FoxTheme.Motion.animate(this,{transform:"scale(1.1)"},{duration:0})}}async initialize(){if(!this.isHold){switch(this.animationType){case"fade-in":await FoxTheme.Motion.animate(this,{opacity:1},{duration:1.5,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break;case"fade-up":await FoxTheme.Motion.animate(this,{transform:"translateY(0)",opacity:1},{duration:.5,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break;case"zoom-in":await FoxTheme.Motion.animate(this,{transform:"scale(1)"},{duration:1.3,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break;case"zoom-in-lg":await FoxTheme.Motion.animate(this,{transform:"scale(1)"},{duration:.5,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break;case"zoom-out":await FoxTheme.Motion.animate(this,{transform:"scale(1)"},{duration:1.5,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break;case"zoom-out-sm":await FoxTheme.Motion.animate(this,{transform:"scale(1)"},{duration:1,delay:this.animationDelay,easing:[0,0,.3,1]}).finished;break}this.classList.add("is-animated")}}async resetAnimation(duration){switch(this.animationType){case"fade-in":await FoxTheme.Motion.animate(this,{opacity:0},{duration:duration||1.5,delay:this.animationDelay,easing:duration?"none":[0,0,.3,1]}).finished;break;case"fade-up":await FoxTheme.Motion.animate(this,{transform:"translateY(2.5rem)",opacity:0}
1,{duration:duration||.5,delay:this.animationDelay,easing:duration?"none":[0,0,.3,1]}).finished;break;case"zoom-in":await FoxTheme.Motion.animate(this,{transform:"scale(0)"},{duration:duration||1.3,delay:this.animationDelay,easing:duration?"none":[0,0,.3,1]}).finished;break;case"zoom-in-lg":await FoxTheme.Motion.animate(this,{transform:"scale(0)"},{duration:duration||1.3,delay:this.animationDelay,easing:duration?"none":[0,0,.3,1]}).finished;break;case"zoom-out":await FoxTheme.Motion.animate(this,{transform:"scale(0)"},{duration:duration||1.3,delay:this.animationDelay,easing:duration?"none":[.16,1,.3,1]}).finished;break;case"zoom-out-sm":await FoxTheme.Motion.animate(this,{transform:"scale(0)"},{duration:duration||1.3,delay:this.animationDelay,easing:duration?"none":[.16,1,.3,1]}).finished;break}}refreshAnimation(){this.removeAttribute("hold"),this.preInitialize(),setTimeout(()=>{this.initialize()},50)}}customElements.define("motion-element",MotionElement);class TabsComponent extends HTMLElement{constructor(){super(),this.selectors={tabHeader:'[role="tablist"]',tabPanels:['[role="tabpanel"]'],tabNavs:['[role="tab"]'],tabSelect:"tab-selector"},this.domNodes=FoxTheme.utils.queryDomNodes(this.selectors,this),this.selectedIndex=0,this.selectedTab=this.domNodes.tabPanels[this.selectedIndex],this.scrollToActiveTab=this.dataset.scrollToActiveTab==="true",this.scrollOffset=20,this.headerEl=document.querySelector('.header-section header[is="sticky-header"]'),this.init(),this.setActiveTab(0),this.tabChange=new CustomEvent("tabChange",{bubbles:!0,detail:{selectedTab:this.selectedTab}})}connectedCallback(){this.setActiveTab(0)}init=()=>{this.domNodes.tabNavs.forEach(tab=>{tab.addEventListener("click",this.onTabClick.bind(this))}),this.domNodes.tabHeader&&this.domNodes.tabHeader.addEventListener("keydown",this.handleKeyDown.bind(this)),this.setAccessible()};static get observedAttributes(){return["data-selected"]}get buttons(){return this._buttons=this._buttons||Array.from(this.querySelectorAll('button[role="tab"]'))}getHeaderHeight(){let headerHeight=0;if(this.headerEl){const height=Math.round(this.headerEl.offsetHeight);if(this.headerEl.isAlwaysSticky)headerHeight=height;else{const isSticky=document.body.classList.contains(this.headerEl.classes.pinned);window.scrollY>this.offsetTop-this.scrollOffset&&(headerHeight=height),isSticky&&window.scrollY>=this.offsetTop-this.scrollOffset-height&&(headerHeight=height)}}return headerHeight}scrollToTop(){let offsetTop=this.offsetTop-this.scrollOffset-this.getHeaderHeight();window.scrollTo({top:offsetTop,behavior:"smooth"})}onTabClick(evt){if(evt.target.tagName==="A"&&evt.target.hasAttribute("href"))return;evt.preventDefault();const currentTab=evt.currentTarget,index=currentTab?Number(currentTab.dataset.index):0;this.setActiveTab(index),this.scrollToActiveTab&&this.scrollToTop()}setActiveTab=tabIndex=>{const{tabNavs,tabPanels,tabSelect}=this.domNodes;if(tabIndex!==-1){const newHeader=tabNavs&&tabNavs[tabIndex],newTab=tabPanels&&tabPanels[tabIndex];this.setAttribute("data-selected",tabIndex),tabNavs.forEach(nav=>nav.setAttribute("aria-selected",!1)),newHeader&&newHeader.setAttribute("aria-selected",!0),this.selectedIndex=tabIndex,this.selectedTab=newTab,this.onTabChange(),this.dispatchEvent(new CustomEvent("tabChange",{bubbles:!0,detail:{selectedIndex:tabIndex,selectedTab:newTab}})),tabSelect&&(tabSelect.querySelector("select").value=tabIndex)}};onTabChange(){}setAccessible(){const{tabNavs,tabPanels}=this.domNodes;tabNavs.forEach((tab,index)=>{tab.id&&tabPanels[index].setAttribute("aria-labelledby",tab.id),tab.setAttribute("aria-selected",index===0),tab.setAttribute("data-index",index)}),tabPanels.forEach((panel,index)=>{panel.id&&tabNavs[index].setAttribute("aria-controls",panel.id),panel.setAttribute("tabindex",0)})}handleKeyDown(e){const{tabNavs}=this.domNodes;(e.keyCode===39||e.keyCode===37)&&(tabNavs[this.selectedIndex].setAttribute("tabindex",-1),e.keyCode===39?(this.selectedIndex++,this.selectedIndex>=tabNavs.length&&(this.selectedIndex=0)):e.keyCode===37&&(this.selectedIndex--,this.selectedIndex<0&&(this.selectedIndex=tabNavs.length-1)),tabNavs[this.selectedIndex].setAttribute("tabindex",0),tabNavs[this.selectedIndex].focus())}getSelected(){return{index:this.selectedIndex,element:this.selectedTab}}
1attributeChangedCallback(name,oldValue,newValue){if(name==="data-selected"&&oldValue!==null&&oldValue!==newValue){const fromButton=this.buttons[parseInt(oldValue)],toButton=this.buttons[parseInt(newValue)];this.transition(document.getElementById(fromButton.getAttribute("aria-controls")),document.getElementById(toButton.getAttribute("aria-controls")))}}async transition(fromPanel,toPanel){await FoxTheme.Motion.animate(fromPanel,{transform:["translateY(0)","translateY(2rem)"],opacity:[1,0]},{duration:.3}).finished,fromPanel.hidden=!0,toPanel.hidden=!1,FoxTheme.Motion.animate(toPanel,{transform:["translateY(2rem)","translateY(0)"],opacity:[0,1]},{duration:.3}).finished,toPanel.querySelector("grid-list")&&toPanel.querySelector("grid-list").showGridItems()}}customElements.define("tabs-component",TabsComponent);class ProductTabs extends TabsComponent{constructor(){super()}onTabChange(){if(this.selectedTab.querySelector(".products-list"))return;const tabContent=this.selectedTab.querySelector("template").content.cloneNode(!0).firstElementChild;this.selectedTab.appendChild(tabContent)}}customElements.define("product-tabs",ProductTabs);class TabSelector extends HTMLElement{constructor(){super(),this.tabs=this.closest("tabs-component"),this.querySelector("select").addEventListener("change",e=>{this.tabs.setActiveTab(e.target.value)})}}customElements.define("tab-selector",TabSelector);class Parallax extends HTMLElement{get parallax(){return this.dataset.parallax?parseFloat(this.dataset.parallax):!1}get parallaxDirection(){return this.dataset.parallaxDirection||"vertical"}get parallaxMediaElements(){return Array.from(this.querySelectorAll("img, video, iframe, svg, video-element"))}connectedCallback(){this.shouldInitializeParallax()&&this.setupParallax()}shouldInitializeParallax(){return!FoxTheme.config.motionReduced&&this.parallax}setupParallax(){const parallaxScale=1+this.parallax,parallaxTranslate=this.parallax*100/(1+this.parallax);let parallaxTransformProperties={};this.parallaxDirection==="vertical"?parallaxTransformProperties={transform:[`scale(${parallaxScale}) translateY(0)`,`scale(${parallaxScale}) translateY(${parallaxTranslate}%)`],transformOrigin:["bottom","bottom"]}:this.parallaxDirection==="horizontal"?parallaxTransformProperties={transform:[`scale(${parallaxScale}) translateX(0)`,`scale(${parallaxScale}) translateX(${parallaxTranslate}%)`],transformOrigin:["right","right"]}:parallaxTransformProperties={transform:["scale(1)",`scale(${parallaxScale})`],transformOrigin:["center","center"]},FoxTheme.Motion.scroll(FoxTheme.Motion.animate(this.parallaxMediaElements,parallaxTransformProperties,{easing:"linear"}),{target:this,offset:["start end","end start"]})}}customElements.define("parallax-element",Parallax);class ProductForm extends HTMLFormElement{constructor(){super(),this.productIdInput=this.querySelector("[name=id]"),this.productIdInput.disabled=!1,this.addEventListener("submit",this.handleFormSubmit)}get cartDrawerElement(){return document.querySelector("cart-drawer")}get submitButtonElement(){return this._submitButtonElement=this._submitButtonElement||this.querySelector('[type="submit"]')}get isHideErrors(){return this.dataset.hideErrors==="true"}handleFormSubmit=event=>{if(document.body.classList.contains("cart-template")||FoxTheme.settings.cartType==="page"||(event.preventDefault(),this.submitButtonElement.hasAttribute("aria-disabled")))return;this.lastSubmittedElement=event.submitter||event.currentTarget,this.displayFormErrors();let sectionsToBundle=[];document.documentElement.dispatchEvent(new CustomEvent("cart:grouped-sections",{bubbles:!0,detail:{sections:sectionsToBundle}}));const config=FoxTheme.utils.fetchConfig("javascript");config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"],this.formData=new FormData(this),this.formData.append("sections",sectionsToBundle),this.formData.append("sections_url",window.location.pathname),config.body=this.formData,this.submitButtonElement.setAttribute("aria-disabled","true"),this.submitButtonElement.classList.add("btn--loading"),this.handleFormSubmission(config)};displayFormErrors=(errorMessage=!1)=>{this.isHideErrors||(this.formErrorMessage=this.formErrorMessage||this.querySelector(".product-form__error-message"),this.formErrorMessage?(this.formErrorMessage.toggleAttribute("hidden",!errorMessage),this.formErrorMessage.innerText=errorMessage):errorMessage!==!1&&alert(errorMessage))};handleFormSubmission=config=>{fetch(`${FoxTheme.routes.cart_add_url}`,config).then(response=>response.json()).then(async parsedState=>{if(parsedState.status){this.handleCartError(parsedState);const cartJsonSub=await(await fetch(`${FoxTheme.routes.cart_url}`,{...FoxTheme.utils.fetchConfig("json","GET")})).json();this.updateCartState(cartJsonSub),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{open:!0}}));return}const cartJson=await(await fetch(`${FoxTheme.routes.cart_url}`,{...FoxTheme.utils.fetchConfig("json","GET")})).json();cartJson.sections=parsedState.sections,this.updateCartState(cartJson),this.dispatchProductAddedEvent(parsedState),this.showCartDrawer()}).catch(error=>{console.log(error)}).finally(()=>{this.submitButtonElement.classList.remove("btn--loading"),this.submitButtonElement.removeAttribute("aria-disabled"),this.hasError||this.submitButtonElement.removeAttribute("aria-disabled")})};handleCartError=parsedState=>{FoxTheme.pubsub.publish(FoxTheme.pubsub.PUB_SUB_EVENTS.cartError,{source:"product-form",productVariantId:this.formData.get("id"),errors:parsedState.errors||parsedState.description,message:parsedState.message}),this.displayFormErrors(parsedState.description),document.dispatchEvent(new CustomEvent("product-ajax:error",{detail:{errorMessage:parsedState.description}})),this.hasError=!0};updateCartState=cartJson=>{FoxTheme.pubsub.publish(FoxTheme.pubsub.PUB_SUB_EVENTS.cartUpdate,{cart:cartJson})};dispatchProductAddedEvent=parsedState=>{document.dispatchEvent(new CustomEvent("product-ajax:added",{detail:{product:parsedState}}))};showCartDrawer=()=>{const quickViewModal=this.closest("quick-view-modal");quickViewModal?(this.cartDrawerElement&&!this.cartDrawerElement.open&&document.body.addEventListener(quickViewModal.events.handleAfterHide,()=>{setTimeout(()=>{this.cartDrawerElement.show(this.lastSubmittedElement)})},{once:!0}),quickViewModal.hide(!0)):this.cartDrawerElement&&this.cartDrawerElement.show(this.lastSubmittedElement)}}customElements.define("product-form",ProductForm,{extends:"form"});class HighlightText extends HTMLElement{constructor(){super(),FoxTheme.Motion.inView(this,this.init.bind(this))}init(){this.classList.add("animate")}}customElements.define("highlight-text",HighlightText,{extends:"em"});class NewsletterForm extends HTMLFormElement{constructor(){super(),this.selectors={subscribedMessage:"[id*=Newsletter-error-subscribed]",modal:"[id*=NewsletterAlertModal-]"},this.init()}init(){const result=window.location.href.includes("form_type=customer"),inputVal=this.querySelector('[id*="NewsletterForm"]').value.length,modalEl=this.querySelector(this.selectors.modal);if(result&&inputVal!=0){const subscribedMessageEl=this.querySelector(this.selectors.subscribedMessage);subscribedMessageEl&&subscribedMessageEl.classList.remove("hidden"),window.isNewsletterModalShow||(modalEl&&modalEl.show(),window.isNewsletterModalShow=!0)}this.querySelector(".form-message--main")&&(window.isNewsletterModalShow||(modalEl&&modalEl.show(),window.isNewsletterModalShow=!0))}}if(customElements.define("newsletter-form",NewsletterForm,{extends:"form"}),!customElements.get("scrolling-promotion")){class ScrollingPromotion extends HTMLElement{constructor(){super(),!FoxTheme.config.motionReduced&&(this.promotion=this.querySelector(".promotion"),FoxTheme.Motion.inView(this,this.init.bind(this),{margin:"200px 0px 200px 0px"}))}init(){if(this.childElementCount===1){this.promotion.classList.add("promotion--animated");for(let index=0;
1index<10;index++)this.clone=this.promotion.cloneNode(!0),this.appendChild(this.clone);new IntersectionObserver((entries,_observer)=>{entries.forEach(entry=>{entry.isIntersecting?this.scrollingPlay():this.scrollingPause()})},{rootMargin:"0px 0px 50px 0px"}).observe(this)}}scrollingPlay(){this.classList.remove("scrolling-promotion--paused")}scrollingPause(){this.classList.add("scrolling-promotion--paused")}}customElements.define("scrolling-promotion",ScrollingPromotion)} 2//# sourceMappingURL=/cdn/shop/t/18/assets/theme.js.map?v=79212106766806262211772124845
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.