PageSourceSearch

https://www.plaud.ai/cdn/shop/t/125/assets/theme.js?v=44945053239706040061790655845

js plaud.ai collected 2026-10-01 08:41:38 UTC 314,701 bytes, 118 lines download raw bytes

1"use strict";var root=document.body;function debounce(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}}function getCookie(cname){let name=cname+"=",ca=decodeURIComponent(document.cookie).split(";");for(let i=0;i<ca.length;i++){let c=ca[i];for(;c.charAt(0)==" ";)c=c.substring(1);if(c.indexOf(name)==0)return c.substring(name.length,c.length)}return""}function deleteCookie(cname){document.cookie=cname+"=;expires=Thu, 01 Jan 1970 00:00:01 GMT;"}function setCookie(cname,cvalue,exdays){const date=new Date;date.setTime(date.getTime()+exdays*24*60*60*1e3);let expires="expires="+date.toUTCString();document.cookie=cname+"="+cvalue+";"+expires+";path=/"}function fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}function initComparisons(){var x,i;for(x=document.getElementsByClassName("img-comp-overlay"),i=0;i<x.length;i++)compareImages(x[i]);function compareImages(img){var slider,img,clicked=0,w;w=img.offsetWidth;const icc=img.closest(".img-comp-container");icc&&(slider=icc.querySelector(".image-comparison__button")),slider&&(slider.addEventListener("touchstart",slideReady),slider.addEventListener("mousedown",slideReady)),window.addEventListener("mouseup",slideFinish),window.addEventListener("touchend",slideFinish);function slideReady(e){e.preventDefault(),clicked=1,window.addEventListener("mousemove",slideMove),window.addEventListener("touchmove",slideMove)}function slideFinish(){clicked=0,window.removeEventListener("mousemove",slideMove),window.removeEventListener("touchmove",slideMove)}function slideMove(e){var pos;if(clicked==0)return!1;pos=getCursorPos(e),pos<0&&(pos=0),pos>w&&(pos=w),slide(pos)}function getCursorPos(e){e=e.changedTouches?e.changedTouches[0]:e;const a=img.getBoundingClientRect();let x2=e.clientX-a.left+14;return x2=Math.max(0,Math.min(x2,w)),x2}function slide(x2){if(slider){const sliderHalfWidth=slider.offsetWidth/2;let percent=(x2-sliderHalfWidth)/w*100,min=sliderHalfWidth/icc.getBoundingClientRect().width*100;percent=Math.max(min-.1,Math.min(percent,100)),img.closest(".img-comp-container").setAttribute("style","--percent: "+percent+"%;")}}}}initComparisons();let resizeTimeout;window.addEventListener("resize",()=>{clearTimeout(resizeTimeout),resizeTimeout=setTimeout(()=>{initComparisons()},200)});function initLazyloadItem(){const lazyVideos=document.querySelectorAll("video.lazy-video-item"),observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{if(entry.isIntersecting){const video=entry.target;if(video.dataset.poster&&(video.poster=video.dataset.poster,video.removeAttribute("data-poster")),video.querySelectorAll("source").forEach(source=>{const realSrc=source.getAttribute("data-video-src")||source.getAttribute("data-src")||source.getAttribute("srcset");realSrc&&(source.src=realSrc,source.removeAttribute("data-video-src"),source.removeAttribute("data-src"),source.removeAttribute("srcset"))}),video.load(),video.hasAttribute("autoplay")){const playPromise=video.play();playPromise!==void 0&&playPromise.catch(()=>{})}video.classList.remove("lazy-video-item"),observer2.unobserve(video)}})},{threshold:.1,rootMargin:"50px"});lazyVideos.forEach(video=>observer.observe(video))}document.addEventListener("DOMContentLoaded",initLazyloadItem);function initLazyBg(){const lazyBg=document.querySelectorAll(".lazy-bg"),isMobile=window.innerWidth<768,observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{if(entry.isIntersecting){const bg=entry.target,data=bg.dataset,src=isMobile&&data.srcMobile||data.src;bg.style.setProperty("--bg",`url(${src})`),bg.classList.remove("lazy-bg"),observer2.unobserve(bg)}})},{threshold:.1});lazyBg.forEach(bg=>observer.observe(bg))}initLazyBg();function initLazyload(){window.addEventListener("scroll",()=>{scrollLazyload()}),window.pageYOffset>40&&scrollLazyload()}initLazyload();function scrollLazyload(){document.querySelectorAll("video.lazy-video").forEach(el=>{scrollLazyloadItem(el)})}function scrollLazyloadItem(el){const poster=el.dataset.poster,src=el.dataset.src;poster&&(el.setAttribute("poster",poster),el.removeAttribute("data-poster"),el.setAttribute("src",src),el.removeAttribute("data-src")),el.querySelectorAll("source").forEach(source=>{const source_src=source.dataset.src;source_src&&(source.setAttribute("src",source_src),source.removeAttribute("data-src"))}),el.classList.remove("lazy-video")}
1function eventFlashingBrowseTab(){var enable=window.flashingBrowseTab?.enable,myTimer,message,titleTag=document.getElementsByTagName("title")[0],first_notification=window.flashingBrowseTab?.firstNotification,secondary_notification=window.flashingBrowseTab?.secondaryNotification;if(enable&&titleTag){var originalTitle=titleTag.innerText,isActive=!0;document.addEventListener("visibilitychange",()=>{document.visibilityState==="visible"?(function(){isActive||(clearInterval(myTimer),titleTag.innerText=originalTitle)})():(function(){var i=1;isActive=!1,!(!first_notification||!secondary_notification)&&(myTimer=setInterval(function(){i==1?(message=first_notification,i=2):(message=secondary_notification,i=1),titleTag.innerText=message},2e3))})()})}}eventFlashingBrowseTab();function initializeLazyLoad(){const videoPlaceholders=document.querySelectorAll(".lazy-video-link"),loadYouTubeVideo=element=>{const videoId=element.getAttribute("data-video-id"),iframe=document.createElement("iframe");iframe.src=`https://www.youtube.com/embed/${videoId}?controls=0&autoplay=1&mute=1&playsinline=1&loop=1&playlist=${videoId}`,iframe.allowFullscreen=!0,iframe.frameBorder="0",iframe.title=element.getAttribute("data-video-title")||"YouTube video player",iframe.allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",element.closest(".release-notes-video-container")?(element.appendChild(iframe),element.classList.add("has-iframe")):(element.innerHTML="",element.appendChild(iframe))},loadVimeoVideo=element=>{const videoId=element.getAttribute("data-video-id"),iframe=document.createElement("iframe");iframe.src=`https://player.vimeo.com/video/${videoId}?controls=0&background=1&autoplay=1&muted=1&loop=1`,iframe.allowFullscreen=!0,iframe.allow="autoplay; fullscreen; picture-in-picture",iframe.frameBorder="0",iframe.title=element.getAttribute("data-video-title")||"Vimeo video player",element.closest(".release-notes-video-container")?(element.appendChild(iframe),element.classList.add("has-iframe")):(element.innerHTML="",element.appendChild(iframe))},loadVideo=element=>{const videoType=element.getAttribute("data-video-type");videoType==="youtube"?loadYouTubeVideo(element):videoType==="vimeo"&&loadVimeoVideo(element)};(()=>{const observer=new IntersectionObserver((entries,observer2)=>{entries.forEach(entry=>{entry.isIntersecting&&(loadVideo(entry.target),observer2.unobserve(entry.target))})});videoPlaceholders.forEach(videoPlaceholder=>{observer.observe(videoPlaceholder)})})()}initializeLazyLoad();const slideAnime=(()=>{let isAnimating=!1;return setOptions=>{const options=Object.assign({},{target:!1,animeType:"slideToggle",duration:250,easing:"ease",isDisplayStyle:"block",parent:!1,addFunction:()=>{}},setOptions),target=options.target;options.ownAnimate&&(isAnimating=!1);const parent=options.parent;if(!target||isAnimating)return;isAnimating=!0,parent.classList?.toggle("opened");let animeType=options.animeType;const styles=getComputedStyle(target);if(animeType==="slideToggle"&&(animeType=styles.display==="none"?"slideDown":"slideUp"),animeType==="slideUp"&&styles.display==="none"||animeType==="slideDown"&&styles.display!=="none"||animeType!=="slideUp"&&animeType!=="slideDown")return isAnimating=!1,!1;target.style.overflow="hidden";const duration=options.duration,easing=options.easing,isDisplayStyle=options.isDisplayStyle;animeType==="slideDown"&&(target.style.display=isDisplayStyle);const heightVal={height:target.getBoundingClientRect().height+"px",marginTop:styles.marginTop,marginBottom:styles.marginBottom,paddingTop:styles.paddingTop,paddingBottom:styles.paddingBottom};if(Object.keys(heightVal).forEach(key=>{parseFloat(heightVal[key])===0&&delete heightVal[key]}),Object.keys(heightVal).length===0)return isAnimating=!1,!1;let slideAnime2;animeType==="slideDown"?(Object.keys(heightVal).forEach(key=>{target.style[key]=0}),slideAnime2=target.animate(heightVal,{duration,easing})):animeType==="slideUp"&&(Object.keys(heightVal).forEach(key=>{target.style[key]=heightVal[key],heightVal[key]=0}),slideAnime2=target.animate(heightVal,{duration,easing})),slideAnime2.finished.then(()=>{options.addFunction(),target.style.overflow="",Object.keys(heightVal).forEach(key=>{target.style[key]=""}),animeType==="slideUp"&&(target.style.display="none"),isAnimating=!1})}})();class CollectionOverviews extends HTMLElement{constructor(){super()}connectedCallback(){this.initSections(),document.addEventListener("shopify:section:load",event=>{this.contains(event.target)&&this.initSection(event.target)}),document.addEventListener("shopify:section:reorder",event=>{this.contains(event.target)&&this.initSection(event.target)})}initSections(){this.querySelectorAll(".section__block-inner").forEach(section=>{this.initSection(section)})}initSection(section){const blocks=section.querySelectorAll(".content-overview-block"),banners=section.querySelectorAll(".banner__media-collection");
1banners.forEach(banner=>{banner.classList.remove("active")}),banners.length>0&&banners[0].classList.add("active"),blocks.forEach(block=>{block.classList.remove("active")}),blocks.length>0&&blocks[0].classList.add("active"),blocks.forEach(block=>{block.addEventListener("mousemove",()=>{const blockIndex=block.getAttribute("data-index");banners.forEach(banner=>{banner.classList.remove("active")}),blocks.forEach(b=>{b.classList.remove("active")});const targetBanner=section.querySelector(`.banner__media-collection[data-index="${blockIndex}"]`);if(targetBanner){targetBanner.classList.add("active");const video=targetBanner.querySelector("video");video&&(video.currentTime=0)}block.classList.add("active")})})}}customElements.define("collection-overviews",CollectionOverviews);class MultiContent extends SlideSection{constructor(){super(),this.enable=this.dataset.enable,this.swiperSlideInnerHtml=this.innerHTML,this.init()}init(){if(this.enable=="true"){let width=window.innerWidth;window.addEventListener("resize",()=>{const newWidth=window.innerWidth;newWidth<=767&&width>767&&this.actionOnMobile(),newWidth>767&&width<=767&&this.actionOutMobile(),width=newWidth}),width<=576?this.actionOnMobile():this.actionOutMobile()}}actionOnMobile(){this.classList.add("swiper");const wrapper=`<div class='swiper-wrapper'>${this.swiperSlideInnerHtml.replaceAll("section__block","swiper-slide")}</div> <div
2    class="swiper-pagination  ${this.enable&&this.dataset.mobile!=1.5?"flex":"hidden"} px-15 lh-1 bottom-30 justify-content-center"
3    style="--swiper-pagination-bottom: 3rem;--swiper-pagination-position: static;"
4  ></div> `;this.innerHTML=wrapper,this.initSlide()}actionOutMobile(){this.classList.contains("swiper")&&(this.classList.remove("swiper"),this.innerHTML=this.swiperSlideInnerHtml)}}customElements.define("multi-content",MultiContent);class MultiContentWW extends SlideSection{constructor(){super(),this.enable=!1,this.desktopEnable=!1,this.isExpandable=!1,this.swiperSlideInnerHtml=this.innerHTML,this.isInitialized=!1,this.currentMode=null,this.expandableSlideInlineStyles=new Map}init(){}connectedCallback(){if(this.isInitialized)return;this.enable=this.dataset.enable==="true",this.desktopEnable=this.dataset.desktopEnable==="true",this.isExpandable=this.dataset.expandable==="true",this.isProgressbar=this.dataset.paginationProgressbar==="true",this.captureExpandableSlideInlineStyles(),this.checkLayout();let width=window.innerWidth;window.addEventListener("resize",()=>{const newWidth=window.innerWidth;(newWidth<=767&&width>767||newWidth>767&&width<=767)&&this.checkLayout(),width=newWidth}),this.isInitialized=!0}checkLayout(){window.innerWidth<=767?this.enable?this.actionBuildSlider("mobile"):this.actionDestroySlider():this.desktopEnable?this.actionBuildSlider("desktop"):this.actionDestroySlider()}actionBuildSlider(mode){if(this.classList.contains("swiper-initialized")){if(this.currentMode===mode)return;this.actionDestroySlider()}this.classList.add("swiper");const columnGap=this.dataset.spacing?parseFloat(this.dataset.spacing):15,enableAutoplay=this.dataset.autoplay==="true",autoplaySpeed=this.dataset.autoplaySpeed?parseInt(this.dataset.autoplaySpeed)*1e3:5e3;let config={speed:600,watchSlidesProgress:!0,watchSlidesVisibility:!0,resistance:!0,resistanceRatio:.85,navigation:{nextEl:this.querySelector(".swiper-button-next"),prevEl:this.querySelector(".swiper-button-prev")},pagination:{clickable:!0,el:this.querySelector(".swiper-pagination"),type:this.isProgressbar?"progressbar":"bullets"},observer:!0,observeParents:!0};if(enableAutoplay&&(config.autoplay={delay:autoplaySpeed,disableOnInteraction:!1,pauseOnMouseEnter:!0}),mode==="desktop")config={...config,slidesPerView:"auto",spaceBetween:columnGap,slidesOffsetBefore:0,centerInsufficientSlides:!1,centeredSlides:!1,simulateTouch:!0,loop:!1,breakpoints:{1025:{slidesPerView:"auto",spaceBetween:columnGap}}};else{const mobileCols=this.dataset.mobile?parseFloat(this.dataset.mobile):1,columnGapMb=this.dataset.spacingMb?parseFloat(this.dataset.spacingMb):this.dataset.spacingMobile?parseFloat(this.dataset.spacingMobile):columnGap;config={...config,slidesPerView:mobileCols,spaceBetween:columnGapMb,centeredSlides:!1,freeMode:!1}}if(!this.querySelector(".swiper-wrapper")&&!this.innerHTML.includes("swiper-wrapper")){let html=this.swiperSlideInnerHtml.replaceAll("section__block","swiper-slide");this.innerHTML=`<div class='swiper-wrapper'>${html}</div>`;const pagination=document.createElement("div");pagination.className="swiper-pagination",this.appendChild(pagination)}this.globalSlide=new Swiper(this,config),this.currentMode=mode,setTimeout(()=>
4{this.globalSlide&&(this.globalSlide.update(),this.globalSlide.navigation&&this.globalSlide.navigation.update())},100)}captureExpandableSlideInlineStyles(){!this.isExpandable||this.expandableSlideInlineStyles.size||this.querySelectorAll(".ww-expandable-col[data-block-id]").forEach(slide=>{const blockId=slide.getAttribute("data-block-id"),inlineStyle=slide.getAttribute("style");blockId&&inlineStyle&&this.expandableSlideInlineStyles.set(blockId,inlineStyle)})}restoreExpandableSlideInlineStyles(){!this.isExpandable||!this.expandableSlideInlineStyles.size||this.querySelectorAll(".ww-expandable-col[data-block-id]").forEach(slide=>{const blockId=slide.getAttribute("data-block-id"),inlineStyle=this.expandableSlideInlineStyles.get(blockId);inlineStyle&&slide.setAttribute("style",inlineStyle)})}actionDestroySlider(){this.globalSlide&&(this.globalSlide.destroy(!0,!0),this.globalSlide=null),this.classList.remove("swiper","swiper-initialized","swiper-horizontal"),this.currentMode=null,this.restoreExpandableSlideInlineStyles(),this.isExpandable||(this.innerHTML=this.swiperSlideInnerHtml)}}customElements.get("multi-content-ww")||customElements.define("multi-content-ww",MultiContentWW);var getScrollBarWidth=(function(){return{init:function(){var scrollDiv=document.createElement("div");scrollDiv.style.width="100px",scrollDiv.style.height="100px",scrollDiv.style.overflow="scroll",scrollDiv.style.position="absolute",scrollDiv.style.top="-9999px",document.body.appendChild(scrollDiv);var scrollbarWidth=scrollDiv.offsetWidth-scrollDiv.clientWidth;return document.body.removeChild(scrollDiv),scrollbarWidth}}})(),wishlistHeader=(function(){return{init:function(){this.handleCount()},handleCount:function(){const wishlist=document.querySelectorAll(".wishlist-count");let items=[];try{const stored=localStorage.getItem("glozin__wishlist-items");items=stored?JSON.parse(stored):[],Array.isArray(items)||(items=[])}catch(e){console.warn("Failed to parse wishlist items",e),localStorage.removeItem("glozin__wishlist-items")}wishlist.forEach(item=>{item.innerText=items.length!==0?items.length:0})}}})();wishlistHeader.init();function initAccountDropdown(){const accountWrapper=document.querySelector("[data-account-dropdown-wrapper]");if(!accountWrapper)return;const trigger=accountWrapper.querySelector("[data-account-dropdown-trigger]"),menu=accountWrapper.querySelector("[data-account-dropdown-menu]");if(!trigger||!menu)return;const closeDropdown=()=>{menu.hidden=!0,menu.classList.remove("is-open"),trigger.setAttribute("aria-expanded","false")};if(trigger.addEventListener("click",event=>{event.stopPropagation(),trigger.getAttribute("aria-expanded")==="true"?closeDropdown():(menu.hidden=!1,setTimeout(()=>{menu.classList.add("is-open")},10),trigger.setAttribute("aria-expanded","true"))}),document.addEventListener("click",event=>{!accountWrapper.contains(event.target)&&menu.classList.contains("is-open")&&closeDropdown()}),accountWrapper.closest(".site-header--new")){let leaveTimer;const cancelLeave=()=>window.clearTimeout(leaveTimer),closeAfterLeave=()=>{window.clearTimeout(leaveTimer),leaveTimer=window.setTimeout(closeDropdown,120)};accountWrapper.addEventListener("mouseenter",cancelLeave),accountWrapper.addEventListener("mouseleave",closeAfterLeave)}}(function(){const originalHandleCount=wishlistHeader.handleCount;wishlistHeader.handleCount=function(){originalHandleCount.apply(this,arguments);const wishlistCounters=document.querySelectorAll(".wishlist-count");let items=[];try{const stored=localStorage.getItem("glozin__wishlist-items");items=stored?JSON.parse(stored):[],Array.isArray(items)||(items=[])}catch{items=[]}const count=items.length;wishlistCounters.forEach(counter=>{count>0?counter.classList.contains("wishlist-count-bubble--inner")||(counter.style.display="inline-flex",counter.style.alignItems="center",counter.style.justifyContent="center"):counter.style.display="none"})},wishlistHeader.init()})(),document.addEventListener("DOMContentLoaded",initAccountDropdown);function HoverIntent(exitTime,elements,userConfig){const config={exitDelay:exitTime,interval:100,sensitivity:6,...userConfig},allElems=elements;for(let elem of allElems){if(!elem)continue;let hoverTimer=null,exitTimer=null,currX=0,currY=0,prevX=0,prevY=0;const track=e=>{currX=e.pageX,currY=e.pageY},compare=()=>{const distX=prevX-currX,distY=prevY-currY,distance=Math.sqrt(distX*distX+distY*distY);if(distance<config.sensitivity||isNaN(distance)){clearTimeout(exitTimer);const activeOthers=Array.from(allElems).filter(other=>other!==elem&&other.isActive);if(activeOthers.length>0&&typeof config.onSwitch=="function"&&config.onSwitch(activeOthers,elem)===!0){activeOthers.forEac
4h(other=>{other.isActive=!1}),elem.isActive=!0;return}activeOthers.forEach(other=>{config.onExit(other),other.isActive=!1}),config.onEnter(elem),elem.isActive=!0}else prevX=currX,prevY=currY,hoverTimer=setTimeout(compare,config.interval)};elem.addEventListener("mousemove",track),elem.addEventListener("mouseenter",e=>{if(prevX=e.pageX,prevY=e.pageY,currX=e.pageX,currY=e.pageY,clearTimeout(exitTimer),!elem.isActive){if(typeof config.onSwitch=="function"&&Array.from(allElems).some(other=>other!==elem&&other.isActive)){hoverTimer=setTimeout(()=>{const activeOthers=Array.from(allElems).filter(other=>other!==elem&&other.isActive);if(activeOthers.length>0&&config.onSwitch(activeOthers,elem)===!0){activeOthers.forEach(other=>{other.isActive=!1}),elem.isActive=!0;return}compare()},80);return}hoverTimer=setTimeout(compare,config.interval)}}),elem.addEventListener("mouseleave",()=>{clearTimeout(hoverTimer),elem.isActive&&(exitTimer=setTimeout(()=>{typeof config.onSwitch=="function"&&!elem.isActive||(config.onExit(elem),elem.isActive=!1)},config.exitDelay))})}}let BlsMainMenuShopify=(function(){return{init:function(){this.initMenu(),this.initMainMenu(),this.initMobileMenu(),this.initVerticalMenu()},initMenu:function(){const header=document.querySelector("header");if(!header)return;const elements={categoriesListMenuMobile:document.querySelector(".categories-list-menu-mobile"),categoriesListMenu:document.querySelector('[data-menu="categories-list"]'),categoriesListMenuVertical:document.querySelector('[data-menu="verticalmenu-list"]'),categoriesListMenuVerticalMobile:document.querySelector(".verticalmenu-mobile"),horizontalList:document.querySelector("nav.mobile .horizontal-list")},sectionPbValue=this.calculateSectionPadding(header);this.initFadeInDownAnimation(header,sectionPbValue),this.setupMenuTabSwitching(elements),this.updateMenuTabState(elements),this.updateMenuVerticalMobile(elements),window.addEventListener("resize",()=>this.updateMenuTabState(elements)),window.addEventListener("resize",()=>this.updateMenuVerticalMobile(elements))},calculateSectionPadding:function(header){let sectionPbValue=parseInt(getComputedStyle(header).getPropertyValue("--section-pb").trim());return header.querySelector(".header__layout-2")&&(sectionPbValue=0),sectionPbValue},initFadeInDownAnimation:function(header,sectionPbValue){const isFadeInDown=document.querySelector(".animation-fade-in-down, .fade-in-down");this.usesSlideAnimation=!!isFadeInDown;const menus=document.querySelectorAll(".menu-parent__horizontal");if(!menus.length)return;let onEnterFn,onExitFn;isFadeInDown?(onEnterFn=targetItem=>this.handleMenuEnter(targetItem,header,sectionPbValue),onExitFn=targetItem=>this.handleMenuExit(targetItem,header)):(onEnterFn=function(targetItem){targetItem.classList.add("visible")},onExitFn=function(targetItem){targetItem.classList.remove("visible")}),HoverIntent(180,menus,{onEnter:onEnterFn,onExit:onExitFn,onSwitch:header.classList.contains("site-header--new")?(previousItems,nextItem)=>this.handleNewHeaderMenuSwitch(previousItems,nextItem,header):null}),menus.forEach(parent=>{const link=parent.querySelector("a");link&&link.addEventListener("focus",()=>{const activeParents=Array.from(menus).filter(otherParent=>otherParent!==parent&&(otherParent.classList.contains("visible")||otherParent.isActive));header.classList.contains("site-header--new")&&activeParents.length>0&&this.handleNewHeaderMenuSwitch(activeParents,parent,header)?activeParents.forEach(otherParent=>{otherParent.isActive=!1}):(activeParents.forEach(otherParent=>{onExitFn(otherParent),otherParent.isActive=!1}),onEnterFn(parent)),parent.isActive=!0}),parent.addEventListener("focusout",e=>{(!e.relatedTarget||!parent.contains(e.relatedTarget))&&(onExitFn(parent),parent.isActive=!1)})}),document.addEventListener("keydown",e=>{e.key==="Escape"&&Array.from(menus).filter(m=>m.classList.contains("visible")||m.isActive).forEach(parent=>{const link=parent.querySelector("a");header.classList.contains("site-header--new")?(link&&link.focus(),onExitFn(parent),parent.isActive=!1):(onExitFn(parent),parent.isActive=!1,link&&link.focus())})})},handleMenuEnter:function(targetItem,header,sectionPbValue){const submenu=targetItem.querySelector(".submenu-horizontal");if(!submenu||window.innerWidth<1280)return;header?.getAttribute("data-sticky")=="on-scroll-up"&&header.classList.add("open-submenu"),document.documentElement.classList.contains("open-search")?this.handleMenuEnterWithSearchOpen(targetItem,submenu,sectionPbValue):this.handleStandardMenuEnter(targetItem,submenu,header)},handleNewHeaderMenuSwitch:function(previousItems,nextItem,header){const nextSubmenu=nextItem.querySelector(".site-nav-v3--desktop"),previousItem=previousItems.find(item=>item.querySelector(".site-nav-v3--desktop")),previousSubmenu=previousItem?.querySelector(".site-nav-v3--desktop");if(!nextSubmenu||!previousItem||window.innerWidth<1280)return!1;const handoffClass="site-nav-v3--handoff",usesSlideAnimation=!!this.usesSlideAnimation;let submenuOffset=0;if(usesSlideAnimation){const headerRect=header.getBoundingClientRect(),nextItemRect=nextItem.getBoundingClientRect();submenuOffset=headerRect.bottom-nextItemRect.bottom}previousSubmenu.classList.add(handoffClass),nextSubmenu.classList.add(handoffClass),previousSubmenu.getAnimations().forEac
4h(animation=>animation.cancel()),nextSubmenu.getAnimations().forEach(animation=>animation.cancel()),nextItem.classList.add("visible"),previousItem.classList.remove("visible"),usesSlideAnimation?(nextSubmenu.style.transform=`translateY(${submenuOffset}px)`,nextSubmenu.style.visibility="visible",previousSubmenu.style.transform="translateY(-105%)",previousSubmenu.style.visibility="hidden"):(nextSubmenu.style.removeProperty("transform"),nextSubmenu.style.removeProperty("visibility"),previousSubmenu.style.removeProperty("transform"),previousSubmenu.style.removeProperty("visibility")),this.handoffGeneration=(this.handoffGeneration||0)+1;const handoffGeneration=String(this.handoffGeneration);return previousSubmenu.dataset.handoffGeneration=handoffGeneration,nextSubmenu.dataset.handoffGeneration=handoffGeneration,window.requestAnimationFrame(()=>{window.requestAnimationFrame(()=>{[previousSubmenu,nextSubmenu].forEach(panel=>{panel.dataset.handoffGeneration===handoffGeneration&&(panel.classList.remove(handoffClass),delete panel.dataset.handoffGeneration)})})}),usesSlideAnimation&&(header.classList.contains("border-bottom")||header.classList.add("active"),header.getAttribute("data-sticky")==="on-scroll-up"&&header.classList.add("open-submenu")),!0},handleStandardMenuEnter:function(targetItem,submenu,header){const outerRect=header.getBoundingClientRect(),innerRect=targetItem.getBoundingClientRect(),heightScrollDown=outerRect.bottom-innerRect.bottom;motion.animate(submenu,{y:["-105%",heightScrollDown],visibility:["hidden","visible"]},{ease:[.7,0,.2,1],duration:.35}),targetItem.classList.add("visible"),header.classList.contains("border-bottom")||header.classList.add("active")},handleMenuEnterWithSearchOpen:function(targetItem,submenu,sectionPbValue){const ps=document.querySelector(".popup-search"),overlay_search=document.querySelector(".overlay_search"),sf=document.querySelector(".search-full");if(!ps||!overlay_search||!sf)return;overlay_search.classList.remove("open");let topCaculate=sf.getBoundingClientRect().bottom+10;Promise.all([motion.animate(ps,{y:[topCaculate,"-105%"],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:.2}),motion.animate(overlay_search,{opacity:[1,0],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:.2})]).then(()=>{setTimeout(()=>{document.documentElement.classList.contains("open-minicart")?document.documentElement.classList.remove("open-search"):(document.documentElement.classList.remove("open-drawer","open-search"),root.style.removeProperty("padding-right")),motion.animate(submenu,{y:["-105%",sectionPbValue],visibility:["hidden","visible"]},{ease:[.7,0,.2,1],duration:.35}),targetItem.classList.add("visible")},20)})},handleMenuExit:function(targetItem,header){const submenu=targetItem.querySelector(".submenu-horizontal");if(!submenu||window.innerWidth<1280)return;const sticky=header?.getAttribute("data-sticky"),outerRect=header.getBoundingClientRect(),innerRect=targetItem.getBoundingClientRect(),heightScrollDown=outerRect.bottom-innerRect.bottom;sticky=="on-scroll-up"&&header.classList.remove("open-submenu"),motion.animate(submenu,{y:[heightScrollDown,"-105%"],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:.4}),targetItem.classList.remove("visible"),header.classList.contains("active")&&header.classList.remove("active")},setupMenuTabSwitching:function(elements){document.querySelectorAll(".menu-mobile-title button").forEach(tabToggle=>{tabToggle.addEventListener("click",e=>{e.preventDefault();const target=e.currentTarget,data=target.dataset.menu;document.querySelectorAll(".menu-mobile-title button").forEach(item=>item.classList.remove("active")),target.classList.add("active"),this.showMenuForTab(data,elements)})})},showMenuForTab:function(tabId,elements){const{horizontalList,categoriesListMenuMobile}=elements,categoriesListMenuVerticalMobile=document.querySelector(".verticalmenu-mobile");horizontalList&&(horizontalList.style.display=tabId!=="horizontal-list"?"none":"block",tabId==="categories-list"?(categoriesListMenuMobile&&(categoriesListMenuMobile.style.display="block"),categoriesListMenuVerticalMobile&&(categoriesListMenuVerticalMobile.style.display="none")):tabId==="verticalmenu-list"?(categoriesListMenuMobile&&(categoriesListMenuMobile.style.display="none"),categoriesListMenuVerticalMobile&&(categoriesListMenuVerticalMobile.style.display="block")):(categoriesListMenuMobile&&(categoriesListMenuMobile.style.display="none"),categoriesListMenuVerticalMobile&&(categoriesListMenuVerticalMobile.style.display="none")))},updateMenuVerticalMobile:function(elements){if(window.innerWidth<=1279.98){const headerVertical=document.querySelector(".header-vertical"),titleVertical=document.querySelector(".verticalmenu-mobile")?.dataset.title,menuMobileTitle=document.querySelector(".menu-mobile-title");if(!headerVertical)return;if(!menuMobileTitle.querySelector('[data-menu="verticalmenu-list"]')){const contentAppendTitleVertical=`
5            <a
6              class="no-underline heading-style py-10"
7              data-menu="verticalmenu-list"
8              role="link"
9              aria-disabled="true"
10            >
11              ${titleVertical}
12            </a>
13          `;menuMobileTitle.insertAdjacentHTML("beforeend",contentAppendTitleVertical);const newTabButton=menuMobileTitle.querySelector('[data-menu="verticalmenu-list"]');newTabButton&&newTabButton.addEventListener("click",e=>{e.preventDefault(),document.querySelectorAll(".menu-mobile-title button").forEach(item=>item.classList.remove("active")),newTabButton.classList.add("active"),this.showMenuForTab("verticalmenu-list",elements)})}const wrapperVerticalmenu=document.querySelector(".verticalmenu-mobile"),navigationMenuContent=document.querySelector(".navigation__menu-content-mobile");if(!wrapperVerticalmenu||!navigationMenuContent)return;if(!navigationMenuContent.querySelector(".verticalmenu-mobile")){const cloneWrapper=wrapperVerticalmenu.cloneNode(!0);navigationMenuContent.appendChild(cloneWrapper)}}},updateMenuTabState:function(elements){const windowWidth=window.innerWidth,{horizontalList,categoriesListMenu,categoriesListMenuVertical,categoriesListMenuMobile,categoriesListMenuVerticalMobile}=elements;!horizontalList||!categoriesListMenu||(windowWidth<=1279.98?((categoriesListMenu?.classList.contains("active")||categoriesListMenuVertical?.classList.contains("active"))&&(horizontalList.style.display="none"),categoriesListMenuVerticalMobile&&categoriesListMenuVertical?.classList.contains("active")&&(categoriesListMenuVerticalMobile.style.display="block")):(categoriesListMenuMobile&&categoriesListMenu?.classList.contains("active")&&(categoriesListMenuMobile.style.display="none"),categoriesListMenuVerticalMobile&&categoriesListMenuVertical?.classList.contains("active")&&(categoriesListMenuVerticalMobile.style.display="none"),(categoriesListMenu?.classList.contains("active")||categoriesListMenuVertical?.classList.contains("active"))&&(horizontalList.style.display="inline-flex")))},initMainMenu:function(){const header=document.querySelector("header");header&&(this.setupNavToggle(),this.setupMenuMouseEvents(),this.setupHeaderAttributes(),this.initStickyHeader(header),this.initSubMenu())},setupNavToggle:function(){const mobileNavigation=document.getElementById("mobile-navigation"),focusableSelector='a[href], area[href], button:not([disabled]), input:not([disabled]):not([type="hidden"]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not
13([tabindex="-1"])',getFocusableElements=()=>mobileNavigation?window.A11yFocusUtils?.getFocusableElements?window.A11yFocusUtils.getFocusableElements(mobileNavigation):Array.from(mobileNavigation.querySelectorAll(focusableSelector)).filter(element=>{if(element.closest('[aria-hidden="true"]')||element.hasAttribute("disabled"))return!1;if(typeof element.checkVisibility=="function")return element.checkVisibility({checkVisibilityCSS:!0,contentVisibilityAuto:!0});const style=window.getComputedStyle(element);return style.display!=="none"&&style.visibility!=="hidden"&&element.offsetParent!==null&&element.getClientRects().length>0}):[],setNavigationState=isOpen=>{mobileNavigation&&(mobileNavigation.setAttribute("aria-hidden",String(!isOpen)),mobileNavigation.inert=!isOpen)},removeFocusTrap=()=>{const trap=window.__plaudNavFocusTrap;trap?.handler&&(document.removeEventListener("keydown",trap.handler,!0),trap.handler=null)},addFocusTrap=()=>{if(!mobileNavigation||(window.__plaudNavFocusTrap||={handler:null,restoreTarget:null},window.__plaudNavFocusTrap.handler))return;const handler=event=>{if(!document.documentElement.classList.contains("nav-open"))return;if(event.key==="Escape"){event.preventDefault(),closeNavigation();return}if(event.key!=="Tab")return;const focusable=getFocusableElements();if(!focusable.length){event.preventDefault(),mobileNavigation.focus();return}const first=focusable[0],last=focusable[focusable.length-1];mobileNavigation.contains(document.activeElement)?event.shiftKey&&document.activeElement===first?(event.preventDefault(),last.focus()):!event.shiftKey&&document.activeElement===last&&(event.preventDefault(),first.focus()):(event.preventDefault(),first.focus())};window.__plaudNavFocusTrap.handler=handler,document.addEventListener("keydown",handler,!0)},closeNavigation=target=>{const mainMenu=document.querySelector(".navigation.horizontal"),restoreTarget=target||window.__plaudNavFocusTrap?.restoreTarget||document.querySelector(".nav-toggle");root.style.removeProperty("padding-right"),document.documentElement.classList.remove("nav-open","open-drawer"),restoreTarget?.classList.remove("open"),restoreTarget?.setAttribute("aria-expanded","false"),removeFocusTrap(),setNavigationState(!1),restoreTarget?.focus(),window.__plaudNavFocusTrap&&(window.__plaudNavFocusTrap.restoreTarget=null)};window.__plaudCloseNavigation=closeNavigation,setNavigationState(document.documentElement.classList.contains("nav-open")),document.querySelectorAll(".nav-toggle").forEach(navToggle=>{navToggle.dataset.navToggleBound!=="true"&&(navToggle.dataset.navToggleBound="true",navToggle.setAttribute("aria-controls","mobile-navigation"),navToggle.setAttribute("aria-expanded",document.documentElement.classList.contains("nav-open")?"true":"false"),navToggle.addEventListener("click",e=>{const target=e.currentTarget,main_menu=document.querySelector(".navigation.horizontal");document.documentElement.classList.contains("nav-open")?closeNavigation(target):(root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"),document.documentElement.classList.add("nav-open","open-drawer"),target.classList.add("open"),target.setAttribute("aria-expanded","true"),window.__plaudNavFocusTrap||={handler:null,restoreTarget:null},window.__plaudNavFocusTrap.restoreTarget=target,setNavigationState(!0),addFocusTrap(),requestAnimationFrame(()=>getFocusableElements()[0]?.focus({preventScroll:!0})))}))})},setupMenuMouseEvents:function(){window.innerWidth<=1279||document.querySelectorAll("li.menu-parent .submenu").forEach(menuItem=>{menuItem.addEventListener("mouseenter",e=>{e.currentTarget.closest(".menu-parent").classList.add("active-submenu")}),menuItem.addEventListener("mouseleave",e=>{e.currentTarget.closest(".menu-parent").classList.remove("active-submenu")})})},setupHeaderAttributes:function(){let announcement_bar=document.querySelector(".section-announcement-bar")?.clientHeight||0,top_bar=document.querySelector(".section-top-bar")?.clientHeight||0,headerpage=document.querySelector("header")?.clientHeight||0;document.querySelector("body").setAttribute("style",`--height-bar: ${announcement_bar}px; --height-header: ${headerpage}px; --height-topbar: ${top_bar}px`)},initStickyHeader:function(header){const sticky=header?.getAttribute("data-sticky"),sticky_mobile=header?.getAttribute("data-sticky-mobile");if(sticky==="none"||sticky_mobile==="false"&&window.innerWidth<1280||document.querySelectorAll(".category-tab").length>0)return;const headerSpaceH=document.getElementById("header-sticky")?.offsetHeight||0,announcement_bar=document.querySelector(".section-announcement-bar")?.clientHeight||0,top_bar=document.querySelector(".section-top-bar")?.clientHeight||0,headerh=announcement_bar+top_bar+headerSpaceH;this.lastScrollPosition=0;const sec_header=header.closest(".section-header");sec_header&&(sticky==="on-scroll-up"&&sec_header.classList.add("scroll-up"),window.addEventListener("scroll",()=>{header.matches(":hover")||this.updateStickyHeader(sec_header,sticky,headerh)}))},updateStickyHeader:function(sec_header,sticky,headerh){let wpy=window.scrollY;sticky==="always"?wpy>headerh?sec_header.classList.add("shopify-section-header-sticky","animate"):sec_header.classList.remove("shopify-section-header-sticky","animate"):wpy>0?wpy>headerh?(sec_header.classList.add("scr-pass-header"),wpy>this.lastScrollPosition?sec_header.classList.add("shopify-section-header-hidden"):(sec_header.classList.remove("shopify-section-header-hidden"),sec_header.classList.add("animate")),sec_header.classList.add("header-sticky","shopify-section-header-sticky"),this.lastScrollPosition=wpy):(sec_header.classList.remove("header-sticky","scr-pass-header"),this.lastScrollPosition=0):sec_header.classList.remove("shopify-section-header-hidden","header-sticky","animate","shopify-section-header-sticky")},initSubMenu:function(){!document.querySelector(".navigation.horizontal")||window.innerWidth<=1279||document.querySelector("header.site-header--new")||(this.addCssSubMenu(),window.addEventListener("resize",()=>{window.innerWidth>1279&&this.addCssSubMenu()}))},addCssSubMenu:function(){const bodyWidth=document.documentElement.clientWidth||document.body.clientWidth,header=document.querySelector("header"),submenu_center=document.querySelector(".submenu-ce
13nter"),width_sub_center=800;if(!header||bodyWidth<1279)return;const padding=30;document.querySelectorAll(".horizontal-list .mega-menu-fix-width").forEach(submenu=>{if(submenu_center){const submenu_data=submenu.getBoundingClientRect(),width=submenu_data.width,left=submenu_data.left,right=submenu_data.right;if(width_sub_center<=width){const left_style=(left-(right-bodyWidth))/2;submenu.style.left=left_style+"px"}}else{const elementWidth=submenu.clientWidth,elementLeft=submenu.offsetLeft;if(bodyWidth-(elementWidth+elementLeft)<0){let left=bodyWidth-(elementWidth+elementLeft);left=left+elementLeft-padding,elementLeft<0&&(left=0),submenu.style.left=left+"px"}}})},initVerticalMenu:function(){if(!document.querySelector(".verticalmenu-html"))return;const verticalMenu=document.querySelector(".vertical-menu");verticalMenu&&(verticalMenu.addEventListener("mouseenter",function(){setTimeout(function(){verticalMenu.classList.add("open-vertical")},150)}),verticalMenu.addEventListener("mouseleave",function(){verticalMenu.classList.remove("open-vertical")}),this.setupSimpleHoverIntent(1,".menu-parent__vertical"))},initMobileMenu:function(){}}})();BlsMainMenuShopify.init();var BlsSearchShopify=(function(){return{init:function(){var predictive=document.querySelector("#predictive-search");predictive&&this.setupEventListeners();const form=document.querySelector("#search-form");document.querySelectorAll(".top-search-toggle").forEach(navToggle=>{navToggle.onclick=e=>{const target=e.currentTarget;form.classList.contains("open")?(form.classList.remove("open"),target.classList.remove("open"),setTimeout(()=>{document.documentElement.classList.remove("open-drawer"),root.style.removeProperty("padding-right")},300),document.documentElement.classList.remove("open-search")):(form.classList.add("open"),target.classList.add("open"),document.documentElement.classList.add("open-drawer","open-search"),root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"),setTimeout(function(){form.querySelector('input[type="search"]').focus()},100))}}),document.querySelectorAll(".btn-search-close").forEach(navToggle=>{navToggle.onclick=()=>{form.classList.remove("open"),document.querySelector(".dropdown-toggle .top-search-toggle")?.classList.remove("open"),document.documentElement.classList.remove("open-search"),setTimeout(()=>{document.documentElement.classList.remove("open-drawer"),root.style.removeProperty("padding-right")},300)};const overlay_search=document.querySelector(".overlay_search");overlay_search&&(overlay_search.onclick=()=>{navToggle.click()})});const sf=document.querySelector(".search-full");if(sf){const hs=sf.closest(".header_search");var unSubcribeCloseCanvas;unSubcribeCloseCanvas&&(unSubcribeCloseCanvas(),unSubcribeCloseCanvas=null),unSubcribeCloseCanvas=subscribe("closeCanvas",data=>{if(document.documentElement.classList.contains("open-search")){const width=window.innerWidth,ps=document.querySelector(".popup-search");width>=767.95&&ps&&this.closeDefaultSearch()}}),this._boundHandleClickSearch=this._boundHandleClickSearch||this.handleClickSearch.bind(this),document.removeEventListener("click",this._boundHandleClickSearch),document.addEventListener("click",this._boundHandleClickSearch)}},handleClickSearch:function(e){const hs=document.querySelector(".search-full").closest(".header_search"),ehs=e.target.closest(".header_search"),search_container=e.target.closest("header-search");if(ehs||search_container){const ps=document.querySelector(".popup-search"),width=window.innerWidth;if(ps){if(ps.classList.add("popup-search-show"),document.documentElement.classList.contains("open-search"))return;width>=767.95&&this.openDefaultSearch()}}else hs&&document.documentElement.classList.contains("open-search")&&(window.innerWidth>=767.95?this.closeDefaultSearch():(document.querySelector("#search-form").classList.remove("open"),document.documentElement.classList.contains("open-minicart")?document.documentElement.classList.remove("open-search"):(document.documentElement.classList.remove("open-drawer","open-search"),root.style.removeProperty("padding-right"))))},openDefaultSearch:function(){const headerNavigation=document.querySelector(".header-bottom__navigation"),headerTopActions=document.querySelector(".header-top__actions"),headerWrapper=document.querySelector("header");if(headerNavigation&&headerWrapper){const headerNavigationHeight=headerNavigation.offsetHeight;headerNavigation.style.opacity="0",headerNavigation.style.transition="opacity 0.3s ease",headerNavigation.style.display="none",headerWrapper.style.marginBottom=`${headerNavigationHeight}px`}const overlay_search=document.querySelector(".overlay_search");overlay_search.classList.add("open");const containsHeaderLayoutOne=document.querySelector(".header__layout-1"),containsHeaderLayoutTwo=document.querySelector(".header__layout-2"),containsHeaderLayoutThree=document.querySelector(".header__layout-3");let topCaculate=document.querySelector(containsHeaderLayoutOne?"header":containsHeaderLayoutTwo?"header-inner":containsHeaderLayoutThree?".header-mega-store":".
13search-full").getBoundingClientRect().bottom;const ps=document.querySelector(".popup-search");document.documentElement.classList.add("open-drawer"),root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"),Promise.all([motion.animate(ps,{y:["-105%",topCaculate],visibility:["hidden","visible"]},{ease:[.7,0,.2,1],duration:.4}),motion.animate(overlay_search,{opacity:[0,1],visibility:["hidden","visible"]},{ease:[.7,0,.2,1],duration:.4})]).then(()=>{setTimeout(()=>{document.documentElement.classList.add("open-search")},20)})},closeDefaultSearch:function(){const headerNavigation=document.querySelector(".header-bottom__navigation"),headerWrapper=document.querySelector("header"),ps=document.querySelector(".popup-search"),sf=document.querySelector(".search-full"),overlay_search=document.querySelector(".overlay_search");overlay_search.classList.remove("open"),ps.classList.remove("popup-search-show");let topCaculate=sf.getBoundingClientRect().bottom+10;headerNavigation&&headerWrapper&&(headerNavigation.style.opacity="",headerNavigation.style.transition="",headerNavigation.style.display="",headerWrapper.style.marginBottom=""),Promise.all([motion.animate(ps,{y:[topCaculate,"-105%"],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:.4}),motion.animate(overlay_search,{opacity:[1,0],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:.4})]).then(()=>{setTimeout(()=>{document.documentElement.classList.contains("open-minicart")?document.documentElement.classList.remove("open-search"):(document.documentElement.classList.remove("open-drawer","open-search"),root.style.removeProperty("padding-right"))},20)})},setupEventListeners:function(){const input=document.querySelector('input[type="search"]'),form=document.querySelector("form.search");!input||!form||(form.addEventListener("submit",this.onFormSubmit.bind(this)),input.addEventListener("input",this.debounce(event=>{this.onChange(event)},300).bind(this)),input.addEventListener("focus",this.onFocus.bind(this)),document.addEventListener("focusout",this.onFocusOut.bind(this)),input.addEventListener("keydown",this.onKeydown.bind(this)))},debounce:function(fn,wait){let t;return(...args)=>{clearTimeout(t),t=setTimeout(()=>fn.apply(this,args),wait)}},getQuery:function(){return document.querySelector('input[type="search"]').value.trim()},onChange:function(){const searchTerm=this.getQuery();if(!searchTerm.length){this.close(!0);return}this.getSearchResults(searchTerm)},onFormSubmit:function(event){const selectedOption=document.querySelector('#predictive-search [role="option"][aria-selected="true"]');(!this.getQuery().length||selectedOption)&&event.preventDefault()},onFocus:function(){const searchTerm=this.getQuery();searchTerm.length&&(document.querySelector("#predictive-search").classList.contains("results")?this.open():this.getSearchResults(searchTerm))},onFocusOut:function(){setTimeout(()=>{document.contains(document.activeElement)||this.close()})},onKeydown:function(event){if(!this.getQuery().length){this.close(!0);return}switch(event.code){case"ArrowUp":if(!this.isOpen)return;event.preventDefault(),this.switchOption("up");break;case"ArrowDown":if(!this.isOpen)return;event.preventDefault(),this.switchOption("down");break;case"Enter":this.selectOption()&&event.preventDefault();break}},switchOption:function(direction){if(!this.isOpen)return;const listbox=document.querySelector("#predictive-search [data-predictive-search]");if(!listbox)return;const allElements=Array.from(listbox.querySelectorAll('[role="option"]'));if(!allElements.length)return;const selectedElement=allElements.find(option=>option.getAttribute("aria-selected")==="true"),selectedIndex=allElements.indexOf(selectedElement);let activeIndex;direction==="up"?activeIndex=selectedIndex<=0?allElements.length-1:selectedIndex-1:activeIndex=selectedIndex===-1||selectedIndex===allElements.length-1?0:selectedIndex+1;const activeElement=allElements[activeIndex],statusElement=listbox.querySelector("[data-predictive-status]");statusElement&&(statusElement.textContent=""),activeElement.id||(activeElement.id=`predictive-search-option-${activeIndex+1}
13`),allElements.forEach(option=>{option.setAttribute("aria-selected",option===activeElement?"true":"false")}),document.querySelector('input[type="search"]').setAttribute("aria-activedescendant",activeElement.id)},selectOption:function(){const selectedOption=document.querySelector('#predictive-search [role="option"][aria-selected="true"]');if(!selectedOption)return!1;const selectedAction=selectedOption.matches("a[href], button:not([disabled])")?selectedOption:selectedOption.querySelector("a[href], button:not([disabled])");return selectedAction?(selectedAction.click(),!0):!1},getSearchResults:function(searchTerm){this._cachedResults||(this._cachedResults={});const queryKey=searchTerm.replace(" ","-").toLowerCase();if(this.setLiveRegionLoadingState(),this._cachedResults[queryKey]){this.renderSearchResults(this._cachedResults[queryKey]);return}var loading=document.querySelector(".search__loading-state"),collection_suggest=document.querySelector(".collection-suggest");collection_suggest&&(collection_suggest.style.display="none");var section_id="search-predictive-grid";if(document.querySelector(".predictive_search_suggest"))var search_url=`${routes?.predictive_search_url}?q=${encodeURIComponent(searchTerm)}&resources[options][fields]=title,tag,vendor,product_type,variants.title,variants.sku&resources[options][prefix]=last&resources[options][unavailable_products]=last&resources[type]=query,product,collection,page,article&section_id=${section_id}`;else var search_url=`${routes.search_url}?q=${encodeURIComponent(searchTerm)}&options[prefix]=last&options[unavailable_products]=last&type=query,product,collection,page,article&section_id=${section_id}`;fetch(`${search_url}`).then(response=>{if(!response.ok){var error=new Error(response.status);throw this.close(),error}return response.text()}).then(text=>{const resultsMarkup=new DOMParser().parseFromString(text,"text/html").querySelector("#shopify-section-"+section_id).innerHTML;this._cachedResults[queryKey]=resultsMarkup,this.renderSearchResults(resultsMarkup),BlsLazyloadImg.init()}).catch(error=>{throw this.close(),error})},setLiveRegionLoadingState:function(){document.querySelector("#search_mini_form").classList.add("loading"),document.querySelector("#predictive-search").classList.add("loading")},setLiveRegionResults:function(){document.querySelector("#search_mini_form").classList.remove("loading"),document.querySelector("#predictive-search").classList.remove("loading")},renderSearchResults:function(resultsMarkup){document.querySelector("[data-predictive-search]").innerHTML=resultsMarkup,document.querySelector('input[type="search"]').removeAttribute("aria-activedescendant"),document.querySelector("#predictive-search").classList.add("results"),document.querySelector(".search-not-sugges")&&(document.querySelector(".search-not-sugges").classList.remove("search-hidden"),document.documentElement.classList.add("open-drawer","open-search"),root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"));const quick_search=document.querySelector("#quick-search");quick_search&&quick_search.classList.add("hidden"),this.setLiveRegionResults(),this.open()},open:function(){document.querySelector('input[type="search"]').setAttribute("aria-expanded",!0),this.isOpen=!0},close:function(clearSearchTerm=!1){if(clearSearchTerm){document.querySelector('input[type="search"]').value="",document.querySelector("#predictive-search").classList.remove("results"),document.querySelector(".search-not-sugges")&&(document.querySelector(".search-not-sugges").classList.add("search-hidden"),document.documentElement.classList.remove("open-drawer","open-search"),root.style.removeProperty("padding-right"));const quick_search=document.querySelector("#quick-search");quick_search&&quick_search.classList.remove("hidden")}const selected=document.querySelector('#predictive-search [aria-selected="true"]');selected&&selected.setAttribute("aria-selected",!1),document.querySelector('input[type="search"]').removeAttribute("aria-activedescendant"),document.querySelector('input[type="search"]').setAttribute("aria-expanded",!1),this.resultsMaxHeight=!1,document.querySelector("[data-predictive-search]").removeAttribute("style"),this.isOpen=!1}}})();BlsSearchShopify.init();class HeaderSearch extends HTMLElement{constructor(){super(),this.init()}init(){const _this=this,header=document.querySelector("header"),button_search_default=document.querySelector("#button_search_default");if(header.classList.contains("popup-search-mobile")&&this.classList.contains("search_type_default")){let sectionId="top-search";window.innerWidth<=767&&(_this.fetchUrl(`${window.location.pathname}?section_id=${sectionId}&type=popup&ajax=1`,"popup"),button_search_default.classList.add("top-search-toggle"));let width=window.innerWidth;window.addEventListener("resize",function(){const newWidth=window.innerWidth;if(newWidth<=767&&width>767){const overlay_search=document.querySelector(".overlay_search");overlay_search.style.visibility="hidden",overlay_search.style.opacity=0,overlay_search.classList.remove("open"),_this.fetchUrl(`${window.location.pathname}?section_id=${sectionId}&type=popup&ajax=1`,"popup"),button_search_default.classList.add("top-search-toggle")}if(newWidth>767&&width<=767){button_search_default.classList.remove("top-search-toggle"),_this.fetchUrl(`${window.location.pathname}?section_id=${sectionId}&type=default&ajax=1`);var popup_search_form_popup=document.querySelector(".search__type-popup");popup_search_form_popup&&(popup_search_form_popup.style.display="none")}width=newWidth})}else{let width=window.innerWidth;window.addEventListener("resize",function(){const newWidth=window.innerWidth;var popup_search_form_popup=document.querySelector(".search__type-popup");newWidth<=767&&width>767&&popup_search_form_popup&&!document.documentElement.classList.contains("open-search")&&(popup_search_form_popup.style.display="none",setTimeout(()=>{popup_search_form_popup.style.display="block"},20)),newWidth>767&&width<=767&&popup_search_form_popup&&!document.documentElement.classList.contains("open-search")&&(popup_search_form_popup.style.display="none",setTimeout(()=>{popup_search_form_popup.style.display="block"},20)),width=newWidth})}}fetchUrl(url,type="default"){var input=document.querySelector(".search__input");type=="default"?input.setAttribute("type","search"):input.removeAttribute("type"),fetch(url).then(response=>response.text()).then(responseText=>{const newSection=new DOMParser().parseFromString(responseText,"text/html").querySelector("header-search").innerHTML;document.querySelector("header-search").innerHTML=newSection}).catch(e=>{throw e}).finally(()=>{document.documentElement.classList.contains("open-search")&&document.documentElement.classList.remove("open-search","open-drawer"),BlsSearchShopify.init()})}}customElements.define("header-search",HeaderSearch);class CartNotification extends HTMLElement{constructor(){super(),this.notification=document.getElementById("minicart_wrapper"),this.giftwrap=document.querySelector(".add-giftwrap"),this.cartCountDown=document.querySelector(".cart-countdown-time"),this.minicart__wrapper=this.notification.querySelector(".minicart__wrapper"),this.cartUpsellBeside=document.querySelector(".recommendations-beside"),this.startTime=Date.now(),document.querySelectorAll(".cart-count").forEach(el=>{el.hasAttribute("aria-live")||el.setAttribute("aria-live","polite"),el.hasAttribute("aria-atomic")||el.setAttribute("aria-atomic","true")}),this.querySelectorAll(".minicart__wrapper .close-cart-button").forEach(closeButton=>closeButton.addEventListener("click",this.close.bind(this))),document.querySelectorAll(".minicart__action").forEach(navToggle=>{navToggle.addEventListener("click",e=>{e.preventDefault(),this.notification.querySelector(".minicart__wrapper").classList.contains("open")?this.close():this.open()},!1)}),this.currentItemCount=Array.from(this.querySelectorAll('[name="updates[]"]')).reduce((total,quantityInput)=>total+parseInt(quantityInput.value),0),this.onBodyClick=this.handleBodyClick.bind(this),this.debouncedOnChange=debounce(event=>{this.onChange(event)},300),this.notification.addEventListener("change",this.debouncedOnChange.bind(this)),this.cartAction(),this.addonsUpdate()}handleBodyClick(evt){const target=evt.target;target!=this&&!target.closest(".header__minicart")&&!target.closest("cart-notification")&&!target.closest(".cart-quick-edit-modal")&&!target.closest(".tingle-modal")&&this.close()}cartAction(){const checkoutButton=this.querySelector(".btn-checkout");if(checkoutButton&&!checkoutButton.dataset.handlerAttached){const buttonSpan=checkoutButton.querySelector("span");buttonSpan&&(checkoutButton.dataset.originalText=buttonSpan.textContent),checkoutButton.addEventListener("click",event=>{if(event.preventDefault(),!buttonSpan)return;checkoutButton.setAttribute("disabled",!0),checkoutButton.classList.add("custom-loading");let loadingText="Generating offer";buttonSpan.textContent=loadingText;let dotCount=0;checkoutButton.dataset.intervalId=setInterval(()=>{dotCount=(dotCount+1)%4,buttonSpan.textContent=loadingText+".".repeat(dotCount)}
13,400),setTimeout(()=>{window.location.href="/checkout"},200)}),checkoutButton.dataset.handlerAttached="true"}window.isCheckoutResetAttached||(window.addEventListener("pageshow",event=>{document.querySelectorAll(".btn-checkout.custom-loading").forEach(btn=>{btn.removeAttribute("disabled"),btn.classList.remove("custom-loading"),btn.dataset.intervalId&&(clearInterval(btn.dataset.intervalId),delete btn.dataset.intervalId);const span=btn.querySelector("span");span&&btn.dataset.originalText&&(span.textContent=btn.dataset.originalText)})}),window.isCheckoutResetAttached=!0),this.querySelectorAll(".close-cart").forEach(navToggle=>{navToggle.addEventListener("click",e=>{e.preventDefault(),this.notification.querySelector(".minicart__wrapper").classList.contains("open")&&this.close()},!1)}),this._boundCartAddons=this._boundCartAddons||this.cartAddons.bind(this),this._boundCartAddonsSave=this._boundCartAddonsSave||this.cartAddonsSave.bind(this),this.querySelectorAll(".cart-addons button").forEach(button=>{button.removeEventListener("click",this._boundCartAddons,!1),button.addEventListener("click",this._boundCartAddons,!1)}),document.querySelectorAll(".addon-actions .btn-save").forEach(button=>{button.removeEventListener("click",this._boundCartAddonsSave,!1),button.addEventListener("click",this._boundCartAddonsSave,!1)}),this.querySelectorAll(".add-giftwrap").forEach(giftwrap=>{giftwrap.removeEventListener("click",this.addGiftwrapClick.bind(this),!1),giftwrap.addEventListener("click",this.addGiftwrapClick.bind(this),!1)}),this.querySelectorAll(".addon-actions .btn-cancel").forEach(addonCancel=>{addonCancel.addEventListener("click",e=>{e.preventDefault();const target=e.currentTarget;target.closest(".cart__addon-content").classList.remove("is-open"),target.closest(".minicart__wrapper").querySelector(".open").classList.remove("open")},!1)})}addonsUpdate(){const address_country=document.getElementById("address_country"),address_province=
13document.getElementById("address_province");address_country&&address_province&&new Shopify.CountryProvinceSelector("address_country","address_province",{hideElement:"address_province_container"});const discount_code=document.querySelector(".discount_code"),code=localStorage.getItem("discount_code");code&&discount_code&&(document.querySelector(".discount_code").value=code)}cartAddons(event){event.preventDefault();const target=event.currentTarget,open=target.getAttribute("data-open");if(document.getElementById(open).classList.contains("is-open"))document.getElementById(open).classList.remove("is-open"),target.classList.remove("open");else if(document.getElementById(open).classList.add("is-open"),target.classList.add("open"),open=="shipping"){const address_country=document.getElementById("address_country"),address_province=document.getElementById("address_province");address_country&&address_province&&new Shopify.CountryProvinceSelector("address_country","address_province",{hideElement:"address_province_container"})}}fetchConfig(type="json"){return{method:"POST",headers:{"Content-Type":"application/json",Accept:`application/${type}`}}}cartAddonsSave(event){event.preventDefault();const target=event.currentTarget,action=target.getAttribute("data-action");if(action=="note"){const body=JSON.stringify({note:document.querySelector(".cart-note").value});fetch(`${routes?.cart_update_url}`,{...this.fetchConfig(),body}),document.getElementById(action).classList.remove("is-open"),target.closest(".minicart__wrapper").querySelector(".open").classList.remove("open")}else if(action=="shipping"){var e={};e.zip=document.querySelector("#AddressZip").value||"",e.country=document.querySelector("#address_country").value||"",e.province=document.querySelector("#address_province").value||"",this._getCartShippingRatesForDestination(e)}}_getCartShippingRatesForDestination(event){fetch(`${window.Shopify.routes.root}cart/shipping_rates.json?shipping_address%5Bzip%5D=${event.zip}&shipping_address%5Bcountry%5D=${event.country}&shipping_address%5Bprovince%5D=${event.province}`).then(response=>response.text()).then(state=>{const message=document.querySelector(".addon-message");for(var item of document.querySelectorAll(".addon-message p"))item.remove();const{showDeliveryDays,deliveryDayOne,deliveryDaysOther}=message.dataset,parsedState=JSON.parse(state);if(parsedState&&parsedState.shipping_rates)if(parsedState.shipping_rates.length>0){message.classList.remove("error","warning"),message.classList.add("success");const p=document.createElement("p");p.innerText=cartStrings?.shipping_rate.replace("{{address}}",event.zip+", "+event.country+" "+event.province),message.appendChild(p),parsedState.shipping_rates.map(rate=>{let daysShipping="";if(rate.delivery_days.length>0&&showDeliveryDays=="true"){let typeDay=deliveryDayOne;const day=rate.delivery_days[0],dayAt=rate.delivery_days.at(-1);day>1&&(typeDay=deliveryDaysOther),day===dayAt?daysShipping=`(${day} ${typeDay})`:daysShipping=`(${day} - ${dayAt} ${typeDay})`}const rateNode=document.createElement("p");rateNode.innerHTML=rate.name+": "+Shopify.formatMoney(rate.price,cartStrings?.money_format)+" "+daysShipping,message.appendChild(rateNode)})}else{message.classList.remove("error","success"),message.classList.add("warning");const p=document.createElement("p");p.innerText=cartStrings?.no_shipping,message.appendChild(p)}else message.classList.remove("success","warning"),message.classList.add("error"),Object.entries(parsedState).map(error=>{const message_error=`${error[1][0]}`,p=document.createElement("p");p.innerText=message_error,message.appendChild(p)})}).catch(error=>{throw error})}addGiftwrapClick(event){event.preventDefault();const target=event.currentTarget,variant_id=target.getAttribute("data-variant-id"),config=fetchConfig("json");config.body=JSON.stringify({id:Number(variant_id),quantity:1,sections:this.getSectionsToRender().map(section=>section.id),sections_url:window.location.pathname}),target.classList.add("loading"),fetch(`${routes?.cart_add_url}`,config).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);fetch("/cart.json").then(res=>res.json()).then(cart=>{if(cart.item_count!=null){document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${cart.item_count})`:el.innerHTML=cart.item_count>100?"~":cart.item_count}),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(cart);const cart_free_ship=document.querySelector("free-ship-progress-bar");cart_free_ship&&cart_free_ship.init(cart.items_subtotal_price)}}).catch(error=>{throw error}
13),this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id),html=new DOMParser().parseFromString(parsedState.sections[section.id],"text/html");elementToReplace.innerHTML=html.querySelector("#minicart-form").innerHTML}),this.cartAction()}).catch(e=>{throw e}).finally(()=>{BlsLazyloadImg.init(),document.querySelector(".add-giftwrap").classList.remove("loading")})}onChange(event){event.target.getAttribute("name")=="updates[]"&&this.updateQuantity(event.target.dataset.id,event.target.value,event.target.dataset.value,event.target,document.activeElement.getAttribute("name"))}updateQuantity(id,quantity,currentQuantity,_this,name){quantity=quantity||0;const body=JSON.stringify({id,quantity,sections:this.getSectionsToRender().map(section=>section.id),sections_url:window.location.pathname}),selector=`mini-cart-remove-button[data-index="${id}"]`,cart_select=`minicart-wishlist-action[data-index="${id}"]`,minicart_wishlist_action=this.querySelector(cart_select);minicart_wishlist_action&&minicart_wishlist_action.classList.add("loading");const cart_item=this.querySelector(selector);cart_item.classList.add("loading");const cartRecommend=document.querySelector(".cart-recommend");cartRecommend&&cartRecommend.classList.contains("open")&&cartRecommend.classList.remove("open");const cart_free_ship=document.querySelector("free-ship-progress-bar");fetch(`${routes?.cart_change_url}`,{...fetchConfig(),body}).then(response=>response.text()).then(state=>{const parsedState=JSON.parse(state);if(parsedState.errors){this.updateMessageErrors(id,parsedState.errors,_this);return}if(parsedState.item_count!=null&&(document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${parsedState.item_count})`:el.innerHTML=parsedState.item_count>100?"~":parsedState.item_count}),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(parsedState)),document.querySelector(".quantity__label")){const items=parsedState.items,pro_id=document.querySelector(".quantity__label").getAttribute("data-pro-id");var variant_id,variant_quantity;items.forEach(function(item){if(variant_id=item.variant_id,variant_id==pro_id){document.querySelector(".quantity-cart").innerHTML=item.quantity,document.querySelector(".quantity__label").classList.remove("hidden"),variant_quantity=pro_id;return}}),variant_quantity||(document.querySelector(".quantity-cart").innerHTML=0,document.querySelector(".quantity__label").classList.add("hidden"))}document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(parsedState),parsedState.item_count==0&&this.cartCountDown&&this.cartCountDown.querySelector("countdown-timer").remove(),parsedState.item_count==0&&this.cartUpsellBeside&&this.cartUpsellBeside.classList.contains("is-open")&&this.cartUpsellBeside.classList.remove("is-open"),!parsedState.error&&parsedState.item_count!=null&&this.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id),html=new DOMParser().parseFromString(parsedState.sections[section.id],"text/html");elementToReplace.innerHTML=html.querySelector("#minicart-form").innerHTML,cart_free_ship&&cart_free_ship.init(parsedState.items_subtotal_price)}),this.cartAction()}).catch(e=>{throw e}).finally(()=>{BlsLazyloadImg.init(),cart_item.classList.remove("loading"),minicart_wishlist_action&&minicart_wishlist_action.classList.remove("loading"),setTimeout(()=>{this.cart=document.querySelector("cart-notification")},500);const cartRecommend2=document.querySelector(".cart-recommend");if(cartRecommend2&&!cartRecommend2.classList.contains("hidden-recommend"))if(cartRecommend2.classList.contains("cart-recommend-custom")){const cartUpsellItem=document.querySelectorAll(".cart-upsell-item"),cartUpsellSlide=document.querySelectorAll(".swiper-cart-upsell .swiper-slide");cartUpsellItem.length>0?setTimeout(function(){cartRecommend2.classList.add("open")},800):cartUpsellSlide.length===0&&(cartRecommend2.classList.remove("block"),cartRecommend2.classList.add("hidden"))}else setTimeout(function(){cartRecommend2.classList.add("open")},800)})}updateMessageErrors(line,message,target){const val=target.dataset.value;target.value=val;const lineItemError=document.getElementById(`CartDrawer-LineItemError-${line}`);lineItemError&&(lineItemError.querySelector(".cart-item__error-text").textContent=message)}async open(){if(this.notification.classList.contains("go_to_cart_page"))this.notification.querySelector("a").click();else{this.classList.contains("show_popup")&&(this.cart_icon=document.querySelector("header"),this.minicart__wrapper.style.top=`calc(${this.cart_icon.getBoundingClientRect().bottom}px)`);let delay;document.documentElement.classList.contains("open-search")&&(delay=new Promise(resolve=>
13setTimeout(resolve,650))),delay&&await delay,this.notification.querySelector(".minicart__wrapper").classList.add("open"),this.notification.classList.add("open"),setTimeout(()=>{this.classList.contains("show_popup")||(document.documentElement.classList.add("open-drawer","open-minicart"),this.notification.classList.contains("open_drawer")&&root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"))},100),BlsLazyloadImg.init()}this.notification.addEventListener("transitionend",()=>{this.notification.focus()},{once:!0}),document.body.addEventListener("click",this.onBodyClick)}close(){this.notification.querySelector(".minicart__wrapper").classList.remove("open");const cartRecommend=document.querySelector(".cart-recommend");let time=0;cartRecommend&&cartRecommend.classList.contains("open")&&(time=500,cartRecommend.classList.remove("open")),setTimeout(()=>{this.notification.classList.remove("open"),this.notification.querySelector(".minicart__wrapper").classList.remove("open"),document.documentElement.classList.remove("open-minicart")},time),setTimeout(()=>{root.style.removeProperty("padding-right"),document.documentElement.classList.remove("open-drawer"),document.querySelector("minicart-recommendations-beside")&&document.querySelector("minicart-recommendations-beside").classList.remove("open")},time+550),document.body.removeEventListener("click",this.onBodyClick);for(var item of document.querySelectorAll(".addon"))item.classList.remove("is-open")}getSectionsToRender(){return[{id:"minicart-form"}]}getSectionInnerHTML(html,selector=".shopify-section"){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}setActiveElement(element){this.activeElement=element}}customElements.define("cart-notification",CartNotification);class MinicartItemEdit extends PopupBase{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const key=this.getAttribute("data-key"),quantity=this.getAttribute("data-quantity"),href=this.getAttribute("href"),variant=href.indexOf("?")>-1||href.indexOf("?variant=")>-1||href.indexOf("&variant=")>-1?"&":"/?";fetch(`${window.shopUrl}${href}${variant}section_id=cart-quick-edit`).then(response=>{if(!response.ok){var error=new Error(response.status);throw error}return response.text()}).then(response=>{const resultsMarkup=new DOMParser().parseFromString(response,"text/html").getElementById("shopify-section-cart-quick-edit");this.initPopup(resultsMarkup,`<h3 class="title-popup h5 my-0 px-20 px-md-30 py-20 border-bottom">${this.dataset?.textHeader}</h3>`),typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(resultsMarkup)}).catch(error=>{throw error}).finally(()=>{BlsLazyloadImg.init(),document.querySelector("[data-template-quick-cart-edit]")&&document.querySelector("[data-template-quick-cart-edit]").setAttribute("data-line",key),document.querySelector(".product-form-quick-edit quantity-input input")&&(document.querySelector(".product-form-quick-edit quantity-input input").value=quantity)})})}}customElements.define("minicart-item-edit",MinicartItemEdit);function attachQtyGuard(input,opts={}){if(!input||input.dataset.qtyGuard==="on")return;input.dataset.qtyGuard="on";const fallback=typeof opts.fallback=="function"?opts.fallback:()=>NaN,attrInt=(name,def)=>{if(!input.hasAttribute(name))return def;const n=parseInt(input.getAttribute(name),10);return Number.isFinite(n)?n:def},supportsSelection=()=>{try{return input.selectionStart!==null}catch{return!1}},toAscii=text=>String(text||"").replace(/[\uFF10-\uFF19]/g,c=>String.fromCharCode(c.charCodeAt(0)-65248));let lastGood=input.value,valueAtFocus=input.value,changeSeen=!1;const pendingChange=()=>!changeSeen&&input.value!==valueAtFocus;input.hasAttribute("inputmode")||input.setAttribute("inputmode","numeric");const writeDigits=text=>{text=toAscii(text);const decimal=text.match(/^\s*(\d+)[.,]\d+\s*$/),digits=(decimal?decimal[1]:text).replace(/\D/g,"");if(!digits)return;let inserted=!1;if(supportsSelection())try{input.setRangeText(digits,input.selectionStart,input.selectionEnd,"end"),inserted=!0}catch{inserted=!1}inserted||(input.value=digits),lastGood=input.value,input.dispatchEvent(new Event("input",{bubbles:!0}))},normalize=()=>{const raw=input.value;let v=/^\s*\d+(?:[.,]\d+)?\s*$/.test(raw)?parseInt(raw,10):NaN;const min=attrInt("min",1);let step=attrInt("step",1);step>0||(step=1);let max=attrInt("max",NaN);(!Number.isFinite(max)||max<min)&&(max=999999),Number.isFinite(v)||(v=parseInt(fallback(),10)),Number.isFinite(v)||(v=min),v=Math.floor(v),v<min&&(v=min),v=min+Math.floor((v-min)/step)*step,v>max&&(v=min+Math.floor((max-min)/step)*step);const next=String(v);return lastGood=next,next===raw?!1:(input.value=next,!0)};input.qtyGuardNormalize=normalize;const emitChange=()=>{!opts.ignoreDataValue&&input.dataset.value!==void 0&&input.value===String(input.dataset.value).trim()||input.dispatchEvent(new Event("change",{bubbles:!0}))};input.addEventListener("beforeinput",event=>{const type=event.inputType||"";if(!/^insert(Text|FromPaste|FromDrop|ReplacementText)$/.test(type))return;let text=event.data;text==null&&event.dataTransfer&&(text=event.dataTransfer.getData("text")),!(text==null||!/\D/.test(text))&&(event.preventDefault(),!(/^insert(Text|ReplacementText)$/.test(type)&&!supportsSelection())&&writeDigits(text))}),input.addEventListener("paste",event=>{const clipboard=event.clipboardData||window.clipboardData,text=clipboard?clipboard.getData("text"):"";/\D/.test(text)&&(event.preventDefault(),writeDigits(text))}),input.addEventListener("keydown",event=>{if(!(event.isComposing||event.keyCode===229||event.key==="Unidentified")){if(event.key==="Enter"){normalize(),pe
13ndingChange()&&setTimeout(()=>{pendingChange()&&emitChange()},0);return}event.ctrlKey||event.metaKey||event.key&&event.key.length===1&&!/[\d\uFF10-\uFF19]/.test(event.key)&&event.preventDefault()}}),input.addEventListener("input",()=>{if(input.type==="number"){if(input.validity&&input.validity.badInput){input.value=lastGood;return}lastGood=input.value;return}const raw=input.value,stripped=toAscii(raw).replace(/\D/g,"");if(stripped!==raw){let caret=null;supportsSelection()&&(caret=toAscii(raw.slice(0,input.selectionStart)).replace(/\D/g,"").length),input.value=stripped,caret!==null&&input.setSelectionRange(caret,caret)}lastGood=input.value}),input.addEventListener("focus",()=>{valueAtFocus=input.value,changeSeen=!1,input.validity&&input.validity.badInput||(lastGood=input.value)}),input.addEventListener("blur",()=>{(normalize()||pendingChange())&&emitChange()}),input.addEventListener("change",event=>{changeSeen=!0,normalize()&&(event.stopPropagation(),emitChange())})}class QuantityInput extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
13w Event("change",{bubbles:!0}),attachQtyGuard(this.input,{fallback:()=>this.input.dataset.value}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}quantityUpdateUnsubscriber=void 0;connectedCallback(){this.validateQtyRules(),this.quantityUpdateUnsubscriber=subscribe(PUB_SUB_EVENTS.quantityUpdate,this.validateQtyRules.bind(this))}disconnectedCallback(){this.quantityUpdateUnsubscriber&&this.quantityUpdateUnsubscriber()}onInputChange(){this.validateQtyRules()}onButtonClick(event){event.preventDefault();const previousValue=this.input.value;event.target.name==="plus"||event.target.closest("button").name==="plus"?this.input.stepUp():this.input.stepDown(),previousValue!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}validateQtyRules(){const value=parseInt(this.input.value);if(this.input.min){const min=parseInt(this.input.min);this.querySelector(".quantity__button[name='minus']").classList.toggle("disabled",value<=min)}if(this.input.max){const max=parseInt(this.input.max);this.querySelector(".quantity__button[name='plus']").classList.toggle("disabled",value>=max)}}}customElements.define("quantity-input",QuantityInput);class ProgressBar extends HTMLElement{constructor(){super();const orders=this.dataset.order;this.init(orders)}init(orders){const fe_unavaiable=this.dataset.feUnavaiable,fe_avaiable=this.dataset.feAvaiable,rate=Number(Shopify.currency.rate),min=Number(this.dataset.feAmount);if(!min||!rate)return;const order=Number(orders)/100,min_by_currency=min*rate;order!=null&&(order/min_by_currency*100>100?this.setProgressBar(100):this.setProgressBar(order/min_by_currency*100),this.setProgressBarTitle(order,min_by_currency,fe_unavaiable,fe_avaiable))}setProgressBarTitle(order,min_by_currency,fe_unavaiable,fe_avaiable){const title=this.querySelector(".free-shipping-message");if(title)if(title.classList.remove("opacity-0"),order>=min_by_currency)title.innerHTML=fe_avaiable;else{const ammount="{{ amount }}";title.innerHTML=fe_unavaiable.replace(ammount.trim(),Shopify.formatMoney((min_by_currency-order)*100,cartStrings.money_format))}}setProgressBar(progress){const p=this.querySelector(".progress");p.style.width=progress+"%",progress===100?this.classList.add("cart_shipping_free"):this.classList.remove("cart_shipping_free")}}customElements.define("free-ship-progress-bar",ProgressBar);class OpenChildrenToggle extends HTMLElement{constructor(){super(),this.touchStartX=0,this.touchStartY=0,this.isDragging=!1,this.threshold=10,this.wasToggledByTouch=!1,this.addEventListener("touchstart",this.handleTouchStart.bind(this),{passive:!0}),this.addEventListener("touchmove",this.handleTouchMove.bind(this),{passive:!0}),this.addEventListener("touchend",this.handleTouchEnd.bind(this)),this.addEventListener("click",this.handleClick.bind(this)),this.addEventListener("keydown",this.handleKeyDown.bind(this))}handleTouchStart(e){this.touchStartX=e.touches[0].clientX,this.touchStartY=e.touches[0].clientY,this.isDragging=!1,this.wasToggledByTouch=!1}handleTouchMove(e){if(this.isDragging)return;const deltaX=Math.abs(e.touches[0].clientX-this.touchStartX),deltaY=Math.abs(e.touches[0].clientY-this.touchStartY);(deltaX>this.threshold||deltaY>this.threshold)&&(this.isDragging=!0)}handleTouchEnd(e){this.isDragging||(e.preventDefault(),this.onToggle(),this.wasToggledByTouch=!0)}handleClick(e){if(this.wasToggledByTouch){e.preventDefault(),e.stopPropagation();return}this.onToggle()}handleKeyDown(e){(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),this.onToggle())}onToggle(){const parent=this.parentElement;parent&&(parent.classList.contains("is-open")?(parent.classList.remove("is-open"),this.setAttribute("aria-expanded","false")):(parent.classList.add("is-open"),this.setAttribute("aria-expanded","true")))}}customElements.define("open-children-toggle",OpenChildrenToggle);function handleCustomControlKeydown(event){event.target===event.currentTarget&&(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),event.currentTarget.click())}class CloseMenu extends HTMLElement{constructor(){super(),this.addEventListener("click",this.onClose.bind(this),!1),this.addEventListener("keydown",handleCustomControlKeydown)}onClose(){document.querySelectorAll("menu-item").forEach(item=>{item.classList.remove("is-open")}),window.__plaudCloseNavigation?window.__plaudCloseNavigation():(document.querySelector(".nav-toggle")?.classList.remove("open"),document.documentElement.classList.remove("nav-open"),setTimeout(()=>{document.documentElement.classList.remove("open-drawer"),root.style.removeProperty("padding-right")},400))}}customElements.define("close-menu",CloseMenu);class ReviewProduct extends HTMLElement{constructor(){super(),this.productHandle=this.dataset.productHandle,this.initialized=!1,new IntersectionObserver((entries,observer2)=>{entries[0].isIntersecting&&(this.fetchDataReviewProduct(),observer2.unobserve(this))},{}).observe(this)}fetchDataReviewProduct(){if(this.initialized||!this.classList.contains("review-product-added"))return;this.initialized=!0,this.classList.remove("review-product-added");const reviewJsonEl=this.querySelector(".product-review-json");reviewJsonEl&&(this.innerHTML=reviewJsonEl.innerHTML),this.classList.remove("inline-loading")}}customElements.define("review-product",ReviewProduct);class BackMenu extends HTMLElement{constructor(){super(),this.addEventListener("click",this.onBackMenu.bind(this),!1),this.addEventListener("keydown",handleCustomControlKeydown)}onBackMenu(){let parentMenuItem;this.classList.contains("back-lv1")?parentMenuItem=this.closest(".level-1")?.querySelector("menu-item"):parentMenuItem=this.closest(".level0")?.querySelector("menu-item"),parentMenuItem?.classList.remove("is-open");const toggles=parentMenuItem?Array.from(parentMenuItem.querySelectorAll("open-children-toggle")):[];
13toggles.forEach(toggle=>toggle.setAttribute("aria-expanded","false")),(toggles.find(toggle=>{if(toggle.closest('[hidden], [inert], [aria-hidden="true"]'))return!1;const style=window.getComputedStyle(toggle);return style.display!=="none"&&style.visibility!=="hidden"&&toggle.getClientRects().length>0})||parentMenuItem?.querySelector("a[href]"))?.focus()}}customElements.define("back-menu",BackMenu);var BlsLoginPopup=(function(){return{init:function(){this.showLogin()},clickTab:function(modal){const hidden=document.querySelectorAll("[data-login-hidden]"),show=document.querySelectorAll("[data-login-show]"),iTitle=document.querySelector("#login-popup .login-heading");show.forEach(e=>{var s=e?.dataset.loginShow;e.addEventListener("click",function(el){el.preventDefault(),hidden.forEach(eh=>{var h=eh?.dataset.loginHidden;eh.getAttribute("aria-hidden")==="true"&&s===h?(eh.setAttribute("aria-hidden","false"),iTitle&&(iTitle.innerText=s)):eh.setAttribute("aria-hidden","true")})})})},showLogin:function(){const action=document.querySelector(".action-login-popup"),_this=this;action&&action.addEventListener("click",e=>{e.preventDefault(),_this.fetchDataLogin()})},fetchDataLogin:function(){const url=`${window.location.pathname}?section_id=login-popup`,_this=this;fetch(url).then(response=>response.text()).then(responseText=>{const content=parser.parseFromString(responseText,"text/html").querySelector("#login-popup");if(content){const modal=new tingle.modal({footer:!1,stickyFooter:!1,closeMethods:["overlay","button","escape"],closeLabel:"Close",cssClass:["login-popup-modal"],onOpen:function(){},onClose:function(){},beforeOpen:function(){},beforeClose:function(){return!0}});modal.setContent(content),modal.open(),document.querySelectorAll(".login__popup-button-close").forEach(navToggle=>{navToggle.addEventListener("click",e=>{e.preventDefault(),modal.close()},!1)})}_this.clickTab()}).catch(e=>{throw e})}}})();BlsLoginPopup.init();class BackToTop extends HTMLElement{constructor(){super(),this.addEventListener("click",this.backToTop.bind(this),!1)}connectedCallback(){this._scrollHandler=this.updateScrollPercentage.bind(this),window.addEventListener("scroll",this._scrollHandler)}disconnectedCallback(){window.removeEventListener("scroll",this._scrollHandler)}backToTop(){(document.documentElement.scrollTop>0||document.body.scrollTop>0)&&window.scrollTo({top:0,behavior:"smooth"})}updateScrollPercentage(){const scrollHeight=document.documentElement.scrollHeight||document.body.scrollHeight,scrollTop=document.documentElement.scrollTop||document.body.scrollTop,clientHeight=document.documentElement.clientHeight||document.body.clientHeight,scrollPercentage=scrollTop/(scrollHeight-clientHeight)*100;this.style.setProperty("--height",scrollPercentage.toFixed(2)+"%"),scrollTop>200?this.classList.add("show"):this.classList.remove("show")}}customElements.define("back-to-top",BackToTop);class LocalizationForm extends HTMLElement{constructor(){super(),this.elements={input:this.querySelector('input[name="language_code"], input[name="country_code"]'),button:this.querySelector(".button-localization"),panel:this.querySelector("ul")},this.elements.button&&(this.elements.button.addEventListener("click",this.openSelector.bind(this)),this.elements.button.addEventListener("focusout",this.closeSelector.bind(this))),this.addEventListener("keyup",this.onContainerKeyUp.bind(this));const links=this.querySelectorAll("a");links&&links.length>0&&links.forEach(item=>item.addEventListener("click",this.onItemClick.bind(this))),this.onBodyClick=this.handleBodyClick.bind(this)}handleBodyClick(evt){const target=evt.target;target!=this&&!target.closest("localization-form")&&this.hidePanel()}hidePanel(){document.body.removeEventListener("click",this.onBodyClick),this.elements.button.classList.remove("open"),this.elements.button.setAttribute("aria-expanded","false")}onContainerKeyUp(event){event.code.toUpperCase()==="ESCAPE"&&(this.hidePanel(),this.elements.button.focus())}onItemClick(event){event.preventDefault();const form=this.querySelector("form");this.elements.input.value=event.currentTarget.dataset.value,form&&form.submit()}openSelector(){if(this.elements.button.classList.contains("open"))this.hidePanel();else{document.body.addEventListener("click",this.onBodyClick),this.elements.button.focus();for(var item of document.querySelectorAll(".button-localization"))item.classList.remove("open");this.elements.button.classList.add("open"),this.elements.button.setAttribute("aria-expanded","true")}}
13closeSelector(event){const shouldClose=event.relatedTarget&&event.relatedTarget.nodeName==="BUTTON";(event.relatedTarget===null||shouldClose)&&this.hidePanel()}}customElements.define("localization-form",LocalizationForm);class CollapsibleBlock extends HTMLElement{constructor(){super();const _this=this;_this.querySelectorAll(".collapsible-heading").forEach(trigger=>{trigger.hasAttribute("aria-controls")&&trigger.setAttribute("aria-expanded",_this.classList.contains("active")?"true":"false"),trigger.addEventListener("click",e=>{const target=e.currentTarget,footerContent=target.parentElement.querySelector(".collapsible-content");if(!footerContent)return;const collectionFilter=_this.closest(".collection-filter.horizontal"),shouldExpand=!_this.classList.contains("active");collectionFilter&&window.innerWidth>1024?(collectionFilter.querySelectorAll("collapsible-block.active").forEach(collapsible=>{collapsible!==_this&&this.setExpanded(collapsible,!1)}),this.setExpanded(_this,shouldExpand)):(slideAnime({target:footerContent,animeType:"slideToggle"}),this.setExpanded(_this,shouldExpand)),target.hasAttribute("aria-controls")||target.setAttribute("aria-expanded",_this.classList.contains("active")?"true":"false")}),trigger.addEventListener("keydown",e=>{const collectionFilter=_this.closest(".collection-filter.horizontal");e.key==="Escape"&&collectionFilter&&window.innerWidth>1024&&_this.classList.contains("active")&&(e.preventDefault(),this.setExpanded(_this,!1),trigger.focus())})}),this._bodyClickHandler=this.handleBodyClick.bind(this),document.body.addEventListener("click",this._bodyClickHandler),this.classList.contains("collection")&&(this.actionInMobile(),this._resizeHandler=()=>{this.actionInMobile()},window.addEventListener("resize",this._resizeHandler))}disconnectedCallback(){document.body.removeEventListener("click",this._bodyClickHandler),this._resizeHandler&&window.removeEventListener("resize",this._resizeHandler)}setExpanded(collapsible,expanded){collapsible.classList.toggle("active",expanded);const trigger=collapsible.querySelector(".collapsible-heading[aria-controls]");trigger&&trigger.setAttribute("aria-expanded",expanded?"true":"false")}actionInMobile(){var _this=this,width=window.innerWidth;if(width<=1024){const footerContent=_this.querySelector(".collapsible-content");footerContent&&(footerContent.style.display="block"),this.setExpanded(_this,!0)}}handleBodyClick(evt){const target=evt.target,collectionFilter=this.closest(".collection-filter.horizontal");target!=this&&!target.closest("collapsible-block")&&collectionFilter&&window.innerWidth>1024&&collectionFilter.querySelectorAll("collapsible-block").forEach(collapsible=>{this.setExpanded(collapsible,!1)})}}customElements.define("collapsible-block",CollapsibleBlock);class StickyElement extends HTMLElement{constructor(){super(),this.collapsibleHeading=this.querySelector(".collapsible-bundle"),this.contentWrapper=this.querySelector(".bundle-items__wrapper"),this.isOpen=!0,this.isMobile=window.innerWidth<=1024,this.init()}init(){this.isMobile&&this.setupCollapsible(),window.addEventListener("resize",this.onResize.bind(this))}setupCollapsible(){!this.collapsibleHeading||!this.contentWrapper||(this.isMobile&&(this.isOpen=!1,this.contentWrapper.style.display="none",this.classList.remove("opened")),this.collapsibleHeading.hasEventListener||(this.collapsibleHeading.hasEventListener=!0,this.collapsibleHeading.addEventListener("click",this.toggleCollapse.bind(this))))}toggleCollapse(event){this.isMobile&&(event.preventDefault(),this.isOpen=!this.isOpen,slideAnime({target:this.contentWrapper,animeType:"slideToggle",parent:this}))}onResize(){const wasMobile=this.isMobile;this.isMobile=window.innerWidth<=1024,wasMobile!==this.isMobile&&(this.isMobile?this.setupCollapsible():this.contentWrapper&&(this.contentWrapper.style.display="block",this.contentWrapper.style.height="auto"))}showContent(){this.isMobile&&!this.isOpen&&this.contentWrapper&&(this.isOpen=!0,slideAnime({target:this.contentWrapper,animeType:"slideDown",parent:this}),this.classList.add("opened"))}}customElements.define("sticky-element",StickyElement);class AnnouncementBar extends HTMLElement{constructor(){super();const _this=this,close=_this.querySelector(".announcement-bar-close");close&&close.addEventListener("click",e=>{slideAnime({target:_this,animeType:"slideToggle"}),sessionStorage.setItem("announcement_bar","false")})}}customElements.define("announcement-bar",AnnouncementBar);class VideoSection extends HTMLElement{constructor(){super(),this.video=this.querySelector("video"),this.btn=this.querySelector(".custom-play-pause-btn"),this.playIcon=this.querySelector(".play-icon"),this.pauseIcon=this.querySelector(".pause-icon"),this.thumb=this.querySelector(".video-thumbnail"),this.video_iframe=this.querySelector(".video-has-bg iframe"),this.initCustomControls(),this.init()}ensureLazySourcesLoaded(){const video=this.video;
13if(!video)return Promise.resolve();video.dataset.poster&&(video.poster=video.dataset.poster,video.removeAttribute("data-poster"));const sources=video.querySelectorAll("source");let hadLazy=!1;return sources.forEach(source=>{const realSrc=source.getAttribute("data-video-src")||source.getAttribute("data-src")||source.getAttribute("srcset");realSrc&&(source.src=realSrc,source.removeAttribute("data-video-src"),source.removeAttribute("data-src"),source.removeAttribute("srcset"),hadLazy=!0)}),hadLazy||video.classList.contains("lazy-video-item")?(video.classList.remove("lazy-video-item"),video.load(),new Promise(resolve=>{const done=()=>resolve();if(video.readyState>=2){done();return}video.addEventListener("loadeddata",done,{once:!0}),video.addEventListener("error",done,{once:!0}),setTimeout(done,8e3)})):Promise.resolve()}initCustomControls(){!this.video||!this.btn||(this.btn.addEventListener("click",()=>{this.video.paused?this.ensureLazySourcesLoaded().then(()=>{this.video.muted=!1;const p=this.video.play();p!==void 0&&p.catch(()=>{})}):this.video.pause()}),this.video.addEventListener("play",()=>this.updateIcons(!0)),this.video.addEventListener("pause",()=>this.updateIcons(!1)),this.video.addEventListener("ended",()=>this.updateIcons(!1)))}updateIcons(isPlaying){this.btn&&(isPlaying?(this.playIcon.classList.add("hidden"),this.pauseIcon.classList.remove("hidden"),this.btn.setAttribute("aria-label","Pause video")):(this.playIcon.classList.remove("hidden"),this.pauseIcon.classList.add("hidden"),this.btn.setAttribute("aria-label","Play video")))}init(){this.video_iframe&&this.video_iframe.addEventListener("load",()=>{this.thumb&&this.thumb.remove()})}}customElements.define("video-section",VideoSection);class AgeVerifier extends HTMLElement{constructor(){super(),this.ageVerifyDetail=this.querySelector(".age-verify-detail"),this.declineVerifyDetail=this.querySelector(".decline-verify-detail"),this.init(),this.mainFunction()}init(){const _this=this;Shopify.designMode||(getCookie("age_verifier")?getCookie("age_verifier")=="false"?(this.classList.add("active"),this.declineVerifyDetail.classList.remove("hidden"),this.ageVerifyDetail.classList.add("hidden")):this.remove():(this.classList.add("active"),this.declineVerifyDetail.classList.add("hidden"),this.ageVerifyDetail.classList.remove("hidden")))}mainFunction(){const approve=this.querySelector(".age-verifier-approve"),decline=this.querySelector(".age-verifier-decline"),returnBtn=this.querySelector(".age-verifier-return");returnBtn&&returnBtn.addEventListener("click",()=>this.handleReturn()),!(!approve||!decline)&&(approve.addEventListener("click",()=>this.handleApprove()),decline.addEventListener("click",()=>this.handleDecline()))}handleReturn(){Shopify.designMode||(setCookie("age_verifier","false","-1"),this.init())}handleDecline(){Shopify.designMode||(setCookie("age_verifier","false","365"),this.init())}handleApprove(){setCookie("age_verifier","true","false"),this.classList.add("fadeOut"),setTimeout(()=>{this.remove()},1e3)}}customElements.define("age-verifier",AgeVerifier);class PromotionPopup extends HTMLElement{constructor(){super(),setTimeout(()=>{this.init()},15e3)}init(){const _this=this,s=_this?.dataset.show,m=_this?.dataset.showMb==="true";if(!Shopify.designMode&&(s==="show-on-all-pages"||s==="show-on-homepage")&&getCookie("promotion-popup")===""){let _promotionTrapCleanup=null;const modal=new tingle.modal({footer:!1,stickyFooter:!1,closeMethods:["overlay","button","escape"],closeLabel:"Close",cssClass:["promotion-popup-modal",`${m?"enable-on-mobile":"show-all"}`],onOpen:function(){_promotionTrapCleanup=trapFocus(this.modalBox)},beforeClose:function(){return _promotionTrapCleanup&&(_promotionTrapCleanup(),_promotionTrapCleanup=null),!0}});modal.setContent(_this.innerHTML),modal.open(),_this.copyPromotion(),_this.checkNotShowPromotion()}}checkNotShowPromotion(){const check=document.querySelector(".promotion-popup-modal .do-not-show-again");check&&check.addEventListener("click",e=>{setCookie("promotion-popup",1,1),document.querySelector(".promotion-popup-modal .tingle-modal__close").click()})}copyPromotion(){const cp=document.querySelectorAll(".promotion-popup-modal .discount");
13cp!==null&&cp.forEach(e=>{e.addEventListener("click",el=>{el.preventDefault(),navigator.clipboard.writeText(e?.dataset.code),e.classList.add("action-copy"),setTimeout(()=>{e.classList.remove("action-copy")},1500)})})}}customElements.define("promotion-popup",PromotionPopup);class NewsletterPopup extends HTMLElement{constructor(){super(),setTimeout(()=>{this.init()},12e3)}init(){const sectionId=this.dataset.sectionId,url=`${window.location.pathname}?section_id=${sectionId}&ajax=1`;fetch(`${url}`).then(response=>{if(!response.ok){var error=new Error(response.status);throw error}return response.text()}).then(responseText=>{const newSection=new DOMParser().parseFromString(responseText,"text/html").querySelector("newsletter-popup").innerHTML;document.querySelector("newsletter-popup").innerHTML=newSection}).catch(error=>{throw error}).finally(()=>{this.initPopup()})}initPopup(){const _this=this,s=_this?.dataset.show,m=_this?.dataset.showMb==="true";if(!Shopify.designMode){const cookie=getCookie("newsletter_popup"),width=window.innerWidth;if(!m&&width<768)return!1;if((s=="show_homepage"||s=="show_all_page")&&cookie===""){let _newsletterTrapCleanup=null;const modal=new tingle.modal({footer:!1,stickyFooter:!1,closeMethods:["overlay","button","escape"],closeLabel:"Close",beforeOpen:function(){CloseAllPopup()},onOpen:function(){_newsletterTrapCleanup=trapFocus(this.modalBox)},beforeClose:function(){return _newsletterTrapCleanup&&(_newsletterTrapCleanup(),_newsletterTrapCleanup=null),!0},cssClass:["newsletter-popup-modal",`${m?"show-all":"disable-on-mobile"}`]});modal.setContent(_this.innerHTML),modal.open(),_this.onShowNewletter()}}}onShowNewletter(){const _this=this,setC=document.querySelector(".newsletter-popup-modal .newsletter-popup__dont-show");setC&&(setC.addEventListener("click",_this.notShow.bind(_this)),setC.addEventListener("keypress",function(event){event.key==="Enter"&&_this.notShow.bind(_this)(event)}.bind(_this),!1))}notShow(e){e.preventDefault(),setCookie("newsletter_popup",30,1),document.querySelector(".newsletter-popup-modal .tingle-modal__close").click()}}customElements.define("newsletter-popup",NewsletterPopup);class TiktokVideo extends HTMLElement{constructor(){super(),this.init()}init(){const _this=this;window.addEventListener("scroll",()=>{window.scrollY>0&&this.scrollLazyloadVideo()}),window.pageYOffset>40&&this.scrollLazyloadVideo()}scrollLazyloadVideo(){const _this=this;if(!_this.classList.contains("tiktok-loading"))return;_this.classList.remove("tiktok-loading");const sectionId=_this.dataset.sectionId,url=`${window.location.pathname}?section_id=${sectionId}&ajax=1`;fetch(`${url}`).then(response=>{if(!response.ok){var error=new Error(response.status);throw error}return response.text()}).then(responseText=>{const newSection=new DOMParser().parseFromString(responseText,"text/html").querySelector("tiktok-video").innerHTML;_this.innerHTML=newSection}).catch(error=>{throw error}).finally(()=>{var script=document.createElement("script");script.type="text/javascript",script.src="https://www.tiktok.com/embed.js",document.body.appendChild(script)})}}customElements.define("tiktok-video",TiktokVideo);var returnMessageWhenSubmit=(function(){return{init:function(){this.checkUrlReturn()},checkUrlReturn:function(){const getUrl=window.location.href;if(getUrl.indexOf("customer_posted=true#newsletter-form")>=1||getUrl.indexOf("customer_posted=true")>=1){this.handleMessageSuccessPopup(),setCookie("newsletter_popup",30,1);const newURL=location.href.split("?")[0];window.history.pushState("object",document.title,newURL)}if(getUrl.indexOf("contact%5Btags%5D=newsletter&form_type=customer")>=1){this.handleMessageErrorPopup();const newURL=location.href.split("?")[0];window.history.pushState("object",document.title,newURL)}},handleMessageSuccessPopup:function(){const url=`${window.location.pathname}?section_id=form-message`;fetch(url).then(response=>response.text()).then(responseText=>{const elementSuccessMessage=new DOMParser().parseFromString(responseText,"text/html").querySelector(".newsletter-form__success-message-wrapper"),elementMessage=elementSuccessMessage.querySelector(".newsletter-form__message");showToast(elementSuccessMessage.innerHTML,5e3,"modal-success")}
13).catch(e=>{throw e})},handleMessageErrorPopup:function(){const url=`${window.location.pathname}?section_id=form-message`;fetch(url).then(response=>response.text()).then(responseText=>{const elementErrorMessage=new DOMParser().parseFromString(responseText,"text/html").querySelector(".newsletter-form__error-message-wrapper"),elementMessage=elementErrorMessage.querySelector(".newsletter-form__message");showToast(elementErrorMessage.innerHTML,5e3,"modal-error")}).catch(e=>{throw e})}}})();returnMessageWhenSubmit.init();class NavBar extends HTMLElement{constructor(){super(),this.init()}init(){document.body.classList.add("mobi-navigation-bar")}}customElements.define("mobile-navigation-bar",NavBar);class IconBox extends SlideSection{constructor(){super(),this.enable=this.dataset.enable,this.swiperSlideInnerHtml=this.innerHTML,this.init()}init(){if(this.enable=="true"){let width=window.innerWidth;window.addEventListener("resize",()=>{const newWidth=window.innerWidth;newWidth<=767&&width>767&&this.actionOnMobile(),newWidth>767&&width<=767&&this.actionOutMobile(),width=newWidth}),width<=767?this.actionOnMobile():this.actionOutMobile()}}actionOnMobile(){this.classList.add("swiper"),this.classList.remove("grid","grid-cols");const wrapper=`<div class='swiper-wrapper'>${this.swiperSlideInnerHtml.replaceAll("sec__icon-switch-slide","swiper-slide")}</div> <div
14    class="swiper-pagination  ${this.enable&&this.dataset.mobile!=1.5?"flex":"hidden"} px-15 lh-1 bottom-30 justify-content-center"
15    style="--swiper-pagination-bottom: 3rem;--swiper-pagination-position: static;"
16  ></div> `;this.innerHTML=wrapper,this.initSlide()}actionOutMobile(){this.classList.remove("swiper"),this.classList.add("grid","grid-cols"),this.innerHTML=this.swiperSlideInnerHtml}}customElements.define("icon-box",IconBox);class PaginateLoadmore extends HTMLElement{constructor(){super(),this.initLoadMore(),this.classList.contains("collection-infinite-scroll")&&this.querySelector("a").addEventListener("click",async e=>{this.toggleLoading(e.currentTarget,!0),await new Promise((resolve,reject)=>{setTimeout(()=>{resolve(),this.toggleLoading(e.currentTarget,!1),this.remove()},400)});for(var item of document.querySelectorAll(".sec__collections-list .collection-item.grid-custom-item"))item.classList.remove("hidden");this.hasAttribute("hold")||motion.animate(document.querySelectorAll(".sec__collections-list .collection-item.grid-custom-item.trigger_slidein"),{transform:["translateY(3.5rem)","translateY(0)"],opacity:[.01,1],visibility:["hidden","visible"]},{duration:.5,delay:motion.stagger(.1),easing:[0,0,.3,1]})},!1)}initLoadMore(){this.querySelectorAll(".actions-loadmore").forEach(loadMore=>{var _this=this;if(loadMore.classList.contains("infinit-scrolling")){var observer=new IntersectionObserver(function(entries){entries.forEach(entry=>{entry.intersectionRatio===1&&_this.loadMoreItem(loadMore)})},{threshold:1});observer.observe(loadMore)}else loadMore.addEventListener("click",event=>{event.preventDefault();const target=event.currentTarget;_this.loadMoreItem(target)},!1)})}loadMoreItem(target){const loadMore_url=target.getAttribute("href"),_this=this;document.querySelector("#product-grid")?.classList.add("bls-image-js"),_this.toggleLoading(target,!0),fetch(`${loadMore_url}`).then(response=>{if(!response.ok){var error=new Error(response.status);throw error}return response.text()}).then(responseText=>{const resultNodes=parser.parseFromString(responseText,"text/html");resultNodes.querySelectorAll(".loadmore-lists .loadmore-item").forEach(prodNode=>document.querySelector(".loadmore-lists").appendChild(prodNode));const load_more=resultNodes.querySelector(".actions-loadmore");document.querySelector(".load-more-bar").innerHTML=resultNodes.querySelector(".load-more-bar").innerHTML,load_more?target.setAttribute("href",load_more.getAttribute("href")):target.remove(),_this.toggleLoading(target,!1)}).catch(error=>{throw _this.toggleLoading(target,!1),error}).finally(async()=>{initLazyloadItem(),BlsLazyloadImg.init(),setTimeout(()=>{document.querySelector("grid-list")?.showGridItems()},100)})}toggleLoading(event,loading){if(event){const method=loading?"add":"remove";event.classList[method]("loading")}}}
16customElements.define("loadmore-button",PaginateLoadmore);class SingleItem extends HTMLElement{constructor(){super(),this.position=this.dataset.position,this.section=this.closest(".section-slide-single"),this.init()}init(){this.addEventListener("click",this.onClick.bind(this))}onClick(){if(this.section&&this.position){const slideSEction=this.section.querySelector("slide-section-single");this.section.querySelectorAll("single-item").forEach(dot=>{dot.classList.remove("active")}),this.classList.add("active"),slideSEction&&slideSEction.functionGoto(this.position)}}}customElements.define("single-item",SingleItem);class SlideSectionSingle extends SlideSection{constructor(){super(),this.init()}init(){this.initSlide()}functionGoto(position){this.globalSlide.slideToLoop(position-1,500)}}customElements.define("slide-section-single",SlideSectionSingle);class CartUpsell extends HTMLElement{constructor(){super()}init(){this.connectedCallback()}connectedCallback(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendations=html.querySelector(".swiper-wrapper");recommendations&&recommendations.innerHTML.trim().length?this.querySelector(".swiper-wrapper")&&(this.querySelector(".swiper-wrapper").innerHTML=recommendations.innerHTML,typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(this)):this.classList.add("hidden")}).finally(()=>{}).catch(e=>{console.error(e)})}}customElements.define("minicart-recommendations",CartUpsell);class CartUpsellBeside extends HTMLElement{constructor(){super()}init(){this.connectedCallback()}connectedCallback(){fetch(this.dataset.url).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recommendationsBeside=html.querySelector(".cart-upsell-wrapper");recommendationsBeside&&recommendationsBeside.innerHTML.trim().length?this.querySelector(".cart-upsell-wrapper")&&(this.querySelector(".cart-upsell-wrapper").innerHTML=recommendationsBeside.innerHTML,typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(this)):this.classList.add("hidden")}).finally(()=>{}).catch(e=>{console.error(e)})}}customElements.define("minicart-recommendations-beside",CartUpsellBeside);class CartUpsellHeading extends HTMLElement{constructor(){super(),this.querySelector(".button-close-beside")&&this.querySelector(".button-close-beside").addEventListener("click",e=>{e.currentTarget.closest(".cart-recommend").classList.remove("open")},!1)}}customElements.define("minicart-recommendations-heading",CartUpsellHeading);function handleVariantRadioKeydown(event){const current=event.currentTarget;if(event.key==="Enter"||event.key===" "){event.preventDefault(),current.getAttribute("aria-disabled")!=="true"&&current.click();return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(event.key))return;const fieldset=current.closest("fieldset");if(!fieldset)return;const options=Array.from(fieldset.querySelectorAll(".option-swatch-js")).filter(option=>option.getAttribute("aria-disabled")!=="true");if(!options.length)return;event.preventDefault();let currentIndex=options.indexOf(current);currentIndex<0&&(currentIndex=0);let nextIndex=currentIndex;event.key==="Home"?nextIndex=0:event.key==="End"?nextIndex=options.length-1:event.key==="ArrowLeft"||event.key==="ArrowUp"?nextIndex=(currentIndex-1+options.length)%options.length:nextIndex=(currentIndex+1)%options.length,options[nextIndex].focus(),options[nextIndex].click()}class VariantRadiosQuickEdit extends SwatchInit{constructor(){super(),this.init()}init(){this.querySelectorAll(".product__color-swatches--js").forEach(btn=>{this.checkSwatches(btn)}),this.querySelectorAll(".option-swatch-js").forEach(button=>{button.addEventListener("click",this.onVariantChange.bind(this),!1),button.addEventListener("keydown",handleVariantRadioKeydown)})}onVariantChange(event){event.preventDefault();const target=event.currentTarget,value=target.getAttribute("data-value");for(var item of target.closest("fieldset").querySelectorAll(".option-swatch-js"))item.classList.remove("active"),item.setAttribute("aria-checked","fal
16se"),item.setAttribute("tabindex","-1");target.classList.add("active"),target.setAttribute("aria-checked","true"),target.setAttribute("tabindex","0"),target.closest("fieldset").querySelector(".swatch-selected-value").textContent=value,this.options=Array.from(this.querySelectorAll(".option-swatch-js.active"),select=>select.getAttribute("data-value")),this.updateMasterId(),this.toggleAddButton(!0,"",!1),this.updateVariantStatuses(),this.currentVariant?(this.updateMedia(),this.updateVariantInput(),this.renderProductInfo()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateMedia(){if(!this.currentVariant||!this.currentVariant.featured_media)return;const form=document.getElementById(`product-form-quick-edit-${this.dataset.section}`);form.querySelector(".product__media img")&&(form.querySelector(".product__media img").removeAttribute("srcset"),form.querySelector(".product__media img").setAttribute("src",this.currentVariant.featured_media.preview_image.src))}updateVariantInput(){const localContainer=this.closest(".product__item-js, .product-quickview__content, .sec__featured-product, .product-item");localContainer&&localContainer.querySelectorAll('input[name="id"]').forEach(input=>{input.value=this.currentVariant.id}),document.querySelectorAll(`#product-form-${this.dataset.section}, #sticky-addcart-form-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input&&(input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0})))})}renderProductInfo(){if(!this.currentVariant)return;const compare_at_price=this.currentVariant.compare_at_price,current_price=this.currentVariant.price,price_format=Shopify.formatMoney(this.currentVariant.price,cartStrings?.money_format),form=document.getElementById(`product-form-quick-edit-${this.dataset.section}`);form.querySelector(".price-regular .price").innerHTML=price_format;const price=form.querySelector(".price");if(price.classList.remove("price--sold-out","price--on-sale"),price.querySelector(".price-regular .price").classList.remove("special-price"),compare_at_price&&compare_at_price>current_price){const compare_format=Shopify.formatMoney(compare_at_price,cartStrings?.money_format);if(!price.querySelector(".compare-price")){var ps=price.querySelector(".price__sale"),sp=document.createElement("span"),cp=document.createElement("s");cp.classList.add("price-item","compare-price"),sp.appendChild(cp),ps&&ps.appendChild(sp)}price.querySelector(".compare-price")&&(price.querySelector(".compare-price").innerHTML=compare_format),price.classList.add("price--on-sale"),price.querySelector(".price-regular .price").classList.add("special-price")}else this.currentVariant.available||price.classList.add("price--sold-out");this.toggleAddButton(!this.currentVariant.available,window.variantStrings?.soldOut)}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=document.getElementById(`product-form-quick-edit-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span'),buttonPayment=productForm.querySelector(".product-dynamic-checkout");addButton&&(disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings?.addToCart))}setUnavailable(){const button=document.getElementById(`product-form-quick-edit-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`);addButton&&(addButtonText.textContent=window.variantStrings?.unavailable,price&&price.classList.add("visibility-hidden"))}setAvailability(listOfOptions,listOfAvailableOptions){listOfOptions.forEach(input=>{const available=listOfAvailableOptions.includes(input.dataset.value);input.classList.toggle("option-disabled",!available),input.setAttribute("aria-disabled",String(!available))})}updateVariantStatuses(){const selectedOptionOneVariants=this.getVariantData().filter(variant=>this.querySelector(".active").dataset.value===variant.option1),inputWrappers=[...this.querySelectorAll(".product-form__input")];
16inputWrappers.forEach((option,index)=>{if(index===0)return;const optionInputs=[...option.querySelectorAll(".option-swatch-js")],previousOptionSelected=inputWrappers[index-1].querySelector(".active").dataset.value,availableOptionInputsValue=selectedOptionOneVariants.filter(variant=>variant.available&&variant[`option${index}`]===previousOptionSelected).map(variantOption=>variantOption[`option${index+1}`]);this.setAvailability(optionInputs,availableOptionInputsValue)})}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}}customElements.define("variant-radios-quick-edit",VariantRadiosQuickEdit);class VariantRadiosBundle extends SwatchInit{constructor(){super(),this.init()}init(){this.querySelectorAll(".product__color-swatches--js").forEach(btn=>{this.checkSwatches(btn),this.variantHover(btn)}),this.querySelectorAll(".option-swatch-js").forEach(button=>{button.addEventListener("click",this.onVariantChange.bind(this),!1),button.addEventListener("keydown",handleVariantRadioKeydown)})}onVariantChange(event){event.preventDefault(),this.productTarget=this.closest(".product__item-js");const variantQtyData=JSON.parse(this.productTarget.querySelector(".productVariantsQty").textContent),target=event.currentTarget,value=target.getAttribute("data-value");for(var item of target.closest("fieldset").querySelectorAll(".option-swatch-js"))item.classList.remove("active"),item.setAttribute("aria-checked","false"),item.setAttribute("tabindex","-1");target.classList.add("active"),target.setAttribute("aria-checked","true"),target.setAttribute("tabindex","0"),target.closest("fieldset").querySelector(".swatch-selected-value").textContent=value,this.options=Array.from(this.querySelectorAll(".option-swatch-js.active"),select=>select.getAttribute("data-value")),this.updateMasterId(),this.toggleAddButton(!0,"",!1),this.updateVariantStatuses(),this.currentVariant?(this.updateVariantInput(),this.renderProductInfo(this.productTarget,variantQtyData,target),this.updateMedia()):(this.toggleAddButton(!0,"",!0),this.setUnavailable())}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}async updateMedia(){if(this.currentVariant){if(!this.productTarget.querySelector(".product__media img").classList.contains("hidden")){const productItem=this.productTarget.querySelector(".product__media img").closest(".product-item");(productItem.querySelector("video")||productItem.querySelector("iframe"))&&(this.productTarget.querySelector(".product__media img").classList.add("hidden"),productItem.querySelector("video")?.classList.remove("hidden"),productItem.querySelector("iframe")?.classList.remove("hidden"))}if(this.currentVariant.featured_media){if(this.productTarget.querySelector(".product__media img")&&this.productTarget.querySelector(".product__media img").removeAttribute("srcset"),this.productTarget.querySelector(".product__media img").classList.contains("hidden")){this.productTarget.querySelector(".product__media img").classList.remove("hidden");const productItem=this.productTarget.querySelector(".product__media img").closest(".product-item");(productItem.querySelector("video")||productItem.querySelector("iframe"))&&(productItem.querySelector("video")?.classList.add("hidden"),productItem.querySelector("iframe")?.classList.add("hidden"))}this.productTarget.querySelector(".product__media img")&&(await motion.animate(this.productTarget.querySelector(".product__media img"),{opacity:[1,0]},{duration:.1,easing:"ease-in"}),this.productTarget.querySelector(".product__media img").setAttribute("src",this.currentVariant.featured_media.preview_image.src),await new Promise(resolve=>{this.productTarget.querySelector(".product__media img").onload=()=>{resolve()}}),motion.animate(this.productTarget.querySelector(".product__media img"),{opacity:[0,1]},{duration:.1,easing:"ease-in"}))}}}updateVariantInput(){document.querySelectorAll(`#quick-add-bundle-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}renderProductInfo(productTarget,variantQtyData,target){if(!this.currentVariant||!productTarget)return;let qty=0,percent=0,sale=!1,soldOut=!1,pre_order=!1,av=this.currentVariant.available,im=this.currentVariant.inventory_management;const compare_at_price=this.currentVariant.compare_at_price,current_price=this.currentVariant.price;let avaiable=productTarget.querySelector(".available-value");const price_format=Shopify.formatMoney(this.currentVariant.price,cartStrings?.money_format),typePercent=productTarget.querySelector(".product__badges-type-percent");productTarget.querySelector(".price-regular .price").innerHTML=price_format;const price=productTarget.querySelector(".price");if(price.classList.remove("price--sold-out","price--on-sale"),productTarget.querySelector(".price-regular .price").classList.remove("special-price"),variantQtyData.find(variantQty=>{variantQty.id===this.currentVariant.id&&(qty=Number(variantQty.qty)||0,av=variantQty.available,im=variantQty.mamagement===""?null:variantQty.mamagement)}),compare_at_price&&compare_at_price>current_price){sale=!0,typePercent?percent=(compare_at_price-current_price)/compare_at_price*100:percent=compare_at_price-current_price;const compare_format=Shopify.formatMoney(compare_at_price,cartStrings?.money_format);
16if(!price.querySelector(".compare-price")){var ps=price.querySelector(".price__sale"),sp=document.createElement("span"),cp=document.createElement("s");cp.classList.add("price-item","compare-price"),sp.appendChild(cp),ps&&ps.appendChild(sp)}price.querySelector(".compare-price")&&(price.querySelector(".compare-price").innerHTML=compare_format),price.classList.add("price--on-sale"),productTarget.querySelector(".price-regular .price").classList.add("special-price")}else this.currentVariant.available||price.classList.add("price--sold-out");im===null||im===""||im===void 0?(soldOut=!1,pre_order=!1,avaiable&&(avaiable.innerHTML=window.variantStrings.inStock)):av?qty<1?(pre_order=!0,avaiable&&(avaiable.innerHTML=window.variantStrings.preOrder)):(soldOut=!1,pre_order=!1,avaiable&&(avaiable.innerHTML=window.variantStrings.inStock)):(soldOut=!0,avaiable&&(avaiable.innerHTML=window.variantStrings.outStock)),this.toggleAddButton(!this.currentVariant.available,window.variantStrings?.soldOut),this.renderLabel(sale,pre_order,soldOut,percent,productTarget)}renderLabel(sale,pre_order,soldOut,percent,productTarget){const label=productTarget.querySelector(".product__badges");if(!label)return;const dsale=label.querySelector(".product__badges-sale"),dsoldout=label.querySelector(".product__badges-sold-out"),dpreorder=label.querySelector(".product__badges-pre-order"),show_sale=label.dataset.showSale==="true",show_sold_out=label.dataset.showSoldOut==="true",show_pre_order=label.dataset.showPreorder==="true";if(sale&&show_sale&&dsale){const prd=Shopify.formatMoney(percent,window.cartStrings?.money_format);dsale.classList.contains("product__badges-type-percent")?dsale.innerHTML=`-${percent.toFixed(0)}%`:dsale.classList.contains("product__badges-type-price")?dsale.innerHTML=`${window.variantStrings.save?window.variantStrings.save:"Save"} ${prd}`:dsale.innerHTML=window.variantStrings.sale_label||"Sale",dsale.classList.remove("hidden-important")}else dsale&&dsale.classList.add("hidden-important");const regionOut=label.dataset.regionOut==="true";soldOut&&show_sold_out&&dsoldout&&!regionOut?(dsoldout.classList.remove("hidden-important"),dpreorder&&dpreorder.classList.add("hidden-important")):(dsoldout&&dsoldout.classList.add("hidden-important"),pre_order&&show_pre_order&&dpreorder?dpreorder.classList.remove("hidden-important"):dpreorder&&dpreorder.classList.add("hidden-important"));const productBadgesScrolling=productTarget.querySelector(".product__badges-sale-scrolling");if(productBadgesScrolling&&sale){const dataBadgesScrolling=productBadgesScrolling.dataset.textProductScrolling;productBadgesScrolling.querySelectorAll(".content-badges-scrolling").forEach(content=>{content.innerText=dataBadgesScrolling.replace("[percent_sale]",`${percent.toFixed(0)}%`)})}}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=document.getElementById(`quick-add-bundle-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span'),buttonPayment=productForm.querySelector(".product-dynamic-checkout");addButton&&(disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText&&(addButtonText.textContent=window.variantStrings?.addToCartBundle)))}setUnavailable(){const button=document.getElementById(`quick-add-bundle-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`);addButton&&(addButtonText.textContent=window.variantStrings?.unavailable,price&&price.classList.add("visibility-hidden"))}setAvailability(listOfOptions,listOfAvailableOptions){listOfOptions.forEach(input=>{const available=listOfAvailableOptions.includes(input.dataset.value);input.classList.toggle("option-disabled",!available),input.setAttribute("aria-disabled",String(!available))})}updateVariantStatuses(){const selectedOptionOneVariants=this.getVariantData().filter(variant=>this.querySelector(".active").dataset.value===variant.option1),inputWrappers=[...this.querySelectorAll(".product-form__input")];
16inputWrappers.forEach((option,index)=>{if(index===0)return;const optionInputs=[...option.querySelectorAll(".option-swatch-js")],previousOptionSelected=inputWrappers[index-1].querySelector(".active").dataset.value,availableOptionInputsValue=selectedOptionOneVariants.filter(variant=>variant.available&&variant[`option${index}`]===previousOptionSelected).map(variantOption=>variantOption[`option${index+1}`]);this.setAvailability(optionInputs,availableOptionInputsValue)})}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}variantHover(e){if(!e.closest(".product-item"))return;const swiperElement=e.closest(".swiper");if(!swiperElement)return;let timeout;const handleMouseOut=()=>{swiperElement.classList.remove("show-tooltip")},handleMouseOver=()=>{swiperElement.classList.add("show-tooltip")};e.addEventListener("mouseout",handleMouseOut,!1),e.addEventListener("mouseover",handleMouseOver,!1),e.addEventListener("mouseenter",handleMouseOver,!1),e.addEventListener("mouseleave",handleMouseOut,!1)}}customElements.define("variant-radios-bundle",VariantRadiosBundle),customElements.get("product-form-bundle")||customElements.define("product-form-bundle",class extends PopupBase{constructor(){super(),this.form=this.querySelector("form"),this.form.querySelector("[name=id]").disabled=!1,this.form.addEventListener("submit",this.onSubmitHandler.bind(this)),this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer"),this.submitButton=this.querySelector('[type="submit"]'),this.hideErrors=this.dataset.hideErrors==="true",this.productItem=this.form.closest(".product-item")||this.form.closest("sticky-add-cart")}updateBundleButtonStatus(){const productFormBundle=this.closest("product-form-bundle"),minimum=productFormBundle.dataset.minimum,maximum=productFormBundle.dataset.maximum,submitButton=document.querySelector("button-submit-bundle");if(!submitButton)return;const bundleItems=document.querySelectorAll("[data-product-bundle-variant][data-variant-id]");bundleItems.length>=minimum?(submitButton.classList.remove("disabled"),submitButton.setAttribute("aria-disabled","false")):(submitButton.classList.add("disabled"),submitButton.setAttribute("aria-disabled","true"));const btnAddCart=this.closest("product-bundle").querySelectorAll("product-form-bundle button");bundleItems.length>=maximum&&btnAddCart.forEach(btn=>{btn.classList.add("disabled"),btn.setAttribute("aria-disabled","true")})}onSubmitHandler(evt){if(evt.preventDefault(),this.submitButton.getAttribute("aria-disabled")==="true")return;this.handleErrorMessage(),this.submitButton.classList.add("disabled"),this.submitButton.textContent=window.variantStrings?.addedToCartBundle;const formData=new FormData(this.form),variantId=formData.get("id"),quantity=formData.get("quantity")||1,productHandle=this.dataset.handle||this.dataset.productHandle;fetch(`/products/${productHandle}?section_id=bundle-item&variant=${variantId}`).then(response=>response.text()).then(responseText=>{const doc=parser.parseFromString(responseText,"text/html"),bundleContainers=document.querySelectorAll("[data-product-bundle-variant]");if(!bundleContainers.length){console.error("No bundle container found");return}let existingItemContainer=null;for(const container of bundleContainers)if(container.getAttribute("data-variant-id")===variantId){existingItemContainer=container;break}if(existingItemContainer){const currentQty=parseInt(existingItemContainer.getAttribute("data-quantity")||0);existingItemContainer.setAttribute("data-quantity",currentQty+parseInt(quantity));const quantityDisplay=existingItemContainer.querySelector(".bundle-item-quantity");quantityDisplay&&(quantityDisplay.textContent=currentQty+parseInt(quantity)),existingItemContainer.classList.add("flash-highlight"),setTimeout(()=>{existingItemContainer.classList.remove("flash-highlight")},1500)}else{let targetContainer=null;for(const container of bundleContainers)if(!container.hasAttribute("data-variant-id")){targetContainer=container;break}if(!targetContainer){this.handleErrorMessage("Bundle is full. Please remove an item first.");return}const bundleImage=doc.querySelector(".bundle-image"),bundleContent=doc.querySelector(".bundle-content"),bundleRemoveButton=doc.querySelector("bundle-cart-remove-button");if(!bundleImage||!bundleContent){console.error("Missing required elements in response",{bundleImage,bundleContent}),this.handleErrorMessage("Error processing product data");return}targetContainer.setAttribute("data-variant-id",variantId),targetContainer.setAttribute("data-quantity",quantity),targetContainer.classList.add("bundle-item-dev");const mediaContainer=targetContainer.querySelector("[data-product-bundle-variant-media]");mediaContainer&&bundleImage&&(mediaContainer.classList.remove("skeleton"),mediaContainer.innerHTML=bundleImage.innerHTML);const contentContainer=targetContainer.querySelector("[data-product-bundle-variant-content]");if(contentContainer&&bundleContent){contentContainer.querySelectorAll(".horizontal-product__skeleton").forEach(el=>el.remove()),contentContainer.innerHTML=bundleContent.innerHTML;let bundleActionContainer=targetContainer.querySelector(".bundle-action");if(bundleActionContainer||(bundleActionContainer=document.createElement("div"),bundleActionContainer.classList.add("bundle-action"),targetContainer.appendChild(bundleActionContainer)),bundleRemoveButton){bundleActionContainer.querySelectorAll("bundle-cart-remove-button").forEach(button=>button.remove());const removeButtonHTML=bundleRemoveButton.outerHTML;bundleActionContainer.insertAdjacentHTML("beforeend",removeButtonHTML);const newRemoveButton=bundleActionContainer.querySelector("bundle-cart-remove-button:last-child");newRemoveButton&&newRemoveButton.addEventListener("click",()=>{const _this=this;targetContainer.removeAttribute("data-variant-id"),targetContainer.removeAttribute("data-quantity"),mediaContainer&&(mediaContainer.innerHTML=""),contentContainer&&(contentContainer.innerHTML=`
17                                                <span class="horizontal-product__skeleton skeleton-1"></span>
18                                                <span class="horizontal-product__skeleton skeleton-2"></span>
19                                                <span class="horizontal-product__skeleton skeleton-3"></span>
20                                              `),_this.submitButton.classList.remove("disabled"),_this.submitButton.textContent=window.variantStrings?.addToCartBundle,_this.updateContainerOrders(),_this.updateBundleTotal(),document.dispatchEvent(new CustomEvent("bundle:item-changed"));const bundleItems=document.querySelectorAll("[data-product-bundle-variant][data-variant-id]"),maximum=_this.closest("product-form-bundle").dataset.maximum;bundleItems.length<maximum&&_this.closest("product-bundle").querySelectorAll("product-form-bundle button.disabled").forEach(btn=>{const productId=btn.closest("product-form-bundle").querySelector('input[name="id"]').value;Array.from(bundleItems).some(item=>item.getAttribute("data-variant-id")===productId)||(btn.classList.remove("disabled"),btn.setAttribute("aria-disabled","false"))}),_this.updateBundleButtonStatus()})}}targetContainer.classList.add("flash-highlight"),setTimeout(()=>{targetContainer.classList.remove("flash-highlight")},1500)}this.form.reset(),this.updateBundleTotal()}).catch(error=>{console.error("Error adding product to bundle:",error),this.handleErrorMessage("Could not add product to bundle")}).finally(()=>{document.dispatchEvent(new CustomEvent("bundle:item-changed")),this.updateBundleButtonStatus()})}updateContainerOrders(){const bundleContainers=document.querySelectorAll("[data-product-bundle-variant]");bundleContainers.forEach(container=>{container.style.order=""});let filledCount=0,emptyCount=0;bundleContainers.forEach((container,index)=>{container.hasAttribute("data-variant-id")?(container.style.order=filledCount.toString(),filledCount++):(container.style.order=(bundleContainers.length+emptyCount).toString(),emptyCount++)})}updateBundleTotal(){let totalPrice=0,itemTotalPrice=0;document.querySelectorAll("[data-product-bundle-variant][data-variant-id]").forEach(item=>{const price=item.querySelector(".price-item--regular")?.dataset.price,quantity=parseInt(item.getAttribute("data-quantity"))||1;itemTotalPrice+=price*quantity,totalPrice=Shopify.formatMoney(itemTotalPrice,cartStrings?.money_format)});const totalElement=document.querySelector(".subtotal-price__bundle");itemTotalPrice>0?totalElement.textContent=totalPrice:totalElement.textContent=Shopify.formatMoney(0,cartStrings?.money_format)}getMainCartSectionRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items")?.dataset.id,selector:".js-contents"}]}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}handleErrorMessage(errorMessage=!1){this.hideErrors||(this.errorMessageWrapper=this.errorMessageWrapper||this.querySelector(".product-form__error-message-wrapper"),this.errorMessageWrapper&&(this.errorMessage=this.errorMessage||this.errorMessageWrapper.querySelector(".product-form__error-message"),this.errorMessageWrapper.toggleAttribute("hidden",!errorMessage),errorMessage&&(this.errorMessage.textContent=errorMessage)))}handleErrorMessagePopup(errorMessage=!1){const url=`${window.location.pathname}?section_id=form-message`;fetch(url).then(response=>response.text()).then(responseText=>{const elementErrorMessage=new DOMParser().parseFromString(responseText,"text/html").querySelector(".product-form__error-message-wrapper"),elementMessage=elementErrorMessage.querySelector(".product-form__error-message");elementMessage.textContent=errorMessage,showToast(elementErrorMessage.innerHTML,5e3,"modal-error")}).catch(e=>{throw e})}});class QuantityInputBundle extends HTMLElement{constructor(){super(),this.input=this.querySelector("input"),this.changeEvent=ne
20w Event("change",{bubbles:!0}),this.previousValue=parseInt(this.input.value)||1,attachQtyGuard(this.input,{fallback:()=>1,ignoreDataValue:!0}),this.input.addEventListener("change",this.onInputChange.bind(this)),this.querySelectorAll("button").forEach(button=>button.addEventListener("click",this.onButtonClick.bind(this)))}onInputChange(){this.updateBundleQuantity()}onButtonClick(event){event.preventDefault(),this.previousValue=parseInt(this.input.value),event.target.name==="plus"||event.target.closest("button").name==="plus"?this.input.stepUp():this.input.stepDown(),this.previousValue!==parseInt(this.input.value)&&(this.input.dispatchEvent(this.changeEvent),this.updateBundleQuantity())}updateBundleQuantity(){const bundleContainer=this.closest("[data-product-bundle-variant]");if(!bundleContainer)return;const currentValue=parseInt(this.input.value)||1;bundleContainer.setAttribute("data-quantity",currentValue),this.updateBundleTotal()}updateBundleTotal(){let itemTotalPrice=0;document.querySelectorAll("[data-product-bundle-variant][data-variant-id]").forEach(item=>{const priceElement=item.querySelector(".price-item--regular");if(!priceElement||!priceElement.dataset.price)return;const price=parseFloat(priceElement.dataset.price),quantity=parseInt(item.getAttribute("data-quantity"))||1;!isNaN(price)&&!isNaN(quantity)&&(itemTotalPrice+=price*quantity)});const totalElement=document.querySelector(".subtotal-price__bundle");totalElement&&(itemTotalPrice>0?totalElement.textContent=Shopify.formatMoney(itemTotalPrice,cartStrings?.money_format):totalElement.textContent=Shopify.formatMoney(0,cartStrings?.money_format))}}customElements.define("quantity-input-bundle",QuantityInputBundle);class ButtonSubmitBundle extends HTMLElement{constructor(){super(),this.submitButton=this,this.addEventListener("click",this.onSubmitHandler.bind(this)),this.addEventListener("keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),this.getAttribute("aria-disabled")!=="true"&&this.click())}),this.minimum=this.dataset.minimum,this.maximum=this.dataset.maximum}onSubmitHandler(evt){if(evt.preventDefault(),this.classList.contains("loading")||this.classList.contains("disabled")||this.getAttribute("aria-disabled")==="true")return;this.classList.add("loading"),this.setAttribute("aria-disabled","true"),this.querySelector("span").textContent=window.variantStrings?.addingToCart||"Adding to cart...";const bundleItems=document.querySelectorAll("[data-product-bundle-variant][data-variant-id]");if(!bundleItems.length){this.handleErrorMessagePopup("Please add products to your bundle first"),this.resetButton();return}const items=Array.from(bundleItems).map(item=>({id:item.getAttribute("data-variant-id"),quantity:parseInt(item.getAttribute("data-quantity"))||1}));this.addItemsToCart(items)}addItemsToCart(items){this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer");const formData={items,sections:this.cart?this.cart.getSectionsToRender().map(section=>section.id):[],sections_url:window.location.pathname};fetch(`${routes?.cart_add_url}`,{method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"},body:JSON.stringify(formData)}).then(response=>response.json()).then(response=>{if(response.status){this.handleErrorMessagePopup(response.description);return}else if(response.errors){this.handleErrorMessagePopup(response.errors);return}this.updateCartCount(),this.clearBundle(),this.cart&&this.updateCartSections(response),this.cart?this.cart.open():window.location=window.routes.cart_url}).catch(error=>{throw error}).finally(()=>{this.resetButton()})}updateCartCount(){fetch("/cart.json").then(res=>res.json()).then(cart=>{if(cart.item_count!==void 0){document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${cart.item_count})`:el.innerHTML=cart.item_count>100?"~":cart.item_count}),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(cart);const cartFreeShip=document.querySelector("free-ship-progress-bar");cartFreeShip&&cartFreeShip.init(cart.items_subtotal_price)}}).catch(error=>{console.error("Error updating cart count:",error)})}updateCartSections(response){this.cart.getSectionsToRender().forEac
20h(section=>{const elementToReplace=document.getElementById(section.id),html=new DOMParser().parseFromString(response.sections[section.id],"text/html");elementToReplace&&(elementToReplace.innerHTML=html.querySelector("#minicart-form").innerHTML)}),this.cart&&typeof this.cart.cartAction=="function"&&this.cart.cartAction()}clearBundle(){document.querySelectorAll("[data-product-bundle-variant]").forEach(container=>{container.removeAttribute("data-variant-id"),container.removeAttribute("data-quantity");const mediaContainer=container.querySelector("[data-product-bundle-variant-media]");mediaContainer&&(mediaContainer.innerHTML="");const contentContainer=container.querySelector("[data-product-bundle-variant-content]");contentContainer&&(contentContainer.innerHTML=`
21          <span class="horizontal-product__skeleton skeleton-1"></span>
22          <span class="horizontal-product__skeleton skeleton-2"></span>
23          <span class="horizontal-product__skeleton skeleton-3"></span>
24        `);const actionContainer=container.querySelector(".bundle-action");actionContainer&&(actionContainer.innerHTML="")});const totalElement=document.querySelector(".subtotal-price__bundle");totalElement&&(totalElement.textContent=Shopify.formatMoney(0,cartStrings?.money_format)),this.updateButtonStatus(),document.dispatchEvent(new CustomEvent("bundle:item-changed"))}handleErrorMessagePopup(errorMessage=!1){const url=`${window.location.pathname}?section_id=form-message`;fetch(url).then(response=>response.text()).then(responseText=>{const elementErrorMessage=new DOMParser().parseFromString(responseText,"text/html").querySelector(".product-form__error-message-wrapper"),elementMessage=elementErrorMessage.querySelector(".product-form__error-message");elementMessage.textContent=errorMessage,showToast(elementErrorMessage.innerHTML,5e3,"modal-error")}).catch(e=>{throw e})}resetButton(){this.classList.remove("loading"),this.setAttribute("aria-disabled","false"),this.querySelector("span").textContent=window.variantStrings?.addAllToCart||"Add all to cart",this.updateButtonStatus()}updateButtonStatus(){const bundleItems=document.querySelectorAll("[data-product-bundle-variant][data-variant-id]"),sectionId=this.dataset.sectionId;document.querySelectorAll(`#product-bundle-${sectionId} product-form-bundle button`).forEach(button=>{button.classList.contains("disabled")&&(button.classList.remove("disabled"),button.setAttribute("aria-disabled","false"))});let itemCount=0;bundleItems.length>0&&(itemCount=bundleItems.length),itemCount>=this.minimum?(this.classList.remove("disabled"),this.setAttribute("aria-disabled","false")):(this.classList.add("disabled"),this.setAttribute("aria-disabled","true"))}}customElements.define("button-submit-bundle",ButtonSubmitBundle);class ProgressBundleBar extends HTMLElement{constructor(){super(),this.minimum=parseInt(this.dataset.minimum)||1,this.updateBundleProgress(),document.addEventListener("bundle:item-changed",()=>this.updateBundleProgress())}updateBundleProgress(){const itemCount=Array.from(this.closest("sticky-element").querySelectorAll("[data-product-bundle-variant][data-variant-id]")).length;let progressPercentage;itemCount>=this.minimum?progressPercentage=100:progressPercentage=itemCount/this.minimum*100,this.style.setProperty("--progress-width",`${progressPercentage}%`),progressPercentage>=100?this.classList.add("complete"):this.classList.remove("complete")}}customElements.define("progress-bundle-bar",ProgressBundleBar),customElements.get("product-form-quick-edit")||customElements.define("product-form-quick-edit",class extends HTMLElement{constructor(){super(),this.form=this.querySelector("form"),this.form.querySelector("[name=id]").disabled=!1,this.form.addEventListener("submit",this.onSubmitHandler.bind(this)),this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer"),this.submitButton=this.querySelector('[type="submit"]')}onSubmitHandler(evt){evt.preventDefault(),this.submitButton.setAttribute("disabled",!0),this.submitButton.classList.add("loading");const cartRecommend=document.querySelector(".cart-recommend");cartRecommend&&cartRecommend.classList.contains("open")&&cartRecommend.classList.remove("open");const id=document.getElementById("product-form-quick-edit").getAttribute("data-line"),quantity=0,config_change=fetchConfig("json");config_change.body=JSON.stringify({id,quantity}),fetch(`${routes?.cart_change_url}`,config_change).then(response=>response.text()).catch(e=>{throw e}).finally(()=>{this.addCartAdd()})}addCartAdd(){const config=fetchConfig("json");config.headers["X-Requested-With"]="XMLHttpRequest",delete config.headers["Content-Type"];const formData=new FormData(this.form);this.cart&&(formData.append("sections",this.cart.getSectionsToRender().map(section=>section.id)),formData.append("sections_url",window.location.pathname),this.cart.setActiveElement(document.activeElement)),config.body=formData,fetch(`${routes?.cart_add_url}`,config).then(response=>response.text()).then(state=>{this.submitButton.setAttribute("disabled",!0),this.submitButton.querySelector("span").classList.add("hidden");
24const parsedState=JSON.parse(state),updateQuickEditCartSummary=cart=>{if(!cart||cart.item_count==null)return;document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${cart.item_count})`:el.innerHTML=cart.item_count>100?"~":cart.item_count}),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(cart);const cart_free_ship=document.querySelector("free-ship-progress-bar");cart_free_ship&&cart_free_ship.init(cart.items_subtotal_price)};if(parsedState.errors&&fetch("/cart.json").then(res=>res.json()).then(updateQuickEditCartSummary).catch(error=>{throw error}),parsedState.errors)this.submitButton.removeAttribute("disabled"),this.submitButton.classList.remove("loading"),this.submitButton.querySelector("span").classList.remove("hidden"),this.updateMessageQuickErrors(parsedState.errors);else{const renderQuickEditCart=renderState=>{this.cart.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id),html=new DOMParser().parseFromString(renderState.sections[section.id],"text/html");elementToReplace.innerHTML=html.querySelector("#minicart-form").innerHTML}),this.cart&&typeof this.cart.cartAction=="function"&&this.cart.cartAction(),document.querySelector(".tingle-modal__close").click()};if(!window.tagQtyLimit){fetch("/cart.json").then(res=>res.json()).then(updateQuickEditCartSummary).catch(error=>{throw error}),renderQuickEditCart(parsedState);return}const addedLineKeys=getTagQtyLimitAddedLineKeys(parsedState);return fetch("/cart.json").then(res=>res.json()).then(cart=>enforceTagQtyLimitAfterAdd(cart,formData.get("id"),addedLineKeys,Object.keys(parsedState.sections||{}))).catch(error=>(console.error("Failed to refresh cart after quick edit:",error),null)).then(cart=>{updateQuickEditCartSummary(cart);const renderState=cart?.sections?cart:parsedState;renderQuickEditCart(renderState)})}}).catch(e=>{throw e}).finally(()=>{BlsLazyloadImg.init(),this.submitButton.removeAttribute("disabled"),this.submitButton.querySelector("span").classList.remove("hidden"),this.cart.open();const cartRecommend=document.querySelector(".cart-recommend");if(cartRecommend&&!cartRecommend.classList.contains("hidden-recommend"))if(cartRecommend.classList.contains("cart-recommend-custom")){const cartUpsellItem=document.querySelectorAll(".cart-upsell-item"),cartUpsellSlide=document.querySelectorAll(".swiper-cart-upsell .swiper-slide");cartUpsellItem.length>0?setTimeout(function(){cartRecommend.classList.add("open")},800):cartUpsellSlide.length===0&&(cartRecommend.classList.remove("block"),cartRecommend.classList.add("hidden"))}else setTimeout(function(){cartRecommend.classList.add("open")},800)})}updateMessageQuickErrors(message){this.querySelector(".cart-item__error-text").textContent=message}});class ShowPassWord extends HTMLElement{constructor(){super(),this.init()}init(){this.addEventListener("click",this.onClick.bind(this))}onClick(){var input=this.closest(".form-field").querySelector("input");input.type==="password"?(input.type="text",this.classList.add("text")):(input.type="password",this.classList.remove("text"))}}customElements.define("show-pass-word",ShowPassWord);class BeforeYouLeave extends HTMLElement{constructor(){super(),this._initTimer=setTimeout(()=>{this.init()},1e4)}disconnectedCallback(){clearTimeout(this._initTimer),clearTimeout(this._popupTimer),this._bodyActivityHandler&&["scroll","click","mousemove","keydown"].forEach(type=>document.body.removeEventListener(type,this._bodyActivityHandler)),this.teardownPopupFocus()}init(){const sectionId=this.dataset.sectionId,before_you_leave=document.querySelector(`#${sectionId}`).innerHTML;document.querySelector("before-you-leave").innerHTML=before_you_leave,setTimeout(()=>{this.initPopup(),BlsLazyloadImg.init()},500)}initPopup(){const element=document.querySelector("before-you-leave"),delay=element?.dataset.timeDelay;var action=0;if(element!==null){let setAction=function(){action=action-1};this._popupTimer=setTimeout(()=>{getTimeOut()},(delay-10)*1e3),this._bodyActivityHandler=()=>{setAction()},["scroll","click","mousemove","keydown"].forEach(type=>document.body.addEventListener(type,this._bodyActivityHandler)),document.querySelectorAll(".close-before").forEach(event=>{event.addEventListener("click",()=>{clearTimeout(this._popupTimer),["scroll","click","mousemove","keydown"].forEach(type=>document.body.removeEventListener(type,this._bodyActivityHandler)),element.classList.remove("open"),element.setAttribute("aria-hidden","true"),element.setAttribute("inert",""),this.teardownPopupFocus(),document.documentElement.classList.remove("open-byl"),element._a11yOpener?.focus?.(),element._a11yOpener=null,setTimeout(()=>{document.documentElement.classList.remove("open-drawer"),root.style.removeProperty("padding-right")},550)})});const getTimeOut=()=>{if(action=action+1,action>=1){document.documentElement.classList.add("open-drawer","open-byl"),root.style.setProperty("padding-right",getScrollBarWidth.init()+"px"),element._a11yOpener=document.activeElement,element.removeAttribute("inert"),element.setAttribute("aria-hidden","false"),element.classList.add("open");const utils=window.A11yFocusUtils;utils?(this._focusTrapHandler=utils.trapFocus(element),document.addEventListener("keydown",this._focusTrapHandler,!0),requestAnimationFrame(()=>utils.moveFocusToFirst(element))):requestAnimationFrame(()=>element.querySelector(".close-before")?.focus());const cp=element.querySelectorAll(".discount");
24cp!==null&&cp.forEach(e=>{e.addEventListener("click",el=>{el.preventDefault(),navigator.clipboard.writeText(e?.dataset.code),e.classList.add("action-copy"),setTimeout(()=>{e.classList.remove("action-copy")},1500)})})}}}}teardownPopupFocus(){this._focusTrapHandler&&(document.removeEventListener("keydown",this._focusTrapHandler,!0),this._focusTrapHandler=null)}}customElements.define("before-you-leave",BeforeYouLeave);class MiniCartRemoveButton extends HTMLElement{constructor(){super(),this.addEventListener("click",event=>{event.preventDefault();const wishlist_items=JSON.parse(localStorage.getItem("glozin__wishlist-items")),productHandle=this.dataset.productHandle;let index=wishlist_items?.indexOf(productHandle);this.classList.contains("action-add-wishlist")?index==-1||index==null?(this.closest(".cart-item").querySelector(".minicart__wishlist").style.display="block",this.closest(".cart-item").querySelector(".minicart__product-info").style.display="none"):this.closest("cart-notification").updateQuantity(this.dataset.index,0):this.closest("cart-notification").updateQuantity(this.dataset.index,0)})}}customElements.define("mini-cart-remove-button",MiniCartRemoveButton);class MiniCartWishlistAction extends HTMLElement{constructor(){super(),this.actionRemoveWishlist(),this.actionAddWishlist(),this.actionClose(),this.querySelectorAll('[role="button"]').forEach(control=>{control.addEventListener("keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),control.click())})})}actionRemoveWishlist(){this.querySelector(".btn-minicart__remove-js").addEventListener("click",event=>{event.preventDefault();const target=event.currentTarget;this.eventRemove(target)})}actionAddWishlist(){this.querySelector(".btn-minicart__add-wishlist-js").addEventListener("click",event=>{event.preventDefault();const target=event.currentTarget,localListProductIds=localStorage.getItem("glozin__wishlist-items");let listProductIds=[],productId=target.dataset.productId;if(localListProductIds){const parseLocalListProductIds=JSON.parse(localListProductIds);parseLocalListProductIds.includes(productId)?listProductIds.push(...parseLocalListProductIds):listProductIds.push(...parseLocalListProductIds,productId)}else listProductIds.push(productId);const stringifyListProductIds=JSON.stringify(listProductIds);localStorage.setItem("glozin__wishlist-items",stringifyListProductIds),this.eventRemove(target)})}eventRemove(target){document.querySelector("cart-notification").updateQuantity(target.dataset.index,0)}actionClose(){document.querySelectorAll(".cart-close-wishlist").forEach(items=>{items.addEventListener("click",e=>{const target=e.currentTarget;e.preventDefault(),target.closest(".cart-item").querySelector(".minicart__wishlist").style.display="none",target.closest(".cart-item").querySelector(".minicart__product-info").style.display="block"})})}}customElements.define("minicart-wishlist-action",MiniCartWishlistAction);class CookieBar extends HTMLElement{constructor(){super(),this.init()}init(){var _this=this;getCookie("cookie_bar")||this.classList.remove("hidden"),this.querySelectorAll(".cookie-dismiss").forEach(closeCookie=>{closeCookie.addEventListener("click",e=>{e.preventDefault();const target=e.currentTarget;_this.remove(),target.id=="cookie-refuse"?setCookie("cookie_bar","dismiss",7):setCookie("cookie_bar","dismiss",30)},!1)})}}customElements.define("cookie-bar",CookieBar);class TermsConditions extends PopupBase{constructor(){super(),this.init()}init(){const terms=this.querySelector("a");terms&&terms.addEventListener("click",e=>{e.preventDefault();const popup=document.querySelector("#popup-terms-conditions");if(popup){const header=popup.getAttribute("data-text");this.initPopup(popup.querySelector(".terms-conditions-content").outerHTML,`<h3 class="title-popup h5 my-0 px-20 px-md-30 py-20 border-bottom">${header}</h3>`)}});const conditions=this.querySelector(".conditions_form_minicart")||this.querySelector(".conditions_form_product"),bpb=document.querySelector(".btn-checkout"),dynamicCheckout=this.closest("product-form")?.querySelector(".btn-checkout-dynamic");conditions&&(getCookie("term_conditions")&&(conditions.setAttribute("checked",""),bpb&&bpb.removeAttribute("disabled"),dynamicCheckout&&dynamicCheckout.classList.remove("disabled")),conditions.addEventListener("change",event=>{bpb&&(event.currentTarget.checked?(bpb.removeAttribute("disabled"),setCookie("term_conditions",1,1)):(bpb.setAttribute("disabled",""),deleteCookie("term_conditions"))),dynamicCheckout&&(event.currentTarget.checked?(dynamicCheckout.classList.remove("disabled"),setCookie("term_conditions",1,1)):(dynamicCheckout.classList.add("disabled"),deleteCookie("term_conditions")))}))}}customElements.define("terms-conditions",TermsConditions);var BlsGlozinAdminLi=(function(){return{init:function(){this.BlsCheckLi()},BlsCheckLi:function(){const _this=this;if(typeof glozin_app=="object"){if(glozin_app.mode==="admin")if(glozin_app.action==="active"){if(_this.checkCookie(glozin_app.lic)===!1){let encrypted="";glozin_app._e&&(encrypted=glozin_app._e),_this.BlsActive(encrypted)}}else{const url="https://api.nextsky.co/glozin/api/remove-license/?code="+glozin_app.lic+"&domain="+glozin_app.shop;fetch(url).then(response=>response.json()).then(responseText=>{if(responseText){const dateCreate=new Date(new Date().getTime()-36e6);_this.setCookie(glozin_app.lic,dateCreate)}_this.BlsRenderHtml(3)}
24).catch(e=>{console.warn(e)})}}else _this.BlsRenderHtml(0)},BlsRenderHtml:function(cs){const shop=window.location.hostname.replace(/\./g,"-");if(document.querySelector("#bls__"+shop))document.querySelector("#bls__"+shop).remove();else{const container=document.createElement("DIV"),wrapper=document.createElement("DIV"),title=document.createElement("h3"),introText=document.createElement("p"),messages={1:"This purchase code was activated for another domain!",2:"This purchase code is invalid!",3:"Purchase Code deleted successfully!",0:"Welcome Tayler - Shopify Themes OS 2.0 \u{1F389} "};title.textContent=messages[cs]||messages[0],title.setAttribute("class",`msg-${cs}`),introText.textContent="Follow these simple steps to use Glozin theme:";const stepElements=[{title:"Step 1: Add Glozin theme file to your 'Online store' > 'Theme'.",content:""},{title:"Step 2: Insert purchase code",content:"Go to 'Theme setting' > 'Purchase code' to insert your purchase code."},{title:"Step 3: Activate purchase code",content:"Go to 'Theme setting' > 'Purchase code action' and select 'Active purchase code'."}].map((step,index)=>{const stepEl=document.createElement("DIV");stepEl.setAttribute("class",`step-${index+1}`);const heading=document.createElement("h5");if(heading.textContent=step.title,stepEl.appendChild(heading),step.content){const content=document.createElement("p");content.textContent=step.content,stepEl.appendChild(content)}return stepEl}),purchaseLink=document.createElement("a");purchaseLink.setAttribute("target","_blank"),purchaseLink.setAttribute("class","popup-btn"),purchaseLink.setAttribute("href","https://nextsky.gitbook.io/glozin-theme/get-started/purchase-code-and-activation"),purchaseLink.textContent="\u{1F449} Get Glozin purchase code",stepElements[1].appendChild(purchaseLink),wrapper.appendChild(title),wrapper.appendChild(introText),stepElements.forEach(step=>wrapper.appendChild(step)),container.setAttribute("id","bls__not-active"),container.appendChild(wrapper),setInterval(()=>{document.getElementById("bls__not-active")?document.getElementById("bls__not-active").setAttribute("style","display: block !important;"):document.querySelector("body").appendChild(container)},1e3)}},BlsActive:function(encrypted){const _this=this,salt=glozin_app._s||glozin_app.shop+"GlzSalt25",url="https://api.nextsky.co/glozin/api/check-license/?code="+glozin_app.lic+"&domain="+glozin_app.shop+"&e="+encodeURIComponent(encrypted)+"&s="+encodeURIComponent(salt);fetch(url).then(response=>response.json()).then(responseText=>{if(responseText.d===!1)_this.BlsRenderHtml(responseText.s);else if(responseText.d===!0){const dateCheck=new Date(new Date().getTime()+36e6);_this.setCookie(glozin_app.lic,dateCheck)}else responseText.d==="err"&&console.warn(responseText.err?responseText.err.message:"Please contact to server's adminstrator!!!")}).catch(e=>{console.warn(e)})},setCookie:function(cvalue,d){const v=btoa(cvalue);document.cookie="UHVyY2hhc2VDb2Rl="+v+";expires="+d+";path=/"},checkCookie:function(val){const v=atob(getCookie("UHVyY2hhc2VDb2Rl"));return val.length!==0&&v==val}}})();class QuickView extends PopupBase{constructor(){super(),this.html=null}onThisClick(){this.classList.add("loading"),fetch(this.url).then(response=>response.text()).then(text=>{this.html=parser.parseFromString(text,"text/html").querySelector("#shopify-section-product-quickview .product-quickview__content"),this.html&&(this.loadScripts(this.html),this.html.classList.remove("hidden"),this.initPopup(this.html),typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(this.html))}).finally(()=>{Shopify.PaymentButton.init(),document.querySelector('div[data-animation="slide_in"')||BlsLazyloadImg.init(),this.classList.remove("loading")}).catch(e=>{this.classList.remove("loading"),console.error(e)})}loadScripts(html){html.querySelectorAll("script").forEach(script=>{const newScript=document.createElement("script");newScript.src=script.src,newScript.textContent=script.textContent,document.body.appendChild(newScript).parentNode.removeChild(newScript)})}}class ButtonQuickView extends QuickView{constructor(){super(),this.url=this.dataset.url,this.init()}init(){this.addEventListener("click",this.onThisClick.bind(this)),this.addEventListener("keydown",handleCustomControlKeydown)}}customElements.define("button-quickview",ButtonQuickView);class ButtonSelectOptions extends QuickView{constructor(){super(),this.url=this.dataset.url,this.init()}init(){this.addEventListener("click",this.onThisClick.bind(this)),this.addEventListener("keydown",handleCustomControlKeydown)}}customElements.define("select-option",ButtonSelectOptions);class ButtonWishlist extends HTMLElement{constructor(){super(),this.productId=this.dataset.productId,this.action=this.dataset.action||"remove",this.addTooltip=this.dataset.tooltipAdd||"Add to wishlist",this.removeTooltip=this.dataset.tooltipRemove||"Remove from wishlist",this.redirectTooltip=this.dataset.tooltipRedirect||"Browse wishlist",this.tooltipDiv=this.querySelector(".tooltip-content"),this.init()}init(){this.initializeWishlistStatus(),this.addEventListener("click",this.onThisClick.bind(this)),this.addEventListener("keydown",handleCustomControlKeydown)}initializeWishlistStatus(){const localListProductIds=localStorage.getItem("glozin__wishlist-items");if(!localListProductIds)return;JSON.parse(localListProductIds).includes(this.productId)&&(this.classList.add("active"),this.tooltipDiv&&(this.action==="remove"?this.tooltipDiv.textContent=this.removeTooltip:this.tooltipDiv.textContent=this.redirectTooltip))}actionWhenClicked(allThisProductIds,isAdd){allThisProductIds.forEach(_this=>{if(isAdd===!0){_this.classList.add("active");const tooltipDiv=_this.querySelector(".tooltip-content");tooltipDiv&&(this.action==="remove"?tooltipDiv.textContent=this.removeTooltip:tooltipDiv.textContent=this.redirectTooltip)}else{const tooltipDiv=_this.querySelector(".tooltip-content");tooltipDiv&&(tooltipDiv.textContent=this.addTooltip),_this.classList.remove("active")}})}onThisClick(){const localListProductIds=localStorage.getItem("glozin__wishlist-items"),allThisProductIds=document.querySelectorAll(`button-wishlist[data-product-id="${this.productId}"]`);let listProductIds=[];if(!this.productId)return;if(localListProductIds&&allThisProductIds.length>0){const parseLocalListProductIds=JSON.parse(localListProductIds);if(!parseLocalListProductIds.includes(this.productId))listProductIds.push(...parseLocalListProductIds,this.productId),this.actionWhenClicked(allThisProductIds,!0);else if(this.action)if(this.action==="remove"){const indexOfProductId=parseLocalListProductIds.indexOf(this.productId);parseLocalListProductIds.splice(indexOfProductId,1),listProductIds.push(...parseLocalListProductIds),this.closest(".wishlist-page-main")?(this.closest(".wishlist-list").remove(),document.querySelectorAll(".wishlist-page-section .product-item__action button-wishlist").length<1&&document.querySelector(".wishlist-no-product-js").classList.remove("hidden")):this.actionWhenClicked(allThisProductIds,!1)}else listProductIds.push(...parseLocalListProductIds),window.location.href=`${window.shopUrl}${window.Shopify.routes.root}pages/wishlist`;else listProductIds.push(...parseLocalListProductIds)}else listProductIds.push(this.productId),this.actionWhenClicked(allThisProductIds,!0);const stringifyListProductIds=JSON.stringify(listProductIds);localStorage.setItem("glozin__wishlist-items",stringifyListProductIds),wishlistHeader.init()}}customElements.define("button-wishlist",ButtonWishlist);class ButtonCompare extends HTMLElement{constructor(){super(),this.productId=this.dataset.productId,this.action=this.dataset.action||"remove",this.addTooltip=this.dataset.tooltipAdd||"Compare",this.removeTooltip=this.dataset.tooltipRemove||"Remove from compare",this.redirectTooltip=this.dataset.tooltipRedirect||"Browse compare",this.tooltipDiv=this.querySelector(".tooltip-content"),this.action=this.dataset.action||"remove",this.init()}init(){this.initializeCompareStatus(),this.addEventListener("click",this.onThisClick.bind(this)),this.addEventListener("keydown",handleCustomControlKeydown)}initializeCompareStatus(){const localListProductIds=localStorage.getItem("glozin__compare-items");if(!localListProductIds)return;JSON.parse(localListProductIds).includes(this.productId)&&(this.classList.add("active"),this.tooltipDiv&&(this.action==="remove"?this.tooltipDiv.textContent=this.removeTooltip:this.tooltipDiv.textContent=this.redirectTooltip))}actionWhenClicked(allThisProductIds,isAdd){allThisProductIds.forEach(_this=>{if(isAdd===!0){_this.classList.add("active");const tooltipDiv=_this.querySelector(".tooltip-content");tooltipDiv&&(this.action==="remove"?tooltipDiv.textContent=this.removeTooltip:tooltipDiv.textContent=this.redirectTooltip)}else{const tooltipDiv=_this.querySelector(".tooltip-content");tooltipDiv&&(tooltipDiv.textContent=this.addTooltip),_this.classList.remove("active")}})}onThisClick(){const localListProductIds=localStorage.getItem("glozin__compare-items"),allThisProductIds=document.querySelectorAll(`button-compare[data-product-id="${this.productId}"]`);let listProductIds=[];if(!this.productId)return;if(localListProductIds&&allThisProductIds.length>0){const parseLocalListProductIds=JSON.parse(localListProductIds);if(!parseLocalListProductIds.includes(this.productId))listProductIds.push(...parseLocalListProductIds,this.productId),this.actionWhenClicked(allThisProductIds,!0);else if(this.action)if(this.action==="remove"){const indexOfProductId=parseLocalListProductIds.indexOf(this.productId);parseLocalListProductIds.splice(indexOfProductId,1),listProductIds.push(...parseLocalListProductIds),this.actionWhenClicked(allThisProductIds,!1)}else listProductIds.push(...parseLocalListProductIds),window.location.href=`${window.shopUrl}${window.Shopify.routes.root}pages/compare`;else listProductIds.push(...parseLocalListProductIds)}else listProductIds.push(this.productId),this.actionWhenClicked(allThisProductIds,!0);const stringifyListProductIds=JSON.stringify(listProductIds);localStorage.setItem("glozin__compare-items",stringifyListProductIds)}}customElements.define("button-compare",ButtonCompare);class SwatchFunctions extends SwatchInit{constructor(){super(),this.init()}
24showColorSwatch(){const _this=this;_this.show_color_swatch!=null&&(_this.show_color_swatch.addEventListener("keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),event.currentTarget.click())}),_this.show_color_swatch.addEventListener("click",e=>{e.currentTarget.classList.add("hidden"),e.currentTarget.setAttribute("aria-hidden","true"),e.currentTarget.setAttribute("tabindex","-1"),_this.querySelectorAll(".product__color-swatches--js.hidden").forEach(btn=>{btn.classList.remove("hidden"),btn.removeAttribute("aria-hidden"),btn.setAttribute("tabindex","0"),setTimeout(()=>{btn.classList.remove("opacity-0")},100)})}))}init(){this.querySelectorAll(".product__color-swatches--js").forEach(btn=>{this.checkSwatches(btn)}),this.initAction(),this.querySelectorAll('input[type="radio"]:checked').forEach(input=>{input.dispatchEvent(new Event("change",{bubbles:!0}))}),this.equalizeSpanWidths()}equalizeSpanWidths(){requestAnimationFrame(()=>{const items=this.querySelectorAll(".product__color-swatches--js > span");if(items.length<2)return;let maxWidth=0;items.forEach(item=>{item.style.minWidth="";const width=item.getBoundingClientRect().width;width>maxWidth&&(maxWidth=width)}),items.forEach(item=>{item.style.minWidth=Math.ceil(maxWidth)+"px"})})}initAction(){this.addEventListener("change",this.onVariantChange)}onVariantChange(e){this.productTarget=this.closest(".product__item-js");const target=e.target,variantQtyData=JSON.parse(this.productTarget.querySelector(".productVariantsQty").textContent);this.groupFunctionsInit(),this.currentVariant?this.groupFunctionsAvailable(variantQtyData,target):this.groupFunctionsUnavailable(target)}groupFunctionsInit(){this.updateOptions(),this.updateMasterId(),this.updatePickupAvailability(),this.updateVariantStatuses()}groupFunctionsUnavailable(target){this.toggleAddButton(!0,"",!0),this.setUnavailable(target)}groupFunctionsAvailable(variantQtyData,target){this.updateURL(),this.updateVariantInput(),this.updatePrice(this.productTarget),this.renderProductInfor(this.productTarget,variantQtyData,target),this.updateShareUrl(),this.setAvailable()}updatePrice(productTarget){if(!this.currentVariant||!productTarget)return;const p=document.getElementById(`price-${this.dataset.section}`);p&&p.classList.remove("visibility-hidden");const compare_at_price=this.currentVariant.compare_at_price,price=this.currentVariant.price,unit_price=this.currentVariant.unit_price,unit_price_measurement=this.currentVariant.unit_price_measurement,price_format=Shopify.formatMoney(this.currentVariant.price,themeGlobalVariables.settings.money_format);if(unit_price&&unit_price_measurement){const price_num=Shopify.formatMoney(unit_price,themeGlobalVariables.settings.money_format),price_unit=unit_price_measurement.reference_value!=1?unit_price_measurement.reference_value:unit_price_measurement.reference_unit;productTarget.querySelector(".unit-price .number")&&(productTarget.querySelector(".unit-price .number").innerHTML=price_num),productTarget.querySelector(".unit-price .unit")&&(productTarget.querySelector(".unit-price .unit").innerHTML=price_unit)}productTarget.querySelector(".price-regular .price")&&(productTarget.querySelector(".price-regular .price").innerHTML=price_format);const bls__price=productTarget.querySelector(".card-product-price");if(bls__price){if(!bls__price.querySelector(".compare-price")){var ps=document.createElement("div"),sp=document.createElement("span"),cp=document.createElement("s");cp.classList.add("price-item","compare-price"),sp.appendChild(cp),ps.appendChild(sp),ps.classList.add("price-regular"),productTarget.querySelector(".card-product-price")&&productTarget.querySelector(".card-product-price").appendChild(ps)}const cpp=bls__price.querySelector(".compare-price");if(cpp){if(compare_at_price&&compare_at_price>price){const compare_format=Shopify.formatMoney(compare_at_price,themeGlobalVariables.settings.money_format);cpp.innerHTML=compare_format,bls__price.querySelector(".price-regular")&&bls__price.querySelector(".price-regular").classList.add("primary-color"),bls__price.querySelector(".price-regular .price")&&bls__price.querySelector(".price-regular .price").classList.add("price--special")}else cpp.innerHTML="",bls__price.querySelector(".price-regular")&&bls__price.querySelector(".price-regular").classList.remove("primary-color"),bls__price.querySelector(".price-regular .price")&&(bls__price.querySelector(".price-regular .price").innerHTML=price_format,bls__price.querySelector(".price-regular .price").classList.remove("price--special"));this.currentVariant.available||bls__price.classList.add("price--sold-out")}}}toggleAddButton(disable=!0,text,modifyClass=!0){const productForm=d
24ocument.getElementById(`product-form-${this.dataset.section}`);if(!productForm)return;const addButton=productForm.querySelector('[name="add"]'),addButtonText=productForm.querySelector('[name="add"] > span');addButton&&(disable?(addButton.setAttribute("disabled","disabled"),text&&(addButtonText.textContent=text)):(addButton.removeAttribute("disabled"),addButtonText.textContent=window.variantStrings.addToCart))}setUnavailable(target){const button=document.getElementById(`product-form-${this.dataset.section}`),addButton=button.querySelector('[name="add"]'),addButtonText=button.querySelector('[name="add"] > span'),price=document.getElementById(`price-${this.dataset.section}`),inventory=document.getElementById(`Inventory-${this.dataset.section}`),sku=document.getElementById(`Sku-${this.dataset.section}`),pricePerItem=document.getElementById(`Price-Per-Item-${this.dataset.section}`),volumeNote=document.getElementById(`Volume-Note-${this.dataset.section}`),volumeTable=document.getElementById(`Volume-${this.dataset.section}`),qtyRules=document.getElementById(`Quantity-Rules-${this.dataset.section}`);if(target){const fieldset=target.closest("fieldset"),val=target.value,optionSelected=fieldset.querySelector(".option_value");optionSelected.textContent=val}addButton&&(addButtonText.textContent=window.variantStrings.unavailable,price&&price.classList.add("hidden"),inventory&&inventory.classList.add("hidden"),sku&&sku.classList.add("hidden"),pricePerItem&&pricePerItem.classList.add("hidden"),volumeNote&&volumeNote.classList.add("hidden"),volumeTable&&volumeTable.classList.add("hidden"),qtyRules&&qtyRules.classList.add("hidden"))}setAvailable(){const price=document.getElementById(`price-${this.dataset.section}`),inventory=document.getElementById(`Inventory-${this.dataset.section}`),sku=document.getElementById(`Sku-${this.dataset.section}`),pricePerItem=document.getElementById(`Price-Per-Item-${this.dataset.section}`),volumeNote=document.getElementById(`Volume-Note-${this.dataset.section}`),volumeTable=document.getElementById(`Volume-${this.dataset.section}`),qtyRules=document.getElementById(`Quantity-Rules-${this.dataset.section}`);price&&price.classList.contains("hidden")&&price.classList.remove("hidden"),inventory&&inventory.classList.contains("hidden")&&inventory.classList.remove("hidden"),sku&&sku.classList.contains("hidden")&&sku.classList.remove("hidden"),pricePerItem&&pricePerItem.classList.contains("hidden")&&pricePerItem.classList.remove("hidden"),volumeNote&&volumeNote.classList.contains("hidden")&&volumeNote.classList.remove("hidden"),volumeTable&&volumeTable.classList.contains("hidden")&&volumeTable.classList.remove("hidden"),qtyRules&&qtyRules.classList.contains("hidden")&&qtyRules.classList.remove("hidden")}updateMedia(variantGroup=!1){if(!this.productTarget)return;const mediaGalleries=this.productTarget.querySelector("media-gallery"),layout=mediaGalleries?.dataset.layout;if(layout)if(layout==="thumbnail"){const swiper=mediaGalleries.querySelector("slide-with-thumbs");if(!swiper)return;const slide_items=swiper.querySelectorAll(".swiper-wrapper-preview .media-gallery__image.swiper-slide");if(slide_items.length==0||!this.currentVariant?.featured_media)return;const targetIndex=Array.from(slide_items).findIndex(e=>{const mediaId=e.getAttribute("data-media-id");return mediaId&&mediaId===`${this.dataset.section}-${this.currentVariant.featured_media.id}`});if(targetIndex!==-1){const position=slide_items[targetIndex].getAttribute("data-position"),gotoIndex=variantGroup?targetIndex:position-1;typeof swiper.functionGoto=="function"?swiper.functionGoto(gotoIndex):customElements.whenDefined("slide-with-thumbs").then(()=>{typeof swiper.functionGoto=="function"&&swiper.functionGoto(gotoIndex)})}}else{const mediaElement=document.querySelector(`[data-media-id="${this.dataset.section}-${this.currentVariant.featured_media.id}"]`);mediaElement&&mediaElement.scrollIntoView({behavior:"smooth",block:"center"})}}updateMediaSticky(){if(!this.productTarget||!this.currentVariant)return;const stickyAddCart=this.productTarget.querySelector("sticky-add-cart");if(!stickyAddCart||!this.currentVariant.featured_media)return;const imgQuery=stickyAddCart.querySelector("img");imgQuery.src=this.currentVariant.featured_media.preview_image.src,imgQuery.removeAttribute("srcset"),imgQuery.removeAttribute("sizes")}renderProductInfor(productTarget,variantQtyData,target){if(!this.currentVariant||!productTarget)return;let qty=0,percent=0,sale=!1,soldOut=!1,pre_order=!1,av=this.currentVariant.available,sku=this.currentVariant.sku,im=this.currentVariant.inventory_management;const compare_at_price=this.currentVariant.compare_at_price,price=this.currentVariant.price;let avaiable=productTarget.querySelector(".available-value"),sku_area=productTarget.querySelector(".product__sku");const productDetailPicker=productTarget.querySelector(".product-detail__variant-picker");if(productDetailPicker){const type=productDetailPicker.dataset.type||"swatches",updateOptionValues=selector=>{productTarget.querySelectorAll(selector).forEach((element,index)=>{const optionValue=this.currentVariant[`option${index+1}`];optionValue&&(element.innerHTML=optionValue)})};if(type==="swatches")updateOptionValues(".option_value");else{updateOptionValues(".option_drop_value .option_value"),updateOptionValues("swatch-dropdown-select-value .option_value");const closestSwatchDropdown=target.closest("swatch-dropdown");closestSwatchDropdown&&closestSwatchDropdown.classList.contains("active")&&closestSwatchDropdown.classList.remove("active")}}sku_area&&(sku_area.innerHTML=sku||"N/A"),variantQtyData.find(variantQty=>{variantQty.id===this.currentVariant.id&&(qty=Number(variantQty.qty)||0,av=variantQty.available,im=variantQty.mamagement===""?null:variantQty.mamagement)});const countdown=document.querySelector("stock-countdown");if(countdown){const itemsLeft=countdown.dataset.itemsLeft,message=countdown.dataset.message;if(itemsLeft>=qty&&message&&qty>=1){countdown.classList.add("block"),countdown.classList.remove("hidden");const qt=countdown.querySelector("span.count"),progressbar=countdown.querySelector(".progressbar-stock");let widthProgress;qty/itemsLeft*100>100?widthProgress=100:widthProgress=qty/itemsLeft*100,progressbar.style.setProperty("--percent","100%"),setTimeout(()=>{progressbar.style.setProperty("--percent",`${widthProgress}%`)},850),qt&&(qt.innerHTML=qty)}else countdown.classList.remove("block"),countdown.classList.add("hidden")}const typePercent=productTarget.querySelector(".product__badges-type-percent");if(compare_at_price&&compare_at_price>price&&(sale=!0,typePercent?percent=(compare_at_price-price)/compare_at_price*100:percent=compare_at_price-price),im===null||im===""||im===void 0)soldOut=!1,pre_order=!1,avaiable&&(avaiable.innerHTML=window.variantStrings.inStock);else if(av){const preOrderEnabled=!!productTarget.querySelector('product-form[data-pre-order-enabled="true"]');qty<1&&preOrderEnabled?(pre_order=!0,avaiable&&(avaiable.innerHTML=window.variantStrings.preOrder)):(pre_order=!1,avaiable&&(avaiable.innerHTML=window.variantStrings.inStock))}else soldOut=!0,avaiable&&(avaiable.innerHTML=window.variantStrings.outStock);this.renderLabel(sale,pre_order,soldOut,percent,productTarget),this.renderBtnStatus(productTarget,im,av,qty,pre_order)}renderLabel(sale,pre_order,soldOut,percent,productTarget){const label=productTarget.querySelector(".product__badges");if(!label)return;const dsale=label.querySelector(".product__badges-sale"),dsoldout=label.querySelector(".product__badges-sold-out"),dpreorder=label.querySelector(".product__badges-pre-order"),show_sale=label.dataset.showSale==="true",show_sold_out=label.dataset.showSoldOut==="true",show_pre_order=label.dataset.showPreorder==="true";if(sale&&show_sale&&dsale){const prd=Shopify.formatMoney(percent,window.cartStrings?.money_format);dsale.classList.contains("product__badges-type-percent")?dsale.innerHTML=`-${percent.toFixed(0)}%`:dsale.classList.contains("product__badges-type-price")?dsale.innerHTML=`${window.variantStrings.save?window.variantStrings.save:"Save"} ${prd}`:dsale.innerHTML=window.variantStrings.sale_label||"Sale",dsale.classList.remove("hidden-important")}else dsale&&dsale.classList.add("hidden-important");const regionOut=label.dataset.regionOut==="true";soldOut&&show_sold_out&&dsoldout&&!regionOut?(dsoldout.classList.remove("hidden-important"),dpreorder&&dpreorder.classList.add("hidden-important")):(dsoldout&&dsoldout.classList.add("hidden-important"),pre_order&&show_pre_order&&dpreorder?dpreorder.classList.remove("hidden-important"):dpreorder&&dpreorder.classList.add("hidden-important"));const productBadgesScrolling=productTarget.querySelector(".product__badges-sale-scrolling");if(productBadgesScrolling&&sale){const dataBadgesScrolling=productBadgesScrolling.dataset.textProductScrolling;productBadgesScrolling.querySelectorAll(".content-badges-scrolling").forEach(content=>{content.innerText=dataBadgesScrolling.replace("[percent_sale]",`${percent.toFixed(0)}%`)})}}renderBtnStatus(productTarget,im,av,qty,pre_order=!1){if(!productTarget)return;let btns_add_cart=productTarget.querySelectorAll(".product_submit_button");productTarget.querySelectorAll("product-form").forEach(productForm=>{productForm.dataset.available=av?"true":"false",productForm.dataset.preOrder=pre_order?"true":"false"}),btns_add_cart.forEach(btn_add_cart=>{btn_add_cart.querySelector(".btn-label")&&(av?(btn_add_cart.querySelector(".btn-label").innerHTML=pre_order?window.variantStrings.preOrder:window.variantStrings.addToCart,btn_add_cart.disabled=!1):(btn_add_cart.querySelector(".btn-label").innerHTML=window.variantStrings.soldOut,btn_add_cart.disabled=!0))})}updateVariantStatuses(){const selectedOptionOneVariants=this.variantData.filter(variant=>this.querySelector(":checked").value===variant.option1),inputWrappers=[...this.querySelectorAll(".product-form__input")];
24inputWrappers.forEach((option,index)=>{if(index===0)return;const optionInputs=[...option.querySelectorAll('input[type="radio"], option')],previousOptionSelected=inputWrappers[index-1].querySelector(":checked").value,availableOptionInputsValue=selectedOptionOneVariants.filter(variant=>variant.available&&variant[`option${index}`]===previousOptionSelected).map(variantOption=>variantOption[`option${index+1}`]);this.setInputAvailability(optionInputs,availableOptionInputsValue)})}setInputAvailability(elementList,availableValuesList){elementList.forEach(element=>{const value=element.getAttribute("value"),availableElement=availableValuesList.includes(value);element.tagName==="INPUT"?element.classList.toggle("option-disabled",!availableElement):element.tagName==="OPTION"&&(element.innerText=availableElement?value:window.variantStrings.unavailable_with_option.replace("[value]",value))})}updateOptions(){this.options=[],Array.from(this.querySelectorAll("select, fieldset"),element=>{element.tagName==="SELECT"&&element.value.split(" / ").forEach(item=>this.options.push(item)),element.tagName==="FIELDSET"&&this.options.push(Array.from(element.querySelectorAll("input")).find(radio=>radio.checked)?.value)})}updateMasterId(){this.currentVariant=this.getVariantData().find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateURL(){if(!this.currentVariant||this.dataset.updateUrl==="false")return;const url=new URL(window.location.href);url.searchParams.set("variant",this.currentVariant.id),window.history.replaceState({},"",url.toString())}updateVariantInput(){document.querySelectorAll(`#product-form-${this.dataset.section}, #sticky-addcart-form-${this.dataset.section}`).forEach(productForm=>{const input=productForm.querySelector('input[name="id"]');input.value=this.currentVariant.id,input.dispatchEvent(new Event("change",{bubbles:!0}))})}updateShareUrl(){const copyButton=document.getElementById(`Share-${this.dataset.section}`);if(!copyButton||!copyButton.updateUrl)return;copyButton.updateUrl(`${window.shopUrl}${this.dataset.url}?variant=${this.currentVariant.id}`);const copyParent=copyButton.closest(".share__content");if(!copyParent)return;const copySpan=copyParent.querySelector(".copy__url");copySpan&&(copySpan.innerHTML=`${window.shopUrl}${this.dataset.url}?variant=${this.currentVariant.id}`)}updatePickupAvailability(){const pickUpAvailability=document.querySelector("pickup-availability");pickUpAvailability&&(this.currentVariant&&this.currentVariant.available?pickUpAvailability.fetchAvailability(this.currentVariant.id):(pickUpAvailability.removeAttribute("available"),pickUpAvailability.innerHTML=""))}getVariantData(){return this.variantData=this.variantData||JSON.parse(this.querySelector('[type="application/json"]').textContent),this.variantData}}class SwatchDropdownSelectValue extends HTMLElement{constructor(){super(),this.addEventListener("click",this.activeFilterSort.bind(this),!1)}activeFilterSort(){document.querySelectorAll(".select-custom.active").forEach(element=>{element!==this.closest(".select-custom")&&element.classList.remove("active")}),this.closest(".select-custom").classList.contains("active")?this.closest(".select-custom").classList.remove("active"):this.closest(".select-custom").classList.add("active")}}customElements.define("swatch-dropdown-select-value",SwatchDropdownSelectValue);function handleClickOutside(event){event.target.closest(".select-custom")||document.querySelectorAll(".select-custom.active").forEach(element=>{element.classList.remove("active")})}document.addEventListener("click",handleClickOutside);class VariantRadios extends SwatchFunctions{constructor(){super(),this.show_color_swatch=this.querySelector(".show_color_swatch"),this.showColorSwatch()}init(){this.querySelectorAll(".product__color-swatches--js").forEach(btn=>{this.checkSwatches(btn),this.variantHover(btn),btn.addEventListener("click",this.onVariantChange.bind(this),!1),btn.addEventListener("keydown",event=>{(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),btn.click())})})}variantHover(e){if(!e.closest(".product-item"))return;const swiperElement=e.closest(".swiper");if(!swiperElement)return;let timeout;const handleMouseOut=()=>{swiperElement.classList.remove("show-tooltip")},handleMouseOver=()=>{swiperElement.classList.add("show-tooltip")};e.addEventListener("mouseout",handleMouseOut,!1),e.addEventListener("mouseover",handleMouseOver,!1),e.addEventListener("mouseenter",handleMouseOver,!1),e.addEventListener("mouseleave",handleMouseOut,!1)}onVariantChange(e){e.preventDefault();const target=e.currentTarget;this.productTarget=this.closest(".product__item-js"),this.position_swatch=target.dataset.position;const variantQtyData=JSON.parse(this.productTarget.querySelector(".productItemVariantsQty").textContent);target.classList.contains("active")||(target.closest(".product__color-swatches").querySelectorAll(".product__color-swatches--js").forEach(el=>{el.classList.remove("active"),el.setAttribute("aria-pressed","fal
24se")}),target.classList.add("active"),target.setAttribute("aria-pressed","true"),this.groupFunctionsInit(this.getVariantData()),this.currentVariant&&this.groupFunctionsAvailable(variantQtyData))}groupFunctionsInit(variantData){this.updateOptions(),this.updateMasterId(variantData)}groupFunctionsAvailable(variantQtyData){this.updatePrice(),this.updateMedia(),this.renderProductInfor(variantQtyData),this.updateSelectOptionUrl()}updateSelectOptionUrl(){if(!this.currentVariant||!this.productTarget)return;const selectOption=this.productTarget.querySelector("select-option");if(!selectOption)return;const newUrl=(selectOption.dataset.url||"").split("&variant=")[0]+"&variant="+this.currentVariant.id;selectOption.dataset.url=newUrl,selectOption.url=newUrl}updatePrice(){if(!this.currentVariant||!this.productTarget)return;const p=document.getElementById(`price-${this.dataset.section}`);p&&p.classList.remove("visibility-hidden");const compare_at_price=this.currentVariant.compare_at_price,price=this.currentVariant.price,unit_price=this.currentVariant.unit_price,unit_price_measurement=this.currentVariant.unit_price_measurement,price_format=Shopify.formatMoney(this.currentVariant.price,themeGlobalVariables.settings.money_format);if(unit_price&&unit_price_measurement){const price_num=Shopify.formatMoney(unit_price,themeGlobalVariables.settings.money_format),price_unit=unit_price_measurement.reference_value!=1?unit_price_measurement.reference_value:unit_price_measurement.reference_unit;this.productTarget.querySelector(".unit-price .number")&&(this.productTarget.querySelector(".unit-price .number").innerHTML=price_num),this.productTarget.querySelector(".unit-price .unit")&&(this.productTarget.querySelector(".unit-price .unit").innerHTML=price_unit)}this.productTarget.querySelector(".price-regular .price")&&(this.productTarget.querySelector(".price-regular .price").innerHTML=price_format);const bls__price=this.productTarget.querySelector(".card-product-price");if(bls__price){if(!bls__price.querySelector(".compare-price")){var ps=document.createElement("div"),sp=document.createElement("span"),cp=document.createElement("s");cp.classList.add("price-item","dark-gray","compare-price"),sp.appendChild(cp),ps.appendChild(sp),ps.classList.add("price-sale"),this.productTarget.querySelector(".card-product-price")&&this.productTarget.querySelector(".card-product-price").appendChild(ps)}const cpp=bls__price.querySelector(".compare-price");if(cpp){if(compare_at_price&&compare_at_price>price){const compare_format=Shopify.formatMoney(compare_at_price,themeGlobalVariables.settings.money_format);cpp.innerHTML=compare_format,bls__price.querySelector(".price-regular")&&bls__price.querySelector(".price-regular").classList.add("primary-color"),bls__price.querySelector(".price-regular .price")&&bls__price.querySelector(".price-regular .price").classList.add("price--special")}else cpp.innerHTML="",bls__price.querySelector(".price-regular")&&bls__price.querySelector(".price-regular").classList.remove("primary-color"),bls__price.querySelector(".price-regular .price")&&(bls__price.querySelector(".price-regular .price").classList.remove("price--special"),bls__price.querySelector(".price-regular .price").innerHTML=price_format);this.currentVariant.available||bls__price.classList.add("price--sold-out")}}}renderProductInfor(variantQtyData){if(!this.currentVariant||!this.productTarget)return;let qty=0,percent=0,sale=!1,soldOut=!1,pre_order=!1,av=!1,im=!1;const compare_at_price=this.currentVariant.compare_at_price,price=this.currentVariant.price,productTarget=this.productTarget,productBadgesScrolling=productTarget.querySelector(".product__badges-sale-scrolling"),typePercent=productTarget.querySelector(".product__badges-type-percent");variantQtyData.reduce((acc,item)=>{const existingItem=acc.find(i=>i.option===item.option);return existingItem?(existingItem.qty+=item.qty,item.available===!0&&(existingItem.available=!0),item.mamagement===""&&(existingItem.mamagement="")):acc.push(item),acc},[]).find(variantQty=>{variantQty.option===this.currentVariant.option1&&(qty=variantQty.qty,av=variantQty.available,im=variantQty.mamagement)}),compare_at_price&&compare_at_price>price&&(sale=!0,productBadgesScrolling||typePercent?percent=(compare_at_price-price)/compare_at_price*100:percent=compare_at_price-price),im===""?(soldOut=!1,pre_order=!1):av||(soldOut=!0),this.renderLabel(sale,pre_order,soldOut,percent,this.productTarget)}updateMasterId(variantData){return this.currentVariant=variantData.find(variant=>!variant.options.map((option,index)=>this.options[index]===option).includes(!1))}updateOptions(){this.options=Array.from(this.productTarget.querySelectorAll(".product__color-swatches--js.active"),select=>select.getAttribute("data-value")),this.variantData.find(variant=>{this.options.length==1&&{1:variant.option1,2:variant.option2,3:variant.option3}[this.position_swatch]===this.options[0]&&(this.options=variant.options)})}async updateMedia(){if(this.currentVariant){if(!this.productTarget.querySelector(".product__media img").classList.contains("hidden")){const productItem=this.productTarget.querySelector(".product__media img").closest(".product-item");(productItem.querySelector("video")||productItem.querySelector("iframe"))&&(this.productTarget.querySelector(".product__media img").classList.add("hidden"),productItem.querySelector("video")?.classList.remove("hidden"),productItem.querySelector("iframe")?.classList.remove("hidden"))}if(this.currentVariant.featured_media){if(this.productTarget.querySelector(".product__media img")&&this.productTarget.querySelector(".product__media img").removeAttribute("srcset"),this.productTarget.querySelector(".product__media img").classList.contains("hidden")){this.productTarget.querySelector(".product__media img").classList.remove("hidden");const productItem=this.productTarget.querySelector(".product__media img").closest(".product-item");(productItem.querySelector("video")||productItem.querySelector("iframe"))&&(productItem.querySelector("video")?.classList.add("hidden"),productItem.querySelector("iframe")?.classList.add("hidden"))}this.productTarget.querySelector(".product__media img")&&(await motion.animate(this.productTarget.querySelector(".product__media img"),{opacity:[1,0]},{duration:.1,easing:"ease-in"}),this.productTarget.querySelector(".product__media img").setAttribute("src",this.currentVariant.featured_media.preview_image.src),await new Promise(resolve=>{this.productTarget.querySelector(".product__media img").onload=()=>{resolve()}}),motion.animate(this.productTarget.querySelector(".product__media img"),{opacity:[0,1]},{duration:.1,easing:"ease-in"}))}}}}customElements.define("variant-radios",VariantRadios);class VariantRadiosDetail extends SwatchFunctions{constructor(){super()}groupFunctionsAvailable(variantQtyData,target){this.updateURL(),this.updateV
24ariantInput(),this.updatePrice(this.productTarget),this.renderProductInfor(this.productTarget,variantQtyData,target),this.closest(".product-quickview__content")?this.updateMediaQuickView():this.updateMedia(),this.updateShareUrl(),this.mapStickyDropdown(),this.setAvailable()}updateMediaQuickView(){if(!this.currentVariant)return;const container=this.closest(".product__item-js");if(!container)return;const productHandle=container.dataset.productHandle||this.dataset.productHandle,mediaContainer=container.querySelector("media-gallery");if(!productHandle||!mediaContainer)return;this._qvAbort&&this._qvAbort.abort(),this._qvAbort=new AbortController;const url=`${container.dataset.productUrl||`/products/${productHandle}`}?section_id=product-quickview&variant=${this.currentVariant.id}`;mediaContainer.classList.add("skeleton-loading","opacity-50"),fetch(url,{signal:this._qvAbort.signal}).then(r=>{if(!r.ok)throw new Error(r.status);return r.text()}).then(text=>{const newMedia=new DOMParser().parseFromString(text,"text/html").querySelector(".product__item-js media-gallery");if(newMedia){mediaContainer.innerHTML=newMedia.innerHTML;const swt=mediaContainer.querySelector("slide-with-thumbs");swt&&typeof swt.init=="function"&&(swt.globalSlide&&swt.globalSlide.destroy(!0,!0),swt.thumbnailSlide&&swt.thumbnailSlide.destroy(!0,!0),swt.init()),BlsLazyloadImg.init()}}).catch(e=>{e.name!=="AbortError"&&console.error(e)}).finally(()=>mediaContainer.classList.remove("skeleton-loading","opacity-50"))}mapStickyDropdown(){if(!this.currentVariant||!this.productTarget)return;const stickyAddCart=this.productTarget.querySelector("sticky-add-cart");if(!stickyAddCart)return;const select=stickyAddCart.querySelector("select"),detailRadio=this.productTarget.querySelector("variant-radios-detail, variant-group-detail");if(!(!select&&detailRadio)){for(let i=0;i<select.options.length;i++)if(select.options[i].value===this.currentVariant.title){select.options[i].selected=!0,detailRadio.querySelectorAll("fieldset").forEach((fieldset,index)=>{fieldset.querySelectorAll("input").forEach(input=>{input.removeAttribute("checked"),input.value===this.currentVariant[`option${index+1}`]&&(input.checked=!0)})});break}}}}customElements.define("variant-radios-detail",VariantRadiosDetail);class VariantRadiosSingle extends SwatchFunctions{constructor(){super()}groupFunctionsAvailable(variantQtyData){this.updateVariantInput(),this.updatePrice(this.productTarget),this.renderProductInfor(this.productTarget,variantQtyData),this.updateMedia()}}customElements.define("variant-radios-single",VariantRadiosSingle);class VariantGroupDetail extends VariantRadiosDetail{constructor(){super(),this._attachPreloadEvents()}_attachPreloadEvents(){this.preloadedImages=new Set,this.querySelectorAll("[data-preload-src]").forEach(swatch=>{swatch.addEventListener("mouseenter",event=>{const imageUrlToPreload=event.currentTarget.dataset.preloadSrc;if(imageUrlToPreload&&!this.preloadedImages.has(imageUrlToPreload)){const img=new Image;img.src=imageUrlToPreload,this.preloadedImages.add(imageUrlToPreload)}})})}onVariantChange(e){this.productTarget=this.closest(".product__item-js");const variantQtyData=JSON.parse(this.productTarget.querySelector(".productVariantsQty").textContent);this.groupFunctionsInit(),this.currentVariant?(this.closest(".product-quickview__content")?this.updateMediaQuickView():this.checkColorGroup(e),this.updateURL(),this.updateVariantInput(),this.updatePrice(this.productTarget),this.renderProductInfor(this.productTarget,variantQtyData,e.target),this.updateShareUrl(),this.mapStickyDropdown(),this.setAvailable()):(this.groupFunctionsUnavailable(e.target),this.checkColorGroup(e))}checkColorGroup(e){const colorString=this.productTarget.dataset.colorTrigger;if(colorString){const colorArray=colorString.split(","),colorSelector=this.productTarget.querySelector(`[data-value='${CSS.escape(e.target.value)}']`),dataName=colorSelector?.dataset.name;if(colorArray.includes(dataName||e.target.name)){const dataValue=colorSelector?.dataset.colorValue;this.updateMediaGroup(dataValue||e.target.value)}else this.updateMedia()}}updateMediaGroup(altValue){if(!this.currentVariant){console.error("updateMediaGroup called but this.currentVariant is not set.");return}const isQuickView=this.closest(".product-quickview__content")!==null,container=this.closest(".product__item-js");if(!container){console.error("Could not find parent .product__item-js container.");return}const productHandle=container.querySelector("[data-product-handle]")?.dataset.productHandle||this.dataset.productHandle,sectionId=container.dataset.section,mediaContainer=container.querySelector("media-gallery");if(!productHandle||!sectionId||!mediaContainer){console.error("Missing required data attributes from .product__item-js container.");return}mediaContainer.classList.add("skeleton-loading","opacity-50");let url;isQuickView?url=`${container.dataset.productUrl||`/products/${productHandle}`}?section_id=product-quickview&variant=${this.currentVariant.id}`:url=`/products/${productHandle}?section_id=${sectionId}&variant=${this.currentVariant.id}`,fetch(url).then(response=>{if(!response.ok)throw new Error(`Network response was not ok, status: ${response.status}`);return response.text()}).then(text=>{const newMediaContent=new DOMParser().parseFromString(text,"text/html").querySelector(".product__item-js media-gallery");if(newMediaContent){mediaContainer.innerHTML=newMediaContent.innerHTML;const imageZoom=container.dataset.zoom,zoomActionContainer=mediaContainer.querySelector("zoom-action");zoomActionContainer&&typeof zoomActionContainer.initDrift=="function"&&(zoomActionContainer.drift=null,imageZoom!=="open_lightbox"&&imageZoom!=="no_zoom"&&zoomActionContainer.initDrift(),imageZoom==="open_lightbox"&&zoomActionContainer.initLightBox());const slideWithThumbs=mediaContainer.querySelector("slide-with-thumbs");slideWithThumbs&&typeof slideWithThumbs.init=="function"&&(slideWithThumbs.globalSlide&&slideWithThumbs.globalSlide.destroy(!0,!0),slideWithThumbs.thumbnailSlide&&slideWithThumbs.thumbnailSlide.destroy(!0,!0),slideWithThumbs.init()),BlsLazyloadImg.init()}else console.warn("Could not find media-gallery in the AJAX response. The response HTML was:",text)}).catch(e=>{console.error("Error processing variant media response:",e)}).finally(()=>{mediaContainer.classList.remove("skeleton-loading","opacity-50")})}getAllButtonValue(){const buttonArray=[];return this.querySelectorAll(".product__color-swatches--js, .product-sticky-js").forEach(btn=>{btn.classList.contains("product__color-swatches--js")&&btn.dataset.value?buttonArray.push(btn.dataset.value):btn.classList.contains("product-sticky-js")&&btn.dataset.colorValue&&buttonArray.push(btn.dataset.colorValue)}),buttonArray}}customElements.define("variant-group-detail",VariantGroupDetail);class VariantRadiosSticky extends VariantRadiosDetail{constructor(){super()}}customElements.define("variant-radios-sticky",VariantRadiosSticky);class VariantGroupSticky extends VariantGroupDetail{constructor(){super()}}customElements.define("variant-group-sticky",VariantGroupSticky);class CountdownTimer extends HTMLElement{constructor(){super(),this.timeoutMessage=this.dataset.timeoutMessage,this.format=this.dataset.format||"dd:hh:mm:ss",this.interval=null,this.init()}init(){const cddl=this.dataset?.endtime,minutesLeft=this.dataset.minutesLeft,countdownAppend=this.querySelector(".countdown-inner");if(countdownAppend?countdownAppend.innerHTML=this.appendChildHtml(minutesLeft).innerHTML:this.innerHTML=this.appendChildHtml(minutesLeft).innerHTML,c
24ddl){let isoDate="";if(this.isISODate(cddl))isoDate=cddl,this.mainFunction(isoDate,minutesLeft);else if(this.isValidDateTime(cddl))isoDate=new Date(cddl).toISOString(),this.mainFunction(isoDate,minutesLeft);else if(this.isValidDate(cddl)){const dateParts=cddl.split("-");isoDate=dateParts[2]+"-"+dateParts[0].padStart(2,"0")+"-"+dateParts[1].padStart(2,"0")+"T00:00:00Z",this.mainFunction(isoDate,minutesLeft)}else this.mainFunction(isoDate,minutesLeft)}else this.mainFunction("",minutesLeft)}mainFunction(isoDate,minutesLeft){let timeLeft={};const calculateTimeLeft=difference=>{let timeLeft2={};return this.format.includes("dd")&&(timeLeft2.days_timer=Math.floor(difference/864e5)),this.format.includes("hh")&&(this.format.includes("dd")?timeLeft2.hours_timer=Math.floor(difference/36e5%24):timeLeft2.hours_timer=Math.floor(difference/36e5)),this.format.includes("mm")&&(this.format==="mm:ss"?timeLeft2.minutes_timer=Math.floor(difference/1e3/60):timeLeft2.minutes_timer=Math.floor(difference/1e3/60%60)),this.format.includes("ss")&&(timeLeft2.seconds_timer=Math.floor(difference/1e3%60)),timeLeft2};if(Date.parse(isoDate)||minutesLeft){let deadline=new Date(isoDate);minutesLeft&&(deadline=new Date(Date.now()+parseInt(minutesLeft)*6e4));const updateCountdown=()=>{const difference=deadline-new Date;difference>0?timeLeft=calculateTimeLeft(difference):timeLeft=calculateTimeLeft(0),timeLeft.days_timer>0||timeLeft.hours_timer>0||timeLeft.minutes_timer>0||timeLeft.seconds_timer>0||!this.timeoutMessage?Object.entries(timeLeft).forEach(([key,value])=>{this.querySelector("."+key)&&(this.querySelector("."+key).innerHTML=value.toString().padStart(2,"0"))}):this.timeoutMessage?(this.innerHTML=this.timeoutMessage,clearInterval(this.interval)):clearInterval(this.interval),this.classList.remove("hidden");const badgesCountdown=this.closest(".product__badges-sale-countdown");badgesCountdown&&(badgesCountdown.classList.remove("hidden"),badgesCountdown.classList.add("inline-flex"))};this.interval=setInterval(updateCountdown,1e3),updateCountdown()}else timeLeft=calculateTimeLeft(0),Object.entries(timeLeft).forEach(([key,value])=>{this.querySelector("."+key)&&(this.querySelector("."+key).innerHTML=value.toString().padStart(2,"0"))})}appendChildHtml(minutesLeft){const days=this.dataset?.days,hours=this.dataset?.hours,mins=this.dataset?.mins,secs=this.dataset?.secs,container=document.createElement("div");return container.innerHTML=`${minutesLeft?"":`${this.format.includes("dd")?`<div class="countdown--container"><span class="days_timer count-timer"></span><span class="timer_announcementbar--text"> ${days||""}</span></div>`:""}${this.format.includes("hh")?`<div class="countdown--container"><span class="hours_timer count-timer"></span><span class="timer_announcementbar--text"> ${hours||""}</span></div>`:""}`}<div class="countdown--container"><span class="minutes_timer count-timer"></span><span class="timer_announcementbar--text"> ${minutesLeft?"m":mins||""}</span></div><div class="countdown--container"><span class="seconds_timer count-timer"></span><span class="timer_announcementbar--text"> ${minutesLeft?"s":secs||""}</span></div>`,container}isISODate(dateString){return/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(\.\d{3})?Z$/.test(dateString)}isValidDateTime(dateString){return/^\d{2}-\d{2}-\d{4} \d{2}:\d{2}:\d{2}$/.test(dateString)}isValidDate(dateString){var regex=/^\d{2}-\d{2}-\d{4}$/;return!!regex.test(dateString)}disconnectedCallback(){clearInterval(this.interval)}}customElements.define("countdown-timer",CountdownTimer);const tagQtyLimitProductTagsCache=new Map;let tagQtyLimitEnforcementQueue=Promise.resolve();function getTagQtyLimitProductTags(handle){if(tagQtyLimitProductTagsCache.has(handle))return tagQtyLimitProductTagsCache.get(handle);const request=fetch(`/products/${encodeURIComponent(handle)}.js`).then(res=>{if(!res.ok)throw new Error(`product tags request failed: ${res.status}`);return res.json()}).then(product=>(Array.isArray(product.tags)?product.tags:String(product.tags||"").split(",")).map(tag=>String(tag).trim().toLowerCase())).catch(error=>{throw tagQtyLimitProductTagsCache.delete(handle),error});return tagQtyLimitProductTagsCache.set(handle,request),request}function getTagQtyLimitUpdates(items,lockedHandles){const updates={},keeperKey=items.filter(item=>item&&item.key&&lockedHandles.has(item.handle))[0]?.key;
24return items.forEach(item=>{!item||!item.key||!lockedHandles.has(item.handle)||(item.key===keeperKey?Number(item.quantity)!==1&&(updates[item.key]=1):updates[item.key]=0)}),updates}function getTagQtyLimitAddedLineKeys(addResponse){const itemKeys=Array.isArray(addResponse?.items)?addResponse.items.map(item=>item&&item.key):[];return[addResponse?.key,...itemKeys].filter(Boolean)}function getTagQtyLimitCartRenderer(){return document.querySelector("new-main-cart")||document.querySelector("cart-notification")||document.querySelector("cart-drawer")}function renderTagQtyLimitCartSections(cart,renderer){if(!(!cart||!cart.sections||!renderer)){if(renderer.matches("new-main-cart")&&typeof renderer.updateCartUI=="function"){renderer.updateCartUI(cart);return}if(typeof renderer.renderContents=="function"){renderer.renderContents(cart);return}typeof renderer.getSectionsToRender=="function"&&(renderer.getSectionsToRender().forEach(section=>{const sectionKey=section.section||section.id,sectionMarkup=cart.sections[sectionKey],elementToReplace=document.getElementById(section.id);if(!sectionMarkup||!elementToReplace)return;const replacement=new DOMParser().parseFromString(sectionMarkup,"text/html").getElementById(section.id);replacement&&(elementToReplace.innerHTML=replacement.innerHTML)}),typeof renderer.cartAction=="function"&&renderer.cartAction())}}function syncTagQtyLimitCartUI(cart,renderer){if(!cart||cart.item_count==null)return;renderTagQtyLimitCartSections(cart,renderer),document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${cart.item_count})`:el.innerHTML=cart.item_count>100?"~":cart.item_count});const headerTotal=document.querySelector("header-total-price");headerTotal&&headerTotal.updateTotal(cart);const cartFreeShip=document.querySelector("free-ship-progress-bar");cartFreeShip&&cartFreeShip.init(cart.items_subtotal_price)}async function enforceTagQtyLimitAfterAddNow(cart,addedVariantId,addedLineKeys=[],requestedSectionIds=[]){if(!window.tagQtyLimit||!cart||!cart.items||!addedVariantId)return cart;const lockedTags=new Set(String(window.tagQtyLimit.tags||"").split(",").map(tag=>tag.trim().toLowerCase()).filter(Boolean));if(lockedTags.size===0)return cart;const normalizedAddedKeys=(Array.isArray(addedLineKeys)?addedLineKeys:[addedLineKeys]).filter(Boolean);let addedItems=cart.items.filter(item=>normalizedAddedKeys.includes(item.key));if(addedItems.length===0){const added=cart.items.find(item=>String(item.variant_id)===String(addedVariantId));added&&(addedItems=[added])}const addedHandles=[...new Set(addedItems.map(item=>item.handle).filter(Boolean))];if(addedHandles.length===0)return cart;try{if(!(await Promise.all(addedHandles.map(async handle=>({handle,tags:await getTagQtyLimitProductTags(handle)})))).some(({tags})=>tags.some(tag=>lockedTags.has(tag))))return cart;const handles=[...new Set(cart.items.map(item=>item.handle).filter(Boolean))],products=await Promise.all(handles.map(async handle=>{try{return{handle,tags:await getTagQtyLimitProductTags(handle)}}catch(error){return console.error(`tagQtyLimit tags lookup failed: ${handle}`,error),{handle,tags:[]}}})),lockedHandles=new Set(products.filter(({tags})=>tags.some(tag=>lockedTags.has(tag))).map(({handle})=>handle)),updates=getTagQtyLimitUpdates(cart.items,lockedHandles),renderer=getTagQtyLimitCartRenderer(),rendererSectionIds=renderer&&typeof renderer.getSectionsToRender=="function"?renderer.getSectionsToRender().map(section=>section.section||section.id).filter(Boolean):[],sectionIds=[...new Set([...rendererSectionIds,...requestedSectionIds])].filter(Boolean),body={updates};sectionIds.length>0&&(body.sections=sectionIds,body.sections_url=window.location.pathname);const response=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(body)});if(!response.ok)throw new Error(`cart clamp request failed: ${response.status}`);const freshCart=await response.json();return syncTagQtyLimitCartUI(freshCart,renderer),freshCart}catch(e){return console.error("tagQtyLimit clamp failed:",e),cart}}function enforceTagQtyLimitAfterAdd(cart,addedVariantId,addedLineKeys=[],requestedSectionIds=[]){if(!window.tagQtyLimit)return Promise.resolve(cart);const task=tagQtyLimitEnforcementQueue.then(async()=>{let latestCart=cart;try{const latestResponse=await fetch("/cart.json");latestResponse.ok&&(latestCart=await latestResponse.json())}catch(error){console.error("tagQtyLimit latest cart refresh failed:",error)}const addedKeySet=new Set((Array.isArray(addedLineKeys)?addedLineKeys:[addedLineKeys]).filter(
24Boolean)),addedLineStillExists=latestCart?.items?.some(item=>addedKeySet.has(item.key));if(addedKeySet.size>0&&!addedLineStillExists){const renderer=getTagQtyLimitCartRenderer(),rendererSectionIds=renderer&&typeof renderer.getSectionsToRender=="function"?renderer.getSectionsToRender().map(section=>section.section||section.id).filter(Boolean):[],sectionIds=[...new Set([...rendererSectionIds,...requestedSectionIds])].filter(Boolean);if(sectionIds.length===0)return latestCart;try{const refreshResponse=await fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates:{},sections:sectionIds,sections_url:window.location.pathname})});return refreshResponse.ok?await refreshResponse.json():latestCart}catch(error){return console.error("tagQtyLimit section refresh failed:",error),latestCart}}return await enforceTagQtyLimitAfterAddNow(latestCart,addedVariantId,addedLineKeys,requestedSectionIds)});return tagQtyLimitEnforcementQueue=task.catch(()=>{}),task}window.enforceTagQtyLimitBeforeRedirect=function(addResponse,addedVariantId,requestedSectionIds=[],timeoutMs=6e3){if(!window.tagQtyLimit)return Promise.resolve(null);const task=enforceTagQtyLimitAfterAdd(null,addedVariantId,getTagQtyLimitAddedLineKeys(addResponse),requestedSectionIds);return new Promise(resolve=>{let finished=!1;const finish=result=>{finished||(finished=!0,clearTimeout(timeoutId),resolve(result||null))},timeoutId=setTimeout(()=>{console.warn("tagQtyLimit clamp timed out before cart redirect"),finish(null)},timeoutMs);task.then(finish).catch(error=>{console.error("tagQtyLimit pre-redirect clamp failed:",error),finish(null)})})},customElements.get("product-form")||customElements.define("product-form",class extends PopupBase{constructor(){super(),this.form=this.querySelector("form"),this.form.querySelector("[name=id]").disabled=!1,this.form.addEventListener("submit",this.onSubmitHandler.bind(this)),this.form.querySelector("[name=id]")?.addEventListener("change",this.syncPreOrderState.bind(this)),this.cart=document.querySelector("cart-notification")||document.querySelector("cart-drawer"),this.submitButton=this.querySelector('[type="submit"]'),this.hideErrors=this.dataset.hideErrors==="true",this.productItem=this.form.closest(".product-item")||this.form.closest("sticky-add-cart"),this.dataset.available!=="false"&&this.submitButton.removeAttribute("disabled"),this.syncPreOrderState(),this.initializeAddons()}getCurrentVariantInventoryState(){const productTarget=this.closest(".product__item-js"),variantId=this.form.querySelector("[name=id]")?.value;if(!productTarget||!variantId)return null;let variant=null,inventory=null;const productJson=productTarget.querySelector(".productJson"),variantsQtyJson=productTarget.querySelector(".productVariantsQty");if(productJson?.textContent)try{variant=JSON.parse(productJson.textContent)?.variants?.find(item=>`${item.id}`==`${variantId}`)}catch(error){console.warn("Unable to parse product JSON for pre-order state.",error)}if(variantsQtyJson?.textContent)try{inventory=JSON.parse(variantsQtyJson.textContent).find(item=>`${item.id}`==`${variantId}`)}catch(error){console.warn("Unable to parse inventory JSON for pre-order state.",error)}if(!variant&&!inventory)return null;const inventoryManagement=inventory?.mamagement??variant?.inventory_management,inventoryQuantity=Number(inventory?.qty??variant?.inventory_quantity??0),isAvailable=inventory?.available??variant?.available;return{isAvailable,isPreOrder:inventoryManagement!=null&&inventoryManagement!==""&&inventoryQuantity<1&&isAvailable===!0}}syncPreOrderState(){if(this.form.querySelector('input[name="selling_plan"]')||this.dataset.preOrderEnabled!=="true")return;const state=this.getCurrentVariantInventoryState();if(!state)return;const label=this.submitButton?.querySelector(".btn-label");this.dataset.available=state.isAvailable?"true":"false",this.dataset.preOrder=state.isPreOrder?"true":"false",label&&(state.isPreOrder?label.textContent=window.variantStrings?.preOrder||"Pre-Order":label.textContent=state.isAvailable?window.variantStrings?.addToCart||"Add To Cart":window.variantStrings?.soldOut||"
24Sold Out"),this.submitButton&&this.submitButton.toggleAttribute("disabled",state.isAvailable!==!0)}initializeAddons(){this.productContainer=this.form.closest(".sec__featured-product"),this.productContainer&&(this.addonItems=this.productContainer.querySelectorAll(".product-addon__item"),this.addonItems.length===0?this.isAddonsPage=!1:this.isAddonsPage=!0,this.variantRadios=this.productContainer.querySelector("variant-radios-detail, variant-group-detail"),this.quantityInput=this.form.querySelector("quantity-input"),this.totalPriceElements=document.querySelectorAll("[data-bundle-total-price]"),this.comparePriceElements=document.querySelectorAll("[data-bundle-compare-price]"),this.variantRadios&&(typeof this.variantRadios.updateOptions=="function"&&this.variantRadios.updateOptions(),typeof this.variantRadios.updateMasterId=="function"&&this.variantRadios.updateMasterId(),this.variantRadios.addEventListener("change",this.calculateTotals.bind(this))),this.quantityInput&&this.quantityInput.addEventListener("change",this.calculateTotals.bind(this)),this.addonItems.forEach(item=>{const checkbox=item.querySelector(".product-addon__checkbox"),selector=item.querySelector(".product-addon__variant-selector");checkbox&&checkbox.addEventListener("change",this.calculateTotals.bind(this)),selector&&selector.addEventListener("change",this.onAddonVariantChange.bind(this))}),setTimeout(()=>this.calculateTotals(),100))}onAddonVariantChange(event){const select=event.currentTarget,selectedOption=select.options[select.selectedIndex],parentItem=select.closest(".product-addon__item"),checkbox=parentItem.querySelector(".product-addon__checkbox"),priceDisplay=parentItem.querySelector(".product-addon__price"),imageElement=parentItem.querySelector(".product-addon__image img");checkbox.dataset.variantId=selectedOption.value,checkbox.dataset.price=selectedOption.dataset.price,checkbox.dataset.compareAtPrice=selectedOption.dataset.compareAtPrice;const newImageUrl=selectedOption.dataset.imageSrc;imageElement&&newImageUrl&&(imageElement.src=newImageUrl);const price=parseFloat(selectedOption.dataset.price),comparePrice=parseFloat(selectedOption.dataset.compareAtPrice);let priceHTML=`<span class='price-item price-item--regular'>${Shopify.formatMoney(price,window.cartStrings?.money_format)}</span>`;comparePrice>price&&(priceHTML+=`<s class='price-item price-item--compare ml-5'>${Shopify.formatMoney(comparePrice,window.cartStrings?.money_format)}</s>`),priceDisplay.innerHTML=priceHTML,this.calculateTotals()}calculateTotals(){let totalPrice=0,totalComparePrice=0,quantity=Number(this.quantityInput?.input?.value)||1;const mainVariant=this.variantRadios?.currentVariant;if(mainVariant)totalPrice+=mainVariant.price*quantity,totalComparePrice+=(mainVariant.compare_at_price||mainVariant.price)*quantity;else{const initialProductData=JSON.parse(this.productContainer.querySelector("[data-product-json]")?.textContent||"{}");initialProductData.price&&(totalPrice+=initialProductData.price*quantity,totalComparePrice+=(initialProductData.compare_at_price||initialProductData.price)*quantity)}this.addonItems.forEach(item=>{const checkbox=item.querySelector(".product-addon__checkbox");checkbox&&checkbox.checked&&(totalPrice+=parseFloat(checkbox.dataset.price),totalComparePrice+=parseFloat(checkbox.dataset.compareAtPrice))}),this.updatePriceDisplay(totalPrice,totalComparePrice)}updatePriceDisplay(price,comparePrice){this.totalPriceElements.forEach(el=>{el.innerHTML=Shopify.formatMoney(price,window.cartStrings?.money_format)}),this.comparePriceElements.forEach(el=>{comparePrice>price?(el.innerHTML=Shopify.formatMoney(comparePrice,window.cartStrings?.money_format),el.style.display=""):el.style.display="none"})}onSubmitHandler(evt){if(evt.preventDefault(),this.submitButton||(this.submitButton=this.querySelector('[type="submit"]')),!this.submitButton||this.submitButton.getAttribute("aria-disabled")==="true")return;const popup=document.getElementById("ai-plan-recommendation");if(this.form.dataset.unlimitedPlan==="true"&&popup){const variantId=new FormData(this.form).get("id");popup.addProduct(variantId),popup.open(null,!0);return}this.handleErrorMessage(),this.submitButton.setAttribute("aria-disabled",!0),this.submitButton.classList.add("loading");const cartRecommend=document.querySelector(".cart-recommend");cartRecommend&&cartRecommend.classList.contains("open")&&cartRecommend.classList.remove("open");const config={method:"POST",headers:{"Content-Type":"application/json",Accept:"application/json"}},guardedQtyInput=this.form.querySelector('quantity-input input[name="quantity"]')||(this.form.id?document.querySelector('quantity-selector input[name="quantity"][form="'+this.form.id+'"]'):null);guardedQtyInput&&typeof guardedQtyInput.qtyGuardNormalize=="function"&&guardedQtyInput.qtyGuardNormalize();const formData=new FormData(this.form);let mainVariantId=formData.get("id"),mainQuantity=parseInt(formData.get("quantity")||1);const sellingPlan=formData.get("selling_plan"),localContainer=this.closest(".product-quickview__content, .sec__featured-product, .product-item, .product__item-js");if(localContainer){const explicitIdInput=localContainer.querySelector('input[name="id"]');explicitIdInput&&explicitIdInput.value&&(mainVariantId=explicitIdInput.value);const explicitQtyInput=localContainer.querySelector('input[name="quantity"]');explicitQtyInput&&typeof explicitQtyInput.qtyGuardNormalize=="function"&&explicitQtyInput.qtyGuardNormalize(),explicitQtyInput&&explicitQtyInput.value&&(mainQuantity=parseInt(explicitQtyInput.value||1))}const properties={},productInfo=this.form.closest(".product-detail__information");productInfo&&productInfo.querySelectorAll('product-property input[name^="properties"]').forEach(property=>{if(property.type!=="file"&&property.value){const name=property.name.match(/properties\[(.*)\]/)[1];name&&(properties[name]=property.value)}});
24const items=[],mainProductItem={id:mainVariantId,quantity:mainQuantity};Object.keys(properties).length>0&&(mainProductItem.properties=properties),sellingPlan&&(mainProductItem.selling_plan=sellingPlan),items.push(mainProductItem),this.isAddonsPage&&this.addonItems.forEach(item=>{const checkbox=item.querySelector(".product-addon__checkbox");checkbox&&checkbox.checked&&items.push({id:checkbox.dataset.variantId,quantity:1})});const requestBody={items},is_cart_page=document.body.classList.contains("template-cart");this.cart&&(requestBody.sections=this.cart.getSectionsToRender().map(section=>section.id),requestBody.sections_url=window.location.pathname,this.cart.setActiveElement(document.activeElement)),is_cart_page&&(requestBody.sections=this.getMainCartSectionRender().map(section=>section.id),requestBody.sections_url=window.location.pathname),config.body=JSON.stringify(requestBody);let preTask=Promise.resolve();sellingPlan&&(preTask=fetch("/cart.json").then(res=>res.json()).then(cart=>{const updates={};let hasUpdates=!1;if(cart.items.forEach(item=>{item.selling_plan_allocation&&String(item.variant_id)!==String(mainVariantId)&&(updates[item.key]=0,hasUpdates=!0)}),hasUpdates)return fetch("/cart/update.js",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({updates})})}).catch(e=>console.error("Failed to sync selling plans:",e))),preTask.then(()=>fetch(`${routes.cart_add_url}`,config)).then(response=>response.json()).then(async response=>{const responseErrors=response.errors,hasResponseErrors=Array.isArray(responseErrors)?responseErrors.length>0:responseErrors&&typeof responseErrors=="object"?Object.keys(responseErrors).length>0:!!responseErrors,errorMessage=(Array.isArray(responseErrors)?responseErrors.flat().filter(Boolean).join(", "):responseErrors&&typeof responseErrors=="object"?Object.values(responseErrors).flat().filter(Boolean).join(", "):String(responseErrors||"").trim())||response.description||response.message||window.cartStrings.error;if(response.status||hasResponseErrors){const productVariantId=this.isAddonsPage?requestBody.items[0]?.id:new FormData(this.form).get("id");publish(PUB_SUB_EVENTS.cartError,{source:"product-form",productVariantId,errors:response.errors||response.description,message:response.message}),this.handleErrorMessage(errorMessage),this.productItem&&this.handleErrorMessagePopup(errorMessage);return}else if(response.sections&&!response.id&&!response.items){this.handleErrorMessagePopup(window.cartStrings.error);return}const shouldRedirectToCart=!this.cart&&!response.sections,shouldClampBeforeRedirect=shouldRedirectToCart&&this.dataset.tagQtyLocked==="true"&&!!window.tagQtyLimit;if(shouldRedirectToCart&&!shouldClampBeforeRedirect){window.location=window.routes.cart_url;return}const updateProductFormCartSummary=cart=>{if(!cart||cart.item_count==null)return;document.querySelectorAll(".cart-count").forEach(el=>{el.classList.contains("cart-count-drawer")?el.innerHTML=`(${cart.item_count})`:el.innerHTML=cart.item_count>100?"~":cart.item_count}),document.querySelector("header-total-price")&&document.querySelector("header-total-price").updateTotal(cart);const cart_free_ship=document.querySelector("free-ship-progress-bar");cart_free_ship&&cart_free_ship.init(cart.items_subtotal_price)};if(window.tagQtyLimit)try{const requestedSectionIds=Object.keys(response.sections||{}),freshCart=shouldClampBeforeRedirect?await window.enforceTagQtyLimitBeforeRedirect(response,mainVariantId,requestedSectionIds):await fetch("/cart.json").then(res=>res.json()).then(cart=>enforceTagQtyLimitAfterAdd(cart,mainVariantId,getTagQtyLimitAddedLineKeys(response),requestedSectionIds));updateProductFormCartSummary(freshCart),freshCart?.sections&&(response=freshCart)}catch(error){console.error("Failed to refresh cart after product add:",error)}else fetch("/cart.json").then(res=>res.json()).then(updateProductFormCartSummary).catch(error=>{throw error});if(shouldRedirectToCart){window.location=window.routes.cart_url;return}const productVariantIdForEvent=mainVariantId;publish(PUB_SUB_EVENTS.cartUpdate,{source:"product-form",productVariantId:productVariantIdForEvent,cartData:response});const modalQuickview=document.querySelector(".tingle-modal--visible.tingle-modal.quickview .tingle-modal__close"),modalShopableVideo=document.querySelector(".tingle-modal--visible.tingle-modal.shopable-video");let time=0;
24if((modalQuickview||modalShopableVideo)&&(document.documentElement.querySelector("body").classList.contains("tingle-enabled")&&document.documentElement.querySelector("body").classList.remove("tingle-enabled"),modalShopableVideo&&modalShopableVideo.remove(),modalQuickview&&(time+=250,modalQuickview.click())),!document.body.classList.contains("template-cart"))!response.errors&&this.cart&&(this.cart.getSectionsToRender().forEach(section=>{const elementToReplace=document.getElementById(section.id),html=new DOMParser().parseFromString(response.sections[section.id],"text/html");elementToReplace&&(elementToReplace.innerHTML=html.querySelector("#minicart-form").innerHTML,html.querySelectorAll("script[src]").forEach(scriptTag=>{const src=scriptTag.getAttribute("src");if(src){const script=document.createElement("script");script.src=src,scriptTag.defer&&(script.defer=!0),scriptTag.async&&(script.async=!0),document.body.appendChild(script)}}))}),this.cart.cartAction(),this.cart&&this.cart.classList.contains("is-empty")&&this.cart.classList.remove("is-empty"),setTimeout(()=>{this.cart.open();const cartRecommend2=document.querySelector(".cart-recommend");if(cartRecommend2&&!cartRecommend2.classList.contains("hidden-recommend"))if(cartRecommend2.classList.contains("cart-recommend-custom")){const cartUpsellItem=document.querySelectorAll(".cart-upsell-item"),cartUpsellSlide=document.querySelectorAll(".swiper-cart-upsell .swiper-slide");cartUpsellItem.length>0?setTimeout(function(){cartRecommend2.classList.add("open")},800):cartUpsellSlide.length===0&&(cartRecommend2.classList.remove("block"),cartRecommend2.classList.add("hidden"))}else setTimeout(function(){cartRecommend2.classList.add("open")},800)},time));else if(!response.errors){this.getMainCartSectionRender().forEach(section=>{if(section.selector!=null){const elementToReplace=document.getElementById(section.id).querySelector(section.selector)||document.getElementById(section.id);elementToReplace.innerHTML=this.getSectionInnerHTML(response.sections[section.id],section.selector);const cart_gift_html=new DOMParser().parseFromString(response.sections[section.id],"text/html").querySelector("#gift"),cart_gift=document.getElementById("gift");if(cart_gift){cart_gift.innerHTML=cart_gift_html.innerHTML;const gift_form_minicart=document.getElementById("gift_form_minicart");gift_form_minicart&&gift_form_minicart.addEventListener("change",event=>{event.currentTarget.checked?this.addGiftwrapCartClick(gift_form_minicart):this.updateQuantity(event.currentTarget.dataset.index,0)})}}});var wrapperDiv=document.createElement("div"),messageDiv=document.createElement("div");messageDiv.className="mt-10 newsletter-form__message--success success form__message inline-flex align-center",messageDiv.setAttribute("tabindex","-1"),messageDiv.setAttribute("role","status"),messageDiv.setAttribute("aria-live","polite"),messageDiv.innerHTML=`
25                  <svg width="18" height="18" fill="none">
26                    <g stroke="#137F24" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3"><path d="m6.033 8.992 1.972 1.98 3.952-3.96"/><path d="M7.973 1.178c.565-.482 1.49-.482 2.062 0l1.293 1.113c.245.213.704.385 1.03.385h1.392c.867 0 1.579.712 1.579 1.579v1.39c0 .32.172.786.384 1.032l1.113 1.292c.483.565.483 1.49 0 2.062l-1.113 1.293a1.813 1.813 0 0 0-.384 1.03v1.392c0 .867-.712 1.579-1.58 1.579h-1.39c-.32 0-.786.172-1.031.384l-1.293 1.113c-.564.483-1.489.483-2.062 0L6.681 15.71a1.813 1.813 0 0 0-1.031-.384H4.234c-.867 0-1.579-.712-1.579-1.58v-1.398c0-.32-.172-.778-.376-1.023l-1.105-1.301c-.474-.565-.474-1.48 0-2.045L2.28 6.677c.204-.246.376-.704.376-1.023V4.247c0-.868.712-1.58 1.58-1.58H5.65c.319 0 .785-.171 1.03-.384l1.293-1.105Z"/></g>
27                  </svg>
28                `;var span=document.createElement("span");span.className="ml-5",span.textContent="Update cart successfully",messageDiv.appendChild(span),wrapperDiv.appendChild(messageDiv),showToast(wrapperDiv.innerHTML,2e3,"modal-success");const totals=this.getSectionInnerHTML(response.sections["main-cart-items"],".cart-info .totals"),totals_content=document.querySelector(".cart-info .totals");totals&&totals_content&&(totals_content.innerHTML=totals)}}).catch(e=>{console.error(e)}).finally(()=>{BlsLazyloadImg.init(),document.documentElement.classList.contains("open-popup")&&document.documentElement.classList.remove("open-popup"),this.submitButton.classList.remove("loading"),this.cart&&this.cart.classList.contains("is-empty")&&this.cart.classList.remove("is-empty"),this.submitButton.setAttribute("aria-disabled","false")})}getMainCartSectionRender(){return[{id:"main-cart-items",section:document.getElementById("main-cart-items")?.dataset.id,selector:".js-contents"}]}getSectionInnerHTML(html,selector){return new DOMParser().parseFromString(html,"text/html").querySelector(selector).innerHTML}handleErrorMessage(errorMessage=!1){this.hideErrors||(this.errorMessageWrapper=this.errorMessageWrapper||this.querySelector(".product-form__error-message-wrapper"),this.errorMessageWrapper&&(this.errorMessage=this.errorMessage||this.errorMessageWrapper.querySelector(".product-form__error-message"),this.errorMessageWrapper.toggleAttribute("hidden",!errorMessage),errorMessage&&(this.errorMessage.textContent=errorMessage)))}handleErrorMessagePopup(errorMessage=!1){const url=`${window.location.pathname}?section_id=form-message`;fetch(url).then(response=>response.text()).then(responseText=>{const elementErrorMessage=new DOMParser().parseFromString(responseText,"text/html").querySelector(".product-form__error-message-wrapper"),elementMessage=elementErrorMessage.querySelector(".product-form__error-message");elementMessage.textContent=errorMessage,showToast(elementErrorMessage.innerHTML,5e3,"modal-error")}).catch(e=>{throw e})}});class Loadmore extends HTMLElement{constructor(){super(),this.button=this.querySelector("button"),this.collectionUrl=this.dataset.collectionUrl,this.sectionId=this.dataset.sectionId,this.all=this.dataset.allProducts,this.limit=this.dataset.limit,this.blockId=this.dataset.blockId,this.init()}init(){const _this=this;this.button&&this.button.addEventListener("click",function(){_this.scanData()})}scanData(){const _this=this;let url=this.dataset.url;if(!url)return;let sectionContainer=document.querySelector(`#shopify-section-${this.sectionId}`);sectionContainer?.classList.add("bls-image-js"),this.querySelector("button").classList.add("loading"),fetch(this.collectionUrl+url+`&section_id=${this.sectionId}`).then(response=>response.text()).then(text=>{const html=parser.parseFromString(text,"text/html");let parentDiv=this.closest(".sec__products-loadmore");if(!parentDiv)return;let elements,itemDiv,fetchDiv,page,times,limit,remainder,end_load;this.blockId?(itemDiv=parentDiv.querySelector(`.collection-tab-${this.blockId} .product-ajax__append`),fetchDiv=html.querySelector(`.sec__products-loadmore .collection-tab-${this.blockId} .product-ajax__append`),elements=fetchDiv.querySelectorAll(".grid-custom-item")):(itemDiv=parentDiv.querySelector(".product-ajax__append"),fetchDiv=html.querySelector(".sec__products-loadmore .product-ajax__append"),elements=fetchDiv.querySelectorAll(".grid-custom-item")),!(!itemDiv||!fetchDiv)&&(page=Number(this.dataset.url.replace("?page=","")),times=page*this.limit,limit=this.limit,end_load=!1,times>=this.all&&(end_load=!0,limit=this.limit-(times-this.all)),elements.forEac
28h((prodNode,index)=>{index=index+1,!(end_load&&limit<index)&&itemDiv.appendChild(prodNode)}))}).finally(()=>{_this.updateUrl(Number(this.dataset.url.replace("?page=",""))),this.querySelector("button")?.classList.remove("loading"),BlsAnimations.innit(),initLazyloadItem(),typeof refineRegionByRealIP=="function"&&sectionContainer&&refineRegionByRealIP(sectionContainer)}).catch(e=>{console.error(e)})}updateUrl(e){if(this.all&&this.limit&&this.all>0){const times=~~(this.all/this.limit),remainder=this.all%this.limit;let pages=times;if(remainder>0&&(pages=times+1),e<pages)this.dataset.url="?page="+ ++e;else{const btn=this.querySelector("button");btn&&btn.remove()}}}handleCountItemToShow(pages){return this.all&&this.limit&&pages&&Number(this.all)<Number(this.limit)*pages?Number(this.limit)*pages-Number(this.all):0}}customElements.define("loadmore-function",Loadmore);class LookbookItem extends HTMLElement{constructor(){super(),this.itemPopup=this.querySelector(".lookbook-item__popup"),this.type=this.dataset.type,this.position=this.dataset.productPosition,this.lookbookProductDiv=this.closest(".sec__lookbook-product"),this.instagramShop=this.closest(".popup-content"),this.allDots=this.closest(".sec__lookbook-product"),this._boundClickOutside=this.onClickOutside.bind(this),this.init(),document.body.addEventListener("click",this._boundClickOutside)}disconnectedCallback(){document.body.removeEventListener("click",this._boundClickOutside)}init(){if(this.type==="open"||this.type==="slide"){const atag=this.querySelector("a");if(!atag)return;atag.addEventListener("click",this.onClick.bind(this));const closeButton=this.querySelector("icon-close");if(!closeButton)return;closeButton.addEventListener("click",this.onClose.bind(this))}}onClickOutside(event){event.target.closest("lookbook-item")||this.onClose()}onClick(){if(this.type==="open"){if(this.itemPopup){const thisSection=this.closest("section");if(!thisSection)return;const allPopups=thisSection.querySelectorAll(".lookbook-item__popup");if(window.innerWidth>=1024)allPopups.forEach(popup=>{if(popup!==this.itemPopup){popup.classList.add("invisible");const thisClosest=popup.closest("lookbook-item");thisClosest&&thisClosest.classList.remove("open")}}),this.onToggle();else{const modal=new tingle.modal({footer:!1,stickyFooter:!1,closeMethods:["overlay","button","escape"],closeLabel:"Close",cssClass:["lookbook-modal"],onOpen:function(){},onClose:function(){},beforeClose:function(){return!0}});modal.setContent(this.itemPopup.querySelector(".product-item").innerHTML),modal.open()}}}else if(this.lookbookProductDiv&&this.position){const slideSEction=this.lookbookProductDiv.querySelector("slide-section-lookbook");this.lookbookProductDiv.querySelectorAll("lookbook-item[data-type='slide']").forEach(dot=>{dot.classList.remove("active")}),this.classList.add("active"),slideSEction&&slideSEction.functionGoto(this.position)}else if(this.instagramShop&&this.position){const slideSEction=this.instagramShop.querySelector("slide-section-instagram");slideSEction&&slideSEction.functionGoto(this.position),this.instagramShop.querySelectorAll("lookbook-item[data-type='slide']").forEach(dot=>{dot.classList.remove("active")}),this.classList.add("active")}}onToggle(){this.itemPopup?.classList.toggle("invisible"),this.classList.toggle("open")}onClose(){this.itemPopup?.classList.add("invisible"),this.classList.remove("open")}}customElements.define("lookbook-item",LookbookItem);class SectionSlideLookbook extends SlideSection{constructor(){super(),this.init()}connectedCallback(){if(this.dataset.alignProductCards!=="true"||this._lookbookCardAlignmentReady)return;this._lookbookCardAlignmentReady=!0,this._lookbookDesktopMedia=window.matchMedia("(min-width: 1025px)"),this._scheduleLookbookCardAlignment=()=>{this.isConnected&&(cancelAnimationFrame(this._lookbookCardAlignmentFrame),this._lookbookCardAlignmentFrame=requestAnimationFrame(()=>{this.alignProductCards()}))},this._lookbookCardMutationObserver=new MutationObserver(this._scheduleLookbookCardAlignment);const wrapper=this.querySelector(".swiper-wrapper");wrapper&&this._lookbookCardMutationObserver.observe(wrapper,{attributes:!0,attributeFilter:["class","hidden"],characterData:!0,childList:!0,subtree:!0}),window.addEventListener("resize",this._scheduleLookbookCardAlignment,{passive:!0}),document.fonts?.addEventListener("loadingdone",this._scheduleLookbookCardAlignment),document.fonts?.ready.then(this._scheduleLookbookCardAlignment),this._scheduleLookbookCardAlignment()}init(){this.initSlide()}alignProductCards(){this._lookbookCardAlignmentFrame=null,["--lookbook-card-swatch-height","--lookbook-card-title-height","--lookbook-card-price-height","--lookbook-card-description-height"].forEach(property=>this.style.removeProperty(property)),this.classList.remove("lookbook-product-cards--has-swatches","lookbook-product-cards--has-descriptions");const slides=Array.from(this.querySelectorAll(".swiper-wrapper > .lookbook-item.swiper-slide")),offsetProperties=["--lookbook-card-title-offset","--lookbook-card-price-offset","--lookbook-card-description-offset"];
28if(slides.forEach(slide=>{offsetProperties.forEach(property=>slide.style.removeProperty(property))}),!(this._lookbookDesktopMedia?.matches&&Number(this.dataset.desktop)>1&&slides.length>1))return;const setMaxHeight=(selector,property,stateClass)=>{const elements=slides.map(slide=>slide.querySelector(selector)).filter(Boolean);if(!elements.length)return;const maxHeight=Math.max(...elements.map(element=>element.getBoundingClientRect().height));maxHeight<=0||(this.style.setProperty(property,`${Math.ceil(maxHeight*100)/100}px`),stateClass&&this.classList.add(stateClass))};setMaxHeight(".product__color-swatches","--lookbook-card-swatch-height","lookbook-product-cards--has-swatches"),setMaxHeight(".product-item__name","--lookbook-card-title-height"),setMaxHeight(".product-item__price","--lookbook-card-price-height"),setMaxHeight(".product-item__short-description","--lookbook-card-description-height","lookbook-product-cards--has-descriptions");const alignTops=(selector,property)=>{const targets=slides.map(slide=>({slide,element:slide.querySelector(selector)})).filter(({element})=>element);if(targets.length<2)return;const top=Math.max(...targets.map(({element})=>element.getBoundingClientRect().top));targets.forEach(({slide,element})=>{const offset=top-element.getBoundingClientRect().top;offset>.01&&slide.style.setProperty(property,`${Math.ceil(offset*100)/100}px`)})};alignTops(".product-item__name","--lookbook-card-title-offset"),alignTops(".product-item__price","--lookbook-card-price-offset"),alignTops(".product-item__short-description","--lookbook-card-description-offset")}functionGoto(position){this.globalSlide.slideTo(position-1,500)}disconnectedCallback(){super.disconnectedCallback(),cancelAnimationFrame(this._lookbookCardAlignmentFrame),this._lookbookCardMutationObserver?.disconnect(),window.removeEventListener("resize",this._scheduleLookbookCardAlignment),document.fonts?.removeEventListener("loadingdone",this._scheduleLookbookCardAlignment),this._lookbookCardAlignmentReady=!1}}customElements.define("slide-section-lookbook",SectionSlideLookbook);class SectionSlideInstagramShop extends SlideSection{constructor(){super(),this.init()}init(){this.initSlide()}functionGoto(position){this.globalSlide.slideTo(position-1,500)}}customElements.define("slide-section-instagram",SectionSlideInstagramShop);class TabItems extends HTMLElement{constructor(){super(),this.tabs=this.querySelectorAll(".collection-tab__tab-item"),this.select=this.querySelector(".select-collection-tab"),this.content=this.querySelectorAll(".collection-tab__tab-content"),this.select_li=this.querySelectorAll(".collection_title_input"),this.type=this.dataset.type,this.init()}init(){if(this.type==="horizontal"||this.type==="vertical"){const self=this;
28this.tabs.forEach(tab=>{tab.addEventListener("click",function(){self.onClick(this)})})}else{const self=this;this.select.addEventListener("click",function(e){if(e.target.classList.contains("select__selected_title")){let select__dropdown=this.querySelector(".select-custom__content");this.classList.toggle("active"),select__dropdown.classList.toggle("invisible")}}),this._boundDocClick=function(event){event.target.closest(".select-collection-tab")||(self.select.classList.remove("active"),document.querySelectorAll(".select-collection-tab .select-custom__content")?.forEach(item=>{item.classList.add("invisible")}))},document.addEventListener("click",this._boundDocClick),this.select_li.forEach(item=>{item.addEventListener("click",function(){self.onClickBySelect(this),self.select.classList.remove("active"),document.querySelectorAll(".select-collection-tab .select-custom__content")?.forEach(item2=>{item2.classList.add("invisible")})})})}}onClick(tab){const blockId=tab.dataset.blockId;this.showContent(blockId),this.tabs.forEach(t=>{t.classList.remove("active")}),tab.classList.add("active")}onClickBySelect(selectedBlockId){let select__selected_title=this.querySelector(".select__selected_title");select__selected_title.innerHTML=selectedBlockId.innerHTML+`<svg class="icon-down transition active-rotated" width="10" height="6">
29    <use href="#icon-arrow-down"></use>
30  </svg>`,this.showContent(selectedBlockId.dataset.id)}showContent(blockId){this.content.forEach(content=>{content.dataset.blockId===blockId?(content.classList.add("active"),content.querySelectorAll("motion-element").forEach(motion2=>{motion2.refreshAnimation()})):content.classList.remove("active")})}disconnectedCallback(){this._boundDocClick&&document.removeEventListener("click",this._boundDocClick)}}customElements.define("tab-items",TabItems);class ShopableVideo extends PopupBase{constructor(){super(),this.popupDiv=this.querySelector(".video-item__popup"),this.productPopupDiv=this.querySelector(".video-item__product-mobile"),this.init()}init(){(this.popupDiv||!this.classList.contains("instagram-item"))&&(window.addEventListener("resize",this.responsive.bind(this)),window.addEventListener("load",this.responsive.bind(this)),this.addEventListener("click",this.onClick.bind(this)),this.connectedCallback()),this.productPopupDiv&&this.productPopupDiv.addEventListener("click",this.onClickMobile.bind(this.productPopupDiv))}onClick(){if(this.popupDiv){const html=this.popupDiv,popup=document.querySelector(".tingle-modal.shopable-video");if(!html||popup)return;html.classList.remove("hidden"),this.initPopup(html)}else if(this.classList.contains("instagram-item")){const sectionId=this.dataset.sectionId,index=this.dataset.index,url=`${window.location.pathname}?section_id=${sectionId}&ajax=1`;var _this=this;fetch(`${url}`).then(response=>{if(!response.ok){var error=new Error(response.status);throw error}return response.text()}).then(responseText=>{const newSection=new DOMParser().parseFromString(responseText,"text/html").querySelector(`.popup-index-${index}`);_this.appendChild(newSection)}).catch(error=>{throw error}).finally(()=>{const html=_this.querySelector(".popup-content");html&&(html.classList.remove("hidden"),this.initPopup(html))})}}onCloseEvent(){const popup=document.querySelector(".tingle-modal.shopable-video");if(!popup)return;const productInformation=popup.querySelector(".shopable-video__product-information");productInformation&&productInformation.classList.add("hidden")}connectedCallback(){const handleIntersection=(entries,observer)=>{if(!entries[0].isIntersecting)return;observer.unobserve(this),this.querySelectorAll("video").forEach(video=>{const dataSrc=video.dataset.src;dataSrc&&(video.src=dataSrc,video.removeAttribute("data-src"))})};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 200px 0px"}).observe(this)}responsive(){const productDivs=document.querySelectorAll(".shopable-video__product-information");if(productDivs.length!=0)if(window.innerWidth>=768){if(!this.popupDiv?.querySelector(".video-item__popup--flex"))return;productDivs.forEach(div=>{div.classList.remove("hidden")})}else{if(!this.popupDiv?.querySelector(".video-item__popup--flex"))return;
30productDivs.forEach(div=>{div.classList.add("hidden")})}}onClickMobile(){const popup=this.closest(".video-item__popup");if(!popup)return;const productInformation=popup.querySelector(".shopable-video__product-information");productInformation&&productInformation.classList.toggle("hidden")}}customElements.define("shopable-video",ShopableVideo);class InstagramShop extends ShopableVideo{constructor(){super(),this.popupDiv=this.querySelector(".popup-content"),(this.popupDiv||this.classList.contains("instagram-item"))&&this.addEventListener("click",this.onClick.bind(this))}}customElements.define("instagram-shop",InstagramShop);class InstagramSection extends HTMLElement{constructor(){super(),this.accessToken=this.dataset.accessToken,this.type=this.dataset.type,this.ratio=this.dataset.ratio,this.init()}async init(){if(this.accessToken){const resp=await this.fetchDataInstagram(`https://graph.instagram.com/me/media?fields=caption,id,media_type,media_url,permalink,thumbnail_url,timestamp,username&access_token=${this.accessToken}`);if(!resp)return;if(resp.error)return console.error("Instagram error: ",resp.error?.message);this.type==="carousel"?this.generateCarousel(resp.data,this.ratio):this.generateGrid(resp.data,this.ratio)}}fetchDataInstagram(fetchUrl){const map=new Map;return new Promise((resolve,reject)=>{if(map.get(fetchUrl))return resolve(map.get(fetchUrl));fetch(fetchUrl,{cache:"force-cache"}).then(res=>{if(res.ok){const json=res.json();return resolve(json),map.set(fetchUrl,json),json}else reject(res)}).catch(reject)})}generateCarousel(items,ratio){const wrapper=this.querySelector(".swiper-wrapper");if(wrapper){let html="";items.forEach(item=>{item.media_type==="VIDEO"?html+=`<a href="${item.permalink}" aria-label="${item.caption}" class="swiper-slide">
31                                <div class="instagram-item__media--ratio" style="--aspect-ratio: ${ratio};">
32                                    <video loop="true" muted="true" playsinline="true" autoplay="true" src="${item.media_url}"></video>
33                                </div>
34                            </a>`:html+=`<a href="${item.permalink}" aria-label="${item.caption}" class="swiper-slide">
35                                <div class="instagram-item__media--ratio" style="--aspect-ratio: ${ratio};">
36                                    <img src="${item.media_url}" srcset="${item.media_url}&amp;width=720 720w, ${item.media_url}&amp;width=660 660w, ${item.media_url}&amp;width=550 550w, ${item.media_url}&amp;width=480 480w, ${item.media_url}&amp;width=360 360w" width="1000" height="1000" loading="lazy" sizes="(min-width: 1200px) calc((100vw - 0px * 0) * 1), (min-width: 768px) calc( (100vw - 0px * 0 ) * 1), calc( (100vw - 0 * 0 ) * 1)" alt="${item.caption}">
37                                </div>
38                            </a>`}),wrapper.innerHTML=html}}generateGrid(items,ratio){const wrapper=this.querySelector(".instagram--grid");if(wrapper){let html="";items.forEach(item=>{item.media_type==="VIDEO"?html+=`<a href="${item.permalink}" aria-label="${item.caption}">
39                                <div class="instagram-item__media--ratio" style="--aspect-ratio: ${ratio};">
40                                    <video loop="true" muted="true" playsinline="true" autoplay="true" src="${item.media_url}"></video>
41                                </div>
42                            </a>`:html+=`<a href="${item.permalink}" aria-label="${item.caption}">
43                                <div class="instagram-item__media--ratio" style="--aspect-ratio: ${ratio};">
44                                    <img src="${item.media_url}" srcset="${item.media_url}&amp;width=720 720w, ${item.media_url}&amp;width=660 660w, ${item.media_url}&amp;width=550 550w, ${item.media_url}&amp;width=480 480w, ${item.media_url}&amp;width=360 360w" width="1000" height="1000" loading="lazy" sizes="(min-width: 1200px) calc((100vw - 0px * 0) * 1), (min-width: 768px) calc( (100vw - 0px * 0 ) * 1), calc( (100vw - 0 * 0 ) * 1)" alt="${item.caption}">
45                                </div>
46                            </a>`}),wrapper.innerHTML=html}}}customElements.define("instagram-section",InstagramSection);class GridCustom extends SlideSection{constructor(){super(),this.enable=this.dataset.enable,this.parentElementt=document.querySelector(`#shopify-section-${this.dataset?.sectionId}`),this.loadmore=this.parentElementt?.querySelectorAll("loadmore-function"),this.viewAll=this.parentElementt?.querySelector(".view_all"),this.swiperSlideInnerHtml=this.innerHTML,this.init()}init(){if(this.enable=="true"){let width=window.innerWidth;window.addEventListener("resize",()=>{const newWidth=window.innerWidth;newWidth<=767&&width>767&&(this.actionOnMobile(),typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(this)),newWidth>767&&width<=767&&(this.actionOutMobile(),typeof refineRegionByRealIP=="function"&&refineRegionByRealIP(this)),width=newWidth}),width<=767&&this.actionOnMobile()}}actionOnMobile(){this.classList.add("swiper"),this.classList.remove("grid","grid-cols"),this.style.setProperty("padding-bottom","52px"),this.viewAll&&this.viewAll.classList.add("hidden"),this.loadmore&&this.loadmore.length>0&&this.loadmore.forEach(button=>{button.classList.add("hidden"),button.classList.remove("block")});const wrapper=`<div class='swiper-wrapper'>${this.swiperSlideInnerHtml.replaceAll("grid-custom-item","swiper-slide")}</div>
47      <div class="delta-trust-pagination-progressbar ${this.enable&&this.dataset.mobile!=1.5?"flex":"hidden"}">
48        <div class="swiper-actions flex content-center gap-10 mb-0">
49            <div class="trust-arrow trust-arrow-prev swiper-button-prev">
50                <svg width="6" height="11" fill="none">
51                    <use href="#icon-back" />
52                </svg>
53            </div>
54            <div class="swiper-pagination"></div>
55            <div class="trust-arrow trust-arrow-next swiper-button-next">
56                <svg width="6" height="11" fill="none">
57                    <use href="#icon-next" />
58                </svg>
59            </div>
60        </div>
61    </div>
62    `;this.innerHTML=wrapper,this.initSlide()}actionOutMobile(){this.classList.remove("swiper"),this.classList.add("grid","grid-cols"),this.viewAll&&this.viewAll.classList.remove("hidden"),this.innerHTML=this.swiperSlideInnerHtml,this.loadmore&&this.loadmore.length>0&&this.loadmore.forEach(button=>{button.classList.add("block"),button.classList.remove("hidden")})}}customElements.define("grid-custom",GridCustom);class SlideWithThumbs extends HTMLElement{constructor(){super(),this.globalSlide=null,this.thumbnailSlide=null,this.loop=!1,this.deferInitForLCP(
62)}deferInitForLCP(){const lcpImg=this.querySelector('img[fetchpriority="high"]');lcpImg&&!lcpImg.complete?(lcpImg.addEventListener("load",()=>this.init(),{once:!0}),setTimeout(()=>{this.globalSlide||this.init()},3e3)):this.init()}init(){this.dataset?.nothumb||(this.initThumbnail(),Shopify.designMode&&document.addEventListener("shopify:section:load",()=>this.initThumbnail())),this.initSlide(),this.pauseMedia(),this.playMedia()}initSlide(){var autoplaying=this?.dataset.autoplay==="true";this.loop=this?.dataset.loop==="true";const rewind=this?.dataset.rewind==="true",itemMobile=this?.dataset.mobile?this?.dataset.mobile:1,itemDesktop=this?.dataset.desktop?this?.dataset.desktop:4;var itemTablet=this?.dataset.tablet?this?.dataset.tablet:"",direction=this?.dataset.direction?this?.dataset.direction:"horizontal",autoplaySpeed=this?.dataset.autoplaySpeed?this?.dataset.autoplaySpeed*1e3:3e3,speed=this?.dataset.speed?this?.dataset.speed:400;const effect=this?.dataset.effect?this?.dataset.effect:"slide";var spacing=this?.dataset.spacing?this?.dataset.spacing:30;spacing=Number(spacing),autoplaySpeed=Number(autoplaySpeed),speed=Number(speed),autoplaying&&(autoplaying={delay:autoplaySpeed});const deferAutoplay=autoplaying&&effect==="fade";window.innerWidth<767&&(direction="horizontal");const container=this.querySelector(".main-slide__navigation"),initSwiper=this.querySelector(".swiper-wrapper-preview");var _this=this;const slideCount=initSwiper?initSwiper.querySelectorAll(".swiper-slide").length:0,loopEnabled=this.loop&&slideCount>Number(itemMobile)*2;if(this.globalSlide=new Swiper(initSwiper,{slidesPerView:itemMobile,spaceBetween:spacing>=15?15:spacing,autoplay:deferAutoplay?!1:autoplaying,direction,loop:loopEnabled,rewind,effect,fadeEffect:effect==="fade"?{crossFade:!0}:null,speed,watchSlidesProgress:!0,watchSlidesVisibility:!0,navigation:{nextEl:container?.querySelector(".swiper-button-next"),prevEl:container?.querySelector(".swiper-button-prev")},pagination:{clickable:!0,el:this.querySelector(".swiper-pagination"),type:"custom",renderCustom:function(swiper,current,total){return current+" / "+total}},breakpoints:{768:{slidesPerView:itemTablet},1025:{slidesPerView:itemDesktop}},on:{init:function(){var slide_visibles=_this.querySelectorAll(".swiper-slide:not(.swiper-slide-visible) motion-element");slide_visibles?.forEach(slide=>{typeof slide?.initialize=="function"&&slide?.initialize()});const currentSlide=this.slides[this.activeIndex];currentSlide&&currentSlide.classList.contains("cloudimage-360")?this.allowTouchMove=!1:this.allowTouchMove=!0},slideChange:function(){const currentSlide=this.slides[this.activeIndex];currentSlide&&(currentSlide.classList.contains("media-gallery__model")||currentSlide.classList.contains("cloudimage-360")?this.allowTouchMove=!1:this.allowTouchMove=!0)}},thumbs:{swiper:this.thumbnailSlide?this.thumbnailSlide:null}}),deferAutoplay&&this.globalSlide){const swiper=this.globalSlide,startAutoplay=()=>{window.removeEventListener("scroll",startAutoplay),window.removeEventListener("click",startAutoplay),window.removeEventListener("touchstart",startAutoplay),!(!swiper||swiper.destroyed||!swiper.params)&&(swiper.params.autoplay=autoplaying,swiper.autoplay.start())};window.addEventListener("scroll",startAutoplay,{passive:!0}),window.addEventListener("click",startAutoplay),window.addEventListener("touchstart",startAutoplay,{passive:!0})}}initThumbnail(){const container=this.querySelector(".thumbnail-slide");if(!container)return;var direction=this.dataset.thumbDirection?this.dataset.thumbDirection:"horizontal";const slidesPerView=this.dataset.thumbSlidesPerView?this.dataset.thumbSlidesPerView:4,spaceBetween=this.dataset.thumbSpaceBetween?this.dataset.thumbSpaceBetween:10,watchSlidesVisibility=this.dataset.thumbWatchSlidesVisibility?this.dataset.thumbWatchSlidesVisibility:!0,watchOverflow=this.dataset.thumbWatchOverflow?this.dataset.thumbWatchOverflow:!0;var thumbWrapEl=container.closest(".media-thumb-swiper");this.thumbnailSlide=new Swiper(container,{direction:"horizontal",spaceBetween:16,slidesPerView:"auto",watchSlidesVisibility,watchSlidesProgress:!0,watchOverflow,breakpoints:{768:{direction,slidesPerView:direction=="vertical"?10:"auto",spaceBetween}},on:{init:function(){updateThumbFadeMask(this,thumbWrapEl)},reachEnd:function(){updateThumbFadeMask(this,thumbWrapEl)},fromEdge:function(){updateThumbFadeMask(this,thumbWrapEl)},resize:function(){updateThumbFadeMask(this,thumbWrapEl)}}});function updateThumbFadeMask(swiper,wrapEl){if(wrapEl){var isEnd=swiper.isEnd||swiper.slides.length<=Math.ceil(swiper.params.slidesPerView);wrapEl.classList.toggle("thumbs-at-end",isEnd)}}}pauseMedia(){this.globalSlide.on("slideChange",function(){})}playMedia(){if(this?.dataset.autoPlayVideo==="true"){if(!document.querySelector('script[src*="player.vimeo.com/api"]')){var vimeoTag=document.createElement("script");vimeoTag.src="https://player.vimeo.com/api/player.js",document.head.appendChild(vimeoTag)}this.globalSlide.on("slideChangeTransitionEnd",function(){var activeSlide=this.slides[this.activeIndex],video=activeSlide.querySelector(".media-video");if(video){if(video.tagName==="VIDEO")video.play().catch(()=>{});else if(video.tagName==="IFRAME"){if(video.src.includes("vimeo")){var vimeoPlayer=new Vimeo.Player(video);vimeoPlayer.play()}video.src.includes("youtube")&&video.contentWindow.postMessage('{"event":"command","func":"playVideo","args":""}',"*")}}})}}playActiveSlideVideo(swiper){}functionGoto(position){this.loop?this.globalSlide.slideToLoop(position,500):this.globalSlide.slideTo(position,500)}
62updateSlide(){this.globalSlide.update()}updateThumbSlide(){this.thumbnailSlide.update()}appendSlide(item){this.globalSlide.appendSlide(item)}}customElements.define("slide-with-thumbs",SlideWithThumbs);class ProductRecentlyViewed extends SlideSection{constructor(){super()}init(){this.call()}initData(){var savedProductsArr=JSON.parse(localStorage.getItem("glozin__recently-viewed-products"));this.getStoredProducts(savedProductsArr)}getStoredProducts(p){const limit=this.dataset?.limit;if(limit){var query="",productAjaxURL="";p&&p.length>0&&(query=p.slice().slice(0,limit).join("%20OR%20id:"),productAjaxURL=`&q=id:${query}`)}fetch(`${this.dataset.url}${productAjaxURL}`).then(response=>response.text()).then(text=>{const html=document.createElement("div");html.innerHTML=text;const recentlyViewedProducts=html.querySelector("recently-viewed-products");recentlyViewedProducts&&recentlyViewedProducts.innerHTML.trim().length&&(this.innerHTML=recentlyViewedProducts.innerHTML),recentlyViewedProducts.innerHTML.trim().length===0&&this.remove()}).finally(()=>{this.querySelector(".swiper-wrapper")&&this.initSlide(),initLazyloadItem(),BlsLazyloadImg.init()}).catch(e=>{console.error(e)})}call(){const __this=this,handleIntersection=(entries,observer)=>{entries[0].isIntersecting&&(observer.unobserve(this),__this.initData())};new IntersectionObserver(handleIntersection.bind(this),{rootMargin:"0px 0px 400px 0px"}).observe(this)}}customElements.define("recently-viewed-products",ProductRecentlyViewed);class MediaGallery extends HTMLElement{constructor(){super()}setActiveMedia(mediaId,prepend){const activeMedia=this.querySelector('[id^="GalleryViewer"]').querySelector(`[data-media-id="${mediaId}"]`);activeMedia&&(this.querySelector('[id^="GalleryViewer"]').querySelectorAll("[data-media-id]").forEach(element=>{element.classList.remove("is-active")}),activeMedia.classList.add("is-active"),prepend&&activeMedia.parentElement.prepend(activeMedia))}}customElements.define("media-gallery",MediaGallery);function pauseAllMedia(){document.querySelectorAll(".js-youtube").forEach(video=>{video.contentWindow.postMessage('{"event":"command","func":"pauseVideo","args":""}',"*")}),document.querySelectorAll(".js-vimeo").forEach(video=>{video.contentWindow.postMessage('{"method":"pause"}',"*")}),document.querySelectorAll("video").forEach(video=>video.pause()),document.querySelectorAll("product-model").forEach(model=>{model.modelViewerUI&&model.modelViewerUI.pause()})}var BlsCustomer=(function(){return{init:function(){this.toggleForm(),this.deleteAddresses(),this.addAddresses()},toggleForm:function(){const e=document.querySelector(".add-address"),c=document.querySelector(".cancel-add");e!==null&&c!==null&&(e.addEventListener("click",()=>{e.getAttribute("aria-expanded")==="false"?(e.setAttribute("aria-expanded","true"),e.closest(".bls-customer__address").classList.add("active")):(e.setAttribute("aria-expanded","false"),e.closest(".bls-customer__address").classList.remove("active"))}),c.addEventListener("click",()=>{c.closest(".bls-customer__address").classList.contains("active")&&(e.closest(".bls-customer__address").classList.remove("active"),e.closest(".add-address").setAttribute("aria-expanded","false"))}))},deleteAddresses:function(){document.querySelectorAll(".address-delete").forEach(e=>{e.addEventListener("click",()=>{const id=e?.dataset.formId,msg=e?.dataset.confirmMessage;confirm(msg||"Are you sure you wish to delete this address?")&&Shopify.postLink("/account/addresses/"+id,{parameters:{_method:"delete"}})})})},addAddresses:function(){Shopify&&document.getElementById("AddressCountryNew")&&new Shopify.CountryProvinceSelector("AddressCountryNew","AddressProvinceNew",{hideElement:"AddressProvinceNewContainer"}),document.querySelectorAll(".edit-country-option").forEach(e=>{const formId=e?.dataset.formId,editCountry="AddressCountry_"+formId,editProvince="AddressProvince_"+formId,editContainer="AddressProvinceContainer_"+formId;new Shopify.CountryProvinceSelector(editCountry,editProvince,{hideElement:editContainer})})}}})();BlsCustomer.init();class ideaProducts extends HTMLElement{constructor(){super(),this.view_idea_product=this.querySelector(".view_idea_product"),this.content=this.querySelector(".idea-product-list"),this.close=this.querySelector(".close"),this.init()}init(){const _this=this;this.view_idea_product.addEventListener("click",e=>{_this.toggleViewIdeaProducts("show")}),this.close.addEventListener("click",e=>{_this.toggleViewIdeaProducts.bind(_this)()})}toggleViewIdeaProducts(type="hidden"){type=="hidden"?this.classList.remove("active"):this.classList.add("active")}}customElements.define("idea-product",ideaProducts);const outfit_idea=document.querySelector(".outfit_idea");outfit_idea&&document.body.addEventListener("click",function(event){event.target.closest(".idea-product")||document.querySelectorAll("idea-product").forEach(instance=>{instance.toggleViewIdeaProducts()})});function PreloadPage(){const preload=document.querySelector("preload-page");window.addEventListener("DOMContentLoaded",()=>{preload&&motion.animate(preload,{opacity:[1,0],visibility:["visible","hidden"]},{ease:[.7,0,.2,1],duration:1})})}PreloadPage();class GridList extends HTMLElement{constructor(){super(),this.hasAttribute("hold")||motion.inView(this,this.showGridItems.bind(this),{margin:"0px 0px -5px 0px"})}get gridItems(){return this.querySelectorAll("motion-element[hold]:not([data-image]):not([style*='opacity: 1']")}get visibleGridItems(){return this.querySelectorAll("motion-element:not([data-image])[style*='opacity: 1']")}hideGrid(){motion.animate(this.gridItems,{transform:"translateY(3.5rem)",opacity:.01,visibility:"hidden"},{duration:0})}hideGridItems(){this.hasAttribute("hold")||motion.animate(this.visibleGridItems,{transform:["translateY(0)","translateY(3.5rem)"],opacity:[1,.01],visibility:["visible","hidden"]},{duration:.4,delay:motion.stagger(.1),easing:[0,0,.3,1]})}showGridItems(){this.hasAttribute("hold")||motion.animate(this.gridItems,{transform:["translateY(3.5rem)","translateY(0)"],opacity:[.01,1],visibility:["hidden","visible"]},{duration:.47,delay:motion.stagger(.15,{startDelay:.1}),easing:[0,0,.3,1]})}}customElements.define("grid-list",GridList);class ProgressStockBar extends HTMLElement{constructor(){super(),motion.inView(this,this.init.bind(this),{margin:"0px 0px -10px 0px"})}init(){this.style.setProperty("--percent","100%"),setTimeout(()=>{this.style.setProperty("--percent",`${this.dataset.progress}%`)},200)}}customElements.define("progress-stock-bar",ProgressStockBar);class HeaderTotalPrice extends HTMLElement{constructor(){super()}updateTotal(cart){if(this.minicart_total=this.querySelector("[data-cart-subtotal-price]"),!this.minicart_total||cart.total_price==null)return;const price_format=Shopify.formatMoney(cart.total_price,cartStrings?.money_format);this.minicart_total.innerHTML=price_format}}customElements.define("header-total-price",HeaderTotalPrice);class ProductWithBanner extends HTMLElement{constructor(){super(),this.bannerImages=this.querySelectorAll(".product-banner__image"),this.init()}init(){this.waitForSlideSection()}waitForSlideSection(attempts=0){if(attempts>50)return;const slideSection=this.querySelector("slide-section");if(!slideSection||!slideSection.globalSlide){setTimeout(()=>this.waitForSlideSection(attempts+1),100);return}slideSection.updateActiveBanner=()=>{},slideSection.globalSlide.on("slideChange",()=>{this.updateActiveBanner(slideSection.globalSlide)}),this.updateActiveBanner(slideSection.globalSlide,!0)}updateActiveBanner(swiper,isInitial=!1){if(!(!swiper||!this.bannerImages||this.bannerImages.length<=0)&&!isInitial){const activeSlide=swiper.slides[swiper.activeIndex];if(!activeSlide)return;const productId=activeSlide.querySelector("[data-product-id]")?.dataset.productId||activeSlide.querySelector(".block-text-product__item")?.dataset.productId||this.querySelectorAll(".swiper-slide")[swiper.realIndex]?.dataset.productId;
62this.bannerImages.forEach(image=>{image.classList.remove("active")});let matchingBanner;if(productId&&(matchingBanner=Array.from(this.bannerImages).find(image=>image.dataset.productId===productId)),matchingBanner)matchingBanner.classList.add("active");else{const index=swiper.realIndex;this.bannerImages[index]&&this.bannerImages[index].classList.add("active")}}}}customElements.define("product-with-banner",ProductWithBanner);class PopupAddons extends PopupBase{constructor(){super(),this.popupPopupDiv=this.querySelector(".popup-addons__content"),this.targetHash=this.dataset.hash,this.init()}init(){this.popupPopupDiv?(this.addEventListener("click",this.onClick.bind(this)),this.getAttribute("role")==="button"&&this.addEventListener("keydown",this.onKeydown.bind(this)),this.targetHash&&(this.checkHashAndOpen(),window.addEventListener("hashchange",this.checkHashAndOpen.bind(this),!1))):console.warn('PopupAddons Warning: No ".popup-addons__content" found inside this element. Popup cannot be initialized.',this)}onKeydown(e){e.target!==this||e.repeat||e.key!=="Enter"&&e.key!==" "||(e.preventDefault(),this.onClick(e))}
62checkHashAndOpen(){if(!window.location.hash||!this.targetHash)return;const currentHash=window.location.hash.replace("#","").toLowerCase(),target=this.targetHash.toLowerCase();currentHash===target&&setTimeout(()=>{document.querySelector(".tingle-modal--visible")||this.onClick()},500)}onClick(e){e&&e.preventDefault();const html=this.popupPopupDiv;html&&(html.classList.remove("hidden"),this.initPopup(html,`<h3 class="title-popup h5 my-0 px-20 px-md-30 py-20 border-bottom">${this.dataset?.textHeader}</h3>`))}}customElements.define("popup-addons",PopupAddons);class FoldupAddons extends PopupBase{constructor(){super(),this.onClick=this.onClick.bind(this)}connectedCallback(){this.init()}init(){this.trigger=this.querySelector(".foldup-trigger"),this.trigger&&this.trigger.addEventListener("click",this.onClick)}disconnectedCallback(){this.trigger&&this.trigger.removeEventListener("click",this.onClick)}onClick(e){const isOpen=this.classList.toggle("open");this.trigger&&this.trigger.setAttribute("aria-expanded",isOpen)}}customElements.define("foldup-addons",FoldupAddons);class WWTabItems extends HTMLElement{constructor(){super(),this.tabs=this.querySelectorAll(".ww-tab__tab-item"),this.select=this.querySelector(".ww-tab__select-tab"),this.content=this.querySelectorAll(".ww-tab__tab-content"),this.init()}init(){const self=this;
62this.tabs.forEach(tab=>{tab.addEventListener("click",function(){self.onClick(this)}),tab.addEventListener("keydown",function(event){(event.key==="Enter"||event.key===" ")&&(event.preventDefault(),self.onClick(this))})})}onClick(tab){const blockId=tab.dataset.blockId;this.showContent(blockId),this.tabs.forEach(t=>{t.classList.remove("active"),t.setAttribute("aria-expanded","false")}),tab.classList.add("active"),tab.setAttribute("aria-expanded","true")}showContent(blockId){this.content.forEach(content=>{content.dataset.blockId===blockId?(content.classList.add("active"),content.removeAttribute("inert"),content.setAttribute("aria-hidden","false"),content.querySelectorAll("motion-element").forEach(motion2=>{motion2.refreshAnimation()})):(content.classList.remove("active"),content.setAttribute("inert",""),content.setAttribute("aria-hidden","true"))})}}customElements.define("ww-tab-items",WWTabItems);class WWTabMulti extends HTMLElement{constructor(){super(),this.select=this.querySelector(".ww-select-collection-tab"),this.content=this.querySelectorAll(".ww-collection-tab__tab-content"),this.select_li=this.querySelectorAll(".ww-collection_title_input"),this.init()}init(){const self=this;this.select.addEventListener("click",function(e){if(e.target.classList.contains("ww-select__selected_title")){let select__dropdown=this.querySelector(".ww-select-custom__content");this.classList.toggle("active"),select__dropdown.classList.toggle("invisible")}}),document.addEventListener("click",function(event){event.target.closest(".ww-select-collection-tab")||(self.select.classList.remove("active"),document.querySelectorAll(".ww-select-collection-tab .ww-select-custom__content")?.forEach(item=>{item.classList.add("invisible")}))}),this.select_li.forEach(item=>{item.addEventListener("click",function(){self.onClickBySelect(this),self.select.classList.remove("active"),document.querySelectorAll(".ww-select-collection-tab .ww-select-custom__content")?.forEach(item2=>{item2.classList.add("invisible")})})})}onClickBySelect(selectedBlockId){let select__selected_title=this.querySelector(".ww-select__selected_title");select__selected_title.innerHTML=selectedBlockId.innerHTML+`<svg class="icon-down transition active-rotated" width="10" height="6">
63         <use href="#icon-arrow-down"></use>
64       </svg>`,this.showContent(selectedBlockId.dataset.id)}showContent(blockId){this.content.forEach(content=>{content.dataset.blockId===blockId?(content.classList.add("active"),content.querySelectorAll("motion-element").forEach(motion2=>{motion2.refreshAnimation()})):content.classList.remove("active")})}}customElements.define("ww-multi-tab-select",WWTabMulti);class RegionSelector extends PopupBase{constructor(){super(),this.$host=window.location.host,this.currentPath=new URL(window.location.href).pathname,this.design_mode=this.dataset.design_mode==="true",this.ip_guide=this.dataset.ip_guide==="true",this.ip_guide_hide_days=parseInt(this.dataset.ip_guide_hide_days,10)||0,this.shop_iso_code=this.dataset.shop_iso_code,this.user_country=window.userSiteData?.country||"",this.user_market=window.userSiteData?.market_handle||"",this.user_country_iso_code=window.userSiteData?.country_iso_code||"";const currentHref=window.location.href;currentHref.startsWith("https://eu.plaud.ai/nl/")||currentHref==="https://eu.plaud.ai/nl"?(this.$host="eu.plaud.ai/nl",this.shop_iso_code="NL"):(currentHref.startsWith("https://eu.plaud.ai/pt/")||currentHref==="https://eu.plaud.ai/pt")&&(this.$host="eu.plaud.ai/pt",this.shop_iso_code="PT"),this.$host==="sea.plaud.ai"&&/^\/en-(th|my|vi|ph)(\/|$)/.test(this.currentPath)&&(this.shop_iso_code=""),this.siteData=[],this.allSites=[],this.modalContent="",this.modalTitle=`<h2 class="fs-title-1">${this.dataset.modal_title||""}</h2>`,this.activeSite={},this.targetSite={},this.$activeIsoCodeDom=this.querySelector(".active-store-iso-code"),this.$activeLanguageDom=this.querySelector(".active-store-language"),this.$ipGuideSection=document.querySelector("#ip-guide-section"),this.$ipGuidePopup=document.querySelector("#ip-guide-popup"),this.init()}init(){this.siteData=this.getSiteData(),this.allSites=this.siteData.reduce((acc,region)=>acc.concat(region.children||[]),[]),this.modalContent=this.getModalContent(),this.activeSite=this.getActiveSite(),this.$activeIsoCodeDom&&this.activeSite.iso_code&&(this.$activeIsoCodeDom.innerText=this.activeSite.iso_code);const activeLanguageName=this.activeSite.language_local_name||this.activeSite.language_name;this.$activeLanguageDom&&activeLanguageName&&(this.$activeLanguageDom.innerText=`(${activeLanguageName})`),window.addEventListener("load",()=>{this.addEventListener("click",this.onThisClick.bind(this)),this.dataset.regionClickReady="true"}),window.saRegionGeo&&typeof window.saRegionGeo.flushOpen=="function"&&window.saRegionGeo.flushOpen(this),this.ip_guide&&this.$ipGuideSection&&window.addEventListener("load",()=>{fetch("/browsing_context_suggestions.json").then(r=>r.json()).then(data=>{const realIso=data?.detected_values?.country?.handle?.toUpperCase();realIso&&(this.user_country_iso_code=realIso)}).catch(()=>{}).finally(()=>this.ipGuideHandle())})}onThisClick(){this.initPopup(this.modalContent,this.modalTitle,"region-selector-modal",$modalBox=>{window.innerWidth<=768&&$modalBox.querySelectorAll(".region-name").forEach(ele=>{var parentEle=ele.parentElement;parentEle.classList.add("hide"),ele.addEventListener("click",function(){parentEle.classList.toggle("hide")})}),$modalBox.querySelectorAll(".site-item a").forEach(ele=>{ele.addEventListener("click",e=>{e.preventDefault();const href=ele.getAttribute("href");href&&(window.location.href=this._buildRedirectUrl(href))})})})}getSiteData(){const data=Array.isArray(window.siteData)?window.siteData:[];if(!data)return;data.sort((a,b)=>a.id-b.id),data.forEach(item=>{item.children.length>0&&item.children.sort((a,b)=>a.id-b.id)});const browserLang=navigator.language||navigator.userLanguage;return["BE","LU","CH"].forEach(countryCode=>{const matchSites=[];if(data.forEach(item=>
64{item.children&&item.children.forEach(child=>{child.iso_code===countryCode&&matchSites.push(child)})}),matchSites.length>1){let targetSite=matchSites.find(site=>browserLang.startsWith(site.language_isocode));targetSite||(targetSite=matchSites.find(site=>site.language_isocode==="en")),targetSite&&data.forEach(item=>{item.children&&(item.children=item.children.filter(child=>child.iso_code!==countryCode||child===targetSite))})}}),data}getModalContent(){const regionItemTemplate=`
65      <div class="region-item">
66        <div class="region-name">
67          <h3 class="fs-title-3" data-handle="{__handle}">{__region}</h3>
68          <svg fill="none" height="17" viewBox="0 0 16 17" width="16" xmlns="http://www.w3.org/2000/svg"><path d="m10.5867 6.69329-2.58671 2.58667-2.58667-2.58667c-.26-.26-.68-.26-.94 0s-.26.68 0 .94l3.06 3.06001c.26.26.68.26.94 0l3.05998-3.06001c.26-.26.26-.68 0-.94-.26-.25333-.6866-.26-.9466 0z" fill="currentColor"></path></svg>
69        </div>
70        <ul class="site-list list-none">{__children}</ul>
71      </div>
72    `,siteItemTemplate=`
73      <li class="site-item">
74        <a href="{__website_url}" data-iso_code="{__iso_code}">
75          <span class="fs-headline">{__name}</span>
76          <span class="fs-body-md text-secondary" data-iso_code="{__language_isocode}">
77            {__language_name} / {__currency}
78          </span>
79        </a>
80      </li>
81    `;var html="";return this.siteData.forEach(item=>{var childrenHtml="";item.children.forEach(site=>{site.is_visible!=="false"&&(childrenHtml+=siteItemTemplate.replace("{__name}",site.local_name||site.name).replace("{__iso_code}",site.iso_code).replace("{__website_url}",site.website_url).replace("{__language_name}",site.language_local_name||site.language_name).replace("{__language_isocode}",site.language_isocode).replace("{__currency}",site.currency))}),html+=regionItemTemplate.replace("{__handle}",item.handle).replace("{__region}",item.region).replace("{__children}",childrenHtml)}),`<div class="region-list">${html}</div>`}getActiveSite(){const normalizePath=p=>p==="/"?"/":p.replace(/\/+$/,"");if(this.shop_iso_code){const isoMatch=this.allSites.find(site=>site.iso_code===this.shop_iso_code);if(isoMatch)return isoMatch}let matched={},matchedLen=-1;for(const site of this.allSites)try{const url=new URL(site.website_url);if(url.host!==this.$host)continue;const sitePath=normalizePath(url.pathname);if(sitePath!=="/"&&!this.currentPath.startsWith(sitePath))continue;const len=sitePath==="/"?0:sitePath.length;len>matchedLen&&(matched=site,matchedLen=len)}catch(err){console.warn("[getActiveSite] Invalid URL:",site.website_url,err)}return matched}getTargetSite(){const byIso=this.allSites.find(site=>site.iso_code===this.user_country_iso_code);if(byIso)return byIso;for(const region of this.siteData)if(region.market===this.user_market)return region.main_site||region.children[0];const globalRegion=this.siteData.find(r=>r.market==="global");return globalRegion?globalRegion.main_site||globalRegion.children[0]:null}_buildRedirectUrl(baseUrl){const utmKeys=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],current=new URLSearchParams(window.location.search),carry=new URLSearchParams;utmKeys.forEach(k=>{const v=current.get(k);v&&carry.set(k,v)}),carry.set("manual_redirect","1");const sep=baseUrl.includes("?")?"&":"?";return baseUrl+sep+carry.toString()}goToTargetSite(){window.location.href=this._buildRedirectUrl(this.targetSite.website_url)}ipGuideHandle(){const detectedName=this.$ipGuideSection?.dataset?.detectedName||"";if(this.activeSite&&this.activeSite.iso_code===this.user_country_iso_code||(this.targetSite=this.getTargetSite(),!this.targetSite||!this.targetSite.website_url)||this.activeSite.website_url===this.targetSite.website_url||!this.design_mode&&getCookie("ip_guide_stay"))return;const $bar=this.$ipGuidePopup;if(!$bar)return;const $select=$bar.querySelector(".ip-guide-select"),$trigger=$bar.querySelector(".ip-guide-select__trigger"),$trigLabel=$trigger?.querySelector(".ip-guide-select__label-text"),$optCountry=$bar.querySelector(".ip-guide-select__option--country"),$optOther=$bar.querySelector(".ip-guide-select__option--other"),$continue=$bar.querySelector(".guide-btn"),$close=$bar.querySelector(".close-btn"),countryLabel=detectedName||this.targetSite.local_name||this.targetSite.name||"",otherLabel=$optOther?$optOther.textContent.trim():"";$bar.querySelectorAll(".ip-guide-select__label-text, .guide-country-option").forEach(el=>{el.textContent=countryLabel});let selectedType="country";const setSelected=type=>{selectedType=type;const isCountry=type==="country";$optCountry&&$optCountry.setAttribute("aria-selected",isCountry?"true":"false"),$optOther&&$optOther.setAttribute("aria-selected",isCountry?"false":"true"),$trigLabel&&($trigLabel.textContent=isCountry?countryLabel:otherL
81abel)},closeDropdown=()=>$trigger?.setAttribute("aria-expanded","false"),toggleDropdown=()=>{if(!$trigger)return;const open=$trigger.getAttribute("aria-expanded")==="true";$trigger.setAttribute("aria-expanded",open?"false":"true"),open||requestAnimationFrame(()=>{($bar.querySelector('.ip-guide-select__option[aria-selected="true"]')||$optCountry)?.focus()})};$bar.dataset.ipGuideReady||($bar.dataset.ipGuideReady="1",$trigger&&($trigger.addEventListener("click",e=>{e.stopImmediatePropagation(),toggleDropdown()}),$trigger.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),toggleDropdown()),e.key==="Escape"&&closeDropdown()})),$optCountry&&($optCountry.addEventListener("click",()=>{setSelected("country"),closeDropdown(),$trigger?.focus()}),$optCountry.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),setSelected("country"),closeDropdown(),$trigger?.focus()),e.key==="ArrowDown"&&(e.preventDefault(),setSelected("other"),$optOther?.focus()),e.key==="Escape"&&(closeDropdown(),$trigger?.focus())})),$optOther&&($optOther.addEventListener("click",()=>{setSelected("other"),closeDropdown(),$trigger?.focus()}),$optOther.addEventListener("keydown",e=>{(e.key==="Enter"||e.key===" ")&&(e.preventDefault(),setSelected("other"),closeDropdown(),$trigger?.focus()),e.key==="ArrowUp"&&(e.preventDefault(),setSelected("country"),$optCountry?.focus()),e.key==="Escape"&&(closeDropdown(),$trigger?.focus())})),$select&&$select.addEventListener("focusout",()=>{setTimeout(()=>{$select&&!$select.contains(document.activeElement)&&closeDropdown()},0)}),document.addEventListener("click",e=>{$select&&!$select.contains(e.target)&&closeDropdown()},{passive:!0}),$continue&&$continue.addEventListener("click",()=>{selectedType==="other"?(this._closeBar($bar),this.onThisClick()):this.goToTargetSite()}),$close&&$close.addEventListener("click",()=>{this._closeBar($bar),this.design_mode||setCookie("ip_guide_stay","true",this.ip_guide_hide_days)})),this._openBar($bar)}_openBar($bar){$bar.style.willChange="max-height, opacity",$bar.style.display="",requestAnimationFrame(()=>{requestAnimationFrame(()=>{$bar.classList.add("ip-guide-bar--open"),$bar.addEventListener("transitionend",()=>{$bar.style.willChange=""},{once:!0})})})}_closeBar($bar){$bar.style.willChange="max-height, opacity",$bar.classList.remove("ip-guide-bar--open"),$bar.addEventListener("transitionend",()=>{$bar.style.display="none",$bar.style.willChange=""},{once:!0})}}customElements.define("region-selector",RegionSelector);class QuantitySelector extends HTMLElement{constructor(){super(),this.inputElement=null}connectedCallback(){if(this.inputElement=this.querySelector(".quantity-selector-input"),!this.inputElement)return;const val=parseInt(this.dataset.min_count,10);this.min_count=isNaN(val)?1:val,attachQtyGuard(this.inputElement,{fallback:()=>this.inputElement.dataset.value!==void 0?this.inputElement.dataset.value:this.min_count});const[minusBtn,plusBtn]=this.querySelectorAll(".quantity-selector-btn");minusBtn&&minusBtn.addEventListener("click",()=>{this.updateQuantity(this.getValue()-1)}),plusBtn&&plusBtn.addEventListener("click",()=>{this.updateQuantity(this.getValue()+1)})}getValue(){const val=parseInt(this.inputElement.value,10);return isNaN(val)?1:val}updateQuantity(newValue){newValue<this.min_count&&(newValue=this.min_count),this.inputElement.value=newValue,this.inputElement.dispatchEvent(new Event("change",{bubbles:!0}))}}customElements.define("quantity-selector",QuantitySelector);class AIPlanRecommendation extends HTMLElement{constructor(){super(),this.$cartCountDomList=document.querySelectorAll(".cart-count"),this.$headerTotalPrice=document.querySelector("header-total-price"),this.$mainCart=document.querySelector("new-main-cart"),this.$popupCon=this.querySelector(".recommendation-popup-con"),this.$mask=this.querySelector(".mask"),this.$closeBtn=this.querySelector(".popup-close-btn"),this.$confirmBtn=this.querySelector(".popup-confirm-btn"),this.$switchBtn=this.querySelector(".recommendation-switch"),this.$productItemList=this.querySelectorAll(".product-item"),this.$firstYearlyProduct=this.querySelector('.product-item[data-type="yearly"]'),this.$firstMonthlyProduct=this.querySelector('.product-item[data-type="monthly"]'),this.productHandleList=Array.from(this.$productItemList).map(i=>i.dataset.handle),this.init()}init(){this.$confirmBtn?.addEventListener("click",e=>{e.preventDefault(),this.confirm()}),this.$closeBtn?.addEventListener("click",()=>this.close()),this.$mask?.addEventListener("click",()=>this.close()),this.$switchBtn?.addEventListener("click",()=>this.toggleType()),this.addEventListener("click",e=>{const item=e.target.closest(".product-item");item&&this.selectProduct(item.dataset.handle)}),this.addEventListener("keydown",event=>{if(event.key==="Escape"&&this.classList.contains("open")){event.preventDefault(),this.close();return}const item=event.target.closest(".product-item");if(!item)return;if(event.key==="Enter"||event.key===" "){event.preventDefault(),this.selectProduct(item.dataset.handle);return}if(!["ArrowLeft","ArrowRight","ArrowUp","ArrowDown","Home","End"].includes(event.key))return;const visibleItems=Array.from(this.$productItemList).filter(product=>product.getClientRects().length>0);if(!visibleItems.length)return;event.preventDefault();const currentIndex=Math.max(0,visibleItems.indexOf(item));let nextIndex=currentIndex;event.key==="Home"?nextIndex=0:event.key==="End"?nextIndex=visibleItems.length-1:event.key==="ArrowLeft"||event.key==="ArrowUp"?nextIndex=(currentIndex-1+visibleItems.length)%visibleItems.length:nextIndex=(currentIndex+1)%visibleItems.length;const nextItem=visibleItems[nextIndex];this.selectProduct(nextItem.dataset.handle),nextItem.focus()})}open(handle){(!handle||!this.productHandleList.includes(handle))&&(handle=this.$firstYearlyProduct?.dataset.handle||this.$firstMonthlyProduct?.dataset.handle),handle&&(this.teardownFocusTrap(),this._opener=document.activeElement,document.documentElement.classList.add("open-popup"),this.classList.add("open"),this.removeAttribute("inert"),this.setAttribute("aria-hidden","false"),this.selectProduct(handle),requestAnimationFrame(()=>{const utils=window.A11yFocusUtils;!utils||!this.classList.contains("open")||(this._focusTrapHandler=utils.trapFocus(this),document.addEventListener("keydown",this._focusTrapHandler,!0),(this.$closeBtn||this.querySelector('.product-item[aria-checked="true"]'))?.focu
81s())}))}close(){this.teardownFocusTrap(),document.documentElement.classList.remove("open-popup"),this.classList.remove("open"),this.setAttribute("aria-hidden","true"),this.setAttribute("inert",""),window.A11yFocusUtils&&this._opener?window.A11yFocusUtils.returnFocus(this._opener):this._opener?.focus?.(),this._opener=null}teardownFocusTrap(){this._focusTrapHandler&&(document.removeEventListener("keydown",this._focusTrapHandler,!0),this._focusTrapHandler=null)}disconnectedCallback(){this.teardownFocusTrap()}toggleType(){const product=this.$popupCon.classList.contains("yearly")?this.$firstMonthlyProduct:this.$firstYearlyProduct;product&&this.selectProduct(product.dataset.handle)}selectProduct(handle){if(!handle)return;const $target=this.querySelector(`.product-item[data-handle="${handle}"]`);if(!$target)return;const type=$target.dataset.type;this.$popupCon.classList.toggle("yearly",type==="yearly"),this.$switchBtn?.setAttribute("aria-checked",String(type==="yearly")),this.$productItemList.forEach(item=>{const isSelected=item===$target;item.classList.toggle("selected",isSelected),item.setAttribute("aria-checked",String(isSelected)),item.setAttribute("tabindex",isSelected?"0":"-1")}),$target.classList.add("selected")}async confirm(){const $selected=this.querySelector(".product-item.selected");if(!$selected)return;const id=$selected.dataset.id,selling_plan=$selected.dataset.selling_plan_id||void 0;if(id){typeof handleAddToCart=="function"&&handleAddToCart($selected),this.$confirmBtn?.classList.add("loading");try{if(selling_plan){const cartInfo=await this.getCartInfo();if(cartInfo.ids.includes(id))return;const updates={};cartInfo.sellingPlanItems.forEach(itemId=>{updates[itemId]=0}),Object.keys(updates).length>0&&await fetch("/cart/update.js",{...fetchConfig(),body:JSON.stringify({updates})})}await this.addProduct(id,selling_plan,!0),this.close(),this.openCartDrawer()}catch(e){console.error(e)}finally{this.$confirmBtn?.classList.remove("loading"),this.classList.contains("open")&&this.close()}}}async getCartInfo(){const ids=[],sellingPlanItems=[];return this.$mainCart?document.querySelectorAll("new-main-cart .cart-items-card > .cart-item").forEach(item=>{ids.push(item.dataset.id),item.dataset.selling_plan_id&&sellingPlanItems.push(item.dataset.id)}):(await fetch("/cart.json").then(r=>r.json())).items.forEach(item=>{ids.push(String(item.id)),item.selling_plan_allocation&&sellingPlanItems.push(String(item.id))}),{ids,sellingPlanItems}}openCartDrawer(){if(this.$mainCart)return;const cartElement=document.querySelector("cart-notification")||document.querySelector("cart-drawer");cartElement?cartElement.open():window.location=window.routes.cart_url}async addProduct(id,selling_plan=null,isRender=!0,callback=null){if(!id)return;const body=JSON.stringify({id,quantity:1,selling_plan:selling_plan||void 0,sections:this.$mainCart?.getSectionsToRender()?.map(s=>s.section)||[],sections_url:window.location.pathname});try{const stateText=await(await fetch(`${routes.cart_add_url}`,{...fetchConfig(),body})).text(),parsedState=JSON.parse(stateText);if(parsedState.errors){this.toastError(parsedState.errors);return}isRender&&this.updateCart(parsedState,!0)}catch(err){console.error(err)}finally{callback?.()}}updateCart(parsedState,showToast2=!1){if(this.$mainCart){this.$mainCart.renderData(parsedState,1);return}if(parsedState.item_count!==void 0){this.updateItemsCount(parsedState,showToast2);return}fetch("/cart.json").then(res=>res.json()).then(cart=>{parsedState.item_count=cart.item_count,this.updateItemsCount(parsedState,showToast2)}).catch(err=>{console.error("Error fetching cart:",err),parsedState.item_count=parsedState.item_count??0,this.updateItemsCount(parsedState,showToast2)})}updateItemsCount(parsedState,showToast2=!1){this.$cartCountDomList.forEach(el=>{el.innerHTML=el.classList.contains("cart-count-drawer")?`(${parsedState.item_count})`:parsedState.item_count>100?"~":parsedState.item_count}),this.$headerTotalPrice&&this.$headerTotalPrice.updateTotal(parsedState),showToast2&&this.toastSuccess(window.variantStrings.addSuccess)}toastSuccess(message){const wrapperDiv=document.createElement("div");wrapperDiv.innerHTML=`
82      <div class="mt-10 newsletter-form__message--success success form__message inline-flex align-center" tabindex="-1" role="status" aria-l
82ive="polite">
83        <svg width="18" height="18" fill="none">
84          <g stroke="#137F24" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3">
85            <path d="m6.033 8.992 1.972 1.98 3.952-3.96"/><path d="M7.973 1.178c.565-.482 1.49-.482 2.062 0l1.293 1.113c.245.213.704.385 1.03.385h1.392c.867 0 1.579.712 1.579 1.579v1.39c0 .32.172.786.384 1.032l1.113 1.292c.483.565.483 1.49 0 2.062l-1.113 1.293a1.813 1.813 0 0 0-.384 1.03v1.392c0 .867-.712 1.579-1.58 1.579h-1.39c-.32 0-.786.172-1.031.384l-1.293 1.113c-.564.483-1.489.483-2.062 0L6.681 15.71a1.813 1.813 0 0 0-1.031-.384H4.234c-.867 0-1.579-.712-1.579-1.58v-1.398c0-.32-.172-.778-.376-1.023l-1.105-1.301c-.474-.565-.474-1.48 0-2.045L2.28 6.677c.204-.246.376-.704.376-1.023V4.247c0-.868.712-1.58 1.58-1.58H5.65c.319 0 .785-.171 1.03-.384l1.293-1.105Z"/>
86          </g>
87        </svg>
88        <span class="ml-5">${message}</span>
89      </div>
90    `,showToast(wrapperDiv.innerHTML,2e3,"modal-success")}toastError(message,line){const wrapperDiv=document.createElement("div");wrapperDiv.innerHTML=`
91      <div class="mt-10 line-item-error-${line||1} error form__message inline-flex align-center" tabindex="-1" role="alert" aria-live="assertive">
92          <svg width="18" height="18" fill="none" class="flex-auto">
93              <g stroke="#D0473E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3">
94                  <path d="M7.977 1.198c.573-.482 1.498-.482 2.054 0l1.293 1.105a1.89 1.89 0 0 0 1.039.376h1.39c.868 0 1.58.712 1.58 1.58v1.39c0 .328.171.786.376 1.031l1.105 1.293c.482.573.482 1.497 0 2.054l-1.105 1.292c-.204.246-.376.704-.376 1.031v1.391c0 .867-.712 1.58-1.58 1.58h-1.39c-.328 0-.786.171-1.031.376L10.039 16.8c-.573.483-1.497.483-2.054 0l-1.292-1.104c-.246-.205-.712-.377-1.031-.377H4.23c-.867 0-1.58-.712-1.58-1.579v-1.399c0-.319-.163-.785-.367-1.023l-1.105-1.3c-.474-.565-.474-1.481 0-2.046l1.105-1.3c.204-.246.368-.705.368-1.024V4.267c0-.868.712-1.58 1.579-1.58h1.415c.328 0 .786-.171 1.031-.376l1.301-1.113ZM7 11l4-4M11 11 7 7"/>
95              </g>
96          </svg>
97          <span class="ml-5">${message}</span>
98      </div>
99    `,showToast(wrapperDiv.innerHTML,2e3,"modal-error")}}customElements.define("ai-plan-recommendation",AIPlanRecommendation);class KlaviyoNewsletter extends HTMLElement{constructor(){if(super(),this.publicKey=this.dataset.publicKey,this.listId=this.dataset.listId,this.customSource=this.dataset.source||"footer",this.successMsg=this.dataset.successMsg,this.errorMsg=this.dataset.errorMsg,this.form=this.querySelector("form"),this.submitBtn=this.querySelector('button[type="submit"]'),this.emailInput=this.querySelector('input[name="email"]'),!this.publicKey||!this.listId){console.warn("Klaviyo Configuration missing: Please set List ID & Public Key in settings."),this.emailInput&&(this.emailInput.disabled=!0,this.emailInput.placeholder="Subscription unavailable"),this.submitBtn&&(this.submitBtn.disabled=!0);return}this.successMessageDiv=this.querySelector(".klaviyo-success"),this.errorMessageDiv=this.querySelector(".klaviyo-error"),this.init()}init(){this.form&&(this.form.addEventListener("submit",this.onSubmit.bind(this)),this.submitBtn&&(this.submitBtn.disabled=!1))}onSubmit(e){if(e.preventDefault(),this.submitBtn?.classList.contains("loading"))return;const email=this.emailInput?.value;if(!email){console.warn("Email is empty.");return}this.submitBtn?.classList.add("loading");const url=`https://a.klaviyo.com/client/subscriptions/?company_id=${encodeURIComponent(this.publicKey)}`,payload={data:{type:"subscription",attributes:{custom_source:this.customSource,profile:{data:{type:"profile",attributes:{email,properties:{$source:this.customSource}}}}},relationships:{list:{data:{type:"list",id:this.listId}}}}};fetch(url,{method:"POST",headers:{"content-type":"application/vnd.api+json",accept:"application/vnd.api+json",revision:"2025-10-15"},body:JSON.stringify(payload)}).then(async res=>{if(res.ok)try{return await res.json()}catch{return{}}throw await res.json()}).then(data=>{this.successMessageDiv?(this.successMessageDiv.style.display="inline-flex",
99setTimeout(()=>{this.successMessageDiv.style.display="none"},5e3)):this.toastSuccess(this.successMsg),this.emailInput&&(this.emailInput.value="",this.emailInput.blur())}).catch(err=>{console.error("Klaviyo Subscribe error:",err),this.errorMessageDiv?(this.errorMessageDiv.style.display="inline-flex",setTimeout(()=>{this.errorMessageDiv.style.display="none"},5e3)):this.toastError(this.errorMsg)}).finally(()=>{this.submitBtn?.classList.remove("loading")})}toastSuccess(message){const wrapperDiv=document.createElement("div");wrapperDiv.innerHTML=`
100      <div class="mt-10 newsletter-form__message--success success form__message inline-flex align-center" tabindex="-1" role="status" aria-live="polite">
101        <svg width="18" height="18" fill="none">
102          <g stroke="#137F24" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3">
103            <path d="m6.033 8.992 1.972 1.98 3.952-3.96"/><path d="M7.973 1.178c.565-.482 1.49-.482 2.062 0l1.293 1.113c.245.213.704.385 1.03.385h1.392c.867 0 1.579.712 1.579 1.579v1.39c0 .32.172.786.384 1.032l1.113 1.292c.483.565.483 1.49 0 2.062l-1.113 1.293a1.813 1.813 0 0 0-.384 1.03v1.392c0 .867-.712 1.579-1.58 1.579h-1.39c-.32 0-.786.172-1.031.384l-1.293 1.113c-.564.483-1.489.483-2.062 0L6.681 15.71a1.813 1.813 0 0 0-1.031-.384H4.234c-.867 0-1.579-.712-1.579-1.58v-1.398c0-.32-.172-.778-.376-1.023l-1.105-1.301c-.474-.565-.474-1.48 0-2.045L2.28 6.677c.204-.246.376-.704.376-1.023V4.247c0-.868.712-1.58 1.58-1.58H5.65c.319 0 .785-.171 1.03-.384l1.293-1.105Z"/>
104          </g>
105        </svg>
106        <span class="ml-5">${message}</span>
107      </div>
108    `,showToast(wrapperDiv.innerHTML,2e3,"modal-success")}toastError(message,line){const wrapperDiv=document.createElement("div");wrapperDiv.innerHTML=`
109      <div class="mt-10 line-item-error-${line||1} error form__message inline-flex align-center" tabindex="-1" role="alert" aria-live="assertive">
110          <svg width="18" height="18" fill="none" class="flex-auto">
111              <g stroke="#D0473E" stroke-linecap="round" stroke-linejoin="round" stroke-width="1.3">
112                  <path d="M7.977 1.198c.573-.482 1.498-.482 2.054 0l1.293 1.105a1.89 1.89 0 0 0 1.039.376h1.39c.868 0 1.58.712 1.58 1.58v1.39c0 .328.171.786.376 1.031l1.105 1.293c.482.573.482 1.497 0 2.054l-1.105 1.292c-.204.246-.376.704-.376 1.031v1.391c0 .867-.712 1.58-1.58 1.58h-1.39c-.328 0-.786.171-1.031.376L10.039 16.8c-.573.483-1.497.483-2.054 0l-1.292-1.104c-.246-.205-.712-.377-1.031-.377H4.23c-.867 0-1.58-.712-1.58-1.579v-1.399c0-.319-.163-.785-.367-1.023l-1.105-1.3c-.474-.565-.474-1.481 0-2.046l1.105-1.3c.204-.246.368-.705.368-1.024V4.267c0-.868.712-1.58 1.579-1.58h1.415c.328 0 .786-.171 1.031-.376l1.301-1.113ZM7 11l4-4M11 11 7 7"/>
113              </g>
114          </svg>
115          <span class="ml-5">${message}</span>
116      </div>
117    `,showToast(wrapperDiv.innerHTML,2e3,"modal-error")}}customElements.define("klaviyo-newsletter",KlaviyoNewsletter),(function(){if(window.isPlaudNavInitialized)return;window.isPlaudNavInitialized=!0;const initNavigation=()=>{const tabSelectors={container:"[data-atlassian-menu]",tab:".at-tab-item",panel:".at-content-panel",visual:".at-visual-item",activeClass:"active"},handleTabActivation=tabElement=>{if(window.innerWidth<=1279)return;const container=tabElement.closest(tabSelectors.container);if(!container||tabElement.classList.contains(tabSelectors.activeClass))return;container.querySelectorAll(tabSelectors.tab).forEach(el=>{el.classList.remove(tabSelectors.activeClass),el.setAttribute("aria-expanded","false"),el.setAttribute("tabindex","-1")}),container.querySelectorAll(`.${tabSelectors.activeClass}`).forEach(el=>{el.classList.remove(tabSelectors.activeClass)}),tabElement.classList.add(tabSelectors.activeClass),tabElement.setAttribute("aria-expanded","true"),tabElement.setAttribute("tabindex","0");const panelId=tabElement.dataset.target;if(panelId){const panel=document.getElementById(panelId);panel&&panel.classList.add(tabSelectors.activeClass);const visualId=panelId.replace("-panel-","-visual-").replace("panel-","visual-"),visual=document.getElementById(visualId);visual&&visual.classList.add(tabSelectors.activeClass)}};document.body.dataset.plaudNavDelegatedEvents||(document.body.dataset.plaudNavDelegatedEvents="true",document.body.addEventListener("mouseover",e=>{if(window.innerWidth<=1279||!e.target||typeof e.target.closest!="function")return;const tab=e.target.closest("[data-atlassian-menu] .at-tab-item");tab&&handleTabActivation(tab)}),document.body.addEventListener("focusin",e=>{if(window.innerWidth<=1279||!e.target||typeof e.target.closest!="function")return;const tab=e.target.closest("[data-atlassian-menu] .at-tab-item");tab&&handleTabActivation(tab)}),document.body.addEventListener("keydown",e=>{if(window.innerWidth<=1279||!e.target||typeof e.target.closest!="function")return;const currentTab=e.target.closest("[data-atlassian-menu] .at-tab-item");if(!currentTab||e.key!=="ArrowDown"&&e.key!=="ArrowUp")return;const menu=currentTab.closest("[data-atlassian-menu]"),tabs=Array.from(menu.querySelectorAll(".at-tab-item")),index=tabs.indexOf(currentTab);if(index===-1||tabs.length===0)return;e.preventDefault();const direction=e.key==="ArrowDown"?1:-1;tabs[(index+direction+tabs.length)%tabs.length].focus()}),document.body.addEventListener("click",e=>{if(window.innerWidth>1279||!e.target||typeof e.target.closest!="function")return;const mobileTrigger=e.target.closest(".mobile-toggle-trigger");if(mobileTrigger){e.preventDefault(),e.stopPropagation(),mobileTrigger.closest("menu-item")?.querySelector("open-children-toggle")?.click();return}const trigger=e.target.closest("[data-accordion-trigger]");if(!trigger)return;e.preventDefault(),e.stopPropagation();const controlledId=trigger.getAttribute("aria-controls"),content=controlledId?document.getElementById(controlledId):trigger.closest("li")?.querySelector(".mobile-accordion-content");
117if(!content)return;const isOpen=content.classList.contains("is-open"),isNewHeaderAccordion=!!trigger.closest(".site-header--new");if(isOpen){content.classList.remove("is-open"),isNewHeaderAccordion||content.classList.add("hidden"),trigger.setAttribute("aria-expanded","false");return}const productsMobile=isNewHeaderAccordion?trigger.closest(".site-nav-v3__products-mobile"):null;productsMobile&&!productsMobile.hasAttribute("data-accordion-default-open")&&(productsMobile.querySelectorAll(".mobile-accordion-content.is-open").forEach(element=>{element.classList.remove("is-open")}),productsMobile.querySelectorAll('[data-accordion-trigger][aria-expanded="true"]').forEach(element=>{element.setAttribute("aria-expanded","false")})),content.classList.remove("hidden"),content.classList.add("is-open"),trigger.setAttribute("aria-expanded","true")}));const syncToggleAccessibility=isDesktop=>{document.querySelectorAll("open-children-toggle.static-1280").forEach(toggle=>{isDesktop?(toggle.setAttribute("tabindex","-1"),toggle.setAttribute("aria-hidden","true")):(toggle.setAttribute("tabindex","0"),toggle.hasAttribute("aria-expanded"),toggle.removeAttribute("aria-hidden"))})},mql=window.matchMedia("(max-width: 1279px)");syncToggleAccessibility(!mql.matches),window.__plaudNavBreakpointBound||(window.__plaudNavBreakpointBound=!0,mql.addEventListener("change",e=>{const isMobile=e.matches,isDesktop=!e.matches;syncToggleAccessibility(isDesktop),document.querySelectorAll(".at-tab-item.active, .at-content-panel.active, .at-visual-item.active").forEach(el=>{el.classList.remove("active")}),document.querySelectorAll(".mobile-accordion-content.is-open").forEach(el=>{el.classList.remove("is-open"),el.closest(".site-header--new")||el.classList.add("hidden")}),document.querySelectorAll('[data-accordion-trigger][aria-expanded="true"]').forEach(el=>{el.setAttribute("aria-expanded","false")}),document.querySelectorAll("[data-accordion-default-open] .mobile-accordion-content").forEach(el=>{el.classList.add("is-open")}),document.querySelectorAll("[data-accordion-default-open] [data-accordion-trigger]").forEach(el=>{el.setAttribute("aria-expanded","true")}),isDesktop&&document.documentElement.classList.contains("nav-open")&&(typeof window.__plaudCloseNavigation=="function"?window.__plaudCloseNavigation():(document.documentElement.classList.remove("nav-open","open-drawer"),document.documentElement.style.removeProperty("padding-right"))),isDesktop&&document.querySelectorAll("[data-atlassian-menu]").forEach(menu=>{const firstTab=menu.querySelector(".at-tab-item");if(firstTab){firstTab.classList.add("active"),firstTab.setAttribute("aria-expanded","true"),firstTab.setAttribute("tabindex","0");const panelId=firstTab.dataset.target;if(panelId){const panel=document.getElementById(panelId);panel&&panel.classList.add("active");const visualId=panelId.replace("-panel-","-visual-").replace("panel-","visual-"),visual=document.getElementById(visualId);visual&&visual.classList.add("active")}}})}))};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initNavigation):initNavigation(),document.addEventListener("shopify:section:load",initNavigation)})(),(function(){const initFooterAccordion=()=>{const triggers=document.querySelectorAll(".footer__accordion-btn");if(triggers.length===0)return;triggers.forEach(btn=>{const newBtn=btn.cloneNode(!0);btn.parentNode.replaceChild(newBtn,btn)}),document.querySelectorAll(".footer__accordion-btn").forEach(btn=>{btn.addEventListener("click",function(e){e.preventDefault();const targetId=this.getAttribute("aria-controls"),content=document.getElementById(targetId);if(!content)return;const isExpanded=this.getAttribute("aria-expanded")==="true";this.setAttribute("aria-expanded",!isExpanded),isExpanded?content.classList.remove("is-open"):content.classList.add("is-open")})})};document.readyState==="loading"?document.addEventListener("DOMContentLoaded",initFooterAccordion):initFooterAccordion(),document.addEventListener("shopify:section:load",e=>{e.target.id.includes("footer")&&initFooterAccordion()})})(),(function(){class OuraCardController{constructor(container){this.container=container,this.items=Array.from(container.querySelectorAll(".ww-expandable-col")),this.triggers=container.querySelectorAll(".ww-col-expand-trigger"),this.parallaxImages=container.querySelectorAll(".ww-
117parallax-image-container"),this.isSliderMode=container.dataset.desktopEnable==="true",this.swiperInstance=null,this.syncFrameId=null,this.isInteracting=!1,this.collapseDuration=800,this.expandDuration=950,this.desktopNavDelay=850,this.mobileNavDuration=900,this.mobileSliderDefaults=null,this.init()}init(){this.bindClickEvents(),this.isSliderMode?this.waitForSwiper():this.container.setAttribute("data-oura-ready","true")}bindClickEvents(){this.container.addEventListener("click",e=>{const btn=e.target.closest(".ww-col-expand-trigger");if(btn){e.preventDefault(),e.stopPropagation();const targetCol=btn.closest(".ww-expandable-col");this.toggleState(targetCol)}})}getSwiperInstance(){let swiper=this.container.globalSlide||this.container.swiper;if(!swiper){const swiperContainer=this.container.querySelector(".swiper");swiperContainer&&swiperContainer.swiper&&(swiper=swiperContainer.swiper)}return swiper&&swiper.initialized?(this.swiperInstance=swiper,swiper):this.swiperInstance&&this.swiperInstance.initialized?this.swiperInstance:(this.swiperInstance=null,null)}isMobileViewport(){return window.matchMedia("(max-width: 767.98px)").matches}getMobileSliderDefaults(swiper){if(this.mobileSliderDefaults)return this.mobileSliderDefaults;const fallbackSlidesPerView=this.container.dataset.mobile?parseFloat(this.container.dataset.mobile):swiper.params.slidesPerView,fallbackSpaceBetween=this.container.dataset.spacingMb?parseFloat(this.container.dataset.spacingMb):this.container.dataset.spacing?parseFloat(this.container.dataset.spacing):swiper.params.spaceBetween;return this.mobileSliderDefaults={slidesPerView:fallbackSlidesPerView||1,spaceBetween:Number.isFinite(fallbackSpaceBetween)?fallbackSpaceBetween:0,slidesOffsetAfter:swiper.params.slidesOffsetAfter||0},this.mobileSliderDefaults}setExpandedMobileSwiperLayout(swiper,expanded){if(!swiper)return;if(!this.isMobileViewport()){swiper.update();return}const defaults=this.getMobileSliderDefaults(swiper),slideSize=(swiper.width-(defaults.slidesPerView-1)*defaults.spaceBetween)/defaults.slidesPerView,expandedOffsetAfter=Math.max(0,swiper.width-slideSize),nextSlidesOffsetAfter=expanded?defaults.slidesOffsetAfter+expandedOffsetAfter:defaults.slidesOffsetAfter;(swiper.params.slidesPerView!==defaults.slidesPerView||swiper.params.spaceBetween!==defaults.spaceBetween||swiper.params.slidesOffsetAfter!==nextSlidesOffsetAfter)&&(swiper.params.slidesPerView=defaults.slidesPerView,swiper.params.spaceBetween=defaults.spaceBetween,swiper.params.slidesOffsetAfter=nextSlidesOffsetAfter),swiper.setTransition&&swiper.setTransition(0),swiper.update()}freezeMobileSwiperPosition(swiper){if(!swiper||!this.isMobileViewport())return!1;const translate=typeof swiper.getTranslate=="function"?swiper.getTranslate():swiper.translate||0;return this.container.style.setProperty("--ww-frozen-swiper-x",`${translate}px`),this.container.setAttribute("data-oura-freeze-swiper","true"),swiper.setTransition&&swiper.setTransition(0),!0}unfreezeMobileSwiperPosition(){this.container.removeAttribute("data-oura-freeze-swiper"),this.container.style.removeProperty("--ww-frozen-swiper-x")}getMobileExpandedHeight(){const viewportHeight=window.visualViewport?window.visualViewport.height:window.innerHeight;return Math.max(0,Math.round(viewportHeight||window.innerHeight||0))}getMobileExpandedWidth(swiper){return Math.round(swiper?.width||this.container.getBoundingClientRect().width||window.innerWidth||0)}getMobileCollapsedSize(swiper,item){if(swiper&&swiper.width){const defaults=this.getMobileSliderDefaults(swiper);return Math.round((swiper.width-(defaults.slidesPerView-1)*defaults.spaceBetween)/defaults.slidesPerView)}return Math.round(item?.getBoundingClientRect().width||0)}startMobileSlideHeightTransition(item,expanding,swiper){if(!item||!this.isMobileViewport())return!1;const rect=item.getBoundingClientRect(),currentWidth=Math.round(rect.width||0),currentHeight=Math.round(rect.height||0),targetWidth=expanding?this.getMobileExpandedWidth(swiper):this.getMobileCollapsedSize(swiper,item),targetHeight=expanding?this.getMobileExpandedHeight():this.getMobileCollapsedSize(swiper,item);return!currentWidth||!currentHeight||!targetWidth||!targetHeight?!1:(item.setAttribute("data-oura-height-animating","true"),item.style.setProperty("--ww-anim-width",`${currentWidth}px`),item.style.setProperty("--ww-anim-height",`${currentHeight}px`),item.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{item.hasAttribute("data-oura-height-animating")&&(item.style.setProperty("--ww-anim-width",`${targetWidth}px`),item.style.setProperty("--ww-anim-height",`${targetHeight}px`))})}),!0)}finishMobileSlideHeightTransition(item){item&&(item.removeAttribute("data-oura-height-animating"),item.style.removeProperty("--ww-anim-width"),item.style.removeProperty("--ww-anim-height"))}waitForSwiper(){let attempts=0;const checkSwiper=setInterval(()=>{if(++attempts>50){clearInterval(checkSwiper);return}let swiper=this.container.globalSlide||this.container.swiper;if(!swiper){const swiperContainer=this.container.querySelector(".swiper");swiperContainer&&swiperContainer.swiper&&(swiper=swiperContainer.swiper)}swiper&&swiper.initialized&&(clearInterval(checkSwiper),this.swiperInstance=swiper,this.setupSwiperControls(),this.container.setAttribute("data-oura-ready","true"),this.swiperInstance.navigation&&this.swiperInstance.navigation.update())},200)}
117setupSwiperControls(){if(!this.swiperInstance)return;const nextBtn=this.container.querySelector(".swiper-button-next"),prevBtn=this.container.querySelector(".swiper-button-prev");nextBtn&&nextBtn.addEventListener("click",e=>this.handleNavigation(e,"next"),!0),prevBtn&&prevBtn.addEventListener("click",e=>this.handleNavigation(e,"prev"),!0),this.swiperInstance.on("sliderMove",(swiper,e)=>{const event=e.originalEvent||e;!event||!event.target||event.target.closest(".ww-col-expand-trigger")||event.target.closest(".swiper-button-next")||event.target.closest(".swiper-button-prev")||this.container.hasAttribute("data-has-expanded")&&this.collapseAll()}),this.swiperInstance.on("slideChange",()=>{this.swiperInstance.navigation&&this.swiperInstance.navigation.update()})}handleNavigation(e,direction){if(e.preventDefault(),e.stopPropagation(),!this.getSwiperInstance()||this.isInteracting)return;const slideAction=()=>{const swiper=this.getSwiperInstance();swiper&&(direction==="next"?swiper.slideNext():swiper.slidePrev(),swiper.navigation&&swiper.navigation.update())};if(this.container.hasAttribute("data-has-expanded")){if(this.isMobileViewport()){this.navigateExpandedMobile(direction);return}this.isInteracting=!0,this.collapseAll(!1),setTimeout(()=>{const swiper=this.getSwiperInstance();swiper&&(swiper.update(),swiper.navigation&&swiper.navigation.update()),slideAction(),this.isInteracting=!1},this.desktopNavDelay)}else slideAction()}navigateExpandedMobile(direction){const swiper=this.getSwiperInstance();if(!swiper)return;const currentIndex=this.items.findIndex(item=>item.classList.contains("is-expanded")),baseIndex=currentIndex>=0?currentIndex:swiper.activeIndex,targetIndex=direction==="next"?Math.min(baseIndex+1,this.items.length-1):Math.max(baseIndex-1,0),targetItem=this.items[targetIndex];if(targetIndex===baseIndex||!targetItem){swiper.navigation&&swiper.navigation.update();return}this.stopAnimationLoop(),this.isInteracting=!0,this.container.setAttribute("data-has-expanded","true"),this.items.forEach((item,index)=>{index!==targetIndex&&(item.classList.remove("is-expanded"),this.resetButtonState(item))}),targetItem.classList.add("is-expanded");const btn=targetItem.querySelector(".ww-col-expand-trigger");btn&&btn.setAttribute("aria-expanded","true"),this.setExpandedMobileSwiperLayout(swiper,!0),swiper.navigation&&swiper.navigation.update(),swiper.slideTo(targetIndex,600),this.runAnimationSync(this.mobileNavDuration,()=>{const latestSwiper=this.getSwiperInstance();latestSwiper&&(this.setExpandedMobileSwiperLayout(latestSwiper,!0),latestSwiper.slideTo(targetIndex,0),latestSwiper.navigation&&latestSwiper.navigation.update()),this.isInteracting=!1},!1)}stopAnimationLoop(){this.syncFrameId&&(cancelAnimationFrame(this.syncFrameId),this.syncFrameId=null)}collapseAll(unlock=!0){if(this.stopAnimationLoop(),!this.container.hasAttribute("data-has-expanded"))return;const currentSwiper=this.getSwiperInstance(),expandedIndex=this.items.findIndex(item=>item.classList.contains("is-expanded")),collapseIndex=expandedIndex>=0?expandedIndex:currentSwiper?currentSwiper.activeIndex:0,collapseItem=this.items[collapseIndex];if(currentSwiper&&this.isMobileViewport()&&(this.freezeMobileSwiperPosition(currentSwiper),this.startMobileSlideHeightTransition(collapseItem,!1,currentSwiper),this.container.setAttribute("data-oura-collapsing","true")),this.items.forEach(item=>{item.classList.remove("is-expanded"),this.resetButtonState(item)}),this.container.removeAttribute("data-has-expanded"),!this.isSliderMode){this.unfreezeMobileSwiperPosition(),this.container.removeAttribute("data-oura-collapsing"),unlock&&(this.isInteracting=!1);return}currentSwiper&&!this.isMobileViewport()&&this.setExpandedMobileSwiperLayout(currentSwiper,!1),this.runAnimationSync(this.collapseDuration,()=>{const swiper=this.getSwiperInstance();swiper&&(this.setExpandedMobileSwiperLayout(swiper,!1),this.isMobileViewport()&&swiper.slideTo(collapseIndex,0),swiper.navigation&&swiper.navigation.update()),this.finishMobileSlideHeightTransition(collapseItem),this.unfreezeMobileSwiperPosition(),this.container.removeAttribute("data-oura-collapsing"),unlock&&(this.isInteracting=!1)},!this.isMobileViewport())}toggleState(activeItem){if(this.isInteracting)return;this.stopAnimationLoop(),this.isInteracting=!0;const isAlreadyExpanded=activeItem.classList.contains("is-expanded"),slideIndex=this.items.indexOf(activeItem),swiper=this.getSwiperInstance();if(isAlreadyExpanded){this.isSliderMode&&swiper&&this.isMobileViewport()&&(this.freezeMobileSwiperPosition(swiper),this.startMobileSlideHeightTransition(activeItem,!1,swiper),this.container.setAttribute("data-oura-collapsing","true")),activeItem.classList.remove("is-expanded"),this.resetButtonState(activeItem),this.container.removeAttribute("data-has-expanded"),this.isSliderMode&&swiper?(this.isMobileViewport()||this.setExpandedMobileSwiperLayout(swiper,!1),this.runAnimationSync(this.collapseDuration,()=>{const latestSwiper=this.getSwiperInstance();latestSwiper&&(this.setExpandedMobileSwiperLayout(latestSwiper,!1),latestSwiper.slideTo(slideIndex,this.isMobileViewport()?0:600),latestSwiper.navigation&&latestSwiper.navigation.update()),this.finishMobileSlideHeightTransition(activeItem),this.unfreezeMobileSwiperPosition(),this.container.removeAttribute("data-oura-collapsing"),this.isInteracting=!1},!this.isMobileViewport())):setTimeout(()=>{this.isInteracting=!1},this.collapseDuration);return}this.isSliderMode&&swiper&&this.isMobileViewport()&&(this.freezeMobileSwiperPosition(swiper),this.startMobileSlideHeightTransition(activeItem,!0,swiper)),this.items.forEac
117h(item=>{item!==activeItem&&(item.classList.remove("is-expanded"),this.resetButtonState(item))}),activeItem.classList.add("is-expanded"),this.container.setAttribute("data-has-expanded","true");const btn=activeItem.querySelector(".ww-col-expand-trigger");btn&&btn.setAttribute("aria-expanded","true"),this.isSliderMode&&swiper?(this.isMobileViewport()||(this.setExpandedMobileSwiperLayout(swiper,!0),swiper.slideTo(slideIndex,600)),this.runAnimationSync(this.expandDuration,()=>{const latestSwiper=this.getSwiperInstance();latestSwiper&&(this.setExpandedMobileSwiperLayout(latestSwiper,!0),latestSwiper.slideTo(slideIndex,this.isMobileViewport()?0:300),latestSwiper.navigation&&latestSwiper.navigation.update()),this.finishMobileSlideHeightTransition(activeItem),this.unfreezeMobileSwiperPosition(),this.isInteracting=!1},!this.isMobileViewport())):setTimeout(()=>{this.isMobileViewport()&&activeItem.scrollIntoView({behavior:"smooth",block:"center"}),this.isInteracting=!1},this.collapseDuration)}resetButtonState(item){const btn=item.querySelector(".ww-col-expand-trigger");btn&&btn.setAttribute("aria-expanded","false")}runAnimationSync(duration,onComplete,syncDuringAnimation=!0){const startTime=Date.now(),frame=()=>{const progress=Date.now()-startTime;syncDuringAnimation&&this.swiperInstance&&this.swiperInstance.update(),progress<duration?this.syncFrameId=requestAnimationFrame(frame):(this.syncFrameId=null,onComplete&&onComplete())};this.syncFrameId=requestAnimationFrame(frame)}}const initOuraCards=()=>{document.querySelectorAll('multi-content-ww[data-expandable="true"]').forEach(section=>{section.dataset.ouraInit||(new OuraCardController(section),section.dataset.ouraInit="true")})};document.addEventListener("DOMContentLoaded",initOuraCards),document.addEventListener("shopify:section:load",initOuraCards)})();let _realIpCountryPromise=null;function requestRealIpCountryCode(){return fetch("/browsing_context_suggestions.json").then(response=>response.json()).then(data=>data?.detected_values?.country?.handle?.toUpperCase()||null).then(code=>(code&&window.saRegionGeo&&typeof window.saRegionGeo.set=="function"&&window.saRegionGeo.set(code),code)).catch(error=>(_realIpCountryPromise=null,console.error("Error fetching geolocation for badges:",error),null))}function fetchRealIpCountryCode(){if(!_realIpCountryPromise){const early=window.saRegionGeo&&window.saRegionGeo.promise;_realIpCountryPromise=early&&typeof early.then=="function"?early.then(code=>code||requestRealIpCountryCode(),()=>requestRealIpCountryCode()):requestRealIpCountryCode()}return _realIpCountryPromise}function refineRegionByRealIP(root2=document){const badgeContainers=root2.querySelectorAll('.product__badges[data-region-aware="true"]'),standaloneRegionBtns=root2.querySelectorAll(".js-region-buy-btn[data-allowed-markets]");badgeContainers.length===0&&standaloneRegionBtns.length===0||fetchRealIpCountryCode().then(userRealCountryCode=>{userRealCountryCode&&(standaloneRegionBtns.forEach(regionBtn=>{const allowedAttr=regionBtn.getAttribute("data-allowed-markets");if(!allowedAttr)return;const isOutOfRegion=!allowedAttr.split(",").includes(userRealCountryCode);regionBtn.classList.toggle("hidden-important",!isOutOfRegion);const wrap=regionBtn.closest("[data-region-buy-wrap]");if(!wrap)return;wrap.setAttribute("data-region-out",isOutOfRegion);const productItem=wrap.closest(".custom-product-list .product-item");productItem&&productItem.querySelectorAll('[data-region-color-unavailable="true"]').forEach(colorOption=>{colorOption.classList.toggle("hidden-important",!isOutOfRegion)}),wrap.querySelectorAll("[data-region-hide]").forEach(el=>{if(el.classList.toggle("hidden-important",isOutOfRegion),isOutOfRegion)el.hasAttribute("data-region-prev-aria-disabled")||el.setAttribute("data-region-prev-aria-disabled",el.hasAttribute("aria-disabled")?el.getAttribute("aria-disabled"):"__missing__"),el.setAttribute("aria-disabled","true");else if(el.hasAttribute("data-region-prev-aria-disabled")){const previousAriaDisabled=el.getAttribute("data-region-prev-aria-disabled");previousAriaDisabled==="__missing__"?el.removeAttribute("aria-disabled"):el.setAttribute("aria-disabled",previousAriaDisabled),el.removeAttribute("data-region-prev-aria-disabled")}})}
117),badgeContainers.forEach(container=>{const allowedMarketsStr=container.getAttribute("data-allowed-markets");if(!allowedMarketsStr)return;const isOutOfRegion=!allowedMarketsStr.split(",").includes(userRealCountryCode),regionBuyEnabled=container.getAttribute("data-region-buy-enabled")==="true";container.setAttribute("data-region-out",regionBuyEnabled&&isOutOfRegion);const soldOutBadge=container.querySelector(".js-badge-sold-out"),regionBadge=container.querySelector(".js-badge-region");regionBadge&&(regionBuyEnabled?regionBadge.classList.add("hidden-important"):regionBadge.classList.toggle("hidden-important",!isOutOfRegion)),soldOutBadge&&soldOutBadge.classList.toggle("hidden-important",isOutOfRegion);const scope=container.closest(".shopify-section, [data-section-id], .product-quickview__content");scope&&(scope.querySelectorAll("[data-region-tip]").forEach(tip=>{tip.classList.toggle("hidden-important",!isOutOfRegion)}),scope.querySelectorAll("product-form").forEach(pf=>{const regionBtn=pf.querySelector(".js-region-buy-btn");if(!regionBtn)return;regionBtn.classList.toggle("hidden-important",!isOutOfRegion);const submitBtn=pf.querySelector(".product-form__submit");submitBtn&&(submitBtn.classList.toggle("hidden-important",isOutOfRegion),isOutOfRegion?submitBtn.setAttribute("aria-disabled","true"):submitBtn.getAttribute("aria-disabled")==="true"&&submitBtn.removeAttribute("aria-disabled")),pf.querySelectorAll("[data-region-hide-checkout]").forEach(el=>{el.classList.toggle("hidden-important",isOutOfRegion)})}))}))}).catch(error=>console.error("Error refining region state:",error))}document.addEventListener("DOMContentLoaded",function(){document.addEventListener("submit",function(e){const wrap=e.target.closest("[data-region-buy-wrap]");if(!wrap)return;const regionBtn=wrap.querySelector(".js-region-buy-btn[data-allowed-markets]");!regionBtn||regionBtn.classList.contains("hidden-important")||(e.preventDefault(),e.stopImmediatePropagation())},!0),document.addEventListener("click",function(e){if(!e.target.closest(".js-open-region-selector"))return;e.preventDefault();const regionSelectorComponent=document.querySelector("region-selector");regionSelectorComponent?regionSelectorComponent.click():console.warn("Region selector component not found on this page.")}),refineRegionByRealIP()});
118//# sourceMappingURL=/cdn/shop/t/125/assets/theme.js.map?v=44945053239706040061790655845

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.