PageSourceSearch

https://joiejewelry.ca/cdn/shop/t/18/assets/theme.js?v=147719205544241979961789917903

js joiejewelry.ca collected 2026-09-25 23:11:09 UTC 637,772 bytes, 64 lines download raw bytes

1/*
2* @license
3* PIPELINE Theme (c) Groupthought Themes
4*
5* This file is included for advanced development by
6* Shopify Agencies. Modified versions of the theme
7* code are not supported by Shopify or Groupthought.
8*
9* Add any minor JS changes in assets/custom.js, this
10* will make it easier to update the theme in the future.
11*
12*/(function(AOS,FlickityFade,scrollLock,Flickity,MicroModal,Rellax,themeCurrency,axios,themeAddresses,Sqrl){"use strict";function _interopNamespaceDefault(e){var n=Object.create(null);return e&&Object.keys(e).forEach(function(k){if(k!=="default"){var d=Object.getOwnPropertyDescriptor(e,k);Object.defineProperty(n,k,d.get?d:{enumerable:!0,get:function(){return e[k]}})}}),n.default=e,Object.freeze(n)}var Sqrl__namespace=_interopNamespaceDefault(Sqrl);(function(){const env={NODE_ENV:"production"};try{if(process){process.env=Object.assign({},process.env),Object.assign(process.env,env);return}}catch{}globalThis.process={env}})(),window.requestIdleCallback=window.requestIdleCallback||function(cb){var start2=Date.now();return setTimeout(function(){cb({didTimeout:!1,timeRemaining:function(){return Math.max(0,50-(Date.now()-start2))}})},1)},window.cancelIdleCallback=window.cancelIdleCallback||function(id){clearTimeout(id)};function moveModals(container){const modals=container.querySelectorAll("[data-modal]"),modalBin=document.querySelector("[data-modal-container]");modals.forEach(element=>{modalBin.querySelector(`[id="${element.id}"]`)||modalBin.appendChild(element)})}function floatLabels(container){container.querySelectorAll(".float__wrapper").forEach(element=>{const label=element.querySelector("label"),input=element.querySelector("input, textarea");label&&input.addEventListener("keyup",event=>{event.target.value!==""?label.classList.add("label--float"):label.classList.remove("label--float")}),input&&input.value&&input.value.length&&label.classList.add("label--float")})}function errorTabIndex(container){container.querySelectorAll(".errors").forEach(element=>{element.setAttribute("tabindex","0"),element.setAttribute("aria-live","assertive"),element.setAttribute("role","alert")})}function readHeights(){const h={};return h.windowHeight=window.innerHeight,h.announcementHeight=getHeight$1("[data-announcement-bar]"),h.toolbarHeight=getHeight$1("[data-toolbar-height]"),h.footerHeight=getHeight$1('[data-section-type*="footer"]'),h.menuHeight=getHeight$1("[data-header-height]"),h.headerHeight=h.menuHeight+h.announcementHeight,h.logoHeight=getFooterLogoWithPadding(),h.stickyHeader=document.querySelector('[data-header-sticky="sticky"]')?h.menuHeight:0,h.backfillHeight=getHeight$1("[data-header-backfill]"),h}function setVarsOnResize(){document.addEventListener("theme:resize",resizeVars),setVars()}function setVars(){const{windowHeight,announcementHeight,toolbarHeight,headerHeight,logoHeight,menuHeight,footerHeight,stickyHeader:stickyHeader2,backfillHeight}=readHeights();document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),document.documentElement.style.setProperty("--footer-logo",`${logoHeight}px`),document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--three-quarters",`${windowHeight*.75}px`),document.documentElement.style.setProperty("--two-thirds",`${windowHeight*.66}px`),document.documentElement.style.setProperty("--one-half",`${windowHeight*.5}px`),document.documentElement.style.setProperty("--one-third",`${windowHeight*.33}px`),document.documentElement.style.setProperty("--one-fifth",`${windowHeight*.2}px`),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--toolbar-height",`${toolbarHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--menu-height-sticky",`${stickyHeader2}px`);
12let newBackfill=Math.abs(backfillHeight-menuHeight)>1?`${menuHeight}px`:"auto";document.documentElement.style.setProperty("--menu-backfill-height",newBackfill)}function resizeVars(){const{windowHeight,announcementHeight,toolbarHeight,headerHeight,logoHeight,menuHeight,footerHeight,stickyHeader:stickyHeader2,backfillHeight}=readHeights();document.documentElement.style.setProperty("--scrollbar-width",`${getScrollbarWidth()}px`),document.documentElement.style.setProperty("--full-screen",`${windowHeight}px`),document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`),document.documentElement.style.setProperty("--announcement-height",`${announcementHeight}px`),document.documentElement.style.setProperty("--toolbar-height",`${toolbarHeight}px`),document.documentElement.style.setProperty("--header-height",`${headerHeight}px`),document.documentElement.style.setProperty("--footer-height",`${footerHeight}px`),document.documentElement.style.setProperty("--content-full",`${windowHeight-headerHeight-logoHeight/2}px`),document.documentElement.style.setProperty("--menu-height-sticky",`${stickyHeader2}px`);
12let newBackfill=Math.abs(backfillHeight-menuHeight)>1?`${menuHeight}px`:"auto";document.documentElement.style.setProperty("--menu-backfill-height",newBackfill)}function getHeight$1(selector){const el=document.querySelector(selector);return el?el.clientHeight:0}function getFooterLogoWithPadding(){const height=getHeight$1("[data-footer-logo]");return height>0?height+20:0}function getScrollbarWidth(){const outer=document.createElement("div");outer.style.visibility="hidden",outer.style.overflow="scroll",outer.style.msOverflowStyle="scrollbar",document.body.appendChild(outer);const inner=document.createElement("div");outer.appendChild(inner);const scrollbarWidth=outer.offsetWidth-inner.offsetWidth;return outer.parentNode.removeChild(outer),scrollbarWidth}function singles(frame2,wrappers){let padding=64,tallest=0;wrappers.forEach(wrap2=>{if(wrap2.offsetHeight>tallest){const getMarginTop=parseInt(window.getComputedStyle(wrap2).marginTop),getMarginBottom=parseInt(window.getComputedStyle(wrap2).marginBottom),getMargin=getMarginTop+getMarginBottom;getMargin>padding&&(padding=getMargin),tallest=wrap2.offsetHeight}});const images=frame2.querySelectorAll("[data-overflow-background]");[frame2,...images].forEach(el=>{el.style.setProperty("min-height",`calc(${tallest+padding}px + var(--menu-height))`)})}function doubles(section2){let footerLogoH=document.querySelector("[data-footer-logo]")?document.querySelector("[data-footer-logo]").clientHeight+20:0;const lastSection=document.querySelector("#MainContent .shopify-section:last-child [data-section-id]"),lastSectionAttrID=lastSection?lastSection.getAttribute("data-section-id"):null;if((lastSectionAttrID!==null&&section2.getAttribute("data-section-id")!==lastSectionAttrID||!lastSection)&&(footer
12LogoH=0),window.innerWidth<window.theme.sizes.medium){section2.querySelectorAll("[data-overflow-frame]").forEach(singleframe=>{const wrappers=singleframe.querySelectorAll("[data-overflow-content]");singles(singleframe,wrappers)});return}const htmlObject=document.createElement("div");section2.prepend(htmlObject),htmlObject.style.display="none",htmlObject.style.width=getComputedStyle(section2).getPropertyValue("--outer");const padding=parseInt(getComputedStyle(htmlObject).getPropertyValue("width"))*2;section2.firstChild.remove();let tallest=0;const frames=section2.querySelectorAll("[data-overflow-frame]");section2.querySelectorAll("[data-overflow-content]").forEach(content=>{content.offsetHeight>tallest&&(tallest=content.offsetHeight)});const images=section2.querySelectorAll("[data-overflow-background]");[...frames,...images].forEach(el=>{el.style.setProperty("min-height",`${tallest+padding}px`)}),section2.style.setProperty("min-height",`${tallest+padding+2+footerLogoH}px`)}function preventOverflow(container){const singleFrames=container.querySelectorAll(".js-overflow-container");if(singleFrames){singleFrames.forEach(frame2=>{const wrappers=frame2.querySelectorAll(".js-overflow-content");singles(frame2,wrappers),document.addEventListener("theme:resize",()=>{singles(frame2,wrappers)})});const slideshows=container.querySelectorAll("[data-slideshow-wrapper]");
12slideshows.length&&slideshows.forEach(slideshow2=>{const slideshowInstance=FlickityFade.data(slideshow2);typeof slideshowInstance<"u"&&slideshowInstance.reloadCells()})}const doubleSections=container.querySelectorAll("[data-overflow-wrapper]");doubleSections&&doubleSections.forEach(section2=>{doubles(section2),document.addEventListener("theme:resize",()=>{doubles(section2)})})}function debounce$1(func,wait=500,immediate=!1){var timeout,args,context,timestamp,result;wait==null&&(wait=100);function later(){var last=Date.now()-timestamp;last<wait&&last>=0?timeout=setTimeout(later,wait-last):(timeout=null,immediate||(result=func.apply(context,args),context=args=null))}var debounced=function(){context=this,args=arguments,timestamp=Date.now();var callNow=immediate&&!timeout;return timeout||(timeout=setTimeout(later,wait)),callNow&&(result=func.apply(context,args),context=args=null),result};return debounced.clear=function(){timeout&&(clearTimeout(timeout),timeout=null)},debounced.flush=function(){timeout&&(result=func.apply(context,args),context=args=null,clearTimeout(timeout),timeout=null)},debounced}let lastWindowWidth=window.innerWidth,lastWindowHeight=window.innerHeight;function dispatch$2(){document.dispatchEvent(new CustomEvent("theme:resize",{bubbles:!0})),lastWindowWidth!==window.innerWidth&&(document.dispatchEvent(new CustomEvent("theme:resize:width",{bubbles:!0})),lastWindowWidth=window.innerWidth),lastWindowHeight!==window.innerHeight&&(document.dispatchEvent(new CustomEvent("theme:resize:height",{bubbles:!0})),lastWindowHeight=window.innerHeight)}let raf;function resizeListener(){window.addEventListener("resize",()=>{raf&&window.cancelAnimationFrame(raf),raf=window.requestAnimationFrame(debounce$1(dispatch$2,50))})}let prev=window.pageYOffset,up=null,down=null,wasUp=null,wasDown=null,scrollLockTimer=0;function dispatch$1(){const position=window.pageYOffset;position>prev?(down=!0,up=!1):position<prev?(down=!1,up=!0):(up=null,down=null),prev=position,document.dispatchEvent(new CustomEvent("theme:scroll",{detail:{up,down,position},bubbles:!1})),up&&!wasUp&&document.dispatchEvent(new CustomEvent("theme:scroll:up",{detail:{position},bubbles:!1})),down&&!wasDown&&document.dispatchEvent(new CustomEvent("theme:scroll:down",{detail:{position},bubbles:!1})),wasDown=down,wasUp=up}function lock(e){setTimeout(()=>{scrollLockTimer&&clearTimeout(scrollLockTimer),scrollLock.disablePageScroll(e.detail,{allowTouchMove:el=>el.tagName==="TEXTAREA"}),document.documentElement.setAttribute("data-scroll-locked","")})}function unlock(e){const timeout=e.detail;timeout?scrollLockTimer=setTimeout(removeScrollLock,timeout):removeScrollLock()}function removeScrollLock(){scrollLock.clearQueueScrollLocks(),scrollLock.enablePageScroll(),document.documentElement.removeAttribute("data-scroll-locked")}function scrollListener(){let raf2;window.addEventListener("scroll",function(){raf2&&window.cancelAnimationFrame(raf2),raf2=window.requestAnimationFrame(dispatch$1)},{passive:!0}),window.addEventListener("theme:scroll:lock",lock),window.addEventListener("theme:scroll:unlock",unlock)}const selectors$13={time:"time",days:"[data-days]",hours:"[data-hours]",minutes:"[data-minutes]",seconds:"[data-seconds]",shopifySection:".shopify-section"},attributes$2={expirationBehavior:"data-expiration-behavior"},classes$D={showMessage:"show-message",hideCountdown:"hidden"},settings={hideSection:"hide-section",showMessage:"show-message"};let CountdownTimer=class extends HTMLElement{connectedCallback(){if(isNaN(this.endDate)){this.onComplete();return}if(this.endDate<=Date.now()){this.onComplete();return}this.interval=setInterval(this.update,1e3)}disconnectedCallback(){this.stopTimer()}convertTime(timeInMs){const days=this.formatDigits(parseInt(timeInMs/this.daysInMs,10));timeInMs-=days*this.daysInMs;const hours=this.formatDigits(parseInt(timeInMs/this.hoursInMs,10));timeInMs-=hours*this.hoursInMs;const minutes=this.formatDigits(parseInt(timeInMs/this.minutesInMs,10));timeInMs-=minutes*this.minutesInMs;const seconds=this.formatDigits(parseInt(timeInMs/this.secondsInMs,10));return{days,hours,minutes,seconds}}formatDigits(number2){return number2<10&&(number2="0"+number2),number2}render(timer){this.days.textContent=timer.days,this.hours.textContent=timer.hours,this.minutes.textContent=timer.minutes,this.seconds.textContent=timer.seconds}stopTimer(){clearInterval(this.interval)}
12onComplete(){this.render({days:0,hours:0,minutes:0,seconds:0}),this.shouldHideOnComplete&&this.shopifySection.classList.add(classes$D.hideCountdown),this.shouldShowMessage&&this.classList.add(classes$D.showMessage)}update(){const timeNow=new Date().getTime(),timeDiff=this.endDate-timeNow;timeDiff<=0&&(this.stopTimer(),this.onComplete());const timeRemaining=this.convertTime(timeDiff);this.render(timeRemaining)}constructor(){super(),this.shopifySection=this.closest(selectors$13.shopifySection),this.expirationBehavior=this.getAttribute(attributes$2.expirationBehavior),this.time=this.querySelector(selectors$13.time),this.days=this.querySelector(selectors$13.days),this.hours=this.querySelector(selectors$13.hours),this.minutes=this.querySelector(selectors$13.minutes),this.seconds=this.querySelector(selectors$13.seconds),this.endDate=Date.parse(this.time.dateTime),this.daysInMs=1e3*60*60*24,this.hoursInMs=this.daysInMs/24,this.minutesInMs=this.hoursInMs/60,this.secondsInMs=this.minutesInMs/60,this.shouldHideOnComplete=this.expirationBehavior===settings.hideSection,this.shouldShowMessage=this.expirationBehavior===settings.showMessage,this.update=this.update.bind(this)}};resizeListener(),scrollListener(),window.addEventListener("DOMContentLoaded",()=>{setVarsOnResize(),floatLabels(document),errorTabIndex(document),moveModals(document),window.theme.settings.animate_scroll&&AOS.refresh()}),window.addEventListener("load",()=>{preventOverflow(document)}),document.addEventListener("shopify:section:load",e=>{const container=e.target;floatLabels(container),errorTabIndex(container),moveModals(container),preventOverflow(container),window.theme.settings.animate_scroll&&AOS.refresh()}),document.addEventListener("shopify:section:reorder",()=>{document.dispatchEvent(new CustomEvent("theme:header:check",{bubbles:!1}))}),customElements.get("countdown-timer")||customElements.define("countdown-timer",CountdownTimer);const showElement=(elem,removeProp=!1,prop="block")=>{elem&&(removeProp?elem.style.removeProperty("display"):elem.style.display=prop)};function FetchError(object){this.status=object.status||null,this.headers=object.headers||null,this.json=object.json||null,this.body=object.body||null}FetchError.prototype=Error.prototype;const selectors$12={scrollbar:"data-scrollbar-slider",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]"},classes$C={hidden:"is-hidden"},times$1={delay:200};let NativeScrollbar=class{init(){this.arrowNext&&this.arrowPrev&&(window.isRTL?this.togglePrevArrow():this.toggleNextArrow(),this.events())}resize(){document.addEventListener("theme:resize",()=>{window.isRTL?this.togglePrevArrow():this.toggleNextArrow()})}events(){this.arrowNext.addEventListener("click",event=>{event.preventDefault(),this.goToNext()}),this.arrowPrev.addEventListener("click",event=>{event.preventDefault(),this.goToPrev()}),this.scrollbar.addEventListener("scroll",()=>{this.togglePrevArrow(),this.toggleNextArrow()})}goToNext(){const position=this.scrollbar.getBoundingClientRect().width/2+this.scrollbar.scrollLeft;this.move(position),this.arrowPrev.classList.remove(classes$C.hidden),this.toggleNextArrow()}goToPrev(){const position=this.scrollbar.scrollLeft-this.scrollbar.getBoundingClientRect().width/2;this.move(position),this.arrowNext.classList.remove(classes$C.hidden),this.togglePrevArrow()}toggleNextArrow(){setTimeout(()=>{window.isRTL?this.arrowNext.classList.toggle(classes$C.hidden,this.scrollbar.scrollLeft===0):this.arrowNext.classList.toggle(classes$C.hidden,Math.round(this.scrollbar.scrollLeft+this.scrollbar.getBoundingClientRect().width+1)>=this.scrollbar.scrollWidth)},times$1.delay)}togglePrevArrow(){setTimeout(()=>{window.isRTL?this.arrowPrev.classList.toggle(classes$C.hidden,Math.abs(this.scrollbar.scrollLeft)+this.scrollbar.getBoundingClientRect().width+1>=this.scrollbar.scrollWidth):this.arrowPrev.classList.toggle(classes$C.hidden,this.scrollbar.scrollLeft<=0)},times$1.delay)}scrollToVisibleElement(){[].forEach.call(this.scrollbar.children,element=>{element.addEventListener("click",event=>{(event.target.tagName.toLowerCase()==="a"||event.currentTarget&&event.currentTarget.tagName.toLowerCase()==="a"||event.currentTarget&&event.currentTarget.querySelector("a"))&&event.preventDefault(),this.move(element.offsetLeft-element.clientWidth)})})}move(offsetLeft){this.scrollbar.scrollTo({top:0,left:offsetLeft,behavior:"smooth"})}constructor(scrollbar){this.scrollbar=scrollbar,this.arrowNext=this.scrollbar.parentNode.querySelector(selectors$12.scrollbarArrowNext),this.arrowPrev=this.scrollbar.parentNode.querySelector(selectors$12.scrollbarArrowPrev),this.init(),this.resize(),this.scrollbar.hasAttribute(selectors$12.scrollbar)&&this.scrollToVisibleElement()}};const selectors$11={siblingsInnerHolder:"[data-sibling-inner]"};
12let Siblings=class{init(){this.siblings.forEach(sibling=>{new NativeScrollbar(sibling)})}constructor(holder){this.siblings=holder.querySelectorAll(selectors$11.siblingsInnerHolder),this.init()}};const siblings={onLoad(){new Siblings(this.container)}},cookieDefaultValues={expires:7,path:"/",domain:window.location.hostname};let Cookies=class{write(value){document.cookie=`${this.options.name}=${value}; expires=${this.options.expires}; path=${this.options.path}; domain=${this.options.domain}`}read(){let cookieValuesArr=[];const hasCookieWithThisName=document.cookie.split("; ").find(row=>row.startsWith(this.options.name));if(document.cookie.indexOf("; ")!==-1&&hasCookieWithThisName){const cookieValue=document.cookie.split("; ").find(row=>row.startsWith(this.options.name)).split("=")[1];cookieValue!==null&&(cookieValuesArr=cookieValue.split(","))}return cookieValuesArr}destroy(){document.cookie=`${this.options.name}=null; expires=${this.options.expires}; path=${this.options.path}; domain=${this.options.domain}`}remove(removedValue){const cookieValue=this.read(),position=cookieValue.indexOf(removedValue);position!==-1&&(cookieValue.splice(position,1),this.write(cookieValue))}constructor(options2={}){this.options={...cookieDefaultValues,...options2}}};const config={howManyToShow:4,howManyToStoreInMemory:10,wrapper:"[data-recently-viewed-products]",limit:"data-limit",recentTabLink:"[data-recent-link-tab]",recentWrapper:"[data-recent-wrapper]",recentViewedTab:"[data-recently-viewed-tab]",tabsHolderScroll:"[data-tabs-holder-scroll]",apiContent:"[data-api-content]",dataMinimum:"data-minimum",dataItemId:"data-item-id"},classes$B={hide:"hide",containerWithoutTabsNav:"section-without-title--skip"},cookieConfig={expires:90,name:"shopify_recently_viewed"},sections$n=[],excludedHandles=[];let RecentProducts=class{renderProducts(){const recentlyViewedHandlesArray=this.cookie.read(),arrayURLs=[];let counter=0;if(recentlyViewedHandlesArray.length>0){for(let index=0;index<recentlyViewedHandlesArray.length;index++){const handle=recentlyViewedHandlesArray[index];if(excludedHandles.includes(handle))continue;const url=`${window.theme.routes.root_url}products/${handle}?section_id=api-product-grid-item`;if(arrayURLs.push(url),counter++,counter===this.howManyToShow||counter===recentlyViewedHandlesArray.length-1)break}if(arrayURLs.length>0&&arrayURLs.length>=this.minimum){this.container.classList.remove(classes$B.hide),this.recentViewedLink&&this.recentViewedLink.previousElementSibling&&(this.tabsHolderScroll.classList.remove(classes$B.hide),this.container.classList.add(classes$B.containerWithoutTabsNav));const fecthRequests=arrayURLs.map(url=>fetch(url,{mode:"no-cors"}).then(this.handleErrors)),productMarkups=[];Promise.allSettled(fecthRequests).then(responses=>Promise.all(responses.map(async response=>{response.status==="fulfilled"&&productMarkups.push(await response.value.text())}))).then(()=>{productMarkups.forEach(markup=>{const buffer=document.createElement("div"),slide=document.createElement("div");buffer.innerHTML=markup,buffer.querySelector(`[${config.dataItemId}]`).getAttribute(config.dataItemId)!==""&&(slide.classList.add("product-grid-slide"),slide.setAttribute("data-carousel-slide",null),slide.setAttribute("data-item",null),slide.innerHTML=buffer.querySelector(config.apiContent).innerHTML,this.wrapper.appendChild(slide))}),new Siblings(this.container)}).then(()=>{showElement(this.wrapper,!0),this.container.dispatchEvent(new CustomEvent("theme:recent-products:added",{bubbles:!0}))})}else if(this.recentViewedTab){const hasSiblingTabs=Array.prototype.filter.call(this.recentViewedTab.parentNode.children,child=>child!==this.recentViewedTab).length>1;this.recentViewedLink&&this.recentViewedLink.previousElementSibling&&(this.tabsHolderScroll.classList.add(classes$B.hide),this.container.classList.remove(classes$B.containerWithoutTabsNav)),hasSiblingTabs||this.container.classList.add(classes$B.hide)}else this.container.classList.add(classes$B.hide)}}handleErrors(response){return response.ok?response:response.text().then(function(text){throw new FetchError({status:response.statusText,headers:response.headers,text})})}constructor(section2){this.container=section2.container,this.cookie=new Cookies(cookieConfig),this.wrapper=this.container.querySelector(config.wrapper),this.wrapper!==null&&(this.howManyToShow=parseInt(this.container.querySelector(config.recentWrapper).getAttribute(config.limit))||config.howManyToShow,this.minimum=parseInt(this.container.querySelector(config.recentWrapper).getAttribute(config.dataMinimum)),this.recentViewedTab=this.container.querySelector(config.recentViewedTab),this.recentViewedLink=this.container.querySelector(config.recentTabLink),this.tabsHolderScroll=this.container.querySelector(config.tabsHolderScroll),this.renderProducts())}},RecordRecentlyViewed=class{updateCookie(){let recentlyViewed=this.cookie.read();const position=recentlyViewed.indexOf(this.handle);position===-1?(recentlyViewed.unshift(this.handle),recentlyViewed=recentlyViewed.splice(0,config.howManyToStoreInMemory)):(recentlyViewed.splice(position,1),recentlyViewed.unshift(this.handle));const recentlyViewedString=recentlyViewed.join(",");this.cookie.write(recentlyViewedString)}constructor(handle){this.handle=encodeURIComponent(handle),this.cookie=new Cookies(cookieConfig),!(typeof this.handle>"u")&&(excludedHandles.push(this.handle),this.updateCookie())}};const recentProducts={onLoad(){sections$n[this.id]=new RecentProducts(this)}};function resolution(){const touchQuery="(any-pointer: coarse)",mobileQuery=`(max-width: ${window.theme.sizes.medium}px)`,tabletQuery=`(min-width: ${window.theme.sizes.medium+1}px) and (max-width: ${window.theme.sizes.large}px)`,desktopQuery=`(min-width: ${window.theme.sizes.large+1}px)`;resolution.isTouch=()=>{const touchMatches=window.matchMedia(touchQuery).matches;return document.documentElement.classList.toggle("supports-touch",touchMatches),touchMatches},resolution.isMobile=()=>window.matchMedia(mobileQuery).matches,resolution.isTablet=()=>window.matchMedia(tabletQuery).matches,resolution.isDesktop=()=>window.matchMedia(desktopQuery).matches;const queries=[[touchQuery,resolution.isTouch],[mobileQuery,resolution.isMobile],[tabletQuery,resolution.isTablet],[desktopQuery,resolution.isDesktop]];resolution.onChange=callback=>
12{queries.forEach(query=>{window.matchMedia(query[0]).addEventListener("change",()=>{query[1]()&&callback&&callback()})})}}resolution();const selectors$10={holderItems:"[data-custom-scrollbar-items]",scrollbar:"[data-custom-scrollbar]",scrollbarTrack:"[data-custom-scrollbar-track]"},classes$A={hide:"hide"},sections$m={};let CustomScrollbar=class{events(){this.holderItems.addEventListener("scroll",this.calculatePosition.bind(this)),this.holderItems.addEventListener("theme:carousel:scroll",this.calculatePosition.bind(this)),document.addEventListener("theme:resize:width",this.calculateTrackWidth.bind(this)),document.addEventListener("theme:resize:width",this.calculatePosition.bind(this))}calculateTrackWidth(){const htmlObject=document.createElement("div");this.holderItems.prepend(htmlObject),htmlObject.style.display="none",htmlObject.style.width=getComputedStyle(this.holderItems).getPropertyValue("--outer");const widthAfter=parseInt(getComputedStyle(htmlObject).getPropertyValue("width"));this.holderItems.firstChild.remove(),this.scrollbarWidth=this.scrollbar.clientWidth===0?this.scrollbar.parentNode.getBoundingClientRect().width:this.scrollbar.clientWidth,setTimeout(()=>{const childWidth=this.children[0].clientWidth,childMarginRight=Number(getComputedStyle(this.children[0]).marginRight.replace("px","")),childMarginLeft=Number(getComputedStyle(this.children[0]).marginLeft.replace("px",""));this.scrollWidth=this.children.length*(childWidth+childMarginRight+childMarginLeft)+widthAfter-childMarginRight,this.trackWidth=(this.scrollbarWidth+widthAfter)/this.scrollWidth*100,this.trackWidth=this.trackWidth<5?5:this.trackWidth,this.scrollbar.style.setProperty("--track-width",`${this.trackWidth}%`);const hideScrollbar=Math.ceil(this.trackWidth)>=100;this.scrollbar.classList.toggle(classes$A.hide,hideScrollbar)},100)}calculatePosition(){let position=Math.abs(this.holderItems.scrollLeft)/(this.holderItems.scrollWidth-this.holderItems.clientWidth);position*=this.scrollbar.clientWidth-this.scrollbarTrack.clientWidth,position=position<0?0:position,position=isNaN(position)?0:position,this.scrollbar.style.setProperty("--position",`${Math.round(position)}px`),document.dispatchEvent(new CustomEvent("theme:scrollbar:scroll",{bubbles:!0,detail:{holder:this.holderItems}}))}constructor(holder,children=null){this.holderItems=holder.querySelector(selectors$10.holderItems),this.scrollbar=holder.querySelector(selectors$10.scrollbar),this.scrollbarTrack=holder.querySelector(selectors$10.scrollbarTrack),this.trackWidth=0,this.scrollWidth=0,this.scrollbar&&this.holderItems&&(this.children=children||this.holderItems.children,this.events(),this.calculateTrackWidth())}};const customScrollbar={onLoad(){sections$m[this.id]=new CustomScrollbar(this.container)}},selectors$$={carousel:"[data-carousel]",carouselWithProgress:"data-carousel-progress",carouselSlide:"[data-carousel-slide]",carouselFirstSlidePhoto:"[data-grid-slide]",pgiFirstSlidePhoto:"product-grid-item-variant:not([hidden]) [data-grid-slide]",wrapper:"[data-wrapper]",carouselTrack:"[data-carousel-track]",slider:".flickity-slider",carouselOptions:"data-options",carouselCustomScrollbar:"data-custom-scrollbar-items",carouselPrev:".flickity-button.previous",carouselNext:".flickity-button.next",recentlyViewHolder:"data-recently-viewed-products",relatedHolder:"data-related-products",sectionHolder:"[data-section-id]"},classes$z={wrapper:"wrapper",arrowsForceTop:"flickity-force-arrows-top",arrowsOnSide:"not-moved-arrows",hide:"hide",flickityEnabled:"flickity-enabled",hiddenArrows:"hidden-arrows",flickityStatic:"flickity-static"},offsets$1={additionalOffsetWrapper:112};let Carousel=class extends HTMLElement{connectedCallback(){this.carousel=this.container.querySelector(selectors$$.carousel),this.carouselTrack=this.container.querySelector(selectors$$.carouselTrack),this.wrapper=this.container.closest(selectors$$.wrapper),this.section=this.container.closest(selectors$$.sectionHolder),this.slidesVisible=null,this.carouselInstance=null,this.carouselPrev=null,this.carouselNext=null,this.customOptions={},this.toggleWrapperModifierEvent=()=>this.toggleWrapperModifier(),this.carousel&&this.carousel.hasAttribute(selectors$$.recentlyViewHolder)?this.section.addEventListener("theme:recent-products:added",()=>{this.init()}):this.carousel&&this.carousel.hasAttribute(selectors$$.relatedHolder)?this.section.addEventListener("theme:related-products:added",()=>{this.init()}):this.init()}init(){this.carousel&&(this.slidesTotal=this.carousel.querySelectorAll(selectors$$.carouselSlide).length,this.getGridLayout(),this.trackVisibleSlides(),this.carousel.hasAttribute(selectors$$.carouselOptions)&&(this.customOptions=JSON.parse(decodeURIComponent(this.carousel.getAttribute(selectors$$.carouselOptions)))),this.initCarousel(),this.calculatedArrowsTopPosition(),this.toggleWrapperModifier(),document.addEventListener("theme:resize:width",this.toggleWrapperModifierEvent),this.carousel.hasAttribute(selectors$$.carouselWithProgress)&&this.progressBarCalculate(),this.carousel.hasAttribute(selectors$$.carouselCustomScrollbar)&&new CustomScrollbar(this.container))}initCarousel(){this.options={accessibility:!0,contain:!0,freeScroll:!0,prevNextButtons:!0,wrapArround:!1,groupCells:!1,autoPlay:!1,pageDots:!1,cellAlign:window.isRTL?"right":"left",rightToLeft:window.isRTL,dragThreshold:10,arrowShape:{x0:10,x1:60,y1:50,x2:67.5,y2:42.5,x3:25},on:{ready:()=>{this.removeIncorrectAria()},resize:()=>{this.toggleArrows(),this.calculatedArrowsTopPosition(),setTimeout(()=>{this.visibleSlides()},100)}},...this.customOptions},this.carouselInstance=new Flickity(this.carousel,this.options),this.carouselPrev=this.carousel.querySelector(selectors$$.carouselPrev),this.carouselNext=this.carousel.querySelector(selectors$$.carouselNext),this.container.addEventListener("theme:tab:change",()=>{this.carouselInstance.resize(),this.carouselPrev=this.carousel.querySelector(selectors$$.carouselPrev),this.carouselNext=this.carousel.querySelector(selectors$$.carouselNext)}),this.carouselInstance.on("dragStart",()=>{this.carouselInstance.slider.style.pointerEvents="none",resolution.isMobile||this.containDrag()}),this.carouselInstance.on("dragEnd",()=>{this.carouselInstance.slider.style.pointerEvents="auto",resolution.isMobile||this.containDrag()}),this.carouselInstance.on("change",index=>this.lockArrows(index)),setTimeout(()=>{this.visibleSlides()},100),Shopify.designMode&&setTimeout(()=>{this.carouselInstance.options.watchCSS&&!this.carousel.classList.contains(classe
12s$z.flickityEnabled)?(this.carouselInstance.destroy(),this.carouselInstance=new Flickity(this.carousel,this.options),this.carouselInstance.resize(),this.carouselPrev=this.carousel.querySelector(selectors$$.carouselPrev),this.carouselNext=this.carousel.querySelector(selectors$$.carouselNext)):this.carouselInstance.resize()},10),this.carousel.classList.toggle(classes$z.flickityStatic,this.smallItems===this.carousel.querySelectorAll(selectors$$.carouselSlide).length),new Siblings(this.container)}calculatedArrowsTopPosition(){const carouselFirstSlidePhoto=this.container.querySelector(selectors$$.carouselFirstSlidePhoto),pgiFirstSlidePhoto=this.container.querySelector(selectors$$.pgiFirstSlidePhoto);if(pgiFirstSlidePhoto){const buttonOffset=pgiFirstSlidePhoto.offsetHeight/2;this.carousel.style.setProperty("--buttons-top",`${buttonOffset}px`)}else if(carouselFirstSlidePhoto){const buttonOffset=carouselFirstSlidePhoto.offsetHeight/2;this.carousel.style.setProperty("--buttons-top",`${buttonOffset}px`)}}toggleWrapperModifier(){if(!this.wrapper)return;const scrollbarWidth=Number(getComputedStyle(document.documentElement).getPropertyValue("--scrollbar-width").replace("px","")),wrapperWidth=this.wrapper.clientWidth;this.wrapperWidthWithGutter=wrapperWidth+offsets$1.additionalOffsetWrapper+scrollbarWidth,window.innerWidth>=this.wrapperWidthWithGutter&&(this.wrapper.classList.remove(classes$z.arrowsForceTop),this.section.classList.add(classes$z.arrowsOnSide)),window.innerWidth<this.wrapperWidthWithGutter&&(this.wrapper.classList.add(classes$z.arrowsForceTop),this.section.classList.remove(classes$z.arrowsOnSide))}progressBarCalculate(){this.carouselInstance!==null&&this.carouselTrack&&this.carouselInstance.on("scroll",progress2=>{progress2=Math.max(0,Math.min(1,progress2))*100+"%",this.carouselTrack.style.width=progress2})}getGridLayout(){this.largeItems=Number(getComputedStyle(this.carousel).getPropertyValue("--grid-large-items"))||3,this.mediumItems=Number(getComputedStyle(this.carousel).getPropertyValue("--grid-medium-items"))||this.largeItems,this.smallItems=Number(getComputedStyle(this.carousel).getPropertyValue("--grid-small-items"))||this.mediumItems||this.largeItems}visibleSlides(){if(!this.carousel)return;this.getGridLayout();const carouselWidth=this.carousel.clientWidth||this.carouselInstance.size.width,slideWidth=this.carouselInstance!==null&&this.carouselInstance.selectedElement?this.carouselInstance.selectedElement.clientWidth:this.carousel.querySelector(selectors$$.carouselSlide).clientWidth,countSlides=this.carouselInstance!==null&&this.carouselInstance.slides?this.carouselInstance.slides.length:this.carousel.querySelectorAll(selectors$$.carouselSlide).length,numberOfVisibleSlides=Math.floor(carouselWidth/slideWidth);this.section.classList.remove(classes$z.hiddenArrows),this.carouselPrev&&this.carouselNext&&(this.carouselPrev.classList.remove(classes$z.hide),this.carouselNext.classList.remove(classes$z.hide)),window.innerWidth>window.theme.sizes.large&&!this.options.groupCells&&numberOfVisibleSlides<=this.largeItems&&countSlides<=this.largeItems&&this.carouselPrev&&this.carouselNext&&this.hideArrows(),window.innerWidth>=window.theme.sizes.medium&&window.innerWidth<=window.theme.sizes.large&&!this.options.groupCells&&numberOfVisibleSlides<=this.mediumItems&&countSlides<=this.mediumItems&&this.carouselPrev&&this.carouselNext&&this.hideArrows(),window.innerWidth<window.theme.sizes.medium&&!this.options.groupCells&&numberOfVisibleSlides<=this.smallItems&&countSlides<=this.smallItems&&this.carouselPrev&&this.carouselNext&&this.hideArrows()}trackVisibleSlides(){const isSmallDown=window.matchMedia(`(max-width: ${window.theme.sizes.medium-1}px)`),isTablet=window.matchMedia(`(min-width: ${window.theme.sizes.medium}px) and (max-width: ${window.theme.sizes.large-1}px)`),isDesktop2=window.matchMedia(`(min-width: ${window.theme.sizes.large}px)`);isSmallDown.addEventListener("change",event=>{event.matches&&(this.slidesVisible=this.smallItems)}),isSmallDown.matches&&(this.slidesVisible=this.smallItems),isTablet.addEventListener("change",event=>{event.matches&&(this.slidesVisible=this.mediumItems)}),isTablet.matches&&(this.slidesVisible=this.mediumItems),isDesktop2.addEventListener("change",event=>{event.matches&&(this.slidesVisible=this.largeItems)}),isDesktop2.matches&&(this.slidesVisible=this.largeItems)}containDrag(){const lastSelectableCell=this.slidesTotal-this.slidesVisible;this.carouselInstance.selectedIndex>=lastSelectableCell&&(this.carouselInstance.select(lastSelectableCell),this.lockArrows(this.carouselInstance.selectedIndex))}
12lockArrows(index){if(this.options.wrapAround||this.options.groupCells)return;const nextIndex=parseInt(index),lastSelectableCell=this.slidesTotal-this.slidesVisible;this.carouselNext.disabled=nextIndex>=lastSelectableCell}showArrows(){this.carouselPrev.classList.remove(classes$z.hide),this.carouselNext.classList.remove(classes$z.hide),this.section.classList.remove(classes$z.hiddenArrows)}hideArrows(){this.carouselPrev.classList.add(classes$z.hide),this.carouselNext.classList.add(classes$z.hide),this.section.classList.add(classes$z.hiddenArrows)}toggleArrows(){this.carouselPrev&&this.carouselNext&&(this.carouselPrev.disabled&&this.carouselNext.disabled?this.hideArrows():this.showArrows())}removeIncorrectAria(){this.carousel.querySelectorAll('[aria-hidden="true"]').forEach(el=>el.removeAttribute("aria-hidden"))}constructor(){super(),this.container=this}};customElements.get("flickity-carousel")||customElements.define("flickity-carousel",Carousel);const selectors$_={templateAddresses:"[data-address-wrapper]",addressNewForm:"[data-new-address-form]",addressNewFormInner:"[new-address-form-inner]",btnNew:".address-new-toggle",btnEdit:".address-edit-toggle",btnDelete:".address-delete",classHide:"hide",dataFormId:"data-form-id",dataConfirmMessage:"data-confirm-message",defaultConfirmMessage:"Are you sure you wish to delete this address?",editAddress:"#EditAddress",addressCountryNew:"AddressCountryNew",addressProvinceNew:"AddressProvinceNew",addressProvinceContainerNew:"AddressProvinceContainerNew",addressCountryOption:".address-country-option",addressCountry:"AddressCountry",addressProvince:"AddressProvince",addressProvinceContainer:"AddressProvinceContainer"};let Addresses=class{init(){if(this.addressNewForm){const section2=this.section,newAddressFormInner=this.addressNewForm.querySelector(selectors$_.addressNewFormInner);this.customerAddresses();const newButtons=section2.querySelectorAll(selectors$_.btnNew);newButtons.length&&newButtons.forEach(element=>{element.addEventListener("click",function(){newAddressFormInner.classList.toggle(selectors$_.classHide)})});const editButtons=section2.querySelectorAll(selectors$_.btnEdit);editButtons.length&&editButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$_.dataFormId);section2.querySelector(`${selectors$_.editAddress}_${formId}`).classList.toggle(selectors$_.classHide)})});const deleteButtons=section2.querySelectorAll(selectors$_.btnDelete);deleteButtons.length&&deleteButtons.forEach(element=>{element.addEventListener("click",function(){const formId=this.getAttribute(selectors$_.dataFormId),confirmMessage=this.getAttribute(selectors$_.dataConfirmMessage);confirm(confirmMessage||selectors$_.defaultConfirmMessage)&&Shopify.postLink(window.theme.routes.account_addresses_url+"/"+formId,{parameters:{_method:"delete"}})})})}}customerAddresses(){Shopify.CountryProvinceSelector&&new Shopify.CountryProvinceSelector(selectors$_.addressCountryNew,selectors$_.addressProvinceNew,{hideElement:selectors$_.addressProvinceContainerNew}),this.section.querySelectorAll(selectors$_.addressCountryOption).forEach(element=>{const formId=element.getAttribute(selectors$_.dataFormId),countrySelector=`${selectors$_.addressCountry}_${formId}`,provinceSelector=`${selectors$_.addressProvince}_${formId}`,containerSelector=`${selectors$_.addressProvinceContainer}_${formId}`;new Shopify.CountryProvinceSelector(countrySelector,provinceSelector,{hideElement:containerSelector})})}constructor(section2){this.section=section2,this.addressNewForm=this.section.querySelector(selectors$_.addressNewForm),this.init()}};const template=document.querySelector(selectors$_.templateAddresses);template&&new Addresses(template),(function(){var recoverPasswordForm=document.querySelector("#RecoverPassword");recoverPasswordForm&&customerLogin();function customerLogin(){var config2={recoverPasswordForm:"#RecoverPassword",hideRecoverPasswordLink:"#HideRecoverPasswordLink"};checkUrlHash(),resetPasswordSuccess(),document.querySelector(config2.recoverPasswordForm).addEventListener("click",onShowHidePasswordForm),document.querySelector(config2.hideRecoverPasswordLink).addEventListener("click",onShowHidePasswordForm);function onShowHidePasswordForm(evt){evt.preventDefault(),toggleRecoverPasswordForm()}function checkUrlHash(){var hash=window.location.hash;
12hash==="#recover"&&toggleRecoverPasswordForm()}function toggleRecoverPasswordForm(){var emailValue=document.querySelector("#CustomerEmail").value;document.querySelector("#RecoverEmail").value=emailValue,document.querySelector("#RecoverPasswordForm").classList.toggle("display-none"),document.querySelector("#CustomerLoginForm").classList.toggle("display-none")}function resetPasswordSuccess(){var formSuccess=document.querySelector(".reset-password-success");formSuccess&&document.querySelector("#ResetSuccess").classList.remove("display-none")}}})(),window.Shopify=window.Shopify||{},window.Shopify.theme=window.Shopify.theme||{},window.Shopify.theme.sections=window.Shopify.theme.sections||{},window.Shopify.theme.sections.registered=window.Shopify.theme.sections.registered||{},window.Shopify.theme.sections.instances=window.Shopify.theme.sections.instances||[];const registered=window.Shopify.theme.sections.registered,instances=window.Shopify.theme.sections.instances,selectors$Z={id:"data-section-id",type:"data-section-type"};let Registration=class{getStack(){return this.callStack}constructor(type=null,components=[]){this.type=type,this.components=validateComponentsArray(components),this.callStack={onLoad:[],onUnload:[],onSelect:[],onDeselect:[],onBlockSelect:[],onBlockDeselect:[],onReorder:[]},components.forEach(comp=>{for(const[key,value]of Object.entries(comp)){const arr=this.callStack[key];Array.isArray(arr)&&typeof value=="function"?arr.push(value):(console.warn(`Unregisted function: '${key}' in component: '${this.type}'`),console.warn(value))}})}},Section=class{callFunctions(key,e=null){this.callStack[key].forEach(func=>
12{const props={id:this.id,type:this.type,container:this.container};e?func.call(props,e):func.call(props)})}onLoad(){this.callFunctions("onLoad")}onUnload(){this.callFunctions("onUnload")}onSelect(e){this.callFunctions("onSelect",e)}onDeselect(e){this.callFunctions("onDeselect",e)}onBlockSelect(e){this.callFunctions("onBlockSelect",e)}onBlockDeselect(e){this.callFunctions("onBlockDeselect",e)}onReorder(e){this.callFunctions("onReorder",e)}constructor(container,registration){this.container=validateContainerElement(container),this.id=container.getAttribute(selectors$Z.id),this.type=registration.type,this.callStack=registration.getStack();try{this.onLoad()}catch(e){console.warn(`Error in section: ${this.id}`),console.warn(this),console.error(e)}}};function validateContainerElement(container){if(!(container instanceof Element))throw new TypeError("Theme Sections: Attempted to load section. The section container provided is not a DOM element.");if(container.getAttribute(selectors$Z.id)===null)throw new Error("Theme Sections: The section container provided does not have an id assigned to the "+selectors$Z.id+" attribute.");return container}function validateComponentsArray(value){if(typeof value<"u"&&typeof value!="object"||value===null)throw new TypeError("Theme Sections: The components object provided is not a valid");return value}function register(type,components){if(typeof type!="string")throw new TypeError("Theme Sections: The first argument for .register must be a string that specifies the type of the section being registered");if(typeof registered[type]<"u")throw new Error('Theme Sections: A section of type "'+type+'" has already been registered. You cannot register the same section type twice');Array.isArray(components)||(components=[components]);const section2=new Registration(type,components);return registered[type]=section2,registered}function load(types,containers){types=normalizeType(types),typeof containers>"u"&&(containers=document.querySelectorAll("["+selectors$Z.type+"]")),containers=normalizeContainers(containers),types.forEach(function(type){const registration=registered[type];typeof registration>"u"||(containers=containers.filter(function(container){return isInstance(container)||container.getAttribute(selectors$Z.type)===null?!1:container.getAttribute(selectors$Z.type)!==type?!0:(instances.push(new Section(container,registration)),!1)}))})}function unload(selector){var instancesToUnload=getInstances(selector);instancesToUnload.forEach(function(instance){var index=instances.map(function(e){return e.id}).indexOf(instance.id);instances.splice(index,1),instance.onUnload()})}function reorder(selector){var instancesToReorder=getInstances(selector);instancesToReorder.forEach(function(instance){instance.onReorder()})}function getInstances(selector){var filteredInstances=[];if(NodeList.prototype.isPrototypeOf(selector)||Array.isArray(selector))var firstElement=selector[0];if(selector instanceof Element||firstElement instanceof Element){var containers=normalizeContainers(selector);containers.forEach(function(container){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.container===container}))})}else if(typeof selector=="string"||typeof firstElement=="string"){var types=normalizeType(selector);types.forEach(function(type){filteredInstances=filteredInstances.concat(instances.filter(function(instance){return instance.type===type}))})}return filteredInstances}function getInstanceById(id){for(var instance,i=0;i<instances.length;i++)if(instances[i].id===id){instance=instances[i];break}return instance}function isInstance(selector){return getInstances(selector).length>0}function normalizeType(types){return types==="*"?types=Object.keys(registered):typeof types=="string"?types=[types]:types.constructor===Section?types=[types.prototype.type]:Array.isArray(types)&&types[0].constructor===Section&&(types=types.map(function(Section1){return Section1.type})),types=types.map(function(type){return type.toLowerCase()}),types}function normalizeContainers(containers){return NodeList.prototype.isPrototypeOf(containers
12)&&containers.length>0?containers=Array.prototype.slice.call(containers):NodeList.prototype.isPrototypeOf(containers)&&containers.length===0?containers=[]:containers===null?containers=[]:!Array.isArray(containers)&&containers instanceof Element&&(containers=[containers]),containers}window.Shopify.designMode&&(document.addEventListener("shopify:section:load",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$Z.id+'="'+id+'"]');container!==null&&load(container.getAttribute(selectors$Z.type),container)}),document.addEventListener("shopify:section:reorder",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$Z.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&reorder(container)}),document.addEventListener("shopify:section:unload",function(event){var id=event.detail.sectionId,container=event.target.querySelector("["+selectors$Z.id+'="'+id+'"]'),instance=getInstances(container)[0];typeof instance=="object"&&unload(container)}),document.addEventListener("shopify:section:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onSelect(event)}),document.addEventListener("shopify:section:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onDeselect(event)}),document.addEventListener("shopify:block:select",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockSelect(event)}),document.addEventListener("shopify:block:deselect",function(event){var instance=getInstanceById(event.detail.sectionId);typeof instance=="object"&&instance.onBlockDeselect(event)}));function forceFocus(element,options2){options2=options2||{},element.focus(),typeof options2.className<"u"&&element.classList.add(options2.className),element.addEventListener("blur",callback);function callback(event){event.target.removeEventListener(event.type,callback),typeof options2.className<"u"&&element.classList.remove(options2.className)}}function focusHash(options2){options2=options2||{};var hash=window.location.hash,element=document.getElementById(hash.slice(1));if(element&&options2.ignore&&element.matches(options2.ignore))return!1;hash&&element&&forceFocus(element,options2)}function bindInPageLinks(options2){options2=options2||{};var links=Array.prototype.slice.call(document.querySelectorAll('a[href^="#"]'));function queryCheck(selector){return document.getElementById(selector)!==null}return links.filter(function(link){if(link.hash==="#"||link.hash===""||options2.ignore&&link.matches(options2.ignore)||!queryCheck(link.hash.substr(1)))return!1;var element=document.querySelector(link.hash);return element?(link.addEventListener("click",function(){forceFocus(element,options2)}),!0):!1})}function focusable$2(container){var elements=Array.prototype.slice.call(container.querySelectorAll("[tabindex],[draggable],a[href],area,button:enabled,input:not([type=hidden]):enabled,object,select:enabled,textarea:enabled[data-focus-element]"));return elements.filter(function(element){return!!(element.offsetWidth||element.offsetHeight||element.getClientRects().length)})}var trapFocusHandlers={};function trapFocus(container,options2){options2=options2||{};var elements=focusable$2(container),elementToFocus=options2.elementToFocus||container,first=elements[0],last=elements[elements.length-1];removeTrapFocus(),trapFocusHandlers.focusin=function(event){container!==event.target&&!container.contains(event.target)&&first&&first===event.target&&first.focus(),!(event.target!==container&&event.target!==last&&event.target!==first)&&document.addEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.focusout=function(){document.removeEventListener("keydown",trapFocusHandlers.keydown)},trapFocusHandlers.keydown=function(event){event.code==="Tab"&&(event.target===last&&!event.shiftKey&&(event.preventDefault(),first.focus()),(event.target===container||event.target===first)&&event.shiftKey&&(event.preventDefault(),last.focus()))},document.addEventListener("focusout",trapFocusHandlers.focusout),document.addEventListener("focusin",trapFocusHandlers.focusin),forceFocus(elementToFocus,options2)}function removeTrapFocus(){document.removeEventListener("focusin",trapFocusHandlers.focusin),document.removeEventListener("focusout",trapFocusHandlers.focusout),document.removeEventListener("keydown",trapFocusHandlers.keydown)}function accessibleLinks(elements,options2){if(typeof elements!="str
12ing")throw new TypeError(elements+" is not a String.");if(elements=document.querySelectorAll(elements),elements.length===0)return;options2=options2||{},options2.messages=options2.messages||{};var messages1={newWindow:options2.messages.newWindow||"Opens in a new window.",external:options2.messages.external||"Opens external website.",newWindowExternal:options2.messages.newWindowExternal||"Opens external website in a new window."},prefix2=options2.prefix||"a11y",messageSelectors={newWindow:prefix2+"-new-window-message",external:prefix2+"-external-message",newWindowExternal:prefix2+"-new-window-external-message"};function generateHTML(messages){var container=document.createElement("ul"),htmlMessages=Object.keys(messages).reduce(function(html,key){return html+="<li id="+messageSelectors[key]+">"+messages[key]+"</li>"},"");container.setAttribute("hidden",!0),container.innerHTML=htmlMessages,document.body.appendChild(container)}function externalSite(link){return link.hostname!==window.location.hostname}elements.forEach(function(link){var target=link.getAttribute("target"),rel=link.getAttribute("rel"),isExternal=externalSite(link),isTargetBlank=target==="_blank",missingRelNoopener=rel===null||rel.indexOf("noopener")===-1;if(isTargetBlank&&missingRelNoopener){var relValue=rel===null?"noopener":rel+" noopener";link.setAttribute("rel",relValue)}isExternal&&isTargetBlank?link.setAttribute("aria-describedby",messageSelectors.newWindowExternal):isExternal?link.setAttribute("aria-describedby",messageSelectors.external):isTargetBlank&&link.setAttribute("aria-describedby",messageSelectors.newWindow)}),generateHTML(messages1)}var a11y=Object.freeze({__proto__:null,accessibleLinks,bindInPageLinks,focusHash,focusable:focusable$2,forceFocus,removeTrapFocus,trapFocus});const selectors$Y={focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])'};function modal(unique){const uniqueID=`data-popup-${unique}`;MicroModal.init({openTrigger:uniqueID,disableScroll:!0,onShow:(modal1,el,event)=>{event.preventDefault();const firstFocus=modal1.querySelector(selectors$Y.focusable);trapFocus(modal1,{elementToFocus:firstFocus})},onClose:(modal2,el,event)=>{event.preventDefault(),removeTrapFocus(),el.focus()}})}const selectors$X={trigger:"[data-toggle-password-modal]",errors:".storefront-password-form .errors"},sections$l={};let PasswordPage=class{init(){modal("password"),this.errors&&this.trigger.click()}constructor(section2){this.container=section2.container,this.trigger=this.container.querySelector(selectors$X.trigger),this.errors=this.container.querySelector(selectors$X.errors),this.init()}};register("password",{onLoad(){sections$l[this.id]=new PasswordPage(this)}}),(function(){var config2={qrCode:"#QrCode",giftCardCode:".giftcard__code"};const qrCode=document.querySelector(config2.qrCode);if(qrCode){let loadGiftCard=function(){const qrCodeText=qrCode.getAttribute("data-identifier");new QRCode(qrCode,{text:qrCodeText,width:120,height:120})};window.addEventListener("load",loadGiftCard)}const giftCardCode=document.querySelector(config2.giftCardCode);if(giftCardCode){let selectText=function(){var text=document.querySelector("#GiftCardDigits"),range="";if(document.body.createTextRange)range=document.body.createTextRange(),range.moveToElementText(text),range.select();else if(window.getSelection){var selection=window.getSelection();range=document.createRange(),range.selectNodeContents(text),selection.removeAllRanges(),selection.addRange(range)}};giftCardCode.addEventListener("click",selectText())}})();const selectors$W={parallaxWrapper:"[data-parallax-wrapper]",parallaxImg:"[data-parallax-img]"};let sections$k={};const parallaxImage={onLoad(){sections$k[this.id]=[],this.container.querySelectorAll(selectors$W.parallaxWrapper).forEach(frame2=>{const inner=frame2.querySelector(selectors$W.parallaxImg);sections$k[this.id].push(new Rellax(inner,{center:!0,round:!0,frame:frame2}))})},onUnload:function(){sections$k[this.id].forEach(image=>{typeof image.destroy=="function"&&image.destroy()})}};register("article",parallaxImage);const selectors$V={frame:"[data-ticker-frame]",scale:"[data-ticker-scale]",text:"[data-ticker-text]"},attributes$1={clone:"data-clone",ariaHidden:"aria-hidden"},classes$y={animationClass:"ticker--animated",unloadedClass:"ticker--unloaded",comparitorClass:"ticker__comparitor"},sections$j={};let Ticker=class{init(){this.addComparitor(),this.resizeEvent=debounce$1(()=>this.checkWidth(),300),this.listen()}addComparitor(){this.comparitor=this.text.cloneNode(!0),this.comparitor.classList.add(classes$y.comparitorClass),this.frame.appendChild(this.comparitor),this.scale.classList.remove(classes$y.unloadedClass)}unload(){document.removeEventListener("theme:resize",this.resizeEvent)}listen(){document.addEventListener("theme:resize",this.resizeEvent),this.checkWidth()}checkWidth(){const padding=window.getComputedStyle(this.frame).paddingLeft.replace("px","")*2;
12if(Array.from(this.text.parentNode.children).forEach(child=>{child.classList.add(classes$y.animationClass)}),this.frame.clientWidth-padding<this.comparitor.clientWidth||this.stopClone){if(this.scale.childElementCount===1&&(this.clone=this.text.cloneNode(!0),this.clone.setAttribute(attributes$1.ariaHidden,!0),this.clone.setAttribute(attributes$1.clone,""),this.scale.appendChild(this.clone),this.stopClone))for(let index=0;index<10;index++){const cloneSecond=this.text.cloneNode(!0);cloneSecond.setAttribute(attributes$1.ariaHidden,!0),cloneSecond.setAttribute(attributes$1.clone,""),this.scale.appendChild(cloneSecond)}const animationTimeFrame=this.text.clientWidth/this.space*this.timeIndex;this.scale.style.setProperty("--animation-time",`${animationTimeFrame}s`)}else{let clone2=this.scale.querySelector(`[${attributes$1.clone}]`);clone2&&this.scale.removeChild(clone2),this.text.classList.remove(classes$y.animationClass)}}constructor(el,stopClone=!1){this.frame=el,this.stopClone=stopClone,this.scale=this.frame.querySelector(selectors$V.scale),this.text=this.frame.querySelector(selectors$V.text),this.space=100,this.timeIndex=1.63,this.init()}};const ticker={onLoad(){sections$j[this.id]=[],this.container.querySelectorAll(selectors$V.frame).forEach(el=>{sections$j[this.id].push(new Ticker(el))})},onUnload(){sections$j[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}},selectors$U={frame:"[data-ticker-frame]",slideValue:"data-slide",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]"},classes$x={trickerAnimated:"ticker--animated"},sections$i={};let Bar=class{init(){this.initTickers(!0)}initTickers(stopClone=!1){const frame2=this.container.querySelector(selectors$U.frame);frame2&&new Ticker(frame2,stopClone)}toggleTicker(e,isStopped){const tickerScale=this.container.querySelector(selectors$U.tickerScale),element=this.container.querySelector(`[${selectors$U.slideValue}="${e.detail.blockId}"]`);if(!(!element||!tickerScale)){if(isStopped){const gutter=Number(getComputedStyle(element).getPropertyValue("--gutter").replace("px","")),leftPosition=-(element.offsetLeft-gutter);tickerScale.setAttribute("data-stop",""),tickerScale.querySelectorAll(selectors$U.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes$x.trickerAnimated),textHolder.style.transform=`translate3d(${leftPosition}px, 0, 0)`})}isStopped||(tickerScale.querySelectorAll(selectors$U.tickerText).forEach(textHolder=>{textHolder.classList.add(classes$x.trickerAnimated),textHolder.removeAttribute("style")}),tickerScale.removeAttribute("data-stop"))}}onBlockSelect(e){this.toggleTicker(e,!0)}onBlockDeselect(e){this.toggleTicker(e,!1)}constructor(section2){this.container=section2.container,this.init()}};register("logos",{onLoad(){sections$i[this.id]=[],sections$i[this.id].push(new Bar(this))},onBlockSelect(e){sections$i[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections$i[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockDeselect(e)})}}),register("blog",parallaxImage);var selectors$T={drawerWrappper:"[data-drawer]",drawerScrolls:"[data-drawer-scrolls]",input:"[data-predictive-search-input]",underlay:"[data-drawer-underlay]",stagger:"[data-stagger-animation]",drawerToggle:"data-drawer-toggle",firstFocus:"data-first-focus",children:":scope > * > [data-animates]",focusable:'button, [href], select, textarea, [tabindex]:not([tabindex="-1"])'},classes$w={isVisible:"drawer--visible",displayNone:"display-none"},sections$h={};let Drawer=class{unload(){}connectToggle(){this.buttons.forEach(btn=>{btn.addEventListener("click",(function(e){e.preventDefault(),this.drawer.dispatchEvent(new CustomEvent("theme:drawer:toggle",{bubbles:!1}))}).bind(this))})}connectDrawer(){this.drawer.addEventListener("theme:drawer:toggle",(function(){this.drawer.classList.contains(classes$w.isVisible)?this.drawer.dispatchEvent(new CustomEvent("theme:drawer:close",{bubbles:!1})):this.drawer.dispatchEvent(new CustomEvent("theme:drawer:open",{bubbles:!1}))}).bind(this)),this.drawer.addEventListener("theme:drawer:close",this.hideDrawer.bind(this)),this.drawer.addEventListener("theme:drawer:open",this.showDrawer.bind(this))}
12staggerChildAnimations(){this.staggers.forEach(el=>{el.querySelectorAll(selectors$T.children).forEach((child,index)=>{child.style.transitionDelay=`${index*50+10}ms`})})}closers(){this.drawer.addEventListener("keyup",(function(evt){evt.code==="Escape"&&this.hideDrawer()}).bind(this)),this.underlay.addEventListener("click",(function(){this.hideDrawer()}).bind(this))}setFocus(){const closeButton=this.drawer.querySelector(selectors$T.firstFocus);trapFocus(this.drawer,{elementToFocus:closeButton})}showDrawer(){this.drawer.classList.remove(classes$w.displayNone),setTimeout(()=>{this.buttons.forEach(el=>el.setAttribute("aria-expanded",!0)),this.drawer.classList.add(classes$w.isVisible),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.drawerScrolls})),this.drawer.addEventListener("transitionend",this.setFocus.bind(this),{once:!0}),this.drawer.addEventListener("transitioncancel",this.setFocus.bind(this),{once:!0})},1)}hideDrawer(){window.theme.state.cartOpen=!1,this.buttons.forEach(el=>el.setAttribute("aria-expanded",!0)),this.drawer.classList.remove(classes$w.isVisible),this.drawerScrolls.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),document.dispatchEvent(new CustomEvent("theme:sliderule:close",{bubbles:!1})),removeTrapFocus(),this.buttons[0].focus({preventScroll:!0}),setTimeout(()=>{this.drawer.classList.contains(classes$w.isVisible)||this.drawer.classList.add(classes$w.displayNone)},800)}constructor(el){this.drawer=el,this.drawerScrolls=this.drawer.querySelector(selectors$T.drawerScrolls),this.underlay=this.drawer.querySelector(selectors$T.underlay),this.key=this.drawer.dataset.drawer;const btnSelector=`[${selectors$T.drawerToggle}='${this.key}']`;this.buttons=document.querySelectorAll(btnSelector),this.staggers=this.drawer.querySelectorAll(selectors$T.stagger),this.connectToggle(),this.connectDrawer(),this.closers(),this.staggerChildAnimations()}};const drawer={onLoad(){sections$h[this.id]=[],this.container.querySelectorAll(selectors$T.drawerWrappper).forEach(el=>{sections$h[this.id].push(new Drawer(el))})},onUnload:function(){sections$h[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}},selectors$S={announcement:"[data-announcement-bar]",transparent:"data-header-transparent",header:"[data-header-wrapper] header"},classes$v={stuck:"js__header__stuck",stuckAnimated:"js__header__stuck--animated",triggerAnimation:"js__header__stuck--trigger-animation",stuckBackdrop:"js__header__stuck__backdrop"};let sections$g={},Sticky=class{unload(){document.removeEventListener("theme:scroll",this.listen),document.removeEventListener("theme:scroll:up",this.scrollUpDirectional),document.removeEventListener("theme:scroll:down",this.scrollDownDirectional)}listen(){(this.sticks||this.animated)&&document.addEventListener("theme:scroll",e=>{e.detail.down?(!this.currentlyStuck&&e.detail.position>this.stickDown&&this.stickSimple(),!this.currentlyBlurred&&e.detail.position>this.blur&&this.addBlur()):(e.detail.position<=this.stickUp&&this.unstickSimple(),e.detail.position<=this.blur&&this.removeBlur())}),this.animated&&(document.addEventListener("theme:scroll:up",this.scrollUpDirectional.bind(this)),document.addEventListener("theme:scroll:down",this.scrollDownDirectional.bind(this)))}stickSimple(){this.animated&&this.cls.add(classes$v.stuckAnimated),this.cls.add(classes$v.stuck),this.wrapper.setAttribute(selectors$S.transparent,!1),this.currentlyStuck=!0}unstickSimple(){this.cls.remove(classes$v.stuck),this.wrapper.setAttribute(selectors$S.transparent,this.transparent),this.animated&&this.cls.remove(classes$v.stuckAnimated),this.currentlyStuck=!1}scrollDownInit(){window.scrollY>this.stickDown&&this.stickSimple(),window.scrollY>this.blur&&this.addBlur()}stickDirectional(){this.cls.add(classes$v.triggerAnimation)}unstickDirectional(){this.cls.remove(classes$v.triggerAnimation)}scrollDownDirectional(){this.unstickDirectional()}scrollUpDirectional(){window.scrollY<=this.stickDown?this.unstickDirectional():this.stickDirectional()}addBlur(){this.cls.add(classes$v.stuckBackdrop),this.currentlyBlurred=!0}
12removeBlur(){this.cls.remove(classes$v.stuckBackdrop),this.currentlyBlurred=!1}constructor(el){this.wrapper=el,this.type=this.wrapper.dataset.headerSticky,this.transparent=this.wrapper.dataset.headerTransparent,this.sticks=this.type==="sticky",this.animated=this.type==="directional",this.currentlyStuck=!1,this.cls=this.wrapper.classList;const announcementEl=document.querySelector(selectors$S.announcement),announcementHeight=announcementEl?announcementEl.clientHeight:0,headerHeight=document.querySelector(selectors$S.header).clientHeight;this.blur=headerHeight+announcementHeight,this.stickDown=headerHeight+announcementHeight,this.stickUp=announcementHeight,this.wrapper.getAttribute(selectors$S.transparent)!=="false"&&(this.blur=announcementHeight),this.sticks&&(this.stickDown=announcementHeight,this.scrollDownInit()),this.listen()}};const stickyHeader={onLoad(){sections$g=new Sticky(this.container)},onUnload:function(){typeof sections$g.unload=="function"&&sections$g.unload()}},selectors$R={disclosureToggle:"data-hover-disclosure-toggle",disclosureWrappper:"[data-hover-disclosure]",link:"[data-top-link]",wrapper:"[data-header-wrapper]",stagger:"[data-stagger]",staggerPair:"[data-stagger-first]",staggerAfter:"[data-stagger-second]",staggerItem:"[data-header-megamenu-item]"},classes$u={isVisible:"is-visible",meganavVisible:"meganav--visible",grandparent:"grandparent"};let sections$f={},disclosures={},HoverDisclosure=class{onBlockSelect(evt){this.disclosure.contains(evt.target)&&this.showDisclosure()}onBlockDeselect(evt){this.disclosure.contains(evt.target)&&this.hideDisclosure()}showDisclosure(){this.grandparent?this.wrapper.classList.add(classes$u.meganavVisible):this.wrapper.classList.remove(classes$u.meganavVisible),this.trigger.setAttribute("aria-expanded",!0),this.trigger.classList.add(classes$u.isVisible),this.disclosure.classList.add(classes$u.isVisible)}hideDisclosure(){this.disclosure.classList.remove(classes$u.isVisible),this.trigger.classList.remove(classes$u.isVisible),this.trigger.setAttribute("aria-expanded",!1),this.wrapper.classList.remove(classes$u.meganavVisible)}staggerChildAnimations(){this.disclosure.querySelectorAll(selectors$R.stagger).forEach((el,index)=>{el.style.transitionDelay=`${index*50+10}ms`}),this.disclosure.querySelectorAll(selectors$R.staggerPair).forEach((child,i)=>{const d1=i*150;child.style.transitionDelay=`${d1}ms`,child.parentElement.querySelectorAll(selectors$R.staggerAfter).forEach((grandchild,i2)=>{const d2=(i2+1)*20;grandchild.style.transitionDelay=`${d1+d2}ms`})}),this.disclosure.querySelectorAll(selectors$R.staggerItem).forEach((el,index)=>{el.style.transitionDelay=`${(index+1)*80}ms`})}handleTablets(){this.trigger.addEventListener("touchstart",(function(e){this.disclosure.classList.contains(classes$u.isVisible)||(e.preventDefault(),this.showDisclosure())}).bind(this),{passive:!0})}connectHoverToggle(){this.trigger.addEventListener("pointerenter",this.showDisclosure.bind(this)),this.link.addEventListener("focus",this.showDisclosure.bind(this)),this.trigger.addEventListener("pointerleave",this.hideDisclosure.bind(this)),this.trigger.addEventListener("focusout",(function(e){this.trigger.contains(e.relatedTarget)||this.hideDisclosure()}).bind(this)),this.disclosure.addEventListener("keyup",(function(evt){evt.code==="Escape"&&this.hideDisclosure()}).bind(this))}constructor(el){this.disclosure=el,this.wrapper=el.closest(selectors$R.wrapper),this.key=this.disclosure.id;const btnSelector=`[${selectors$R.disclosureToggle}='${this.key}']`;this.trigger=document.querySelector(btnSelector),this.link=this.trigger.querySelector(selectors$R.link),this.grandparent=this.trigger.classList.contains(classes$u.grandparent),this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.connectHoverToggle(),this.handleTablets(),this.staggerChildAnimations()}};const hoverDisclosure={onLoad(){sections$f[this.id]=[],disclosures=this.container.querySelectorAll(selectors$R.disclosureWrappper),disclosures.forEach(el=>{sections$f[this.id].push(new HoverDisclosure(el))})}
12,onBlockSelect(evt){sections$f[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$f[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})},onUnload:function(){sections$f[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()})}},selectors$Q={item:"[data-main-menu-text-item]",wrapper:"[data-text-items-wrapper]",text:".navtext",isActive:"data-menu-active",sectionOuter:"[data-header-wrapper]",underlineCurrent:"data-underline-current",defaultItem:".menu__item.main-menu--active .navtext, .header__desktop__button.main-menu--active .navtext"};let sections$e={},defaultPositions=null,HoverLine=class{init(){if(this.itemList.length){if(this.listen(),this.listenResize(),this.textBottom=null,this.setHeight(),defaultPositions){if(this.defaultItem){const startingLeft=Math.round(this.defaultItem.getBoundingClientRect().left)||0;this.sectionOuter.style.setProperty("--bar-left",`${startingLeft}px`)}this.reset()}else{const startingLeft=Math.round(this.sectionOuter.querySelector(selectors$Q.item).getBoundingClientRect().left);this.sectionOuter.style.setProperty("--bar-left",`${startingLeft}px`),this.sectionOuter.style.setProperty("--bar-width","0px")}this.sectionOuter.style.setProperty("--bar-opacity","1")}}unload(){document.removeEventListener("theme:resize",this.reset),defaultPositions=null}listenResize(){document.addEventListener("theme:resize",this.reset.bind(this))}setDefault(){this.defaultItem&&(defaultPositions={left:Math.round(this.defaultItem.getBoundingClientRect().left)||null,width:this.defaultItem.clientWidth||null})}setHeight(){const height=this.wrapper.clientHeight,textHeight=this.itemList[0].querySelector(selectors$Q.text).clientHeight,textBottom=Math.floor(height/2-textHeight/2)-4;this.textBottom!==textBottom&&textHeight>0&&(this.sectionOuter.style.setProperty("--bar-text",`${textHeight}px`),this.sectionOuter.style.setProperty("--bar-bottom",`${textBottom}px`),this.textBottom=textBottom)}listen(){this.itemList.forEach(element=>{element.addEventListener("pointerenter",evt=>{const item=evt.target.querySelector(selectors$Q.text);this.startBar(item)})}),this.wrapper.addEventListener("pointerleave",this.clearBar.bind(this))}startBar(item){this.setHeight();let active=this.sectionOuter.getAttribute(selectors$Q.isActive)!=="false",left=Math.round(item.getBoundingClientRect().left),width=item.clientWidth;active?this.render(width,left):(this.sectionOuter.setAttribute(selectors$Q.isActive,!0),this.render(0,left),setTimeout(()=>{this.render(width,left)},10))}render(width,left){this.sectionOuter.style.setProperty("--bar-left",`${left}px`),this.sectionOuter.style.setProperty("--bar-width",`${width}px`)}reset(){this.setDefault(),defaultPositions&&defaultPositions.left&&defaultPositions.width?(this.sectionOuter.style.setProperty("--bar-left",`${defaultPositions.left}px`),this.sectionOuter.style.setProperty("--bar-width",`${defaultPositions.width}px`)):this.sectionOuter.style.setProperty("--bar-width","0px")}clearBar(){this.sectionOuter.setAttribute(selectors$Q.isActive,!1),setTimeout(()=>{this.sectionOuter.getAttribute(selectors$Q.isActive)!=="false"||this.reset()},150)}constructor(el){this.wrapper=el,this.itemList=this.wrapper.querySelectorAll(selectors$Q.item),this.sectionOuter=document.querySelector(selectors$Q.sectionOuter),this.underlineCurrent=this.sectionOuter.getAttribute(selectors$Q.underlineCurrent)==="true",this.defaultItem=null,this.underlineCurrent&&(this.defaultItem=this.wrapper.querySelector(selectors$Q.defaultItem)),this.setDefault(),document.fonts.ready.then(()=>{this.init()})}};const hoverUnderline={onLoad(){sections$e[this.id]=[],this.container.querySelectorAll(selectors$Q.wrapper).forEach(el=>{sections$e[this.id].push(new HoverLine(el))})},onUnload:function(){sections$e[this.id].forEach(el=>{typeof el.unload=="function"&&el.unload()}),delete sections$e[this.id]}},selectors$P={price:"data-header-cart-price",count:"data-header-cart-count",dot:"data-header-cart-full"};let Totals=class{listen(){document.addEventListener("theme:cart:change",(function(event){this.cart=event.detail.cart,this.update()}).bind(this))}
12update(){this.cart&&(this.prices.forEach(price=>{price.setAttribute(selectors$P.price,this.cart.total_price);const newTotal=themeCurrency.formatMoney(this.cart.total_price,theme.moneyFormat);price.innerHTML=newTotal}),this.counts.forEach(count=>{count.setAttribute(selectors$P.count,this.cart.item_count),count.innerHTML=`(${this.cart.item_count})`}),this.dots.forEach(dot=>{const full=this.cart.item_count>0;dot.setAttribute(selectors$P.dot,full)}))}constructor(el){this.section=el,this.counts=this.section.querySelectorAll(`[${selectors$P.count}]`),this.prices=this.section.querySelectorAll(`[${selectors$P.price}]`),this.dots=this.section.querySelectorAll(`[${selectors$P.dot}]`),this.cart=null,this.listen()}};const headerTotals={onLoad(){new Totals(this.container)}},selectors$O={wrapper:"[data-search-popdown-wrap]",popdownTrigger:"data-popdown-toggle",close:"[data-close-popdown]",input:"[data-predictive-search-input]",underlay:"[data-search-underlay]"},classes$t={underlayVisible:"underlay--visible",isVisible:"is-visible"};let sections$d={},SearchPopdownTriggers=class{initTriggerEvents(){this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.trigger.addEventListener("click",(function(evt){evt.preventDefault(),this.showPopdown()}).bind(this)),this.trigger.addEventListener("keyup",(function(evt){evt.code==="Space"&&this.showPopdown()}).bind(this))}initPopdownEvents(){this.popdown.addEventListener("keyup",(function(evt){evt.code==="Escape"&&this.hidePopdown()}).bind(this)),this.close.addEventListener("click",(function(){this.hidePopdown()}).bind(this)),this.underlay.addEventListener("click",(function(){this.hidePopdown()}).bind(this))}hidePopdown(){this.popdown.classList.remove(classes$t.isVisible),this.underlay.classList.remove(classes$t.underlayVisible),this.trigger.focus(),removeTrapFocus(),this.popdown.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))}showPopdown(){this.popdown.classList.add(classes$t.isVisible),this.underlay.classList.add(classes$t.underlayVisible),trapFocus(this.popdown,{elementToFocus:this.input}),this.popdown.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}))}constructor(trigger2){this.trigger=trigger2,this.key=this.trigger.getAttribute(selectors$O.popdownTrigger),this.popdown=document.querySelector(`[id='${this.key}']`),this.input=this.popdown.querySelector(selectors$O.input),this.close=this.popdown.querySelector(selectors$O.close),this.wrapper=this.popdown.closest(selectors$O.wrapper),this.underlay=this.wrapper.querySelector(selectors$O.underlay),this.initTriggerEvents(),this.initPopdownEvents()}};const searchPopdown={onLoad(){sections$d[this.id]={};const trigger2=this.container.querySelector(`[${selectors$O.popdownTrigger}]`);trigger2&&(sections$d[this.id]=new SearchPopdownTriggers(trigger2))},onUnload:function(){typeof sections$d[this.id].unload=="function"&&sections$d[this.id].unload()}},selectors$N={wrapper:"[data-product-add-popdown-wrapper]",closeDrawer:"[data-close-popdown]",apiContent:"[data-api-content]",cartAjaxEnabled:'[data-ajax-disable="false"]',cartAjaxDisabled:'[data-ajax-disable="true"]',cartToggleButton:'[data-drawer-toggle="drawer-cart"]',cartDrawer:'[data-drawer="drawer-cart"]'},classes$s={visible:"is-visible",focusEnable:"focus-enabled"};let globalTimer,CartPopdown=class{renderPopdown(event){const variant=event.detail.variant,url=`${window.theme.routes.root_url}variants/${variant.id}/?section_id=api-product-popdown`,instance=this;axios.get(url).then(function(response){const fresh=document.createElement("div");if(fresh.innerHTML=response.data,instance.popdown.innerHTML=fresh.querySelector(selectors$N.apiContent).innerHTML,instance.connectCartButton(),instance.connectCloseButton(),document.body.classList.contains(classes$s.focusEnable)){const cartButton=instance.popdown.querySelector(selectors$N.cartToggleButton);setTimeout(()=>{cartButton.focus()},0)}}).catch(function(error2){console.warn(error2)})}connectCloseButton(){this.popdown.classList.add(classes$s.visible),this.popdown.querySelector(selectors$N.closeDrawer).addEventListener("click",(function(e){e.preventDefault(),this.popdown.classList.remove(classes$s.visible)}).bind(this)),this.popdownTimer()}connectCartButton(){const cartButton=this.popdown.querySelector(selectors$N.cartToggleButton),cartDrawer2=document.querySelector(selectors$N.cartDrawer);cartDrawer2&&cartButton.addEventListener("click",(function(e){e.preventDefault(),this.popdown.classList.remove(classes$s.visible),cartDrawer2.dispatchEvent(new CustomEvent("theme:drawer:open",{bubbles:!1}))}).bind(this))}popdownTimer(){clearTimeout(globalTimer),globalTimer=setTimeout(()=>{this.popdown.contains(document.activeElement)?this.popdownTimer():this.popdown.classList.remove(classes$s.visible)},5e3)}constructor(){this.popdown=document.querySelector(selectors$N.wrapper),this.cartAjaxEnabled=document.querySelector(selectors$N.cartAjaxEnabled),this.cartAjaxDisabled=document.querySelector(selectors$N.cartAjaxDisabled),document.addEventListener("theme:cart:popdown",e=>{this.cartAjaxEnabled?this.cartAjaxEnabled.dispatchEvent(new CustomEvent("theme:cart:reload",{bubbles:!0})):this.cartAjaxDisabled?window.location.reload():this.renderPopdown(e)})}};const cartPopdown={onLoad(){new CartPopdown(this)}};function getScript(url,callback,callbackError){let head=document.getElementsByTagName("head")[0],done=!1,script=document.createElement("script");script.src=url,script.onload=script.onreadystatechange=function(){!done&&(!this.readyState||this.readyState=="loaded"||this.readyState=="complete")?(done=!0,callback()):callbackError()},head.appendChild(script)}const loaders={};function loadScript(options2={}){if(options2.type||(options2.type="json"),options2.url)return loaders[options2.url]?loaders[options2.url]:getScriptWithPromise(options2.url,options2.type);if(options2.json){if(loaders[options2.json])return Promise.resolve(loaders[options2.json]);{const request=window.fetch(options2.json).then(response=>response.json()).then(response=>(loaders[options2.json]=response,response)).catch(error2=>{loaders[options2.json]=null});return loaders[options2.json]=request,request}}else if(options2.name){const key="".concat(options2.name,options2.version);
12return loaders[key]?loaders[key]:loadShopifyWithPromise(options2)}else return Promise.reject()}function getScriptWithPromise(url,type){const loader=new Promise((resolve,reject)=>{type==="text"?fetch(url).then(response=>response.text()).then(data2=>{resolve(data2)}).catch(error2=>{reject(error2)}):getScript(url,function(){resolve()},function(){reject()})});return loaders[url]=loader,loader}function loadShopifyWithPromise(options2){const key="".concat(options2.name,options2.version),loader=new Promise((resolve,reject)=>{try{window.Shopify.loadFeatures([{name:options2.name,version:options2.version,onLoad:err=>{onLoadFromShopify(resolve,reject,err)}}])}catch(err){reject(err)}});return loaders[key]=loader,loader}function onLoadFromShopify(resolve,reject,err){return err?reject(err):resolve()}const selectors$M={wrapper:"[data-swapper-wrapper]",target:"[data-swapper-target]",hover:"data-swapper-hover"};let sections$c={},Swapper=class{init(){this.hovers.forEach(hover=>{hover.addEventListener("mouseenter",(function(){const newContent=hover.getAttribute(selectors$M.hover);this.target.innerHTML=`${newContent}`}).bind(this))}),this.hovers.forEach(hover=>{hover.addEventListener("mouseleave",(function(){this.target.innerHTML=this.deafaultContent}).bind(this))}),this.hovers.forEach(hover=>{hover.addEventListener("click",(function(){const clickedContent=hover.getAttribute(selectors$M.hover);this.deafaultContent=`${clickedContent}`}).bind(this))})}constructor(el){this.container=el,this.target=this.container.querySelector(selectors$M.target),this.hovers=this.container.querySelectorAll(`[${selectors$M.hover}]`),this.target&&this.hovers.length&&(this.deafaultContent=this.target.innerHTML,this.init())}};function makeSwappers(container){sections$c[container.id]=[],container.querySelectorAll(selectors$M.wrapper).forEach(el=>{sections$c[container.id].push(new Swapper(el))})}const swapperSection={onLoad(){makeSwappers(this.container)}},defaults={color:"ash"},selectors$L={swatch:"data-swatch",outerGrid:"[data-grid-item]",dataGridImageDefault:"data-grid-image-default",dataGridImageTarget:"data-grid-image-target",image:"data-swatch-image",imageId:"data-swatch-image-id",variant:"data-swatch-variant"},classes$r={fade:"is-fade"};let ColorMatch=class{getColor(){return this.match}init(){return loadScript({json:window.theme.assets.swatches}).then(colors=>this.matchColors(colors,this.settings.color)).catch(e=>{console.log("failed to load swatch colors script"),console.log(e)})}matchColors(colors,name){let bg="#E5E5E5",img=null;const path=window.theme.assets.base||"/",comparisonName=name.toLowerCase().replace(/\s/g,""),array=colors.colors;if(array){const variantNameMatch=nameObject=>Object.keys(nameObject).toString().toLowerCase().replace(/\s/g,"")===comparisonName,position=array.findIndex(variantNameMatch);if(position>-1){const value=Object.values(array[position])[0],valueLowerCase=value.toLowerCase();valueLowerCase.includes(".jpg")||valueLowerCase.includes(".jpeg")||valueLowerCase.includes(".png")||valueLowerCase.includes(".svg")?(img=`${path}${encodeURIComponent(value)}`,bg="#888888"):bg=value}}return{color:this.settings.color,path:img,hex:bg}}constructor(options2={}){this.settings={...defaults,...options2},this.match=this.init()}},RadioSwatch=class extends HTMLElement{connectedCallback(){this.element=this.querySelector(`[${selectors$L.swatch}]`),this.colorString=this.element.getAttribute(selectors$L.swatch),this.image=this.element.getAttribute(selectors$L.image),this.imageId=this.element.getAttribute(selectors$L.imageId),this.variant=this.element.getAttribute(selectors$L.variant),this.outer=this.element.closest(selectors$L.outerGrid),this.media=null,this.imageSlide=null,this.imageDefault=null,this.stopSlideAnimation=!1,this.element.getAttribute(selectors$L.swatch)!=""&&new ColorMatch({color:this.colorString}).getColor().then(result=>{this.colorMatch=result,this.setStyles()}),this.init()}init(){this.variant&&this.outer&&this.outer.addEventListener("theme:quickview:media",e=>{e&&e.detail&&e.detail.media&&(this.media=e.detail.media)})}setStyles(){this.colorMatch.hex&&this.element.style.setProperty("--swatch",`${this.colorMatch.hex}`),this.colorMatch.path&&(this.element.style.setProperty("background-image",`url(${this.colorMatch.path})`),this.element.style.setProperty("background-size","cover"))}replaceImage(){if(this.imageReplace&&this.imageSlide&&this.imageId){if(this.imageSlide.hasAttribute(selectors$L.dataGridImageTarget)&&this.imageSlide.getAttribute(selectors$L.dataGridImageTarget)!==this.imageId){this.imageSlide.classList.add(classes$r.fade);const timeoutDelay=parseFloat(window.getComputedStyle(this.imageSlide).getPropertyValue("animation-duration"))*1e3;setTimeout(()=>{this.imageSlide.classList.remove(classes$r.fade)},timeoutDelay)}this.imageSlide.setAttribute(selectors$L.dataGridImageTarget,this.imageId),this.imageSlide.style.setProperty("background-color","#fff"),this.imageSlide.hasAttribute(selectors$L.dataGridImageDefault)||this.imageSlide.setAttribute(selectors$L.dataGridImageDefault,window.getComputedStyle(this.imageSlide).backgroundImage),this.imageSlide.style.setProperty("background-image",this.imageReplace)}}};const swatchGridSection={onLoad(){makeSwappers(this.container)}},selectors$K={dataGridItemVariant:"data-grid-item-variant",dataGridImageTarget:"data-grid-image-target",dataSwatchGridImageIndex:"data-grid-image",dataGridImage:"data-grid-image",dataSwatchImageId:"data-swatch-image-id",dataSwatchIndex:"data-swatch-index"};let ProductGridItem=class extends HTMLElement{connectedCallback(){this.gridItemVariantLinks.length&&this.gridItemVariantLinks.forEach(element=>{element.hasAttribute(selectors$K.dataGridItemVariant)&&(this.swatchHoverEvent(element),this.swatchClickEvent(element))})}swatchHoverEvent(swatchLink){swatchLink.addEventListener("mouseenter",()=>{if(swatchLink.hasAttribute(selectors$K.dataGridItemVariant)){const product=swatchLink.getAttribute(selectors$K.dataGridItemVariant);this.container.querySelectorAll(`product-grid-item-variant[${selectors$K.dataGridItemVariant}="${product}"] product-grid-item-image`).forEach(image=>{image.setAttribute("loading","eager")})}})}swatchClickEvent(swatchLink){swatchLink.addEventListener("click",e=>{if(e.preventDefault(),this.container.querySelectorAll(`a[${selectors$K.dataGridItemVariant}]`).forEach(link=>link.removeAttribute("aria-selected")),swatchLink.setAttribute("aria-selected","true"),swatchLink.hasAttribute(selectors$K.dataGridItemVariant)){const swatchLinkVariant=swatchLink.getAttribute(selectors$K.dataGridItemVariant);this.container.querySelectorAll(`product-grid-item-variant[${selectors$K.dataGridItemVariant}]`).forEach(swatchElement=>{swatchElement.getAttribute(selectors$K.dataGridItemVariant)===swatchLinkVariant?swatchElement.removeAttribute("hidden"):swatchElement.setAttribute("hidden","")})}})}constructor(){super(),this.container=this,this.gridItemVariantLinks=this.container.querySelectorAll(`a[${selectors$K.dataGridItemVariant}]`)}};const selectors$J={productGridItemLink:"[data-grid-link]",dataGridImages:"data-grid-images",dataGridImage:"data-grid-image",dataGridImageTarget:"data-grid-image-target",dataGridCurrentImage:"data-grid-current-image",dataGridPagination:"data-grid-pagination",dataGridPage:"data-grid-page",dataGridItemVariant:"data-grid-item-variant",dataSlideForFilterSelectedVariant:"data-sli
12de-for-filter-selected-variant",dataSlideForVariantMedia:"data-slide-for-variant-media",dataSlideshowStyle:"data-slideshow-style",styleWidth:"--width"},classes$q={fade:"is-fade",active:"is-active",mobile:"is-mobile",pagination:"product-grid-item__pagination",productGridItemImage:"product-grid-item__image"};let ProductGridItemVariant=class extends HTMLElement{static get observedAttributes(){return["hidden"]}preloadImage(index){if(this.isMobile)return;const childElement=[...this.images][index];if(!childElement)throw new Error(`No child element at index ${index}`);childElement.setAttribute("loading","eager")}preloadImages(){[...this.imagesHolder.children].forEach((_el,i)=>this.preloadImage(i))}connectedCallback(){this.toggleMobile(),document.addEventListener("theme:resize:width",()=>this.toggleMobile()),!this.isMobile&&(this.imageCount>1&&(this.createPaging(),this.container.addEventListener("theme:swatch:change",this.swatchChangeEvent),this.container.addEventListener("mouseenter",this.mouseEnterEvent),this.container.addEventListener("mouseleave",this.mouseLeaveEvent)),this.intersectionObserver.observe(this.container))}disconnectedCallback(){this.container.removeEventListener("theme:swatch:change",this.swatchChangeEvent),this.container.removeEventListener("mouseenter",this.mouseEnterEvent),this.container.removeEventListener("mouseleave",this.mouseLeaveEvent)}swatchChangeEvent(e){const id=e.detail.id,target=this.container.querySelector(`[${selectors$J.dataGridImageTarget}="${id}"]`);if(target){const index=target.getAttribute(selectors$J.dataGridImage);this.pagingProgressCounter=0,this.changeImage(index),e.detail.stopSlideAnimation&&this.stopPaging()}}mouseEnterEvent(){switch(this.preloadImages(),this.slideshowStyle){case"cycle_images":this.pagingProgressPause=this.isMobile,this.progressPaging();break;case"second_immediately":this.changeImage(this.getNextIndex());break;case"disabled":break;default:throw new Error(`Unknown option ${this.slideshowStyle}`)}}mouseLeaveEvent(){this.pagingProgressPause=!0,this.resetSlideshow(),this.progressPaging()}attributeChangedCallback(name,prevValue,newValue){name==="hidden"&&prevValue==null&&newValue!=null&&this.showVariant()}toggleMobile(){this.container.classList.toggle(classes$q.mobile,this.isMobile)}get isMobile(){return(window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth)<window.theme.sizes.medium}resetSlideshow(){const forcedDefaultSlide=this.container.querySelector(`[${selectors$J.dataSlideForFilterSelectedVariant}]`);if(forcedDefaultSlide){let imageIndex=Number(forcedDefaultSlide.getAttribute(selectors$J.dataGridImage));this.changeImage(imageIndex)}else this.changeImage(0);this.pagingProgressPause=!0}showVariant(){const variantImage=this.container.querySelector(`[${selectors$J.dataSlideForVariantMedia}]`);if(variantImage){let imageIndex=Number(variantImage.getAttribute(selectors$J.dataGridImage));this.changeImage(imageIndex)}else this.changeImage(0);this.pagingProgressPause=!0}getNextIndex(){let currentImage=this.container.querySelector(`[${selectors$J.dataGridImage}][${selectors$J.dataGridCurrentImage}]`);return currentImage?(Number(currentImage.getAttribute(selectors$J.dataGridImage))+1)%this.imageCount:0}changeImage(index){const currentImage=this.images[index%this.imageCount];currentImage&&(this.activeImages.forEach(image=>image.removeAttribute(selectors$J.dataGridCurrentImage)),currentImage.setAttribute(selectors$J.dataGridCurrentImage,"true"),this.slideshowStyle==="cycle_images"&&this.changePaging(index))}changePaging(index=0){const activePage=this.container.querySelector(`[${selectors$J.dataGridPage}].${classes$q.active}`),currentPage=this.container.querySelector(`[${selectors$J.dataGridPage}="${index}"]`);activePage&&(activePage.style.setProperty(selectors$J.styleWidth,"100%"),activePage.classList.remove(classes$q.active)),currentPage&&(currentPage.classList.add(classes$q.active),this.progressPaging())}progressPaging(){const element=this.container.querySelector(`[${selectors$J.dataGridPage}].${classes$q.active}`);!element||this.isMobile||(this.stopPaging(),this.pagingProgressCounter===0&&element.style.setProperty(selectors$J.styleWidth,"0%"),this.interval=setInterval(()=>{this.pagingProgressCounter>=100&&!this.pagingProgressPause?(this.stopPaging(),this.pagingProgressCounter=0,this.changeImage(this.getNextIndex())):this.pagingProgressPause||(this.pagingProgressCounter++,element.style.setProperty(selectors$J.styleWidth,`${this.pagingProgressCounter}%`))},this.timeout/100))}stopPaging(){this.interval&&clearInterval(this.interval)}createPaging(){if(this.imagesHolder&&this.slideshowStyle==="cycle_images"){let pagination="";for(let index=0;
12index<this.imageCount;index++){let activeClass="";index===0&&(activeClass=`class="${classes$q.active}"`),pagination+=`<span ${activeClass} ${selectors$J.dataGridPage}="${index}">${index+1}</span>`}if(pagination!==""){let pagingContainer=this.container.querySelector(`[${selectors$J.dataGridPagination}]`);pagingContainer||(pagingContainer=document.createElement("div"),pagingContainer.className=classes$q.pagination,pagingContainer.setAttribute(selectors$J.dataGridPagination,"")),pagingContainer.innerHTML=pagination,this.imagesHolder.parentElement.prepend(pagingContainer)}}}removePaging(){const pagingContainer=this.container.querySelector(`[${selectors$J.dataGridPagination}]`);pagingContainer&&pagingContainer.remove()}get imagesHolder(){return this.container.querySelector(`[${selectors$J.dataGridImages}]`)}get images(){return this.imagesHolder.querySelectorAll(`[${selectors$J.dataGridImage}]`)}get activeImages(){return this.imagesHolder.querySelectorAll(`[${selectors$J.dataGridImage}][${selectors$J.dataGridCurrentImage}]`)}get links(){return this.container.querySelectorAll(selectors$J.productGridItemLink)}get slideshowStyle(){return this.container.getAttribute(selectors$J.dataSlideshowStyle)}get imageCount(){return this.images.length}constructor(){super(),this.container=this,this.mobileStopSlideshow="true",this.timeout=window.theme.settings.cycle_images_hover_delay*1e3||1500,this.interval=null,this.pagingProgressPause=!1,this.pagingProgressCounter=0,this.siblingsFetchCounter=0,this.siblingLoadImageIndex=null,this.intersectionObserver=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting&&this.imageCount>1&&this.preloadImage(1)})},{threshold:.1})}};const selectors$I={dataGridCurrentImage:"data-grid-current-image"},classes$p={active:"is-active"};let ProductGridItemImage=class extends HTMLElement{static get observedAttributes(){return["loading",selectors$I.dataGridCurrentImage]}connectedCallback(){this.getAttribute(selectors$I.dataGridCurrentImage)===null?this.hide():this.show()}attributeChangedCallback(name,_oldValue,newValue){switch(name){case"loading":(newValue===null||newValue==="eager")&&this.eagerLoad();break;case selectors$I.dataGridCurrentImage:newValue===null?this.hide():this.show();break}}show(){this.classList.add(classes$p.active)}hide(){this.classList.remove(classes$p.active)}eagerLoad(){const childElement=this.firstElementChild;switch(childElement.nodeName){case"TEMPLATE":const template2=childElement,templateContent=template2.content;templateContent.querySelectorAll("img").forEach(imgEl=>{imgEl.setAttribute("loading","eager"),imgEl.setAttribute("fetchpriority","high")}),template2.replaceWith(templateContent);break;case"IMG":childElement.setAttribute("loading","eager"),childElement.setAttribute("fetchpriority","high");break}}};const selectors$H={popoutWrapper:"[data-popout]",popoutList:"[data-popout-list]",popoutListScroll:"data-popout-list-scroll",popoutToggle:"data-popout-toggle",popoutInput:"[data-popout-input]",popoutOptions:"[data-popout-option]",popoutPrevent:"data-popout-prevent",popoutQuantity:"data-quantity-field",dataValue:"data-value",ariaExpanded:"aria-expanded",ariaCurrent:"aria-current"},classes$o={listVisible:"popout-list--visible",currentSuffix:"--current"};let PopoutSelect=class extends HTMLElement{unload(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.removeEventListener("theme:popout:click",this.popupOptionsClick.bind(this)),element.removeEventListener("click",this._connectOptionsDispatch.bind(this))}),this.popoutToggle.removeEventListener("click",this.popupToggleClick.bind(this)),this.popoutToggle.removeEventListener("focusout",this.popupToggleFocusout.bind(this)),this.popoutList.removeEventListener("focusout",this.popupListFocusout.bind(this)),this.container.removeEventListener("keyup",this.containerKeyup.bind(this)),this.outsidePopupToggle&&(this.outsidePopupToggle.removeEventListener("click",this.popupToggleClick.bind(this)),this.outsidePopupToggle.removeEventListener("focusout",this.popupToggleFocusout.bind(this)))}popupToggleClick(evt){const ariaExpanded=evt.currentTarget.getAttribute(selectors$H.ariaExpanded)==="true";evt.currentTarget.setAttribute(selectors$H.ariaExpanded,!ariaExpanded),this.popout
12List.classList.toggle(classes$o.listVisible),this.popupListMaxWidth(),this.popoutList.hasAttribute(selectors$H.popoutListScroll)&&setTimeout(()=>{this.popoutList.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}))},1)}popupToggleFocusout(evt){this.container.contains(evt.relatedTarget)||this._hideList()}popupListFocusout(evt){const childInFocus=evt.currentTarget.contains(evt.relatedTarget);this.popoutList.classList.contains(classes$o.listVisible)&&!childInFocus&&this._hideList()}popupListMaxWidth(){this.popoutList.style.maxWidth=`${parseInt(document.body.clientWidth-this.popoutList.getBoundingClientRect().left)}px`}popupOptionsClick(evt){if(evt.target.closest(selectors$H.popoutOptions).attributes.href.value==="#"){evt.preventDefault();let attrValue="";if(evt.currentTarget.getAttribute(selectors$H.dataValue)&&(attrValue=evt.currentTarget.getAttribute(selectors$H.dataValue)),this.popoutInput.value=attrValue,this.popoutPrevent){this.popoutInput.dispatchEvent(new Event("change")),!evt.detail.preventTrigger&&this.popoutInput.hasAttribute(selectors$H.popoutQuantity)&&this.popoutInput.dispatchEvent(new Event("input"));
12const currentElement=this.popoutList.querySelector(`[class*="${classes$o.currentSuffix}"]`);let targetClass=classes$o.currentSuffix;if(currentElement&&currentElement.classList.length){for(const currentElementClass of currentElement.classList)if(currentElementClass.includes(classes$o.currentSuffix)){targetClass=currentElementClass;break}}const listTargetElement=this.popoutList.querySelector(`.${targetClass}`);listTargetElement&&(listTargetElement.classList.remove(`${targetClass}`),evt.currentTarget.parentElement.classList.add(`${targetClass}`));const targetAttribute=this.popoutList.querySelector(`[${selectors$H.ariaCurrent}]`);targetAttribute&&targetAttribute.hasAttribute(`${selectors$H.ariaCurrent}`)&&(targetAttribute.removeAttribute(`${selectors$H.ariaCurrent}`),evt.currentTarget.setAttribute(`${selectors$H.ariaCurrent}`,"true")),attrValue!==""&&(this.replaceTextContent(this.popoutToggle,attrValue),this.outsidePopupToggle&&this.replaceTextContent(this.outsidePopupToggle,attrValue)),this.popupToggleFocusout(evt),this.popupListFocusout(evt)}else this._submitForm(attrValue)}}replaceTextContent(elem,newContent){Array.from(elem.childNodes).forEach(node=>{node.nodeType===Node.TEXT_NODE&&(node.textContent=newContent)})}
12updatePopout(evt){const targetElement=this.popoutList.querySelector(`[${selectors$H.dataValue}="${this.popoutInput.value}"]`);targetElement&&targetElement.dispatchEvent(new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!0}}))}containerKeyup(evt){evt.code==="Escape"&&(this._hideList(),this.popoutToggle.focus())}bodyClick(evt){const isOption=this.container.contains(evt.target),isVisible=this.popoutList.classList.contains(classes$o.listVisible);this.outsidePopupToggle,evt.target,isVisible&&!isOption&&this._hideList()}_connectToggle(){this.popoutToggle.addEventListener("click",this.popupToggleClick.bind(this)),this.outsidePopupToggle&&this.outsidePopupToggle.addEventListener("click",this.popupToggleClick.bind(this))}_connectOptions(){this.popoutOptions.length&&this.popoutOptions.forEach(element=>{element.addEventListener("theme:popout:click",this.popupOptionsClick.bind(this)),element.addEventListener("click",this._connectOptionsDispatch.bind(this))})}_connectOptionsDispatch(evt){const event=new CustomEvent("theme:popout:click",{cancelable:!0,bubbles:!0,detail:{preventTrigger:!1}});evt.target.dispatchEvent(event)||evt.preventDefault()}_onFocusOut(){this.popoutToggle.addEventListener("focusout",this.popupToggleFocusout.bind(this)),this.outsidePopupToggle&&this.outsidePopupToggle.addEventListener("focusout",this.popupToggleFocusout.bind(this)),this.popoutList.addEventListener("focusout",this.popupListFocusout.bind(this)),this.container.addEventListener("keyup",this.containerKeyup.bind(this)),document.body.addEventListener("click",this.bodyClick.bind(this))}_submitForm(value){const form=this.container.closest("form");form&&form.submit()}_hideList(){this.popoutList.classList.remove(classes$o.listVisible),this.popoutToggle.setAttribute(selectors$H.ariaExpanded,!1),this.outsidePopupToggle&&this.outsidePopupToggle.setAttribute(selectors$H.ariaExpanded,!1)}constructor(){super(),this.container=this.querySelector(selectors$H.popoutWrapper),this.popoutList=this.container.querySelector(selectors$H.popoutList),this.popoutToggle=this.container.querySelector(`[${selectors$H.popoutToggle}]`),this.outsidePopupToggle=document.querySelector(`[${selectors$H.popoutToggle}="${this.popoutList.id}"]`),this.popoutInput=this.container.querySelector(selectors$H.popoutInput),this.popoutOptions=this.container.querySelectorAll(selectors$H.popoutOptions),this.popoutPrevent=this.container.getAttribute(selectors$H.popoutPrevent)==="true",this._connectOptions(),this._connectToggle(),this._onFocusOut(),this.popupListMaxWidth(),this.popoutInput&&this.popoutInput.hasAttribute(selectors$H.popoutQuantity)&&document.addEventListener("theme:popout:update",this.updatePopout.bind(this)),document.addEventListener("theme:resize",()=>{this.popupListMaxWidth()})}};const hideElement=elem=>{elem&&(elem.style.display="none")},selectors$G={inputSearch:'input[type="search"]',focusedElements:'[aria-selected="true"] a',resetButton:'button[type="reset"]'},classes$n={hidden:"is-hidden"};let HeaderSearchForm=class extends HTMLElement{toggleResetButton(){const resetIsHidden=this.resetButton.classList.contains(classes$n.hidden);this.input.value.length>0&&resetIsHidden?this.resetButton.classList.remove(classes$n.hidden):this.input.value.length===0&&!resetIsHidden&&this.resetButton.classList.add(classes$n.hidden)}onChange(){this.toggleResetButton()}shouldResetForm(){return!document.querySelector(selectors$G.focusedElements)}onFormReset(event){event.preventDefault(),this.shouldResetForm()&&(this.input.value="",this.toggleResetButton(),event.target.querySelector(selectors$G.inputSearch).focus())}constructor(){super(),this.input=this.querySelector(selectors$G.inputSearch),this.resetButton=this.querySelector(selectors$G.resetButton),this.input&&(this.input.form.addEventListener("reset",this.onFormReset.bind(this)),this.input.addEventListener("input",debounce$1(event=>{this.onChange(event)},300).bind(this)))}};customElements.define("header-search-form",HeaderSearchForm);const selectors$F={allVisibleElements:'[role="option"]',ariaSelected:'[aria-selected="true"]',predictiveSearch:"predictive-search",predictiveSearchResults:"[data-predictive-search-results]",predictiveSearchStatus:"[data-predictive-search-status]",searchInput:"[data-predictive-search-input]",searchResultsLiveRegion:"[data-predictive-search-live-region-count-value]",searchResultsGroupsWrapper:"data-search-results-groups-wrapper",searchForText:"[data-predictive-search-search-for-text]",sectionPredictiveSearch:"#shopify-section-predictive-search",selectedLink:'[aria-selected="true"] a',selectedOption:'[aria-selected="true"] a, button[aria-selected="true"]',loader:"[data-loading-indicator]"};let PredictiveSearch=class extends HeaderSearchForm{connectedCallback(){this.input.addEventListener("focus",this.onFocus.bind(this)),this.input.form.addEventListener("submit",this.onFormSubmit.bind(this)),this.addEventListener("focusout",this.onFocusOut.bind(this)),this.addEventListener("keyup",this.onKeyup.bind(this)),this.addEventListener("keydown",this.onKeydown.bind(this))}getQuery(){return this.input.value.trim()}onChange(){super.onChange();const newSearchTerm=this.getQuery();if(!this.searchTerm||!newSearchTerm.startsWith(this.searchTerm)){var ref2;(ref2=this.querySelector(selectors$F.searchResultsGroupsWrapper))===null||ref2===void 0||ref2.remove()}if(this.updateSearchForTerm(this.searchTerm,newSearchTerm),this.searchTerm=newSearchTerm,!this.searchTerm.length){this.reset();return}this.getSearchResults(this.searchTerm)}onFormSubmit(event){(!this.getQuery().length||this.querySelector(selectors$F.selectedLink))&&event.preventDefault()}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&(this.searchTerm="",this.abortController.abort(),this.abortController=new AbortController,this.closeResults(!0))}shouldResetForm(){return!document.querySelector(selectors$F.selectedLink)}onFocus(){const currentSearchTerm=this.getQuery();currentSearchTerm.length&&(this.searchTerm!==currentSearchTerm?this.onChange():this.getAttribute("results")==="true"?this.open():this.getSearchResults(this.searchTerm))}onFocusOut(){setTimeout(()=>{this.contains(document.activeElement)||this.close()})}onKeyup(event){switch(this.getQuery().length||this.close(!0),event.preventDefault(),event.code){case"ArrowUp":this.switchOption("up");break;case"ArrowDown":this.switchOption("down");break;case"Enter":this.selectOption();break}}onKeydown(event){(event.code==="ArrowUp"||event.code==="ArrowDown")&&event.preventDefault()}updateSearchForTerm(previousTerm,newTerm){const searchForTextElement=this.querySelector(selectors$F.searchForText),currentButtonText=searchForTextElement?.innerText;if(currentButtonText){var ref2;if(((ref2=currentButtonText.match(previousTerm))===null||ref2===void 0?void 0:ref2.length)>1)return;const newButtonText=currentButtonText.replace(previousTerm,newTerm);searchForTextElement.innerText=newButtonText}}switchOption(direction){if(!this.getAttribute("open"))return;const moveUp=direction==="up",selectedElement=this.querySelector(selectors$F.ariaSelected),allVisibleElements=Array.from(this.querySelectorAll(selectors$F.allVisibleElements)).filter(element=>element.offsetParent!==null);let activeElementIndex=0;if(moveUp&&!selectedElement)return;let selectedElementIndex=-1,i=0;for(;selectedElementIndex===-1&&i<=allVisibleElements.length;)allVisibleElements[i]===selectedElement&&(selectedElementIndex=i),i++;if(this.statusElement.textContent="",!moveUp&&selectedElement?activeElementIndex=selectedElementIndex===allVisibleElements.length-1?0:selectedElementIndex+1:moveUp&&(activeElementIndex=selectedElementIndex===0?allVisibleElements.length-1:selectedElementIndex-1),activeElementIndex===selectedElementIndex)return;const activeElement=allVisibleElements[activeElementIndex];activeElement.setAttribute("aria-selected",!0),selectedElement&&selectedElement.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",activeElement.id)}selectOption(){const selectedOption=this.querySelector(selectors$F.selectedOption);selectedOption&&selectedOption.click()}getSearchResults(searchTerm){const queryKey=searchTerm.replace(" ","-").toLowerCase();if(this.setLiveRegionLoadingState(),this.cachedResults[queryKey]){this.renderSearchResults(this.cachedResults[queryKey]);return}showElement(this.loader),fetch(`${theme.routes.predictive_search_url}?q=${encodeURIComponent(searchTerm)}&section_id=predictive-search`,{signal:this.abortController.signal}).then(this.handleErrors).then(response=>response.text()).then(response=>{const resultsMarkup=new DOMParser().parseFromString(response,"text/html").querySelector(selectors$F.sectionPredictiveSearch).innerHTML;
12this.allPredictiveSearchInstances.forEach(predictiveSearchInstance=>{predictiveSearchInstance.cachedResults[queryKey]=resultsMarkup}),this.renderSearchResults(resultsMarkup)}).catch(e=>{console.error(e)}).finally(()=>{hideElement(this.loader)})}setLiveRegionLoadingState(){this.statusElement=this.statusElement||this.querySelector(selectors$F.predictiveSearchStatus),this.loadingText=this.loadingText||this.getAttribute("data-loading-text"),this.setLiveRegionText(this.loadingText),this.setAttribute("loading",!0)}setLiveRegionText(statusText){this.statusElement.setAttribute("aria-hidden","false"),this.statusElement.textContent=statusText,setTimeout(()=>{this.statusElement.setAttribute("aria-hidden","true")},1e3)}renderSearchResults(resultsMarkup){this.predictiveSearchResults.innerHTML=resultsMarkup,this.setAttribute("results",!0),this.setLiveRegionResults(),this.open()}setLiveRegionResults(){this.removeAttribute("loading"),this.setLiveRegionText(this.querySelector(selectors$F.searchResultsLiveRegion).textContent)}open(){this.setAttribute("open",!0),this.input.setAttribute("aria-expanded",!0),this.isOpen=!0}close(clearSearchTerm=!1){this.closeResults(clearSearchTerm),this.isOpen=!1}closeResults(clearSearchTerm=!1){var ref2;clearSearchTerm&&(this.input.value="",this.removeAttribute("results"));const selected=this.querySelector(selectors$F.ariaSelected);selected&&selected.setAttribute("aria-selected",!1),this.input.setAttribute("aria-activedescendant",""),this.removeAttribute("loading"),this.removeAttribute("open"),this.input.setAttribute("aria-expanded",!1),(ref2=this.predictiveSearchResults)===null||ref2===void 0||ref2.removeAttribute("style")}reset(){this.predictiveSearchResults.innerHTML="",this.input.val="",this.a11y.removeTrapFocus()}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}constructor(){super(),this.wrapper=this,this.a11y=a11y,this.abortController=new AbortController,this.allPredictiveSearchInstances=document.querySelectorAll(selectors$F.predictiveSearch),this.cachedResults={},this.input=this.wrapper.querySelector(selectors$F.searchInput),this.isOpen=!1,this.predictiveSearchResults=this.querySelector(selectors$F.predictiveSearchResults),this.searchTerm="",this.loader=this.wrapper.querySelector(selectors$F.loader)}};function getWindowWidth(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth}function isDesktop(){return getWindowWidth()>=window.theme.sizes.small}function isMobile(){return getWindowWidth()<window.theme.sizes.small}const selectors$E={inputSearch:'input[type="search"]'};let MainSearch=class extends HeaderSearchForm{setupEventListeners(){let allSearchForms=[];this.allSearchInputs.forEach(input=>allSearchForms.push(input.form)),this.input.addEventListener("focus",this.onInputFocus.bind(this)),!(allSearchForms.length<2)&&(allSearchForms.forEach(form=>form.addEventListener("reset",this.onFormReset.bind(this))),this.allSearchInputs.forEach(input=>input.addEventListener("input",this.onInput.bind(this))))}onFormReset(event){super.onFormReset(event),super.shouldResetForm()&&this.keepInSync("",this.input)}onInput(event){const target=event.target;this.keepInSync(target.value,target)}onInputFocus(){isDesktop()||this.scrollIntoView({behavior:"smooth"})}keepInSync(value,target){this.allSearchInputs.forEach(input=>{input!==target&&(input.value=value)})}constructor(){super(),this.allSearchInputs=document.querySelectorAll(selectors$E.inputSearch),this.setupEventListeners()}};const selectors$D={drawer:"data-drawer-scrolls",slideruleOpen:"data-sliderule-open",slideruleClose:"data-sliderule-close",sliderulePane:"data-sliderule-pane",slideruleWrappper:"[data-sliderule]",dataAnimates:"data-animates",children:`:scope > [data-animates],
13             :scope > * > [data-animates],
14             :scope > * > * >[data-animates],
15             :scope .sliderule-grid  > *`},classes$m={isVisible:"is-visible",isHiding:"is-hiding",isHidden:"is-hidden"};let sections$b={},HeaderMobileSliderule=class{clickEvents(){this.trigger.addEventListener("click",(function(){this.showSliderule()}).bind(this)),this.exit.forEach(element=>{element.addEventListener("click",(function(){this.hideSliderule()}).bind(this))})}keyboardEvents(){this.trigger.addEventListener("keyup",(function(evt){evt.code==="Space"&&this.showSliderule()}).bind(this)),this.sliderule.addEventListener("keyup",(function(evt){evt.code==="Escape"&&(this.hideSliderule(),this.buttons[0].focus())}).bind(this))}staggerChildAnimations(reverse=!1){(reverse?Array.prototype.slice.call(this.children).slice().reverse():this.children).forEac
15h((child,index)=>{child.style.transitionDelay=index*50+10+"ms"})}hideSliderule(close=!1){const paneStyle=window.getComputedStyle(this.pane),paneTransitionDuration=parseFloat(paneStyle.getPropertyValue("transition-duration"))*1e3,children=close?this.pane.querySelectorAll(`.${classes$m.isVisible}`):this.children;this.pane.style.setProperty("--sliderule-height","auto"),this.staggerChildAnimations(!0),this.pane.classList.add(classes$m.isHiding),this.sliderule.classList.add(classes$m.isHiding),this.sliderule.classList.remove(classes$m.isVisible),children.forEach(el=>{el.classList.remove(classes$m.isVisible)});const newPosition=parseInt(this.pane.dataset.sliderulePane,10)-1;this.pane.setAttribute(selectors$D.sliderulePane,newPosition);const hidedSelector=close?`[${selectors$D.dataAnimates}].${classes$m.isHidden}`:`[${selectors$D.dataAnimates}="${newPosition}"].${classes$m.isHidden}`,hidedItems=this.pane.querySelectorAll(hidedSelector);hidedItems.length&&hidedItems.forEach(element=>{element.classList.remove(classes$m.isHidden)}),setTimeout(()=>{this.pane.classList.remove(classes$m.isHiding),this.sliderule.classList.remove(classes$m.isHiding),this.staggerChildAnimations()},paneTransitionDuration)}showSliderule(){this.pane.style.setProperty("--sliderule-height","auto"),this.sliderule.classList.add(classes$m.isVisible),this.children.forEach(el=>{el.classList.add(classes$m.isVisible)});const oldPosition=parseInt(this.pane.dataset.sliderulePane,10),newPosition=oldPosition+1;this.pane.setAttribute(selectors$D.sliderulePane,newPosition);const hidedItems=this.pane.querySelectorAll(`[${selectors$D.dataAnimates}="${oldPosition}"]`);if(hidedItems.length){const hidedItemsTransition=parseFloat(window.getComputedStyle(hidedItems[0]).getPropertyValue("transition-duration"))*1e3;setTimeout(()=>{hidedItems.forEach(element=>{element.classList.add(classes$m.isHidden)})},hidedItemsTransition)}const newHeight=parseInt(this.trigger.nextElementSibling.offsetHeight);this.pane.style.setProperty("--sliderule-height",`${newHeight}px`);const drawerScrollY=this.drawer.scrollTop,scrollToElement=this.pane.offsetTop;scrollToElement<drawerScrollY&&this.pane.offsetHeight>=this.drawer.offsetHeight&&this.drawer.scrollTo({top:scrollToElement,left:0,behavior:"smooth"})}closeSliderule(){this.pane&&this.pane.hasAttribute(selectors$D.sliderulePane)&&parseInt(this.pane.getAttribute(selectors$D.sliderulePane))>0&&(this.hideSliderule(!0),parseInt(this.pane.getAttribute(selectors$D.sliderulePane))>0&&this.pane.setAttribute(selectors$D.sliderulePane,0))}constructor(el){this.sliderule=el,this.wrapper=el.closest(selectors$D.wrapper),this.key=this.sliderule.id;const btnSelector=`[${selectors$D.slideruleOpen}='${this.key}']`,exitSelector=`[${selectors$D.slideruleClose}='${this.key}']`;this.trigger=document.querySelector(btnSelector),this.drawer=document.querySelector(`[${selectors$D.drawer}]`),this.exit=document.querySelectorAll(exitSelector),this.pane=document.querySelector(`[${selectors$D.sliderulePane}]`),this.children=this.sliderule.querySelectorAll(selectors$D.children),this.trigger.setAttribute("aria-haspopup",!0),this.trigger.setAttribute("aria-expanded",!1),this.trigger.setAttribute("aria-controls",this.key),this.clickEvents(),this.staggerChildAnimations(),document.addEventListener("theme:sliderule:close",this.closeSliderule.bind(this))}};const headerMobileSliderule={onLoad(){sections$b[this.id]=[],this.container.querySelectorAll(selectors$D.slideruleWrappper).forEach(el=>{sections$b[this.id].push(new HeaderMobileSliderule(el))})}},selectors$C={widthContent:"[data-takes-space]",desktop:"[data-header-desktop]",cloneClass:"js__header__clone",showMobileClass:"js__show__mobile",backfill:"[data-header-backfill]",transparent:"data-header-transparent",overrideBorder:"header-override-border",firstSectionHasImage:".main-content > .shopify-section:first-child [data-overlay-header]",preventTransparentHeader:".main-content > .shopify-section:first-child [data-prevent-transparent-header]",deadLink:'.navlink[href="#"]'},classes$l={hasOverlay:"has-overlay"};let sections$a={},Header=class{unload(){document.removeEventListener("theme:resize",this.checkWidth)}checkForImage(){this.overlayedImages=document.querySelectorAll(selectors$C.firstSectionHasImage);let preventTransparentHeader=document.querySelectorAll(selectors$C.preventTransparentHeader).length;this.overlayedImages.length&&!preventTransparentHeader&&this.transparent?(document.querySelector(selectors$C.backfill).style.display="none",this.listenOverlay()):this.wrapper.setAttribute(selectors$C.transparent,!1),this.overlayedImages.length&&!preventTransparentHeader&&!this.transparent&&(this.wrapper.classList.add(selectors$C.overrideBorder),this.subtractHeaderHeight())}listenOverlay(){document.addEventListener("theme:resize",this.checkWidth.bind(this)),this.subtractAnnouncementHeight()}listenWidth(){document.addEventListener("theme:resize",this.checkWidth.bind(this)),this.checkWidth()}killDeadLinks(){this.deadLinks.forEach(el=>{el.onclick=e=>{e.preventDefault()}})}subtractAnnouncementHeight(){const{windowHeight,announcementHeight}=readHeights();
15this.overlayedImages.forEach(el=>{el.style.setProperty("--full-screen",`${windowHeight-announcementHeight}px`),el.classList.add(classes$l.hasOverlay)})}subtractHeaderHeight(){const{windowHeight,headerHeight}=readHeights();this.overlayedImages.forEach(el=>{el.style.setProperty("--full-screen",`${windowHeight-headerHeight}px`)})}checkWidth(){document.body.clientWidth<this.minWidth?this.wrapper.classList.add(selectors$C.showMobileClass):this.wrapper.classList.remove(selectors$C.showMobileClass)}getMinWidth(){const comparitor=this.wrapper.cloneNode(!0);comparitor.classList.add(selectors$C.cloneClass),document.body.appendChild(comparitor);const wideElements=comparitor.querySelectorAll(selectors$C.widthContent);let minWidth=0;return wideElements.length===3?minWidth=_sumSplitWidths(wideElements):minWidth=_sumWidths(wideElements),document.body.removeChild(comparitor),minWidth+wideElements.length*20}constructor(el){this.wrapper=el,this.style=this.wrapper.dataset.style,this.desktop=this.wrapper.querySelector(selectors$C.desktop),this.transparent=this.wrapper.getAttribute(selectors$C.transparent)!=="false",this.overlayedImages=document.querySelectorAll(selectors$C.firstSectionHasImage),this.deadLinks=document.querySelectorAll(selectors$C.deadLink),this.killDeadLinks(),this.style!=="drawer"&&this.desktop&&(this.minWidth=this.getMinWidth(),this.listenWidth()),this.checkForImage(),window.dispatchEvent(new Event("resize")),document.addEventListener("theme:header:check",this.checkForImage.bind(this))}};function _sumSplitWidths(nodes){let arr=[];return nodes.forEach(el=>{arr.push(el.clientWidth)}),arr[0]>arr[2]?arr[2]=arr[0]:arr[0]=arr[2],arr.reduce((a,b)=>a+b)}function _sumWidths(nodes){let width=0;return nodes.forEach(el=>{width+=el.clientWidth}),width}register("header",[{onLoad(){sections$a=new Header(this.container)},onUnload:function(){typeof sections$a.unload=="function"&&sections$a.unload()}},drawer,headerMobileSliderule,stickyHeader,hoverDisclosure,hoverUnderline,headerTotals,searchPopdown,cartPopdown,swatchGridSection,ticker]),customElements.get("popout-select")||customElements.define("popout-select",PopoutSelect),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage),customElements.get("predictive-search")||customElements.define("predictive-search",PredictiveSearch),customElements.get("main-search")||customElements.define("main-search",MainSearch);const selectors$B={newsletterForm:"[data-newsletter-form]"},classes$k={success:"has-success",error:"has-error"},sections$9={};let NewsletterCheckForResult=class{init(){this.newsletter.addEventListener("submit",this.newsletterSubmit),this.showMessage()}newsletterSubmitEvent(e){this.stopSubmit&&(e.preventDefault(),e.stopImmediatePropagation(),this.removeStorage(),this.writeStorage(),this.stopSubmit=!1,this.newsletter.submit())}checkForChallengePage(){this.isChallengePage=window.location.pathname==="/challenge"}writeStorage(){this.sessionStorage!==void 0&&this.sessionStorage.setItem("newsletter_form_id",this.newsletter.id)}readStorage(){this.formID=this.sessionStorage.getItem("newsletter_form_id")}removeStorage(){this.sessionStorage.removeItem("newsletter_form_id")}showMessage(){if(this.readStorage(),this.newsletter.id===this.formID){const newsletter=document.getElementById(this.formID);window.location.search.indexOf("?customer_posted=true")!==-1?(newsletter.classList.remove(classes$k.error),newsletter.classList.add(classes$k.success)):window.location.search.indexOf("accepts_marketing")!==-1&&(newsletter.classList.remove(classes$k.success),newsletter.classList.add(classes$k.error)),this.removeStorage(),this.scrollToForm(newsletter)}}scrollToForm(newsletter){const rect=newsletter.getBoundingClientRect();rect.top>=0&&rect.left>=0&&rect.bottom<=(window.innerHeight||document.documentElement.clientHeight)&&rect.right<=(window.innerWidth||document.documentElement.clientWidth)||setTimeout(()=>
15{window.scroll({top:rect.top,left:0,behavior:"smooth"})},400)}unload(){this.newsletter.removeEventListener("submit",this.newsletterSubmit)}constructor(newsletter){this.sessionStorage=window.sessionStorage,this.newsletter=newsletter,this.stopSubmit=!0,this.isChallengePage=!1,this.formID=null,this.checkForChallengePage(),this.newsletterSubmit=e=>this.newsletterSubmitEvent(e),this.isChallengePage||this.init()}};const newsletterCheckForResultSection={onLoad(){sections$9[this.id]=[],this.container.querySelectorAll(selectors$B.newsletterForm).forEach(form=>{sections$9[this.id].push(new NewsletterCheckForResult(form))})},onUnload(){sections$9[this.id].forEach(form=>{typeof form.unload=="function"&&form.unload()})}},selectors$A={shopPayWrapper:"[data-shop-pay-wrapper]",shopLoginButton:"shop-login-button",shopFollowButton:"shop-follow-button",followOnShopButton:"follow-on-shop-button",heartIcon:"heart-icon",shopLogo:"shop-logo"},sections$8={};let ShopPayLink=class{init(){!this.shopLoginButton||!this.shopPayWrapper||(this.mainButtonStyles=`
16      :host {
17        --bg-color: ${this.shopPayWrapper.dataset.bg};
18        --text-color: ${this.shopPayWrapper.dataset.text};
19        --hover-color: ${this.shopPayWrapper.dataset.hover};
20      }
21
22      .follow-icon-wrapper:before {
23        background: var(--bg-color);
24        border-color: var(--text-color);
25      }
26
27      .button:not(.button--following):focus-visible .follow-icon-wrapper:before,
28      .button:not(.button--following):hover .follow-icon-wrapper:before {
29        background: var(--bg-color);
30        border-color: var(--hover-color);
31      }
32
33      .button {
34        background: transparent;
35        color: var(--text-color);
36      }
37
38      .following-text {
39        color: var(--text-color);
40      }
41
42      .button--following:focus-visible,
43      .button--following:hover {
44        background: var(--bg-color);
45      }
46
47      .button:not(.button--following):focus-visible .follow-icon-wrapper:before,
48      .button:not(.button--following):hover .follow-icon-wrapper:before {
49        background: var(--bg-color);
50        border-color: var(--hover-color);
51      }
52    `,this.svgIconsStyles=`
53      :host {
54        color: ${this.shopPayWrapper.dataset.text};
55      }
56    `,customElements.whenDefined(selectors$A.shopLoginButton).then(res=>{requestAnimationFrame(()=>{const shadowRoot1=this.shopLoginButton.shadowRoot,shopFollowButton=shadowRoot
561?.querySelector(selectors$A.shopFollowButton),shadowRoot2=shopFollowButton?.shadowRoot,followOnShopButton=shadowRoot2?.querySelector(selectors$A.followOnShopButton),shadowRoot3=followOnShopButton?.shadowRoot;shadowRoot3&&this.overwriteStyles(shadowRoot3.host.shadowRoot,this.mainButtonStyles);const heartIcon=shadowRoot3.querySelector(selectors$A.heartIcon),shadowRoot4=heartIcon?.shadowRoot,shopLogo=shadowRoot3.querySelector(selectors$A.shopLogo),shadowRoot5=shopLogo?.shadowRoot;shadowRoot4&&this.overwriteStyles(shadowRoot4.host.shadowRoot,this.svgIconsStyles),shadowRoot5&&this.overwriteStyles(shadowRoot5.host.shadowRoot,this.svgIconsStyles)})}))}overwriteStyles(element,styles2){let style=document.createElement("style");style.innerHTML=styles2,element.appendChild(style)}constructor(container){this.container=container,this.shopPayWrapper=document.querySelector(selectors$A.shopPayWrapper),this.shopLoginButton=document.querySelector(selectors$A.shopLoginButton),this.init()}};register("footer",[newsletterCheckForResultSection,{onLoad(){sections$8[this.id]=new ShopPayLink(this.container)}}]),customElements.get("popout-select")||customElements.define("popout-select",PopoutSelect);const defaultOptions$1={cc_load_policy:1,iv_load_policy:3,modestbranding:1,playsinline:1,controls:1,showinfo:0,ecver:2,fs:1,rel:0},selectors$z={player:"iframe, [data-replace]",videoId:"data-video-id"};function embedYoutube(uniqueKey,options2){const playerOptions={...defaultOptions$1,...options2}
56,playerWrapper=document.querySelector(`[data-player="${uniqueKey}"]`),playerElement=playerWrapper.querySelector(selectors$z.player),youtubeKey=playerWrapper.querySelector(`[${selectors$z.videoId}]`).getAttribute(selectors$z.videoId);return loadScript({url:"https://www.youtube.com/iframe_api"}),window.youtubeLoaderPromise.then(()=>{let player=new window.YT.Player(playerElement,{videoId:youtubeKey,playerVars:{...playerOptions},events:{onStateChange:event=>{event.data==1?playerWrapper.dispatchEvent(new CustomEvent("play")):event.data==2&&playerWrapper.dispatchEvent(new CustomEvent("pause"))}}});return playerWrapper.addEventListener("pause",()=>{try{player.pauseVideo()}catch(e){console.warn(e)}}),playerWrapper.addEventListener("play",()=>{try{player.playVideo?player.playVideo():player.addEventListener("onReady",()=>{player.playVideo()})}catch(e){console.warn(e)}}),playerWrapper.addEventListener("destroy",()=>{try{player.destroy&&player.destroy()}catch(e){console.warn(e)}}),player}).catch(err=>{console.error(err)})}window.youtubeLoaderPromise=new Promise(resolve=>{window.onYouTubeIframeAPIReady=function(){resolve()}});const defaultOptions={autoplay:!0,loop:!0,controls:!0,muted:!1,playsinline:!0},selectors$y={player:"iframe, [data-replace]",videoId:"data-video-id"};function embedVimeo(uniqueKey,options2){const playerOptions={...defaultOptions,...options2}
56,playerWrapper=document.querySelector(`[data-player="${uniqueKey}"]`),playerElement=playerWrapper.querySelector(selectors$y.player),vimeoKey=playerWrapper.querySelector(`[${selectors$y.videoId}]`).getAttribute(selectors$y.videoId),loadedPromise=loadScript({url:"https://player.vimeo.com/api/player.js"}),vimeoSelector=`select-${uniqueKey}`;return playerElement.setAttribute("id",vimeoSelector),loadedPromise.then(()=>{const player=new window.Vimeo.Player(vimeoSelector,{...playerOptions,id:vimeoKey});return player.on("play",()=>{playerWrapper.dispatchEvent(new CustomEvent("play"))}),player.on("pause",()=>{playerWrapper.dispatchEvent(new CustomEvent("pause"))}),playerWrapper.addEventListener("pause",()=>{try{player.pause&&player.pause()}catch(e){console.warn(e)}}),playerWrapper.addEventListener("play",()=>{player.play&&player.getPaused().then(paused=>{paused&&player.play()})}),playerWrapper.addEventListener("destroy",()=>{try{player.destroy&&player.destroy()}catch(e){console.log(e)}}),player}).catch(err=>{console.error(err)})}const selectors$x={videoPopup:"[data-video-popup]",videoAutoplay:"[data-video-autoplay]",attrUnique:"data-unique",attrVideoId:"data-video-id",attrVideoType:"data-video-type",attrPlayer:"data-player"};let PopupVideo=class{init(){this.triggers.forEach(trigger2=>{const unique=trigger2.getAttribute(selectors$x.attrUnique),video=trigger2.getAttribute(selectors$x.attrVideoId),type=trigger2.getAttribute(selectors$x.attrVideoType),uniqueKey=`${video}-${unique}`,player=document.querySelector(`[${selectors$x.attrPlayer}="${uniqueKey}"]`);MicroModal.init({onShow:()=>{this.backgroundVideo&&typeof this.backgroundVideo.pause=="function"&&this.backgroundVideo.pause();let playerPromise={};type==="youtube"?playerPromise=embedYoutube(uniqueKey):type==="vimeo"&&(playerPromise=embedVimeo(uniqueKey)),playerPromise.then(()=>{player.dispatchEvent(new CustomEvent("play"))})},onClose:(modal2,el,event)=>{event.preventDefault(),player.dispatchEvent(new CustomEvent("destroy")),this.backgroundVideo&&typeof this.backgroundVideo.play=="function"&&this.backgroundVideo.play()},openTrigger:`data-trigger-${video}-${unique}`})})}constructor(section2){this.container=section2.container,this.triggers=this.container.querySelectorAll(selectors$x.videoPopup),this.backgroundVideo=this.container.querySelector(selectors$x.videoAutoplay),this.init()}};const popupVideoSection={onLoad(){new PopupVideo(this)}},selectors$w={button:"[data-scroll-down]"};let ScrollButton=class{init(){const buttons=this.wrapper.querySelectorAll(selectors$w.button);buttons&&buttons.forEach(btn=>{btn.addEventListener("click",this.scroll.bind(this))})}scroll(){const bottom=this.wrapper.offsetTop+this.wrapper.clientHeight;window.scroll({top:bottom,left:0,behavior:"smooth"})}constructor(el){this.wrapper=el,this.init()}};const scrollButton={onLoad(){this.scrollButton=new ScrollButton(this.container)},onUnload:function(){delete this.scrollButton}};register("video",[parallaxImage,scrollButton,popupVideoSection]),register("hero",[parallaxImage,scrollButton,customScrollbar]);const selectors$v={slider:"[data-slider]",photo:"[data-grid-slide]",wrapper:"[data-wrapper]",carouselCustomScrollbar:"data-custom-scrollbar-items"},attributes={showDots:"data-show-dots"},classes$j={wrapper:"wrapper",wrapperModifier:"wrapper--full",hide:"hide"},offsets={scrollbarWidth:window.innerWidth-document.documentElement.clientWidth,additionalOffsetWrapper:112},sections$7={};let Slider=class{init(){const instance=this,sliderOptions={initialIndex:0,accessibility:!0,autoPlay:!1,contain:!0,pageDots:this.pageDots,adaptiveHeight:!1,wrapAround:!1,groupCells:!1,cellAlign:"left",freeScroll:!0,prevNextButtons:!0,draggable:!0,rightToLeft:window.isRTL,watchCSS:!0,arrowShape:{x0:10,x1:60,y1:50,x2:67.5,y2:42.5,x3:25},on:{ready:function(){instance.removeIncorrectAria()}}};this.flkty=new Flickity(this.slideshow,sliderOptions),this.container.addEventListener("theme:tab:change",()=>{this.flkty.resize()}),this.toggleWrapperModifier(),document.addEventListener("theme:resize:width",this.toggleWrapperModifier.bind(this)),this.slideshow.hasAttribute(selectors$v.carouselCustomScrollbar)&&new CustomScrollbar(this.container),new Siblings(this.container)}
56toggleWrapperModifier(){this.wrapper.classList.contains(classes$j.wrapper)&&this.wrapper.classList.toggle(classes$j.wrapperModifier,this.wrapperWidthWithGutter>=window.innerWidth)}removeIncorrectAria(){this.slideshow.querySelectorAll('[aria-hidden="true"]').forEach(el=>el.removeAttribute("aria-hidden"))}onUnload(){this.slideshow&&this.flkty&&(this.flkty.options.watchCSS=!1,this.flkty.destroy())}constructor(container,el){if(this.container=container,this.slideshow=el,this.wrapper=this.container.querySelector(selectors$v.wrapper),this.wrapperWidth=Number(getComputedStyle(document.documentElement).getPropertyValue("--LAYOUT-WIDTH").replace("px","")),this.wrapperWidthWithGutter=this.wrapperWidth+offsets.additionalOffsetWrapper+offsets.scrollbarWidth,this.pageDots=this.slideshow.getAttribute(attributes.showDots)==="true",this.firstPhoto=this.container.querySelector(selectors$v.photo),this.firstPhoto){const buttonOffset=this.firstPhoto.offsetHeight/2;this.slideshow.style.setProperty("--buttons-top",`${buttonOffset}px`)}this.slideshow&&(this.flkty=null,this.init())}};const productSliderSection={onLoad(){sections$7[this.id]=[],this.container.querySelectorAll(selectors$v.slider).forEach(el=>{sections$7[this.id].push(new Slider(this.container,el))})},onUnload(e){sections$7[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload(e)})}};register("custom-content",[parallaxImage,popupVideoSection,swatchGridSection,productSliderSection]),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage);const sections$6=[],selectors$u={wrapper:"[data-slideshow-wrapper]",speed:"data-slideshow-speed",autoplay:"data-slideshow-autoplay",slideCount:"data-slideshow-slides",prevButton:"[data-slide-custom-prev]",nextButton:"[data-slide-custom-next]",slideshoIndex:"data-slideshow-index"},classes$i={isEnable:"flickity-enabled"};let Slideshow=class{init(){const settings2={autoPlay:this.autoplay&&this.speed?parseInt(this.speed):!1,contain:!1,pageDots:!0,adaptiveHeight:!0,accessibility:!0,wrapAround:this.slideCount!==2,prevNextButtons:!1,draggable:!0,fade:!0,rightToLeft:window.isRTL};this.flkty=new FlickityFade(this.wrapper,settings2),this.prevButtons.length&&this.prevButtons.forEach(e=>{e.onclick=()=>{this.flkty.previous(!0,!1)}}),this.nextButtons.length&&this.nextButtons.forEach(e=>{e.onclick=()=>{this.flkty.next(!0,!1)}}),document.addEventListener("theme:scroll",this.scrollEvent)}scrollEvents(){if(this.flkty&&this.autoplay&&this.speed){const slideshow2=this.flkty.element,slideshowBottomPosition=slideshow2.getBoundingClientRect().top+window.scrollY+slideshow2.offsetHeight;window.pageYOffset>slideshowBottomPosition?this.flkty.player.state==="playing"&&this.flkty.pausePlayer():this.flkty.player.state==="paused"&&this.flkty.playPlayer()}}unload(){document.removeEventListener("theme:scroll",this.scrollEvent),this.flkty&&this.wrapper&&this.wrapper.classList.contains(classes$i.isEnable)&&this.flkty.destroy()}onBlockSelect(evt){const slideIndex=evt.target.closest(`[${selectors$u.slideshoIndex}]`).getAttribute(selectors$u.slideshoIndex),select=parseInt(slideIndex);this.flkty.selectCell(select),this.flkty.stopPlayer()}onBlockDeselect(){this.autoplay&&this.flkty.playPlayer()}constructor(section2){this.container=section2.container,this.wrapper=section2.container.querySelector(selectors$u.wrapper),this.speed=this.wrapper.getAttribute(selectors$u.speed),this.autoplay=this.wrapper.getAttribute(selectors$u.autoplay)==="true",this.slideCount=parseInt(this.wrapper.getAttribute(selectors$u.slideCount),10),this.prevButtons=this.wrapper.querySelectorAll(selectors$u.prevButton),this.nextButtons=this.wrapper.querySelectorAll(selectors$u.nextButton),this.flkty=null,this.scrollEvent=()=>this.scrollEvents(),this.init()}};register("slideshow",[{onLoad(){sections$6[this.id]=new Slideshow(this)},onUnload(){typeof sections$6[this.id].unload=="function"&&sections$6[this.id].unload()},onBlockSelect(evt){typeof sections$6[this.id].onBlockSelect=="function"&&sections$6[this.id].onBlockSelect(evt)},onBlockDeselect(evt){typeof sections$6[this.id].onBlockSelect=="function"&&sections$6[this.id].onBlockDeselect(evt)}},parallaxImage,scrollButton]);const selectors$t={rangeSlider:"[data-range-slider]",rangeDotLeft:"[data-range-left]",rangeDotRight:"[data-range-right]",rangeLine:"[data-range-line]",rangeHolder:"[data-range-holder]",dataMin:"data-se-min",dataMax:"data-se-max",dataMinValue:"data-se-min-value",dataMaxValue:"data-se-max-value",dataStep:"data-se-step",dataFilterUpdate:"data-range-filter-update",priceMin:"[data-field-price-min]",priceMax:"[data-field-price-max]"},classes$h={isInitialized:"is-initialized"};let RangeSlider=class{init(){this.setDefaultValues(),this.touchLeft.addEventListener("mousedown",this.onStartEvent),this.touchRight.addEventListener("mousedown",this.onStartEvent),this.touchLeft.addEventListener("touchstart",this.onStartEvent),this.touchRight.addEventListener("touchstart",this.onStartEvent),this.slider.classList.add(classes$h.isInitialized)}setDefaultValues(){let defaultMinValue=this.min;this.slider.hasAttribute(selectors$t.dataMinValue)&&(defaultMinValue=parseFloat(this.slider.getAttribute(selectors$t.dataMinValue)));let defaultMaxValue=this.max;this.slider.hasAttribute(selectors$t.dataMaxValue)&&(defaultMaxValue=parseFloat(this.slider.getAttribute(selectors$t.dataMaxValue))),defaultMinValue<this.min&&(defaultMinValue=this.min),defaultMaxValue>this.max&&(defaultMaxValue=this.max),defaultMinValue>defaultMaxValue&&(defaultMinValue=defaultMaxValue),this.slider.getAttribute(selectors$t.dataStep)&&(this.step=Math.abs(parseFloat(this.slider.getAttribute(selectors$t.dataStep)))),this.reset(),this.maxX=this.slider.offsetWidth-this.touchRight.offsetWidth,this.selectedTouch=null,this.initialValue=this.lineSpan.offsetWidth-this.normalizeFact,this.setMinValue(defaultMinValue),this.setMaxValue(defaultMaxValue)}reset(){this.touchLeft.style.left="0px",this.touchRight.style.left=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.lineSpan.style.marginLeft="0px",this.lineSpan.style.width=this.slider.offsetWidth-this.touchLeft.offsetWidth+"px",this.startX=0,this.x=0}setMinValue(minValue){const ratio=(minValue-this.min)/(this.max-this.min);this.touchLeft.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact)))+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$t.dataMinValue,minValue)}setMaxValue(maxValue){const ratio=(maxValue-this.min)/(this.max-this.min);this.touchRight.style.left=Math.ceil(ratio*(this.slider.offsetWidth-(this.touchLeft.offsetWidth+this.normalizeFact))+this.normalizeFact)+"px",this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.slider.setAttribute(selectors$t.dataMaxValue,maxValue)}onStart(event){event.preventDefault();let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),event.currentTarget===this.touchLeft?this.x=this.touchLeft.offsetLeft:event.currentTarget===this.touchRight&&(this.x=this.touchRight.offsetLeft),this.startX=eventTouch.pageX-this.x,this.selectedTouch=event.currentTarget,document.addEventListener("mousemove",this.onMoveEvent),document.addEventListener("mouseup",this.onStopEvent),document.addEventListener("touchmove",this.onMoveEvent),document.addEventListener("touchend",this.onStopEvent)}onMove(event){let eventTouch=event;event.touches&&(eventTouch=event.touches[0]),this.x=eventTouch.pageX-this.startX,this.selectedTouch===this.touchLeft?(this.x>this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10?this.x=this.touchRight.offsetLeft-this.selectedTouch.offsetWidth+10:this.x<0&&(this.x=0),this.selectedTouch.style.left=this.x+"px"):this.selectedTouch===this.touchRight&&(this.x<this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10?this.x=this.touchLeft.offsetLeft+this.touchLeft.offsetWidth-10:this.x>this.maxX&&(this.x=this.maxX),this.selectedTouch.style.left=this.x+"px"),this.lineSpan.style.marginLeft=this.touchLeft.offsetLeft+"px",this.lineSpan.style.width=this.touchRight.offsetLeft-this.touchLeft.offsetLeft+"px",this.calculateValue(),this.slider.getAttribute("on-change")&&new Function("min, max",this.slider.getAttribute("on-change"))(this.slider.getAttribute(selectors$t.dataMinValue),this.slider.getAttribute(selectors$t.dataMaxValue)),this.onChange(this.slider.getAttribute(selectors$t.dataMinValue),this.slider.getAttribute(selectors$t.dataMaxValue))}onStop(event){document.removeEventListener("mousemove",this.onMoveEvent),document.removeEventListener("mouseup",this.onStopEvent),document.removeEventListener("touchmove",this.onMoveEvent),document.removeEventListener("touchend",this.onStopEvent),this.selectedTouch=null,this.calculateValue(),this.onChanged(this.slider.getAttribute(selectors$t.dataMinValue),this.slider.getAttribute(selectors$t.dataMaxValue))}onChange(min,max){const rangeHolder=this.slider.closest(selectors$t.rangeHolder);if(rangeHolder){const priceMin=rangeHolder.querySelector(selectors$t.priceMin),priceMax=rangeHolder.querySelector(selectors$t.priceMax);priceMin&&priceMax&&(priceMin.value=min,priceMax.value=max)}}onChanged(min,max){this.slider.hasAttribute(selectors$t.dataFilterUpdate)&&this.slider.dispatchEvent(new CustomEvent("theme:range:update",{bubbles:!0}))}calculateValue(){const newValue=(this.lineSpan.offsetWidth-this.normalizeFact)/this.initialValue;let minValue=this.lineSpan.offsetLeft/this.initialValue,maxValue=minValue+newValue;if(minValue=minValue*(this.max-this.min)+this.min,maxValue=maxValue*(this.max-this.min)+this.min,this.step!==0){let multi=Math.floor(minValue/this.step);minValue=this.step*multi,multi=Math.floor(maxValue/this.step),maxValue=this.step*multi}this.selectedTouch===this.touchLeft&&this.slider.setAttribute(selectors$t.dataMinValue,minValue),this.selectedTouch===this.touchRight&&this.slider.setAttribute(selectors$t.dataMaxValue,maxValue)}constructor(section2){this.container=section2.container,this.slider=section2.querySelector(selectors$t.rangeSlider),this.slider&&(this.onMoveEvent=event=>this.onMove(event),this.onStopEvent=event=>this.onStop(event),this.onStartEvent=event=>this.onStart(event),this.startX=0,this.x=0,this.touchLeft=this.slider.querySelector(selectors$t.rangeDotLeft),this.touchRight=this.slider.querySelector(selectors$t.rangeDotRight),this.lineSpan=this.slider.querySelector(selectors$t.rangeLine),this.min=parseFloat(this.slider.getAttribute(selectors$t.dataMin)),this.max=parseFloat(this.slider.getAttribute(selectors$t.dataMax)),this.step=0,this.normalizeFact=26,this.init(),document.addEventListener("theme:price-range:reset",()=>{this.setDefaultValues()}))}};const throttle$1=(fn,wait)=>{let prev2,next;return function invokeFn(...args){const now2=Date.now();next=clearTimeout(next),!prev2||now2-prev2>=wait?(fn.apply(null,args),prev2=now2):next=setTimeout(invokeFn.bind(null,...args),wait-(now2-prev2))}},selectors$s={filtersWrappper:"data-filters",underlay:"[data-filters-underlay]",filtersHideDesktop:"data-default-hide",filtersToggle:"data-filters-toggle",focusable:'button, [href], input, select, textarea, [tabindex]:not
56([tabindex="-1"])',groupHeading:"data-group-heading",showMore:"data-show-more"},classes$g={show:"drawer--visible",defaultVisible:"filters--default-visible",hide:"hidden",expand:"is-expanded",hidden:"is-hidden",focusEnable:"focus-enabled"},sections$5={};let Filters=class{unload(){this.filtersToggleButtons.length&&this.filtersToggleButtons.forEach(element=>{element.removeEventListener("click",this.connectToggleMemory)}),this.showMoreButtons.length&&this.showMoreButtons.forEach(button=>{button.removeEventListener("click",this.connectShowHiddenOptions)})}expandingEvents(){this.showMoreButtons.length&&this.showMoreButtons.forEach(button=>{button.addEventListener("click",throttle$1(this.connectShowHiddenOptions,500))})}showHiddenOptions(evt){const element=evt.target.hasAttribute(selectors$s.showMore)?evt.target:evt.target.closest(`[${selectors$s.showMore}]`);element.classList.add(classes$g.hidden),element.previousElementSibling.querySelectorAll(`.${classes$g.hidden}`).forEach(option=>{option.classList.remove(classes$g.hidden)})}connectToggle(refresh=!1){this.filtersToggleButtons.forEach(button=>{const isDynamic=button.closest(`[${selectors$s.filtersWrappper}]`)!==null;(isDynamic&&refresh||isDynamic&&!refresh||!isDynamic&&!refresh)&&button.addEventListener("click",this.connectToggleMemory.bind(this))})}connectToggleFunction(evt){evt.currentTarget.getAttribute("aria-expanded")==="true"?this.hideFilters():this.showFilters()}onFocusOut(){this.container.addEventListener("focusout",(function(evt){if(window.innerWidth>=window.theme.sizes.medium)return;const childInFocus=evt.currentTarget.contains(evt.relatedTarget),isVisible=this.container.classList.contains(classes$g.show);document.body.classList.contains(classes$g.focusEnable)&&isVisible&&!childInFocus&&this.hideFilters()}).bind(this)),this.container.addEventListener("keyup",(function(evt){evt.code==="Escape"&&(this.hideFilters(),this.filtersToggleButtons[0].focus())}).bind(this)),this.underlay.addEventListener("click",(function(){this.hideFilters()}).bind(this))}getShowOnLoad(){const selector=`[${selectors$s.filtersHideDesktop}='false']`,showOnDesktop=document.querySelector(selector),isDesktop2=window.innerWidth>=window.theme.sizes.medium;return!!(showOnDesktop&&isDesktop2)}showFilters(){this.filtersToggleButtons=document.querySelectorAll(this.selector),this.container.classList.remove(classes$g.hide),setTimeout(()=>{this.filtersToggleButtons.forEach(btn=>btn.setAttribute("aria-expanded",!0)),this.filtersToggleButtons.forEach(btn=>btn.classList.add(classes$g.show)),this.container.classList.add(classes$g.show),this.container.querySelector(selectors$s.focusable).focus()},1)}hideFilters(){this.filtersToggleButtons=document.querySelectorAll(this.selector),this.filtersToggleButtons.forEach(btn=>btn.setAttribute("aria-expanded",!1)),this.container.classList.remove(classes$g.show),this.container.classList.remove(classes$g.defaultVisible),this.filtersToggleButtons.forEach(btn=>btn.classList.remove(classes$g.show)),this.filtersToggleButtons.forEach(btn=>btn.classList.remove(classes$g.defaultVisible)),setTimeout(()=>{this.container.classList.contains(classes$g.show)||this.container.classList.add(classes$g.hide)},800)}constructor(filters,refresh=!1){this.container=filters,this.underlay=this.container.querySelector(selectors$s.underlay),this.groupHeadings=this.container.querySelectorAll(`[${selectors$s.groupHeading}]`),this.showMoreButtons=this.container.querySelectorAll(`[${selectors$s.showMore}]`),this.triggerKey=this.container.getAttribute(selectors$s.filtersWrappper),this.selector=`[${selectors$s.filtersToggle}='${this.triggerKey}']`,this.filtersToggleButtons=document.querySelectorAll(this.selector),this.connectToggleMemory=evt=>this.connectToggleFunction(evt),this.connectShowHiddenOptions=evt=>this.showHiddenOptions(evt),this.connectToggle(refresh),this.onFocusOut(),this.expandingEvents(),this.getShowOnLoad()?this.showFilters():this.hideFilters()}};const collectionFiltersSidebar={onLoad(){sections$5[this.id]=[],this.container.querySelectorAll(`[${selectors$s.filtersWrappper}]`).forEach(wrapper=>{sections$5[this.id].push(new Filters(wrapper))})}
56,onUnload:function(){sections$5[this.id].forEach(filters=>{typeof filters.unload=="function"&&filters.unload()})}},selectors$r={collectionSidebar:"[data-collection-sidebar]",form:"[data-sidebar-filter-form]",inputs:"input, select, label, textarea",priceMin:"data-field-price-min",priceMax:"data-field-price-max",rangeMin:"data-se-min-value",rangeMax:"data-se-max-value",rangeMinDefault:"data-se-min",rangeMaxDefault:"data-se-max",productsContainer:"[data-products-grid]",filterUpdateUrlButton:"[data-filter-update-url]",activeFiltersHolder:"[data-active-filters]",activeFiltersCount:"[data-active-filters-count]",productsCount:"[data-products-count]",dataSort:"data-sort-enabled",collectionTools:"[data-collection-tools]",filtersWrappper:"[data-filters]",headerSticky:'[data-header-sticky="sticky"]',headerHeight:"[data-header-height]",gridLarge:"data-grid-large",gridSmall:"data-grid-small",filter:"[data-filter]",showMore:"[data-show-more]",checkedOption:"input:checked",optionHolder:"[data-option-holder]"},classes$f={classHidden:"is-hidden",classLoading:"is-loading"},times={loadingDelay:1e3,scrollTime:1e3};let FiltersForm=class{init(){this.showAllOptions(),this.form&&(new RangeSlider(this.form),this.sidebar.addEventListener("input",debounce$1(e=>{const type=e.type,target=e.target;if(!selectors$r.inputs.includes(type)||!this.form||typeof this.form.submit!="function")return;const priceMin=this.form.querySelector(`[${selectors$r.priceMin}]`),priceMax=this.form.querySelector(`[${selectors$r.priceMax}]`);if(target.hasAttribute(selectors$r.priceMin)||target.hasAttribute(selectors$r.priceMax)){const rangeMin=this.form.querySelector(`[${selectors$r.rangeMin}]`),rangeMax=this.form.querySelector(`[${selectors$r.rangeMax}]`),rangeMinDefault=parseInt(rangeMin.getAttribute(selectors$r.rangeMinDefault)),rangeMaxDefault=parseInt(rangeMax.getAttribute(selectors$r.rangeMaxDefault));priceMin.value&&!priceMax.value&&(priceMax.value=rangeMaxDefault),priceMax.value&&!priceMin.value&&(priceMin.value=rangeMinDefault),priceMin.value<=rangeMinDefault&&priceMax.value>=rangeMaxDefault&&(priceMin.placeholder=rangeMinDefault,priceMax.placeholder=rangeMaxDefault,priceMin.value="",priceMax.value="")}this.filtering(e)},1500)),this.form.addEventListener("theme:range:update",e=>this.updateRange(e))),this.sidebar&&this.sidebar.addEventListener("click",e=>this.updateFilterFromUrl(e)),this.activeFiltersHolder&&this.activeFiltersHolder.addEventListener("click",e=>this.updateFilterFromUrl(e)),this.productsContainer&&this.productsContainer.addEventListener("click",e=>this.updateFilterFromUrl(e)),makeSwappers(this.sidebar)}updateRange(e){if(this.form&&typeof this.form.submit=="function"){const rangeMin=this.form.querySelector(`[${selectors$r.rangeMin}]`),rangeMax=this.form.querySelector(`[${selectors$r.rangeMax}]`),priceMin=this.form.querySelector(`[${selectors$r.priceMin}]`),priceMax=this.form.querySelector(`[${selectors$r.priceMax}]`);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$r.rangeMin)&&rangeMax.hasAttribute(selectors$r.rangeMax)){const priceMinValue=parseInt(priceMin.placeholder),priceMaxValue=parseInt(priceMax.placeholder),rangeMinValue=parseInt(rangeMin.getAttribute(selectors$r.rangeMin)),rangeMaxValue=parseInt(rangeMax.getAttribute(selectors$r.rangeMax));(priceMinValue!==rangeMinValue||priceMaxValue!==rangeMaxValue)&&(priceMin.value=rangeMinValue,priceMax.value=rangeMaxValue,this.filtering(e))}}}updateFilterFromUrl(e){const target=e.target;if(target.matches(selectors$r.filterUpdateUrlButton)||target.closest(selectors$r.filterUpdateUrlButton)&&target){e.preventDefault();const button=target.matches(selectors$r.filterUpdateUrlButton)?target:target.closest(selectors$r.filterUpdateUrlButton);this.filtering(e,button.getAttribute("href"))}}addToHistory(e,replaceHref=""){const sortValue=this.sort?this.sort.getAttribute(selectors$r.dataSort):"";if(!e||e&&e.type!=="popstate"){if(replaceHref===""){const searchParams=new window.URL(window.location.href).searchParams,filterUrlParams=Object.fromEntries(searchParams),filterUrlRemoveString=searchParams.toString();if(filterUrlRemoveString.includes("filter.")||filterUrlRemoveString.includes("sort_by")||filterUrlRemoveString.includes("page"))for(const key in filterUrlParams)(key.includes("filter.")||key.includes("sort_by")||key.includes("page"))&&searchParams.delete(key);if(this.form){const formParams=new URLSearchParams(new FormData(this.form));
56for(let[key,val]of formParams.entries())key.includes("filter.")&&val&&searchParams.append(key,val);const rangeMin=this.form.querySelector(`[${selectors$r.rangeMin}]`),rangeMax=this.form.querySelector(`[${selectors$r.rangeMax}]`),priceMin=this.form.querySelector(`[${selectors$r.priceMin}]`),priceMax=this.form.querySelector(`[${selectors$r.priceMax}]`);if(rangeMin&&rangeMax&&priceMin&&priceMax&&rangeMin.hasAttribute(selectors$r.rangeMinDefault)&&rangeMax.hasAttribute(selectors$r.rangeMaxDefault)){const rangeMinDefault=parseFloat(rangeMin.getAttribute(selectors$r.rangeMinDefault),10),rangeMaxDefault=parseFloat(rangeMax.getAttribute(selectors$r.rangeMaxDefault),10),priceMinValue=priceMin.value===""?parseFloat(priceMin.placeholder,10):parseFloat(priceMin.value,10),priceMaxValue=priceMax.value===""?parseFloat(priceMax.placeholder,10):parseFloat(priceMax.value,10);priceMinValue<=rangeMinDefault&&priceMaxValue>=rangeMaxDefault&&(searchParams.delete("filter.v.price.gte"),searchParams.delete("filter.v.price.lte"))}}if(sortValue||e&&e.detail&&e.detail.href){const sortString=sortValue||e.detail.params;searchParams.set("sort_by",sortString)}const filterUrlString=searchParams.toString(),filterNewParams=filterUrlString?`?${filterUrlString}`:location.pathname;window.history.pushState(null,"",filterNewParams);return}window.history.pushState(null,"",replaceHref)}}getFilterResult(){this.productsContainer.classList.add(classes$f.classLoading),this.getGridValues();const url=new window.URL(window.location.href);url.searchParams.set("section_id",this.section.id),fetch(`${window.location.pathname}${url.search}`).then(response=>response.text()).then(response=>{const responseHolder=document.createElement("div");responseHolder.innerHTML=response,this.sidebar&&(this.sidebar.innerHTML=responseHolder.querySelector(selectors$r.collectionSidebar).innerHTML),this.activeFiltersCount&&(this.activeFiltersCount.innerHTML=responseHolder.querySelector(selectors$r.activeFiltersCount).innerHTML),this.productsContainer.innerHTML=responseHolder.querySelector(selectors$r.productsContainer).innerHTML,this.activeFiltersHolder.innerHTML=responseHolder.querySelector(selectors$r.activeFiltersHolder).innerHTML,this.activeFiltersHolder.parentNode.classList.toggle(classes$f.classHidden,this.activeFiltersHolder.innerHTML===""),this.productsCount&&(this.productsCount.innerHTML=responseHolder.querySelector(selectors$r.productsCount).innerHTML),this.setGridValues(),this.refreshFunctionalities(),setTimeout(()=>{this.productsContainer.classList.remove(classes$f.classLoading)},times.loadingDelay)})}refreshFunctionalities(){this.form=this.container.querySelector(selectors$r.form),this.form&&(new RangeSlider(this.form),this.form.addEventListener("theme:range:update",e=>this.updateRange(e))),this.container.querySelectorAll(selectors$r.filtersWrappper).forEach(filter2=>{new Filters(filter2,!0)}),new Siblings(this.container),this.sidebar&&makeSwappers(this.sidebar),this.showAllOptions()}getGridValues(){this.layoutLarge&&(this.layoutLargeValue=this.layoutLarge.getAttribute(selectors$r.gridLarge)),this.layoutSmall&&(this.layoutSmallValue=this.layoutSmall.getAttribute(selectors$r.gridSmall))}setGridValues(){this.layoutLarge&&(this.layoutLarge=this.container.querySelector(`[${selectors$r.gridLarge}]`),this.layoutLarge.setAttribute(selectors$r.gridLarge,this.layoutLargeValue)),this.layoutSmall&&(this.layoutSmall=this.container.querySelector(`[${selectors$r.gridSmall}]`),this.layoutSmall.setAttribute(selectors$r.gridSmall,this.layoutSmallValue))}showAllOptions(){this.container.querySelectorAll(selectors$r.checkedOption).forEach(option=>{if(option.closest(selectors$r.optionHolder)&&option.closest(selectors$r.optionHolder).classList.contains(classes$f.classHidden)){const filter2=option.closest(selectors$r.filter),button=filter2?.querySelector(selectors$r.showMore);button&&!button.classList.contains(classes$f.classHidden)&&button.dispatchEvent(new Event("click"))}})}filtering(e,replaceHref=""){if(e.state===null)return;const headerH=this.headerIsSticky?document.querySelector(selectors$r.headerHeight).getBoundingClientRect().height:0,scrollToElement=this.container.offsetTop-headerH;let options2={root:null,rootMargin:`${headerH}px`,threshold:1};const handleFilterAndScroll=entries=>{const[entry]=entries;setTimeout(()=>{this.addToHistory(e,replaceHref),this.getFilterResult()},entry.isIntersecting?10:times.scrollTime),observer2.unobserve(this.productsContainer),!entry.isIntersecting&&window.scrollTo({top:scrollToElement,left:0,behavior:"smooth"})},observer2=new IntersectionObserver(handleFilterAndScroll,options2);observer2.observe(this.productsContainer)}constructor(section2){this.section=section2,this.container=this.section.container,this.sidebar=this.container.querySelector(selectors$r.collectionSidebar),this.form=section2.container.querySelector(selectors$r.form),this.sort=this.container.querySelector(`[${selectors$r.dataSort}]`),this.productsContainer=this.container.querySelector(selectors$r.productsContainer),this.activeFiltersHolder=this.container.querySelector(selectors$r.activeFiltersHolder),this.activeFiltersCount=this.container.querySelector(selectors$r.activeFiltersCount),this.productsCount=this.container.querySelector(selectors$r.productsCount),this.headerIsSticky=document.querySelector(selectors$r.headerSticky)!==null,this.layoutLarge=this.container.querySelector(`[${selectors$r.gridLarge}]`),this.layoutSmall=this.container.querySelector(`[${selectors$r.gridSmall}]`),this.productsContainer&&this.sidebar&&this.init(),this.sort&&this.container.addEventListener("theme:form:filter",e=>this.filtering(e)),(this.sidebar||this.sort)&&window.addEventListener("popstate",e=>this.filtering(e))}};const collectionFiltersForm={onLoad(){this.filterForm=new FiltersForm(this)},onUnload(){this.filterForm&&typeof this.filterForm.unload=="function"&&this.filterForm.unload()}};register("search-page",[collectionFiltersSidebar,collectionFiltersForm,swatchGridSection]),customElements.get("popout-select")||customElements.define("popout-select",PopoutSelect),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage);const selectors$q={zoomImage:"[data-image-zoom]",modalContainer:"[data-modal-container]",attrUnique:"data-unique",image:"data-src"};
56let GalleryZoom=class{init(){this.triggers.forEach(trigger2=>{const unique=trigger2.getAttribute(selectors$q.attrUnique),modalIsAdded=this.modalContainer.querySelector(`#zoom-${unique}`);if(modalIsAdded){const newModal=this.container.querySelector(`#zoom-${unique}`);newModal&&(modalIsAdded.parentNode.removeChild(modalIsAdded),this.modalContainer.appendChild(newModal))}MicroModal.init({disableScroll:!0,openTrigger:`data-popup-${unique}`,onShow:modal2=>{var images=modal2.querySelectorAll(`[${selectors$q.image}]`,modal2);images.forEach(image=>{if(image.getAttribute("src")===null){const bigImage=image.getAttribute(selectors$q.image);image.setAttribute("src",bigImage)}})},onClose:(modal2,el,event)=>{event.preventDefault()}})})}constructor(container){this.container=container,this.triggers=this.container.querySelectorAll(selectors$q.zoomImage),this.modalContainer=document.querySelector(selectors$q.modalContainer),this.init()}};register("gallery",[{onLoad(){new GalleryZoom(this.container)}},popupVideoSection,customScrollbar]);const tokensReducer=(acc,token)=>{const{el,elStyle,elHeight,rowsLimit,rowsWrapped,options:options2}=acc;let oldBuffer=acc.buffer,newBuffer=oldBuffer;if(rowsWrapped===rowsLimit+1)return{...acc};const textBeforeWrap=oldBuffer;let newRowsWrapped=rowsWrapped,newHeight=elHeight;return el.innerHTML=newBuffer=oldBuffer.length?`${oldBuffer}${options2.delimiter}${token}${options2.replaceStr}`:`${token}${options2.replaceStr}`,parseFloat(elStyle.height)>parseFloat(elHeight)&&(newRowsWrapped++,newHeight=elStyle.height,newRowsWrapped===rowsLimit+1)?(el.innerHTML=newBuffer=textBeforeWrap[textBeforeWrap.length-1]==="."&&options2.replaceStr==="..."?`${textBeforeWrap}..`:`${textBeforeWrap}${options2.replaceStr}`,{...acc,elHeight:newHeight,rowsWrapped:newRowsWrapped}):(el.innerHTML=newBuffer=textBeforeWrap.length?`${textBeforeWrap}${options2.delimiter}${token}`:`${token}`,{...acc,buffer:newBuffer,elHeight:newHeight,rowsWrapped:newRowsWrapped})},ellipsis=(selector="",rows=1,options2={})=>{const opts={...{replaceStr:"...",debounceDelay:250,delimiter:" "},...options2},elements=selector&&(selector instanceof NodeList?selector:selector.nodeType===1?[selector]:document.querySelectorAll(selector));for(let i=0;i<elements.length;i++){const el=elements[i],elementHtml=el.innerHTML,commentRegex=/<!--[\s\S]*?-->/g,splittedText=elementHtml.replace(commentRegex,"").split(opts.delimiter);el.innerHTML="";const elStyle=window.getComputedStyle(el);splittedText.reduce(tokensReducer,{el,buffer:el.innerHTML,elStyle,elHeight:0,rowsLimit:rows,rowsWrapped:0,options:opts})}};function isTouch(){const isTouch1="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;return document.documentElement.classList.toggle("supports-touch",isTouch1),isTouch1}isTouch();let modelJsonSections={},models={},xrButtons={};const selectors$p={productSlideshow:"[data-product-slideshow]",productXr:"[data-shopify-xr]",dataMediaId:"data-media-id",dataModelId:"data-model-id",modelViewer:"model-viewer",dataModel3d:"data-shopify-model3d-id",modelJson:"#ModelJson-"};function initSectionModels(modelViewerContainer,sectionId){modelJsonSections[sectionId]={loaded:!1};const mediaId=modelViewerContainer.getAttribute(selectors$p.dataMediaId),modelViewerElement=modelViewerContainer.querySelector(selectors$p.modelViewer),modelId=modelViewerElement.getAttribute(selectors$p.dataModelId);if(modelViewerContainer.closest(selectors$p.productSlideshow)!==null){const xrButton=modelViewerContainer.closest(selectors$p.productSlideshow).parentElement.querySelector(selectors$p.productXr);xrButtons[sectionId]={$element:xrButton,defaultId:modelId}}models[mediaId]={modelId,mediaId,sectionId,$container:modelViewerContainer,$element:modelViewerElement},window.Shopify.loadFeatures([{name:"shopify-xr",version:"1.0",onLoad:setupShopifyXr},{name:"model-viewer-ui",version:"1.0",onLoad:setupModelViewerUi}])}function setupShopifyXr(errors){if(errors){console.warn(errors);return}if(!window.ShopifyXR){document.addEventListener("shopify_xr_initialized",function(){setupShopifyXr()});return}for(const sectionId in modelJsonSections)if(modelJsonSections.hasOwnProperty(sectionId)){const modelSection=modelJsonSections[sectionId];if(modelSection.loaded)continue;const modelJson=document.querySelector(`${selectors$p.modelJson}${sectionId}`);modelJson&&(window.ShopifyXR.addModels(JSON.parse(modelJson.innerHTML)),modelSection.loaded=!0)}window.ShopifyXR.setupXRElements()}function setupModelViewerUi(errors){if(errors){console.warn(errors);return}for(const key in models)if(models.hasOwnProperty(key)){const model=models[key];model.modelViewerUi||(model.modelViewerUi=new Shopify.ModelViewerUI(model.$element)),setupModelViewerListeners(model)}}function setupModelViewerListeners(model){const xrButton=xrButtons[model.sectionId];model.$container.addEventListener("pause",function(){model.modelViewerUi.pause&&model.modelViewerUi.pause()}),model.$container.addEventListener("play",function(){model.modelViewerUi.play&&(model.modelViewerUi.play(),xrButton&&xrButton.$element&&model&&model.modelId&&selectors$p.dataModel3d&&xrButton.$element.setAttribute(selectors$p.dataModel3d,model.modelId))}),model.$element.addEventListener("shopify_model_viewer_ui_toggle_play",()=>
56{model.$container.dispatchEvent(new CustomEvent("theme:media:play"))}),model.$element.addEventListener("shopify_model_viewer_ui_toggle_pause",()=>{model.$container.dispatchEvent(new CustomEvent("theme:media:pause"))})}async function productNativeVideo(uniqueKey){const playerElement=document.querySelector(`[data-player="${uniqueKey}"]`),videoElement=playerElement.querySelector("video");await loadScript({name:"video-ui",version:"1.0"});const player=new window.Shopify.Plyr(videoElement);return playerElement.addEventListener("pause",()=>{player.pause&&player.pause()}),playerElement.addEventListener("play",()=>{try{player.play?player.paused&&player.play():player.addEventListener("onReady",()=>{player.play()})}catch(e){console.warn(e)}}),playerElement.addEventListener("destroy",()=>{try{player.destroy&&player.destroy()}catch(e){console.warn(e)}}),player}const selectors$o={productSlideshow:"[data-product-slideshow]",slideshowMobileStyle:"data-slideshow-mobile-style",slideshowDesktopStyle:"data-slideshow-desktop-style",productThumbs:"[data-product-thumbs]",leftThumbsHolder:"[data-thumbs-holder]",thumbImage:"[data-slideshow-thumbnail]",mediaSlide:"[data-media-slide]",dataMediaId:"data-media-id",dataMediaSelect:"data-media-select",mediaType:"data-type",videoPlayerExternal:'[data-type="external_video"]',videoPlayerNative:'[data-type="video"]',modelViewer:'[data-type="model"]',modelViewerTag:"model-viewer",allPlayers:"[data-player]",loopVideo:"data-enable-video-looping",verticalAlignment:"[data-thumbnails-left]",arrowPrev:"[data-thumbs-arrow-prev]",arrowNext:"[data-thumbs-arrow-next]",aspectRatio:"data-aspect-ratio",flickitylockHeight:"flickity-lock-height"},classes$e={flickityDisableClass:"flickity-disabled-mobile",flickityEnabled:"flickity-enabled",selected:"is-selected",active:"is-activated",show:"show",enableVideoDraggable:"enable-video-draggable",hide:"hide"};let Media=class{init(){this.storeEvents(),this.connectSliderMediaEvents(),this.detectVideos(),this.detect3d(),this.scrollThumbs(),document.addEventListener("theme:resize:width",()=>{this.scrollThumbs()}),resolution.onChange(()=>{this.connectSliderMediaEvents()})}connectSliderMediaEvents(){resolution.isMobile()?this.createMobileSlider():this.createDesktopSlider()}createMobileSlider(){this.hasDesktopSlider&&this.flkty&&(this.destroySlider(),this.hasDesktopSlider=!1);const mobileOptions={autoPlay:!1,prevNextButtons:!1,pageDots:!1,adaptiveHeight:!0,accessibility:!0,watchCSS:!1,wrapAround:!0,rightToLeft:window.isRTL,dragThreshold:80,contain:!0,fade:!0};this.mobileStyle=="carousel"&&(mobileOptions.contain=!1,mobileOptions.dragThreshold=10,mobileOptions.fade=!1),this.mobileStyle=="slideshow"&&(mobileOptions.pageDots=!0,mobileOptions.fade=!1,mobileOptions.dragThreshold=10),this.mobileStyle!="none"&&(this.createSlider(mobileOptions),this.hasMobileSlider=!0)}createDesktopSlider(){if(this.hasMobileSlider&&this.flkty&&(this.destroySlider(),this.hasMobileSlider=!1),this.desktopStyle=="none")return;const desktopOptions={autoPlay:!1,prevNextButtons:!1,pageDots:!1,adaptiveHeight:!0,accessibility:!0,watchCSS:!1,wrapAround:!0,rightToLeft:window.isRTL,dragThreshold:80,contain:!0,fade:!0};this.createSlider(desktopOptions),this.hasDesktopSlider=!0}createSlider(options2){this.flkty=new Flickity(this.slideshow,options2),this.flkty.resize(),this.currentSlide=this.slideshow.querySelectorAll(selectors$o.mediaSlide)[0],this.setDraggable(),this.addEventListeners()}destroySlider(){this.removeEventListeners(),this.flkty.destroy()}storeEvents(){this.storeFlktyChange=e=>this.doFlktyChange(e),this.storeFlktySettle=e=>this.doFlktySettle(e),this.storeImageChange=e=>this.doImageChange(e),this.storeArrowPrevClick=e=>this.doArrowPrevClick(e),this.storeArrowNextClick=e=>this.doArrowNextClick(e),this.storeThumbClick=e=>this.doThumbClick(e),this.storeThumbContainerScroll=e=>this.doThumbContainerScroll(e)}addEventListeners(){var ref2,ref1,ref22;this.flkty.on("change",this.storeFlktyChange),this.flkty.on("settle",this.storeFlktySettle),this.slideshow.addEventListener("theme:image:change",this.storeImageChange),(ref2=this.arrowPrev)===null||ref2===void 0||ref2.addEventListener("click",this.storeArrowPrevClick),(ref1=this.arrowNext)===null||ref1===void 0||ref1.addEventListener("click",this.storeArrowNextClick),(ref22=this.thumbs)===null||ref22===void 0||ref22.addEventListener("scroll",this.storeThumbContainerScroll),this.thumbImages.forEac
56h(thumb=>{thumb.addEventListener("click",this.storeThumbClick)})}removeEventListeners(){var ref2,ref3,ref4;this.flkty.on("change",this.storeFlktyChange),this.flkty.on("settle",this.storeFlktySettle),this.slideshow.removeEventListener("theme:image:change",this.storeImageChange),(ref2=this.arrowPrev)===null||ref2===void 0||ref2.removeEventListener("click",this.storeArrowPrevClick),(ref3=this.arrowNext)===null||ref3===void 0||ref3.removeEventListener("click",this.storeArrowNextClick),(ref4=this.thumbs)===null||ref4===void 0||ref4.removeEventListener("scroll",this.storeThumbContainerScroll),this.thumbImages.forEach(thumb=>{thumb.removeEventListener("click",this.storeThumbClick)})}addMediaEventListeners(media){media&&(media.addEventListener("play",()=>{(resolution.isMobile()||resolution.isTouch())&&this.updateDraggable(!1)}),media.addEventListener("pause",()=>{(resolution.isMobile()||resolution.isTouch())&&this.updateDraggable(!0)}))}doFlktyChange(index){var ref2,ref5;(this.mediaType==="model"||this.mediaType==="video"||this.mediaType==="external_video")&&this.currentSlide.dispatchEvent(new CustomEvent("pause")),this.currentSlide=this.flkty.cells[index].element,this.slideshow.classList.remove(selectors$o.flickitylockHeight);const id=this.currentSlide.getAttribute(selectors$o.dataMediaId),currentThumb=(ref2=this.thumbWrapper)===null||ref2===void 0?void 0:ref2.querySelector(`[${selectors$o.dataMediaSelect}="${id}"]`);(ref5=this.thumbWrapper)===null||ref5===void 0||ref5.querySelector(`.${classes$e.active}`).classList.remove(classes$e.active),currentThumb?.classList.add(classes$e.active),this.scrollThumbs(),setTimeout(()=>{if(currentThumb?.classList.contains(classes$e.hide)||this.currentSlide.classList.contains(classes$e.hide)){let length=this.flkty.cells.length;const moveLeft=this.flkty.dragStartPosition<this.flkty.dragX;for(let n=0;n<length;n++){let position=moveLeft?index-n:index+n;position<0&&(position=position+length),position>=length&&(position=position-length);const mediaSelect=this.flkty.cells[position].element;if(!mediaSelect.classList.contains(classes$e.hide)){this.lastMediaSelect=mediaSelect.getAttribute(selectors$o.dataMediaId);break}}this.lastMediaSelect?this.slideshow.dispatchEvent(new CustomEvent("theme:image:change",{detail:{id:this.lastMediaSelect}})):window.location.reload()}})}doFlktySettle(index){this.allSlides=this.flkty.cells,this.currentSlide=this.flkty.cells[index].element,this.setDraggable(),document.body.classList.contains(selectors$o.focusEnabled)&&this.currentSlide.dispatchEvent(new Event("focus")),this.scrollThumbs()}doImageChange(event){var mediaId=event.detail.id;this.lastMediaSelect=mediaId;const mediaIdString=`[${selectors$o.dataMediaId}="${mediaId}"]`,matchesMedia=cell=>cell.element.matches(mediaIdString),index=this.flkty.cells.findIndex(matchesMedia);this.flkty.select(index),this.scrollThumbs()}doThumbContainerScroll(){this.scrollThumbs("scroll")}doArrowPrevClick(){this.scrollThumbs("clickPrev")}doArrowNextClick(){this.scrollThumbs("clickNext")}doThumbClick(event){const id=event.currentTarget.getAttribute(selectors$o.dataMediaSelect);this.slideshow.dispatchEvent(new CustomEvent("theme:image:change",{detail:{id}}))}setDraggable(){this.currentSlide&&(this.mediaType=this.currentSlide.getAttribute(selectors$o.mediaType),this.mediaType==="model"||this.mediaType==="video"||this.mediaType==="external_video"?!resolution.isMobile()||!resolution.isTouch()?(this.currentSlide.dispatchEvent(new CustomEvent("play")),this.updateDraggable(!1)):this.updateDraggable(!0):this.updateDraggable(!0))}updateDraggable(state){this.flkty&&(this.flkty.options.draggable=state,this.flkty.updateDraggable(),this.slideshow.classList.toggle(classes$e.enableVideoDraggable,state))}detect3d(){const modelViewerElements=this.container.querySelectorAll(selectors$o.modelViewer);modelViewerElements&&(modelViewerElements.forEach(element=>{initSectionModels(element,this.section.id),element.addEventListener("theme:media:play",()=>{this.updateDraggable(!1)}),element.addEventListener("theme:media:pause",()=>{this.updateDraggable(!0)})}),document.addEventListener("shopify_xr_launch",(function(){this.container.querySelectorAll(selectors$o.allPlayers
56).forEach(player=>{player.dispatchEvent(new CustomEvent("pause"))})}).bind(this)))}detectVideos(){const playerElements=this.section.container.querySelectorAll(`${selectors$o.videoPlayerExternal}, ${selectors$o.videoPlayerNative}`);for(var player of playerElements){const uniqueKey=player.dataset.player,host=player.dataset.host;let videoPlayerPromise;host==="youtube"?videoPlayerPromise=embedYoutube(uniqueKey):host==="vimeo"?videoPlayerPromise=embedVimeo(uniqueKey):videoPlayerPromise=productNativeVideo(uniqueKey),this.loopVideo===!0&&videoPlayerPromise.then(videoPlayer=>host?_setToLoop(videoPlayer,host):(videoPlayer.loop=!0,videoPlayer)).catch(err=>{console.error(err)}),this.addMediaEventListeners(player)}}pauseAllMedia(){this.container.querySelector(selectors$o.mediaSlide).dispatchEvent(new CustomEvent("pause"))}pauseOtherMedia(uniqueKey){this.container.querySelector(`${selectors$o.mediaSlide}:not([data-player="${uniqueKey}"])`).dispatchEvent(new CustomEvent("pause"))}destroy(){this.container.querySelectorAll(selectors$o.allPlayers).forEach(player=>{player.dispatchEvent(new CustomEvent("destroy"))})}scrollThumbs(event){if(this.thumbs=this.container.querySelector(selectors$o.productThumbs),this.thumbs){if(this.thumb=this.thumbs.querySelector(`.${classes$e.active}`),this.thumbItems=this.container.querySelectorAll(selectors$o.thumbImage),this.lastThumb=this.thumbItems[this.thumbItems.length-1],!this.thumb)return;this.thumbsScrollTop=this.thumbs.scrollTop,this.thumbsScrollLeft=this.thumbs.scrollLeft,this.thumbsWidth=this.thumbs.offsetWidth,this.thumbsHeight=this.slideshow.offsetWidth/this.thumb.getAttribute(selectors$o.aspectRatio),this.thumbsPositionBottom=this.thumbsScrollTop+this.thumbsHeight,this.thumbsPositionRight=this.thumbsScrollLeft+this.thumbsWidth,this.checkThumbPositions(),this.toggleToActiveThumb(event),this.toggleArrows()}}checkThumbPositions(){this.thumbWidth=this.thumb.offsetWidth,this.thumbHeight=this.thumb.offsetHeight,this.thumbPosTop=this.thumb.offsetTop,this.thumbPosLeft=this.thumb.offsetLeft,this.lastThumbRightPos=this.lastThumb.offsetLeft+this.thumbWidth,this.lastThumbBottomPos=this.lastThumb.offsetTop+this.thumbHe
56ight,this.scrollTopPosition=this.thumbPosTop+this.thumbHeight/2-this.thumbsHeight/2,this.scrollLeftPosition=this.thumbPosLeft+this.thumbWidth/2-this.thumbsWidth/2,this.topCheck=this.thumbsScrollTop>0,this.bottomCheck=this.thumbsPositionBottom<this.lastThumbBottomPos,this.leftCheck=this.thumbsScrollLeft>0,this.rightCheck=this.thumbsPositionRight<this.lastThumbRightPos,this.verticalCheck=this.bottomCheck||this.topCheck,this.horizontalCheck=this.rightCheck||this.leftCheck}toggleToActiveThumb(event){event!=="scroll"&&(event=="clickPrev"&&(this.verticalCheck?(this.scrollTopPosition=this.thumbsScrollTop-this.thumbsHeight,this.scrollLeftPosition=0):(this.scrollTopPosition=0,this.scrollLeftPosition=this.thumbsScrollLeft-this.thumbsWidth)),event=="clickNext"&&(this.verticalCheck?(this.scrollTopPosition=this.thumbsScrollTop+this.thumbsHeight,this.scrollLeftPosition=0):(this.scrollTopPosition=0,this.scrollLeftPosition=this.thumbsScrollLeft+this.thumbsWidth)),this.thumbs.scrollTo({top:this.scrollTopPosition,left:this.scrollLeftPosition,behavior:"smooth"}))}toggleArrows(){(this.verticalCheck||this.verticalAlignment&&!this.verticalCheck)&&(this.arrowPrev.classList.toggle(classes$e.show,this.topCheck),this.arrowNext.classList.toggle(classes$e.show,this.bottomCheck)),(this.horizontalCheck||!this.verticalAlignment&&!this.horizontalCheck)&&(this.arrowPrev.classList.toggle(classes$e.show,this.leftCheck),this.arrowNext.classList.toggle(classes$e.show,this.rightCheck))}constructor(section2){var ref2,ref6;this.section=section2,this.container=section2.container,this.slideshow=this.container.querySelector(selectors$o.productSlideshow),this.mobileStyle=((ref2=this.slideshow)===null||ref2===void 0?void 0:ref2.getAttribute(selectors$o.slideshowMobileStyle))||"none",this.desktopStyle=((ref6=this.slideshow)===null||ref6===void 0?void 0:ref6.getAttribute(selectors$o.slideshowDesktopStyle))||"none",this.arrowPrev=this.container.querySelector(selectors$o.arrowPrev),this.arrowNext=this.container.querySelector(selectors$o.arrowNext),this.leftThumbsHolder=this.container.querySelector(selectors$o.leftThumbsHolder),this.thumbWrapper=this.container.querySelector(selectors$o.productThumbs),this.thumbImages=this.container.querySelectorAll(selectors$o.thumbImage),this.loopVideo=this.container.getAttribute(selectors$o.loopVideo)==="true",this.verticalAlignment=!!this.container.querySelector(selectors$o.verticalAlignment),this.flkty=null,this.lastMediaSelect=null,this.thumbs=this.container.querySelector(selectors$o.productThumbs),this.currentSlide=null,this.mediaType=null,this.hasMobileSlider=!1,this.hasDesktopSlider=!1,this.init()}};function _setToLoop(player,host){return host==="youtube"?player.addEventListener("onStateChange",event=>{event.data===0&&event.target.playVideo()}):host==="vimeo"&&player.on("ended",()=>{player.play()}),player}const selectors$n={pickupContainer:"data-store-availability-container",shopifySection:"[data-api-content]",drawer:"[data-pickup-drawer]",drawerOpen:"[data-pickup-drawer-open]",drawerClose:"[data-pickup-drawer-close]",drawerBody:"[data-pickup-body]"},classes$d={isVisible:"drawer--visible",isHidden:"hide",isPickupVisible:"is-pickup-visible"};let PickupAvailability=class extends HTMLElement{connectedCallback(){if(this.container=this,this.drawer=this.container.querySelector(selectors$n.drawer),this.buttonDrawerOpen=this.container.querySelector(selectors$n.drawerOpen),this.buttonDrawerClose=this.container.querySelectorAll(selectors$n.drawerClose),this.drawerBody=this.container.querySelector(selectors$n.drawerBody),this.buttonDrawerOpen){var ref2;(ref2=this.buttonDrawerOpen)===null||ref2===void 0||ref2.addEventListener("click",()=>this.openDrawer())}this.buttonDrawerClose&&this.buttonDrawerClose.forEach(element=>{element.addEventListener("click",()=>this.closeDrawer())})}openDrawer(){this.drawer&&(document.body.classList.add(classes$d.isPickupVisible),this.drawer.classList.add(classes$d.isVisible),this.drawer.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.drawerBody.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})))}closeDrawer(){this.drawer&&(document.body.classList.remove(classes$d.isPickupVisible),this.drawer.classList.remove(classes$d.isVisible),this.drawer.dis
56patchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.drawerBody.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})))}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}},ProductComplimentary=class extends HTMLElement{connectedCallback(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const fresh=document.createElement("div");fresh.innerHTML=text;const newContent=fresh.querySelector("[data-api-content]");newContent&&(this.innerHTML=newContent.innerHTML);const loader=this.closest("[data-product-complimentary-loaded]");loader&&newContent.innerHTML.trim()!==""&&loader.classList.remove("js-unloaded")}).catch(e=>{console.error(e)})}constructor(){super()}};const selectors$m={slideshow:"[data-product-slideshow]",singeImage:"[data-product-image]",zoomButton:"[data-zoom-button]",zoomWrapper:"[data-zoom-wrapper]",mediaId:"data-media-id"};function productPhotoswipeZoom(container,json){return loadScript({url:window.theme.assets.photoswipe}).then(()=>{const PhotoSwipe=window.themePhotoswipe.PhotoSwipe.default,PhotoSwipeUI=window.themePhotoswipe.PhotoSwipeUI.default;container.querySelectorAll(selectors$m.zoomButton).forEach(trigger2=>{trigger2.addEventListener("click",event=>{const el=container.querySelector(selectors$m.zoomWrapper),dataId=event.target.closest(`[${selectors$m.mediaId}]`).getAttribute(selectors$m.mediaId).toString(),items=[];for(let i=0;i<json.media.length;i++)json.media[i].media_type==="image"&&(items[items.length]={src:json.media[i].src,w:json.media[i].width,h:json.media[i].height,id:json.media[i].id});const findImage=element=>element.id.toString()===dataId,options2={index:items.findIndex(findImage),showHideOpacity:!0,showAnimationDuration:150,hideAnimationDuration:250,bgOpacity:1,spacing:0,allowPanToNext:!1,maxSpreadZoom:3,history:!1,loop:!0,pinchToClose:!1,modal:!1,closeOnScroll:!1,closeOnVerticalDrag:!0,getDoubleTapZoom:function(isMouseClick,item){return isMouseClick?1.67:item.initialZoomLevel<.7?1:1.3},getThumbBoundsFn:function(){let imageLocation=container.querySelector(selectors$m.slideshow);imageLocation||(imageLocation=container.querySelector(selectors$m.singeImage));const pageYScroll=window.pageYOffset||document.documentElement.scrollTop,rect=imageLocation.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}};el.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0}));const gallery=new PhotoSwipe(el,PhotoSwipeUI,items,options2);gallery.init(),gallery.listen("close",function(){document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0}))})})})}).catch(e=>console.error(e))}const selectors$l={body:"body",dataRelatedSectionElem:"[data-related-section]",dataTabsHolder:"[data-tabs-holder]",dataTab:"data-tab",dataTabIndex:"data-tab-index",blockId:"data-block-id",tabsLi:".tabs > button",tabLink:".tab-link",tabLinkRecent:".tab-link__recent",tabContent:".tab-content",scrollbarHolder:"[data-scrollbar]",scrollbarArrowPrev:"[data-scrollbar-arrow-prev]",scrollbarArrowNext:"[data-scrollbar-arrow-next]",firstElement:"a:first-child, input:first-child"},classes$c={classCurrent:"current",classHide:"hide",classAlt:"alt",isFocused:"is-focused"},sections$4={};let GlobalTabs=class{init(){const ctx=this.container,tabsNavList=ctx.querySelectorAll(selectors$l.tabsLi),firstTabLink=ctx.querySelector(`${selectors$l.tabLink}-0`),firstTabContent=ctx.querySelector(`${selectors$l.tabContent}-0`);firstTabContent&&firstTabContent.classList.add(classes$c.classCurrent),firstTabLink&&firstTabLink.classList.add(classes$c.classCurrent),this.checkVisibleTabLinks(),this.container.addEventListener("theme:tabs:check",()=>this.checkRecentTab()),this.container.addEventListener("theme:tabs:hide",()=>this.hideRelatedTab()),tabsNavList.length&&tabsNavList.forEach(element=>{const tabId=parseInt(element.getAttribute(selectors$l.dataTab)),tab=ctx.querySelector(`${selectors$l.tabContent}-${tabId}`);element.addEventListener("click",()=>{this.tabChange(element,tab)}),element.addEventListener("keyup",event=>{(event.code==="Space"||event.code==="Enter")&&this.body.classList.contains(classe
56s$c.isFocused)&&(this.tabChange(element,tab),tab.querySelector("a, input")&&(this.accessibility.lastFocused=element,this.accessibility.a11y.trapFocus(tab,{elementToFocus:tab.querySelector(selectors$l.firstElement)})))})})}tabChange(element,tab){this.container.querySelector(`${selectors$l.tabsLi}.${classes$c.classCurrent}`).classList.remove(classes$c.classCurrent),this.container.querySelector(`${selectors$l.tabContent}.${classes$c.classCurrent}`).classList.remove(classes$c.classCurrent),element.classList.add(classes$c.classCurrent),tab.classList.add(classes$c.classCurrent),element.classList.contains(classes$c.classHide)&&tab.classList.add(classes$c.classHide),this.checkVisibleTabLinks(),this.container.dispatchEvent(new CustomEvent("theme:tab:change"))}initNativeScrollbar(){this.scrollbarHolder.length&&this.scrollbarHolder.forEach(scrollbar=>{new NativeScrollbar(scrollbar)})}checkVisibleTabLinks(){const tabsNavList=this.container.querySelectorAll(selectors$l.tabsLi),tabsNavListHided=this.container.querySelectorAll(`${selectors$l.tabLink}.${classes$c.classHide}`);tabsNavList.length-tabsNavListHided.length<2?this.container.classList.add(classes$c.classAlt):this.container.classList.remove(classes$c.classAlt)}checkRecentTab(){const tabLink=this.container.querySelector(selectors$l.tabLinkRecent);if(tabLink){tabLink.classList.remove(classes$c.classHide);const tabLinkIdx=parseInt(tabLink.getAttribute(selectors$l.dataTab)),tabContent=this.container.querySelector(`${selectors$l.tabContent}[${selectors$l.dataTabIndex}="${tabLinkIdx}"]`);tabContent&&tabContent.classList.remove(classes$c.classHide),this.checkVisibleTabLinks(),this.initNativeScrollbar()}}hideRelatedTab(){const relatedSection2=this.container.querySelector(selectors$l.dataRelatedSectionElem);if(!relatedSection2)return;const parentTabContent=relatedSection2.closest(`${selectors$l.tabContent}.${classes$c.classCurrent}`);if(!parentTabContent)return;const parentTabContentIdx=parseInt(parentTabContent.getAttribute(selectors$l.dataTabIndex)),tabsNavList=this.container.querySelectorAll(selectors$l.tabsLi);if(tabsNavList.length>parentTabContentIdx){const nextTabsNavLink=tabsNavList[parentTabContentIdx].nextElementSibling;nextTabsNavLink&&(tabsNavList[parentTabContentIdx].classList.add(classes$c.classHide),nextTabsNavLink.dispatchEvent(new Event("click")),this.initNativeScrollbar())}}onBlockSelect(evt){const element=this.container.querySelector(`${selectors$l.tabLink}[${selectors$l.blockId}="${evt.detail.blockId}"]`);element&&(element.dispatchEvent(new Event("click")),element.parentNode.scrollTo({top:0,left:element.offsetLeft-element.clientWidth,behavior:"smooth"}))}constructor(holder){this.container=holder,this.body=document.querySelector(selectors$l.body),this.accessibility=window.accessibility,this.container&&(this.scrollbarHolder=this.container.querySelectorAll(selectors$l.scrollbarHolder),this.init(),this.initNativeScrollbar())}};const tabs$1={onLoad(){sections$4[this.id]=[],this.container.querySelectorAll(selectors$l.dataTabsHolder).forEach(holder=>{sections$4[this.id].push(new GlobalTabs(holder))})},onBlockSelect(e){sections$4[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})}},selectors$k={urlInput:"[data-share-url]",section:"data-section-type",shareDetails:"[data-share-details]",shareSummary:"[data-share-summary]",shareCopy:"[data-share-copy]",shareButton:"[data-share-button]",closeButton:"[data-close-button]",successMessage:"[data-success-message]",shareHolder:"[data-share-holder]"},classes$b={hidden:"is-hidden"};let ShareButton=class extends HTMLElement{connectedCallback(){this.container=this.closest(`[${selectors$k.section}]`),this.mainDetailsToggle=this.querySelector(selectors$k.shareDetails),this.shareButton=this.querySelector(selectors$k.shareButton),this.shareCopy=this.querySelector(selectors$k.shareCopy),this.shareSummary=this.querySelector(selectors$k.shareSummary),this.closeButton=this.querySelector(selectors$k.closeButton),this.successMessage=this.querySelector(selectors$k.successMessage),this.shareHolder=this.querySelector(selectors$k.shareHolder),this.urlInput=this.querySelector(selectors$k.urlInput),this.urlToShare=this.urlInput?this.urlInput.value:d
56ocument.location.href,this.init()}init(){navigator.share?(this.mainDetailsToggle.classList.add(classes$b.hidden),this.shareButton.classList.remove(classes$b.hidden),this.shareButton.addEventListener("click",()=>{navigator.share({url:this.urlToShare,title:document.title})})):(this.mainDetailsToggle.addEventListener("toggle",this.toggleDetails.bind(this)),this.mainDetailsToggle.addEventListener("focusout",()=>{setTimeout(()=>{this.contains(document.activeElement)||this.close()})}),this.shareCopy.addEventListener("click",this.copyToClipboard.bind(this)),this.closeButton.addEventListener("click",this.close.bind(this)),this.container.addEventListener("keyup",this.keyboardEvents.bind(this)))}toggleDetails(){this.mainDetailsToggle.open||(this.successMessage.classList.add(classes$b.hidden),this.successMessage.textContent="",this.closeButton.classList.add(classes$b.hidden),this.shareCopy.focus())}copyToClipboard(){navigator.clipboard.writeText(this.urlInput.value).then(()=>{this.successMessage.classList.remove(classes$b.hidden),this.successMessage.textContent=theme.strings.successMessage,this.closeButton.classList.remove(classes$b.hidden),this.closeButton.focus()})}close(){this.mainDetailsToggle.removeAttribute("open"),this.shareSummary.setAttribute("aria-expanded",!1)}keyboardEvents(e){e.code==="Escape"&&(this.mainDetailsToggle.focus(),this.close())}};const selectors$j={sizeButton:"[data-size-button]",mediaHolder:"[data-media-slide]"},classes$a={classExpanded:"is-expanded"};let ImageCaption=class{init(){this.sizeButtons.forEach(button=>{button.addEventListener("click",()=>{button.classList.toggle(classes$a.classExpanded),button.closest(selectors$j.mediaHolder).classList.toggle(classes$a.classExpanded)})})}constructor(container){this.container=container,this.sizeButtons=this.container.querySelectorAll(selectors$j.sizeButton),this.sizeButtons.length>0&&this.init()}};const selectors$i={productJson:"[data-product-json]",zoomButton:"[data-zoom-button]",toggleTruncateHolder:"[data-truncated-holder]",toggleTruncateButton:"[data-truncated-button]",toggleTruncateContent:"data-truncated-content"},classes$9={classExpanded:"is-expanded",classVisible:"is-visible"},sections$3=[];let ProductTemplate=class{init(){this.zoomEnabled=this.container.querySelector(selectors$i.zoomButton)!==null,this.zoomEnabled&&productPhotoswipeZoom(this.container,this.product),this.truncateElementHolder&&this.truncateElement&&(setTimeout(this.resizeEventTruncate,50),document.addEventListener("theme:resize",this.resizeEventTruncate)),new ImageCaption(this.container)}truncateText(){if(this.truncateElementHolder.classList.contains(classes$9.classVisible))return;const styles2=this.truncateElement.querySelectorAll("style");styles2.length&&styles2.forEach(style=>{this.truncateElementHolder.prepend(style)});const truncateElementCloned=this.truncateElement.cloneNode(!0),truncateElementClass=this.truncateElement.getAttribute(selectors$i.toggleTruncateContent),truncateNextElement=this.truncateElement.nextElementSibling;truncateNextElement&&truncateNextElement.remove(),this.truncateElement.parentElement.append(truncateElementCloned);const truncateAppendedElement=this.truncateElement.nextElementSibling;truncateAppendedElement.classList.add(truncateElementClass),truncateAppendedElement.removeAttribute(selectors$i.toggleTruncateContent),showElement(truncateAppendedElement),ellipsis(truncateAppendedElement,5,{replaceStr:"",delimiter:" "}),hideElement(truncateAppendedElement),this.truncateElement.innerHTML!==truncateAppendedElement.innerHTML?this.truncateElementHolder.classList.add(classes$9.classExpanded):(truncateAppendedElement.remove(),this.truncateElementHolder.classList.remove(classes$9.classExpanded)),this.toggleTruncatedContent(this.truncateElementHolder)}toggleTruncatedContent(holder){const toggleButton=holder.querySelector(selectors$i.toggleTruncateButton);toggleButton&&toggleButton.addEventListener("click",e=>{e.preventDefault(),holder.classList.remove(classes$9.classExpanded),holder.classList.add(classes$9.classVisible)})}onBlockSelect(event){const block=this.container.querySelector(`[data-block-id="${event.detail.blockId}"]`);block&&block.dispatchEvent(new Event("click"))}onBlockDeselect(event){const block=this.container.querySelector(`[data-block-id="${event.detail.blockId}"]`);block&&block.dispatchEvent(new Event("click"))}onUnload(){this.media.destroy(),this.truncateElementHolder&&this.truncateElement&&document.removeEventListener("theme:resize",this.resizeEventTruncate)}constructor(section2){this.section=section2,this.id=section2.id,this.container=section2.container,this.settings=section2.settings,modal(this.id
56),this.media=new Media(section2);const productJSON=this.container.querySelector(selectors$i.productJson);if(productJSON&&productJSON.innerHTML!=="")this.product=JSON.parse(productJSON.innerHTML);else{console.error("Missing product JSON");return}this.truncateElementHolder=this.container.querySelector(selectors$i.toggleTruncateHolder),this.truncateElement=this.container.querySelector(`[${selectors$i.toggleTruncateContent}]`),this.resizeEventTruncate=()=>this.truncateText(),this.init()}};register("product",[{onLoad(){sections$3[this.id]=new ProductTemplate(this)},onUnload(){typeof sections$3[this.id].unload=="function"&&sections$3[this.id].unload()},onBlockSelect(evt){typeof sections$3[this.id].onBlockSelect=="function"&&sections$3[this.id].onBlockSelect(evt)},onBlockDeselect(evt){typeof sections$3[this.id].onBlockDeselect=="function"&&sections$3[this.id].onBlockDeselect(evt)}},tabs$1,swapperSection]),customElements.get("pickup-availability")||customElements.define("pickup-availability",PickupAvailability),customElements.get("product-complimentary")||customElements.define("product-complimentary",ProductComplimentary),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("popout-select")||customElements.define("popout-select",PopoutSelect),customElements.get("share-button")||customElements.define("share-button",ShareButton);const selectors$h={toggle:"data-toggle-grid",large:"data-grid-large",small:"data-grid-small"},classes$8={active:"is-active"},options={breakpoint:window.theme.sizes.small};var sections$2={};let Toggle=class{init(){this.toggle.addEventListener("click",this.toggleFunction),document.addEventListener("theme:resize:width",this.toggleFunction),this.toggleEvent(!1)}unload(){this.toggle.removeEventListener("click",this.toggleFunction),document.removeEventListener("theme:resize:width",this.toggleFunction)}toggleEvent(evt=!0){const clickEvent=evt&&evt.type==="click",selector=window.innerWidth>=options.breakpoint?selectors$h.large:selectors$h.small,grid=this.container.querySelector(`[${selector}]`),gridNumber=grid.getAttribute(selector),activeToggle=this.toggle.parentElement.querySelector(`[${selectors$h.toggle}].${classes$8.active}`);let currentToggle=this.toggle.parentElement.querySelector(`[${selectors$h.toggle}="${gridNumber}"]`);clickEvent&&(currentToggle=this.toggle,grid.setAttribute(selector,this.value)),activeToggle&&activeToggle.classList.remove(classes$8.active),currentToggle&&currentToggle.classList.add(classes$8.active)}constructor(toggle2,container){this.container=container||document,this.toggle=toggle2,this.value=this.toggle.getAttribute(selectors$h.toggle),this.toggleFunction=evt=>this.toggleEvent(evt),this.init()}};const toggleSection={onLoad(){sections$2[this.id]=[],this.container.querySelectorAll(`[${selectors$h.toggle}]`).forEach(button=>{sections$2[this.id].push(new Toggle(button,this.container))})},onUnload:function(){sections$2[this.id].forEach(toggle2=>{typeof toggle2.unload=="function"&&toggle2.unload()})}},selectors$g={sort:"data-sort-enabled",sortLinks:"[data-sort-link]",sortButtonText:"[data-sort-button-text]",sortValue:"data-value"},classes$7={active:"popout-list__item--current"};let Sort=class{init(){this.sortLinks.forEach(link=>{link.addEventListener("click",e=>{e.preventDefault(),this.sortingResults(e)})})}sortingResults(e){const link=e.currentTarget,sort=link.getAttribute(selectors$g.sortValue),text=link.innerText;this.sortButtonText.innerText=text,this.sortButtonText.parentNode.dispatchEvent(new Event("click")),this.sort.querySelector(`.${classes$7.active}`).classList.remove(classes$7.active),link.parentNode.classList.add(classes$7.active),this.sort.setAttribute(selectors$g.sort,sort),this.container.dispatchEvent(new CustomEvent("theme:form:filter",{bubbles:!0,detail:{params:sort}}))}constructor(section2){this.container=section2.container,this.sort=this.container.querySelector(`[${selectors$g.sort}]`),this.sortLinks=this.container.querySelectorAll(selectors$g.sortLinks),this.sortButtonText=this.container.querySelector(selectors$g.sortButtonText),this.sort&&this.init()}};var selectors$f={swatch:"data-swatch"};let Collection=class{init(){new Sort(this.section)}constructor(section2){this.section=section2,this.container=this.section.container,this.swatches=this.container.querySelectorAll(`[${selectors$f.swatch}]`),this.init()}};register("collection",[{onLoad(){this.collection=new Collection(this)}},collectionFiltersSidebar,collectionFiltersForm,toggleSection,swatchGridSection,siblings]),customElements.get("popout-select")||customElements.define("popout-select",PopoutSelect),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage),register("collection-row",[swatchGridSection,siblings,customScrollbar,parallaxImage]),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage),register("collection-tabs",[tabs$1,productSliderSection,swatchGridSection]),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage);var styles={};styles.basic=[],styles.light=[{featureType:"administrative",elementType:"labels",stylers:[{visibility:"on"},{lightness:"64"},{hue:"#ff0000"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f0f0f0"},{visibility:"simplified"}]},{featureType:"landscape.natural.landcover",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.terrain",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{lightness:"100"}]},{featureType:"poi.park",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{saturation:"-41"},{color:"#e8ede7"}]},{featureType:"poi.park",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:"-100"}]},{featureType:"road",elementType:"labels",stylers:[{lightness:"25"},{gamma:"1.06"},{saturation:"-100"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{gamma:"10.00"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.01"},{visibility:"simplified"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{gamma:"10.00"},{lightness:"100"},{weight:"0.4"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"simplified"},{weight:"0.01"},{lightness:"39"}]},{featureType:"road.local",elementType:"labels.text.stroke",stylers:[{weight:"0.50"},{gamma:"10.00"},{lightness:"100"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#cfe5ee"},{visibility:"on"}]}],styles.light_blank=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"off"},{lightness:"64"},{hue:"#ff0000"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#bdbdbd"}]},{featureType:"administrative",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f0f0f0"},{visibility:"simplified"}]},{featureType:"landscape.natural.landcover",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"landscape.natural.terrain",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry.fill",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"labels",stylers:[{lightness:"100"}]},{featureType:"poi.park",elementType:"all",stylers:[{visibility:"on"}]},{featureType:"poi.park",elementType:"geometry",stylers:[{saturation:"-41"},{color:"#e8ede7"}]},{featureType:"poi.park",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:"-100"}]},{featureType:"road",elementType:"labels",stylers:[{lightness:"25"},{gamma:"1.06"},{saturation:"-100"},{visibility:"off"}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{gamma:"10.00"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.01"},{visibility:"simplified"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.fill",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{gamma:"10.00"},{lightness:"100"},{weight:"0.4"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"},{weight:"0.01"},{lightness:"39"}]},{featureType:"road.local",elementType:"labels.text.stroke",stylers:[{weight:"0.50"},{gamma:"10.00"},{lightness:"100"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#cfe5ee"},{visibility:"on"}]}],styles.white_blank=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#444444"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#e4e4e4"},{visibility:"on"}]}],styles.white_label=[{featureType:"all",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"all",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"administrative",elementType:"labels",stylers:[{gamma:"3.86"},{lightness:"100"}]},{featureType:"administrative",elementType:"labels.text.fill",stylers:[{color:"#cccccc"}]},{featureType:"landscape",elementType:"all",stylers:[{color:"#f2f2f2"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"road",elementType:"all",stylers:[{saturation:-100},{lightness:45}]},{featureType:"road.highway",elementType:"all",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"labels.text.fill",stylers:[{weight:"0.8"}]},{featureType:"road.highway",elementType:"labels.text.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0"}]},{featureType:"road.arterial",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels.text",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"water",elementType:"all",stylers:[{color:"#e4e4e4"},{visibility:"on"}]}],styles.dark_blank=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17},{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:"0.01"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}],styles.dark_label=[{featureType:"all",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"all",elementType:"labels.text.fill",stylers:[{saturation:36},{color:"#000000"},{lightness:40}]},{featureType:"
56all",elementType:"labels.text.stroke",stylers:[{visibility:"on"},{color:"#000000"},{lightness:16}]},{featureType:"all",elementType:"labels.icon",stylers:[{visibility:"off"}]},{featureType:"administrative",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"administrative",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:17},{weight:1.2}]},{featureType:"administrative",elementType:"labels",stylers:[{visibility:"simplified"},{lightness:"-82"}]},{featureType:"administrative",elementType:"labels.text.stroke",stylers:[{invert_lightness:!0},{weight:"7.15"}]},{featureType:"landscape",elementType:"geometry",stylers:[{color:"#000000"},{lightness:20}]},{featureType:"landscape",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"poi",elementType:"geometry",stylers:[{color:"#000000"},{lightness:21}]},{featureType:"road",elementType:"labels",stylers:[{visibility:"simplified"}]},{featureType:"road.highway",elementType:"geometry.fill",stylers:[{color:"#000000"},{lightness:17},{weight:"0.8"}]},{featureType:"road.highway",elementType:"geometry.stroke",stylers:[{color:"#000000"},{lightness:29},{weight:"0.01"}]},{featureType:"road.highway",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"road.arterial",elementType:"geometry",stylers:[{color:"#000000"},{lightness:18}]},{featureType:"road.arterial",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"geometry",stylers:[{color:"#000000"},{lightness:16}]},{featureType:"road.local",elementType:"geometry.stroke",stylers:[{weight:"0.01"}]},{featureType:"road.local",elementType:"labels",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"all",stylers:[{visibility:"off"}]},{featureType:"transit",elementType:"geometry",stylers:[{color:"#000000"},{lightness:19}]},{featureType:"water",elementType:"geometry",stylers:[{color:"#000000"},{lightness:17}]}];function mapStyle(key){return styles[key]}window.theme.allMaps=window.theme.allMaps||{};let allMaps=window.theme.allMaps;const selectors$e={mapContainer:"[data-map-container]",style:"data-style",apiKey:"data-api-key",zoom:"data-zoom",address:"data-address",latLongCorrection:"data-latlong-correction",lat:"data-lat",long:"data-long"};let Map$1=class{initMaps(){const urlKey=`https://maps.googleapis.com/maps/api/js?key=${this.key}`;loadScript({url:urlKey}).then(()=>this.enableCorrection==="true"&&this.lat!==""&&this.long!==""?new window.google.maps.LatLng(this.lat,this.long):geocodeAddressPromise(this.address)).then(center=>{var zoom=parseInt(this.zoomString,10);const styles2=mapStyle(this.styleString);var mapOptions={zoom,styles:styles2,center,draggable:!0,clickableIcons:!1,scrollwheel:!1,zoomControl:!1,disableDefaultUI:!0};return createMap(this.mapWrap,mapOptions)}).then(map=>{this.map=map,allMaps[this.id]=map}).catch(e=>{console.log("Failed to load Google Map"),console.log(e)})}onUnload(){typeof window.google<"u"&&window.google.maps.event.clearListeners(this.map,"resize")}constructor(section2){this.container=section2.container,this.mapWrap=this.container.querySelector(selectors$e.mapContainer),this.styleString=this.container.getAttribute(selectors$e.style)||"",this.key=this.container.getAttribute(selectors$e.apiKey),this.zoomString=this.container.getAttribute(selectors$e.zoom)||14,this.address=this.container.getAttribute(selectors$e.address),this.enableCorrection=this.container.getAttribute(selectors$e.latLongCorrection),this.lat=this.container.getAttribute(selectors$e.lat),this.long=this.container.getAttribute(selectors$e.long),this.key&&this.initMaps()}};function createMap(container,options2){var map=new window.google.maps.Map(container,options2),center=map.getCenter();return new window.google.maps.Marker({map,position:center}),window.google.maps.event.addDomListener(window,"resize",function(){window.google.maps.event.trigger(map,"resize"),map.setCenter(center)}),map}function geocodeAddressPromise(address){return new Promise((resolve,reject)=>{var geocoder=new window.google.maps.Geocoder;geocoder.geocode({address},function(results,status){if(status=="OK"){var latLong={lat:results[0].geometry.location.lat(),lng:results[0].geometry.location.lng()};resolve(latLong)}else reject(status)})})}register("section-map",[{onLoad(){allMaps[this.id]=new Map$1(this)},onUnload(){typeof allMaps[this.id].unload=="function"&&allMaps[this.id].unload()}},parallaxImage]),register("section-columns",[popupVideoSection,customScrollbar]);const selectors$d={dataRelatedSectionElem:"[data-related-section]",dataRelatedProduct:"[data-grid-item]",carousel:"[data-carousel]",dataLimit:"data-limit",dataMinimum:"data-minimum",dataLargeLayout:"data-layout-desktop",dataMediumLayout:"data-layout-tablet",dataSmallLayout:"data-layout-mobile",recentlyViewed:"[data-recent-wrapper]",recentlyViewedWrapper:"[data-recently-viewed-wrapper]",productId:"data-product-id"};let Related=class{init(){const relatedSection1=this.container.querySelector(selectors$d.dataRelatedSectionElem);if(!relatedSection1)return;const productId=relatedSection1.getAttribute(selectors$d.productId),limit=relatedSection1.getAttribute(selectors$d.dataLimit),layoutLarge=relatedSection1.getAttribute(selectors$d.dataLargeLayout),layoutMedium=relatedSection1.getAttribute(selectors$d.dataMediumLayout),layoutSmall=relatedSection1.getAttribute(selectors$d.dataSmallLayout),requestUrl=`${window.theme.routes.product_recommendations_url||"/recommendations/products/"}
56?section_id=related&limit=${limit}&product_id=${productId}`;axios.get(requestUrl).then(response=>{const fresh=document.createElement("div");fresh.innerHTML=response.data;const inner=fresh.querySelector(selectors$d.dataRelatedSectionElem);if(inner.querySelector(selectors$d.dataRelatedProduct)){const innerHtml=inner.innerHTML;relatedSection1.innerHTML=innerHtml,relatedSection1.querySelector(selectors$d.carousel).style.setProperty("--grid-large-items",layoutLarge),relatedSection1.querySelector(selectors$d.carousel).style.setProperty("--grid-medium-items",layoutMedium),relatedSection1.querySelector(selectors$d.carousel).style.setProperty("--grid-small-items",layoutSmall),relatedSection1.dispatchEvent(new CustomEvent("theme:related-products:added",{bubbles:!0}))}else relatedSection1.dispatchEvent(new CustomEvent("theme:tabs:hide",{bubbles:!0}))}).catch(function(error2){console.warn(error2)})}recent(){const recentlyViewedHolder=this.container.querySelector(selectors$d.recentlyViewed),recentlyViewedWrapper=this.container.querySelector(selectors$d.recentlyViewedWrapper),recentProducts1=this.container.querySelectorAll(selectors$d.dataRelatedProduct),minimumNumberProducts=recentlyViewedHolder.hasAttribute(selectors$d.dataMinimum)?parseInt(recentlyViewedHolder.getAttribute(selectors$d.dataMinimum)):4,checkRecentInRelated=!recentlyViewedWrapper&&recentProducts1.length>0,checkRecentOutsideRelated=recentlyViewedWrapper&&recentProducts1.length>=minimumNumberProducts;(checkRecentInRelated||checkRecentOutsideRelated)&&recentlyViewedHolder.dispatchEvent(new CustomEvent("theme:tabs:check",{bubbles:!0}))}constructor(section2){this.section=section2,this.container=section2.container,this.init(),this.container.addEventListener("theme:recent-products:added",()=>{this.recent()})}};register("related",[{onLoad(){this.section=new Related(this)}},tabs$1,recentProducts]),customElements.get("radio-swatch")||customElements.define("radio-swatch",RadioSwatch),customElements.get("product-grid-item")||customElements.define("product-grid-item",ProductGridItem),customElements.get("product-grid-item-variant")||customElements.define("product-grid-item-variant",ProductGridItemVariant),customElements.get("product-grid-item-image")||customElements.define("product-grid-item-image",ProductGridItemImage);const slideDown=(target,duration=500,checkHidden=!0)=>{let display=window.getComputedStyle(target).display;if(checkHidden&&display!=="none")return;target.style.removeProperty("display"),display==="none"&&(display="block"),target.style.display=display;let height=target.offsetHeight;target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,target.offsetHeight,target.style.boxSizing="border-box",target.style.transitionTimingFunction="cubic-bezier(0.215, 0.61, 0.355, 1)",target.style.transitionProperty="height, margin, padding",target.style.transitionDuration=duration+"ms",target.style.height=height+"px",target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),window.setTimeout(()=>{target.style.removeProperty("height"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property"),target.style.removeProperty("transition-timing-function")},duration)},slideUp=(target,duration=500)=>{target.style.transitionProperty="height, margin, padding",target.style.transitionTimingFunction="cubic-bezier(0.215, 0.61, 0.355, 1)",target.style.transitionDuration=duration+"ms",target.style.boxSizing="border-box",target.style.height=target.offsetHeight+"px",target.offsetHeight,target.style.overflow="hidden",target.style.height=0,target.style.paddingTop=0,target.style.paddingBottom=0,target.style.marginTop=0,target.style.marginBottom=0,window.setTimeout(()=>{target.style.display="none",target.style.removeProperty("height"),target.style.removeProperty("padding-top"),target.style.removeProperty("padding-bottom"),target.style.removeProperty("margin-top"),target.style.removeProperty("margin-bottom"),target.style.removeProperty("overflow"),target.style.removeProperty("transition-duration"),target.style.removeProperty("transition-property"),target.style.removeProperty("transition-timing-function")},duration)},selectors$c={cartNote:"[data-cart-note]"};
56class CartNotes{initInputs(){this.inputs.forEach(input=>{input.addEventListener("input",debounce$1((function(e){const note=e.target.value.toString()||"";this.saveNotes(note)}).bind(this),300))})}saveNotes(newNote){window.fetch(`${window.theme.routes.cart}/update.js`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({note:newNote})}).catch(e=>{console.error(e)})}constructor(element){this.inputs=element.querySelectorAll(selectors$c.cartNote),this.initInputs()}}const getUrlString=(params,keys2=[],isArray2=!1)=>{const p=Object.keys(params).map(key=>{let val=params[key];if(Object.prototype.toString.call(val)==="[object Object]"||Array.isArray(val))return Array.isArray(params)?keys2.push(""):keys2.push(key),getUrlString(val,keys2,Array.isArray(val));{let tKey=key;return keys2.length>0&&(tKey=(isArray2?keys2:[...keys2,key]).reduce((str,k)=>str===""?k:`${str}[${k}]`,"")),isArray2?`${tKey}[]=${val}`:`${tKey}=${val}`}}).join("&");return keys2.pop(),p},selectors$b={html:"html",submitButton:"[data-submit-shipping]",form:"[data-shipping-estimate-form]",template:"[data-response-template]",country:"#estimate_address_country",province:"#estimate_address_province",zip:"#estimate_address_zip",wrapper:"[data-response-wrapper]",defaultData:"data-default-fullname",lang:"lang",defaultData:"data-default"},classes$6={success:"shipping--success",error:"errors",disable:"disabled"};class ShippingCalculator{enableButtons(){this.button.removeAttribute("disabled"),this.button.classList.remove(classes$6.disable)}disableButtons(){this.button.setAttribute("disabled","disabled"),this.button.classList.add(classes$6.disable)}render(rates){if(this.template&&this.ratesWrapper){const rendered=Sqrl__namespace.render(this.template,rates);this.ratesWrapper.innerHTML=rendered}this.enableButtons(),this.ratesWrapper.style.removeProperty("display")}estimate(shipping_address){const encodedShippingAddressData=encodeURI(getUrlString({shipping_address})),url=`${window.theme.routes.cart}/shipping_rates.json?${encodedShippingAddressData}`,instance=this;axios.get(url).then(function(response){const items=instance.sanitize(response);instance.render(items),instance.enableButtons(),instance.ratesWrapper.style.removeProperty("display")}).catch(function(error2){const errors=instance.sanitizeErrors(error2);instance.render(errors)})}sanitize(response){const sanitized={};return sanitized.class=classes$6.success,sanitized.items=[],response.data.shipping_rates&&response.data.shipping_rates.length>
560?response.data.shipping_rates.forEach(r=>{let item={};item.title=r.presentment_name,item.value=themeCurrency.formatMoney(r.price,theme.moneyFormat),sanitized.items.push(item)}):sanitized.items[0]={value:theme.strings.noShippingAvailable},sanitized}sanitizeErrors(response){const errors={};if(errors.class=classes$6.error,errors.items=[],typeof response.data=="object")for(const[key,value]of Object.entries(response.data)){let item={};item.title=key.toString(),item.value=value.toString(),errors.items.push(item)}else errors.items[0]={value:theme.strings.noShippingAvailable};return errors}init(){const htmlEl=document.querySelector(selectors$b.html);let locale="en";htmlEl.hasAttribute(selectors$b.lang)&&htmlEl.getAttribute(selectors$b.lang)!==""&&(locale=htmlEl.getAttribute(selectors$b.lang)),this.form&&themeAddresses.AddressForm(this.form,locale,{shippingCountriesOnly:!0}),this.country&&this.country.hasAttribute(selectors$b.defaultData)&&this.province&&this.province.hasAttribute(selectors$b.defaultData)&&this.country.addEventListener("change",function(){this.country.removeAttribute(selectors$b.defaultData),this.province.removeAttribute(selectors$b.defaultData)}),this.button&&this.button.addEventListener("click",(function(e){for(e.preventDefault(),this.disableButtons();this.ratesWrapper.firstChild;)this.ratesWrapper.removeChild(this.ratesWrapper.firstChild);this.ratesWrapper.style.display="none";const shippingAddress={};let elemCountryVal=this.country.value,elemProvinceVal=this.province.value;const elemCountryData=this.country.getAttribute(selectors$b.defaultData);elemCountryVal===""&&elemCountryData&&elemCountryData!==""&&(elemCountryVal=elemCountryData);const elemProvinceData=this.province.getAttribute(selectors$b.defaultData);elemProvinceVal===""&&elemProvinceData&&elemProvinceData!==""&&(elemProvinceVal=elemProvinceData),shippingAddress.zip=this.zip.value||"",shippingAddress.country=elemCountryVal||"",shippingAddress.province=elemProvinceVal||"",this.estimate(shippingAddress)}).bind(this))}constructor(section2){this.button=section2.container.querySelector(selectors$b.submitButton),this.template=section2.container.querySelector(selectors$b.template).innerHTML,this.ratesWrapper=section2.container.querySelector(selectors$b.wrapper),this.form=section2.container.querySelector(selectors$b.form),this.country=section2.container.querySelector(selectors$b.country),this.province=section2.container.querySelector(selectors$b.province),this.zip=section2.container.querySelector(selectors$b.zip),this.init()}}const selectors$a={cartMessage:"[data-cart-message]",cartMessageValue:"data-cart-message",leftToSpend:"[data-left-to-spend]",cartProgress:"[data-cart-progress]",limit:"data-limit",percent:"data-percent"},classes$5={isHidden:"is-hidden",isSuccess:"is-success"};let CartShippingMessage=class{init(){this.cartFreeLimitShipping=Number(this.cartMessage[0].getAttribute(selectors$a.limit))*100*this.rate,this.shippingAmount=0,this.circumference=28*Math.PI,this.exchangeRateConversions(this.cartFreeLimitShipping,this.shippingAmount),this.cartBarProgress(),this.listen()}listen(){document.addEventListener("theme:cart:change",(function(event){this.cart=event.detail.cart,this.render()}).bind(this))}render(){const totalPrice=this.cart.total_price;this.freeShippingMessageHandle(totalPrice),this.cart&&this.cart.total_price&&this.cartMessage.length>0&&(this.shippingAmount=totalPrice,this.updateProgress())}freeShippingMessageHandle(total){this.cartMessage.length>0&&this.container.querySelectorAll(selectors$a.cartMessage).forEach(message=>{const hasFreeShipping=message.hasAttribute(selectors$a.cartMessageValue)&&message.getAttribute(selectors$a.cartMessageValue)==="true"&&total>=this.cartFreeLimitShipping&&total!==0;message.classList.toggle(classes$5.isSuccess,hasFreeShipping)})}cartBarProgress(progress2=null){this.container.querySelectorAll(selectors$a.cartProgress).forEach(element=>{this.setProgress(element,progress2===null?element.getAttribute(selectors$a.percent):progress2)})}setProgress(holder,percent2){const offset=this.circumference-percent2/100*this.circumference/2;holder.style.strokeDashoffset=offset}updateProgress(){const newPercentValue=this.shippingAmount/this.cartFreeLimitShipping*100;this.exchangeRateConversions(this.cartFreeLimitShipping,this.shippingAmount),this.cartBarProgress(newPercentValue>100?100:newPercentValue)}exchangeRateConversions(cartFreeLimitShipping,shippingAmount){const leftToSpend=theme.settings.currency_code_enable?theme
56Currency.formatMoney(cartFreeLimitShipping-shippingAmount,theme.moneyFormat)+` ${theme.currencyCode}`:themeCurrency.formatMoney(cartFreeLimitShipping-shippingAmount,theme.moneyFormat);this.container.querySelectorAll(selectors$a.leftToSpend).forEach(element=>{element.innerHTML=leftToSpend.replace(".00","")})}constructor(section2){this.container=section2,this.cartMessage=this.container.querySelectorAll(selectors$a.cartMessage),this.rate=window.Shopify.currency.rate,this.cartMessage.length>0&&this.init()}};const selectors$9={wrapper:"[data-quantity-selector]",increase:"[data-increase-quantity]",decrease:"[data-decrease-quantity]",input:"[data-quantity-input]"};let Quantity=class{initButtons(){this.increase.addEventListener("click",(function(e){e.preventDefault();let v=parseInt(this.input.value,10);v=isNaN(v)?0:v,v++,this.input.value=v,this.input.dispatchEvent(new Event("change"))}).bind(this)),this.decrease.addEventListener("click",(function(e){e.preventDefault();let v=parseInt(this.input.value,10);v=isNaN(v)?0:v,v--,v=Math.max(this.min,v),this.input.value=v,this.input.dispatchEvent(new Event("change"))}).bind(this))}constructor(wrapper){this.wrapper=wrapper,this.increase=this.wrapper.querySelector(selectors$9.increase),this.decrease=this.wrapper.querySelector(selectors$9.decrease),this.input=this.wrapper.querySelector(selectors$9.input),this.min=parseInt(this.input.getAttribute("min"),10),this.initButtons()}};function initQtySection(container){container.querySelectorAll(selectors$9.wrapper).forEach(qty=>{new Quantity(qty)})}const selectors$8={drawer:'[data-drawer="drawer-cart"]',shipping:"[data-shipping-estimate-form]",loader:"[data-cart-loading]",form:"[data-cart-form]",emptystate:"[data-cart-empty]",progress:"[data-cart-progress]",items:"[data-line-items]",subtotal:"[data-cart-subtotal]",bottom:"[data-cart-bottom]",quantity:"[data-quantity-selector]",errors:"[data-form-errors]",item:"[data-cart-item]",finalPrice:"[data-cart-final]",key:"data-update-cart",remove:"data-remove-key",pageUpsellWrapper:"[data-cart-page-upsell-wrapper]",cartPage:'[data-section-type="cart"]',bar:"[data-cart-bar]",ship:"[data-cart-message]",itemLoadbar:"[data-item-loadbar]",cartMessageContainer:"[data-cart-message-container]",apiContent:"[data-api-content]"},classes$4={hidden:"cart--hidden",loading:"cart--loading"};let CartItems=class{listen(){document.addEventListener("theme:cart:change",(function(event){this.cart=event.detail.cart,this.stale=!0}).bind(this)),document.addEventListener("theme:cart:init",(function(){this.init()}).bind(this)),document.addEventListener("theme:cart:reload",(function(){this.stale=!0,this.cart?this.loadHTML():this.init().then(()=>this.loadHTML())}).bind(this)),this.drawer&&(this.drawer.addEventListener("theme:drawer:open",(function(){this.cart?this.loadHTML():this.init().then(()=>this.loadHTML()),window.theme.state.cartOpen=!0}).bind(this)),this.drawer.addEventListener("theme:drawer:close",function(){window.theme.state.cartOpen=!1})),new CartNotes(this.container),new CartShippingMessage(this.container)}init(){return window.fetch(`${window.theme.routes.cart}.js`).then(this.handleErrors).then(response=>response.json()).then(response=>(this.cart=response,this.fireChange(response),response)).catch(e=>{console.error(e)})}loadHTML(plain=!1){this.stale&&(this.cart&&this.cart.item_count>0?this.loadForm(plain):(this.showEmpty(),this.cartMessages.forEach(message=>{new CartShippingMessage(message)}))),this.stale=!1}initInputs(){this.inputs=this.container.querySelectorAll(`[${selectors$8.key}]`),this.inputs.forEach(input=>{const key=input.getAttribute(selectors$8.key);input.addEventListener("change",(function(e){const quantity=parseInt(e.target.value,10);this.latestClick=e.target.closest(selectors$8.item),this.lockState(),this.updateCart(key,quantity)}).bind(this))})}initRemove(){this.removers=this.container.querySelectorAll(`[${selectors$8.remove}]`),this.removers.forEach(remover=>{const key=remover.getAttribute(selectors$8.remove);remover.addEventListener("click",(function(e){e.preventDefault(),this.latestClick=e.target.closest(selectors$8.item),this.lockState(),this.updateCart(key,0)}).bind(this))})}lockState(){this.latestClick.querySelector(selectors$8.itemLoadbar).style.display="block",this.loader.classList.add(classes$4.loading)}updateCart(clickedKey,newQuantity){window.fetch(`${window.theme.routes.cart}/change.js`,{method:"post",headers:{"Content-Type":"application/json"},body:JSON.stringify({id:clickedKey,quantity:newQuantity})}).then(this.handleErrors).then(response=>response.json()).then(response=>{this.cart=response,slideUp(this.errors),this.fireChange(response),this.stale=!0,this.loadHTML()}).catch(e=>{if(e instanceof FetchError){var ref2,ref1;let defaultMessage2=window.theme.strings.stockout||"Could not update cart, please reload",messageText=((ref2=e.json)===null||ref2===void 0?void 0:ref2.message)||e.message||defaultMessage2,descriptionText=((ref1=e.json)===null||ref1===void 0?void 0:ref1.description)||"",contentToShow=messageText===descriptionText?`<p>${messageText}</p>`:`<p>${messageText}</p> <p>${descriptionText}</p>`;this.showError(contentToShow),this.loadForm()}else{let error2=`<p>${e.message||defaultMessage}</p>`;throw this.showError(error2),e}})}fireChange(newCart){document.dispatchEvent(new CustomEvent("theme:cart:change",{detail:{cart:newCart},bubbles:!0}))}updateTotal(){if(this.cart&&this.cart.total_price!=null){const price=themeCurrency.formatMoney(this.cart.total_price,theme.moneyFormat);this.finalPrice.innerHTML=price+` ${theme.currencyCode}`}this.subtotal&&this.cart&&window.fetch(`${window.theme.routes.root_url}?section_id=api-cart-subtotal`).then(this.handleErrors).then(response=>response.text()).then(response=>{const fresh=document.createElement("div");fresh.innerHTML=response,this.subtotal.innerHTML=fresh.querySelector(selectors$8.apiContent).innerHTML})}showError(message){slideUp(this.errors),this.errors.innerHTML=message,window.setTimeout(()=>{slideDown(this.errors)},600)}
56loadForm(plain=!1){if(plain){this.showForm(),this.initQuantity(),this.initQuickview(),this.updateTotal();return}window.fetch(`${window.theme.routes.root_url}?section_id=api-cart-items`).then(this.handleErrors).then(response=>response.text()).then(response=>{const fresh=document.createElement("div");fresh.innerHTML=response,this.items.innerHTML=fresh.querySelector(selectors$8.apiContent).innerHTML,this.showForm(),this.initQuantity(),this.initQuickview(),this.updateTotal()})}initQuickview(){const pageUpsellWrapper=this.items.querySelector(selectors$8.pageUpsellWrapper),oldPageUpsellWrapper=this.bottom.querySelector(selectors$8.pageUpsellWrapper);oldPageUpsellWrapper&&oldPageUpsellWrapper.remove(),this.cartPage&&pageUpsellWrapper&&(this.bottom.insertBefore(pageUpsellWrapper,this.bottom.firstChild),Alpine.initTree(this.bottom))}initQuantity(){initQtySection(this.container),this.initInputs(),this.initRemove()}showForm(){this.bar&&this.bar.classList.remove(classes$4.hidden),this.ship&&this.ship.classList.remove(classes$4.hidden),this.progress&&this.progress.classList.remove(classes$4.hidden),this.form.classList.remove(classes$4.hidden),this.bottom.classList.remove(classes$4.hidden),this.loader.classList.remove(classes$4.loading),this.emptystate.classList.add(classes$4.hidden)}showEmpty(){this.bar&&this.bar.classList.add(classes$4.hidden),this.ship&&this.ship.classList.add(classes$4.hidden),this.progress&&this.progress.classList.add(classes$4.hidden),this.emptystate.classList.remove(classes$4.hidden),this.loader.classList.remove(classes$4.loading),this.form.classList.add(classes$4.hidden),this.bottom.classList.add(classes$4.hidden)}handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})}constructor(section2){this.section=section2,this.container=section2.container,this.cartMessages=document.querySelectorAll(selectors$8.cartMessageContainer),this.bar=this.container.querySelector(selectors$8.bar),this.ship=this.container.querySelector(selectors$8.ship),this.drawer=this.container.querySelector(selectors$8.drawer),this.form=this.container.querySelector(selectors$8.form),this.loader=this.container.querySelector(selectors$8.loader),this.bottom=this.container.querySelector(selectors$8.bottom),this.items=this.container.querySelector(selectors$8.items),this.subtotal=this.container.querySelector(selectors$8.subtotal),this.errors=this.container.querySelector(selectors$8.errors),this.finalPrice=this.container.querySelector(selectors$8.finalPrice),this.emptystate=this.container.querySelector(selectors$8.emptystate),this.progress=this.container.querySelector(selectors$8.progress),this.latestClick=null,this.cart=null,this.stale=!0,this.cartPage=document.querySelector(selectors$8.cartPage),this.listen()}};const cartDrawer={onLoad(){document.querySelector(selectors$8.drawer)&&(this.cart=new CartItems(this)),this.container.querySelector(selectors$8.shipping)&&new ShippingCalculator(this)},onUnload:function(){this.cart&&typeof this.cart.unload=="function"&&this.cart.unload()}},selectors$7={ajaxDisable:"data-ajax-disable",shipping:"[data-shipping-estimate-form]",input:"[data-update-cart]",update:"[data-update-button]",bottom:"[data-cart-bottom]",upsellWrapper:"[data-cart-page-upsell-wrapper]"},classes$3={dirty:"cart--dirty",heartBeat:"heart-beat"},cartSection={onLoad(){if(this.container.querySelector(selectors$7.shipping)&&new ShippingCalculator(this),this.disabled=this.container.getAttribute(selectors$7.ajaxDisable)=="true",this.disabled){this.cart=new AjaxDisabledCart(this);return}this.cart=new CartItems(this),this.cart.init().then(()=>{this.cart.loadHTML(!0)})}};let AjaxDisabledCart=class{initQuantity(){initQtySection(this.container)}moveUpsell(){const bottom=this.container.querySelector(selectors$7.bottom);bottom.insertBefore(this.upsellWrapper,bottom.firstChild)}initInputs(){this.inputs.forEach(input=>{input.addEventListener("change",(function(){this.updateBtn.classList.add(classes$3.dirty),this.updateBtn.classList.add(classes$3.heartBeat),setTimeout((function(){this.updateBtn.classList.remove(classes$3.heartBeat)}).bind(this),1300)}).bind(this))})}constructor(section2){window.theme.state.cartOpen=!0,this.section=section2,this.container=section2.container,this.inputs=this.container.querySelectorAll(selectors$7.input),this.quantityWrappers=this.container.querySelectorAll(selectors$7.qty),this.updateBtn=this.container.querySelector(selectors$7.update),this.upsellWrapper=this.container.querySelector(selectors$7.upsellWrapper),this.initQuantity(),this.initInputs(),this.upsellWrapper&&this.moveUpsell(),document.addEventListener("theme:cart:reload",(function(){window.location.reload()}).bind(this))}};register("cart",[cartSection]),register("cart-drawer",[drawer,cartDrawer]);const fadeIn=(el,display,callback=null)=>{el.style.opacity=0,el.style.display="block",(function fade(){let val=parseFloat(el.style.opacity);(val+=.1)>1||(el.style.opacity=val,requestAnimationFrame(fade)),val===1&&typeof callback=="function"&&callback()})()},fadeOut=(el,callback=null)=>{el.style.opacity=1,(function fade(){(el.style.opacity-=.1)<0?el.style.display="none":requestAnimationFrame(fade),parseFloat(el.style.opacity)===0&&typeof callback=="function"&&callback()})()},selectors$6={tracking:"[data-tracking-consent]",trackingAccept:"[data-confirm-cookies]",close:"[data-close-modal]",popupInner:"[data-popup-inner]",newsletterPopup:"[data-newsletter]",newsletterPopupHolder:"[data-newsletter-holder]",newsletterField:"[data-newsletter-field]",newsletterForm:"[data-newsletter-form]",promoPopup:"[data-promo-text]",delayAttribite:"data-popup-delay",cookieNameAttribute:"data-cookie-name",dataTargetReferrer:"data-target-referrer"},classes$2={hide:"hide",hasValue:"has-value",success:"has-success",error:"has-error",desktop:"desktop",mobile:"mobile"};let sections$1={},PopupCookie=class{write(){(document.cookie.indexOf("; ")!==-1&&!document.cookie.split("; ").find(row=>row.startsWith(this.name))||document.cookie.indexOf("; ")===-1)&&(document.cookie=`${this.name}=${this.value}; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}read(){return document.cookie.indexOf("; ")!==-1&&document.cookie.split("; ").find(row=>row.startsWith(this.name))?document.cookie.split("; ").find(row=>row.startsWith(this.name)).split("=")[1]:!1}destroy(){document.cookie.split("; ").find(row=>row.startsWith(this.name))&&(document.cookie=`${this.name}=null; expires=${this.configuration.expires}; path=${this.configuration.path}; domain=${this.configuration.domain}`)}constructor(name,value){this.configuration={expires:null,path:"/",domain:window.location.hostname},this.name=name,this.value=value}},DelayShow=class{hide(){this.show=!1}always(){this.show&&fadeIn(this.element)}delayed(){setTimeout(()=>{this.always()},1e4)}bottom(){let raf2;const onScroll=()=>{raf2&&window.cancelAnimationFrame(raf2),raf2=window.requestAnimationFrame(()=>{window.requestIdleCallback(()=>{Math.round(window.scrollY+window.innerHeight)>=Math.round(document.body.clientHeight)&&(this.always(),window.removeEventListener("scroll",onScroll,{passive:!0}))},{timeout:300})})};window.addEventListener("scroll",onScroll,{passive:!0})}onScroll(){}idle(){let timer=0,idleTime=6e4;const documentEvents=["mousemove","mousedown","click","touchmove","touchstart","touchend","keydown","keypress"],windowEvents=["load","resize","scroll"],startTimer=()=>{timer=setTimeout(()=>{timer=0,this.always()}
56,idleTime),documentEvents.forEach(eventType=>{document.addEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.addEventListener(eventType,resetTimer)})},resetTimer=()=>{timer&&clearTimeout(timer),documentEvents.forEach(eventType=>{document.removeEventListener(eventType,resetTimer)}),windowEvents.forEach(eventType=>{window.removeEventListener(eventType,resetTimer)}),startTimer()};startTimer()}constructor(holder,element){this.show=!0,this.element=element,this.delay=holder.getAttribute(selectors$6.delayAttribite),this.delay==="always"&&this.always(),this.delay==="delayed"&&this.delayed(),this.delay==="bottom"&&this.bottom(),this.delay==="idle"&&this.idle()}},TargetReferrer=class{init(){this.locationPath.indexOf(this.el.getAttribute(selectors$6.dataTargetReferrer))===-1&&!window.Shopify.designMode&&this.el.parentNode.removeChild(this.el)}constructor(el){this.el=el,this.locationPath=location.href,this.el.hasAttribute(selectors$6.dataTargetReferrer)&&this.init()}},Tracking=class{init(){this.showPopup&&fadeIn(this.modalInner),this.clickEvents()}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!1,()=>fadeOut(this.modalInner))}),this.acceptButton.addEventListener("click",event=>{event.preventDefault(),window.Shopify.customerPrivacy.setTrackingConsent(!0,()=>fadeOut(this.modalInner))}),document.addEventListener("trackingConsentAccepted",function(){console.log("trackingConsentAccepted event fired")})}onBlockSelect(evt){this.popup.contains(evt.target)&&this.showPopup&&fadeIn(this.modalInner)}onBlockDeselect(evt){this.popup.contains(evt.target)&&fadeOut(this.modalInner)}constructor(el){this.popup=el,this.modal=document.querySelector(selectors$6.tracking),this.modalInner=this.popup.querySelector(selectors$6.popupInner),this.close=this.modal.querySelector(selectors$6.close),this.acceptButton=this.modal.querySelector(selectors$6.trackingAccept),this.enable=this.modal.getAttribute("data-enable")==="true",this.showPopup=!1,window.Shopify.loadFeatures([{name:"consent-tracking-api",version:"0.1"}],error2=>{if(error2)throw error2;const userCanBeTracked=window.Shopify.customerPrivacy.userCanBeTracked(),userTrackingConsent=window.Shopify.customerPrivacy.getTrackingConsent();this.showPopup=!userCanBeTracked&&userTrackingConsent==="no_interaction"&&this.enable,window.Shopify.designMode&&(this.showPopup=!0),this.init()})}},PromoText=class{init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(window.Shopify.designMode?fadeIn(this.popupInner):new DelayShow(this.popup,this.popupInner),this.clickEvents())}clickEvents(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.popupInner),this.cookie.write()})}onBlockSelect(evt){this.popup.classList.contains(classes$2.mobile)&&(this.hasDeviceClass=classes$2.mobile),this.popup.classList.contains(classes$2.desktop)&&(this.hasDeviceClass=classes$2.desktop),this.hasDeviceClass!==""&&this.popup.classList.remove(this.hasDeviceClass),this.popup.contains(evt.target)&&fadeIn(this.popupInner)}onBlockDeselect(evt){this.popup.contains(evt.target)&&fadeOut(this.popupInner),this.hasDeviceClass!==""&&this.popup.classList.add(this.hasDeviceClass)}constructor(el){this.popup=el,this.popupInner=this.popup.querySelector(selectors$6.popupInner),this.close=this.popup.querySelector(selectors$6.close),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$6.cookieNameAttribute),"user_has_closed"),this.isTargeted=new TargetReferrer(this.popup),this.hasDeviceClass="",this.init()}},NewsletterPopup=class{init(){(!(this.cookie.read()!==!1)||window.Shopify.designMode)&&(this.show(),this.checkForSuccess())}show(){window.Shopify.designMode?fadeIn(this.popupInner):this.delayShow=new DelayShow(this.popup,this.popupInner),this.inputField(),this.closePopup()}preventDelayShow(){this.delayShow&&this.delayShow.hide()}checkForSuccess(){const hasError=this.form.classList.contains(classes$2.error),hasSuccess=this.form.classList.contains(classes$2.success);(hasSuccess||hasError)&&(fadeIn(this.popupInner),this.preventDelayShow(),hasSuccess&&this.cookie.write())}
56closePopup(){this.close.addEventListener("click",event=>{event.preventDefault(),fadeOut(this.popupInner),this.cookie.write(),this.preventDelayShow()})}inputField(){this.newsletterField.addEventListener("input",()=>{this.newsletterField.value!==""&&this.holder.classList.add(classes$2.hasValue,this.newsletterField.value!=="")}),this.newsletterField.addEventListener("focus",()=>{this.newsletterField.value!==""&&this.holder.classList.add(classes$2.hasValue,this.newsletterField.value!=="")}),this.newsletterField.addEventListener("focusout",()=>{setTimeout(()=>{this.holder.classList.remove(classes$2.hasValue)},2e3)})}onBlockSelect(evt){this.popup.contains(evt.target)&&fadeIn(this.popupInner)}onBlockDeselect(evt){this.popup.contains(evt.target)&&fadeOut(this.popupInner)}constructor(el){this.popup=el,this.popupInner=this.popup.querySelector(selectors$6.popupInner),this.holder=this.popup.querySelector(selectors$6.newsletterPopupHolder),this.close=this.popup.querySelector(selectors$6.close),this.newsletterField=this.popup.querySelector(selectors$6.newsletterField),this.cookie=new PopupCookie(this.popup.getAttribute(selectors$6.cookieNameAttribute),"newsletter_is_closed"),this.form=this.popup.querySelector(selectors$6.newsletterForm),this.isTargeted=new TargetReferrer(this.popup),this.delayShow=null,this.init()}};register("popups",[newsletterCheckForResultSection,{onLoad(){sections$1[this.id]=[],this.container.querySelectorAll(selectors$6.tracking).forEach(el=>{sections$1[this.id].push(new Tracking(el))}),this.container.querySelectorAll(selectors$6.newsletterPopup).forEach(el=>{sections$1[this.id].push(new NewsletterPopup(el))}),this.container.querySelectorAll(selectors$6.promoPopup).forEach(el=>{sections$1[this.id].push(new PromoText(el))})},onBlockSelect(evt){sections$1[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(evt)})},onBlockDeselect(evt){sections$1[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(evt)})}}]);const selectors$5={dot:"data-look-dot",productsHolder:"data-products-holder",slider:"[data-carousel]",buttonClose:"[data-button-close-holder]",slideIndex:"data-carousel-index",blockId:"data-block-id",focusable:"button"},classes$1={active:"is-active",expand:"is-expanded"},sections={};let Look=class{init(){this.keyEvents=e=>this.keyboardEventShowProductHolder(e),this.keyCloseEvent=e=>this.hideProductsHolder(e),this.clickEventsDot=e=>this.clickEventShowProductsHolder(e),this.clickEventToClose=e=>this.clickEventCloseProductsHolder(e),this.toggleOnResize=e=>debounce$1(this.onResize(e),200),this.initSlider(),this.addEvents()}initSlider(){this.slider&&(this.carousel=Flickity.data(this.slider),this.carousel.options.wrapAround=!0,this.carousel.options.freeScroll=!1,this.carousel.resize(),this.carousel.on("change",index=>{this.currentDot=this.container.querySelector(`[${selectors$5.dot}="${index}"]`),this.currentDot.classList.add(classes$1.active),this.removeClassOnSiblingDots()}))}addEvents(){this.dots.forEach(dot=>{dot.addEventListener("click",this.clickEventsDot),dot.addEventListener("keyup",this.keyEvents)}),document.addEventListener("keyup",this.keyCloseEvent),document.addEventListener("theme:resize",this.toggleOnResize),this.buttonClose&&this.buttonClose.addEventListener("click",this.clickEventToClose)}showProductsHolder(){const selectCellAnimate=!this.productsHolder.classList.contains(classes$1.expand);this.currentDot.classList.toggle(classes$1.active),this.productsHolder.classList.toggle(classes$1.expand,this.currentDot.classList.contains(classes$1.active)),isMobile()&&this.productsHolder.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0})),this.currentDot.classList.contains(classes$1.active)&&(this.hasDefaultOpen=!0,this.carousel.selectCell(Number(this.currentDot.getAttribute(selectors$5.dot)),!0,selectCellAnimate)),this.removeClassOnSiblingDots()}hideProductsHolder(e){e.code==="Escape"&&(this.removeClasses(),removeTrapFocus(),this.currentDot.focus())}removeClasses(){this.productsHolder.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})),this.productsHolder.classList.remove(classes$1.expand),this.currentDot.classList.remove(classes$1.active),this.hasDefaultOpen=!1}clickEventShowProductsHolder(e){this.currentDot=e.currentTarget,this.showProductsHolder()}clickEventCloseProductsHolder(){this.removeClasses()}keyboardEventShowProductHolder(e){e.code!=="Enter"&&e.code!=="Space"||setTimeout(()=>{const firstFocus=this.productsHolder.querySelector(selectors$5.focusable);trapFocus(this.productsHolder,{elementToFocus:firstFocus})},400)}onResize(){this.currentDot&&(window.innerWidth<window.theme.sizes.medium?this.removeClasses():this.hasDefaultOpen&&
56(this.currentDot.classList.add(classes$1.active),this.productsHolder.classList.add(classes$1.expand)))}removeEvents(){this.dots.forEach(dot=>{dot.removeEventListener("click",this.clickEventsDot),dot.removeEventListener("keyup",this.keyEvents)}),document.removeEventListener("keyup",this.keyCloseEvent),document.removeEventListener("theme:resize",this.toggleOnResize),this.buttonClose&&this.buttonClose.removeEventListener("click",this.clickEventToClose)}removeClassOnSiblingDots(){for(let sibling of this.currentDot.parentNode.children)sibling!==this.currentDot&&sibling.classList.remove(classes$1.active)}onUnload(){this.slider&&this.carousel&&this.carousel.destroy(),this.removeEvents()}onBlockSelect(e){if(this.slider&&this.carousel){const slide=this.container.querySelector(`[${selectors$5.blockId}="${e.detail.blockId}"]`);this.productsHolder.classList.add(classes$1.expand),this.carousel.selectCell(Number(slide.getAttribute(selectors$5.slideIndex)),!0,!0)}}onBlockDeselect(){window.innerWidth<window.theme.sizes.medium&&(this.productsHolder.classList.remove(classes$1.expand),this.currentDot.classList.remove(classes$1.active))}constructor(section2){this.section=section2,this.container=this.section.container,this.dots=this.container.querySelectorAll(`[${selectors$5.dot}]`),this.productsHolder=this.container.querySelector(`[${selectors$5.productsHolder}]`),this.slider=this.container.querySelector(selectors$5.slider),this.buttonClose=this.container.querySelector(selectors$5.buttonClose),this.currentDot=this.container.querySelector(`[${selectors$5.dot}].${classes$1.active}`),this.hasDefaultOpen=!!this.currentDot,this.init()}};register("look",[{onLoad(){sections[this.id]=[],sections[this.id].push(new Look(this))},onUnload(){sections[this.id].forEach(el=>{typeof el.onUnload=="function"&&el.onUnload()})},onBlockSelect(e){sections[this.id].forEach(el=>{typeof el.onBlockSelect=="function"&&el.onBlockSelect(e)})},onBlockDeselect(e){sections[this.id].forEach(el=>{typeof el.onBlockDeselect=="function"&&el.onBlockDeselect(e)})}}]),register("featured-article",parallaxImage);const wrap$1=(toWrap,wrapperClass="",wrapper)=>(wrapper=wrapper||document.createElement("div"),wrapper.classList.add(wrapperClass),toWrap.parentNode.insertBefore(wrapper,toWrap),wrapper.appendChild(toWrap));window.theme.settings.animate_scroll&&AOS.init({once:!0}),document.addEventListener("DOMContentLoaded",function(){const menuEl=document.querySelector("[data-header-height]");if(menuEl){const menuHeight=menuEl.clientHeight||0;document.documentElement.style.setProperty("--menu-height",`${menuHeight}px`)}load("*"),window.theme.settings.animate_hover&&document.body.classList.add("theme-animate-hover"),document.querySelectorAll(".rte table").forEach(table=>{wrap$1(table,"rte__table-wrapper")}),document.querySelectorAll('.rte iframe[src*="youtube.com/embed"], .rte iframe[src*="player.vimeo"], .rte iframe#admin_bar_iframe').forEach(frame2=>{wrap$1(frame2,"rte__video-wrapper")}),document.addEventListener("mousedown",()=>{document.body.classList.remove("focus-enabled")}),document.addEventListener("keyup",event=>{event.code==="Tab"&&document.body.classList.add("focus-enabled")}),window.navigator.cookieEnabled&&(document.documentElement.className=document.documentElement.className.replace("supports-no-cookies","supports-cookies")),focusHash(),bindInPageLinks(),"scrollBehavior"in document.documentElement.style||loadScript({url:window.theme.assets.smoothscroll})});var candidateSelectors$1=["input","select","textarea","a[href]","button","[tabindex]:not(slot)","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable="false"])',"details>summary:first-of-type","details"],candidateSelector$1=candidateSelectors$1.join(","),NoElement$1=typeof Element>"u",matches$1=NoElement$1?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,getRootNode$1=!NoElement$1&&Element.prototype.getRootNode?function(element){return element.getRootNode()}:function(element){return element.ownerDocument},getCandidates$1=function(el,includeContainer,filter2){var candidates=Array.prototype.slice.apply(el.querySelectorAll(candidateSelector$1));return includeContainer&&matches$1.call(el,candidateSelector$1)&&candidates.unshift(el),candidates=candidates.filter(filter2),candidates}
vendor: 3,228 bytes, line 56
56,getCandidatesIteratively=function getCandidatesIteratively2(elements,includeContainer,options2){for(var candidates=[],elementsToCheck=Array.from(elements);elementsToCheck.length;){var element=elementsToCheck.shift();if(element.tagName==="SLOT"){var assigned=element.assignedElements(),content=assigned.length?assigned:element.children,nestedCandidates=getCandidatesIteratively2(content,!0,options2);options2.flatten?candidates.push.apply(candidates,nestedCandidates):candidates.push({scope:element,candidates:nestedCandidates})}else{var validCandidate=matches$1.call(element,candidateSelector$1);validCandidate&&options2.filter(element)&&(includeContainer||!elements.includes(element))&&candidates.push(element);var shadowRoot=element.shadowRoot||typeof options2.getShadowRoot=="function"&&options2.getShadowRoot(element),validShadowRoot=!options2.shadowRootFilter||options2.shadowRootFilter(element);if(shadowRoot&&validShadowRoot){var _nestedCandidates=getCandidatesIteratively2(shadowRoot===!0?element.children:shadowRoot.children,!0,options2);options2.flatten?candidates.push.apply(candidates,_nestedCandidates):candidates.push({scope:element,candidates:_nestedCandidates})}else elementsToCheck.unshift.apply(elementsToCheck,element.children)}}return candidates},getTabindex=function(node,isScope){return node.tabIndex<0&&(isScope||/^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName)||node.isContentEditable)&&isNaN(parseInt(node.getAttribute("tabindex"),10))?0:node.tabIndex},sortOrderedTabbables=function(a,b){return a.tabIndex===b.tabIndex?a.documentOrder-b.documentOrder:a.tabIndex-b.tabIndex},isInput$1=function(node){return node.tagName==="INPUT"},isHiddenInput$1=function(node){return isInput$1(node)&&node.type==="hidden"},isDetailsWithSummary$1=function(node){var r=node.tagName==="DETAILS"&&Array.prototype.slice.apply(node.children).some(function(child){return child.tagName==="SUMMARY"});return r},getCheckedRadio=function(nodes,form){for(var i=0;i<nodes.length;i++)if(nodes[i].checked&&nodes[i].form===form)return nodes[i]},isTabbableRadio=function(node){if(!node.name)return!0;var radioScope=node.form||getRootNode$1(node),queryRadios=function(name){return radioScope.querySelectorAll('input[type="radio"][name="'+name+'"]')},radioSet;if(typeof window<"u"&&typeof window.CSS<"u"&&typeof window.CSS.escape=="function")radioSet=queryRadios(window.CSS.escape(node.name));else try{radioSet=queryRadios(node.name)}catch(err){return console.error("Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s",err.message),!1}var checked=getCheckedRadio(radioSet,node.form);return!checked||checked===node},isRadio$1=function(node){return isInput$1(node)&&node.type==="radio"},isNonTabbableRadio=function(node){return isRadio$1(node)&&!isTabbableRadio(node)},isZeroArea$1=function(node){var _node$getBoundingClie=node.getBoundingClientRect(),width=_node$getBoundingClie.width,height=_node$getBoundingClie.height;return width===0&&height===0},isHidden$1=function(node,_ref){var displayCheck=_ref.displayCheck,getShadowRoot=_ref.getShadowRoot;if(getComputedStyle(node).visibility==="hidden")return!0;var isDirectSummary=matches$1.call(node,"details>
56summary:first-of-type"),nodeUnderDetails=isDirectSummary?node.parentElement:node;if(matches$1.call(nodeUnderDetails,"details:not([open]) *"))return!0;var nodeRootHost=getRootNode$1(node).host,nodeIsAttached=nodeRootHost?.ownerDocument.contains(nodeRootHost)||node.ownerDocument.contains(node);if(!displayCheck||displayCheck==="full"){if(typeof getShadowRoot=="function"){for(var originalNode=node;node;){var parentElement=node.parentElement,rootNode=getRootNode$1(node);if(parentElement&&!parentElement.shadowRoot&&getShadowRoot(parentElement)===!0)return isZeroArea$1(node);node.assignedSlot?node=node.assignedSlot:!parentElement&&rootNode!==node.ownerDocument?node=rootNode.host:node=parentElement}node=originalNode}if(nodeIsAttached)return!node.getClientRects().length}else if(displayCheck==="non-zero-area")return isZeroArea$1(node);return!1},isDisabledFromFieldset$1=function(node){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName))for(var parentNode=node.parentElement;parentNode;){if(parentNode.tagName==="FIELDSET"&&parentNode.disabled){for(var i=0;i<parentNode.children.length;i++){var child=parentNode.children.item(i);if(child.tagName==="LEGEND")return matches$1.call(parentNode,"fieldset[disabled] *")?!0:!child.contains(node)}return!0}parentNode=parentNode.parentElement}return!1},isNodeMatchingSelectorFocusable$1=function(options2,node){return!(node.disabled||isHiddenInput$1(node)||isHidden$1(node,options2)||isDetailsWithSummary$1(node)||isDisabledFromFieldset$1(node))},isNodeMatchingSelectorTabbable=function(options2,node){return!(isNonTabbableRadio(node)||getTabindex(node)<0||!isNodeMatchingSelectorFocusable$1(options2,node))},isValidShadowRootTabbable=function(shadowHostNode){var tabIndex=parseInt(shadowHostNode.getAttribute("tabindex"),10);return!!(isNaN(tabIndex)||tabIndex>=0)},sortByOrder=function sortByOrder2(candidates){var regularTabbables=[],orderedTabbables=[];return candidates.forEach(function(item,i){var isScope=!!item.scope,element=isScope?item.scope:item,candidateTabindex=getTabindex(element,isScope),elements=isScope?sortByOrder2(item.candidates):element;candidateTabindex===0?isScope?regularTabbables.push.apply(regularTabbables,elements):regularTabbables.push(element):orderedTabbables.push({documentOrder:i,tabIndex:candidateTabindex,item,isScope,content:elements})}),orderedTabbables.sort(sortOrderedTabbables).reduce(function(acc,sortable){return sortable.isScope?acc.push.apply(acc,sortable.content):acc.push(sortable.content),acc},[]).concat(regularTabbables)},tabbable=function(el,options2){options2=options2||{};var candidates;return options2.getShadowRoot?candidates=getCandidatesIteratively([el],options2.includeContainer,{filter:isNodeMatchingSelectorTabbable.bind(null,options2),flatten:!1,getShadowRoot:options2.getShadowRoot,shadowRootFilter:isValidShadowRootTabbable}):candidates=getCandidates$1(el,options2.includeContainer,isNodeMatchingSelectorTabbable.bind(null,options2)),sortByOrder(candidates)},focusable$1=function(el,options2){options2=options2||{};var candidates;return options2.getShadowRoot?candidates=getCandidatesIteratively([el],options2.includeContainer,{filter:isNodeMatchingSelectorFocusable$1.bind(null,options2),flatten:!0,getShadowRoot:options2.getShadowRoot}):candidates=getCandidates$1(el,options2.includeContainer,isNodeMatchingSelectorFocusable$1.bind(null,options2)),candidates},isTabbable=function(node,options2){if(options2=options2||{},!node)throw new Error("No node provided");return matches$1.call(node,candidateSelector$1)===!1?!1:isNodeMatchingSelectorTabbable(options2,node)},focusableCandidateSelector$1=candidateSelectors$1.concat("iframe").join(","),isFocusable$1=function(node,options2){if(options2=options2||{},!node)throw new Error("No node provided");return matches$1.call(node,focusableCandidateSelector$1)===!1?!1:isNodeMatchingSelectorFocusable$1(options2,node)};function ownKeys$1(object,enumerableOnly){var keys2=Object.keys(object);if(Object.getOwnPropertySymbols){var symbols=Object.getOwnPropertySymbols(object);enumerableOnly&&(symbols=symbols.filter(function(sym){return Object.getOwnPropertyDescriptor(object,sym).enumerable})),keys2.push.apply(keys2,symbols)}return keys2}
vendor: 5,496 bytes, line 56
56function _objectSpread2(target){for(var i=1;i<arguments.length;i++){var source=arguments[i]!=null?arguments[i]:{};i%2?ownKeys$1(Object(source),!0).forEach(function(key){_defineProperty(target,key,source[key])}):Object.getOwnPropertyDescriptors?Object.defineProperties(target,Object.getOwnPropertyDescriptors(source)):ownKeys$1(Object(source)).forEach(function(key){Object.defineProperty(target,key,Object.getOwnPropertyDescriptor(source,key))})}return target}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}var activeFocusTraps=(function(){var trapQueue=[];return{activateTrap:function(trap){if(trapQueue.length>0){var activeTrap=trapQueue[trapQueue.length-1];activeTrap!==trap&&activeTrap.pause()}var trapIndex=trapQueue.indexOf(trap);trapIndex===-1||trapQueue.splice(trapIndex,1),trapQueue.push(trap)},deactivateTrap:function(trap){var trapIndex=trapQueue.indexOf(trap);trapIndex!==-1&&trapQueue.splice(trapIndex,1),trapQueue.length>0&&trapQueue[trapQueue.length-1].unpause()}}})(),isSelectableInput=function(node){return node.tagName&&node.tagName.toLowerCase()==="input"&&typeof node.select=="function"},isEscapeEvent=function(e){return e.key==="Escape"||e.key==="Esc"||e.keyCode===27},isTabEvent=function(e){return e.key==="Tab"||e.keyCode===9},delay=function(fn){return setTimeout(fn,0)},findIndex=function(arr,fn){var idx=-1;return arr.every(function(value,i){return fn(value)?(idx=i,!1):!0}),idx},valueOrHandler=function(value){for(var _len=arguments.length,params=new Array(_len>1?_len-1:0),_key=1;_key<_len;_key++)params[_key-1]=arguments[_key];return typeof value=="function"?value.apply(void 0,params):value},getActualTarget=function(event){return event.target.shadowRoot&&typeof event.composedPath=="function"?event.composedPath()[0]:event.target},createFocusTrap=function(elements,userOptions){var doc=userOptions?.document||document,config2=_objectSpread2({returnFocusOnDeactivate:!0,escapeDeactivates:!0,delayInitialFocus:!0},userOptions),state={containers:[],containerGroups:[],tabbableGroups:[],nodeFocusedBeforeActivation:null,mostRecentlyFocusedNode:null,active:!1,paused:!1,delayInitialFocusTimer:void 0},trap,getOption=function(configOverrideOptions,optionName,configOptionName){return configOverrideOptions&&configOverrideOptions[optionName]!==void 0?configOverrideOptions[optionName]:config2[configOptionName||optionName]},findContainerIndex=function(element){return state.containerGroups.findIndex(function(_ref){var container=_ref.container,tabbableNodes=_ref.tabbableNodes;return container.contains(element)||tabbableNodes.find(function(node){return node===element})})},getNodeForOption=function(optionName){var optionValue=config2[optionName];if(typeof optionValue=="function"){for(var _len2=arguments.length,params=new Array(_len2>1?_len2-1:0),_key2=1;_key2<_len2;_key2++)params[_key2-1]=arguments[_key2];optionValue=optionValue.apply(void 0,params)}if(optionValue===!0&&(optionValue=void 0),!optionValue){if(optionValue===void 0||optionValue===!1)return optionValue;throw new Error("`".concat(optionName,"` was specified but was not a node, or did not return a node"))}var node=optionValue;if(typeof optionValue=="string"&&(node=doc.querySelector(optionValue),!node))throw new Error("`".concat(optionName,"` as selector refers to no known node"));return node},getInitialFocusNode=function(){var node=getNodeForOption("initialFocus");if(node===!1)return!1;if(node===void 0)if(findContainerIndex(doc.activeElement)>=0)node=doc.activeElement;else{var firstTabbableGroup=state.tabbableGroups[0],firstTabbableNode=firstTabbableGroup&&firstTabbableGroup.firstTabbableNode;node=firstTabbableNode||getNodeForOption("fallbackFocus")}if(!node)throw new Error("Your focus-trap needs to have at least one focusable element");return node},updateTabbableNodes=function(){if(state.containerGroups=state.containers.map(function(container){var tabbableNodes=tabbable(container,config2.tabbableOptions),focusableNodes=focusable$1(container,config2.tabbableOptions);return{container,tabbableNodes,focusableNodes,firstTabbableNode:tabbableNodes.length>0?tabbableNodes[0]:null,lastTabbableNode:tabbableNodes.length>0?tabbableNodes[tabbableNodes.length-1]:null,nextTabbableNode:function(node){var forward=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!0,nodeIdx=focusableNodes.findIndex(function(n){return n===node});if(!(nodeIdx<0))return forward?focusableNodes.slice(nodeIdx+1).find(function(n){return isTabbable(n,config2.tabbableOptions)}):focusableNodes.slice(0,nodeIdx).reverse().find(function(n){return isTabbable(n,config2.tabbableOptions)})}}}),state.tabbableGroups=state.containerGroups.filter(function(group){return group.tabbableNodes.length>0}),state.tabbableGroups.length<=0&&!getNodeForOption("fallbackFocus"))throw new Error("Your focus-trap must have at least one container with at least one tabbable node in it at all times")},tryFocus=function tryFocus2(node){if(node!==!1&&node!==doc.activeElement){if(!node||!node.focus){tryFocus2(getInitialFocusNode());return}node.focus({preventScroll:!!config2.preventScroll}),state.mostRecentlyFocusedNode=node,isSelectableInput(node)&&node.select()}},getReturnFocusNode=function(previousActiveElement){var node=getNodeForOption("setReturnFocus",previousActiveElement);return node||(node===!1?!1:previousActiveElement)},checkPointerDown=function(e){var target=getActualTarget(e);if(!(findContainerIndex(target)>
56=0)){if(valueOrHandler(config2.clickOutsideDeactivates,e)){trap.deactivate({returnFocus:config2.returnFocusOnDeactivate&&!isFocusable$1(target,config2.tabbableOptions)});return}valueOrHandler(config2.allowOutsideClick,e)||e.preventDefault()}},checkFocusIn=function(e){var target=getActualTarget(e),targetContained=findContainerIndex(target)>=0;targetContained||target instanceof Document?targetContained&&(state.mostRecentlyFocusedNode=target):(e.stopImmediatePropagation(),tryFocus(state.mostRecentlyFocusedNode||getInitialFocusNode()))},checkTab=function(e){var target=getActualTarget(e);updateTabbableNodes();var destinationNode=null;if(state.tabbableGroups.length>0){var containerIndex=findContainerIndex(target),containerGroup=containerIndex>=0?state.containerGroups[containerIndex]:void 0;if(containerIndex<0)e.shiftKey?destinationNode=state.tabbableGroups[state.tabbableGroups.length-1].lastTabbableNode:destinationNode=state.tabbableGroups[0].firstTabbableNode;else if(e.shiftKey){var startOfGroupIndex=findIndex(state.tabbableGroups,function(_ref2){var firstTabbableNode=_ref2.firstTabbableNode;return target===firstTabbableNode});if(startOfGroupIndex<0&&(containerGroup.container===target||isFocusable$1(target,config2.tabbableOptions)&&!isTabbable(target,config2.tabbableOptions)&&!containerGroup.nextTabbableNode(target,!1))&&(startOfGroupIndex=containerIndex),startOfGroupIndex>=0){var destinationGroupIndex=startOfGroupIndex===0?state.tabbableGroups.length-1:startOfGroupIndex-1,destinationGroup=state.tabbableGroups[destinationGroupIndex];destinationNode=destinationGroup.lastTabbableNode}}else{var lastOfGroupIndex=findIndex(state.tabbableGroups,function(_ref3){var lastTabbableNode=_ref3.lastTabbableNode;return target===lastTabbableNode});if(lastOfGroupIndex<0&&(containerGroup.container===target||isFocusable$1(target,config2.tabbableOptions)&&!isTabbable(target,config2.tabbableOptions)&&!containerGroup.nextTabbableNode(target))&&(lastOfGroupIndex=containerIndex),lastOfGroupIndex>=0){var _destinationGroupIndex=lastOfGroupIndex===state.tabbableGroups.length-1?0:lastOfGroupIndex+1,_destinationGroup=state.tabbableGroups[_destinationGroupIndex];destinationNode=_destinationGroup.firstTabbableNode}}}else destinationNode=getNodeForOption("fallbackFocus");destinationNode&&(e.preventDefault(),tryFocus(destinationNode))},checkKey=function(e){if(isEscapeEvent(e)&&valueOrHandler(config2.escapeDeactivates,e)!==!1){e.preventDefault(),trap.deactivate();return}if(isTabEvent(e)){checkTab(e);return}},checkClick=function(e){var target=getActualTarget(e);findContainerIndex(target)>=0||valueOrHandler(config2.clickOutsideDeactivates,e)||valueOrHandler(config2.allowOutsideClick,e)||(e.preventDefault(),e.stopImmediatePropagation())},addListeners=function(){if(state.active)return activeFocusTraps.activateTrap(trap),state.delayInitialFocusTimer=config2.delayInitialFocus?delay(function(){tryFocus(getInitialFocusNode())}):tryFocus(getInitialFocusNode()),doc.addEventListener("focusin",checkFocusIn,!0),doc.addEventListener("mousedown",checkPointerDown,{capture:!0,passive:!1}),doc.addEventListener("touchstart",checkPointerDown,{capture:!0,passive:!1}),doc.addEventListener("click",checkClick,{capture:!0,passive:!1}),doc.addEventListener("keydown",checkKey,{capture:!0,passive:!1}),trap},removeListeners=function(){if(state.active)return doc.removeEventListener("focusin",checkFocusIn,!0),doc.removeEventListener("mousedown",checkPointerDown,!0),doc.removeEventListener("touchstart",checkPointerDown,!0),doc.removeEventListener("click",checkClick,!0),doc.removeEventListener("keydown",checkKey,!0),trap};return trap={get active(){return state.active},get paused(){return state.paused},activate:function(activateOptions){if(state.active)return this;var onActivate=getOption(activateOptions,"onActivate"),onPostActivate=getOption(activateOptions,"onPostActivate"),checkCanFocusTrap=getOption(activateOptions,"checkCanFocusTrap");checkCanFocusTrap||updateTabbableNodes(),state.active=!0,state.paused=!1,state.nodeFocusedBeforeActivation=doc.activeElement,onActivate&&onActivate();var finishActivation=function(){checkCanFocusTrap&&updateTabbableNodes(),addListeners(),onPostActivate&&onPostActivate()};return checkCanFocusTrap?(checkCanFocusTrap(state.containers.concat()).then(finishActivation,finishActivation),this):(finishActivation(),this)},deactivate:function(deactivateOptions){if(!state.active)return this;
56var options2=_objectSpread2({onDeactivate:config2.onDeactivate,onPostDeactivate:config2.onPostDeactivate,checkCanReturnFocus:config2.checkCanReturnFocus},deactivateOptions);clearTimeout(state.delayInitialFocusTimer),state.delayInitialFocusTimer=void 0,removeListeners(),state.active=!1,state.paused=!1,activeFocusTraps.deactivateTrap(trap);var onDeactivate=getOption(options2,"onDeactivate"),onPostDeactivate=getOption(options2,"onPostDeactivate"),checkCanReturnFocus=getOption(options2,"checkCanReturnFocus"),returnFocus=getOption(options2,"returnFocus","returnFocusOnDeactivate");onDeactivate&&onDeactivate();var finishDeactivation=function(){delay(function(){returnFocus&&tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)),onPostDeactivate&&onPostDeactivate()})};return returnFocus&&checkCanReturnFocus?(checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation,finishDeactivation),this):(finishDeactivation(),this)},pause:function(){return state.paused||!state.active?this:(state.paused=!0,removeListeners(),this)},unpause:function(){return!state.paused||!state.active?this:(state.paused=!1,updateTabbableNodes(),addListeners(),this)},updateContainerElements:function(containerElements){var elementsAsArray=[].concat(containerElements).filter(Boolean);return state.containers=elementsAsArray.map(function(element){return typeof element=="string"?doc.querySelector(element):element}),state.active&&updateTabbableNodes(),this}},trap.updateContainerElements(elements),trap};function src_default$4(Alpine2){let lastFocused,currentFocused;window.addEventListener("focusin",()=>{lastFocused=currentFocused,currentFocused=document.activeElement}),Alpine2.magic("focus",el=>{let within=el;return{__noscroll:!1,__wrapAround:!1,within(el2){return within=el2,this},withoutScrolling(){return this.__noscroll=!0,this},noscroll(){return this.__noscroll=!0,this},withWrapAround(){return this.__wrapAround=!0,this},wrap(){return this.withWrapAround()},focusable(el2){return isFocusable$1(el2)},previouslyFocused(){return lastFocused},lastFocused(){return lastFocused},focused(){return currentFocused},focusables(){return Array.isArray(within)?within:focusable$1(within,{displayCheck:"none"})},all(){return this.focusables()},isFirst(el2){let els=this.all();return els[0]&&els[0].isSameNode(el2)},isLast(el2){let els=this.all();return els.length&&els.slice(-1)[0].isSameNode(el2)},getFirst(){return this.all()[0]},getLast(){return this.all().slice(-1)[0]},getNext(){let list=this.all(),current=document.activeElement;if(list.indexOf(current)!==-1)return this.__wrapAround&&list.indexOf(current)===list.length-1?list[0]:list[list.indexOf(current)+1]},getPrevious(){let list=this.all(),current=document.activeElement;if(list.indexOf(current)!==-1)return this.__wrapAround&&list.indexOf(current)===0?list.slice(-1)[0]:list[list.indexOf(current)-1]},first(){this.focus(this.getFirst())},last(){this.focus(this.getLast())},next(){this.focus(this.getNext())},previous(){this.focus(this.getPrevious())},prev(){return this.previous()},focus(el2){el2&&setTimeout(()=>{el2.hasAttribute("tabindex")||el2.setAttribute("tabindex","0"),el2.focus({preventScroll:this.__noscroll})})}}}),Alpine2.directive("trap",Alpine2.skipDuringClone((el,{expression,modifiers},{effect:effect3,evaluateLater:evaluateLater2,cleanup:cleanup2})=>{let evaluator=evaluateLater2(expression),oldValue=!1,options2={escapeDeactivates:!1,allowOutsideClick:!0,fallbackFocus:()=>el},undoInert=()=>{};if(modifiers.includes("noautofocus"))options2.initialFocus=!1;else{let autofocusEl=el.querySelector("[autofocus]");autofocusEl&&(options2.initialFocus=autofocusEl)}modifiers.includes("inert")&&(options2.onPostActivate=()=>{Alpine2.nextTick(()=>{undoInert=setInert(el)})});let trap=createFocusTrap(el,options2),undoDisableScrolling=()=>{};const releaseFocus=()=>{undoInert(),undoInert=()=>{},undoDisableScrolling(),undoDisableScrolling=()=>{},trap.deactivate({returnFocus:!modifiers.includes("noreturn")})};effect3(()=>evaluator(value=>{oldValue!==value&&(value&&!oldValue&&(modifiers.includes("noscroll")&&(undoDisableScrolling=disableScrolling()),setTimeout(()=>{trap.activate()},15)),!value&&oldValue&&releaseFocus(),oldValue=!!value)})),cleanup2(releaseFocus)},(el,{expression,modifiers},{evaluate:evaluate2})=>{modifiers.includes("inert")&&evaluate2(expression)&&setInert(el)}))}function setInert(el){let undos=[];return crawlSiblingsUp(el,sibling=>{let cache2=sibling.hasAttribute("aria-hidden");sibling.setAttribute("aria-hidden","true"),undos.push(()=>cache2||sibling.removeAttribute("aria-hidden"))}),()=>{for(;undos.length;)undos.pop()()}}function crawlSiblingsUp(el,callback){el.isSameNode(document.body)||!el.parentNode||Array.from(el.parentNode.children).forEac
56h(sibling=>{sibling.isSameNode(el)?crawlSiblingsUp(el.parentNode,callback):callback(sibling)})}function disableScrolling(){let overflow2=document.documentElement.style.overflow,paddingRight=document.documentElement.style.paddingRight,scrollbarWidth=window.innerWidth-document.documentElement.clientWidth;return document.documentElement.style.overflow="hidden",document.documentElement.style.paddingRight=`${scrollbarWidth}px`,()=>{document.documentElement.style.overflow=overflow2,document.documentElement.style.paddingRight=paddingRight}}var module_default$4=src_default$4;function src_default$3(Alpine2){Alpine2.directive("intersect",Alpine2.skipDuringClone((el,{value,expression,modifiers},{evaluateLater:evaluateLater2,cleanup:cleanup2})=>{let evaluate2=evaluateLater2(expression),options2={rootMargin:getRootMargin(modifiers),threshold:getThreshold(modifiers)},observer2=new IntersectionObserver(entries=>{entries.forEach(entry=>{entry.isIntersecting!==(value==="leave")&&(evaluate2(),modifiers.includes("once")&&observer2.disconnect())})},options2);observer2.observe(el),cleanup2(()=>{observer2.disconnect()})}))}function getThreshold(modifiers){if(modifiers.includes("full"))return .99;if(modifiers.includes("half"))return .5;if(!modifiers.includes("threshold"))return 0;let threshold=modifiers[modifiers.indexOf("threshold")+1];return threshold==="100"?1:threshold==="0"?0:+`.${threshold}`}function getLengthValue(rawValue){let match=rawValue.match(/^(-?[0-9]+)(px|%)?$/);return match?match[1]+(match[2]||"px"):void 0}function getRootMargin(modifiers){const key="margin",fallback="0px 0px 0px 0px",index=modifiers.indexOf(key);if(index===-1)return fallback;let values=[];for(let i=1;i<5;i++)values.push(getLengthValue(modifiers[index+i]||""));return values=values.filter(v=>v!==void 0),values.length?values.join(" ").trim():fallback}var module_default$3=src_default$3;function src_default$2(Alpine2){Alpine2.directive("collapse",collapse),collapse.inline=(el,{modifiers})=>{modifiers.includes("min")&&(el._x_doShow=()=>{},el._x_doHide=()=>{})};function collapse(el,{modifiers}){let duration=modifierValue$1(modifiers,"duration",250)/1e3,floor=modifierValue$1(modifiers,"min",0),fullyHide=!modifiers.includes("min");el._x_isShown||(el.style.height=`${floor}px`),!el._x_isShown&&fullyHide&&(el.hidden=!0),el._x_isShown||(el.style.overflow="hidden");let setFunction=(el2,styles2)=>{let revertFunction=Alpine2.setStyles(el2,styles2);return styles2.height?()=>{}:revertFunction},transitionStyles={transitionProperty:"height",transitionDuration:`${duration}s`,transitionTimingFunction:"cubic-bezier(0.4, 0.0, 0.2, 1)"};el._x_transition={in(before=()=>{},after=()=>{}){fullyHide&&(el.hidden=!1),fullyHide&&(el.style.display=null);let current=el.getBoundingClientRect().height;el.style.height="auto";let full=el.getBoundingClientRect().height;current===full&&(current=floor),Alpine2.transition(el,Alpine2.setStyles,{during:transitionStyles,start:{height:current+"px"},end:{height:full+"px"}},()=>el._x_isShown=!0,()=>{Math.abs(el.getBoundingClientRect().height-full)<1&&(el.style.overflow=null)})},out(before=()=>{},after=()=>{}){let full=el.getBoundingClientRect().height;Alpine2.transition(el,setFunction,{during:transitionStyles,start:{height:full+"px"},end:{height:floor+"px"}},()=>el.style.overflow="hidden",()=>{el._x_isShown=!1,el.style.height==`${floor}px`&&fullyHide&&(el.style.display="none",el.hidden=!0)})}}}}function modifierValue$1(modifiers,key,fallback){if(modifiers.indexOf(key)===-1)return fallback;const rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue)return fallback;if(key==="duration"){let match=rawValue.match(/([0-9]+)ms/);if(match)return match[1]}if(key==="min"){let match=rawValue.match(/([0-9]+)px/);if(match)return match[1]}return rawValue}var module_default$2=src_default$2;function morph$1(from,toHtml,options2){monkeyPatchDomSetAttributeToAllowAtSymbols();let context=createMorphContext(options2),toEl=typeof toHtml=="string"?createElement(toHtml):toHtml;return window.Alpine&&window.Alpine.closestDataStack&&!from._x_dataStack&&(toEl._x_dataStack=window.Alpine.closestDataStack(from),toEl._x_dataStack&&window.Alpine.cloneNode(from,toEl)),context.patch(from,toEl),from}function morphBetween(startMarker,endMarker,toHtml,options2={}
vendor: 6,711 bytes, line 56
56){monkeyPatchDomSetAttributeToAllowAtSymbols();let context=createMorphContext(options2),fromContainer=startMarker.parentNode,fromBlock=new Block(startMarker,endMarker),toContainer=typeof toHtml=="string"?(()=>{let container=document.createElement("div");return container.insertAdjacentHTML("beforeend",toHtml),container})():toHtml,toStartMarker=document.createComment("[morph-start]"),toEndMarker=document.createComment("[morph-end]");toContainer.insertBefore(toStartMarker,toContainer.firstChild),toContainer.appendChild(toEndMarker);let toBlock=new Block(toStartMarker,toEndMarker);window.Alpine&&window.Alpine.closestDataStack&&(toContainer._x_dataStack=window.Alpine.closestDataStack(fromContainer),toContainer._x_dataStack&&window.Alpine.cloneNode(fromContainer,toContainer)),context.patchChildren(fromBlock,toBlock)}function createMorphContext(options2={}){let defaultGetKey=el=>el.getAttribute("key"),noop2=()=>{},context={key:options2.key||defaultGetKey,lookahead:options2.lookahead||!1,updating:options2.updating||noop2,updated:options2.updated||noop2,removing:options2.removing||noop2,removed:options2.removed||noop2,adding:options2.adding||noop2,added:options2.added||noop2};return context.patch=function(from,to){if(context.differentElementNamesTypesOrKeys(from,to))return context.swapElements(from,to);let updateChildrenOnly=!1,skipChildren=!1,skipUntil=predicate=>context.skipUntilCondition=predicate;if(!shouldSkipChildren(context.updating,()=>skipChildren=!0,skipUntil,from,to,()=>updateChildrenOnly=!0)){if(from.nodeType===1&&window.Alpine&&(window.Alpine.cloneNode(from,to),from._x_teleport&&to._x_teleport&&context.patch(from._x_teleport,to._x_teleport)),textOrComment(to)){context.patchNodeValue(from,to),context.updated(from,to);return}updateChildrenOnly||context.patchAttributes(from,to),context.updated(from,to),skipChildren||context.patchChildren(from,to)}},context.differentElementNamesTypesOrKeys=function(from,to){return from.nodeType!=to.nodeType||from.nodeName!=to.nodeName||context.getKey(from)!=context.getKey(to)},context.swapElements=function(from,to){if(shouldSkip(context.removing,from))return;let toCloned=to.cloneNode(!0);shouldSkip(context.adding,toCloned)||(from.replaceWith(toCloned),context.removed(from),context.added(toCloned))},context.patchNodeValue=function(from,to){let value=to.nodeValue;from.nodeValue!==value&&(from.nodeValue=value)},context.patchAttributes=function(from,to){if(from._x_transitioning||from._x_isShown&&!to._x_isShown||!from._x_isShown&&to._x_isShown)return;let domAttributes=Array.from(from.attributes),toAttributes=Array.from(to.attributes);for(let i=domAttributes.length-1;i>=0;i--){let name=domAttributes[i].name;to.hasAttribute(name)||from.removeAttribute(name)}for(let i1=toAttributes.length-1;i1>=0;i1--){let name=toAttributes[i1].name,value=toAttributes[i1].value;from.getAttribute(name)!==value&&from.setAttribute(name,value)}},context.patchChildren=function(from,to){let fromKeys=context.keyToMap(from.children),fromKeyHoldovers={},currentTo=getFirstNode(to),currentFrom=getFirstNode(from);for(;currentTo;){seedingMatchingId(currentTo,currentFrom);let toKey=context.getKey(currentTo),fromKey=context.getKey(currentFrom);if(context.skipUntilCondition){let fromDone=!currentFrom||context.skipUntilCondition(currentFrom),toDone=!currentTo||context.skipUntilCondition(currentTo);if(fromDone&&toDone)context.skipUntilCondition=null;else{fromDone||(currentFrom=currentFrom&&getNextSibling(from,currentFrom)),toDone||(currentTo=currentTo&&getNextSibling(to,currentTo));continue}}if(!currentFrom)if(toKey&&fromKeyHoldovers[toKey]){let holdover=fromKeyHoldovers[toKey];from.appendChild(holdover),currentFrom=holdover,fromKey=context.getKey(currentFrom)}else{if(!shouldSkip(context.adding,currentTo)){let clone2=currentTo.cloneNode(!0);from.appendChild(clone2),context.added(clone2)}currentTo=getNextSibling(to,currentTo);continue}let isIf=node=>node&&node.nodeType===8&&node.textContent==="[if BLOCK]><![endif]",isEnd=node=>node&&node.nodeType===8&&node.textContent==="[if ENDBLOCK]><![endif]";if(isIf(currentTo)&&isIf(currentFrom)){let nestedIfCount=0,fromBlockStart=currentFrom;for(;currentFrom;){let next=getNextSibling(from,currentFrom);if(isIf(next))nestedIfCount++;else if(isEnd(next)&&nestedIfCount>0)nestedIfCount--;else if(isEnd(next)&&nestedIfCount===0){currentFrom=next;break}currentFrom=next}let fromBlockEnd=currentFrom;nestedIfCount=0;let toBlockStart=currentTo;for(;currentTo;){let next=getNextSibling(to,currentTo);if(isIf(next))nestedIfCount++;else if(isEnd(next)&&nestedIfCount>0)nestedIfCount--;else if(isEnd(next)&&nestedIfCount===0){currentTo=next;break}currentTo=next}let toBlockEnd=currentTo,fromBlock=new Block(fromBlockStart,fromBlockEnd),toBlock=new Block(toBlockStart,toBlockEnd);context.patchChildren(fromBlock,toBlock);continue}if(currentFrom.nodeType===1&&context.lookahead&&!currentFrom.isEqualNode(currentTo)){let nextToElementSibling=getNextSibling(to,currentTo),found=!1;for(;!found&&nextToElementSibling;)nextToElementSibling.nodeType===1&&currentFrom.isEqualNode(nextToElementSibling)&&(found=!0,currentFrom=context.addNodeBefore(from,currentTo,currentFrom),fromKey=context.getKey(currentFrom)),nextToElementSibling=getNextSibling(to,nextToElementSibling)}if(toKey!==fromKey){if(!toKey&&fromKey){fromKeyHoldovers[fromKey]=currentFrom,currentFrom=context.addNodeBefore(from,currentTo,currentFrom),fromKeyHoldovers[fromKey].remove(),currentFrom=getNextSibling(from,currentFrom),currentTo=getNextSibling(to,currentTo);continue}if(toKey&&!fromKey&&fromKeys[toKey]&&(currentFrom.replaceWith(fromKeys[toKey]),currentFrom=fromKeys[toKey],fromKey=context.getKey(currentFrom)),toKey&&fromKey){let fromKeyNode=fromKeys[toKey];if(fromKeyNode)fromKeyHoldovers[fromKey]=currentFrom,currentFrom.replaceWith(fromKeyNode),currentFrom=fromKeyNode,fromKey=context.getKey(currentFrom);else{fromKeyHoldovers[fromKey]=currentFrom,currentFrom=context.addNodeBefore(from,currentTo,currentFrom),fromKeyHoldovers[fromKey].remove(),currentFrom=getNextSibling(from,currentFrom),currentTo=getNextSibling(to,currentTo);continue}}}let currentFromNext=currentFrom&&getNextSibling(from,currentFrom);context.patch(currentFrom,currentTo),currentTo=currentTo&&getNextSibling(to,currentTo),currentFrom=currentFromNext}let removals=[];for(;currentFrom;)shouldSkip(context.removing,currentFrom)||removals.push(currentFrom),currentFrom=getNextSibling(from,currentFrom);for(;removals.length;){let domForRemoval=removals.shift();domForRemoval.remove(),context.removed(domForRemoval)}},context.getKey=function(el){return el&&el.nodeType===1&&context.key(el)},context.keyToMap=function(els){let map={};for(let el of els){let theKey=context.getKey(el);
56theKey&&(map[theKey]=el)}return map},context.addNodeBefore=function(parent,node,beforeMe){if(!shouldSkip(context.adding,node)){let clone2=node.cloneNode(!0);return parent.insertBefore(clone2,beforeMe),context.added(clone2),clone2}return node},context}morph$1.step=()=>{},morph$1.log=()=>{};function shouldSkip(hook,...args){let skip=!1;return hook(...args,()=>skip=!0),skip}function shouldSkipChildren(hook,skipChildren,skipUntil,...args){let skip=!1;return hook(...args,()=>skip=!0,skipChildren,skipUntil),skip}var patched=!1;function createElement(html){const template2=document.createElement("template");return template2.innerHTML=html,template2.content.firstElementChild}function textOrComment(el){return el.nodeType===3||el.nodeType===8}var Block=class{get children(){let children=[],currentNode=this.startComment.nextSibling;for(;currentNode&&currentNode!==this.endComment;)children.push(currentNode),currentNode=currentNode.nextSibling;return children}appendChild(child){this.endComment.before(child)}get firstChild(){let first=this.startComment.nextSibling;if(first!==this.endComment)return first}nextNode(reference){let next=reference.nextSibling;if(next!==this.endComment)return next}insertBefore(newNode,reference){return reference.before(newNode),newNode}constructor(start2,end){this.startComment=start2,this.endComment=end}};function getFirstNode(parent){return parent.firstChild}function getNextSibling(parent,reference){let next;return parent instanceof Block?next=parent.nextNode(reference):next=reference.nextSibling,next}function monkeyPatchDomSetAttributeToAllowAtSymbols(){if(patched)return;patched=!0;let original=Element.prototype.setAttribute,hostDiv=document.createElement("div");Element.prototype.setAttribute=function(name,value){if(!name.includes("@"))return original.call(this,name,value);hostDiv.innerHTML=`<span ${name}="${value}"></span>`;let attr=hostDiv.firstElementChild.getAttributeNode(name);hostDiv.firstElementChild.removeAttributeNode(attr),this.setAttributeNode(attr)}}function seedingMatchingId(to,from){let fromId=from&&from._x_bindings&&from._x_bindings.id;fromId&&to.setAttribute&&(to.setAttribute("id",fromId),to.id=fromId)}function src_default$1(Alpine2){Alpine2.morph=morph$1,Alpine2.morphBetween=morphBetween}var module_default$1=src_default$1,flushPending=!1,flushing=!1,queue=[],lastFlushedIndex=-1;function scheduler(callback){queueJob(callback)}function queueJob(job){queue.includes(job)||queue.push(job),queueFlush()}function dequeueJob(job){let index=queue.indexOf(job);index!==-1&&index>lastFlushedIndex&&queue.splice(index,1)}function queueFlush(){!flushing&&!flushPending&&(flushPending=!0,queueMicrotask(flushJobs))}function flushJobs(){flushPending=!1,flushing=!0;for(let i=0;i<queue.length;i++)queue[i](),lastFlushedIndex=i;queue.length=0,lastFlushedIndex=-1,flushing=!1}var reactive,effect,release,raw,shouldSchedule=!0;function disableEffectScheduling(callback){shouldSchedule=!1,callback(),shouldSchedule=!0}function setReactivityEngine(engine){reactive=engine.reactive,release=engine.release,effect=callback=>engine.effect(callback,{scheduler:task=>{shouldSchedule?scheduler(task):task()}}),raw=engine.raw}function overrideEffect(override){effect=override}function elementBoundEffect(el){let cleanup2=()=>{};return[callback=>{let effectReference=effect(callback);return el._x_effects||(el._x_effects=new Set,el._x_runEffects=()=>{el._x_effects.forEach(i=>i())}),el._x_effects.add(effectReference),cleanup2=()=>{effectReference!==void 0&&(el._x_effects.delete(effectReference),release(effectReference))},effectReference},()=>{cleanup2()}]}function watch(getter,callback){let firstTime=!0,oldValue,effectReference=effect(()=>{let value=getter();JSON.stringify(value),firstTime?oldValue=value:queueMicrotask(()=>{callback(value,oldValue),oldValue=value}),firstTime=!1});return()=>release(effectReference)}var onAttributeAddeds=[],onElRemoveds=[],onElAddeds=[];function onElAdded(callback){onElAddeds.push(callback)}function onElRemoved(el,callback){typeof callback=="function"?(el._x_cleanups||(el._x_cleanups=[]),el._x_cleanups.push(callback)):(callback=el,onElRemoveds.push(callback))}function onAttributesAdded(callback){onAttributeAddeds.push(callback)}function onAttributeRemoved(el,name,callback){el._x_attributeCleanups||(el._x_attributeCleanups={}),el._x_attributeCleanups[name]||(el._x_attributeCleanups[name]=[]),el._x_attributeCleanups[name].push(callback)}function cleanupAttributes(el,names){el._x_attributeCleanups&&Object.entries(el._x_attributeCleanups).forEac
56h(([name,value])=>{(names===void 0||names.includes(name))&&(value.forEach(i=>i()),delete el._x_attributeCleanups[name])})}function cleanupElement(el){var ref2,ref1;for((ref2=el._x_effects)===null||ref2===void 0||ref2.forEach(dequeueJob);!((ref1=el._x_cleanups)===null||ref1===void 0)&&ref1.length;)el._x_cleanups.pop()()}var observer$1=new MutationObserver(onMutate),currentlyObserving=!1;function startObservingMutations(){observer$1.observe(document,{subtree:!0,childList:!0,attributes:!0,attributeOldValue:!0}),currentlyObserving=!0}function stopObservingMutations(){flushObserver(),observer$1.disconnect(),currentlyObserving=!1}var queuedMutations=[];function flushObserver(){let records=observer$1.takeRecords();queuedMutations.push(()=>records.length>0&&onMutate(records));let queueLengthWhenTriggered=queuedMutations.length;queueMicrotask(()=>{if(queuedMutations.length===queueLengthWhenTriggered)for(;queuedMutations.length>0;)queuedMutations.shift()()})}function mutateDom(callback){if(!currentlyObserving)return callback();stopObservingMutations();let result=callback();return startObservingMutations(),result}var isCollecting=!1,deferredMutations=[];function deferMutations(){isCollecting=!0}function flushAndStopDeferringMutations(){isCollecting=!1,onMutate(deferredMutations),deferredMutations=[]}function onMutate(mutations){if(isCollecting){deferredMutations=deferredMutations.concat(mutations);return}let addedNodes=[],removedNodes=new Set,addedAttributes=new Map,removedAttributes=new Map;for(let i1=0;i1<mutations.length;i1++)if(!mutations[i1].target._x_ignoreMutationObserver&&(mutations[i1].type==="childList"&&(mutations[i1].removedNodes.forEach(node=>{node.nodeType===1&&node._x_marker&&removedNodes.add(node)}),mutations[i1].addedNodes.forEach(node=>{if(node.nodeType===1){if(removedNodes.has(node)){removedNodes.delete(node);return}node._x_marker||addedNodes.push(node)}})),mutations[i1].type==="attributes")){let el=mutations[i1].target,name=mutations[i1].attributeName,oldValue=mutations[i1].oldValue,add2=()=>{addedAttributes.has(el)||addedAttributes.set(el,[]),addedAttributes.get(el).push({name,value:el.getAttribute(name)})},remove=()=>{removedAttributes.has(el)||removedAttributes.set(el,[]),removedAttributes.get(el).push(name)};el.hasAttribute(name)&&oldValue===null?add2():el.hasAttribute(name)?(remove(),add2()):remove()}removedAttributes.forEach((attrs,el)=>{cleanupAttributes(el,attrs)}),addedAttributes.forEach((attrs,el)=>{onAttributeAddeds.forEach(i=>i(el,attrs))});for(let node2 of removedNodes)addedNodes.some(i=>i.contains(node2))||onElRemoveds.forEach(i=>i(node2));for(let node1 of addedNodes)node1.isConnected&&onElAddeds.forEach(i=>i(node1));addedNodes=null,removedNodes=null,addedAttributes=null,removedAttributes=null}function scope(node){return mergeProxies(closestDataStack(node))}function addScopeToNode(node,data2,referenceNode){return node._x_dataStack=[data2,...closestDataStack(referenceNode||node)],()=>{node._x_dataStack=node._x_dataStack.filter(i=>i!==data2)}}function closestDataStack(node){return node._x_dataStack?node._x_dataStack:typeof ShadowRoot=="function"&&node instanceof ShadowRoot?closestDataStack(node.host):node.parentNode?closestDataStack(node.parentNode):[]}function mergeProxies(objects){return new Proxy({objects},mergeProxyTrap)}var mergeProxyTrap={ownKeys({objects}){return Array.from(new Set(objects.flatMap(i=>Object.keys(i))))},has({objects},name){return name==Symbol.unscopables?!1:objects.some(obj=>Object.prototype.hasOwnProperty.call(obj,name)||Reflect.has(obj,name))},get({objects},name,thisProxy){return name=="toJSON"?collapseProxies:Reflect.get(objects.find(obj=>Reflect.has(obj,name))||{},name,thisProxy)},set({objects},name,value,thisProxy){const target=objects.find(obj=>Object.prototype.hasOwnProperty.call(obj,name))||objects[objects.length-1],descriptor=Object.getOwnPropertyDescriptor(target,name);return descriptor?.set&&descriptor?.get?descriptor.set.call(thisProxy,value)||!0:Reflect.set(target,name,value)}};function collapseProxies(){return Reflect.ownKeys(this).reduce((acc,key)=>(acc[key]=Reflect.get(this,key),acc),{})}function initInterceptors(data2){let isObject2=val=>typeof val=="object"&&!Array.isArray(val)&&val!==null,recurse=(obj,basePath="")=>
vendor: 4,390 bytes, lines 56-60
56{Object.entries(Object.getOwnPropertyDescriptors(obj)).forEach(([key,{value,enumerable}])=>{if(enumerable===!1||value===void 0||typeof value=="object"&&value!==null&&value.__v_skip)return;let path=basePath===""?key:`${basePath}.${key}`;typeof value=="object"&&value!==null&&value._x_interceptor?obj[key]=value.initialize(data2,path,key):isObject2(value)&&value!==obj&&!(value instanceof Element)&&recurse(value,path)})};return recurse(data2)}function interceptor(callback,mutateObj=()=>{}){let obj={initialValue:void 0,_x_interceptor:!0,initialize(data2,path,key){return callback(this.initialValue,()=>get(data2,path),value=>set(data2,path,value),path,key)}};return mutateObj(obj),initialValue=>{if(typeof initialValue=="object"&&initialValue!==null&&initialValue._x_interceptor){let initialize=obj.initialize.bind(obj);obj.initialize=(data2,path,key)=>{let innerValue=initialValue.initialize(data2,path,key);return obj.initialValue=innerValue,initialize(data2,path,key)}}else obj.initialValue=initialValue;return obj}}function get(obj,path){return path.split(".").reduce((carry,segment)=>carry[segment],obj)}function set(obj,path,value){if(typeof path=="string"&&(path=path.split(".")),path.length===1)obj[path[0]]=value;else{if(path.length===0)throw error;return obj[path[0]]||(obj[path[0]]={}),set(obj[path[0]],path.slice(1),value)}}var magics={};function magic(name,callback){magics[name]=callback}function injectMagics(obj,el){let memoizedUtilities=getUtilities(el);return Object.entries(magics).forEach(([name,callback])=>{Object.defineProperty(obj,`$${name}`,{get(){return callback(el,memoizedUtilities)},enumerable:!1})}),obj}function getUtilities(el){let[utilities,cleanup2]=getElementBoundUtilities(el),utils={interceptor,...utilities};return onElRemoved(el,cleanup2),utils}function tryCatch(el,expression,callback,...args){try{return callback(...args)}catch(e){handleError(e,el,expression)}}function handleError(...args){return errorHandler(...args)}var errorHandler=normalErrorHandler;function setErrorHandler(handler4){errorHandler=handler4}function normalErrorHandler(error2,el,expression=void 0){error2=Object.assign(error2??{message:"No error message given."},{el,expression}),console.warn(`Alpine Expression Error: ${error2.message}
57
58${expression?'Expression: "'+expression+`"
59
60`:""}`,el),setTimeout(()=>{throw error2},0)}var shouldAutoEvaluateFunctions=!0;function dontAutoEvaluateFunctions(callback){let cache2=shouldAutoEvaluateFunctions;shouldAutoEvaluateFunctions=!1;let result=callback();return shouldAutoEvaluateFunctions=cache2,result}function evaluate(el,expression,extras={}){let result;return evaluateLater(el,expression)(value=>result=value,extras),result}function evaluateLater(...args){return theEvaluatorFunction(...args)}var theEvaluatorFunction=normalEvaluator;function setEvaluator(newEvaluator){theEvaluatorFunction=newEvaluator}function normalEvaluator(el,expression){let overriddenMagics={};injectMagics(overriddenMagics,el);let dataStack=[overriddenMagics,...closestDataStack(el)],evaluator=typeof expression=="function"?generateEvaluatorFromFunction(dataStack,expression):generateEvaluatorFromString(dataStack,expression,el);return tryCatch.bind(null,el,expression,evaluator)}function generateEvaluatorFromFunction(dataStack,func){return(receiver=()=>{},{scope:scope2={},params=[],context}={})=>{let result=func.apply(mergeProxies([scope2,...dataStack]),params);runIfTypeOfFunction(receiver,result)}}var evaluatorMemo={};function generateFunctionFromString(expression,el){if(evaluatorMemo[expression])return evaluatorMemo[expression];let AsyncFunction=Object.getPrototypeOf(async function(){}).constructor,rightSideSafeExpression=/^[\n\s]*if.*\(.*\)/.test(expression.trim())||/^(let|const)\s/.test(expression.trim())?`(async()=>{ ${expression} })()`:expression,func=(()=>{try{let func2=new AsyncFunction(["__self","scope"],`with (scope) { __self.result = ${rightSideSafeExpression} }; __self.finished = true; return __self.result;`);return Object.defineProperty(func2,"name",{value:`[Alpine] ${expression}`}),func2}catch(error2){return handleError(error2,el,expression),Promise.resolve()}})();return evaluatorMemo[expression]=func,func}function generateEvaluatorFromString(dataStack,expression,el){let func=generateFunctionFromString(expression,el);return(receiver=()=>{},{scope:scope2={},params=[],context}={})=>{func.result=void 0,func.finished=!1;
60let completeScope=mergeProxies([scope2,...dataStack]);if(typeof func=="function"){let promise=func.call(context,func,completeScope).catch(error2=>handleError(error2,el,expression));func.finished?(runIfTypeOfFunction(receiver,func.result,completeScope,params,el),func.result=void 0):promise.then(result=>{runIfTypeOfFunction(receiver,result,completeScope,params,el)}).catch(error2=>handleError(error2,el,expression)).finally(()=>func.result=void 0)}}}function runIfTypeOfFunction(receiver,value,scope2,params,el){if(shouldAutoEvaluateFunctions&&typeof value=="function"){let result=value.apply(scope2,params);result instanceof Promise?result.then(i=>runIfTypeOfFunction(receiver,i,scope2,params)).catch(error2=>handleError(error2,el,value)):receiver(result)}else typeof value=="object"&&value instanceof Promise?value.then(i=>receiver(i)):receiver(value)}var prefixAsString="x-";function prefix(subject=""){return prefixAsString+subject}function setPrefix(newPrefix){prefixAsString=newPrefix}var directiveHandlers={};function directive(name,callback){return directiveHandlers[name]=callback,{before(directive2){if(!directiveHandlers[directive2]){console.warn(String.raw`Cannot find directive \`${directive2}\`. \`${name}\` will use the default order of execution`);return}const pos=directiveOrder.indexOf(directive2);directiveOrder.splice(pos>=0?pos:directiveOrder.indexOf("DEFAULT"),0,name)}}}function directiveExists(name){return Object.keys(directiveHandlers).includes(name)}function directives(el,attributes2,originalAttributeOverride){if(attributes2=Array.from(attributes2),el._x_virtualDirectives){let vAttributes=Object.entries(el._x_virtualDirectives).map(([name,value])=>({name,value})),staticAttributes=attributesOnly(vAttributes);vAttributes=vAttributes.map(attribute=>staticAttributes.find(attr=>attr.name===attribute.name)?{name:`x-bind:${attribute.name}`,value:`"${attribute.value}"`}:attribute),attributes2=attributes2.concat(vAttributes)}let transformedAttributeMap={};return attributes2.map(toTransformedAttributes((newName,oldName)=>transformedAttributeMap[newName]=oldName)).filter(outNonAlpineAttributes).map(toParsedDirectives(transformedAttributeMap,originalAttributeOverride)).sort(byPriority).map(directive2=>getDirectiveHandler(el,directive2))}function attributesOnly(attributes2){return Array.from(attributes2).map(toTransformedAttributes()).filter(attr=>!outNonAlpineAttributes(attr))}var isDeferringHandlers=!1,directiveHandlerStacks=new Map,currentHandlerStackKey=Symbol();function deferHandlingDirectives(callback){isDeferringHandlers=!0;let key=Symbol();currentHandlerStackKey=key,directiveHandlerStacks.set(key,[]);let flushHandlers=()=>{for(;directiveHandlerStacks.get(key).length;)directiveHandlerStacks.get(key).shift()();directiveHandlerStacks.delete(key)},stopDeferring=()=>{isDeferringHandlers=!1,flushHandlers()};callback(flushHandlers),stopDeferring()}function getElementBoundUtilities(el){let cleanups=[],cleanup2=callback=>cleanups.push(callback),[effect3,cleanupEffect]=elementBoundEffect(el);return cleanups.push(cleanupEffect),[{Alpine:alpine_default,effect:effect3,cleanup:cleanup2,evaluateLater:evaluateLater.bind(evaluateLater,el),evaluate:evaluate.bind(evaluate,el)},()=>cleanups.forEach(i=>i())]}function getDirectiveHandler(el,directive2){let noop2=()=>{},handler4=directiveHandlers[directive2.type]||noop2,[utilities,cleanup2]=getElementBoundUtilities(el);onAttributeRemoved(el,directive2.original,cleanup2);let fullHandler=()=>{el._x_ignore||el._x_ignoreSelf||(handler4.inline&&handler4.inline(el,directive2,utilities),handler4=handler4.bind(handler4,el,directive2,utilities),isDeferringHandlers?directiveHandlerStacks.get(currentHandlerStackKey).push(handler4):handler4())};return fullHandler.runCleanups=cleanup2,fullHandler}var startingWith=(subject,replacement)=>({name,value})=>(name.startsWith(subject)&&(name=name.replace(subject,replacement)),{name,value}),into=i=>i;function toTransformedAttributes(callback=()=>{}){return({name,value})=>{let{name:newName,value:newValue}=attributeTransformers.reduce((carry,transform2)=>transform2(carry),{name,value});return newName!==name&&callback(newName,name),{name:newName,value:newValue}}}var attributeTransformers=[];function mapAttributes(callback){attributeTransformers.push(callback)}function outNonAlpineAttributes({name}){return alpineAttributeRegex().test(name)}var alpineAttributeRegex=()=>new RegExp(`^${prefixAsString}([^:^.]+)\\b`);function toParsedDirectives(transformedAttributeMap,originalAttributeOverride){return({name,value})=>{let typeMatch=name.match(alpineAttributeRegex()),valueMatch=name.match(/:([a-zA-Z0-9\-_:]+)/),modifiers=name.match(/\.[^.\]]+(?=[^\]]*$)/g)||[],original=originalAttributeOverride||transformedAttributeMap[name]||name;return{type:typeMatch?typeMatch[1]:null,value:valueMatch?valueMatch[1]:null,modifiers:modifiers.map(i=>i.replace(".","")),expression:value,original}}}var DEFAULT="DEFAULT",directiveOrder=["ignore","ref","data","id","anchor","bind","init","for","model","modelable","transition","show","if",DEFAULT,"teleport"];function byPriority(a,b){let typeA=directiveOrder.indexOf(a.type)===-1?DEFAULT:a.type,typeB=directiveOrder.indexOf(b.type)===-1?DEFAULT:b.type;return directiveOrder.indexOf(typeA)-directiveOrder.indexOf(typeB)}function dispatch(el,name,detail={}){el.dispatchEvent(new CustomEvent(name,{detail,bubbles:!0,composed:!0,cancelable:!0}))}function walk(el,callback){if(typeof ShadowRoot=="function"&&el instanceof ShadowRoot){Array.from(el.children).forEac
vendor: 12,628 bytes, line 60
60h(el2=>walk(el2,callback));return}let skip=!1;if(callback(el,()=>skip=!0),skip)return;let node=el.firstElementChild;for(;node;)walk(node,callback),node=node.nextElementSibling}function warn(message,...args){console.warn(`Alpine Warning: ${message}`,...args)}var started=!1;function start(){started&&warn("Alpine has already been initialized on this page. Calling Alpine.start() more than once can cause problems."),started=!0,document.body||warn("Unable to initialize. Trying to load Alpine before `<body>` is available. Did you forget to add `defer` in Alpine's `<script>` tag?"),dispatch(document,"alpine:init"),dispatch(document,"alpine:initializing"),startObservingMutations(),onElAdded(el=>initTree(el,walk)),onElRemoved(el=>destroyTree(el)),onAttributesAdded((el,attrs)=>{directives(el,attrs).forEach(handle=>handle())});let outNestedComponents=el=>!closestRoot(el.parentElement,!0);Array.from(document.querySelectorAll(allSelectors().join(","))).filter(outNestedComponents).forEach(el=>{initTree(el)}),dispatch(document,"alpine:initialized"),setTimeout(()=>{warnAboutMissingPlugins()})}var rootSelectorCallbacks=[],initSelectorCallbacks=[];function rootSelectors(){return rootSelectorCallbacks.map(fn=>fn())}function allSelectors(){return rootSelectorCallbacks.concat(initSelectorCallbacks).map(fn=>fn())}function addRootSelector(selectorCallback){rootSelectorCallbacks.push(selectorCallback)}function addInitSelector(selectorCallback){initSelectorCallbacks.push(selectorCallback)}function closestRoot(el,includeInitSelectors=!1){return findClosest(el,element=>{if((includeInitSelectors?allSelectors():rootSelectors()).some(selector=>element.matches(selector)))return!0})}function findClosest(el,callback){if(el){if(callback(el))return el;if(el._x_teleportBack&&(el=el._x_teleportBack),!!el.parentElement)return findClosest(el.parentElement,callback)}}function isRoot(el){return rootSelectors().some(selector=>el.matches(selector))}var initInterceptors2=[];function interceptInit(callback){initInterceptors2.push(callback)}var markerDispenser=1;function initTree(el,walker=walk,intercept=()=>{}){findClosest(el,i=>i._x_ignore)||deferHandlingDirectives(()=>{walker(el,(el2,skip)=>{el2._x_marker||(intercept(el2,skip),initInterceptors2.forEach(i=>i(el2,skip)),directives(el2,el2.attributes).forEach(handle=>handle()),el2._x_ignore||(el2._x_marker=markerDispenser++),el2._x_ignore&&skip())})})}function destroyTree(root,walker=walk){walker(root,el=>{cleanupElement(el),cleanupAttributes(el),delete el._x_marker})}function warnAboutMissingPlugins(){[["ui","dialog",["[x-dialog], [x-popover]"]],["anchor","anchor",["[x-anchor]"]],["sort","sort",["[x-sort]"]]].forEach(([plugin2,directive2,selectors2])=>{directiveExists(directive2)||selectors2.some(selector=>{if(document.querySelector(selector))return warn(`found "${selector}", but missing ${plugin2} plugin`),!0})})}var tickStack=[],isHolding=!1;function nextTick(callback=()=>{}){return queueMicrotask(()=>{isHolding||setTimeout(()=>{releaseNextTicks()})}),new Promise(res=>{tickStack.push(()=>{callback(),res()})})}function releaseNextTicks(){for(isHolding=!1;tickStack.length;)tickStack.shift()()}function holdNextTicks(){isHolding=!0}function setClasses(el,value){return Array.isArray(value)?setClassesFromString(el,value.join(" ")):typeof value=="object"&&value!==null?setClassesFromObject(el,value):typeof value=="function"?setClasses(el,value()):setClassesFromString(el,value)}function setClassesFromString(el,classString){let missingClasses=classString2=>classString2.split(" ").filter(i=>!el.classList.contains(i)).filter(Boolean),addClassesAndReturnUndo=classes2=>(el.classList.add(...classes2),()=>{el.classList.remove(...classes2)});return classString=classString===!0?classString="":classString||"",addClassesAndReturnUndo(missingClasses(classString))}function setClassesFromObject(el,classObject){let split=classString=>classString.split(" ").filter(Boolean),forAdd=Object.entries(classObject).flatMap(([classString,bool])=>bool?split(classString):!1).filter(Boolean),forRemove=Object.entries(classObject).flatMap(([classString,bool])=>bool?!1:split(classString)).filter(Boolean),added=[],removed=[];return forRemove.forEach(i=>{el.classList.contains(i)&&(el.classList.remove(i),removed.push(i))}),forAdd.forEach(i=>{el.classList.contains(i)||(el.classList.add(i),added.push(i))}),()=>{removed.forEach(i=>el.classList.add(i)),added.forEach(i=>el.classList.remove(i))}}function setStyles(el,value){return typeof value=="object"&&value!==null?setStylesFromObject(el,value):setStylesFromString(el,value)}function setStylesFromObject(el,value){let previousStyles={};return Object.entries(value).forEach(([key,value2])=>{previousStyles[key]=el.style[key],key.startsWith("--")||(key=kebabCase(key)),el.style.setProperty(key,value2)}),setTimeout(()=>{el.style.length===0&&el.removeAttribute("style")}),()=>{setStyles(el,previousStyles)}}function setStylesFromString(el,value){let cache2=el.getAttribute("style",value);return el.setAttribute("style",value),()=>{el.setAttribute("style",cache2||"")}}function kebabCase(subject){return subject.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function once(callback,fallback=()=>{}){let called=!1;return function(){called?fallback.apply(this,arguments):(called=!0,callback.apply(this,arguments))}}directive("transition",(el,{value,modifiers,expression},{evaluate:evaluate2})=>{typeof expression=="function"&&(expression=evaluate2(expression)),expression!==!1&&(!expression||typeof expression=="boolean"?registerTransitionsFromHelper(el,modifiers,value):registerTransitionsFromClassString(el,expression,value))});function registerTransitionsFromClassString(el,classString,stage){registerTransitionObject(el,setClasses,""),{enter:classes2=>{el._x_transition.enter.during=classes2},"enter-start":classes2=>{el._x_transition.enter.start=classes2},"enter-end":classes2=>{el._x_transition.enter.end=classes2},leave:classes2=>{el._x_transition.leave.during=classes2},"leave-start":classes2=>{el._x_transition.leave.start=classes2},"leave-end":classes2=>{el._x_transition.leave.end=classes2}}[stage](classString)}function registerTransitionsFromHelper(el,modifiers,stage){registerTransitionObject(el,setStyles);let doesntSpecify=!modifiers.includes("in")&&!modifiers.includes("out")&&!stage,transitioningIn=doesntSpecify||modifiers.includes("in")||["enter"].includes(stage),transitioningOut=doesntSpecify||modifiers.includes("out")||["leave"].includes(stage);modifiers.includes("in")&&!doesntSpecify&&(modifiers=modifiers.filter((i,index)=>index<modifiers.indexOf("out"))),modifiers.includes("out")&&!doesntSpecify&&(modifiers=modifiers.filter((i,index)=>index>modifiers.indexOf("out")));let wantsAll=!modifiers.includes("opacity")&&!modifiers.includes("scale"),wantsOpacity=wantsAll||modifiers.includes("opacity"),wantsScale=wantsAll||modifiers.includes("scale"),opacityValue=wantsOpacity?0:1,scaleValue=wantsScale?modifierValue(modifiers,"scale",95)/100:1,delay2=modifierValue(modifiers,"delay",0)/1e3,origin=modifierValue(modifiers,"origin","center"),property="opacity, transform",durationIn=modifierValue(modifiers,"duration",150)/1e3,durationOut=modifierValue(modifiers,"duration",75)/1e3,easing="cubic-bezier(0.4, 0.0, 0.2, 1)";transitioningIn&&(el._x_transition.enter.during={transformOrigin:origin,transitionDelay:`${delay2}s`,transitionProperty:property,transitionDuration:`${durationIn}s`,transitionTimingFunction:easing},el._x_transition.enter.start={opacity:opacityValue,transform:`scale(${scaleValue})`},el._x_transition.enter.end={opacity:1,transform:"scale(1)"}),transitioningOut&&(el._x_transition.leave.during={transformOrigin:origin,transitionDelay:`${delay2}s`,transitionProperty:property,transitionDuration:`${durationOut}s`,transitionTimingFunction:easing},el._x_transition.leave.start={opacity:1,transform:"scale(1)"},el._x_transition.leave.end={opacity:opacityValue,transform:`scale(${scaleValue})`})}function registerTransitionObject(el,setFunction,defaultValue={}){el._x_transition||(el._x_transition={enter:{during:defaultValue,start:defaultValue,end:defaultValue},leave:{during:defaultValue,start:defaultValue,end:defaultValue},in(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.enter.during,start:this.enter.start,end:this.enter.end},before,after)},out(before=()=>{},after=()=>{}){transition(el,setFunction,{during:this.leave.during,start:this.leave.start,end:this.leave.end},before,after)}})}window.Element.prototype._x_toggleAndCascadeWithTransitions=function(el,value,show,hide){const nextTick2=document.visibilityState==="visible"?requestAnimationFrame:setTimeout;let clickAwayCompatibleShow=()=>nextTick2(show);if(value){el._x_transition&&(el._x_transition.enter||el._x_transition.leave)?el._x_transition.enter&&(Object.entries(el._x_transition.enter.during).length||Object.entries(el._x_transition.enter.start).length||Object.entries(el._x_transition.enter.end).length)?el._x_transition.in(show):clickAwayCompatibleShow():el._x_transition?el._x_transition.in(show):clickAwayCompatibleShow();return}el._x_hidePromise=el._x_transition?new Promise((resolve,reject)=>{el._x_transition.out(()=>{},()=>resolve(hide)),el._x_transitioning&&el._x_transitioning.beforeCancel(()=>reject({isFromCancelledTransition:!0}))}):Promise.resolve(hide),queueMicrotask(()=>{let closest=closestHide(el);closest?(closest._x_hideChildren||(closest._x_hideChildren=[]),closest._x_hideChildren.push(el)):nextTick2(()=>{let hideAfterChildren=el2=>{let carry=Promise.all([el2._x_hidePromise,...(el2._x_hideChildren||[]).map(hideAfterChildren)]).then(([i])=>i?.());return delete el2._x_hidePromise,delete el2._x_hideChildren,carry};hideAfterChildren(el).catch(e=>{if(!e.isFromCancelledTransition)throw e})})})};function closestHide(el){let parent=el.parentNode;if(parent)return parent._x_hidePromise?parent:closestHide(parent)}function transition(el,setFunction,{during,start:start2,end}={},before=()=>{},after=()=>{}){if(el._x_transitioning&&el._x_transitioning.cancel(),Object.keys(during).length===0&&Object.keys(start2).length===0&&Object.keys(end).length===0){before(),after();return}let undoStart,undoDuring,undoEnd;performTransition(el,{start(){undoStart=setFunction(el,start2)},during(){undoDuring=setFunction(el,during)},before,end(){undoStart(),undoEnd=setFunction(el,end)},after,cleanup(){undoDuring(),undoEnd()}})}function performTransition(el,stages){let interrupted,reachedBefore,reachedEnd,finish=once(()=>{mutateDom(()=>{interrupted=!0,reachedBefore||stages.before(),reachedEnd||(stages.end(),releaseNextTicks()),stages.after(),el.isConnected&&stages.cleanup(),delete el._x_transitioning})});el._x_transitioning={beforeCancels:[],beforeCancel(callback){this.beforeCancels.push(callback)},cancel:once(function(){for(;this.beforeCancels.length;)this.beforeCancels.shift()();finish()}),finish},mutateDom(()=>{stages.start(),stages.during()}),holdNextTicks(),requestAnimationFrame(()=>{if(interrupted)return;let duration=Number(getComputedStyle(el).transitionDuration.replace(/,.*/,"").replace("s",""))*1e3,delay2=Number(getComputedStyle(el).transitionDelay.replace(/,.*/,"").replace("s",""))*1e3;duration===0&&(duration=Number(getComputedStyle(el).animationDuration.replace("s",""))*1e3),mutateDom(()=>{stages.before()}),reachedBefore=!0,requestAnimationFrame(()=>{interrupted||(mutateDom(()=>{stages.end()}),releaseNextTicks(),setTimeout(el._x_transitioning.finish,duration+delay2),reachedEnd=!0)})})}function modifierValue(modifiers,key,fallback){if(modifiers.indexOf(key)===-1)return fallback;const rawValue=modifiers[modifiers.indexOf(key)+1];if(!rawValue||key==="scale"&&isNaN(rawValue))return fallback;if(key==="duration"||key==="delay"){let match=rawValue.match(/([0-9]+)ms/);if(match)return match[1]}return key==="origin"&&["top","right","left","center","bottom"].includes(modifiers[modifiers.indexOf(key)+2])?[rawValue,modifiers[modifiers.indexOf(key)+2]].join(" "):rawValue}var isCloning=!1;function skipDuringClone(callback,fallback=()=>{}){return(...args)=>isCloning?fallback(...args):callback(...args)}function onlyDuringClone(callback){return(...args)=>isCloning&&callback(...args)}var interceptors=[];function interceptClone(callback){interceptors.push(callback)}function cloneNode(from,to){interceptors.forEach(i=>i(from,to)),isCloning=!0,dontRegisterReactiveSideEffects(()=>{initTree(to,(el,callback)=>{callback(el,()=>{})})}),isCloning=!1}var isCloningLegacy=!1;function clone$1(oldEl,newEl){newEl._x_dataStack||(newEl._x_dataStack=oldEl._x_dataStack),isCloning=!0,isCloningLegacy=!0,dontRegisterReactiveSideEffects(()=>{cloneTree(newEl)}),isCloning=!1,isCloningLegacy=!1}
60function cloneTree(el){let hasRunThroughFirstEl=!1;initTree(el,(el2,callback)=>{walk(el2,(el3,skip)=>{if(hasRunThroughFirstEl&&isRoot(el3))return skip();hasRunThroughFirstEl=!0,callback(el3,skip)})})}function dontRegisterReactiveSideEffects(callback){let cache2=effect;overrideEffect((callback2,el)=>{let storedEffect=cache2(callback2);return release(storedEffect),()=>{}}),callback(),overrideEffect(cache2)}function bind(el,name,value,modifiers=[]){switch(el._x_bindings||(el._x_bindings=reactive({})),el._x_bindings[name]=value,name=modifiers.includes("camel")?camelCase(name):name,name){case"value":bindInputValue(el,value);break;case"style":bindStyles(el,value);break;case"class":bindClasses(el,value);break;case"selected":case"checked":bindAttributeAndProperty(el,name,value);break;default:bindAttribute(el,name,value);break}}function bindInputValue(el,value){if(isRadio(el))el.attributes.value===void 0&&(el.value=value),window.fromModel&&(typeof value=="boolean"?el.checked=safeParseBoolean(el.value)===value:el.checked=checkedAttrLooseCompare(el.value,value));else if(isCheckbox(el))Number.isInteger(value)?el.value=value:!Array.isArray(value)&&typeof value!="boolean"&&![null,void 0].includes(value)?el.value=String(value):Array.isArray(value)?el.checked=value.some(val=>checkedAttrLooseCompare(val,el.value)):el.checked=!!value;else if(el.tagName==="SELECT")updateSelect(el,value);else{if(el.value===value)return;el.value=value===void 0?"":value}}function bindClasses(el,value){el._x_undoAddedClasses&&el._x_undoAddedClasses(),el._x_undoAddedClasses=setClasses(el,value)}function bindStyles(el,value){el._x_undoAddedStyles&&el._x_undoAddedStyles(),el._x_undoAddedStyles=setStyles(el,value)}function bindAttributeAndProperty(el,name,value){bindAttribute(el,name,value),setPropertyIfChanged(el,name,value)}
vendor: 4,180 bytes, line 60
60function bindAttribute(el,name,value){[null,void 0,!1].includes(value)&&attributeShouldntBePreservedIfFalsy(name)?el.removeAttribute(name):(isBooleanAttr(name)&&(value=name),setIfChanged(el,name,value))}function setIfChanged(el,attrName,value){el.getAttribute(attrName)!=value&&el.setAttribute(attrName,value)}function setPropertyIfChanged(el,propName,value){el[propName]!==value&&(el[propName]=value)}function updateSelect(el,value){const arrayWrappedValue=[].concat(value).map(value2=>value2+"");Array.from(el.options).forEach(option=>{option.selected=arrayWrappedValue.includes(option.value)})}function camelCase(subject){return subject.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase())}function checkedAttrLooseCompare(valueA,valueB){return valueA==valueB}function safeParseBoolean(rawValue){return[1,"1","true","on","yes",!0].includes(rawValue)?!0:[0,"0","false","off","no",!1].includes(rawValue)?!1:rawValue?!!rawValue:null}var booleanAttributes=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected","shadowrootclonable","shadowrootdelegatesfocus","shadowrootserializable"]);function isBooleanAttr(attrName){return booleanAttributes.has(attrName)}function attributeShouldntBePreservedIfFalsy(name){return!["aria-pressed","aria-checked","aria-expanded","aria-selected"].includes(name)}function getBinding(el,name,fallback){return el._x_bindings&&el._x_bindings[name]!==void 0?el._x_bindings[name]:getAttributeBinding(el,name,fallback)}function extractProp(el,name,fallback,extract=!0){if(el._x_bindings&&el._x_bindings[name]!==void 0)return el._x_bindings[name];if(el._x_inlineBindings&&el._x_inlineBindings[name]!==void 0){let binding=el._x_inlineBindings[name];return binding.extract=extract,dontAutoEvaluateFunctions(()=>evaluate(el,binding.expression))}return getAttributeBinding(el,name,fallback)}function getAttributeBinding(el,name,fallback){let attr=el.getAttribute(name);return attr===null?typeof fallback=="function"?fallback():fallback:attr===""?!0:isBooleanAttr(name)?!![name,"true"].includes(attr):attr}function isCheckbox(el){return el.type==="checkbox"||el.localName==="ui-checkbox"||el.localName==="ui-switch"}function isRadio(el){return el.type==="radio"||el.localName==="ui-radio"}function debounce(func,wait){let timeout;return function(){const context=this,args=arguments,later=function(){timeout=null,func.apply(context,args)};clearTimeout(timeout),timeout=setTimeout(later,wait)}}function throttle(func,limit){let inThrottle;return function(){let context=this,args=arguments;inThrottle||(func.apply(context,args),inThrottle=!0,setTimeout(()=>inThrottle=!1,limit))}}function entangle({get:outerGet,set:outerSet},{get:innerGet,set:innerSet}){let firstRun=!0,outerHash,reference=effect(()=>{let outer=outerGet(),inner=innerGet();if(firstRun)innerSet(cloneIfObject(outer)),firstRun=!1;else{let outerHashLatest=JSON.stringify(outer),innerHashLatest=JSON.stringify(inner);outerHashLatest!==outerHash?innerSet(cloneIfObject(outer)):outerHashLatest!==innerHashLatest&&outerSet(cloneIfObject(inner))}outerHash=JSON.stringify(outerGet()),JSON.stringify(innerGet())});return()=>{release(reference)}}function cloneIfObject(value){return typeof value=="object"?JSON.parse(JSON.stringify(value)):value}function plugin(callback){(Array.isArray(callback)?callback:[callback]).forEach(i=>i(alpine_default))}var stores={},isReactive=!1;function store(name,value){if(isReactive||(stores=reactive(stores),isReactive=!0),value===void 0)return stores[name];stores[name]=value,initInterceptors(stores[name]),typeof value=="object"&&value!==null&&value.hasOwnProperty("init")&&typeof value.init=="function"&&stores[name].init()}function getStores(){return stores}var binds={};function bind2(name,bindings){let getBindings=typeof bindings!="function"?()=>bindings:bindings;return name instanceof Element?applyBindingsObject(name,getBindings()):(binds[name]=getBindings,()=>{})}function injectBindingProviders(obj){return Object.entries(binds).forEac
60h(([name,callback])=>{Object.defineProperty(obj,name,{get(){return(...args)=>callback(...args)}})}),obj}function applyBindingsObject(el,obj,original){let cleanupRunners=[];for(;cleanupRunners.length;)cleanupRunners.pop()();let attributes2=Object.entries(obj).map(([name,value])=>({name,value})),staticAttributes=attributesOnly(attributes2);return attributes2=attributes2.map(attribute=>staticAttributes.find(attr=>attr.name===attribute.name)?{name:`x-bind:${attribute.name}`,value:`"${attribute.value}"`}:attribute),directives(el,attributes2,original).map(handle=>{cleanupRunners.push(handle.runCleanups),handle()}),()=>{for(;cleanupRunners.length;)cleanupRunners.pop()()}}var datas={};function data(name,callback){datas[name]=callback}function injectDataProviders(obj,context){return Object.entries(datas).forEach(([name,callback])=>{Object.defineProperty(obj,name,{get(){return(...args)=>callback.bind(context)(...args)},enumerable:!1})}),obj}var Alpine$1={get reactive(){return reactive},get release(){return release},get effect(){return effect},get raw(){return raw},version:"3.15.2",flushAndStopDeferringMutations,dontAutoEvaluateFunctions,disableEffectScheduling,startObservingMutations,stopObservingMutations,setReactivityEngine,onAttributeRemoved,onAttributesAdded,closestDataStack,skipDuringClone,onlyDuringClone,addRootSelector,addInitSelector,setErrorHandler,interceptClone,addScopeToNode,deferMutations,mapAttributes,evaluateLater,interceptInit,setEvaluator,mergeProxies,extractProp,findClosest,onElRemoved,closestRoot,destroyTree,interceptor,transition,setStyles,mutateDom,directive,entangle,throttle,debounce,evaluate,initTree,nextTick,prefixed:prefix,prefix:setPrefix,plugin,magic,store,start,clone:clone$1,cloneNode,bound:getBinding,$data:scope,watch,walk,data,bind:bind2},alpine_default=Alpine$1;function makeMap(str,expectsLowerCase){const map=Object.create(null),list=str.split(",");for(let i=0;i<list.length;i++)map[list[i]]=!0;return val=>!!map[val]}var EMPTY_OBJ=Object.freeze({}),hasOwnProperty=Object.prototype.hasOwnProperty,hasOwn=(val,key)=>hasOwnProperty.call(val,key),isArray=Array.isArray,isMap=val=>toTypeString(val)==="[object Map]",isString=val=>typeof val=="string",isSymbol=val=>typeof val=="symbol",isObject$1=val=>val!==null&&typeof val=="object",objectToString=Object.prototype.toString,toTypeString=value=>objectToString.call(value),toRawType=value=>toTypeString(value).slice(8,-1),isIntegerKey=key=>isString(key)&&key!=="NaN"&&key[0]!=="-"&&""+parseInt(key,10)===key,cacheStringFunction=fn=>{const cache2=Object.create(null);return str=>cache2[str]||(cache2[str]=fn(str))},capitalize=cacheStringFunction(str=>str.charAt(0).toUpperCase()+str.slice(1)),hasChanged=(value,oldValue)=>value!==oldValue&&(value===value||oldValue===oldValue),targetMap=new WeakMap,effectStack=[],activeEffect,ITERATE_KEY=Symbol("iterate"),MAP_KEY_ITERATE_KEY=Symbol("Map key iterate");function isEffect(fn){return fn&&fn._isEffect===!0}function effect2(fn,options2=EMPTY_OBJ){isEffect(fn)&&(fn=fn.raw);const effect3=createReactiveEffect(fn,options2);return options2.lazy||effect3(),effect3}function stop(effect3){effect3.active&&(cleanup(effect3),effect3.options.onStop&&effect3.options.onStop(),effect3.active=!1)}var uid=0;function createReactiveEffect(fn,options2){const effect3=function(){if(!effect3.active)return fn();if(!effectStack.includes(effect3)){cleanup(effect3);try{return enableTracking(),effectStack.push(effect3),activeEffect=effect3,fn()}finally{effectStack.pop(),resetTracking(),activeEffect=effectStack[effectStack.length-1]}}};return effect3.id=uid++,effect3.allowRecurse=!!options2.allowRecurse,effect3._isEffect=!0,effect3.active=!0,effect3.raw=fn,effect3.deps=[],effect3.options=options2,effect3}function cleanup(effect3){const{deps}=effect3;if(deps.length){for(let i=0;i<deps.length;i++)deps[i].delete(effect3);deps.length=0}}var shouldTrack=!0,trackStack=[];function pauseTracking(){trackStack.push(shouldTrack),shouldTrack=!1}function enableTracking(){trackStack.push(shouldTrack),shouldTrack=!0}function resetTracking(){const last=trackStack.pop();shouldTrack=last===void 0?!0:last}function track(target,type,key){if(!shouldTrack||activeEffect===void 0)return;let depsMap=targetMap.get(target);depsMap||targetMap.set(target,depsMap=new Map);let dep=depsMap.get(key);dep||depsMap.set(key,dep=new Set),dep.has(activeEffect)||(dep.add(activeEffect),activeEffect.deps.push(dep),activeEffect.options.onTrack&&activeEffect.options.onTrack({effect:activeEffect,target,type,key}))}function trigger(target,type,key,newValue,oldValue,oldTarget){const depsMap=targetMap.get(target);if(!depsMap)return;const effects=new Set,add2=effectsToAdd=>
60{effectsToAdd&&effectsToAdd.forEach(effect3=>{(effect3!==activeEffect||effect3.allowRecurse)&&effects.add(effect3)})};if(type==="clear")depsMap.forEach(add2);else if(key==="length"&&isArray(target))depsMap.forEach((dep,key2)=>{(key2==="length"||key2>=newValue)&&add2(dep)});else switch(key!==void 0&&add2(depsMap.get(key)),type){case"add":isArray(target)?isIntegerKey(key)&&add2(depsMap.get("length")):(add2(depsMap.get(ITERATE_KEY)),isMap(target)&&add2(depsMap.get(MAP_KEY_ITERATE_KEY)));break;case"delete":isArray(target)||(add2(depsMap.get(ITERATE_KEY)),isMap(target)&&add2(depsMap.get(MAP_KEY_ITERATE_KEY)));break;case"set":isMap(target)&&add2(depsMap.get(ITERATE_KEY));break}const run=effect3=>{effect3.options.onTrigger&&effect3.options.onTrigger({effect:effect3,target,key,type,newValue,oldValue,oldTarget}),effect3.options.scheduler?effect3.options.scheduler(effect3):effect3()};effects.forEach(run)}var isNonTrackableKeys=makeMap("__proto__,__v_isRef,__isVue"),builtInSymbols=new Set(Object.getOwnPropertyNames(Symbol).map(key=>Symbol[key]).filter(isSymbol)),get2=createGetter(),readonlyGet=createGetter(!0),arrayInstrumentations=createArrayInstrumentations();function createArrayInstrumentations(){const instrumentations={};return["includes","indexOf","lastIndexOf"].forEach(key=>{instrumentations[key]=function(...args){const arr=toRaw(this);for(let i=0,l=this.length;i<l;i++)track(arr,"get",i+"");const res=arr[key](...args);return res===-1||res===!1?arr[key](...args.map(toRaw)):res}}),["push","pop","shift","unshift","splice"].forEach(key=>{instrumentations[key]=function(...args){pauseTracking();const res=toRaw(this)[key].apply(this,args);return resetTracking(),res}}),instrumentations}function createGetter(isReadonly=!1,shallow=!1){return function(target,key,receiver){if(key==="__v_isReactive")return!isReadonly;if(key==="__v_isReadonly")return isReadonly;if(key==="__v_raw"&&receiver===(isReadonly?shallow?shallowReadonlyMap:readonlyMap:shallow?shallowReactiveMap:reactiveMap).get(target))return target;const targetIsArray=isArray(target);if(!isReadonly&&targetIsArray&&hasOwn(arrayInstrumentations,key))return Reflect.get(arrayInstrumentations,key,receiver);const res=Reflect.get(target,key,receiver);return(isSymbol(key)?builtInSymbols.has(key):isNonTrackableKeys(key))||(isReadonly||track(target,"get",key),shallow)?res:isRef(res)?!targetIsArray||!isIntegerKey(key)?res.value:res:isObject$1(res)?isReadonly?readonly(res):reactive2(res):res}}var set2=createSetter();function createSetter(shallow=!1){return function(target,key,value,receiver){let oldValue=target[key];if(!shallow&&(value=toRaw(value),oldValue=toRaw(oldValue),!isArray(target)&&isRef(oldValue)&&!isRef(value)))return oldValue.value=value,!0;const hadKey=isArray(target)&&isIntegerKey(key)?Number(key)<target.length:hasOwn(target,key),result=Reflect.set(target,key,value,receiver);return target===toRaw(receiver)&&(hadKey?hasChanged(value,oldValue)&&trigger(target,"set",key,value,oldValue):trigger(target,"add",key,value)),result}}function deleteProperty(target,key){const hadKey=hasOwn(target,key),oldValue=target[key],result=Reflect.deleteProperty(target,key);return result&&hadKey&&trigger(target,"delete",key,void 0,oldValue),result}function has(target,key){const result=Reflect.has(target,key);return(!isSymbol(key)||!builtInSymbols.has(key))&&track(target,"has",key),result}function ownKeys(target){return track(target,"iterate",isArray(target)?"length":ITERATE_KEY),Reflect.ownKeys(target)}var mutableHandlers={get:get2,set:set2,deleteProperty,has,ownKeys},readonlyHandlers={get:readonlyGet,set(target,key){return console.warn(`Set operation on key "${String(key)}" failed: target is readonly.`,target),!0},deleteProperty(target,key){return console.warn(`Delete operation on key "${String(key)}" failed: target is readonly.`,target),!0}},toReactive=value=>isObject$1(value)?reactive2(value):value,toReadonly=value=>isObject$1(value)?readonly(value):value,toShallow=value=>value,getProto=v=>Reflect.getPrototypeOf(v);function get$1(target,key,isReadonly=!1,isShallow=!1){target=target.__v_raw;const rawTarget=toRaw(target),rawKey=toRaw(key);key!==rawKey&&!isReadonly&&track(rawTarget,"get",key),!isReadonly&&track(rawTarget,"get",rawKey);const{has:has2}=getProto(rawTarget),wrap2=isShallow?toShallow:isReadonly?toReadonly:toReactive;if(has2.call(rawTarget,key))return wrap2(target.get(key));if(has2.call(rawTarget,rawKey))return wrap2(target.get(rawKey));target!==rawTarget&&target.get(key)}function has$1(key,isReadonly=!1){const target=this.__v_raw,rawTarget=toRaw(target),rawKey=toRaw(key);return key!==rawKey&&!isReadonly&&track(rawTarget,"has",key),!isReadonly&&track(rawTarget,"has",rawKey
60),key===rawKey?target.has(key):target.has(key)||target.has(rawKey)}function size(target,isReadonly=!1){return target=target.__v_raw,!isReadonly&&track(toRaw(target),"iterate",ITERATE_KEY),Reflect.get(target,"size",target)}function add(value){value=toRaw(value);const target=toRaw(this);return getProto(target).has.call(target,value)||(target.add(value),trigger(target,"add",value,value)),this}function set$1(key,value){value=toRaw(value);const target=toRaw(this),{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);hadKey?checkIdentityKeys(target,has2,key):(key=toRaw(key),hadKey=has2.call(target,key));const oldValue=get3.call(target,key);return target.set(key,value),hadKey?hasChanged(value,oldValue)&&trigger(target,"set",key,value,oldValue):trigger(target,"add",key,value),this}function deleteEntry(key){const target=toRaw(this),{has:has2,get:get3}=getProto(target);let hadKey=has2.call(target,key);hadKey?checkIdentityKeys(target,has2,key):(key=toRaw(key),hadKey=has2.call(target,key));const oldValue=get3?get3.call(target,key):void 0,result=target.delete(key);return hadKey&&trigger(target,"delete",key,void 0,oldValue),result}function clear(){const target=toRaw(this),hadItems=target.size!==0,oldTarget=isMap(target)?new Map(target):new Set(target),result=target.clear();return hadItems&&trigger(target,"clear",void 0,void 0,oldTarget),result}function createForEach(isReadonly,isShallow){return function(callback,thisArg){const observed=this,target=observed.__v_raw,rawTarget=toRaw(target),wrap2=isShallow?toShallow:isReadonly?toReadonly:toReactive;return!isReadonly&&track(rawTarget,"iterate",ITERATE_KEY),target.forEach((value,key)=>callback.call(thisArg,wrap2(value),wrap2(key),observed))}}function createIterableMethod(method,isReadonly,isShallow){return function(...args){const target=this.__v_raw,rawTarget=toRaw(target),targetIsMap=isMap(rawTarget),isPair=method==="entries"||method===Symbol.iterator&&targetIsMap,isKeyOnly=method==="keys"&&targetIsMap,innerIterator=target[method](...args),wrap2=isShallow?toShallow:isReadonly?toReadonly:toReactive;return!isReadonly&&track(rawTarget,"iterate",isKeyOnly?MAP_KEY_ITERATE_KEY:ITERATE_KEY),{next(){const{value,done}=innerIterator.next();return done?{value,done}:{value:isPair?[wrap2(value[0]),wrap2(value[1])]:wrap2(value),done}},[Symbol.iterator](){return this}}}}function createReadonlyMethod(type){return function(...args){{const key=args[0]?`on key "${args[0]}" `:"";console.warn(`${capitalize(type)} operation ${key}failed: target is readonly.`,toRaw(this))}return type==="delete"?!1:this}}function createInstrumentations(){const mutableInstrumentations2={get(key){return get$1(this,key)},get size(){return size(this)},has:has$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(!1,!1)},shallowInstrumentations2={get(key){return get$1(this,key,!1,!0)},get size(){return size(this)},has:has$1,add,set:set$1,delete:deleteEntry,clear,forEach:createForEach(!1,!0)},readonlyInstrumentations2={get(key){return get$1(this,key,!0)},get size(){return size(this,!0)},has(key){return has$1.call(this,key,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!1)},shallowReadonlyInstrumentations2={get(key){return get$1(this,key,!0,!0)},get size(){return size(this,!0)},has(key){return has$1.call(this,key,!0)},add:createReadonlyMethod("add"),set:createReadonlyMethod("set"),delete:createReadonlyMethod("delete"),clear:createReadonlyMethod("clear"),forEach:createForEach(!0,!0)};return["keys","values","entries",Symbol.iterator].forEach(method=>{mutableInstrumentations2[method]=createIterableMethod(method,!1,!1),readonlyInstrumentations2[method]=createIterableMethod(method,!0,!1),shallowInstrumentations2[method]=createIterableMethod(method,!1,!0),shallowReadonlyInstrumentations2[method]=createIterableMethod(method,!0,!0)}),[mutableInstrumentations2,readonlyInstrumentations2,shallowInstrumentations2,shallowReadonlyInstrumentations2]}var[mutableInstrumentations,readonlyInstrumentations,shallowInstrumentations,shallowReadonlyInstrumentations]=createInstrumentations();function createInstrumentationGetter(isReadonly,shallow){const instrumentations=isReadonly?readonlyInstrumentations:mutableInstrumentations;return(target,key,receiver)=>key==="__v_isReactive"?!isReadonly:key==="__v_isReadonly"?isReadonly:key==="__v_raw"?target:Reflect.get(hasOwn(instrumentations,key)&&key in target?instrumentations:target,key,receiver)}var mutableCollectionHandlers={get:createInstrumentationGetter(!1)},readonlyCollectionHandlers={get:createInstrumentationGetter(!0)};function checkIdentityKeys(target,has2,key){const rawKey=toRaw(key);if(rawKey!==key&&has2.call(target,rawKey)){const type=toRawType(target);console.warn(`Reactive ${type} contains both the raw and reactive versions of the same object${type==="Map"?" as keys":""}, which can lead to inconsistencies. Avoid differentiating between the raw and reactive versions of an object and only use the reactive version if possible.`)}}var reactiveMap=new WeakMap,shallowReactiveMap=new WeakMap,readonlyMap=new WeakMap,shallowReadonlyMap=new WeakMap;function targetTypeMap(rawType){switch(rawType){case"Object":case"Array":return 1;case"Map":case"Set":case"WeakMap":case"WeakSet":return 2;default:return 0}}function getTargetType(value){return value.__v_skip||!Object.isExtensible(value)?0:targetTypeMap(toRawType(value))}function reactive2(target){return target&&target.__v_isReadonly?target:createReactiveObject(target,!1,mutableHandlers,mutableCollectionHandlers,reactiveMap)}function readonly(target){return createReactiveObject(target,!0,readonlyHandlers,readonlyCollectionHandlers,readonlyMap)}function createReactiveObject(target,isReadonly,baseHandlers,collectionHandlers,proxyMap){if
60(!isObject$1(target))return console.warn(`value cannot be made reactive: ${String(target)}`),target;if(target.__v_raw&&!(isReadonly&&target.__v_isReactive))return target;const existingProxy=proxyMap.get(target);if(existingProxy)return existingProxy;const targetType=getTargetType(target);if(targetType===0)return target;const proxy=new Proxy(target,targetType===2?collectionHandlers:baseHandlers);return proxyMap.set(target,proxy),proxy}function toRaw(observed){return observed&&toRaw(observed.__v_raw)||observed}function isRef(r){return!!(r&&r.__v_isRef===!0)}magic("nextTick",()=>nextTick),magic("dispatch",el=>dispatch.bind(dispatch,el)),magic("watch",(el,{evaluateLater:evaluateLater2,cleanup:cleanup2})=>(key,callback)=>{let evaluate2=evaluateLater2(key),unwatch=watch(()=>{let value;return evaluate2(i=>value=i),value},callback);cleanup2(unwatch)}),magic("store",getStores),magic("data",el=>scope(el)),magic("root",el=>closestRoot(el)),magic("refs",el=>(el._x_refs_proxy||(el._x_refs_proxy=mergeProxies(getArrayOfRefObject(el))),el._x_refs_proxy));function getArrayOfRefObject(el){let refObjects=[];return findClosest(el,i=>{i._x_refs&&refObjects.push(i._x_refs)}),refObjects}var globalIdMemo={};function findAndIncrementId(name){return globalIdMemo[name]||(globalIdMemo[name]=0),++globalIdMemo[name]}function closestIdRoot(el,name){return findClosest(el,element=>{if(element._x_ids&&element._x_ids[name])return!0})}function setIdRoot(el,name){el._x_ids||(el._x_ids={}),el._x_ids[name]||(el._x_ids[name]=findAndIncrementId(name))}magic("id",(el,{cleanup:cleanup2})=>(name,key=null)=>{let cacheKey=`${name}${key?`-${key}`:""}`;return cacheIdByNameOnElement(el,cacheKey,cleanup2,()=>{let root=closestIdRoot(el,name),id=root?root._x_ids[name]:findAndIncrementId(name);return key?`${name}-${id}-${key}`:`${name}-${id}`})}),interceptClone((from,to)=>{from._x_id&&(to._x_id=from._x_id)});function cacheIdByNameOnElement(el,cacheKey,cleanup2,callback){if(el._x_id||(el._x_id={}),el._x_id[cacheKey])return el._x_id[cacheKey];let output=callback();return el._x_id[cacheKey]=output,cleanup2(()=>{delete el._x_id[cacheKey]}),output}magic("el",el=>el),warnMissingPluginMagic("Focus","focus","focus"),warnMissingPluginMagic("Persist","persist","persist");function warnMissingPluginMagic(name,magicName,slug){magic(magicName,el=>warn(`You can't use [$${magicName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`,el))}directive("modelable",(el,{expression},{effect:effect3,evaluateLater:evaluateLater2,cleanup:cleanup2})=>{let func=evaluateLater2(expression),innerGet=()=>{let result;return func(i=>result=i),result},evaluateInnerSet=evaluateLater2(`${expression} = __placeholder`),innerSet=val=>evaluateInnerSet(()=>{},{scope:{__placeholder:val}}),initialValue=innerGet();innerSet(initialValue),queueMicrotask(()=>{if(!el._x_model)return;el._x_removeModelListeners.default();let outerGet=el._x_model.get,outerSet=el._x_model.set,releaseEntanglement=entangle({get(){return outerGet()},set(value){outerSet(value)}},{get(){return innerGet()},set(value){innerSet(value)}});cleanup2(releaseEntanglement)})}),directive("teleport",(el,{modifiers,expression},{cleanup:cleanup2})=>{el.tagName.toLowerCase()!=="template"&&warn("x-teleport can only be used on a <template> tag",el);let target=getTarget(expression),clone2=el.content.cloneNode(!0).firstElementChild;el._x_teleport=clone2,clone2._x_teleportBack=el,el.setAttribute("data-teleport-template",!0),clone2.setAttribute("data-teleport-target",!0),el._x_forwardEvents&&el._x_forwardEvents.forEach(eventName=>{clone2.addEventListener(eventName,e=>{e.stopPropagation(),el.dispatchEvent(new e.constructor(e.type,e))})}),addScopeToNode(clone2,{},el);let placeInDom=(clone3,target2,modifiers2)=>{modifiers2.includes("prepend")?target2.parentNode.insertBefore(clone3,target2):modifiers2.includes("append")?target2.parentNode.insertBefore(clone3,target2.nextSibling):target2.appendChild(clone3)};mutateDom(()=>{placeInDom(clone2,target,modifiers),skipDuringClone(()=>{initTree(clone2)})()}),el._x_teleportPutBack=()=>{let target2=getTarget(expression);mutateDom(()=>{placeInDom(el._x_teleport,target2,modifiers)})},cleanup2(()=>mutateDom(()=>{clone2.remove(),destroyTree(clone2)}))});var teleportContainerDuringClone=document.createElement("div");function getTarget(expression){let target=skipDuringClone(()=>document.querySelector(expression),()=>teleportContainerDuringClone)();return target||warn(`Cannot find x-teleport element for selector: "${expression}"`),target}var handler=()=>{};handler.inline=(el,{modifiers},{cleanup:cleanup2})=>{modifiers.includes("self")?el._x_ignoreSelf=!0:el._x_ignore=!0,cleanup2(()=>{modifiers.includes("self")?delete el._x_ignoreSelf:delete el._x_ignore})},directive("ignore",handler),directive("effect",skipDuringClone((el,{expression},{effect:effect3})=>{effect3(evaluateLater(el,expression))}));function on(el,event,modifiers,callback){let listenerTarget=el,handler4=e=>callback(e),options2={},wrapHandler=(callback2,wrapper)=>e=>wrapper(callback2,e);if(modifiers.includes("dot")&&(event=dotSyntax(event)),modifiers.includes("camel")&&(event=camelCase2(event)),modifiers.includes("passive")&&(options2.passive=!0),modifiers.includes("capture")&&(options2.capture=!0),modifiers.includes("window")&&(listenerTarget=window),modifiers.includes("document")&&(listenerTarget=document),modifiers.includes("debounce")){let nextModifier=modifiers[modifiers.indexOf("debounce")+1]||"invalid-wait",wait=isNumeric$1(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler4=debounce(handler4,wait)}if(modifiers.includes("throttle")){let nextModifier=modifiers[modifiers.indexOf("throttle")+1]||"invalid-wait",wait=isNumeric$1(nextModifier.split("ms")[0])?Number(nextModifier.split("ms")[0]):250;handler4=throttle(handler4,wait)}return modifiers.includes("prevent")&&(handler4=wrapHandler(handler4,(next,e)=>{e.preventDefault(),next(e)})),modifiers.includes("stop")&&(handler4=wrapHandler(handler4,(next,e)=>{e.stopPropagation(),next(e)})),modifiers.includes("once")&&(handler4=wrapHandler(handler4,(next,e)=>{next(e),listenerTarget.removeEventListener(event,handler4,options2)})),(modifiers.includes("away")||modifiers.includes("outside"))&&(listenerTarget=document,handler4=wrapHandler(handler4,(next,e)=>{el.contains(e.target)||e.target.isConnected!==!1&&(el.offsetWidth<1&&el.offsetHeight<1||el._x_isShown!==!1&&next(e))})),modifiers.includes("self")&&(handler4=wrapHandler(handler4,(next,e)=>{e.target===el&&next(e)})),(isKeyEvent(event)||isClickEvent(event))&&(handler4=wrapHandler(handler4,(next,e)=>{isListeningForASpecificKeyThatHasntBeenPressed(e,modifiers)||next(e)})),listenerTarget.addEventListener(event,handler4,options2),()=>{listenerTarget.removeEventListener(event,handler4,options2)}}function dotSyntax(subject){return subject.replace(/-/g,".")}
60function camelCase2(subject){return subject.toLowerCase().replace(/-(\w)/g,(match,char)=>char.toUpperCase())}function isNumeric$1(subject){return!Array.isArray(subject)&&!isNaN(subject)}function kebabCase2(subject){return[" ","_"].includes(subject)?subject:subject.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[_\s]/,"-").toLowerCase()}function isKeyEvent(event){return["keydown","keyup"].includes(event)}function isClickEvent(event){return["contextmenu","click","mouse"].some(i=>event.includes(i))}function isListeningForASpecificKeyThatHasntBeenPressed(e,modifiers){let keyModifiers=modifiers.filter(i=>!["window","document","prevent","stop","once","capture","self","away","outside","passive","preserve-scroll"].includes(i));if(keyModifiers.includes("debounce")){let debounceIndex=keyModifiers.indexOf("debounce");keyModifiers.splice(debounceIndex,isNumeric$1((keyModifiers[debounceIndex+1]||"invalid-wait").split("ms")[0])?2:1)}if(keyModifiers.includes("throttle")){let debounceIndex=keyModifiers.indexOf("throttle");keyModifiers.splice(debounceIndex,isNumeric$1((keyModifiers[debounceIndex+1]||"invalid-wait").split("ms")[0])?2:1)}if(keyModifiers.length===0||keyModifiers.length===1&&keyToModifiers(e.key).includes(keyModifiers[0]))return!1;const selectedSystemKeyModifiers=["ctrl","shift","alt","meta","cmd","super"].filter(modifier=>keyModifiers.includes(modifier));return keyModifiers=keyModifiers.filter(i=>!selectedSystemKeyModifiers.includes(i)),!(selectedSystemKeyModifiers.length>0&&selectedSystemKeyModifiers.filter(modifier=>((modifier==="cmd"||modifier==="super")&&(modifier="meta"),e[`${modifier}Key`])).length===selectedSystemKeyModifiers.length&&(isClickEvent(e.type)||keyToModifiers(e.key).includes(keyModifiers[0])))}function keyToModifiers(key){if(!key)return[];key=kebabCase2(key);let modifierToKeyMap={ctrl:"control",slash:"/",space:" ",spacebar:" ",cmd:"meta",esc:"escape",up:"arrow-up",down:"arrow-down",left:"arrow-left",right:"arrow-right",period:".",comma:",",equal:"=",minus:"-",underscore:"_"};return modifierToKeyMap[key]=key,Object.keys(modifierToKeyMap).map(modifier=>{if(modifierToKeyMap[modifier]===key)return modifier}).filter(modifier=>modifier)}directive("model",(el,{modifiers,expression},{effect:effect3,cleanup:cleanup2})=>{let scopeTarget=el;modifiers.includes("parent")&&(scopeTarget=el.parentNode);let evaluateGet=evaluateLater(scopeTarget,expression),evaluateSet;typeof expression=="string"?evaluateSet=evaluateLater(scopeTarget,`${expression} = __placeholder`):typeof expression=="function"&&typeof expression()=="string"?evaluateSet=evaluateLater(scopeTarget,`${expression()} = __placeholder`):evaluateSet=()=>{};let getValue=()=>{let result;return evaluateGet(value=>result=value),isGetterSetter(result)?result.get():result},setValue=value=>{let result;evaluateGet(value2=>result=value2),isGetterSetter(result)?result.set(value):evaluateSet(()=>{},{scope:{__placeholder:value}})};typeof expression=="string"&&el.type==="radio"&&mutateDom(()=>{el.hasAttribute("name")||el.setAttribute("name",expression)});let event=el.tagName.toLowerCase()==="select"||["checkbox","radio"].includes(el.type)||modifiers.includes("lazy")?"change":"input",removeListener=isCloning?()=>{}:on(el,event,modifiers,e=>{setValue(getInputValue(el,modifiers,e,getValue()))});if(modifiers.includes("fill")&&([void 0,null,""].includes(getValue())||isCheckbox(el)&&Array.isArray(getValue())||el.tagName.toLowerCase()==="select"&&el.multiple)&&setValue(getInputValue(el,modifiers,{target:el},getValue())),el._x_removeModelListeners||(el._x_removeModelListeners={}),el._x_removeModelListeners.default=removeListener,cleanup2(()=>el._x_removeModelListeners.default()),el.form){let removeResetListener=on(el.form,"reset",[],e=>{nextTick(()=>el._x_model&&el._x_model.set(getInputValue(el,modifiers,{target:el},getValue())))});cleanup2(()=>removeResetListener())}el._x_model={get(){return getValue()},set(value){setValue(value)}},el._x_forceModelUpdate=value=>{value===void 0&&typeof expression=="string"&&expression.match(/\./)&&(value=""),window.fromModel=!0,mutateDom(()=>bind(el,"value",value)),delete window.fromModel},effect3(()=>{let value=getValue();modifiers.includes("unintrusive")&&document.activeElement.isSameNode(el)||el._x_forceModelUpdate(value)})});function getInputValue(el,modifiers,event,currentValue){return mutateDom(()=>{if(event instanceof CustomEvent&&event.detail!==void 0)return event.detail!==null&&event.detail!==void 0?event.detail
60:event.target.value;if(isCheckbox(el))if(Array.isArray(currentValue)){let newValue=null;return modifiers.includes("number")?newValue=safeParseNumber(event.target.value):modifiers.includes("boolean")?newValue=safeParseBoolean(event.target.value):newValue=event.target.value,event.target.checked?currentValue.includes(newValue)?currentValue:currentValue.concat([newValue]):currentValue.filter(el2=>!checkedAttrLooseCompare2(el2,newValue))}else return event.target.checked;else{if(el.tagName.toLowerCase()==="select"&&el.multiple)return modifiers.includes("number")?Array.from(event.target.selectedOptions).map(option=>{let rawValue=option.value||option.text;return safeParseNumber(rawValue)}):modifiers.includes("boolean")?Array.from(event.target.selectedOptions).map(option=>{let rawValue=option.value||option.text;return safeParseBoolean(rawValue)}):Array.from(event.target.selectedOptions).map(option=>option.value||option.text);{let newValue;return isRadio(el)?event.target.checked?newValue=event.target.value:newValue=currentValue:newValue=event.target.value,modifiers.includes("number")?safeParseNumber(newValue):modifiers.includes("boolean")?safeParseBoolean(newValue):modifiers.includes("trim")?newValue.trim():newValue}}})}function safeParseNumber(rawValue){let number2=rawValue?parseFloat(rawValue):null;return isNumeric2(number2)?number2:rawValue}function checkedAttrLooseCompare2(valueA,valueB){return valueA==valueB}function isNumeric2(subject){return!Array.isArray(subject)&&!isNaN(subject)}function isGetterSetter(value){return value!==null&&typeof value=="object"&&typeof value.get=="function"&&typeof value.set=="function"}directive("cloak",el=>queueMicrotask(()=>mutateDom(()=>el.removeAttribute(prefix("cloak"))))),addInitSelector(()=>`[${prefix("init")}]`),directive("init",skipDuringClone((el,{expression},{evaluate:evaluate2})=>typeof expression=="string"?!!expression.trim()&&evaluate2(expression,{},!1):evaluate2(expression,{},!1))),directive("text",(el,{expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2(value=>{mutateDom(()=>{el.textContent=value})})})}),directive("html",(el,{expression},{effect:effect3,evaluateLater:evaluateLater2})=>{let evaluate2=evaluateLater2(expression);effect3(()=>{evaluate2(value=>{mutateDom(()=>{el.innerHTML=value,el._x_ignoreSelf=!0,initTree(el),delete el._x_ignoreSelf})})})}),mapAttributes(startingWith(":",into(prefix("bind:"))));var handler2=(el,{value,modifiers,expression,original},{effect:effect3,cleanup:cleanup2})=>{if(!value){let bindingProviders={};injectBindingProviders(bindingProviders),evaluateLater(el,expression)(bindings=>{applyBindingsObject(el,bindings,original)},{scope:bindingProviders});return}if(value==="key")return storeKeyForXFor(el,expression);if(el._x_inlineBindings&&el._x_inlineBindings[value]&&el._x_inlineBindings[value].extract)return;let evaluate2=evaluateLater(el,expression);effect3(()=>evaluate2(result=>{result===void 0&&typeof expression=="string"&&expression.match(/\./)&&(result=""),mutateDom(()=>bind(el,value,result,modifiers))})),cleanup2(()=>{el._x_undoAddedClasses&&el._x_undoAddedClasses(),el._x_undoAddedStyles&&el._x_undoAddedStyles()})};handler2.inline=(el,{value,modifiers,expression})=>{value&&(el._x_inlineBindings||(el._x_inlineBindings={}),el._x_inlineBindings[value]={expression,extract:!1})},directive("bind",handler2);function storeKeyForXFor(el,expression){el._x_keyExpression=expression}addRootSelector(()=>`[${prefix("data")}]`),directive("data",(el,{expression},{cleanup:cleanup2})=>{if(shouldSkipRegisteringDataDuringClone(el))return;expression=expression===""?"{}":expression;let magicContext={};injectMagics(magicContext,el);let dataProviderContext={};injectDataProviders(dataProviderContext,magicContext);let data2=evaluate(el,expression,{scope:dataProviderContext});(data2===void 0||data2===!0)&&(data2={}),injectMagics(data2,el);let reactiveData=reactive(data2);initInterceptors(reactiveData);let undo=addScopeToNode(el,reactiveData);reactiveData.init&&evaluate(el,reactiveData.init),cleanup2(()=>{reactiveData.destroy&&evaluate(el,reactiveData.destroy),undo()})}),interceptClone((from,to)=>{from._x_dataStack&&(to._x_dataStack=from._x_dataStack,to.setAttribute("data-has-alpine-state",!0))});function shouldSkipRegisteringDataDuringClone(el){return isCloning?isCloningLegacy?!0:el.hasAttribute("data-has-alpine-state"):!1}directive("show",(el,{modifiers,expression},{effect:effect3})=>{let evaluate2=evaluateLater(el,expression);el._x_doHide||(el._x_doHide=()=>{mutateDom(()=>{el.style.setProperty("display","none",modifiers.includes("important")?"important":void 0)})}),el._x_doShow||(el._x_doShow=()=>{mutateDom(()=>{el.style.length===1&&el.style.display==="none"?el.removeAttribute("style"):el.style.removeProperty("display")})});let hide=()=>{el._x_doHide(),el._x_isShown=!1},show=()=>{el._x_doShow(),el._x_isShown=!0},clickAwayCompatibleShow=()=>setTimeout(show),toggle2=once(value=>value?show():hide(),value=>{typeof el._x_toggleAndCascadeWithTransitions=="function"?el._x_toggleAndCascadeWithTransitions(el,value,show,hide):value?clickAwayCompatibleShow():hide()}),oldValue,firstTime=!0;effect3(()=>evaluate2(value=>{!firstTime&&value===oldValue||(modifiers.includes("immediate")&&(value?clickAwayCompatibleShow():hide()),toggle2(value),oldValue=value,firstTime=!1)}))}),directive("for",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{let iteratorNames=parseForExpression(expression),evaluateItems=evaluateLater(el,iteratorNames.items),evaluateKey=evaluateLater(el,el._x_keyExpression||"index");el._x_prevKeys=[],el._x_lookup={},effect3(()=>loop(el,iteratorNames,evaluateItems,evaluateKey)),cleanup2(()=>
60{Object.values(el._x_lookup).forEach(el2=>mutateDom(()=>{destroyTree(el2),el2.remove()})),delete el._x_prevKeys,delete el._x_lookup})});function loop(el,iteratorNames,evaluateItems,evaluateKey){let isObject2=i=>typeof i=="object"&&!Array.isArray(i),templateEl=el;evaluateItems(items=>{isNumeric3(items)&&items>=0&&(items=Array.from(Array(items).keys(),i=>i+1)),items===void 0&&(items=[]);let lookup=el._x_lookup,prevKeys=el._x_prevKeys,scopes=[],keys2=[];if(isObject2(items))items=Object.entries(items).map(([key,value])=>{let scope2=getIterationScopeVariables(iteratorNames,value,key,items);evaluateKey(value2=>{keys2.includes(value2)&&warn("Duplicate key on x-for",el),keys2.push(value2)},{scope:{index:key,...scope2}}),scopes.push(scope2)});else for(let i=0;i<items.length;i++){let scope2=getIterationScopeVariables(iteratorNames,items[i],i,items);evaluateKey(value=>{keys2.includes(value)&&warn("Duplicate key on x-for",el),keys2.push(value)},{scope:{index:i,...scope2}}),scopes.push(scope2)}let adds=[],moves=[],removes=[],sames=[];for(let i7=0;i7<prevKeys.length;i7++){let key=prevKeys[i7];keys2.indexOf(key)===-1&&removes.push(key)}prevKeys=prevKeys.filter(key=>!removes.includes(key));let lastKey="template";for(let i2=0;i2<keys2.length;i2++){let key=keys2[i2],prevIndex=prevKeys.indexOf(key);if(prevIndex===-1)prevKeys.splice(i2,0,key),adds.push([lastKey,i2]);else if(prevIndex!==i2){let keyInSpot=prevKeys.splice(i2,1)[0],keyForSpot=prevKeys.splice(prevIndex-1,1)[0];prevKeys.splice(i2,0,keyForSpot),prevKeys.splice(prevIndex,0,keyInSpot),moves.push([keyInSpot,keyForSpot])}else sames.push(key);lastKey=key}for(let i3=0;i3<removes.length;i3++){let key=removes[i3];key in lookup&&(mutateDom(()=>{destroyTree(lookup[key]),lookup[key].remove()}),delete lookup[key])}for(let i4=0;i4<moves.length;i4++){let[keyInSpot,keyForSpot]=moves[i4],elInSpot=lookup[keyInSpot],elForSpot=lookup[keyForSpot],marker=document.createElement("div");mutateDom(()=>{elForSpot||warn('x-for ":key" is undefined or invalid',templateEl,keyForSpot,lookup),elForSpot.after(marker),elInSpot.after(elForSpot),elForSpot._x_currentIfEl&&elForSpot.after(elForSpot._x_currentIfEl),marker.before(elInSpot),elInSpot._x_currentIfEl&&elInSpot.after(elInSpot._x_currentIfEl),marker.remove()}),elForSpot._x_refreshXForScope(scopes[keys2.indexOf(keyForSpot)])}for(let i5=0;i5<adds.length;i5++){let[lastKey2,index]=adds[i5],lastEl=lastKey2==="template"?templateEl:lookup[lastKey2];lastEl._x_currentIfEl&&(lastEl=lastEl._x_currentIfEl);let scope2=scopes[index],key=keys2[index],clone2=document.importNode(templateEl.content,!0).firstElementChild,reactiveScope=reactive(scope2);addScopeToNode(clone2,reactiveScope,templateEl),clone2._x_refreshXForScope=newScope=>{Object.entries(newScope).forEach(([key2,value])=>{reactiveScope[key2]=value})},mutateDom(()=>{lastEl.after(clone2),skipDuringClone(()=>initTree(clone2))()}),typeof key=="object"&&warn("x-for key cannot be an object, it must be a string or an integer",templateEl),lookup[key]=clone2}for(let i6=0;i6<sames.length;i6++)lookup[sames[i6]]._x_refreshXForScope(scopes[keys2.indexOf(sames[i6])]);templateEl._x_prevKeys=keys2})}function parseForExpression(expression){let forIteratorRE=/,([^,\}\]]*)(?:,([^,\}\]]*))?$/,stripParensRE=/^\s*\(|\)\s*$/g,forAliasRE=/([\s\S]*?)\s+(?:in|of)\s+([\s\S]*)/,inMatch=expression.match(forAliasRE);if(!inMatch)return;let res={};res.items=inMatch[2].trim();let item=inMatch[1].replace(stripParensRE,"").trim(),iteratorMatch=item.match(forIteratorRE);return iteratorMatch?(res.item=item.replace(forIteratorRE,"").trim(),res.index=iteratorMatch[1].trim(),iteratorMatch[2]&&(res.collection=iteratorMatch[2].trim())):res.item=item,res}function getIterationScopeVariables(iteratorNames,item,index,items){let scopeVariables={};return/^\[.*\]$/.test(iteratorNames.item)&&Array.isArray(item)?iteratorNames.item.replace("[","").replace("]","").split(",").map(i=>i.trim()).forEach((name,i)=>{scopeVariables[name]=item[i]}):/^\{.*\}$/.test(iteratorNames.item)&&!Array.isArray(item)&&typeof item=="object"?iteratorNames.item.replace("{","").replace("}","").split(",").map(i=>
60i.trim()).forEach(name=>{scopeVariables[name]=item[name]}):scopeVariables[iteratorNames.item]=item,iteratorNames.index&&(scopeVariables[iteratorNames.index]=index),iteratorNames.collection&&(scopeVariables[iteratorNames.collection]=items),scopeVariables}function isNumeric3(subject){return!Array.isArray(subject)&&!isNaN(subject)}function handler3(){}handler3.inline=(el,{expression},{cleanup:cleanup2})=>{let root=closestRoot(el);root._x_refs||(root._x_refs={}),root._x_refs[expression]=el,cleanup2(()=>delete root._x_refs[expression])},directive("ref",handler3),directive("if",(el,{expression},{effect:effect3,cleanup:cleanup2})=>{el.tagName.toLowerCase()!=="template"&&warn("x-if can only be used on a <template> tag",el);let evaluate2=evaluateLater(el,expression),show=()=>{if(el._x_currentIfEl)return el._x_currentIfEl;let clone2=el.content.cloneNode(!0).firstElementChild;return addScopeToNode(clone2,{},el),mutateDom(()=>{el.after(clone2),skipDuringClone(()=>initTree(clone2))()}),el._x_currentIfEl=clone2,el._x_undoIf=()=>{mutateDom(()=>{destroyTree(clone2),clone2.remove()}),delete el._x_currentIfEl},clone2},hide=()=>{el._x_undoIf&&(el._x_undoIf(),delete el._x_undoIf)};effect3(()=>evaluate2(value=>{value?show():hide()})),cleanup2(()=>el._x_undoIf&&el._x_undoIf())}),directive("id",(el,{expression},{evaluate:evaluate2})=>{evaluate2(expression).forEach(name=>setIdRoot(el,name))}),interceptClone((from,to)=>{from._x_ids&&(to._x_ids=from._x_ids)}),mapAttributes(startingWith("@",into(prefix("on:")))),directive("on",skipDuringClone((el,{value,modifiers,expression},{cleanup:cleanup2})=>{let evaluate2=expression?evaluateLater(el,expression):()=>{};el.tagName.toLowerCase()==="template"&&(el._x_forwardEvents||(el._x_forwardEvents=[]),el._x_forwardEvents.includes(value)||el._x_forwardEvents.push(value));let removeListener=on(el,value,modifiers,e=>{evaluate2(()=>{},{scope:{$event:e},params:[e]})});cleanup2(()=>removeListener())})),warnMissingPluginDirective("Collapse","collapse","collapse"),warnMissingPluginDirective("Intersect","intersect","intersect"),warnMissingPluginDirective("Focus","trap","focus"),warnMissingPluginDirective("Mask","mask","mask");function warnMissingPluginDirective(name,directiveName,slug){directive(directiveName,el=>warn(`You can't use [x-${directiveName}] without first installing the "${name}" plugin here: https://alpinejs.dev/plugins/${slug}`,el))}alpine_default.setEvaluator(normalEvaluator),alpine_default.setReactivityEngine({reactive:reactive2,effect:effect2,release:stop,raw:toRaw});var src_default=alpine_default,module_default=src_default;function isFormDataSubmitterSupported(){try{new FormData(document.createElement("form"),0)}catch{return!1}}function getFormSubmissionInfo(target,submitter){let method,action,formData,enctype=null,defaultMethod="GET";if(isFormElement(target))action=target.action,method=target.getAttribute("method")||defaultMethod,enctype=target.getAttribute("enctype")||null,formData=new FormData(target,submitter||null);else if(isButtonElement(target)||isInputElement(target)&&(target.type==="submit"||target.type==="image")){let form=target.form;if(form==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');if(action=target.formAction||form.action,method=target.getAttribute("formmethod")||form.getAttribute("method")||defaultMethod,enctype=target.getAttribute("formenctype")||form.getAttribute("enctype")||null,formData=new FormData(form,target),!isFormDataSubmitterSupported()){let{name,type,value}=target;if(type==="image"){let prefix2=name?`${name}.`:"";formData.append(`${prefix2}x`,"0"),formData.append(`${prefix2}y`,"0")}else name&&formData.append(name,value)}}else{if(isHtmlElement(target))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');method=defaultMethod,action=null,enctype=null}return{action,method:method.toUpperCase(),formData,enctype}}async function submitFormData({action,formData,method,enctype},init){switch(method){case"POST":return enctype==="application/json"?fetch(action,Object.assign({method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json","X-Requested-With":"XMLHttpRequest"},body:JSON.stringify(serializeFormData(formData))},init)):fetch(action,Object.assign({method:"POST",body:formData,headers:{Accept:"application/javascript","X-Requested-With":"XMLHttpRequest"}},init));case"GET":const url=`${action}?${new URLSearchParams(formData).toString()}`;return fetch(url,Object.assign({method:"GET",headers:{"Content-Type":"application/json",Accept:"application/json"}},init));default:throw new Error(`Unsupported method: ${method}`)}}function isModifiedEvent(event){return!!(event.metaKey||event.altKey||event.ctrlKey||event.shiftKey)}function shouldProcessLinkClick(event,target){return event.button===0&&(!target||target==="_self")&&!isModifiedEvent(event)}function isHtmlElement(node){return node!=null&&node!=null&&typeof node.tagName=="string"&&node.nodeType===Node.ELEMENT_NODE}function isAnchorElement(node){return isHtmlElement(node)&&node.nodeName==="A"}function isFormElement(node){return isHtmlElement(node)&&node.nodeName==="FORM"}function isInputElement(node){return isHtmlElement(node)&&node.nodeName==="INPUT"}function isInputNumberElement(node){return isHtmlElement(node)&&node.nodeName==="INPUT"&&node.getAttribute("type")=="number"}function isButtonElement(node){return isHtmlElement(node)&&node.nodeName==="BUTTON"}function isTemplateElement(node){return isHtmlElement(node)&&node.nodeName==="TEMPLATE"}function serializeFormData(formData){const result={};for(const[key,value]of formData.entries()){const parts=key.match(/([^\[\]]+)/g)||[key];let current=result;for(let i=0;i<parts.length-1;i++){const part=parts[i];current[part]=current[part]||{},current=current[part]}const lastPart=parts[parts.length-1];current[lastPart]=value}return result}function onDocumentReady$1(callback){document.readyState!=="complete"?document.addEventListener("DOMContentLoaded",callback):callback()}function requestIdleCallback(callback,options2){if(typeof window.requestIdleCallback=="function")return window.requestIdleCallback(callback,options2);{let start2=Date.now();return setTimeout(()=>{callback({didTimeout:!1,timeRemaining:()=>{var _a;return Math.max(0,(_a=void 0)!==null&&_a!==void 0?_a:50-(Date.now()-start2))}})},1)}}function cancelIdleCallback(id){return typeof window.cancelIdleCallback=="function"?window.cancelIdleCallback(id):clearTimeout(id)}function cache(Alpine1){Alpine1.store("cache",cacheStore()),Alpine1.directive("cache",($el,{modifiers,expression},{Alpine:Alpine2,evaluate:evaluate2})=>{var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if($el.nodeName!=="SCRIPT")throw new Error("Can only be used on script tags");if(((_a=$el.textContent)===null||_a===void 0?void 0:_a.trim())=="")return;let json;try{json=JSON.parse($el.textContent||"{}")}catch(e){throw new Error(`Could not parse ${$el.textContent} as JSON: ${e}`)}const resourceName=modifiers[0];
60if(!resourceName)throw new Error("Must specify a store to cache to e.g. x-cache.products");const cacheResource=Alpine2.store("cache").resources[resourceName];if(!cacheResource)throw new Error(`Could not find resource named ${resourceName}. Did you define it in the cache store?`);if(expression){const cacheKey=evaluate2(expression);cacheResource.set(cacheKey,json)}else isSingletonResource(cacheResource)?cacheResource.set(json):cacheResource.upsert(json)}).before("bind"),Alpine1.magic("cache",()=>Alpine1.store("cache").resources)}function isSingletonResource(x){return!!("isSingleton"in x&&x.isSingleton)}function buildResource(builder){return{records:{},set(key,value){this.records[key]=value},populate(records){this.records=records},upsert(records){this.records=Object.assign(Object.assign({},this.records),records)},evict(key){delete this.records[key]},reset(){this.records={}},get(key){const result=this.records[key];return result?builder?builder(result):result:null},get isSingleton(){return!1}}}function buildSingletonResource(builder){return{record:null,set(value){this.record=value},evict(){this.record=null},reset(){this.record=null},get(){const result=this.record;return result?builder?builder(result):result:null},get isSingleton(){return!0}}}function cacheStore(){return{resources:{},reset(){Object.keys(this.resources).forEach(key=>{this.resources[key].reset()})},addResource(key,options2){options2?.singleton?this.resources[key]=buildSingletonResource(options2?.builder):this.resources[key]=buildResource(options2?.builder)}}}function isPlainObject(x){return typeof x=="object"&&x!==null&&!Array.isArray(x)&&!(x instanceof Date)}function copyProperty(obj,newObj,oldName,optionalNewName){const newName=oldName,descriptor=Object.getOwnPropertyDescriptor(obj,oldName);if(!descriptor)throw new Error(`Property ${String(oldName)} not found on object`);Object.defineProperty(newObj,newName,descriptor)}function trackProperty(obj,key,trackingKey){return new Proxy(obj,{set(target,prop,value,receiver){return prop==key&&receiver[key]!==value&&(receiver[trackingKey]=receiver[key]),Reflect.set(target,prop,value,receiver)}})}function mod(n,m){return(n%m+m)%m}function isNumeric(value){return typeof value=="number"?!0:!isNaN(value)&&!isNaN(parseFloat(value))}function closestSectionEl($el){if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);return $el.classList.contains("shopify-section")?$el:$el.closest(".shopify-section")}class StateMachine{set state(newState){if(intersectArrays(this.states,this.transitions[this._state]||[]).includes(newState)){let prevState=this._state;this._prevState=prevState,this._state=newState,this.listeners.forEach(listener=>listener(newState,prevState))}else throw new Error(`Invalid transition from ${this._state} to ${newState}`)}setTransientState(transientState,nextState,timeout){return new Promise(resolve=>{this._state=transientState,setTimeout(()=>{this._state=nextState,resolve()},timeout)})}get state(){return this._state}get prevState(){return this._prevState}on(listener){this.listeners.push(listener)}off(listener){const index=this.listeners.indexOf(listener);index!==-1&&this.listeners.splice(index,1)}constructor(initialState,states,transitions){this._prevState=null,this.listeners=[],this._state=initialState,this.states=states,this.transitions=transitions}}function intersectArrays(arr1,arr2){const set22=new Set(arr2);return arr1.filter(x=>set22.has(x))}function yieldToMain(){var _a;return"scheduler"in window&&typeof((_a=window.scheduler)===null||_a===void 0?void 0:_a.yield)=="function"?window.scheduler.yield():new Promise(resolve=>{setTimeout(resolve,0)})}function getModifierValue(modifiers,modifierName){var _a;const modifierIndex=modifiers.indexOf(modifierName);return modifierIndex===-1?null:(_a=modifiers[modifierIndex+1])!==null&&_a!==void 0?_a:null}function getNumberModifierValue(modifiers,modifierName){const rawModifierValue=getModifierValue(modifiers,modifierName);if(rawModifierValue==null)return null;const parsedModifierValue=Number(rawModifierValue);return Number.isFinite(parsedModifierValue)?parsedModifierValue:null}function getPositiveNumberModifierValue(modifiers,modifierName){const parsedModifierValue=getNumberModifierValue(modifiers,modifierName);return parsedModifierValue==null||parsedModifierValue<=0?null:parsedModifierValue}function getMillisecondsModifierValue(modifiers,modifierName){const rawModifierValue=getModifierValue(modifiers,modifierName);if(rawModifierValue==null)return null;const millisecondsMatch=rawModifierValue.match(/^([0-9]+)ms$/);return millisecondsMatch?Number(millisecondsMatch[1]):null}function getPercentageModifierValue(modifiers,modifierName){const rawModifierValue=getModifierValue(modifiers,modifierName);if(rawModifierValue==null)return null;const percentageMatch=rawModifierValue.match(/^([0-9]+)%$/);return percentageMatch?Number(percentageMatch[1]):null}function getPixelModifierValue(modifiers,modifierName){const rawModifierValue=getModifierValue(modifiers,modifierName);if(rawModifierValue==null)return null;const pixelMatch=rawModifierValue.match(/^(-?[0-9]+)px$/);return pixelMatch?Number(pixelMatch[1]):null}const DEFAULT_MIN_SPRING_MASS=.01;function getMassModifierValue(modifiers,modifierName,minimumMass=DEFAULT_MIN_SPRING_MASS){const rawModifierValue=getModifierValue(modifiers,modifierName);if(rawModifierValue==null)return null;const parsedModifierValue=Number(rawModifierValue);return Number.isNaN(parsedModifierValue)||parsedModifierValue<0?null:parsedModifierValue===0?minimumMass:parsedModifierValue*minimumMass}function getSpringModifierConfig(modifiers,defaultSpringConfig,minimumMass=DEFAULT_MIN_SPRING_MASS){const springConfig=Object.assign({},defaultSpringConfig),parsedMass=getMassModifierValue(modifiers,"mass",minimumMass);parsedMass!==null&&(springConfig.mass=parsedMass);const parsedStiffness=getPositiveNumberModifierValue(modifiers,"stiffness");parsedStiffness!==null&&(springConfig.stiffness=parsedStiffness);const parsedDamping=getPositiveNumberModifierValue(modifiers,"damping");return parsedDamping!==null&&(springConfig.damping=parsedDamping),springConfig}function isReducedMotion(){return window.matchMedia("(prefers-reduced-motion: reduce)").matches}function isLowPowerDevice(){return Number(navigator.hardwareConcurrency)<=2||Number(navigator.deviceMemory)<=2}function afterNextPaint(fn){return requestAnimationFrame(fn)}function readLayoutAfterPaint(fn){return new Promise(resolve=>{afterNextPaint(()=>resolve(fn()))})}const DEFAULT_LIST_STATE_NAME="listState";function listState(Alpine2){Alpine2.directive("list-state",($el,{value,expression,modifiers},{evaluate:evaluate2})=>
60{if(value=="item"){const $data=Alpine2.$data($el);let scope2=`$${DEFAULT_LIST_STATE_NAME}`;if(modifiers.includes("for")&&modifiers.length>=2){const forIndex=modifiers.indexOf("for");scope2=`$${modifiers[forIndex+1]}`}if(!(scope2 in $data))throw new Error("x-list-state:item must be used within x-list-state directive. To register an item in a scoped list state, use $myScopeName.register($el)");Alpine2.bind($el,{"x-data"(){return{init(){$data[scope2].register(this.$el)},destroy(){$data[scope2].unregister(this.$el)}}}})}else if(value==null){let options2={},scope2=`$${DEFAULT_LIST_STATE_NAME}`;if(modifiers.includes("as")&&modifiers.length>=2){const asIndex=modifiers.indexOf("as");scope2=`$${modifiers[asIndex+1]}`}if(expression){let evalutatedExpression=evaluate2(expression===""?"{}":expression);isPlainObject(evalutatedExpression)&&(options2=evalutatedExpression,options2.scope&&(scope2=`$${options2.scope}`))}let state;if(options2.multiple||modifiers.includes("multiple")){if(options2=options2,options2?.selectedIndices&&!(options2.selectedIndices instanceof Set))throw new Error("selectedIndices must be a Set");state=buildMultiSelectListState(options2)}else options2=options2,state=buildSingleSelectListState(options2);Alpine2.addScopeToNode($el,{[scope2]:Alpine2.reactive(state)})}else throw new Error(`Unknown directive: x-list-state:${value}`)}).before("bind")}function buildSingleSelectListState(options2){let state={previousSelectedIndex:null,selectedIndex:null,items:new Set,get totalItems(){return this.items.size},isSelected(index){return this.selectedIndex==index},register(el){this.items.add(el)},unregister(el){this.items.delete(el)},indexOf(el){return Array.from(this.items).indexOf(el)},toggle(index){this.selectedIndex==index?this.deselect(index):this.select(index)},select(index){this.selectedIndex=index},deselect(index){this.selectedIndex==index&&(this.selectedIndex=null)}};return"selectedIndex"in options2&&copyProperty(options2,state,"selectedIndex"),state}function buildMultiSelectListState(options2){let state={selectedIndices:new Set,items:new Set,get totalItems(){return this.items.size},isSelected(index){return this.selectedIndices.has(index)},register(el){this.items.add(el)},unregister(el){this.items.delete(el)},indexOf(el){return Array.from(this.items).indexOf(el)},toggle(index){this.selectedIndices.has(index)?this.deselect(index):this.select(index)},select(index){const selected=this.selectedIndices;selected.add(index),this.selectedIndices=new Set(Array.from(selected))},deselect(index){const selected=this.selectedIndices;selected.delete(index),this.selectedIndices=new Set(Array.from(selected))}};return"selectedIndices"in options2&&copyProperty(options2,state,"selectedIndices"),state}function warnMissingParentDirective(childDirective,parentDirective,el){console.error(`Cannot use ${childDirective} without a parent element having ${parentDirective}.`,el)}function prettyPrintError(err){let output="";return typeof err=="string"?output=err:err instanceof Error?output=err.message:err&&typeof err.toString=="function"?output=err.toString():err&&typeof err.message=="string"?output=err.message:output="An unknown error occurred.",output}const DEFAULT_MAX_REPEAT_TIME_IN_MS=1500;function hold(Alpine2){Alpine2.directive("hold",($el,{modifiers,expression},{evaluate:evaluate2})=>{if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);let firstModifier=modifiers[0]||"",time2=isNumeric(firstModifier.split("ms")[0])?Number(firstModifier.split("ms")[0]):25,maxModifierIndex=modifiers.indexOf("max"),maxValueModifier=modifiers[maxMo
60difierIndex+1],maxTime=isNumeric(maxValueModifier?.split("ms")[0])?Number(maxValueModifier.split("ms")[0]):DEFAULT_MAX_REPEAT_TIME_IN_MS;Alpine2.bind($el,{"x-data"(){return{__intervalId:void 0,__onPointerDown(e){var _a;isHtmlElement(e.target)&&!((_a=e.target)===null||_a===void 0)&&_a.hasPointerCapture(e.pointerId)&&e.target.releasePointerCapture(e.pointerId);let repeats=0;this.__intervalId=window.setInterval(()=>{evaluate2(expression),repeats+=1,repeats*time2>=maxTime&&window.clearInterval(this.__intervalId)},time2)},__onPointerUp(_e){window.clearInterval(this.__intervalId)},__onPointerLeave(_e){window.clearInterval(this.__intervalId)},destroy(){window.clearInterval(this.__intervalId)}}},"@pointerdown":"__onPointerDown","@pointerup.window":"__onPointerUp","@pointerleave":"__onPointerLeave"})}).before("bind")}function addUniqueItem(arr,item){arr.indexOf(item)===-1&&arr.push(item)}function removeItem(arr,item){const index=arr.indexOf(item);index>-1&&arr.splice(index,1)}const clamp=(min,max,v)=>v>max?max:v<min?min:v;function formatErrorMessage(message,errorCode){return errorCode?`${message}. For more information and steps for solving, visit https://motion.dev/troubleshooting/${errorCode}`:message}var ref;let warning=()=>{},invariant=()=>{};typeof process<"u"&&((ref=process.env)===null||ref===void 0?void 0:ref.NODE_ENV)!=="production"&&(warning=(check,message,errorCode)=>{!check&&typeof console<"u"&&console.warn(formatErrorMessage(message,errorCode))},invariant=(check,message,errorCode)=>{if(!check)throw new Error(formatErrorMessage(message,errorCode))});const MotionGlobalConfig={},isNumericalString=v=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(v),isObject=value=>typeof value=="object"&&value!==null,isZeroValueString=v=>/^0[^.\s]+$/u.test(v);function memo(callback){let result;return()=>(result===void 0&&(result=callback()),result)}const noop=any=>any,pipe=(...transformers)=>transformers.reduce((a,b)=>v=>b(a(v))),progress=(from,to,value)=>{const range=to-from;return range?(value-from)/range:1};let SubscriptionManager=class{add(handler4){return addUniqueItem(this.subscriptions,handler4),()=>removeItem(this.subscriptions,handler4)}notify(a,b,c){const numSubscriptions=this.subscriptions.length;if(numSubscriptions)if(numSubscriptions===1)this.subscriptions[0](a,b,c);else for(let i=0;i<numSubscriptions;i++){const handler4=this.subscriptions[i];handler4&&handler4(a,b,c)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}constructor(){this.subscriptions=[]}};const secondsToMilliseconds=seconds=>seconds*1e3,millisecondsToSeconds=milliseconds=>milliseconds/1e3,velocityPerSecond=(velocity,frameDuration)=>frameDuration?velocity*(1e3/frameDuration):0,warned=new Set;function warnOnce(condition,message,errorCode){condition||warned.has(message)||(console.warn(formatErrorMessage(message,errorCode)),warned.add(message))}const wrap=(min,max,v)=>{const rangeSize=max-min;return((v-min)%rangeSize+rangeSize)%rangeSize+min},calcBezier=(t,a1,a2)=>(((1-3*a2+3*a1)*t+(3*a2-6*a1))*t+3*a1)*t,subdivisionPrecision=1e-7,subdivisionMaxIterations=12;function binarySubdivide(x,lowerBound,upperBound,mX1,mX2){let currentX,currentT,i=0;do currentT=lowerBound+(upperBound-lowerBound)/2,currentX=calcBezier(currentT,mX1,mX2)-x,currentX>0?upperBound=currentT:lowerBound=currentT;while(Math.abs(currentX)>subdivisionPrecision&&++i<subdivisionMaxIterations);return currentT}function cubicBezier(mX1,mY1,mX2,mY2){if(mX1===mY1&&mX2===mY2)return noop;const getTForX=aX=>binarySubdivide(aX,0,1,mX1,mX2);return t=>t===0||t===1?t:calcBezier(getTForX(t),mY1,mY2)}const mirrorEasing=easing=>p=>p<=.5?easing(2*p)/2:(2-easing(2*(1-p)))/2,reverseEasing=easing=>p=>1-easing(1-p),backOut=cubicBezier(.33,1.53,.69,.99),backIn=reverseEasing(backOut),backInOut=mirrorEasing(backIn),anticipate=p=>p>=1?1:(p*=2)<1?.5*backIn(p):.5*(2-Math.pow(2,-10*(p-1))),circIn=p=>1-Math.sin(Math.acos(p)),circOut=reverseEasing(circIn),circInOut=mirrorEasing(circIn),easeIn=cubicBezier(.42,0,1,1),easeOut=cubicBezier(0,0,.58,1),easeInOut=cubicBezier(.42,0,.58,1),isEasingArray=ease2=>Array.isArray(ease2)&&typeof ease2[0]!="number";function getEasingForSegment(easing,i){return isEasingArray(easing)?easing[wrap(0,easing.length,i)]:easing}const isBezierDefinition=easing=>Array.isArray(easing)&&typeof easing[0]=="number",easingLookup={linear:noop,easeIn,easeInOut,easeOut,circIn,circInOut,circOut,backIn,backInOut,backOut,anticipate},isValidEasing=easing=>typeof easing=="string",easingDefinitionToFunction=definition=>
60{if(isBezierDefinition(definition)){invariant(definition.length===4,"Cubic bezier arrays must contain four numerical values.","cubic-bezier-length");const[x1,y1,x2,y2]=definition;return cubicBezier(x1,y1,x2,y2)}else if(isValidEasing(definition))return invariant(easingLookup[definition]!==void 0,`Invalid easing type '${definition}'`,"invalid-easing-type"),easingLookup[definition];return definition},stepsOrder=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"],statsBuffer={value:null,addProjectionMetrics:null};function createRenderStep(runNextFrame,stepName){let thisFrame=new Set,nextFrame=new Set,isProcessing=!1,flushNextFrame=!1;const toKeepAlive=new WeakSet;let latestFrameData={delta:0,timestamp:0,isProcessing:!1},numCalls=0;function triggerCallback(callback){toKeepAlive.has(callback)&&(step.schedule(callback),runNextFrame()),numCalls++,callback(latestFrameData)}const step={schedule:(callback,keepAlive=!1,immediate=!1)=>{const queue2=immediate&&isProcessing?thisFrame:nextFrame;return keepAlive&&toKeepAlive.add(callback),queue2.add(callback),callback},cancel:callback=>{nextFrame.delete(callback),toKeepAlive.delete(callback)},process:frameData2=>{if(latestFrameData=frameData2,isProcessing){flushNextFrame=!0;return}isProcessing=!0;const prevFrame=thisFrame;thisFrame=nextFrame,nextFrame=prevFrame,thisFrame.forEach(triggerCallback),stepName&&statsBuffer.value&&statsBuffer.value.frameloop[stepName].push(numCalls),numCalls=0,thisFrame.clear(),isProcessing=!1,flushNextFrame&&(flushNextFrame=!1,step.process(frameData2))}};return step}const maxElapsed$1=40;function createRenderBatcher(scheduleNextBatch,allowKeepAlive){let runNextFrame=!1,useDefaultElapsed=!0;const state={delta:0,timestamp:0,isProcessing:!1},flagRunNextFrame=()=>runNextFrame=!0,steps=stepsOrder.reduce((acc,key)=>(acc[key]=createRenderStep(flagRunNextFrame,allowKeepAlive?key:void 0),acc),{}),{setup,read,resolveKeyframes,preUpdate,update,preRender,render,postRender}=steps,processBatch=()=>{const useManualTiming=MotionGlobalConfig.useManualTiming,timestamp=useManualTiming?state.timestamp:performance.now();runNextFrame=!1,useManualTiming||(state.delta=useDefaultElapsed?1e3/60:Math.max(Math.min(timestamp-state.timestamp,maxElapsed$1),1)),state.timestamp=timestamp,state.isProcessing=!0,setup.process(state),read.process(state),resolveKeyframes.process(state),preUpdate.process(state),update.process(state),preRender.process(state),render.process(state),postRender.process(state),state.isProcessing=!1,runNextFrame&&allowKeepAlive&&(useDefaultElapsed=!1,scheduleNextBatch(processBatch))},wake=()=>{runNextFrame=!0,useDefaultElapsed=!0,state.isProcessing||scheduleNextBatch(processBatch)};return{schedule:stepsOrder.reduce((acc,key)=>{const step=steps[key];return acc[key]=(process2,keepAlive=!1,immediate=!1)=>(runNextFrame||wake(),step.schedule(process2,keepAlive,immediate)),acc},{}),cancel:process2=>{for(let i=0;i<stepsOrder.length;i++)steps[stepsOrder[i]].cancel(process2)},state,steps}}const{schedule:frame,cancel:cancelFrame,state:frameData,steps:frameSteps}=createRenderBatcher(typeof requestAnimationFrame<"u"?requestAnimationFrame:noop,!0);let now;function clearTime(){now=void 0}const time={now:()=>(now===void 0&&time.set(frameData.isProcessing||MotionGlobalConfig.useManualTiming?frameData.timestamp:performance.now()),now),set:newTime=>{now=newTime,queueMicrotask(clearTime)}},checkStringStartsWith=token=>key=>typeof key=="string"&&key.startsWith(token),isCSSVariableName=checkStringStartsWith("--"),startsAsVariableToken=checkStringStartsWith("var(--"),isCSSVariableToken=value=>startsAsVariableToken(value)?singleCssVariableRegex.test(value.split("/*")[0].trim()):!1,singleCssVariableRegex=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function containsCSSVariable(value){return typeof value!="string"?!1:value.split("/*")[0].includes("var(--")}const number={test:v=>typeof v=="number",parse:parseFloat,transform:v=>v},alpha={...number,transform:v=>clamp(0,1,v)},scale={...number,default:1},sanitize=v=>Math.round(v*1e5)/1e5,floatRegex=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function isNullish(v){return v==null}const singleColorRegex=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,isColorString=(type,testProp)=>v=>!!(typeof v=="string"&&singleColorRegex.test(v)&&v.startsWith(type)||testProp&&!isNullish(v)&&Object.prototype.hasOwnProperty.call(v,testProp)),splitColor=(aName,bName,cName)=>v=>{if(typeof v!="string")return v;const[a,b,c,alpha2]=v.match(floatRegex);return{[aName]:parseFloat(a),[bName]:parseFloat(b),[cName]:parseFloat(c),alph
60a:alpha2!==void 0?parseFloat(alpha2):1}},clampRgbUnit=v=>clamp(0,255,v),rgbUnit={...number,transform:v=>Math.round(clampRgbUnit(v))},rgba={test:isColorString("rgb","red"),parse:splitColor("red","green","blue"),transform:({red,green,blue,alpha:alpha$1=1})=>"rgba("+rgbUnit.transform(red)+", "+rgbUnit.transform(green)+", "+rgbUnit.transform(blue)+", "+sanitize(alpha.transform(alpha$1))+")"};function parseHex(v){let r="",g="",b="",a="";return v.length>5?(r=v.substring(1,3),g=v.substring(3,5),b=v.substring(5,7),a=v.substring(7,9)):(r=v.substring(1,2),g=v.substring(2,3),b=v.substring(3,4),a=v.substring(4,5),r+=r,g+=g,b+=b,a+=a),{red:parseInt(r,16),green:parseInt(g,16),blue:parseInt(b,16),alpha:a?parseInt(a,16)/255:1}}const hex={test:isColorString("#"),parse:parseHex,transform:rgba.transform},createUnitType=unit=>({test:v=>typeof v=="string"&&v.endsWith(unit)&&v.split(" ").length===1,parse:parseFloat,transform:v=>`${v}${unit}`}),degrees=createUnitType("deg"),percent=createUnitType("%"),px=createUnitType("px"),vh=createUnitType("vh"),vw=createUnitType("vw"),progressPercentage={...percent,parse:v=>percent.parse(v)/100,transform:v=>percent.transform(v*100)},hsla={test:isColorString("hsl","hue"),parse:splitColor("hue","saturation","lightness"),transform:({hue,saturation,lightness,alpha:alpha$1=1})=>"hsla("+Math.round(hue)+", "+percent.transform(sanitize(saturation))+", "+percent.transform(sanitize(lightness))+", "+sanitize(alpha.transform(alpha$1))+")"},color={test:v=>rgba.test(v)||hex.test(v)||hsla.test(v),parse:v=>rgba.test(v)?rgba.parse(v):hsla.test(v)?hsla.parse(v):hex.parse(v),transform:v=>typeof v=="string"?v:v.hasOwnProperty("red")?rgba.transform(v):hsla.transform(v),getAnimatableNone:v=>{const parsed=color.parse(v);return parsed.alpha=0,color.transform(parsed)}},colorRegex=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function test(v){var ref2,ref1;return isNaN(v)&&typeof v=="string"&&(((ref2=v.match(floatRegex))===null||ref2===void 0?void 0:ref2.length)||0)+(((ref1=v.match(colorRegex))===null||ref1===void 0?void 0:ref1.length)||0)>0}const NUMBER_TOKEN="number",COLOR_TOKEN="color",VAR_TOKEN="var",VAR_FUNCTION_TOKEN="var(",SPLIT_TOKEN="${}",complexRegex=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function analyseComplexValue(value){const originalValue=value.toString(),values=[],indexes={color:[],number:[],var:[]},types=[];let i=0;const split=originalValue.replace(complexRegex,parsedValue=>(color.test(parsedValue)?(indexes.color.push(i),types.push(COLOR_TOKEN),values.push(color.parse(parsedValue))):parsedValue.startsWith(VAR_FUNCTION_TOKEN)?(indexes.var.push(i),types.push(VAR_TOKEN),values.push(parsedValue)):(indexes.number.push(i),types.push(NUMBER_TOKEN),values.push(parseFloat(parsedValue))),++i,SPLIT_TOKEN)).split(SPLIT_TOKEN);return{values,split,indexes,types}}function parseComplexValue(v){return analyseComplexValue(v).values}function buildTransformer({split,types}){const numSections=split.length;return v=>{let output="";for(let i=0;i<numSections;i++)if(output+=split[i],v[i]!==void 0){const type=types[i];type===NUMBER_TOKEN?output+=sanitize(v[i]):type===COLOR_TOKEN?output+=color.transform(v[i]):output+=v[i]}return output}}function createTransformer(source){return buildTransformer(analyseComplexValue(source))}const convertNumbersToZero=v=>typeof v=="number"?0:color.test(v)?color.getAnimatableNone(v):v,convertToZero=(value,splitBefore)=>typeof value=="number"?splitBefore?.trim().endsWith("/")?value:0:convertNumbersToZero(value);function getAnimatableNone$1(v){const info=analyseComplexValue(v);return buildTransformer(info)(info.values.map((value,i)=>convertToZero(value,info.split[i])))}const complex={test,parse:parseComplexValue,createTransformer,getAnimatableNone:getAnimatableNone$1};function hueToRgb(p,q,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?p+(q-p)*6*t:t<1/2?q:t<2/3?p+(q-p)*(2/3-t)*6:p}function hslaToRgba({hue,saturation,lightness,alpha:alpha2}){hue/=360,saturation/=100,lightness/=100;let red=0,green=0,blue=0;if(!saturation)red=green=blue=lightness;else{const q=lightness<.5?lightness*(1+saturation):lightness+saturation-lightness*saturation,p=2*lightness-q;red=hueToRgb(p,q,hue+1/3),green=hueToRgb(p,q,hue),blue=hueToRgb(p,q,hue-1/3)}return{red:Math.round(red*255),green:Math.round(green*255),blue:Math.round(blue*255),alpha:alpha2}}function mixImmediate(a,b){return p=>p>
vendor: 11,975 bytes, line 60
600?b:a}const mixNumber$1=(from,to,progress2)=>from+(to-from)*progress2,mixLinearColor=(from,to,v)=>{const fromExpo=from*from,expo=v*(to*to-fromExpo)+fromExpo;return expo<0?0:Math.sqrt(expo)},colorTypes=[hex,rgba,hsla],getColorType=v=>colorTypes.find(type=>type.test(v));function asRGBA(color2){const type=getColorType(color2);if(warning(!!type,`'${color2}' is not an animatable color. Use the equivalent color code instead.`,"color-not-animatable"),!type)return!1;let model=type.parse(color2);return type===hsla&&(model=hslaToRgba(model)),model}const mixColor=(from,to)=>{const fromRGBA=asRGBA(from),toRGBA=asRGBA(to);if(!fromRGBA||!toRGBA)return mixImmediate(from,to);const blended={...fromRGBA};return v=>(blended.red=mixLinearColor(fromRGBA.red,toRGBA.red,v),blended.green=mixLinearColor(fromRGBA.green,toRGBA.green,v),blended.blue=mixLinearColor(fromRGBA.blue,toRGBA.blue,v),blended.alpha=mixNumber$1(fromRGBA.alpha,toRGBA.alpha,v),rgba.transform(blended))},invisibleValues=new Set(["none","hidden"]);function mixVisibility(origin,target){return invisibleValues.has(origin)?p=>p<=0?origin:target:p=>p>=1?target:origin}function mixNumber(a,b){return p=>mixNumber$1(a,b,p)}function getMixer(a){return typeof a=="number"?mixNumber:typeof a=="string"?isCSSVariableToken(a)?mixImmediate:color.test(a)?mixColor:mixComplex:Array.isArray(a)?mixArray:typeof a=="object"?color.test(a)?mixColor:mixObject:mixImmediate}function mixArray(a,b){const output=[...a],numValues=output.length,blendValue=a.map((v,i)=>getMixer(v)(v,b[i]));return p=>{for(let i=0;i<numValues;i++)output[i]=blendValue[i](p);return output}}function mixObject(a,b){const output={...a,...b},blendValue={};for(const key1 in output)a[key1]!==void 0&&b[key1]!==void 0&&(blendValue[key1]=getMixer(a[key1])(a[key1],b[key1]));return v=>{for(const key in blendValue)output[key]=blendValue[key](v);return output}}function matchOrder(origin,target){const orderedOrigin=[],pointers={color:0,var:0,number:0};for(let i=0;i<target.values.length;i++){const type=target.types[i],originIndex=origin.indexes[type][pointers[type]];var _originIndex;const originValue=(_originIndex=origin.values[originIndex])!==null&&_originIndex!==void 0?_originIndex:0;orderedOrigin[i]=originValue,pointers[type]++}return orderedOrigin}const mixComplex=(origin,target)=>{const template2=complex.createTransformer(target),originStats=analyseComplexValue(origin),targetStats=analyseComplexValue(target);return originStats.indexes.var.length===targetStats.indexes.var.length&&originStats.indexes.color.length===targetStats.indexes.color.length&&originStats.indexes.number.length>=targetStats.indexes.number.length?invisibleValues.has(origin)&&!targetStats.values.length||invisibleValues.has(target)&&!originStats.values.length?mixVisibility(origin,target):pipe(mixArray(matchOrder(originStats,targetStats),targetStats.values),template2):(warning(!0,`Complex values '${origin}' and '${target}' too different to mix. Ensure all colors are of the same type, and that each contains the same quantity of number and color values. Falling back to instant transition.`,"complex-values-different"),mixImmediate(origin,target))};function mix(from,to,p){return typeof from=="number"&&typeof to=="number"&&typeof p=="number"?mixNumber$1(from,to,p):getMixer(from)(from,to)}const frameloopDriver=update=>{const passTimestamp=({timestamp})=>update(timestamp);return{start:(keepAlive=!0)=>frame.update(passTimestamp,keepAlive),stop:()=>cancelFrame(passTimestamp),now:()=>frameData.isProcessing?frameData.timestamp:time.now()}},generateLinearEasing=(easing,duration,resolution2=10)=>{let points="";const numPoints=Math.max(Math.round(duration/resolution2),2);for(let i=0;i<numPoints;i++)points+=Math.round(easing(i/(numPoints-1))*1e4)/1e4+", ";return`linear(${points.substring(0,points.length-2)})`},maxGeneratorDuration=2e4;function calcGeneratorDuration(generator){let duration=0;const timeStep=50;let state=generator.next(duration);for(;!state.done&&duration<maxGeneratorDuration;)duration+=timeStep,state=generator.next(duration);return duration>=maxGeneratorDuration?1/0:duration}function createGeneratorEasing(options2,scale2=100,createGenerator){const generator=createGenerator({...options2,keyframes:[0,scale2]}),duration=Math.min(calcGeneratorDuration(generator),maxGeneratorDuration);return{type:"keyframes",ease:progress2=>generator.next(duration*progress2).value/scale2,duration:millisecondsToSeconds(duration)}}const springDefaults={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function calcAngularFreq(undampedFreq,dampingRatio){return undampedFreq*Math.sqrt(1-dampingRatio*dampingRatio)}const rootIterations=12;function approximateRoot(envelope,derivative,initialGuess){let result=initialGuess;for(let i=1;i<rootIterations;i++)result=result-envelope(result)/derivative(result);return result}const safeMin=.001;function findSpring({duration=springDefaults.duration,bounce=springDefaults.bounce,velocity=springDefaults.velocity,mass=springDefaults.mass}){let envelope,derivative;warning(duration<=secondsToMilliseconds(springDefaults.maxDuration),"Spring duration must be 10 seconds or less","spring-duration-limit");let dampingRatio=1-bounce;dampingRatio=clamp(springDefaults.minDamping,springDefaults.maxDamping,dampingRatio),duration=clamp(springDefaults.minDuration,springDefaults.maxDuration,millisecondsToSeconds(duration)),dampingRatio<1?(envelope=undampedFreq=>{const exponentialDecay=undampedFreq*dampingRatio,delta=exponentialDecay*duration,a=exponentialDecay-velocity,b=calcAngularFreq(undampedFreq,dampingRatio),c=Math.exp(-delta);return safeMin-a/b*c},derivative=undampedFreq=>{const delta=undampedFreq*dampingRatio*duration,d=delta*velocity+velocity,e=Math.pow(dampingRatio,2)*Math.pow(undampedFreq,2)*duration,f=Math.exp(-delta),g=calcAngularFreq(Math.pow(undampedFreq,2),dampingRatio);return(-envelope(undampedFreq)+safeMin>0?-1:1)*((d-e)*f)/g}):(envelope=undampedFreq=>{const a=Math.exp(-undampedFreq*duration),b=(undampedFreq-velocity)*duration+1;return-safeMin+a*b},derivative=undampedFreq=>{const a=Math.exp(-undampedFreq*duration),b=(velocity-undampedFreq)*(duration*duration);return a*b});const initialGuess=5/duration,undampedFreq1=approximateRoot(envelope,derivative,initialGuess);if(duration=secondsToMilliseconds(duration),isNaN(undampedFreq1))return{stiffness:springDefaults.stiffness,damping:springDefaults.damping,duration};{const stiffness=Math.pow(undampedFreq1,2)*mass;return{stiffness,damping:dampingRatio*2*Math.sqrt(mass*stiffness),duration}}}const durationKeys=["duration","bounce"],physicsKeys=["stiffness","damping","mass"];function isSpringType(options2,keys2){return keys2.some(key=>options2[key]!==void 0)}function getSpringOptions(options2){let springOptions={velocity:springDefaults.velocity,stiffness:springDefaults.stiffness,damping:springDefaults.damping,mass:springDefaults.mass,isResolvedFromDuration:!1,...options2};if(!isSpringType(options2,physicsKeys)&&isSpringType(options2,durationKeys))if(springOptions.velocity=0,options2.visualDuration){const visualDuration=options2.visualDuration,root=2*Math.PI/(visualDuration*1.2),stiffness=root*root,damping=2*clamp(.05,1,1-(options2.bounce||0))*Math.sqrt(stiffness);springOptions={...springOptions,mass:springDefaults.mass,stiffness,damping}}else{const derived=findSpring({...options2,velocity:0});springOptions={...springOptions,...derived,mass:springDefaults.mass},springOptions.isResolvedFromDuration=!0}return springOptions}function spring(optionsOrVisualDuration=springDefaults.visualDuration,bounce=springDefaults.bounce){const options2=typeof optionsOrVisualDuration!="object"?{visualDuration:optionsOrVisualDuration,keyframes:[0,1],bounce}:optionsOrVisualDuration;let{restSpeed,restDelta}=options2;const origin=options2.keyframes[0],target=options2.keyframes[options2.keyframes.length-1],state={done:!1,value:origin},{stiffness,damping,mass,duration,velocity,isResolvedFromDuration}=getSpringOptions({...options2,velocity:-millisecondsToSeconds(options2.velocity||0)}),initialVelocity=velocity||0,dampingRatio=damping/(2*Math.sqrt(stiffness*mass)),initialDelta=target-origin,undampedAngularFreq=millisecondsToSeconds(Math.sqrt(stiffness/mass)),isGranularScale=Math.abs(initialDelta)<5;restSpeed||(restSpeed=isGranularScale?springDefaults.restSpeed.granular:springDefaults.restSpeed.default),restDelta||(restDelta=isGranularScale?springDefaults.restDelta.granular:springDefaults.restDelta.default);let resolveSpring,resolveVelocity,angularFreq,A,sinCoeff,cosCoeff;if(dampingRatio<1)angularFreq=calcAngularFreq(undampedAngularFreq,dampingRatio),A=(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/angularFreq,resolveSpring=t=>{const envelope=Math.exp(-dampingRatio*undampedAngularFreq*t);return target-envelope*(A*Math.sin(angularFreq*t)+initialDelta*Math.cos(angularFreq*t))},sinCoeff=dampingRatio*undampedAngularFreq*A+initialDelta*angularFreq,cosCoeff=dampingRatio*undampedAngularFreq*initialDelta-A*angularFreq,resolveVelocity=t=>Math.exp(-dampingRatio*undampedAngularFreq*t)*(sinCoeff*Math.sin(angularFreq*t)+cosCoeff*Math.cos(angularFreq*t));else if(dampingRatio===1){resolveSpring=t=>target-Math.exp(-undampedAngularFreq*t)*(initialDelta+(initialVelocity+undampedAngularFreq*initialDelta)*t);const C=initialVelocity+undampedAngularFreq*initialDelta;resolveVelocity=t=>Math.exp(-undampedAngularFreq*t)*(undampedAngularFreq*C*t-initialVelocity)}else{const dampedAngularFreq=undampedAngularFreq*Math.sqrt(dampingRatio*dampingRatio-1);resolveSpring=t=>{const envelope=Math.exp(-dampingRatio*undampedAngularFreq*t),freqForT=Math.min(dampedAngularFreq*t,300);return target-envelope*((initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)*Math.sinh(freqForT)+dampedAngularFreq*initialDelta*Math.cosh(freqForT))/dampedAngularFreq};const P=(initialVelocity+dampingRatio*undampedAngularFreq*initialDelta)/dampedAngularFreq,sinhCoeff=dampingRatio*undampedAngularFreq*P-initialDelta*dampedAngularFreq,coshCoeff=dampingRatio*undampedAngularFreq*initialDelta-P*dampedAngularFreq;resolveVelocity=t=>{const envelope=Math.exp(-dampingRatio*undampedAngularFreq*t),freqForT=Math.min(dampedAngularFreq*t,300);return envelope*(sinhCoeff*Math.sinh(freqForT)+coshCoeff*Math.cosh(freqForT))}}const generator={calculatedDuration:isResolvedFromDuration&&duration||null,velocity:t=>secondsToMilliseconds(resolveVelocity(t)),next:t=>{if(!isResolvedFromDuration&&dampingRatio<1){const envelope=Math.exp(-dampingRatio*undampedAngularFreq*t),sin=Math.sin(angularFreq*t),cos=Math.cos(angularFreq*t),current2=target-envelope*(A*sin+initialDelta*cos),currentVelocity=secondsToMilliseconds(envelope*(sinCoeff*sin+cosCoeff*cos));return state.done=Math.abs(currentVelocity)<=restSpeed&&Math.abs(target-current2)<=restDelta,state.value=state.done?target:current2,state}const current=resolveSpring(t);if(isResolvedFromDuration)state.done=t>=duration;else{const currentVelocity=secondsToMilliseconds(resolveVelocity(t));state.done=Math.abs(currentVelocity)<=restSpeed&&Math.abs(target-current)<=restDelta}return state.value=state.done?target:current,state},toString:()=>{const calculatedDuration=Math.min(calcGeneratorDuration(generator),maxGeneratorDuration),easing=generateLinearEasing(progress2=>generator.next(calculatedDuration*progress2).value,calculatedDuration,30);return calculatedDuration+"ms "+easing},toTransition:()=>{}};return generator}spring.applyToOptions=options2=>{const generatorOptions=createGeneratorEasing(options2,100,spring);return options2.ease=generatorOptions.ease,options2.duration=secondsToMilliseconds(generatorOptions.duration),options2.type="keyframes",options2};const velocitySampleDuration=5;function getGeneratorVelocity(resolveValue,t,current){const prevT=Math.max(t-velocitySampleDuration,0);return velocityPerSecond(current-resolveValue(prevT),t-prevT)}
60function inertia({keyframes:keyframes2,velocity=0,power=.8,timeConstant=325,bounceDamping=10,bounceStiffness=500,modifyTarget,min,max,restDelta=.5,restSpeed}){const origin=keyframes2[0],state={done:!1,value:origin},isOutOfBounds=v=>min!==void 0&&v<min||max!==void 0&&v>max,nearestBoundary=v=>min===void 0?max:max===void 0||Math.abs(min-v)<Math.abs(max-v)?min:max;let amplitude=power*velocity;const ideal=origin+amplitude,target=modifyTarget===void 0?ideal:modifyTarget(ideal);target!==ideal&&(amplitude=target-origin);const calcDelta=t=>-amplitude*Math.exp(-t/timeConstant),calcLatest=t=>target+calcDelta(t),applyFriction=t=>{const delta=calcDelta(t),latest=calcLatest(t);state.done=Math.abs(delta)<=restDelta,state.value=state.done?target:latest};let timeReachedBoundary,spring$1;const checkCatchBoundary=t=>{isOutOfBounds(state.value)&&(timeReachedBoundary=t,spring$1=spring({keyframes:[state.value,nearestBoundary(state.value)],velocity:getGeneratorVelocity(calcLatest,t,state.value),damping:bounceDamping,stiffness:bounceStiffness,restDelta,restSpeed}))};return checkCatchBoundary(0),{calculatedDuration:null,next:t=>{let hasUpdatedFrame=!1;return!spring$1&&timeReachedBoundary===void 0&&(hasUpdatedFrame=!0,applyFriction(t),checkCatchBoundary(t)),timeReachedBoundary!==void 0&&t>=timeReachedBoundary?spring$1.next(t-timeReachedBoundary):(!hasUpdatedFrame&&applyFriction(t),state)}}}function createMixers(output,ease2,customMixer){const mixers=[],mixerFactory=customMixer||MotionGlobalConfig.mix||mix,numMixers=output.length-1;for(let i=0;i<numMixers;i++){let mixer=mixerFactory(output[i],output[i+1]);if(ease2){const easingFunction=Array.isArray(ease2)?ease2[i]||noop:ease2;mixer=pipe(easingFunction,mixer)}mixers.push(mixer)}return mixers}function interpolate(input,output,{clamp:isClamp=!0,ease:ease2,mixer}={}){const inputLength=input.length;if(invariant(inputLength===output.length,"Both input and output ranges must be the same length","range-length"),inputLength===1)return()=>output[0];if(inputLength===2&&output[0]===output[1])return()=>output[1];const isZeroDeltaRange=input[0]===input[1];input[0]>input[inputLength-1]&&(input=[...input].reverse(),output=[...output].reverse());const mixers=createMixers(output,ease2,mixer),numMixers=mixers.length,interpolator=v=>{if(isZeroDeltaRange&&v<input[0])return output[0];let i=0;if(numMixers>1)for(;i<input.length-2&&!(v<input[i+1]);i++);const progressInRange=progress(input[i],input[i+1],v);return mixers[i](progressInRange)};return isClamp?v=>interpolator(clamp(input[0],input[inputLength-1],v)):interpolator}function fillOffset(offset,remaining){const min=offset[offset.length-1];for(let i=1;i<=remaining;i++){const offsetProgress=progress(0,remaining,i);offset.push(mixNumber$1(min,1,offsetProgress))}}function defaultOffset$1(arr){const offset=[0];return fillOffset(offset,arr.length-1),offset}function convertOffsetToTimes(offset,duration){return offset.map(o=>o*duration)}function defaultEasing(values,easing){return values.map(()=>easing||easeInOut).splice(0,values.length-1)}function keyframes({duration=300,keyframes:keyframeValues,times:times2,ease:ease2="easeInOut"}){const easingFunctions=isEasingArray(ease2)?ease2.map(easingDefinitionToFunction):easingDefinitionToFunction(ease2),state={done:!1,value:keyframeValues[0]},absoluteTimes=convertOffsetToTimes(times2&&times2.length===keyframeValues.length?times2:defaultOffset$1(keyframeValues),duration),mapTimeToKeyframe=interpolate(absoluteTimes,keyframeValues,{ease:Array.isArray(easingFunctions)?easingFunctions:defaultEasing(keyframeValues,easingFunctions)});return{calculatedDuration:duration,next:t=>(state.value=mapTimeToKeyframe(t),state.done=t>=duration,state)}}const isNotNull=value=>value!==null;function getFinalKeyframe(keyframes2,{repeat,repeatType="loop"},finalKeyframe,speed=1){const resolvedKeyframes=keyframes2.filter(isNotNull),index=speed<0||repeat&&repeatType!=="loop"&&repeat%2===1?0:resolvedKeyframes.length-1;return!index||finalKeyframe===void 0?resolvedKeyframes[index]:finalKeyframe}const transitionTypeMap={decay:inertia,inertia,tween:keyframes,keyframes,spring};function replaceTransitionType(transition2){typeof transition2.type=="string"&&(transition2.type=transitionTypeMap[transition2.type])}let WithPromise=class{get finished(){return this._finished}updateFinished(){this._finished=new Promise(resolve=>{this.resolve=resolve})}notifyFinished(){this.resolve()}then(onResolve,onReject){return this.finished.then(onResolve,onReject)}constructor(){this.updateFinished()}};const percentToProgress=percent2=>percent2/100;let JSAnimation=class extends WithPromise{initAnimation(){const{options:options2}=this;replaceTransitionType(options2);const{type=keyframes,repeat=0,repeatDelay=0,repeatType,velocity=0}=options2;let{keyframes:keyframes$1}=options2;const generatorFactory=type||keyframes;process.env.NODE_ENV!=="production"&&generatorFactory!==keyframes&&invariant(keyframes$1.length<=2,`Only two keyframes currently supported with spring and inertia animations. Trying to animate ${keyframes$1}`,"spring-two-frames"),generatorFactory!==keyframes&&typeof keyframes$1[
vendor: 4,173 bytes, line 60
600]!="number"&&(this.mixKeyframes=pipe(percentToProgress,mix(keyframes$1[0],keyframes$1[1])),keyframes$1=[0,100]);const generator=generatorFactory({...options2,keyframes:keyframes$1});repeatType==="mirror"&&(this.mirroredGenerator=generatorFactory({...options2,keyframes:[...keyframes$1].reverse(),velocity:-velocity})),generator.calculatedDuration===null&&(generator.calculatedDuration=calcGeneratorDuration(generator));const{calculatedDuration}=generator;this.calculatedDuration=calculatedDuration,this.resolvedDuration=calculatedDuration+repeatDelay,this.totalDuration=this.resolvedDuration*(repeat+1)-repeatDelay,this.generator=generator}updateTime(timestamp){const animationTime=Math.round(timestamp-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=animationTime}tick(timestamp,sample=!1){const{generator,totalDuration,mixKeyframes,mirroredGenerator,resolvedDuration,calculatedDuration}=this;if(this.startTime===null)return generator.next(0);const{delay:delay2=0,keyframes:keyframes1,repeat,repeatType,repeatDelay,type,onUpdate,finalKeyframe}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,timestamp):this.speed<0&&(this.startTime=Math.min(timestamp-totalDuration/this.speed,this.startTime)),sample?this.currentTime=timestamp:this.updateTime(timestamp);const timeWithoutDelay=this.currentTime-delay2*(this.playbackSpeed>=0?1:-1),isInDelayPhase=this.playbackSpeed>=0?timeWithoutDelay<0:timeWithoutDelay>totalDuration;this.currentTime=Math.max(timeWithoutDelay,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=totalDuration);let elapsed=this.currentTime,frameGenerator=generator;if(repeat){const progress2=Math.min(this.currentTime,totalDuration)/resolvedDuration;let currentIteration=Math.floor(progress2),iterationProgress=progress2%1;!iterationProgress&&progress2>=1&&(iterationProgress=1),iterationProgress===1&&currentIteration--,currentIteration=Math.min(currentIteration,repeat+1),currentIteration%2&&(repeatType==="reverse"?(iterationProgress=1-iterationProgress,repeatDelay&&(iterationProgress-=repeatDelay/resolvedDuration)):repeatType==="mirror"&&(frameGenerator=mirroredGenerator)),elapsed=clamp(0,1,iterationProgress)*resolvedDuration}let state;isInDelayPhase?(this.delayState.value=keyframes1[0],state=this.delayState):state=frameGenerator.next(elapsed),mixKeyframes&&!isInDelayPhase&&(state.value=mixKeyframes(state.value));let{done}=state;!isInDelayPhase&&calculatedDuration!==null&&(done=this.playbackSpeed>=0?this.currentTime>=totalDuration:this.currentTime<=0);const isAnimationFinished=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&done);return isAnimationFinished&&type!==inertia&&(state.value=getFinalKeyframe(keyframes1,this.options,finalKeyframe,this.speed)),onUpdate&&onUpdate(state.value),isAnimationFinished&&this.finish(),state}then(resolve,reject){return this.finished.then(resolve,reject)}get duration(){return millisecondsToSeconds(this.calculatedDuration)}get iterationDuration(){const{delay:delay2=0}=this.options||{};return this.duration+millisecondsToSeconds(delay2)}get time(){return millisecondsToSeconds(this.currentTime)}set time(newTime){newTime=secondsToMilliseconds(newTime),this.currentTime=newTime,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=newTime:this.driver&&(this.startTime=this.driver.now()-newTime/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=newTime,this.tick(newTime))}getGeneratorVelocity(){const t=this.currentTime;if(t<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(t);const current=this.generator.next(t).value;return getGeneratorVelocity(s=>this.generator.next(s).value,t,current)}get speed(){return this.playbackSpeed}set speed(newSpeed){const hasChanged2=this.playbackSpeed!==newSpeed;hasChanged2&&this.driver&&this.updateTime(time.now()),this.playbackSpeed=newSpeed,hasChanged2&&this.driver&&(this.time=millisecondsToSeconds(this.currentTime))}play(){var _options,ref2;if(this.isStopped)return;const{driver=frameloopDriver,startTime}=this.options;
60this.driver||(this.driver=driver(timestamp=>this.tick(timestamp))),(ref2=(_options=this.options).onPlay)===null||ref2===void 0||ref2.call(_options);const now2=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=now2):this.holdTime!==null?this.startTime=now2-this.holdTime:this.startTime||(this.startTime=startTime??now2),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(time.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var _options,ref2;this.notifyFinished(),this.teardown(),this.state="finished",(ref2=(_options=this.options).onComplete)===null||ref2===void 0||ref2.call(_options)}cancel(){var _options,ref2;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(ref2=(_options=this.options).onCancel)===null||ref2===void 0||ref2.call(_options)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(sampleTime){return this.startTime=0,this.tick(sampleTime,!0)}attachTimeline(timeline){var ref2;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(ref2=this.driver)===null||ref2===void 0||ref2.stop(),timeline.observe(this)}constructor(options2){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var _options,ref2;const{motionValue:motionValue2}=this.options;motionValue2&&motionValue2.updatedAt!==time.now()&&this.tick(time.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(ref2=(_options=this.options).onStop)===null||ref2===void 0||ref2.call(_options))},this.options=options2,this.initAnimation(),this.play(),options2.autoplay===!1&&this.pause()}};function fillWildcards(keyframes2){for(let i=1;i<keyframes2.length;i++){var _i;(_i=keyframes2[i])!==null&&_i!==void 0||(keyframes2[i]=keyframes2[i-1])}}const radToDeg=rad=>rad*180/Math.PI,rotate=v=>{const angle=radToDeg(Math.atan2(v[1],v[0]));return rebaseAngle(angle)},matrix2dParsers={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:v=>(Math.abs(v[0])+Math.abs(v[3]))/2,rotate,rotateZ:rotate,skewX:v=>radToDeg(Math.atan(v[1])),skewY:v=>radToDeg(Math.atan(v[2])),skew:v=>(Math.abs(v[1])+Math.abs(v[2]))/2},rebaseAngle=angle=>(angle=angle%360,angle<0&&(angle+=360),angle),rotateZ=rotate,scaleX=v=>Math.sqrt(v[0]*v[0]+v[1]*v[1]),scaleY=v=>Math.sqrt(v[4]*v[4]+v[5]*v[5]),matrix3dParsers={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX,scaleY,scale:v=>(scaleX(v)+scaleY(v))/2,rotateX:v=>rebaseAngle(radToDeg(Math.atan2(v[6],v[5]))),rotateY:v=>rebaseAngle(radToDeg(Math.atan2(-v[2],v[0]))),rotateZ,rotate:rotateZ,skewX:v=>radToDeg(Math.atan(v[4])),skewY:v=>radToDeg(Math.atan(v[1])),skew:v=>(Math.abs(v[1])+Math.abs(v[4]))/2};function defaultTransformValue(name){return name.includes("scale")?1:0}function parseValueFromTransform(transform2,name){if(!transform2||transform2==="none")return defaultTransformValue(name);const matrix3dMatch=transform2.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let parsers,match;if(matrix3dMatch)parsers=matrix3dParsers,match=matrix3dMatch;else{const matrix2dMatch=transform2.match(/^matrix\(([-\d.e\s,]+)\)$/u);parsers=matrix2dParsers,match=matrix2dMatch}if(!match)return defaultTransformValue(name);const valueParser=parsers[name],values=match[1].split(",").map(convertTransformToNumber);return typeof valueParser=="function"?valueParser(values):values[valueParser]}const readTransformValue=(instance,name)=>{const{transform:transform2="none"}=getComputedStyle(instance);return parseValueFromTransform(transform2,name)};function convertTransformToNumber(value){return parseFloat(value.trim())}const transformPropOrder=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],transformProps=new Set([...transformPropOrder,"pathRotation"]),isNumOrPxType=v=>v===number||v===px,transformKeys=new Set(["x","y","z"]),nonTranslationalTransformKeys=transformPropOrder.filter(key=>!transformKeys.has(key));function removeNonTranslationalTransform(visualElement){const removedTransforms=[];return nonTranslationalTransformKeys.forEach(key=>{const value=visualElement.getValue(key);value!==void 0&&(removedTransforms.push([key,value.get()]),value.set(key.startsWith("scale")?1:0))}),removedTransforms}const positionalValues={width:({x},{paddingLeft="0",paddingRight="0",boxSizing})=>{const width=x.max-x.min;return boxSizing==="border-box"?width:width-parseFloat(paddingLeft)-parseFloat(paddingRight)},height:({y},{paddingTop="0",paddingBottom="0",boxSizing})=>{const height=y.max-y.min;return boxSizing==="border-box"?height:height-parseFloat(paddingTop)-parseFloat(paddingBottom)},top:(_bbox,{top})=>
60parseFloat(top),left:(_bbox,{left})=>parseFloat(left),bottom:({y},{top})=>parseFloat(top)+(y.max-y.min),right:({x},{left})=>parseFloat(left)+(x.max-x.min),x:(_bbox,{transform:transform2})=>parseValueFromTransform(transform2,"x"),y:(_bbox,{transform:transform2})=>parseValueFromTransform(transform2,"y")};positionalValues.translateX=positionalValues.x,positionalValues.translateY=positionalValues.y;const toResolve=new Set;let isScheduled=!1,anyNeedsMeasurement=!1,isForced=!1;function measureAllKeyframes(){if(anyNeedsMeasurement){const resolversToMeasure=Array.from(toResolve).filter(resolver=>resolver.needsMeasurement),elementsToMeasure=new Set(resolversToMeasure.map(resolver=>resolver.element)),transformsToRestore=new Map;elementsToMeasure.forEach(element=>{const removedTransforms=removeNonTranslationalTransform(element);removedTransforms.length&&(transformsToRestore.set(element,removedTransforms),element.render())}),resolversToMeasure.forEach(resolver=>resolver.measureInitialState()),elementsToMeasure.forEach(element=>{element.render();const restore=transformsToRestore.get(element);restore&&restore.forEach(([key,value])=>{var ref2;(ref2=element.getValue(key))===null||ref2===void 0||ref2.set(value)})}),resolversToMeasure.forEach(resolver=>resolver.measureEndState()),resolversToMeasure.forEach(resolver=>{resolver.suspendedScrollY!==void 0&&window.scrollTo(0,resolver.suspendedScrollY)})}anyNeedsMeasurement=!1,isScheduled=!1,toResolve.forEach(resolver=>resolver.complete(isForced)),toResolve.clear()}function readAllKeyframes(){toResolve.forEach(resolver=>{resolver.readKeyframes(),resolver.needsMeasurement&&(anyNeedsMeasurement=!0)})}function flushKeyframeResolvers(){isForced=!0,readAllKeyframes(),measureAllKeyframes(),isForced=!1}let KeyframeResolver=class{scheduleResolve(){this.state="scheduled",this.isAsync?(toResolve.add(this),isScheduled||(isScheduled=!0,frame.read(readAllKeyframes),frame.resolveKeyframes(measureAllKeyframes))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes,name,element,motionValue:motionValue2}=this;if(unresolvedKeyframes[0]===null){const currentValue=motionValue2?.get(),finalKeyframe=unresolvedKeyframes[unresolvedKeyframes.length-1];if(currentValue!==void 0)unresolvedKeyframes[0]=currentValue;else if(element&&name){const valueAsRead=element.readValue(name,finalKeyframe);valueAsRead!=null&&(unresolvedKeyframes[0]=valueAsRead)}unresolvedKeyframes[0]===void 0&&(unresolvedKeyframes[0]=finalKeyframe),motionValue2&&currentValue===void 0&&motionValue2.set(unresolvedKeyframes[0])}fillWildcards(unresolvedKeyframes)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(isForcedComplete=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,isForcedComplete),toResolve.delete(this)}cancel(){this.state==="scheduled"&&(toResolve.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}constructor(unresolvedKeyframes,onComplete,name,motionValue2,element,isAsync=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...unresolvedKeyframes],this.onComplete=onComplete,this.name=name,this.motionValue=motionValue2,this.element=element,this.isAsync=isAsync}};const isCSSVar=name=>name.startsWith("--");function setStyle(element,name,value){isCSSVar(name)?element.style.setProperty(name,value):element.style[name]=value}const supportsFlags={};function memoSupports(callback,supportsFlag){const memoized=memo(callback);var _supportsFlag;return()=>(_supportsFlag=supportsFlags[supportsFlag])!==null&&_supportsFlag!==void 0?_supportsFlag:memoized()}const supportsScrollTimeline=memoSupports(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),supportsViewTimeline=memoSupports(()=>window.ViewTimeline!==void 0,"viewTimeline"),supportsLinearEasing=memoSupports(()=>{try{document.createElement("div").animate({opacity:0}
60,{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),cubicBezierAsString=([a,b,c,d])=>`cubic-bezier(${a}, ${b}, ${c}, ${d})`,supportedWaapiEasing={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:cubicBezierAsString([0,.65,.55,1]),circOut:cubicBezierAsString([.55,0,1,.45]),backIn:cubicBezierAsString([.31,.01,.66,-.59]),backOut:cubicBezierAsString([.33,1.53,.69,.99])};function mapEasingToNativeEasing(easing,duration){if(easing)return typeof easing=="function"?supportsLinearEasing()?generateLinearEasing(easing,duration):"ease-out":isBezierDefinition(easing)?cubicBezierAsString(easing):Array.isArray(easing)?easing.map(segmentEasing=>mapEasingToNativeEasing(segmentEasing,duration)||supportedWaapiEasing.easeOut):supportedWaapiEasing[easing]}function startWaapiAnimation(element,valueName,keyframes2,{delay:delay2=0,duration=300,repeat=0,repeatType="loop",ease:ease2="easeOut",times:times2}={},pseudoElement=void 0){const keyframeOptions={[valueName]:keyframes2};times2&&(keyframeOptions.offset=times2);const easing=mapEasingToNativeEasing(ease2,duration);Array.isArray(easing)&&(keyframeOptions.easing=easing);const options2={delay:delay2,duration,easing:Array.isArray(easing)?"linear":easing,fill:"both",iterations:repeat+1,direction:repeatType==="reverse"?"alternate":"normal"};return pseudoElement&&(options2.pseudoElement=pseudoElement),element.animate(keyframeOptions,options2)}function isGenerator(type){return typeof type=="function"&&"applyToOptions"in type}function applyGeneratorOptions({type,...options2}){if(isGenerator(type)&&supportsLinearEasing())return type.applyToOptions(options2);var _duration;(_duration=options2.duration)!==null&&_duration!==void 0||(options2.duration=300);var _ease;return(_ease=options2.ease)!==null&&_ease!==void 0||(options2.ease="easeOut"),options2}let NativeAnimation=class extends WithPromise{play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var _animation,ref2;(ref2=(_animation=this.animation).finish)===null||ref2===void 0||ref2.call(_animation)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state}=this;state==="idle"||state==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var ref2;const element=(ref2=this.options)===null||ref2===void 0?void 0:ref2.element;if(!this.isPseudoElement&&element?.isConnected){var _animation,ref1;(ref1=(_animation=this.animation).commitStyles)===null||ref1===void 0||ref1.call(_animation)}}get duration(){var ref2,ref22;const duration=((ref2=this.animation.effect)===null||ref2===void 0||(ref22=ref2.getComputedTiming)===null||ref22===void 0?void 0:ref22.call(ref2).duration)||0;return millisecondsToSeconds(Number(duration))}get iterationDuration(){const{delay:delay2=0}=this.options||{};return this.duration+millisecondsToSeconds(delay2)}get time(){return millisecondsToSeconds(Number(this.animation.currentTime)||0)}set time(newTime){const wasFinished=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=secondsToMilliseconds(newTime),wasFinished&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(newSpeed){newSpeed<0&&(this.finishedTime=null),this.animation.playbackRate=newSpeed}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){var _manualStartTime;return(_manualStartTime=this.manualStartTime)!==null&&_manualStartTime!==void 0?_manualStartTime:Number(this.animation.startTime)}set startTime(newStartTime){this.manualStartTime=this.animation.startTime=newStartTime}attachTimeline({timeline,rangeStart,rangeEnd,observe}){if(this.allowFlatten){var ref2;(ref2=this.animation.effect)===null||ref2===void 0||ref2.updateTiming({easing:"linear"})}return this.animation.onfinish=null,timeline&&supportsScrollTimeline()?(this.animation.timeline=timeline,rangeStart&&(this.animation.rangeStart=rangeStart),rangeEnd&&(this.animation.rangeEnd=rangeEnd),noop):observe(this)}constructor(options2){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!options2)return;const{element,name,keyframes:keyframes2,pseudoElement,allowFlatten=!1,finalKeyframe,onComplete}=options2;this.isPseudoElement=!!pseudoElement,this.allowFlatten=allowFlatten,this.options=options2,invariant(typeof options2.type!="string",`Mini animate() doesn't support "type" as a string.`,"mini-spring");const transition2=applyGeneratorOptions(options2);this.animation=startWaapiAnimation(element,name,keyframes2,transition2,pseudoElement),transition2.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>
60{if(this.finishedTime=this.time,!pseudoElement){const keyframe=getFinalKeyframe(keyframes2,this.options,finalKeyframe,this.speed);this.updateMotionValue&&this.updateMotionValue(keyframe),setStyle(element,name,keyframe),this.animation.cancel()}onComplete?.(),this.notifyFinished()}}};const unsupportedEasingFunctions={anticipate,backInOut,circInOut};function isUnsupportedEase(key){return key in unsupportedEasingFunctions}function replaceStringEasing(transition2){typeof transition2.ease=="string"&&isUnsupportedEase(transition2.ease)&&(transition2.ease=unsupportedEasingFunctions[transition2.ease])}const sampleDelta=10;let NativeAnimationExtended=class extends NativeAnimation{updateMotionValue(value){const{motionValue:motionValue2,onUpdate,onComplete,element,...options2}=this.options;if(!motionValue2)return;if(value!==void 0){motionValue2.set(value);return}const sampleAnimation=new JSAnimation({...options2,autoplay:!1}),sampleTime=Math.max(sampleDelta,time.now()-this.startTime),delta=clamp(0,sampleDelta,sampleTime-sampleDelta),current=sampleAnimation.sample(sampleTime).value,{name}=this.options;element&&name&&setStyle(element,name,current),motionValue2.setWithVelocity(sampleAnimation.sample(Math.max(0,sampleTime-delta)).value,current,delta),sampleAnimation.stop()}constructor(options2){replaceStringEasing(options2),replaceTransitionType(options2),super(options2),options2.startTime!==void 0&&options2.autoplay!==!1&&(this.startTime=options2.startTime),this.options=options2}};const isAnimatable=(value,name)=>name==="zIndex"?!1:!!(typeof value=="number"||Array.isArray(value)||typeof value=="string"&&(complex.test(value)||value==="0")&&!value.startsWith("url("));function hasKeyframesChanged(keyframes2){const current=keyframes2[0];if(keyframes2.length===1)return!0;for(let i=0;i<keyframes2.length;i++)if(keyframes2[i]!==current)return!0}function canAnimate(keyframes2,name,type,velocity){const originKeyframe=keyframes2[0];if(originKeyframe===null)return!1;if(name==="display"||name==="visibility")return!0;const targetKeyframe=keyframes2[keyframes2.length-1],isOriginAnimatable=isAnimatable(originKeyframe,name),isTargetAnimatable=isAnimatable(targetKeyframe,name);return warning(isOriginAnimatable===isTargetAnimatable,`You are trying to animate ${name} from "${originKeyframe}" to "${targetKeyframe}". "${isOriginAnimatable?targetKeyframe:originKeyframe}" is not an animatable value.`,"value-not-animatable"),!isOriginAnimatable||!isTargetAnimatable?!1:hasKeyframesChanged(keyframes2)||(type==="spring"||isGenerator(type))&&velocity}function makeAnimationInstant(options2){options2.duration=0,options2.type="keyframes"}const acceleratedValues=new Set(["opacity","clipPath","filter","transform"]),browserColorFunctions=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function hasBrowserOnlyColors(keyframes2){for(let i=0;i<keyframes2.length;i++)if(typeof keyframes2[i]=="string"&&browserColorFunctions.test(keyframes2[i]))return!0;return!1}const colorProperties=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),supportsWaapi=memo(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function supportsBrowserAnimation(options2){var ref2;const{motionValue:motionValue2,name,repeatDelay,repeatType,damping,type,keyframes:keyframes2}=options2;if(!((motionValue2==null||(ref2=motionValue2.owner)===null||ref2===void 0?void 0:ref2.current)instanceof HTMLElement))return!1;const{onUpdate,transformTemplate}=motionValue2.owner.getProps();return supportsWaapi()&&name&&(acceleratedValues.has(name)||colorProperties.has(name)&&hasBrowserOnlyColors(keyframes2))&&(name!=="transform"||!transformTemplate)&&!onUpdate&&!repeatDelay&&repeatType!=="mirror"&&damping!==0&&type!=="inertia"}const MAX_RESOLVE_DELAY=40;let AsyncMotionValueAnimation=class extends WithPromise{onKeyframesResolved(keyframes2,finalKeyframe,options2,sync){var ref2,ref1;this.keyframeResolver=void 0;const{name,type,velocity,delay:delay2,isHandoff,onUpdate}=options2;this.resolvedAt=time.now();let canAnimateValue=!0;
60canAnimate(keyframes2,name,type,velocity)||(canAnimateValue=!1,(MotionGlobalConfig.instantAnimations||!delay2)&&onUpdate?.(getFinalKeyframe(keyframes2,options2,finalKeyframe)),keyframes2[0]=keyframes2[keyframes2.length-1],makeAnimationInstant(options2),options2.repeat=0);const resolvedOptions={startTime:sync?this.resolvedAt?this.resolvedAt-this.createdAt>MAX_RESOLVE_DELAY?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe,...options2,keyframes:keyframes2},useWaapi=canAnimateValue&&!isHandoff&&supportsBrowserAnimation(resolvedOptions),element=(ref2=resolvedOptions.motionValue)===null||ref2===void 0||(ref1=ref2.owner)===null||ref1===void 0?void 0:ref1.current;let animation;if(useWaapi)try{animation=new NativeAnimationExtended({...resolvedOptions,element})}catch{animation=new JSAnimation(resolvedOptions)}else animation=new JSAnimation(resolvedOptions);animation.finished.then(()=>{this.notifyFinished()}).catch(noop),this.pendingTimeline&&(this.stopTimeline=animation.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=animation}get finished(){return this._animation?this.animation.finished:this._finished}then(onResolve,_onReject){return this.finished.finally(onResolve).then(()=>{})}get animation(){if(!this._animation){var ref2;(ref2=this.keyframeResolver)===null||ref2===void 0||ref2.resume(),flushKeyframeResolvers()}return this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(newTime){this.animation.time=newTime}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(newSpeed){this.animation.speed=newSpeed}get startTime(){return this.animation.startTime}attachTimeline(timeline){return this._animation?this.stopTimeline=this.animation.attachTimeline(timeline):this.pendingTimeline=timeline,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var ref2;this._animation&&this.animation.cancel(),(ref2=this.keyframeResolver)===null||ref2===void 0||ref2.cancel()}constructor({autoplay=!0,delay:delay2=0,type="keyframes",repeat=0,repeatDelay=0,repeatType="loop",keyframes:keyframes2,name,motionValue:motionValue2,element,...options2}){var ref3;super(),this.stop=()=>{var ref2;if(this._animation){var _obj,ref22;this._animation.stop(),(ref22=(_obj=this).stopTimeline)===null||ref22===void 0||ref22.call(_obj)}(ref2=this.keyframeResolver)===null||ref2===void 0||ref2.cancel()},this.createdAt=time.now();const optionsWithDefaults={autoplay,delay:delay2,type,repeat,repeatDelay,repeatType,name,motionValue:motionValue2,element,...options2},KeyframeResolver$1=element?.KeyframeResolver||KeyframeResolver;this.keyframeResolver=new KeyframeResolver$1(keyframes2,(resolvedKeyframes,finalKeyframe,forced)=>this.onKeyframesResolved(resolvedKeyframes,finalKeyframe,optionsWithDefaults,!forced),name,motionValue2,element),(ref3=this.keyframeResolver)===null||ref3===void 0||ref3.scheduleResolve()}},GroupAnimation=class{get finished(){return Promise.all(this.animations.map(animation=>animation.finished))}getAll(propName){return this.animations[0][propName]}setAll(propName,newValue){for(let i=0;i<this.animations.length;i++)this.animations[i][propName]=newValue}attachTimeline(timeline){const subscriptions=this.animations.map(animation=>animation.attachTimeline(timeline));return()=>{subscriptions.forEach((cancel,i)=>{cancel&&cancel(),this.animations[i].stop()})}}get time(){return this.getAll("time")}set time(time2){this.setAll("time",time2)}get speed(){return this.getAll("speed")}set speed(speed){this.setAll("speed",speed)}get state(){return this.getAll("state")}get startTime(){return this.getAll("startTime")}get duration(){return getMax(this.animations,"duration")}get iterationDuration(){return getMax(this.animations,"iterationDuration")}runAll(methodName){this.animations.forEach(controls=>controls[methodName]())}play(){this.runAll("play")}pause(){this.runAll("pause")}cancel(){this.runAll("cancel")}complete(){this.runAll("complete")}constructor(animations){this.stop=()=>
60this.runAll("stop"),this.animations=animations.filter(Boolean)}};function getMax(animations,propName){let max=0;for(let i=0;i<animations.length;i++){const value=animations[i][propName];value!==null&&value>max&&(max=value)}return max}let GroupAnimationWithThen=class extends GroupAnimation{then(onResolve,_onReject){return this.finished.finally(onResolve).then(()=>{})}};const MAX_VELOCITY_DELTA=30,isFloat=value=>!isNaN(parseFloat(value)),collectMotionValues={current:void 0};let MotionValue=class{setCurrent(current){this.current=current,this.updatedAt=time.now(),this.canTrackVelocity===null&&current!==void 0&&(this.canTrackVelocity=isFloat(this.current))}setPrevFrameValue(prevFrameValue=this.current){this.prevFrameValue=prevFrameValue,this.prevUpdatedAt=this.updatedAt}onChange(subscription){return process.env.NODE_ENV!=="production"&&warnOnce(!1,'value.onChange(callback) is deprecated. Switch to value.on("change", callback).'),this.on("change",subscription)}on(eventName,callback){this.events[eventName]||(this.events[eventName]=new SubscriptionManager);const unsubscribe=this.events[eventName].add(callback);return eventName==="change"?()=>{unsubscribe(),frame.read(()=>{this.events.change.getSize()||this.stop()})}
60:unsubscribe}clearListeners(){for(const eventManagers in this.events)this.events[eventManagers].clear()}attach(passiveEffect,stopPassiveEffect){this.passiveEffect=passiveEffect,this.stopPassiveEffect=stopPassiveEffect}set(v){this.passiveEffect?this.passiveEffect(v,this.updateAndNotify):this.updateAndNotify(v)}setWithVelocity(prev2,current,delta){this.set(current),this.prev=void 0,this.prevFrameValue=prev2,this.prevUpdatedAt=this.updatedAt-delta}jump(v,endAnimation=!0){this.updateAndNotify(v),this.prev=v,this.prevUpdatedAt=this.prevFrameValue=void 0,endAnimation&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var ref2;(ref2=this.events.change)===null||ref2===void 0||ref2.notify(this.current)}addDependent(dependent){this.dependents||(this.dependents=new Set),this.dependents.add(dependent)}removeDependent(dependent){this.dependents&&this.dependents.delete(dependent)}get(){return collectMotionValues.current&&collectMotionValues.current.push(this),this.current}getPrevious(){return this.prev}getVelocity(){const currentTime=time.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||currentTime-this.updatedAt>MAX_VELOCITY_DELTA)return 0;const delta=Math.min(this.updatedAt-this.prevUpdatedAt,MAX_VELOCITY_DELTA);return velocityPerSecond(parseFloat(this.current)-parseFloat(this.prevFrameValue),delta)}start(startAnimation){return this.stop(),new Promise(resolve=>{this.hasAnimated=!0,this.animation=startAnimation(resolve),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var ref2,ref1;(ref2=this.dependents)===null||ref2===void 0||ref2.clear(),(ref1=this.events.destroy)===null||ref1===void 0||ref1.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}constructor(init,options2={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=v=>{const currentTime=time.now();if(this.updatedAt!==currentTime&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(v),this.current!==this.prev){var ref2;if((ref2=this.events.change)===null||ref2===void 0||ref2.notify(this.current),this.dependents)for(const dependent of this.dependents)dependent.dirty()}},this.hasAnimated=!1,this.setCurrent(init),this.owner=options2.owner}};function motionValue(init,options2){return new MotionValue(init,options2)}function resolveTransition(transition2,parentTransition){if(transition2?.inherit&&parentTransition){const{inherit:_,...rest}=transition2;return{...parentTransition,...rest}}return transition2}function getValueTransition$1(transition2,key){var ref2,ref1;const valueTransition=(ref1=(ref2=transition2?.[key])!==null&&ref2!==void 0?ref2:transition2?.default)!==null&&ref1!==void 0?ref1:transition2;return valueTransition!==transition2?resolveTransition(valueTransition,transition2):valueTransition}const underDampedSpring={type:"spring",stiffness:500,damping:25,restSpeed:10},criticallyDampedSpring=target=>({type:"spring",stiffness:550,damping:target===0?2*Math.sqrt(550):30,restSpeed:10}),keyframesTransition={type:"keyframes",duration:.8},ease={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},getDefaultTransition=(valueKey,{keyframes:keyframes2})=>keyframes2.length>2?keyframesTransition:transformProps.has(valueKey)?valueKey.startsWith("scale")?criticallyDampedSpring(keyframes2[1]):underDampedSpring:ease,orchestrationKeys=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function isTransitionDefined(transition2){for(const key in transition2)if(!orchestrationKeys.has(key))return!0;return!1}const animateMotionValue=(name,value,target,transition2={},element,isHandoff)=>onComplete=>{const valueTransition=getValueTransition$1(transition2,name)||{},delay2=valueTransition.delay||transition2.delay||0;let{elapsed=0}=transition2;elapsed=elapsed-secondsToMilliseconds(delay2);const options2={keyframes:Array.isArray(target)?target:[null,target],ease:"easeOut",velocity:value.getVelocity(),...valueTransition,delay:-elapsed,onUpdate:v=>{value.set(v),valueTransition.onUpdate&&valueTransition.onUpdate(v)},onComplete:()=>{onComplete(),valueTransition.onComplete&&valueTransition.onComplete()},name,motionValue:value,element:isHandoff?void 0:element};isTransitionDefined(valueTransition)||Object.assign(options2,getDefaultTransition(name,options2)),options2.duration&&(options2.duration=secondsToMilliseconds(options2.duration)),options2.repeatDelay&&(options2.repeatDelay=secondsToMilliseconds(options2.repeatDelay)),options2.from!==void 0&&(options2.keyframes[0]=options2.from);let shouldSkip2=!1;if((options2.type===!1||options2.duration===0&&!options2.repeatDelay)&&(makeAnimationInstant(options2),options2.delay===0&&(shouldSkip2=!0)),(MotionGlobalConfig.instantAnimations||MotionGlobalConfig.skipAnimations||element?.shouldSkipAnimations||valueTransition.skipAnimations)&&(shouldSkip2=!0,makeAnimationInstant(options2),options2.delay=0),options2.allowFlatten=!valueTransition.type&&!valueTransition.ease,shouldSkip2&&!isHandoff&&value.get()!==void 0){const finalKeyframe=getFinalKeyframe(options2.keyframes,valueTransition);if(finalKeyframe!==void 0){frame.update(()=>{options2.onUpdate(finalKeyframe),options2.onComplete()});return}}return valueTransition.isSync?new JSAnimation(options2):new AsyncMotionValueAnimation(options2)},splitCSSVariableRegex=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function parseCSSVariable(current){const match=splitCSSVariableRegex.exec(current);if(!match)return[,];const[,token1,token2,fallback]=match;return[`--${token1??token2}`,fallback]}const maxDepth=4;function getVariableValue(current,element,depth=1){invariant(depth<=maxDepth,`Max CSS variable fallback depth detected in property "${current}". This may indicate a circular fallback dependency.`,"max-css-var-depth");const[token,fallback]=parseCSSVariable(current);if(!token)return;const resolved=window.getComputedStyle(element).getPropertyValue(token);if(resolved){const trimmed=resolved.trim();return isNumericalString(trimmed)?parseFloat(trimmed):trimmed}return isCSSVariableToken(fallback)?getVariableValue(fallback,element,depth+1):fallback}function getValueState(visualElement){const state=[{},{}];
60return visualElement?.values.forEach((value,key)=>{state[0][key]=value.get(),state[1][key]=value.getVelocity()}),state}function resolveVariantFromProps(props,definition,custom,visualElement){if(typeof definition=="function"){const[current,velocity]=getValueState(visualElement);definition=definition(custom!==void 0?custom:props.custom,current,velocity)}if(typeof definition=="string"&&(definition=props.variants&&props.variants[definition]),typeof definition=="function"){const[current,velocity]=getValueState(visualElement);definition=definition(custom!==void 0?custom:props.custom,current,velocity)}return definition}function resolveVariant(visualElement,definition,custom){const props=visualElement.getProps();return resolveVariantFromProps(props,definition,props.custom,visualElement)}const positionalKeys=new Set(["width","height","top","left","right","bottom",...transformPropOrder]),isKeyframesTarget=v=>Array.isArray(v);function setMotionValue(visualElement,key,value){visualElement.hasValue(key)?visualElement.getValue(key).set(value):visualElement.addValue(key,motionValue(value))}function resolveFinalValueInKeyframes(v){return isKeyframesTarget(v)?v[v.length-1]||0:v}function setTarget(visualElement,definition){const resolved=resolveVariant(visualElement,definition);let{transitionEnd={},transition:transition2={},...target}=resolved||{};target={...target,...transitionEnd};for(const key in target){const value=resolveFinalValueInKeyframes(target[key]);setMotionValue(visualElement,key,value)}}const isMotionValue=value=>!!(value&&value.getVelocity);function isWillChangeMotionValue(value){return!!(isMotionValue(value)&&value.add)}function addValueToWillChange(visualElement,key){const willChange=visualElement.getValue("willChange");if(isWillChangeMotionValue(willChange))return willChange.add(key);if(!willChange&&MotionGlobalConfig.WillChange){const newWillChange=new MotionGlobalConfig.WillChange("auto");visualElement.addValue("willChange",newWillChange),newWillChange.add(key)}}function camelToDash(str){return str.replace(/([A-Z])/g,match=>`-${match.toLowerCase()}`)}const optimizedAppearDataAttribute="data-"+camelToDash("framerAppearId");function getOptimisedAppearId(visualElement){return visualElement.props[optimizedAppearDataAttribute]}function shouldBlockAnimation({protectedKeys,needsAnimating},key){const shouldBlock=protectedKeys.hasOwnProperty(key)&&needsAnimating[key]!==!0;return needsAnimating[key]=!1,shouldBlock}function animateTarget(visualElement,targetAndTransition,{delay:delay2=0,transitionOverride,type}={}){let{transition:transition2,transitionEnd,...target}=targetAndTransition;const defaultTransition=visualElement.getDefaultTransition();transition2=transition2?resolveTransition(transition2,defaultTransition):defaultTransition;const reduceMotion=transition2?.reduceMotion,skipAnimations=transition2?.skipAnimations;transitionOverride&&(transition2=transitionOverride);const animations=[],animationTypeState=type&&visualElement.animationState&&visualElement.animationState.getState()[type],path=transition2?.path;path&&path.animateVisualElement(visualElement,target,transition2,delay2,animations);for(const key in target){var _key;const value=visualElement.getValue(key,(_key=visualElement.latestValues[key])!==null&&_key!==void 0?_key:null),valueTarget=target[key];if(valueTarget===void 0||animationTypeState&&shouldBlockAnimation(animationTypeState,key))continue;const valueTransition={delay:delay2,...getValueTransition$1(transition2||{},key)};skipAnimations&&(valueTransition.skipAnimations=!0);const currentValue=value.get();if(currentValue!==void 0&&!value.isAnimating()&&!Array.isArray(valueTarget)&&valueTarget===currentValue&&!valueTransition.velocity){frame.update(()=>value.set(valueTarget));continue}let isHandoff=!1;if(window.MotionHandoffAnimation){const appearId=getOptimisedAppearId(visualElement);if(appearId){const startTime=window.MotionHandoffAnimation(appearId,key,frame);startTime!==null&&(valueTransition.startTime=startTime,isHandoff=!0)}}addValueToWillChange(visualElement,key);const shouldReduceMotion=reduceMotion??visualElement.shouldReduceMotion;value.start(animateMotionValue(key,value,valueTarget,shouldReduceMotion&&positionalKeys.has(key)?{type:!1}:valueTransition,visualElement,isHandoff));const animation=value.animation;animation&&animations.push(animation)}if(transitionEnd){const applyTransitionEnd=()=>frame.update(()=>{transitionEnd&&setTarget(visualElement,transitionEnd)});animations.length?Promise.all(animations).then(applyTransitionEnd):applyTransitionEnd()}return animations}const auto={test:v=>v==="auto",parse:v=>v},testValueType=v=>type=>type.test(v),dimensionValueTypes=[number,px,percent,degrees,vw,vh,auto],findDimensionValueType=v=>dimensionValueTypes.find(testValueType(v));function isNone(value){return typeof value=="number"?value===0:value!==null?value==="none"||value==="0"||isZeroValueString(value):!0}const maxDefaults=new Set(["brightness","contrast","saturate","opacity"]);function applyDefaultFilter(v){const[name,value]=v.slice(0,-1).split("(");if(name==="drop-shadow")return v;const[number2]=value.match(floatRegex)||[];
vendor: 5,610 bytes, line 60
60if(!number2)return v;const unit=value.replace(number2,"");let defaultValue=maxDefaults.has(name)?1:0;return number2!==value&&(defaultValue*=100),name+"("+defaultValue+unit+")"}const functionRegex=/\b([a-z-]*)\(.*?\)/gu,filter={...complex,getAnimatableNone:v=>{const functions=v.match(functionRegex);return functions?functions.map(applyDefaultFilter).join(" "):v}},mask={...complex,getAnimatableNone:v1=>{const parsed=complex.parse(v1);return complex.createTransformer(v1)(parsed.map(v=>typeof v=="number"?0:typeof v=="object"?{...v,alpha:1}:v))}},int={...number,transform:Math.round},numberValueTypes={borderWidth:px,borderTopWidth:px,borderRightWidth:px,borderBottomWidth:px,borderLeftWidth:px,borderRadius:px,borderTopLeftRadius:px,borderTopRightRadius:px,borderBottomRightRadius:px,borderBottomLeftRadius:px,width:px,maxWidth:px,height:px,maxHeight:px,top:px,right:px,bottom:px,left:px,inset:px,insetBlock:px,insetBlockStart:px,insetBlockEnd:px,insetInline:px,insetInlineStart:px,insetInlineEnd:px,padding:px,paddingTop:px,paddingRight:px,paddingBottom:px,paddingLeft:px,paddingBlock:px,paddingBlockStart:px,paddingBlockEnd:px,paddingInline:px,paddingInlineStart:px,paddingInlineEnd:px,margin:px,marginTop:px,marginRight:px,marginBottom:px,marginLeft:px,marginBlock:px,marginBlockStart:px,marginBlockEnd:px,marginInline:px,marginInlineStart:px,marginInlineEnd:px,fontSize:px,backgroundPositionX:px,backgroundPositionY:px,...{rotate:degrees,pathRotation:degrees,rotateX:degrees,rotateY:degrees,rotateZ:degrees,scale,scaleX:scale,scaleY:scale,scaleZ:scale,skew:degrees,skewX:degrees,skewY:degrees,distance:px,translateX:px,translateY:px,translateZ:px,x:px,y:px,z:px,perspective:px,transformPerspective:px,opacity:alpha,originX:progressPercentage,originY:progressPercentage,originZ:px},zIndex:int,fillOpacity:alpha,strokeOpacity:alpha,numOctaves:int},defaultValueTypes={...numberValueTypes,color,backgroundColor:color,outlineColor:color,fill:color,stroke:color,borderColor:color,borderTopColor:color,borderRightColor:color,borderBottomColor:color,borderLeftColor:color,filter,WebkitFilter:filter,mask,WebkitMask:mask},getDefaultValueType=key=>defaultValueTypes[key],customTypes=new Set([filter,mask]);function getAnimatableNone(key,value){let defaultValueType=getDefaultValueType(key);return customTypes.has(defaultValueType)||(defaultValueType=complex),defaultValueType.getAnimatableNone?defaultValueType.getAnimatableNone(value):void 0}const invalidTemplates=new Set(["auto","none","0"]);function makeNoneKeyframesAnimatable(unresolvedKeyframes,noneKeyframeIndexes,name){let i=0,animatableTemplate;for(;i<unresolvedKeyframes.length&&!animatableTemplate;){const keyframe=unresolvedKeyframes[i];typeof keyframe=="string"&&!invalidTemplates.has(keyframe)&&analyseComplexValue(keyframe).values.length&&(animatableTemplate=unresolvedKeyframes[i]),i++}if(animatableTemplate&&name)for(const noneIndex of noneKeyframeIndexes)unresolvedKeyframes[noneIndex]=getAnimatableNone(name,animatableTemplate)}let DOMKeyframesResolver=class extends KeyframeResolver{readKeyframes(){const{unresolvedKeyframes,element,name}=this;if(!element||!element.current)return;super.readKeyframes();for(let i=0;i<unresolvedKeyframes.length;i++){let keyframe=unresolvedKeyframes[i];if(typeof keyframe=="string"&&(keyframe=keyframe.trim(),isCSSVariableToken(keyframe))){const resolved=getVariableValue(keyframe,element.current);resolved!==void 0&&(unresolvedKeyframes[i]=resolved),i===unresolvedKeyframes.length-1&&(this.finalKeyframe=keyframe)}}if(this.resolveNoneKeyframes(),!positionalKeys.has(name)||unresolvedKeyframes.length!==2)return;const[origin,target]=unresolvedKeyframes,originType=findDimensionValueType(origin),targetType=findDimensionValueType(target),originHasVar=containsCSSVariable(origin),targetHasVar=containsCSSVariable(target);if(originHasVar!==targetHasVar&&positionalValues[name]){this.needsMeasurement=!0;return}if(originType!==targetType)if(isNumOrPxType(originType)&&isNumOrPxType(targetType))for(let i=0;i<unresolvedKeyframes.length;i++){const value=unresolvedKeyframes[i];typeof value=="string"&&(unresolvedKeyframes[i]=parseFloat(value))}else positionalValues[name]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes,name}=this,noneKeyframeIndexes=[];for(let i=0;i<unresolvedKeyframes.length;i++)(unresolvedKeyframes[i]===null||isNone(unresolvedKeyframes[i]))&&noneKeyframeIndexes.push(i);noneKeyframeIndexes.length&&makeNoneKeyframesAnimatable(unresolvedKeyframes,noneKeyframeIndexes,name)}measureInitialState(){const{element,unresolvedKeyframes,name}=this;if(!element||!element.current)return;name==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=positionalValues[name](element.measureViewportBox(),window.getComputedStyle(element.current)),unresolvedKeyframes[0]=this.measuredOrigin;const measureKeyframe=unresolvedKeyframes[unresolvedKeyframes.length-1];measureKeyframe!==void 0&&element.getValue(name,measureKeyframe).jump(measureKeyframe,!1)}measureEndState(){var ref2;const{element,name,unresolvedKeyframes}=this;if(!element||!element.current)return;const value=element.getValue(name);value&&value.jump(this.measuredOrigin,!1);const finalKeyframeIndex=unresolvedKeyframes.length-1,finalKeyframe=unresolvedKeyframes[finalKeyframeIndex];unresolvedKeyframes[finalKeyframeIndex]=positionalValues[name](element.measureViewportBox(),window.getComputedStyle(element.current)),finalKeyframe!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=finalKeyframe),!((ref2=this.removedTransforms)===null||ref2===void 0)&&ref2.length&&this.removedTransforms.forEac
60h(([unsetTransformName,unsetTransformValue])=>{element.getValue(unsetTransformName).set(unsetTransformValue)}),this.resolveNoneKeyframes()}constructor(unresolvedKeyframes,onComplete,name,motionValue2,element){super(unresolvedKeyframes,onComplete,name,motionValue2,element,!0)}};function resolveElements(elementOrSelector,scope2,selectorCache){if(elementOrSelector==null)return[];if(elementOrSelector instanceof EventTarget)return[elementOrSelector];if(typeof elementOrSelector=="string"){let root=document;scope2&&(root=scope2.current);var ref2;const elements=(ref2=selectorCache?.[elementOrSelector])!==null&&ref2!==void 0?ref2:root.querySelectorAll(elementOrSelector);return elements?Array.from(elements):[]}return Array.from(elementOrSelector).filter(element=>element!=null)}function createSelectorEffect(subjectEffect){return(subject,values)=>{const elements=resolveElements(subject),subscriptions=[];for(const element of elements){const remove=subjectEffect(element,values);subscriptions.push(remove)}return()=>{for(const remove of subscriptions)remove()}}}const getValueAsType=(value,type)=>type&&typeof value=="number"?type.transform(value):value;let MotionValueState=class{set(name,value,render,computed,useDefaultValueType=!0){const existingValue=this.values.get(name);existingValue&&existingValue.onRemove();const onChange=()=>{const v=value.get();useDefaultValueType?this.latest[name]=getValueAsType(v,numberValueTypes[name]):this.latest[name]=v,render&&frame.render(render)};onChange();const cancelOnChange=value.on("change",onChange);computed&&value.addDependent(computed);const remove=()=>{cancelOnChange(),render&&cancelFrame(render),this.values.delete(name),computed&&value.removeDependent(computed)};return this.values.set(name,{value,onRemove:remove}),remove}get(name){var ref2;return(ref2=this.values.get(name))===null||ref2===void 0?void 0:ref2.value}constructor(){this.latest={},this.values=new Map}};function createEffect(addValue){const stateCache=new WeakMap;return(subject,values)=>{var ref2;const state=(ref2=stateCache.get(subject))!==null&&ref2!==void 0?ref2:new MotionValueState;stateCache.set(subject,state);const subscriptions=[];for(const key in values){const value=values[key],remove=addValue(subject,state,key,value);subscriptions.push(remove)}return()=>{for(const cancel of subscriptions)cancel()}}}function isHTMLElement(element){return isObject(element)&&"offsetHeight"in element&&!("ownerSVGElement"in element)}const translateAlias$1={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"};function buildTransform$1(state){let transform2="",transformIsDefault=!0;for(let i=0;i<transformPropOrder.length;i++){const key=transformPropOrder[i],value=state.latest[key];if(value===void 0)continue;let valueIsDefault=!0;if(typeof value=="number")valueIsDefault=value===(key.startsWith("scale")?1:0);else{const parsed=parseFloat(value);valueIsDefault=key.startsWith("scale")?parsed===1:parsed===0}if(!valueIsDefault){transformIsDefault=!1;const transformName=translateAlias$1[key]||key;transform2+=`${transformName}(${value}) `}}const pathRotation=state.latest.pathRotation;return pathRotation&&(transformIsDefault=!1,transform2+=`rotate(${typeof pathRotation=="number"?`${pathRotation}deg`:pathRotation}) `),transformIsDefault?"none":transform2.trim()}const originProps=new Set(["originX","originY","originZ"]),addStyleValue=(element,state,key,value)=>{let render,computed;return transformProps.has(key)?(state.get("transform")||(!isHTMLElement(element)&&!state.get("transformBox")&&addStyleValue(element,state,"transformBox",new MotionValue("fill-box")),state.set("transform",new MotionValue("none"),()=>{element.style.transform=buildTransform$1(state)})),computed=state.get("transform")):originProps.has(key)?(state.get("transformOrigin")||state.set("transformOrigin",new MotionValue(""),()=>{var _originX;const originX=(_originX=state.latest.originX)!==null&&_originX!==void 0?_originX:"50%";var _originY;const originY=(_originY=state.latest.originY)!==null&&_originY!==void 0?_originY:"50%";var _originZ;const originZ=(_originZ=state.latest.originZ)!==null&&_originZ!==void 0?_originZ:0;element.style.transformOrigin=`${originX} ${originY} ${originZ}`}),computed=state.get("transformOrigin")):isCSSVar(key)?render=()=>{element.style.setProperty(key,state.latest[key])}:render=()=>{element.style[key]=state.latest[key]},state.set(key,value,render,computed)}
60,styleEffect=createSelectorEffect(createEffect(addStyleValue)),{schedule:microtask,cancel:cancelMicrotask}=createRenderBatcher(queueMicrotask,!1);function isSVGElement(element){return isObject(element)&&"ownerSVGElement"in element}const resizeHandlers=new WeakMap;let observer;const getSize=(borderBoxAxis,svgAxis,htmlAxis)=>(target,borderBoxSize)=>borderBoxSize&&borderBoxSize[0]?borderBoxSize[0][borderBoxAxis+"Size"]:isSVGElement(target)&&"getBBox"in target?target.getBBox()[svgAxis]:target[htmlAxis],getWidth=getSize("inline","width","offsetWidth"),getHeight=getSize("block","height","offsetHeight");function notifyTarget({target,borderBoxSize}){var ref2;(ref2=resizeHandlers.get(target))===null||ref2===void 0||ref2.forEach(handler4=>{handler4(target,{get width(){return getWidth(target,borderBoxSize)},get height(){return getHeight(target,borderBoxSize)}})})}function notifyAll(entries){entries.forEach(notifyTarget)}function createResizeObserver(){typeof ResizeObserver>"u"||(observer=new ResizeObserver(notifyAll))}function resizeElement(target,handler4){observer||createResizeObserver();const elements=resolveElements(target);return elements.forEach(element=>{let elementHandlers=resizeHandlers.get(element);elementHandlers||(elementHandlers=new Set,resizeHandlers.set(element,elementHandlers)),elementHandlers.add(handler4),observer?.observe(element)}),()=>{elements.forEach(element=>{const elementHandlers=resizeHandlers.get(element);elementHandlers?.delete(handler4),elementHandlers?.size||observer?.unobserve(element)})}}const windowCallbacks=new Set;let windowResizeHandler;function createWindowResizeHandler(){windowResizeHandler=()=>{const info={get width(){return window.innerWidth},get height(){return window.innerHeight}};windowCallbacks.forEach(callback=>callback(info))},window.addEventListener("resize",windowResizeHandler)}function resizeWindow(callback){return windowCallbacks.add(callback),windowResizeHandler||createWindowResizeHandler(),()=>{windowCallbacks.delete(callback),!windowCallbacks.size&&typeof windowResizeHandler=="function"&&(window.removeEventListener("resize",windowResizeHandler),windowResizeHandler=void 0)}}function resize(a,b){return typeof a=="function"?resizeWindow(a):resizeElement(a,b)}function observeTimeline(update,timeline){let prevProgress;const onFrame=()=>{const{currentTime}=timeline,progress2=(currentTime===null?0:currentTime.value)/100;prevProgress!==progress2&&update(progress2),prevProgress=progress2};return frame.preUpdate(onFrame,!0),()=>cancelFrame(onFrame)}function isSVGSVGElement(element){return isSVGElement(element)&&element.tagName==="svg"}function transform(...args){const useImmediate=!Array.isArray(args[0]),argOffset=useImmediate?0:-1,inputValue=args[0+argOffset],inputRange=args[1+argOffset],outputRange=args[2+argOffset],options2=args[3+argOffset],interpolator=interpolate(inputRange,outputRange,options2);return useImmediate?interpolator(inputValue):interpolator}function followValue(source,options2){const initialValue=isMotionValue(source)?source.get():source,value=motionValue(initialValue);return attachFollow(value,source,options2),value}function attachFollow(value,source,options2={}){const initialValue=value.get();let activeAnimation=null,latestValue=initialValue,latestSetter;const unit=typeof initialValue=="string"?initialValue.replace(/[\d.-]/g,""):void 0,stopAnimation=()=>{activeAnimation&&(activeAnimation.stop(),activeAnimation=null),value.animation=void 0},startAnimation=()=>{const currentValue=asNumber(value.get()),targetValue=asNumber(latestValue);if(currentValue===targetValue){stopAnimation();return}const velocity=activeAnimation?activeAnimation.getGeneratorVelocity():value.getVelocity();stopAnimation(),activeAnimation=new JSAnimation({keyframes:[currentValue,targetValue],velocity,type:"spring",restDelta:.001,restSpeed:.01,...options2,onUpdate:latestSetter})},scheduleAnimation=()=>{var ref1;startAnimation(),value.animation=activeAnimation??void 0,(ref1=value.events.animationStart)===null||ref1===void 0||ref1.notify(),activeAnimation?.then(()=>{var ref2;value.animation=void 0,(ref2=value.events.animationComplete)===null||ref2===void 0||ref2.notify()})};if(value.attach((v,set3)=>{latestValue=v,latestSetter=latest=>set3(parseValue(latest,unit)),frame.postRender(scheduleAnimation)},stopAnimation),isMotionValue(source)){let skipNextAnimation=options2.skipInitialAnimation===!0;const removeSourceOnChange=source.on("change",v=>{skipNextAnimation?(skipNextAnimation=!1,value.jump(parseValue(v,unit),!1)):value.set(parseValue(v,unit))}),removeValueOnDestroy=value.on("destroy",removeSourceOnChange);return()=>{removeSourceOnChange(),removeValueOnDestroy()}}return stopAnimation}function parseValue(v,unit){return unit?v+unit:v}function asNumber(v){return typeof v=="number"?v:parseFloat(v)}function subscribeValue(inputValues,outputValue,getLatest){const update=()=>
60outputValue.set(getLatest()),scheduleUpdate=()=>frame.preRender(update,!1,!0),subscriptions=inputValues.map(v=>v.on("change",scheduleUpdate));outputValue.on("destroy",()=>{subscriptions.forEach(unsubscribe=>unsubscribe()),cancelFrame(update)})}function transformValue(transform2){const collectedValues=[];collectMotionValues.current=collectedValues;const initialValue=transform2();collectMotionValues.current=void 0;const value=motionValue(initialValue);return subscribeValue(collectedValues,value,transform2),value}function springValue(source,options2){return followValue(source,{type:"spring",...options2})}const valueTypes=[...dimensionValueTypes,color,complex],findValueType=v=>valueTypes.find(testValueType(v)),createAxis=()=>({min:0,max:0}),createBox=()=>({x:createAxis(),y:createAxis()}),visualElementStore=new WeakMap;function isAnimationControls(v){return v!==null&&typeof v=="object"&&typeof v.start=="function"}function isVariantLabel(v){return typeof v=="string"||Array.isArray(v)}const variantProps=["initial",...["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"]];function isControllingVariants(props){return isAnimationControls(props.animate)||variantProps.some(name=>isVariantLabel(props[name]))}function isVariantNode(props){return!!(isControllingVariants(props)||props.variants)}function updateMotionValuesFromProps(element,next,prev2){for(const key in next){const nextValue=next[key],prevValue=prev2[key];if(isMotionValue(nextValue))element.addValue(key,nextValue);else if(isMotionValue(prevValue))element.addValue(key,motionValue(nextValue,{owner:element}));else if(prevValue!==nextValue)if(element.hasValue(key)){const existingValue=element.getValue(key);existingValue.liveStyle===!0?existingValue.jump(nextValue):existingValue.hasAnimated||existingValue.set(nextValue)}else{const latestValue=element.getStaticValue(key);element.addValue(key,motionValue(latestValue!==void 0?latestValue:nextValue,{owner:element}))}}for(const key1 in prev2)next[key1]===void 0&&element.removeValue(key1);return next}const prefersReducedMotion={current:null},hasReducedMotionListener={current:!1},isBrowser=typeof window<"u";function initPrefersReducedMotion(){if(hasReducedMotionListener.current=!0,!!isBrowser)if(window.matchMedia){const motionMediaQuery=window.matchMedia("(prefers-reduced-motion)"),setReducedMotionPreferences=()=>prefersReducedMotion.current=motionMediaQuery.matches;motionMediaQuery.addEventListener("change",setReducedMotionPreferences),setReducedMotionPreferences()}else prefersReducedMotion.current=!1}const propEventHandlers=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let featureDefinitions={},VisualElement=class{scrapeMotionValuesFromProps(_props,_prevProps,_visualElement){return{}}mount(instance){var ref2;if(this.hasBeenMounted)for(const key in this.initialValues){var ref1;(ref1=this.values.get(key))===null||ref1===void 0||ref1.jump(this.initialValues[key]),this.latestValues[key]=this.initialValues[key]}this.current=instance,visualElementStore.set(instance,this),this.projection&&!this.projection.instance&&this.projection.mount(instance),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((value,key)=>this.bindToMotionValue(key,value)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(hasReducedMotionListener.current||initPrefersReducedMotion(),this.shouldReduceMotion=prefersReducedMotion.current),process.env.NODE_ENV!=="production"&&warnOnce(this.shouldReduceMotion!==!0,"You have Reduced Motion enabled on your device. Animations may not appear as expected.","reduced-motion-disabled");var _skipAnimationsConfig;this.shouldSkipAnimations=(_skipAnimationsConfig=this.skipAnimationsConfig)!==null&&_skipAnimationsConfig!==void 0?_skipAnimationsConfig:!1,(ref2=this.parent)===null||ref2===void 0||ref2.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var ref2;this.projection&&this.projection.unmount(),cancelFrame(this.notifyUpdate),cancelFrame(this.render),this.valueSubscriptions.forEach(remove=>remove()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(ref2=this.parent)===null||ref2===void 0||ref2.removeChild(this);for(const key in this.events)this.events[key].clear();for(const key1 in this.features){const feature=this.features[key1];feature&&(feature.unmount(),feature.isMounted=!1)}this.current=null}addChild(child){this.children.add(child);var _enteringChildren;(_enteringChildren=this.enteringChildren)!==null&&_enteringChildren!==void 0||(this.enteringChildren=new Set),this.enteringChildren.add(child)}removeChild(child){this.children.delete(child),this.enteringChildren&&this.enteringChildren.delete(child)}bindToMotionValue(key,value){if(this.valueSubscriptions.has(key)&&this.valueSubscriptions.get(key)(),value.accelerate&&acceleratedValues.has(key)&&this.current instanceof HTMLElement){const{factory,keyframes:keyframes2,times:times2,ease:ease2,duration}=value.accelerate,animation=new NativeAnimation({element:this.current,name:key,keyframes:keyframes2,times:times2,ease:ease2,duration:secondsToMilliseconds(duration)}),cleanup2=factory(animation);this.valueSubscriptions.set(key,()=>{cleanup2(),animation.cancel()});return}const valueIsTransform=transformProps.has(key);valueIsTransform&&this.onBindTransform&&this.onBindTransform();const removeOnChange=value.on("change",latestValue=>{this.latestValues[key]=latestValue,this.props.onUpdate&&frame.preRender(this.notifyUpdate),valueIsTransform&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let removeSyncCheck;typeof window<"u"&&window.MotionCheckAppearSync&&(removeSyncCheck=window.MotionCheckAppearSync(this,key,value)),this.valueSubscriptions.set(key,()=>{removeOnChange(),removeSyncCheck&&removeSyncCheck()})}sortNodePosition(other){return!this.current||!this.sortInstanceNodePosition||this.type!==other.type?0:this.sortInstanceNodePosition(this.current,other.current)}updateFeatures(){let key="animation";for(key in featureDefinitions){const featureDefinition=featureDefinitions[key];if(!featureDefinition)continue;const{isEnabled,Feature:FeatureConstructor}=featureDefinition;if(!this.features[key]&&FeatureConstructor&&isEnabled(this.props)&&(this.features[key]=new FeatureConstructor(this)),this.features[key]){const feature=this.features[key];
60feature.isMounted?feature.update():(feature.mount(),feature.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):createBox()}getStaticValue(key){return this.latestValues[key]}setStaticValue(key,value){this.latestValues[key]=value}update(props,presenceContext){(props.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=props,this.prevPresenceContext=this.presenceContext,this.presenceContext=presenceContext;for(let i=0;i<propEventHandlers.length;i++){const key=propEventHandlers[i];this.propEventSubscriptions[key]&&(this.propEventSubscriptions[key](),delete this.propEventSubscriptions[key]);const listenerName="on"+key,listener=props[listenerName];listener&&(this.propEventSubscriptions[key]=this.on(key,listener))}this.prevMotionValues=updateMotionValuesFromProps(this,this.scrapeMotionValuesFromProps(props,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(name){return this.props.variants?this.props.variants[name]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(child){const closestVariantNode=this.getClosestVariantNode();if(closestVariantNode)return closestVariantNode.variantChildren&&closestVariantNode.variantChildren.add(child),()=>closestVariantNode.variantChildren.delete(child)}addValue(key,value){const existingValue=this.values.get(key);value!==existingValue&&(existingValue&&this.removeValue(key),this.bindToMotionValue(key,value),this.values.set(key,value),this.latestValues[key]=value.get())}removeValue(key){this.values.delete(key);const unsubscribe=this.valueSubscriptions.get(key);unsubscribe&&(unsubscribe(),this.valueSubscriptions.delete(key)),delete this.latestValues[key],this.removeValueFromRenderState(key,this.renderState)}hasValue(key){return this.values.has(key)}getValue(key,defaultValue){if(this.props.values&&this.props.values[key])return this.props.values[key];let value=this.values.get(key);return value===void 0&&defaultValue!==void 0&&(value=motionValue(defaultValue===null?void 0:defaultValue,{owner:this}),this.addValue(key,value)),value}readValue(key,target){var ref2;let value=this.latestValues[key]!==void 0||!this.current?this.latestValues[key]:(ref2=this.getBaseTargetFromProps(this.props,key))!==null&&ref2!==void 0?ref2:this.readValueFromInstance(this.current,key,this.options);return value!=null&&(typeof value=="string"&&(isNumericalString(value)||isZeroValueString(value))?value=parseFloat(value):!findValueType(value)&&complex.test(target)&&(value=getAnimatableNone(key,target)),this.setBaseTarget(key,isMotionValue(value)?value.get():value)),isMotionValue(value)?value.get():value}setBaseTarget(key,value){this.baseTarget[key]=value}getBaseTarget(key){const{initial}=this.props;let valueFromInitial;if(typeof initial=="string"||typeof initial=="object"){var ref2;const variant=resolveVariantFromProps(this.props,initial,(ref2=this.presenceContext)===null||ref2===void 0?void 0:ref2.custom);variant&&(valueFromInitial=variant[key])}if(initial&&valueFromInitial!==void 0)return valueFromInitial;const target=this.getBaseTargetFromProps(this.props,key);return target!==void 0&&!isMotionValue(target)?target:this.initialValues[key]!==void 0&&valueFromInitial===void 0?void 0:this.baseTarget[key]}on(eventName,callback){return this.events[eventName]||(this.events[eventName]=new SubscriptionManager),this.events[eventName].add(callback)}notify(eventName,...args){this.events[eventName]&&this.events[eventName].notify(...args)}scheduleRenderMicrotask(){microtask.render(this.render)}constructor({parent,props,presenceContext,reducedMotionConfig,skipAnimations,blockInitialAnimation,visualState},options2={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=KeyframeResolver,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const now2=time.now();this.renderScheduledAt<now2&&(this.renderScheduledAt=now2,frame.render(this.render,!1,!0))};const{latestValues,renderState}=visualState;this.latestValues=latestValues,this.baseTarget={...latestValues},this.initialValues=props.initial?{...latestValues}:{},this.renderState=renderState,this.parent=parent,this.props=props,this.presenceContext=presenceContext,this.depth=parent?parent.depth+1:0,this.reducedMotionConfig=reducedMotionConfig,this.skipAnimationsConfig=skipAnimations,this.options=options2,this.blockInitialAnimation=!!blockInitialAnimation,this.isControllingVariants=isControllingVariants(props),this.isVariantNode=isVariantNode(props),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(parent&&parent.current);const{willChange,...initialMotionValues}=this.scrapeMotionValuesFromProps(props,{},this);for(const key in initialMotionValues){const value=initialMotionValues[key];latestValues[key]!==void 0&&isMotionValue(value)&&value.set(latestValues[key])}}},DOMVisualElement=class extends VisualElement{sortInstanceNodePosition(a,b){return a.compareDocumentPosition(b)&2?1:-1}getBaseTargetFromProps(props,key){const style=props.style;return style?style[key]:void 0}removeValueFromRenderState(key,{vars,style}){delete vars[key],delete style[key]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children}=this.props;isMotionValue(children)&&(this.childSubscription=children.on("change",latest=>{this.current&&(this.current.textContent=`${latest}`)}))}constructor(){super(...arguments),this.KeyframeResolver=DOMKeyframesResolver}};function convertBoundingBoxToBox({top,left,right,bottom}){return{x:{min:left,max:right},y:{min:top,max:bottom}}}function transformBoxPoints(point2,transformPoint){if(!transformPoint)return point2;const topLeft=transformPoint({x:point2.left,y:point2.top}),bottomRight=transformPoint({x:point2.right,y:point2.bottom});
60return{top:topLeft.y,left:topLeft.x,bottom:bottomRight.y,right:bottomRight.x}}function measureViewportBox(instance,transformPoint){return convertBoundingBoxToBox(transformBoxPoints(instance.getBoundingClientRect(),transformPoint))}const translateAlias={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},numTransforms=transformPropOrder.length;function buildTransform(latestValues,transform2,transformTemplate){let transformString="",transformIsDefault=!0;for(let i=0;i<numTransforms;i++){const key=transformPropOrder[i],value=latestValues[key];if(value===void 0)continue;let valueIsDefault=!0;if(typeof value=="number")valueIsDefault=value===(key.startsWith("scale")?1:0);else{const parsed=parseFloat(value);valueIsDefault=key.startsWith("scale")?parsed===1:parsed===0}if(!valueIsDefault||transformTemplate){const valueAsType=getValueAsType(value,numberValueTypes[key]);if(!valueIsDefault){transformIsDefault=!1;const transformName=translateAlias[key]||key;transformString+=`${transformName}(${valueAsType}) `}transformTemplate&&(transform2[key]=valueAsType)}}const pathRotation=latestValues.pathRotation;return pathRotation&&(transformIsDefault=!1,transformString+=`rotate(${getValueAsType(pathRotation,numberValueTypes.pathRotation)}) `),transformString=transformString.trim(),transformTemplate?transformString=transformTemplate(transform2,transformIsDefault?"":transformString):transformIsDefault&&(transformString="none"),transformString}function buildHTMLStyles(state,latestValues,transformTemplate){const{style,vars,transformOrigin}=state;let hasTransform=!1,hasTransformOrigin=!1;for(const key in latestValues){const value=latestValues[key];if(transformProps.has(key)){hasTransform=!0;continue}else if(isCSSVariableName(key)){vars[key]=value;continue}else{const valueAsType=getValueAsType(value,numberValueTypes[key]);key.startsWith("origin")?(hasTransformOrigin=!0,transformOrigin[key]=valueAsType):style[key]=valueAsType}}if(latestValues.transform||(hasTransform||transformTemplate?style.transform=buildTransform(latestValues,state.transform,transformTemplate):style.transform&&(style.transform="none")),hasTransformOrigin){const{originX="50%",originY="50%",originZ=0}=transformOrigin;style.transformOrigin=`${originX} ${originY} ${originZ}`}}function renderHTML(element,{style,vars},styleProp,projection){const elementStyle=element.style;let key;for(key in style)elementStyle[key]=style[key];projection?.applyProjectionStyles(elementStyle,styleProp);for(key in vars)elementStyle.setProperty(key,vars[key])}function pixelsToPercent(pixels,axis){return axis.max===axis.min?0:pixels/(axis.max-axis.min)*100}const correctBorderRadius={correct:(latest,node)=>{if(!node.target)return latest;if(typeof latest=="string")if(px.test(latest))latest=parseFloat(latest);else return latest;const x=pixelsToPercent(latest,node.target.x),y=pixelsToPercent(latest,node.target.y);return`${x}% ${y}%`}},correctBoxShadow={correct:(latest,{treeScale,projectionDelta})=>{const original=latest,shadow=complex.parse(latest);if(shadow.length>5)return original;const template2=complex.createTransformer(latest),offset=typeof shadow[0]!="number"?1:0,xScale=projectionDelta.x.scale*treeScale.x,yScale=projectionDelta.y.scale*treeScale.y;shadow[0+offset]/=xScale,shadow[1+offset]/=yScale;const averageScale=mixNumber$1(xScale,yScale,.5);
60return typeof shadow[2+offset]=="number"&&(shadow[2+offset]/=averageScale),typeof shadow[3+offset]=="number"&&(shadow[3+offset]/=averageScale),template2(shadow)}},scaleCorrectors={borderRadius:{...correctBorderRadius,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:correctBorderRadius,borderTopRightRadius:correctBorderRadius,borderBottomLeftRadius:correctBorderRadius,borderBottomRightRadius:correctBorderRadius,boxShadow:correctBoxShadow};function isForcedMotionValue(key,{layout,layoutId}){return transformProps.has(key)||key.startsWith("origin")||(layout||layoutId!==void 0)&&(!!scaleCorrectors[key]||key==="opacity")}function scrapeMotionValuesFromProps$1(props,prevProps,visualElement){const style=props.style,prevStyle=prevProps?.style,newValues={};if(!style)return newValues;for(const key in style){var ref2;(isMotionValue(style[key])||prevStyle&&isMotionValue(prevStyle[key])||isForcedMotionValue(key,props)||((ref2=visualElement?.getValue(key))===null||ref2===void 0?void 0:ref2.liveStyle)!==void 0)&&(newValues[key]=style[key])}return newValues}function getComputedStyle$1(element){return window.getComputedStyle(element)}let HTMLVisualElement=class extends DOMVisualElement{readValueFromInstance(instance,key){if(transformProps.has(key)){var ref2;return!((ref2=this.projection)===null||ref2===void 0)&&ref2.isProjecting?defaultTransformValue(key):readTransformValue(instance,key)}else{const computedStyle=getComputedStyle$1(instance),value=(isCSSVariableName(key)?computedStyle.getPropertyValue(key):computedStyle[key])||0;return typeof value=="string"?value.trim():value}}measureInstanceViewportBox(instance,{transformPagePoint}){return measureViewportBox(instance,transformPagePoint)}build(renderState,latestValues,props){buildHTMLStyles(renderState,latestValues,props.transformTemplate)}scrapeMotionValuesFromProps(props,prevProps,visualElement){return scrapeMotionValuesFromProps$1(props,prevProps,visualElement)}constructor(){super(...arguments),this.type="html",this.renderInstance=renderHTML}};function isObjectKey(key,object){return key in object}let ObjectVisualElement=class extends VisualElement{readValueFromInstance(instance,key){if(isObjectKey(key,instance)){const value=instance[key];if(typeof value=="string"||typeof value=="number")return value}}getBaseTargetFromProps(){}removeValueFromRenderState(key,renderState){delete renderState.output[key]}measureInstanceViewportBox(){return createBox()}build(renderState,latestValues){Object.assign(renderState.output,latestValues)}renderInstance(instance,{output}){Object.assign(instance,output)}sortInstanceNodePosition(){return 0}constructor(){super(...arguments),this.type="object"}};const dashKeys={offset:"stroke-dashoffset",array:"stroke-dasharray"},camelKeys={offset:"strokeDashoffset",array:"strokeDasharray"};function buildSVGPath(attrs,length,spacing=1,offset=0,useDashCase=!0){attrs.pathLength=1;const keys2=useDashCase?dashKeys:camelKeys;attrs[keys2.offset]=`${-offset}`,attrs[keys2.array]=`${length} ${spacing}`}const cssMotionPathProperties=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function buildSVGAttrs(state,{attrX,attrY,attrScale,pathLength,pathSpacing=1,pathOffset=0,...latest},isSVGTag2,transformTemplate,styleProp){if(buildHTMLStyles(state,latest,transformTemplate),isSVGTag2){state.style.viewBox&&(state.attrs.viewBox=state.style.viewBox);return}state.attrs=state.style,state.style={};const{attrs,style}=state;if(attrs.transform&&(style.transform=attrs.transform,delete attrs.transform),style.transform||attrs.transformOrigin){var _transformOrigin;style.transformOrigin=(_transformOrigin=attrs.transformOrigin)!==null&&_transformOrigin!==void 0?_transformOrigin:"50% 50%",delete attrs.transformOrigin}if(style.transform){var ref2;style.transformBox=(ref2=styleProp?.transformBox)!==null&&ref2!==void 0?ref2:"fill-box",delete attrs.transformBox}for(const key of cssMotionPathProperties)attrs[key]!==void 0&&(style[key]=attrs[key],delete attrs[key]);attrX!==void 0&&(attrs.x=attrX),attrY!==void 0&&(attrs.y=attrY),attrScale!==void 0&&(attrs.scale=attrScale),pathLength!==void 0&&buildSVGPath(attrs,pathLength,pathSpacing,pathOffset,!1)}const camelCaseAttributes=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),isSVGTag=tag=>typeof tag=="string"&&tag.toLowerCase()==="svg";
60function renderSVG(element,renderState,_styleProp,projection){renderHTML(element,renderState,void 0,projection);for(const key in renderState.attrs)element.setAttribute(camelCaseAttributes.has(key)?key:camelToDash(key),renderState.attrs[key])}function scrapeMotionValuesFromProps(props,prevProps,visualElement){const newValues=scrapeMotionValuesFromProps$1(props,prevProps,visualElement);for(const key in props)if(isMotionValue(props[key])||isMotionValue(prevProps[key])){const targetKey=transformPropOrder.indexOf(key)!==-1?"attr"+key.charAt(0).toUpperCase()+key.substring(1):key;newValues[targetKey]=props[key]}return newValues}let SVGVisualElement=class extends DOMVisualElement{getBaseTargetFromProps(props,key){return props[key]}readValueFromInstance(instance,key){if(transformProps.has(key)){const defaultType=getDefaultValueType(key);return defaultType&&defaultType.default||0}return key=camelCaseAttributes.has(key)?key:camelToDash(key),instance.getAttribute(key)}scrapeMotionValuesFromProps(props,prevProps,visualElement){return scrapeMotionValuesFromProps(props,prevProps,visualElement)}build(renderState,latestValues,props){buildSVGAttrs(renderState,latestValues,this.isSVGTag,props.transformTemplate,props.style)}renderInstance(instance,renderState,styleProp,projection){renderSVG(instance,renderState,styleProp,projection)}mount(instance){this.isSVGTag=isSVGTag(instance.tagName),super.mount(instance)}constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=createBox}};function animateSingleValue(value,keyframes2,options2){const motionValue$1=isMotionValue(value)?value:motionValue(value);return motionValue$1.start(animateMotionValue("",motionValue$1,keyframes2,options2)),motionValue$1.animation}function isDOMKeyframes(keyframes2){return typeof keyframes2=="object"&&!Array.isArray(keyframes2)}function resolveSubjects(subject,keyframes2,scope2,selectorCache){return subject==null?[]:typeof subject=="string"&&isDOMKeyframes(keyframes2)?resolveElements(subject,scope2,selectorCache):subject instanceof NodeList?Array.from(subject):Array.isArray(subject)?subject.filter(s=>s!=null):[subject]}function calculateRepeatDuration(duration,repeat,repeatDelay){return duration*(repeat+1)+repeatDelay*repeat}function calcNextTime(current,next,prev2,labels){if(typeof next=="number")return next;if(next.startsWith("-")||next.startsWith("+"))return Math.max(0,current+parseFloat(next));if(next==="<")return prev2;if(next.startsWith("<"))return Math.max(0,prev2+parseFloat(next.slice(1)));var ref2;return(ref2=labels.get(next))!==null&&ref2!==void 0?ref2:current}function eraseKeyframes(sequence,startTime,endTime){for(let i=0;i<sequence.length;i++){const keyframe=sequence[i];keyframe.at>startTime&&keyframe.at<endTime&&(removeItem(sequence,keyframe),i--)}}function addKeyframes(sequence,keyframes2,easing,offset,startTime,endTime){eraseKeyframes(sequence,startTime,endTime);for(let i=0;i<keyframes2.length;i++)sequence.push({value:keyframes2[i],at:mixNumber$1(startTime,endTime,offset[i]),easing:getEasingForSegment(easing,i)})}function normalizeTimes(times2,repeat,repeatDelayUnits=0){const totalUnits=repeat+1+repeat*repeatDelayUnits;for(let i=0;i<times2.length;i++)times2[i]=times2[i]/totalUnits}function compareByTime(a,b){return a.at===b.at?a.value===null?1:b.value===null?-1:0:a.at-b.at}const defaultSegmentEasing="easeInOut",MAX_REPEAT=20;function createAnimationsFromSequence(sequence,{defaultTransition={},...sequenceTransition}={},scope2,generators){const defaultDuration=defaultTransition.duration||.3,animationDefinitions=new Map,sequences=new Map,elementCache={},timeLabels=new Map;let prevTime=0,currentTime=0,totalDuration=0;for(let i1=0;i1<sequence.length;i1++){const segment=sequence[i1];if(typeof segment=="string"){timeLabels.set(segment,currentTime);continue}else if(!Array.isArray(segment)){timeLabels.set(segment.name,calcNextTime(currentTime,segment.at,prevTime,timeLabels)
60);continue}let[subject,keyframes2,transition2={}]=segment;transition2.at!==void 0&&(currentTime=calcNextTime(currentTime,transition2.at,prevTime,timeLabels));let maxDuration=0;const resolveValueSequence=(valueKeyframes,valueTransition,valueSequence,elementIndex=0,numSubjects=0)=>{const valueKeyframesAsList=keyframesAsList(valueKeyframes),{delay:delay2=0,times:times2=defaultOffset$1(valueKeyframesAsList),type=defaultTransition.type||"keyframes",repeat,repeatType,repeatDelay=0,...remainingTransition}=valueTransition;let{ease:ease2=defaultTransition.ease||"easeOut",duration}=valueTransition;const calculatedDelay=typeof delay2=="function"?delay2(elementIndex,numSubjects):delay2,numKeyframes=valueKeyframesAsList.length,createGenerator=isGenerator(type)?type:generators?.[type||"keyframes"];if(numKeyframes<=2&&createGenerator){let absoluteDelta=100;if(numKeyframes===2&&isNumberKeyframesArray(valueKeyframesAsList)){const delta=valueKeyframesAsList[1]-valueKeyframesAsList[0];absoluteDelta=Math.abs(delta)}const springTransition={...defaultTransition,...remainingTransition};duration!==void 0&&(springTransition.duration=secondsToMilliseconds(duration));const springEasing=createGeneratorEasing(springTransition,absoluteDelta,createGenerator);ease2=springEasing.ease,duration=springEasing.duration}duration??(duration=defaultDuration);const startTime=currentTime+calculatedDelay;times2.length===1&&times2[0]===0&&(times2[1]=1);const remainder=times2.length-valueKeyframesAsList.length;if(remainder>0&&fillOffset(times2,remainder),valueKeyframesAsList.length===1&&valueKeyframesAsList.unshift(null),repeat&&warning(repeat<MAX_REPEAT,`Sequence segments can't repeat ${repeat} times \u2014 ignoring repeat option. Use a value below ${MAX_REPEAT} or apply repeat at the sequence level instead.`),repeat&&repeat<MAX_REPEAT){const repeatDelayUnits=duration>0?repeatDelay/duration:0;duration=calculateRepeatDuration(duration,repeat,repeatDelay);const originalKeyframes=[...valueKeyframesAsList],originalTimes=[...times2];ease2=Array.isArray(ease2)?[...ease2]:[ease2];const originalEase=[...ease2],isFlipping=repeatType==="reverse"||repeatType==="mirror";let flippedKeyframes=originalKeyframes,flippedEases=originalEase;isFlipping&&(flippedKeyframes=[...originalKeyframes].reverse(),repeatType==="reverse"&&(flippedEases=[...originalEase].reverse().map(e=>typeof e=="function"?reverseEasing(e):e)));for(let repeatIndex=0;repeatIndex<repeat;repeatIndex++){const isFlipped=isFlipping&&repeatIndex%2===0,iterKeyframes=isFlipped?flippedKeyframes:originalKeyframes,iterEase=isFlipped?flippedEases:originalEase,iterStartOffset=(repeatIndex+1)*(1+repeatDelayUnits);repeatDelayUnits>0&&(valueKeyframesAsList.push(valueKeyframesAsList[valueKeyframesAsList.length-1]),times2.push(iterStartOffset),ease2.push("linear")),valueKeyframesAsList.push(...iterKeyframes);for(let keyframeIndex=0;keyframeIndex<iterKeyframes.length;keyframeIndex++)times2.push(originalTimes[keyframeIndex]+iterStartOffset),ease2.push(keyframeIndex===0?"linear":getEasingForSegment(iterEase,keyframeIndex-1))}normalizeTimes(times2,repeat,repeatDelayUnits)}const targetTime=startTime+duration;addKeyframes(valueSequence,valueKeyframesAsList,ease2,times2,startTime,targetTime),maxDuration=Math.max(calculatedDelay+duration,maxDuration),totalDuration=Math.max(targetTime,totalDuration)};if(isMotionValue(subject)){const subjectSequence=getSubjectSequence(subject,sequences);resolveValueSequence(keyframes2,transition2,getValueSequence("default",subjectSequence))}else{const subjects=resolveSubjects(subject,keyframes2,scope2,elementCache),numSubjects=subjects.length;for(let subjectIndex=0;subjectIndex<numSubjects;subjectIndex++){keyframes2=keyframes2,transition2=transition2;const thisSubject=subjects[subjectIndex],subjectSequence=getSubjectSequence(thisSubject,sequences);for(const key in keyframes2)resolveValueSequence(keyframes2[key],getValueTransition(transition2,key),getValueSequence(key,subjectSequence),subjectIndex,numSubjects)}}prevTime=currentTime,currentTime+=maxDuration}return sequences.forEach((valueSequences,element)=>{for(const key in valueSequences){const valueSequence=valueSequences[key];valueSequence.sort(compareByTime);const keyframes2=[],valueOffset=[],valueEasing=[];for(let i=0;i<valueSequence.length;i++){const{at,value,easing}=valueSequence[i];keyframes2.push(value),valueOffset.push(progress(0,totalDuration,at)),valueEasing.push(easing||"easeOut")}valueOffset[0]!==0&&(valueOffset.unshift(0),keyframes2.unshift(keyframes2[0]),valueEasing.unshift(defaultSegmentEasing)),valueOffset[valueOffset.length-1]!==1&&(valueOffset.push(1),keyframes2.push(null)),animationDefinitions.has(element)||animationDefinitions.set(element,{keyframes:{},transition:{}});const definition=animationDefinitions.get(element);definition.keyframes[key]=keyframes2;const{type:_type,...remainingDefaultTransition}=defaultTransition;definition.transition[key]={...remainingDefaultTransition,duration:totalDuration,ease:valueEasing,times:valueOffset,...sequenceTransition}}}),animationDefinitions}function getSubjectSequence(subject,sequences){return!sequences.has(subject)&&sequences.set(subject,{}),sequences.get(subject)}function getValueSequence(name,sequences){return sequences[name]||(sequences[name]=[]),sequences[name]}function keyframesAsList(keyframes2){return Array.isArray(keyframes2)?keyframes2:[keyframes2]}function getValueTransition(transition2,key){return transition2&&transition2[key]?{...transition2,...transition2[key]}:{...transition2}}const isNumber=keyframe=>typeof keyframe=="number",isNumberKeyframesArray=keyframes2=>keyframes2.every(isNumber);function createDOMVisualElement(element){const options2={presenceContext:null,props:{}
60,visualState:{renderState:{transform:{},transformOrigin:{},style:{},vars:{},attrs:{}},latestValues:{}}},node=isSVGElement(element)&&!isSVGSVGElement(element)?new SVGVisualElement(options2):new HTMLVisualElement(options2);node.mount(element),visualElementStore.set(element,node)}function createObjectVisualElement(subject){const options2={presenceContext:null,props:{},visualState:{renderState:{output:{}},latestValues:{}}},node=new ObjectVisualElement(options2);node.mount(subject),visualElementStore.set(subject,node)}function isSingleValue(subject,keyframes2){return isMotionValue(subject)||typeof subject=="number"||typeof subject=="string"&&!isDOMKeyframes(keyframes2)}function animateSubject(subject,keyframes2,options2,scope2){const animations=[];if(isSingleValue(subject,keyframes2))animations.push(animateSingleValue(subject,isDOMKeyframes(keyframes2)&&keyframes2.default||keyframes2,options2&&(options2.default||options2)));else{if(subject==null)return animations;const subjects=resolveSubjects(subject,keyframes2,scope2),numSubjects=subjects.length;invariant(!!numSubjects,"No valid elements provided.","no-valid-elements");for(let i=0;i<numSubjects;i++){const thisSubject=subjects[i],createVisualElement=thisSubject instanceof Element?createDOMVisualElement:createObjectVisualElement;visualElementStore.has(thisSubject)||createVisualElement(thisSubject);const visualElement=visualElementStore.get(thisSubject),transition2={...options2};"delay"in transition2&&typeof transition2.delay=="function"&&(transition2.delay=transition2.delay(i,numSubjects)),animations.push(...animateTarget(visualElement,{...keyframes2,transition:transition2},{}))}}return animations}function animateSequence(sequence,options2,scope2){const animations=[],processedSequence=sequence.map(segment=>{if(Array.isArray(segment)&&typeof segment[0]=="function"){const callback=segment[0],mv=motionValue(0);return mv.on("change",callback),segment.length===1?[mv,[0,1]]:segment.length===2?[mv,[0,1],segment[1]]:[mv,segment[1],segment[2]]}return segment});return createAnimationsFromSequence(processedSequence,options2,scope2,{spring}).forEach(({keyframes:keyframes2,transition:transition2},subject)=>{animations.push(...animateSubject(subject,keyframes2,transition2))}),animations}function isSequence(value){return Array.isArray(value)&&value.some(Array.isArray)}function createScopedAnimate(options1={}){const{scope:scope2,reduceMotion,skipAnimations}=options1;function scopedAnimate(subjectOrSequence,optionsOrKeyframes,options2){let animations=[],animationOnComplete;const inherited={};if(reduceMotion!==void 0&&(inherited.reduceMotion=reduceMotion),skipAnimations!==void 0&&(inherited.skipAnimations=skipAnimations),isSequence(subjectOrSequence)){const{onComplete,...sequenceOptions}=optionsOrKeyframes||{};typeof onComplete=="function"&&(animationOnComplete=onComplete),animations=animateSequence(subjectOrSequence,{...inherited,...sequenceOptions},scope2)}else{const{onComplete,...rest}=options2||{};typeof onComplete=="function"&&(animationOnComplete=onComplete),animations=animateSubject(subjectOrSequence,optionsOrKeyframes,{...inherited,...rest},scope2)}const animation=new GroupAnimationWithThen(animations);return animationOnComplete&&animation.finished.then(animationOnComplete),scope2&&(scope2.animations.push(animation),animation.finished.then(()=>{removeItem(scope2.animations,animation)})),animation}return scopedAnimate}const animate=createScopedAnimate();function canUseNativeTimeline(target){return typeof window>"u"?!1:target?supportsViewTimeline():supportsScrollTimeline()}const maxElapsed=50,createAxisInfo=()=>({current:0,offset:[],progress:0,scrollLength:0,targetOffset:0,targetLength:0,containerLength:0,velocity:0}),createScrollInfo=()=>({time:0,x:createAxisInfo(),y:createAxisInfo()}),keys={x:{length:"Width",position:"Left"},y:{length:"Height",position:"Top"}};function updateAxisInfo(element,axisName,info,time2){const axis=info[axisName],{length,position}=keys[axisName],prev2=axis.current,prevTime=info.time;axis.current=Math.abs(element[`scroll${position}`]),axis.scrollLength=element[`scroll${length}`]-element[`client${length}`],axis.offset.length=0,axis.offset[0]=0,axis.offset[1]=axis.scrollLength,axis.progress=progress(0,axis.scrollLength,axis.current);const elapsed=time2-prevTime;axis.velocity=elapsed>maxElapsed?0:velocityPerSecond(axis.current-prev2,elapsed)}function updateScrollInfo(element,info,time2){updateAxisInfo(element,"x",info,time2),updateAxisInfo(element,"y",info,time2),info.time=time2}function calcInset(element,container){const inset={x:0,y:0};let current=element;for(;current&&current!==container;)if(isHTMLElement(current))inset.x+=current.offsetLeft,inset.y+=current.offsetTop,current=current.offsetParent;else if(current.tagName==="svg"){const svgBoundingBox=current.getBoundingClientRect();current=current.parentElement;const parentBoundingBox=current.getBoundingClientRect();inset.x+=svgBoundingBox.left-parentBoundingBox.left,inset.y+=svgBoundingBox.top-parentBoundingBox.top}else if(current instanceof SVGGraphicsElement){const{x,y}=current.getBBox();inset.x+=x,inset.y+=y;let svg=null,parent=current.parentNode;for(;!svg;)parent.tagName==="svg"&&(svg=parent),parent=current.parentNode;current=svg}else break;return inset}const namedEdges={start:0,center:.5,end:1};function resolveEdge(edge,length,inset=0){let delta=0;if(edge in namedEdges&&(edge=namedEdges[edge]),typeof edge=="string"){const asNumber2=parseFloat(edge);edge.endsWith("px")?delta=asNumber2:edge.endsWith("%")?edge=asNumber2/100:edge.endsWith("vw")?delta=asNumber2/100*document.documentElement.clientWidth:edge.endsWith("vh")?delta=asNumber2/100*document.documentElement.clientHeight:edge=asNumber2}return typeof edge=="number"&&(delta=length*edge),inset+delta}const defaultOffset=[0,0];function resolveOffset(offset,containerLength,targetLength,targetInset){let offsetDefinition=Array.isArray(offset)?offset:defaultOffset,targetPoint=0,containerPoint=0;return typeof offset=="number"?offsetDefinition=[offset,offset]:typeof offset=="string"&&(offset=offset.trim(),offset.includes(" ")?offsetDefinition=offset.split(" "):offsetDefinition=[offset,namedEdges[offset]?offset:"0"]),targetPoint=resolveEdge(offsetDefinition[0],targetLength,targetInset),containerPoint=resolveEdge(offsetDefinition[1],containerLength),targetPoint-containerPoint}const ScrollOffset={Enter:[[0,1],[1,1]],Exit:[[0,0],[1,0]],Any:[[1,0],[0,1]],All:[[0,0],[1,1]]},point={x:0,y:0};function getTargetSize(target){return"getBBox"in target&&target.tagName!=="svg"?target.getBBox():{width:target.clientWidth,height:target.clientHeight}}function resolveOffsets(container,info,options2){const{offset:offsetDefinition=ScrollOffset.All}=options2,{target=container,axis="y"}=options2,lengthLabel=axis==="y"?"height":"width",inset=target!==container?calcInset(target,container):point,targetSize=target===container?{width:container.scrollWidth,height:container.scrollHeight}:getTargetSize(target),containerSize={width:container.clientWidth,height:container.clientHeight};info[axis].offset.length=0;let hasChanged2=!info[axis].interpolate;const numOffsets=offsetDefinition.length;for(let i=0;
60i<numOffsets;i++){const offset=resolveOffset(offsetDefinition[i],containerSize[lengthLabel],targetSize[lengthLabel],inset[axis]);!hasChanged2&&offset!==info[axis].interpolatorOffsets[i]&&(hasChanged2=!0),info[axis].offset[i]=offset}hasChanged2&&(info[axis].interpolate=interpolate(info[axis].offset,defaultOffset$1(offsetDefinition),{clamp:!1}),info[axis].interpolatorOffsets=[...info[axis].offset]),info[axis].progress=clamp(0,1,info[axis].interpolate(info[axis].current))}function measure(container,target=container,info){if(info.x.targetOffset=0,info.y.targetOffset=0,target!==container){let node=target;for(;node&&node!==container;)info.x.targetOffset+=node.offsetLeft,info.y.targetOffset+=node.offsetTop,node=node.offsetParent}info.x.targetLength=target===container?target.scrollWidth:target.clientWidth,info.y.targetLength=target===container?target.scrollHeight:target.clientHeight,info.x.containerLength=container.clientWidth,info.y.containerLength=container.clientHeight,process.env.NODE_ENV!=="production"&&container&&target&&target!==container&&container!==document.documentElement&&container!==document.scrollingElement&&container!==document.body&&warnOnce(getComputedStyle(container).position!=="static","Please ensure that the container has a non-static position, like 'relative', 'fixed', or 'absolute' to ensure scroll offset is calculated correctly.")}function createOnScrollHandler(element,onScroll,info,options2={}){return{measure:time2=>{measure(element,options2.target,info),updateScrollInfo(element,info,time2),(options2.offset||options2.target)&&resolveOffsets(element,info,options2)},notify:()=>onScroll(info)}}const scrollListeners=new WeakMap,resizeListeners=new WeakMap,onScrollHandlers=new WeakMap,scrollSize=new WeakMap,dimensionCheckProcesses=new WeakMap,getEventTarget=element=>element===document.scrollingElement?window:element;function scrollInfo(onScroll,{container=document.scrollingElement,trackContentSize=!1,...options2}={}){if(!container)return noop;let containerHandlers=onScrollHandlers.get(container);containerHandlers||(containerHandlers=new Set,onScrollHandlers.set(container,containerHandlers));const info=createScrollInfo(),containerHandler=createOnScrollHandler(container,onScroll,info,options2);if(containerHandlers.add(containerHandler),!scrollListeners.has(container)){const measureAll=()=>{for(const handler4 of containerHandlers)handler4.measure(frameData.timestamp);frame.preUpdate(notifyAll2)},notifyAll2=()=>{for(const handler4 of containerHandlers)handler4.notify()},listener2=()=>frame.read(measureAll);scrollListeners.set(container,listener2);const target=getEventTarget(container);window.addEventListener("resize",listener2),container!==document.documentElement&&resizeListeners.set(container,resize(container,listener2)),target.addEventListener("scroll",listener2),listener2()}if(trackContentSize&&!dimensionCheckProcesses.has(container)){const listener2=scrollListeners.get(container),size2={width:container.scrollWidth,height:container.scrollHeight};scrollSize.set(container,size2);const checkScrollDimensions=()=>{const newWidth=container.scrollWidth,newHeight=container.scrollHeight;(size2.width!==newWidth||size2.height!==newHeight)&&(listener2(),size2.width=newWidth,size2.height=newHeight)},dimensionCheckProcess=frame.read(checkScrollDimensions,!0);dimensionCheckProcesses.set(container,dimensionCheckProcess)}const listener=scrollListeners.get(container);return frame.read(listener,!1,!0),()=>{cancelFrame(listener);const currentHandlers=onScrollHandlers.get(container);if(!currentHandlers||(currentHandlers.delete(containerHandler),currentHandlers.size))return;const scrollListener2=scrollListeners.get(container);if(scrollListeners.delete(container),scrollListener2){var ref2;getEventTarget(container).removeEventListener("scroll",scrollListener2),(ref2=resizeListeners.get(container))===null||ref2===void 0||ref2(),window.removeEventListener("resize",scrollListener2)}const dimensionCheckProcess=dimensionCheckProcesses.get(container);dimensionCheckProcess&&(cancelFrame(dimensionCheckProcess),dimensionCheckProcesses.delete(container)),scrollSize.delete(container)}}const presets=[[ScrollOffset.Enter,"entry"],[ScrollOffset.Exit,"exit"],[ScrollOffset.Any,"cover"],[ScrollOffset.All,"contain"]],stringToProgress={start:0,end:1};function parseStringOffset(s){const parts=s.trim().split(/\s+/);if(parts.length!==2)return;const a=stringToProgress[parts[0]],b=stringToProgress[parts[1]];if(!(a===void 0||b===void 0))return[a,b]}function normaliseOffset(offset){if(offset.length!==2)return;const result=[];for(const item of offset)if(Array.isArray(item))result.push(item);else if(typeof item=="string"){const parsed=parseStringOffset(item);if(!parsed)return;result.push(parsed)}else return;return result}function matchesPreset(offset,preset){const normalised=normaliseOffset(offset);if(!normalised)return!1;for(let i=0;i<2;i++){const o=normalised[i],p=preset[i];if(o[0]!==p[0]||o[1]!==p[1])return!1}return!0}function offsetToViewTimelineRange(offset){if(!offset)return{rangeStart:"contain 0%",rangeEnd:"contain 100%"};
60for(const[preset,name]of presets)if(matchesPreset(offset,preset))return{rangeStart:`${name} 0%`,rangeEnd:`${name} 100%`}}const timelineCache=new Map;function scrollTimelineFallback(options2){const currentTime={value:0},cancel=scrollInfo(info=>{currentTime.value=info[options2.axis].progress*100},options2);return{currentTime,cancel}}function getTimeline({source,container,...options2}){const{axis}=options2;source&&(container=source);let containerCache=timelineCache.get(container);containerCache||(containerCache=new Map,timelineCache.set(container,containerCache));var _target;const targetKey=(_target=options2.target)!==null&&_target!==void 0?_target:"self";let targetCache=containerCache.get(targetKey);targetCache||(targetCache={},containerCache.set(targetKey,targetCache));var _offset;const axisKey=axis+((_offset=options2.offset)!==null&&_offset!==void 0?_offset:[]).join(",");return targetCache[axisKey]||(options2.target&&canUseNativeTimeline(options2.target)?offsetToViewTimelineRange(options2.offset)?targetCache[axisKey]=new ViewTimeline({subject:options2.target,axis}):targetCache[axisKey]=scrollTimelineFallback({container,...options2}):canUseNativeTimeline()?targetCache[axisKey]=new ScrollTimeline({source:container,axis}):targetCache[axisKey]=scrollTimelineFallback({container,...options2})),targetCache[axisKey]}function attachToAnimation(animation,options2){const timeline=getTimeline(options2),range=options2.target?offsetToViewTimelineRange(options2.offset):void 0,useNative=options2.target?canUseNativeTimeline(options2.target)&&!!range:canUseNativeTimeline();return animation.attachTimeline({timeline:useNative?timeline:void 0,...range&&useNative&&{rangeStart:range.rangeStart,rangeEnd:range.rangeEnd},observe:valueAnimation=>(valueAnimation.pause(),observeTimeline(progress2=>{valueAnimation.time=valueAnimation.iterationDuration*progress2},timeline))})}function isElementTracking(options2){return options2&&(options2.target||options2.offset)}function isOnScrollWithInfo(onScroll){return onScroll.length===2}function attachToFunction(onScroll,options2){return isOnScrollWithInfo(onScroll)||isElementTracking(options2)?scrollInfo(info=>{onScroll(info[options2.axis].progress,info)},options2):observeTimeline(onScroll,getTimeline(options2))}function scroll(onScroll,{axis="y",container=document.scrollingElement,...options2}={}){if(!container)return noop;const optionsWithDefaults={axis,container,...options2};return typeof onScroll=="function"?attachToFunction(onScroll,optionsWithDefaults):attachToAnimation(onScroll,optionsWithDefaults)}const thresholds={some:0,all:1};function inView(elementOrSelector,onStart,{root,margin:rootMargin,amount="some"}={}){const elements=resolveElements(elementOrSelector),activeIntersections=new WeakMap,onIntersectionChange=entries=>{entries.forEach(entry=>{const onEnd=activeIntersections.get(entry.target);if(entry.isIntersecting!==!!onEnd)if(entry.isIntersecting){const newOnEnd=onStart(entry.target,entry);typeof newOnEnd=="function"?activeIntersections.set(entry.target,newOnEnd):observer2.unobserve(entry.target)}else typeof onEnd=="function"&&(onEnd(entry),activeIntersections.delete(entry.target))})},observer2=new IntersectionObserver(onIntersectionChange,{root,rootMargin,threshold:typeof amount=="number"?amount:thresholds[amount]});return elements.forEach(element=>observer2.observe(element)),()=>observer2.disconnect()}function disclosure(Alpine2){Alpine2.directive("disclosure",($el,data2,utilities)=>{if(data2.value==="panel")handlePanel($el,Alpine2);else if(data2.value==="button")handleButton($el,Alpine2);else if(data2.value===null)handleRoot$4($el,Alpine2,data2,utilities);else throw new Error(`Unknown directive: x-disclosure:${data2.value}`)}).before("bind"),Alpine2.directive("disclosure-group",($el,data2,utilities)=>{if(data2.value===null)handleDisclosureGroup($el,Alpine2,data2,utilities);else throw new Error(`Unknown directive: x-disclosure-group:${data2.value}`)}).before("bind"),Alpine2.magic("disclosure",handleDisclosureMagic(Alpine2)),Alpine2.magic("disclosureGroup",handleDisclosureGroupMagic(Alpine2))}function handleDisclosureMagic(Alpine2){return function($el){const $data=Alpine2.$data($el);return{get isExpanded(){var _a;return(_a=$data.__disclosure_state)===null||_a===void 0?void 0:_a.isExpanded},set isExpanded(value){$data.__disclosure_state&&($data.__disclosure_state.isExpanded=value)},get isCollapsed(){var _a1;return(_a1=$data.__disclosure_state)===null||_a1===void 0?void 0:_a1.isCollapsed},get isInGroup(){return $data.__disclosure_isInGroup},get groupIndex(){return $data.__disclosure_groupIndex},toggle(){var _a;(_a=$data.__disclosure_state)===null||_a===void 0||_a.toggle()},expand(){var _a;(_a=$data.__disclosure_state)===null||_a===void 0||_a.expand()},collapse(){var _a;(_a=$data.__disclosure_state)===null||_a===void 0||_a.collapse()},waitForAnimations(){return $data.__disclosure_waitForAnimations()}}}}function handleDisclosureGroupMagic(Alpine2){return function($el){return Alpine2.$data($el).__disclosure_group_state||{}}}function handlePanel($el,Alpine2){$el._x_doShow||($el._x_doShow=()=>{}),$el._x_doHide||($el._x_doHide=()=>{}),Alpine2.bind($el,{":id":"$el.id || $id('disclosure-panel')",role:"group","x-show":"$disclosure.isExpanded","x-init"(){if
60(!this.__disclosure_isRoot){warnMissingParentDirective("x-disclosure:panel","x-disclosure",this.$el);return}this.__disclosure_contentEl=this.$el;const addHidden=()=>{Alpine2.mutateDom(()=>{this.$el.setAttribute("hidden",""),this.$el.style.setProperty("display","none")})},removeHidden=()=>{Alpine2.mutateDom(()=>{this.$el.removeAttribute("hidden"),this.$el.style.removeProperty("display")})};this.__disclosure_state.isExpanded?removeHidden():addHidden(),this.$watch("__disclosure_state.isExpanded",async isExpanded=>{if(isExpanded)removeHidden();else if(this.__disclosure_animated){if(await this.__disclosure_waitForAnimations(),this.__disclosure_state.isExpanded)return;addHidden()}else addHidden()})},":aria-labelledby"(){var _a;return(_a=this.__disclosure_buttonEl)===null||_a===void 0?void 0:_a.id},"data-morph-children-only":""})}function handleButton($el,Alpine2){Alpine2.bind($el,{":role"(){return this.$el.tagName==="BUTTON"?void 0:"button"},":id":"$el.id || $id('disclosure-button')","x-init"(){if(!this.__disclosure_isRoot){warnMissingParentDirective("x-disclosure:button","x-disclosure",this.$el);return}this.__disclosure_buttonEl=this.$el},"@click.stop.prevent":"$disclosure.toggle()",":aria-controls"(){var _a;return(_a=this.__disclosure_contentEl)===null||_a===void 0?void 0:_a.id},":aria-expanded":"$disclosure.isExpanded"})}function handleDisclosureGroup($el,Alpine2,{expression,modifiers},{evaluate:evaluate2}){let options2=evaluate2(expression===""?"{}":expression);if(options2!=null&&!isPlainObject(options2))throw new Error(`options must be an object, but got ${options2}`);let state;options2.multiple||modifiers.includes("multiple")?state=buildMultiSelectDisclosureGroupState(options2):state=buildSingleSelectDisclosureGroupState(options2),Alpine2.bind($el,{"x-data"(){return{__disclosure_group_state:state,__disclosure_groupDepth:null}}})}function handleRoot$4($el,Alpine2,{modifiers,expression},{evaluate:evaluate2}){const $data=Alpine2.$data($el),isInDisclosureGroup=!!$data.__disclosure_group_state;let groupDepth=$data.__disclosure_groupDepth;isInDisclosureGroup&&(groupDepth==null&&(groupDepth=0),groupDepth++);const isDirectChildOfDisclosureGroup=isInDisclosureGroup&&groupDepth===1,animated=!modifiers.includes("noanimate"),expand=modifiers.includes("expand");let options2={};if(expression){let evalutatedExpression=evaluate2(expression===""?"{}":expression);evalutatedExpression===!0||evalutatedExpression===!1?options2.isExpanded=evalutatedExpression:isPlainObject(evalutatedExpression)&&(options2=evalutatedExpression)}else expand&&(options2.isExpanded=!0);let state=buildDisclosureState(options2);isDirectChildOfDisclosureGroup&&(state=buildDisclosureState({get isExpanded(){var _a,_b;const index=(_b=(_a=$data.__disclosure_group_state).indexOf)===null||_b===void 0?void 0:_b.call(_a,$el);return $data.__disclosure_group_state.isExpanded(index)},set isExpanded(value){var _a2,_b1;const index=(_b1=(_a2=$data.__disclosure_group_state).indexOf)===null||_b1===void 0?void 0:_b1.call(_a2,$el);value?$data.__disclosure_group_state.expand(index):$data.__disclosure_group_state.collapse(index)}})),Alpine2.bind($el,{":id":"$el.id || $id('disclosure')","x-data"(){return{__disclosure_isRoot:!0,__disclosure_buttonEl:null,__disclosure_contentEl:null,__disclosure_state:state,__disclosure_animated:animated,__disclosure_groupDepth:groupDepth,init(){this.$watch("__disclosure_state.isExpanded",isExpanded=>{this.$dispatch(isExpanded?"expand":"collapse")}),isDirectChildOfDisclosureGroup&&(this.$data.__disclosure_group_state.register(this.$el),options2.isExpanded&&this.__disclosure_state.expand())},destroy(){isDirectChildOfDisclosureGroup&&this.$data.__disclosure_group_state.unregister(this.$el)},async __disclosure_waitForAnimations(){return await this.$waitForAnimations({subtree:!0,target:this.__disclosure_contentEl})},get __disclosure_isInGroup(){return isInDisclosureGroup},get __disclosure_groupIndex(){var _a,_b;return this.__disclosure_isInGroup?(_b=(_a=$data.__disclosure_group_state).indexOf)===null||_b===void 0?void 0:_b.call(_a,this.$el):null}}},"x-id":"['disclosure', 'disclosure-panel', 'disclosure-button']"})}
60function buildDisclosureState(options2){var _a;let state={isExpanded:(_a=options2?.isExpanded)!==null&&_a!==void 0?_a:!1,expand(){this.isExpanded=!0},collapse(){this.isExpanded=!1},toggle(){this.isExpanded=!this.isExpanded},get isCollapsed(){return!this.isExpanded}};if(options2?.isExpanded!==void 0){const isExpandedDescriptor=Object.getOwnPropertyDescriptor(options2,"isExpanded");Object.defineProperty(state,"isExpanded",isExpandedDescriptor)}return state}function buildSingleSelectDisclosureGroupState(options2){var _a3;let state={expandedIndex:(_a3=options2?.initiallyExpandedIndex)!==null&&_a3!==void 0?_a3:null,items:new Set,isExpanded(index){return this.expandedIndex===index},register(el){this.items.add(el)},unregister(el){this.items.delete(el)},indexOf(el){var _a;const explicit=(_a=options2?.getIndex)===null||_a===void 0?void 0:_a.call(options2,el);return explicit??Array.from(this.items).indexOf(el)},toggle(index){this.expandedIndex===index?this.collapse(index):this.expand(index)},expand(index){this.expandedIndex=index},collapse(index){this.expandedIndex===index&&(this.expandedIndex=null)}};return options2&&"expandedIndex"in options2&&copyProperty(options2,state,"expandedIndex"),state}function buildMultiSelectDisclosureGroupState(options2){var _a;let state={expandedIndices:(_a=options2?.initiallyExpandedIndices)!==null&&_a!==void 0?_a:new Set,items:new Set,isExpanded(index){return this.expandedIndices.has(index)},register(el){this.items.add(el)},unregister(el){this.items.delete(el)},indexOf(el){return Array.from(this.items).indexOf(el)},toggle(index){this.expandedIndices.has(index)?this.collapse(index):this.expand(index)},expand(index){const expanded=this.expandedIndices;expanded.add(index),this.expandedIndices=new Set(Array.from(expanded))},collapse(index){const expanded=this.expandedIndices;expanded.delete(index),this.expandedIndices=new Set(Array.from(expanded))}};return options2&&"expandedIndices"in options2&&copyProperty(options2,state,"expandedIndices"),state}function section(Alpine2){Alpine2.store("sectionData",{}),Alpine2.magic("sectionData",$el=>{var _a;const sectionId=(_a=closestSectionEl($el))===null||_a===void 0?void 0:_a.id;return sectionId?new Proxy({},{get(_target,prop){return!sectionId||!(sectionId in Alpine2.store("sectionData"))?null:Alpine2.store("sectionData")[sectionId][prop]},set(_target,prop,value){return sectionId?(sectionId in Alpine2.store("sectionData")||(Alpine2.store("sectionData")[sectionId]={}),Alpine2.store("sectionData")[sectionId][prop]=value,!0):!1}}):{}}),Alpine2.magic("sectionEl",$el=>closestSectionEl($el)),Alpine2.magic("sectionId",$el=>{var _a;const rawId=(_a=closestSectionEl($el))===null||_a===void 0?void 0:_a.id;return rawId?rawId.startsWith("shopify-section-")?rawId.split("shopify-section-")[1]:rawId:null})}const DATA_EXCLUDE_SUBTREE_ATTRIBUTE="data-skip-animation-wait",DEFAULT_EXCLUDE_SUBTREE_FILTER=element=>element.hasAttribute(DATA_EXCLUDE_SUBTREE_ATTRIBUTE),ANIMATION_START_TIMEOUT=50,ANIMATION_COMPLETION_TIMEOUT=2e3;function animationUtils(Alpine2){Alpine2.magic("waitForAnimations",function($el){return async function(options2){var _a;const parentEl=(_a=options2?.target)!==null&&_a!==void 0?_a:$el,animations=await getPendingAnimations(parentEl,options2);return getCompletedAnimations(parentEl,animations,options2?.subtree,options2?.excludeSubtree)}})}async function getPendingAnimations($el,options2={}){return new Promise((resolve,reject)=>
60{let startTimeout=ANIMATION_START_TIMEOUT;options2?.startTimeout!==void 0&&(options2.startTimeout===!1?startTimeout=0:startTimeout=options2.startTimeout),setTimeout(()=>{let animations=$el.getAnimations(options2);options2.excludeSubtree&&(animations=filterSubtreeAnimations($el,animations,options2.excludeSubtree)),animations.length===0?(warnForNoAnimationsStarted($el,options2?.subtree),resolve([])):resolve(animations)},startTimeout)})}async function getCompletedAnimations($el,animations,subtree=!1,excludeSubtree=DEFAULT_EXCLUDE_SUBTREE_FILTER){let timedOutAnimations=[],filteredAnimations=filterSubtreeAnimations($el,animations,excludeSubtree);const animationPromises=filteredAnimations.map(animation=>animation.finished);return await promiseAllSettledWithTimeout(animationPromises,ANIMATION_COMPLETION_TIMEOUT).then(results=>{results.forEach((result,i)=>{result.status==="rejected"&&result.reason==="timeout"&&(timedOutAnimations=[...timedOutAnimations,filteredAnimations[i]])})}),timedOutAnimations.length>0?(warnForNoAnimationsFinished($el,filteredAnimations,timedOutAnimations,subtree),[]):filteredAnimations}function warnForNoAnimationsStarted($el,subtree=!1){process.env.NODE_ENV==="development"&&console.warn(subtree?`Expected animations or transitions to start on element or its desce
60ndants, but none did after waiting ${ANIMATION_START_TIMEOUT}ms`:`Expected animations or transitions to start on element, but none did after waiting ${ANIMATION_START_TIMEOUT}ms`,$el)}function warnForNoAnimationsFinished($el,started2,unfinished,subtree=!1){process.env.NODE_ENV==="development"&&console.warn(subtree?`Expected all animations or transitions on element and its descendants to finish within ${ANIMATION_COMPLETION_TIMEOUT}ms, but ${unfinished.length} of ${started2.length} did not`:`Expected all animations or transitions on element to finish within ${ANIMATION_COMPLETION_TIMEOUT}ms, but ${unfinished.length} of ${started2.length} did not`,$el,unfinished)}function promiseAllSettledWithTimeout(promises,timeoutMs){return Promise.allSettled(promises.map(promise=>withTimeout(promise,timeoutMs)))}async function withTimeout(promise,timeoutMs){let timeoutHandle;const timeoutPromise=new Promise((_resolve,reject)=>{timeoutHandle=setTimeout(()=>{reject("timeout")},timeoutMs)});return Promise.race([promise,timeoutPromise]).then(result=>(clearTimeout(timeoutHandle),result)).catch(error2=>{throw clearTimeout(timeoutHandle),error2})}function isKeyframeEffect(effect3){return effect3 instanceof KeyframeEffect}function filterSubtreeAnimations(rootEl,animations,filter2){const hasExcludedAncestor=animatedElement=>{let parent=animatedElement.parentElement;if(animatedElement===rootEl||parent===rootEl)return!1;for(;parent;){if(filter2(parent))return!0;parent=parent.parentElement}return!1};return animations.filter(animation=>{if(isKeyframeEffect(animation.effect)){const target=animation.effect.target;return target?filter2(target)?!1:!hasExcludedAncestor(target):!0}else return!0})}function asyncForm(Alpine2){Alpine2.directive("async-form",($el,data2,utilities)=>{if(data2.value=="form")handleForm$1($el,Alpine2,data2,utilities);else if(data2.value=="context")handleContext($el,Alpine2,data2,utilities);else if(data2.value==null)if(isFormElement($el))Alpine2.bind($el,{[`x-async-form:context.${data2.modifiers.join(".")}`]:data2.expression||"",[`x-async-form:form.${data2.modifiers.join(".")}`]:""});else{const form=$el.querySelector("form");Alpine2.bind($el,{[`x-async-form:context.${data2.modifiers.join(".")}`]:data2.expression||""}),form&&Alpine2.bind(form,{[`x-async-form:form.${data2.modifiers.join(".")}`]:""})}else throw new Error(`Unknown directive: x-async-form:${data2.value}`)}).before("bind"),Alpine2.magic("asyncForm",handleAsyncFormMagic(Alpine2))}function handleAsyncFormMagic(Alpine2){return function($el){const $data=Alpine2.$data($el);return{get formData(){return $data.__asyncForm_formData},get state(){return $data.__asyncForm_state},get response(){return $data.__asyncForm_response},get parsedBody(){return $data.__asyncForm_parsedBody},reset(){return $data.__asyncForm_reset()},submitAsync(info){return $data.__asyncForm_submitAsync(info)},get errorMessage(){return $data.__asyncForm_errorMessage},get errorDescription(){return $data.__asyncForm_errorDescription},get signal(){var _a;return((_a=$data.__asyncForm_abortController)===null||_a===void 0?void 0:_a.signal)||null}}}}function handleContext($el,Alpine2,{expression,modifiers},{evaluateLater:evaluateLater2}){let getCallbackFn=expression?evaluateLater2(expression):null;const errorTimeout=getErrorTimeoutModifier(modifiers)||!1,successTimeout=getSuccessTimeoutModifier(modifiers)||1e3;Alpine2.bind($el,{"x-data"(){return{__asyncForm_formEl:null,__asyncForm_stateMachine:new StateMachine("idle",["idle","pending","success","error"],{idle:["pending"],pending:["success","error","pending"],success:["idle","pending"],error:["idle","pending"]}),__asyncForm_callback:null,__asyncForm_abortController:null,__asyncForm_formData:null,__asyncForm_response:null,__asyncForm_parsedBody:null,__asyncForm_errorMessage:null,__asyncForm_errorDescription:null,__asyncForm_successTimeout:successTimeout||!1,__asyncForm_errorTimeout:errorTimeout||!1,init(){this.$watch("__asyncForm_state",(state,prevState)=>{(prevState=="success"||prevState=="error")&&state=="idle"&&(this.__asyncForm_formData=null),prevState=="success"&&state=="idle"&&(this.__asyncForm_errorMessage=null,this.__asyncForm_errorDescription=null)}),Alpine2.effect(()=>{this.__asyncForm_callback=callbackInfo=>{var _a,_b;if(!getCallbackFn){const submissionInfo=Object.assign(Object.assign({},callbackInfo),{action:this.$el.getAttribute("async-action")||callbackInfo?.action});return submitFormData(submissionInfo,{signal:(_a=this.__asyncForm_abortController)===null||_a===void 0?void 0:_a.signal})}let result;if(Alpine2.dontAutoEvaluateFunctions(()=>{getCallbackFn(callbackResult=>{result=callbackResult})}),typeof result=="function"){const formSubmissionInfoOrPromise=result.bind(this)(callbackInfo);if(formSubmissionInfoOrPromise instanceof Promise)return formSubmissionInfoOrPromise;if(typeof formSubmissionInfoOrPromise=="object"&&formSubmissionInfoOrPromise!==null){const mergedInfo=Object.assign(Object.assign({},callbackInfo),formSubmissionInfoOrPromise);return submitFormData(mergedInfo,{signal:(_b=this.__asyncForm_abortController)===null||_b===void 0?void 0:_b.signal})}}else throw new Error("x-async-form callback must return a Promise, or FormDataSubmissionInfo");throw new Error("x-async-form callback must return a Promise, partial FormDataSubmissionInfo object, or a function that returns a Promise")}})},get __asyncForm_state(){return this.__asyncForm_stateMachine.state},set __asyncForm_state(state){this.__asyncForm_stateMachine.state=state},get __asyncForm_form(){var _a1;let form=null;return this.$el.tagName==="FORM"&&(form=this.$el),this.__asyncForm_formEl&&((_a1=this.__asyncForm_formEl)===null||_a1===void 0?void 0:_a1.tagName)==="FORM"&&(form=this.__asyncForm_formEl),form},async __asyncForm_submitAsync(info){info?.formData&&(this.__asyncForm_formData=info.formData),this.__asyncForm_state="pending",(this.__asyncForm_formEl||this.$el).dispatchEvent(new CustomEvent("form:pending",{bubbles:!0,composed:!0,cancelable:!0,detail:this.__asyncForm_formData})),await yieldToMain(),this.__asyncForm_abortController&&this.__asyncForm_abortController.abort("cancelled by user"),this.__asyncForm_abortController=new AbortController;try{const response=await this.__asyncForm_callback.bind(this)(info);return await this.__asyncForm_handleResponse(response)}catch(e){return e.name=="AbortError"?null:(this.__asyncForm_handleError(String(e?.message||e)),console.error(e),Promise.resolve())}},async __asyncForm_handleResponse(response){if(this.__asyncForm_response=response,this.__asyncForm_parsedBody=await parseResponseBody(response),!response||response?.status==null)return this.__asyncForm_handleSuccess(),response;if(response.status===200)return this.__asyncForm_handleSuccess(),response;{let message=getErrorMessage(response,this.__asyncForm_parsedBody),description=getErrorDescription(this.__asyncForm_parsedBody);return this.__asyncForm_handleError(message,description),response}},async __asyncForm_handleSuccess(){(this.__asyncForm_formEl||this.$el).dispatchEvent(new CustomEvent("form:success",{bubbles:!0,composed:!0,cancelable:!0,detail:this.__asyncForm_parsedBody})),successTimeout?this.__asyncForm_stateMachine.setTransientState("success","idle",successTimeout):this.__asyncForm_state="success"},async __asyncForm_handleError(message,description){(this.__asyncForm_formEl||this.$el).dispatchEvent(new CustomEvent("form:error",{bubbles:!0,composed:!0,cancelable:!0,detail:{message,description}})),errorTimeout?this.__asyncForm_stateMachine.setTransientState("error","idle",errorTimeout):this.__asyncForm_state="error",this.__asyncForm_errorMessage=message,this.__asyncForm_errorDescription=description},__asyncForm_reset(){this.__asyncForm_abortController&&(this.__asyncForm_abortController.abort("cancelled by user"),this.__asyncForm_abortController=null),this.__asyncForm_state="idle",this.__asyncForm_response=null,this.__asyncForm_parsedBody=null,this.__asyncForm_errorMessage=null,this.__asyncForm_errorDescription=null}}}})}function handleForm$1($el,Alpine2,{expression},{}){if(!isFormElement($el))throw new Error("x-async-form:form directive can only be used on form elements");Alpine2.bind($el,{"x-data"(){return{__asyncForm_form_onSubmit(e){e.preventDefault(),this.__asyncForm_submitAsync(getFormSubmissionInfo($el,e.submitter))},init(){if(this.__asyncForm_submitAsync==null)throw new Error("x-async-form:form directive must be used within an x-async-form:context directive")}}},"x-init"(){this.__asyncForm_submitAsync!=null&&(this.__asyncForm_formEl=this.$el)},"@submit":"__asyncForm_form_onSubmit"})}function getErrorTimeoutModifier(modifiers){return getMillisecondsModifierValue(modifiers,"wait-error")||!1}function getSuccessTimeoutModifier(modifiers){return getMillisecondsModifierValue(modifiers,"wait-success")||!1}async function parseResponseBody(response){var _a;if(!response||!isPlainObject(response)||!("json"in response))return null;if(!((_a=response.headers.get("Content-Type"))===null||_a===void 0)&&_a.includes("text/html"))return await response.clone().text();try{return await response.clone().json()}catch{return await response.clone().text()}}function getErrorMessage(response,parsedBody){return isPlainObject(parsedBody)&&parsedBody.message?parsedBody.message:response.statusText}function getErrorDescription(parsedBody){if(isPlainObject(parsedBody)){if(parsedBody.description)return isPlainObject(parsedBody.description)?Object.values(parsedBody.description).filter(str=>str!=null).join(", "):parsedBody.description;if(parsedBody.error)return parsedBody.error.toString();if(parsedBody.errors)return parsedBody.errors.toString()}return null}function asyncLink(Alpine2){Alpine2.directive("async-link",($el,data2,{evaluateLater:evaluateLater2})=>
60{if(data2.value=="link"){if(!isAnchorElement($el))throw new Error("x-async-link:link directive can only be used on anchor elements");Alpine2.bind($el,{"x-data"(){return{async __asyncLink_onClick(e){shouldProcessLinkClick(e,$el.target)&&(e.defaultPrevented||this.$el.href&&(e.preventDefault(),this.__asyncLink_load(this.$el.href)))},init(){if(this.__asyncLink_state==null)throw new Error("x-async-link:link directive must be used within an x-async-link:context directive")}}},"@click":"__asyncLink_onClick"})}else if(data2.value=="context"){if(!data2.expression)throw new Error("x-async-link:context directive requires a an async callback function");let getCallbackFn=evaluateLater2(data2.expression);Alpine2.bind($el,{"x-data"(){return{__asyncLink_pendingHref:null,__asyncLink_stateMachine:new StateMachine("idle",["idle","pending"],{idle:["pending"],pending:["pending","idle"]}),__asyncLink_callback:null,__asyncLink_errorMessage:null,__asyncLink_errorDescription:null,init(){Alpine2.effect(()=>{this.__asyncLink_callback=async href=>{let resultPromise;return Alpine2.dontAutoEvaluateFunctions(()=>{getCallbackFn(async result=>{if(typeof result=="function")resultPromise=result.bind(this)(href);else throw new Error("x-async-link expects an async function as its expression")},{params:[href],scope:{$href:href}})}),resultPromise}})},get __asyncLink_state(){return this.__asyncLink_stateMachine.state},get __asyncLink_prevState(){return this.__asyncLink_stateMachine.prevState},set __asyncLink_state(state){this.__asyncLink_stateMachine.state=state},async __asyncLink_load(href){this.__asyncLink_state="pending",this.__asyncLink_pendingHref=href,this.$dispatch("link:pending",this.__asyncLink_pendingHref),await yieldToMain();try{const response=await this.__asyncLink_callback.bind(this)(href);if(!response||response?.status==null)return this.__asyncLink_handleSuccess(),response;if(response.status===200)return this.__asyncLink_handleSuccess(),response;if(response.status===422){const body=await response.json();return this.__asyncLink_handleError(body.message,body.description),response}else return this.__asyncLink_handleError(response.statusText),response}catch(e){if(e.name=="AbortError")return this.__asyncLink_pendingHref=null,this.__asyncLink_state="idle",!1;throw this.__asyncLink_handleError(String(e?.message||e)),e}},async __asyncLink_handleSuccess(){this.$dispatch("link:loaded",this.__asyncLink_pendingHref),this.__asyncLink_state="idle",this.__asyncLink_pendingHref=null},async __asyncLink_handleError(message,description){this.__asyncLink_state="idle",this.__asyncLink_errorMessage=message,this.__asyncLink_errorDescription=description,this.__asyncLink_pendingHref=null},__asyncLink_reset(){this.__asyncLink_state="idle",this.__asyncLink_errorMessage=null,this.__asyncLink_errorDescription=null,this.__asyncLink_pendingHref=null}}}})}else{if(!data2.expression)throw new Error("x-async-link directive requires a an async callback function");if(!isAnchorElement($el))throw new Error("x-async-link directive can only be used on anchor elements");Alpine2.bind($el,{"x-async-link:context":data2.expression,[`x-async-link:link.${data2.modifiers.join(".")}`]:""})}}).before("bind"),Alpine2.magic("asyncLink",$el=>{const $data=Alpine2.$data($el);return{get pendingHref(){return $data.__asyncLink_pendingHref},get state(){return $data.__asyncLink_state},get reset(){return $data.__asyncLink_reset()},get errorMessage(){return $data.__asyncLink_errorMessage},get errorDescription(){return $data.__asyncLink_errorDescription}}})}const DEFAULT_SLIDE_DURATION=1e3;function slideshow(Alpine2){Alpine2.directive("slideshow",($el,data2,utilities)=>{if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(data2.value==="slide")handleSlide($el,Alpine2);else if(data2.value==="control")handleControl($el,Alpine2);else if(data2.value==="play")handlePlayButton($el,Alpine2);else if(data2.value==="pause")handlePauseButton($el,Alpine2);else if(data2.value==="next")handleNextButton($el,Alpine2);else if(data2.value==="prev")handlePrevButton($el,Alpine2);else if(data2.value==="toggle")handleToggleButton($el,Alpine2);else if(data2.value==="viewport")handleViewport($el,Alpine2);else if(data2.value===null)handleRoot$3($el,Alpine2,data2,utilities);else throw new Error(`Unknown directive: x-slideshow:${data2.value}`)}).before("bind"),Alpine2.magic("slideshow",function($el){return Alpine2.$data($el).__slideshow_state||{}}),Alpine2.magic("slide",function($el){const $data=Alpine2.$data($el);return{get slideIndex(){return $data.__slideshowSlide_slideIndex},get isCurrentSlide(){return $data.__slideshowSlide_isCurrentSlide},get wasLastSlide(){return $data.__slideshowSlide_wasLastSlide}}})}function handleControl($el,Alpine2){Alpine2.bind($el,{":aria-controls":'$id("slideshow")'})}function handlePlayButton($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.__slideshow_isRoot||warn
60MissingParentDirective("x-slideshow:play","x-slideshow",this.$el)}}},"@click":"$slideshow.play()","x-slideshow:control":""})}function handlePauseButton($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.__slideshow_isRoot||warnMissingParentDirective("x-slideshow:pause","x-slideshow",this.$el)}}},"@click":"$slideshow.pause()","x-slideshow:control":""})}function handleNextButton($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.__slideshow_isRoot||warnMissingParentDirective("x-slideshow:next","x-slideshow",this.$el)}}},"@click":"$slideshow.pause(); $slideshow.next()","x-slideshow:control":""})}function handlePrevButton($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.__slideshow_isRoot||warnMissingParentDirective("x-slideshow:prev","x-slideshow",this.$el)}}},"@click":"$slideshow.pause(); $slideshow.prev()","x-slideshow:control":""})}function handleToggleButton($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.__slideshow_isRoot||warnMissingParentDirective("x-slideshow:toggle","x-slideshow",this.$el)}}},"@click":"$slideshow.toggle()","x-slideshow:control":""})}function handleSlide($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){if(!this.__slideshow_isRoot){warnMissingParentDirective("x-slideshow:slide","x-slideshow",this.$el);return}this.__slideshow_state.register(this.$el)},destroy(){this.__slideshow_isRoot&&this.__slideshow_state.unregister(this.$el)},get __slideshowSlide_slideIndex(){return this.__slideshow_isRoot?Array.from(this.__slideshow_state.slides).indexOf(this.$el):null},get __slideshowSlide_isCurrentSlide(){return this.__slideshow_isRoot?this.__slideshow_state.currentSlideIndex===this.__slideshowSlide_slideIndex:!1},get __slideshowSlide_wasLastSlide(){return this.__slideshow_isRoot?this.__slideshow_state.lastSlideIndex===this.__slideshowSlide_slideIndex:!1}}},role:"group","aria-roledescription":"slide"})}function handleViewport($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{init(){this.$nextTick(()=>{Alpine2.$data($el).__slideshow_isRoot||warnMissingParentDirective("x-slideshow:viewport","x-slideshow",$el)})}}},":id":"$id('slideshow')",role:"region","aria-roledescription":"carousel",":aria-live":'$slideshow.state == "playing" ? "off" : "polite"',"@keydown.left.stop.prevent":"$slideshow.prev()","@keydown.right.stop.prevent":"$slideshow.next()","@focus":"$slideshow.pause()"})}function handleRoot$3($el,Alpine2,data2,{evaluate:evaluate2}){var _a;const autoplay=data2.modifiers.includes("autoplay"),slideDuration=(_a=getMillisecondsModifierValue(data2.modifiers,"duration"))!==null&&_a!==void 0?_a:DEFAULT_SLIDE_DURATION;let expression=data2.expression===""?"{}":data2.expression,options2=evaluate2(expression);if(options2.slideDuration=slideDuration,options2.autoplay=autoplay,options2!=null&&!isPlainObject(options2))throw new Error(`options must be an object, but got ${options2}`);let state=buildSlideshowState(options2);Alpine2.bind($el,{"x-data"(){return{__slideshow_isRoot:!0,__slideshow_autoplayTimeoutId:void 0,__slideshow_animationFrameId:void 0,__slideshow_state:state,init(){let lastTimestamp;const updateProgress=timestamp=>{lastTimestamp===void 0&&(lastTimestamp=timestamp);const deltaTime=timestamp-lastTimestamp;lastTimestamp=timestamp,this.__slideshow_state.currentSlideElapsedTime=Math.round(this.__slideshow_state.currentSlideElapsedTime+deltaTime),this.__slideshow_state.state==="playing"&&(this.__slideshow_animationFrameId=requestAnimationFrame(updateProgress))},startProgressUpdates=()=>{this.__slideshow_animationFrameId!==void 0&&cancelAnimationFrame(this.__slideshow_animationFrameId),lastTimestamp=void 0,this.__slideshow_animationFrameId=requestAnimationFrame(updateProgress)},stopProgressUpdates=()=>{this.__slideshow_animationFrameId!==void 0&&(cancelAnimationFrame(this.__slideshow_animationFrameId),this.__slideshow_animationFrameId=void 0)},scheduleNextSlide=()=>{if(this.__slideshow_autoplayTimeoutId!==void 0&&(clearTimeout(this.__slideshow_autoplayTimeoutId),this.__slideshow_autoplayTimeoutId=void 0),this.__slideshow_state.state==="playing"){startProgressUpdates();const remainingTime=this.__slideshow_state.slideDuration-this.__slideshow_state.currentSlideElapsedTime;this.__slideshow_autoplayTimeoutId=window.setTimeout(()=>{this.__slideshow_state.next(),this.__slideshow_state.currentSlideElapsedTime=0,scheduleNextSlide()},remainingTime)}else stopProgressUpdates()};this.$watch("__slideshow_state.state",()=>{scheduleNextSlide()}),this.$watch("__slideshow_state.currentSlideIndex",(_nextIndex,prevIndex)=>{this.__slideshow_state.currentSlideElapsedTime=0,scheduleNextSlide()}),scheduleNextSlide()},destroy(){this.__slideshow_autoplayTimeoutId!==void 0&&clearTimeout(this.__slideshow_autoplayTimeoutId),this.__slideshow_animationFrameId!==void 0&&cancelAnimationFrame(this.__slideshow_animationFrameId)}}},"x-id":"['slideshow']",":id":'$id("slideshow")'})}function buildSlideshowState(options2={}){let state={state:options2.autoplay?"playing":"paused",slideDuration:options2.slideDuration||1e3,currentSlideIndex:options2.initialSlideIndex||
600,currentSlideElapsedTime:0,slides:new Set,lastSlideIndex:null,get totalSlides(){return this.slides.size},get nextSlideIndex(){return mod(this.currentSlideIndex+1,this.totalSlides)},get prevSlideIndex(){return mod(this.currentSlideIndex-1,this.totalSlides)},register(el){this.slides.add(el)},unregister(el){this.slides.delete(el)},next(){this.currentSlideIndex=this.nextSlideIndex},prev(){this.currentSlideIndex=this.prevSlideIndex},play(){this.state!=="playing"&&(this.state="playing")},pause(){this.state!=="paused"&&(this.state="paused")},toggle(){this.state==="playing"?this.pause():this.play()}};return state=trackProperty(state,"currentSlideIndex","lastSlideIndex"),options2?.state!==void 0&&copyProperty(options2,state,"state"),options2?.currentSlideIndex!==void 0&&copyProperty(options2,state,"currentSlideIndex"),state}var ThemeEditorEvent;(function(ThemeEditorEvent1){ThemeEditorEvent1.INSPECTOR_ACTIVATED="shopify:inspector:activate",ThemeEditorEvent1.INSPECTOR_DEACTIVATED="shopify:inspector:deactivate",ThemeEditorEvent1.SECTION_LOAD="shopify:section:load",ThemeEditorEvent1.SECTION_UNLOAD="shopify:section:unload",ThemeEditorEvent1.SECTION_SELECT="shopify:section:select",ThemeEditorEvent1.SECTION_DESELECT="shopify:section:deselect",ThemeEditorEvent1.SECTION_REORDER="shopify:section:reorder",ThemeEditorEvent1.BLOCK_SELECT="shopify:block:select",ThemeEditorEvent1.BLOCK_DESELECT="shopify:block:deselect"})(ThemeEditorEvent||(ThemeEditorEvent={}));function themeEditor(Alpine2){Alpine2.magic("isSelectedSection",handleIsSelectedSectionMagic(Alpine2)),Alpine2.magic("isSelectedBlock",handleIsSelectedBlockMagic(Alpine2)),Alpine2.magic("isInSelectedBlockTree",handleIsInSelectedBlockTreeMagic(Alpine2)),Alpine2.magic("containsSelectedBlock",handleContainsSelectedBlockMagic(Alpine2)),Alpine2.magic("wasSelectedSection",handleWasSelectedSectionMagic(Alpine2)),Alpine2.magic("wasInSelectedBlockTree",handleWasInSelectedBlockTreeMagic(Alpine2)),Alpine2.magic("wasSelectedBlock",handleWasSelectedBlockMagic(Alpine2)),Alpine2.magic("selectedSection",handleSelectedSectionMagic(Alpine2)),Alpine2.magic("selectedBlock",handleSelectedBlockMagic(Alpine2)),Alpine2.magic("prevSelectedSection",handlePrevSelectedSectionMagic(Alpine2)),Alpine2.magic("prevSelectedBlock",handlePrevSelectedBlockMagic(Alpine2)),Alpine2.store("themeEditor",themeEditorStore)}function handleSelectedSectionMagic(Alpine2){return function(_$el){var _a;return!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode?Alpine2.store("themeEditor").selectedSection:null}}function handlePrevSelectedSectionMagic(Alpine2){return function(_$el){var _a;return!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode?Alpine2.store("themeEditor").prevSelectedSection:null}}function handlePrevSelectedBlockMagic(Alpine2){return function(_$el){var _a;return!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode?Alpine2.store("themeEditor").prevSelectedBlock:null}}function handleSelectedBlockMagic(Alpine2){return function(_$el){var _a;return!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode?Alpine2.store("themeEditor").selectedBlock:null}}function handleIsSelectedSectionMagic(Alpine2){return function($el){var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;if(!isHtmlElement)throw new Error(`Expected HTMLElement but got ${$el}`);const el=closestSectionEl($el),selectedSection=Alpine2.store("themeEditor").selectedSection;return!el||!selectedSection?!1:el.id==selectedSection.id}}function handleWasSelectedSectionMagic(Alpine2){return function($el){var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;if(!isHtmlElement)throw new Error(`Expected HTMLElement but got ${$el}`);const el=closestSectionEl($el),prevSelectedSection=Alpine2.store("themeEditor").prevSelectedSection;return!el||!prevSelectedSection?!1:el.id==prevSelectedSection.id}}function handleIsSelectedBlockMagic(Alpine2){return function($el){var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const el=$el.closest("[data-shopify-editor-block]"),selectedBlock=Alpine2.store("themeEditor").selectedBlock;return!el||!selectedBlock?!1:el===selectedBlock}}function handleIsInSelectedBlockTreeMagic(Alpine2){return function($el){var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const el=$el.closest("[data-shopify-editor-block]"),selectedBlock=Alpine2.store("themeEditor").selectedBlock;return!el||!selectedBlock?!1:el.contains(selectedBlock)||el===selectedBlock||selectedBlock.contains(el)}}function handleContainsSelectedBlockMagic(Alpine2){return function($el){var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const el=$el.closest("[data-shopify-editor-block]"),selectedBlock=Alpine2.store("themeEditor").selectedBlock;return!el||!selectedBlock?!1:el.contains(selectedBlock)||el===selectedBlock}}function handleWasSelectedBlockMagic(Alpine2){return function($el){var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const el=$el.closest("[data-shopify-editor-block]"),selectedBlock=Alpine2.store("themeEditor").prevSelectedBlock;return!el||!selectedBlock?!1:el==selectedBlock}}function handleWasInSelectedBlockTreeMagic(Alpine2){return function($el){var _a;if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const el=$el.closest("[data-shopify-editor-block]"),selectedBlock=Alpine2.store("themeEditor").prevSelectedBlock;return!el||!selectedBlock?!1:el.contains(selectedBlock)||el===selectedBlock||selectedBlock.contains(el)}}const themeEditorStore={isInspectorActive:!1,selectedSectionId:null,prevSelectedSectionId:null,
60selectedBlock:null,prevSelectedBlock:null,get selectedSection(){return this.selectedSectionId?document.getElementById(`shopify-section-${this.selectedSectionId}`):null},get prevSelectedSection(){return this.prevSelectedSectionId?document.getElementById(`shopify-section-${this.prevSelectedSectionId}`):null},init(){window.addEventListener(ThemeEditorEvent.INSPECTOR_ACTIVATED,()=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;this.isInspectorActive=!0}),window.addEventListener(ThemeEditorEvent.INSPECTOR_DEACTIVATED,()=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;this.isInspectorActive=!1}),window.addEventListener(ThemeEditorEvent.SECTION_SELECT,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const sectionSelectEvent=e;this.selectedSectionId!==null&&(this.prevSelectedSectionId=this.selectedSectionId),this.selectedSectionId=sectionSelectEvent.detail.sectionId}),window.addEventListener(ThemeEditorEvent.SECTION_DESELECT,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;this.prevSelectedSectionId=this.selectedSectionId,this.selectedSectionId=null}),window.addEventListener(ThemeEditorEvent.BLOCK_SELECT,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;const blockSelectEvent=e;this.prevSelectedBlock=this.selectedBlock,this.selectedBlock=blockSelectEvent.target}),window.addEventListener(ThemeEditorEvent.BLOCK_DESELECT,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1;this.prevSelectedBlock=this.selectedBlock,this.selectedBlock=null}),window.addEventListener(ThemeEditorEvent.SECTION_LOAD,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1}),window.addEventListener(ThemeEditorEvent.SECTION_UNLOAD,e=>{var _a;if(!(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode))return!1})}},DATA_MORPH_SYNC_STATE="data-morph-sync",DATA_MORPH_CHILDREN_ONLY="data-morph-children-only",DATA_MORPH_SKIP="data-morph-skip",DATA_MORPH_SKIP_CHILDREN="data-morph-skip-children",MORPH_SYNC_EVENT="morph:sync";function morph(rootEl,html,morphOptions){const syncedElements=[];let flushScheduled=!1;const scheduleFlush=()=>{flushScheduled||(flushScheduled=!0,queueMicrotask(()=>{for(const{el,detail}of syncedElements)el.dispatchEvent(new CustomEvent(MORPH_SYNC_EVENT,{bubbles:!0,detail}));syncedElements.length=0,flushScheduled=!1}))},pushSyncIfChanged=(el,previousValue,value)=>{previousValue!==value&&(syncedElements.push({el,detail:{previousValue,value}}),scheduleFlush())},syncInputValue=(newNode,oldNode)=>{if(oldNode.type==="file")return;const previousValue=oldNode.value,value=newNode.value;value===null?oldNode.value="":oldNode.value=value,pushSyncIfChanged(oldNode,previousValue,value??"")},syncCheckbox=(newNode,oldNode)=>{const previousValue=oldNode.checked?"true":"false",value=newNode.checked?"true":"false";oldNode.checked=newNode.checked,newNode.indeterminate!==oldNode.indeterminate&&(oldNode.indeterminate=newNode.indeterminate),pushSyncIfChanged(oldNode,previousValue,value)},syncRadio=(newNode,oldNode)=>{const previousValue=oldNode.checked?oldNode.value:"",value=newNode.checked?newNode.value:"";oldNode.checked=newNode.checked,pushSyncIfChanged(oldNode,previousValue,value)},syncTextareaValue=(newNode,oldNode)=>{const previousValue=oldNode.value,value=newNode.value;value!==oldNode.value&&(oldNode.value=value);const firstChild=oldNode.firstChild;if(firstChild?.nodeType===Node.TEXT_NODE){if(value===""&&firstChild.nodeValue===oldNode.placeholder)return;firstChild.nodeValue=value}pushSyncIfChanged(oldNode,previousValue,value)},config2=Object.assign(Object.assign({},morphOptions),{updating(el,toEl,childrenOnly,skip,skipChildren){var _a,_b,_c;isHtmlElement(el)&&isHtmlElement(toEl)&&el===rootEl&&childrenOnly(),el.hasAttribute&&el.hasAttribute(DATA_MORPH_CHILDREN_ONLY)&&childrenOnly(),el.hasAttribute&&el.hasAttribute(DATA_MORPH_SKIP)&&skip(),el.hasAttribute&&el.hasAttribute(DATA_MORPH_SKIP_CHILDREN)&&skipChildren(),!((_a=el.hasAttribute)===null||_a===void 0)&&_a.call(el,DATA_MORPH_SYNC_STATE)&&(!((_b=toEl?.hasAttribute)===null||_b===void 0)&&_b.call(toEl,DATA_MORPH_SYNC_STATE))&&(el instanceof HTMLInputElement&&toEl instanceof HTMLInputElement?(syncInputValue(toEl,el),el.type==="checkbox"?syncCheckbox(toEl,el):el.type==="radio"&&syncRadio(toEl,el)):el instanceof HTMLTextAreaElement&&toEl instanceof HTMLTextAreaElement&&syncTextareaValue(toEl,el)),(_c=morphOptions?.updating)===null||_c===void 0||_c.call(morphOptions,el,toEl,childrenOnly,skip,skipChildren)},updated(el,toEl){var _a;(_a=morphOptions?.updated)===null||_a===void 0||_a.call(morphOptions,el,toEl)},removing(el,skip){var _a;el.hasAttribute&&el.hasAttribute(DATA_MORPH_SKIP)&&skip(),(_a=morphOptions?.removing)===null||_a===void 0||_a.call(morphOptions,el,skip)}});module_default.morph(rootEl,html,config2)}let FetchBatcher=class{request(url){return new Promise((resolve,reject)=>{const baseUrl=this.getBaseUrl(url),queryParams=this.getQueryParams(url),sectionsParam=queryParams.getAll("sections").concat(queryParams.getAll("section_id")).concat(queryParams.getAll("sections[]"));this.batchMap.has(baseUrl)||this.batchMap.set(baseUrl,new Set);const sectionsSet=this.batchMap.get(baseUrl);sectionsSet&&sectionsParam.forEach(section2=>sectionsSet.add(section2)),this.requestPromises.has(baseUrl)||this.requestPromises.set(baseUrl,[]);const promisesList=this.requestPromises.get(baseUrl);if(promisesList&&promisesList.push({resolve,reject}),!this.timeoutMap.has(baseUrl)){const timeoutId=setTimeout(()=>{this.fetchBatch(baseUrl)},this.timeoutDuration);this.timeoutMap.set(baseUrl,timeoutId)}})}getBaseUrl(url){const[baseUrl,_queryParams]=url.split("?");return baseUrl}getQueryParams(url){const[_baseUrl,queryParams]=url.split("?");return new URLSearchParams(queryParams)}buildBatchUrl(baseUrl,sections2){return`${baseUrl}?sections=${Array.from(sections2).join(",")}`}async fetchBatch(baseUrl){const sections2=this.batchMap.get(baseUrl);if(!sections2)return;const batchUrl=this.buildBatchUrl(baseUrl,sections2);this.batchMap.delete(baseUrl),this.timeoutMap.delete(baseUrl);try{const response=await fetch(batchUrl);if(response.ok){const data2=await response.json(),requestPromises=this.requestPromises.get(baseUrl);
60requestPromises&&(requestPromises.forEach(({resolve})=>resolve(data2)),this.requestPromises.delete(baseUrl))}else throw response.statusText}catch(error2){const requestPromises=this.requestPromises.get(baseUrl);requestPromises&&(requestPromises.forEach(({reject})=>reject(error2)),this.requestPromises.delete(baseUrl))}}constructor(timeoutDuration=100){this.batchMap=new Map,this.timeoutMap=new Map,this.timeoutDuration=timeoutDuration,this.requestPromises=new Map}};function isDebugEnabled(){return typeof window<"u"&&(window.debugSectionApi===!0||window.debugMode===!0)}function debugLog(message,data2){isDebugEnabled()&&console.log(`[section-api] ${message}`,data2!==void 0?data2:"")}function debugLogCacheHit(message,data2){isDebugEnabled()&&console.log(`%c[section-api] ${message}`,"color: #10b981; font-weight: bold;",data2!==void 0?data2:"")}function debugLogCacheMiss(message,data2){isDebugEnabled()&&console.log(`%c[section-api] ${message}`,"color: #ef4444; font-weight: bold;",data2!==void 0?data2:"")}function debugGroup(label){return isDebugEnabled()?(console.group(`[section-api] ${label}`),()=>console.groupEnd()):null}const MORPH_ROOT_ATTR="data-morph-root",MORPH_ROOT_SELECTOR=`[${MORPH_ROOT_ATTR}]`,fetchBatcher=new FetchBatcher,DEFAULT_MORPH_CONFIG={updating(el,_toEl,_childrenOnly,skip){el.hasAttribute&&el.hasAttribute("data-shopify")&&skip()},removing(el,skip){el.hasAttribute&&el.hasAttribute("data-shopify")&&skip()}};var sectionApi=(options2=>{let morphConfig=options2?.morphConfig||DEFAULT_MORPH_CONFIG;return function(Alpine2){if(isDebugEnabled()&&console.log("%c[section-api] Debug mode enabled","color: #10b981; font-weight: bold; font-size: 12px;","Set window.debugSectionApi = false or window.debugMode = false to disable"),!("morph"in Alpine2))throw new Error("The x-section-api directive requires the @alpinejs/morph plugin");if(!Alpine2.store("cache"))throw new Error("The x-section-api directive requires the method-ui cache plugin");Alpine2.store("cache").resources.sectionHtml||Alpine2.store("cache").addResource("sectionHtml"),window._x_router_initialized||(window.history.replaceState({fromRouter:!0,url:document.location.href},"",document.location.href),window.addEventListener("popstate",event=>{var _a;!((_a=event.state)===null||_a===void 0)&&_a.fromRouter&&window.location.reload()}),window._x_router_initialized=!0),Alpine2.directive("section-api",($el,data2,utilities)=>{if(!isHtmlElement($el))throw new Error(`Expected HTMLElement but got ${$el}`);if(data2.value==="form")handleForm($el,data2,utilities,Alpine2);else if(data2.value==="link")handleLink($el,data2,utilities,Alpine2);else if(data2.value===null)handleRoot$2($el,data2,utilities,Alpine2,morphConfig);else throw new Error(`Unknown directive: x-section-api:${data2.value}`)}).before("bind"),Alpine2.magic("sectionApi",handleSectionMagic(Alpine2)),bindAllThemeSections(Alpine2,el=>{const sectionIdForSectionRenderingApi=el.id.split("shopify-section-")[1];el.setAttribute("x-section-api",sectionIdForSectionRenderingApi)})}});function handleSectionMagic(Alpine2){return function($el){const data2=Alpine2.$data($el);return data2?.__sectionApi_morphConfig?{get morphConfig(){return data2.__sectionApi_morphConfig},set morphConfig(value){data2.__sectionApi_morphConfig=value},get sectionId(){return data2.__sectionApi_sectionId},get state(){return data2.__sectionApi_state},get error(){return data2.__sectionApi_error},update(options2){return data2.__sectionApi_update(options2)},load(options2){return data2.__sectionApi_load(options2)},navigate(url,historyMode){return data2.__sectionApi_navigate(url,historyMode)},setHtml(html,options2){return data2.__sectionApi_setHtml(html,options2)}}:{}}}function handleForm($el,data1,_utilities,Alpine2){if(!isFormElement($el))throw new Error("x-section-api:form directive can only be used on form elements");if($el.method.toLowerCase()=="post")throw new Error("x-section-api:form directive does not support POST requests");const historyMode=getHistoryModeModifier(data1.modifiers);Alpine2.bind($el,{"x-init"(){var _a;((_a=Alpine2.$data($el))===null||_a===void 0?void 0:_a.__sectionApi_navigate)==null&&warnMissingParentDirective("x-section-api:form","x-section-api",$el)},"x-async-form"(){return async info=>{const url=getNavigationUrl(info).toString(),data2=Alpine2.$data($el);return data2?.__sectionApi_navigate(url,historyMode)}}})}function handleLink($el,data2,_utilities,Alpine2){if(!isAnchorElement($el))throw new Error("x-section-api:link directive can only be used on anchor elements");const historyMode=getHistoryModeModifier(data2.modifiers);Alpine2.bind($el,{"x-init"(){var _a;((_a=Alpine2.$data($el))===null||_a===void 0?void 0:_a.__sectionApi_navigate)==null&&warnMissingParentDirective("x-section-api:link","x-section-api",$el)},"x-async-link"(){return async href=>{const url=getNavigationUrl({action:href}).toString(),data3=Alpine2.$data($el);return data3?.__sectionApi_navigate(url,historyMode)}}})}function handleRoot$2($el,data2,_utilities,Alpine2,morphConfig1){const sectionId=data2.expression;if(!sectionId)throw new Error("x-section-api directive requires a section id to be passed");const options1={morphConfig:morphConfig1},fetchSectionHtml=async options2=>{var _a;if(window.dispatchEvent(new CustomEvent("theme:section:load",{detail:{sectionId:options2.sectionId,url:options2.requestUrl}})),options2.batch){const html=(await fetchBatcher.request(options2.requestUrl))[options2.sectionId];return Alpine2.store("cache").resources.sectionHtml.set(options2.cacheKey,html),window.dispatchEvent(new CustomEvent("theme:section:loaded",{detail:{sectionId:options2.sectionId,url:options2.requestUrl}})),html}const result=await fetch(options2.requestUrl,Object.assign({signal:options2.signal},(_a=options2.fetchOptions)!==null&&_a!==void 0?_a:{}));if(!result.ok)throw debugLog("\u2717 Fetch failed",{status:result.status,statusText:result.statusText,url:options2.requestUrl}),new Error(result.statusText);const responseHtml=await result.text();return Alpine2.store("cache").resources.sectionHtml.set(options2.cacheKey,responseHtml),window.dispatchEvent(new CustomEvent("theme:section:loaded",{detail:{sectionId:options2.sectionId,url:options2.requestUrl}})),responseHtml};Alpine2.bind($el,{"x-data"(){var _a1,_b1;return{__sectionApi_rootEl:options1?.rootEl||$el,__sectionApi_state:"idle",__sectionApi_error:null,__sectionApi_targetId:(_a1=options1?.targetId)!==null&&_a1!==void 0?_a1:null,__sectionApi_sectionId:sectionId,__sectionApi_pendingUrl:null,__sectionApi_abortController:null,__sectionApi_idleCallbackId:null,__sectionApi_idleResolve:null,__sectionApi_morphConfig:(_b1=options1?.morphConfig)!==null&&_b1!==void 0?_b1:DEFAULT_MORPH_CONFIG,__sectionApi_buildUrl(buildUrlOptions){var _a;return buildSectionUrl((_a=buildUrlOptions?.sectionId)!==null&&_a!==void 0?_a:this.__sectionApi_sectionId,Object.assign(Object.assign({},buildUrlOptions),{targetId:this.__sectionApi_targetId}))},__sectionApi_update:async function(options2){var _a2,_b2;
60const endGroup=debugGroup(`update() - ${this.__sectionApi_sectionId}`),cachePolicy=(_a2=options2?.cachePolicy)!==null&&_a2!==void 0?_a2:"cache-and-network",url1=this.__sectionApi_buildUrl(options2),requestUrl=(_b2=options2?.url)!==null&&_b2!==void 0?_b2:url1;debugLog("update()",{sectionId:this.__sectionApi_sectionId,cachePolicy,url:requestUrl,htmlMode:options2?.htmlMode});const _notify=url=>{window.dispatchEvent(new CustomEvent("theme:section:update",{detail:{sectionId:this.__sectionApi_sectionId,url}}))},_update=async()=>{var _a,_b,_c;let resultHtml;if(cachePolicy=="cache-only"){const cachedHtml=Alpine2.store("cache").resources.sectionHtml.get(url1);cachedHtml?(debugLogCacheHit("\u2713 Cache hit (cache-only)",{url:url1,htmlLength:cachedHtml.length}),this.__sectionApi_setHtml(cachedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots}),_notify(url1)):debugLogCacheMiss("\u2717 Cache miss (cache-only)",{url:url1}),resultHtml=cachedHtml}else if(cachePolicy=="network-only"){options2?.abortPending!=!1&&((_a=this.__sectionApi_abortController)===null||_a===void 0||_a.abort()),this.__sectionApi_abortController=new AbortController,this.__sectionApi_pendingUrl=requestUrl,this.__sectionApi_state="loading",this.__sectionApi_error=null;try{const{url:_url,baseUrl:_baseUrl,sectionId:_sectionId,cacheKey:_cacheKey,batch:_batch,waitForIdle:_waitForIdle,abortPending:_abortPending,force:_force,loadingState:_loadingState,fetchOptions}=options2||{},updatedHtml=await fetchSectionHtml({sectionId:this.__sectionApi_sectionId,requestUrl,cacheKey:url1,batch:options2?.batch,signal:this.__sectionApi_abortController.signal,fetchOptions});updatedHtml&&(this.__sectionApi_setHtml(updatedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots}),_notify(url1)),resultHtml=updatedHtml}catch(e){if(e.name=="AbortError"){this.__sectionApi_state="idle";return}throw this.__sectionApi_state="error",this.__sectionApi_error=prettyPrintError(e),debugLog("\u2717 Fetch error",{error:this.__sectionApi_error}),e}finally{this.__sectionApi_pendingUrl=null,this.__sectionApi_state!=="error"&&(this.__sectionApi_state="idle")}}else if(cachePolicy=="cache-first"){const cachedHtml=Alpine2.store("cache").resources.sectionHtml.get(url1);if(cachedHtml)return debugLogCacheHit("\u2713 Cache hit",{url:url1,htmlLength:cachedHtml.length}),this.__sectionApi_setHtml(cachedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots}),_notify(url1),cachedHtml;debugLogCacheMiss("\u2717 Cache miss: fetching",{url:url1}),options2?.abortPending!=!1&&((_b=this.__sectionApi_abortController)===null||_b===void 0||_b.abort()),this.__sectionApi_abortController=new AbortController,this.__sectionApi_pendingUrl=requestUrl,this.__sectionApi_state="loading",this.__sectionApi_error=null;try{const{url:_url,baseUrl:_baseUrl,sectionId:_sectionId,cacheKey:_cacheKey,batch:_batch,waitForIdle:_waitForIdle,abortPending:_abortPending,force:_force,loadingState:_loadingState,fetchOptions}=options2||{},updatedHtml=await fetchSectionHtml({sectionId:this.__sectionApi_sectionId,requestUrl,cacheKey:url1,batch:options2?.batch,signal:this.__sectionApi_abortController.signal,fetchOptions});updatedHtml&&(_notify(url1),this.__sectionApi_setHtml(updatedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots})),resultHtml=updatedHtml}catch(e){if(e.name=="AbortError"){this.__sectionApi_state="idle";return}throw this.__sectionApi_state="error",this.__sectionApi_error=prettyPrintError(e),debugLog("\u2717 Fetch error",{error:this.__sectionApi_error}),e}finally{this.__sectionApi_pendingUrl=null,this.__sectionApi_state!=="error"&&(this.__sectionApi_state="idle")}}else if(cachePolicy=="cache-and-network"){const cachedHtml=Alpine2.store("cache").resources.sectionHtml.get(url1);cachedHtml?(debugLogCacheHit("\u2713 Cache hit: rendering from cache, then fetching",{url:url1,htmlLength:cachedHtml.length}),this.__sectionApi_setHtml(cachedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots})):debugLogCacheMiss("\u2717 Cache miss: fetching",{url:url1}),options2?.abortPending!=!1&&((_c=this.__sectionApi_abortController)===null||_c===void 0||_c.abort()),this.__sectionApi_abortController=new AbortController,this.__sectionApi_pendingUrl=requestUrl,this.__sectionApi_state=cachedHtml?"refreshing":"loading",this.__sectionApi_error=null;try{const{url:_url,baseUrl:_baseUrl,sectionId:_sectionId,cacheKey:_cacheKey,batch:_batch,waitForIdle:_w
60aitForIdle,abortPending:_abortPending,force:_force,loadingState:_loadingState,fetchOptions}=options2||{},updatedHtml=await fetchSectionHtml({sectionId:this.__sectionApi_sectionId,requestUrl,cacheKey:url1,batch:options2?.batch,signal:this.__sectionApi_abortController.signal,fetchOptions});updatedHtml&&(_notify(url1),this.__sectionApi_setHtml(updatedHtml,{mode:options2?.htmlMode,morphConfig:options2?.morphConfig,onlyRoots:options2?.onlyRoots})),resultHtml=updatedHtml}catch(e){if(e.name=="AbortError"){this.__sectionApi_state="idle";return}throw this.__sectionApi_state="error",this.__sectionApi_error=prettyPrintError(e),debugLog("\u2717 Fetch error",{error:this.__sectionApi_error}),e}finally{this.__sectionApi_pendingUrl=null,this.__sectionApi_state!=="error"&&(this.__sectionApi_state="idle")}}else throw new Error(`Unknown cache policy: ${cachePolicy}`);return resultHtml};if(options2?.waitForIdle)return new Promise(async resolve=>{var _a;this.__sectionApi_idleCallbackId!==null&&(cancelIdleCallback(this.__sectionApi_idleCallbackId),this.__sectionApi_idleCallbackId=null),(_a=this.__sectionApi_idleResolve)===null||_a===void 0||_a.call(this,void 0),this.__sectionApi_idleResolve=resolve,this.__sectionApi_idleCallbackId=requestIdleCallback(async()=>{this.__sectionApi_idleCallbackId=null,this.__sectionApi_idleResolve=null;const result=await _update();endGroup?.(),resolve(result)})});{const result=await _update();return endGroup?.(),result}},__sectionApi_load:async function(options2){var _a,_b;const endGroup=debugGroup(`load() - ${this.__sectionApi_sectionId}`),url=(_a=options2?.url)!==null&&_a!==void 0?_a:this.__sectionApi_buildUrl(options2),force=(_b=options2?.force)!==null&&_b!==void 0?_b:!1;if(debugLog("load()",{sectionId:this.__sectionApi_sectionId,url,force}),!force){const cachedHtml=Alpine2.store("cache").resources.sectionHtml.get(url);if(cachedHtml){debugLogCacheHit("\u2713 Cache hit: skipping fetch",{url,htmlLength:cachedHtml.length}),endGroup?.();return}}const{url:_url,baseUrl:_baseUrl,sectionId:_sectionId,cacheKey:_cacheKey,batch:_batch,waitForIdle:_waitForIdle,abortPending:_abortPending,force:_force,loadingState:_loadingState,fetchOptions}=options2||{};try{await fetchSectionHtml({sectionId:this.__sectionApi_sectionId,requestUrl:url,cacheKey:url,batch:options2?.batch,fetchOptions}),endGroup?.()}catch(e){if(e.name=="AbortError"){endGroup?.();return}throw debugLog("\u2717 Load error",{error:prettyPrintError(e)}),endGroup?.(),e}},__sectionApi_navigate:async function(url,historyMode){const urlObj=new URL(url,window.location.href),baseUrl=`${urlObj.pathname}${urlObj.search}`;historyMode=="replace"?window.history.replaceState({fromRouter:!0,url:urlObj.toString()},"",urlObj.toString()):historyMode=="push"&&window.history.pushState({fromRouter:!0,url:urlObj.toString()},"",urlObj.toString());const result=await this.__sectionApi_update({baseUrl});return window.dispatchEvent(new CustomEvent("theme:section:navigate",{detail:{sectionId,url:baseUrl}})),result},__sectionApi_setHtml(html1,options2){var _a,_b,_c,_d,_e;const endGroup=debugGroup(`setHtml() - ${this.__sectionApi_sectionId}`),mode=(_a=options2?.mode)!==null&&_a!==void 0?_a:"morph",sanitizedHtml=html1.replace(/<!--shopify:rendered_by_section_api-->/g,""),morphConfig=(_b=options2?.morphConfig)!==null&&_b!==void 0?_b:this.__sectionApi_morphConfig;if(options2?.mode=="replace")debugLog("setHtml() - replace mode",{htmlLength:html1.length}),Alpine2.mutateDom(()=>{const responseRoot=new DOMParser().parseFromString(sanitizedHtml,"text/html").body.firstElementChild,content=responseRoot?responseRoot.innerHTML:sanitizedHtml;this.__sectionApi_rootEl.innerHTML=content,Alpine2.skipDuringClone(()=>Alpine2.initTree(this.__sectionApi_rootEl))()}),endGroup?.();else{const newRoot=new DOMParser().parseFromString(sanitizedHtml,"text/html").body.firstElementChild;if(!newRoot)return;const fromRoots=this.__sectionApi_rootEl.querySelectorAll(MORPH_ROOT_SELECTOR),toRoots=newRoot.querySelectorAll(MORPH_ROOT_SELECTOR);let leafFromRoots=Array.from(fromRoots).filter(fromEl=>!Array.from(fromRoots).some(other=>other!==fromEl&&fromEl.contains(other)));if(!((_c=options2?.onlyRoots)===null||_c===void 0)&&_c.length){const allowed=new Set(options2.onlyRoots);leafFromRoots=leafFromRoots.filter(el=>{const key=el.getAttribute(MORPH_ROOT_ATTR);return key!=null&&key!==""&&allowed.has(key)})}const hasRoots=leafFromRoots.length&&toRoots.length,onlyRootsProvided=((_e=(_d=options2?.onlyRoots)===null||_d===void 0?void 0:_d.length)!==null&&_e!==void 0?_e:0)>0;debugLog("setHtml() - morph mode",{mode,htmlLength:html1.length,hasMorphRoots:hasRoots,morphRootCount:hasRoots?leafFromRoots.length:0,rootKeys:hasRoots?leafFromRoots.map(el=>el.getAttribute(MORPH_ROOT_ATTR)):void 0});const _morph=(rootEl,html)=>morph(rootEl,html,morphConfig);
60hasRoots?leafFromRoots.forEach(fromEl=>{const key=fromEl.getAttribute(MORPH_ROOT_ATTR);if(key==""||key==null)return;const toEl=newRoot.querySelector(`[${MORPH_ROOT_ATTR}="${key}"]`);toEl&&_morph(fromEl,toEl.outerHTML)}):onlyRootsProvided?debugLog("setHtml() - onlyRoots provided but no matching roots, skipping morph"):_morph(this.__sectionApi_rootEl,sanitizedHtml),endGroup?.()}},destroy(){var _a,_b;this.__sectionApi_idleCallbackId!==null&&(cancelIdleCallback(this.__sectionApi_idleCallbackId),this.__sectionApi_idleCallbackId=null),(_a=this.__sectionApi_idleResolve)===null||_a===void 0||_a.call(this,void 0),this.__sectionApi_idleResolve=null,(_b=this.__sectionApi_abortController)===null||_b===void 0||_b.abort()}}},"aria-atomic":"true"})}function buildSectionUrl(sectionId,options2){var _a,_b,_c,_d;const fullUrl=new URL((_d=(_a=options2?.baseUrl)!==null&&_a!==void 0?_a:(_c=(_b=window.theme)===null||_b===void 0?void 0:_b.routes)===null||_c===void 0?void 0:_c.root)!==null&&_d!==void 0?_d:"/",window.location.href);let sanitizedSectionId;return sectionId.startsWith("shopify-section-")?sanitizedSectionId=sectionId.split("shopify-section-")[1]:sanitizedSectionId=sectionId,options2?.targetId&&(fullUrl.hash=options2.targetId),fullUrl.searchParams.append("section_id",sanitizedSectionId),fullUrl.toString()}function getHistoryModeModifier(modifiers,defaultMode="push"){return modifiers.includes("replace")?"replace":modifiers.includes("push")?"push":modifiers.includes("nopush")?"none":defaultMode}function getNavigationUrl(navigationInfo){let url=new URL(navigationInfo.action);if(navigationInfo?.formData&&navigationInfo?.method==="GET"){let formData=navigationInfo.formData,searchParams=new URLSearchParams(formData);url.search=searchParams.toString()}return url}function bindAllThemeSections(Alpine2,cb){onDocumentReady$1(()=>{const sections2=document.getElementsByClassName("shopify-section");for(const el of sections2)isHtmlElement(el)&&cb(el);window.addEventListener(ThemeEditorEvent.SECTION_LOAD,e=>{var _a;if(!((_a=window.Shopify)===null||_a===void 0)&&_a.designMode){const loadedEvent=e,section2=document.getElementById(`shopify-section-${loadedEvent.detail.sectionId}`);section2&&(Alpine2.deferMutations(),cb(section2),Alpine2.flushAndStopDeferringMutations())}})})}var __rest=function(s,e){var t={};for(var p in s)Object.prototype.hasOwnProperty.call(s,p)&&e.indexOf(p)<0&&(t[p]=s[p]);if(s!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,p=Object.getOwnPropertySymbols(s);i<p.length;i++)e.indexOf(p[i])<0&&Object.prototype.propertyIsEnumerable.call(s,p[i])&&(t[p[i]]=s[p[i]]);return t};function scrollStagger(Alpine2){Alpine2.directive("scroll-stagger",($el,{expression,value},{evaluate:evaluate2})=>{if(value=="enter"){const keyframes2=evaluate2(expression);Alpine2.bind($el,{"x-init"(){if(!this.$data.__scrollStagger_isRoot){warnMissingParentDirective("x-scroll-stagger:enter","x-scroll-stagger",this.$el);return}this.$data.__scrollStagger_enterKeyframes=keyframes2}})}else if(value=="leave"){const keyframes2=evaluate2(expression);Alpine2.bind($el,{"x-init"(){if(!this.$data.__scrollStagger_isRoot){warnMissingParentDirective("x-scroll-stagger:leave","x-scroll-stagger",this.$el);return}this.$data.__scrollStagger_leaveKeyframes=keyframes2}})}else{const _a1=expression?evaluate2(expression):{},{selector:optionalSelector,stagger:optionalStagger,scrollOffset:optionalScrollOffset,target:optionalTarget}=_a1,visibleKeyframes=__rest(_a1,["selector","stagger","scrollOffset","target"]),selector=optionalSelector||"[data-animate-stagger-item]",stagger=optionalStagger||.2,scrollOffset=optionalScrollOffset||["25% 100%","0% 50%","0% 0%","75% 0%"],target=optionalTarget||$el;Alpine2.bind($el,{"x-data"(){return{__scrollStagger_isRoot:!0,__scrollStagger_cancelScroll:null,__scrollStagger_fitsInViewport:null,__scrollStagger_wasFullyVisible:null,__scrollStagger_isFullyVisible:null,__scrollStagger_wasPartiallyVisible:null,__scrollStagger_isPartiallyVisible:null,__scrollStagger_enterKeyframes:{},__scrollStagger_visibleKeyframes:visibleKeyframes,__scrollStagger_leaveKeyframes:{},get __scrollStagger_items(){return Array.from($el.querySelectorAll(selector))},init(){this.$watch("__scrollStagger_wasFullyVisible",isFullyVisible=>{this.__scrollStagger_wasFullyVisible=isFullyVisible}),this.$watch("__scrollStagger_wasPartiallyVisible",isPartiallyVisible=>{this.__scrollStagger_wasPartiallyVisible=isPartiallyVisible})},destroy(){this.__scrollStagger_cancelScrollAnimation()},__scrollStagger_startScrollAnimation(){if(this.__scrollStagger_cancelScroll!==null)return;const staggerItemDuration=1,at=`-${staggerItemDuration*(1-(stagger||.2))}`,entrySequence=this.__scrollStagger_items.map(staggerElement=>[staggerElement,this.__scrollStagger_enterKeyframes,{ease:"easeOut",duration:staggerItemDuration,at}]),staticVisibleKeyframes=this.__scrollStagger_visibleKeyframes!==null&&Object.keys(this.__scrollStagger_visibleKeyframes).length>0?this.__scrollStagger_visibleKeyframes:buildStaticKeyframes(this.__scrollStagger_enterKeyframes),visibleSequence=this.__scrollStagger_items.map(staggerElement=>[staggerElement,staticVisibleKeyframes,{duration:staggerItemDuration,at,ease:"easeOut"}]),exitSequence=this.__scrollStagger_items.map(staggerElement=>[staggerElement,this.__scrollStagger_leaveKeyframes,{ease:"easeOut",duration:staggerItemDuration,at}]);this.__scrollStagger_fitsInViewport==!1?this.__scrollStagger_cancelScroll=scroll(animate(entrySequence),{target,offset:["0% 100%","100% 0%"]}):this.__scrollStagger_cancelScroll=scroll(animate([...entrySequence,...visibleSequence,...exitSequence]),{target,offset:scrollOffset})},__scrollStagger_cancelScrollAnimation(){var _a;(_a=this.__scrollStagger_cancelScroll)===null||_a===void 0||_a.call(this),this.__scrollStagger_cancelScroll=null}}},"x-intersect:enter.threshold.0":"__scrollStagger_isPartiallyVisible = true","x-intersect:leave.threshold.0":"__scrollStagger_isPartiallyVisible = false","x-intersect:enter.full":"__scrollStagger_isFullyVisible = true","x-intersect:leave.full":"__scrollStagger_isFullyVisible = false",async"x-effect"(){this.__scrollStagger_wasFullyVisible==null&&this.__scrollStagger_isFullyVisible?this.__scrollStagger_startScrollAnimation():this.__scrollStagger_isFullyVisible==!1&&(this.__scrollStagger_isPartiallyVisible==!0?this.__scrollStagger_startScrollAnimation():this.__scrollStagger_wasPartiallyVisible==!0&&this.__scrollStagger_isPartiallyVisible==!1&&this.__scrollStagger_cancelScrollAnimation())},"x-resize"(){this.__scrollStagger_fitsInViewport=this.$height<=window.innerHeight}})}})}function buildStaticKeyframes(enterKeyframes){return Object.entries(enterKeyframes).reduce((keyframes2,[key,value])=>Object.assign(Object.assign({},keyframes2),{[key]:Array.isArray(value)?value.length>1?[value[1],value[1]]:value[0]:[value,value]}),{})}function stepper(Alpine2){Alpine2.directive("stepper",($el,data2)=>{if(data2.value=="input")handleInput($el,Alpine2);else if(data2.value=="minus")handleButtonMinus($el,Alpine2);else if(data2.value=="plus")handleButtonPlus($el,Alpine2);else if(data2.value==null)handleRoot$1($el,Alpine2);else throw new Error(`Unknown directive: x-stepper:${data2.value}`)}).before("bind"),Alpine2.magic("stepper",$el=>{const $data=Alpine2.$data($el);return{get value(){return $data.__stepper_value},increment(){var _a;(_a=$data.__stepper_increment)===null||_a===void 0||_a.call($data)}
60,decrement(){var _a;(_a=$data.__stepper_decrement)===null||_a===void 0||_a.call($data)}}})}function handleInput($el,Alpine2){if(isInputNumberElement($el))Alpine2.bind($el,{"x-init"(){if(!this.__stepper_isRoot){warnMissingParentDirective("x-stepper:input","x-stepper",$el);return}this.__stepper_inputEl=$el}});else throw new Error(`Expected <input type="number"> tag for x-stepper:input but got ${$el}`)}function handleButtonMinus($el,Alpine2){if(isButtonElement($el))Alpine2.bind($el,{"x-data"(){return{init(){this.__stepper_isRoot||warnMissingParentDirective("x-stepper:minus","x-stepper",this.$el)}}},"@click.prevent":"$stepper.decrement"});else throw new Error(`Expected <button> tag for x-stepper:minus but got ${$el}`)}function handleButtonPlus($el,Alpine2){if(isButtonElement($el))Alpine2.bind($el,{"x-data"(){return{init(){this.__stepper_isRoot||warnMissingParentDirective("x-stepper:plus","x-stepper",this.$el)}}},"@click.prevent":"$stepper.increment"});else throw new Error(`Expected <button> tag for x-stepper:plus but got ${$el}`)}function handleRoot$1($el,Alpine2){Alpine2.bind($el,{"x-data"(){return{__stepper_isRoot:!0,__stepper_inputEl:null,__stepper_value:null,init(){queueMicrotask(()=>{Alpine2.effect(()=>{if(this.__stepper_inputEl){const value=Alpine2.bound(this.__stepper_inputEl,"value",null);this.__stepper_value=value!=null?Number(value):null}})})},__stepper_decrement(){var _a,_b,_c,_d;(_a=this.__stepper_inputEl)===null||_a===void 0||_a.stepDown(),(_b=this.__stepper_inputEl)===null||_b===void 0||_b.dispatchEvent(new Event("input",{bubbles:!0})),(_c=this.__stepper_inputEl)===null||_c===void 0||_c.dispatchEvent(new Event("change",{bubbles:!0})),this.$dispatch("decrement",(_d=this.__stepper_inputEl)===null||_d===void 0?void 0:_d.value)},__stepper_increment(){var _a,_b,_c,_d;(_a=this.__stepper_inputEl)===null||_a===void 0||_a.stepUp(),(_b=this.__stepper_inputEl)===null||_b===void 0||_b.dispatchEvent(new Event("input",{bubbles:!0})),(_c=this.__stepper_inputEl)===null||_c===void 0||_c.dispatchEvent(new Event("change",{bubbles:!0})),this.$dispatch("increment",(_d=this.__stepper_inputEl)===null||_d===void 0?void 0:_d.value)}}},"@click.self"(){var _a;(_a=this.__stepper_inputEl)===null||_a===void 0||_a.focus()}})}function clone(Alpine2){Alpine2.directive("clone",($targetEl,{expression},{effect:effect3,evaluate:evaluate2,cleanup:cleanup2})=>{if(!isHtmlElement($targetEl))throw new Error(`Expected HTMLElement but got ${$targetEl}`);$targetEl._x_insertClone=sourceEl=>{var _a;if(!isHtmlElement(sourceEl))return;if(!isTemplateElement($targetEl))throw new Error("x-clone can only be used on a <template> tag");$targetEl._x_clonedElement&&((_a=$targetEl._x_undoClone)===null||_a===void 0||_a.call($targetEl));let clone2=isTemplateElement(sourceEl)?sourceEl.content.cloneNode(!0).firstElementChild:sourceEl.cloneNode(!0);clone2&&(Alpine2.addScopeToNode(clone2,{},$targetEl),Alpine2.mutateDom(()=>{$targetEl.after(clone2),Alpine2.skipDuringClone(()=>Alpine2.initTree(clone2))()}),$targetEl._x_clonedElement=clone2,$targetEl._x_undoClone=()=>{clone2.remove(),Alpine2.destroyTree(clone2),delete $targetEl._x_clonedElement})},$targetEl._x_insertClone(evaluate2(expression)),cleanup2(()=>$targetEl._x_undoClone&&$targetEl._x_undoClone())}).before("bind")}function formatCurrency(amount,format={}){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k;let defaultCurrency="USD",defaultLocale="en-US",defaultFreeTranslation;typeof window<"u"&&(defaultCurrency=((_b=(_a=window.theme)===null||_a===void 0?void 0:_a.currency)===null||_b===void 0?void 0:_b.currencyCode)||((_d=(_c=window.Shopify)===null||_c===void 0?void 0:_c.currency)===null||_d===void 0?void 0:_d.active)||defaultCurrency,defaultLocale=((_f=(_e=window.theme)===null||_e===void 0?void 0:_e.currency)===null||_f===void 0?void 0:_f.locale)||((_g=window.Shopify)===null||_g===void 0?void 0:_g.locale)||defaultLocale,defaultFreeTranslation=(_k=(_j=(_h=window.theme)===null||_h===void 0?void 0:_h.translations)===null||_j===void 0?void 0:_j.other)===null||_k===void 0?void 0:_k.free);const{form="short",rounded,currency:currency2=defaultCurrency,locale=defaultLocale,legacyFormat}=format;if(amount==null||isNaN(amount))return"x.xx";if(amount===0&&form==="short"&&rounded===!0&&defaultFreeTranslation)return defaultFreeTranslation;const amountInDollars=amount/100;let amountWithSymbol;legacyFormat?amountWithSymbol=formatCurrencyLegacy(amountInDollars,{currency:currency2,legacyFormat,rounded:format.rounded}):amountWithSymbol=formatCurrencyNew(amountInDollars,{currency:currency2,locale,rounded:format.rounded});const codeString=form==="explicit"?` ${currency2}`:"";return`${amountWithSymbol}${codeString}`}function formatCurrencyNew(amount,format){const options2={style:"currency",currency:format.currency,currencyDisplay:"symbol"};format.rounded&&(options2.maximumFractionDigits=0);let price=new Intl.NumberFormat(format.locale,options2).format(amount);return typeof format.rounded>"u"&&(price=price.replace(/([.,]00)(?=\D*$)/g,"")),price}function formatCurrencyLegacy(amount,format){var _a;const legacyFormat=(_a=format.legacyFormat)!==null&&_a!==void 0?_a:"${{amount}}";let precision1=2;format.rounded&&(precision1=0);const formatWithDelimiters=(number2,precision=2,thousands=",",decimal=".")=>{if(isNaN(number2)||number2==null)return"0";number2=parseFloat(number2.toFixed(precision));const parts=number2.toFixed(precision).split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d{3})+(?!\d))/g,`$1${thousands}`),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount},placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,match=legacyFormat.match(placeholderRegex);let formattedValue="";if(match){switch(match[1]){case"amount":formattedValue=formatWithDelimiters(amount,precision1);break;case"amount_no_decimals":formattedValue=formatWithDelimiters(amount,precision1);break;case"amount_with_comma_separator":formattedValue=formatWithDelimiters(amount,precision1,".",",");break;case"amount_no_decimals_with_comma_separator":formattedValue=formatWithDelimiters(amount,precision1,".",",");break;case"amount_with_apostrophe_separator":formattedValue=formatWithDelimiters(amount,precision1,"'",".");break;case"amount_no_decimals_with_space_separator":formattedValue=formatWithDelimiters(amount,precision1," ");break;case"amount_with_space_separator":formattedValue=formatWithDelimiters(amount,precision1," ",",");break;case"amount_with_period_and_space_separator":formattedValue=formatWithDelimiters(amount,precision1," ",".");break;default:throw new Error(`Unknown format type: ${match[1]}`)}
vendor: 5,655 bytes, lines 60-63
60formattedValue=legacyFormat.replace(placeholderRegex,formattedValue),typeof format.rounded>"u"&&legacyFormat.includes("no_decimals")&&(formattedValue=formattedValue.replace(/([.,]00)(?=\D*$)/g,""))}return formattedValue}function convertCurrency(amount,rate){var _a,_b;const currencyRate=rate||((_b=(_a=window.Shopify)===null||_a===void 0?void 0:_a.currency)===null||_b===void 0?void 0:_b.rate)||1;return(amount==null||isNaN(amount))&&(amount=0),amount*currencyRate}function currency(Alpine2){Alpine2.magic("formatCurrency",()=>formatCurrency),Alpine2.magic("convertCurrency",()=>convertCurrency)}/*!
61* tabbable 6.4.0
62* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE
63*/var candidateSelectors=["input:not([inert]):not([inert] *)","select:not([inert]):not([inert] *)","textarea:not([inert]):not([inert] *)","a[href]:not([inert]):not([inert] *)","button:not([inert]):not([inert] *)","[tabindex]:not(slot):not([inert]):not([inert] *)","audio[controls]:not([inert]):not([inert] *)","video[controls]:not([inert]):not([inert] *)",'[contenteditable]:not([contenteditable="false"]):not([inert]):not([inert] *)',"details>summary:first-of-type:not([inert]):not([inert] *)","details:not([inert]):not([inert] *)"],candidateSelector=candidateSelectors.join(","),NoElement=typeof Element>"u",matches=NoElement?function(){}:Element.prototype.matches||Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector,getRootNode=!NoElement&&Element.prototype.getRootNode?function(element){var _element$getRootNode;return element==null||(_element$getRootNode=element.getRootNode)===null||_element$getRootNode===void 0?void 0:_element$getRootNode.call(element)}:function(element){return element?.ownerDocument},_isInert=function(node,lookUp){var _node$getAttribute;lookUp===void 0&&(lookUp=!0);var inertAtt=node==null||(_node$getAttribute=node.getAttribute)===null||_node$getAttribute===void 0?void 0:_node$getAttribute.call(node,"inert"),inert=inertAtt===""||inertAtt==="true",result=inert||lookUp&&node&&(typeof node.closest=="function"?node.closest("[inert]"):_isInert(node.parentNode));return result},getCandidates=function(el,includeContainer,filter2){if(_isInert(el))return[];var candidates=Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));return includeContainer&&matches.call(el,candidateSelector)&&candidates.unshift(el),candidates=candidates.filter(filter2),candidates},_getCandidatesIteratively=function(elements,includeContainer,options2){for(var candidates=[],elementsToCheck=Array.from(elements);elementsToCheck.length;){var element=elementsToCheck.shift();if(!_isInert(element,!1))if(element.tagName==="SLOT"){var assigned=element.assignedElements(),content=assigned.length?assigned:element.children,nestedCandidates=_getCandidatesIteratively(content,!0,options2);options2.flatten?candidates.push.apply(candidates,nestedCandidates):candidates.push({scopeParent:element,candidates:nestedCandidates})}else{var validCandidate=matches.call(element,candidateSelector);validCandidate&&options2.filter(element)&&(includeContainer||!elements.includes(element))&&candidates.push(element);var shadowRoot=element.shadowRoot||typeof options2.getShadowRoot=="function"&&options2.getShadowRoot(element),validShadowRoot=!_isInert(shadowRoot,!1)&&(!options2.shadowRootFilter||options2.shadowRootFilter(element));if(shadowRoot&&validShadowRoot){var _nestedCandidates=_getCandidatesIteratively(shadowRoot===!0?element.children:shadowRoot.children,!0,options2);options2.flatten?candidates.push.apply(candidates,_nestedCandidates):candidates.push({scopeParent:element,candidates:_nestedCandidates})}else elementsToCheck.unshift.apply(elementsToCheck,element.children)}}return candidates},isInput=function(node){return node.tagName==="INPUT"},isHiddenInput=function(node){return isInput(node)&&node.type==="hidden"},isDetailsWithSummary=function(node){var r=node.tagName==="DETAILS"&&Array.prototype.slice.apply(node.children).some(function(child){return child.tagName==="SUMMARY"});return r},isNodeAttached=function(node){var _nodeRoot,nodeRoot=node&&getRootNode(node),nodeRootHost=(_nodeRoot=nodeRoot)===null||_nodeRoot===void 0?void 0:_nodeRoot.host,attached=!1;if(nodeRoot&&nodeRoot!==node){var _nodeRootHost,_nodeRootHost$ownerDo,_node$ownerDocument;for(attached=!!((_nodeRootHost=nodeRootHost)!==null&&_nodeRootHost!==void 0&&(_nodeRootHost$ownerDo=_nodeRootHost.ownerDocument)!==null&&_nodeRootHost$ownerDo!==void 0&&_nodeRootHost$ownerDo.contains(nodeRootHost)||node!=null&&(_node$ownerDocument=node.ownerDocument)!==null&&_node$ownerDocument!==void 0&&_node$ownerDocument.contains(node));!attached&&nodeRootHost;){var _nodeRoot2,_nodeRootHost2,_nodeRootHost2$ownerD;nodeRoot=getRootNode(nodeRootHost),nodeRootHost=(_nodeRoot2=nodeRoot)===null||_nodeRoot2===void 0?void 0:_nodeRoot2.host,attached=!!((_nodeRootHost2=nodeRootHost)!==null&&_nodeRootHost2!==void 0&&(_nodeRootHost2$ownerD=_nodeRootHost2.ownerDocument)!==null&&_nodeRootHost2$ownerD!==void 0&&_nodeRootHost2$ownerD.contains(nodeRootHost))}}return attached},isZeroArea=function(node){var _node$getBoundingClie=node.getBoundingClientRect(),width=_node$getBoundingClie.width,height=_node$getBoundingClie.height;return width===0&&height===0},isHidden=function(node,_ref){var displayCheck=_ref.displayCheck,getShadowRoot=_ref.getShadowRoot;if(displayCheck==="full-native"&&"checkVisibility"in node){var visible=node.checkVisibility({checkOpacity:!1,opacityProperty:!1,contentVisibilityAuto:!0,visibilityProperty:!0,checkVisibilityCSS:!0});return!visible}if(getComputedStyle(node).visibility==="hidden")return!0;var isDirectSummary=matches.call(node,"details>
63summary:first-of-type"),nodeUnderDetails=isDirectSummary?node.parentElement:node;if(matches.call(nodeUnderDetails,"details:not([open]) *"))return!0;if(!displayCheck||displayCheck==="full"||displayCheck==="full-native"||displayCheck==="legacy-full"){if(typeof getShadowRoot=="function"){for(var originalNode=node;node;){var parentElement=node.parentElement,rootNode=getRootNode(node);if(parentElement&&!parentElement.shadowRoot&&getShadowRoot(parentElement)===!0)return isZeroArea(node);node.assignedSlot?node=node.assignedSlot:!parentElement&&rootNode!==node.ownerDocument?node=rootNode.host:node=parentElement}node=originalNode}if(isNodeAttached(node))return!node.getClientRects().length;if(displayCheck!=="legacy-full")return!0}else if(displayCheck==="non-zero-area")return isZeroArea(node);return!1},isDisabledFromFieldset=function(node){if(/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName))for(var parentNode=node.parentElement;parentNode;){if(parentNode.tagName==="FIELDSET"&&parentNode.disabled){for(var i=0;i<parentNode.children.length;i++){var child=parentNode.children.item(i);if(child.tagName==="LEGEND")return matches.call(parentNode,"fieldset[disabled] *")?!0:!child.contains(node)}return!0}parentNode=parentNode.parentElement}return!1},isNodeMatchingSelectorFocusable=function(options2,node){return!(node.disabled||isHiddenInput(node)||isHidden(node,options2)||isDetailsWithSummary(node)||isDisabledFromFieldset(node))},focusable=function(container,options2){options2=options2||{};var candidates;return options2.getShadowRoot?candidates=_getCandidatesIteratively([container],options2.includeContainer,{filter:isNodeMatchingSelectorFocusable.bind(null,options2),flatten:!0,getShadowRoot:options2.getShadowRoot}):candidates=getCandidates(container,options2.includeContainer,isNodeMatchingSelectorFocusable.bind(null,options2)),candidates},focusableCandidateSelector=candidateSelectors.concat("iframe:not([inert]):not([inert] *)").join(","),isFocusable=function(node,options2){if(options2=options2||{},!node)throw new Error("No node provided");return matches.call(node,focusableCandidateSelector)===!1?!1:isNodeMatchingSelectorFocusable(options2,node)};const DEFAULT_SPEED=60,DEFAULT_ATTRIBUTE_BLACKLIST=["id"],SCROLL_PROGRESS_TO_MARQUEE_OFFSET_MULTIPLIER=5,VIEWPORT_RESIZE_DEBOUNCE_MS=100,SCROLL_SPRING_CONFIG={stiffness:100,damping:40,mass:.2};function marquee(Alpine2){Alpine2.directive("marquee",($el,{value,modifiers})=>{var _a1;if(value=="source")Alpine2.bind($el,{"x-init"(){if(!this.__marquee_isRoot){warnMissingParentDirective("x-marquee:source","x-marquee",this.$el);return}this.__marquee_sourceEl=this.$el}});else if(value=="target")Alpine2.bind($el,{"x-init"(){if(!this.__marquee_isRoot){warnMissingParentDirective("x-marquee:target","x-marquee",this.$el);return}this.__marquee_targetEl=this.$el}});else if(value==null){const speed=(_a1=getNumberModifierValue(modifiers,"speed"))!==null&&_a1!==void 0?_a1:DEFAULT_SPEED;let fill=modifiers.includes("fill"),autoplay=!modifiers.includes("pause"),scrollWithPage=modifiers.includes("scroll");Alpine2.bind($el,{"x-data"(){return{__marquee_isRoot:!0,__marquee_state:buildMarqueeState({isPlaying:autoplay}),__marquee_isInitialized:!1,__marquee_isActive:!1,__marquee_isRendering:!1,__marquee_wasPlayingBeforeKeyboardFocus:!1,__marquee_sourceEl:null,__marquee_targetEl:null,__marquee_originalContentFragment:document.createDocumentFragment(),__marquee_originalContentWidth:0,__marquee_sourceElWidth:0,__marquee_viewportWidth:0,__marquee_offsetValue:motionValue(0),__marquee_scrollOffsetValue:motionValue(0),__marquee_scrollOffsetSpringValue:null,__marquee_offsetTransformValue:null,__marquee_animation:null,__marquee_sourceElStyleEffect:null,__marquee_targetElStyleEffect:null,__marquee_cancelScroll:null,__marquee_afterNextPaintId:null,__marquee_afterNextPaintResolve:null,__marquee_renderFrameId:null,__marquee_resizeFrameId:null,__marquee_resetRenderingFrameId:null,__marquee_sentinel:null,__marquee_cancelInView:null,__marquee_measureWidths(){return readLayoutAfterPaint(()=>{this.__marquee_originalContentWidth=this.__marquee_sourceEl.clientWidth,this.__marquee_sourceElWidth=this.__marquee_originalContentWidth,this.__marquee_viewportWidth=this.$el.clientWidth}
63)},get __marquee_animationDuration(){return this.__marquee_sourceElWidth/Math.abs(speed)},__marquee_fillSource(){return(async()=>{this.__marquee_originalContentWidth===0&&await readLayoutAfterPaint(()=>{this.__marquee_originalContentWidth=this.__marquee_sourceEl.clientWidth,this.__marquee_sourceElWidth=this.__marquee_originalContentWidth});let needsWidthAfterDomChange=!1;Alpine2.mutateDom(()=>{if(!this.__marquee_sentinel)this.__marquee_sentinel=document.createComment("marquee-sentinel"),this.__marquee_sourceEl.appendChild(this.__marquee_sentinel);else{let next=this.__marquee_sentinel.nextSibling;for(;next;){const toRemove=next;next=next.nextSibling,this.__marquee_sourceEl.removeChild(toRemove)}needsWidthAfterDomChange=!0}}),needsWidthAfterDomChange&&await readLayoutAfterPaint(()=>{this.__marquee_originalContentWidth=this.__marquee_sourceEl.clientWidth,this.__marquee_sourceElWidth=this.__marquee_originalContentWidth});const spaceToFill=Math.max(0,this.__marquee_viewportWidth-this.__marquee_originalContentWidth);if(spaceToFill===0)return;const timesToClone=Math.ceil(spaceToFill/this.__marquee_originalContentWidth),fragment=document.createDocumentFragment();for(let i=0;i<timesToClone;i++){const clone2=this.__marquee_originalContentFragment.cloneNode(!0);Array.from(clone2.children).forEach(child=>prepareClonedSourceElement(child)),fragment.appendChild(clone2)}await new Promise(resolve=>{Alpine2.mutateDom(()=>{this.__marquee_sentinel.after(fragment),Alpine2.skipDuringClone(()=>Alpine2.initTree(this.__marquee_sourceEl))(),this.__marquee_afterNextPaintResolve=resolve,this.__marquee_afterNextPaintId=afterNextPaint(()=>{this.__marquee_afterNextPaintId=null,this.__marquee_afterNextPaintResolve=null,this.__marquee_sourceElWidth=this.__marquee_sourceEl.clientWidth,resolve()})})})})()},__marquee_cloneSourceToTarget(){return new Promise(resolve=>{if(this.__marquee_sourceElWidth<this.__marquee_viewportWidth)return resolve();Alpine2.mutateDom(()=>{const clone2=this.__marquee_sourceEl.cloneNode(!0);Array.from(clone2.children).forEach(child=>prepareClonedTargetElement(child)),this.__marquee_targetEl.replaceChildren(...clone2.children),Alpine2.skipDuringClone(()=>Alpine2.initTree(this.__marquee_targetEl))(),resolve()})})},__marquee_setupAnimations(){var _a;const durationInSeconds=this.__marquee_animationDuration;let animationStartOffset=this.__marquee_offsetValue.get();this.__marquee_animation==null&&speed<0&&animationStartOffset===0&&(animationStartOffset=-100);const animationEndOffset=animationStartOffset+(speed<0?100:-100),shouldPlay=this.__marquee_state.isPlaying&&this.__marquee_sourceElWidth>=this.__marquee_viewportWidth;(_a=this.__marquee_animation)===null||_a===void 0||_a.stop(),this.__marquee_animation=animate(this.__marquee_offsetValue,[animationStartOffset,animationEndOffset],{duration:durationInSeconds,repeat:1/0,ease:"linear"}),shouldPlay||this.__marquee_animation.pause(),this.__marquee_enableScroll()},__marquee_enableScroll(){if(!scrollWithPage||this.__marquee_cancelScroll!=null||isReducedMotion()||isLowPowerDevice()||this.__marquee_sourceElWidth<this.__marquee_viewportWidth)return;let lastScrollProgress=null;this.__marquee_cancelScroll=scroll(scrollProgress=>{if(lastScrollProgress==null){lastScrollProgress=scrollProgress;return}const scrollProgressDelta=scrollProgress-lastScrollProgress;lastScrollProgress=scrollProgress,this.__marquee_nudgeOffsetByScrollProgress(scrollProgressDelta)},{target:$el,offset:["end start","start end"]})},__marquee_disableScroll(){var _a;(_a=this.__marquee_cancelScroll)===null||_a===void 0||_a.call(this),this.__marquee_cancelScroll=null},__marquee_nudgeOffsetByScrollProgress(scrollProgressDelta){let offsetDirection=speed<0?-1:1;scrollProgressDelta>0&&(offsetDirection=speed<0?1:-1);const newOffset=this.__marquee_scrollOffsetValue.get()+scrollProgressDelta*SCROLL_PROGRESS_TO_MARQUEE_OFFSET_MULTIPLIER*offsetDirection;this.__marquee_scrollOffsetValue.set(newOffset)},__marquee_scrollTo(element){if(!isFinite(this.__marquee_animationDuration))return;let offset=element.offsetLeft,leftSpacingBuffer=24;speed<0&&(offset=this.__marquee_sourceElWidth-offset,leftSpacingBuffer=leftSpacingBuffer*-1);const elementPositionTime=(offset-leftSpacingBuffer)/this.__marquee_sourceElWidth*this.__marquee_animationDuration;isFinite(elementPositionTime)&&this.__marquee_animation!=null&&(this.__marquee_animation.time=elementPositionTime)}
63,async __marquee_render(){if(this.__marquee_isActive&&!this.__marquee_isRendering)try{this.__marquee_isRendering=!0,await this.__marquee_measureWidths(),fill&&await this.__marquee_fillSource(),await this.__marquee_cloneSourceToTarget(),isReducedMotion()||this.__marquee_setupAnimations(),this.__marquee_isInitialized=!0,this.__marquee_resetRenderingFrameId=window.requestAnimationFrame(()=>{this.__marquee_resetRenderingFrameId=null,this.__marquee_isRendering=!1})}finally{this.__marquee_isRendering=!1}},__marquee_updateViewportWidth(){this.__marquee_resizeFrameId!==null&&cancelAnimationFrame(this.__marquee_resizeFrameId),this.__marquee_resizeFrameId=requestAnimationFrame(()=>{this.__marquee_resizeFrameId=null,this.__marquee_viewportWidth=this.$el.clientWidth,this.__marquee_render()})},__marquee_pauseForKeyboardFocus(target){var _a;target instanceof HTMLElement&&(this.__marquee_wasPlayingBeforeKeyboardFocus=this.__marquee_state.isPlaying,this.__marquee_state.pause(),(_a=this.__marquee_animation)===null||_a===void 0||_a.pause(),this.__marquee_scrollTo(target))},__marquee_resumeAfterKeyboardFocus(){var _a;this.__marquee_wasPlayingBeforeKeyboardFocus&&(this.__marquee_wasPlayingBeforeKeyboardFocus=!1,this.__marquee_state.play(),(_a=this.__marquee_animation)===null||_a===void 0||_a.play())},__marquee_teardown(){var _a;this.__marquee_disableScroll(),(_a=this.__marquee_animation)===null||_a===void 0||_a.stop(),this.__marquee_animation=null,this.__marquee_isInitialized=!1},init(){this.$nextTick(()=>{if(this.__marquee_sourceEl==null)throw new Error("Source element not found, x-marquee:source must be applied to a child element of the x-marquee directive");if(this.__marquee_targetEl==null)throw new Error("Target element not found, x-marquee:target must be applied to a child element of the x-marquee directive");this.__marquee_targetEl.setAttribute("aria-hidden","true"),Array.from(this.__marquee_sourceEl.children).forEach(element=>{const clone2=element.cloneNode(!0);for(const blacklistedAttribute of DEFAULT_ATTRIBUTE_BLACKLIST)clone2.removeAttribute(blacklistedAttribute);this.__marquee_originalContentFragment.append(clone2)}
63),this.__marquee_scrollOffsetSpringValue=springValue(this.__marquee_scrollOffsetValue,SCROLL_SPRING_CONFIG),this.__marquee_offsetTransformValue=transformValue(()=>`${wrapOffsetPercentage(this.__marquee_offsetValue.get()+this.__marquee_scrollOffsetSpringValue.get())}%`),this.__marquee_sourceElStyleEffect=styleEffect(this.__marquee_sourceEl,{x:this.__marquee_offsetTransformValue}),this.__marquee_targetElStyleEffect=styleEffect(this.__marquee_targetEl,{x:this.__marquee_offsetTransformValue}),this.__marquee_cancelInView=inView(this.$el,()=>(this.__marquee_isActive=!0,this.__marquee_renderFrameId!==null&&cancelAnimationFrame(this.__marquee_renderFrameId),this.__marquee_renderFrameId=window.requestAnimationFrame(()=>{this.__marquee_renderFrameId=null,this.__marquee_isActive&&this.__marquee_render()}),()=>{this.__marquee_renderFrameId!==null&&(cancelAnimationFrame(this.__marquee_renderFrameId),this.__marquee_renderFrameId=null),this.__marquee_isActive=!1,this.__marquee_teardown()}))}),this.$watch("__marquee_state.isPlaying",playing=>{var _a,_b;playing?(_a=this.__marquee_animation)===null||_a===void 0||_a.play():(_b=this.__marquee_animation)===null||_b===void 0||_b.pause()})},destroy(){var _a,_b,_c,_d,_e,_f,_g,_h,_j,_k,_l;this.__marquee_disableScroll(),(_a=this.__marquee_cancelInView)===null||_a===void 0||_a.call(this),this.__marquee_afterNextPaintId!==null&&(cancelAnimationFrame(this.__marquee_afterNextPaintId),this.__marquee_afterNextPaintId=null),(_b=this.__marquee_afterNextPaintResolve)===null||_b===void 0||_b.call(this),this.__marquee_afterNextPaintResolve=null,this.__marquee_renderFrameId!==null&&(cancelAnimationFrame(this.__marquee_renderFrameId),this.__marquee_renderFrameId=null),this.__marquee_resizeFrameId!==null&&(cancelAnimationFrame(this.__marquee_resizeFrameId),this.__marquee_resizeFrameId=null),this.__marquee_resetRenderingFrameId!==null&&(cancelAnimationFrame(this.__marquee_resetRenderingFrameId),this.__marquee_resetRenderingFrameId=null),(_c=this.__marquee_sourceElStyleEffect)===null||_c===void 0||_c.call(this),(_d=this.__marquee_targetElStyleEffect)===null||_d===void 0||_d.call(this),(_f=(_e=this.__marquee_offsetTransformValue)===null||_e===void 0?void 0:_e.stop)===null||_f===void 0||_f.call(_e),this.__marquee_offsetTransformValue=null,(_g=this.__marquee_sourceEl)===null||_g===void 0||_g.replaceChildren(this.__marquee_originalContentFragment),this.__marquee_originalContentFragment=document.createDocumentFragment(),(_h=this.__marquee_sentinel)===null||_h===void 0||_h.remove(),(_j=this.__marquee_animation)===null||_j===void 0||_j.stop(),(_l=(_k=this.__marquee_scrollOffsetSpringValue)===null||_k===void 0?void 0:_k.stop)===null||_l===void 0||_l.call(_k),this.__marquee_animation=null}}},"@focusin":"__marquee_pauseForKeyboardFocus($event.target)","@focusout":"__marquee_resumeAfterKeyboardFocus()","x-resize.document":Alpine2.debounce(function(){this.__marquee_updateViewportWidth()},VIEWPORT_RESIZE_DEBOUNCE_MS)})}else throw new Error(`Unknown directive: x-marquee:${value}`)}).before("bind"),Alpine2.magic("marquee",$el=>{const $data=Alpine2.$data($el);return{get isPlaying(){var _a;return(_a=$data.__marquee_state)===null||_a===void 0?void 0:_a.isPlaying},play(){var _a;(_a=$data.__marquee_state)===null||_a===void 0||_a.play()},pause(){var _a;(_a=$data.__marquee_state)===null||_a===void 0||_a.pause()},toggle(){var _a;(_a=$data.__marquee_state)===null||_a===void 0||_a.toggle()},scrollTo(element){var _a;(_a=$data.__marquee_scrollTo)===null||_a===void 0||_a.call($data,element)},get offsetValue(){return $data.__marquee_offsetValue},get isReady(){return $data.__marquee_isInitialized}}})}function buildMarqueeState(options2){var _a;return{isPlaying:(_a=options2?.isPlaying)!==null&&_a!==void 0?_a:!1,play(){this.isPlaying=!0},pause(){this.isPlaying=!1},toggle(){this.isPlaying=!this.isPlaying}}}function wrapOffsetPercentage(offsetPercentage){const wrappedOffsetPercentage=(offsetPercentage%100+100)%100;return wrappedOffsetPercentage===0?0:wrappedOffsetPercentage-100}function prepareClonedSourceElement(element){element.setAttribute("aria-hidden","true"),removeClonedElementFromTabOrder(element)}function prepareClonedTargetElement(element){removeClonedElementFromTabOrder(element)}function removeClonedElementFromTabOrder(element){isFocusable(element,{displayCheck:"none"})&&element.setAttribute("tabindex","-1"),focusable(element,{displayCheck:"none"}
63).forEach(focusableElement=>{focusableElement.setAttribute("tabindex","-1")})}const SCROLL_PROGRESS_TO_REVEAL_PROGRESS_MULTIPLIER=30,DEFAULT_EDGE_BUFFER_PX=2,MIN_SPRING_MASS=.01,SPRING_DEFAULT_CONFIG={stiffness:300,damping:30,mass:.05};function sliderReveal(Alpine2){Alpine2.directive("slider-reveal",($el,data2)=>{if(data2.value=="handle")handleHandle($el,Alpine2);else if(data2.value=="reveal")handleReveal($el,Alpine2);else if(data2.value==null)handleRoot($el,Alpine2,data2);else throw new Error(`Unknown directive: x-slider-reveal:${data2.value}`)}).before("bind"),Alpine2.magic("sliderReveal",handleSliderRevealMagic(Alpine2))}function handleHandle($el,Alpine2,_data){Alpine2.bind($el,{"x-init"(){if(!this.__sliderReveal_isRoot){warnMissingParentDirective("x-slider-reveal:handle","x-slider-reveal",this.$el);return}this.__sliderReveal_handle=this.$el}})}function handleReveal($el,Alpine2,_data){Alpine2.bind($el,{"x-init"(){if(!this.__sliderReveal_isRoot){warnMissingParentDirective("x-slider-reveal:reveal","x-slider-reveal",this.$el);return}this.__sliderReveal_reveal=this.$el}})}function handleRoot($el,Alpine2,data2){var _a1,_b1;const orientation=data2.modifiers.includes("vertical")?"vertical":"horizontal",edgeBufferPx=(_a1=getPixelModifierValue(data2.modifiers,"edge-buffer"))!==null&&_a1!==void 0?_a1:DEFAULT_EDGE_BUFFER_PX,startProgress=(_b1=getPercentageModifierValue(data2.modifiers,"progress"))!==null&&_b1!==void 0?_b1:0,fromProgress=getPercentageModifierValue(data2.modifiers,"from"),springConfig=getSpringModifierConfig(data2.modifiers,SPRING_DEFAULT_CONFIG,MIN_SPRING_MASS);let initialProgress=startProgress;fromProgress!==null&&(initialProgress=Number(fromProgress)),Alpine2.bind($el,{"x-data"(){return{__sliderReveal_isRoot:!0,__sliderReveal_rootEl:$el,__sliderReveal_progressValue:reactiveMotionValue(Alpine2,initialProgress),__sliderReveal_progressSpringValue:null,__sliderReveal_startProgress:startProgress,__sliderReveal_handle:null,__sliderReveal_reveal:null,__sliderReveal_afterNextPaintId:null,__sliderReveal_scrollAnimationFn:null,__sliderReveal_startAnimationFn:null,__sliderReveal_stopHandleStyleEffect:null,__sliderReveal_stopRevealStyleEffect:null,init(){this.$nextTick(()=>{this.__sliderReveal_afterNextPaintId=afterNextPaint(()=>{this.__sliderReveal_afterNextPaintId=null;const effectiveInitialProgress=this.__sliderReveal_getEffectiveProgress(initialProgress);this.__sliderReveal_startProgress=this.__sliderReveal_getEffectiveProgress(startProgress),this.__sliderReveal_progressValue.set(effectiveInitialProgress),this.__sliderReveal_progressSpringValue=springV
63alue(this.__sliderReveal_progressValue,springConfig),this.__sliderReveal_handle&&(this.__sliderReveal_stopHandleStyleEffect=styleEffect(this.__sliderReveal_handle,{transform:transformValue(()=>getHandleTransform(this.__sliderReveal_progressSpringValue.get(),orientation,this.$el,this.__sliderReveal_handle,edgeBufferPx))})),this.__sliderReveal_reveal&&(this.__sliderReveal_stopRevealStyleEffect=styleEffect(this.__sliderReveal_reveal,{clipPath:transformValue(()=>getRevealClipPath(this.__sliderReveal_getEffectiveProgress(this.__sliderReveal_progressSpringValue.get()),orientation))}))})})},destroy(){var _a,_b,_c,_d,_e;this.__sliderReveal_afterNextPaintId!==null&&(cancelAnimationFrame(this.__sliderReveal_afterNextPaintId),this.__sliderReveal_afterNextPaintId=null),this.__sliderReveal_disableScroll(),(_a=this.__sliderReveal_stopHandleStyleEffect)===null||_a===void 0||_a.call(this),(_b=this.__sliderReveal_stopRevealStyleEffect)===null||_b===void 0||_b.call(this),(_d=(_c=this.__sliderReveal_progressSpringValue)===null||_c===void 0?void 0:_c.stop)===null||_d===void 0||_d.call(_c),(_e=this.__sliderReveal_startAnimationFn)===null||_e===void 0||_e.stop(),this.__sliderReveal_startAnimationFn=null},__sliderReveal_getEffectiveProgress(progress2){return getEffectiveProgress(progress2,orientation,this.__sliderReveal_rootEl,this.__sliderReveal_handle,edgeBufferPx)},async __sliderReveal_enableScroll(){if(this.__sliderReveal_scrollAnimationFn||isLowPowerDevice()||isReducedMotion())return;if(this.__sliderReveal_startAnimationFn==null)await this.__sliderReveal_animateToStartProgress();else if(this.__sliderReveal_startAnimationFn.state=="running")return;let lastScrollProgress=null;this.__sliderReveal_scrollAnimationFn=scroll(scrollProgress=>{if(lastScrollProgress==null){lastScrollProgress=scrollProgress;return}const progressDelta=scrollProgress-lastScrollProgress;lastScrollProgress=scrollProgress,this.__sliderReveal_progressValue.set(this.__sliderReveal_getEffectiveProgress(this.__sliderReveal_progressValue.get()+progressDelta*SCROLL_PROGRESS_TO_REVEAL_PROGRESS_MULTIPLIER))},{target:$el,offset:["end start","start end"]})},__sliderReveal_disableScroll(){var _a;(_a=this.__sliderReveal_scrollAnimationFn)===null||_a===void 0||_a.call(this),this.__sliderReveal_scrollAnimationFn=null},async __sliderReveal_animateToStartProgress(){if(this.__sliderReveal_startAnimationFn)return;const effectiveFromProgress=fromProgress==null?this.__sliderReveal_progressValue.get():this.__sliderReveal_getEffectiveProgress(fromProgress);return this.__sliderReveal_startAnimationFn=animate(this.__sliderReveal_progressValue,[effectiveFromProgress,this.__sliderReveal_startProgress],{duration:.3,ease:"easeInOut"}),this.__sliderReveal_startAnimationFn.finished}}}})}function clampProgress(progress2){return Math.max(0,Math.min(100,progress2))}function getEffectiveProgress(progress2,orientation,rootEl,handleEl,edgeBufferPx){const boundedProgress=clampProgress(progress2);if(rootEl==null||handleEl==null)return boundedProgress;const translateAmount=getClampedHandleTranslateAmount(boundedProgress,orientation,rootEl,handleEl,edgeBufferPx);return getProgressFromHandleTranslateAmount(translateAmount,orientation,rootEl)}function getProgressFromHandleTranslateAmount(translateAmount,orientation,rootEl){const rootRect=rootEl.getBoundingClientRect(),rootSize=orientation==="vertical"?rootRect.height:rootRect.width,directionMultiplier=document.dir==="rtl"?-1:1;return rootSize===0?0:clampProgress(translateAmount/(directionMultiplier*rootSize)*100)}function getHandleTransform(progress2,orientation,rootEl,handleEl,edgeBufferPx){const translateAmount=getClampedHandleTranslateAmount(progress2,orientation,rootEl,handleEl,edgeBufferPx);return orientation==="vertical"?`translateY(${translateAmount}px)`:`translateX(${translateAmount}px)`}function getClampedHandleTranslateAmount(progress2,orientation,rootEl,handleEl,edgeBufferPx){const rootRect=rootEl.getBoundingClientRect(),rootSize=orientation==="vertical"?rootRect.height:rootRect.width,directionMultiplier=document.dir==="rtl"?-1:1,progressBasedTranslate=progress2/100*rootSize,handleContentBounds=getHandleContentBounds(handleEl,orientation);if(handleContentBounds==null)return directionMultiplier*progressBasedTranslate;const handleRect=handleEl.getBoundingClientRect(),handleStart=orientation==="vertical"?handleRect.top:handleRect.left,contentStartOffset=handleContentBounds.start-handleStart,contentEndOffset=handleContentBounds.end-handleStart,minTranslateAmount=edgeBufferPx-contentStartOffset,maxTranslateAmount=rootSize-edgeBufferPx-contentEndOffset,clampedProgressBasedTranslate=Math.max(minTranslateAmount,Math.min(maxTranslateAmount,progressBasedTranslate));return directionMultiplier*clampedProgressBasedTranslate}function getHandleContentBounds(handleEl,orientation){const descendantEls=Array.from(handleEl.querySelectorAll("*"));if(descendantEls.length===0)return null;let start2=Number.POSITIVE_INFINITY,end=Number.NEGATIVE_INFINITY;for(const descendantEl of descendantEls){const descendantRect=descendantEl.getBoundingClientRect();orientation==="vertical"?(start2=Math.min(start2,descendantRect.top),end=Math.max(end,descendantRect.bottom)):(start2=Math.min(start2,descendantRect.left),end=Math.max(end,descendantRect.right))}return{start:start2,end}}function getRevealClipPath(progress2,orientation){const percentProgress=transform([0,100],["0%","100%"])(progress2);return orientation==="vertical"?document.dir==="rtl"?`inset(0% 0% ${percentProgress} 0%)`:`inset(${percentProgress} 0% 0% 0%)`:document.dir==="rtl"?`inset(0% ${percentProgress} 0% 0%)`:`inset(0% 0% 0% ${percentProgress})`}function handleSliderRevealMagic(Alpine2){return function($el){const $data=Alpine2.$data($el);return{get progressValue(){return $data.__sliderReveal_progressValue},get progress(){var _a,_b;return(_b=(_a=$data.__sliderReveal_progressValue)===null||_a===void 0?void 0:_a.get)===null||_b===void 0?void 0:_b.call(_a)},set progress(value){var _a2,_b2;(_b2=(_a2=$data.__sliderReveal_progressValue)===null||_a2===void 0?void 0:_a2.set)===null||_b2===void 0||_b2.call(_a2,$data.__sliderReveal_getEffectiveProgress(value))},enableScroll(){$data.__sliderReveal_enableScroll()},disableScroll(){$data.__sliderReveal_disableScroll()}}}}function reactiveMotionValue(_Alpine,initialMotionValue){const value=motionValue(initialMotionValue),reactiveValue=_Alpine.reactive({value:value.get()});return value.on("change",newValue=>{reactiveValue.value=newValue}),new Proxy(value,{get(target,prop,receiver){return prop==="get"&&reactiveValue.value,Reflect.get(target,prop,receiver)}})}const selectors$4={announcementBar:"[data-announcement-bar]",tickerFrame:"[data-ticker-frame]",tickerScale:"[data-ticker-scale]",tickerText:"[data-ticker-text]"},classes={isSelected:"is-selected",tickerAnimated:"ticker--animated"};
63function announcementTicker(options2={stopClone:!1,waitForSlider:!1}){var ref1;return{tickerFrames:(ref1=this.$el.closest(selectors$4.announcementBar))===null||ref1===void 0?void 0:ref1.querySelectorAll(selectors$4.tickerFrame),init(){var ref2;options2?.waitForSlider&&((ref2=this.tickerFrames)===null||ref2===void 0?void 0:ref2.length)>1?document.addEventListener("theme:announcement:loaded",this.initTicker.bind(this)):this.initTicker()},initTicker(){new Ticker(this.$el,options2?.stopClone)},toggleTicker(event,isStopped){const tickerScale=this.$el.querySelector(selectors$4.tickerScale),element=this.$el.querySelector(`[x-ref="${event.detail.blockId}"]`);if(!(!element||element.offsetParent===null)){if(isStopped){const itemsSpacing=Number(getComputedStyle(element).getPropertyValue("--items-spacing").replace("px","")),leftPosition=-(element.offsetLeft+itemsSpacing);tickerScale.setAttribute("data-stop",""),tickerScale.querySelectorAll(selectors$4.tickerText).forEach(textHolder=>{textHolder.classList.remove(classes.tickerAnimated),textHolder.style.transform=`translate3d(${leftPosition}px, 0, 0)`})}isStopped||(tickerScale.querySelectorAll(selectors$4.tickerText).forEach(textHolder=>{textHolder.classList.add(classes.tickerAnimated),textHolder.removeAttribute("style")}),tickerScale.removeAttribute("data-stop"))}},onBlockSelect(event){this.toggleTicker(event,!0)},onBlockDeselect(event){this.toggleTicker(event,!1)}}}function announcementSlider(speed=4e3){return{options:{initialIndex:0,autoPlay:speed,contain:!0,pageDots:!1,adaptiveHeight:!0,wrapAround:!0,groupCells:!1,cellAlign:"left",freeScroll:!1,prevNextButtons:!0,draggable:!0,rightToLeft:window.isRTL,on:{ready:()=>{setTimeout(()=>{this.$el.dispatchEvent(new CustomEvent("theme:announcement:loaded",{bubbles:!0,detail:{slider:this.$el}}))},50)}}},flkty:null,desktopSlides:[],mobileSlides:[],isMobileSliderInitialized:!1,init(){this.$nextTick(()=>{this.$el.children.length<2||(this.flkty=new Flickity(this.$el,this.options),this.removeDeviceSpecificSlides(),resolution.onChange(()=>{this.updateDeviceSpecificSlides()}),this.scrollEvent=()=>this.scrollEvents(),this.resizeEvent=()=>this.resizeEvents(),document.addEventListener("theme:resize",this.resizeEvent),document.addEventListener("theme:scroll",this.scrollEvent))})},removeDeviceSpecificSlides(){this.flkty.getCellElements().forEach((slide,index)=>{slide.classList.remove(classes.isSelected),slide.dataset.device=="desktop"&&(this.desktopSlides.push([slide,index]),resolution.isMobile()&&this.flkty.remove(slide)),slide.dataset.device=="mobile"&&(this.mobileSlides.push([slide,index]),(resolution.isDesktop()||resolution.isTablet())&&this.flkty.remove(slide))}),setTimeout(()=>{this.flkty.resize()},1e3),this.handleSliderAutoplay(),this.isMobileSliderInitialized=resolution.isMobile()},updateDeviceSpecificSlides(){(resolution.isDesktop()||resolution.isTablet())&&this.isMobileSliderInitialized&&(this.desktopSlides.forEach(sli
63de=>{this.flkty.insert(slide[0],slide[1])}),this.mobileSlides.forEach(slide=>{this.flkty.remove(slide[0])})),resolution.isMobile()&&(this.isMobileSliderInitialized||(this.mobileSlides.forEach(slide=>{this.flkty.insert(slide[0],slide[1])}),this.desktopSlides.forEach(slide=>{this.flkty.remove(slide[0])}))),setTimeout(()=>{this.flkty.resize()},1e3),this.handleSliderAutoplay(),this.isMobileSliderInitialized=resolution.isMobile()},handleSliderAutoplay(){var ref2;((ref2=this.flkty)===null||ref2===void 0?void 0:ref2.slides.length)>1?this.flkty.playPlayer():this.flkty.pausePlayer()},resizeEvents(){this.flkty.resize()},scrollEvents(){if(!this.flkty.options.autoPlay)return;const slider=this.flkty.element,sliderBottomPosition=slider.getBoundingClientRect().top+window.scrollY+slider.offsetHeight;window.pageYOffset>sliderBottomPosition?this.flkty.player.state==="playing"&&this.flkty.pausePlayer():this.flkty.player.state==="paused"&&this.flkty.playPlayer()},onBlockSelect(event){const slide=this.$el.querySelector(`[x-ref="${event.detail.blockId}"]`);if(!slide)return;const slideIndex=parseInt([...slide.parentNode.children].indexOf(slide));this.flkty.selectCell(slideIndex),this.flkty.stopPlayer()},onBlockDeselect(){this.flkty.playPlayer()},onUnload(){this.flkty.options.watchCSS=!1,this.flkty.destroy()}}}function announcement(){new CartShippingMessage(this.$el)}const STATES$2={INITIAL:0,LOADING:1,SUCCESS:2,ERROR:3},selectors$3={popdown:"[data-product-add-popdown-wrapper]",errors:"[data-add-action-errors]",errorBoundary:"[data-error-boundary]",errorDisplay:"[data-error-display]",quickviewModal:"[data-quickview-modal]",sectionTypeCart:'[data-section-type="cart"]',sectionTypeProduct:'[data-section-type="product"]',ajaxDisable:'[data-ajax-disable="true"]',productSlideshowDesktop:'[data-slideshow-desktop-style="slideshow"]',productSlideshowMobile:"[data-slideshow-mobile-style]",productMediaDesktop:"[data-product-slideshow]"},defaultTimes$1={durationAddButtonDisable:3500,hideErrorTime:5e3};function productForm(options2={}){const times2={...defaultTimes$1,...options2.times};return{state:STATES$2.INITIAL,error:"",quantity:1,variantId:null,showForm:!0,get form(){return this.$root.querySelector("form")},get popdown(){return document.querySelector(selectors$3.popdown)},get errorDisplay(){let errorsEl=this.$root.querySelector(selectors$3.errors);if(!errorsEl){const ancestorErrorBoundary=this.$root.closest(selectors$3.errorBoundary);ancestorErrorBoundary&&(errorsEl=ancestorErrorBoundary.querySelector(selectors$3.errorDisplay))}return errorsEl||(errorsEl=this.$root.querySelector(selectors$3.errorDisplay)),errorsEl},get quickViewModal(){return this.$root.closest(selectors$3.quickviewModal)},get isInitial(){return this.state===STATES$2.INITIAL},get isLoading(){return this.state===STATES$2.LOADING},get isSuccess(){return this.state===STATES$2.SUCCESS},get isError(){return this.state===STATES$2.ERROR},get isDisabled(){return this.isLoading},get isAjaxDisabled(){return!!this.$root.closest(selectors$3.ajaxDisable)},get isInsideQuickViewModal(){return!!this.quickViewModal},handleSubmit(e){e.preventDefault(),this.state=STATES$2.LOADING;const formData=new FormData(this.form);this.addToCart(formData).then(this.handleSuccess.bind(this)).catch(this.handleError.bind(this))},handleSuccess(response){const variant=response.data;this.state=STATES$2.SUCCESS,this.updateHeaderTotal(),setTimeout(()=>{this.state=STATES$2.INITIAL},times2.durationAddButtonDisable),this.isInsideQuickViewModal&&this.closeQuickView(),window.theme.state.cartOpen?this.reloadCart():this.openPopdown(variant)},handleError(error2){if(error2?.data){if(this.state=STATES$2.ERROR,error2.data.description&&typeof error2.data.description=="string"?this.error=error2.data.description:error2.data.message&&typeof error2.data.message=="string"?this.error=error2.data.message:error2.data.description&&typeof error2.data.description=="object"?this.error=Object.keys(error2.data.description).map(key=>`${key}: ${error2.data.description[key]}`).join("<br>"):this.error="Network error: please try again",this.errorDisplay){const errorsHTML=`<div class="errors">${this.error}</div>`;this.errorDisplay.innerHTML=errorsHTML,slideDown(this.errorDisplay),setTimeout(()=>{slideUp(this.errorDisplay)},times2.hideErrorTime)}}else throw error2},addToCart(formData){const url=`${window.theme.routes.cart}
63/add.js`,formPayload=new URLSearchParams(formData).toString();return axios.post(url,formPayload,{headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded"}})},updateHeaderTotal(){return axios.get(`${window.theme.routes.cart}.js`).then(response=>{document.dispatchEvent(new CustomEvent("theme:cart:change",{detail:{cart:response.data},bubbles:!0}))}).catch(e=>{console.error(e)})},closeQuickView(){this.quickViewModal.dispatchEvent(new CustomEvent("theme:quickview:close"))},reloadCart(){document.dispatchEvent(new CustomEvent("theme:cart:reload",{bubbles:!0}))},openPopdown(variant){this.popdown.dispatchEvent(new CustomEvent("theme:cart:popdown",{detail:{variant},bubbles:!0}))},async changeVariant(variantUrl,newVariantId,variantMediaId){var ref2;newVariantId!=null&&(this.variantId=newVariantId),((ref2=this.$root.closest("[data-enable-history-state]"))===null||ref2===void 0?void 0:ref2.dataset.enableHistoryState)=="false"?await this.$sectionApi.navigate(variantUrl,"none"):await this.$sectionApi.navigate(variantUrl,"replace"),this.updateProductImage(variantMediaId)},updateProductImage(variantMediaId){const desktopOrTablet=resolution.isDesktop()||resolution.isTablet(),mobile=resolution.isMobile();if(desktopOrTablet&&this.hasDesktopSlideshow||mobile&&this.hasMobileSlideshow)variantMediaId&&this.onSlideshowReady(()=>{this.slideshow.dispatchEvent(new CustomEvent("theme:image:change",{detail:{id:variantMediaId}}))});else if(this.productMedia&&desktopOrTablet&&this.productMedia.hasAttribute("data-vertical-images")){const selectedImage=this.productMedia.querySelector(`[data-media-id="${variantMediaId}"]`);selectedImage?.scrollIntoView({behavior:"smooth",block:"nearest"})}},async preloadVariant(variantUrl){window.requestIdleCallback(()=>{var _$sectionApi,ref2;return(ref2=(_$sectionApi=this.$sectionApi).load)===null||ref2===void 0?void 0:ref2.call(_$sectionApi,{baseUrl:variantUrl,cachePolicy:"cache-first",abortPending:!1})})},get hasDesktopSlideshow(){return!!this.$root.querySelector(selectors$3.productSlideshowDesktop)},get hasMobileSlideshow(){return!!this.$root.querySelector(selectors$3.productSlideshowMobile)},get slideshow(){return this.$root.querySelector(selectors$3.productSlideshowDesktop)||this.$root.querySelector(selectors$3.productSlideshowMobile)},get hasProductMedia(){return!!this.productMedia},get productMedia(){return this.$root.querySelector(selectors$3.productMediaDesktop)},onSlideshowReady(callback){if(this.slideshow.classList.contains("flickity-enabled"))callback();else{const mutationObserver=new MutationObserver(mutationList=>{for(const item of mutationList)if(item.attributeName==="class"&&this.slideshow.classList.contains("flickity-enabled")){mutationObserver.disconnect(),callback();break}});mutationObserver.observe(this.slideshow,{attributes:!0})}},init(){this.form.addEventListener("submit",this.handleSubmit.bind(this));const section2=this.$root.closest("[data-section-type]"),desktopOrTablet=resolution.isDesktop()||resolution.isTablet(),mobile=resolution.isMobile();if(desktopOrTablet&&this.hasDesktopSlideshow||mobile&&this.hasMobileSlideshow){const initialVariantMediaId=section2?.dataset.initialVariantMediaId;initialVariantMediaId!==null&&this.updateProductImage(initialVariantMediaId)}
63mobile&&(this.showForm=!1);const handle=section2?.dataset.productHandle;handle&&new RecordRecentlyViewed(handle)}}}const STATES$1={INITIAL:0,LOADING:1,SUCCESS:2,ERROR:3},selectors$2={popdown:"[data-product-add-popdown-wrapper]",errors:"[data-add-action-errors]",errorBoundary:"[data-error-boundary]",errorDisplay:"[data-error-display]",quickviewModal:"[data-quickview-modal]",cartPageUpsellWrapper:"[data-cart-page-upsell-wrapper]",sectionTypeCart:'[data-section-type="cart"]',ajaxDisable:'[data-ajax-disable="true"]'},defaultTimes={durationAddButtonDisable:3500,hideErrorTime:5e3};function productAddButtonForm(options2={}){const times2={...defaultTimes,...options2.times};return{state:STATES$1.INITIAL,error:"",isUpsell:!1,isInCartPage:!1,get cartPageUpsellWrapper(){return this.$el.closest(selectors$2.cartPageUpsellWrapper)},get sectionTypeCart(){return this.$el.closest(selectors$2.sectionTypeCart)},get form(){return this.isUpsell&&this.isInCartPage?this.$el.closest("form"):this.$el.querySelector("form")},get button(){return this.$el.querySelector("button")},get popdown(){return document.querySelector(selectors$2.popdown)},get errorDisplay(){let errorsEl=this.$el.querySelector(selectors$2.errors);if(!errorsEl){const ancestorErrorBoundary=this.$el.closest(selectors$2.errorBoundary);ancestorErrorBoundary&&(errorsEl=ancestorErrorBoundary.querySelector(selectors$2.errorDisplay))}return errorsEl||(errorsEl=this.$el.querySelector(selectors$2.errorDisplay)),errorsEl},get quickViewModal(){return this.$el.closest(selectors$2.quickviewModal)},get isInitial(){return this.state===STATES$1.INITIAL},get isLoading(){return this.state===STATES$1.LOADING},get isSuccess(){return this.state===STATES$1.SUCCESS},get isError(){return this.state===STATES$1.ERROR},get isDisabled(){return this.isLoading},get isAjaxDisabled(){return!!this.$el.closest(selectors$2.ajaxDisable)},get isInsideQuickViewModal(){return!!this.quickViewModal},handleClickAddButton(e){e.preventDefault(),this.state=STATES$1.LOADING;const formData=new FormData(this.form);this.addToCart(formData).then(this.handleSuccess.bind(this)).catch(this.handleError.bind(this))},handleSuccess(response){const variant=response.data;this.state=STATES$1.SUCCESS,this.updateHeaderTotal(),setTimeout(()=>{this.state=STATES$1.INITIAL},times2.durationAddButtonDisable),this.isInsideQuickViewModal&&this.closeQuickView(),window.theme.state.cartOpen||this.isInCartPage||this.isOnCartPage?this.reloadCart():this.openPopdown(variant)},handleError(error2){if(error2?.data){if(this.state=STATES$1.ERROR,error2.data.description&&typeof error2.data.description=="string"?this.error=error2.data.description:error2.data.message&&typeof error2.data.message=="string"?this.error=error2.data.message:error2.data.description&&typeof error2.data.description=="object"?this.error=Object.keys(error2.data.description).map(key=>`${key}: ${error2.data.description[key]}`).join("<br>"):this.error="Network error: please try again",this.errorDisplay){const errorsHTML=`<div class="errors">${this.error}</div>`;this.errorDisplay.innerHTML=errorsHTML,slideDown(this.errorDisplay),setTimeout(()=>{slideUp(this.errorDisplay)},times2.hideErrorTime)}}else throw error2},addToCart(formData){const url=`${window.theme.routes.cart}/add.js`,formPayload=new URLSearchParams(formData).toString();return axios.post(url,formPayload,{headers:{"X-Requested-With":"XMLHttpRequest","Content-Type":"application/x-www-form-urlencoded"}})},updateHeaderTotal(){return axios.get(`${window.theme.routes.cart}.js`).then(response=>{document.dispatchEvent(new CustomEvent("theme:cart:change",{detail:{cart:response.data},bubbles:!0}))}).catch(e=>{console.error(e)})},closeQuickView(){this.quickViewModal.dispatchEvent(new CustomEvent("theme:quickview:close"))},reloadCart(){document.dispatchEvent(new CustomEvent("theme:cart:reload",{bubbles:!0}))},openPopdown(variant){this.popdown.dispatchEvent(new CustomEvent("theme:cart:popdown",{detail:{variant},bubbles:!0}))},get isInCartPage(){return!!this.sectionTypeCart},get isOnCartPage(){return!!document.body.querySelector(selectors$2.sectionTypeCart)},get isUpsell(){return!!this.cartPageUpsellWrapper},init(){this.button.addEventListener("click",this.handleClickAddButton.bind(this))}}}const STATES={INITIAL:0,LOADING:1},selectors$1={shopifySection:".shopify-section",quickviewHolder:"data-quickview-holder",addButtonWrapper:"[data-add-action-wrapper]",modalContent:"[data-product-quickview-ajax]",quickviewModal:"[data-quickview-modal]",quickviewModalScrolls:"[data-drawer-scrolls]",quickviewModalTemplate:"[data-quickview-modal-template]",quickviewHead:"[data-quickview-head]",quickviewFormArea:"[data-quickview-form-area]",toggleButton:"[data-toggle-button]",media:"[data-media-slide]",mediaId:"[data-media-id]",focusable:'button, [href], select, textarea, [tabindex]:not
63([tabindex="-1"])'};function productQuickViewButton(_productId,handle){return{state:STATES.INITIAL,get quickviewHolder(){return this.$root.querySelector(`[${selectors$1.quickviewHolder}]`)},get isInitial(){return this.state===STATES.INITIAL},get isLoading(){return this.state===STATES.LOADING},get isDisabled(){return this.isLoading},clickQuickviewButton(e){this.modal&&this.modalID&&(this.modal.id=this.modalID),document.documentElement.hasAttribute("data-scroll-locked")&&(this.scrollLockEnable=!1),this.state=STATES.LOADING,this.getQuickviewHTML()},getQuickviewHTML(){window.fetch(`${window.theme.routes.root_url}products/${handle}?section_id=api-product-quickview`).then(this.handleErrors).then(response=>response.text()).then(response=>{var ref2;const quickviewHTML=(ref2=new DOMParser().parseFromString(response,"text/html").querySelector(selectors$1.shopifySection))===null||ref2===void 0?void 0:ref2.innerHTML;this.modalContent=this.modal.querySelector(selectors$1.modalContent),this.modalContent.innerHTML=quickviewHTML,this.modalScroll=this.modal.querySelector(selectors$1.quickviewModalScrolls);const images=this.modalContent.querySelector(selectors$1.mediaId);if(images){const imagesHolder=document.createElement("div");imagesHolder.innerHTML=images.parentElement.innerHTML,this.quickviewHolder.dispatchEvent(new CustomEvent("theme:quickview:media",{bubbles:!0,detail:{media:imagesHolder}}))}const section2={container:this.modalContent};this.media=new Media(section2),this.modalCreate(),this.state=STATES.INITIAL})},modalCreate(){MicroModal.show(this.modalID,{onShow:(modal2,el,event)=>{this.quickviewHead=modal2.querySelector(selectors$1.quickviewHead),this.quickviewFormArea=modal2.querySelector(selectors$1.quickviewFormArea);const firstFocus=modal2.querySelector(selectors$1.focusable);trapFocus(modal2,{elementToFocus:firstFocus}),this.modal.addEventListener("theme:quickview:close",this.modalClose),document.dispatchEvent(new CustomEvent("theme:scroll:lock",{bubbles:!0,detail:this.modalScroll})),new ImageCaption(this.modal)},onClose:(modal2,el,event)=>{event&&event.preventDefault(),this.media.destroy(),modal2.querySelectorAll(selectors$1.media).forEach(media=>{media.dispatchEvent(new CustomEvent("pause"))}),removeTrapFocus(),el.focus(),this.modal.removeEventListener("theme:quickview:close",this.modalClose),this.scrollLockEnable?document.dispatchEvent(new CustomEvent("theme:scroll:unlock",{bubbles:!0})):this.scrollLockEnable=!0}})},modalClose(){MicroModal.close(this.modalID)},handleErrors(response){return response.ok?response:response.json().then(function(json){throw new FetchError({status:response.statusText,headers:response.headers,json})})},init(){if(this.quickviewHolder&&(this.modalTemplate=this.quickviewHolder.querySelector(selectors$1.quickviewModalTemplate),this.modal=document.querySelector(selectors$1.quickviewModal),this.modalID=this.quickviewHolder.getAttribute(selectors$1.quickviewHolder),this.modalContent=null,this.modalScroll=null,this.scrollLockEnable=!0,this.windowH=window.innerHeight,this.modalTemplate&&!this.modal)){const modalTemplateInner=this.modalTemplate.innerHTML,htmlObject=document.createElement("div");htmlObject.innerHTML=modalTemplateInner,this.modalHtml=htmlObject.querySelector(selectors$1.quickviewModal),document.body.appendChild(this.modalHtml),this.modal=document.querySelector(selectors$1.quickviewModal)}}}}function toggle(){return{isOpen:!1,get isClosed(){return!this.isOpen},toggle(){if(this.isOpen)return this.close();this.open()},open(){this.isOpen=!0},close(){this.isOpen&&(this.isOpen=!1)}}}function isFunction(x){return typeof x=="function"}function compose(...components){return components.reduce((composedComponent,componentOrComponentFunction)=>{const component=isFunction(componentOrComponentFunction)?componentOrComponentFunction():componentOrComponentFunction;return component.init&&composedComponent._initializers.push(component.init),delete component.init,Object.defineProperties(composedComponent,Object.getOwnPropertyDescriptors(component))},{_initializers:[],init(){this._initializers.forEach(initializer=>initializer.call(this))}})}function productGridItemQuickAddMenu(){return compose(toggle(),{controller:null,init(){this.$watch("isOpen",isOpen=>{isOpen?this.listen():this.unlisten()})},listen(){this.controller=new AbortController,this.$el.addEventListener("mouseleave",()=>{this.close()},{signal:this.controller.signal}),document.addEventListener("click",e=>{this.$el.contains(e.target)||this.$el._x_isShown!==!1&&this.close()},{signal:this.controller.signal}),document.addEventListener("focusin",e=>{this.$el.contains(e.target)||this.close()},{signal:this.controller.signal}),document.addEventListener("keydown",e=>{e.key==="Escape"&&this.close()},{signal:this.controller.signal})},unlisten(){this.controller.abort(),this.controller=null}})}const selectors={tablist:'[role="tablist"]',tab:'[role="tab"]'};function tabs(initialIndex=0){return{selectedIndex:null,init(){this.$nextTick(()=>this.select(initialIndex))},get tablist(){return this.$el.querySelector(selectors.tablist)},get tabs(){var ref2;return(ref2=this.tablist)===null||ref2===void 0?void 0:ref2.querySelectorAll(selectors.tab)},getTab(index){var ref2;return(ref2=this.tabs)===null||ref2===void 0?void 0:ref2[index]},isSelected(index){return this.selectedIndex===index},select(index,scrollIntoView=!0){this.selectedIndex=index;const tab=this.getTab(index);tab&&scrollIntoView&&this.tablist.scrollTo({top:0,left:tab.offsetLeft-tab.clientWidth,behavior:"smooth"})},bindTabs:{"x-id":"['tab', 'tab-panel']"},bindTablist:{":role":"'tablist'","@keydown.right.prevent.stop":"$focus.wrap().next()","@keydown.home.prevent.stop":"$focus.first()","@keydown.page-up.prevent.stop":"$focus.first()","@keydown.left.prevent.stop":"$focus.wrap().prev()","@keydown.end.prevent.stop":"$focus.last()","@keydown.page-down.prevent.stop":"$focus.last()"},bindTabpanels:{},bindTab(index){return{":id":`$id('tab', ${index+1})`,":role":"'tab'","@click":`select(${index})`,"@mousedown.prevent":"","@focus":`select(${index})`,":tabindex":`isSelected(${index}) ? 0 : -1`,":aria-selected":`isSelected(${index})`,":aria-controls":`$id('tab-panel', ${index+1})`}},bindTabpanel(index){return{":id":`$id('tab-panel', ${index+1})`,":role":"'tabpanel'","x-show":`isSelected(${index})`,":aria-labelledby":`$id('tab', ${index+1})`}}}}function overflow(options1={}){const inset={top:0,right:0,bottom:0,left:0,...options1.inset};return{get overflowContainer(){return this.$refs.overflowContainer},isOverflowing:{top:!1,bottom:!1,left:!1,right:!1},checkOverflow(){const scrollOffsetBottom=this.overflowContainer.scrollHeight-this.overflowContainer.scrollTop-inset.bottom,scrollOffsetRight=this.overflowContainer.scrollWidth-this.overflowContainer.scrollLeft-inset.right;this.isOverflowing.top=this.overflowContainer.scrollTop-inset.top>0,this.isOverflowing.bottom=scrollOffsetBottom>this.overflowContainer.clientHeight,this.isOverflowing.left=this.overflowContainer.scrollLeft-inset.left>0,this.isOverflowing.right=scrollOffsetRight>this.overflowContainer.clientWidth},scrollTo(options2){this.overflowContainer.scrollTo(options2)}}}function flickity(Alpine2){Alpine2.directive("flickity",($el,{value,modifiers})=>{switch(value){case"slider":Alpine2.bind($el,{"x-init":"__flickity_sliderEl = $el"});break;case null:Alpine2.bind($el,{"x-data"(){return{__flickity_sliderEl:null,__flickity_isReady:!1,__flickity_instance:null,__flickity_mutationObserver:null,init(){this.$nextTick(()=>{this.__flickity_sliderEl.classList.contains("flickity-enabled")?(this.__flickity_instance=Flickity.data(this.__flickity_sliderEl),this.__flickity_isReady=!0):(this.__flickity_mutationObserver=new MutationObserver(mutationList=>{mutationList.forEach(mutation=>{mutation.type==="attributes"&&mutation.attributeName==="class"&&mutation.target.classList.contains("flickity-enabled")&&(this.__flickity_instance=Flickity.data(this.__flickity_sliderEl),this.__flickity_isReady=!0)})}),this.__flickity_mutationObserver.observe(this.__flickity_sliderEl,{attributes:!0}))})},destroy(){this.__flickity_mutationObserver.disconnect()}}}});break;default:throw new Error(`Invalid flickity directive: ${value}`)}}).before("bind"),Alpine2.magic("flickity",$el=>{const $data=Alpine2.$data($el);return{get instance(){return $data.__flickity_instance},get isReady(){return $data.__flickity_isReady}}})}var targetReferrer=((el,{expression})=>{expression&&document.referrer.indexOf(expression)===-1&&!window.Shopify.designMode&&el.parentNode.removeChild(el)});function ensemble(Alpine2){Alpine2.directive("ensemble",($el,{value:value1,modifiers})=>{const{$ensemble}=Alpine2.$data($el);switch(value1){case"slideshow":Alpine2.bind($el,{[`x-slideshow.${modifiers.join(".")}`](){return{get currentSlideIndex(){return $ensemble.selectedIndex===null?0:$ensemble.selectedIndex>=this.totalSlides?this.totalSlides-1:$ensemble.selectedIndex},set currentSlideIndex(value){$ensemble.selectedIndex=value},get state(){return this.totalSlides<$ensemble.totalSlides?"paused":$ensemble.isPlaying?"playing":"paused"},set state(value){$ensemble.isPlaying=value==="playing"}}},"x-effect"(){this.$slideshow.totalSlides>this.$ensemble.totalSlides&&(this.$ensemble.totalSlides=this.$slideshow.totalSlides)}});break;case"disclosure-group":Alpine2.bind($el,{"x-disclosure-group"(){return{get expandedIndex(){if($ensemble.selectedIndex===null)return 0;const lastDisclosureIndex=Array.from(this.items).length-1;return $ensemble.selectedIndex>lastDisclosureIndex?lastDisclosureIndex:$ensemble.selectedIndex},set expandedIndex(value){value!==null&&($ensemble.isPlaying=!1,$ensemble.selectedIndex=value)}}}});break;case"slider":Alpine2.bind($el,{"x-flickity":"","x-list-state"(){return{scope:"sliderItems",get selectedIndex(){return $ensemble.selectedIndex===null?null:$ensemble.selectedIndex},set selectedIndex(value){$ensemble.selectedIndex=value}}},"x-init"(){this.$watch("$sliderItems.selectedIndex",(selectedIndex,prevSelectedIndex)=>{if(window.innerWidth<768){const targetSlide=Array.from(this.$sliderItems.items)[selectedIndex];targetSlide&&targetSlide.scrollIntoView({behavior:"smooth",block:"nearest",inline:"center"})}else selectedIndex!==this.$flickity.instance.selectedIndex&&this.$flickity.instance.select(selectedIndex)}),this.$watch("$flickity.isReady",isReady=>{this.$flickity.instance.options.fade=!0,this.$flickity.instance.options.freeScroll=!1,this.$flickity.instance.resize(),isReady&&this.$flickity.instance.on("select",index=>{index!==this.$sliderItems.selectedIndex&&(this.$sliderItems.selectedIndex=index)})})}});break;case"hotspots":Alpine2.bind($el,{"x-list-state"(){return{scope:"hotspots",get selectedIndex(){return $ensemble.selectedIndex===null?null:$ensemble.selectedIndex},set selectedIndex(value){$ensemble.isPlaying=!1,$ensemble.selectedIndex=value}}}});break;case null:Alpine2.bind($el,{"x-intersect:enter":"$ensemble.isPlaying = true","x-intersect:leave":"$ensemble.isPlaying = false","@focusin":"$ensemble.isPlaying = false","x-data"(){return{$ensemble:{titleEl:null,selectedIndex:0,totalSlides:0,isPlaying:!1,members:{},registerMember(id,el){this.members[id]=el},getPeerIds(id){return Object.keys(this.members).filter(memberId=>memberId!==id)}}}},":aria-labelledby":"$ensemble.titleEl?.id"});break;default:throw new Error(`Invalid ensemble directive: ${value1}`)}}).before("bind")}module_default.data("announcement",announcement),module_default.data("announcementSlider",announcementSlider),module_default.data("announcementTicker",announcementTicker),module_default.data("productForm",productForm),module_default.data("productAddButtonForm",productAddButtonForm),module_default.data("productQuickViewButton",productQuickViewButton),module_default.data("productGridItemQuickAddMenu",productGridItemQuickAddMenu),module_default.data("toggle",toggle),module_default.data("tabs",tabs),module_default.data("overflow",overflow),module_default.directive("target-referrer",targetReferrer),module_default.plugin(module_default$4),module_default.plugin(module_default$3),module_default.plugin(module_default$2),module_default.plugin(module_default$1),module_default.plugin(currency),module_default.plugin(stepper),module_default.plugin(cache),module_default.plugin(asyncLink),module_default.plugin(asyncForm),module_default.plugin(clone),module_default.plugin(sliderReveal),module_default.plugin(slideshow),module_default.plugin(listState),module_default.plugin(scrollStagger),module_default.plugin(animationUtils),module_default.plugin(disclosure),module_default.plugin(themeEditor),module_default.plugin(marquee),module_default.plugin(hold),module_default.plugin(ensemble),module_default.plugin(flickity),module_default.plugin(section);function isInProductForm(el){return el.hasAttribute&&el.closest(".shopify-product-form")}function isSellingPlanHiddenInput(el){return el.tagName==="INPUT"&&el.type==="hidden"&&el.name==="selling_plan"}module_default.plugin(sectionApi({morphConfig:{updating(el,toEl,childrenOnly,skip){el.hasAttribute&&el.hasAttribute("data-shopify")&&skip(),isInProductForm(el)&&isSellingPlanHiddenInput(el)&&skip()},removing(el,skip){el.hasAttribute&&el.hasAttribute("data-shopify")&&skip(),isInProductForm(el)&&isSellingPlanHiddenInput(el)&&skip()}}})),window.Alpine=module_default;function onDocumentReady(callback){document.readyState!=="complete"?document.addEventListener("DOMContentLoaded",callback):callback()}onDocumentReady(()=>{(window.requestIdleCallback||(cb=>setTimeout(cb,1)))(()=>{module_default.start()})})})(themeVendor.AOS,themeVendor.FlickityFade,themeVendor.ScrollLock,themeVendor.Flickity,themeVendor.MicroModal,themeVendor.Rellax,themeVendor.themeCurrency,themeVendor.axios,themeVendor.themeAddresses,themeVendor.Sqrl);
64//# sourceMappingURL=/cdn/shop/t/18/assets/theme.js.map?v=147719205544241979961789917903

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.