function closeCart(){document.querySelector("a.header__action-item-link.header__cart-toggle")&&document.querySelector("a.header__action-item-link.header__cart-toggle").click(),closePopup()}function openPopup(e){$("#upsellItems").addClass("active"),$(e).show()}function closePopup(){$("#upsellItems").removeClass("active"),$(".upsellItem").hide()}function refreshCart(){$("#mini-cart").load(window.routes.cartUrl+"?view=cartFetch","",(function(){adjustMiniCartHeight()})),$.ajax({url:"/cart.js",type:"GET",dataType:"json",success:function(e){var t=e.item_count;$("span.header__cart-count").html(t)}})}function submitFunction(e){$.ajax({type:"POST",url:"/cart/add.js",data:{quantity:1,id:parseInt($(e).val())},dataType:"json",success:function(e){closePopup(),refreshCart()}})}function adjustMiniCartHeight(){var e=function(){return window.matchMedia("screen and (max-width: 640px)").matches?"phone":window.matchMedia("screen and (min-width: 641px) and (max-width: 1023px)").matches?"tablet":window.matchMedia("screen and (min-width: 1024px) and (max-width: 1279px)").matches?"lap":window.matchMedia("screen and (min-width: 1280px)").matches?"desk":void 0},t=document.querySelector(".mini-cart");if(t)if("phone"===e()){var i=document.querySelector(".drawer__header").getBoundingClientRect().bottom,n=document.querySelector(".mini-cart__recap"),o=document.querySelector(".mini-cart__content");if(n){var s=n.getBoundingClientRect().top-i;o.style.maxHeight=s+"px"}}else t.style.maxHeight="",t.querySelector(".mini-cart__content").style.maxHeight=""}!function(e){"function"==typeof define&&define.amd?define("index",e):e()}((function(){"use strict";function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){for(var i=0;ie.length)&&(t=e.length);for(var i=0,n=new Array(t);i=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,a=!0,r=!1;return{s:function(){i=e[Symbol.iterator]()},n:function(){var e=i.next();return a=e.done,e},e:function(e){r=!0,s=e},f:function(){try{a||null==i.return||i.return()}finally{if(r)throw s}}}}var h={},p=function(){function e(){t(this,e)}return n(e,null,[{key:"slideUp",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"height";e.style[i]="".concat(e.scrollHeight,"px"),e.offsetHeight,e.style[i]=0,h[e.id]&&(e.removeEventListener("transitionend",h[e.id]),delete h[e.id]);e.addEventListener("transitionend",(function i(n){"height"===n.propertyName&&(e.removeEventListener("transitionend",i),(t||function(){})())}))}},{key:"slideDown",value:function(e,t){var i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"height";e.style[i]="".concat(e.scrollHeight,"px");var n=function n(o){if(o.propertyName===i){var s="auto";"max-height"===i&&(s="none"),e.style[i]=s,e.removeEventListener("transitionend",n),delete h[e.id],(t||function(){})()}};e.addEventListener("transitionend",n),h[e.id]=n}}]),e}(),m=function(){function e(){t(this,e)}return n(e,null,[{key:"getSiblings",value:function(e,t){for(var i=arguments.length>2&&void 0!==arguments[2]&&arguments[2],n=[],o=e;o=o.previousElementSibling;)t&&!o.matches(t)||n.push(o);for(i&&n.push(e),o=e;o=o.nextElementSibling;)t&&!o.matches(t)||n.push(o);return n}}]),e}(),f="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function v(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function g(e,t,i){return e(i={path:t,exports:{},require:function(e,t){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==t&&i.path)}},i.exports),i.exports}var y=g((function(e,t){function i(e){this.listenerMap=[{},{}],e&&this.root(e),this.handle=i.prototype.handle.bind(this),this._removedListeners=[]}function n(e,t){return e.toLowerCase()===t.tagName.toLowerCase()}function o(e,t){return this.rootElement===window?t===document||t===document.documentElement||t===window:this.rootElement===t}function s(e,t){return e===t.id}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,i.prototype.root=function(e){var t,i=this.listenerMap;if(this.rootElement){for(t in i[1])i[1].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!0);for(t in i[0])i[0].hasOwnProperty(t)&&this.rootElement.removeEventListener(t,this.handle,!1)}if(!e||!e.addEventListener)return this.rootElement&&delete this.rootElement,this;for(t in this.rootElement=e,i[1])i[1].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!0);for(t in i[0])i[0].hasOwnProperty(t)&&this.rootElement.addEventListener(t,this.handle,!1);return this},i.prototype.captureForType=function(e){return-1!==["blur","error","focus","load","resize","scroll"].indexOf(e)},i.prototype.on=function(e,t,i,a){var r,l,c,d;if(!e)throw new TypeError("Invalid event type: "+e);if("function"==typeof t&&(a=i,i=t,t=null),void 0===a&&(a=this.captureForType(e)),"function"!=typeof i)throw new TypeError("Handler must be a type of Function");return r=this.rootElement,(l=this.listenerMap[a?1:0])[e]||(r&&r.addEventListener(e,this.handle,a),l[e]=[]),t?/^[a-z]+$/i.test(t)?(d=t,c=n):/^#[a-z0-9\-_]+$/i.test(t)?(d=t.slice(1),c=s):(d=t,c=Element.prototype.matches):(d=null,c=o.bind(this)),l[e].push({selector:t,handler:i,matcher:c,matcherParam:d}),this},i.prototype.off=function(e,t,i,n){var o,s,a,r,l;if("function"==typeof t&&(n=i,i=t,t=null),void 0===n)return this.off(e,t,i,!0),this.off(e,t,i,!1),this;if(a=this.listenerMap[n?1:0],!e){for(l in a)a.hasOwnProperty(l)&&this.off(l,t,i);return this}if(!(r=a[e])||!r.length)return this;for(o=r.length-1;o>=0;o--)s=r[o],t&&t!==s.selector||i&&i!==s.handler||(this._removedListeners.push(s),r.splice(o,1));return r.length||(delete a[e],this.rootElement&&this.rootElement.removeEventListener(e,this.handle,n)),this},i.prototype.handle=function(e){var t,i,n,o,s,a=e.type,r=[],l="ftLabsDelegateIgnore";if(!0!==e[l]){switch(3===(s=e.target).nodeType&&(s=s.parentNode),s.correspondingUseElement&&(s=s.correspondingUseElement),n=this.rootElement,e.eventPhase||(e.target!==e.currentTarget?3:2)){case 1:r=this.listenerMap[1][a];break;case 2:this.listenerMap[0]&&this.listenerMap[0][a]&&(r=r.concat(this.listenerMap[0][a])),this.listenerMap[1]&&this.listenerMap[1][a]&&(r=r.concat(this.listenerMap[1][a]));break;case 3:r=this.listenerMap[0][a]}var c,d=[];for(i=r.length;s&&i;){for(t=0;t-1&&s.hasAttribute("disabled")?d=[]:o.matcher.call(s,o.matcherParam,s)&&d.push([e,s,o]);if(s===n)break;if(i=r.length,(s=s.parentElement||s.parentNode)instanceof HTMLDocument)break}for(t=0;t-1)&&!1===this.fire.apply(this,d[t])){d[t][0][l]=!0,d[t][0].preventDefault(),c=!1;break}return c}},i.prototype.fire=function(e,t,i){return i.handler.call(t,e,t)},i.prototype.destroy=function(){this.off(),this.root()};var a=i;t.default=a,e.exports=t.default})),b=v(y),w=function(){function e(){t(this,e),this.domDelegate=new b(document.body),this._attachListeners()}return n(e,[{key:"_attachListeners",value:function(){this.domDelegate.on("click",'[data-action="toggle-collapsible"]:not([disabled])',this._toggleCollapsible.bind(this)),document.addEventListener("collapsible:toggle",this._toggleCollapsible.bind(this))}},{key:"_toggleCollapsible",value:function(e,t){var i=this;!t&&e.detail&&(t=document.querySelector('[aria-controls="'.concat(e.detail.id,'"]')));var n="true"===t.getAttribute("aria-expanded"),o=t.parentNode;n?this._close(o):this._open(o),"false"!==t.getAttribute("data-close-siblings")&&m.getSiblings(o).forEach((function(e){return i._close(e)}))}},{key:"_open",value:function(e){var t=e.querySelector("[aria-controls]");if(t&&"true"!==t.getAttribute("aria-expanded")){var i=e.querySelector("#".concat(t.getAttribute("aria-controls")));t.setAttribute("aria-expanded","true"),i.hasAttribute("aria-hidden")&&i.setAttribute("aria-hidden","false"),p.slideDown(i,(function(){t.hasAttribute("data-collapsible-force-overflow")&&(i.style.overflow="visible");var e=i.querySelector("[autofocus]");e&&e.focus()}))}}},{key:"_close",value:function(e){var t=e.querySelector("[aria-controls]");if(t&&"false"!==t.getAttribute("aria-expanded")){var i=e.querySelector("#".concat(t.getAttribute("aria-controls")));t.hasAttribute("data-collapsible-force-overflow")&&(i.style.overflow="hidden"),i.hasAttribute("aria-hidden")&&i.setAttribute("aria-hidden","true"),t.setAttribute("aria-expanded","false"),p.slideUp(i)}}}]),e}(),_=function(){function e(i,n){t(this,e),this.countrySelect=i,this.provinceSelect=n,this.countrySelect&&this.provinceSelect&&(this._attachListeners(),this._initSelectors())}return n(e,[{key:"destroy",value:function(){this.countrySelect&&this.countrySelect.removeEventListener("change",this._onCountryChangedListener)}},{key:"_initSelectors",value:function(){var e=this.countrySelect.getAttribute("data-default");if(e){for(var t=0;t!==this.countrySelect.options.length;++t)if(this.countrySelect.options[t].text===e){this.countrySelect.selectedIndex=t;break}}else this.countrySelect.selectedIndex=0;var i=new Event("change",{bubbles:!0});this.countrySelect.dispatchEvent(i);var n=this.provinceSelect.getAttribute("data-default");if(n)for(var o=0;o!==this.provinceSelect.options.length;++o)if(this.provinceSelect.options[o].text===n){this.provinceSelect.selectedIndex=o;break}}},{key:"_attachListeners",value:function(){this._onCountryChangedListener=this._onCountryChanged.bind(this),this.countrySelect.addEventListener("change",this._onCountryChangedListener)}},{key:"_onCountryChanged",value:function(){var e=this,t=this.countrySelect.options[this.countrySelect.selectedIndex];if(t){var i=JSON.parse(t.getAttribute("data-provinces")||"[]");this.provinceSelect.innerHTML="",0!==i.length?(i.forEach((function(t){e.provinceSelect.options.add(new Option(t[1],t[0]))})),this.provinceSelect.closest(".form__input-wrapper").style.display="block"):this.provinceSelect.closest(".form__input-wrapper").style.display="none"}}}]),e}(),E=function(){function e(){t(this,e)}return n(e,null,[{key:"matchesBreakpoint",value:function(e){switch(e){case"phone":return window.matchMedia("screen and (max-width: 640px)").matches;case"tablet":return window.matchMedia("screen and (min-width: 641px) and (max-width: 1023px)").matches;case"tablet-and-up":return window.matchMedia("screen and (min-width: 641px)").matches;case"pocket":return window.matchMedia("screen and (max-width: 1023px)").matches;case"lap":return window.matchMedia("screen and (min-width: 1024px) and (max-width: 1279px)").matches;case"lap-and-up":return window.matchMedia("screen and (min-width: 1024px)").matches;case"desk":return window.matchMedia("screen and (min-width: 1280px)").matches;case"widescreen":return window.matchMedia("screen and (min-width: 1440px)").matches;case"supports-hover":return window.matchMedia("(hover: hover) and (pointer: fine)").matches}}},{key:"getCurrentBreakpoint",value:function(){return window.matchMedia("screen and (max-width: 640px)").matches?"phone":window.matchMedia("screen and (min-width: 641px) and (max-width: 1023px)").matches?"tablet":window.matchMedia("screen and (min-width: 1024px) and (max-width: 1279px)").matches?"lap":window.matchMedia("screen and (min-width: 1280px)").matches?"desk":void 0}}]),e}(),k=function(){function e(i,n,o){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.delegateRoot=new b(document.documentElement),this.useInlineNavigation="inline"===n,this.isNavigationVisible=this.useInlineNavigation,this.openTrigger=o,E.matchesBreakpoint("supports-hover")||(this.openTrigger="click"),this.openItems=[],this.dropdownActivationTimeouts={},this.dropdownDeactivationTimeouts={},this.DROPDOWN_TIMEOUT=100,this._attachListeners(),this.useInlineNavigation&&this._setupInlineNavigation()}return n(e,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off()}},{key:"onBlockSelect",value:function(e){var t=this;this.useInlineNavigation||this._openNavigation(),m.getSiblings(e.target.parentNode,".is-dropdown-open").forEach((function(i){t._deactivateDropdown(e,i.querySelector('[data-type="menuitem"][aria-haspopup]'))})),this._activateDropdown(e,e.target.previousElementSibling)}},{key:"onBlockDeselect",value:function(e){this.useInlineNavigation||this._closeNavigation(),this._deactivateDropdown(e,e.target.parentNode)}},{key:"_attachListeners",value:function(){this.delegateElement.on("focusout",this._onFocusOut.bind(this)),this.delegateRoot.on("click",this._onClick.bind(this)),this.delegateElement.on("click",'[data-action="toggle-menu"]',this._toggleNavigation.bind(this)),"hover"===this.openTrigger?(this.delegateElement.on("focusin",'[data-type="menuitem"][aria-haspopup]',this._activateDropdown.bind(this)),this.delegateElement.on("mouseover",'[data-type="menuitem"][aria-haspopup]',this._activateDropdown.bind(this)),this.delegateElement.on("mouseover",'[data-type="menu"][aria-hidden="false"]',this._blockDropdownDeactivation.bind(this)),this.delegateElement.on("focusout",".is-dropdown-open",this._deactivateDropdown.bind(this)),this.delegateElement.on("mouseout",".is-dropdown-open",this._deactivateDropdown.bind(this))):this.delegateElement.on("click",'[data-type="menuitem"][aria-haspopup]',this._toggleDropdown.bind(this))}},{key:"_onFocusOut",value:function(e){null===e.relatedTarget||this.element.contains(e.relatedTarget)||this._closeNavigation()}},{key:"_onClick",value:function(e){this.element.contains(e.target)||this._closeNavigation()}},{key:"_openNavigation",value:function(){this.useInlineNavigation||(this.element.querySelector('[data-action="toggle-menu"]').setAttribute("aria-expanded","true"),this.element.querySelector('[data-type="menu"]').setAttribute("aria-hidden","false"),this.isNavigationVisible=!0)}},{key:"_closeNavigation",value:function(){var e=this;(this.useInlineNavigation||(this.element.querySelector('[data-action="toggle-menu"]').setAttribute("aria-expanded","false"),this.element.querySelector('[data-type="menu"]').setAttribute("aria-hidden","true")),this.isNavigationVisible=!1,"click"===this.openTrigger)&&this.openItems.slice(0).forEach((function(t){e._deactivateDropdown(event,t)}))}},{key:"_toggleNavigation",value:function(e){this.isNavigationVisible?this._closeNavigation():this._openNavigation()}},{key:"_toggleDropdown",value:function(e,t){"false"===t.getAttribute("aria-expanded")&&e.preventDefault(),"true"===t.getAttribute("aria-expanded")?"#"===t.getAttribute("href")&&(e.preventDefault(),this._deactivateDropdown(e,t.closest(".is-dropdown-open"))):this._activateDropdown(e,t)}},{key:"_activateDropdown",value:function(e,t){var i=this;"click"===this.openTrigger&&this.openItems.slice(0).forEach((function(n){n.contains(t)||i._deactivateDropdown(e,n)}));var n=m.getSiblings(t,"[aria-hidden]")[0],o=function(){if(t.setAttribute("aria-expanded","true"),t.parentNode.classList.add("is-dropdown-open"),n.setAttribute("aria-hidden","false"),"hover"===i.openTrigger&&i.dropdownDeactivationTimeouts[n.id]&&(clearTimeout(i.dropdownDeactivationTimeouts[n.id]),delete i.dropdownDeactivationTimeouts[n.id]),i.useInlineNavigation){var e=window.innerWidth,o=!1;n.querySelectorAll(".nav-dropdown").forEach((function(t){t.getBoundingClientRect().right>e&&(o=!0)})),o&&n.classList.add("nav-dropdown--inverse")}t.closest('[data-type="menu"]').classList.add("nav-dropdown--glued"),n.classList.contains("mega-menu")&&i._setupMegaMenu(n),"click"===i.openTrigger&&i.openItems.push(t.parentNode)};if("click"===this.openTrigger)o();else{for(var s in this.dropdownActivationTimeouts)this.dropdownActivationTimeouts.hasOwnProperty(s)&&(clearTimeout(this.dropdownActivationTimeouts[s]),delete this.dropdownActivationTimeouts[s]);o()}}},{key:"_deactivateDropdown",value:function(e,t){var i=this;if("hover"!==this.openTrigger||!t.contains(e.relatedTarget)){var n=t.querySelector("[aria-hidden]"),o=function(){if(t.classList.remove("is-dropdown-open"),t.querySelector('[data-type="menuitem"]').setAttribute("aria-expanded","false"),t.querySelector("[aria-hidden]").setAttribute("aria-hidden","true"),t.closest('[data-type="menu"]').classList.remove("nav-dropdown--glued"),"click"===i.openTrigger){t.querySelectorAll(".is-dropdown-open").forEach((function(t){i._deactivateDropdown(e,t);var n=i.openItems.indexOf(t);n>-1&&i.openItems.splice(n,1)}));var n=i.openItems.indexOf(t);n>-1&&i.openItems.splice(n,1)}};"click"===this.openTrigger?o():this.dropdownDeactivationTimeouts[n.id]=setTimeout((function(){o(),delete i.dropdownDeactivationTimeouts[n.id]}),this.DROPDOWN_TIMEOUT)}}},{key:"_blockDropdownDeactivation",value:function(e,t){if(void 0!==this.dropdownDeactivationTimeouts[t.id])for(var i in clearTimeout(this.dropdownDeactivationTimeouts[t.id]),delete this.dropdownDeactivationTimeouts[t.id],this.dropdownActivationTimeouts)this.dropdownActivationTimeouts.hasOwnProperty(i)&&(clearTimeout(this.dropdownActivationTimeouts[i]),delete this.dropdownActivationTimeouts[i])}},{key:"_setupMegaMenu",value:function(e){if(!this.useInlineNavigation){var t=e.closest(".nav-dropdown").clientWidth;e.style.maxWidth=Math.min(1400-t,parseInt(window.innerWidth-t-80))+"px"}}},{key:"_setupInlineNavigation",value:function(){var e=this;this.element.querySelectorAll(".mega-menu").forEach((function(e){e.closest(".nav-bar__item").classList.add("nav-bar__item--static")})),"MutationObserver"in window&&(this.dropdownMenuObserver=new MutationObserver((function(e){e.forEach((function(e){"false"===e.target.getAttribute("aria-hidden")&&e.target.style.setProperty("--distance-to-top","".concat(e.target.getBoundingClientRect().top,"px"))}))})),this.element.querySelectorAll(".nav-dropdown .nav-dropdown").forEach((function(t){e.dropdownMenuObserver.observe(t,{attributes:!0,attributeFilter:["aria-hidden"]})})))}}]),e}(),S=function(){function e(i){t(this,e),this.element=document.getElementById("mobile-collection-filters"),this.delegateRoot=new b(document.documentElement),this.options=i,this.isOpen=!1,this.element&&this._attachListeners()}return n(e,[{key:"destroy",value:function(){this.delegateRoot.off()}},{key:"_attachListeners",value:function(){this.delegateRoot.on("click",'[aria-controls="mobile-collection-filters"][data-action="open-drawer"]',this.open.bind(this)),this.delegateRoot.on("click",'#mobile-collection-filters [data-action="close-drawer"]',this.close.bind(this)),document.addEventListener("collection-filter:close",this.close.bind(this)),document.addEventListener("click",this._detectOutsideClick.bind(this)),window.addEventListener("resize",this._computeDrawerHeight.bind(this))}},{key:"open",value:function(e){e&&e.stopPropagation(),this._computeDrawerHeight(),this.isOpen=!0,document.querySelector('[aria-controls="mobile-collection-filters"]').setAttribute("aria-expanded","true"),document.getElementById("mobile-collection-filters").setAttribute("aria-hidden","false"),document.body.classList.add("no-mobile-scroll")}},{key:"close",value:function(e){e&&e.stopPropagation(),this.isOpen=!1,document.querySelector('[aria-controls="mobile-collection-filters"]').setAttribute("aria-expanded","false"),document.getElementById("mobile-collection-filters").setAttribute("aria-hidden","true"),document.body.classList.remove("no-mobile-scroll")}},{key:"_computeDrawerHeight",value:function(){document.getElementById("mobile-collection-filters").querySelector(".collection-drawer").style.maxHeight="".concat(window.innerHeight,"px")}},{key:"_detectOutsideClick",value:function(e){this.isOpen&&!e.target.closest(".collection-drawer__inner")&&this.close()}}]),e}(),x=function(){function e(i){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.rootDelegateElement=new b(document.body),this.options=JSON.parse(i.getAttribute("data-popup-settings")),this.hasOpenOnceInCurrentPage=!1;try{"#exit-popup"===window.location.hash&&"captcha"!==window.theme.pageType&&this._openPopup()}catch(e){}this._attachListeners()}return n(e,[{key:"destroy",value:function(){this.delegateElement.off()}},{key:"_attachListeners",value:function(){var e=this;this._onKeyPressedListener=this._onKeyPressed.bind(this),E.matchesBreakpoint("supports-hover")&&(this.delegateElement.on("click",'[data-action="close-popup"]',this._closePopup.bind(this)),document.body.addEventListener("mouseleave",(function(){e.hasOpenOnceInCurrentPage||(!e.options.showOnlyOnce||e.options.showOnlyOnce&&null===localStorage.getItem("themeExitPopup"))&&e._openPopup()})),this._clickOutsideListener=this._checkClickOutside.bind(this))}},{key:"_openPopup",value:function(){window.theme.isNewsletterPopupOpen||(this.element.setAttribute("aria-hidden","false"),localStorage.setItem("themeExitPopup","true"),this.hasOpenOnceInCurrentPage=!0,window.theme.isExitPopupOpen=!0,this.delegateElement.on("click",this._clickOutsideListener),this.rootDelegateElement.on("keyup",this._onKeyPressedListener))}},{key:"_closePopup",value:function(){this.element.setAttribute("aria-hidden","true"),window.theme.isExitPopupOpen=!1,this.delegateElement.off("click",this._clickOutsideListener),this.rootDelegateElement.off("keyup",this._onKeyPressedListener)}},{key:"_checkClickOutside",value:function(e){this.element.contains(e.target)&&this.element!==e.target||this._closePopup()}},{key:"_onKeyPressed",value:function(e){"Escape"===e.key&&this._closePopup()}}]),e}(),C=function(){function e(){t(this,e),this.element=document.querySelector(".loading-bar"),this.element&&(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 n(e,[{key:"_onLoadingStart",value:function(){this.element.classList.add("is-visible"),this.element.style.transform="scaleX(0.4)"}},{key:"_onLoadingEnd",value:function(){this.element.style.transform="scaleX(1)",this.element.classList.add("is-finished")}},{key:"_onTransitionEnd",value:function(e){"transform"===e.propertyName&&this.element.classList.contains("is-finished")&&(this.element.classList.remove("is-visible"),this.element.classList.remove("is-finished"),this.element.style.transform="scaleX(0)")}}]),e}(),L=function(){function e(){t(this,e)}return n(e,null,[{key:"trapFocus",value:function(e,t){this.listeners=this.listeners||{};var i=e.querySelector("[autofocus]")||e;e.setAttribute("tabindex","-1"),i.focus(),this.listeners[t]=function(t){e===t.target||e.contains(t.target)||i.focus()},document.addEventListener("focusin",this.listeners[t])}},{key:"removeTrapFocus",value:function(e,t){e&&e.removeAttribute("tabindex"),document.removeEventListener("focusin",this.listeners[t])}},{key:"clearTrapFocus",value:function(){for(var e in this.listeners)this.listeners.hasOwnProperty(e)&&document.removeEventListener("focusin",this.listeners[e]);this.listeners={}}}]),e}(),A=function(){function e(i,n){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.delegateRoot=new b(document.documentElement),this.options=n,this.element&&(this.miniCartElement=this.element.querySelector(".mini-cart"),this.isMiniCartOpen=!1,"cart"!==window.theme.pageType&&this.miniCartElement&&(this.miniCartToggleElement=this.element.querySelector('[aria-controls="'.concat(this.miniCartElement.id,'"]')),this._checkMiniCartScrollability()),this.itemCount=window.theme.cartCount,this._attachListeners())}return n(e,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off(),window.removeEventListener("resize",this._calculateMiniCartHeightListener)}},{key:"_attachListeners",value:function(){this._calculateMiniCartHeightListener=this._calculateMiniCartHeight.bind(this),"cart"!==window.theme.pageType&&"page"!==window.theme.cartType&&(this.delegateElement.on("click",'[data-action="toggle-mini-cart"]',this._toggleMiniCart.bind(this)),this.delegateElement.on("keyup",this._checkMiniCartClose.bind(this)),this.delegateRoot.on("click",this._onWindowClick.bind(this)),window.addEventListener("resize",this._calculateMiniCartHeightListener)),this.delegateRoot.on("click",'[data-action="decrease-quantity"]',this._updateQuantity.bind(this)),this.delegateRoot.on("click",'[data-action="increase-quantity"]',this._updateQuantity.bind(this)),this.delegateRoot.on("change",".quantity-selector:not(.quantity-selector--product) .quantity-selector__value",this._updateQuantity.bind(this)),this.delegateRoot.on("keyup",".quantity-selector:not(.quantity-selector--product) .quantity-selector__value",this._updateQuantitySize.bind(this)),this.delegateRoot.on("keydown",".quantity-selector__value",this._blockEnterKey.bind(this)),this.delegateRoot.on("product:added",this._onProductAdded.bind(this)),this.delegateRoot.on("cart:refresh",this._onCartRefresh.bind(this))}},{key:"_toggleMiniCart",value:function(e){e&&e.preventDefault(),this.isMiniCartOpen?this._closeMiniCart():this._openMiniCart()}},{key:"_openMiniCart",value:function(){this.miniCartToggleElement.setAttribute("aria-expanded","true"),"phone"===E.getCurrentBreakpoint()&&this.miniCartToggleElement.querySelector(".header__cart-icon").setAttribute("aria-expanded","true"),this.miniCartElement.setAttribute("aria-hidden","false"),this.isMiniCartOpen=!0,this._calculateMiniCartHeight(),L.trapFocus(this.miniCartElement,"mini-cart"),document.body.classList.add("no-mobile-scroll")}},{key:"_closeMiniCart",value:function(){this.miniCartToggleElement.setAttribute("aria-expanded","false"),"phone"===E.getCurrentBreakpoint()&&(this.miniCartToggleElement.querySelector(".header__cart-icon").setAttribute("aria-expanded","false"),this.miniCartElement.style.maxHeight=""),this.miniCartElement.setAttribute("aria-hidden","true"),this.isMiniCartOpen=!1,document.documentElement.style.overflow="",document.body.classList.remove("no-mobile-scroll")}},{key:"_checkMiniCartClose",value:function(e){this.isMiniCartOpen&&"Escape"===e.key&&this._closeMiniCart()}},{key:"_calculateMiniCartHeight",value:function(){if("phone"===E.getCurrentBreakpoint())if(this.isMiniCartOpen){var e=window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom;this.miniCartElement.style.maxHeight="".concat(e,"px");var t=this.miniCartElement.querySelector(".mini-cart__content"),i=this.miniCartElement.querySelector(".mini-cart__recap");i&&(t.style.maxHeight="".concat(e-i.clientHeight,"px"))}else this.miniCartElement.style.maxHeight="",this.miniCartElement.querySelector(".mini-cart__content").style.maxHeight="";else this.miniCartElement.style.maxHeight="",this.miniCartElement.querySelector(".mini-cart__content").style.maxHeight=""}},{key:"_updateQuantity",value:function(e,t){var i=this,n=1;n="INPUT"===t.tagName?parseInt(t.value):parseInt(t.getAttribute("data-quantity")),"page"===window.theme.cartType||"true"===window.theme.cartCompatibility&&"cart"===window.theme.pageType?t.hasAttribute("data-href")?window.location.href=t.getAttribute("data-href"):window.location.href="".concat(window.routes.cartChangeUrl,"?line=").concat(t.getAttribute("data-line"),"&quantity=").concat(n):(document.dispatchEvent(new CustomEvent("theme:loading:start")),fetch("".concat(window.routes.cartChangeUrl,".js"),{body:JSON.stringify({line:t.getAttribute("data-line"),quantity:n}),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((function(e){e.json().then((function(e){i.itemCount=e.item_count,i._rerender(!1).then((function(){document.dispatchEvent(new CustomEvent("theme:loading:end"))}))}))})),e.preventDefault())}},{key:"_updateQuantitySize",value:function(e,t){t.setAttribute("size",Math.max(t.value.length,2))}},{key:"_blockEnterKey",value:function(e){if("Enter"===e.key)return!1}},{key:"_rerender",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],i="";if("cart"!==window.theme.pageType)i="".concat(window.routes.cartUrl,"?section_id=mini-cart");else{var n=document.querySelector('[data-section-type="cart"]');i="".concat(window.routes.cartUrl,"?section_id=").concat(n.getAttribute("data-section-id"))}return fetch(i,{credentials:"same-origin",method:"GET",headers:{"Cache-Control":"no-cache"}}).then((function(i){i.text().then((function(i){var n=document.createElement("div");if(n.innerHTML=i,n.firstElementChild&&n.firstElementChild.hasAttribute("data-item-count")&&(e.itemCount=parseInt(n.firstElementChild.getAttribute("data-item-count"))),e.element.querySelector(".header__cart-count").textContent=e.itemCount,"page"!==window.theme.cartType)if("cart"!==window.theme.pageType){var o=document.createElement("div");o.innerHTML=i;var s=e.miniCartElement.querySelector(".mini-cart__line-item-list"),a=null;s&&(a=s.scrollTop),e.miniCartElement.innerHTML=o.querySelector(".mini-cart").innerHTML;var r=e.miniCartElement.querySelector(".mini-cart__line-item-list");r&&null!==a&&(r.scrollTop=a),e._checkMiniCartScrollability(),e._calculateMiniCartHeight(),e.element.dispatchEvent(new CustomEvent("cart:rerendered"))}else{var l=document.createElement("div");l.innerHTML=i,document.querySelector('[data-section-type="cart"]').innerHTML=l.querySelector('[data-section-type="cart"]').innerHTML,t&&window.scrollTo({top:0,behavior:"smooth"}),e.element.dispatchEvent(new CustomEvent("cart:rerendered",{bubbles:!0}))}}))}))}},{key:"_checkMiniCartScrollability",value:function(){var e=this.miniCartElement.querySelector(".mini-cart__line-item-list");e&&e.scrollHeight>e.clientHeight&&e.classList.add("is-scrollable")}},{key:"_onProductAdded",value:function(e){var t=this;this.itemCount+=e.detail.quantity,this._onCartRefresh().then((function(){"cart"!==window.theme.pageType&&("drawer"!==window.theme.cartType||t.options.useStickyHeader||window.scrollTo({top:0,behavior:"smooth"}),"message"===window.theme.cartType&&e.detail.button&&(e.detail.button.innerHTML=window.languages.productAddedShort,setTimeout((function(){e.detail.button.innerHTML=window.languages.productFormAddToCart}),1500)),"cart"!==window.theme.pageType&&"drawer"===window.theme.cartType&&t._openMiniCart())}))}},{key:"_onCartRefresh",value:function(e){var t=!0;return e&&e.detail&&(t=e.detail.scrollToTop),this._rerender(t).then((function(){document.dispatchEvent(new CustomEvent("theme:loading:end"))}))}},{key:"_onWindowClick",value:function(e){this.miniCartElement&&this.isMiniCartOpen&&!this.element.contains(e.target)&&this._closeMiniCart()}}]),e}(),M=function(){function e(i){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.delegateRoot=new b(document.documentElement),this.mobileMenuElement=this.element.querySelector(".mobile-menu"),this.mobileMenuToggleElement=this.element.querySelector('[aria-controls="'.concat(this.mobileMenuElement.id,'"]')),this.isOpen=!1,this._attachListeners()}return n(e,[{key:"destroy",value:function(){this.delegateElement.off(),this.delegateRoot.off(),window.removeEventListener("resize",this._calculatMaxHeightListener)}},{key:"_attachListeners",value:function(){this._calculatMaxHeightListener=this._calculateMaxHeight.bind(this),this.delegateElement.on("click",'[data-action="toggle-menu"]',this._toggleMenu.bind(this)),this.delegateElement.on("click",'[data-action="open-panel"]',this._openPanel.bind(this)),this.delegateElement.on("click",'[data-action="close-panel"]',this._closePanel.bind(this)),this.delegateRoot.on("click",this._onWindowClick.bind(this)),window.addEventListener("resize",this._calculatMaxHeightListener)}},{key:"_toggleMenu",value:function(){this.isOpen=!this.isOpen,this.mobileMenuToggleElement.setAttribute("aria-expanded",this.isOpen?"true":"false"),this.mobileMenuElement.setAttribute("aria-hidden",this.isOpen?"false":"true"),this.isOpen?(this._calculateMaxHeight(),document.body.classList.add("no-mobile-scroll")):(this.mobileMenuElement.style.maxHeight="",this.element.querySelectorAll(".mobile-menu__panel.is-open").forEach((function(e){e.classList.remove("is-open")})),document.body.classList.remove("no-mobile-scroll"))}},{key:"_openPanel",value:function(e,t){t.setAttribute("aria-expanded","true"),this.element.querySelector("#".concat(t.getAttribute("aria-controls"))).classList.add("is-open")}},{key:"_closePanel",value:function(e,t){var i=t.closest(".mobile-menu__panel.is-open");i.classList.remove("is-open"),this.element.querySelector('[aria-controls="'.concat(i.id,'"]')).setAttribute("aria-expanded","false")}},{key:"_calculateMaxHeight",value:function(){this.isOpen&&(this.mobileMenuElement.style.maxHeight="".concat(window.innerHeight-document.querySelector(".header").getBoundingClientRect().bottom,"px"))}},{key:"_onWindowClick",value:function(e){this.isOpen&&!this.element.contains(e.target)&&this._toggleMenu()}}]),e}(),I=function(){function e(){t(this,e),this.domDelegate=new b(document.body),this.activeModalsQueue=[];var i=document.querySelector('.modal[aria-hidden="false"]');i&&this.activeModalsQueue.push(i),this._attachListeners()}return n(e,[{key:"_attachListeners",value:function(){this._onKeyPressedListener=this._onKeyPressed.bind(this),this.domDelegate.on("click",'[data-action="open-modal"]',this._openModal.bind(this)),this.domDelegate.on("click",'[data-action="close-modal"]',this._closeModal.bind(this)),document.addEventListener("modal:close",this._closeModal.bind(this)),this._clickOutsideListener=this._checkClickOutside.bind(this),this.activeModalsQueue.length>0&&(document.documentElement.classList.add("is-locked"),this.domDelegate.on("click",this._clickOutsideListener))}},{key:"_openModal",value:function(e,t){var i=this,n=document.querySelector("#".concat(t.getAttribute("aria-controls")));if(n){return n.addEventListener("transitionend",(function e(t){"visibility"===t.propertyName&&(n.removeEventListener("transitionend",e),L.trapFocus(n,"modal"+n.id),i.activeModalsQueue.push(n))})),n.setAttribute("aria-hidden","false"),document.documentElement.classList.add("is-locked"),this.domDelegate.on("click",this._clickOutsideListener),this.domDelegate.on("keyup",this._onKeyPressedListener),!1}}},{key:"_closeModal",value:function(){if(this.activeModalsQueue.length>0){var e=this.activeModalsQueue.pop();e.addEventListener("transitionend",(function t(i){"visibility"===i.propertyName&&(e.removeEventListener("transitionend",t),L.removeTrapFocus(e,"modal"+e.id),e.dispatchEvent(new CustomEvent("modal:closed")))})),e.setAttribute("aria-hidden","true"),document.documentElement.classList.remove("is-locked"),this.domDelegate.off("click",this._clickOutsideListener),this.domDelegate.off("keyup",this._onKeyPressedListener)}}},{key:"_checkClickOutside",value:function(e){if(0!==this.activeModalsQueue.length){var t=this.activeModalsQueue[this.activeModalsQueue.length-1];!t||t.contains(e.target)&&t!==e.target||this._closeModal()}}},{key:"_onKeyPressed",value:function(e){"Escape"===e.key&&this._closeModal()}}]),e}(),T=function(){function e(i){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.rootDelegateElement=new b(document.body),this.options=JSON.parse(i.getAttribute("data-popup-settings"));try{"#newsletter-popup"===window.location.hash&&"captcha"!==window.theme.pageType?this._openPopup():(!this.options.showOnlyOnce||this.options.showOnlyOnce&&null===localStorage.getItem("themePopup"))&&setTimeout(this._openPopup.bind(this),1e3*this.options.apparitionDelay)}catch(e){}this._attachListeners()}return n(e,[{key:"destroy",value:function(){this.delegateElement.off()}},{key:"_attachListeners",value:function(){this._onKeyPressedListener=this._onKeyPressed.bind(this),this.delegateElement.on("click",'[data-action="close-popup"]',this._closePopup.bind(this)),this._clickOutsideListener=this._checkClickOutside.bind(this)}},{key:"_openPopup",value:function(){window.theme.isExitPopupOpen||(this.element.setAttribute("aria-hidden","false"),localStorage.setItem("themePopup","true"),window.theme.isNewsletterPopupOpen=!0,this.delegateElement.on("click",this._clickOutsideListener),this.rootDelegateElement.on("keyup",this._onKeyPressedListener))}},{key:"_closePopup",value:function(){this.element.setAttribute("aria-hidden","true"),window.theme.isNewsletterPopupOpen=!1,this.delegateElement.off("click"),this.rootDelegateElement.off("keyup",this._onKeyPressedListener)}},{key:"_checkClickOutside",value:function(e){this.element.contains(e.target)&&this.element!==e.target||this._closePopup()}},{key:"_onKeyPressed",value:function(e){"Escape"===e.key&&this._closePopup()}}]),e}(),P=g((function(t){!function(i){var n=function(){},o=i.requestAnimationFrame||i.webkitRequestAnimationFrame||i.mozRequestAnimationFrame||i.msRequestAnimationFrame||function(e){return setTimeout(e,16)};function s(){var e=this;e.reads=[],e.writes=[],e.raf=o.bind(i)}function a(e){e.scheduled||(e.scheduled=!0,e.raf(r.bind(null,e)))}function r(e){var t,i=e.writes,o=e.reads;try{n("flushing reads",o.length),l(o),n("flushing writes",i.length),l(i)}catch(e){t=e}if(e.scheduled=!1,(o.length||i.length)&&a(e),t){if(n("task errored",t.message),!e.catch)throw t;e.catch(t)}}function l(e){for(var t;t=e.shift();)t()}function c(e,t){var i=e.indexOf(t);return!!~i&&!!e.splice(i,1)}s.prototype={constructor:s,measure:function(e,t){var i=t?e.bind(t):e;return this.reads.push(i),a(this),i},mutate:function(e,t){var i=t?e.bind(t):e;return this.writes.push(i),a(this),i},clear:function(e){return c(this.reads,e)||c(this.writes,e)},extend:function(t){if("object"!=e(t))throw new Error("expected object");var i=Object.create(this);return function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])}(i,t),i.fastdom=this,i.initialize&&i.initialize(),i},catch:null};var d=i.fastdom=i.fastdom||new s;t.exports=d}("undefined"!=typeof window?window:f)})),z=function(){function e(i,n){t(this,e),i&&(this.element=i,this.options=n,this.lastKnownY=window.scrollY,this.currentTop=0,this.initialTopOffset=n.offsetTop||parseInt(window.getComputedStyle(this.element).top),this._attachListeners())}return n(e,[{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 e=this;P.measure((function(){var t=e.element.getBoundingClientRect().top+window.scrollY-e.element.offsetTop+e.initialTopOffset,i=e.element.clientHeight-window.innerHeight+(e.options.offsetBottom||0);window.scrollYe.price?(i.innerHTML+=''.concat(q.formatMoney(e.compare_at_price,window.theme.moneyFormat),""),i.innerHTML+="
",i.innerHTML+=''.concat(q.formatMoney(e.price,window.theme.moneyFormat),""),i.innerHTML+='
-'.concat(Math.round(100-100*e.price/e.compare_at_price),"% OFF
"),i.innerHTML+="
",i.innerHTML+='

ou em até 12x de '.concat(q.formatMoney(e.price/o*n,window.theme.moneyFormat)," 

"),i.innerHTML+='
Economize '.concat(q.formatMoney(e.compare_at_price-e.price,window.theme.moneyFormat),"
"),i.innerHTML+='
'.concat(q.formatMoney(e.price*s/1,window.theme.moneyFormat)," no pix
5% de desconto
Pague com pix e economize ",q.formatMoney(r,window.theme.moneyFormat),"
")):(i.innerHTML+=''.concat(q.formatMoney(e.price,window.theme.moneyFormat),""),i.innerHTML+='

em 12x de '.concat(q.formatMoney(e.price/o*n,window.theme.moneyFormat)," 

"),i.innerHTML+='
'.concat(q.formatMoney(e.price*s/1,window.theme.moneyFormat)," no pix
5% de desconto
Pague com pix e economize ",q.formatMoney(r,window.theme.moneyFormat),"
")),i.style.display=""}else i.style.display="none"}},{},{key:"_updateInventory",value:function(e){if(this.options.showInventoryQuantity&&e){var t=this.element.querySelector(".product-form__inventory"),i=this.variantsInventories[e.id].inventory_management,n=this.variantsInventories[e.id].inventory_policy,o=this.variantsInventories[e.id].inventory_quantity,s=this.variantsInventories[e.id].inventory_message;if(t){t.classList.remove("inventory--high"),t.classList.remove("inventory--low"),e.available&&(null!==i&&"deny"===n&&this.options.lowInventoryThreshold>0&&o<=this.options.lowInventoryThreshold?t.classList.add("inventory--low"):t.classList.add("inventory--high"));var a=this.element.querySelector(".inventory-bar");if(a){var r=Math.min(Math.max(o/parseInt(a.getAttribute("data-stock-countdown-max"))*100,0),100);a.classList.toggle("inventory-bar--hidden",0===r),a.firstElementChild.style.width="".concat(r,"%")}t.innerHTML=s}}}},{key:"_updateSku",value:function(e,t){var i=this.element.querySelector(".product-meta__sku");if(i){var n=i.querySelector(".product-meta__sku-number");if(e&&""!==e.sku){if(t&&t.sku===e.sku)return;n.innerHTML=e.sku,i.style.display=""}else i.style.display="none"}}},{key:"_updateDiscountLabel",value:function(e,t){if(window.theme.showDiscount){var i=this.element.querySelector(".product-meta .product-label--on-sale");if(i=this.element.querySelector(".desconto"))if(e&&e.price".concat(q.formatMoney(e.compare_at_price-e.price,window.theme.moneyFormat),""),i.innerHTML="".concat(window.languages.collectionOnSaleLabel.replace("",n)),i.style.display="inline-block"}else i.style.display="none"}}},{key:"_updateUnitPrice",value:function(e,t){var i=this.element.querySelector(".unit-price-measurement");if(i)if(e&&e.unit_price_measurement){i.parentNode.style.display="block",i.querySelector(".unit-price-measurement__price").innerHTML=q.formatMoney(e.unit_price,window.theme.moneyFormat),i.querySelector(".unit-price-measurement__reference-unit").innerHTML=e.unit_price_measurement.reference_unit;var n=i.querySelector(".unit-price-measurement__reference-value");n.innerHTML=e.unit_price_measurement.reference_value,n.style.display=1===e.unit_price_measurement.reference_value?"none":"inline"}else i.parentNode.style.display="none"}},{key:"_updateSelectors",value:function(e){var t=this,i=function(e,t,i){switch(e.getAttribute("data-selector-type")){case"color":e.querySelector(".color-swatch:nth-child(".concat(t+1,")")).classList.toggle("color-swatch--disabled",!i);break;case"variant":e.querySelector(".variant-swatch:nth-child(".concat(t+1,")")).classList.toggle("variant-swatch--disabled",!i);break;case"block":e.querySelector(".block-swatch:nth-child(".concat(t+1,")")).classList.toggle("block-swatch--disabled",!i)}};this.variantSelectors&&this.variantSelectors[0]&&this.productOptionsWithValues[0].values.forEach((function(e,n){i(t.variantSelectors[0],n,t.productData.variants.some((function(t){return t.option1===e&&t.available}))),t.variantSelectors[1]&&t.productOptionsWithValues[1].values.forEach((function(e,n){i(t.variantSelectors[1],n,t.productData.variants.some((function(i){return i.option2===e&&i.option1===t.option1&&i.available}))),t.variantSelectors[2]&&t.productOptionsWithValues[2].values.forEach((function(e,n){i(t.variantSelectors[2],n,t.productData.variants.some((function(i){return i.option3===e&&i.option1===t.option1&&i.option2===t.option2&&i.available})))}))}))}))}},{key:"_updateAddToCartButton",value:function(e){var t=this.element.querySelector(".product-form__add-button"),i=this.element.querySelector(".product-form__info-list");if(t&&(e?(i.style.display="block",e.available?(t.removeAttribute("disabled"),t.classList.remove("button--disabled"),t.classList.add("button--primary"),t.setAttribute("data-action","add-to-cart"),t.innerHTML=window.languages.productFormAddToCart):(t.setAttribute("disabled","disabled"),t.classList.add("button--disabled"),t.classList.remove("button--primary"),t.removeAttribute("data-action"),t.innerHTML=window.languages.productFormSoldOut)):(t.setAttribute("disabled","disabled"),t.classList.add("button--disabled"),t.classList.remove("button--primary"),t.removeAttribute("data-action"),t.innerHTML=window.languages.productFormUnavailable,i.style.display="none"),this.options.showPaymentButton)){var n=this.element.querySelector(".shopify-payment-button");if(!n)return;e&&e.available?n.style.display="block":n.style.display="none"}}},{key:"_onOptionChanged",value:function(e,t){this["option"+t.getAttribute("data-option-position")]=t.value;var i=t.closest(".product-form__option").querySelector(".product-form__selected-value");i&&(i.innerHTML=t.value);var n=this.currentVariant;if(this.currentVariant=this._getCurrentVariantFromOptions(),this._onVariantChanged(n,this.currentVariant),this.currentVariant){if(this.options.enableHistoryState&&history.replaceState){var o="".concat(window.location.protocol,"//").concat(window.location.host).concat(window.location.pathname,"?variant=").concat(this.currentVariant.id);window.history.replaceState({path:o},"",o)}this.masterSelector.querySelector("[selected]").removeAttribute("selected"),this.masterSelector.querySelector('[value="'.concat(this.currentVariant.id,'"]')).setAttribute("selected","selected")}}},{key:"_getCurrentVariantFromOptions",value:function(){var e=this,t=!1;return this.productData.variants.forEach((function(i){i.option1===e.option1&&i.option2===e.option2&&i.option3===e.option3&&(t=i)})),t||null}},{key:"_addToCart",value:function(e,t){var i=this,n="true"===t.getAttribute("data-buy-now");e.preventDefault(),e.stopPropagation(),t.setAttribute("disabled","disabled"),document.dispatchEvent(new CustomEvent("theme:loading:start"));var o=this.element.querySelector('form[action*="/cart/add"]'),s=new FormData(o),a=[{id:s.get("id"),quantity:s.get("quantity")}];$(".buy-together-list input").each((function(){$(this).prop("checked")&&a.push({id:$(this).attr("data-id"),quantity:1})})),o.querySelectorAll(".campo-personalizacao").forEach((function(e){var t=e.getAttribute("name"),i=e.value;t&&i&&(t=t.replace("properties[","").replace("]",""),a[0].properties={...a[0].properties||{},[t]:i})}));var r={items:a};fetch("".concat(window.routes.cartAddUrl,".js"),{body:JSON.stringify(r),credentials:"same-origin",method:"POST",headers:{"Content-Type":"application/json","X-Requested-With":"XMLHttpRequest"}}).then((function(e){document.dispatchEvent(new CustomEvent("theme:loading:end")),e.ok?(t.removeAttribute("disabled"),i.element.dispatchEvent(new CustomEvent("product:added",{bubbles:!0,detail:{variant:i.currentVariant,quantity:parseInt(o.querySelector('[name="quantity"]').value)}})),i.options.isQuickView&&"drawer"===window.theme.cartType&&document.dispatchEvent(new CustomEvent("modal:close")),"message"===window.theme.cartType&&i._showAlert(window.languages.productAdded,"success",t),n||"page"!==window.theme.cartType||(window.location.href="/cart")):e.json().then((function(e){i._showAlert(e.description,"error",t)}))})).catch((function(e){console.error("Error adding products to cart:",e)}))}},{},{key:"_setupStockCountdown",value:function(){var e=this,t=this.element.querySelector(".inventory-bar");if(t){var i=function(){var i=e.variantsInventories[e.currentVariant.id].inventory_quantity,n=Math.min(Math.max(i/parseInt(t.getAttribute("data-stock-countdown-max"))*100,0),100);t.classList.toggle("inventory-bar--hidden",0===n),t.firstElementChild.style.width="".concat(n,"%")};if(window.IntersectionObserver){var n=new IntersectionObserver((function(e){e.forEach((function(e){e.isIntersecting&&(i(),n.disconnect())}))}));n.observe(t)}else i()}}},{key:"_showAlert",value:function(e,t,i){var n=document.createElement("div");n.className="product-form__status-message",n.innerHTML='

').concat(e,"

"),i.removeAttribute("disabled"),i.parentNode.insertAdjacentElement("afterend",n),p.slideDown(n),setTimeout((function(){p.slideUp(n,(function(){n.remove()}))}),5500)}}]),e}(),F=function(){function e(i){t(this,e),this.element=i,this.delegateElement=new b(this.element),this.delegateRoot=new b(document.documentElement),this._attachListeners();var n=document.createElement("link");n.rel="stylesheet",n.href="https://cdn.shopify.com/shopifycloud/model-viewer-ui/assets/v1.0/model-viewer-ui.css",document.head.appendChild(n),window.Shopify.loadFeatures([{name:"model-viewer-ui",version:"1.0",onLoad:this._setupModelViewerUI.bind(this)},{name:"shopify-xr",version:"1.0"}])}return n(e,[{key:"destroy",value:function(){}},{key:"_attachListeners",value:function(){var e=this;this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_play",(function(){e.element.dispatchEvent(new CustomEvent("model:played",{bubbles:!0}))})),this.element.querySelector("model-viewer").addEventListener("shopify_model_viewer_ui_toggle_pause",(function(){e.element.dispatchEvent(new CustomEvent("model:paused",{bubbles:!0}))}))}},{key:"hasBeenSelected",value:function(e){E.matchesBreakpoint("supports-hover")&&!e&&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)}}]),e}(),N=function(){function e(i,n){switch(t(this,e),this.element=i,this.delegateElement=new b(this.element),this.enableVideoLooping=n,this.player=null,this.element.getAttribute("data-media-type")){case"video":var o=document.createElement("link");o.rel="stylesheet",o.href="https://cdn.shopify.com/shopifycloud/shopify-plyr/v1.0/shopify-plyr.css",document.head.appendChild(o),window.Shopify.loadFeatures([{name:"video-ui",version:"1.0",onLoad:this._setupHtml5Video.bind(this)}]);break;case"external_video":this._setupExternalVideo()}}return n(e,[{key:"destroy",value:function(){this.player&&this.player.destroy()}},{key:"hasBeenSelected",value:function(e){E.matchesBreakpoint("supports-hover")&&!e&&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":"youtube"===this.element.getAttribute("data-media-host")?this.player.playVideo():this.player.player(),this.element.focus()}}},{key:"pause",value:function(){switch(this.element.getAttribute("data-media-type")){case"video":this.player.pause();break;case"external_video":"youtube"===this.element.getAttribute("data-media-host")?this.player.pauseVideo():this.player.pause()}}},{key:"_setupHtml5Video",value:function(){var e=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(){e.element.dispatchEvent(new CustomEvent("video:played",{bubbles:!0}))})),this.player.on("pause",(function(){e.element.dispatchEvent(new CustomEvent("video:paused",{bubbles:!0}))}))}},{key:"_setupExternalVideo",value:function(){"youtube"===this.element.getAttribute("data-media-host")?this._loadYouTubeScript().then(this._setupYouTubePlayer.bind(this)):"vimeo"===this.element.getAttribute("data-media-host")&&this._loadVimeoScript().then(this._setupVimeoPlayer.bind(this))}},{key:"_setupYouTubePlayer",value:function(){var e=this,t=setInterval((function(){void 0!==window.YT&&void 0!==window.YT.Player&&(e.player=new YT.Player(e.element.querySelector("iframe"),{videoId:e.element.getAttribute("data-video-id"),events:{onStateChange:function(t){0===t.data&&e.enableVideoLooping&&t.target.seekTo(0)}}}),clearInterval(t))}),50)}},{key:"_loadYouTubeScript",value:function(){return new Promise((function(e,t){var i=document.createElement("script");document.body.appendChild(i),i.onload=e,i.onerror=t,i.async=!0,i.src="//www.youtube.com/iframe_api"}))}},{key:"_setupVimeoPlayer",value:function(){var e=this,t=setInterval((function(){void 0!==window.Vimeo&&void 0!==window.Vimeo.Player&&(e.player=new Vimeo.Player(e.element.querySelector("iframe")),clearInterval(t))}),50)}},{key:"_loadVimeoScript",value:function(){return new Promise((function(e,t){var i=document.createElement("script");document.body.appendChild(i),i.onload=e,i.onerror=t,i.async=!0,i.src="//player.vimeo.com/api/player.js"}))}}]),e}(),U=g((function(e){!function(t,i){e.exports?e.exports=i():t.EvEmitter=i()}("undefined"!=typeof window?window:f,(function(){function e(){}var t=e.prototype;return t.on=function(e,t){if(e&&t){var i=this._events=this._events||{},n=i[e]=i[e]||[];return-1==n.indexOf(t)&&n.push(t),this}},t.once=function(e,t){if(e&&t){this.on(e,t);var i=this._onceEvents=this._onceEvents||{};return(i[e]=i[e]||{})[t]=!0,this}},t.off=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){var n=i.indexOf(t);return-1!=n&&i.splice(n,1),this}},t.emitEvent=function(e,t){var i=this._events&&this._events[e];if(i&&i.length){i=i.slice(0),t=t||[];for(var n=this._onceEvents&&this._onceEvents[e],o=0;o