PageSourceSearch

https://cuyana.com/cdn/shop/t/10/assets/theme.js?v=115642311089602795811790268575

js cuyana.com collected 2026-09-24 19:14:42 UTC 386,250 bytes, 19 lines download raw bytes

1(function(factory){typeof define=="function"&&define.amd?define("index",factory):factory()})((function(){"use strict";const KLAVIYO_PUBLIC_KEY="VV2vHd",KLAVIYO_LIST_ID="XqEi7e";function _classCallCheck(instance,Constructor){if(!(instance instanceof Constructor))throw new TypeError("Cannot call a class as a function")}function _defineProperties(target,props){for(var i=0;i<props.length;i++){var descriptor=props[i];descriptor.enumerable=descriptor.enumerable||!1,descriptor.configurable=!0,"value"in descriptor&&(descriptor.writable=!0),Object.defineProperty(target,descriptor.key,descriptor)}}function _createClass(Constructor,protoProps,staticProps){return protoProps&&_defineProperties(Constructor.prototype,protoProps),staticProps&&_defineProperties(Constructor,staticProps),Constructor}function _defineProperty(obj,key,value){return key in obj?Object.defineProperty(obj,key,{value,enumerable:!0,configurable:!0,writable:!0}):obj[key]=value,obj}function _inherits(subClass,superClass){if(typeof superClass!="function"&&superClass!==null)throw new TypeError("Super expression must either be null or a function");subClass.prototype=Object.create(superClass&&superClass.prototype,{constructor:{value:subClass,writable:!0,configurable:!0}}),superClass&&_setPrototypeOf(subClass,superClass)}function _getPrototypeOf(o){return _getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(o2){return o2.__proto__||Object.getPrototypeOf(o2)},_getPrototypeOf(o)}function _setPrototypeOf(o,p){return _setPrototypeOf=Object.setPrototypeOf||function(o2,p2){return o2.__proto__=p2,o2},_setPrototypeOf(o,p)}function _isNativeReflectConstruct(){if(typeof Reflect>"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function _construct(Parent,args,Class){return _isNativeReflectConstruct()?_construct=Reflect.construct:_construct=function(Parent2,args2,Class2){var a=[null];a.push.apply(a,args2);var Constructor=Function.bind.apply(Parent2,a),instance=new Constructor;return Class2&&_setPrototypeOf(instance,Class2.prototype),instance},_construct.apply(null,arguments)}function _isNativeFunction(fn){return Function.toString.call(fn).indexOf("[native code]")!==-1}function _wrapNativeSuper(Class){var _cache=typeof Map=="function"?new Map:void 0;return _wrapNativeSuper=function(Class2){if(Class2===null||!_isNativeFunction(Class2))return Class2;if(typeof Class2!="function")throw new TypeError("Super expression must either be null or a function");if(typeof _cache<"u"){if(_cache.has(Class2))return _cache.get(Class2);_cache.set(Class2,Wrapper)}function Wrapper(){return _construct(Class2,arguments,_getPrototypeOf(this).constructor)}return Wrapper.prototype=Object.create(Class2.prototype,{constructor:{value:Wrapper,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(Wrapper,Class2)},_wrapNativeSuper(Class)}function _assertThisInitialized(self){if(self===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return self}function _possibleConstructorReturn(self,call){return call&&(typeof call=="object"||typeof call=="function")?call:_assertThisInitialized(self)}function _createSuper(Derived){var hasNativeReflectConstruct=_isNativeReflectConstruct();return function(){var Super=_getPrototypeOf(Derived),result;if(hasNativeReflectConstruct){var NewTarget=_getPrototypeOf(this).constructor;result=Reflect.construct(Super,arguments,NewTarget)}else result=Super.apply(this,arguments);return _possibleConstructorReturn(this,result)}}function _toConsumableArray(arr){return _arrayWithoutHoles(arr)||_iterableToArray(arr)||_unsupportedIterableToArray(arr)||_nonIterableSpread()}function _arrayWithoutHoles(arr){if(Array.isArray(arr))return _arrayLikeToArray(arr)}function _iterableToArray(iter){if(typeof Symbol<"u"&&iter[Symbol.iterator]!=null||iter["@@iterator"]!=null)return Array.from(iter)}function _unsupportedIterableToArray(o,minLen){if(o){if(typeof o=="string")return _arrayLikeToArray(o,minLen);var n=Object.prototype.toString.call(o).slice(8,-1);if(n==="Object"&&o.constructor&&(n=o.constructor.name),n==="Map"||n==="Set")return Array.from(o);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return _arrayLikeToArray(o,minLen)}}function _arrayLikeToArray(arr,len){(len==null||len>arr.length)&&(len=arr.length);for(var i=0,arr2=new Array(len);i<len;i++)arr2[i]=arr[i];return arr2}function _nonIterableSpread(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
2In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _generateRandomID(){return Math.floor(Math.random()*1e3).toString().padStart(3,"0")}async function _generateLineGroupID(alreadyUsedIDs=[],checkCart=!0){let id=_generateRandomID();
2const itemList=document.querySelector(".Cart__ItemList");if(itemList)itemList.querySelectorAll("[data-line-group]").forEach(item=>{const lineGroupValue=item.getAttribute("data-line-group");alreadyUsedIDs.push(lineGroupValue)});else if(checkCart){const response=await fetch(`${window.routes.cartUrl}.json`,{credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);(await response.json()).items.forEach(function(item){item.properties?._line_group&&alreadyUsedIDs.push(item.properties._line_group)})}for(;alreadyUsedIDs.includes(id);)id=_generateRandomID();return id}function _validMonoCharacterCheck(testString){var regex=new RegExp("^[a-zA-Z0-9.]+$");return!!regex.test(testString)}function _validEmailAddress(email){if(email=email.trim(),!email)return!1;var emailPattern=new RegExp("^[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+.[A-Za-z]{2,}$");return emailPattern.test(email)}function checkPrivateSale(checkOnly=!1){if(!window.theme.customStrikethroughEnabled)return!1;function getCookie(name){const parts=`; ${document.cookie}`.split(`; ${name}=`);if(parts.length===2)return parts.pop().split(";").shift()}function showPrivateSaleBadges(){const privateSaleBadges=document.querySelectorAll(".Product__BadgeWrapperCustom");if(privateSaleBadges.length){let anyCustomVisible=!1;privateSaleBadges.forEach(element=>{if(element.hasAttribute("data-variant-sale-badge")&&element.getAttribute("data-on-sale")!=="true"){element.classList.add("d-none");return}element.classList.remove("d-none"),anyCustomVisible=!0}),document.querySelectorAll(".Product__BadgeWrapper:not(.Product__BadgeWrapperCustom)").forEach(element=>{anyCustomVisible?element.classList.add("d-none"):element.classList.remove("d-none")})}}function showPrivateSalePrices(){const strikethroughPrices=document.querySelectorAll(".ProductItem__CustomStrikethroughPrice");strikethroughPrices.length&&(strikethroughPrices.forEach(element=>{element.classList.remove("d-none")}),document.querySelectorAll(".ProductItem__DefaultPrice").forEach(element=>{element.classList.add("d-none")}))}const norm=v=>(v||"").trim(),cookieName="cuy_csp",urlParam="privatesale";let showPrivateSalePricing=!1;if(!window.theme.customStrikethroughCodeRequired)showPrivateSalePricing=!0;else{let codeValue=urlParam;window?.theme?.customStrikethroughCode&&(codeValue=norm(window.theme.customStrikethroughCode));const privateSaleCookie=getCookie(cookieName);if(privateSaleCookie&&privateSaleCookie==codeValue)showPrivateSalePricing=!0;else{const privateSaleValue=new URLSearchParams(window.location.search).get(urlParam);privateSaleValue&&privateSaleValue==codeValue&&(document.cookie=`${cookieName}=${privateSaleValue}; Max-Age=2592000; Path=/`,showPrivateSalePricing=!0)}}if(checkOnly)return showPrivateSalePricing;if(showPrivateSalePricing){showPrivateSaleBadges(),showPrivateSalePrices();return}}var Responsive=(function(){function Responsive2(){var _this=this;_classCallCheck(this,Responsive2),this.currentBreakpoint=Responsive2.getCurrentBreakpoint(),window.addEventListener("resize",function(){var newBreakpoint=Responsive2.getCurrentBreakpoint();_this.currentBreakpoint!==newBreakpoint&&(document.dispatchEvent(new CustomEvent("breakpoint:changed",{detail:{previousBreakpoint:_this.currentBreakpoint,currentBreakpoint:newBreakpoint}})),_this.currentBreakpoint=newBreakpoint)})}return _createClass(Responsive2,null,[{key:"matchesBreakpoint",value:function(breakpoint){switch(breakpoint){case"phone":return window.matchMedia("screen and (max-width: 640px)").matches;case"tablet":return window.matchMedia("screen and (min-width: 641px) and (max-width: 1007px)").matches;case"tablet-and-up":return window.matchMedia("screen and (min-width: 641px)").matches;case"pocket":return window.matchMedia("screen and (max-width: 1007px)").matches;case"lap":return window.matchMedia("screen and (min-width: 1008px) and (max-width: 1279px)").matches;case"lap-and-up":return window.matchMedia("screen and (min-width: 1008px)").matches;case"desk":return window.matchMedia("screen and (min-width: 1280px)").matches;case"widescreen":return window.matchMedia("screen and (min-width: 1600px)").matches;
2case"supports-hover":return window.matchMedia("(hover: hover) and (pointer: fine)").matches}}},{key:"getCurrentBreakpoint",value:function(){if(window.matchMedia("screen and (max-width: 640px)").matches)return"phone";if(window.matchMedia("screen and (min-width: 641px) and (max-width: 1007px)").matches)return"tablet";if(window.matchMedia("screen and (min-width: 1008px) and (max-width: 1279px)").matches)return"lap";if(window.matchMedia("screen and (min-width: 1280px)").matches)return"desk"}}]),Responsive2})(),Carousel=(function(){function Carousel2(element){var options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},overrideSettings=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck(this,Carousel2),this.element=element,this.initialConfig=Object.assign(JSON.parse(element.getAttribute("data-flickity-config")),overrideSettings),this.options=options,this._attachListeners(),this._build()}return _createClass(Carousel2,[{key:"destroy",value:function(){this.flickityInstance.destroy(),this.initialConfig.breakpoints!==void 0&&document.removeEventListener("breakpoint:changed",this._onBreakpointChangedListener)}},{key:"getFlickityInstance",value:function(){return this.flickityInstance}},{key:"selectCell",value:function(index){var shouldPause=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,shouldAnimate=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;shouldPause&&this.flickityInstance.pausePlayer(),this.flickityInstance.select(index,!1,!shouldAnimate)}},{key:"next",value:function(){this.flickityInstance.next()}},{key:"previous",value:function(){this.flickityInstance.previous()}},{key:"pausePlayer",value:function(){this.flickityInstance.pausePlayer()}},{key:"unpausePlayer",value:function(){this.flickityInstance.unpausePlayer()}},{key:"resize",value:function(){this.flickityInstance.resize()}},{key:"getSelectedIndex",value:function(){return this.flickityInstance.selectedIndex}},{key:"getSelectedCell",value:function(){return this.flickityInstance.selectedCell.element}},{key:"_attachListeners",value:function(){this.initialConfig.breakpoints!==void 0&&(this._onBreakpointChangedListener=this._onBreakpointChanged.bind(this),document.addEventListener("breakpoint:changed",this._onBreakpointChangedListener))}},{key:"_build",value:function(){var _this=this,config=this._processConfig();this.flickityInstance=new Flickity(this.element,config),this._validateDraggable(),this.selectedIndex=this.flickityInstance.selectedIndex,this.flickityInstance.on("resize",this._validateDraggable.bind(this)),this.options.onSelect&&this.flickityInstance.on("select",function(){_this.selectedIndex!==_this.flickityInstance.selectedIndex&&(_this.options.onSelect(_this.flickityInstance.selectedIndex,_this.flickityInstance.selectedCell.element),_this.selectedIndex=_this.flickityInstance.selectedIndex)}),this.options.onSettle&&this.flickityInstance.on("settle",function(index){_this.options.onSettle(index,_this.flickityInstance.selectedCell.element)}),this.options.onClick&&this.flickityInstance.on("staticClick",function(event,pointer,cell,index){_this.options.onClick(cell,index)})}},{key:"_validateDraggable",value:function(){var isActive=this.flickityInstance.isActive||!1;!isActive||!this.flickityInstance.options.draggable||(this.flickityInstance.selectedElements===void 0||this.flickityInstance.selectedElements.length===this.flickityInstance.cells.length?this.flickityInstance.unbindDrag():this.flickityInstance.bindDrag())}},{key:"_processConfig",value:function(){var config=Object.assign({},this.initialConfig);if(delete config.breakpoints,this.initialConfig.breakpoints===void 0)return config;var breakpoints=this.initialConfig.breakpoints;return breakpoints.forEach(function(breakpoint){Responsive.matchesBreakpoint(breakpoint.matches)&&(config=Object.assign(config,breakpoint.settings))}),config}},{key:"_onBreakpointChanged",value:function(){this.flickityInstance.destroy(),this._build()}}]),Carousel2})(),Animation=(function(){function Animation2(){_classCallCheck(this,Animation2)}return _createClass(Animation2,null,[{key:"slideUp",value:function(element){element.style.height="".concat(element.scrollHeight,"px"),element.offsetHeight,element.style.height=0}},{key:"slideDown",value:function(element){if(element.style.height!=="auto"){element.style.height="".concat(element.firstElementChild.scrollHeight,"px");var transitionEnded=function transitionEnded2(event){event.propertyName==="height"&&(element.style.height="auto",element.removeEventListener("transitionend",transitionEnded2))};element.addEventListener("transitionend",transitionEnded)}}}]),Animation2})(),Dom=(function(){function Dom2(){_classCallCheck(this,Dom2)}return _createClass(Dom2,null,[{key:"getSiblings",value:function(element,filter){for(var includeSelf=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,siblings=[],currentElement=element;currentElement=currentElement.previousElementSibling;)(!filter||currentElement.matches(filter))&&siblings.push(currentElement);for(includeSelf&&siblings.push(element),currentElement=element;currentElement=currentElement.nextElementSibling;)(!filter||currentElement.matches(filter))&&siblings.push(currentElement);return siblings}},{key:"nodeListToArray",value:function(nodeList,filter){for(var items=[],i=0;i!==nodeList.length;++i)(!filter||nodeList[i].matches(filter))&&items.push(nodeList[i]);return items}},{key:"outerWidthWithMargin",value:function(element){var width=element.offsetWidth,style=getComputedStyle(element);return width+=parseInt(style.marginLeft)+parseInt(style.marginRight),width}},{key:"outerHeightWithMargin",value:function(element){var height=element.offsetHeight,style=getComputedStyle(element);return height+=parseInt(style.marginTop)+parseInt(style.marginBottom),height}}]),Dom2})(),Collapsible=(function(){function Collapsible2(){_classCallCheck(this,Collapsible2),this.domDelegate=new domDelegate.Delegate(document.body),this._attachListeners()}return _createClass(Collapsible2,[{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="toggle-collapsible"]',this._toggleCollapsible.bind(this))}},{key:"_toggleCollapsible",value:function(event,target){var _this=this,parentCollapsible=target.closest(".Collapsible");if(!(parentCollapsible.classList.contains("Collapsible--autoExpand")&&Responsive.matchesBreakpoint("tablet-and-up"))){var isOpen=target.getAttribute("aria-expanded")==="true";isOpen?this._close(parentCollapsible,target):this._open(parentCollapsible,target),Dom.getSiblings(parentCollapsible).forEach(function(collapsibleToClose){return _this._close(collapsibleToClose)}),event.preventDefault()}}},{key:"_open",value:function(collapsible){var toggleButton=collapsible.querySelector(".Collapsible__Button"),collapsibleInner=collapsible.querySelector(".Collapsible__Inner");!collapsibleInner||toggleButton.getAttribute("aria-expanded")==="true"||(toggleButton.setAttribute("aria-expanded","true"),collapsibleInner.style.overflow="visible",Animation.slideDown(collapsibleInner),setTimeout(function(){collapsible.style.overflow="visible"},350))}},{key:"_close",value:function(collapsible){var toggleButton=collapsible.querySelector(".Collapsible__Button"),collapsibleInner=collapsible.querySelector(".Collapsible__Inner");!collapsibleInner||toggleButton.getAttribute("aria-expanded")==="false"||(toggleButton.setAttribute("aria-expanded","fal
2se"),collapsibleInner.style.overflow="hidden",collapsible.style.overflow="hidden",Animation.slideUp(collapsibleInner))}}]),Collapsible2})(),Accessibility=(function(){function Accessibility2(){_classCallCheck(this,Accessibility2)}return _createClass(Accessibility2,null,[{key:"trapFocus",value:function(container,namespace){this.listeners=this.listeners||{};var elementToFocus=container.querySelector("[autofocus]")||container;container.setAttribute("tabindex","-1"),elementToFocus.focus(),this.listeners[namespace]=function(event){container!==event.target&&!container.contains(event.target)&&container.focus()},document.addEventListener("focusin",this.listeners[namespace])}},{key:"removeTrapFocus",value:function(container,namespace){container&&container.removeAttribute("tabindex"),this.listeners&&this.listeners[namespace]&&document.removeEventListener("focusin",this.listeners[namespace])}},{key:"clearTrapFocus",value:function(){for(var key in this.listeners)this.listeners.hasOwnProperty(key)&&document.removeEventListener("focusin",this.listeners[key]);this.listeners={}}}]),Accessibility2})(),Drawer=(function(){function Drawer2(element){var options=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};_classCallCheck(this,Drawer2),element&&(this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.delegateBody=new domDelegate.Delegate(document.body),this.onOpen=options.onOpen||function(){},this.onClose=options.onClose||function(){},this.isOpen=!1,this.direction=this.element.classList.contains("Drawer--fromLeft")?"fromLeft":"fromRight",this.pageOverlayElement=document.querySelector(".PageOverlay"),this._attachListeners())}return _createClass(Drawer2,[{key:"destroy",value:function(){this.delegateBody&&(this.delegateBody.off("click",'[data-action="open-drawer"][data-drawer-id="'.concat(this.element.id,'"]')),this.delegateBody.off("click",'[data-action="close-drawer"][data-drawer-id="'.concat(this.element.id,'"]'))),window.removeEventListener("resize",this._calculateMaxHeightListener)}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"open",value:function(event){if(!this.isOpen)return this.element.dispatchEvent(new CustomEvent("search:close",{bubbles:!0})),this.element.id=="sidebar-cart"&&this.element.dispatchEvent(new CustomEvent("cart:open",{bubbles:!0})),event&&event.preventDefault(),this.element.setAttribute("aria-hidden","false"),this._calculateMaxHeight(),document.documentElement.classList.add("no-scroll"),Accessibility.trapFocus(this.element,this.element.id),document.querySelector("#shopify-section-header").style.zIndex="",this.pageOverlayElement.classList.add("is-visible"),this.pageOverlayElement.addEventListener("click",this._closeListener),this.isOpen=!0,this.onOpen(),!1}},{key:"close",value:function(event){this.isOpen&&(event&&event.preventDefault(),this.element.setAttribute("aria-hidden","true"),document.documentElement.classList.remove("no-scroll"),Accessibility.removeTrapFocus(this.element,this.element.id),this.pageOverlayElement.classList.remove("is-visible"),this.pageOverlayElement.removeEventListener("click",this._closeListener),this.isOpen=!1,this.onClose())}},{key:"_attachListeners",value:function(){this._openListener=this.open.bind(this),this._closeListener=this.close.bind(this),this._calculateMaxHeightListener=this._calculateMaxHeight.bind(this),this.delegateBody.on("click",'[data-action="open-drawer"][data-drawer-id="'.concat(this.element.id,'"]'),this._openListener),this.delegateBody.on("click",'[data-action="close-drawer"][data-drawer-id="'.concat(this.element.id,'"]'),this._closeListener),this.element.addEventListener("keyup",this._handleKeyboard.bind(this)),window.addEventListener("resize",this._calculateMaxHeightListener)}},{key:"_calculateMaxHeight",value:function(){this.element.style.maxHeight=window.innerHeight+"px"}},{key:"_handleKeyboard",value:function(event){this.isOpen&&event.keyCode===27&&this.close()}}]),Drawer2})(),LoadingBar=(function(){function LoadingBar2(){_classCallCheck(this,LoadingBar2),this.element=document.querySelector(".LoadingBar"),document.addEventListener("theme:loading:start",this._onLoadingStart.bind(this)),document.addEventListener("theme:loading:end",this._onLoadingEnd.bind(this)),this.element.addEventListener("transitionend",this._onTransitionEnd.bind(this))}return _createClass(LoadingBar2,[{key:"_onLoadingStart",value:function(){this.element.classList.add("is-visible"),this.element.style.width="40%"}},{key:"_onLoadingEnd",value:function(){this.element.style.width="100%",this.element.classList.add("is-finished")}},{key:"_onTransitionEnd",value:function(event){event.propertyName==="width"&&this.element.classList.contains("is-finished")&&(this.element.classList.remove("is-visible"),this.element.classList.remove("is-finished"),this.element.style.width="0")}}]),LoadingBar2})(),Modal=(function(){function Modal2(){_classCallCheck(this,Modal2),this.domDelegate=new domDelegate.Delegate(document.body),this.activeModal=null,this.wasLocked=!1,this.pageOverlayElement=document.querySelector(".PageOverlay"),this._attachListeners(),this._checkOpenByHash()}return _createClass(Modal2,[{key:"_attachListeners",value:function(){this._closeListener=this._closeModal.bind(this),this._handleKeyboardListener=this._handleKeyboard.bind(this),this.domDelegate.on("click",'[data-action="open-modal"]',this._openModalEvent.bind(this)),this.domDelegate.on("click",'[data-action="close-modal"]',this._closeModal.bind(this))}},{key:"_openModalEvent",value:function(event,target){this._openModal(document.getElementById(target.getAttribute("aria-controls"))),event.preventDefault(),event.stopPropagation()}},{key:"_openModal",value:function(modal){var _this=this;this.activeModal||!modal||(this.activeModal=modal,this.domDelegate.on("keyup",this._handleKeyboardListener),document.documentElement.classList.contains("no-scroll")&&(this.wasLocked=!0),fastdom.mutate(function(){Accessibility.clearTrapFocus(),_this._onTransitionEndedListener=_this._onTransitionEnded.bind(_this),_this.activeModal.addEventListener("transitionend",_this._onTransitionEndedListener),_this.activeModal.setAttribute("aria-hidden","false"),document.documentElement.classList.add("no-scroll"),_this.activeModal.classList.contains("Modal--fullScreen")||(_this.pageOverlayElement.classList.add("is-visible"),_this.pageOverlayElement.addEventListener("click",_this._closeListener))}))}},{key:"_closeModal",value:function(){var _this2=this;if(this.activeModal){this.activeModal.removeEventListener("keyup",this._handleKeyboardListener),this.domDelegate.off("keyup");var closingModal=this.activeModal;fastdom.mutate(function(){closingModal.classList.contains("Modal--videoContent")&&(_this2._resetVideoListener=_this2._resetVideo.bind(_this2),
2closingModal.addEventListener("transitionend",_this2._resetVideoListener)),Accessibility.removeTrapFocus(closingModal,"modal"),closingModal.classList.contains("Modal--fullScreen")||_this2.activeModal===closingModal&&(_this2.pageOverlayElement.classList.remove("is-visible"),_this2.pageOverlayElement.removeEventListener("click",_this2._closeListener)),closingModal.setAttribute("aria-hidden","true"),_this2.activeModal===closingModal&&(_this2.activeModal=null),_this2.wasLocked||document.documentElement.classList.remove("no-scroll")})}}},{key:"_onTransitionEnded",value:function(event){event.propertyName==="visibility"&&(Accessibility.trapFocus(this.activeModal,"modal"),this.activeModal.removeEventListener("transitionend",this._onTransitionEndedListener))}},{key:"_resetVideo",value:function(event){if(event.propertyName==="visibility"){var iframe=event.target.querySelector("iframe");iframe.parentNode.innerHTML='<iframe class="Image--lazyLoad" data-src='.concat(iframe.getAttribute("data-src"),' frameborder="0" allowfullscreen>'),event.target.removeEventListener("transitionend",this._resetVideoListener)}}},{key:"_checkOpenByHash",value:function(){var hash=window.location.hash,modal=document.getElementById(hash.replace("#",""));modal&&modal.classList.contains("Modal")&&this._openModal(modal)}},{key:"_handleKeyboard",value:function(event){this.activeModal!==null&&event.keyCode===27&&this._closeModal()}}]),Modal2})(),Popover=(function(){function Popover2(element,options){_classCallCheck(this,Popover2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.activator=options.activator||document.querySelector('[aria-controls="'.concat(element.getAttribute("id"),'"]')),this.preferredPosition=options.preferredPosition||"bottom",this.preferredAlignment=options.preferredAlignment||void 0,this.threshold=options.threshold||20,this.isOpen=!1,this.onValueChanged=options.onValueChanged||function(){},this.onOpen=options.onOpen||function(){},this.onClose=options.onClose||function(){},this.showOverlay=options.showOverlay===void 0?!0:options.showOverlay,this.fitToViewport=options.fitToViewport===void 0?!1:options.fitToViewport,this.pageOverlayElement=document.querySelector(".PageOverlay"),this._attachListeners()}return _createClass(Popover2,[{key:"destroy",value:function(){this.element.removeEventListener("keyup",this._handleKeyboardListener),this.delegateElement.off("click"),this.activator.removeEventListener("click",this._toggleListener)}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"open",value:function(){var _this=this;this.isOpen||this.activator.getAttribute("aria-controls")!==this.element.id||(this.element.setAttribute("aria-hidden","false"),this.activator.setAttribute("aria-expanded","true"),disableBodyScroll(!0,"[data-scrollable]"),document.documentElement.classList.add("no-scroll"),Responsive.matchesBreakpoint("lap-and-up")?(document.body.addEventListener("click",this._clickOutsideListener),this._position(),this.element.setAttribute("tabindex","-1"),this.element.addEventListener("transitionend",function(){_this.element.focus()},{once:!0})):(this.element.removeAttribute("style"),this._resetViewportFit(),this.showOverlay&&(this.pageOverlayElement.classList.add("is-visible"),this.pageOverlayElement.addEventListener("click",this._closeListener))),this.onOpen(this),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.element.setAttribute("aria-hidden","true"),this.activator.setAttribute("aria-expanded","false"),disableBodyScroll(!1,"[data-scrollable]"),document.documentElement.classList.remove("no-scroll"),document.body.removeEventListener("click",this._clickOutsideListener),this.showOverlay&&(this.pageOverlayElement.classList.remove("is-visible"),this.pageOverlayElement.removeEventListener("click",this._closeListener)),this.element.removeAttribute("tabindex"),this._resetViewportFit(),this.activator.focus(),this.onClose(this),this.isOpen=!1)}},{key:"_attachListeners",value:function(){this._handleKeyboardListener=this._handleKeyboard.bind(this),this._clickOutsideListener=this._clickOutside.bind(this),this._closeListener=this.close.bind(this),this._toggleListener=this.toggle.bind(this),this.element.addEventListener("keyup",this._handleKeyboardListener),this.activator.addEventListener("click",this._toggleListener),this.delegateElement.on("click",'[data-action="close-popover"]',this.close.bind(this)),this.delegateElement.on("click",'[data-action="select-value"]',this._valueChanged.bind(this)),this.element.hasAttribute("id")&&this.delegateElement.on("focusout","#".concat(this.element.getAttribute("id")),this._onFocusOut.bind(this))}},{key:"_valueChanged",value:function(event){Dom.getSiblings(event.target,".is-selected").forEach(function(item){return item.classList.remove("is-selected")}),event.target.classList.add("is-selected"),this.onValueChanged(event.target.getAttribute("data-value"),event.target,this.activator),this.close()}},{key:"_onFocusOut",value:function(event){!this.element.contains(event.relatedTarget)&&event.relatedTarget!==this.activator&&this.close()}},{key:"_clickOutside",value:function(event){!event.target.closest(".Popover")&&!event.target.closest(".Modal")&&event.target!==this.activator&&!this.activator.contains(event.target)&&this.close()}},{key:"_position",value:function(){var _this2=this,topPosition=0,rightPosition=0,position="",alignment="",headerHeight=0,fitAvailableHeight=0,threshold=this.threshold;fastdom.measure(function(){var headerElement=_this2.element.querySelector(".Popover__Header");headerHeight=headerElement?headerElement.offsetHeight:0;var windowHeight=window.innerHeight,activatorBoundingRect=_this2.activator.getBoundingClientRect(),halfHeight=windowHeight/2;if(_this2.preferredPosition==="bottom")alignment="right",_this2.element.clientHeight<=windowHeight-(activatorBoundingRect.bottom+threshold)||windowHeight-activatorBoundingRect.bottom>=halfHeight?position="bottom":position="top";else if(_this2.preferredPosition==="top")alignment="right",_this2.element.clientHeight<=activatorBoundingRect.top-threshold||activatorBoundingRect.top>=halfHeight?position="top":position="bottom";else{position="left";var halfElementHeight=_this2.element.clientHeight/2;activatorBoundingRect.top>=halfElementHeight&&windowHeight-activatorBoundingRect.bottom>
2=halfElementHeight?alignment="center":windowHeight-activatorBoundingRect.bottom>=halfElementHeight?alignment="bottom":alignment="top"}_this2.preferredAlignment&&(alignment=_this2.preferredAlignment),_this2.fitToViewport&&(position="bottom",fitAvailableHeight=windowHeight-activatorBoundingRect.bottom-threshold),position==="top"?(topPosition=activatorBoundingRect.top-_this2.element.clientHeight-threshold,alignment==="center"?rightPosition=window.innerWidth-activatorBoundingRect.right-_this2.element.clientWidth/2+3:rightPosition=window.innerWidth-activatorBoundingRect.right):position==="bottom"?(topPosition=activatorBoundingRect.bottom+threshold,alignment==="center"?rightPosition=window.innerWidth-activatorBoundingRect.right-_this2.element.clientWidth/2+3:rightPosition=window.innerWidth-activatorBoundingRect.right):(rightPosition=window.innerWidth-activatorBoundingRect.left+threshold,alignment==="center"?topPosition=activatorBoundingRect.top-_this2.element.clientHeight/2+_this2.activator.clientHeight/2:alignment==="top"?topPosition=activatorBoundingRect.bottom-_this2.element.clientHeight:topPosition=activatorBoundingRect.top)}),fastdom.mutate(function(){if(["Popover--positionBottom","Popover--positionTop","Popover--positionCenter","Popover--alignTop","Popover--alignCenter","Popover--alignBottom"].map(function(item){return _this2.element.classList.remove(item)}),_this2.element.classList.add("Popover--position".concat(position.charAt(0).toUpperCase()+position.slice(1))),_this2.element.classList.add("Popover--align".concat(alignment.charAt(0).toUpperCase()+alignment.slice(1))),_this2.element.setAttribute("style","top: ".concat(parseInt(topPosition),"px; right: ").concat(parseInt(rightPosition),"px;")),_this2.fitToViewport){var valueList=_this2.element.querySelector(".Popover__ValueList");valueList&&(valueList.style.maxHeight="".concat(Math.max(0,Math.floor(fitAvailableHeight)-headerHeight),"px"))}})}},{key:"_resetViewportFit",value:function(){if(this.fitToViewport){var valueList=this.element.querySelector(".Popover__ValueList");valueList&&(valueList.style.maxHeight="")}}},{key:"_handleKeyboard",value:function(event){this.isOpen&&event.keyCode===27&&this.close()}}]),Popover2})(),PageTransition=(function(){function PageTransition2(){_classCallCheck(this,PageTransition2),this.domDelegate=new domDelegate.Delegate(document.body),this.pageTransition=document.querySelector(".PageTransition"),this._attachListeners()}return _createClass(PageTransition2,[{key:"_attachListeners",value:function(){this.domDelegate.on("click",'a[href]:not([href^="#"]):not([href^="javascript:"]):not([href^="mailto:"]):not([href^="tel:"]):not([target="_blank"])',this._onPageUnload.bind(this))}},{key:"_onPageUnload",value:function(event,target){var _this=this;if(!(event.defaultPrevented||event.ctrlKey||event.metaKey||!window.theme.showPageTransition||!this.pageTransition)&&(event.preventDefault(),window.theme.showPageTransition&&this.pageTransition)){var doTransition=function doTransition2(event2){event2.propertyName==="opacity"&&(_this.pageTransition.removeEventListener("transitionend",doTransition2),window.location.href=target.href)};this.pageTransition.addEventListener("transitionend",doTransition),this.pageTransition.style.visibility="visible",this.pageTransition.style.opacity="1"}}}],[{key:"getInstance",value:function(){return this.instance||(this.instance=new PageTransition2),this.instance}}]),PageTransition2})(),Image=(function(){function Image2(){_classCallCheck(this,Image2)}return _createClass(Image2,null,[{key:"getSizedImageUrl",value:function(src,size){if(size===null)return src;if(size==="master")return src.replace(/http(s)?:/,"");var match=src.match(/\.(jpg|jpeg|gif|png|bmp|bitmap|tiff|tif)(\?v=\d+)?$/i);if(match){var prefix=src.split(match[0]),suffix=match[0];return(prefix[0]+"_"+size+suffix).replace(/http(s)?:/,"")}else return null}},{key:"getSupportedSizes",value:function(image,desiredSizes){var supportedSizes=[],imageWidth=image.width;return desiredSizes.forEach(function(width){imageWidth>=width&&supportedSizes.push(width)}),supportedSizes}}]),Image2})(),ProductImageZoom=(function(){function ProductImageZoom2(element,slideshow){_classCallCheck(this,ProductImageZoom2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.delegateRoot=new domDelegate.Delegate(document.body),this.slideshow=slideshow,this._attachListeners()}return _createClass(ProductImageZoom2,[{key:"destroy",value:function(){this.delegateElement.off("click")}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="open-product-zoom"]',this._initPhotoSwipe.bind(this)),this.delegateElement.on("click",".Product__SlideItem--image",this._initPhotoSwipeFromImageClick.bind(this))}},{key:"_initPhotoSwipe",value:function(){var images=[];
2this.slideshow.flickityInstance.cells.forEach(function(item){item.element.classList.contains("Product__SlideItem--image")&&images.push(item.element.querySelector("img"))}),this._createPhotoSwipeInstance(this._createPhotoSwipeItemsFromImages(images),parseInt(this.slideshow.flickityInstance.selectedElement.getAttribute("data-image-media-position")))}},{key:"_initPhotoSwipeFromImageClick",value:function(event,target){if(!Responsive.matchesBreakpoint("pocket")){var images=Dom.nodeListToArray(this.element.querySelectorAll(".Product__SlideItem--image img"));this._createPhotoSwipeInstance(this._createPhotoSwipeItemsFromImages(images),parseInt(target.getAttribute("data-image-media-position")))}}},{key:"_createPhotoSwipeItemsFromImages",value:function(images){return images.map(function(image){var maxWidth=parseInt(image.getAttribute("data-max-width")),maxHeight=parseInt(image.getAttribute("data-max-height")),maxDimension=Responsive.matchesBreakpoint("phone")?1200:1800,reduceFactor=1;maxWidth>=maxHeight?reduceFactor=Math.max(maxWidth/maxDimension,1):reduceFactor=Math.max(maxHeight/maxDimension,1);var requestedWidth=Math.floor(maxWidth/reduceFactor),requestedHeight=Math.floor(maxHeight/reduceFactor);return{msrc:image.currentSrc||image.src,w:requestedWidth,h:requestedHeight,initialZoomLevel:.65,src:Image.getSizedImageUrl(image.getAttribute("data-original-src"),requestedWidth+"x"+requestedHeight)}})}},{key:"_createPhotoSwipeInstance",value:function(items,selectedImageIndex){var _this=this,photoswipeContainer=document.querySelector(".pswp");this.photoSwipeInstance=new PhotoSwipe(photoswipeContainer,!1,items,{index:selectedImageIndex,showHideOpacity:!0,showAnimationDuration:500,loop:!1,history:!1,closeOnVerticalDrag:!1,allowPanToNext:!1,pinchToClose:!1,errorMsg:'<p class="pswp__error-msg">'+window.languages.productImageLoadingError+"</p>",scaleMode:"zoom",getDoubleTapZoom:function(isMouseClick,item){return isMouseClick?1.6:item.initialZoomLevel<.7?1:1.33},getThumbBoundsFn:function(index){var thumbnail=_this.element.querySelector('.Product__Slideshow .Carousel__Cell[data-image-media-position="'.concat(parseInt(index),'"] img')),pageYScroll=window.pageYOffset||document.documentElement.scrollTop,rect=thumbnail.getBoundingClientRect();return{x:rect.left,y:rect.top+pageYScroll,w:rect.width}}});var originalUpdateSize=this.photoSwipeInstance.updateSize,lastWidth=null;this.photoSwipeInstance.updateSize=function(){(lastWidth===null||lastWidth!==window.innerWidth)&&originalUpdateSize(this,arguments),lastWidth=window.innerWidth},this.photoSwipeInstance.listen("beforeChange",this._onSlideChanged.bind(this)),this.photoSwipeInstance.listen("destroy",this._destroyPhotoSwipe.bind(this)),this.photoSwipeInstance.listen("doubleTap",this._onDoubleTap.bind(this)),this.photoSwipeInstance.listen("initialZoomIn",this._onInitialZoomIn.bind(this)),this.photoSwipeInstance.listen("initialZoomOut",this._onInitialZoomOut.bind(this)),this.delegateRoot.on("pswpTap",".pswp__scroll-wrap",this._onSingleTap.bind(this)),this.delegateRoot.on("pswpTap",".pswp__button--close",this.photoSwipeInstance.close),this.delegateRoot.on("pswpTap",".pswp__button--prev",this.photoSwipeInstance.prev),this.delegateRoot.on("pswpTap",".pswp__button--next",this.photoSwipeInstance.next),this.photoSwipeInstance.init()}},{key:"_onSlideChanged",value:function(){this.photoSwipeInstance.getCurrentIndex()===0?this.photoSwipeInstance.scrollWrap.querySelector(".pswp__button--prev").setAttribute("disabled","disabled"):this.photoSwipeInstance.scrollWrap.querySelector(".pswp__button--prev").removeAttribute("disabled"),this.photoSwipeInstance.getCurrentIndex()+1===this.photoSwipeInstance.options.getNumItemsFn()?this.photoSwipeInstance.scrollWrap.querySelector(".pswp__button--next").setAttribute("disabled","disabled"):this.photoSwipeInstance.scrollWrap.querySelector(".pswp__button--next").removeAttribute("disabled")}},{key:"_onSingleTap",value:function(event){if(!event.detail||event.detail.pointerType==="mouse")event.target.classList.contains("pswp__img")&&this.photoSwipeInstance.toggleDesktopZoom(event.detail.releasePoint);else{if(event.target.classList.contains("pswp__button"))return;event.target.closest(".pswp").querySelector(".pswp__ui").classList.toggle("pswp__ui--hidden")}}},{key:"_onDoubleTap",value:function(point){var initialZoomLevel=this.photoSwipeInstance.currItem.initialZoomLevel;this.photoSwipeInstance.getZoomLevel()!==initialZoomLevel?this.photoSwipeInstance.zoomTo(initialZoomLevel,point,333):this.photoSwipeInstance.zoomTo(initialZoomLevel<.7?1:1.33,point,333)}},{key:"_onInitialZoomIn",value:function(){document.querySelector(".pswp__ui").classList.remove("pswp__ui--hidden")}},{key:"_onInitialZoomOut",value:function(){document.querySelector(".pswp__ui").classList.add("pswp__ui--hidden")}},{key:"_destroyPhotoSwipe",value:function(){this.delegateRoot.off("pswpTap"),this.photoSwipeInstance=null}}]),ProductImageZoom2})(),ProductModel=(function(){function ProductModel2(element,stackProductImages){_classCallCheck(this,ProductModel2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.delegateRoot=new domDelegate.Delegate(document.documentElement),this.stackProductImages=stackProductImages,this._attachListeners();var stylesheet=document.createElement("link");stylesheet.rel="stylesheet",stylesheet.href="https://cdn.shopify.com/shopifycloud/model-viewer-ui/assets/v1.0/model-viewer-ui.css",document.head.appendChild(stylesheet),window.Shopify.loadFeatures([{name:"model-viewer-ui",ver
2sion:"1.0",onLoad:this._setupModelViewerUI.bind(this)},{name:"shopify-xr",version:"1.0"}])}return _createClass(ProductModel2,[{key:"destroy",value:function(){}},{key:"_attachListeners",value:function(){var _this=this;this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_play",function(){_this.element.dispatchEvent(new CustomEvent("model:played",{bubbles:!0}))}),this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_pause",function(){_this.element.dispatchEvent(new CustomEvent("model:paused",{bubbles:!0}))})}},{key:"hasBeenSelected",value:function(){Responsive.matchesBreakpoint("supports-hover")&&this.modelUi.play()}},{key:"hasBeenDeselected",value:function(){this.modelUi.pause()}},{key:"_setupModelViewerUI",value:function(){this.modelElement=this.element.querySelector("model-viewer"),this.modelUi=new window.Shopify.ModelViewerUI(this.modelElement)}}]),ProductModel2})(),ProductReviews=(function(){function ProductReviews2(container){_classCallCheck(this,ProductReviews2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.delegateElement.on("click",".spr-summary-actions-newreview",this._onNewReviewClicked.bind(this)),window.SPRCallbacks={},window.SPRCallbacks.onFormSuccess=this._onFormSuccess.bind(this),window.SPRCallbacks.onReviewsLoad=this._onReviewsLoad.bind(this)}return _createClass(ProductReviews2,[{key:"destroy",value:function(){this.delegateElement.off()}},{key:"_updatePagination",value:function(event,target){SPR.$(target).data("page",parseInt(target.getAttribute("data-page"))+1)}},{key:"_onFormSuccess",value:function(){var formSuccess=this.element.querySelector(".spr-form-message-success");window.scrollTo(0,formSuccess.offsetTop-45)}},{key:"_onReviewsLoad",value:function(){var sprSummaryActions=this.element.querySelector(".spr-summary-actions"),previousSprPaginationNext=sprSummaryActions.querySelector(".spr-pagination-next"),sprPaginationNext=this.element.querySelector(".spr-pagination .spr-pagination-next");previousSprPaginationNext&&previousSprPaginationNext.remove(),sprPaginationNext&&sprSummaryActions.insertBefore(sprPaginationNext,sprSummaryActions.firstChild)}},{key:"_onNewReviewClicked",value:function(event,target){target.style.display="none",target.previousElementSibling&&(target.previousElementSibling.style.display="none")}}]),ProductReviews2})(),Form=(function(){function Form2(){_classCallCheck(this,Form2)}return _createClass(Form2,null,[{key:"serialize",value:function(form){function stringKey(key,value){var beginBracket=key.lastIndexOf("[");if(beginBracket===-1){var _hash={};return _hash[key]=value,_hash}var newKey=key.substr(0,beginBracket),newValue={};return newValue[key.substring(beginBracket+1,key.length-1)]=value,stringKey(newKey,newValue)}for(var hash={},i=0,len=form.elements.length;i<len;i++){var formElement=form.elements[i];if(!(formElement.name===""||formElement.disabled)&&formElement.name&&!formElement.disabled&&(formElement.checked||/select|textarea/i.test(formElement.nodeName)||/hidden|text|search|tel|url|email|password|datetime|date|month|week|time|datetime-local|number|range|c
2olor/i.test(formElement.type))){var stringKeys=stringKey(formElement.name,formElement.value);hash=Form2.extend(hash,stringKeys)}}return hash}},{key:"extend",value:function(){for(var extended={},i=0,merge=function(obj){for(var prop in obj)obj.hasOwnProperty(prop)&&(Object.prototype.toString.call(obj[prop])==="[object Object]"?extended[prop]=Form2.extend(extended[prop],obj[prop]):extended[prop]=obj[prop])};i<arguments.length;i++)merge(arguments[i]);return extended}}]),Form2})(),Currency=(function(){function Currency2(){_classCallCheck(this,Currency2)}return _createClass(Currency2,null,[{key:"formatMoney",value:function(cents,format){typeof cents=="string"&&(cents=cents.replace(".",""));var placeholderRegex=/\{\{\s*(\w+)\s*\}\}/,formatString=format||"${{amount}}";function defaultTo(value2,defaultValue){return value2==null||value2!==value2?defaultValue:value2}function formatWithDelimiters(number,precision,thousands,decimal){if(precision=defaultTo(precision,2),thousands=defaultTo(thousands,","),decimal=defaultTo(decimal,"."),isNaN(number)||number==null)return 0;number=(number/100).toFixed(precision);var parts=number.split("."),dollarsAmount=parts[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+thousands),centsAmount=parts[1]?decimal+parts[1]:"";return dollarsAmount+centsAmount}var value="";switch(formatString.match(placeholderRegex)[1]){case"amount":value=formatWithDelimiters(cents,2);break;case"amount_no_decimals":value=formatWithDelimiters(cents,0);break;case"amount_with_space_separator":value=formatWithDelimiters(cents,2," ",".");break;case"amount_no_decimals_with_comma_separator":value=formatWithDelimiters(cents,0,".",",");break;case"amount_no_decimals_with_space_separator":value=formatWithDelimiters(cents,0," ");break;case"amount_with_comma_separator":value=formatWithDelimiters(cents,2,".",",");break}return formatString.indexOf("with_comma_separator")!==-1?formatString.replace(placeholderRegex,value).replace(",00",""):formatString.replace(placeholderRegex,value).replace(".00","")}}]),Currency2})(),VariantSelector=(function(){function VariantSelector2(element,parentProductVariants){var options=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};_classCallCheck(this,VariantSelector2),this.element=element,this.parentProductVariants=parentProductVariants,this.delegateElement=new domDelegate.Delegate(this.element),this.activator=options.activator||document.querySelector('[aria-controls="'.concat(element.getAttribute("id"),'"]')),this.onValueChangedCallback=options.onValueChanged||function(){},this.isOpen=!1,this.pageOverlayElement=document.querySelector(".PageOverlay"),this.variantChoiceList=Dom.nodeListToArray(this.element.querySelectorAll(".VariantSelector__Choice")),this.variantCarousel=new Carousel(this.element.querySelector(".VariantSelector__Carousel"),{onSelect:this._variantChanged.bind(this),onClick:this._variantSelected.bind(this)}),this._attachListeners()}return _createClass(VariantSelector2,[{key:"destroy",value:function(){this.element.removeEventListener("keyup",this._handleKeyboardListener),this.delegateElement.off("click"),this.activator.removeEventListener("click",this._toggleListener),this.variantCarousel.destroy()}},{key:"toggle",value:function(){this.isOpen?this.close():this.open()}},{key:"open",value:function(){this.isOpen||(this.element.setAttribute("aria-hidden","false"),this.activator.setAttribute("aria-expanded","true"),Accessibility.trapFocus(this.element,"variant-selector"),document.documentElement.classList.add("no-scroll"),this.element.setAttribute("style",""),this.pageOverlayElement.classList.add("is-visible"),this.pageOverlayElement.addEventListener("click",this._closeListener),this.isOpen=!0)}},{key:"close",value:function(){this.isOpen&&(this.element.setAttribute("aria-hidden","true"),this.activator.setAttribute("aria-expanded","false"),Accessibility.removeTrapFocus(this.element,"variant-selector"),document.documentElement.classList.remove("no-scroll"),this.pageOverlayElement.classList.remove("is-visible"),this.pageOverlayElement.removeEventListener("click",this._closeListener),this.isOpen=!1)}},{key:"_attachListeners",value:function(){this._handleKeyboardListener=this._handleKeyboard.bind(this),this._closeListener=this.close.bind(this),this._toggleListener=this.toggle.bind(this),this.element.addEventListener("keyup",this._handleKeyboardListener),this.activator.addEventListener("click",this._toggleListener),this.delegateElement.on("click",'[data-action="select-variant"]',this._onVariantSelect.bind(this)),this.parentProductVariants.delegateElement.on("variant:changed",this._onVariantChanged.bind(this))}},{key:"_variantChanged",value:function(selectedIndex){var activeChoice=this.variantChoiceList[selectedIndex];activeChoice.classList.add("is-selected"),Dom.getSiblings(activeChoice,".is-selected").forEach(function(item){return item.classList.remove("is-selected")})}},{key:"_variantSelected",value:function(cellElement,cellIndex){this.variantCarousel.getSelectedIndex()===cellIndex?(this.onValueChangedCallback(cellElement.getAttribute("data-option-value"),cellElement,this.activator),this.close()):this.variantCarousel.selectCell(cellIndex)}},{key:"_onVariantChanged",value:function(event){var _this=this,selectedVariant=event.detail.variant,imageWrapperElements=this.element.querySelectorAll(".VariantSelector__ImageWrapper"),found=!1;
2Dom.nodeListToArray(imageWrapperElements).forEach(function(image){var colorPosition=parseInt(image.parentElement.getAttribute("data-option-position"))-1,combinationExcludedColor="";selectedVariant.options.forEach(function(optionValue,index){index!==colorPosition&&(combinationExcludedColor+=optionValue)}),image.getAttribute("data-variant-title")===combinationExcludedColor?(image.setAttribute("aria-hidden","false"),found=!0):image.setAttribute("aria-hidden","true")}),found||imageWrapperElements.children[0].setAttribute("aria-hidden","false");var foundColorIndex=0;Dom.nodeListToArray(this.element.querySelectorAll(".VariantSelector__ChoicePrice")).forEach(function(priceElement,index){var colorPosition=parseInt(priceElement.getAttribute("data-color-position"))-1;_this.parentProductVariants.productData.variants.forEach(function(variant){var matchOptionsExcludedColor=!0;variant.options.forEach(function(option,index2){index2!==colorPosition&&variant.options[index2]!==selectedVariant.options[index2]&&(matchOptionsExcludedColor=!1)}),matchOptionsExcludedColor&&variant.options[colorPosition]===selectedVariant.options[colorPosition]&&foundColorIndex++===index&&(priceElement.innerHTML='<span class="Heading Text--subdued">'.concat(Currency.formatMoney(variant.price,window.theme.moneyFormat),"</span>"))})})}},{key:"_onVariantSelect",value:function(){var selectedCell=this.variantCarousel.flickityInstance.selectedCell.element;this.onValueChangedCallback(selectedCell.getAttribute("data-option-value"),selectedCell,this.activator),this.close()}},{key:"_handleKeyboard",value:function(event){this.isOpen&&event.keyCode===27&&this.close()}}]),VariantSelector2})(),StoreAvailability=(function(){function StoreAvailability2(element,productTitle){_classCallCheck(this,StoreAvailability2),this.element=element,this.productTitle=productTitle,this.existingDrawers={}}return _createClass(StoreAvailability2,[{key:"updateWithVariant",value:function(variant){if(this.element){if(!variant){this.element.textContent="";return}this._renderAvailabilitySection(variant.id)}}},{key:"_renderAvailabilitySection",value:function(id){var _this=this;this.element.innerHTML="";var availabilityModal=document.getElementById("StoreAvailabilityModal-".concat(id));return availabilityModal&&availabilityModal.remove(),this.existingDrawers["StoreAvailabilityModal-".concat(id)]&&(this.existingDrawers["StoreAvailabilityModal-".concat(id)].destroy(),delete this.existingDrawers["StoreAvailabilityModal-".concat(id)]),fetch("".concat(window.routes.rootUrlWithoutSlash,"/variants/").concat(id,"?section_id=store-availability")).then(function(response){return response.text().then(function(content){_this.element.innerHTML=content,_this.element.innerHTML=_this.element.firstElementChild.innerHTML;var productTitle=_this.element.querySelector(".store-availabilities-modal__product-title");productTitle&&(productTitle.textContent=_this.productTitle);var availabilityModal2=document.getElementById("StoreAvailabilityModal-".concat(id));availabilityModal2&&document.body.appendChild(availabilityModal2),_this.existingDrawers["StoreAvailabilityModal-".concat(id)]=new Drawer(availabilityModal2)})})}}]),StoreAvailability2})(),ProductVariants=(function(){function ProductVariants2(container,options){var _this=this;_classCallCheck(this,ProductVariants2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=options;var jsonData=JSON.parse(this.element.querySelector("[data-product-json]").innerHTML||"[]");this.productData=jsonData.product,this.variantsInventories=jsonData.inventories||{},this.variantsExtraData=jsonData.variants_extra_data||{},this.configurator=jsonData.configurator,this.masterSelector=this.element.querySelector("#product-select-".concat(this.productData.id)),this.productVariantsElement=this.element.querySelector(".ProductForm__Variants"),this.productData.variants.forEac
2h(function(variant){_this.variantsExtraData.hasOwnProperty(variant.id)&&Object.assign(variant,_this.variantsExtraData[variant.id]),variant.productHandle=_this.productData.handle,variant.showConfigurator=!(_this.configurator==null||_this.configurator===""),variant.id===jsonData.selected_variant_id&&(_this.currentVariant=variant,_this.option1=variant.option1,_this.option2=variant.option2,_this.option3=variant.option3)}),this.storeAvailability=new StoreAvailability(this.element.querySelector(".ProductMeta__StoreAvailabilityContainer"),this.productData.title),this.storeAvailability.updateWithVariant(this.currentVariant),this._updateAddToCartButton(this.currentVariant),this._updateVariantSaleBadge(this.currentVariant),this._attachListeners(),this._createSelectors()}return _createClass(ProductVariants2,[{key:"destroy",value:function(){this.delegateElement.off("click"),this.delegateElement.off("change"),this.formPopovers.forEach(function(popover){return popover.destroy()}),this.formVariantSelectors.forEach(function(selector){return selector.destroy()})}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="add-to-cart"]',this._addToCart.bind(this)),this.delegateElement.on("click",'[data-action="decrease-quantity"]',this._decreaseQuantity.bind(this)),this.delegateElement.on("click",'[data-action="increase-quantity"]',this._increaseQuantity.bind(this)),this.delegateElement.on("change",'[name="quantity"]',this._validateQuantity.bind(this)),this.delegateElement.on("change",'.ProductForm__Option [type="radio"]',this._onOptionChanged.bind(this)),this.delegateElement.on("input",'.GiftCardSlider[type="range"]',this._previewSliderValue.bind(this)),this.delegateElement.on("change",'.GiftCardSlider[type="range"]',this._updateSliderValue.bind(this))}},{key:"_createSelectors",value:function(){var _this2=this;this.formPopovers=[],this.formVariantSelectors=[],Dom.nodeListToArray(this.element.querySelectorAll(".OptionSelector")).forEac
2h(function(item){var popover=new Popover(item,{preferredPosition:"left",onValueChanged:_this2._onOptionChanged.bind(_this2)});_this2.formPopovers.push(popover)}),Dom.nodeListToArray(this.element.querySelectorAll(".VariantSelector")).forEach(function(item){var variantSelector=new VariantSelector(item,_this2,{onValueChanged:_this2._onOptionChanged.bind(_this2)});_this2.formVariantSelectors.push(variantSelector)})}},{key:"_onVariantChanged",value:function(previousVariant,newVariant){this._updateProductPrices(newVariant,previousVariant),this._updateInventory(newVariant,previousVariant),this._updateSku(newVariant,previousVariant),this._updateUnitPrice(newVariant,previousVariant),this._updateAddToCartButton(newVariant,previousVariant),this._updateProductForm(newVariant),this._updateStoreAvailabilityAccordion(newVariant),this.storeAvailability.updateWithVariant(newVariant),this._updateVariantSaleBadge(newVariant),this.element.dispatchEvent(new CustomEvent("variant:changed",{bubbles:!0,detail:{variant:newVariant,previousVariant}}))}},{key:"_updateProductPrices",value:function(newVariant,previousVariant){var productMetaPrices=this.element.querySelector(".ProductMeta__PriceList"),currencyFormat=window.theme.currencyCodeEnabled?window.theme.moneyWithCurrencyFormat:window.theme.moneyFormat;if(productMetaPrices)if(!newVariant)productMetaPrices.style.display="none";else{if(previousVariant&&previousVariant.price===newVariant.price&&previousVariant.compare_at_price===newVariant.compare_at_price&&previousVariant.custom_private_sale_price==newVariant.custom_private_sale_price)return;productMetaPrices.innerHTML="",(previousVariant.custom_private_sale_price!==void 0||newVariant.custom_private_sale_price!==void 0)&&(newVariant.custom_private_sale_price?(productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price Price--compareAt d-none" data-money-convertible>'.concat(Currency.formatMoney(newVariant.price,currencyFormat),"</span>"),productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price Price--highlight d-none">'.concat(newVariant.custom_private_sale_price,"</span>")):productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price Text--subdued u-h4 d-none" data-money-convertible>'.concat(Currency.formatMoney(newVariant.price,currencyFormat),"</span>")),newVariant.compare_at_price>newVariant.price?(productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__DefaultPrice Price Price--compareAt" data-money-convertible>'.concat(Currency.formatMoney(newVariant.compare_at_price,currencyFormat),"</span>"),productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__DefaultPrice Price Price--highlight" data-money-convertible>'.concat(Currency.formatMoney(newVariant.price,currencyFormat),"</span>")):productMetaPrices.innerHTML+='<span class="ProductItem__Price ProductItem__DefaultPrice Price" data-money-convertible>'.concat(Currency.formatMoney(newVariant.price,currencyFormat),"</span>"),productMetaPrices.style.display="",checkPrivateSale()}}},{key:"_updateVariantSaleBadge",value:function(newVariant){var badges=this.element.querySelectorAll("[data-variant-sale-badge]");if(badges.length){var isOnSale=!!(newVariant&&newVariant.on_sale);badges.forEach(function(badge){badge.setAttribute("data-on-sale",isOnSale?"true":"false")}),checkPrivateSale()}}},{key:"_updateInventory",value:function(newVariant){if(this.options.showInventoryQuantity){var productFormInventory=this.element.querySelector(".ProductForm__Inventory"),variantInventory=newVariant?this.variantsInventories[newVariant.id]:null;console.log(variantInventory),!newVariant||variantInventory.inventory_management===null||variantInventory.inventory_showmessage=="true"?productFormInventory.style.display="none":(productFormInventory.innerHTML=variantInventory.inventory_message,productFormInventory.style.display="")}}},{key:"_updateSku",value:function(newVariant){if(!(!this.options.showSku||!newVariant)){var productSkuNumber=this.element.querySelector(".ProductMeta__SkuNumber");productSkuNumber&&newVariant.sku&&(productSkuNumber.innerText=newVariant.sku)}}},{key:"_previewSliderValue",value:function(event){if(!(!event.target||!event.target.value)){var slider=event.target,idx=event.target.value,displayedSliderValue=this.element.querySelector(slider.dataset.target),hidden=this.element.querySelector(slider.dataset.hidden),values=slider.dataset.values.split("||"),i=Math.max(0,Math.min(values.length-1,parseInt(idx,10)||0)),val=values[i];displayedSliderValue.textContent=val,hidden.value=val,slider.setAttribute("aria-valuenow",i)}}},{key:"_updateSliderValue",value:function(event){if(!(!event.target||!event.target.value)){this._previewSliderValue(event);var slider=event.target,hidden=this.element.querySelector(slider.dataset.hidden);hidden.dispatchEvent(new Event("change",{bubbles:!0}))}}},{key:"_updateStoreAvailabilityAccordion",value:function(newVariant){if(newVariant){var storeAvailabilityAccordion=this.element.querySelector(".accordion-item.store-availability");if(storeAvailabilityAccordion){var isBeforeLaunch=!!(newVariant.launch_date_seconds&&newVariant.launch_date_seconds>Math.floor(Date.now()/1e3));newVariant.available&&!isBeforeLaunch?storeAvailabilityAccordion.classList.remove("d-none"):storeAvailabilityAccordion.classList.add("d-none")}}}},{key:"_updateUnitPrice",value:function(newVariant){if(newVariant){var unitPriceMeasurement=this.element.querySelector(".ProductMeta__UnitPriceMeasurement");
2if(unitPriceMeasurement){if(!newVariant.hasOwnProperty("unit_price")){unitPriceMeasurement.style.display="none";return}unitPriceMeasurement.style.display="block",unitPriceMeasurement.querySelector(".UnitPriceMeasurement__Price").innerHTML=Currency.formatMoney(newVariant.unit_price,window.theme.moneyFormat),unitPriceMeasurement.querySelector(".UnitPriceMeasurement__ReferenceUnit").textContent=newVariant.unit_price_measurement.reference_unit;var unitPriceReferenceValue=unitPriceMeasurement.querySelector(".UnitPriceMeasurement__ReferenceValue");unitPriceReferenceValue.textContent=newVariant.unit_price_measurement.reference_value,unitPriceReferenceValue.style.display=newVariant.unit_price_measurement.reference_value===1?"none":"inline"}}}},{key:"_updateAddToCartButton",value:function(newVariant){var addToCartButton2=this.element.querySelector(".ProductForm__AddToCart"),buyButtons=this.element.querySelector(".ProductForm__BuyButtons "),preorderInfoText=this.element.querySelector(".preorder-info"),oosGiftCardLink=this.element.querySelector(".oos-gift-card-link"),shopifyPaymentButton=this.element.querySelector(".shopify-payment-button"),preorderProperty=this.element.querySelector("#preorder"),estShipDateProperty=this.element.querySelector("#est_ship_date"),finalSaleProperty=this.element.querySelector("#finalsale"),monogrammingButton=this.element.querySelector(".ProductForm__Monogramming"),eacValue=null,storedEac=localStorage.getItem("eac");if(storedEac){var parsed=JSON.parse(storedEac);if(Date.now()<parsed.expires)var eacValue=parsed.value;else localStorage.removeItem("eac")}var urlParams=new URL(window.location).searchParams,earlyAccess=newVariant.early_access_code!=null&&(urlParams.get("eac")==newVariant.early_access_code||eacValue==newVariant.early_access_code),isBeforeLaunch=!!(newVariant.launch_date_seconds&&newVariant.launch_date_seconds>Math.floor(Date.now()/1e3)),isBeforeBackInStock=!!(newVariant.back_in_stock_date_seconds&&newVariant.back_in_stock_date_seconds>Math.floor(Date.now()/1e3));if(preorderInfoText?.classList.add("d-none"),urlParams.get("cuy")=="ALPACINO"){earlyAccess=!0;const monoTestLink=this.element.querySelector("#cuyana-mono-qa");monoTestLink&&(monoTestLink.dataset.variantId=newVariant.id)}if(monogrammingButton&&(monogrammingButton.dataset.variantId=newVariant.id),addToCartButton2)if(addToCartButton2.classList.remove("d-none"),buyButtons?.classList.remove("d-none"),!newVariant)addToCartButton2.setAttribute("disabled","disabled"),addToCartButton2.removeAttribute("data-action"),preorderProperty?.setAttribute("value",""),estShipDateProperty?.setAttribute("value",""),finalSaleProperty?.setAttribute("value",""),addToCartButton2.classList.add("Button--secondary"),addToCartButton2.innerHTML=window.languages.productFormUnavailable;else if(newVariant.available&&(!isBeforeLaunch||earlyAccess)){if(addToCartButton2.removeAttribute("disabled"),addToCartButton2.classList.add(addToCartButton2.getAttribute("data-use-primary-button")==="true"?"Button--primary":"Button--secondary"),addToCartButton2.setAttribute("data-action","add-to-cart"),newVariant.is_preorder?(addToCartButton2.innerHTML="<span>".concat(window.languages.productFormPreorder,"</span>"),preorderProperty?.setAttribute("value","true"),estShipDateProperty?.setAttribute("value",newVariant.back_in_stock_date||"")):(this.options.showPriceInButton===void 0||this.options.showPriceInButton?addToCartButton2.innerHTML=`
3            <span>`.concat(window.languages.productFormAddToCart,`</span>
4            <span class="Button__SeparatorDot"></span>
5            <span data-money-convertible>`).concat(Currency.formatMoney(newVariant.price,window.theme.moneyFormat),`</span>
6          `):addToCartButton2.innerHTML="<span>".concat(window.languages.productFormAddToCart,"</span>"),preorderProperty?.setAttribute("value",""),estShipDateProperty?.setAttribute("value","")),newVariant.is_final_sale?finalSaleProperty?.setAttribute("value","true"):finalSaleProperty?.setAttribute("value",""),isBeforeBackInStock){var instockDate=this.element.querySelector(".instock-date");instockDate.innerHTML=newVariant.back_in_stock_date,preorderInfoText?.classList.remove("d-none")}}else addToCartButton2.setAttribute("disabled","disabled"),addToCartButton2.classList.add("d-none"),addToCartButton2.removeAttribute("data-action"),preorderProperty?.setAttribute("value",""),estShipDateProperty?.setAttribute("value",""),finalSaleProperty?.setAttribute("value",""),addToCartButton2.innerHTML=window.languages.productFormSoldOut,buyButtons?.classList.add("d-none");var waitlistSection=this.element.querySelector(".ProductForm__WaitList");if(waitlistSection){waitlistSection.classList.add("d-none"),(!newVariant||!newVariant.available||isBeforeLaunch&&!earlyAccess)&&waitlistSection.classList.remove("d-none");var soldOutSunset=waitlistSection.querySelector(".ProductForm__SoldOutSunset"),waitlistInner=waitlistSection.querySelector(".ProductForm__WaitListInner"),exitDateSeconds=newVariant&&newVariant.exit_date_seconds?parseInt(newVariant.exit_date_seconds,10):0,isSunsetted=exitDateSeconds>0&&Math.floor(Date.now()/1e3)>=exitDateSeconds,isReplenishable=!newVariant||newVariant.replenishable!==!1,showSoldOutCta=isSunsetted||!isReplenishable;soldOutSunset&&soldOutSunset.classList.toggle("d-none",!showSoldOutCta),waitlistInner&&waitlistInner.classList.toggle("d-none",showSoldOutCta)}oosGiftCardLink?.classList.add("d-none"),(!newVariant||!newVariant.available)&&oosGiftCardLink?.classList.remove("d-none");var launchMessage=this.element.querySelector(".availability-message");if(launchMessage&&(launchMessage.classList.add("d-none"),isBeforeLaunch&&!earlyAccess)){var defaultMsgValue=launchMessage.getAttribute("data-default-msg");newVariant.launch_date_message?launchMessage.innerHTML=newVariant.launch_date_message:(launchMessage.innerHTML=defaultMsgValue,launchMessage.querySelector(".date").innerHTML=newVariant.launch_date_formatted),launchMessage.classList.remove("d-none")}var showConfiguratorButton=!1,showMonogrammingButton=!1;newVariant.available&&(newVariant.showConfigurator&&(showConfiguratorButton=!0),newVariant.monogramming&&(showMonogrammingButton=!0)),monogrammingButton&&(showMonogrammingButton?monogrammingButton.classList.remove("d-none"):monogrammingButton.classList.add("d-none"));var configuratorButton=this.element.querySelector(".ProductForm__Configurator");configuratorButton&&(showConfiguratorButton?configuratorButton.classList.remove("d-none"):configuratorButton.classList.add("d-none")),this.options.showPaymentButton&&shopifyPaymentButton&&(!newVariant||!newVariant.available?shopifyPaymentButton.style.display="none":shopifyPaymentButton.style.display="block")}},{key:"_updateProductForm",value:function(newVariant){if(this.productVariantsElement&&newVariant.options.length>1){var variant_id=newVariant.id,productHandle=newVariant.productHandle,_this=this;
6const cuyParam=new URL(window.location).searchParams.get("cuy")==="ALPACINO"?"&cuy=ALPACINO":"",url=window.location.origin+"/products/"+productHandle+"?variant="+variant_id+"&view=swatches"+cuyParam;fetch(url).then(response=>response.text()).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const sectionHtml=tempElement.querySelector(".ProductForm__Variants");_this.productVariantsElement.innerHTML=sectionHtml.innerHTML}).catch(error=>{console.error("Failed to fetch product quickview modal content:",error)})}}},{key:"_onOptionChanged",value:function(newValue,target,activator){if(activator)this["option"+target.getAttribute("data-option-position")]=newValue,activator.querySelector(".ProductForm__SelectedValue").innerHTML=newValue;else{this["option"+target.getAttribute("data-option-position")]=target.value;var selectedValue=target.closest(".ProductForm__Option").querySelector(".ProductForm__SelectedValue");selectedValue&&(selectedValue.innerHTML=" "+target.value)}var previousVariant=this.currentVariant;this.currentVariant=this._getCurrentVariantFromOptions(),this.currentVariant&&(this._onVariantChanged(previousVariant,this.currentVariant),this.options.enableHistoryState&&this._updateHistoryState(this.currentVariant),this.masterSelector.querySelector("[selected]").removeAttribute("selected"),this.masterSelector.querySelector('[value="'.concat(this.currentVariant.id,'"]')).setAttribute("selected","selected"),this.masterSelector.dispatchEvent(new Event("change",{bubbles:!0})))}},{key:"_getCurrentVariantFromOptions",value:function(){var _this3=this,found=!1;
6return this.productData.variants.forEach(function(variant){variant.option1===_this3.option1&&variant.option2===_this3.option2&&variant.option3===_this3.option3&&(found=variant)}),found||null}},{key:"_updateHistoryState",value:function(variant){if(history.replaceState){var currentParams=new URL(window.location).searchParams;currentParams.delete("variant");var newUrl="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname).concat("?variant=",variant.id);currentParams.size>0&&(newUrl=newUrl.concat("&",currentParams.toString())),window.history.replaceState({path:newUrl},"",newUrl)}}},{key:"_addToCart",value:function(event){var _this4=this;if(!(this.options.useAjaxCart===void 0||!this.options.useAjaxCart)){event.preventDefault();var formElement=this.element.querySelector('form[action*="/cart/add"]');if(formElement.querySelector(".giftcardform")&&!formElement.checkValidity()){event.stopPropagation(),formElement.classList.add("was-validated");return}var addToCartButton2=this.element.querySelector(".ProductForm__AddToCart");addToCartButton2.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start"));var payload=Form.serialize(formElement);payload.properties._uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3),payload.properties._variant=this.currentVariant?.id;var accessoriesDiv=this.element.querySelector("#accessoriesContent");if(accessoriesDiv){var accessories=accessoriesDiv.querySelectorAll("input.accessoriesSelector"),items=[];accessories.forEach(function(accessory){if(accessory.checked){var id=accessory.getAttribute("data-pid"),preorder=accessory.getAttribute("data-preorder"),finalsale=accessory.getAttribute("data-finalsale"),properties={},item={id,quantity:1};preorder=="true"&&(properties._is_preorder=!0),finalsale=="true"&&(properties.is_final_sale=!0,properties._LPROP="no-returns"),Object.keys(properties).length!==0&&(item.properties=properties),items.push(item)}}),items.length>0&&(items.unshift(payload),payload={items})}fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){document.dispatchEvent(new CustomEvent("theme:loading:end"));var quantityElement=formElement.querySelector('[name="quantity"]');response.ok?(addToCartButton2.removeAttribute("disabled"),_this4.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{variant:_this4.currentVariant,quantity:quantityElement?parseInt(quantityElement.value):1}}))):response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})}),event.preventDefault()}}},{key:"_decreaseQuantity",value:function(event,target){target.nextElementSibling.value=Math.max(parseInt(target.nextElementSibling.value)-1,1)}},{key:"_increaseQuantity",value:function(event,target){target.previousElementSibling.value=parseInt(target.previousElementSibling.value)+1}},{key:"_validateQuantity",value:function(event,target){target.value=Math.max(parseInt(target.value)||1,1)}}]),ProductVariants2})(),ProductVideo=(function(){function ProductVideo2(element,stackProductImages,enableVideoLooping){switch(_classCallCheck(this,ProductVideo2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.stackProductImages=stackProductImages,this.enableVideoLooping=enableVideoLooping,this.player=null,this.element.getAttribute("data-media-type")){case"video":var stylesheet=document.createElement("link");stylesheet.rel="stylesheet",stylesheet.href="https://cdn.shopify.com/shopifycloud/shopify-plyr/v1.0/shopify-plyr.css",document.head.appendChild(stylesheet),window.Shopify.loadFeatures([{name:"video-ui",version:"1.0",onLoad:this._setupHtml5Video.bind(this)}]);break;case"external_video":this._setupExternalVideo();break}}return _createClass(ProductVideo2,[{key:"destroy",value:function(){this.player&&this.player.destroy()}},{key:"hasBeenSelected",value:function(){Responsive.matchesBreakpoint("supports-hover")&&this.play()}},{key:"hasBeenDeselected",value:function(){this.pause()}},{key:"play",value:function(){switch(this.element.getAttribute("data-media-type")){case"video":this.player.play();break;case"external_video":this.player.playVideo();break}}},{key:"pause",value:function(){switch(this.element.getAttribute("data-media-type")){case"video":this.player.pause();break;case"external_video":this.player.pauseVideo();break}}},{key:"_setupHtml5Video",value:function(){var _this=this;this.player=new Shopify.Plyr(this.element.querySelector("video"),{controls:["play","progress","mute","volume","play-large","fullscreen"],loop:{active:this.enableVideoLooping},hideControlsOnPause:!0,clickToPlay:!0,iconUrl:"//cdn.shopify.com/shopifycloud/shopify-plyr/v1.0/shopify-plyr.svg",tooltips:{controls:!1,seek:!0}}),this.player.on("play",function(){_this.element.dispatchEvent(new CustomEvent("video:played",{bubbles:!0}))}),this.player.on("pause",function(){_this.element.dispatchEvent(new CustomEvent("video:paused",{bubbles:!0}))})}},{key:"_setupExternalVideo",value:function(){this.element.getAttribute("data-video-host")==="youtube"&&this._loadYouTubeScript().then(this._setupYouTubePlayer.bind(this))}},{key:"_setupYouTubePlayer",value:function(){var _this2=this,playerLoadingInterval=setInterval(function(){window.YT!==void 0&&window.YT.Player!==void 0&&(_this2.player=new YT.Player(_this2.element.querySelector("iframe"),{videoId:_this2.element.getAttribute("data-video-id"),events:{onStateChange:function(event){event.data===window.YT.PlayerState.PLAYING?_this2.element.dispatchEvent(new CustomEvent("video:played",{bubbles:!0})):event.data===YT.PlayerState.PAUSED&&_this2.element.dispatchEvent(new CustomEvent("video:paused",{bubbles:!0})),event.data===window.YT.PlayerState.ENDED&&_this2.enableVideoLooping&&event.target.seekTo(0)}}}),clearInterval(playerLoadingInterval))},50)}},{key:"_loadYouTubeScript",value:function(){return new Promise(function(resolve,reject){var script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src="//www.youtube.com/iframe_api"})}}]),ProductVideo2})(),ScrollSpy=(function(){function ScrollSpy2(container,elementsToSpy,observerOptions){var _this=this;_classCallCheck(this,ScrollSpy2),this.container=container,this.targets=[],this.targetIndices={},this.indicesInViewPort=[],this.observer=new IntersectionObserver(this._onIntersectionChange.bind(this),observerOptions),elementsToSpy.forEach(function(elementToSpy,index){_this.targets.push(elementToSpy),_this.targetIndices[elementToSpy.id]=index,_this.observer.observe(elementToSpy)})}return _createClass(ScrollSpy2,[{key:"destroy",value:function(){this.observer.disconnect()}}
6,{key:"_onIntersectionChange",value:function(changes){for(var oldTargetIndex=this.indicesInViewPort[0]||0,i=changes.length-1;i>=0;i--)this._updateIndicesInViewPort(changes[i],oldTargetIndex);if(this.indicesInViewPort=this.indicesInViewPort.filter(function(value,index,self){return self.indexOf(value)===index}),!(this.indicesInViewPort.length===0||oldTargetIndex===this.indicesInViewPort[0])){var event=new CustomEvent("scrollspy:target:changed",{detail:{newTarget:this.targets[this.indicesInViewPort[0]],oldTarget:this.targets[oldTargetIndex]}});this.container.dispatchEvent(event)}}},{key:"_updateIndicesInViewPort",value:function(change,oldTargetIndex){var index=this.targetIndices[change.target.id];if(change.intersectionRatio===0){var indexInViewPort=this.indicesInViewPort.indexOf(index);indexInViewPort!==-1&&this.indicesInViewPort.splice(indexInViewPort,1)}else index<oldTargetIndex?this.indicesInViewPort.unshift(index):index>this.indicesInViewPort[this.indicesInViewPort.length-1]?this.indicesInViewPort.push(index):(this.indicesInViewPort.push(index),this.indicesInViewPort.sort())}}]),ScrollSpy2})(),SearchBar=(function(){function SearchBar2(){_classCallCheck(this,SearchBar2),this.documentDelegate=new domDelegate.Delegate(document.body),this.searchElement=document.getElementById("Search"),this.searchInputElement=this.searchElement.querySelector('[name="q"]'),this.searchResultsElement=this.searchElement.querySelector(".Search__Results"),this.queryMap={},this.isOpen=!1,this.pageOverlayElement=document.querySelector(".PageOverlay"),this.srAnnouncements=document.querySelector("#srAnnouncements"),this._attachListeners()}return _createClass(SearchBar2,[{key:"destroy",value:function(){this.searchInputElement.removeEventListener("keydown",this._preventSubmissionListener),this.searchInputElement.removeEventListener("input",this._onInputListener),this.documentDelegate.off()}},{key:"_attachListeners",value:function(){this._preventSubmissionListener=this._preventSubmission.bind(this),this._onInputListener=this._debounce(this._onInput.bind(this),250),this.searchInputElement.addEventListener("keydown",this._preventSubmissionListener),this.searchInputElement.addEventListener("input",this._onInputListener),this.documentDelegate.on("click",'[data-action="toggle-search"]',this._toggleSearch.bind(this)),this.documentDelegate.on("click",'[data-action="open-search"]',this._openSearch.bind(this)),this.documentDelegate.on("click",'[data-action="close-search"]',this._closeSearch.bind(this)),this.documentDelegate.on("search:close",this._closeSearch.bind(this))}},{key:"_toggleSearch",value:function(event){this.isOpen?(this._closeSearch(event),this.srAnnouncements.textContent="The search bar has been closed."):(this._openSearch(event),this.srAnnouncements.textContent="The search bar is has been opened."),event.preventDefault()}},{key:"_openSearch",value:function(){var _this=this;this.searchElement.setAttribute("aria-hidden","false"),this.searchInputElement.setAttribute("aria-hidden","false"),document.documentElement.classList.add("no-scroll"),Accessibility.trapFocus(this.searchElement,"search",this.searchElement.querySelector('[name="q"]'));var onFocusListener=function onFocusListener2(){_this.searchInputElement.focus(),_this.searchElement.removeEventListener("transitionend",onFocusListener2)};this.searchElement.addEventListener("transitionend",onFocusListener),this.isOpen=!0,this.pageOverlayElement.classList.add("is-visible"),document.querySelector("#shopify-section-header").style.zIndex=10}},{key:"_closeSearch",value:function(){var _this2=this;if(this.isOpen){this.searchElement.setAttribute("aria-hidden","true"),document.documentElement.classList.remove("no-scroll"),Accessibility.removeTrapFocus(this.searchElement,"search"),this.isOpen=!1;var onTransitionEnd=function onTransitionEnd2(event){event.propertyName==="visibility"&&(document.querySelector("#shopify-section-header").style.zIndex="",_this2.pageOverlayElement.removeEventListener("transitionend",onTransitionEnd2))};this.pageOverlayElement.addEventListener("transitionend",onTransitionEnd),this.pageOverlayElement.classList.remove("is-visible")}}},{key:"_preventSubmission",value:function(event){event.keyCode===13&&window.theme.searchMode!=="product"&&event.preventDefault()}},{key:"_onInput",value:function(event){var _this3=this;if(event.keyCode!==13){if(this.lastInputValue=event.target.value,this.lastInputValue===""){this._resetSearch();return}var queryOptions={method:"GET",credentials:"same-origin"},queries=[fetch("".concat(window.routes.searchUrl,"?section_id=cuyana-predictive-search&q=").concat(encodeURIComponent(this.lastInputValue),"&options[prefix]=last&type=product"),queryOptions)];window.theme.searchMode!=="product"&&queries.push(fetch("".concat(window.routes.searchUrl,"?section_id=cuyana-predictive-search&q=").concat(encodeURIComponent(this.lastInputValue),"&options[prefix]=last&type=").concat(window.theme.searchMode.replace("product,","")),queryOptions)),this.queryMap[this.lastInputValue]=!0,document.dispatchEvent(new CustomEvent("theme:loading:start")),Promise.all(queries).then(function(responses){_this3.lastInputValue===event.target.value&&(delete _this3.queryMap[event.target.value],Promise.all(responses.map(function(response){return response.text()})).then(function(contents){window.theme.searchMode==="product"?_this3.searchResultsElement.innerHTML=contents[0]:_this3.searchResultsElement.innerHTML=`<div class="PageLayout PageLayout--breakLap">
7              <div class="PageLayout__Section">`.concat(contents[0],`</div>
8              <div class="PageLayout__Section PageLayout__Section--secondary">`).concat(contents[1],`</div>
9            </div>`),_this3.searchResultsElement.setAttribute("aria-hidden","false"),checkPrivateSale()}),document.dispatchEvent(new CustomEvent("theme:loading:end")))})}}},{key:"_resetSearch",value:function(){window.theme.searchMode==="product"?this.searchResultsElement.innerHTML="":this.searchResultsElement.innerHTML=`<div class="PageLayout PageLayout--breakLap">
10              <div class="PageLayout__Section"></div>
11              <div class="PageLayout__Section PageLayout__Section--secondary"></div>
12            </div>`,this.searchResultsElement.setAttribute("aria-hidden","true"),document.dispatchEvent(new CustomEvent("theme:loading:end"))}},{key:"_debounce",value:function(fn,delay){var _this4=this,timer=null;return function(){for(var _len=arguments.length,args=new Array(_len),_
12key=0;_key<_len;_key++)args[_key]=arguments[_key];clearTimeout(timer),timer=setTimeout(function(){fn.apply(_this4,args)},delay)}}}]),SearchBar2})(),NavSearchBar=(function(){function NavSearchBar2(){_classCallCheck(this,NavSearchBar2),this.searchElement=document.getElementById("NavSearch"),this.searchElement&&(this.documentDelegate=new domDelegate.Delegate(document.body),this.searchCloseElement=this.searchElement.querySelector(".Search__Close"),this.searchInputElement=this.searchElement.querySelector('[name="q"]'),this.searchResultsElement=this.searchElement.querySelector(".Search__Results"),this.queryMap={},this.isOpen=!1,this.pageOverlayElement=document.querySelector(".PageOverlay"),this._attachListeners())}return _createClass(NavSearchBar2,[{key:"destroy",value:function(){this.searchInputElement.removeEventListener("keydown",this._preventSubmissionListener),this.searchInputElement.removeEventListener("input",this._onInputListener),this.documentDelegate.off()}},{key:"_attachListeners",value:function(){this._preventSubmissionListener=this._preventSubmission.bind(this),this._onInputListener=this._debounce(this._onInput.bind(this),250),this.searchInputElement.addEventListener("keydown",this._preventSubmissionListener),this.searchInputElement.addEventListener("input",this._onInputListener),this.documentDelegate.on("click",'[data-action="clear-search"]',this._clearSearch.bind(this))}},{key:"_clearSearch",value:function(){var _this2=this;this.searchInputElement.value="",this._resetSearch(this),this.searchCloseElement.classList.add("d-none")}},{key:"_preventSubmission",value:function(event){event.keyCode===13&&window.theme.searchMode!=="product"&&event.preventDefault()}},{key:"_onInput",value:function(event){var _this3=this;if(event.keyCode!==13){if(this.lastInputValue=event.target.value,this.lastInputValue===""){this._resetSearch();return}var queryOptions={method:"GET",credentials:"same-origin"},queries=[fetch("".concat(window.routes.searchUrl,"?section_id=cuyana-predictive-search&q=").concat(encodeURIComponent(this.lastInputValue),"&options[prefix]=last&type=product"),queryOptions)];window.theme.searchMode!=="product"&&queries.push(fetch("".concat(window.routes.searchUrl,"?section_id=cuyana-predictive-search&q=").concat(encodeURIComponent(this.lastInputValue),"&options[prefix]=last&type=").concat(window.theme.searchMode.replace("product,","")),queryOptions)),this.queryMap[this.lastInputValue]=!0,document.dispatchEvent(new CustomEvent("theme:loading:start")),Promise.all(queries).then(function(responses){_this3.lastInputValue===event.target.value&&(delete _this3.queryMap[event.target.value],Promise.all(responses.map(function(response){return response.text()})).then(function(contents){window.theme.searchMode==="product"?_this3.searchResultsElement.innerHTML=contents[0]:_this3.searchResultsElement.innerHTML=`<div class="PageLayout PageLayout--breakLap">
13              <div class="PageLayout__Section">`.concat(contents[0],`</div>
14              <div class="PageLayout__Section PageLayout__Section--secondary">`).concat(contents[1],`</div>
15            </div>`),_this3.searchCloseElement.classList.remove("d-none"),_this3.searchResultsElement.setAttribute("aria-hidden","false")}),document.dispatchEvent(new CustomEvent("theme:loading:end")))})}}},{key:"_resetSearch",value:function(){window.theme.searchMode==="product"?this.searchResultsElement.innerHTML="":this.searchResultsElement.innerHTML=`<div class="PageLayout PageLayout--breakLap">
16              <div class="PageLayout__Section"></div>
17              <div class="PageLayout__Section PageLayout__Section--secondary"></div>
18            </div>`,this.searchResultsElement.setAttribute("aria-hidden","true"),document.dispatchEvent(new CustomEvent("theme:loading:end"))}},{key:"_debounce",value:function(fn,delay){var _this4=this,timer=null;return function(){for(var _len=arguments.length,args=new Array(_len),_key=0;_key<_len;_key++)args[_key]=arguments[_key];clearTimeout(timer),timer=setTimeout(function(){fn.apply(_this4,args)},delay)}}}]),NavSearchBar2})(),CountrySelector=(function(){function CountrySelector2(countrySelect,provinceSelect){_classCallCheck(this,CountrySelector2),this.countrySelect=countrySelect,this.provinceSelect=provinceSelect,this.countrySelect&&this.provinceSelect&&(this._attachListeners(),this._initSelectors())}return _createClass(CountrySelector2,[{key:"destroy",value:function(){this.countrySelect&&this.countrySelect.removeEventListener("change",this._onCountryChangedListener)}},{key:"_initSelectors",value:function(){var defaultCountry=this.countrySelect.getAttribute("data-default");if(defaultCountry){for(var i=0;i!==this.countrySelect.options.length;++i)if(this.countrySelect.options[i].text===defaultCountry){this.countrySelect.selectedIndex=i;break}}else this.countrySelect.selectedIndex=0;var event=new Event("change",{bubbles:!0});this.countrySelect.dispatchEvent(event);var defaultProvince=this.provinceSelect.getAttribute("data-default");if(defaultProvince){for(var _i=0;_i!==this.provinceSelect.options.length;++_i)if(this.provinceSelect.options[_i].text===defaultProvince){this.provinceSelect.selectedIndex=_i;break}}}},{key:"_attachListeners",value:function(){this._onCountryChangedListener=this._onCountryChanged.bind(this),this.countrySelect.addEventListener("change",this._onCountryChangedListener)}},{key:"_onCountryChanged",value:function(){var _this=this,selectedOption=this.countrySelect.options[this.countrySelect.selectedIndex],provinces=JSON.parse(selectedOption.getAttribute("data-provinces")||"[]");if(this.provinceSelect.innerHTML="",provinces.length===0){this.provinceSelect.parentNode.style.display="none";return}
18provinces.forEach(function(data){_this.provinceSelect.options.add(new Option(data[1],data[0]))}),this.provinceSelect.parentNode.style.display="block"}}]),CountrySelector2})(),ShippingEstimator=(function(){function ShippingEstimator2(element){_classCallCheck(this,ShippingEstimator2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.countrySelector=new CountrySelector(this.element.querySelector('[name="country"]'),this.element.querySelector('[name="province"]')),this._attachListeners()}return _createClass(ShippingEstimator2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.countrySelector.destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".ShippingEstimator__Submit",this._fetchRates.bind(this))}},{key:"_fetchRates",value:function(){var _this=this,country=this.element.querySelector('[name="country"]').value,province=this.element.querySelector('[name="province"]').value,zip=this.element.querySelector('[name="zip"]').value;document.dispatchEvent(new CustomEvent("theme:loading:start")),fetch("".concat(window.routes.cartUrl,"/shipping_rates.json?shipping_address[zip]=").concat(zip,"&shipping_address[country]=").concat(country,"&shipping_address[province]=").concat(province),{credentials:"same-origin",method:"GET"}).then(function(response){response.json().then(function(result){document.dispatchEvent(new CustomEvent("theme:loading:end"));var resultsContainer=_this.element.querySelector(".ShippingEstimator__Results"),errorContainer=_this.element.querySelector(".ShippingEstimator__Error");if(response.ok){var shippingRates=result.shipping_rates;if(shippingRates.length===0)resultsContainer.innerHTML="<p>".concat(window.languages.shippingEstimatorNoResults,"</p>");else{var html="";shippingRates.length===1?html+="<p>".concat(window.languages.shippingEstimatorOneResult,"</p><ul>"):html+="<p>".concat(window.languages.shippingEstimatorMoreResults.replace("{{count}}",shippingRates.length),"</p><ul>"),shippingRates.forEach(function(item){html+="<li>".concat(item.name,": ").concat(Currency.formatMoney(item.price,window.theme.moneyFormat),"</li>")}),html+="</ul>",resultsContainer.firstElementChild.innerHTML=html}TweenLite.fromTo(resultsContainer.firstElementChild,.6,{autoAlpha:0,y:-15},{autoAlpha:1,y:0,delay:.35}),errorContainer.style.display="none",resultsContainer.style.display="block",Animation.slideDown(resultsContainer)}else{var errorHtml="";Object.keys(result).forEach(function(key){errorHtml+='<li class="Alert__ErrorItem">'.concat(key," ").concat(result[key],"</li>")}),errorContainer.innerHTML='<ul class="Alert__ErrorList">'.concat(errorHtml,"</ul>"),resultsContainer.style.display="none",errorContainer.style.display="block"}})})}}]),ShippingEstimator2})(),AddressesSection=function AddressesSection2(){var _this=this;_classCallCheck(this,AddressesSection2),this.countrySelectors=[],Dom.nodeListToArray(document.querySelectorAll(".Modal--address")).forEach(function(modal){_this.countrySelectors.push(new CountrySelector(modal.querySelector('[name="address[country]"]'),modal.querySelector('[name="address[province]"]')))})},AnnouncementSection=(function(){function AnnouncementSection2(container){_classCallCheck(this,AnnouncementSection2),this.element=container;const rotationDelaySeconds=parseFloat(this.element.dataset.rotationDelay);var announcements,privateSaleActiveSet=!1,privateAnnouncements=this.element.querySelectorAll(".AnnouncementBar__Content.n4u");if(privateAnnouncements.length&&checkPrivateSale(!0)?(announcements=Array.from(this.element.querySelectorAll(".AnnouncementBar__Content")),announcements=announcements.filter(el=>el.classList.contains("n4u")?(el.classList.remove("n4u"),privateSaleActiveSet||(el.classList.add("active"),privateSaleActiveSet=!0),!0):(el.remove(),!1))):announcements=this.element.querySelectorAll(".AnnouncementBar__Content:not(.n4u)"),announcements.length>1&&rotationDelaySeconds){let currentIndex=0;setInterval(()=>{announcements[currentIndex].classList.remove("active"),currentIndex=(currentIndex+1)%announcements.length,announcements[currentIndex].classList.add("active")},rotationDelaySeconds*1e3)}}return _createClass(AnnouncementSection2,[{key:"onUnload",value:function(){}}]),AnnouncementSection2})(),ArticleList=(function(){function ArticleList2(container){var _this=this;_classCallCheck(this,ArticleList2),this.element=container,window.theme.showElementStaggering&&(this.timeline=new TimelineLite({delay:window.theme.showPageTransition?.5:0}),this.intersectionObserver=new IntersectionObserver(this._reveal.bind(this)),Dom.nodeListToArray(this.element.querySelectorAll(".ArticleItem")).forEac
18h(function(item){_this.intersectionObserver.observe(item)}))}return _createClass(ArticleList2,[{key:"onUnload",value:function(){window.theme.showElementStaggering&&(this.intersectionObserver.disconnect(),this.timeline.kill())}},{key:"_reveal",value:function(results){var _this2=this,toReveal=[];results.forEach(function(result){(result.isIntersecting||result.intersectionRatio>0)&&(toReveal.push(result.target),_this2.intersectionObserver.unobserve(result.target))}),toReveal.length!==0&&this.timeline.staggerFromTo(toReveal,.45,{autoAlpha:0,y:30},{autoAlpha:1,y:0},.2)}}]),ArticleList2})(),ArticleSection=(function(){function ArticleSection2(container){var _this=this;_classCallCheck(this,ArticleSection2),this.element=container,this.toolbarElement=this.element.querySelector(".ArticleToolbar"),this.articleNavElement=this.element.querySelector(".ArticleNav");var articleImageElement=this.element.querySelector(".Article__Image");articleImageElement&&window.matchMedia("(-moz-touch-enabled: 0), (hover: hover)").matches&&(this.parallaxInstance=new Rellax(".Article__Image",{speed:-7,center:!1,round:!0})),window.theme.showElementStaggering&&(this.timeline=new TimelineLite({delay:window.theme.showPageTransition?.5:0}),this.intersectionObserver=new IntersectionObserver(this._reveal.bind(this)),Dom.nodeListToArray(this.element.querySelectorAll(".ArticleItem")).forEach(function(item){_this.intersectionObserver.observe(item)})),this._attachListeners()}return _createClass(ArticleSection2,[{key:"onUnload",value:function(){this.parallaxInstance&&this.parallaxInstance.destroy(),window.theme.showElementStaggering&&(this.intersectionObserver.disconnect(),this.timeline.kill()),window.removeEventListener("scroll",this._onScrollListener)}},{key:"_attachListeners",value:function(){this._onScrollListener=this._checkToolbarVisibility.bind(this),window.addEventListener("scroll",this._onScrollListener)}},{key:"_checkToolbarVisibility",value:function(){var _this2=this,lastYPosition=0,headerHeight=0,navBottom=0,isFixedHeader=0,header=document.querySelector(".Header");fastdom.measure(function(){lastYPosition=window.pageYOffset,headerHeight=header.offsetHeight,isFixedHeader=parseInt(window.getComputedStyle(document.body).getPropertyValue("--use-sticky-header")||0),_this2.articleNavElement&&(navBottom=_this2.articleNavElement.offsetTop+_this2.articleNavElement.clientHeight-headerHeight)}),fastdom.mutate(function(){_this2.toolbarElement.style.top=isFixedHeader?headerHeight+"px":null,_this2.articleNavElement?lastYPosition>150&&_this2.articleNavElement&&lastYPosition<navBottom?_this2.toolbarElement.classList.add("is-visible"):_this2.toolbarElement.classList.remove("is-visible"):lastYPosition>150?_this2.toolbarElement.classList.add("is-visible"):_this2.toolbarElement.classList.remove("is-visible")})}},{key:"_reveal",value:function(results){var _this3=this,toReveal=[];results.forEach(function(result){(result.isIntersecting||result.intersectionRatio>0)&&(toReveal.push(result.target),_this3.intersectionObserver.unobserve(result.target))}),toReveal.length!==0&&this.timeline.staggerFromTo(toReveal,.45,{autoAlpha:0,y:30},{autoAlpha:1,y:0},.2)}}]),ArticleSection2})(),CartSection=(function(){function CartSection2(container){_classCallCheck(this,CartSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.documentDelegate=new domDelegate.Delegate(document.documentElement),this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this.itemCount=this.options.itemCount,this.isCartNoteOpen=!1,this.giftboxUpdateInProgress=!1,this.srAnnouncements=document.querySelector("#srAnnouncements"),this.productMonogramming=null;var monogrammingModal=document.querySelector("#monogrammingModal");monogrammingModal&&(this.productMonogramming=new ProductMonogrammingSection(monogrammingModal,!0)),this.options.drawer&&(this.sidebarDrawer=new Drawer(this.element,{onClose:this._onDrawerClosed.bind(this)})),this.options.hasShippingEstimator&&(this.shippingEstimator=new ShippingEstimator(this.element.querySelector(".ShippingEstimator"))),this._removeOrphanedNonUUIDItems(),this._removeOrphanedItems(),this._attachListeners()}return _createClass(CartSection2,[{key:"onUnload",value:function(){this.options.hasShippingEstimator&&this.shippingEstimator.destroy(),this.delegateElement.off(),document.removeEventListener("product:added",this._onProductAddedListener)}},{key:"_attachListeners",value:function(){this._onProductAddedListener=this._onProductAdded.bind(this),this.delegateElement.on("change","#cart-note",this._updateCartNote.bind(this)),this.options.type!=="page"?(this.delegateElement.on("click",'[data-action="update-item-quantity"], [data-action="remove-item"]',this._updateItemQuantity.bind(this)),this.delegateElement.on("change",".QuantitySelector__CurrentQuantity",this._updateItemQuantity.bind(this)),this.delegateElement.on("change",".CartItem__GiftBoxCheckbox",this._addGiftboxC
18hecked.bind(this))):this.delegateElement.on("change",".QuantitySelector__CurrentQuantity",this._reloadPageWithQuantity.bind(this)),this.options.drawer&&this.delegateElement.on("click",'[data-action="toggle-cart-note"]',this._toggleCartNote.bind(this)),this.delegateElement.on("click",'[data-bs-target="#monogrammingModal"]',this._openMonogramming.bind(this)),this.delegateElement.on("click",".removeProductMonograming",this._removeMonogramming.bind(this)),document.addEventListener("product:added",this._onProductAddedListener),this.documentDelegate.on("cart:refresh",this._rerenderCart.bind(this,!1))}},{key:"_updateCartNote",value:function(event,target){fetch("".concat(window.routes.cartUrl,"/update.js"),{body:JSON.stringify({note:target.value}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}},{key:"_openMonogramming",value:function(event){this.sidebarDrawer.close()}},{key:"_removeMonogramming",value:function(event){event.preventDefault(),event.stopPropagation();var cartItemDiv=event.target.closest(".CartItem");cartItemDiv&&(this.productMonogramming.parentItemUuid=cartItemDiv.getAttribute("data-item-uuid"),this.productMonogramming.parentItemKey=cartItemDiv.getAttribute("data-item-key"),this.productMonogramming.removeMonogrammingFromProduct())}},{key:"_toggleCartNote",value:function(){var _this=this,noteContainer=this.element.querySelector(".Cart__OffscreenNoteContainer"),cartNote=this.element.querySelector("#cart-note");if(this.element.classList.toggle("has-note-open"),this.element.querySelector(".Cart__NoteButton").innerHTML=cartNote.value!==""?window.languages.cartEditNote:window.languages.cartAddNote,noteContainer.setAttribute("aria-hidden",noteContainer.getAttribute("aria-hidden")==="true"?"false":"true"),this.isCartNoteOpen=noteContainer.getAttribute("aria-hidden")==="false",this.element.classList.contains("has-note-open")){var transitionEndListener=function transitionEndListener2(){_this.element.querySelector("#cart-note").focus(),noteContainer.removeEventListener("transitionend",transitionEndListener2)};noteContainer.addEventListener("transitionend",transitionEndListener)}}},{key:"_removeOrphanedNonUUIDItems",value:async function(){const itemContainer=document.querySelector(".Cart__ItemList");if(itemContainer){const hiddenItems=Array.from(itemContainer.querySelectorAll('.CartItem.d-none[data-parent-uuid=""]'));let updates={};hiddenItems.forEach(item=>{let isGiftbox=item.dataset.isGiftbox,lineGroup=item.dataset.lineGroup,itemKey=item.dataset.itemKey;const parentItem=itemContainer.querySelector(`.CartItem:not(.d-none)[data-line-group="${lineGroup}"]`);(isGiftbox=="true"||lineGroup!=""&&!parentItem)&&(updates[itemKey]="0")}),document.dispatchEvent(new CustomEvent("theme:loading:start"));try{const response=await fetch(`${window.routes.cartUpdateUrl}.js`,{body:JSON.stringify({updates}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);this._rerenderCart(),document.dispatchEvent(new CustomEvent("theme:loading:end"))}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"))}}}},{key:"_removeOrphanedItems",value:async function(){const itemContainer=document.querySelector(".Cart__ItemList");if(itemContainer){const hiddenItems=Array.from(itemContainer.querySelectorAll(".CartItem.d-none[data-parent-uuid]")),_this=this;let removals=!1;try{for(const card of hiddenItems){const uuid=card.dataset.parentUuid,parentItem=itemContainer.querySelector(`.CartItem:not(.d-none)[data-item-uuid="${uuid}"]`);uuid!=""&&!parentItem&&(removals=!0,await _this._updateCartItem(card.dataset.itemKey,null,0))}removals&&window.location.reload(!0)}catch(error){console.error("A request failed:",error)}}}},{key:"_updateItemQuantity",value:async function(event,target){event.preventDefault();const item=target.closest(".CartItem"),lineGroup=item.dataset.lineGroup,uuid=item.dataset.itemUuid,productName=item.querySelector(".CartItem__Title a")?.textContent,itemContainer=item.closest(".Cart__ItemList"),quantity=target.tagName==="INPUT"?parseInt(target.value):target.dataset.quantity;let updates={},itemArray=[];uuid&&(itemArray=Array.from(itemContainer.querySelectorAll(`.CartItem[data-parent-uuid="${uuid}"]`))),itemArray.unshift(item),itemArray.forEach(item2=>{let itemKey=item2.dataset.itemKey;updates[itemKey]=quantity}),uuid||Array.from(itemContainer.querySelectorAll(`.CartItem.d-none[data-line-group="${lineGroup}
18"]`)).forEach(hiddenItem=>{let itemKey=hiddenItem.dataset.itemKey;updates[itemKey]="0"}),document.dispatchEvent(new CustomEvent("theme:loading:start"));try{const response=await fetch(`${window.routes.cartUpdateUrl}.js`,{body:JSON.stringify({updates}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}});if(!response.ok)throw new Error(`HTTP error! status: ${response.status}`);this._rerenderCart(),document.dispatchEvent(new CustomEvent("theme:loading:end")),quantity==0?this.srAnnouncements.textContent=`The item ${productName} has been removed from your cart.`:this.srAnnouncements.textContent=`The item ${productName} quantity has been updated to ${quantity}`}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"))}}},{key:"_updateCartItem",value:function(key,properties=null,quantity=null){let payload={id:key};return properties!==null&&(payload.properties=properties),quantity!==null&&(payload.quantity=quantity),fetch(`${window.routes.cartChangeUrl}.js`,{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}},{key:"_addGiftboxItem",value:function(parent_item_key,id,quantity,properties){return fetch(`${window.routes.cartAddUrl}.js`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({id,quantity,parent_line_key:parent_item_key,properties})})}},{key:"_addGiftboxChecked",value:async function(event,target){if(this.giftboxUpdateInProgress){event.preventDefault();return}let parentItem=target.closest(".CartItem"),lineGroup=parentItem.dataset.lineGroup,uuid=parentItem.dataset.itemUuid,parentItemProperties=JSON.parse(parentItem.dataset.lineProperties||"{}");const parentQuantity=parseInt(parentItem.querySelector(".QuantitySelector__CurrentQuantity").value)||1;if(document.dispatchEvent(new CustomEvent("theme:loading:start")),this.giftboxUpdateInProgress=!0,event.target.checked){var addedText=target.getAttribute("data-added");if(event.target.parentElement.querySelector("label").innerText=addedText,document.dispatchEvent(new CustomEvent("theme:loading:start")),!lineGroup)try{lineGroup=await _generateLineGroupID(),parentItemProperties={...parentItemProperties,_line_group:lineGroup}}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"));return}if(!uuid)try{const currentDate=new Date;uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3),parentItem.dataset.itemUuid=uuid,parentItemProperties={...parentItemProperties,_uuid:uuid}}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"));return}try{let giftBoxUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);const giftboxProperties={_is_giftbox:!0,_line_group:lineGroup,_uuid:giftBoxUuid,_parent_uuid:uuid,_hidden:!0,is_final_sale:!0,_LPROP:"no-returns"};await this._addGiftboxItem(parentItem.dataset.itemKey,parentItem.dataset.giftboxId,parentQuantity,giftboxProperties),await this._updateCartItem(parentItem.dataset.itemKey,{...parentItemProperties,_is_giftwrapped:!0},parentQuantity)}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"));return}}else{var addText=target.getAttribute("data-add");event.target.parentElement.querySelector("label").innerText=addText;
18try{let ParentItemkey=parentItem.dataset.itemKey;const giftBoxElement=document.querySelector('.CartItem[data-is-giftbox="true"][data-parent-uuid="'+uuid+'"]');if(giftBoxElement){const giftboxKey=giftBoxElement.dataset.itemKey,updateCartResponse=await this._updateCartItem(giftboxKey,null,0).then(response=>response.json());if(updateCartResponse&&updateCartResponse.items){const matchingItem=updateCartResponse.items.find(item=>item.properties._uuid===uuid);matchingItem&&(ParentItemkey=matchingItem.key)}}parentItemProperties._is_giftwrapped=!1,await this._updateCartItem(ParentItemkey,parentItemProperties,parentQuantity)}catch(error){console.error("A request failed:",error),document.dispatchEvent(new CustomEvent("theme:loading:end"));return}}this.giftboxUpdateInProgress=!1,this._rerenderCart(),document.dispatchEvent(new CustomEvent("theme:loading:end"))}},{key:"_reloadPageWithQuantity",value:function(event,target){window.location.href="".concat(window.routes.cartChangeUrl,"?quantity=").concat(parseInt(target.value),"&line=").concat(target.getAttribute("data-line"))}},{key:"_onProductAdded",value:function(event){var _this3=this;this.itemCount+=event.detail.quantity,this._rerenderCart().then(function(){_this3.sidebarDrawer.open()});const productName=event?.detail?.variant?.name;this.srAnnouncements.textContent=`The item ${productName} has been added to your cart.`}},{key:"_onDrawerClosed",value:function(){this.isCartNoteOpen&&this._toggleCartNote()}},{key:"_rerenderCart",value:function(elementToAnimate){var _this4=this;return fetch("".concat(window.routes.cartUrl,"?section_id=").concat(this.options.drawer&&window.theme.pageType!=="cart"?"mini-cart":"main-cart","&timestamp=").concat(Date.now()),{credentials:"same-origin",method:"GET"}).then(function(content){if(_this4.options.drawer&&elementToAnimate){var timelineLite=new TimelineLite({onComplete:function(){content.text().then(function(html){_this4._replaceContent(html)})}});timelineLite.to(elementToAnimate,.5,{height:0,opacity:0,ease:Cubic.easeOut},0),_this4.itemCount===0&&timelineLite.to(_this4.element.querySelector(".Drawer__Footer"),.5,{y:"100%",transition:"none",ease:Cubic.easeInOut},0)}else content.text().then(function(html){_this4._replaceContent(html)})})}},{key:"_replaceContent",value:function(html){var _this5=this,tempElement=document.createElement("div");tempElement.innerHTML=html,typeof window.cuyFilterCartWallets=="function"&&window.cuyFilterCartWallets(tempElement);var cartSectionElement=tempElement.querySelector('[data-section-type="cart"]');if(cartSectionElement){var cartResult=JSON.parse(cartSectionElement.getAttribute("data-section-settings")||"[]");this.itemCount=cartResult.itemCount;var cartNodeParent=this.element.querySelector(".Cart")?this.element.querySelector(".Cart").parentNode:null;if(this.options.drawer&&window.theme.pageType!=="cart"){var currentScrollPosition=this.element.querySelector(".Drawer__Main").scrollTop;cartNodeParent&&cartNodeParent.replaceChild(tempElement.querySelector(".Cart"),this.element.querySelector(".Cart")),this.element.querySelector(".Drawer__Main").scrollTop=currentScrollPosition}else this.itemCount===0?this.element.innerHTML=tempElement.querySelector(".shopify-section").firstElementChild.innerHTML:(cartNodeParent.replaceChild(tempElement.querySelector(".Cart"),this.element.querySelector(".Cart")),this.element.querySelector(".PageHeader").innerHTML=tempElement.querySelector(".PageHeader").innerHTML);window.Shopify&&Shopify.PaymentButton&&typeof Shopify.PaymentButton.init=="function"&&Shopify.PaymentButton.init();var cartDot=Dom.nodeListToArray(document.querySelectorAll(".Header__CartDot")),cartQuantity=Dom.nodeListToArray(document.querySelectorAll(".Header__CartCount"));cartDot.forEach(function(item){_this5.itemCount===0?item.classList.remove("is-visible"):item.classList.add("is-visible")}),cartQuantity.forEach(function(item){item.textContent=_this5.itemCount})}}}]),CartSection2})(),CollectionListSection=(function(){function CollectionListSection2(container){_classCallCheck(this,CollectionListSection2),this.element=container;var collectionListElement=this.element.querySelector("[data-flickity-config]");collectionListElement&&(this.carousel=new Carousel(collectionListElement))}return _createClass(CollectionListSection2,[{key:"onUnload",value:function(){this.carousel&&this.carousel.destroy()}},{key:"onBlockSelect",value:function(event){this.carousel&&this.carousel.selectCell(event.target.getAttribute("data-sli
18de-index"),!0,!event.detail.load)}},{key:"onBlockDeselect",value:function(){this.carousel&&this.carousel.unpausePlayer()}}]),CollectionListSection2})(),OverflowScroller=(function(){function OverflowScroller2(element){_classCallCheck(this,OverflowScroller2),element&&(this.element=element,this.lastKnownY=window.scrollY,this.currentTop=0,this.initialTopOffset=parseInt(window.getComputedStyle(this.element).top),this._attachListeners())}return _createClass(OverflowScroller2,[{key:"destroy",value:function(){window.removeEventListener("scroll",this._checkPositionListener)}},{key:"_attachListeners",value:function(){this._checkPositionListener=this._checkPosition.bind(this),window.addEventListener("scroll",this._checkPositionListener)}},{key:"_checkPosition",value:function(){var _this=this;fastdom.measure(function(){var bounds=_this.element.getBoundingClientRect(),maxTop=bounds.top+window.scrollY-_this.element.offsetTop+_this.initialTopOffset,minTop=_this.element.clientHeight-window.innerHeight;window.scrollY<_this.lastKnownY?_this.currentTop-=window.scrollY-_this.lastKnownY:_this.currentTop+=_this.lastKnownY-window.scrollY,_this.currentTop=Math.min(Math.max(_this.currentTop,-minTop),maxTop,_this.initialTopOffset),_this.lastKnownY=window.scrollY}),fastdom.mutate(function(){_this.element.style.top="".concat(_this.currentTop,"px")})}}]),OverflowScroller2})(),CollectionSection=(function(){function CollectionSection2(element){_classCallCheck(this,CollectionSection2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.toolbarElement=this.element.querySelector(".CollectionToolbar"),this.collectionInnerElement=this.element.querySelector(".CollectionInner__Products"),this.settings=JSON.parse(this.element.getAttribute("data-section-settings")||"[]");var sortPopoverElement=document.getElementById("collection-sort-popover");sortPopoverElement&&(this.sortPopover=new Popover(sortPopoverElement,{onValueChanged:this._sortByChanged.bind(this),fitToViewport:!0})),this.clearFiltersElement=this.element.querySelector(".Clear_Active_Filters");var filterDrawerElement=document.getElementById("collection-filter-drawer");filterDrawerElement&&(this.filterDrawer=new Drawer(filterDrawerElement)),this.settings.filterPosition==="sidebar"&&(this.filterInnerSidebarScroller=new OverflowScroller(this.element.querySelector(".CollectionInner__Sidebar")));const collectionLevel2Link=document.getElementById("collection-level2-links"),subCollections=document.getElementById("sub-collections");collectionLevel2Link&&subCollections&&(subCollections.innerHTML=collectionLevel2Link.innerHTML);var collectionImageElement=this.element.querySelector(".PageHeader__ImageWrapper");collectionImageElement&&window.matchMedia("(-moz-touch-enabled: 0), (hover: hover)").matches&&(this.parallaxInstance=new Rellax(".PageHeader__ImageWrapper",{speed:-7,center:!1,round:!0})),this.timeline=new TimelineLite({delay:window.theme.showPageTransition?.5:0}),this._setupAnimation(),this._attachListeners()}return _createClass(CollectionSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.sortPopover&&this.sortPopover.destroy(),this.filterDrawer&&this.filterDrawer.destroy(),this.filterInnerSidebarScroller&&this.filterInnerSidebarScroller.destroy(),this.parallaxInstance&&this.parallaxInstance.destroy(),window.theme.showElementStaggering&&(this.intersectionObserver.disconnect(),this.timeline.kill())}},{key:"_setupAnimation",value:function(){var _this=this,forceLoadFromTop=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1;window.theme.showElementStaggering&&(this.intersectionObserver&&this.intersectionObserver.disconnect(),forceLoadFromTop?(this.timeline.clear(),this.timeline.staggerFromTo(this.element.querySelectorAll(".ProductList .ProductItem, .ArticleList .ArticleItem"),.25,{autoAlpha:0,y:25},{autoAlpha:1,y:0},.1)):(this.intersectionObserver=new IntersectionObserver(this._reveal.bind(this),{threshold:.3}),Dom.nodeListToArray(this.element.querySelectorAll(".ProductList .ProductItem, .ArticleList .ArticleItem")).forEach(function(item){_this.intersectionObserver.observe(item)})))}},{key:"_reveal",value:function(results){var _this2=this,toReveal=[];
18results.forEach(function(result){(result.isIntersecting||result.intersectionRatio>0)&&(toReveal.push(result.target),_this2.intersectionObserver.unobserve(result.target))}),toReveal.length!==0&&this.timeline.staggerFromTo(toReveal,.35,{autoAlpha:0,y:25},{autoAlpha:1,y:0},.15)}},{key:"_changeLayoutMode",value:function(event,target){var _this3=this,layoutType=target.getAttribute("data-grid-type"),newCount=parseInt(target.getAttribute("data-count")),productList=this.collectionInnerElement.querySelector(".ProductList");if(productList){var previousCount=parseInt(productList.getAttribute("data-".concat(layoutType,"-count")));if(previousCount===newCount)return;productList.setAttribute("data-".concat(layoutType,"-count"),newCount),Dom.nodeListToArray(productList.querySelectorAll(".Grid__Cell")).forEach(function(item){if(layoutType==="mobile")item.classList.remove("1/".concat(previousCount,"--phone")),item.classList.add("1/".concat(newCount,"--phone"));else{var previousTabletCount=previousCount===2?2:3,newTabletCount=newCount===2?2:3;_this3.settings.filterPosition==="drawer"?(item.classList.remove("1/".concat(previousCount,"--lap-and-up")),item.classList.add("1/".concat(newCount,"--lap-and-up"))):(item.classList.remove("1/".concat(previousCount,"--desk")),item.classList.add("1/".concat(newCount,"--desk"))),item.classList.remove("1/".concat(previousTabletCount,"--tablet-and-up")),item.classList.add("1/".concat(newTabletCount,"--tablet-and-up"))}window.theme.showElementStaggering&&(item.firstElementChild.style.visibility="hidden")}),lazySizes.autoSizer.checkElems()}target.classList.add("is-active"),Dom.getSiblings(target)[0].classList.remove("is-active"),this._setupAnimation(),fetch("".concat(window.routes.cartUrl,"/update.js"),{body:JSON.stringify({attributes:_defineProperty({},"collection_".concat(layoutType,"_items_per_row"),newCount)}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}})}},{key:"_sortByChanged",value:function(sortBy){var currentUrl=new URL(location.href);currentUrl.searchParams.set("sort_by",sortBy),currentUrl.searchParams.delete("page"),this._reloadProducts(currentUrl.toString())}},{key:"_onFiltersCleared",value:function(event){this._reloadProducts(event.target.getAttribute("data-url")),this.clearFiltersElement?.classList.add("d-none")}},{key:"_onFilterChanged",value:function(event){var formData=new FormData(event.target.closest("form")),searchParamsAsString=new URLSearchParams(formData).toString();console.log(searchParamsAsString),searchParamsAsString.includes("filter")?this.clearFiltersElement?.classList.remove("d-none"):this.clearFiltersElement?.classList.add("d-none"),this._reloadProducts("".concat(window.location.pathname,"?").concat(searchParamsAsString))}},{key:"_reloadProducts",value:function(url){var _this4=this;this.abortController&&this.abortController.abort(),document.dispatchEvent(new CustomEvent("theme:loading:start")),history.replaceState&&window.history.pushState({path:url},"",url);var currentUrl=new URL(window.location);currentUrl.searchParams.set("section_id",this.settings.sectionId);try{this.abortController=new AbortController,fetch(currentUrl.toString(),{signal:this.abortController.signal}).then(function(response){response.text().then(function(content){var tempElement=document.createElement("div");tempElement.innerHTML=content,_this4.collectionInnerElement.innerHTML=tempElement.querySelector(".CollectionInner__Products").innerHTML;var toolbarFilter=tempElement.querySelector(".CollectionToolbar__Item--filter");if(toolbarFilter){var newToolbarFilter=_this4.element.querySelector(".CollectionToolbar__Item--filter");newToolbarFilter.innerHTML=toolbarFilter.innerHTML,newToolbarFilter.className=toolbarFilter.className}var collectionFiltersDrawer=_this4.element.querySelector("#collection-filters-drawer-form"),collectionFiltersSidebar=_this4.element.querySelector("#collection-filters-sidebar-form");if(collectionFiltersDrawer){var newDrawerContent=tempElement.querySelector("#collection-filters-drawer-form");Array.from(collectionFiltersDrawer.querySelectorAll(".Collapsible")).forEac
18h(function(collapsible){var newCollapsible=newDrawerContent.querySelector('[data-filter-index="'.concat(collapsible.getAttribute("data-filter-index"),'"]'));collapsible.firstElementChild.getAttribute("aria-expanded")==="true"&&(newCollapsible.style.overflow="visible",newCollapsible.firstElementChild.setAttribute("aria-expanded","true"),newCollapsible.lastElementChild.style.height="auto",newCollapsible.lastElementChild.style.overflow="visible")}),collectionFiltersDrawer.innerHTML=newDrawerContent.innerHTML}if(collectionFiltersSidebar){var newSidebarContent=tempElement.querySelector("#collection-filters-sidebar-form");Array.from(collectionFiltersSidebar.querySelectorAll(".Collapsible")).forEach(function(collapsible){var newCollapsible=newSidebarContent.querySelector('[data-filter-index="'.concat(collapsible.getAttribute("data-filter-index"),'"]'));collapsible.firstElementChild.getAttribute("aria-expanded")==="true"&&(newCollapsible.style.overflow="visible",newCollapsible.firstElementChild.setAttribute("aria-expanded","true"),newCollapsible.lastElementChild.style.height="auto",newCollapsible.lastElementChild.style.overflow="visible")}),collectionFiltersSidebar.innerHTML=newSidebarContent.innerHTML}checkPrivateSale(),document.dispatchEvent(new CustomEvent("theme:loading:end")),_this4._setupAnimation(!0);var elementOffset=_this4.element.querySelector(".CollectionMain").getBoundingClientRect().top-parseInt(document.documentElement.style.getPropertyValue("--header-height"));Responsive.matchesBreakpoint("lap-and-up")&&_this4.toolbarElement&&_this4.toolbarElement.clientHeight===0&&(elementOffset-=50),elementOffset<0&&window.scrollBy({top:elementOffset,behavior:"smooth"})})})}catch{}}},{key:"_handleScroll",value:function(){if(window.innerHeight+window.scrollY>=document.body.offsetHeight-1500&&!document.isLoadingMoreProducts){var loadMoreLink=document.querySelector("#load-more-products");if(loadMoreLink){document.isLoadingMoreProducts=!0,loadMoreLink.textContent="Loading ";var pagination=loadMoreLink.closest(".Pagination");pagination&&pagination.classList.add("is-loading"),fetch(loadMoreLink.href).then(response=>response.text()).then(html=>{var parser=new DOMParser,doc=parser.parseFromString(html,"text/html"),productListItems=doc.querySelector(".ProductList")?.children,productList=document.querySelector(".ProductList");productListItems&&Array.from(productListItems).forEach(element=>productList.appendChild(element)),checkPrivateSale();var newLoadMoreLink=doc.querySelector("#load-more-products");if(newLoadMoreLink)loadMoreLink.href=newLoadMoreLink.href;
18else{const loadMoreBlock=loadMoreLink.closest(".Pagination");loadMoreLink.remove(),loadMoreBlock.classList.add("m-5"),window.removeEventListener("scroll",this._handleScroll)}}).finally(()=>{pagination&&pagination.classList.remove("is-loading"),document.isLoadingMoreProducts=!1,loadMoreLink.textContent="Load More",document.dispatchEvent(new CustomEvent("collection:productsAppended"))})}}}},{key:"_attachListeners",value:function(){this._changeLayoutModeListener=this._changeLayoutMode.bind(this),this.delegateElement.on("click",'[data-action="change-layout-mode"]',this._changeLayoutModeListener),this.delegateElement.on("click",'[data-action="clear-filters"]',this._onFiltersCleared.bind(this)),this.delegateElement.on("change",'[name^="filter."]',this._onFilterChanged.bind(this)),this.scrollListener=window.addEventListener("scroll",this._handleScroll.bind(this)),document.isLoadingMoreProducts=!1,window.addEventListener("popstate",function(event){event.state.path&&(window.location.href=event.state.path)})}}]),CollectionSection2})(),FaqSection=(function(){function FaqSection2(element){_classCallCheck(this,FaqSection2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this._attachListeners()}return _createClass(FaqSection2,[{key:"onUnload",value:function(){this.delegateElement.off()}},{key:"onBlockSelect",value:function(event){this._openItem(event.target)}},{key:"onBlockDeselect",value:function(event){this._closeItem(event.target)}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".Faq__Question",this._toggleItem.bind(this)),this.delegateElement.on("click",".FaqSummary__Item",this._switchToCategory.bind(this))}},{key:"_switchToCategory",value:function(event,target){target.classList.add("is-active"),Dom.getSiblings(target,".is-active").forEach(function(item){item.classList.remove("is-active")})}},{key:"_toggleItem",value:function(event,target){var item=target.closest(".Faq__Item");item.getAttribute("aria-expanded")==="true"?this._closeItem(item):this._openItem(item)}},{key:"_openItem",value:function(item){var answerWrapper=item.querySelector(".Faq__AnswerWrapper");item.setAttribute("aria-expanded","true"),answerWrapper.setAttribute("aria-hidden","false"),Animation.slideDown(answerWrapper,!0),Dom.getSiblings(item,'[aria-expanded="true"]').forEach(function(siblingItem){var siblingAnswerWrapper=siblingItem.querySelector(".Faq__AnswerWrapper");siblingItem.setAttribute("aria-expanded","false"),siblingAnswerWrapper.setAttribute("aria-hidden","true"),Animation.slideUp(siblingAnswerWrapper)})}},{key:"_closeItem",value:function(item){var answerWrapper=item.querySelector(".Faq__AnswerWrapper");item.setAttribute("aria-expanded","false"),answerWrapper.setAttribute("aria-hidden","true"),Animation.slideUp(answerWrapper)}}]),FaqSection2})(),FeaturedCollectionsSection=(function(){function FeaturedCollectionsSection2(container){var _this=this;_classCallCheck(this,FeaturedCollectionsSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-settings")||"[]"),this.carousels=[],Dom.nodeListToArray(this.element.querySelectorAll("[data-flickity-config]")).forEach(function(item){_this.carousels.push(new Carousel(item))}),this._setupAnimation(),this._attachListeners()}return _createClass(FeaturedCollectionsSection2,[{key:"onUnload",value:function(){this.carousels.forEach(function(item){return item.destroy()}),this.delegateElement.off("click"),this.intersectionObserver.disconnect(),this.timeline.kill()}},{key:"onBlockSelect",value:function(event){this.element.querySelector('[aria-controls="'.concat(event.target.id,'"]')).click()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="toggle-tab"]',this._switchTab.bind(this))}},{key:"_switchTab",value:function(event,target){var _this2=this;if(!target.classList.contains("is-active")){target.classList.add("is-active"),Dom.getSiblings(target,".is-active").forEach(function(item){item.classList.remove("is-active")});var tabPanelToShow=this.element.querySelector("#".concat(target.getAttribute("aria-controls")));this.timeline.eventCallback("onReverseComplete",function(){tabPanelToShow.setAttribute("aria-hidden","false"),Dom.getSiblings(tabPanelToShow,'.TabPanel[aria-hidden="false"]').forEach(function(item){item.setAttribute("aria-hidden","true")}),Responsive.matchesBreakpoint("lap-and-up")&&_this2.carousels.forEac
18h(function(carousel){carousel.flickityInstance.activate(),carousel.flickityInstance.resize()}),_this2.timeline.clear(),_this2._setupAnimation()}),this.options.layout==="grid"&&window.theme.showElementStaggering?this.timeline.reverse().timeScale(3):this.timeline.reverse()}}},{key:"_setupAnimation",value:function(){var _this3=this;if(this.intersectionObserver&&this.intersectionObserver.disconnect(),this.timeline=new TimelineLite({delay:.5}),this.options.layout==="grid"&&window.theme.showElementStaggering)this.intersectionObserver=new IntersectionObserver(this._reveal.bind(this)),Dom.nodeListToArray(this.element.querySelectorAll('.TabPanel[aria-hidden="false"] .ProductList .ProductItem')).forEach(function(item){_this3.intersectionObserver.observe(item)});else{var productList=this.element.querySelector('.TabPanel[aria-hidden="false"] .ProductList');productList&&this.timeline.fromTo(productList,.6,{autoAlpha:0,y:25},{autoAlpha:1,y:0})}}},{key:"_reveal",value:function(results){var _this4=this,toReveal=[];results.forEach(function(result){(result.isIntersecting||result.intersectionRatio>0)&&(toReveal.push(result.target),_this4.intersectionObserver.unobserve(result.target))}),toReveal.length!==0&&this.timeline.staggerFromTo(toReveal,.45,{autoAlpha:0,y:25},{autoAlpha:1,y:0},.2)}}]),FeaturedCollectionsSection2})(),FeaturedProductSection=(function(){function FeaturedProductSection2(container){_classCallCheck(this,FeaturedProductSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this.options.usePlaceholder||(this.productVariants=new ProductVariants(container,this.options));var offscreenElement=this.element.querySelector(".Product__OffScreen");offscreenElement&&this.element.appendChild(offscreenElement),this._attachListeners()}return _createClass(FeaturedProductSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productVariants&&this.productVariants.destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("variant:changed",this._updateMainImage.bind(this))}},{key:"_updateMainImage",value:function(event){var variant=event.detail.variant,previousVariant=event.detail.previousVariant;if(!(!variant||!variant.featured_image||previousVariant.featured_image&&previousVariant.featured_image.id===variant.featured_image.id)){var newImage=variant.featured_image,mainImageContainer=this.element.querySelector(".FeaturedProduct__Gallery .AspectRatio");mainImageContainer.style.cssText="max-width: ".concat(newImage.width,"px; --aspect-ratio: ").concat(newImage.width/newImage.height);var newImageElement=document.createElement("img");newImageElement.classList.add("Image--lazyLoad"),newImageElement.setAttribute("data-src",Image.getSizedImageUrl(newImage.src,"1x1").replace("_1x1.","_{width}x.")),newImageElement.setAttribute("data-widths","[".concat(Image.getSupportedSizes(newImage,[200,400,600,700,800,900,1e3]).join(","),"]")),newImageElement.setAttribute("data-sizes","auto"),mainImageContainer.replaceChild(newImageElement,mainImageContainer.querySelector("img"))}}}]),FeaturedProductSection2})(),BackgroundVideoSection=(function(){function BackgroundVideoSection2(container){_classCallCheck(this,BackgroundVideoSection2),this.element=container,this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this._loadScript().then(this._setupPlayer.bind(this))}return _createClass(BackgroundVideoSection2,[{key:"_loadScript",value:function(){var _this=this;return new Promise(function(resolve,reject){var script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src=_this.options.videoType==="youtube"?"//www.youtube.com/iframe_api":"//player.vimeo.com/api/player.js"})}},{key:"onUnload",value:function(){this.player&&this.player.destroy()}},{key:"_setupPlayer",value:function(){var _this2=this,elementToInsert=this.element.querySelector(".ImageHero__VideoHolder"),playerLoadingInterval=setInterval(function(){_this2.options.videoType==="youtube"?window.YT&&(_this2.player=new YT.Player(elementToInsert,{videoId:_this2.options.videoId,playerVars:{showinfo:0,controls:0,fs:0,rel:0,height:"100%",width:"100%",iv_load_policy:3,html5:1,loop:1,playsinline:1,modestbranding:1,disablekb:1,origin:_this2.options.requestHost},events:{onReady:_this2._onYouTubeReady.bind(_this2),onStateChange:_this2._onYouTubeStateChange.bind(_this2)}}),clearInterval(playerLoadingInterval)):window.Vimeo&&(_this2.player=new Vimeo.Player(elementToInsert.parentNode,{id:_this2.options.videoId,autoplay:!0,autopause:!1,muted:!0,background:!0,loop:!0}),clearInterval(playerLoadingInterval))},50)}},{key:"_onYouTubeReady",value:function(event){this.player.mute(),this.player.playVideo()}},{key:"_onYouTubeStateChange",value:function(event){event.data===YT.PlayerState.ENDED&&this.player.playVideo()}}
18]),BackgroundVideoSection2})(),GiftCardSection=(function(){function GiftCardSection2(container){_classCallCheck(this,GiftCardSection2),this.element=container,this._createQrCode(),this._setupPrint()}return _createClass(GiftCardSection2,[{key:"_createQrCode",value:function(){var qrCodeElement=document.getElementById("QrCode");new QRCode(qrCodeElement,{text:qrCodeElement.getAttribute("data-identifier"),width:190,height:190})}},{key:"_setupPrint",value:function(){var printElement=document.getElementById("PrintGiftCard");printElement&&printElement.addEventListener("click",function(){window.print()})}}]),GiftCardSection2})(),HeaderSection=(function(){function HeaderSection2(container){var _this=this;_classCallCheck(this,HeaderSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this.lastScrollPosition=-1,this.isTouch=window.matchMedia("(-moz-touch-enabled: 1), (hover: none)").matches,this.pageOverlayElement=document.querySelector(".PageOverlay"),this.options.isSticky&&Stickyfill.addOne(this.element.parentNode),this.searchBar=new SearchBar,this._attachListeners(),this._verifyNavigationOverlap();var mainLogo=this.element.querySelector(".Header__LogoImage--primary");mainLogo&&!mainLogo.complete?mainLogo.addEventListener("load",function(){fastdom.measure(function(){document.documentElement.style.setProperty("--header-height",_this.element.clientHeight+"px"),document.documentElement.style.setProperty("--header-is-not-transparent",_this.options.hasTransparentHeader?0:1)})}):fastdom.measure(function(){document.documentElement.style.setProperty("--header-height",_this.element.clientHeight+"px"),document.documentElement.style.setProperty("--header-is-not-transparent",_this.options.hasTransparentHeader?0:1)}),window.addEventListener("pageshow",this._checkTransparentHeader.bind(this)),this._setupLocalizationPopovers()}return _createClass(HeaderSection2,[{key:"onUnload",value:function(){this.element.removeEventListener("mouseleave",this._closeNavigationListener),this.element.removeEventListener("mouseenter",this._focusNavigationListener),this.element.removeEventListener("focusin",this._focusNavigationListener),this.delegateElement.off(),window.removeEventListener("scroll",this._checkTransparentHeaderListener),window.removeEventListener("resize",this._verifyNavigationOverlapListener),this._navigationResizeObserver&&this._navigationResizeObserver.disconnect(),this.options.isSticky&&Stickyfill.removeOne(this.element.parentNode),this.searchBar.destroy(),this.localizationPopovers.forEach(function(localizationPopover){localizationPopover.destroy()})}},{key:"onSelect",value:function(){this._checkTransparentHeader()}},{key:"onBlockSelect",value:function(event){var _this2=this,listItem=event.target.closest(".HorizontalList__Item");fastdom.mutate(function(){event.target.setAttribute("aria-hidden","false"),listItem&&(listItem.classList.add("is-expanded"),Dom.getSiblings(listItem,".is-expanded").forEach(function(item){item.classList.remove("is-expanded")})),_this2.element.classList.remove("Header--transparent")})}},{key:"onBlockDeselect",value:function(event){var listItem=event.target.closest(".HorizontalList__Item");fastdom.mutate(function(){event.target.setAttribute("aria-hidden","true"),listItem&&listItem.classList.remove("is-expanded")}),this._checkTransparentHeader()}},{key:"_attachListeners",value:function(){if(this._checkTransparentHeaderListener=this._checkTransparentHeader.bind(this),this._closeNavigationListener=this._closeNavigation.bind(this),this._focusNavigationListener=this._focusNavigation.bind(this),this._verifyNavigationOverlapListener=this._verifyNavigationOverlap.bind(this),this.element.addEventListener("mouseleave",this._closeNavigationListener),this.delegateElement.on("mouseenter",".Header__MainNav .HorizontalList__Item, [aria-haspopup]",this._openMenu.bind(this),!0),this.delegateElement.on("keydown","[aria-haspopup]",this._handleKeyboardMenu.bind(this),!0),this.delegateElement.on("focusout","[aria-haspopup]",this._closeMenu.bind(this),!1),this.delegateElement.on("click",'[data-action="toggle-search"]',this._closeNavigationListener),this.delegateElement.on("mouseleave",".DropdownMenu [aria-haspopup]",this._closeMenu.bind(this),!0),this.delegateElement.on("mouseenter",".DropdownMenu [aria-haspopup]",this._adjustDropdownPosition.bind(this),!0),this.isTouch&&this.delegateElement.on("click",".Header__MainNav [aria-haspopup]",this._handleTouchMenu.bind(this)),this.options.hasTransparentHeader&&(this.element.addEventListener("mouseenter",this._focusNavigationListener),this.element.addEventListener("focusin",this._focusNavigationListener)),this.options.isSticky&&this.options.hasTransparentHeader&&window.addEventListener("scroll",this._checkTransparentHeaderListener),this.options.navigationStyle==="inline"||this.options.navigationStyle==="logoLeft"){window.addEventListener("resize",this._verifyNavigationOverlapListener);var mainTopMenu=this.element.querySelector(".Header__MainNav");if(mainTopMenu&&"ResizeObserver"in window){var _this3b=this,lastNavSignature=null,navSignature=function(){return Dom.nodeListToArray(mainTopMenu.querySelectorAll(".HorizontalList__Item")).filter(function(item){return item.offsetParent!==null}).map(function(item){return item.offsetWidth}).join(",")};this._navigationResizeObserver=new ResizeObserver(function(){var signature=navSignature();signature!==lastNavSignature&&(lastNavSignature=signature,_this3b._verifyNavigationOverlap())}),this._navigationResizeObserver.observe(mainTopMenu)}}}},{key:"_setupLocalizationPopovers",value:function(){this.localizationPopovers=[],Dom.nodeListToArray(document.querySelectorAll("#header-locale-popover")).forEac
18h(function(item,index){item.id="".concat(item.id,"-").concat(index)}),Dom.nodeListToArray(document.querySelectorAll('[aria-controls="header-locale-popover"]')).forEach(function(item,index){item.setAttribute("aria-controls","".concat(item.getAttribute("aria-controls"),"-").concat(index))}),Dom.nodeListToArray(document.querySelectorAll("#header-currency-popover")).forEach(function(item,index){item.id="".concat(item.id,"-").concat(index)}),Dom.nodeListToArray(document.querySelectorAll('[aria-controls="header-currency-popover"]')).forEach(function(item,index){item.setAttribute("aria-controls","".concat(item.getAttribute("aria-controls"),"-").concat(index))});var localePopoverElement1=document.getElementById("header-locale-popover-0");localePopoverElement1&&this.localizationPopovers.push(new Popover(localePopoverElement1,{preferredAlignment:"center",preferredPosition:"bottom",threshold:12}));var localePopoverElement2=document.getElementById("header-locale-popover-1");localePopoverElement2&&this.localizationPopovers.push(new Popover(localePopoverElement2,{preferredAlignment:"center",preferredPosition:"bottom",threshold:12}));var currencyPopoverElement1=document.getElementById("header-currency-popover-0");currencyPopoverElement1&&this.localizationPopovers.push(new Popover(currencyPopoverElement1,{preferredAlignment:"center",preferredPosition:"bottom",threshold:12}));var currencyPopoverElement2=document.getElementById("header-currency-popover-1");currencyPopoverElement2&&this.localizationPopovers.push(new Popover(currencyPopoverElement2,{preferredAlignment:"center",preferredPosition:"bottom",threshold:12}))}},{key:"_focusNavigation",value:function(){var _this3=this;fastdom.mutate(function(){(!_this3.isTouch||Responsive.matchesBreakpoint("desk"))&&_this3.element.classList.remove("Header--transparent")})}},{key:"_closeNavigation",value:function(){var _this4=this;this.pageOverlayElement.classList.remove("header-menu-open"),fastdom.mutate(function(){Dom.nodeListToArray(_this4.element.querySelectorAll(".is-expanded")).forEach(function(item){item.classList.remove("is-expanded")}),Dom.nodeListToArray(_this4.element.querySelectorAll('.Header__MainNav [aria-hidden="false"]')).forEach(function(item){item.setAttribute("aria-hidden","true")})}),this.options.hasTransparentHeader&&this._checkTransparentHeader()}},{key:"_openMenu",value:function(event,target){event.type==="mouseenter"&&target!==event.target||(this.pageOverlayElement.classList.add("header-menu-open"),fastdom.mutate(function(){target.classList.add("is-expanded"),Dom.nodeListToArray(target.children,'.Header__MainNav [aria-hidden="true"]').forEach(function(item){item.setAttribute("aria-hidden","false")}),Dom.getSiblings(target,".is-expanded").forEach(function(item){item.classList.remove("is-expanded"),Dom.nodeListToArray(item.children,'.Header__MainNav [aria-hidden="false"]').forEach(function(item2){item2.setAttribute("aria-hidden","true")})})}))}},{key:"_closeMenu",value:function(event,target){if(!(event.type==="mouseleave"&&target!==event.target)){if(event.type==="focusout"&&event.relatedTarget){var parentListItem=target.closest(".HorizontalList__Item"),relatedParentListItem=event.relatedTarget.closest(".HorizontalList__Item");if(parentListItem&&parentListItem===relatedParentListItem)return}fastdom.mutate(function(){target.classList.remove("is-expanded"),Dom.nodeListToArray(target.children,'.Header__MainNav [aria-hidden="false"]').forEach(function(item){item.setAttribute("aria-hidden","true")})})}}},{key:"_handleKeyboardMenu",value:function(event,target){if(event.key==="Enter"){if(target.classList.contains("is-expanded"))return;event.preventDefault(),event.stopPropagation(),this._openMenu(event,target)}}},{key:"_adjustDropdownPosition",value:function(event,target){var nestedMenus=Dom.nodeListToArray(target.querySelectorAll(".DropdownMenu")),shouldOpenLeft=!1;fastdom.measure(function(){var windowWidth=window.innerWidth,rightEdge=target.getBoundingClientRect().right;nestedMenus.forEach(function(item){rightEdge+item.offsetWidth>windowWidth&&(shouldOpenLeft=!0)})}
18),fastdom.mutate(function(){shouldOpenLeft?nestedMenus.forEach(function(item){item.classList.add("DropdownMenu--reversed")}):nestedMenus.forEach(function(item){item.classList.remove("DropdownMenu--reversed")})})}},{key:"_handleTouchMenu",value:function(event,target){target.classList.contains("is-expanded")||event.preventDefault()}},{key:"_verifyNavigationOverlap",value:function(){var _this5=this,isOverlapping=!1,mainTopMenu=this.element.querySelector(".Header__MainNav");fastdom.measure(function(){if(mainTopMenu){var firstNavElementHeight=Dom.outerHeightWithMargin(mainTopMenu.querySelector(".HorizontalList__Item")),mainNavHeight=mainTopMenu.scrollHeight;mainNavHeight>firstNavElementHeight&&(isOverlapping=!0)}}),this.element.classList.remove("Header--logoLeft","Header--inline","Header--center"),this.element.classList.add("Header--".concat(this.options.navigationStyle)),this.element.clientWidth,fastdom.mutate(function(){if(isOverlapping){if(_this5.element.classList.remove("Header--".concat(_this5.options.navigationStyle)),_this5.element.classList.add("Header--center"),mainTopMenu){var itemTopSet=new Set;Array.from(mainTopMenu.querySelectorAll(".HorizontalList__Item")).forEach(function(item){itemTopSet.add(item.getBoundingClientRect().top)}),isOverlapping=itemTopSet.size>1}}else _this5.element.classList.add("Header--".concat(_this5.options.navigationStyle)),_this5.element.classList.remove("Header--center");var logo=_this5.element.querySelector(".Header__FlexItem--logo");logo.classList.toggle("Header__FlexItem--increaseSpace",isOverlapping),_this5.element.classList.add("Header--initialized"),fastdom.measure(function(){document.documentElement.style.setProperty("--header-height",_this5.element.clientHeight+"px")})})}},{key:"_checkTransparentHeader",value:function(){var _this6=this;if(this.options.hasTransparentHeader){var scrollThreshold=10;fastdom.measure(function(){_this6.lastScrollPosition=window.pageYOffset}),fastdom.mutate(function(){_this6.lastScrollPosition<=scrollThreshold?_this6.element.classList.add("Header--transparent"):_this6.element.classList.remove("Header--transparent")})}}}]),HeaderSection2})(),FooterSection=(function(){function FooterSection2(container){_classCallCheck(this,FooterSection2),this.element=container;var localePopoverElement=document.getElementById("footer-locale-popover");localePopoverElement&&(this.localePopover=new Popover(localePopoverElement,{preferredAlignment:"center",preferredPosition:"top",threshold:12}));var currencyPopoverElement=document.getElementById("footer-currency-popover");currencyPopoverElement&&(this.currencyPopover=new Popover(currencyPopoverElement,{preferredAlignment:"center",preferredPosition:"top",threshold:12}))}return _createClass(FooterSection2,[{key:"onUnload",value:function(){this.localePopover&&this.localePopover.destroy(),this.currencyPopover&&this.currencyPopover.destroy()}}]),FooterSection2})(),ImageWithTextBlockSection=(function(){function ImageWithTextBlockSection2(container){_classCallCheck(this,ImageWithTextBlockSection2),this.element=container}return _createClass(ImageWithTextBlockSection2,[{key:"onUnload",value:function(){}}]),ImageWithTextBlockSection2})(),LoginSection=(function(){function LoginSection2(container){_classCallCheck(this,LoginSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.timelineLite=new TimelineLite,this.customerLoginForm=this.element.querySelector("#customer_login"),this.recoverPasswordForm=this.element.querySelector("#recover_customer_password"),this.delegateElement.on("click",'[data-action="toggle-recover-form"]',this._showRecoverPassword.bind(this))}return _createClass(LoginSection2,[{key:"_showRecoverPassword",value:function(){var isLoginActive=this.customerLoginForm.style.display==="block";isLoginActive?this.timelineLite.fromTo(this.customerLoginForm,.5,{autoAlpha:1,display:"block",y:0},{autoAlpha:0,y:20,display:"none"}).fromTo(this.recoverPasswordForm,.5,{autoAlpha:0,display:"none",y:20},{autoAlpha:1,display:"block",y:0,delay:.25}):this.timelineLite.fromTo(this.recoverPasswordForm,.5,{autoAlpha:1,display:"block",y:0},{autoAlpha:0,y:20,display:"none"}).fromTo(this.customerLoginForm,.5,{autoAlpha:0,display:"none",y:20},{autoAlpha:1,display:"block",y:0,delay:.25})}}]),LoginSection2})(),MapSection=(function(){function MapSection2(element){_classCallCheck(this,MapSection2),this.element=element,this.options=JSON.parse(element.getAttribute("data-section-settings")),this.options.apiKey&&this.options.mapAddress&&this._loadScript().then(this._initMap.bind(this))}return _createClass(MapSection2,[{key:"_loadScript",value:function(){var _this=this;return new Promise(function(resolve,reject){var script=document.createElement("script");document.body.appendChild(script),script.onload=resolve,script.onerror=reject,script.async=!0,script.src="https://maps.googleapis.com/ma
18ps/api/js?key=".concat(_this.options.apiKey)})}},{key:"_initMap",value:function(){var _this2=this,geocoder=new google.maps.Geocoder;geocoder.geocode({address:this.options.mapAddress},function(results,status){if(status!==google.maps.GeocoderStatus.OK)Shopify.designMode;else{var mapOptions={zoom:_this2.options.zoom,center:results[0].geometry.location,draggable:!1,clickableIcons:!1,scrollwheel:!1,disableDoubleClickZoom:!0,disableDefaultUI:!0},map=new google.maps.Map(_this2.element.querySelector(".FeaturedMap__GMap"),mapOptions),center=map.getCenter();map.setCenter(center);var icon={path:"M32.7374478,5.617 C29.1154478,1.995 24.2994478,0 19.1774478,0 C14.0544478,0 9.23944778,1.995 5.61744778,5.617 C-1.08555222,12.319 -1.91855222,24.929 3.81344778,32.569 L19.1774478,54.757 L34.5184478,32.6 C40.2734478,24.929 39.4404478,12.319 32.7374478,5.617 Z M19.3544478,26 C15.4954478,26 12.3544478,22.859 12.3544478,19 C12.3544478,15.141 15.4954478,12 19.3544478,12 C23.2134478,12 26.3544478,15.141 26.3544478,19 C26.3544478,22.859 23.2134478,26 19.3544478,26 Z",fillColor:_this2.options.markerColor,fillOpacity:1,anchor:new google.maps.Point(15,55),strokeWeight:0,scale:.6};new google.maps.Marker({map,position:map.getCenter(),icon});var styledMapType=new google.maps.StyledMapType(JSON.parse(_this2.element.querySelector("[data-gmap-style]").innerHTML));map.mapTypes.set("styled_map",styledMapType),map.setMapTypeId("styled_map"),google.maps.event.addDomListener(window,"resize",function(){google.maps.event.trigger(map,"resize"),map.setCenter(center)})}})}}]),MapSection2})(),NewsletterPopupSection=(function(){function NewsletterPopupSection2(element){_classCallCheck(this,NewsletterPopupSection2),this.element=element,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(element.getAttribute("data-section-settings")||"[]");try{window.location.hash==="#newsletter-popup"&&window.theme.pageType!==null?this._openPopup():(!this.options.showOnlyOnce||this.options.showOnlyOnce&&localStorage.getItem("themePopup")===null)&&setTimeout(this._openPopup.bind(this),this.options.apparitionDelay*1e3)}catch{}this._attachListeners()}return _createClass(NewsletterPopupSection2,[{key:"onUnload",value:function(){this.delegateElement.off()}},{key:"onSelect",value:function(){this._openPopup()}},{key:"onDeselect",value:function(){this._closePopup()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",'[data-action="close-popup"]',this._closePopup.bind(this))}},{key:"_openPopup",value:function(){this.element.setAttribute("aria-hidden","false"),localStorage.setItem("themePopup","true")}},{key:"_closePopup",value:function(){this.element.setAttribute("aria-hidden","true")}}]),NewsletterPopupSection2})(),ProductRecommendationsSection=(function(){function ProductRecommendationsSection2(container){_classCallCheck(this,ProductRecommendationsSection2),this.element=container,this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this._loadRecommendations().then(this._createSlideshow.bind(this))}return _createClass(ProductRecommendationsSection2,[{key:"onUnload",value:function(){this.carousel.destroy()}},{key:"_loadRecommendations",value:function(){var _this=this,url="".concat(window.routes.productRecommendationsUrl,"?section_id=").concat(this.element.getAttribute("data-section-id"),"&product_id=").concat(this.options.productId,"&limit=").concat(this.options.recommendationsCount,"&intent=complementary");return fetch(url).then(function(response){return response.text().then(function(content){var container=document.createElement("div");container.innerHTML=content;var sourceEl=container.querySelector(".ProductRecommendations"),targetEl=_this.element.querySelector(".ProductRecommendations");sourceEl&&targetEl&&(targetEl.innerHTML=sourceEl.innerHTML)})})}},{key:"_createSlideshow",value:function(){var flickityElement=this.element.querySelector("[data-flickity-config]");flickityElement&&(this.carousel=new Carousel(flickityElement))}}]),ProductRecommendationsSection2})(),WaitListSection=(function(){function WaitListSection2(container){var _this=this;_classCallCheck(this,WaitListSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.joinWaitlistDiv=this.element.querySelector("#jwWrapper"),this.joinWaitlistButton=this.element.querySelector(".join-waitlist #jwTrigger"),this.joinWaitlistForm=this.element.querySelector(".join-waitlist #jwForm"),this._attachListeners()}return _createClass(WaitListSection2,[{key:"destroy",value:function(){this.delegateElement.off("click"),this.delegateElement.off("keypress"),this.delegateElement.off("variant:changed")}},{key:"onUnload",value:function(){this.delegateElement.off("click")}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".join-waitlist .btn-join-waitlist",this._joinWaitListShow.bind(this)),this.delegateElement.on("keypress","#jwForm .email-input input",this._joinWaitListInputKeyPress.bind(this)),this.delegateElement.on("click","#jwForm button",this._joinWaitListSubmit.bind(this)),this.delegateElement.on("variant:changed",this._updateWaitListData.bind(this))}},{key:"_updateWaitListData",value:function(event){var variant=event.detail.variant;if(this.joinWaitlistDiv){this.joinWaitlistDiv.setAttribute("data-variant-id",variant.id),this.joinWaitlistDiv.setAttribute("data-variant-name",variant.title||""),this.joinWaitlistDiv.setAttribute("data-variant-sku",variant.sku||"");var launchDateSeconds=variant.launch_date_seconds,isPreLaunch=launchDateSeconds&&parseInt(launchDateSeconds)>Math.floor(Date.now()/1e3);if(this.joinWaitlistDiv.setAttribute("data-pre-launch",isPreLaunch?"true":"false"),this.joinWaitlistButton){var btn=this.joinWaitlistButton.querySelector(".btn-join-waitlist");btn&&(btn.textContent=isPreLaunch?window.languages.productFormEarlyAccess:window.languages.productFormWaitlist),this.joinWaitlistButton.classList.add("active","show")}this.joinWaitlistForm&&(this.joinWaitlistForm.classList.remove("active","show"),this.joinWaitlistForm.querySelector('input[name="waitlistEmail"]').value="");const successMessage=this.element.querySelector("#jwSuccess");if(successMessage){var successP=successMessage.querySelector("p");successP&&(successP.textContent=isPreLaunch?successMessage.getAttribute("data-msg-prelaunch")||"Thank you. You'll be notified when this product launches.":successMessage.getAttribute("data-msg-waitlist")||"Thank you. You've been added to the waitlist."),successMessage.classList.remove("active","show")}}}},{key:"_joinWaitListShow",value:function(event){this.joinWaitlistForm&&(this.joinWaitlistForm.classList.add("active","show"),this.joinWaitlistButton.classList.remove("active","show"))}},{key:"_joinWaitListInputKeyPress",value:function(event){event.key==="Enter"&&(event.preventDefault(),event.stopPropagation(),this._joinWaitListSubmit(event))}},{key:"_joinWaitListSubmit",value:function(event){event.preventDefault();const successMessage=this.element.querySelector("#jwSuccess"),joinWaitlistForm=this.joinWaitlistForm,email=this.joinWaitlistForm.querySelector('input[name="waitlistEmail"]').value,variantId=this.joinWaitlistDiv.getAttribute("data-variant-id"),isPreLaunch=!1,isPreLaunchSignup=this.joinWaitlistDiv.getAttribute("data-pre-launch")==="true",productId=this.joinWaitlistDiv.getAttribute("data-product-id"),productName=this.joinWaitlistDiv.getAttribute("data-product-name"),variantName=this.joinWaitlistDiv.getAttribute("data-variant-name"),variantSku=this.joinWaitlistDiv.getAttribute("data-variant-sku");if(!_validEmailAddress(email)){joinWaitlistForm.querySelector(".invali
18d-feedback").classList.add("d-block");return}const preLaunchPayload={data:{type:"event",attributes:{metric:{data:{type:"metric",attributes:{name:"Pre-Launch Waitlist"}}},profile:{data:{type:"profile",attributes:{email}}},properties:{variant_id:variantId,product_id:productId,product_name:productName,variant_name:variantName,sku:variantSku}}}},backInStockPayload={data:{type:"back-in-stock-subscription",attributes:{profile:{data:{type:"profile",attributes:{email}}},channels:["EMAIL"]},relationships:{variant:{data:{type:"catalog-variant",id:`$shopify:::$default:::${variantId}`}}}}},mainListPayload={data:{type:"subscription",attributes:{profile:{data:{type:"profile",attributes:{email,subscriptions:{email:{marketing:{consent:"SUBSCRIBED",consented_at:new Date().toISOString()}}}}}},custom_source:isPreLaunchSignup?"Pre-Launch Signup":"Back In Stock Signup"},relationships:{list:{data:{type:"list",id:KLAVIYO_LIST_ID}}}}},headers={"Content-Type":"application/json",revision:"2025-04-15"},firstCallUrl=isPreLaunch?"https://a.klaviyo.com/client/events/?company_id="+KLAVIYO_PUBLIC_KEY:"https://a.klaviyo.com/client/back-in-stock-subscriptions/?company_id="+KLAVIYO_PUBLIC_KEY;fetch(firstCallUrl,{method:"POST",headers,body:JSON.stringify(isPreLaunch?preLaunchPayload:backInStockPayload)}).then(response=>{if(!response.ok)throw new Error(isPreLaunch?"Error submitting pre-launch waitlist":"Error subscribing user to back in stock");return console.log(isPreLaunch?"Pre-launch event tracked":"User subscribed to back in stock"),fetch("https://a.klaviyo.com/client/subscriptions/?company_id="+KLAVIYO_PUBLIC_KEY,{method:"POST",headers,body:JSON.stringify(mainListPayload)})}).then(response=>{if(response.status===202)console.log("User subscribed to main list"),successMessage.classList.add("active","show"),joinWaitlistForm.classList.remove("active","show");else return response.json().then(result=>{throw result})}).catch(error=>{console.error("Error in subscription process: ",error)})}}]),WaitListSection2})(),ProductGallery=(function(){function ProductGallery2(container,options){_classCallCheck(this,ProductGallery2),this.options=options,this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.productGalleryElement=this.element.querySelector(".Product__Gallery"),this.viewInSpaceElement=this.element.querySelector("[data-shopify-xr]"),this._initGallery(),this._setupDeviceFeatures(),this._attachListeners()}return _createClass(ProductGallery2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productSlideshow&&this.productSlideshow.destroy(),this.options.enableImageZoom&&this.imageZoomInstance.destroy(),this.carouselNavScrollSpy&&this.carouselNavScrollSpy.destroy(),this.productThumbnailsScroller&&this.productThumbnailsScroller.destroy(),this.delegateElement.off("variant:changed"),document.removeEventListener("breakpoint:changed",this._onBreakpointChangedListener)}},{key:"_initGallery",value:function(){var _this=this,productSlideshowElement=this.element.querySelector(".Product__Slideshow");productSlideshowElement&&(this.productSlideshow=new Carousel(productSlideshowElement,{onSelect:this._onImageChanged.bind(this),onSettle:this._onImageSettled.bind(this)},{draggable:!Responsive.matchesBreakpoint("supports-hover")}),this.mediaList={},this.previouslySelectedMedia=null,productSlideshowElement.querySelectorAll('[data-media-type="model"]').forEach(function(model){_this.mediaList[model.getAttribute("data-media-id")]=new ProductModel(model,_this.options.stackProductImages)}),productSlideshowElement.querySelectorAll('[data-media-type="video"], [data-media-type="external_video"]').forEach(function(video){_this.mediaList[video.getAttribute("data-media-id")]=new ProductVideo(video,_this.options.stackProductImages,_this.options.enableVideoLooping)}),this.options.stackProductImages&&(this.slideshowNavDots=this.element.querySelector(".Product__SlideshowNav--dots"),this.slideshowNavDotsItems=this.slideshowNavDots?Dom.nodeListToArray(this.slideshowNavDots.querySelectorAll("a")):[]),this.options.showThumbnails&&(this.slideshowNavThumbnails=this.element.querySelector(".Product__SlideshowNav--thumbn
18ails"),this.slideshowNavThumbnailsItems=this.slideshowNavThumbnails?Dom.nodeListToArray(this.slideshowNavThumbnails.querySelectorAll(".Product__SlideshowNavImage")):[]),this.slideshowImages=Dom.nodeListToArray(productSlideshowElement.querySelectorAll(".Carousel__Cell")),this._setupSlideshowMobileNav()),this.options.enableImageZoom&&(this.imageZoomInstance=new ProductImageZoom(this.element,this.productSlideshow))}},{key:"_attachListeners",value:function(){this._onBreakpointChangedListener=this._setupDeviceFeatures.bind(this),this.delegateElement.on("variant:changed",this._updateSlideshowImage.bind(this)),this.delegateElement.on("scrollspy:target:changed",this._onScrollTargetChanged.bind(this)),this.delegateElement.on("model:played",this._onMediaPlayed.bind(this)),this.delegateElement.on("video:played",this._onMediaPlayed.bind(this)),this.delegateElement.on("model:paused",this._onMediaPaused.bind(this)),this.delegateElement.on("video:paused",this._onMediaPaused.bind(this)),document.addEventListener("breakpoint:changed",this._onBreakpointChangedListener),this.options.modalDisplay?this.options.showThumbnails?this.delegateElement.on("click",".Product__SlideshowNavImage",this._imageNavClicked.bind(this)):this.delegateElement.on("click",".Product__SlideshowNavDot",this._imageNavClicked.bind(this)):!this.options.stackProductImages&&this.options.showThumbnails&&this.delegateElement.on("click",".Product__SlideshowNavImage",this._switchToImage.bind(this))}},{key:"_setupSlideshowMobileNav",value:function(){var _this2=this;if(this.slideshowMobileNav=this.element.querySelector(".Product__SlideshowMobileNav"),this.slideshowMobileNav){var slideshowMobileNavDelegate=new domDelegate.Delegate(this.slideshowMobileNav);slideshowMobileNavDelegate.on("click",".dot",function(event,element){_this2._slideWillChange(),_this2.productSlideshow.selectCell(parseInt(element.getAttribute("data-index")))}),slideshowMobileNavDelegate.on("click",".Product__SlideshowNavArrow",function(event,element){_this2._slideWillChange(),element.getAttribute("data-direction")==="next"?_this2.productSlideshow.next():_this2.productSlideshow.previous()})}}},{key:"_updateSlideshowImage",value:function(event){var variant=event.detail.variant,previousVariant=event.detail.previousVariant;if(this.productGalleryElement&&this.productGalleryElement.dataset.isVariantGallery)this._updateGallery(event);else{if(!variant||!variant.featured_media||previousVariant&&previousVariant.featured_media&&previousVariant.featured_media.id===variant.featured_media.id)return;if(this._slideWillChange(),Responsive.matchesBreakpoint("pocket")||!this.options.stackProductImages)for(var i=0;i!==this.productSlideshow.flickityInstance.cells.length;++i){var cellElement=this.productSlideshow.flickityInstance.cells[i].element,mediaId=parseInt(cellElement.getAttribute("data-media-id"));mediaId===variant.featured_media.id&&this.productSlideshow.selectCell(parseInt(cellElement.getAttribute("data-media-position"))-1)}else document.querySelector('[href="#Media'.concat(variant.featured_media.id,'"]')).click()}}},{key:"_onMediaPlayed",value:function(event){var videoElement=event.target.querySelector("video[autoplay]:not([playsinline])");if(videoElement&&(this.productSlideshow.getFlickityInstance().options.draggable=!1,this.productSlideshow.getFlickityInstance().unbindDrag()),this.previouslySelectedMedia&&this.previouslySelectedMedia!==event.target){const mediaId=this.previouslySelectedMedia.getAttribute("data-media-id");if(mediaId){const mediaItem=this.mediaList[mediaId];mediaItem&&mediaItem.hasBeenDeselected()}}this.options.stackProductImages&&(this.previouslySelectedMedia=event.target)}},{key:"_onMediaPaused",value:function(){this.productSlideshow.getFlickityInstance().options.draggable=!Responsive.matchesBreakpoint("supports-hover"),this.productSlideshow.getFlickityInstance().bindDrag()}},{key:"_handleMedia",value:function(item){if(this.previouslySelectedMedia&&this.previouslySelectedMedia!==item){switch(this.previouslySelectedMedia.getAttribute("data-media-type")){case"video":case"external_video":case"model":this.mediaList[this.previouslySelectedMedia.getAttribute("data-media-id")].hasBeenDeselected()}this.previouslySelectedMedia.getAttribute("data-media-type")==="model"&&this.viewInSpaceElement&&this.viewInSpaceElement.setAttribute("data-shopify-model3d-id",this.viewInSpaceElement.getAttribute("data-shopify-model3d-default-id"))}switch(item.getAttribute("data-media-type")){case"video":case"external_video":case"model":this.mediaList[item.getAttribute("data-media-id")].hasBeenSelected();break}item.getAttribute("data-media-type")==="model"&&this.viewInSpaceElement&&this.viewInSpaceElement.setAttribute("data-shopify-model3d-id",item.getAttribute("data-media-id")),this.previouslySelectedMedia=item}},{key:"_onScrollTargetChanged",value:function(event){if(this.options.stackProductImages){this.slideshowNavDotsItems.forEac
18h(function(item){return item.classList.remove("is-selected")});var i=parseInt(event.detail.newTarget.getAttribute("data-media-position"));this.slideshowNavDotsItems[i-1].classList.add("is-selected"),this.options.showThumbnails&&(this.slideshowNavThumbnailsItems.forEach(function(item){return item.classList.remove("is-selected")}),this.slideshowNavThumbnailsItems[parseInt(event.detail.newTarget.getAttribute("data-media-position"))-1].classList.add("is-selected"))}}},{key:"_imageNavClicked",value:function(event,target){event.preventDefault(),event.stopPropagation(),this._slideWillChange();const targetImageID=target.getAttribute("href"),targetImage=this.productGalleryElement.querySelector(targetImageID),imageContainer=this.productGalleryElement.parentElement,scrollPosition=targetImage.offsetTop,animationDuration=500,startTime=performance.now();function smoothScrollAnimation(currentTime){const elapsedTime=currentTime-startTime,nextScrollPosition=(scrollPosition-imageContainer.scrollTop)*(-Math.cos(elapsedTime/animationDuration*Math.PI)+1)+imageContainer.scrollTop;imageContainer.scrollTop=nextScrollPosition,elapsedTime<animationDuration&&requestAnimationFrame(smoothScrollAnimation)}requestAnimationFrame(smoothScrollAnimation)}},{key:"_switchToImage",value:function(event,target){event.preventDefault(),this._slideWillChange();for(var i=0;i!==this.productSlideshow.flickityInstance.cells.length;++i){var cellElement=this.productSlideshow.flickityInstance.cells[i].element,mediaId=parseInt(cellElement.getAttribute("data-media-id"));mediaId===parseInt(target.getAttribute("data-media-id"))&&this.productSlideshow.selectCell(parseInt(cellElement.getAttribute("data-media-position"))-1)}}},{key:"_updateGallery",value:function(event){if(this.productGalleryElement){var view="gallery";this.options.view&&(view=this.options.view);var _this=this,variant=event.detail.variant;const url=window.location.origin+"/products/"+variant.productHandle+"?variant="+variant.id+"&view="+view;fetch(url).then(response=>response.text()).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const sectionHtml=tempElement.querySelector(".Product__Gallery");_this.productGalleryElement.innerHTML=sectionHtml.innerHTML,_this._initGallery(),_this._setupDeviceFeatures()}).catch(error=>{console.error("Failed to fetch gallery:",error)})}}},{key:"_onImageChanged",value:function(event,cell){if(Responsive.matchesBreakpoint("pocket")){var productGalleryActionListElement=this.element.querySelector(".Product__Gallery .Product__ActionList");productGalleryActionListElement&&(cell.classList.contains("Product__SlideItem--image")?productGalleryActionListElement.classList.remove("is-hidden"):productGalleryActionListElement.classList.add("is-hidden"))}if(!this.options.stackProductImages&&this.options.showThumbnails){var mediaId=cell.getAttribute("data-media-id");this.slideshowNavThumbnailsItems.forEach(function(thumbnail){thumbnail.getAttribute("data-media-id")===mediaId?thumbnail.classList.add("is-selected"):thumbnail.classList.remove("is-selected")})}if(this.slideshowMobileNav){var selectedIndex=parseInt(cell.getAttribute("data-media-position"))-1;Dom.nodeListToArray(this.slideshowMobileNav.querySelectorAll(".dot")).forEac
18h(function(item,index){index===selectedIndex?item.classList.add("is-selected"):item.classList.remove("is-selected")})}}},{key:"_onImageSettled",value:function(index,cell){if(this._handleMedia(cell),Responsive.matchesBreakpoint("lap-and-up")){var slides=this.element.querySelectorAll(".Product__SlideItem:not(.is-selected)");slides.forEach(function(slide){slide.classList.add("Product__SlideItem--hidden")})}}},{key:"_slideWillChange",value:function(){if(Responsive.matchesBreakpoint("lap-and-up")){var slides=this.element.querySelectorAll(".Product__SlideItem");slides.forEach(function(slide){slide.classList.remove("Product__SlideItem--hidden")})}}},{key:"_setupDeviceFeatures",value:function(event){var currentBreakpoint=event?event.detail.currentBreakpoint:Responsive.getCurrentBreakpoint(),previousBreakpoint=event?event.detail.previousBreakpoint:null;if(currentBreakpoint!==previousBreakpoint)if(currentBreakpoint==="phone"||currentBreakpoint==="tablet")this.carouselNavScrollSpy&&this.carouselNavScrollSpy.destroy(),this.productThumbnailsScroller&&this.productThumbnailsScroller.destroy();else{if(this.slideshowImages&&this.slideshowImages.length>1){var offsetTop=0;this.options.showThumbnails&&Responsive.matchesBreakpoint("desk")&&(offsetTop=250),this.carouselNavScrollSpy=new ScrollSpy(this.element,this.slideshowImages,{rootMargin:"-".concat(offsetTop,"px 0px 0px 0px")})}this.options.showThumbnails&&this.slideshowNavThumbnails&&(this.productThumbnailsScroller=new OverflowScroller(this.slideshowNavThumbnails))}}}]),ProductGallery2})(),ProductHintingModal=(function(){function ProductHintingModal2(container){if(_classCallCheck(this,ProductHintingModal2),this.element=container,this.delegateParentElement=new domDelegate.Delegate(this.element),this.modal=this.element.querySelector("#productHintingModal"),!!this.modal){this.delegateElement=new domDelegate.Delegate(this.modal),this.maxChars=255,this.hintPreview=this.modal.querySelector(".hint-preview"),this.hintDisplay=this.modal.querySelector(".hint-display"),this.sizePreference=this.modal.querySelector(".size-preference"),this.modalDialog=this.modal.querySelector(".modal-dialog"),this.hintForm=this.modal.querySelector(".hint-form form"),this.hintLink=this.element.querySelector(".send-hint"),this.hintImage=this.modal.querySelector(".hint-product .product-image img"),this._attachListeners();var urlParams=new URLSearchParams(window.location.search),showhint=urlParams.get("showhint");if(showhint){var modalInstance=bootstrap.Modal.getInstance(this.modal);modalInstance&&modalInstance.show()}}}return _createClass(ProductHintingModal2,[{key:"onUnload",value:function(){this.delegateElement.off("click")}},{key:"_attachListeners",value:function(){const tooltipList=[...this.element.querySelectorAll('[data-bs-toggle="tooltip"]')].map(tooltipTriggerEl=>new bootstrap.Tooltip(tooltipTriggerEl));this.modal.addEventListener("shown.bs.modal",this._initModal.bind(this)),this.modal.addEventListener("hidden.bs.modal",this._resetModal.bind(this)),this.hintForm.addEventListener("submit",this._submitHint.bind(this)),this.delegateElement.on("input","#hintMessage",this._input.bind(this)),this.delegateElement.on("keypress","#hintMessage",this._keyPress.bind(this)),this.delegateElement.on("click",".preview-link",this._previewHint.bind(this)),this.delegateElement.on("click",".preview-back",this._backToHint.bind(this)),this.delegateParentElement.on("variant:changed",this._updateHintLink.bind(this))}},{key:"_initModal",value:function(event){if(this.sizePreference.innerHTML="",this.hintForm.reset(),this.plpImage=this.hintLink.getAttribute("data-image"),this.hintImage.setAttribute("src",this.plpImage),this.variantId=this.hintLink.getAttribute("data-pid"),this.canMonogram=this.hintLink.getAttribute("data-monogram"),this.canMonogram=="true"){var monoNote=this.element.querySelector(".mono_note");monoNote&&monoNote.classList.remove("d-none")}this.productName=this.element.querySelector(".ProductMeta__Title").innerHTML;var productNameElement=this.modal.querySelector(".hint-product .product-name");productNameElement.innerHTML=this.productName;var sizeAttributes=this.element.querySelector(".SizeSwatchList:not(.OptionLinks)");if(sizeAttributes&&sizeAttributes.innerHTML.trim()!==""){var parentDiv=sizeAttributes.parentElement,clonedSizeAttribute=parentDiv.cloneNode(!0);this.sizePreference.innerHTML='<span class="size non-input-label">Preferred Size</span>',this.sizePreference.appendChild(clonedSizeAttribute)}this.hintPreview.innerHTML="",this.hintDisplay.classList.remove("preview"),this.modalDialog.classList.remove("hint-sent");var preferedColorText="";
18this.productColor="NA";var colorAttribute=this.element.querySelector(".ProductForm__SelectedValue");colorAttribute!==null&&(this.productColor=colorAttribute.innerHTML,preferedColorText="Preferred Color: "+this.productColor);var preferedSizeText="";this.productSize="NA";var sizeAttribute=this.element.querySelector(".SizeSwatch__Radio[checked]");sizeAttribute!==null&&(this.productSize=sizeAttribute.getAttribute("value"),preferedSizeText='Preferred Size: <span id="preferedSize">'+this.productSize+"</span>");var productAttributesContainer=this.modal.querySelector(".hint-product .product-attributes");productAttributesContainer.innerHTML=preferedColorText+"<br/>"+preferedSizeText}},{key:"_resetModal",value:function(event){this.sizePreference.innerHTML=""}},{key:"_input",value:function(event){this._updateMessageCounter(event.target);var value=event.target.value.trim().replace(/(?:\r\n|\r|\n)/g,"<br/>");this.hintPreview.innerHTML=value}},{key:"_keyPress",value:function(event){var regex=/^[a-zA-Z0-9~!@#$%^&*()\-+='":;.,? ]+$/,key=String.fromCharCode(event.charCode?event.charCode:event.which);if(!regex.test(key)&&!(event.keyCode==13||event.keyCode==8))return event.preventDefault(),!1}},{key:"_backToHint",value:function(event){event.preventDefault(),event.stopPropagation();var hintDisplay=this.modal.querySelector(".hint-display");hintDisplay&&hintDisplay.classList.remove("preview")}},{key:"_previewHint",value:function(event){event.preventDefault(),window.scrollTo(0,0);var formValid=!0,yourEmail=this.modal.querySelector('input[name="yourEmail"]'),yourName=this.modal.querySelector('input[name="yourName"]'),name=this.modal.querySelector('input[name="recipientName"]'),email=this.modal.querySelector('input[name="recipientEmail"]'),hintMessage=this.modal.querySelector('textarea[name="hintMessage"]');if(_validEmailAddress(yourEmail.value.trim())||(yourEmail.classList.add("is-invalid"),yourEmail.nextElementSibling.textContent="Please enter a valid email.",formValid=!1),yourName.value.trim()||(yourName.classList.add("is-invalid"),yourName.nextElementSibling.textContent="Please fill out this field.",formValid=!1),_validEmailAddress(email.value.trim())||(email.classList.add("is-invalid"),email.nextElementSibling.textContent="Please enter a valid email.",formValid=!1),name.value.trim()||(name.classList.add("is-invalid"),name.nextElementSibling.textContent="Please fill out this field.",formValid=!1),hintMessage.value.trim()||(hintMessage.classList.add("is-invalid"),hintMessage.nextElementSibling.textContent="Please fill out this field.",formValid=!1),!!formValid){var hintDisplay=this.modal.querySelector(".hint-display");hintDisplay.classList.add("preview")}}},{key:"_submitHint",value:function(event){event.preventDefault();var _this=this,formValid=!0,btn=this.modal.querySelector(".btn-send-hint"),yourEmail=this.modal.querySelector('input[name="yourEmail"]').value.trim(),yourName=this.modal.querySelector('input[name="yourName"]').value.trim(),name=this.modal.querySelector('input[name="recipientName"]').value.trim(),email=this.modal.querySelector('input[name="recipientEmail"]').value.trim(),hintMessage=this.modal.querySelector('textarea[name="hintMessage"]').value.trim();const currentURL=window.location.href;if((!_validEmailAddress(yourEmail)||!_validEmailAddress(email))&&(formValid=!1),!!formValid){var requestOptions={method:"POST",headers:{accept:"application/json",revision:"2025-04-15","Content-Type":"application/json"}},hintRecieverData={data:{type:"event",attributes:{properties:{"Hint Sender Email":String(yourEmail),"Hint Sender Name":String(yourName),"Recipient Name":String(name),"Hint Recipient":String(email),"Hint Message":String(hintMessage),Product:String(this.productName),"Product Color":String(this.productColor),"Product Size":String(this.productSize),"Product Url":String(currentURL),"Product Image Url":String(this.plpImage),"Variant ID":String(this.variantId)},metric:{data:{type:"metric",attributes:{name:"Received Hint"}}},profile:{data:{type:"profile",attributes:{email:String(email)}}}}}},hintSenderData={data:{type:"event",attributes:{properties:{"Hint Sender Email"
18:String(yourEmail),"Hint Sender Name":String(yourName),"Recipient Name":String(name),"Hint Recipient":String(email),"Hint Message":String(hintMessage),Product:String(this.productName),"Product Color":String(this.productColor),"Product Size":String(this.productSize),"Product Url":String(currentURL),"Product Image Url":String(this.plpImage),"Variant ID":String(this.variantId)},metric:{data:{type:"metric",attributes:{name:"Sent Hint"}}},profile:{data:{type:"profile",attributes:{email:String(yourEmail)}}}}}},mainListData={data:{type:"subscription",attributes:{profile:{data:{type:"profile",attributes:{email:yourEmail,subscriptions:{email:{marketing:{consent:"SUBSCRIBED",consented_at:new Date().toISOString()}}}}}},custom_source:"Sent a Hint"},relationships:{list:{data:{type:"list",id:KLAVIYO_LIST_ID}}}}},mainListRequestOptions={method:"POST",headers:{"Content-Type":"application/json",revision:"2025-04-15"},body:JSON.stringify(mainListData),redirect:"follow"};btn.disabled=!0,requestOptions.body=JSON.stringify(hintRecieverData),fetch("https://a.klaviyo.com/client/events/?company_id="+KLAVIYO_PUBLIC_KEY,requestOptions).then(response=>{if(response.status!==202&&console.log(response),response.status===202){var sentMsg=_this.modal.querySelector(".sent-confirmation .message"),messageData=sentMsg.getAttribute("data-msg");sentMsg.textContent=messageData.replace("{{ recipient }}",name),_this.modal.querySelector(".modal-dialog").classList.add("hint-sent");var animationElement=_this.modal.querySelector(".modal-dialog .sent-confirmation .animation");return animationElement&&setTimeout(()=>{animationElement.classList.add("animate")},100),btn.disabled=!1,null}}).catch(err=>console.error(err)),requestOptions.body=JSON.stringify(hintSenderData),fetch("https://a.klaviyo.com/client/events/?company_id="+KLAVIYO_PUBLIC_KEY,requestOptions).then(response=>{if(response.status!==202&&console.log(response),response.status===202)return fetch("https://a.klaviyo.com/client/subscriptions/?company_id="+KLAVIYO_PUBLIC_KEY,mainListRequestOptions);throw new Error("Error subscribing user to back in stock")}).then(response=>response.status===202?null:response.json().then(result=>{throw result})).catch(error=>{console.error("Error subscribing user to main list: ",error)})}}},{key:"_updateHintLink",value:function(event){var previousVariant=event.detail.previousVariant,newVariant=event.detail.variant;newVariant.available?this.hintLink.classList.remove("d-none"):this.hintLink.classList.add("d-none"),this.variantId=newVariant.id,this.hintLink.setAttribute("data-pid",this.variantId),this.canMonogram=newVariant.monogramming?"true":"false",this.hintLink.setAttribute("data-monogram",this.canMonogram);var preferedSize=this.modal.querySelector("#preferedSize");if(preferedSize){if(Array.isArray(previousVariant.options)){var index=previousVariant.options.indexOf(preferedSize.innerHTML);this.productSize=newVariant.options[index]}else this.productSize=newVariant.option1;preferedSize.innerHTML=this.productSize}newVariant.plp_image&&this.hintLink.setAttribute("data-image",newVariant.plp_image)}},{key:"_updateMessageCounter",value:function(textBox,updateDisplay=!0){var chars=textBox.value.trim().replace(/(?:\r\n|\r|\n|<br\/>)/g," ").length,charsLeft=this.maxChars-chars;return updateDisplay&&textBox.closest(".message-input").setAttribute("data-count",charsLeft),chars<=this.maxChars}}]),ProductHintingModal2})(),StickyBottomButtons=(function(){function StickyBottomButtons2(container){if(_classCallCheck(this,StickyBottomButtons2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),!document.querySelector("#sticky-drawer")){var stickyDrawer=document.createElement("div");stickyDrawer.id="sticky-drawer",document.querySelector(".ProductForm").appendChild(stickyDrawer)}this.drawer=document.querySelector("#sticky-drawer");var proofBannerSection=document.querySelector(".proofBanner .proof-wrapper");proofBannerSection&&(this.drawer.style.bottom="48px"),this._updateStickyDrawer(),this._attachListeners()}return _createClass(StickyBottomButtons2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.io.destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("variant:changed",this._updateStickyDrawer.bind(this)),this.delegateElement.on("click","#sticky-drawer button.btn-join-waitlist",this._scrollToWaitList.bind(this)),window.addEventListener("scroll",this._onScrollResizeListener.bind(this)),window.addEventListener("resize",this._onScrollResizeListener.bind(this))}},{key:"_onScrollResizeListener",value:function(event){event.preventDefault();var PpdCtaButtons=this.element.querySelector(".ProductForm__CTA");PpdCtaButtons&&PpdCtaButtons?.getBoundingClientRect().bottom<=100?(this.drawer.classList.add("active"),document.body.classList.add("sticky-drawer-open")):(this.drawer.classList.remove("active"),document.body.classList.remove("sticky-drawer-open"))}},{key:"_scrollToWaitList",value:function(event){event.preventDefault();var scrollTo=document.querySelector("div.join-waitlist").getBoundingClientRect().top+window.scrollY-window.innerHeight/2;window.scrollTo({top:scrollTo,behavior:"smooth"}),document.querySelector("div.join-waitlist button.btn-join-waitlist").click()}},{key:"_updateStickyDrawer",value:function(event){this.drawer.innerHTML="";var PdpButtonConfigurator=this.element.querySelector("button.ProductForm__Configurator"),PdpButtonBundlinator=this.element.querySelector("button.ProductForm__Bundlinator"),PdpButtonCuyDrawer=this.element.querySelector("button.ProductForm__CuyDrawer"),PdpButtonMonogramming=null,pdpButtonAddToCart=this.element.querySelector("button.ProductForm__AddToCart"),pdpWaitList=this.element.querySelector(".ProductForm__WaitList"),showBuyButtons=!0;pdpWaitList&&(showBuyButtons=pdpWaitList.classList.contains("d-none"));var newRow=document.createElement("div");if(newRow.className="row no-gutters",showBuyButtons){var newColumn=document.createElement("div");
18if(newColumn.className="col-12 sticky-atb-btn-wrap",PdpButtonConfigurator){var customizeColumn=newColumn;customizeColumn.appendChild(PdpButtonConfigurator.cloneNode(!0)),newRow.appendChild(customizeColumn)}if(PdpButtonBundlinator){var customizeColumn=newColumn;customizeColumn.appendChild(PdpButtonBundlinator.cloneNode(!0)),newRow.appendChild(customizeColumn)}if(PdpButtonCuyDrawer){var customizeColumn=newColumn;customizeColumn.appendChild(PdpButtonCuyDrawer.cloneNode(!0)),newRow.appendChild(customizeColumn)}if(PdpButtonMonogramming&&PdpButtonConfigurator&&PdpButtonConfigurator.classList.contains("d-none")){var customizeColumn=newColumn;customizeColumn.appendChild(PdpButtonMonogramming.cloneNode(!0)),newRow.appendChild(customizeColumn)}if(pdpButtonAddToCart){var atbColumn=document.createElement("div");atbColumn.className="col-12 sticky-atb-btn-wrap";var atbBtn=pdpButtonAddToCart.cloneNode(!0);pdpButtonAddToCart.classList.contains("d-none")&&(atbColumn.classList.add("d-none"),atbBtn.classList.remove("d-none")),atbColumn.appendChild(atbBtn);var preOrderElement=this.element.querySelector(".ProductForm__CTA .preorder-info ");if(preOrderElement){var preOrderInfo=preOrderElement.cloneNode(!0);atbColumn.appendChild(preOrderInfo)}newRow.appendChild(atbColumn)}}var joinWaitlistForm=this.element.querySelector(".ProductForm__WaitList");if(joinWaitlistForm){var soldOutSunsetEl=joinWaitlistForm.querySelector(".ProductForm__SoldOutSunset"),isSunsettedSticky=soldOutSunsetEl&&!soldOutSunsetEl.classList.contains("d-none"),waitListButton;if(isSunsettedSticky)waitListButton='<div class="col-12"><button class="btn btn-secondary w-100'+(joinWaitlistForm.classList.contains("d-none")?" d-none":"")+'" disabled>Sold Out</button></div>';else{var jwWrapper=this.element.querySelector("#jwWrapper"),stickyLabel=jwWrapper&&jwWrapper.getAttribute("data-pre-launch")==="true"?window.languages.productFormEarlyAccess:window.languages.productFormWaitlist;waitListButton='<div class="col-12"><button class="btn-join-waitlist btn btn-secondary w-100'+(joinWaitlistForm.classList.contains("d-none")?" d-none":"")+'">'+stickyLabel+"</button></div>"}newRow.innerHTML+=waitListButton}this.drawer.appendChild(newRow)}}]),StickyBottomButtons2})(),ProductSection=(function(){function ProductSection2(container){var _this=this;_classCallCheck(this,ProductSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this.viewInSpaceElement=this.element.querySelector("[data-shopify-xr]"),this.productVariants=new ProductVariants(container,this.options),this.waitlistSection=new WaitListSection(container),this.productReviews=new ProductReviews(container),this.productSystems=new ProductSystemsSection(container),this.productHintingModal=new ProductHintingModal(container),this.stickyBottomButtons=new StickyBottomButtons(this.element),this.configuratorModal=document.querySelector("#productConfiguratorModal"),this.bundlinatorModal=document.querySelector("#bundlinatorModal"),this.cuyDrawerBody=document.querySelector('[data-section-type="cuy-drawer-configurator"] .cuy-drawer-body'),this.monogrammingModal=document.querySelector("#monogrammingModal"),this.monogrammingModal&&(this.productMonogramming=new ProductMonogrammingSection(this.monogrammingModal)),this.accessoriesDiv=this.element.querySelector("#accessoriesContent"),this.productWrapperElement=this.element.querySelector(".Product__Wrapper"),this.productInfoElement=this.element.querySelector(".Product__Info"),this.productAsideElement=this.element.querySelector(".Product__Aside"),this.productGalleryElement=this.element.querySelector(".Product__Gallery"),this.quickNav=this.element.querySelector(".Product__QuickNav"),this.productGalleryElement&&(this.productGallery=new ProductGallery(this.element,this.options)),this.productInfoElement&&Stickyfill.addOne(this.productInfoElement);var offscreenElement=this.element.querySelector(".Product__OffScreen");offscreenElement&&this.element.appendChild(offscreenElement),this.productInfoElement&&this._setupDeviceFeatures(),this._attachListeners(),this._autoOpenConfigurator(),document.addEventListener("DOMContentLoaded",function(){var video=_this.element.querySelector("video");video&&video.play().catch(function(){})})}return _createClass(ProductSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productReviews.destroy(),this.productVariants&&this.productVariants.destroy(),this.quickNav&&window.removeEventListener("scroll",this._checkQuickNavListener),this.productInfoScroller&&this.productInfoScroller.destroy(),window.ResizeObserver&&this.productInfoResizeObserver&&this.productInfoResizeObserver.disconnect(),Stickyfill.removeOne(this.productInfoElement),document.removeEventListener("breakpoint:changed",this._onBreakpointChangedListener)}},{key:"_autoOpenConfigurator",value:function(){var params=new URLSearchParams(window.location.search);if(params.get("customize")){var buyButtons=this.element.querySelector(".ProductForm__BuyButtons");if(buyButtons){var candidates=Array.prototype.slice.call(buyButtons.querySelectorAll(".ProductForm__Configurator, .ProductForm__Bundlinator, .ProductForm__CuyDrawer"));if(candidates.length){var done=!1,observer=null,timeoutId=null,visible=function(){return candidates.filter(function(btn
18){return!btn.classList.contains("d-none")})},open=function(btn){done||!btn||(done=!0,observer&&observer.disconnect(),timeoutId&&clearTimeout(timeoutId),btn.click())},current=visible();if(current.length===1){open(current[0]);return}window.MutationObserver&&(observer=new MutationObserver(function(){var v=visible();v.length===1&&open(v[0])}),candidates.forEach(function(btn){observer.observe(btn,{attributes:!0,attributeFilter:["class"]})})),timeoutId=setTimeout(function(){if(!done){done=!0,observer&&observer.disconnect();var fallback=visible()[0];fallback&&fallback.click()}},1e3)}}}}},{key:"_attachListeners",value:function(){if(this._onBreakpointChangedListener=this._setupDeviceFeatures.bind(this),this._checkQuickNavListener=this._checkQuickNav.bind(this),this.delegateElement.on("click",'[data-action="toggle-social-share"]',this._toggleSocialShare.bind(this)),document.addEventListener("breakpoint:changed",this._onBreakpointChangedListener),this.configuratorModal&&this.delegateElement.on("variant:changed",this._updateConfiguratorModal.bind(this)),this.bundlinatorModal&&this.delegateElement.on("variant:changed",this._updateBundlinatorModal.bind(this)),this.cuyDrawerBody&&this.delegateElement.on("variant:changed",this._updateCuyDrawerBody.bind(this)),this.monogrammingModal){this.delegateElement.on("variant:changed",this._updateMonogrammingModal.bind(this));var event={detail:{variant:this.productVariants.currentVariant}};this._updateMonogrammingModal(event)}this.quickNav&&window.addEventListener("scroll",this._checkQuickNavListener),this.accessoriesDiv&&this.delegateElement.on("variant:changed",this._updateAccessoriesAccordion.bind(this))}},{key:"_updateAccessoriesAccordion",value:function(event){var variant=event.detail.variant;const url=window.location.pathname+"?variant="+variant.id+"&view=accessories";var accessoriesDiv=this.accessoriesDiv;accessoriesDiv&&fetch(url).then(response=>response.text()).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const tempAccordionItem=tempElement.querySelector(".accordion-item.accessories"),accordionItem=document.querySelector(".accordion-item.accessories");tempAccordionItem.classList.contains("d-none")?accordionItem.classList.add("d-none"):accordionItem.classList.remove("d-none"),accessoriesDiv.innerHTML=tempElement.querySelector("#accessoriesContent").innerHTML}).catch(error=>{console.error("Failed to fetch accessories content:",error)})}},{key:"_updateMonogrammingModal",value:function(event){var variant=event.detail.variant;this.productMonogramming._updateMonogrammingModal(variant)}},{key:"_updateConfiguratorModal",value:function(event){var _this=this;if(event.target.closest("#productConfiguratorModal"))return;const modalBody=this.configuratorModal.querySelector(".modal-body");if(modalBody){var variant=event.detail.variant;const url=window.location.pathname+"?variant="+variant.id+"&view=configurator-modal";fetch(url).then(response=>response.text()).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const sectionHtml=tempElement.querySelector(".shopify-section").innerHTML;modalBody.innerHTML=sectionHtml}).catch(error=>{console.error("Failed to fetch configurator modal content:",error)})}}},{key:"_updateBundlinatorModal",value:function(event){if(!event.target.closest("#bundlinatorModal")){var modalBody=this.bundlinatorModal.querySelector(".modal-body");if(modalBody){var variant=event.detail.variant,url=window.location.pathname+"?variant="+variant.id+"&view=bundlinator-modal";fetch(url).then(function(response){return response.text()}).then(function(html){var tempElement=document.createElement("div");tempElement.innerHTML=html;var sectionHtml=tempElement.querySelector(".shopify-section");sectionHtml&&(modalBody.innerHTML=sectionHtml.innerHTML)}).catch(function(error){console.error("Failed to fetch bundlinator modal content:",error)})}}}},{key:"_updateCuyDrawerBody",value:function(event){var _this=this;if(!event.target.closest('[data-section-type="cuy-drawer-configurator"]')&&this.cuyDrawerBody){var variant=event.detail.variant,url=window.location.pathname+"?variant="+variant.id+"&view=cuy-drawer-modal";fetch(url).then(function(response){return response.text()}).then(function(html){var tempElement=document.createElement("div");tempElement.innerHTML=html;var sectionHtml=tempElement.querySelector(".shopify-section");sectionHtml&&(_this.cuyDrawerBody.innerHTML=sectionHtml.innerHTML,_this.cuyDrawerBody.dispatchEvent(new CustomEvent("cuy-drawer:body-rerendered",{bubbles:!0})))}).catch(function(error){console.error("Failed to fetch cuy-drawer body content:",error)})}}},{key:"_checkQuickNav",value:function(){var _this3=this,showAsideQuickNav=!1;fastdom.measure(function(){showAsideQuickNav=window.scrollY>=_this3.productAsideElement.offsetTop-_this3.productAsideElement.clientHeight}),fastdom.mutate(function(){showAsideQuickNav?_this3.quickNav.classList.add("is-flipped"):_this3.quickNav.classList.remove("is-flipped")})}},{key:"_toggleSocialShare",value:function(event,target){target.classList.toggle("is-active"),target.classList.toggle("RoundButton--secondaryState"),target.setAttribute("aria-expanded",target.getAttribute("aria-expanded")==="true"?"false":"true"),target.nextElementSibling.setAttribute("aria-hidden",target.nextElementSibling.getAttribute("aria-hidden")==="true"?"false":"true")}},{key:"_setupDeviceFeatures",value:function(event){var _this4=this,currentBreakpoint=event?event.detail.currentBreakpoint:Responsive.getCurrentBreakpoint(),previousBreakpoint=event?event.detail.previousBreakpoint:null;if(currentBreakpoint!==previousBreakpoint)if(currentBreakpoint==="phone"||currentBreakpoint==="tablet")this.productInfoScroller&&this.productInfoScroller.destroy(),this.productAsideElement?this.productAsideElement.style.minHeight=null:this.productWrapperElement.style.minHeight=null,this.productInfoElement.parentNode.style.maxHeight=null;else{var productInfoStyles=window.getComputedStyle(this.productInfoElement),productInfoPadding=parseInt(productInfoStyles.paddingTop)+parseInt(productInfoStyles.paddingBottom),productGalleryHeight=this.productGalleryElement?parseInt(this.productGalleryElement.scrollHeight):0,calculateMinHeight=function(){_this4.productAsideElement?(_this4.productAsideElement.style.minHeight="".concat(_this4.productInfoElement.scrollHeight-productInfoPadding-productGalleryHeight,"px"),_this4.productInfoElement.closest(".Product__InfoWrapper").style.maxHeight=_this4.productAsideElement.offsetTop+_this4.productInfoElement.scrollHeight-productInfoPadding+"px"):_this4.productWrapperElement.style.minHeight="".concat(_this4.productInfoElement.scrollHeight-parseInt(productInfoStyles.paddingTop),"px")};calculateMinHeight(),window.ResizeObserver&&(this.productInfoResizeObserver=new ResizeObserver(function(){calculateMinHeight()}),this.productInfoResizeObserver.observe(this.productInfoElement)),this.productInfoScroller=new OverflowScroller(this.productInfoElement)}}}]),ProductSection2})(),ProductQuickViewSection=(function(){function ProductQuickViewSection2(container){_classCallCheck(this,ProductQuickViewSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this.modal=document.querySelector("#quickViewModal"),this.options.modalDisplay=!0,this.options.showThumbnails=!0,this._attachListeners()}return _createClass(ProductQuickViewSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productVariants&&this.productVariants.destroy(),this.productGallery&&this.productGallery.onUnload()}},{key:"_attachListeners",value:function(){this.modal.addEventListener("shown.bs.modal",this._initModal.bind(this)),this.modal.addEventListener("hide.bs.modal",this._hideModal.bind(this)),this.delegateElement.on("product:added",this._hideModal.bind(this)),this.delegateElement.on("click","[data-quickview-customize]",this._onCustomizeClick.bind(this))}},{key:"_onCustomizeClick",value:function(event,target){event.preventDefault();var productUrl=target.getAttribute("data-product-url");if(productUrl){var variantId=this.productVariants&&this.productVariants.currentVariant?this.productVariants.currentVariant.id:null;window.dataLayer&&window.dataLayer.push({event:"cuyana_customize_btn_click",source:"quickview"});var url=variantId?productUrl+"?variant="+variantId+"&customize=1":productUrl+"?customize=1";window.location.assign(url)}}},{key:"_initModal",value:function(event){event.preventDefault();var target=event.relatedTarget,variant_id=target.getAttribute("data-pid");this.productHandle=target.getAttribute("data-product");var _this=this;const url=window.location.origin+"/products/"+this.productHandle+"?variant="+variant_id+"&view=quickview";fetch(url).then(response=>response.text()).then(html=>{var modalBody=_this.modal.querySelector(".modal-body");const tempElement=document.createElement("div");tempElement.innerHTML=html,modalBody.innerHTML=tempElement.querySelector(".shopify-section").innerHTML,checkPrivateSale(),_this.productVariants&&_this.productVariants.destroy(),_this.waitlistSection&&_this.waitlistSection.destroy(),_this.productGallery&&_this.productGallery.onUnload(),_this.productVariants=new ProductVariants(modalBody,_this.options),_this.waitlistSection=new WaitListSection(modalBody),_this.productGalleryElement=modalBody.querySelector(".Product__Gallery"),_this.productGalleryElement&&(_this.productGallery=new ProductGallery(modalBody,_this.options))}).catch(error=>{console.error("Failed to fetch product quickview modal content:",error)})}},{key:"_hideModal",value:function(event){var modalInstance=bootstrap.Modal.getInstance(this.modal);if(modalInstance){event&&event.type==="product:added"&&modalInstance.hide();var modalBody=this.modal.querySelector(".modal-body");modalBody.innerHTML=""}}}]),ProductQuickViewSection2})(),ProductConfiguratorSection=(function(){function ProductConfiguratorSection2(container){var _this=this;_classCallCheck(this,ProductConfiguratorSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.modal=this.element.querySelector("#productC
18onfiguratorModal"),this.addOnProductSection=this.modal.querySelector(".prdsys-addon-product");const exclusionElement=this.element.querySelector("[data-cex-json]");exclusionElement&&exclusionElement.innerHTML.trim()!==""&&(this.exclusions=JSON.parse(exclusionElement.innerHTML));var urlParams=new URLSearchParams(window.location.search),showconfig=urlParams.get("showconfig");showconfig&&!this.element.hasAttribute("data-configurator-portable")&&(this.selectionsTemp=null,this.selectionsFinal=null,bootstrap.Modal.getOrCreateInstance(this.modal).show()),_this.monogramVariants=!1,this.element.hasAttribute("data-configurator-portable")||this._loadMonogramVariants(),this._attachListeners()}return _createClass(ProductConfiguratorSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productVariants&&this.productVariants.destroy()}},{key:"_loadMonogramVariants",value:function(){if(!this._monoRequested){this._monoRequested=!0;var _this=this,monogrammingDataUrl=window.location.origin+"/products/mono-service.json";fetch(monogrammingDataUrl).then(response=>response.text()).then(html=>{var monogramProductA=html.trim()?JSON.parse(html):{};fetch(window.location.origin+"/products/mono-service-both-cases.json").then(response=>response.text()).then(html2=>{var monogramProductB=html2.trim()?JSON.parse(html2):{};_this.monogramVariants=[...monogramProductA?.product?.variants,...monogramProductB?.product?.variants]})}).catch(error=>{console.error("Failed to fetch monogramming product data for configurator:",error)})}}},{key:"_attachListeners",value:function(){var _this=this;this.modal.addEventListener("shown.bs.modal",this._initModal.bind(this)),this.modal.addEventListener("hidden.bs.modal",this._resetModal.bind(this)),this.modal.querySelector(".prdsys-option-gifting")&&(this.modal.querySelector("input[name='giftbox']").addEventListener("change",function(e){_this._toggleGiftBoxSelection(e)}),this.delegateElement.on("click",".prdsys-option-gifting",this._showSection.bind(this,"gifting",!0)),this.delegateElement.on("click",".prdsys-gifting .prdsys-selection-select",this._toggleGiftBoxSelection.bind(this)),this.delegateElement.on("click",".prdsys-gifting-save",this._saveSelections.bind(this)),this.delegateElement.on("click",".prdsys-gifting-cancel",this._showSection.bind(this,"options",!1))),this.delegateElement.on("click",".prdsys-option-addons",this._showSection.bind(this,"addons",!0)),this.delegateElement.on("click",".prd-sys-review",this._showSection.bind(this,"review",!1)),this.delegateElement.on("click",".addonItemCards .addonItemCard",this._getAddOnItemDetails.bind(this)),this.delegateElement.on("click",".prdsys-addon-detail
18s-cancel",this._addonDetailCancel.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-remove",this._addOnItemDetailRemove.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-add",this._addOnItemSave.bind(this)),this.delegateElement.on("click","#showMonogramming",this._toggleAddOnItemMonogramming.bind(this)),this.delegateElement.on("click",".prdsys-back-to-edit",this._showSection.bind(this,"addons",!1)),this.delegateElement.on("click",".prd-sys-add-to-bag",this._addItemsToCart.bind(this)),this.delegateElement.on("click",".cuyconfig-review-back",this._showSection.bind(this,"addons",!1)),this.delegateElement.on("click",".cuyconfig-header__back",this._onHeaderBack.bind(this)),this.delegateElement.on("click",".cuyconfig-review-remove",this._reviewItemRemove.bind(this)),this.delegateElement.on("click",".variantItemCards .variantItemCard",this._selectVariant.bind(this)),this.delegateElement.on("variant:changed",this._updateAddon.bind(this)),this.element.hasAttribute("data-configurator-portable")&&document.addEventListener("click",function(e){var trigger=e.target.closest("[data-configurator-open]");if(trigger){e.preventDefault();var handle=trigger.getAttribute("data-product-handle"),variantId=trigger.getAttribute("data-variant-id");handle&&_this._openFromLauncher(handle,variantId)}})}},{key:"_initModal",value:function(event){document.body.classList.add("cuyconfig-open"),this._loadMonogramVariants(),this.addOnProductSection=this.modal.querySelector(".prdsys-addon-product");var baseProductEl=this.element.querySelector("[data-baseproduct-json]");if(!baseProductEl){var emptyInstance=bootstrap.Modal.getInstance(this.modal);emptyInstance&&emptyInstance.hide();return}this.baseproduct=JSON.parse(baseProductEl.innerHTML||"{}"),this._savedState&&this._savedState.variantId===this.baseproduct.id?(this.selectionsFinal=this._savedState.selectionsFinal.slice(),this.selectionsFinal[0]=this.baseproduct):(this.selectionsTemp=null,this.selectionsFinal=[this.baseproduct],this._savedState=null);const giftBoxSelection=this.modal.querySelector("input[name='giftbox']");giftBoxSelection&&(giftBoxSelection.checked=!1);const attentiveOverlay=document.getElementById("attentive_overlay");attentiveOverlay&&attentiveOverlay.classList.add("d-none");var headerName=this.modal.querySelector(".cuyconfig-header__name");if(headerName&&this.baseproduct&&this.baseproduct.name&&(headerName.textContent=this.baseproduct.name),this._entryMode==="variants"){var variantTiles=this.modal.querySelectorAll(".prdsys-variants .variantItemCard");variantTiles.length===1?this._chooseVariantTile(variantTiles[0],event):this._showSection("variants",!0,event)}else this._showSection("addons",!0,event)}},{key:"_resetModal",value:function(event){if(document.body.classList.remove("cuyconfig-open"),this._launcherMode=!1,this._entryMode=null,this.modal.classList.remove("cuyconfig-can-goback"),this._addedToCart)this._savedState=null,this._addedToCart=!1;else{var selectionsToSave=this.selectionsTemp||this.selectionsFinal;this.baseproduct&&selectionsToSave&&(this._savedState={variantId:this.baseproduct.id,selectionsFinal:selectionsToSave.slice()})}const optionGifting=this.modal.querySelector(".prdsys-option-gifting");optionGifting&&(optionGifting.querySelector(".option-info").innerHTML="",optionGifting.classList.remove("selected"));const optionAddons=this.modal.querySelector(".prdsys-option-addons");optionAddons&&(optionAddons.querySelector(".option-info").innerHTML="",optionAddons.classList.remove("selected")),this._showSection("addons",!1,event);const attentiveOverlay=document.getElementById("attentive_overlay");attentiveOverlay&&attentiveOverlay.classList.remove("d-none")}},{key:"_buildPayloadItems",value:function(productLineGroupID,item,hasGiftbox){var items=[],productProperties={...item.properties,_line_group:productLineGroupID};const currentDate=new Date;let uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);if(productProperties._uuid=uuid,hasGiftbox&&(productProperties._is_giftwrapped=!0),productProperties._is_baseproduct=item.isBaseProduct,item.monogramming&&item.monogramming.text){var monoProperties={"Monogram Details":item.monogramming.text,"Monogram Color":item.monogramming.color,"Monogram Size":item.monogramming.size,is_final_sale:!0,_LPROP:"no-returns"},productToAddToCart={id:item.id,quantity:1,properties:{...productProperties,...monoProperties}};items.push(productToAddToCart);let monoProductUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var monoProductToAddToCart={id:item.monogramming.pid,quantity:1,properties:{_hidden:!0,_uuid:monoProductUuid,_parent_uuid:productProperties._uuid,_is_monogram:!0,_line_group:productLineGroupID}};items.push(monoProductToAddToCart)}else{var productToAddToCart={id:item.id,quantity:1,properties:productProperties};items.push(productToAddToCart)}if(item.giftbox){let giftboxUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var giftBoxProductToAddToCart={id:item.giftbox.id,quantity:1,properties:{_hidden:!0,_uuid:giftboxUuid,_parent_uuid:productProperties._uuid,_is_giftbox:!0,_line_group:productLineGroupID}};items.push(giftBoxProductToAddToCart)}return items}},{key:"_buildPayload",value:async function(configuratorSelections){var _this=this,payload={items:[]},productLineGroupsUsed=[];const hasGiftbox=configuratorSelections.some(item=>item.giftbox);var productLineGroupID=await _generateLineGroupID(productLineGroupsUsed);productLineGroupsUsed.push(productLineGroupID);const promises=configuratorSelections.map(async function(item){var items2=_this._buildPayloadItems(productLineGroupID,item,hasGiftbox);return items2}),items=await Promise.all(promises);return payload.items=items.flat(),payload}},{key:"_addItemsToCart",value:function(event){event.preventDefault(),event.stopPropagation();var _this=this,addToCartButton2=event.target,configuratorSelectionsFinal=this.selectionsFinal.slice().reverse();this._buildPayload(configuratorSelectionsFinal).then(function(payload){fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){if(response.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:configuratorSelectionsFinal.length,source:"configurator",products:configuratorSelectionsFinal.map(function(item){return{id:item.id,sku:item.sku||"",mpid:item.mpid,name:item.name,color:item.color,size:item.size,price:parseFloat(item.price.decimalValue),isBaseProduct:item.isBaseProduct}})},bubbles:!0})),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),checkPrivateSale(),_this._addedToCart=!0;var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}else response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})})}}
18,{key:"_addOnItemRemove",value:function(event){event.preventDefault(),event.stopPropagation();var addonItemCard=event.target.closest("div.addonItemCard"),productIdToRemove=addonItemCard.getAttribute("data-pid");this.selectionsTemp=this.selectionsTemp.filter(function(selection){return selection.id!==productIdToRemove}),addonItemCard.classList.remove("selected"),this._updateItemCount()}},{key:"_addOnItemDetailRemove",value:function(event){event.preventDefault(),event.stopPropagation();var addButton=this.addOnProductSection.querySelector(".prdsys-addon-details-add"),mpid=addButton?addButton.getAttribute("data-mpid"):null;mpid&&(this.selectionsTemp=this.selectionsTemp.filter(function(selection){return selection.mpid!==mpid}),this.modal.querySelectorAll(".prdsys-addons .addonItemCard").forEach(function(card){card.getAttribute("data-mpid")===mpid&&card.classList.remove("selected")}),this._updateItemCount()),this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_reviewItemRemove",value:function(event){event.preventDefault(),event.stopPropagation();var btn=event.target.closest(".cuyconfig-review-remove")||event.target,mpid=btn.getAttribute("data-mpid");if(mpid){this.selectionsFinal=this.selectionsFinal.filter(function(s){return s.mpid!==mpid}),this.selectionsTemp=this.selectionsFinal.slice();var reviewItem=btn.closest(".cuyconfig-review-item");reviewItem&&reviewItem.remove(),this.modal.querySelectorAll(".prdsys-addons .addonItemCard").forEach(function(card){card.getAttribute("data-mpid")===mpid&&card.classList.remove("selected")});var USDollar=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}),totalPrice=this.selectionsFinal.reduce(function(sum,item){var price=item.price?.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price.decimalValue);return item.monogramming&&item.monogramming.cost&&(price+=parseFloat(item.monogramming.cost)+parseFloat(item.monogramming.upCharge)),item.isBaseProduct&&item.giftbox&&item.giftbox.id&&(price+=parseFloat(item.giftbox.price.decimalValue)),sum+price},0),totalEl=this.modal.querySelector(".prdsys-summary .cuyconfig-review-total");totalEl&&(totalEl.innerHTML=USDollar.format(totalPrice));var totalCountEl=this.modal.querySelector(".cuyconfig-totals-count"),totalLabelEl=this.modal.querySelector(".cuyconfig-totals-label"),totalPriceEl=this.modal.querySelector(".cuyconfig-totals-price");totalCountEl&&(totalCountEl.textContent=this.selectionsFinal.length),totalLabelEl&&(totalLabelEl.textContent=this.selectionsFinal.length===1?"Item":"Items"),totalPriceEl&&(totalPriceEl.textContent=USDollar.format(totalPrice)),this._updateItemCount()}}},{key:"_addOnItemSave",value:function(event){event.preventDefault(),event.stopPropagation();var pid=event.target.getAttribute("data-pid"),mpid=event.target.getAttribute("data-mpid"),name=event.target.getAttribute("data-name"),color=event.target.getAttribute("data-color"),size=event.target.getAttribute("data-size"),preorder=event.target.getAttribute("data-preorder"),final_sale=event.target.getAttribute("data-finalsale"),price=event.target.getAttribute("data-price").replace(/,/g,"").trim(),compare_at_price=event.target.getAttribute("data-compareat").replace(/,/g,"").trim(),custom_sale_price=event.target.getAttribute("data-customsale")?.replace(/,/g,"").trim(),image=event.target.getAttribute("data-image"),handle=event.target.getAttribute("data-handle"),stock_date=event.target.getAttribute("data-stockdate"),productToAdd={id:pid,mpid,handle,name,color,size,image,isBaseProduct:!1,stockdate:stock_date,properties:{},price:{decimalValue:parseFloat(price).toFixed(2),value:parseFloat(price).toFixed(2),formatted:"$"+price}};custom_sale_price&&(productToAdd.price.customSalePrice=parseFloat(custom_sale_price).toFixed(2)),compare_at_price&&(productToAdd.properties._compare_at_price=parseFloat(compare_at_price)),preorder==="true"&&(productToAdd.properties._is_preorder=!0,stock_date&&(productToAdd.properties._est_ship_date=stock_date)),final_sale==="true"&&(productToAdd.properties.is_final_sale=!0,productToAdd.properties._LPROP="no-returns");var configuratorSelectionsTemp=this.selectionsTemp;this.selectionsTemp=configuratorSelectionsTemp.filter(function(selection){return selection.mpid!==mpid}),this.selectionsTemp.push(productToAdd);var plpImage=event.target.getAttribute("data-plpimage"),cardImageSrc=plpImage||image,addonCard=this.modal.querySelector('.prdsys-addons .addonItemCard[data-mpid="'+mpid+'"]');if(addonCard&&cardImageSrc){var cardImg=addonCard.querySelector("img");cardImg&&(cardImg.src=cardImageSrc)}this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_addonDetailCancel",value:function(event){this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_updateAddon",value:function(event){var newVariant=event.detail.variant;if(this._updateAddOnSaveButton(newVariant),this._updateAddOnGallery(newVariant),newVariant&&newVariant.custom_private_sale_price)checkPrivateSale();else{const strikethroughPrices=this.element.querySelectorAll(".ProductItem__CustomStrikethroughPrice");
18strikethroughPrices.length&&(strikethroughPrices.forEach(element=>{element.classList.add("d-none")}),this.element.querySelectorAll(".ProductItem__DefaultPrice").forEach(element=>{element.classList.remove("d-none")}))}}},{key:"_updateAddOnGallery",value:function(newVariant){if(!(!newVariant||!newVariant.featured_image)){var img=this.addOnProductSection.querySelector(".cuyconfig-addon-image img");img&&(img.src=newVariant.featured_image.src)}}},{key:"_updateAddOnSaveButton",value:function(newVariant){var saveButton=this.addOnProductSection.querySelector(".prdsys-addon-details-add");if(saveButton)if(saveButton.classList.remove("d-none"),!newVariant)saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.innerHTML=window.languages.productFormUnavailable;else if(newVariant.available){saveButton.removeAttribute("disabled"),saveButton.textContent.trim()!=="Update"&&(saveButton.innerHTML="Add"),saveButton.setAttribute("data-pid",newVariant.id),saveButton.setAttribute("data-price",(newVariant.price/100).toFixed(2)),newVariant.compare_at_price?saveButton.setAttribute("data-compareat",(newVariant.compare_at_price/100).toFixed(2)):saveButton.setAttribute("data-compareat",""),newVariant.custom_private_sale_price?saveButton.setAttribute("data-customsale",(newVariant.custom_private_sale_price/100).toFixed(2)):saveButton.setAttribute("data-customsale",""),newVariant.is_preorder?(saveButton.innerHTML=window.languages.productFormPreorder,saveButton.setAttribute("data-preorder","true")):saveButton.setAttribute("data-preorder",""),newVariant.is_final_sale?saveButton.setAttribute("data-finalsale","true"):saveButton.setAttribute("data-finalsale",""),newVariant.hasOwnProperty("option1")&&saveButton.setAttribute("data-color",newVariant.option1),newVariant.hasOwnProperty("option2")?saveButton.setAttribute("data-size",newVariant.option2):saveButton.setAttribute("data-size",""),newVariant.hasOwnProperty("back_in_stock_date")?saveButton.setAttribute("data-stockdate",newVariant.back_in_stock_date):saveButton.setAttribute("data-stockdate",""),newVariant.hasOwnProperty("featured_image")&&newVariant.featured_image.src&&saveButton.setAttribute("data-image",newVariant.featured_image.src);try{var productDataEl=this.addOnProductSection.querySelector("[data-product-json]");if(productDataEl){var productData=JSON.parse(productDataEl.textContent),variantExtra=productData.variants_extra_data&&productData.variants_extra_data[newVariant.id];if(variantExtra&&variantExtra.plp_image){var plpBase=variantExtra.plp_image.replace(/\?.*$/,"");saveButton.setAttribute("data-plpimage",plpBase+"?width=600&height=600&crop=center")}}}catch{}}else saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.setAttribute("data-preorder",""),saveButton.setAttribute("data-finalsale",""),saveButton.innerHTML=window.languages.productFormSoldOut}},{key:"_getAddOnItemDetails",value:function(event){event.preventDefault();var addonItemCard=event.target.closest(".addonItemCard"),variant_id=addonItemCard.getAttribute("data-pid"),addonProductHandle=addonItemCard.getAttribute("data-product"),addonMpid=addonItemCard.getAttribute("data-mpid"),isAlreadySelected=this.selectionsTemp&&this.selectionsTemp.some(function(s){return s.mpid===addonMpid});if(isAlreadySelected){var existingSelection=this.selectionsTemp.find(function(s){return s.mpid===addonMpid});existingSelection&&existingSelection.id&&(variant_id=existingSelection.id)}this._openAddonDetail(addonProductHandle,variant_id,addonMpid,isAlreadySelected,!1)}},{key:"_openAddonDetail",value:function(handle,variantId,mpid,isAlreadySelected,fromReview){var _this=this,url=window.location.origin+"/products/"+handle+"?variant="+variantId+"&view=configurator-addon";fetch(url).then(function(response){return response.text()}).then(function(html){var tempElement=document.createElement("div");tempElement.innerHTML=html,_this.exclusions&&_this.exclusions.length>0&&_this.exclusions.forEach(function(item){var baseProducts=item.baseProducts,exclusions=item.exclusions,exclusionKeys=Object.keys(exclusions);(baseProducts.length===0||baseProducts.includes(_this.baseproduct.sku))&&exclusionKeys.forEach(function(key){key===handle&&exclusions[key].forEac
18h(function(attr){var attrEl=tempElement.querySelector('.ProductForm__Option li[data-value="'+attr+'"]');attrEl&&attrEl.remove()})})});var sectionHtml=tempElement.querySelector(".shopify-section").innerHTML;if(_this.addOnProductSection.innerHTML=sectionHtml,checkPrivateSale(),_this.productVariants=new ProductVariants(_this.addOnProductSection,{}),isAlreadySelected){var cancelBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-cancel"),removeBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-remove"),addBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-add");cancelBtn&&cancelBtn.classList.add("d-none"),removeBtn&&removeBtn.classList.remove("d-none"),addBtn&&!addBtn.disabled&&(addBtn.textContent="Update")}_this._detailFromReview=fromReview,fromReview?_this.modal.querySelector(".prdsys-summary").style.display="none":_this.modal.querySelector(".prdsys-main").classList.add("d-none"),_this.addOnProductSection.classList.remove("d-none"),_this.modal.classList.add("cuyconfig-detail-active")}).catch(function(error){console.error("Failed to fetch configurator add-on detail:",error)})}},{key:"_toggleAddOnItemMonogramming",value:function(event){var clickedElement=event.target,productMonogramming=this.addOnProductSection.querySelector(".product-monogramming");if(productMonogramming.classList.toggle("show",clickedElement.checked),document.documentElement.clientWidth>768){var scrollWrapper=this.modal.querySelector(".scroll-wrapper");scrollWrapper.scrollTop=scrollWrapper.querySelector(".scroller").scrollHeight,productMonogramming.classList.contains("mobile-show")&&productMonogramming.classList.remove("mobile-show")}}},{key:"_toggleGiftBoxSelection",value:function(event){event.preventDefault();var giftboxCard=event.target.closest(".addonItemCard");if(giftboxCard){var pid=giftboxCard.getAttribute("data-pid"),mpid=giftboxCard.getAttribute("data-mpid"),price=giftboxCard.getAttribute("data-price").replace(/^\s+|\s+$/g,"");if(pid){var configuratorSelectionsTemp=this.selectionsTemp;if(configuratorSelectionsTemp.length>0&&mpid==="giftbox"){var giftboxInput=this.modal.querySelector("input[name='giftbox']");if(giftboxCard.classList.contains("selected"))configuratorSelectionsTemp[0].giftbox=null,giftboxCard.classList.remove("selected"),giftboxInput.checked=!1;else{var giftbox={id:pid,mpid,name:this.modal.querySelector(".gift-product-name").textContent,color:"",size:"",price:{decimalValue:parseFloat(price),value:parseFloat(price),formatted:"$"+price}};configuratorSelectionsTemp[0].giftbox=giftbox,giftboxCard.classList.add("selected"),giftboxInput.checked=!0}}this.selectionsTemp=configuratorSelectionsTemp}}}},{key:"_saveSelections",value:function(event){event.preventDefault(),this.selectionsFinal=this.selectionsTemp,this._showSection("addons",!1,event)}},{key:"_showSection",value:function(section="",setTempStorage=!1,event){event.preventDefault(),this.addOnProductSection.classList.add("d-none"),this.modal.querySelector(".prdsys-main").classList.remove("d-none"),this.modal.classList.remove("cuyconfig-detail-active");var modalBody=this.modal.querySelector(".modal-body");modalBody&&(modalBody.scrollTop=0),setTempStorage&&(this.selectionsTemp=this.selectionsFinal?this.selectionsFinal:[]);const optionsSection=this.modal.querySelector(".prdsys-options");if(optionsSection&&(optionsSection.style.display="none"),section==="addons"){var configuratorSelectionsTemp=this.selectionsTemp,addonCards=this.modal.querySelectorAll(".prdsys-addons .addonItemCard");addonCards.forEach(function(card){card.classList.remove("selected");var mpid=card.dataset.mpid;configuratorSelectionsTemp.forEach(function(selection){selection.mpid===mpid&&card.classList.add("selected")})}),this.modal.querySelector(".prdsys-addons").style.display="block"}else this.modal.querySelector(".prdsys-addons").style.display="none";if(section==="variants"){var variantsSection=this.modal.querySelector(".prdsys-variants");variantsSection.style.display="block";var baseColor=this.baseproduct&&this.baseproduct.color;variantsSection.querySelectorAll(".variantItemCard").forEach(function(tile){tile.classList.toggle("selected",tile.getAttribute("data-color")===baseColor)})}else{var _pv=this.modal.querySelector(".prdsys-variants");_pv&&(_pv.style.display="none")}if(this._launcherMode&&section==="addons"?this.modal.classList.add("cuyconfig-can-goback"):this.modal.classList.remove("cuyconfig-can-goback"),this._currentSection=section,section==="gifting")this.modal.querySelector(".prdsys-gifting").style.display="block";else{const optionGifting=this.modal.querySelector(".prdsys-gifting");optionGifting&&(optionGifting.style.display="none")}if(section==="review"){let USDollar=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0});this.selectionsFinal=this.selectionsTemp;var productSelectionsContainer=this.modal.querySelector(".prdsys-summary .product-selections");productSelectionsContainer.innerHTML="";var totalPrice=0;this.selectionsFinal.forEach(function(item){let reviewItemHtml=document.querySelector("#productC
18onfiguratorModal div.reviewItemHtml .cuyconfig-review-item").cloneNode(!0),productImage=reviewItemHtml.querySelector("img");productImage.src=item.image,productImage.alt=item.name,productImage.title=item.name;var attributes="";item.properties.is_final_sale&&(attributes+='<p class="CartItem__FinalSale">Final Sale</p>'),item.properties._is_preorder&&(attributes+='<p class="CartItem__Preorder">Estimated to ship <span class="instock-date">'+item.stockdate+"</span></p>"),attributes+=item.color?"<p>"+item.color:"",item.size&&item.size!="One Size"&&item.size!="Null"&&(attributes+=", "+item.size),attributes+="</p>";var monogramming="";monogramming=item.monogramming&&item.monogramming.text?"Monogram: "+item.monogramming.text:"";var itemPrice=item.price.decimalValue,priceHtml="";item.price?.customSalePrice&&item.price.customSalePrice<item.price.decimalValue?(itemPrice=parseFloat(item.price.customSalePrice).toFixed(2),priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price Price--compareAt Text--subdued d-none">'+USDollar.format(item.price.decimalValue)+"</span>",priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price d-none">'+USDollar.format(item.price.customSalePrice)+"</span>"):priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price d-none">'+USDollar.format(item.price.decimalValue)+"</span>",priceHtml+='<span class="ProductItem__Price ProductItem__DefaultPrice Price">'+USDollar.format(item.price.decimalValue)+"</span>",totalPrice+=parseFloat(itemPrice),reviewItemHtml.querySelector(".product-name").innerHTML=item.name,reviewItemHtml.querySelector(".product-price").innerHTML=priceHtml,reviewItemHtml.querySelector(".product-attributes").innerHTML=attributes,reviewItemHtml.querySelector(".product-monogramming").innerHTML=monogramming,item.isBaseProduct&&item.giftbox&&item.giftbox.id&&(reviewItemHtml.querySelector(".product-giftoptions").innerHTML="Gift Box Added",totalPrice+=parseFloat(item.giftbox.price.decimalValue)),item.monogramming&&item.monogramming.cost&&(totalPrice+=parseFloat(item.monogramming.cost)+parseFloat(item.monogramming.upCharge));var removeBtn=reviewItemHtml.querySelector(".cuyconfig-review-remove");item.isBaseProduct||removeBtn&&(removeBtn.classList.remove("d-none"),removeBtn.setAttribute("data-mpid",item.mpid)),productSelectionsContainer.appendChild(reviewItemHtml)});var reviewTotalEl=this.modal.querySelector(".prdsys-summary .cuyconfig-review-total");reviewTotalEl&&(reviewTotalEl.innerHTML=USDollar.format(totalPrice));var totalCountEl=this.modal.querySelector(".cuyconfig-totals-count"),totalLabelEl=this.modal.querySelector(".cuyconfig-totals-label"),totalPriceEl=this.modal.querySelector(".cuyconfig-totals-price");totalCountEl&&(totalCountEl.textContent=this.selectionsFinal.length),totalLabelEl&&(totalLabelEl.textContent=this.selectionsFinal.length===1?"Item":"Items"),totalPriceEl&&(totalPriceEl.textContent=USDollar.format(totalPrice)),this.modal.classList.add("cuyconfig-in-review"),this.modal.querySelector(".prdsys-summary").style.display="block"}else this.modal.classList.remove("cuyconfig-in-review"),this.modal.querySelector(".prdsys-summary").style.display="none";this._updateItemCount(),checkPrivateSale()}},{key:"_updateItemCount",value:function(){var selections=this.selectionsTemp||this.selectionsFinal||[],count=selections.length,countEl=this.modal.querySelector(".cuyconfig-item-count"),labelEl=this.modal.querySelector(".cuyconfig-item-label");countEl&&(countEl.textContent=count),labelEl&&(labelEl.textContent=count===1?"Item":"Items");var totalPrice=selections.reduce(function(sum,item){var price=item.price&&item.price.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price&&item.price.decimalValue||0);return sum+(isNaN(price)?0:price)},0),priceEl=this.modal.querySelector(".cuyconfig-header__price");priceEl&&(priceEl.textContent=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}).format(totalPrice))}},{key:"_onHeaderBack",value:function(event){this.modal.classList.contains("cuyconfig-in-review")?this._showSection("addons",!1,event):this._launcherMode&&this._currentSection==="addons"?this._showSection("variants",!1,event):this._showSection("addons",!1,event)}},{key:"_selectVariant",value:function(event){event.preventDefault(),this._chooseVariantTile(event.target.closest(".variantItemCard"),event)}}
18,{key:"_chooseVariantTile",value:function(tile,event){if(tile){var _this=this,handle=tile.getAttribute("data-handle"),variantId=tile.getAttribute("data-variant-id");if(this.baseproduct&&String(this.baseproduct.id)===String(variantId)){this._showSection("addons",!0,event);return}this._fetchBody(handle,variantId,function(){_this._initBaseProduct(),_this._showSection("addons",!0,event)})}}},{key:"_openFromLauncher",value:function(handle,variantId){var _this=this;this._launcherMode=!0,this._entryMode="variants",this._launcherHandle=handle,this._fetchBody(handle,variantId||null,function(){var tiles=_this.modal.querySelectorAll(".prdsys-variants .variantItemCard");if(tiles.length===0){window.location.href=window.location.origin+"/products/"+handle;return}bootstrap.Modal.getOrCreateInstance(_this.modal).show()})}},{key:"_fetchBody",value:function(handle,variantId,done){var _this=this,url=window.location.origin+"/products/"+handle+"?view=configurator-modal"+(variantId?"&variant="+variantId:"");fetch(url).then(function(response){return response.text()}).then(function(html){var temp=document.createElement("div");temp.innerHTML=html;var section=temp.querySelector(".shopify-section"),modalBody=_this.modal.querySelector(".modal-body");modalBody&&(modalBody.innerHTML=section?section.innerHTML:html),_this.addOnProductSection=_this.modal.querySelector(".prdsys-addon-product"),checkPrivateSale(),done&&done()}).catch(function(error){console.error("Failed to fetch configurator modal body:",error)})}},{key:"_initBaseProduct",value:function(){var baseEl=this.element.querySelector("[data-baseproduct-json]");this.baseproduct=JSON.parse(baseEl&&baseEl.innerHTML||"{}"),this.selectionsTemp=null,this.selectionsFinal=[this.baseproduct],this._savedState=null;var exEl=this.element.querySelector("[data-cex-json]");if(exEl&&exEl.innerHTML.trim()!=="")try{this.exclusions=JSON.parse(exEl.innerHTML)}catch{}var headerName=this.modal.querySelector(".cuyconfig-header__name");headerName&&this.baseproduct.name&&(headerName.textContent=this.baseproduct.name)}}]),ProductConfiguratorSection2})(),BundlinatorSection=(function(){function BundlinatorSection2(container){var _this=this;_classCallCheck(this,BundlinatorSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.modal=this.element.querySelector("#bundlinatorModal"),this.addOnProductSection=this.modal.querySelector(".prdsys-addon-product");const exclusionElement=this.element.querySelector("[data-cex-json]");exclusionElement&&exclusionElement.innerHTML.trim()!==""&&(this.exclusions=JSON.parse(exclusionElement.innerHTML));var urlParams=new URLSearchParams(window.location.search),showconfig=urlParams.get("showbundlinator");showconfig&&(this.selectionsTemp=null,this.selectionsFinal=null,bootstrap.Modal.getOrCreateInstance(this.modal).show()),_this.monogramVariants=!1;const monogrammingDataUrl=window.location.origin+"/products/mono-service.json";fetch(monogrammingDataUrl).then(response=>response.text()).then(html=>{var monogramProductA=html.trim()?JSON.parse(html):{};fetch(window.location.origin+"/products/mono-service-both-cases.json").then(response=>response.text()).then(html2=>{var monogramProductB=html2.trim()?JSON.parse(html2):{};_this.monogramVariants=[...monogramProductA?.product?.variants,...monogramProductB?.product?.variants]})}).catch(error=>{console.error("Failed to fetch monogramming product data for bundlinator:",error)}),this._attachListeners()}return _createClass(BundlinatorSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productVariants&&this.productVariants.destroy()}},{key:"_attachListeners",value:function(){var _this=this;this.modal.addEventListener("shown.bs.modal",this._initModal.bind(this)),this.modal.addEventListener("hidden.bs.modal",this._resetModal.bind(this)),this.modal.querySelector(".prdsys-option-gifting")&&(this.modal.querySelector("input[name='giftbox']").addEventListener("change",function(e){_this._toggleGiftBoxSelection(e)}),this.delegateElement.on("click",".prdsys-option-gifting",this._showSection.bind(this,"gifting",!0)),this.delegateElement.on("click",".prdsys-gifting .prdsys-selection-select",this._toggleGiftBoxSelection.bind(this)),this.delegateElement.on("click",".prdsys-gifting-save",this._saveSelections.bind(this)),this.delegateElement.on("click",".prdsys-gifting-cancel",this._showSection.bind(this,"options",!1))),this.delegateElement.on("click",".prdsys-option-addons",this._showSection.bind(this,"addons",!0)),this.delegateElement.on("click",".prd-sys-review",this._showSection.bind(this,"review",!1)),this.delegateElement.on("click",".addonItemCards .addonItemCard",this._getAddOnItemDetails.bind(this)),this.delegateElement.on("click",".prdsys-addon-detail
18s-cancel",this._addonDetailCancel.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-remove",this._addOnItemDetailRemove.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-add",this._addOnItemSave.bind(this)),this.delegateElement.on("click","#showMonogramming",this._toggleAddOnItemMonogramming.bind(this)),this.delegateElement.on("click",".prdsys-back-to-edit",this._showSection.bind(this,"addons",!1)),this.delegateElement.on("click",".prd-sys-add-to-bag",this._addItemsToCart.bind(this)),this.delegateElement.on("click",".bundlinator-review-back",this._showSection.bind(this,"addons",!1)),this.delegateElement.on("click",".bundlinator-header__back",this._showSection.bind(this,"addons",!1)),this.delegateElement.on("click",".bundlinator-review-remove",this._reviewItemRemove.bind(this)),this.delegateElement.on("variant:changed",this._updateAddon.bind(this))}},{key:"_initModal",value:function(event){document.body.classList.add("bundlinator-open"),this.addOnProductSection=this.modal.querySelector(".prdsys-addon-product"),this.baseproduct=JSON.parse(this.element.querySelector("[data-baseproduct-json]").innerHTML||"{}"),this._savedState&&this._savedState.variantId===this.baseproduct.id?(this.selectionsFinal=this._savedState.selectionsFinal.slice(),this.selectionsFinal[0]=this.baseproduct):(this.selectionsTemp=null,this.selectionsFinal=[this.baseproduct],this._savedState=null);const giftBoxSelection=this.modal.querySelector("input[name='giftbox']");giftBoxSelection&&(giftBoxSelection.checked=!1);const attentiveOverlay=document.getElementById("attentive_overlay");attentiveOverlay&&attentiveOverlay.classList.add("d-none"),this._showSection("addons",!0,event)}},{key:"_resetModal",value:function(event){if(document.body.classList.remove("bundlinator-open"),this._addedToCart)this._savedState=null,this._addedToCart=!1;else{var selectionsToSave=this.selectionsTemp||this.selectionsFinal;this.baseproduct&&selectionsToSave&&(this._savedState={variantId:this.baseproduct.id,selectionsFinal:selectionsToSave.slice()})}const optionGifting=this.modal.querySelector(".prdsys-option-gifting");optionGifting&&(optionGifting.querySelector(".option-info").innerHTML="",optionGifting.classList.remove("selected"));const optionAddons=this.modal.querySelector(".prdsys-option-addons");optionAddons&&(optionAddons.querySelector(".option-info").innerHTML="",optionAddons.classList.remove("selected")),this._showSection("addons",!1,event);const attentiveOverlay=document.getElementById("attentive_overlay");attentiveOverlay&&attentiveOverlay.classList.remove("d-none")}},{key:"_buildPayloadItems",value:function(productLineGroupID,item,hasGiftbox){var items=[],productProperties={...item.properties,_line_group:productLineGroupID};const currentDate=new Date;let uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);if(productProperties._uuid=uuid,hasGiftbox&&(productProperties._is_giftwrapped=!0),productProperties._is_baseproduct=item.isBaseProduct,item.monogramming&&item.monogramming.text){var monoProperties={"Monogram Details":item.monogramming.text,"Monogram Color":item.monogramming.color,"Monogram Size":item.monogramming.size,is_final_sale:!0,_LPROP:"no-returns"},productToAddToCart={id:item.id,quantity:1,properties:{...productProperties,...monoProperties}};items.push(productToAddToCart);let monoProductUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var monoProductToAddToCart={id:item.monogramming.pid,quantity:1,properties:{_hidden:!0,_uuid:monoProductUuid,_parent_uuid:productProperties._uuid,_is_monogram:!0,_line_group:productLineGroupID}};items.push(monoProductToAddToCart)}else{var productToAddToCart={id:item.id,quantity:1,properties:productProperties};items.push(productToAddToCart)}if(item.giftbox){let giftboxUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var giftBoxProductToAddToCart={id:item.giftbox.id,quantity:1,properties:{_hidden:!0,_uuid:giftboxUuid,_parent_uuid:productProperties._uuid,_is_giftbox:!0,_line_group:productLineGroupID}};items.push(giftBoxProductToAddToCart)}return items}},{key:"_buildPayload",value:async function(configuratorSelections){var _this=this,payload={items:[]},productLineGroupsUsed=[];const hasGiftbox=configuratorSelections.some(item=>item.giftbox);var productLineGroupID=await _generateLineGroupID(productLineGroupsUsed);productLineGroupsUsed.push(productLineGroupID);const promises=configuratorSelections.map(async function(item){var items2=_this._buildPayloadItems(productLineGroupID,item,hasGiftbox);return items2}),items=await Promise.all(promises);return payload.items=items.flat(),payload}},{key:"_addItemsToCart",value:function(event){event.preventDefault(),event.stopPropagation();var _this=this,addToCartButton2=event.target,configuratorSelectionsFinal=this.selectionsFinal.slice().reverse();this._buildPayload(configuratorSelectionsFinal).then(function(payload){fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){if(response.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:configuratorSelectionsFinal.length,source:"bundlinator",products:configuratorSelectionsFinal.map(function(item){return{id:item.id,sku:item.sku||"",mpid:item.mpid,name:item.name,color:item.color,size:item.size,price:parseFloat(item.price.decimalValue),isBaseProduct:item.isBaseProduct}})},bubbles:!0})),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),checkPrivateSale(),_this._addedToCart=!0;var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}else response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})})}}
18,{key:"_addOnItemRemove",value:function(event){event.preventDefault(),event.stopPropagation();var addonItemCard=event.target.closest("div.addonItemCard"),productIdToRemove=addonItemCard.getAttribute("data-pid");this.selectionsTemp=this.selectionsTemp.filter(function(selection){return selection.id!==productIdToRemove}),addonItemCard.classList.remove("selected"),this._updateItemCount()}},{key:"_addOnItemDetailRemove",value:function(event){event.preventDefault(),event.stopPropagation();var addButton=this.addOnProductSection.querySelector(".prdsys-addon-details-add"),mpid=addButton?addButton.getAttribute("data-mpid"):null;mpid&&(this.selectionsTemp=this.selectionsTemp.filter(function(selection){return selection.mpid!==mpid}),this.modal.querySelectorAll(".prdsys-addons .addonItemCard").forEach(function(card){card.getAttribute("data-mpid")===mpid&&card.classList.remove("selected")}),this._updateItemCount()),this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_reviewItemRemove",value:function(event){event.preventDefault(),event.stopPropagation();var btn=event.target.closest(".bundlinator-review-remove")||event.target,mpid=btn.getAttribute("data-mpid");if(mpid){this.selectionsFinal=this.selectionsFinal.filter(function(s){return s.mpid!==mpid}),this.selectionsTemp=this.selectionsFinal.slice();var reviewItem=btn.closest(".bundlinator-review-item");reviewItem&&reviewItem.remove(),this.modal.querySelectorAll(".prdsys-addons .addonItemCard").forEach(function(card){card.getAttribute("data-mpid")===mpid&&card.classList.remove("selected")});var USDollar=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}),totalPrice=this.selectionsFinal.reduce(function(sum,item){var price=item.price?.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price.decimalValue);return item.monogramming&&item.monogramming.cost&&(price+=parseFloat(item.monogramming.cost)+parseFloat(item.monogramming.upCharge)),item.isBaseProduct&&item.giftbox&&item.giftbox.id&&(price+=parseFloat(item.giftbox.price.decimalValue)),sum+price},0),totalEl=this.modal.querySelector(".prdsys-summary .bundlinator-review-total");totalEl&&(totalEl.innerHTML=USDollar.format(totalPrice));var totalCountEl=this.modal.querySelector(".bundlinator-totals-count"),totalLabelEl=this.modal.querySelector(".bundlinator-totals-label"),totalPriceEl=this.modal.querySelector(".bundlinator-totals-price");totalCountEl&&(totalCountEl.textContent=this.selectionsFinal.length),totalLabelEl&&(totalLabelEl.textContent=this.selectionsFinal.length===1?"Item":"Items"),totalPriceEl&&(totalPriceEl.textContent=USDollar.format(totalPrice)),this._updateItemCount()}}},{key:"_addOnItemSave",value:function(event){event.preventDefault(),event.stopPropagation();var pid=event.target.getAttribute("data-pid"),mpid=event.target.getAttribute("data-mpid"),name=event.target.getAttribute("data-name"),color=event.target.getAttribute("data-color"),size=event.target.getAttribute("data-size"),preorder=event.target.getAttribute("data-preorder"),final_sale=event.target.getAttribute("data-finalsale"),price=event.target.getAttribute("data-price").replace(/,/g,"").trim(),compare_at_price=event.target.getAttribute("data-compareat").replace(/,/g,"").trim(),custom_sale_price=event.target.getAttribute("data-customsale")?.replace(/,/g,"").trim(),image=event.target.getAttribute("data-image"),handle=event.target.getAttribute("data-handle"),stock_date=event.target.getAttribute("data-stockdate"),productToAdd={id:pid,mpid,handle,name,color,size,image,isBaseProduct:!1,stockdate:stock_date,properties:{},price:{decimalValue:parseFloat(price).toFixed(2),value:parseFloat(price).toFixed(2),formatted:"$"+price}};custom_sale_price&&(productToAdd.price.customSalePrice=parseFloat(custom_sale_price).toFixed(2)),compare_at_price&&(productToAdd.properties._compare_at_price=parseFloat(compare_at_price)),preorder==="true"&&(productToAdd.properties._is_preorder=!0,stock_date&&(productToAdd.properties._est_ship_date=stock_date)),final_sale==="true"&&(productToAdd.properties.is_final_sale=!0,productToAdd.properties._LPROP="no-returns");var configuratorSelectionsTemp=this.selectionsTemp;this.selectionsTemp=configuratorSelectionsTemp.filter(function(selection){return selection.mpid!==mpid}),this.selectionsTemp.push(productToAdd);var plpImage=event.target.getAttribute("data-plpimage"),cardImageSrc=plpImage||image,addonCard=this.modal.querySelector('.prdsys-addons .addonItemCard[data-mpid="'+mpid+'"]');if(addonCard&&cardImageSrc){var cardImg=addonCard.querySelector("img");cardImg&&(cardImg.src=cardImageSrc)}this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_addonDetailCancel",value:function(event){this._detailFromReview?(this._detailFromReview=!1,this._showSection("review",!1,event)):this._showSection("addons",!1,event)}},{key:"_updateAddon",value:function(event){var newVariant=event.detail.variant;if(this._updateAddOnSaveButton(newVariant),this._updateAddOnGallery(newVariant),newVariant&&newVariant.custom_private_sale_price)checkPrivateSale();else{const strikethroughPrices=this.element.querySelectorAll(".ProductItem__CustomStrikethroughPrice");
18strikethroughPrices.length&&(strikethroughPrices.forEach(element=>{element.classList.add("d-none")}),this.element.querySelectorAll(".ProductItem__DefaultPrice").forEach(element=>{element.classList.remove("d-none")}))}}},{key:"_updateAddOnGallery",value:function(newVariant){if(!(!newVariant||!newVariant.featured_image)){var img=this.addOnProductSection.querySelector(".bundlinator-addon-image img");img&&(img.src=newVariant.featured_image.src)}}},{key:"_updateAddOnSaveButton",value:function(newVariant){var saveButton=this.addOnProductSection.querySelector(".prdsys-addon-details-add");if(saveButton)if(saveButton.classList.remove("d-none"),!newVariant)saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.innerHTML=window.languages.productFormUnavailable;else if(newVariant.available){saveButton.removeAttribute("disabled"),saveButton.textContent.trim()!=="Update"&&(saveButton.innerHTML="Add"),saveButton.setAttribute("data-pid",newVariant.id),saveButton.setAttribute("data-price",(newVariant.price/100).toFixed(2)),newVariant.compare_at_price?saveButton.setAttribute("data-compareat",(newVariant.compare_at_price/100).toFixed(2)):saveButton.setAttribute("data-compareat",""),newVariant.custom_private_sale_price?saveButton.setAttribute("data-customsale",(newVariant.custom_private_sale_price/100).toFixed(2)):saveButton.setAttribute("data-customsale",""),newVariant.is_preorder?(saveButton.innerHTML=window.languages.productFormPreorder,saveButton.setAttribute("data-preorder","true")):saveButton.setAttribute("data-preorder",""),newVariant.is_final_sale?saveButton.setAttribute("data-finalsale","true"):saveButton.setAttribute("data-finalsale",""),newVariant.hasOwnProperty("option1")&&saveButton.setAttribute("data-color",newVariant.option1),newVariant.hasOwnProperty("option2")?saveButton.setAttribute("data-size",newVariant.option2):saveButton.setAttribute("data-size",""),newVariant.hasOwnProperty("back_in_stock_date")?saveButton.setAttribute("data-stockdate",newVariant.back_in_stock_date):saveButton.setAttribute("data-stockdate",""),newVariant.hasOwnProperty("featured_image")&&newVariant.featured_image.src&&saveButton.setAttribute("data-image",newVariant.featured_image.src);try{var productDataEl=this.addOnProductSection.querySelector("[data-product-json]");if(productDataEl){var productData=JSON.parse(productDataEl.textContent),variantExtra=productData.variants_extra_data&&productData.variants_extra_data[newVariant.id];if(variantExtra&&variantExtra.plp_image){var plpBase=variantExtra.plp_image.replace(/\?.*$/,"");saveButton.setAttribute("data-plpimage",plpBase+"?width=600&height=600&crop=center")}}}catch{}}else saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.setAttribute("data-preorder",""),saveButton.setAttribute("data-finalsale",""),saveButton.innerHTML=window.languages.productFormSoldOut}},{key:"_getAddOnItemDetails",value:function(event){event.preventDefault();var addonItemCard=event.target.closest(".addonItemCard"),variant_id=addonItemCard.getAttribute("data-pid"),addonProductHandle=addonItemCard.getAttribute("data-product"),addonMpid=addonItemCard.getAttribute("data-mpid"),isAlreadySelected=this.selectionsTemp&&this.selectionsTemp.some(function(s){return s.mpid===addonMpid});if(isAlreadySelected){var existingSelection=this.selectionsTemp.find(function(s){return s.mpid===addonMpid});existingSelection&&existingSelection.id&&(variant_id=existingSelection.id)}this._openAddonDetail(addonProductHandle,variant_id,addonMpid,isAlreadySelected,!1)}},{key:"_openAddonDetail",value:function(handle,variantId,mpid,isAlreadySelected,fromReview){var _this=this,url=window.location.origin+"/products/"+handle+"?variant="+variantId+"&view=bundlinator-addon";fetch(url).then(function(response){return response.text()}).then(function(html){var tempElement=document.createElement("div");tempElement.innerHTML=html,_this.exclusions&&_this.exclusions.length>0&&_this.exclusions.forEach(function(item){var baseProducts=item.baseProducts,exclusions=item.exclusions,exclusionKeys=Object.keys(exclusions);(baseProducts.length===0||baseProducts.includes(_this.baseproduct.sku))&&exclusionKeys.forEach(function(key){key===handle&&exclusions[key].forEac
18h(function(attr){var attrEl=tempElement.querySelector('.ProductForm__Option li[data-value="'+attr+'"]');attrEl&&attrEl.remove()})})});var sectionHtml=tempElement.querySelector(".shopify-section").innerHTML;if(_this.addOnProductSection.innerHTML=sectionHtml,checkPrivateSale(),_this.productVariants=new ProductVariants(_this.addOnProductSection,{}),isAlreadySelected){var cancelBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-cancel"),removeBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-remove"),addBtn=_this.addOnProductSection.querySelector(".prdsys-addon-details-add");cancelBtn&&cancelBtn.classList.add("d-none"),removeBtn&&removeBtn.classList.remove("d-none"),addBtn&&!addBtn.disabled&&(addBtn.textContent="Update")}_this._detailFromReview=fromReview,fromReview?_this.modal.querySelector(".prdsys-summary").style.display="none":_this.modal.querySelector(".prdsys-main").classList.add("d-none"),_this.addOnProductSection.classList.remove("d-none"),_this.modal.classList.add("bundlinator-detail-active")}).catch(function(error){console.error("Failed to fetch bundlinator add-on detail:",error)})}},{key:"_toggleAddOnItemMonogramming",value:function(event){var clickedElement=event.target,productMonogramming=this.addOnProductSection.querySelector(".product-monogramming");if(productMonogramming.classList.toggle("show",clickedElement.checked),document.documentElement.clientWidth>768){var scrollWrapper=this.modal.querySelector(".scroll-wrapper");scrollWrapper.scrollTop=scrollWrapper.querySelector(".scroller").scrollHeight,productMonogramming.classList.contains("mobile-show")&&productMonogramming.classList.remove("mobile-show")}}},{key:"_toggleGiftBoxSelection",value:function(event){event.preventDefault();var giftboxCard=event.target.closest(".addonItemCard");if(giftboxCard){var pid=giftboxCard.getAttribute("data-pid"),mpid=giftboxCard.getAttribute("data-mpid"),price=giftboxCard.getAttribute("data-price").replace(/^\s+|\s+$/g,"");if(pid){var configuratorSelectionsTemp=this.selectionsTemp;if(configuratorSelectionsTemp.length>0&&mpid==="giftbox"){var giftboxInput=this.modal.querySelector("input[name='giftbox']");if(giftboxCard.classList.contains("selected"))configuratorSelectionsTemp[0].giftbox=null,giftboxCard.classList.remove("selected"),giftboxInput.checked=!1;else{var giftbox={id:pid,mpid,name:this.modal.querySelector(".gift-product-name").textContent,color:"",size:"",price:{decimalValue:parseFloat(price),value:parseFloat(price),formatted:"$"+price}};configuratorSelectionsTemp[0].giftbox=giftbox,giftboxCard.classList.add("selected"),giftboxInput.checked=!0}}this.selectionsTemp=configuratorSelectionsTemp}}}},{key:"_saveSelections",value:function(event){event.preventDefault(),this.selectionsFinal=this.selectionsTemp,this._showSection("addons",!1,event)}},{key:"_showSection",value:function(section="",setTempStorage=!1,event){event.preventDefault(),this.addOnProductSection.classList.add("d-none"),this.modal.querySelector(".prdsys-main").classList.remove("d-none"),this.modal.classList.remove("bundlinator-detail-active");var modalBody=this.modal.querySelector(".modal-body");modalBody&&(modalBody.scrollTop=0),setTempStorage&&(this.selectionsTemp=this.selectionsFinal?this.selectionsFinal:[]);const optionsSection=this.modal.querySelector(".prdsys-options");if(optionsSection&&(optionsSection.style.display="none"),section==="addons"){var configuratorSelectionsTemp=this.selectionsTemp,addonCards=this.modal.querySelectorAll(".prdsys-addons .addonItemCard");addonCards.forEach(function(card){card.classList.remove("selected");var mpid=card.dataset.mpid;configuratorSelectionsTemp.forEach(function(selection){selection.mpid===mpid&&card.classList.add("selected")})}),this.modal.querySelector(".prdsys-addons").style.display="block"}else this.modal.querySelector(".prdsys-addons").style.display="none";if(section==="gifting")this.modal.querySelector(".prdsys-gifting").style.display="block";else{const optionGifting=this.modal.querySelector(".prdsys-gifting");optionGifting&&(optionGifting.style.display="none")}if(section==="review"){let USDollar=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0});this.selectionsFinal=this.selectionsTemp;var productSelectionsContainer=this.modal.querySelector(".prdsys-summary .product-selections");productSelectionsContainer.innerHTML="";var totalPrice=0;this.selectionsFinal.forEach(function(item){let reviewItemHtml=document.querySelector("#bundlinatorModal div.reviewItemHtml .bundlinator-review-item").
18cloneNode(!0),productImage=reviewItemHtml.querySelector("img");productImage.src=item.image,productImage.alt=item.name,productImage.title=item.name;var attributes="";item.properties.is_final_sale&&(attributes+='<p class="CartItem__FinalSale">Final Sale</p>'),item.properties._is_preorder&&(attributes+='<p class="CartItem__Preorder">Estimated to ship <span class="instock-date">'+item.stockdate+"</span></p>"),attributes+=item.color?"<p>"+item.color:"",item.size&&item.size!="One Size"&&item.size!="Null"&&(attributes+=", "+item.size),attributes+="</p>";var monogramming="";monogramming=item.monogramming&&item.monogramming.text?"Monogram: "+item.monogramming.text:"";var itemPrice=item.price.decimalValue,priceHtml="";item.price?.customSalePrice&&item.price.customSalePrice<item.price.decimalValue?(itemPrice=parseFloat(item.price.customSalePrice).toFixed(2),priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price Price--compareAt Text--subdued d-none">'+USDollar.format(item.price.decimalValue)+"</span>",priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price d-none">'+USDollar.format(item.price.customSalePrice)+"</span>"):priceHtml+='<span class="ProductItem__Price ProductItem__CustomStrikethroughPrice Price d-none">'+USDollar.format(item.price.decimalValue)+"</span>",priceHtml+='<span class="ProductItem__Price ProductItem__DefaultPrice Price">'+USDollar.format(item.price.decimalValue)+"</span>",totalPrice+=parseFloat(itemPrice),reviewItemHtml.querySelector(".product-name").innerHTML=item.name,reviewItemHtml.querySelector(".product-price").innerHTML=priceHtml,reviewItemHtml.querySelector(".product-attributes").innerHTML=attributes,reviewItemHtml.querySelector(".product-monogramming").innerHTML=monogramming,item.isBaseProduct&&item.giftbox&&item.giftbox.id&&(reviewItemHtml.querySelector(".product-giftoptions").innerHTML="Gift Box Added",totalPrice+=parseFloat(item.giftbox.price.decimalValue)),item.monogramming&&item.monogramming.cost&&(totalPrice+=parseFloat(item.monogramming.cost)+parseFloat(item.monogramming.upCharge));var removeBtn=reviewItemHtml.querySelector(".bundlinator-review-remove");item.isBaseProduct||removeBtn&&(removeBtn.classList.remove("d-none"),removeBtn.setAttribute("data-mpid",item.mpid)),productSelectionsContainer.appendChild(reviewItemHtml)});var reviewTotalEl=this.modal.querySelector(".prdsys-summary .bundlinator-review-total");reviewTotalEl&&(reviewTotalEl.innerHTML=USDollar.format(totalPrice));var totalCountEl=this.modal.querySelector(".bundlinator-totals-count"),totalLabelEl=this.modal.querySelector(".bundlinator-totals-label"),totalPriceEl=this.modal.querySelector(".bundlinator-totals-price");totalCountEl&&(totalCountEl.textContent=this.selectionsFinal.length),totalLabelEl&&(totalLabelEl.textContent=this.selectionsFinal.length===1?"Item":"Items"),totalPriceEl&&(totalPriceEl.textContent=USDollar.format(totalPrice)),this.modal.classList.add("bundlinator-in-review"),this.modal.querySelector(".prdsys-summary").style.display="block"}else this.modal.classList.remove("bundlinator-in-review"),this.modal.querySelector(".prdsys-summary").style.display="none";this._updateItemCount(),checkPrivateSale()}},{key:"_updateItemCount",value:function(){var selections=this.selectionsTemp||this.selectionsFinal||[],count=selections.length,countEl=this.modal.querySelector(".bundlinator-item-count"),labelEl=this.modal.querySelector(".bundlinator-item-label");countEl&&(countEl.textContent=count),labelEl&&(labelEl.textContent=count===1?"Item":"Items");var totalPrice=selections.reduce(function(sum,item){var price=item.price&&item.price.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price&&item.price.decimalValue||0);return sum+(isNaN(price)?0:price)},0),priceEl=this.modal.querySelector(".bundlinator-header__price");priceEl&&(priceEl.textContent=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}).format(totalPrice))}}]),BundlinatorSection2})(),CuyDrawerConfiguratorSection=(function(){function CuyDrawerConfiguratorSection2(container){var _this=this;_classCallCheck(this,CuyDrawerConfiguratorSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.panel=this.element.querySelector(".cuy-drawer-panel"),this.backdrop=this.element.querySelector(".cuy-drawer-backdrop"),this.selections=[],this._savedState=null,this._addedToCart=!1,this._detailFromReview=!1,this.exclusions=null,this.baseproduct=null,this.productVariants=null,this.addonDetailSection=null,this._toastTimer=null,this._scrollTitleIdx=-1,this._attachListeners()}return _createClass(CuyDrawerConfiguratorSection2,[{key:"_attachListeners",value:function(){var _this=this;document.addEventListener("click",function(e){e.target.closest("[data-cuy-drawer-open]")&&_this._open()}),this.backdrop.addEventListener("click",function(){_this._close()});var _sheetPanelEl=this.panel,_sheetBackdrop=this.element.querySelector(".cuy-drawer-backdrop"),DISM
18ISS_VELOCITY=.4,CLOSE_FRACTION=.25,renderDrag=function(delta){if(delta=Math.max(0,delta),_sheetPanelEl.style.transform="translate3d(0,"+delta+"px,0)",_sheetBackdrop){var h=_sheetPanelEl.offsetHeight||1;_sheetBackdrop.style.transition="none",_sheetBackdrop.style.opacity=String(Math.max(0,Math.min(1,1-delta/h)))}},releaseDrag=function(delta,velocity){var h=_sheetPanelEl.offsetHeight||1,shouldClose=velocity>DISMISS_VELOCITY?!0:velocity<-DISMISS_VELOCITY?!1:Math.max(0,delta)>h*CLOSE_FRACTION;shouldClose&&_this._close(),requestAnimationFrame(function(){_sheetPanelEl.style.transition="",_sheetPanelEl.style.transform="",_sheetBackdrop&&(_sheetBackdrop.style.transition="",_sheetBackdrop.style.opacity="")})},handle=this.element.querySelector(".cuy-drawer-handle");if(handle){var dragStartY=0,dragLastY=0,dragLastT=0,dragVel=0,dragging=!1,dragStart=function(y){dragging=!0,dragStartY=y,dragLastY=y,dragLastT=performance.now(),dragVel=0,_sheetPanelEl.style.transition="none"},dragMove=function(y){if(dragging){var now=performance.now(),dt=now-dragLastT;dt>
180&&(dragVel=dragVel*.7+(y-dragLastY)/dt*.3),dragLastY=y,dragLastT=now,renderDrag(y-dragStartY)}},dragEnd=function(){dragging&&(dragging=!1,releaseDrag(dragLastY-dragStartY,dragVel))};handle.addEventListener("touchstart",function(e){dragStart(e.touches[0].clientY)},{passive:!0}),handle.addEventListener("touchmove",function(e){dragMove(e.touches[0].clientY)},{passive:!0}),handle.addEventListener("touchend",dragEnd),handle.addEventListener("touchcancel",dragEnd),handle.addEventListener("mousedown",function(e){dragStart(e.clientY),e.preventDefault()}),document.addEventListener("mousemove",function(e){dragging&&dragMove(e.clientY)}),document.addEventListener("mouseup",function(){dragging&&dragEnd()})}var scrollBody=this.element.querySelector(".cuy-drawer-body");if(scrollBody){var sheetPanel=this.panel,pullStartY=0,pullStartX=0,pullAxis=null,pullLastY=0,pullLastT=0,pullVel=0,pulling=!1,pullScroller=null,isMobile=function(){return window.matchMedia&&window.matchMedia("(max-width: 991.98px)").matches},getScroller=function(node){for(var el=node;el&&el!==sheetPanel;){if(el.scrollHeight>el.clientHeight+1){var oy=window.getComputedStyle(el).overflowY;if(oy==="auto"||oy==="scroll")return el}el=el.parentElement}return scrollBody};scrollBody.addEventListener("touchstart",function(e){e.touches.length===1&&(pullStartY=e.touches[0].clientY,pullStartX=e.touches[0].clientX,pullAxis=null,pullLastY=pullStartY,pullLastT=performance.now(),pullVel=0,pulling=!1,pullScroller=getScroller(e.target))},{passive:!0}),scrollBody.addEventListener("touchmove",function(e){if(e.touches.length===1){var y=e.touches[0].clientY;if(!pulling){if(pullAxis==="h")return;var dx=e.touches[0].clientX-pullStartX,dy=y-pullStartY;if(pullAxis===null&&(Math.abs(dx)<8&&Math.abs(dy)<8||(pullAxis=Math.abs(dx)>Math.abs(dy)?"h":"v",pullAxis==="h")))return;var atTop=!pullScroller||pullScroller.scrollTop<=0,dyInc=y-pullLastY;if(pullLastY=y,isMobile()&&atTop&&dyInc>0){pulling=!0,pullStartY=y,pullLastT=performance.now(),pullVel=0,pullScroller&&(pullScroller.style.overflowY="hidden"),sheetPanel.style.transition="none",e.preventDefault();return}return}var now=performance.now(),dt=now-pullLastT;dt>0&&(pullVel=pullVel*.7+(y-pullLastY)/dt*.3),pullLastY=y,pullLastT=now,e.preventDefault(),renderDrag(y-pullStartY)}},{passive:!1});var pullEnd=function(){pulling&&(pulling=!1,pullScroller&&(pullScroller.style.overflowY=""),releaseDrag(pullLastY-pullStartY,pullVel))};scrollBody.addEventListener("touchend",pullEnd),scrollBody.addEventListener("touchcancel",pullEnd)}this.delegateElement.on("click",".cuy-drawer-header__close",function(){_this._close()}),this.delegateElement.on("click",".cuy-drawer-header__back",function(){_this._stepBack()}),window.addEventListener("popstate",function(){if(_this._suppressNextPopstate){_this._suppressNextPopstate=!1;return}_this.element.classList.contains("cuy-drawer--open")&&_this._historyTrapped&&(_this._edgeBackPending=!1,_this._sheetBack(!0))}),(function(){var EDGE=64,BACK_AT=55,sx=0,sy=0,dx=0,dy=0,fromEdge=!1;_this.element.addEventListener("touchstart",function(e){if(e.touches.length!==1){fromEdge=!1;return}sx=e.touches[0].clientX,sy=e.touches[0].clientY,dx=0,dy=0;var inSub=_this.element.classList.contains("cuy-drawer--detail-active")||_this.element.classList.contains("cuy-drawer--review");fromEdge=_this.element.classList.contains("cuy-drawer--open")&&inSub&&sx<=EDGE},{passive:!0}),_this.element.addEventListener("touchmove",function(e){!fromEdge||e.touches.length!==1||(dx=e.touches[0].clientX-sx,dy=e.touches[0].clientY-sy,dx>0&&Math.abs(dx)>Math.abs(dy)&&e.preventDefault())},{passive:!1});var edgeEnd=function(){fromEdge&&(fromEdge=!1,dx>BACK_AT&&Math.abs(dx)>Math.abs(dy)&&(_this._edgeBackPending=!0,setTimeout(function(){_this._edgeBackPending&&(_this._edgeBackPending=!1,_this._sheetBack(!1))},80)))};_this.element.addEventListener("touchend",edgeEnd),_this.element.addEventListener("touchcancel",edgeEnd)})(),this.delegateElement.on("click",".cuy-drawer-tab",function(e){var tab=e.target.closest(".cuy-drawer-tab");tab&&_this._selectCategory(tab.dataset.category)}),this.delegateElement.on("click",".cuy-drawer-card",function(e){var card=e.target.closest(".cuy-drawer-card");if(card&&!e.target.closest(".cuy-drawer-card__nav")){var slider=e.target.closest(".cuy-drawer-card__slider");if(slider&&slider.dataset.suppressClick==="1"){slider.dataset.suppressClick="0";return}if(e.target.closest(".cuy-drawer-card__imagewrapper")){_this._quickAddAddon(card);return}var isSelected=card.classList.contains("cuy-drawer-card--selected");_this._openAddonDetail(card.dataset.handle,card.dataset.pid,card.dataset.mpid,isSelected,!1)}}
18),this.delegateElement.on("keydown",".cuy-drawer-card__textarea",function(e){if(!(e.key!=="Enter"&&e.key!==" ")){e.preventDefault();var card=e.target.closest(".cuy-drawer-card");if(card){var isSelected=card.classList.contains("cuy-drawer-card--selected");_this._openAddonDetail(card.dataset.handle,card.dataset.pid,card.dataset.mpid,isSelected,!1)}}}),this._initCardSliders(),this.element.addEventListener("cuy-drawer:body-rerendered",this._initCardSliders.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-add",this._addonDetailAdd.bind(this)),this.delegateElement.on("click",".prdsys-addon-details-cancel",function(e){e.preventDefault(),_this._addonDetailCancel()}),this.delegateElement.on("click",".prdsys-addon-details-remove",this._addonDetailRemove.bind(this)),this.delegateElement.on("variant:changed",this._updateAddon.bind(this)),this.delegateElement.on("click",".cuy-drawer-footer",function(e){if(_this.element.classList.contains("cuy-drawer--review")){e.target.closest(".cuy-drawer-footer__atb")&&_this._addItemsToCart(e);return}var atbBtn=_this.element.querySelector(".cuy-drawer-footer__atb");atbBtn&&atbBtn.disabled||_this._showReview()}),this.delegateElement.on("click",".cuy-drawer-review-remove",this._reviewItemRemove.bind(this)),this.delegateElement.on("click",".cuy-drawer-onboard__close",this._hideOnboard.bind(this));var onboardBody=this.element.querySelector(".cuy-drawer-body");onboardBody&&(onboardBody.addEventListener("scroll",this._hideOnboard.bind(this),{passive:!0}),onboardBody.addEventListener("pointerdown",this._hideOnboard.bind(this),{passive:!0}));var scrollBody=this.element.querySelector(".cuy-drawer-body");scrollBody&&scrollBody.addEventListener("scroll",function(){if(!(_this.element.classList.contains("cuy-drawer--detail-active")||_this.element.classList.contains("cuy-drawer--review"))){var headings=_this.element.querySelectorAll(".cuy-drawer-category-heading");if(headings.length){var titleEl=_this.element.querySelector(".cuy-drawer-header__title");if(titleEl){var gTop=scrollBody.getBoundingClientRect().top,idx=-1,name=null;
18if(headings.forEach(function(h,i){var r=h.getBoundingClientRect();r.top-gTop<-r.height*.6&&(idx=i,name=h.textContent)}),idx!==_this._scrollTitleIdx){var up=idx>_this._scrollTitleIdx;_this._scrollTitleIdx=idx,titleEl.textContent=name||"Select Add-ons",titleEl.classList.remove("is-title-up","is-title-down"),titleEl.offsetWidth,titleEl.classList.add(up?"is-title-up":"is-title-down")}}}}},{passive:!0})}},{key:"_showOnboard",value:function(){var el=this.element.querySelector(".cuy-drawer-onboard");if(!(!el||this._onboardShown)){this._onboardShown=!0;var titleEl=el.querySelector(".cuy-drawer-onboard__title");titleEl&&this.baseproduct&&this.baseproduct.name&&(titleEl.textContent="Customize Your "+this.baseproduct.name),el.hidden=!1,requestAnimationFrame(function(){requestAnimationFrame(function(){el.classList.add("is-visible")})})}}},{key:"_hideOnboard",value:function(){var el=this.element.querySelector(".cuy-drawer-onboard");!el||el.hidden||(el.classList.remove("is-visible"),setTimeout(function(){el.hidden=!0},300))}},{key:"_open",value:function(){this.element.classList.add("cuy-drawer--open"),document.body.classList.add("cuy-drawer-open"),this._initDrawer();var _this=this;setTimeout(function(){_this._showOnboard()},550)}},{key:"_close",value:function(){this.element.classList.remove("cuy-drawer--open"),document.body.classList.remove("cuy-drawer-open"),this._saveState(),this._showAddons()}},{key:"_trapForSubview",value:function(){var inSub=this.element.classList.contains("cuy-drawer--detail-active")||this.element.classList.contains("cuy-drawer--review");if(inSub&&!this._historyTrapped)try{history.pushState({cuyDrawer:!0},""),this._historyTrapped=!0}catch{}else if(!inSub&&this._historyTrapped){this._historyTrapped=!1,this._suppressNextPopstate=!0;try{history.back()}catch{this._suppressNextPopstate=!1}}}},{key:"_stepBack",value:function(){return this.element.classList.contains("cuy-drawer--detail-active")?(this._addonDetailCancel(),!0):this.element.classList.contains("cuy-drawer--review")?(this._exitReviewToAddons(),!0):!1}},{key:"_sheetBack",value:function(fromPopstate){var now=window.performance&&performance.now?performance.now():Date.now();return this._lastBackAt&&now-this._lastBackAt<250?!1:(this._lastBackAt=now,fromPopstate&&(this._historyTrapped=!1),this._stepBack())}},{key:"_initDrawer",value:function(){this.addonDetailSection=this.element.querySelector(".cuy-drawer-addon-detail"),this.baseproduct=JSON.parse(this.element.querySelector("[data-cuy-drawer-baseproduct-json]").textContent||"{}");var cexEl=this.element.querySelector("[data-cex-json]");if(cexEl)try{this.exclusions=JSON.parse(cexEl.textContent)}catch{this.exclusions=null}this._savedState&&this._savedState.variantId===this.baseproduct.id?(this.selections=this._savedState.selections.slice(),this.selections[0]=this.baseproduct):(this.selections=[this.baseproduct],this._savedState=null),this._syncCardStates(),this._updateFooter();var body=this.element.querySelector(".cuy-drawer-body");body&&(body.scrollTop=0)}},{key:"_saveState",value:function(){this._addedToCart?(this._savedState=null,this._addedToCart=!1):this.baseproduct&&(this._savedState={variantId:this.baseproduct.id,selections:this.selections.slice()})}},{key:"_initCardSliders",value:function(){var sliders=this.element.querySelectorAll(".cuy-drawer-card__slider");sliders.forEach(function(slider){var card=slider.closest(".cuy-drawer-card"),indicator=card?card.querySelector(".cuy-drawer-card__indicator"):null,track=card?card.querySelector(".cuy-drawer-card__indicator-track"):null,slideCount=track&&parseInt(track.dataset.slideCount,10)||1,navPrev=card?card.querySelector(".cuy-drawer-card__nav--prev"):null,navNext=card?card.querySelector(".cuy-drawer-card__nav--next"):null,updateIndicator=function(){var w=slider.clientWidth||1,ratio=slider.scrollLeft/w,index=Math.max(0,Math.min(slideCount-1,Math.round(ratio)));slider.dataset.slideIndex=String(index),indicator&&(indicator.style.transform="translateX("+index*100+"%)"),navPrev&&navPrev.classList.toggle("cuy-drawer-card__nav--disabled",index<=0),navNext&&navNext.classList.toggle("cuy-drawer-card__nav--disabled",index>=slideCount-1)};slider.addEventListener("scroll",updateIndicator,{passive:!0});
18var goToSlide=function(index){index=Math.max(0,Math.min(slideCount-1,index)),slider.scrollTo({left:index*(slider.clientWidth||1),behavior:"smooth"})};navPrev&&navPrev.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),goToSlide((parseInt(slider.dataset.slideIndex,10)||0)-1)}),navNext&&navNext.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation(),goToSlide((parseInt(slider.dataset.slideIndex,10)||0)+1)}),updateIndicator();var isDown=!1,startX=0,startScrollLeft=0,moved=0;slider.addEventListener("mousedown",function(e){isDown=!0,moved=0,startX=e.pageX,startScrollLeft=slider.scrollLeft,slider.classList.add("is-dragging"),e.preventDefault()});var endDrag=function(e){if(isDown&&(isDown=!1,slider.classList.remove("is-dragging"),moved>5)){slider.dataset.suppressClick="1";var w=slider.clientWidth||1,target=Math.round(slider.scrollLeft/w)*w;slider.scrollTo({left:target,behavior:"smooth"})}};slider.addEventListener("mousemove",function(e){if(isDown){var dx=e.pageX-startX;moved=Math.max(moved,Math.abs(dx)),slider.scrollLeft=startScrollLeft-dx}}),slider.addEventListener("mouseup",endDrag),slider.addEventListener("mouseleave",endDrag)})}},{key:"_syncCardStates",value:function(){var _this=this;this.element.querySelectorAll(".cuy-drawer-card").forEach(function(card){var mpid=card.dataset.mpid,saved=_this.selections.find(function(s){return!s.isBaseProduct&&s.mpid===mpid});card.classList.toggle("cuy-drawer-card--selected",!!saved)}),this._updateCategoryCounts()}},{key:"_updateCategoryCounts",value:function(){var counts={};this.element.querySelectorAll(".cuy-drawer-category-group").forEach(function(group){counts[group.dataset.category]=group.querySelectorAll(".cuy-drawer-card--selected").length}),this.element.querySelectorAll(".cuy-drawer-tab").forEach(function(tab){var sup=tab.querySelector(".cuy-drawer-tab__count");if(sup){var count=counts[tab.dataset.category]||0;count>0?(sup.textContent=count,sup.classList.remove("d-none")):(sup.textContent="",sup.classList.add("d-none"))}})}},{key:"_selectCategory",value:function(category){this.element.querySelectorAll(".cuy-drawer-tab").forEach(function(tab){var active=tab.dataset.category===category;tab.classList.toggle("cuy-drawer-tab--active",active),tab.setAttribute("aria-selected",active?"true":"false")}),this.element.querySelectorAll(".cuy-drawer-category-group").forEach(function(group){group.classList.toggle("d-none",group.dataset.category!==category)})}},{key:"_exitReviewToAddons",value:function(){var _this=this,panel=this.element.querySelector(".cuy-drawer-review"),isMobile=window.matchMedia&&window.matchMedia("(max-width: 991.98px)").matches;if(!panel||!isMobile||!this.element.classList.contains("cuy-drawer--review")){this._showAddons();return}panel.classList.add("cuy-drawer-review--exiting");var done=!1,finish=function(){done||(done=!0,panel.removeEventListener("animationend",onEnd),panel.classList.remove("cuy-drawer-review--exiting"),_this._showAddons())},onEnd=function(e){e.target===panel&&finish()};panel.addEventListener("animationend",onEnd),setTimeout(finish,600)}},{key:"_showAddons",value:function(){this.addonDetailSection&&this.addonDetailSection.classList.add("d-none"),this.element.classList.remove("cuy-drawer--detail-active"),this.element.classList.remove("cuy-drawer--review");var atbBtn=this.element.querySelector(".cuy-drawer-footer__atb");atbBtn&&(atbBtn.textContent="Review");var titleEl=this.element.querySelector(".cuy-drawer-header__title");titleEl&&(titleEl.textContent="Select Add-ons"),this._scrollTitleIdx=-1;var body=this.element.querySelector(".cuy-drawer-body");body&&(body.scrollTop=0),this._syncCardStates(),this._trapForSubview()}},{key:"_showReview",value:function(){var _this=this,fmt=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}),list=this.element.querySelector(".cuy-drawer-review__list"),template=this.element.querySelector(".cuy-drawer-review-item-template .cuy-drawer-review-item");if(!(!list||!template)){list.innerHTML="";var totalPrice=0;this.selections.forEach(function(item){var row=template.cloneNode(!0),img=row.querySelector("img");img&&(img.src=item.image,img.alt=item.name);var nameEl=row.querySelector(".product-name");nameEl&&(nameEl.textContent=item.name);var itemPrice=item.price.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price.decimalValue);totalPrice+=isNaN(itemPrice)?0:itemPrice;var priceEl2=row.querySelector(".product-price");priceEl2&&(priceEl2.textContent=fmt.format(itemPrice));var attrs=[];item.color&&attrs.push(item.color),item.size&&item.size!=="One Size"&&item.size!=="Null"&&item.size!=="null"&&attrs.push(item.size);var attrEl=row.querySelector(".product-attributes");attrEl&&(attrEl.textContent=attrs.join(", "));var descEl=row.querySelector(".product-description");if(descEl&&!item.isBaseProduct){var cardDescEl=_this.element.querySelector('.cuy-drawer-card[data-mpid="'+item.mpid+'"] .cuy-drawer-card__description'),descText=cardDescEl?cardDescEl.textContent.trim():"";descText&&(descEl.textContent=descText,descEl.classList.remove("d-none"))}var removeBtn=row.querySelector(".cuy-drawer-review-remove");removeBtn&&(item.isBaseProduct?removeBtn.classList.add("d-none"):row.dataset.mpid=item.mpid),list.appendChild(row)});var countEl=this.element.querySelector(".cuy-drawer-total-count"),labelEl=this.element.querySelector(".cuy-drawer-total-label"),priceEl=this.element.querySelector(".cuy-drawer-footer__total-price");countEl&&(countEl.textContent=this.selections.length),labelEl&&(labelEl.textContent=this.selections.length===1?"Item":"Items"),priceEl&&(priceEl.textContent=fmt.format(totalPrice));var atbBtn=this.element.querySelector(".cuy-drawer-footer__atb");atbBtn&&(atbBtn.textContent="Add to Bag");var titleEl=this.element.querySelector(".cuy-drawer-header__title");titleEl&&(titleEl.textContent="Customization Review"),this.element.classList.remove("cuy-drawer--detail-active"),this.element.classList.add("cuy-drawer--review"),this._trapForSubview();var body=this.element.querySelector(".cuy-drawer-body");body&&(body.scrollTop=0,requestAnimationFrame(function(){body.scrollTop=0}))}}},{key:"_reviewItemRemove",value:function(event){event.preventDefault(),event.stopPropagation();var row=event.target.closest(".cuy-drawer-review-item"),mpid=row&&row.dataset.mpid;if(mpid){var removed=this.selections.find(function(s){return s.mpid===mpid}),removedName=removed?removed.name:"";this.selections=this.selections.filter(function(s){return s.mpid!==mpid}),row.remove();var card=this.element.querySelector('.cuy-drawer-card[data-mpid="'+mpid+'"]');card&&card.classList.remove("cuy-drawer-card--selected"),this._updateFooter(),removedName&&this._showToast(removedName+" removed"),this.selections.length<=1&&this._exitReviewToAddons()}}},{key:"_quickAddAddon",value:function(card){var mpid=card.dataset.mpid,pid=card.dataset.pid,handle=card.dataset.handle,name=card.dataset.name,color=card.dataset.color,size=card.dataset.size,price=(card.dataset.price||"").replace(/,/g,"").trim(),compareat=(card.dataset.compareat||"").replace(/,/g,"").trim(),customsale=(card.dataset.customsale||"").replace(/,/g,"").trim(),image=card.dataset.image,plpImage=card.dataset.plpimage,stockdate=card.dataset.stockdate,preorder=card.dataset.preorder,finalsale=card.dataset.f
18inalsale,alreadySelected=this.selections.some(function(s){return s.mpid===mpid});if(alreadySelected)this.selections=this.selections.filter(function(s){return s.mpid!==mpid}),this._syncCardStates(),this._updateFooter(),this._showToast(name+" removed");else{this.selections=this.selections.filter(function(s){return s.mpid!==mpid});var priceNum=parseFloat(price||"0"),fmt=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",currencyDisplay:window.theme&&window.theme.currencyCodeEnabled?"code":"symbol"}),productToAdd={id:pid,mpid,handle,name,color,size,image,plpImage,isBaseProduct:!1,stockdate,properties:{},price:{decimalValue:priceNum.toFixed(2),value:priceNum.toFixed(2),formatted:fmt.format(priceNum)}};customsale&&(productToAdd.price.customSalePrice=parseFloat(customsale||"0").toFixed(2)),compareat&&(productToAdd.properties._compare_at_price=parseFloat(compareat)),preorder==="true"&&(productToAdd.properties._is_preorder=!0,stockdate&&(productToAdd.properties._est_ship_date=stockdate)),finalsale==="true"&&(productToAdd.properties.is_final_sale=!0,productToAdd.properties._LPROP="no-returns"),this.selections.push(productToAdd),this._syncCardStates(),this._updateFooter(),this._showToast(name+" added")}}},{key:"_openAddonDetail",value:function(handle,variantId,mpid,isAlreadySelected,fromReview){var _this=this;this._detailFromReview=!!fromReview;var url=window.location.origin+"/products/"+handle+"?variant="+variantId+"&view=cuy-drawer-addon";fetch(url).then(function(r){return r.text()}).then(function(html){var temp=document.createElement("div");temp.innerHTML=html,_this.exclusions&&_this.exclusions.length>0&&_this.exclusions.forEach(function(item){var baseProducts=item.baseProducts,exclusions=item.exclusions;
18Object.keys(exclusions).forEach(function(key){if(key===handle){var shouldApply=baseProducts.length===0||baseProducts.includes(_this.baseproduct.sku);shouldApply&&exclusions[key].forEach(function(attr){var attrEl=temp.querySelector('.ProductForm__Option li[data-value="'+attr+'"]');attrEl&&attrEl.remove()})}})});var sectionEl=temp.querySelector(".shopify-section");if(sectionEl){_this.addonDetailSection.innerHTML=sectionEl.innerHTML,checkPrivateSale(),_this.productVariants=new ProductVariants(_this.addonDetailSection,{});var cancelBtn=_this.addonDetailSection.querySelector(".prdsys-addon-details-cancel"),removeBtn=_this.addonDetailSection.querySelector(".prdsys-addon-details-remove"),addBtn=_this.addonDetailSection.querySelector(".prdsys-addon-details-add");isAlreadySelected&&(cancelBtn&&cancelBtn.classList.add("d-none"),removeBtn&&removeBtn.classList.remove("d-none"),addBtn&&!addBtn.disabled&&(addBtn.textContent="Update")),_this.addonDetailSection.classList.remove("d-none"),_this.element.classList.add("cuy-drawer--detail-active"),_this._trapForSubview(),_this._initGalleryDrag();var body=_this.element.querySelector(".cuy-drawer-body");body&&(body.scrollTop=0)}}).catch(function(err){console.error("Cuy Drawer: failed to fetch addon detail:",err)})}},{key:"_addonDetailCancel",value:function(){this.addonDetailSection&&this.addonDetailSection.classList.add("d-none"),this.element.classList.remove("cuy-drawer--detail-active");var body=this.element.querySelector(".cuy-drawer-body");body&&(body.scrollTop=0),this._detailFromReview?(this._detailFromReview=!1,this._showReview()):this._showAddons()}},{key:"_addonDetailAdd",value:function(event){event.preventDefault(),event.stopPropagation();
18var btn=event.target.closest(".prdsys-addon-details-add")||event.target,pid=btn.getAttribute("data-pid"),mpid=btn.getAttribute("data-mpid"),name=btn.getAttribute("data-name"),color=btn.getAttribute("data-color"),size=btn.getAttribute("data-size"),preorder=btn.getAttribute("data-preorder"),finalsale=btn.getAttribute("data-finalsale"),price=btn.getAttribute("data-price").replace(/,/g,"").trim(),compareat=btn.getAttribute("data-compareat").replace(/,/g,"").trim(),customsale=btn.getAttribute("data-customsale")?.replace(/,/g,"").trim(),image=btn.getAttribute("data-image"),plpImage=btn.getAttribute("data-plpimage"),handle=btn.getAttribute("data-handle"),stockdate=btn.getAttribute("data-stockdate"),isNew=!this.selections.some(function(s){return s.mpid===mpid});this.selections=this.selections.filter(function(s){return s.mpid!==mpid});var priceNum=parseFloat(price||"0"),fmt=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",currencyDisplay:window.theme&&window.theme.currencyCodeEnabled?"code":"symbol"}),productToAdd={id:pid,mpid,handle,name,color,size,image,plpImage,isBaseProduct:!1,stockdate,properties:{},price:{decimalValue:priceNum.toFixed(2),value:priceNum.toFixed(2),formatted:fmt.format(priceNum)}};customsale&&(productToAdd.price.customSalePrice=parseFloat(customsale||"0").toFixed(2)),compareat&&(productToAdd.properties._compare_at_price=parseFloat(compareat)),preorder==="true"&&(productToAdd.properties._is_preorder=!0,stockdate&&(productToAdd.properties._est_ship_date=stockdate)),finalsale==="true"&&(productToAdd.properties.is_final_sale=!0,productToAdd.properties._LPROP="no-returns"),this.selections.push(productToAdd),this._updateFooter(),this._showToast(name+" "+(isNew?"added":"updated")),this._detailFromReview?(this._detailFromReview=!1,this._showReview()):this._addonDetailCancel()}},{key:"_addonDetailRemove",value:function(event){event.preventDefault(),event.stopPropagation();var addBtn=this.addonDetailSection?this.addonDetailSection.querySelector(".prdsys-addon-detail
18s-add"):null,mpid=addBtn?addBtn.getAttribute("data-mpid"):null,name=addBtn?addBtn.getAttribute("data-name"):"";if(mpid){this.selections=this.selections.filter(function(s){return s.mpid!==mpid});var card=this.element.querySelector('.cuy-drawer-card[data-mpid="'+mpid+'"]');card&&card.classList.remove("cuy-drawer-card--selected")}this._updateFooter(),this._showToast(name+" removed"),this._detailFromReview?(this._detailFromReview=!1,this._showReview()):this._addonDetailCancel()}},{key:"_updateAddon",value:function(event){var newVariant=event.detail.variant;this._updateAddOnSaveButton(newVariant),this._updateAddOnGallery(newVariant),newVariant&&newVariant.custom_private_sale_price&&checkPrivateSale()}},{key:"_initGalleryDrag",value:function(){if(this.addonDetailSection){var track=this.addonDetailSection.querySelector(".cuy-drawer-gallery-track");if(!(!track||track.dataset.dragBound==="1")){track.dataset.dragBound="1";var isDown=!1,startX=0,startScrollLeft=0;track.addEventListener("mousedown",function(e){isDown=!0,startX=e.pageX,startScrollLeft=track.scrollLeft,track.classList.add("is-dragging"),e.preventDefault()}),track.addEventListener("mousemove",function(e){isDown&&(track.scrollLeft=startScrollLeft-(e.pageX-startX))});var end=function(){isDown&&(isDown=!1,track.classList.remove("is-dragging"))};track.addEventListener("mouseup",end),track.addEventListener("mouseleave",end)}}}},{key:"_updateAddOnGallery",value:function(newVariant){if(!(!newVariant||!this.addonDetailSection)){var galleriesEl=this.addonDetailSection.querySelector("[data-cuy-drawer-galleries]"),images=null;if(galleriesEl)try{var galleries=JSON.parse(galleriesEl.textContent||"{}");images=galleries[newVariant.id]||galleries[String(newVariant.id)]}catch{images=null}if((!images||!images.length)&&newVariant.featured_image&&(images=[{id:newVariant.featured_image.id,src:newVariant.featured_image.src,alt:newVariant.featured_image.alt||""}
18]),!(!images||!images.length)){var track=this.addonDetailSection.querySelector(".cuy-drawer-gallery-track");track&&(track.innerHTML=images.map(function(img,i){return'<div class="cuy-drawer-gallery-slide" data-index="'+i+'" data-image-id="'+img.id+'"><img src="'+img.src+'" alt="'+(img.alt||"").replace(/"/g,"&quot;")+'" /></div>'}).join(""),track.scrollLeft=0)}}}},{key:"_updateAddOnSaveButton",value:function(newVariant){if(this.addonDetailSection){var saveButton=this.addonDetailSection.querySelector(".prdsys-addon-details-add");if(saveButton){if(saveButton.classList.remove("d-none"),!newVariant){saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.textContent=window.languages.productFormUnavailable;return}if(newVariant.available){saveButton.removeAttribute("disabled"),saveButton.textContent.trim()!=="Update"&&(saveButton.textContent="Add"),saveButton.setAttribute("data-pid",newVariant.id),saveButton.setAttribute("data-price",(newVariant.price/100).toFixed(2)),saveButton.setAttribute("data-compareat",newVariant.compare_at_price?(newVariant.compare_at_price/100).toFixed(2):""),saveButton.setAttribute("data-customsale",newVariant.custom_private_sale_price?(newVariant.custom_private_sale_price/100).toFixed(2):""),saveButton.setAttribute("data-preorder",newVariant.is_preorder?"true":""),saveButton.setAttribute("data-finalsale",newVariant.is_final_sale?"true":""),newVariant.hasOwnProperty("option1")&&saveButton.setAttribute("data-color",newVariant.option1),newVariant.hasOwnProperty("option2")&&saveButton.setAttribute("data-size",newVariant.option2||""),newVariant.hasOwnProperty("back_in_stock_date")&&saveButton.setAttribute("data-stockdate",newVariant.back_in_stock_date||""),newVariant.hasOwnProperty("featured_image")&&newVariant.featured_image&&newVariant.featured_image.src&&saveButton.setAttribute("data-image",newVariant.featured_image.src);try{var productDataEl=this.addonDetailSection.querySelector("[data-product-json]");if(productDataEl){var productData=JSON.parse(productDataEl.textContent),variantExtra=productData.variants_extra_data&&productData.variants_extra_data[newVariant.id];if(variantExtra&&variantExtra.plp_image){var plpBase=variantExtra.plp_image.replace(/\?.*$/,"");saveButton.setAttribute("data-plpimage",plpBase+"?width=600&height=600&crop=center")}}}catch{}}else saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.textContent=window.languages.productFormSoldOut}}}},{key:"_updateFooter",value:function(){var fmt=new Intl.NumberFormat(void 0,{style:"currency",currency:window.theme&&window.theme.currencyCode||"USD",maximumFractionDigits:0}),totalPrice=this.selections.reduce(function(sum,item){var price=item.price&&item.price.customSalePrice&&parseFloat(item.price.customSalePrice)<parseFloat(item.price.decimalValue)?parseFloat(item.price.customSalePrice):parseFloat(item.price&&item.price.decimalValue||0);return sum+(isNaN(price)?0:price)},0),count=this.selections.length,countEl=this.element.querySelector(".cuy-drawer-total-count"),labelEl=this.element.querySelector(".cuy-drawer-total-label"),priceEl=this.element.querySelector(".cuy-drawer-footer__total-price");countEl&&(countEl.textContent=count),labelEl&&(labelEl.textContent=count===1?"Item":"Items"),priceEl&&(priceEl.textContent=fmt.format(totalPrice));var hasAddons=this.selections.some(function(s){return!s.isBaseProduct}),atbBtn=this.element.querySelector(".cuy-drawer-footer__atb");atbBtn&&(atbBtn.disabled=!hasAddons,atbBtn.classList.toggle("cuy-drawer-footer__atb--disabled",!hasAddons));var footer=this.element.querySelector(".cuy-drawer-footer");footer&&footer.classList.toggle("cuy-drawer-footer--has-selection",hasAddons)}},{key:"_showToast",value:function(message){var _this=this,toast=this.element.querySelector(".cuy-drawer-toast");toast&&(toast.textContent=message,toast.classList.add("cuy-drawer-toast--visible"),clearTimeout(this._toastTimer),this._toastTimer=setTimeout(function(){toast.classList.remove("cuy-drawer-toast--visible")},2500))}},{key:"_buildPayloadItems",value:function(productLineGroupID,item){var items=[],productProperties=Object.assign({},item.properties,{_line_group:productLineGroupID}),uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);if(productProperties._uuid=uuid,productProperties._is_baseproduct=item.isBaseProduct,item.monogramming&&item.monogramming.text){var monoProps={"Monogram Details":item.monogramming.text,"Monogram Color":item.monogramming.color,"Monogram Size":item.monogramming.size,is_final_sale:!0,_LPROP:"no-returns"};items.push({id:item.id,quantity:1,properties:Object.assign({},productProperties,monoProps)});var monoUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);items.push({id:item.monogramming.pid,quantity:1,properties:{_hidden:!0,_uuid:monoUuid,_parent_uuid:uuid,_is_monogram:!0,_line_group:productLineGroupID}})}else items.push({id:item.id,quantity:1,properties:productProperties});return items}},{key:"_buildPayload",value:async function(selections){var _this=this,payload={items:[]},productLineGroupsUsed=[],productLineGroupID=await _generateLineGroupID(productLineGroupsUsed);productLineGroupsUsed.push(productLineGroupID);var items=await Promise.all(selections.map(async function(item){return _this._buildPayloadItems(productLineGroupID,item)}));return payload.items=items.flat(),payload}},{key:"_addItemsToCart",value:function(event){event.preventDefault(),event.stopPropagation();var _this=this,atbBtn=event.target.closest(".cuy-drawer-footer__atb")||event.target,selectionsToAdd=this.selections.slice().reverse();this._buildPayload(selectionsToAdd).then(function(payload){fetch(window.routes.cartAddUrl+".js",{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){response.ok?(_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:selectionsToAdd.length,source:"cuy-drawer",products:selectionsToAdd.map(function(item){return{id:item.id,sku:item.sku||"",mpid:item.mpid,name:item.name,color:item.color,size:item.size,price:parseFloat(item.price.decimalValue),isBaseProduct:item.isBaseProduct}})},bubbles:!0})),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),checkPrivateSale(),_this._addedToCart=!0,_this._close()):response.json().then(function(content){var errEl=document.createElement("span");errEl.className="ProductForm__Error Alert Alert--error",errEl.innerHTML=content.description,atbBtn.insertAdjacentElement("afterend",errEl),setTimeout(function(){errEl.remove()},2500)})})})}}]),CuyDrawerConfiguratorSection2})(),CuyanaPreconfiguredSetsSection=(function(){function CuyanaPreconfiguredSetsSection2(container){_classCallCheck(this,CuyanaPreconfiguredSetsSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.track=this.element.querySelector("[data-cuy-sets-track]"),this.tabs=Array.prototype.slice.call(this.element.querySelectorAll(".CuyanaSets__tab")),this.panels=Array.prototype.slice.call(this.element.querySelectorAll(".CuyanaSets__panel")),this.activeIndex=0,this.delegateElement.on("click",'[data-action="cuy-sets-select"]',this._onSelect.bind(this)),this.delegateElement.on("click",'[data-action="cuy-sets-buy"]',this._onBuy.bind(this)),this._setupSwipe(),this._setupCardDrag()}return _createClass(CuyanaPreconfiguredSetsSection2,[{key:"onUnload",value:function(){this.delegateElement.off()}},{key:"_activate",value:function(index){var count=this.tabs.length;index<0&&(index=0),index>count-1&&(index=count-1),this.activeIndex=index,this.track&&(this.track.style.transform="translateX("+-index*100+"%)"),this.tabs.forEac
18h(function(tab,i){var on=i===index;tab.classList.toggle("is-active",on),tab.setAttribute("aria-selected",on?"true":"false")}),this.panels.forEach(function(panel,i){panel.classList.toggle("is-active",i===index)});var activePanel=this.panels[index];if(activePanel){var activeCards=activePanel.querySelector(".CuyanaSets__cards");activeCards&&(activeCards.scrollLeft=0)}var activeTab=this.tabs[index];activeTab&&activeTab.scrollIntoView&&activeTab.scrollIntoView({block:"nearest",inline:"center",behavior:"smooth"})}},{key:"_onSelect",value:function(event,target){var idx=parseInt(target.getAttribute("data-set-index"),10);isNaN(idx)||this._activate(idx)}},{key:"_onBuy",value:function(event,target){event.preventDefault();var _this=this;if(!target.hasAttribute("disabled")){var ids=(target.getAttribute("data-variant-ids")||"").split(",").map(function(s){return s.trim()}).filter(Boolean);if(ids.length){var label=target.querySelector(".CuyanaSets__addLabel"),originalLabel=label?label.textContent:"",items=ids.map(function(id){return{id,quantity:1}});target.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start")),fetch(window.routes.cartAddUrl+".js",{body:JSON.stringify({items}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){if(document.dispatchEvent(new CustomEvent("theme:loading:end")),target.removeAttribute("disabled"),response.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{quantity:items.length,source:"cuyana-preconfigured-sets"}})),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0}));var srRegion=document.querySelector("#srAnnouncements");srRegion&&(srRegion.textContent="Your Set has been added to the cart."),label&&(label.textContent="Added to bag",setTimeout(function(){label.textContent=originalLabel||"Buy Set"},1600))}else response.json().then(function(content){var errEl=document.createElement("span");errEl.className="ProductForm__Error Alert Alert--error",errEl.textContent=content&&content.description||"Could not add this set to your cart.",target.insertAdjacentElement("afterend",errEl),setTimeout(function(){errEl.remove()},3e3)}).catch(function(){})}).catch(function(){document.dispatchEvent(new CustomEvent("theme:loading:end")),target.removeAttribute("disabled")})}}}},{key:"_setupSwipe",value:function(){var _this=this,hero=this.element.querySelector("[data-cuy-sets-hero]");if(hero){var startX=null,startY=null;hero.addEventListener("touchstart",function(e){startX=e.touches[0].clientX,startY=e.touches[0].clientY},{passive:!0}),hero.addEventListener("touchend",function(e){if(startX!==null){var t=e.changedTouches[0],dx=t.clientX-startX,dy=t.clientY-startY;startX=null,startY=null,!(Math.abs(dx)<40||Math.abs(dx)<Math.abs(dy))&&_this._activate(_this.activeIndex+(dx<0?1:-1))}},{passive:!0})}}},{key:"_setupCardDrag",value:function(){var rows=this.element.querySelectorAll(".CuyanaSets__cards");Array.prototype.forEach.call(rows,function(row){var isDown=!1,moved=!1,startX=0,startScroll=0;row.addEventListener("pointerdown",function(e){e.pointerType&&e.pointerType!=="mouse"||(isDown=!0,moved=!1,startX=e.clientX,startScroll=row.scrollLeft)}),row.addEventListener("pointermove",function(e){if(isDown){var dx=e.clientX-startX;!moved&&Math.abs(dx)>3&&(moved=!0,row.setPointerCapture&&row.setPointerCapture(e.pointerId),row.classList.add("is-dragging")),moved&&(row.scrollLeft=startScroll-dx)}});var end=function(){isDown&&(isDown=!1,row.classList.remove("is-dragging"))};row.addEventListener("pointerup",end),row.addEventListener("pointercancel",end),row.addEventListener("click",function(e){moved&&(e.preventDefault(),e.stopPropagation(),moved=!1)},!0),row.addEventListener("dragstart",function(e){e.preventDefault()})})}}]),CuyanaPreconfiguredSetsSection2})(),ProductMonogrammingSection=(function(){function ProductMonogrammingSection2(container,init=!1){var _this=this;if(_classCallCheck(this,ProductMonogrammingSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.monoCost=15,this.modal=document.querySelector("#monogrammingModal"),this.goBackAndDelete=!1,this.parentItemLineGroup=null,this.parentItemUuid=null,this.parentItemKey=null,this.parentItemProperties={},this.initialized=!1,this.modal&&window.location.hash.indexOf("monogram")!==-1){window.history.replaceState(void 0,void 0," ");var modalInstance=bootstrap.Modal.getInstance(this.modal);modalInstance&&modalInstance.show()}_this.monogramVariants=!1;const monogrammingDataUrl=window.location.origin+"/products/mono-service.json";fetch(monogrammingDataUrl).then(response=>response.text()).then(html=>{var monogramProductA=html.trim()?JSON.parse(html):{};fetch(window.location.origin+"/products/mono-service-both-cases.json").then(response=>response.text()).then(html2=>{var monogramProductB=html2.trim()?JSON.parse(html2):{};_this.monogramVariants=[...monogramProductA?.product?.variants,...monogramProductB?.product?.variants]})}).catch(error=>{console.error("Failed to fetch monogramming product data for configurator:",error)}),this._attachListeners(init)}return _createClass(ProductMonogrammingSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click")}},{key:"_attachListeners",value:function(init){this.delegateElement.on("key
18down",".user-input .inputs",this._keyDown.bind(this)),this.delegateElement.on("keypress",".user-input .inputs",this._keyPress.bind(this)),this.delegateElement.on("keyup",".user-input .inputs",this._keyUp.bind(this)),this.delegateElement.on("change",".custom-control-input",this._change.bind(this)),init&&this.modal&&(this.modal.addEventListener("shown.bs.modal",this._initModal.bind(this)),this.modal.addEventListener("hide.bs.modal",this._hideModal.bind(this)),this.delegateElement.on("click",".monogramming-add-to-cart button",this._addItemsToCart.bind(this)),this.delegateElement.on("click",".monogramming-add-to-product button",this._addMonogrammingToProduct.bind(this)),this.delegateElement.on("click",".monogramming-update-product button",this._updateMonogrammingOnProduct.bind(this)),this.delegateElement.on("click",".monogramming-remove-from-product button",this.removeMonogrammingFromProduct.bind(this)))}},{key:"_initModal",value:function(event){var clickedItem=null;if(event?.delegateTarget?.dataset?.variantId?clickedItem=event?.delegateTarget:event?.relatedTarget?.dataset?.variantId&&(clickedItem=event?.relatedTarget),clickedItem.classList.contains("ProductForm__Monogramming")){var productHandle=clickedItem.dataset.product,variant={id:clickedItem.dataset.variantId};this._updateMonogrammingModal(variant,productHandle,!0),clickedItem=null}if(clickedItem){if(this.cartItemDiv=clickedItem.closest(".CartItem"),this.cartItemDiv){this.parentItemLineGroup=this.cartItemDiv.getAttribute("data-line-group"),this.parentItemUuid=this.cartItemDiv.getAttribute("data-item-uuid"),this.parentItemKey=this.cartItemDiv.getAttribute("data-item-key");var linePropertiesRaw=this.cartItemDiv.getAttribute("data-line-properties");this.parentItemProperties=linePropertiesRaw&&linePropertiesRaw.trim()?JSON.parse(linePropertiesRaw):{};var quantityElement=this.cartItemDiv.querySelector(".QuantitySelector__CurrentQuantity");this.parentItemQty=quantityElement.value}var productHandle=clickedItem.dataset.product,variant={id:clickedItem.dataset.variantId};this._updateMonogrammingModal(variant,productHandle)}}},{key:"_populateMongramValues",value:function(){if(this.cartItemDiv&&this.cartItemDiv.getAttribute("data-line-properties")){var lipRaw=this.cartItemDiv.getAttribute("data-line-properties"),lip=lipRaw.trim()?JSON.parse(lipRaw):{};if(lip["Monogram Details"]){for(var monogramDetail=lip["Monogram Details"],monogramInputs=document.querySelectorAll('input[name="monogram[]"]'),i=0;i<monogramDetail.length;i++)i<monogramInputs.length&&(monogramInputs[i].value=monogramDetail.charAt(i),i==monogramDetail.length-1&&monogramInputs[i].focus());for(var j=monogramDetail.length;j<monogramInputs.length;j++)monogramInputs[j].value="";var monogramOverlayText=this.element.querySelector(".monogram-overlay svg text");monogramOverlayText.textContent=monogramDetail}if(lip["Monogram Color"]){var radioButtons=document.querySelectorAll('input[name="placements"]');radioButtons.forEach(function(radioButton){var colorLabel=radioButton.getAttribute("data-label");colorLabel===lip["Monogram Color"]&&(radioButton.checked=!0)})}if(lip["Monogram Placement"]){var radioButtons=document.querySelectorAll('input[name="placements"]');radioButtons.forEach(function(radioButton){var placementLabel=radioButton.getAttribute("data-label");placementLabel===lip["Monogram Placement"]&&(radioButton.checked=!0)})}if(lip["Monogram Size"]){var characterlimit=!1,radioButtons=document.querySelectorAll('input[name="sizes"]');if(radioButtons.forEach(function(radioButton){var sizeLabel=radioButton.getAttribute("data-label");sizeLabel===lip["Monogram Size"]&&(radioButton.checked=!0,characterlimit=radioButton.getAttribute("data-characterlimit")?JSON.parse(radioButton.getAttribute("data-characterlimit")):!1)}),characterlimit){var userInputInputs=this.element.querySelectorAll("#monogramming .user-input .inputs");userInputInputs.forEach(function(input,i2){input.classList.remove("d-none"),i2>=characterlimit&&(input.value="",input.classList.add("d-none"))});var monogramInputs=this.element.querySelectorAll("input[name='monogram[]']"),monogram=Array.from(monogramInputs).map(function(input){return input.value}).filter(function(el){return el!==""});monogramOverlayText&&(monogramOverlayText.textContent=monogram.join(""));var userInputElement=this.element.querySelector(".user-input");
18userInputElement.style.setProperty("--chars",characterlimit);var monogramOverlayElement=this.element.querySelector(".monogram-overlay");monogramOverlayElement&&(characterlimit<4?monogramOverlayElement.classList.add("large"):monogramOverlayElement.classList.remove("large"));var inputField=document.querySelector(".product-data .monogrammingCopy input[name='monogram[]']");if(inputField){var trimmedString=inputField.value.substring(0,characterlimit);inputField.setAttribute("maxlength",characterlimit),inputField.value=trimmedString;var selectedSize=this.element.querySelector('input[name="sizes"]:checked');if(selectedSize){var sizeMessage=selectedSize.closest(".custom-radio").querySelector(".size-message-hidden").innerHTML;this.element.querySelector(".monogrammingCopy .size-message").innerHTML=sizeMessage}}}}}}},{key:"_hideModal",value:function(event){this.modal.classList.add("overlaid")}},{key:"_getMonogrammingData",value:function(event){var monoCost=this.monoCost,monogramInputs=this.element.querySelectorAll("input[name='monogram[]']"),monogram=Array.from(monogramInputs).map(function(input){return input.value}).filter(function(el){return el!==""}),monogrammingError=this.element.querySelector(".monogramming-error");monogrammingError.textContent="";var monogramString=monogram.join("").toUpperCase();if(monogram.length===0)return monogrammingError.textContent=this.element.querySelector(".user-input").getAttribute("data-error"),!1;if(!_validMonoCharacterCheck(monogramString))return monogrammingError.textContent=this.element.querySelector(".user-input").getAttribute("data-error-letters"),!1;var skuPrefix=this.element.querySelector(".selections").getAttribute("data-type"),selectedPlacement="",selectedPlacementID="",upCharge=0,placementRadios=this.element.querySelectorAll('input[name="placements"]');if(placementRadios.length>0){var placements=Array.from(placementRadios).filter(function(radio){return radio.checked});if(placements.length==0)return monogrammingError.style.display="block",monogrammingError.textContent=this.element.querySelector(".selections").getAttribute("data-error"),!1;selectedPlacement=placements[0].getAttribute("data-label"),selectedPlacementID=placements[0].getAttribute("data-id"),upCharge=Number(placements[0].getAttribute("data-additional-cost")),placements[0].getAttribute("data-prefix").trim()!==""&&(skuPrefix=placements[0].getAttribute("data-prefix").trim())}var sizeRadios=this.element.querySelectorAll('input[name="sizes"]:checked');if(sizeRadios.length==0)return monogrammingError.textContent=this.element.querySelector(".selections").getAttribute("data-error"),!1;var selectedSizeID=sizeRadios[0].getAttribute("data-id").split(":")[0].trim(),selectedSize=sizeRadios[0].getAttribute("data-label"),colorRadios=this.element.querySelectorAll('input[name="colors"]:checked');if(colorRadios.length==0)return monogrammingError.textContent=this.element.querySelector(".selections").getAttribute("data-error"),!1;var selectedColorID=colorRadios[0].getAttribute("data-id").split(":")[0].trim(),selectedColor=colorRadios[0].getAttribute("data-label"),monogramSKU=skuPrefix+"-"+selectedColorID+"-"+selectedSizeID,variantId=null;if(this.monogramVariants)for(var i=0;i<this.monogramVariants.length;i++){var variant=this.monogramVariants[i];if(variant.sku===monogramSKU){variantId=variant.id,monoCost=parseFloat(variant.price);break}}var data={pid:variantId,sku:monogramSKU,quantity:1,text:monogram.join("").toUpperCase(),placement:selectedPlacement,placementId:selectedPlacementID,size:selectedSize,color:selectedColor,cost:monoCost,upCharge};return data}},{key:"_addItemsToCart",value:function(event){event.preventDefault(),event.stopPropagation();var monogramingData=this._getMonogrammingData();if(!monogramingData)return!1;var _this=this,addToCartButton2=event.target,productLineGroupsUsed=[],payload={items:[]},monogramingData=this._getMonogrammingData();document.dispatchEvent(new CustomEvent("theme:loading:start"));var formElement=document.querySelector('section[data-section-type="product"] form[action*="/cart/add"]'),productToAddToCart=Form.serialize(formElement);_generateLineGroupID(productLineGroupsUsed).then(productLineGroupID=>{const currentDate=new Date;let uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);productLineGroupsUsed.push(productLineGroupID),productToAddToCart.properties["Monogram Details"]=monogramingData.text,productToAddToCart.properties["Monogram Color"]=monogramingData.color,productToAddToCart.properties["Monogram Size"]=monogramingData.size,productToAddToCart.properties._line_group=productLineGroupID,productToAddToCart.properties.is_final_sale=!0,productToAddToCart.properties._LPROP="no-returns",productToAddToCart.properties._uuid=uuid,monogramingData.placement&&(productToAddToCart.properties["Monogram Placement"]=monogramingData.placement);let monoProductUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var monoProductToAddToCart={id:monogramingData.pid,quantity:1,properties:{_hidden:!0,_uuid:monoProductUuid,_parent_uuid:uuid,_is_monogram:!0,_line_group:productLineGroupID}};payload.items.push(productToAddToCart),payload.items.push(monoProductToAddToCart)}).then(function(){fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){if(document.dispatchEvent(new CustomEvent("theme:loading:end")),response.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:1},bubbles:!0}));var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}else response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})})}},{key:"_addMonogrammingToProduct",value:function(event){event.preventDefault(),event.stopPropagation();var monogramingData=this._getMonogrammingData();if(!monogramingData)return!1;var _this=this,addToCartButton2=event.target,productLineGroupsUsed=[],payload={items:[]},existingProperties={...this.parentItemProperties},productToUpdate={id:this.parentItemKey,quantity:this.parentItemQty,properties:{...existingProperties,_uuid:this.parentItemUuid}};document.dispatchEvent(new CustomEvent("theme:loading:start")),_generateLineGroupID(productLineGroupsUsed).then(productLineGroupID=>{const currentDate=new Date;let uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);_this.parentItemLineGroup?productLineGroupID=_this.parentItemLineGroup:(productLineGroupsUsed.push(productLineGroupID),productToUpdate.properties._line_group=productLineGroupID),productToUpdate.properties["Monogram Details"]=monogramingData.text,productToUpdate.properties["Monogram Color"]=monogramingData.color,productToUpdate.properties["Monogram Size"]=monogramingData.size,productToUpdate.properties.is_final_sale=!0,productToUpdate.properties._LPROP="no-returns",monogramingData.placement&&(productToUpdate.properties["Monogram Placement"]=monogramingData.placement);let monoProductUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var monoProductToAddToCart={id:monogramingData.pid,quantity:_this.parentItemQty,parent_line_key:_this.parentItemKey,properties:{_hidden:!0,_uuid:monoProductUuid,_parent_uuid:_this.parentItemUuid,_is_monogram:!0,_line_group:productLineGroupID}};payload.items.push(monoProductToAddToCart)}).then(function(){fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){response.ok?fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify(productToUpdate),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response2){if(document.dispatchEvent(new CustomEvent("theme:loading:end")),response2.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:1},bubbles:!0}));var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}else response2.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})}):response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})})}},{key:"removeMonogrammingFromProduct",value:function(event){event.preventDefault(),event.stopPropagation();var _this=this,existingProperties={...this.parentItemProperties};delete existingProperties["Monogram Details"],delete existingProperties["Monogram Color"],delete existingProperties["Monogram Size"],delete existingProperties["Monogram Placement"],delete existingProperties.is_final_sale,delete existingProperties._LPROP;var parentItemElement=document.querySelector('.CartItem[data-item-uuid="'+this.parentItemUuid+'"]');parentItemElement&&parentItemElement.getAttribute("data-finalsale")==="true"&&(existingProperties.is_final_sale=!0,existingProperties._LPROP="no-returns");var productToUpdate={id:this.parentItemKey,quantity:this.parentItemQty,properties:{...existingProperties,_uuid:this.parentItemUuid}};productToUpdate.properties._line_group=this.parentItemLineGroup,document.dispatchEvent(new CustomEvent("theme:loading:start")),fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify(productToUpdate),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){var monoItemElement=document.querySelector('.CartItem[data-is-giftbox="false"][data-parent-uuid="'+_this.parentItemUuid+'"]');if(response.ok&&monoItemElement){var monoItemKey=monoItemElement.getAttribute("data-item-key"),parentItemLineGroup=monoItemElement.getAttribute("data-line-group"),monoProductToUpdate={id:monoItemKey,quantity:0};fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify(monoProductToUpdate),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response2){if(document.dispatchEvent(new CustomEvent("theme:loading:end")),response2.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:0},bubbles:!0}));var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}else response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description})})}else response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton.removeAttribute("disabled"),addToCartButton.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})}},{key:"_updateMonogrammingOnProduct",value:function(event){event.preventDefault(),event.stopPropagation();var monogramingData=this._getMonogrammingData();if(!monogramingData)return!1;document.dispatchEvent(new CustomEvent("theme:loading:start"));var _this=this,productLineGroupID=this.parentItemLineGroup,addToCartButton2=event.target,payload={items:[]},monoItemElement=document.querySelector('.CartItem[data-is-giftbox="false"][data-parent-uuid="'+this.parentItemUuid+'"]');if(!monoItemElement)return!1;var monoItemKey=monoItemElement.getAttribute("data-item-key"),monoProductToRemove={id:monoItemKey,quantity:0},existingProperties={...this.parentItemProperties},productToUpdate={id:this.parentItemKey,properties:{...existingProperties,_uuid:this.parentItemUuid,_line_group:productLineGroupID,"Monogram Details":monogramingData.text,"Monogram Color":monogramingData.color,"Monogram Size":monogramingData.size,is_final_sale:!0,_LPROP:"no-returns"}};monogramingData.placement&&(productToUpdate.properties["Monogram Placement"]=monogramingData.placement);let monoProductUuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var monoProductToAddToCart={id:monogramingData.pid,quantity:this.parentItemQty,parent_line_key:_this.parentItemKey,properties:{_hidden:!0,_uuid:monoProductUuid,_parent_uuid:_this.parentItemUuid,_is_monogram:!0,_line_group:productLineGroupID}};payload.items.push(monoProductToAddToCart),fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){response.ok&&fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify(monoProductToRemove),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response2){response2.ok?fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify(productToUpdate),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response3){if(document.dispatchEvent(new CustomEvent("theme:loading:end")),response3.ok){_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:1},bubbles:!0}));var modalInstance=bootstrap.Modal.getInstance(_this.modal);modalInstance&&modalInstance.hide()}
18else response3.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})}):response2.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})})}},{key:"_change",value:function(event){var target=event.target;if(target.classList.contains("custom-control-input")){var group=target.getAttribute("data-group"),placements=target.getAttribute("data-placements")?JSON.parse(target.getAttribute("data-placements")):!1,sizes=target.getAttribute("data-sizes")?JSON.parse(target.getAttribute("data-sizes")):!1,colors=target.getAttribute("data-colors")?JSON.parse(target.getAttribute("data-colors")):!1,characterlimit=target.getAttribute("data-characterlimit")?JSON.parse(target.getAttribute("data-characterlimit")):!1,monogramOverlayText=this.element.querySelector(".monogram-overlay svg text");if(this.element.querySelector(".monogramming-error").textContent="",group==="placements"){var additionalCharge=target.getAttribute("data-additional-cost")?target.getAttribute("data-additional-cost"):0,upCharge=Number(additionalCharge),monoCost=this.monoCost+upCharge;const buttonMonoPrice=this.element.querySelector(".MonogrammingModal__MonoPrice"),addMonoButton=buttonMonoPrice.closest(".btn-primary");buttonMonoPrice.innerHTML=" +$"+monoCost,addMonoButton.setAttribute("aria-label",`Add monogramming to this product for an additional ${monoCost}`)}if(group==="colors"){var label=target.closest(".custom-radio").querySelector("label").textContent.trim().replace(/\s+/g,"-").toLowerCase();this.element.querySelector(".monogram-overlay").setAttribute("data-style",label)}if(group==="sizes"){var monogramInputs=this.element.querySelectorAll("input[name='monogram[]']"),monogram=Array.from(monogramInputs).map(function(input){return input.value}).filter(function(el){return el!==""});monogramOverlayText&&(monogramOverlayText.textContent=monogram.join(""));const index=target.getAttribute("data-index"),fallBackImageID="monogram_image_1",desiredImageID="monogram_image_"+index,desiredImage=document.querySelector('[id="'+desiredImageID+'"]'),currentVisibleImage=document.querySelector('[id^="monogram_image_"]:not(.d-none)');desiredImage&&currentVisibleImage&&desiredImage!==currentVisibleImage?(currentVisibleImage.classList.add("d-none"),desiredImage.classList.remove("d-none")):!desiredImage&&currentVisibleImage&&currentVisibleImage.id!==fallBackImageID&&(currentVisibleImage.classList.add("d-none"),document.querySelector('[id="'+fallBackImageID+'"]').classList.remove("d-none"))}if(placements){var placementInputs=this.element.querySelectorAll(".selection.placements .custom-control-input");placementInputs.forEach(function(input){placements.indexOf(input.getAttribute("data-id"))>-1?input.closest(".custom-radio").classList.remove(group+"-hide"):(input.checked=!1,input.closest(".custom-radio").classList.add(group+"-hide"))})}if(sizes){var sizeInputs=this.element.querySelectorAll(".selection.sizes .custom-control-input");sizeInputs.forEach(function(input){sizes.indexOf(input.getAttribute("data-id"))>-1?input.closest(".custom-radio").classList.remove(group+"-hide"):(input.checked=!1,input.closest(".custom-radio").classList.add(group+"-hide"))})}if(colors){var colorInputs=this.element.querySelectorAll(".selection.colors .custom-control-input");colorInputs.forEach(function(input){colors.indexOf(input.getAttribute("data-id"))>-1?input.closest(".custom-radio").classList.remove(group+"-hide"):(input.checked=!1,input.closest(".custom-radio").classList.add(group+"-hide"))})}if(characterlimit){var userInputInputs=this.element.querySelectorAll("#monogramming .user-input .inputs");
18userInputInputs.forEach(function(input,i){input.classList.remove("d-none"),i>=characterlimit&&(input.value="",input.classList.add("d-none"))});var monogramInputs=this.element.querySelectorAll("input[name='monogram[]']"),monogram=Array.from(monogramInputs).map(function(input){return input.value}).filter(function(el){return el!==""});monogramOverlayText&&(monogramOverlayText.textContent=monogram.join(""));var userInputElement=this.element.querySelector(".user-input");userInputElement.style.setProperty("--chars",characterlimit);var monogramOverlayElement=this.element.querySelector(".monogram-overlay");monogramOverlayElement&&(characterlimit<4?monogramOverlayElement.classList.add("large"):monogramOverlayElement.classList.remove("large"));var inputField=document.querySelector(".product-data .monogrammingCopy input[name='monogram[]']");if(inputField){var trimmedString=inputField.value.substring(0,characterlimit);inputField.setAttribute("maxlength",characterlimit),inputField.value=trimmedString;var selectedSize=this.element.querySelector('input[name="sizes"]:checked');if(selectedSize){var sizeMessage=selectedSize.closest(".custom-radio").querySelector(".size-message-hidden").innerHTML;this.element.querySelector(".monogrammingCopy .size-message").innerHTML=sizeMessage}}}}}},{key:"_keyUp",value:function(event){var target=event.target,monogramOverlayText=this.element.querySelector(".monogram-overlay svg text");if(this.goBackAndDelete){var prevInput=target.previousElementSibling;if(prevInput&&prevInput.classList.contains("inputs")&&(prevInput.focus(),prevInput.value=""),this.goBackAndDelete=!1,monogramOverlayText){var textContent=monogramOverlayText.textContent;if(textContent.length>0){var newTextContent=textContent.slice(0,-1);monogramOverlayText.textContent=newTextContent}}return!1}if(target.value.length===target.maxLength&&!(event.keyCode===9||event.keyCode===16)){var nextInput=target.nextElementSibling;nextInput&&nextInput.classList.contains("inputs")?nextInput.focus():target.blur()}var monogramInputs=this.element.querySelectorAll("input[name='monogram[]']"),monogram=Array.from(monogramInputs).map(function(input){return input.value});monogram=monogram.filter(function(el){return el!==""}),monogramOverlayText&&(monogramOverlayText.textContent=monogram.join(""))}},{key:"_keyPress",value:function(event){var key=event.key;if(!_validMonoCharacterCheck(key))return event.preventDefault(),this.element.querySelector(".monogramming-error").textContent=this.element.querySelector(".user-input").getAttribute("data-error-letters"),!1}},{key:"_keyDown",value:function(event){var target=event.target,cursorPosition=target.selectionStart;(event.key==="Delete"||event.key==="Backspace")&&cursorPosition===0&&(this.goBackAndDelete=!0)}},{key:"_updateMonogrammingModal",value:function(variant,productHandle,hideCartOptions=!1){var _this=this;const monogrammingModal=this.modal;if(this.modal){var url=window.location.pathname+"?variant="+variant.id+"&view=monogramming-modal";productHandle&&(url="/products/"+productHandle+"?variant="+variant.id+"&view=monogramming-modal"),monogrammingModal.classList.add("opening"),fetch(url).then(response=>response.text()).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const monogrammingHTML=tempElement.querySelector("#monogramming");monogrammingHTML&&(monogrammingModal.querySelector("#monogramming").innerHTML=monogrammingHTML.innerHTML,_this.monoCost=Number(monogrammingHTML.getAttribute("data-monogrammingcost")||_this.monoCost))}).then(function(){if(_this.parentItemUuid){var monoItemElement=document.querySelector('.CartItem[data-is-giftbox="false"][data-parent-uuid="'+_this.parentItemUuid+'"]');monoItemElement?(monogrammingModal.querySelector(".monogramming-add-to-product").classList.add("d-none"),monogrammingModal.querySelector(".monograming-edit").classList.remove("d-none")):(monogrammingModal.querySelector(".monogramming-add-to-product").classList.remove("d-none"),monogrammingModal.querySelector(".monograming-edit").classList.add("d-none"))}hideCartOptions&&(monogrammingModal.querySelector(".monogramming-add-to-product").classList.add("d-none"),monogrammingModal.querySelector(".monograming-edit").classList.add("d-none"))}).then(function(){var monoInputs=monogrammingModal.querySelector(".inputs");monoInputs&&!hideCartOptions&&(monogrammingModal.querySelector(".monogramming-add-to-cart").classList.add("d-none"),monoInputs.focus(),_this._populateMongramValues()),checkPrivateSale(),monogrammingModal.classList.contains("show")&&monogrammingModal.classList.remove("overlaid")}).catch(error=>{console.error("Failed to fetch monogramming modal content:",error)})}}}]),ProductMonogrammingSection2})(),ProductSystemsSection=(function(){function ProductSystemsSection2(container){var _this=this;_classCallCheck(this,ProductSystemsSection2);var sidebarDrawer=document.querySelector("#sidebar-product-systems");if(!sidebarDrawer)return;this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.productGallery=null,this.productSystems=this.element.querySelector(".product-systems"),this.systemsItems=this.element.querySelector(".systems-items");const exclusionElement=this.element.querySelector("[data-systems-exclusions-json]");exclusionElement&&exclusionElement.innerHTML.trim()!==""&&(this.exclusions=JSON.parse(exclusionElement.innerHTML)),this.sidebarDelegateElement=new domDelegate.Delegate(sidebarDrawer),this.sidebarContent=sidebarDrawer.querySelector(".Drawer__Main"),this.sidebarDrawer=new Drawer(sidebarDrawer,{onClose:this._onDrawerClosed.bind(this)});const baseProductDataElement=this.element.querySelector("[data-base-systems-product-json]");baseProductDataElement&&baseProductDataElement.innerHTML.trim()!==""&&(this.baseproduct=JSON.parse(baseProductDataElement.innerHTML)),this._attachListeners()}return _createClass(ProductSystemsSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.productVariants&&this.productVariants.destroy(),this.productGallery&&this.productGallery.destroy()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".showControl",this._showMoreLess.bind(this)),this.delegateElement.on("click",".addonItemCard",this._openSidebar.bind(this)),this.delegateElement.on("variant:changed",this._updateSystemsProducts.bind(this)),this.sidebarDelegateElement.on("variant:changed",this._updateSidebarAddon.bind(this)),this.sidebarDelegateElement.on("click","button.prdsys-addon-atb",this._addItemsToCart.bind(this))}},{key:"_addItemsToCart",value:async function(event){event.preventDefault(),event.stopPropagation();var _this=this,addToCartButton2=event.target,pid=event.target.getAttribute("data-pid"),mpid=event.target.getAttribute("data-mpid"),name=event.target.getAttribute("data-name"),color=event.target.getAttribute("data-color"),size=event.target.getAttribute("data-size"),preorder=event.target.getAttribute("data-preorder"),final_sale=event.target.getAttribute("data-finalsale"),price=event.target.getAttribute("data-price").replace(/^\s+|\s+$/g,""),compare_at_price=event.target.getAttribute("data-compareat").replace(/^\s+|\s+$/g,""),image=event.target.getAttribute("data-image"),stock_date=event.target.getAttribute("data-stockdate"),productLineGroupID=await _generateLineGroupID();const currentDate=new Date;let uuid="CUY"+Date.now()+Math.floor(Math.random()*1e3);var payload={items:[]},productToAddToCart={id:pid,quantity:1,properties:{_line_group:productLineGroupID,_uuid:uuid}};compare_at_price&&(productToAddToCart.properties._compare_at_price=parseFloat(compare_at_price)),payload.items.push(productToAddToCart),fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(payload),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then(function(response){response.ok?(_this.element.dispatchEvent(new CustomEvent("product:added",{detail:{quantity:1},bubbles:!0})),document.documentElement.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})),_this.sidebarDrawer.close()):response.json().then(function(content){var errorMessageElement=document.createElement("span");errorMessageElement.className="ProductForm__Error Alert Alert--error",errorMessageElement.innerHTML=content.description,addToCartButton2.removeAttribute("disabled"),addToCartButton2.insertAdjacentElement("afterend",errorMessageElement),setTimeout(function(){errorMessageElement.remove()},2500)})})}},{key:"_getAddOnItemDetails",value:function(){return new Promise((resolve,reject)=>{var _this=this;const url=window.location.origin+"/products/"+this.sidebardAddonProductHandle+"?variant="+this.sidebarVariantID+"&view=systems-addon";fetch(url).then(response=>{if(!response.ok)throw new Error(`Network response was not ok: ${response.statusText}`);return response.text()}).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html,_this.exclusions&&_this.exclusions.length>0&&_this.exclusions.forEach(item=>{const{baseProducts,exclusions}=item,exclusionKeys=Object.keys(exclusions);(baseProducts.length===0||baseProducts.includes(_this.baseproduct.sku))&&exclusionKeys.forEach(key=>
18{key===_this.sidebardAddonProductHandle&&exclusions[key].forEach(attr=>{const attributeElement=tempElement.querySelector('.ProductForm__Option li[data-value="'+attr+'"]');attributeElement&&attributeElement.remove()})})});const sectionHtml=tempElement.querySelector(".shopify-section")?.innerHTML;sectionHtml?(_this.sidebarContent.innerHTML=sectionHtml,_this.productVariants=new ProductVariants(_this.sidebarContent,{}),checkPrivateSale()):console.error("Error: No .shopify-section element found in the fetched content."),resolve()}).catch(error=>{console.error("Failed to fetch configurator add-on modal content:",error),reject(error)})})}},{key:"_openSidebar",value:async function(event){event.preventDefault(),event.stopPropagation();var addonItemCard=event.target.closest(".addonItemCard");this.sidebarVariantID=addonItemCard.getAttribute("data-pid"),this.sidebardAddonProductHandle=addonItemCard.getAttribute("data-product"),await this._getAddOnItemDetails();var productGalleryElement=this.sidebarContent.querySelector(".Product__Gallery");if(productGalleryElement){var options={enableImageZoom:!1,enableVideoLooping:!1,modalDisplay:!1,stackProductImages:!1,showThumbnails:!1,view:"systems-addon-gallery"};this.productGallery=new ProductGallery(this.sidebarContent,options)}this.sidebarDrawer.open()}},{key:"_onDrawerClosed",value:function(){this.productGallery&&this.productGallery.onUnload(),this.productVariants&&this.productVariants.destroy()}},{key:"_updateSidebarAddon",value:async function(event){event.preventDefault(),event.stopPropagation();var newVariant=event.detail.variant;this.sidebarVariantID=newVariant.id,this._updateSidebarAddonATB(newVariant)}},{key:"_updateSidebarAddonATB",value:function(newVariant){var saveButton=this.sidebarContent.querySelector("button.prdsys-addon-atb");saveButton&&(saveButton.classList.remove("d-none"),newVariant?newVariant.available?(saveButton.removeAttribute("disabled"),saveButton.innerHTML=window.languages.productFromAddToSet,saveButton.setAttribute("data-pid",newVariant.id),saveButton.setAttribute("data-price",(newVariant.price/100).toFixed(2)),newVariant.compare_at_price?saveButton.setAttribute("data-compareat",(newVariant.compare_at_price/100).toFixed(2)):saveButton.setAttribute("data-compareat",""),newVariant.is_preorder?(saveButton.innerHTML=window.languages.productFormPreorder,saveButton.setAttribute("data-preorder","true")):saveButton.setAttribute("data-preorder",""),newVariant.is_final_sale?saveButton.setAttribute("data-finalsale","true"):saveButton.setAttribute("data-finalsale",""),newVariant.hasOwnProperty("option1")&&saveButton.setAttribute("data-color",newVariant.option1),newVariant.hasOwnProperty("option2")?saveButton.setAttribute("data-size",newVariant.option2):saveButton.setAttribute("data-size",""),newVariant.hasOwnProperty("back_in_stock_date")?saveButton.setAttribute("data-stockdate",newVariant.back_in_stock_date):saveButton.setAttribute("data-stockdate",""),newVariant.hasOwnProperty("featured_image")&&newVariant.featured_image.src&&saveButton.setAttribute("data-image",newVariant.featured_image.src)):(saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.setAttribute("data-preorder",""),saveButton.setAttribute("data-finalsale",""),saveButton.innerHTML=window.languages.productFormSoldOut):(saveButton.setAttribute("disabled","disabled"),saveButton.removeAttribute("data-pid"),saveButton.innerHTML=window.languages.productFormUnavailable))}},{key:"_updateSystemsProducts",value:function(event){var _this=this;if(this.productSystems){var variant=event.detail.variant;const url=window.location.origin+"/products/"+variant.productHandle+"?variant="+variant.id+"&view=systems";fetch(url).then(response=>{if(!response.ok)throw new Error(`Network response was not ok: ${response.statusText}`);return response.text()}).then(html=>{const tempElement=document.createElement("div");tempElement.innerHTML=html;const sectionHtml=tempElement.querySelector(".systems-items")?.innerHTML;sectionHtml?_this.systemsItems.innerHTML=sectionHtml:console.error("Error: No .shopify-section element found in the fetched content.")}).catch(error=>{console.error("Failed to fetch configurator add-on modal content:",error)})}}},{key:"_showMoreLess",value:function(event){this.productSystems&&this.productSystems.classList.toggle("showMore")}}]),ProductSystemsSection2})(),RecentlyViewedProductsSection=(function(){function RecentlyViewedProductsSection2(container){_classCallCheck(this,RecentlyViewedProductsSection2),this.element=container,this.options=JSON.parse(this.element.getAttribute("data-section-settings")||"[]"),this._fetchProducts()}return _createClass(RecentlyViewedProductsSection2,[{key:"onUnload",value:function(){this.carousel&&this.carousel.destroy()}},{key:"_fetchProducts",value:function(){var _this=this,queryString=this._getSearchQueryString();queryString!==""&&fetch("".concat(window.routes.searchUrl,"?section_id=").concat(this.element.getAttribute("data-section-id"),"&type=product&q=").concat(queryString),{credentials:"same-origin",method:"GET"}).then(function(response){response.text().then(function(content){var tempElement=document.createElement("div");tempElement.innerHTML=content,_this.element.innerHTML=tempElement.querySelector(".Section").innerHTML,_this.element.parentNode.style.display="block",_this.carousel=new Carousel(_this.element.querySelector("[data-flickity-config]")),checkPrivateSale()})})}},{key:"_getSearchQueryString",value:function(){var items=JSON.parse(localStorage.getItem("recentlyViewedProducts")||"[]");return items.includes(this.options.productId)&&items.splice(items.indexOf(this.options.productId),1),items.map(function(item){return"id:"+item}).join(" OR ")}}]),RecentlyViewedProductsSection2})(),SectionContainer=(function(){function SectionContainer2(){_classCallCheck(this,SectionContainer2),this.constructors=[],this.instances=[],this._attachListeners()}return _createClass(SectionContainer2,[{key:"_attachListeners",value:function(){document.addEventListener("shopify:section:load",this._onSectionLoad.bind(this)),document.addEventListener("shopify:section:unload",this._onSectionUnload.bind(this)),document.addEventListener("shopify:section:select",this._onSelect.bind(this)),document.addEventListener("shopify:section:deselect",this._onDeselect.bind(this)),document.addEventListener("shopify:section:reorder",this._onReorder.bind(this)),document.addEventListener("shopify:block:select",this._onBlockSelect.bind(this)),document.addEventListener("shopify:block:deselect",this._onBlockDeselect.bind(this))}},{key:"register",value:function(type,constructor){var _this=this;this.constructors[type]=constructor,Dom.nodeListToArray(document.querySelectorAll("[data-section-type=".concat(type,"]"))).forEac
18h(function(container){_this._createInstance(container,constructor)})}},{key:"_findInstance",value:function(array,key,value){for(var i=0;i<array.length;i++)if(array[i][key]===value)return array[i]}},{key:"_removeInstance",value:function(array,key,value){for(var i=array.length;i--;)if(array[i][key]===value){array.splice(i,1);break}return array}},{key:"_onSectionLoad",value:function(event){var container=event.target.querySelector("[data-section-id]");container&&this._createInstance(container)}},{key:"_onSectionUnload",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&(typeof instance.onUnload=="function"&&instance.onUnload(event),this.instances=this._removeInstance(this.instances,"id",event.detail.sectionId))}},{key:"_onSelect",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&typeof instance.onSelect=="function"&&instance.onSelect(event)}},{key:"_onDeselect",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&typeof instance.onDeselect=="function"&&instance.onDeselect(event)}},{key:"_onReorder",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&typeof instance.onReorder=="function"&&instance.onReorder(event)}},{key:"_onBlockSelect",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&typeof instance.onBlockSelect=="function"&&instance.onBlockSelect(event)}},{key:"_onBlockDeselect",value:function(event){var instance=this._findInstance(this.instances,"id",event.detail.sectionId);instance&&typeof instance.onBlockDeselect=="function"&&instance.onBlockDeselect(event)}},{key:"_createInstance",value:function(container,constructor){var id=container.getAttribute("data-section-id"),type=container.getAttribute("data-section-type");if(constructor=constructor||this.constructors[type],!(typeof constructor>"u")){var instance=Object.assign(new constructor(container),{id,type,container});this.instances.push(instance)}}}]),SectionContainer2})(),ShopNowSection=(function(){function ShopNowSection2(container){_classCallCheck(this,ShopNowSection2),this.element=container,this.carousel=new Carousel(this.element.querySelector("[data-flickity-config]"))}return _createClass(ShopNowSection2,[{key:"onUnload",value:function(){this.carousel.destroy()}}]),ShopNowSection2})(),ShopTheLookSection=(function(){function ShopTheLookSection2(container){_classCallCheck(this,ShopTheLookSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.usePocketMode=Responsive.matchesBreakpoint("pocket"),this.pocketActivatorButton=this.element.querySelector('[data-action="open-look"]'),this._createOuterCarousel(),this._createPocketPopovers(),this._attachListeners()}return _createClass(ShopTheLookSection2,[{key:"onUnload",value:function(){this.outerCarousel.destroy(),this.innerCarousels.forEach(function(item){item.forEach(function(innerItem){return innerItem.destroy()})}),this.popovers.forEach(function(item){return item.destroy()}),this.delegateElement.off()}},{key:"onBlockSelect",value:function(event){this.outerCarousel.selectCell(event.target.getAttribute("data-slide-index"),!0,!event.detail.load)}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".ShopTheLook__Dot",this._onDotClicked.bind(this))}},{key:"_createPocketPopovers",value:function(){var _this=this;this.popovers=[],Dom.nodeListToArray(this.element.querySelectorAll(".Popover")).forEach(function(popover){_this.popovers.push(new Popover(popover,{activator:_this.pocketActivatorButton,showOverlay:!1,onOpen:_this._openPocketZoom.bind(_this),onClose:_this._closePocketZoom.bind(_this)}))})}},{key:"_createOuterCarousel",value:function(){var _this2=this;this.outerCarousel=new Carousel(this.element.querySelector(".ShopTheLook"),{onSelect:this._onLookChanged.bind(this)}),this.innerCarousels=new Array(this.outerCarousel.flickityInstance.cells.length);for(var i=0;i!==this.innerCarousels.length;++i)this.innerCarousels[i]=[];Dom.nodeListToArray(this.element.querySelectorAll(".ShopTheLook__ProductList")).forEac
18h(function(item){var lookIndex=parseInt(item.getAttribute("data-look-index"));_this2.innerCarousels[lookIndex].push(new Carousel(item,{onSelect:_this2._onProductChanged.bind(_this2)})),item.insertBefore(item.querySelector(".flickity-viewport"),item.querySelector(".ShopTheLook__ViewButton"))}),this.outerCarousel.resize()}},{key:"_onLookChanged",value:function(selectedIndex,selectedCell){this.pocketActivatorButton.setAttribute("aria-controls","".concat(selectedCell.getAttribute("id"),"-popover"))}},{key:"_onProductChanged",value:function(selectedIndex,selectedCell){var lookItem=this.outerCarousel.getSelectedCell(),activeDot=null;Dom.nodeListToArray(lookItem.querySelectorAll(".ShopTheLook__Dot")).forEach(function(dot,index){dot.classList.remove("is-active"),index===selectedIndex&&(dot.classList.add("is-active"),activeDot=dot)}),lookItem.querySelector(".ShopTheLook__ViewButton").setAttribute("href",selectedCell.getAttribute("data-product-url")),lookItem.dispatchEvent(new CustomEvent("product:changed",{detail:{dot:activeDot}}))}},{key:"_onDotClicked",value:function(event,target){var shouldAnimateCarousel=!1,hasOnePopoverOpen=!1,lookIndex=this.outerCarousel.getSelectedIndex();this.popovers.forEach(function(item){item.isOpen&&(hasOnePopoverOpen=!0,shouldAnimateCarousel=!0)}),this.innerCarousels[lookIndex].forEach(function(innerCarousel){innerCarousel.selectCell(parseInt(target.getAttribute("data-product-index"))-1,!1,shouldAnimateCarousel)}),this.usePocketMode&&!hasOnePopoverOpen&&this.popovers[lookIndex].open()}},{key:"_openPocketZoom",value:function(popover){var _this3=this;this._calculateImageTransform(popover),fastdom.mutate(function(){document.getElementById("shopify-section-header").style.cssText="transform: translateY(-100%); transition: transform 0.3s ease-in-out;",_this3.outerCarousel.flickityInstance.unbindDrag(),_this3.outerCarousel.flickityInstance.element.classList.add("is-zoomed"),_this3.outerCarousel.getSelectedCell().classList.add("is-expanded")})}},{key:"_calculateImageTransform",value:function(openPopover){var _this4=this,selectedCell=this.outerCarousel.getSelectedCell();fastdom.measure(function(){var scale=window.innerWidth/(selectedCell.offsetWidth-parseInt(window.getComputedStyle(selectedCell).paddingLeft)*2),heightAfterScale=Math.round(selectedCell.offsetHeight*scale),hiddenImageHeight=Math.round(Math.max(heightAfterScale-(window.innerHeight-openPopover.element.offsetHeight),0)),visibleImageHeight=heightAfterScale-hiddenImageHeight,minTranslateY=Math.round(-(selectedCell.getBoundingClientRect().top-(heightAfterScale-selectedCell.offsetHeight)/2)),maxTranslateY=Math.round(minTranslateY-hiddenImageHeight);_this4._calculateTransformForDotListener=function(event){var dotTopPosition=Math.round((event.detail.dot.offsetTop+event.detail.dot.offsetHeight/2)*scale),offsetToMove=Math.round(dotTopPosition-visibleImageHeight/2),translateY=Math.min(Math.max(minTranslateY-offsetToMove,maxTranslateY),minTranslateY);fastdom.mutate(function(){_this4.outerCarousel.flickityInstance.viewport.style.transform="translate3d(0, ".concat(Math.round(translateY),"px, 0) scale(").concat(scale,")")})},selectedCell.addEventListener("product:changed",_this4._calculateTransformForDotListener),selectedCell.dispatchEvent(new CustomEvent("product:changed",{detail:{dot:selectedCell.querySelector(".ShopTheLook__Dot.is-active")}}))})}},{key:"_closePocketZoom",value:function(){var _this5=this,selectedCell=this.outerCarousel.getSelectedCell();selectedCell.removeEventListener("product:changed",this._calculateTransformForDotListener),fastdom.mutate(function(){document.getElementById("shopify-section-header").style.cssText="transform: translateY(0); transition: transform 0.3s ease-in-out 0.3s;",_this5.outerCarousel.flickityInstance.bindDrag(),_this5.outerCarousel.flickityInstance.element.classList.remove("is-zoomed"),_this5.outerCarousel.flickityInstance.viewport.style.transform=null,selectedCell.classList.remove("is-expanded")})}}]),ShopTheLookSection2})(),SidebarMenuSection=(function(){function SidebarMenuSection2(container){_classCallCheck(this,SidebarMenuSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.sidebarDrawer=new Drawer(container),this.searchBar=new NavSearchBar,this._attachListeners()}return _createClass(SidebarMenuSection2,[{key:"onUnload",value:function(){this.sidebarDrawer.destroy()}},{key:"onSelect",value:function(){this.sidebarDrawer.open()}},{key:"onDeselect",value:function(){this.sidebarDrawer.close()}},{key:"_attachListeners",value:function(){}}]),SidebarMenuSection2})(),SlideshowSection=(function(){function SlideshowSection2(container){_classCallCheck(this,SlideshowSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.slideshow=new Carousel(this.element.querySelector("[data-flickity-config]"),{onSelect:this._onSlideChanged.bind(this)}),this.selectedSlide=null,this.shouldAnimate=!0,this.timeline=new TimelineLite({delay:window.theme.showPageTransition?.5:0}),this.slideshow.flickityInstance.cells.length>0&&this._transitionToSlide(this.slideshow.flickityInstance.selectedCell.element,!0),this._attachListeners()}return _createClass(SlideshowSection2,[{key:"onUnload",value:function(){this.slideshow.destroy(),this.timeline.kill(),this.delegateElement.off(),document.removeEventListener("breakpoint:changed",this._onBreakpointChangedListener)}},{key:"onBlockSelect",value:function(event){this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.stopPlayer(),this.shouldAnimate=!event.detail.load,this.slideshow.selectCell(event.target.getAttribute("data-sli
18de-index"),!1,!event.detail.load)}},{key:"onBlockDeselect",value:function(){this.shouldAnimate=!0,this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.playPlayer()}},{key:"_attachListeners",value:function(){this._onBreakpointChangedListener=this._onBreakpointChanged.bind(this),this.delegateElement.on("mouseenter",".Button",this._pauseSlideshow.bind(this),!0),this.delegateElement.on("mouseleave",".Button",this._resumeSlideshow.bind(this),!0),document.addEventListener("breakpoint:changed",this._onBreakpointChangedListener)}},{key:"_pauseSlideshow",value:function(){this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.pausePlayer()}},{key:"_resumeSlideshow",value:function(){this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.unpausePlayer()}},{key:"_onSlideChanged",value:function(index,element){this._transitionToSlide(element)}},{key:"_transitionToSlide",value:function(slide){var _this=this;this.timeline.clear(),this.selectedSlide&&(this._slideLeave(this.selectedSlide),this.timeline.addLabel("enter",this.shouldAnimate?"-=0.4":0)),this._lazyLoadNextImage(),this.timeline.fromTo(slide,this.selectedSlide&&this.shouldAnimate?.3:0,{autoAlpha:0},{autoAlpha:1,ease:Cubic.easeInOut},"enter"),this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.player.state==="playing"&&this.slideshow.flickityInstance.pausePlayer(),Dom.nodeListToArray(slide.querySelectorAll(".Slideshow__Image")).forEach(function(image){image.classList.contains("Image--lazyLoading")||image.classList.contains("Image--lazyLoad")?image.addEventListener("lazyloaded",_this._slideEnter.bind(_this,slide)):_this._slideEnter(slide)}),this.selectedSlide=slide}},{key:"_slideLeave",value:function(slide){var content=slide.querySelector(".SectionHeader"),buttonWrapper=slide.querySelector(".SectionHeader__ButtonWrapper");this.timeline.fromTo(slide,this.shouldAnimate?.3:0,{autoAlpha:1},{autoAlpha:0,ease:Cubic.easeInOut,delay:this.shouldAnimate?.35:0}),content&&this.timeline.fromTo(content,this.shouldAnimate?.4:0,{autoAlpha:1,y:0},{autoAlpha:0,y:20,ease:Cubic.easeIn},0),buttonWrapper&&this.timeline.fromTo(buttonWrapper,this.shouldAnimate?.4:0,{autoAlpha:1,y:0},{autoAlpha:0,y:10,ease:Cubic.easeIn},0)}},{key:"_slideEnter",value:function(slide){var images=slide.querySelectorAll(".Slideshow__Image"),content=slide.querySelector(".SectionHeader"),buttonWrapper=slide.querySelector(".SectionHeader__ButtonWrapper");this.slideshow.flickityInstance.options.autoPlay&&this.slideshow.flickityInstance.player.state==="paused"&&this.slideshow.flickityInstance.unpausePlayer(),window.CSS&&window.CSS.supports("(object-fit: cover) or (-o-object-fit: cover)")&&(window.theme.showImageZooming?this.timeline.fromTo(images,this.shouldAnimate?1.2:0,{opacity:0,scale:1.2},{opacity:1,scale:1,ease:Quad.easeOut},"enter"):this.timeline.fromTo(images,this.shouldAnimate?1.2:0,{opacity:0},{opacity:1,ease:Quad.easeOut},"enter")),content&&this.timeline.fromTo(content,this.shouldAnimate?.8:0,{autoAlpha:0,y:30},{autoAlpha:1,y:0,delay:this.shouldAnimate?.8:0,ease:Cubic.easeOut},"enter"),buttonWrapper&&this.timeline.fromTo(buttonWrapper,this.shouldAnimate?.8:0,{autoAlpha:0,y:20},{autoAlpha:1,y:0,delay:this.shouldAnimate?.8:0,ease:Cubic.easeOut},"enter")}},{key:"_lazyLoadNextImage",value:function(){var currentIndex=this.slideshow.flickityInstance.selectedIndex,breakpoint=Responsive.getCurrentBreakpoint();if(this.slideshow.flickityInstance.cells.length-1>currentIndex){var nextCellElement=this.slideshow.flickityInstance.cells[currentIndex+1].element,imageContainers=Dom.nodeListToArray(nextCellElement.querySelectorAll(".Slideshow__ImageContainer")),imageToReveal=null;breakpoint==="phone"?imageToReveal=imageContainers[0]:imageToReveal=imageContainers[1],window.lazySizes&&imageToReveal&&imageToReveal.classList.contains("Image--lazyLoad")&&lazySizes.loader.unveil(imageToReveal.firstElementChild)}}},{key:"_onBreakpointChanged",value:function(event){(event.detail.previousBreakpoint==="phone"&&event.detail.currentBreakpoint!=="phone"||event.detail.previousBreakpoint!=="phone"&&event.detail.currentBreakpoint==="phone")&&(this.selectedSlide=null,this._transitionToSlide(this.slideshow.flickityInstance.selectedElement))}}]),SlideshowSection2})(),CuyanaProductFeaturesSection=(function(){function CuyanaProductFeaturesSection2(container){_classCallCheck(this,CuyanaProductFeaturesSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element);var features=this.element.querySelectorAll(".feature-progress-bar");features&&(this.numberOfFeatures=features.length),this.progressBarTimer=null,this.activeFeatureProgressBar=0,this.previousFeatureProgressBar=0,this.numberOfSecondsBetweenImages=window.theme.productFeaturesSlideDelay,this.touchstartX=0,this.touchstartY=0,this.touchendX=0,this.touchendY=0;var _this=this,paginationTotal=this.element.querySelector("#pagination-total");if(paginationTotal.textContent=this.numberOfFeatures,document.documentElement.style.setProperty("--feature-pb-timer",this.numberOfSecondsBetweenImages+"s"),this.numberOfFeatures<=1){var progressUnits=this.element.querySelectorAll(".progress-unit");
18progressUnits.forEach(function(unit){unit.style.display="none"})}else{this.delegateElement.on("click","#pagination-back",this._paginationBack.bind(this)),this.delegateElement.on("click","#pagination-next",this._paginationNext.bind(this)),this.delegateElement.on("click","#pagination-pause",this._paginationPlayPause.bind(this));const gestureZone=this.element.querySelector("#product-feature-image-wrapper");gestureZone!=null&&(gestureZone.addEventListener("touchstart",function(event){_this.touchstartX=event.changedTouches[0].screenX,_this.touchstartY=event.changedTouches[0].screenY},!1),gestureZone.addEventListener("touchend",function(event){_this.touchendX=event.changedTouches[0].screenX,_this.touchendY=event.changedTouches[0].screenY,_this._handleGesture()},!1));var featureActive=this.element.querySelector("#feature_0");featureActive&&featureActive.classList.add("active");var progressBarActive=this.element.querySelector("#progress_bar_0");progressBarActive&&progressBarActive.classList.add("active"),this.progressBarTimer=setInterval(this._processProgressBar.bind(this),this.numberOfSecondsBetweenImages*1e3)}}return _createClass(CuyanaProductFeaturesSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click"),this.progressBarTimer.destroy()}},{key:"_handleGesture",value:function(){this.touchendX<this.touchstartX&&this._paginationNext(),this.touchendX>this.touchstartX&&this._paginationBack()}},{key:"_paginationBack",value:function(){this.activeFeatureProgressBar!=0&&(clearInterval(this.progressBarTimer),this.previousFeatureProgressBar=this.activeFeatureProgressBar,this.activeFeatureProgressBar=this.activeFeatureProgressBar-1,this._setActiveProgressBar(),this.progressBarTimer=setInterval(this._processProgressBar.bind(this),this.numberOfSecondsBetweenImages*1e3))}},{key:"_paginationPlayPause",value:function(){var buttonWrapper=this.element.querySelector("#pagination-pause"),buttonPause=buttonWrapper.querySelector("#pagination-pause .icon-pause"),buttonPlay=buttonWrapper.querySelector("#pagination-pause .icon-play-button");if(buttonPlay&&buttonPlay.classList.contains("d-none")){clearInterval(this.progressBarTimer),buttonPlay.classList.remove("d-none"),buttonPause.classList.add("d-none"),buttonWrapper.setAttribute("aria-label","Play Slides");var activeIndex=this.activeFeatureProgressBar,barUnfillActive=this.element.querySelector("#bar_unfill_"+activeIndex);barUnfillActive.classList.add("completed")}else buttonPause&&buttonPause.classList.contains("d-none")&&(buttonPause.classList.remove("d-none"),buttonPlay.classList.add("d-none"),buttonWrapper.setAttribute("aria-label","Pause Slides"),this._paginationNext())}},{key:"_paginationNext",value:function(){this.activeFeatureProgressBar!=this.numberOfFeatures-1&&(clearInterval(this.progressBarTimer),this.previousFeatureProgressBar=this.activeFeatureProgressBar,this.activeFeatureProgressBar=this.activeFeatureProgressBar+1,this._setActiveProgressBar(),this.progressBarTimer=setInterval(this._processProgressBar.bind(this),this.numberOfSecondsBetweenImages*1e3))}},{key:"_transitionImage",value:function(){var previousImage=this.element.querySelector("#feature_image_"+this.previousFeatureProgressBar),nextImage=this.element.querySelector("#feature_image_"+this.activeFeatureProgressBar);previousImage&&previousImage.classList.remove("active"),nextImage&&nextImage.classList.add("active")}},{key:"_processProgressBar",value:function(){this.previousFeatureProgressBar=this.activeFeatureProgressBar,this.activeFeatureProgressBar++,this.activeFeatureProgressBar>this.numberOfFeatures-1&&(this.activeFeatureProgressBar=0),this._setActiveProgressBar()}},{key:"_setActiveProgressBar",value:function(){this._transitionImage();var oldIndex=this.previousFeatureProgressBar,activeIndex=this.activeFeatureProgressBar,barUnfillOld=this.element.querySelector("#bar_unfill_"+oldIndex),barUnfillActive=this.element.querySelector("#bar_unfill_"+activeIndex),paginationBack=this.element.querySelector("#pagination-back"),paginationNext=this.element.querySelector("#pagination-next"),paginationCount=this.element.querySelector("#pagination-count"),progressBarOld=this.element.querySelector("#progress_bar_"+oldIndex),progressBarActive=this.element.querySelector("#progress_bar_"+activeIndex),featureOld=this.element.querySelector("#feature_"+oldIndex),featureActive=this.element.querySelector("#feature_"+activeIndex),imagePlaceholders=this.element.querySelectorAll(".feature-image");if(activeIndex!=0&&activeIndex>oldIndex)barUnfillOld.classList.add("completed"),paginationBack.classList.remove("inactive"),activeIndex+1===this.numberOfFeatures&&paginationNext.classList.add("inactive");else if(activeIndex===0){paginationNext.classList.remove("inactive"),paginationBack.classList.add("inactive");for(var i=0;i<this.numberOfFeatures;i++)this.element.querySelector("#bar_unfill_"+i).classList.remove("completed")}else activeIndex<oldIndex&&(barUnfillOld.classList.remove("completed"),barUnfillActive.classList.remove("completed"),paginationNext.classList.remove("inactive"));paginationCount.textContent=activeIndex+1,progressBarOld.classList.remove("active"),featureOld.classList.remove("active"),progressBarActive.classList.add("active"),featureActive.classList.add("active"),imagePlaceholders[1].style.maxHeight=imagePlaceholders[0].offsetHeight+"px"}}]),CuyanaProductFeaturesSection2})(),CuyanaSliderSection=(function(){function CuyanaSliderSection2(container){_classCallCheck(this,CuyanaSliderSection2),this.element=container,this.currentWidth=window.screen.width,this.progressCount=this.element.querySelector(".progress-count"),this.Carousel=this.element.querySelector("[data-flickity-config]"),this.config=JSON.parse(this.Carousel.getAttribute("data-flickity-config")||"[]"),this.config.breakpoints!==void 0&&(this._onBreakpointChangedListener=this._onBreakpointChanged.bind(this),document.addEventListener("breakpoint:changed",this._onBreakpointChangedListener)),this._build(),window.addEventListener("resize",this.onResize.bind(this)),window.addEventListener("load",this.onResize.bind(this));const observer=new MutationObserver(()=>{this.flickityInstance&&(this.flickityInstance.resize(),observer.disconnect())});observer.observe(document.body,{childList:!0,subtree:!0})}return _createClass(CuyanaSliderSection2,[{key:"onUnload",value:function(){this.flickityInstance.destroy()}},{key:"onResize",value:function(event){window.screen.width!==this.currentWidth&&(this.currentWidth=window.screen.width,this.flickityInstance.resize())}},{key:"_onBreakpointChanged",value:function(){this.flickityInstance.destroy(),this._build()}},{key:"_build",value:function(){var _this=this;this.flickityInstance=new Flickity(this.Carousel,this.config),this.flickityInstance.on("staticClick",function(event,pointer,cellElement,cellIndex){if(typeof cellIndex=="number"){if(cellIndex!=_this.flickityInstance.selectedIndex){const link=cellElement.querySelector("a");link&&link.addEventListener("click",preventLink,{once:!0})}_this.flickityInstance.select(cellIndex)}function preventLink(e){e.preventDefault(),e.stopImmediatePropagation()}}),_this.progressCount&&this.flickityInstance.on("select",function(index){_this.selectedIndex=_this.flickityInstance.selectedIndex,_this.progressCount.textContent=_this.selectedIndex+1})}}]),CuyanaSliderSection2})(),TestimonialsSection=(function(){function TestimonialsSection2(container){_classCallCheck(this,TestimonialsSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.navItems=Dom.nodeListToArray(this.element.querySelectorAll(".TestimonialNav__Item")),this.carousel=new Carousel(this.element.querySelector(".TestimonialList"),{onSelect:this._testimonialChanged.bind(this)}),this._attachListeners()}return _createClass(TestimonialsSection2,[{key:"onUnload",value:function(){this.carousel.destroy(),this.delegateElement.off("click")}},{key:"onBlockSelect",value:function(event){this.carousel.selectCell(event.target.getAttribute("data-sli
18de-index"),!0)}},{key:"onBlockDeselect",value:function(){this.carousel.unpausePlayer()}},{key:"_testimonialClicked",value:function(event,target){this.carousel.pausePlayer(),this.carousel.selectCell(parseInt(target.getAttribute("data-index"))),this.carousel.unpausePlayer()}},{key:"_testimonialChanged",value:function(newIndex){this.navItems.forEach(function(item,index){item.classList.remove("is-selected"),newIndex===index&&item.classList.add("is-selected")})}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".TestimonialNav__Item",this._testimonialClicked.bind(this))}}]),TestimonialsSection2})(),TimelineSection=(function(){function TimelineSection2(container){_classCallCheck(this,TimelineSection2),this.element=container,this.delegateElement=new domDelegate.Delegate(this.element),this.items=Dom.nodeListToArray(this.element.querySelectorAll(".Timeline__Item")),this.navItems=Dom.nodeListToArray(this.element.querySelectorAll(".Timeline__NavItem")),this._attachListeners()}return _createClass(TimelineSection2,[{key:"onUnload",value:function(){this.delegateElement.off("click")}},{key:"onBlockSelect",value:function(event){this.navItems[parseInt(event.target.getAttribute("data-index"))].click()}},{key:"_attachListeners",value:function(){this.delegateElement.on("click",".Timeline__NavItem",this._clickOnNavItem.bind(this))}},{key:"_clickOnNavItem",value:function(event,target){var newItem=this.items[parseInt(target.getAttribute("data-index"))];if(!newItem.classList.contains("is-selected")){var isContentLarger=!1,navWrapper=target.parentNode,scrollableOffset=0;fastdom.measure(function(){var scrollableWidth=navWrapper.scrollWidth,visibleWidth=navWrapper.offsetWidth;if(isContentLarger=visibleWidth<scrollableWidth,isContentLarger){var beginBound=target.offsetLeft,endBound=beginBound+target.offsetWidth,closerToLeft=beginBound<=visibleWidth-endBound,itemToUse=null;closerToLeft?itemToUse=target.previousElementSibling||target:itemToUse=target.nextElementSibling||target;var itemBeginBound=itemToUse.offsetLeft-navWrapper.scrollLeft,itemEndBound=itemBeginBound+itemToUse.offsetWidth;itemEndBound>visibleWidth?scrollableOffset=itemEndBound-visibleWidth:itemBeginBound<0&&(scrollableOffset=itemBeginBound)}}),fastdom.mutate(function(){isContentLarger&&navWrapper.scrollBy({behavior:"smooth",left:scrollableOffset}),target.classList.add("is-selected"),Dom.getSiblings(target,".is-selected").forEach(function(item){item.classList.remove("is-selected")}),newItem.classList.add("is-selected"),Dom.getSiblings(newItem,".is-selected").forEach(function(item){item.classList.remove("is-selected")})})}}}]),TimelineSection2})(),PriceRange=(function(_HTMLElement){_inherits(PriceRange2,_HTMLElement);var _super=_createSuper(PriceRange2);function PriceRange2(){return _classCallCheck(this,PriceRange2),_super.apply(this,arguments)}return _createClass(PriceRange2,[{key:"connectedCallback",value:function(){var _this=this;this.rangeLowerBound=this.querySelector(".price-range__range-group input:first-child"),this.rangeHigherBound=this.querySelector(".price-range__range-group input:last-child"),this.textInputLowerBound=this.querySelector(".price-range__input:first-child input"),this.textInputHigherBound=this.querySelector(".price-range__input:last-child input"),this.textInputLowerBound.addEventListener("focus",function(){return _this.textInputLowerBound.select()}),this.textInputHigherBound.addEventListener("focus",function(){return _this.textInputHigherBound.select()}),this.textInputLowerBound.addEventListener("change",function(event){event.target.value=Math.max(Math.min(parseInt(event.target.value),parseInt(_this.textInputHigherBound.value||event.target.max)-1),event.target.min),_this.rangeLowerBound.value=event.target.value,_this.rangeLowerBound.parentElement.style.setProperty("--range-min","".concat(parseInt(_this.rangeLowerBound.value)/parseInt(_this.rangeLowerBound.max)*100,"%"))}),this.textInputHigherBound.addEventListener("change",function(event){event.target.value=Math.min(Math.max(parseInt(event.target.value),parseInt(_this.textInputLowerBound.value||event.target.min)+1),event.target.max),_this.rangeHigherBound.value=event.target.value,_this.rangeHigherBound.parentElement.style.setProperty("--range-max","".concat(parseInt(_this.rangeHigherBound.value)/parseInt(_this.rangeHigherBound.max)*100,"%"))}),this.rangeLowerBound.addEventListener("change",function(event){_this.textInputLowerBound.value=event.target.value,_this.textInputLowerBound.dispatchEvent(new Event("change",{bubbles:!0}))}),this.rangeHigherBound.addEventListener("change",function(event){_this.textInputHigherBound.value=event.target.value,_this.textInputHigherBound.dispatchEvent(new Event("change",{bubbles:!0}))}),this.rangeLowerBound.addEventListener("input",function(event){event.target.value=Math.min(parseInt(event.target.value),parseInt(_this.textInputHigherBound.value||event.target.max)-1),event.target.parentElement.style.setProperty("--range-min","".concat(parseInt(event.target.value)/parseInt(event.target.max)*100,"%")),_this.textInputLowerBound.value=event.target.value}),this.rangeHigherBound.addEventListener("input",function(event){event.target.value=Math.max(parseInt(event.target.value),parseInt(_this.textInputLowerBound.value||event.target.min)+1),event.target.parentElement.style.setProperty("--range-max","".concat(parseInt(event.target.value)/parseInt(event.target.max)*100,"%")),_this.textInputHigherBound.value=event.target.value})}}]),PriceRange2})(_wrapNativeSuper(HTMLElement));window.customElements.define("price-range",PriceRange);var ProductRecommendations=(function(_HTMLElement){_inherits(ProductRecommendations2,_HTMLElement);var _super=_createSuper(ProductRecommendations2);function ProductRecommendations2(){var _this;
18return _classCallCheck(this,ProductRecommendations2),_this=_super.call(this),_this._isLoaded=!1,_this}return _createClass(ProductRecommendations2,[{key:"connectedCallback",value:function(){this._loadRecommendations()}},{key:"_loadRecommendations",value:function(){var _this2=this;if(!this._isLoaded){this._isLoaded=!0;var section=this.closest(".shopify-section"),intent=this.getAttribute("intent")||"related",url="".concat(Shopify.routes.root,"recommendations/products?product_id=").concat(this.getAttribute("product"),"&limit=").concat(this.getAttribute("limit")||4,"&section_id=").concat(this.getAttribute("section-id"),"&intent=").concat(intent);fetch(url).then(function(response){response.text().then(function(text){var tempDiv=new DOMParser().parseFromString(text,"text/html"),productRecommendationsElement=tempDiv.querySelector("product-recommendations");productRecommendationsElement.childElementCount>0?(_this2.replaceChildren.apply(_this2,_toConsumableArray(document.importNode(productRecommendationsElement,!0).childNodes)),checkPrivateSale()):intent==="related"?section.remove():_this2.remove()})})}}}]),ProductRecommendations2})(_wrapNativeSuper(HTMLElement));window.customElements.get("product-recommendations")||window.customElements.define("product-recommendations",ProductRecommendations),(function(){new Collapsible,new Modal,new Responsive,window.theme.pageType!=="password"&&window.theme.pageType!=="gift_card"&&new LoadingBar;var sections=new SectionContainer;sections.register("header",HeaderSection),sections.register("newheader",HeaderSection),sections.register("footer",FooterSection),sections.register("sidebar-menu",SidebarMenuSection),sections.register("cart",CartSection),sections.register("newsletter-popup",NewsletterPopupSection),sections.register("announcement-bar",AnnouncementSection),sections.register("slideshow",SlideshowSection),sections.register("cuyana-slider",CuyanaSliderSection),sections.register("cuyana-product-features",CuyanaProductFeaturesSection),sections.register("collection-list",CollectionListSection),sections.register("article-list",ArticleList),sections.register("featured-product",FeaturedProductSection),sections.register("image-with-text-block",ImageWithTextBlockSection),sections.register("timeline",TimelineSection),sections.register("map",MapSection),sections.register("featured-collections",FeaturedCollectionsSection),sections.register("shop-the-look",ShopTheLookSection),sections.register("testimonials",TestimonialsSection),sections.register("background-video",BackgroundVideoSection),sections.register("product",ProductSection),sections.register("product-quickview",ProductQuickViewSection),sections.register("product-configurator",ProductConfiguratorSection),sections.register("bundlinator",BundlinatorSection),sections.register("cuy-drawer-configurator",CuyDrawerConfiguratorSection),sections.register("cuyana-preconfigured-sets",CuyanaPreconfiguredSetsSection),sections.register("product-recommendations",ProductRecommendationsSection),sections.register("collection",CollectionSection),sections.register("article-list",ArticleList),sections.register("article",ArticleSection),sections.register("faq",FaqSection),sections.register("login",LoginSection),sections.register("addresses",AddressesSection),sections.register("gift-card",GiftCardSection),sections.register("recently-viewed-products",RecentlyViewedProductsSection),sections.register("shop-now",ShopNowSection),window.Shopify.theme&&(window.Shopify.theme.sections=sections);var urlParams=new URL(window.location).searchParams,eacValue=urlParams.get("eac");if(eacValue){var eacData={value:eacValue,expires:Date.now()+864e5};localStorage.setItem("eac",JSON.stringify(eacData))}Flickity.defaults.dragThreshold=7,(function(){var touchingCarousel=!1,touchStartCoords;document.body.addEventListener("touchstart",function(e){if(e.target.closest(".flickity-slider"))touchingCarousel=!0;else{touchingCarousel=!1;return}touchStartCoords={x:e.touches[0].pageX,y:e.touches[0].pageY}}),document.body.addEventListener("touchmove",function(e){if(touchingCarousel&&e.cancelable){var moveVector={x:e.touches[0].pageX-touchStartCoords.x,y:e.touches[0].pageY-touchStartCoords.y};Math.abs(moveVector.x)>Flickity.defaults.dragThreshold&&e.preventDefault()}},{passive:!1})})(),(function(){if(window.Flickity){var originalResizeMethod=window.Flickity.prototype.resize,lastWidth=window.innerWidth;window.Flickity.prototype.resize=function(){window.innerWidth===lastWidth&&this.maxCellHeight>0||(lastWidth=window.innerWidth,originalResizeMethod.apply(this,arguments))}}})(),(function(){Dom.nodeListToArray(document.querySelectorAll(".Rte table")).forEac
18h(function(table){table.outerHTML='<div class="TableWrapper">'+table.outerHTML+"</div>"}),Dom.nodeListToArray(document.querySelectorAll(".Rte iframe")).forEach(function(iframe){(iframe.src.indexOf("youtube")!==-1||iframe.src.indexOf("youtu.be")!==-1||iframe.src.indexOf("vimeo")!==-1)&&(iframe.outerHTML='<div class="VideoWrapper">'+iframe.outerHTML+"</div>",iframe.src=iframe.src)})})(),(function(){var documentDelegate=new domDelegate.Delegate(document.body),announcementBar=document.querySelector(".AnnouncementBar");documentDelegate.on("click",'[href^="#"], [data-href]',function(event,target){var selector=target.hasAttribute("href")?target.getAttribute("href"):target.getAttribute("data-href");if(!(selector==="#"||selector==="#main"||selector==="#collection-products")){var element=document.querySelector(selector),offset=parseInt(target.getAttribute("data-offset")||0);if(announcementBar&&(offset-=announcementBar.clientHeight),target.hasAttribute("data-focus-on-click")){var prevScrollY=window.pageYOffset;element.focus({preventScroll:!0}),window.pageYOffset!==prevScrollY&&window.scrollTo(window.pageXOffset,prevScrollY),element.focus()}window.scrollTo({behavior:"smooth",top:element.offsetTop-offset}),event.preventDefault()}})})(),(function(){var root=document.documentElement,setLayoutWidth=function(){root.style.setProperty("--layout-width",root.clientWidth+"px")};setLayoutWidth(),typeof ResizeObserver=="function"?new ResizeObserver(setLayoutWidth).observe(root):window.addEventListener("resize",setLayoutWidth)})(),(function(){var windowWidth=window.innerWidth,headerSection=document.getElementById("shopify-section-header");window.addEventListener("resize",function(){var newWidth=-1;fastdom.measure(function(){newWidth=window.innerWidth}),fastdom.mutate(function(){newWidth!==windowWidth&&(windowWidth=newWidth,document.documentElement.style.setProperty("--window-height",window.innerHeight+"px"),headerSection&&document.documentElement.style.setProperty("--header-height",headerSection.clientHeight+"px"))})})})(),checkPrivateSale(),(function(){function handleFirstTab(event){event.keyCode===9&&(document.body.classList.add("is-tabbing"),window.removeEventListener("keydown",handleFirstTab))}window.addEventListener("keydown",handleFirstTab)})();function handleMutations(mutationsList,observer2){for(const mutation of mutationsList)if(mutation.addedNodes.length>0){const addedToasts=Array.from(mutation.addedNodes).filter(node=>node.classList&&node.classList.contains("wishlist-whale-toast"));addedToasts.length>0&&(addedToasts.forEach(newToast=>{newToast.classList.add("new-toast"),setTimeout(()=>{newToast.remove()},5e3)}),document.querySelectorAll(".wishlist-whale-toast:not(.new-toast)").forEach(toast=>{toast.classList.add("d-none")}),addedToasts.forEach(newToast=>{newToast.classList.remove("new-toast")}))}}const body=document.body;new MutationObserver(handleMutations).observe(body,{childList:!0}),(function(){const prefersReducedMotion=window.matchMedia("(prefers-reduced-motion: reduce)").matches;if(prefersReducedMotion){document.querySelectorAll("video[autoplay]").forEach(function(video){video.pause()});return}if("IntersectionObserver"in window){let handleVideoError=function(video){var fallback=video.querySelector("img.video-fallback")||video.nextElementSibling;fallback&&fallback.tagName==="IMG"&&(fallback.parentNode===video&&(video.parentNode.insertBefore(fallback,video.nextSibling),fallback.style.position="absolute",fallback.style.top="0",fallback.style.left="0",fallback.style.width="100%",fallback.style.height="100%",fallback.style.objectFit="cover"),fallback.style.display="block"),video.style.visibility="hidden"},addVideoErrorHandler=function(video){video.addEventListener("error",function(){handleVideoError(video)}),video.querySelectorAll("source").forEach(function(source){source.addEventListener("error",function(){var sources=video.querySelectorAll("source"),lastSource=sources[sources.length-1];source===lastSource&&handleVideoError(video)})})},initVideoObserver=function(video){observedVideos.has(video)||(videoObserver.observe(video),addVideoErrorHandler(video),observedVideos.add(video))};const observedVideos=new WeakSet,videoObserver=new IntersectionObserver(function(entries){entries.forEac
18h(function(entry){const video=entry.target;if(entry.isIntersecting){if(video.paused&&(video.hasAttribute("autoplay")||video.hasAttribute("data-autoplay"))){if(video.networkState===3){var mp4Only=!video.querySelector('source[type="application/x-mpegURL"]'),slowNow=document.documentElement.classList.contains("slow-connection");mp4Only&&!slowNow&&!video.querySelector("source[src]")&&video.querySelectorAll("source[data-src]").forEach(function(source){source.src=source.getAttribute("data-src")}),video.querySelector("source[src]")&&video.load()}video.play().catch(function(){})}}else!video.paused&&video.getAttribute("data-pause-offscreen")!=="false"&&video.pause()})},{rootMargin:"50px 0px",threshold:.1});document.querySelectorAll("video.js-video-lazy, video[autoplay]").forEach(function(video){initVideoObserver(video)}),new MutationObserver(function(mutations){mutations.forEach(function(mutation){mutation.addedNodes.forEach(function(node){node.nodeType===1&&(node.tagName==="VIDEO"&&(node.classList.contains("js-video-lazy")||node.hasAttribute("autoplay"))&&initVideoObserver(node),node.querySelectorAll&&node.querySelectorAll("video.js-video-lazy, video[autoplay]").forEach(function(video){initVideoObserver(video)}))})})}).observe(document.body,{childList:!0,subtree:!0})}function enableLoopAfterFirstPlay(video){video.addEventListener("ended",function(){video.loop=!0,video.currentTime=0,video.play().catch(function(){})},{once:!0})}var hlsLoadingState={loading:!1,loaded:!1},hlsInstances=[];window.addEventListener("beforeunload",function(){hlsInstances.forEach(function(hls){hls&&hls.destroy()}),hlsInstances=[]},{once:!0});function initHlsVideo(video,hlsSource){if(hlsLoadingState.loaded){attachHls(video,hlsSource);return}if(video.setAttribute("data-hls-pending",hlsSource),!hlsLoadingState.loading){hlsLoadingState.loading=!0;var script=document.createElement("script");script.src=window.theme.hlsJsUrl,script.onload=function(){hlsLoadingState.loading=!1,hlsLoadingState.loaded=!0,document.querySelectorAll("video[data-hls-pending]").forEach(function(v){var src=v.getAttribute("data-hls-pending");v.removeAttribute("data-hls-pending"),attachHls(v,src)})},script.onerror=function(){hlsLoadingState.loading=!1,console.error("Failed to load hls.js - videos will use fallback sources"),document.querySelectorAll("video[data-hls-pending]").forEach(function(v){v.removeAttribute("data-hls-pending"),startNativeFallback(v)})},document.head.appendChild(script)}}function scheduleLoopQualityUpgrade(video,hls,hlsSource){hls.once(Hls.Events.BUFFER_EOS,function(){if(video._bailed||video._upgradeScheduled||typeof video._minBufferedLevel!="number")return;var conn=navigator.connection||navigator.webkitConnection||navigator.mozConnection,downlinkMbps=conn&&typeof conn.downlink=="number"&&conn.downlink>0?conn.downlink:0,targetIdx=hls.loadLevel;if(downlinkMbps&&hls.levels.forEach(function(level,i){level.bitrate<=downlinkMbps*1e6&&(targetIdx=Math.max(targetIdx,i))}),targetIdx<=video._minBufferedLevel)return;video._upgradeScheduled=!0;var upgraded=video.cloneNode(!0);upgraded.removeAttribute("data-enable-loop-after-first-play"),upgraded.removeAttribute("data-hls-pending"),upgraded.muted=!0,upgraded.loop=!0;var hlsB=new Hls({autoStartLoad:!1,capLevelToPlayerSize:!1});hlsB.loadSource(hlsSource),hlsB.attachMedia(upgraded),hlsB.on(Hls.Events.MANIFEST_PARSED,function(){hlsB.currentLevel=targetIdx,hlsB.startLoad(0)}),hlsB.on(Hls.Events.ERROR,function(event,data){data.fatal&&(hlsB.destroy(),video.removeEventListener("timeupdate",onTimeUpdate))}),hlsInstances.push(hlsB),upgraded._hlsInstance=hlsB;var upgradeReady=!1;hlsB.once(Hls.Events.BUFFER_EOS,function(){upgradeReady=!0});var lastTime=0;function onTimeUpdate(){var t=video.currentTime,wrapped=t<lastTime;if(lastTime=t,video._bailed){video.removeEventListener("timeupdate",onTimeUpdate),hlsB.destroy();return}!wrapped||!upgradeReady||(video.removeEventListener("timeupdate",onTimeUpdate),upgraded.style.position="absolute",upgraded.style.top="0",upgraded.style.left="0",upgraded.style.width="100%",upgraded.style.height="100%",video.parentNode.insertBefore(upgraded,video.nextSibling),upgraded.currentTime=video.currentTime,upgraded.play().then(function(){video.remove(),hl
18s.destroy(),video._hlsInstance=null,upgraded.style.position="",upgraded.style.top="",upgraded.style.left="",upgraded.style.width="",upgraded.style.height=""}).catch(function(){upgraded.remove(),hlsB.destroy()}))}video.addEventListener("timeupdate",onTimeUpdate)})}function startNativeFallback(video){video._bailed||(video.src&&video.src.indexOf("blob:")===0&&video.removeAttribute("src"),video.querySelectorAll("source[data-src]").forEach(function(source){source.src=source.getAttribute("data-src")}),video.load(),video.play().catch(function(){}))}window.addEventListener("pageshow",function(event){event.persisted&&document.querySelectorAll("video.js-video-lazy").forEach(function(video){var pauseBtn=video.parentNode&&video.parentNode.querySelector(".js-video-pause"),userPaused=pauseBtn&&pauseBtn.classList.contains("is-paused");if(video.src&&video.src.indexOf("blob:")===0){var hlsSourceEl=video.querySelector('source[type="application/x-mpegURL"]'),manifestUrl=video.getAttribute("data-hls-manifest")||hlsSourceEl&&(hlsSourceEl.getAttribute("data-src")||hlsSourceEl.getAttribute("src"));video._hlsInstance&&(video._hlsInstance.destroy(),video._hlsInstance=null),video.removeAttribute("src"),video.style.display="",video.style.visibility="";var fallback=video.parentNode.querySelector("img.video-fallback");if(fallback&&(fallback.style.display="none"),userPaused)return;manifestUrl?attachHls(video,manifestUrl):startNativeFallback(video)}else if(!userPaused&&video.paused&&(video.hasAttribute("autoplay")||video.hasAttribute("data-autoplay"))){var rect=video.getBoundingClientRect();rect.bottom>0&&rect.top<window.innerHeight&&(video.networkState===3&&video.querySelector("source[src]")&&video.load(),video.play().catch(function(){}))}})}),document.addEventListener("playing",function(event){var video=event.target;if(!(!video||video.tagName!=="VIDEO")&&(video.style.visibility==="hidden"||video.style.display==="none")){video.style.visibility="",video.style.display="";var fallback=video.parentNode&&video.parentNode.querySelector("img.video-fallback");fallback&&(fallback.style.display="none")}},!0),document.addEventListener("visibilitychange",function(){document.visibilityState==="visible"&&document.querySelectorAll("video.js-video-lazy").forEach(function(video){if(video.paused&&!(video.src&&video.src.indexOf("blob:")===0&&!video._hlsInstance)&&!(!video.hasAttribute("autoplay")&&!video.hasAttribute("data-autoplay"))){var pauseBtn=video.parentNode&&video.parentNode.querySelector(".js-video-pause");if(!(pauseBtn&&pauseBtn.classList.contains("is-paused"))){var rect=video.getBoundingClientRect();rect.bottom>0&&rect.top<window.innerHeight&&(video.networkState===3&&video.querySelector("source[src]")&&video.load(),video.play().catch(function(){}))}}})});function attachHls(video,hlsSource){if(typeof Hls>"u"){console.warn("hls.js not loaded, falling back to native sources"),startNativeFallback(video);return}if(!(video._hlsInstance||video._bailed))if(Hls.isSupported()){var conn=navigator.connection||navigator.webkitConnection||navigator.mozConnection,downlinkMbps=conn&&typeof conn.downlink=="number"&&conn.downlink>0?conn.downlink:0,hlsConfig={autoStartLoad:!1,capLevelToPlayerSize:!0};downlinkMbps&&(hlsConfig.abrEwmaDefaultEstimate=downlinkMbps*1e6);var hls=new Hls(hlsConfig);video.setAttribute("data-hls-manifest",hlsSource),hls.loadSource(hlsSource),hls.attachMedia(video),hls.on(Hls.Events.FRAG_BUFFERED,function(event,data){data.frag.type==="main"&&(video._minBufferedLevel===void 0||data.frag.level<video._minBufferedLevel)&&(video._minBufferedLevel=data.frag.level)}),hls.on(Hls.Events.MANIFEST_PARSED,function(event,data){var bandwidth=downlinkMbps*1e6,startIdx=0;data.levels.forEach(function(level,i){level.bitrate<=bandwidth&&(startIdx=i)}),hls.startLevel=startIdx,hls.startLoad(),video.play().catch(function(err){console.warn("Video autoplay prevented:",err)})}),hls.on(Hls.Events.ERROR,function(event,data){if(data.fatal){console.error("Fatal HLS error:",data.type,data.details),hls.destroy(),video._hlsInstance=null;var hlsSourceEl=video.querySelector('source[type="application/x-mpegURL"]');hlsSourceEl&&hlsSourceEl.remove(),startNativeFallback(video)}}
18),video._hlsInstance=hls,hlsInstances.push(hls),scheduleLoopQualityUpgrade(video,hls,hlsSource)}else startNativeFallback(video)}var isSlowConnection=document.documentElement.classList.contains("slow-connection");function shouldUseNativeHls(video){var isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);return isSafari&&video.canPlayType("application/vnd.apple.mpegurl")!==""}document.querySelectorAll("video.js-video-deferred").forEach(function(video){if(video.offsetParent!==null){var slowPoster=video.getAttribute("data-slow-connection-poster"),connNow=navigator.connection||navigator.webkitConnection||navigator.mozConnection,slowNow=connNow&&typeof connNow.downlink=="number"&&connNow.downlink>0&&connNow.downlink<3,shouldSkipVideo=isSlowConnection||slowNow||prefersReducedMotion;if(shouldSkipVideo){slowPoster&&(video.poster=slowPoster),video.removeAttribute("data-autoplay"),video.removeAttribute("data-enable-loop-after-first-play");var figure=video.closest("figure"),pauseBtn=figure.querySelector(".js-video-pause");pauseBtn&&(pauseBtn.style.display="none"),figure.classList.add("video-ready");return}var deferredHlsSource=video.querySelector('source[type="application/x-mpegURL"]');if((!deferredHlsSource||shouldUseNativeHls(video))&&(video.querySelectorAll("source[data-src]").forEach(function(source){source.src=source.getAttribute("data-src")}),video.hasAttribute("data-autoplay"))){video.autoplay=!0;var activateRect=video.getBoundingClientRect();activateRect.bottom>-100&&activateRect.top<window.innerHeight+100&&video.load()}var figure=video.closest("figure");if(figure){let showSpinner=function(){spinnerTimeout=setTimeout(function(){figure.classList.add("is-buffering")},150)},hideSpinner=function(){clearTimeout(spinnerTimeout),figure.classList.remove("is-buffering")},markVideoReady=function(){hideSpinner(),figure.classList.add("video-ready")},bailToPoster=function(){if(!video._bailed){video._bailed=!0,clearTimeout(longStallTimer),clearInterval(firstFrameTimer),video.removeAttribute("data-hls-pending"),video._hlsInstance&&(video._hlsInstance.destroy(),video._hlsInstance=null),video.pause();var bailPoster=video.getAttribute("data-slow-connection-poster");bailPoster&&(video.poster=bailPoster),video.removeAttribute("autoplay"),video.removeAttribute("data-autoplay"),video.querySelectorAll("source").forEach(function(source){source.remove()}),video.removeAttribute("src"),video.load();var bailPauseBtn=figure.querySelector(".js-video-pause");if(bailPauseBtn&&(bailPauseBtn.style.display="none"),markVideoReady(),typeof posthog<"u"){var bailConn=navigator.connection||navigator.webkitConnection||navigator.mozConnection;posthog.capture("video_banner_bailout",{stall_count:stallCount,connection_type:bailConn?bailConn.effectiveType:"unknown",downlink_mbps:bailConn?bailConn.downlink:null})}}},watchForChronicStalling=function(){video.addEventListener("waiting",function(){stallStartedAt=performance.now(),clearTimeout(longStallTimer),longStallTimer=setTimeout(bailToPoster,3500)}),video.addEventListener("playing",function(){clearTimeout(longStallTimer),stallStartedAt&&performance.now()-stallStartedAt>500&&(stallCount++,stallCount>=2&&bailToPoster()),stallStartedAt=null})},checkAndReveal=function(){hasRevealed||video.currentTime>.1&&!video.paused&&(hasRevealed=!0,clearInterval(firstFrameTimer),markVideoReady(),video.removeEventListener("timeupdate",checkAndReveal),video.addEventListener("waiting",showSpinner),video.querySelector('source[type="application/x-mpegURL"]')&&watchForChronicStalling())};var spinnerTimeout=null,stallCount=0,stallStartedAt=null,longStallTimer=null,hasRevealed=!1,visibleSince=null,firstFrameTimer=setInterval(function(){if(hasRevealed){clearInterval(firstFrameTimer);return}if(document.hidden){visibleSince=null;return}var rect=video.getBoundingClientRect();if(rect.bottom<=0||rect.top>=window.innerHeight){visibleSince=null;return}if(visibleSince===null){visibleSince=performance.now();return}performance.now()-visibleSince>=8e3&&(clearInterval(firstFrameTimer),bailToPoster())},1e3);video.addEventListener("timeupdate",checkAndReveal),video.addEventListener("canplay",hideSpinner),video.addEventListener("loadeddata",hideSpinner),video.addEventListener("error",markVideoReady)}}}),document.querySelectorAll("video[data-enable-loop-after-first-play]").forEach(function(video){if(video.offsetParent!==null){var hlsSourceEl=video.querySelector('source[type="application/x-mpegURL"]'),hlsSourceUrl=hlsSourceEl&&(hlsSourceEl.getAttribute("src")||hlsSourceEl.getAttribute("data-src"));
18hlsSourceUrl&&!shouldUseNativeHls(video)?(initHlsVideo(video,hlsSourceUrl),enableLoopAfterFirstPlay(video)):video.loop=!0}}),document.querySelectorAll(".js-video-pause").forEach(function(btn){var figure=btn.closest("figure");!figure||!figure.querySelector("video")||btn.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var video=figure.querySelector("video");video&&(video.paused?(video.play(),btn.classList.remove("is-paused"),btn.setAttribute("aria-label","Pause video")):(video.pause(),btn.classList.add("is-paused"),btn.setAttribute("aria-label","Play video")))})}),document.querySelectorAll(".js-video-unmute").forEach(function(btn){var figure=btn.closest("figure");!figure||!figure.querySelector("video")||btn.addEventListener("click",function(e){e.preventDefault(),e.stopPropagation();var video=figure.querySelector("video");video&&(video.muted?(document.querySelectorAll(".js-video-unmute.is-unmuted").forEach(function(otherBtn){if(otherBtn!==btn){var otherFig=otherBtn.closest("figure"),otherVideo=otherFig&&otherFig.querySelector("video");otherVideo&&(otherVideo.muted=!0),otherBtn.classList.remove("is-unmuted"),otherBtn.setAttribute("aria-pressed","false"),otherBtn.setAttribute("aria-label","Unmute video")}}),video.muted=!1,video.paused&&video.play().catch(function(){}),btn.classList.add("is-unmuted"),btn.setAttribute("aria-pressed","true"),btn.setAttribute("aria-label","Mute video")):(video.muted=!0,btn.classList.remove("is-unmuted"),btn.setAttribute("aria-pressed","false"),btn.setAttribute("aria-label","Unmute video")))})})})(),window.theme.showPageTransition&&PageTransition.getInstance()})()}));
19//# sourceMappingURL=/cdn/shop/t/10/assets/theme.js.map?v=115642311089602795811790268575

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.