1var t=class extends HTMLElement{constructor(){super();const t=this;t.setAttribute("role","progressbar"),t.setAttribute("aria-valuemin","0"),t.setAttribute("aria-valuemax","100"),t.setAttribute("aria-valuenow","0"),t.innerHTML='<div class="progress-bar-fill"></div>'}setPercent(t){const e=Math.max(0,Math.min(100,t));this.style.setProperty("--cart-progress-percent",`${e}%`),this.setAttribute("aria-valuenow",e)}};customElements.define("progress-bar",t);var e=class extends HTMLElement{#t=0;#e=0;#i=0;#s="";#n="";#r=null;#o=null;#a=null;#l=null;static get observedAttributes(){return["threshold","current","message-above","message-below","money-format"]}constructor(){super();const t=this;t.#t=parseFloat(t.getAttribute("threshold"))||0,t.#e=parseFloat(t.getAttribute("current"))||0,t.#s=t.getAttribute("message-above")||"",t.#n=t.getAttribute("message-below")||"",t.#a=t.getAttribute("money-format")}async connectedCallback(){await customElements.whenDefined("progress-bar"),this.#c(),this.#h(),this.#d()}disconnectedCallback(){this.#l&&clearTimeout(this.#l)}attributeChangedCallback(t,e,i){if(e===i)return;const s=this;switch(t){case"threshold":s.#t=parseFloat(i)||0,s.#h();break;case"current":s.#e=parseFloat(i)||0,s.#h();break;case"message-above":s.#s=i||"",s.#u();break;case"message-below":s.#n=i||"",s.#u();break;case"money-format":s.#a=i,s.#u()}}#c(){const t=this;t.#o=t.querySelector("[data-content-cart-progress-message]"),t.#r=t.querySelector("progress-bar"),t.#o||!t.#s&&!t.#n||(t.#o=document.createElement("p"),t.#o.setAttribute("data-content-cart-progress-message",""),t.appendChild(t.#o)),t.#r||(t.#r=document.createElement("progress-bar"),t.appendChild(t.#r))}#h(){const t=this,e=t.#m();t.#i=0===e?100:Math.min(100,t.#e/e*100),t.#r&&t.#r.setPercent(t.#i),t.#p(e)}#d(){const t=this,e=t.closest("cart-panel");e&&e.addEventListener("cart-panel:data-changed",e=>t.#g(e))}#g(t){const e=this,i=t.detail;i&&(e.#l&&clearTimeout(e.#l),e.#l=setTimeout(()=>{e.#l=null;const t=(i.calculated_subtotal??i.total_price??0)/100;e.setCurrentAmount(t)},100))}#p(t){const e=this,i=e.#e>=t,s=Math.max(0,t-e.#e),n=e.#f(s);if(e.#o){let t=i?e.#s:e.#n||e.#s;t?(e.#o.textContent=t.replace(/\[\s*amount\s*\]/g,n),e.#o.style.display="block"):e.#o.style.display="none"}e.setAttribute("complete",i.toString())}#f(t){const e=this.#a;if(!e)return t.toFixed(2).replace(/\.00$/,"");const i=t.toFixed(2),s=Math.round(t).toString(),n=i.replace(".",","),r=s.replace(/\B(?=(\d{3})+(?!\d))/g,",");return e.replace(/\{\{\s*amount_no_decimals_with_comma_separator\s*\}\}/g,r).replace(/\{\{\s*amount_with_comma_separator\s*\}\}/g,n).replace(/\{\{\s*amount_no_decimals\s*\}\}/g,s).replace(/\{\{\s*amount\s*\}\}/g,i)}#m(){const t=parseFloat(window.Shopify?.currency?.rate)||1;return this.#t*t}#u(){this.#p(this.#m())}setPercent(t){const e=this,i=Math.max(0,Math.min(100,t));e.#i=i,e.#r&&e.#r.setPercent(i),e.#e=i/100*e.#m(),e.setAttribute("current",e.#e.toString()),e.#p(e.#m())}setCurrentAmount(t){const e=this;e.#e=parseFloat(t)||0,e.setAttribute("current",e.#e.toString()),e.#h()}setThresholdAmount(t){const e=this;e.#t=parseFloat(t)||0,e.setAttribute("threshold",e.#t.toString()),e.#h()}setMinAmount(t){this.setThresholdAmount(t)}getProgress(){const t=this,e=t.#m();return{currentAmount:t.#e,thresholdAmount:t.#t,convertedThreshold:e,minAmount:t.#t,remainingAmount:Math.max(0,e-t.#e),percent:t.#i,isComplete:t.#e>=e,currencyRate:parseFloat(window.Shopify?.currency?.rate)||1}}setMessages(t=null,e=null){const i=this;null!==t&&(i.#s=t,i.setAttribute("message-above",t)),null!==e&&(i.#n=e,i.setAttribute("message-below",e)),i.#u()}get currentAmount(){return this.#e}get thresholdAmount(){return this.#t}get minAmount(){return this.#t}get percent(){return this.#i}get isComplete(){return this.#e>=this.#m()}};customElements.define("cart-progress-bar",e);var i=class extends HTMLElement{#v=[];#b=new Map;#y=!1;#E={click:null,keydown:null};connectedCallback(){const t=this;t.#y||(t.#y=!0,t.#w(),t.#C(),t.#d())}disconnectedCallback(){const t=this;t.#E.click&&(t.removeEventListener("click",t.#E.click),t.#E.click=null),t.#E.keydown&&(t.removeEventListener("keydown",t.#E.keydown),t.#E.keydown=null)}push(t,e=null){const i=this,s=i.#b.get(t);if(!s)return!1;
1const n=i.currentHandle;if(n===t)return!1;if(!i.#S("push",{fromHandle:n,toHandle:t,cancelable:!0}))return!1;const r=i.#b.get(n);return i.#A(s,"current"),i.#v.push({handle:t,trigger:e}),i.#L(),i.#A(r,"previous"),!0}pop(){const t=this;if(t.#v.length<=1)return!1;const e=t.#v[t.#v.length-1],i=t.#v[t.#v.length-2];t.#S("pop",{fromHandle:e.handle,toHandle:i.handle});const s=t.#b.get(e.handle),n=t.#b.get(i.handle);return t.#A(n,"current"),t.#v.pop(),t.#L(e.trigger),t.#A(s,"next"),!0}reset(){const t=this;if(0===t.#v.length)return;const e=t.#v[0];t.#v=[e];const i=t.#b.get(e.handle);t.#A(i,"current"),t.#L();for(const[s,n]of t.#b)s!==e.handle&&t.#A(n,"next");t.#S("reset",{rootHandle:e.handle})}get currentHandle(){return this.#v[this.#v.length-1]?.handle??null}get currentPanel(){return this.#b.get(this.currentHandle)??null}get depth(){return this.#v.length}#w(){const t=this;t.#b.clear();const e=t.querySelectorAll(":scope > stack-panel");for(const i of e){const e=i.getAttribute("handle");e?t.#b.set(e,i):console.warn("<stack-panel> is missing a `handle` attribute",i)}}#C(){const t=this;if(0===t.#b.size)return;const e=t.getAttribute("initial"),i=e&&t.#b.has(e)?e:t.#b.keys().next().value;t.#v=[{handle:i,trigger:null}];for(const[s,n]of t.#b)t.#A(n,s===i?"current":"next")}#d(){const t=this;t.#E.click=e=>{const i=e.target.closest("[data-action-stack-push]");if(i&&t.contains(i)){const s=i.getAttribute("target");return void(s&&(e.preventDefault(),t.push(s,i)))}const s=e.target.closest("[data-action-stack-pop]");s&&t.contains(s)&&(e.preventDefault(),t.pop())},t.addEventListener("click",t.#E.click),t.#E.keydown=e=>{"Escape"===e.key&&(e.defaultPrevented||t.depth<=1||(e.preventDefault(),e.stopPropagation(),t.pop()))},t.addEventListener("keydown",t.#E.keydown)}#A(t,e){t&&(t.setAttribute("state",e),"current"===e?t.removeAttribute("inert"):t.setAttribute("inert",""))}#L(t=null){t?.isConnected?t.focus({preventScroll:!0}):this.currentPanel?.focus({preventScroll:!0})}#S(t,e={}){const{cancelable:i=!1,...s}=e,n=new CustomEvent(`panel-stack:${t}`,{bubbles:!0,composed:!0,cancelable:i,detail:s});return this.dispatchEvent(n)}},s=class extends HTMLElement{connectedCallback(){this.hasAttribute("role")||this.setAttribute("role","group")}focus(t){const e=this.querySelector("[data-stack-focus]")??this.querySelector('button:not([disabled]), a[href], [tabindex]:not([tabindex="-1"]):not([disabled]), input:not([disabled]), select:not([disabled]), textarea:not([disabled])');e&&e.focus(t)}};customElements.get("panel-stack")||customElements.define("panel-stack",i),customElements.get("stack-panel")||customElements.define("stack-panel",s);var n=t=>{const e="shopify-section-",i=t.closest(`[id^="${e}"]`);return i?[i.id.replace(e,""),i]:[null,null]};function r(t,e){return Array.from(document.querySelectorAll(e)).filter(e=>o(t,e))}function o(t,e){return e.hasAttribute("data-vegax-for")?t.id===e.getAttribute("data-vegax-for"):e.closest(t.tagName)===t}function a(t,e){let i;return(...s)=>{clearTimeout(i),i=setTimeout(()=>t.apply(this,s),e)}}function l(){return window.Shopify&&window.Shopify.routes&&window.Shopify.routes.root||"/"}function c(t){const e=window.liquidAjaxCart?.cart?.currency||"USD",i=window.Shopify?.locale||"en";try{return new Intl.NumberFormat(i,{style:"currency",currency:e}).format(t/100)}catch{return`$${(t/100).toFixed(2)}`}}function h(t){try{const e=JSON.parse(t||"[]");return Array.isArray(e)?e:[]}catch{return[]}}function d(t,e){window.liquidAjaxCart&&t.length&&window.liquidAjaxCart.update({updates:Object.fromEntries(t.map(t=>[t,e]))})}var u=class{#k;#q;#x={promise:null,url:null,running:!1};#T={promise:null,url:null,running:!1};#$=0;#M=!1;constructor({cacheExpirationTime:t,htmlFetcherCache:e,useViewTransition:i}){this.#q=t,this.#k=e,this.#M=i}#D(t){let e;return e={promise:new Promise((i,s)=>{fetch(t).then(t=>{if(!t.ok)throw new Error(`Response error from the "${t.url}" URL`);return t.text()}).then(e=>{this.#k.set(t.toString(),e,Date.now()+this.#q),i(void 0)}).catch(t=>{s(t)}).finally(()=>{e.running=!1})}),url:t.toString(),running:!0},e}async prefetch(t){const e=t.toString();this.#x.running&&this.#x.url===e||this.#T.running&&this.#T.url===e||(this.#T=this.#D(e),await(this.#T.promise?.catch(t=>{if("AbortError"!==t.name)throw t})))}async fetch(t,e,i=[]){const s=t.toString(),n=++this.#$;let r=this.#k.get(s);if(void 0===r){const t=()=>{this.#H(i,!0)};
1this.#M?window.VegaX.startViewTransition(t):t(),this.#T.running&&this.#T?.url===s?(this.#x=this.#T,this.#T={promise:null,url:null,running:!1}):this.#x.running&&this.#x.url===s||(this.#x=this.#D(s)),await(this.#x.promise?.catch(t=>{throw this.#H(i,!1),t})),r=this.#k.get(s)}if(n!==this.#$)throw this.#H(i,!1),new DOMException("Superseded by a newer fetch","AbortError");if(void 0===r)throw new Error(`The "${s}" URL is not available in the cache.`);await new Promise(t=>{const s=()=>{this.#H(i,!1),this.#I(r,e),t(void 0)};this.#M?window.VegaX.startViewTransition(s):s()})}#I(t,e){const i=(new DOMParser).parseFromString(t,"text/html");e.forEach(({target:t,source:e})=>{const s=Array.isArray(t)||t instanceof NodeList?t:[t],n=i.querySelectorAll(e);if(n.length===s.length)for(let i=0;i<s.length;i++){const t=s[i];"function"==typeof t?t(n[i].innerHTML):t.innerHTML=n[i].innerHTML}else console.error("The number of targets and sources doesn't match.",t,e)}),window.VegaX.componentLoader?.loadFromDOM(),window.yotpoWidgetsContainer?.initWidgets?.()}#H(t,e){t.forEach(({element:t,classList:i})=>{t.classList[e?"add":"remove"](...i.split(" "))})}},m=new class{#k=new Map;set(t,e,i){if(this.#k.size>10){const t=Date.now();this.#k.forEach((e,i)=>{e.expire<t&&this.#k.delete(i)})}this.#k.set(t,{expire:i,html:e})}get(t){const e=this.#k.get(t);if(!(e&&Date.now()>e.expire))return e?.html;this.#k.delete(t)}};window.VegaX={startViewTransition:function(){let t=null;return async e=>{if(document.startViewTransition)return t?.skipTransition(),t=document.startViewTransition(e),t.ready.catch(()=>{}),t.finished;e()}}(),componentLoader:null,createHTMLFetcher:function({cacheExpirationTime:t=5e3,useViewTransition:e=!1}={}){return new u({cacheExpirationTime:t,htmlFetcherCache:m,useViewTransition:e})}};var p=class extends HTMLElement{connectedCallback(){this.el=this.querySelector("details"),this.summary=this.querySelector("summary"),this.content=this.summary.nextElementSibling,this.config={animationDuration:this.dataset.animationDuration||300,animationTimingFunction:this.dataset.animationTimingFunction||"ease"},this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.summary.addEventListener("click",t=>this.onClick(t))}onClick(t){t.preventDefault(),this.el.style.overflow="hidden",this.isClosing||!this.el.open?this.open():(this.isExpanding||this.el.open)&&this.shrink()}shrink(){this.isClosing=!0;const t=`${this.el.offsetHeight}px`,e=`${this.summary.offsetHeight}px`;this.animation&&this.animation.cancel(),this.startAnimation(t,e),this.animation.onfinish=()=>this.onAnimationFinish(!1),this.animation.oncancel=()=>this.isClosing=!1}open(){this.el.style.height=`${this.el.offsetHeight}px`,this.el.open=!0,window.requestAnimationFrame(()=>this.expand())}expand(){this.isExpanding=!0;const t=`${this.el.offsetHeight}px`,e=`${this.summary.offsetHeight+this.content.offsetHeight}px`;this.animation&&this.animation.cancel(),this.startAnimation(t,e),this.animation.onfinish=()=>this.onAnimationFinish(!0),this.animation.oncancel=()=>this.isExpanding=!1}onAnimationFinish(t){this.el.open=t,this.animation=null,this.isClosing=!1,this.isExpanding=!1,this.el.style.height=this.el.style.overflow=""}startAnimation(t,e){this.animation=this.el.animate({height:[t,e]},{duration:this.config.animationDuration,easing:this.config.animationTimingFunction})}};customElements.define("accordion-block",p);var g="2023-09-15",f=class extends HTMLElement{connectedCallback(){this.formEl=this.querySelector("form"),this.formEl&&(this.emailEl=this.formEl.querySelector("input[name='email']"),this.submitEl=this.formEl.querySelector("button[type='submit']"),this.handleEmailInput=this.handleEmailInput.bind(this),this.handleSubmit=this.handleSubmit.bind(this),this.emailEl&&(this.emailEl.addEventListener("input",this.handleEmailInput),this.handleEmailInput()),this.formEl.addEventListener("submit",this.handleSubmit))}disconnectedCallback(){this.emailEl?.removeEventListener("input",this.handleEmailInput),this.formEl?.removeEventListener("submit",this.handleSubmit)}handleEmailInput(){this.removeAttribute("success"),this.removeAttribute("error"),this.submitEl&&(this.submitEl.disabled=!this.emailEl.checkValidity())}async handleSubmit(t){if(t.preventDefault(),this.hasAttribute("loading"))return;const e=new FormData(this.formEl),i=e.get("klaviyo_company_id"),s=e.get("variant"),n=e.get("email"),r=e.get("klaviyo_marketing_list_id"),o="1"===e.get("accept_marketing");if(i&&s&&n){this.removeAttribute("success"),this.removeAttribute("error"),this.setAttribute("loading",""),this.submitEl&&(this.submitEl.disabled=!0);try{const t=[this.subscribeBackInStock({companyId:i,variantId:s,email:n})];o&&r&&t.push(this.subscribeToList({companyId:i,listId:r,email:n}).catch(()=>null));const[e]=await Promise.all(t);e&&202===e.status?this.setAttribute("success",""):this.setAttribute("error","")}catch(a){this.setAttribute("error","")}finally{this.removeAttribute("loading"),this.submitEl&&(this.submitEl.disabled=!this.emailEl.checkValidity())}}else this.setAttribute("error","")}subscribeBackInStock({companyId:t,variantId:e,email:i}){return fetch(`https://a.klaviyo.com/client/back-in-stock-subscriptions/?company_id=${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json",revision:g},body:JSON.stringify({data:{type:"back-in-stock-subscription",attributes:{profile:{data:{type:"profile",attributes:{email:i}}},channels:["EMAIL"]},relationships:{variant:{data:{type:"catalog-variant",id:`$shopify:::$default:::${e}`}}}}})})}subscribeToList({companyId:t,listId:e,email:i}){return fetch(`https://a.klaviyo.com/client/subscriptions/?company_id=${encodeURIComponent(t)}`,{method:"POST",headers:{"Content-Type":"application/json",accept:"application/json",revision:g},body:JSON.stringify({data:{type:"subscription",attributes:{custom_source:"Back in stock",profile:{data:{type:"profile",attributes:{email:i,subscriptions:{email:{marketing:{consent:"SUBSCRIBED"}}}}}}},relationships:{list:{data:{type:"list",id:e}}}}})})}};customElements.define("bis-form-klaviyo",f);var v="liquid-ajax-cart",b="data-ajax-cart",y="ajax-cart",E="js-ajax-cart",w=`${v}
1:init`,C=function(t,e,i,s){return new(i||(i=Promise))(function(n,r){function o(t){try{l(s.next(t))}catch(t){r(t)}}function a(t){try{l(s.throw(t))}catch(t){r(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof i?e:new i(function(t){t(e)})).then(o,a)}l((s=s.apply(t,e||[])).next())})},S="add",A="change",L="update",k="clear",q="get",x=`${v}:queue-start`,T=`${v}:queue-start-internal`,$=`${v}:queue-empty-internal`,M=`${v}:queue-end-internal`,D=`${v}:queue-end`,H=`${v}:request-start-internal`,I=`${v}:request-start`,O=`${v}:request-end-internal`,F=`${v}:request-end`,z=[],_=!1;function P(t){var e;(null===(e=t.options)||void 0===e?void 0:e.important)&&0!==z.length?z[0].push(t):1===z.push([t])&&(j(!0),R())}function R(){if(1===z.length&&0===z[0].length){const t=new CustomEvent($);document.dispatchEvent(t)}if(0===z.length)return void j(!1);if(0===z[0].length)return z.shift(),void R();const{requestType:t,body:e,options:i}=z[0][0];!function(t,e,i,s){var n;const{extraRequestOnError:r}=bt,o=G(t);let a;t!==q&&(a=e||{});const l=t===q?"GET":"POST",c=i.info||{},h={requestType:t,endpoint:o,requestBody:a,info:c},d=[],u=[],m=new CustomEvent(H,{detail:{requestState:{requestType:t,endpoint:o,info:c,requestBody:a}}});document.dispatchEvent(m);const p=new CustomEvent(I,{detail:{requestState:{requestType:t,endpoint:o,info:c,requestBody:a}}});if(document.dispatchEvent(p),c.cancel)return h.responseData=null,void B(i,s,h);if(null===(n=null==i?void 0:i.signal)||void 0===n?void 0:n.aborted)return h.responseData=null,h.fetchError="AbortError",void B(i,s,h);if(void 0!==a){let e;if(a instanceof FormData||a instanceof URLSearchParams?a.has("sections")&&(e=a.get("sections").toString()):e=a.sections,"string"==typeof e||e instanceof String||Array.isArray(e)){if(Array.isArray(e)?d.push(...e):d.push(...e.split(",")),S===t&&u.push(...d.slice(0,5)),d.length>5){u.push(...d.slice(5));const t=d.slice(0,5).join(",");a instanceof FormData||a instanceof URLSearchParams?a.set("sections",t):a.sections=t}}else null!=e&&console.error(`Liquid Ajax Cart: "sections" parameter in a Cart Ajax API request must be a string or an array. Now it is ${e}`)}const g={method:l};null!=i&&i.signal&&(g.signal=i.signal),t!==q&&(a instanceof FormData||a instanceof URLSearchParams?(g.body=a,g.headers={"x-requested-with":"XMLHttpRequest"}):(g.body=JSON.stringify(a),g.headers={"Content-Type":"application/json"})),fetch(o,g).then(t=>C(this,void 0,void 0,function*(){const e=yield t.json();return{ok:t.ok,status:t.status,body:e}})).then(t=>C(this,void 0,void 0,function*(){var e;return h.responseData=t,!h.responseData.ok&&r&&u.unshift(...d.slice(0,5)),u.length>0&&(null!==(e=null==i?void 0:i.signal)&&void 0!==e&&e.aborted||(h.extraResponseData=yield N(u,null==i?void 0:i.signal))),h})).catch(t=>{(!t||"AbortError"!==t.name&&20!==t.code)&&(console.error("Liquid Ajax Cart: Error while performing cart Ajax request"),console.error(t)),h.responseData=null,h.fetchError=t}).finally(()=>{B(i,s,h)})}(t,e,i,()=>{z[0].shift(),R()})}function j(t){_=t;const e=new CustomEvent(_?T:M);document.dispatchEvent(e);const i=new CustomEvent(_?x:D);document.dispatchEvent(i)}function B(t,e,i){if("firstCallback"in t)try{t.firstCallback(i)}catch(t){console.error('Liquid Ajax Cart: Error in request "firstCallback" function'),console.error(t)}const s={requestState:i},n=new CustomEvent(O,{detail:s});document.dispatchEvent(n);const r=new CustomEvent(F,{detail:s});if(document.dispatchEvent(r),"lastCallback"in t)try{t.lastCallback(i)}catch(t){console.error('Liquid Ajax Cart: Error in request "lastCallback" function'),console.error(t)}e()}function N(t=[],e){const i={updates:{}};return t.length>0&&(i.sections=t.slice(0,5).join(",")),fetch(G(L),{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i),signal:e}).then(i=>i.json().then(s=>{const n={ok:i.ok,status:i.status,body:s};return t.length<6?n:N(t.slice(5),e).then(t=>{var e;return t.ok&&null!==(e=t.body)&&void 0!==e&&e.sections&&"object"==typeof t.body.sections&&("sections"in n.body||(n.body.sections={}),n.body.sections=Object.assign(Object.assign({},n.body.sections),t.body.sections)),n})}))}function V(t={}){P({requestType:q,body:void 0,options:t})}function U(t={},e={}){P({requestType:S,body:t,options:e})}function X(t={},e={}){P({requestType:A,body:t,options:e})}function Y(t={},e={}){P({requestType:L,body:t,options:e})}function W(t={},e={}){P({requestType:k,body:t,options:e})}function G(t){var e,i,s,n,r,o,a,l,c,h;switch(t){case S:return`${(null===(i=null===(e=window.Shopify)||void 0===e?void 0:e.routes)||void 0===i?void 0:i.root)||"/"}cart/add.js`;case A:return`${(null===(n=null===(s=window.Shopify)||void 0===s?void 0:s.routes)||void 0===n?void 0:n.root)||"/"}cart/change.js`;case q:return`${(null===(o=null===(r=window.Shopify)||void 0===r?void 0:r.routes)||void 0===o?void 0:o.root)||"/"}cart.js`;case k:return`${(null===(l=null===(a=window.Shopify)||void 0===a?void 0:a.routes)||void 0===l?void 0:l.root)||"/"}cart/clear.js`;case L:return`${(null===(h=null===(c=window.Shopify)||void 0===c?void 0:c.routes)||void 0===h?void 0:h.root)||"/"}cart/update.js`;default:return}}function K(){return _}var Z,J=`${b}-initial-state`,Q=null;function tt(){return{cart:Q,previousCart:Z}}var et=`${b}-bind`;function it(){tt().cart&&document.querySelectorAll(`[${et}]`).forEach(t=>{t.textContent=function(t){const{binderFormatters:e}=bt,[i,...s]=t.split("|");let n=st(i,tt().cart);
1return s.forEach(t=>{const i=t.trim();""!==i&&("object"==typeof e&&i in e?n=e[i](n):i in rt?n=rt[i](n):console.warn(`Liquid Ajax Cart: the "${i}" formatter is not found`))}),"string"==typeof n||n instanceof String||"number"==typeof n||n instanceof Number?n.toString():(console.error(`Liquid Ajax Cart: the calculated value for the ${et}="${t}" element must be string or number. But the value is`,n),"")}(t.getAttribute(et))})}function st(t,e){const i=t.split("."),s=i.shift().trim();return""!==s&&s in e&&i.length>0?st(i.join("."),e[s]):e[s]}var nt,rt={money_with_currency:t=>{var e;const i=tt();if("number"!=typeof t&&!(t instanceof Number))return console.error("Liquid Ajax Cart: the 'money_with_currency' formatter is not applied because the value is not a number. The value is ",t),t;const s=t/100;return"Intl"in window&&(null===(e=window.Shopify)||void 0===e?void 0:e.locale)?Intl.NumberFormat(window.Shopify.locale,{style:"currency",currency:i.cart.currency}).format(s):`${s.toFixed(2)} ${i.cart.currency}`}},ot=!1;function at(){const{mutations:t}=bt;Array.isArray(t)||console.error('Liquid Ajax Cart: the "mutations" settings parameter must be an array'),0!==t.length&&(ot=!1,nt=-1,lt())}function lt(){const{mutations:t}=bt;if(++nt>=t.length)return;let e=[];try{const i=t[nt]();i&&(e=(null==i?void 0:i.requests)||[])}catch(t){console.error(`Liquid Ajax Cart: Error in the "mutation" function with index ${nt}`),console.error(t)}Array.isArray(e)?ct(e):lt()}function ct(t){const e=t.shift();if(e){if(e.type&&[S,A,L,k,q].includes(e.type))return void P({requestType:e.type,body:e.body,options:{info:{initiator:"mutation"},important:!0,lastCallback:e=>{ct(t)}}});console.error(`Liquid Ajax Cart: wrong request type in the mutation with index ${nt}`)}t.length>0?ct(t):lt()}var ht,dt,ut,mt,pt,gt,ft,vt,bt={binderFormatters:{},requestErrorText:"There was an error while updating your cart. Please try again.",updateOnWindowFocus:!0,quantityTagAllowZero:!1,quantityTagDebounce:300,mutations:[],extraRequestOnError:!0},yt=`${b}-section`,Et=`${b}-static-element`,wt=`${b}-section-scroll`,Ct="shopify-section-",St=`${y}-product-form`,At="processing",Lt=class extends HTMLElement{connectedCallback(){var t,e;const i=this,s=this.querySelectorAll("form");if(1!==s.length)return void console.error(`Liquid Ajax Cart: "${St}" element must have one "form" element as a child, ${s.length} found`,i);const n=s[0];new URL(n.action).pathname===`${(null===(e=null===(t=window.Shopify)||void 0===t?void 0:t.routes)||void 0===e?void 0:e.root)||"/"}cart/add`?n.addEventListener("submit",t=>{if(!i.hasAttribute(At)){const t=new FormData(n);i.setAttribute(At,""),U(t,{lastCallback:()=>{i.removeAttribute(At)},info:{initiator:i}})}t.preventDefault()}):console.error(`Liquid Ajax Cart: "${St}" element's form "action" attribute value isn't a product form action URL`,n,i)}},kt=`${(null===(dt=null===(ht=window.Shopify)||void 0===ht?void 0:ht.routes)||void 0===dt?void 0:dt.root)||"/"}cart/change`,qt=`${(null===(mt=null===(ut=window.Shopify)||void 0===ut?void 0:ut.routes)||void 0===mt?void 0:mt.root)||"/"}cart/add`,xt=`${(null===(gt=null===(pt=window.Shopify)||void 0===pt?void 0:pt.routes)||void 0===gt?void 0:gt.root)||"/"}cart/clear`,Tt=`${(null===(vt=null===(ft=window.Shopify)||void 0===ft?void 0:ft.routes)||void 0===vt?void 0:vt.root)||"/"}cart/update`,$t=`${b}-request-button`;function Mt(t,e){let i;const s=[kt,qt,xt,Tt];if(!t.hasAttribute($t))return;const n=t.getAttribute($t);if(n){let e;try{if(e=new URL(n,window.location.origin),!s.includes(e.pathname))throw`URL should be one of the following: ${kt}, ${qt}, ${Tt}, ${xt}`;i=e}catch(t){console.error(`Liquid Ajax Cart: ${$t} contains an invalid URL as a parameter.`,t)}}else if(t instanceof HTMLAnchorElement&&t.hasAttribute("href")){const e=new URL(t.href);s.includes(e.pathname)?i=e:t.hasAttribute($t)&&console.error(`Liquid Ajax Cart: a link with the ${$t} contains an invalid href URL.`,`URL should be one of the following: ${kt}, ${qt}, ${Tt}, ${xt}`)}if(void 0===i)return void console.error(`Liquid Ajax Cart: a ${$t} element doesn't have a valid URL`);if(e&&e.preventDefault(),K())return;const r=new FormData;
1switch(i.searchParams.forEach((t,e)=>{r.append(e,t)}),i.pathname){case qt:U(r,{info:{initiator:t}});break;case kt:X(r,{info:{initiator:t}});break;case Tt:Y(r,{info:{initiator:t}});break;case xt:W({},{info:{initiator:t}})}}function Dt(t,e){let i,s;return t.length>3?(i=e.cart.items.find(e=>e.key===t),s="id"):(i=e.cart.items[Number(t)-1],s="line"),void 0===i&&(i=null,console.error(`Liquid Ajax Cart: line item with ${s}="${t}" not found`)),[i,s]}var Ht=`${b}-quantity-input`;function It(t){return!(!t.hasAttribute(Ht)||!(t instanceof HTMLInputElement&&["text","number"].includes(t.type)||t instanceof HTMLSelectElement&&["select-one"].includes(t.type))&&(console.error(`Liquid Ajax Cart: the ${Ht} attribute supports "input" elements of types "text", "number" and non-multiple "select" elements`),1))}function Ot(){document.querySelectorAll(`input[${Ht}], select[${Ht}]`).forEach(t=>{if(!It(t))return;if(K())return void(t.disabled=!0);const e=tt(),[i]=Dt(t.getAttribute(Ht).trim(),e);i?t.value=i.quantity.toString():null===i&&(t.value="0"),t.disabled=!1})}function Ft(t,e){if(!It(t))return;if(e&&e.preventDefault(),K())return;let i=Number(t.value.trim());const s=t.getAttribute(Ht).trim();if(isNaN(i))return void console.error(`Liquid Ajax Cart: input value of a ${Ht} must be an Integer number`);if(i<1&&(i=0),!s)return void console.error(`Liquid Ajax Cart: attribute value of a ${Ht} must be an item key or an item index`);const n=s.length>3?"id":"line",r=new FormData;r.set(n,s),r.set("quantity",i.toString()),X(r,{info:{initiator:t}}),t.blur()}var zt=`${b}-property-input`;function _t(t){const e=t.getAttribute(zt),i=t.getAttribute("name");console.error(`Liquid Ajax Cart: the element [${zt}="${e}"]${i?`[name="${i}"]`:""} has wrong attributes.`)}function Pt(t){return!!t.hasAttribute(zt)&&!!(t instanceof HTMLInputElement&&"hidden"!==t.type||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)}function Rt(t){const e={objectCode:void 0,propertyName:void 0,attributeValue:void 0};if(!t.hasAttribute(zt))return e;let i=t.getAttribute(zt).trim();if(!i){const e=t.getAttribute("name").trim();e&&(i=e)}if(!i)return _t(t),e;if(e.attributeValue=i,"note"===i)return e.objectCode="note",e;let[s,...n]=i.trim().split("[");return!n||1!==n.length||n[0].length<2||n[0].indexOf("]")!==n[0].length-1?(_t(t),e):(e.objectCode=s,e.propertyName=n[0].replace("]",""),e)}function jt(){document.querySelectorAll(`[${zt}]`).forEach(t=>{if(!Pt(t))return;if(K())return void(t.disabled=!0);const{objectCode:e,propertyName:i,attributeValue:s}=Rt(t);if(!e)return;const n=tt();let r,o=!1;if("note"===e)r=n.cart.note;else if("attributes"===e)r=n.cart.attributes[i];else{const[t,a]=Dt(e,n);t&&(r=t.properties[i]),null===t&&(console.error(`Liquid Ajax Cart: line item with ${a}="${e}" was not found when the [${zt}] element with "${s}" value tried to get updated from the State`),o=!0)}t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type)?t.checked=t.value===r:("string"==typeof r||r instanceof String||"number"==typeof r||r instanceof Number||(Array.isArray(r)||r instanceof Object?(r=JSON.stringify(r),console.warn(`Liquid Ajax Cart: the ${zt} with the "${s}" value is bound to the ${i} ${"attributes"===e?"attribute":"property"} that is not string or number: ${r}`)):r=""),t.value=r),o||(t.disabled=!1)})}function Bt(t,e){if(!Pt(t))return;e&&e.preventDefault(),t.blur();const i=tt();if(K())return;const{objectCode:s,propertyName:n,attributeValue:r}=Rt(t);if(!s)return;let o=t.value;if(t instanceof HTMLInputElement&&"checkbox"===t.type&&!t.checked){let t=document.querySelector(`input[type="hidden"][${zt}="${r}"]`);t||"note"!==s&&"attributes"!==s||(t=document.querySelector(`input[type="hidden"][${zt}][name="${r}"]`)),o=t?t.value:""}if("note"===s){const e=new FormData;e.set("note",o),Y(e,{info:{initiator:t}})}else if("attributes"===s){const e=new FormData;e.set(`attributes[${n}]`,o),Y(e,{info:{initiator:t}})}else{const[e,a]=Dt(s,i);if(null===e&&console.error(`Liquid Ajax Cart: line item with ${a}="${s}" was not found when the [${zt}] element with "${r}" value tried to update the cart`),!e)return;const l=Object.assign({},e.properties);l[n]=o;const c=new FormData;let h=c;c.set(a,s),c.set("quantity",e.quantity.toString());for(let t in l){const i=l[t];"string"==typeof i||i instanceof String?c.set(`properties[${t}]`,l[t]):h={[a]:s,quantity:e.quantity,properties:l}}X(h,{info:{initiator:t}})}}var Nt=`${y}-quantity`,Vt=`${b}-quantity-plus`,Ut=`${b}-quantity-minus`;var Xt=`${b}-errors`,Yt=t=>{switch(t.requestType){case S:return(t=>{var e;const i=null===(e=t.info)||void 0===e?void 0:e.initiator;return i instanceof Lt?Array.from(i.querySelectorAll(`[${Xt}="form"]`)):[]})(t);case A:return(t=>{var e;const i=[],s=tt();let n,r;if(t.requestBody instanceof FormData||t.requestBody instanceof URLSearchParams?(t.requestBody.has("line")&&(r=t.requestBody.get("line").toString()),t.requestBody.has("id")&&(n=t.requestBody.get("id").toString())):("line"in t.requestBody&&(r=String(t.requestBody.line)),"id"in t.requestBody&&(n=String(t.requestBody.id))),r){const t=Number(r);
1if(t>0){const i=t-1;n=null===(e=s.cart.items[i])||void 0===e?void 0:e.key}}return n&&(n.indexOf(":")>-1?i.push(...Array.from(document.querySelectorAll(`[${Xt}="${n}"]`))):i.push(...Array.from(document.querySelectorAll(s.cart.items.reduce((t,e)=>(e.key!==n&&e.id!==Number(n)||t.push(`[${Xt}="${e.key}"]`),t),[]).join(","))))),i})(t);default:return[]}},Wt=`${E}-init`,Gt=`${E}-processing`,Kt=`${E}-empty`,Zt=`${E}-not-empty`;function Jt(){const t=document.querySelector("html"),e=tt();t.classList.toggle(Wt,null!==e.cart),t.classList.toggle(Gt,K()),t.classList.toggle(Kt,0===e.cart.item_count),t.classList.toggle(Zt,e.cart.item_count>0)}var Qt=!1;if(!("liquidAjaxCart"in window)){function Ts(t,e){Object.defineProperty(window.liquidAjaxCart,t,{get:e,set:()=>{throw new Error(`Liquid Ajax Cart: the "${t}" is a read-only property`)},enumerable:!0})}window.liquidAjaxCart={conf:function(t,e){t in bt?(bt[t]=e,window.liquidAjaxCart.init&&("binderFormatters"===t&&it(),"mutations"===t&&at())):console.error(`Liquid Ajax Cart: unknown configuration parameter "${t}"`)}},Ts("init",()=>Qt),document.addEventListener(H,t=>{const{requestState:e}=t.detail;if(void 0!==e.requestBody){const t=[];if(document.querySelectorAll(`[${yt}]`).forEach(e=>{const i=e.closest(`[id^="${Ct}"]`);if(i){const e=i.id.replace(Ct,"");-1===t.indexOf(e)&&t.push(e)}else console.error(`Liquid Ajax Cart: there is a ${yt} element that is not inside a Shopify section. All the ${yt} elements must be inside Shopify sections.`)}),t.length){let i,s=t.join(",");e.requestBody instanceof FormData||e.requestBody instanceof URLSearchParams?e.requestBody.has("sections")&&(i=e.requestBody.get("sections").toString()):i=e.requestBody.sections,(("string"==typeof i||i instanceof String)&&""!==i||i&&Array.isArray(i)&&i.length>0)&&(s=`${i.toString()},${s}`),e.requestBody instanceof FormData||e.requestBody instanceof URLSearchParams?e.requestBody.set("sections",s):e.requestBody.sections=s}}}),document.addEventListener(O,t=>{var e,i,s,n;t.detail.sections=[];const{requestState:r}=t.detail,o=new DOMParser,a=[];if(r.responseData.body.sections||(null===(i=null===(e=r.extraResponseData)||void 0===e?void 0:e.body)||void 0===i?void 0:i.sections)){let t=r.responseData.body.sections;null!==(n=null===(s=r.extraResponseData)||void 0===s?void 0:s.body)&&void 0!==n&&n.sections&&(t=Object.assign(Object.assign({},t),r.extraResponseData.body.sections));for(let e in t)t[e]?document.querySelectorAll(`#shopify-section-${e}`).forEach(i=>{let s=[];const n="__noId__",l={};i.querySelectorAll(` [${wt}] `).forEach(t=>{let e=t.getAttribute(wt).toString().trim();""===e&&(e=n),e in l||(l[e]=[]),l[e].push({scroll:t.scrollTop,height:t.scrollHeight})});const c={},h=i.querySelectorAll(`[${Et}]`);h&&h.forEach(t=>{let e=t.getAttribute(Et).toString().trim();""===e&&(e=n),e in c||(c[e]=[]),c[e].push(t)});const d=i.querySelectorAll(`[${yt}]`);if(d){const r=o.parseFromString(t[e],"text/html");r.querySelectorAll('img[loading="lazy"]').forEach(t=>{t.removeAttribute("loading")});for(let t in c)r.querySelectorAll(` [${Et}="${t.replace(n,"")}"] `).forEach((e,i)=>{i+1<=c[t].length&&(e.before(c[t][i]),e.parentElement.removeChild(e))});const a=r.querySelectorAll(`[${yt}]`);if(d.length!==a.length){console.error(`Liquid Ajax Cart: the received HTML for the "${e}" section has a different quantity of the "${yt}" containers. The section will be updated completely.`);const t=r.querySelector(`#${Ct}${e}`);if(t){for(i.innerHTML="";t.childNodes.length;)i.appendChild(t.firstChild);s.push(i)}}else d.forEach((t,e)=>{t.before(a[e]),t.parentElement.removeChild(t),s.push(a[e])})}for(let t in l)i.querySelectorAll(` [${wt}="${t.replace(n,"")}"] `).forEach((e,i)=>{i+1<=l[t].length&&(r.requestType!==S||l[t][i].height>=e.scrollHeight)&&(e.scrollTop=l[t][i].scroll)});s.length>0&&a.push({id:e,elements:s})}):console.error(`Liquid Ajax Cart: the HTML for the "${e}" section was requested but the response is ${t[e]}`)}a.length>0&&(t.detail.sections=a)}),document.addEventListener(H,t=>{const{requestState:e}=t.detail;Yt(e).forEach(t=>{t.textContent=""})}),document.addEventListener(O,t=>{const{requestState:e}=t.detail;if(e.info.cancel)return;const i=Yt(e);if(0===i.length)return;const s=function(t){var e,i,s,n,r,o,a;const{requestErrorText:l}=bt;if(null===(e=t.responseData)||void 0===e?void 0:e.ok)return"";const c=(null===(s=null===(i=t.responseData)||void 0===i?void 0:i.body)||void 0===s?void 0:s.errors)||(null===(r=null===(n=t.responseData)||void 0===n?void 0:n.body)||void 0===r?void 0:r.description)||(null===(a=null===(o=t.responseData)||void 0===o?void 0:o.body)||void 0===a?void 0:a.message);return c?"string"==typeof c?c:"object"==typeof c?Object.values(c).map(t=>t.join(", ")).join("; "):l:l}(e);
1s&&i.forEach(t=>{t.textContent=s})}),document.addEventListener(w,at),document.addEventListener($,()=>{ot&&at()}),document.addEventListener(H,t=>{const{requestState:e}=t.detail;"mutation"!==e.info.initiator&&(ot=!0)}),function(){document.addEventListener(O,t=>{var e,i;const{requestState:s}=t.detail;let n;(null===(e=s.extraResponseData)||void 0===e?void 0:e.ok)&&s.extraResponseData.body.token?n=s.extraResponseData.body:null!==(i=s.responseData)&&void 0!==i&&i.ok&&s.responseData.body.token&&(n=s.responseData.body),n&&(Z=Q,Q=n,t.detail.previousCart=Z,t.detail.cart=Q)});const t=document.querySelector(`[${J}]`);if(t)try{Q=JSON.parse(t.textContent)}catch(t){console.error(`Liquid Ajax Cart: can't parse cart JSON from the "${J}" script`),console.error(t)}return new Promise((t,e)=>{var i,s;Q?t():fetch(`${(null===(s=null===(i=window.Shopify)||void 0===i?void 0:i.routes)||void 0===s?void 0:s.root)||"/"}cart.js`,{headers:{"Content-Type":"application/json"}}).then(t=>t.json()).then(e=>{Q=e,t()}).catch(t=>{console.error(t),e('Can\'t load the cart state from the "/cart.js" endpoint')})})}().then(()=>{document.addEventListener(O,it),it(),customElements.define(St,Lt),document.addEventListener("click",function(t){for(let e=t.target;e&&e!=document.documentElement;e=e.parentElement)Mt(e,t)},!1),document.addEventListener("change",function(t){Bt(t.target,t)},!1),document.addEventListener("keydown",function(t){const e=t.target;"Enter"===t.key&&(e instanceof HTMLTextAreaElement&&!t.ctrlKey||Bt(e,t)),"Escape"===t.key&&function(t){if(!Pt(t))return;if(!(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement))return;if(t instanceof HTMLInputElement&&("checkbox"===t.type||"radio"===t.type))return;const e=tt(),{objectCode:i,propertyName:s}=Rt(t);if(!i)return;let n;if("note"===i)n=e.cart.note;else if("attributes"===i)n=e.cart.attributes[s];else{const[t]=Dt(i,e);t&&(n=t.properties[s])}void 0!==n&&(n||"string"==typeof n||n instanceof String||(n=""),t.value=String(n)),t.blur()}(e)},!1),document.addEventListener(T,jt),document.addEventListener(O,jt),document.addEventListener(M,jt),jt(),document.addEventListener("change",function(t){Ft(t.target,t)},!1),document.addEventListener("keydown",function(t){"Enter"===t.key&&Ft(t.target,t),"Escape"===t.key&&function(t){if(!It(t))return;const e=t.getAttribute(Ht).trim();let i;const s=tt();if(e.length>3)i=s.cart.items.find(t=>t.key===e);else{const t=Number(e)-1;i=s.cart.items[t]}i&&(t.value=i.quantity.toString()),t.blur()}(t.target)},!1),document.addEventListener(T,Ot),document.addEventListener(O,Ot),document.addEventListener(M,Ot),Ot(),customElements.define(Nt,class extends HTMLElement{constructor(){super(...arguments),this._timer=void 0}connectedCallback(){const t=this.querySelectorAll("input");1===t.length?(this._$input=t[0],this._$input.hasAttribute(Ht)?(this._$buttons=Array.from(this.querySelectorAll(`[${Ut}], [${Vt}]`)),this._$input.addEventListener("change",this._updateDOM.bind(this)),document.addEventListener(T,this._updateDOM.bind(this)),document.addEventListener(O,this._updateDOM.bind(this)),document.addEventListener(M,this._updateDOM.bind(this)),this._updateDOM(),this._$buttons.forEach(t=>{t.addEventListener("click",e=>{const{quantityTagAllowZero:i}=bt,s=!0===i?0:1;if(!K()){const e=Number(this._$input.value);if(isNaN(e))return void console.error(`Liquid Ajax Cart: "${Nt}" element's input value isn't a number`,this._$input,this);let i=e,n=Number(this._$input.getAttribute("step")||1);(!Number.isSafeInteger(n)||n<=0)&&(n=1),i=t.hasAttribute(Vt)?i+n:i-n,i<s&&(i=s),i!==e&&(this._$input.value=i.toString(),this._runAwaiting(),this._updateDOM())}e.preventDefault()}),t.addEventListener("focusout",e=>{e.relatedTarget&&t.contains(e.relatedTarget)||void 0!==this._timer&&this._runRequest()})})):console.error(`Liquid Ajax Cart: "${Nt}" element's input must have the "${Ht}" attribute`,this._$input,this)):console.error(`Liquid Ajax Cart: "${Nt}" element must have one "input" element as a child, ${t.length} found`,this)}_runAwaiting(){const{quantityTagDebounce:t}=bt;void 0!==this._timer&&clearTimeout(this._timer),t>0?this._timer=setTimeout(()=>{this._runRequest()},Number(t)):this._runRequest()}_runRequest(){void 0!==this._timer&&clearTimeout(this._timer),this._timer=void 0,K()||this._$input.dispatchEvent(new Event("change",{bubbles:!0}))}_updateDOM(){this._$buttons.forEach(t=>{const e=K()||t.hasAttribute(Ut)&&!bt.quantityTagAllowZero&&"1"===this._$input.value;e?t.setAttribute("aria-disabled","true"):t.removeAttribute("aria-disabled"),t instanceof HTMLButtonElement&&t.toggleAttribute("disabled",e)})}}),document.addEventListener(T,Jt),document.addEventListener(O,Jt),document.addEventListener(M,Jt),Jt(),window.liquidAjaxCart.get=V,window.liquidAjaxCart.add=U,window.liquidAjaxCart.change=X,window.liquidAjaxCart.update=Y,window.liquidAjaxCart.clear=W,Ts("cart",()=>tt().cart),Ts("processing",K),window.addEventListener("focus",()=>{bt.updateOnWindowFocus&&Y({},{})}),window.addEventListener("pageshow",t=>{(t.persisted||"back_forward"===performance.getEntriesByType("navigation")[0].type)&&window.liquidAjaxCart.update({},{})}),Qt=!0;const t=new CustomEvent(w);document.dispatchEvent(t)})}function te(){return(window.liquidAjaxCart.cart?.discount_codes||[]).filter(t=>t.applicable).map(t=>t.code)}function ee(t){const e=document.querySelector("[data-discount-code-form] input");e&&(e.disabled=t),document.querySelectorAll("[data-action-remove-discount]").forEach(e
1=>{e.disabled=t})}function ie(t){const e=document.querySelector("[data-discount-code-form] input");if(!e)return;const i=e.closest("[data-ajax-cart-static-element]").querySelector("[data-discount-code-error]");t?(i.textContent=t,i.classList.remove("hidden"),e.setAttribute("aria-invalid","true")):(i.textContent="",i.classList.add("hidden"),e.removeAttribute("aria-invalid"))}window.liquidAjaxCart.conf("updateOnWindowFocus",!1),window.liquidAjaxCart.conf("quantityTagAllowZero",!0),document.addEventListener("input",t=>{const e=t.target.closest("[data-discount-code-form] input");e&&(e.value.trim()||ie(""))}),document.addEventListener("submit",t=>{const e=t.target.closest("[data-discount-code-form]");if(!e)return;t.preventDefault();const i=e.querySelector("input"),s=i.value.trim();if(!s)return;const n=te();if(n.some(t=>t.toLowerCase()===s.toLowerCase()))return i.value="",void ie("");ie(""),i.dataset.submittedCode=s,i.dataset.preservedCodes=n.join("|"),ee(!0);const r=[...n,s].join(",");window.liquidAjaxCart.update({discount:r})}),document.addEventListener("liquid-ajax-cart:request-end",()=>{const t=document.querySelector("[data-discount-code-form] input");if(!t)return;const e=t.dataset.submittedCode;if(!e)return void ee(!1);const i=(t.dataset.preservedCodes||"").split("|").filter(Boolean);delete t.dataset.submittedCode,delete t.dataset.preservedCodes;const s=new Set(te().map(t=>t.toLowerCase()));if(s.has(e.toLowerCase()))return t.value="",ie(""),void ee(!1);ie("Unavailable code"),i.filter(t=>!s.has(t.toLowerCase())).length>0?window.liquidAjaxCart.update({discount:i.join(",")}):ee(!1)}),document.addEventListener("click",t=>{const e=t.target.closest("[data-action-remove-discount]");if(!e)return;const i=e.dataset.discountCode||"",s=te().filter(t=>t.toLowerCase()!==i.toLowerCase());ee(!0),window.liquidAjaxCart.update({discount:s.join(",")})});var se=document.getElementById("cart-dialog"),ne=document.getElementById("cart-progress");ne&&0===parseFloat(ne.getAttribute("current"))&&(ne.hidden=!0),document.addEventListener("liquid-ajax-cart:request-end",t=>{const{requestState:e}=t.detail;"add"===e.requestType&&e.responseData?.ok&&se.showModal();const i=window.liquidAjaxCart?.cart;i&&ne&&(ne.hidden=0===i.item_count,ne.setCurrentAmount(i.total_price/100))}),document.addEventListener("liquid-ajax-cart:request-end",t=>{const{requestState:e}=t.detail;if("add"!==e.requestType||!e.responseData?.ok)return;const i=document.getElementById("cart-upsell-carousel-fetcher");if(!i)return;const s=window.liquidAjaxCart?.cart?.items?.[0]?.product_id;if(!s)return;if(String(s)===i.dataset.loadedPid)return;const n=new URL(i.getAttribute("href"),window.location.origin);n.searchParams.set("product_id",s);const r=n.pathname+n.search;i.dataset.loadedPid=String(s),i.setAttribute("href",r),i.renderURL(r)}),document.addEventListener("product-fetcher:state-change",t=>{const e=t.target;if(!(e instanceof HTMLElement))return;const i=e.querySelector("[data-upsell-price]");if(!i)return;const s=i.querySelector("[data-upsell-price-fresh]"),n=i.querySelector("[data-upsell-price-variant]");if(!s||!n)return;const r=Boolean(t.detail?.picksComplete);s.hidden=r,n.hidden=!r});var re=class{constructor(t,e=4){this.key=`compare:${t||"default"}`,this.max=e,this._listeners=new Set}list(){try{const t=JSON.parse(sessionStorage.getItem(this.key)||"[]");return Array.isArray(t)?t:[]}catch{return[]}}has(t){return this.list().some(e=>e.handle===t)}size(){return this.list().length}add(t){if(!t||!t.handle)return!1;const e=this.list();return!e.some(e=>e.handle===t.handle)&&(!(e.length>=this.max)&&(e.push(t),this._save(e),!0))}remove(t){const e=this.list(),i=e.filter(e=>e.handle!==t);i.length!==e.length&&this._save(i)}clear(){this._save([])}replace(t){this._save(Array.isArray(t)?t.slice(0,this.max):[])}subscribe(t){return this._listeners.add(t),()=>this._listeners.delete(t)}_save(t){try{sessionStorage.setItem(this.key,JSON.stringify(t))}catch(b){return void console.error("[compare-store] save failed",b)}this._listeners.forEach(e=>e(t))}},oe=new Map,ae=new Map;async function le(t){const e=await fetch(function(t){const e=new URL(`${l()}products/${t}`,window.location.origin);return e.searchParams.set("section_id","comparison-table-column"),e}(t));if(!e.ok)throw new Error(`comparison column ${t}: ${e.status}`);return e.text()}function ce(t){if(!t||oe.has(t)||ae.has(t))return;const e=le(t).then(e=>{oe.set(t,e)}).catch(()=>{}).finally(()=>{ae.delete(t)});ae.set(t,e)}var he="compare-active",de=class extends HTMLElement{#O=null;#F=4;#z=null;#_=null;#P=null;connectedCallback(){this.#F=parseInt(this.dataset.compareMax,10)||4,this.#O=new re(this.dataset.collectionHandle,this.#F),this.$toggle=this.querySelector("[data-compare-toggle]"),this.$drawer=this.querySelector("[data-compare-drawer]"),this.$slots=this.querySelector("[data-compare-slots]"),this.$compareNow=this.querySelector("[data-compare-now]"),this.$chevron=this.querySelector("[data-compare-chevron]"),this.$itemTemplate=this.querySelector("[data-compare-item-template]"),this.$emptyTemplate=this.querySelector("[data-compare-empty-template]"),this.$toggle.addEventListener("click",this.#R),this.addEventListener("click",this.#j),document.addEventListener("change",this.#B),document.addEventListener("compare:changed",this.#N
1),this.#z=this.#O.subscribe(()=>{this.#c(),this.#V()}),this.#c(),this.#U(),this.#V(),this.#X(),this.#Y(),this.#W()}disconnectedCallback(){this.$toggle?.removeEventListener("click",this.#R),this.removeEventListener("click",this.#j),document.removeEventListener("change",this.#B),document.removeEventListener("compare:changed",this.#N),this.#z?.(),this.#_?.disconnect(),this.#P?.disconnect(),document.body.classList.remove(he)}#R=()=>{const t=this.toggleAttribute("data-open");document.body.classList.toggle(he,t),this.$toggle.setAttribute("aria-expanded",t?"true":"false"),this.$chevron?.classList.toggle("rotate-180",t),this.$drawer&&(this.$drawer.inert=!t)};#W(){if(!this.$drawer)return;this.$drawer.inert=!this.hasAttribute("data-open");const t=()=>{this.style.setProperty("--compare-h",`${this.$drawer.offsetHeight}px`)};t(),this.#P=new ResizeObserver(t),this.#P.observe(this.$drawer)}#B=t=>{const e=t.target;if(!(e instanceof HTMLInputElement))return;if(!e.matches("[data-compare-checkbox]"))return;const i=e.closest("product-fetcher")?.publicData;i?e.checked?this.#O.add(i)?ce(i.handle):e.checked=!1:this.#O.remove(i.handle):e.checked=!1};#N=t=>{t.detail?.collectionHandle&&t.detail.collectionHandle!==this.dataset.collectionHandle||(this.#c(),this.#U(),this.#V())};#j=t=>{const e=t.target.closest("[data-compare-item-remove]");if(!e)return t.target.closest("[data-compare-clear]")?(this.#O.clear(),void this.#U()):void(t.target.closest("[data-compare-now]")&&this.#O.size()>=2&&this.dispatchEvent(new CustomEvent("compare:open",{bubbles:!0,detail:{items:this.#O.list()}})));this.#G(e.dataset.handle)};#G(t){if(!t)return;this.#O.remove(t);const e=this.#K(t);e&&(e.checked=!1)}#Z(){return Array.from(document.querySelectorAll("[data-compare-checkbox]:not([data-compare-excluded])"))}#K(t){return this.#Z().find(e=>e.closest("product-fetcher")?.publicData?.handle===t)}#U(){this.#Z().forEach(t=>{const e=t.closest("product-fetcher")?.publicData?.handle;t.checked=!!e&&this.#O.has(e)})}#V(){const t=this.#O.list(),e=t.length>=this.#F,i=t[0]?.type??null;this.#Z().forEach(t=>{if(t.checked)return void(t.disabled=!1);const s=t.closest("product-fetcher")?.publicData?.type??null;t.disabled=e||null!==i&&s!==i})}#c(){const t=this.#O.list();this.querySelectorAll("[data-compare-count]").forEach(e=>{e.textContent=String(t.length)}),this.$compareNow&&(this.$compareNow.disabled=t.length<2),this.$slots.replaceChildren(),t.forEach(t=>this.$slots.appendChild(this.#J(t)));for(let e=t.length;e<this.#F;e+=1)this.$slots.appendChild(this.$emptyTemplate.content.firstElementChild.cloneNode(!0))}#J(t){const e=this.$itemTemplate.content.firstElementChild.cloneNode(!0),i=e.querySelector("[data-compare-item-image]");i.src=t.image||"",i.alt=t.title||"",e.querySelector("[data-compare-item-collection]").textContent=t.collectionLabel||"";const s=e.querySelector("[data-compare-item-title-link]");s.textContent=t.title||"",s.href=t.url||"#",e.querySelector("[data-compare-item-link]").href=t.url||"#";const n=e.querySelector("[data-compare-item-remove]");return n.dataset.handle=t.handle,n.setAttribute("aria-label",(this.dataset.removeLabel||"Remove %TITLE%").replace("%TITLE%",t.title||"")),e}async#X(){const t=this.#O.list();if(0===t.length)return;const e=l(),i=await Promise.allSettled(t.map(async t=>{const i=await fetch(`${e}products/${t.handle}.js`);return!!i.ok&&!!(await i.json())})),s=new Set(t.filter((t,e)=>!("fulfilled"===i[e].status&&!0===i[e].value)).map(t=>t.handle));if(s.size>0){const t=this.#O.list();this.#O.replace(t.filter(t=>!s.has(t.handle))),this.#U()}this.#O.list().forEach(t=>ce(t.handle))}#Y(){const t=document.querySelector('[data-facets-form-content="products-list"]');if(!t)return;const e=a(()=>{this.#U(),this.#V()},100);this.#_=new MutationObserver(e),this.#_.observe(t,{childList:!0,subtree:!0})}};customElements.define("compare-bar",de);var ue=class extends HTMLElement{#O=null;#Q="";#F=4;#tt=[];#et=new Map;#it=null;#st=null;#nt=null;#rt=null;#ot=null;#at=null;#lt=null;#ct=null;#ht=null;#dt=null;#ut=null;#mt=null;#pt=null;#gt=null;#ft=0;connectedCallback(){this.#it=this.querySelector("[data-comparison-dialog]"),this.#st=this.querySelector("[data-comparison-images]"),this.#nt=this.querySelector("[data-comparison-image-grid]"),this.#rt=this.querySelector("[data-comparison-headers]"),this.#ot=this.querySelector("[data-comparison-header-grid]"),this.#at=this.querySelector("[data-comparison-scroll]"),this.#lt=this.querySelector("[data-comparison-grid]"),this.#ct=this.querySelector("[data-comparison-nav]"),this.#ht=this.querySelector("[data-comparison-prev]"),this.#dt=this.querySelector("[data-comparison-next]"),this.#ut=this.querySelector("[data-comparison-loading]"),this.#mt=this.querySelector("[data-comparison-error]"),this.#pt=this.querySelector("[data-comparison-banner-template]"),this.#gt={image:this.querySelector("[data-comparison-skeleton-image]"),header:this.querySelector("[data-comparison-skeleton-header]"),value:this.querySelector("[data-comparison-skeleton-value]")},this.#Q=this.dataset.collectionHandle||"",this.#F=parseInt(this.dataset.compareMax,10)||4,this.#O=new re(this.#Q,this.#F),document.addEventListener("compare:open",this.#vt),this.#lt.addEventListener("click",this.#bt),this.#at.addEventListener("scroll",this.#yt),this.#at.addEventListener("scrollend",this.#
1Et),this.#ht?.addEventListener("click",this.#wt),this.#dt?.addEventListener("click",this.#Ct),this.#it?.addEventListener("click",this.#St)}disconnectedCallback(){document.removeEventListener("compare:open",this.#vt),this.#lt?.removeEventListener("click",this.#bt),this.#at?.removeEventListener("scroll",this.#yt),this.#at?.removeEventListener("scrollend",this.#Et),this.#ht?.removeEventListener("click",this.#wt),this.#dt?.removeEventListener("click",this.#Ct),this.#it?.removeEventListener("click",this.#St),this.#ft&&cancelAnimationFrame(this.#ft)}#vt=async t=>{const e=t.detail&&t.detail.items;if(!Array.isArray(e))return;const i=this.#At(e).slice(0,this.#F);if(i.length<2)return;this.#tt=i,this.#et=new Map;let s=!1;i.forEach(t=>{const e=(i=t.handle,oe.get(i)||null);var i;e&&(this.#et.set(t.handle,this.#Lt(e)),s=!0)}),s?this.#kt(i):this.#qt(),this.#xt(),await this.#Tt(i)};async#Tt(t){(await Promise.allSettled(t.map(t=>async function(t){const e=await le(t);return oe.set(t,e),e}(t.handle)))).forEach((e,i)=>{"fulfilled"===e.status&&this.#et.set(t[i].handle,this.#Lt(e.value))});const e=t.filter(t=>(this.#et.get(t.handle)||[]).length>0);e.length<2?this.#$t():(this.#tt=e,this.#kt(e))}#At(t){const e=new Set;return t.filter(t=>!(!t||!t.handle||e.has(t.handle))&&(e.add(t.handle),!0))}#Lt(t){const e=(new DOMParser).parseFromString(t,"text/html");return Array.from(e.querySelectorAll("[data-compare-cell]"))}#Mt(t){const e=t.filter(t=>(this.#et.get(t.handle)||[]).length>0);if(0===e.length)return[];const i=new Map;let s=0;e.forEach(t=>{this.#et.get(t.handle).forEach(t=>{const{group:e,key:n,label:r,order:o,empty:a}=t.dataset;if("header"===e||"footer"===e||"image"===e)return;let l=i.get(n);l||(l={key:n,label:r||"",group:e,order:parseInt(o,10)||0,seq:s++,hasValue:!1},i.set(n,l)),"true"!==a&&(l.hasValue=!0)})});const n=[...i.values()].filter(t=>t.hasValue),r=n.filter(t=>"option"===t.group).sort((t,e)=>this.#Dt(t.key)-this.#Dt(e.key)||t.seq-e.seq),o=n.filter(t=>"attribute"===t.group).sort((t,e)=>t.order-e.order||t.seq-e.seq);return[...r,...o]}#Dt(t){return"option:size"===t?0:"option:color"===t?1:2}#kt(t){this.#Ht(),this.#nt.replaceChildren(),this.#ot.replaceChildren(),this.#lt.replaceChildren(),this.#nt.style.setProperty("--cols",String(t.length)),this.#ot.style.setProperty("--cols",String(t.length)),this.#lt.style.setProperty("--cols",String(t.length));const e=this.#Mt(t),i=2*e.length+1;t.forEach((t,s)=>{const n=s+1,r=this.#et.get(t.handle);if(!r)return this.#It(this.#nt,this.#Ot("image"),n,1),this.#It(this.#ot,this.#Ot("header"),n,1),e.forEach((t,e)=>this.#It(this.#lt,this.#Ot("value"),n,2+2*e)),void this.#It(this.#lt,this.#Ot("value"),n,i);const o=new Map(r.map(t=>[t.dataset.key,t])),a=o.get("image");this.#It(this.#nt,a?this.#Ft(a):this.#Ot("image"),n,1);const l=o.get("header");this.#It(this.#ot,l?this.#Ft(l):this.#Ot("header"),n,1),e.forEach((t,e)=>{const i=o.get(t.key);i&&this.#It(this.#lt,this.#Ft(i),n,2+2*e)});const c=o.get("footer");c&&this.#It(this.#lt,this.#Ft(c),n,i)}),e.forEach((t,e)=>this.#lt.appendChild(this.#zt(t.label,1+2*e))),this.#_t(t.length)}#It(t,e,i,s){e.style.gridColumn=String(i),e.style.gridRow=String(s),t.appendChild(e)}#Ft(t){return document.importNode(t,!0)}#zt(t,e){const i=this.#Ft(this.#pt.content.firstElementChild);return i.style.gridColumn="1 / -1",i.style.gridRow=String(e),i.querySelector("[data-comparison-banner-label]").innerHTML=t,i}#Ot(t){const e=this.#gt[t]||this.#gt.value;return this.#Ft(e.content.firstElementChild)}#Pt(){const t=this.#ot.firstElementChild,e=getComputedStyle(this.#ot),i=parseFloat(e.columnGap)||0;return(t?t.getBoundingClientRect().width:this.#at.clientWidth/2)+i}#wt=()=>this.#at.scrollBy({left:-this.#Pt(),behavior:"smooth"});#Ct=()=>this.#at.scrollBy({left:this.#Pt(),behavior:"smooth"});#yt=()=>{this.#ft||(this.#ft=requestAnimationFrame(()=>{this.#ft=0;const t=this.#at.scrollLeft;this.#st&&(this.#st.scrollLeft=t),this.#rt&&(this.#rt.scrollLeft=t),this.#Et()}))};#_t(t){this.#ct&&this.#ct.classList.toggle("hidden",t<=2),this.#Et()}#Et=()=>{if(!this.#ht||!this.#dt)return;const t=this.#at.scrollWidth-this.#at.clientWidth;this.#ht.disabled=this.#at.scrollLeft<=1,this.#dt.disabled=this.#at.scrollLeft>=t-1};#bt=t=>{const e=t.target.closest("[data-compare-remove]");e&&(t.preventDefault(),this.#Rt(e.dataset.handle))};#Rt(t){t&&(this.#O.remove(t),function(t){oe.delete(t),ae.delete(t)}(t),this.#et.delete(t),this.#tt=this.#tt.filter(e=>e.handle!==t),document.dispatchEvent(new CustomEvent("compare:changed",{bubbles:!0,detail:{collectionHandle:this.#Q}}
1)),this.#tt.length<2?this.#jt():this.#kt(this.#tt))}#xt(){this.#it&&!this.#it.open&&this.#it.showModal()}#jt(){this.#it?.close()}#St=t=>{if(t.target!==this.#it)return;const e=this.#it.getBoundingClientRect();e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.#jt()};#Ht(){this.#ut?.classList.add("hidden"),this.#mt?.classList.add("hidden"),this.#st?.classList.remove("hidden"),this.#rt?.classList.remove("hidden"),this.#at?.classList.remove("hidden")}#qt(){this.#st?.classList.add("hidden"),this.#rt?.classList.add("hidden"),this.#at?.classList.add("hidden"),this.#ct?.classList.add("hidden"),this.#mt?.classList.add("hidden"),this.#ut?.classList.remove("hidden")}#$t(){this.#st?.classList.add("hidden"),this.#rt?.classList.add("hidden"),this.#at?.classList.add("hidden"),this.#ct?.classList.add("hidden"),this.#ut?.classList.add("hidden"),this.#mt?.classList.remove("hidden")}};customElements.define("comparison-modal",ue);var me;if(document.addEventListener("liquid-ajax-cart:request-end",t=>{if(clearTimeout(me),422!==t.detail?.requestState?.responseData?.status)return;const e="[data-ajax-cart-errors][data-max-qty-text]";document.querySelectorAll(e).forEach(t=>{t.textContent.trim()&&(t.textContent=t.getAttribute("data-max-qty-text"))}),me=setTimeout(()=>{document.querySelectorAll(e).forEach(t=>t.textContent="")},3e3)}),!customElements.get("custom-scroll")){class $s extends HTMLElement{#Bt=null;#Nt=null;#Vt=null;#_=null;#Ut=null;#Xt=!1;#Yt=0;#Wt=0;connectedCallback(){this.#Bt=this.querySelector("[data-custom-scroll-track]")||this,this.#Nt=this.querySelector("[data-action-scroll-prev]"),this.#Vt=this.querySelector("[data-action-scroll-next]"),this.#Ut=new AbortController;const{signal:t}=this.#Ut;this.#Bt.addEventListener("mousedown",this.#Gt,{signal:t}),this.#Bt.addEventListener("mousemove",this.#Kt,{signal:t}),this.#Bt.addEventListener("mouseup",this.#Zt,{signal:t}),this.#Bt.addEventListener("mouseleave",this.#Zt,{signal:t}),this.#Nt?.addEventListener("click",()=>this.#Jt(-1),{signal:t}),this.#Vt?.addEventListener("click",()=>this.#Jt(1),{signal:t}),this.#Bt.addEventListener("scroll",this.#Qt,{passive:!0,signal:t}),this.#_=new ResizeObserver(this.#Qt),this.#_.observe(this.#Bt),this.#Qt()}disconnectedCallback(){this.#Ut?.abort(),this.#_?.disconnect()}#Jt(t){this.#Bt.scrollBy({left:t*this.#Bt.clientWidth*.8,behavior:"smooth"})}#Qt=()=>{const t=this.#Bt,e=t.scrollWidth-t.clientWidth-t.scrollLeft;this.#Nt?.classList.toggle("hidden",t.scrollLeft<=1),this.#Vt?.classList.toggle("hidden",e<=1)};#Gt=t=>{this.#Xt=!0,this.#Yt=t.pageX-this.#Bt.offsetLeft,this.#Wt=this.#Bt.scrollLeft};#Kt=t=>{if(!this.#Xt)return;t.preventDefault();const e=t.pageX-this.#Bt.offsetLeft;this.#Bt.scrollLeft=this.#Wt-(e-this.#Yt)};#Zt=()=>{this.#Xt=!1}}customElements.define("custom-scroll",$s)}if(!customElements.get("deferred-media")){class Ms extends HTMLElement{connectedCallback(){const t=this.querySelector("[data-deferred-media-button]");t&&t.addEventListener("click",()=>this.#te(),{once:!0})}#te(){const t=this.querySelector("template");if(!t)return;const e=this.querySelector("[data-deferred-media-poster]");e&&(e.style.display="none");const i=this.querySelector("[data-deferred-media-button]");i&&(i.style.display="none"),this.appendChild(t.content.cloneNode(!0))}}customElements.define("deferred-media",Ms)}var pe,ge="facets-form",fe={ajaxInput:`data-${ge}-input`,content:`data-${ge}-content`,link:`data-${ge}-link`,loadingClass:`data-${ge}-loading-class`,scroll:`data-${ge}-scroll`,toggleCheckbox:`#${ge}-toggle-checkbox`},ve=[],be=window.location.search.slice(1),ye=window.location.search.slice(1);function Ee(t,e=!0,i=!1){try{pe&&(pe.abort(),pe=void 0),ye=t;const s={};document.querySelectorAll(`[${fe.content}]`).forEach(t=>{const[e]=n(t);if(!e)throw new Error(`[${ge}] [The "${fe.content}" element must be within a Shopify section]`);s[e]=!0});const r=Object.keys(s);if(r.length>5)throw new Error(`[${ge}] [The "${fe.content}" elements exist in more than 5 sections]`);const o=`${window.location.pathname}?sections=${r.join(",")}&${t}`,a=ve.find(t=>t.url===o);a?(Ae(a.html),window.yotpoWidgetsContainer?.initWidgets?.(),i&&Se()):(pe=new AbortController,Ce(!0),we(!0),fetch(o,{signal:pe.signal}).then(t=>t.json()).then(t=>{let e="";for(let i in t)e+=t[i];ve.push({url:o,html:e}),Ae(e),window.yotpoWidgetsContainer?.initWidgets?.(),i&&Se()}).catch(e=>{"AbortError"!==e.name&&(console.error(`[${ge}] [Section API request error]`,e),window.location.href=`?${t}`)}).finally(()=>{we(!1),Ce(!1)})),e&&history.pushState({searchParams:t},"",`${window.location.pathname}${t&&"?".concat(t)}`)}catch(b){console.error(b),window.location.href=`?${t}`}}function we(t){document.querySelectorAll(`[${fe.ajaxInput}][type="number"], [${fe.ajaxInput}
1][type="text"]`).forEach(e=>{e.readOnly=t})}function Ce(t){((t,e,i)=>{t.querySelectorAll(`[${e}]`).forEach(t=>{const s=t.getAttribute(e);s&&(i?t.classList.add(s):t.classList.remove(s))})})(document,fe.loadingClass,t)}function Se(){document.querySelector(ge)?.scrollIntoView({behavior:"smooth",block:"start"})}function Ae(t){const e=(new DOMParser).parseFromString(t,"text/html");document.querySelectorAll(`[${fe.content}]`).forEach(t=>{const i=t.getAttribute(fe.content);if(!i)throw new Error(`[${ge}] [A "${fe.content}" element doesn't have unique value]`);const s=e.querySelector(`[${fe.content}="${i}"]`);if(!s)throw new Error(`[${ge}] [A "${fe.content}" element with "${i}" value isn't found in the section API response]`);t.innerHTML=s.innerHTML})}window.addEventListener("popstate",t=>{const e=t.state?t.state.searchParams:be;e!==ye&&Ee(e,!1)}),document.addEventListener("click",t=>{const e=t.target.closest(`[${fe.link}]`);if(!e)return;const i=e.href;if(!i)return;const s=e.hasAttribute(fe.scroll);Ee(new URL(i).searchParams.toString(),!0,s),t.preventDefault()});var Le=class extends HTMLElement{_$form;connectedCallback(){if(this._$form=this.querySelector("form"),!this._$form)throw new Error(`[${ge}] [The "form" element isn't found]`);this._$form.addEventListener("submit",t=>{t.preventDefault(),this._ajaxSubmit(),this._toggleFilterDrawer()}),document.body.addEventListener("change",t=>{t.target.form===this._$form&&t.target.hasAttribute(fe.ajaxInput)&&this._ajaxSubmit()})}_ajaxSubmit(){const t=new FormData(this._$form);let e={};t.forEach((t,i)=>e[i]=t),Ee(new URLSearchParams(t).toString())}_toggleFilterDrawer(){const t=document.querySelector(fe.toggleCheckbox);t&&(t.checked=!t.checked)}};customElements.define(ge,Le);var ke=class{#ee=[];#ie=-1;#_=null;#se={offset:100,threshold:.1,throttle:50,behavior:"smooth",onIndexChange:null};#ne=new Map;#re=null;#oe=!1;#ae=null;#le=null;constructor(t={}){this.#se={...this.#se,...t},this.#ee=this.#ce(this.#se.sections),0!==this.#ee.length?(this.#he(),this.#de()&&this.#ue(),this.#me()):console.warn("ScrollTrigger: No elements found")}#ce(t){return"string"==typeof t?Array.from(document.querySelectorAll(t)):t instanceof NodeList?Array.from(t):Array.isArray(t)?t:[]}#pe(t){return"string"==typeof t&&t.includes("%")}#ge(t){if(this.#pe(t)){const e=parseFloat(t)/100;return Math.round(window.innerHeight*e)}return"number"==typeof t?t:100}#fe(t){if(!t)return this.#se.offset;const e=t.getAttribute("data-animate-offset");return null!==e?/^\d+$/.test(e)?parseInt(e,10):e:this.#se.offset}#de(){return!!this.#pe(this.#se.offset)||this.#ee.some(t=>{const e=t.getAttribute("data-animate-offset");return e&&this.#pe(e)})}#ue(){this.#ae=new ResizeObserver(()=>{this.#_&&this.#_.disconnect(),this.#he()}),this.#ae.observe(document.documentElement)}#me(){this.#le=()=>{this.#ve()},window.addEventListener("scroll",this.#le,{passive:!0})}#he(){const t=`0px 0px -${this.#ge(this.#se.offset)}px 0px`;this.#_=new IntersectionObserver(t=>this.#be(t),{root:null,rootMargin:t,threshold:this.#se.threshold}),this.#ee.forEach(t=>{this.#_.observe(t),this.#ne.set(t,!1)})}#be(t){this.#oe||(t.forEach(t=>{this.#ne.set(t.target,t.isIntersecting)}),this.#ve())}#ve(){this.#re||(this.#re=setTimeout(()=>{this.#ye(),this.#re=null},this.#se.throttle))}#ye(){if(this.#oe)return;let t=-1;for(let e=this.#ee.length-1;e>=0;e--){const i=this.#ee[e],s=this.#fe(i),n=this.#ge(s),r=window.innerHeight-n;if(i.getBoundingClientRect().top<=r){t=e;break}}if(t!==this.#ie){const e=this.#ie;this.#ie=t;const i=this.#ee[t]||null,s=this.#ee[e]||null;this.#se.onIndexChange&&"function"==typeof this.#se.onIndexChange&&this.#se.onIndexChange({currentIndex:t,previousIndex:e,currentElement:i,previousElement:s}),this.#Ee("scroll-trigger:change",{index:t,previousIndex:e,section:i,previousSection:s})}}#Ee(t,e){"undefined"!=typeof window&&window.dispatchEvent(new CustomEvent(t,{bubbles:!0,detail:e}))}getCurrentIndex(){return this.#ie}getCurrentElement(){return this.#ee[this.#ie]||null}getElements(){return[...this.#ee]}scrollToIndex(t,e={}){if(t<0||t>=this.#ee.length)return void console.warn(`ScrollTrigger: Invalid index ${t}`);const i=this.#ee[t],s=e.behavior||this.#se.behavior,n=e.offset||0,r=this.#fe(i),o=this.#ge(r),a=window.innerHeight-o,l=i.getBoundingClientRect(),c=window.pageYOffset||document.documentElement.scrollTop,h=l.top+c-a-n;window.scrollTo({top:h,behavior:s})}scrollToElement(t,e={}){const i=this.#ee.indexOf(t);-1!==i?this.scrollToIndex(i,e):console.warn("ScrollTrigger: Element not found in tracked elements")}refresh(){this.#oe||(this.#ee.forEach(t=>{this.#_.unobserve(t),this.#_.observe(t)}),this.#ye())}updateConfig(t={}){if(this.#oe)return;const e="offset"in t&&t.offset!==this.#se.offset||"threshold"in t&&t.threshold!==this.#se.threshold;if(this.#se={...this.#se,...t},"offset"in t){const t=this.#de();t&&!this.#ae?this.#ue():!t&&this.#ae&&(this.#ae.disconnect(),this.#ae=null)}e&&(this.#_&&this.#_.disconnect(),this.#he())}destroy(){this.#oe||(this.#oe=!0,this.#re&&(clearTimeout(this.#re),this.#re=null),this.#_&&(this.#_.disconnect(),this.#_=null),this.#ae&&(this.#ae.disconnect(),this.#ae=null),this.#le&&(window.removeEventListener("scroll",this.#le),this.#le=null),this.#ne.clear(),this.#ee=[],this.#ie=-1)}},qe=class extends HTMLElement{connectedCallback(){this.headings=Array.from(this.querySelectorAll("[data-faq-heading]")),this.headings.length&&(this.navButtons=Array.from(this.querySelectorAll("[data-faq-nav-target]")),this.currentLabel=this.querySelector("[data-faq-nav-current]"),this.mobileDetails=this.querySelector("openable-component details[data-openable]"),this.trigger=new ke({sections:this.headings,offset:"50%",onIndexChange:({currentIndex:t})=>this.syncActive(t)}),this.navButtons.forEach(t=>{t.addEventListener("click",()=>this.onNavClick(t))}),this.syncActive(this.trigger.getCurrentIndex()))}disconnectedCallback(){this.trigger?.destroy()}syncActive(t){const e=this.headings[t]||this.headings[0],i=e?.id;this.navButtons.forEach(t=>{t.dataset.faqNavTarget===i?t.setAttribute("aria-current","location"):t.removeAttribute("aria-current")}),this.currentLabel&&e&&(this.currentLabel.textContent=e.textContent.trim())}onNavClick(t){const e=document.getElementById(t.dataset.faqNavTarget);e&&(this.trigger.scrollToElement(e,{behavior:"smooth"}),this.mobileDetails?.open&&(this.mobileDetails.open=!1))}};customElements.define("faq-content",qe);var xe=class extends HTMLElement{connectedCallback(){if(this.limit=parseInt(this.getAttribute("limit"),10)||10,this.button=this.querySelector("[data-action-show-more-toggle]"),!this.button)return;this.itemsContainer=this;const t=Array.from(this.children).filter(t=>t!==this.button);if(1!==t.length||"DIV"!==t[0].tagName||t[0].hasAttribute("data-facets-form-input")||(this.itemsContainer=t[0]),this.applyInitialHidden(),!this.hasOverflow())return this.button.hidden=!0,void this.getItems().forEac
1h(t=>{t.style.display=""});this.isAnimating=!1,this.button.addEventListener("click",()=>{if(this.isAnimating)return;const t="true"!==this.button.getAttribute("aria-expanded");this.button.setAttribute("aria-expanded",String(t)),t?this.expand():this.collapse()})}getItems(){return Array.from(this.itemsContainer.children).filter(t=>t!==this.button)}hasOverflow(){let t=0;for(const e of this.getItems())if(!e.querySelector("input:checked")&&(t++,t>this.limit))return!0;return!1}applyInitialHidden(){let t=0;for(const e of this.getItems())e.querySelector("input:checked")?e.style.display="":(t++,e.style.display=t>this.limit?"none":"")}getItemsToHide(){const t=[];let e=0;for(const i of this.getItems())i.querySelector("input:checked")||(e++,e>this.limit&&"none"!==i.style.display&&t.push(i));return t}getHiddenItems(){return this.getItems().filter(t=>"none"===t.style.display)}async expand(){const t=this.getHiddenItems();if(0!==t.length){this.isAnimating=!0;try{const e=this.itemsContainer.offsetHeight;t.forEach(t=>{t.style.opacity="0",t.style.display=""});const i=this.itemsContainer.offsetHeight;this.itemsContainer.style.overflow="hidden",await this.itemsContainer.animate({height:[`${e}px`,`${i}px`]},{duration:400,easing:"ease-in-out"}).finished,this.itemsContainer.style.overflow="",this.itemsContainer.style.height="";const s=t.map(t=>t.animate({opacity:[0,1]},{duration:250,easing:"ease",fill:"forwards"}));await Promise.all(s.map(t=>t.finished)),t.forEach((t,e)=>{t.style.opacity="",s[e].cancel()})}finally{this.isAnimating=!1}}}async collapse(){const t=this.getItemsToHide();if(0!==t.length){this.isAnimating=!0;try{const e=t.map(t=>t.animate({opacity:[1,0]},{duration:250,easing:"ease",fill:"forwards"}));await Promise.all(e.map(t=>t.finished));const i=this.itemsContainer.offsetHeight;t.forEach((t,i)=>{t.style.display="none",e[i].cancel(),t.style.opacity=""});const s=this.itemsContainer.offsetHeight;this.itemsContainer.style.overflow="hidden",await this.itemsContainer.animate({height:[`${i}px`,`${s}px`]},{duration:400,easing:"ease-in-out"}).finished,this.itemsContainer.style.overflow="",this.itemsContainer.style.height=""}finally{this.isAnimating=!1}}}};customElements.define("filter-show-more",xe),document.querySelectorAll("[data-action-toggle-mobile-menu]").forEach(t=>{const e=t.getAttribute("data-vegax-commandfor"),i=e&&document.getElementById(e);i?(t.addEventListener("click",()=>{t.classList.add("is-active")}),i.addEventListener("close",()=>{t.classList.remove("is-active")})):t.addEventListener("click",()=>{t.classList.toggle("is-active")})});var Te=class extends HTMLElement{constructor(){super()}connectedCallback(){["onHamburgerClick","onDocumentClickCapture","onDocumentKeydown","onMediaChange","onHeaderResize","onTabKey"].forEach(t=>this[t]=this[t].bind(this)),this.headerEl=document.querySelector(".header-section")||document.querySelector("header"),this.panelStackEl=this.querySelector("panel-stack"),this.hamburgerEl=document.querySelector("[data-action-toggle-mobile-menu]"),this.mediaQuery=window.matchMedia("(min-width: 1024px)"),this.headerObserver=new ResizeObserver(this.onHeaderResize),this.setAttribute("role","dialog"),this.setAttribute("aria-modal","true"),this.hasAttribute("aria-label")||this.setAttribute("aria-label","Menu"),this.hasAttribute("state")||this.setAttribute("state","closed"),this.setAttribute("aria-hidden","true"),document.addEventListener("click",this.onHamburgerClick)}disconnectedCallback(){document.removeEventListener("click",this.onHamburgerClick),document.removeEventListener("click",this.onDocumentClickCapture,!0),document.removeEventListener("keydown",this.onDocumentKeydown),this.removeEventListener("keydown",this.onTabKey),this.mediaQuery.removeEventListener("change",this.onMediaChange),this.headerObserver.disconnect(),clearTimeout(this.resetTimer)}onHamburgerClick(t){t.target.closest("[data-action-toggle-mobile-menu]")&&(t.preventDefault(),this.toggle())}toggle(){"open"===this.getAttribute("state")?this.close():this.open()}open(){"open"!==this.getAttribute("state")&&(this.mediaQuery.matches||(this.updateMenuTop(),this.headerEl&&this.headerObserver.observe(this.headerEl),this.applyInert(!0),document.addEventListener("click",this.onDocumentClickCapture,!0),document.addEventListener("keydown",this.onDocumentKeydown),this.addEventListener("keydown",this.onTabKey),this.mediaQuery.addEventListener("change",this.onMediaChange),this.lastFocused=document.activeElement,this.setAttribute("state","open"),this.setAttribute("aria-hidden","false"),this.hamburgerEl&&(this.hamburgerEl.setAttribute("aria-expanded","true"),this.hamburgerEl.setAttribute("aria-label","Close menu"),this.hamburgerEl.classList.add("is-active")),requestAnimationFrame(()=>this.focusFirst())))}close(){"closed"!==this.getAttribute("state")&&(this.setAttribute("state","closed"),this.setAttribute("aria-hidden","true"),this.hamburgerEl&&(this.hamburgerEl.setAttribute("aria-expanded","fal
1se"),this.hamburgerEl.setAttribute("aria-label","Open menu"),this.hamburgerEl.classList.remove("is-active")),this.applyInert(!1),document.removeEventListener("click",this.onDocumentClickCapture,!0),document.removeEventListener("keydown",this.onDocumentKeydown),this.removeEventListener("keydown",this.onTabKey),this.mediaQuery.removeEventListener("change",this.onMediaChange),this.headerObserver.disconnect(),this.lastFocused&&this.lastFocused.focus?this.lastFocused.focus({preventScroll:!0}):this.hamburgerEl&&this.hamburgerEl.focus({preventScroll:!0}),clearTimeout(this.resetTimer),this.resetTimer=setTimeout(()=>{this.panelStackEl?.reset&&this.panelStackEl.reset()},260))}updateMenuTop(){if(!this.headerEl)return;const t=this.headerEl.getBoundingClientRect().bottom;this.style.setProperty("--mobile-menu-top",`${Math.max(0,t)}px`)}onHeaderResize(){this.updateMenuTop()}applyInert(t){[document.querySelector("main")||document.querySelector("#MainContent")||document.querySelector("[role='main']"),document.querySelector("footer")].forEach(e=>{e&&(t?e.setAttribute("inert",""):e.removeAttribute("inert"))})}onDocumentClickCapture(t){"open"===this.getAttribute("state")&&(this.contains(t.target)||t.target.closest("[data-action-toggle-mobile-menu]")||this.close())}onDocumentKeydown(t){"Escape"===t.key&&"open"===this.getAttribute("state")&&this.close()}onMediaChange(t){t.matches&&this.close()}getFocusable(){const t=["a[href]","button:not([disabled])","input:not([disabled])","select:not([disabled])","textarea:not([disabled])","[tabindex]:not([tabindex='-1'])"].join(",");return Array.from(this.querySelectorAll(t)).filter(t=>!t.closest("[inert]")&&(null!==t.offsetParent||0!==t.getClientRects().length))}focusFirst(){const t=this.getFocusable();t.length>0?t[0].focus({preventScroll:!0}):this.focus({preventScroll:!0})}onTabKey(t){if("Tab"!==t.key)return;const e=this.getFocusable();if(0===e.length)return void t.preventDefault();const i=e[0],s=e[e.length-1];t.shiftKey&&document.activeElement===i?(t.preventDefault(),s.focus({preventScroll:!0})):t.shiftKey||document.activeElement!==s||(t.preventDefault(),i.focus({preventScroll:!0}))}};customElements.define("mobile-menu-drawer",Te);var $e="html-fetcher",Me="lazy",De={area:"data-html-fetcher-area",fetcherLink:"data-html-fetcher-link",loadingClass:"data-html-fetcher-loading-class",sectionId:"section",href:"href",loading:"loading",useViewTransition:"use-view-transition"},He=class extends HTMLElement{#we;#Ce=null;constructor(){super(),this.#we=window.VegaX.createHTMLFetcher({useViewTransition:this.hasAttribute(De.useViewTransition)})}connectedCallback(){const t=this.getAttribute(De.href);t&&(this.getAttribute(De.loading)===Me?this.#Se(t):this.renderURL(t))}#Se(t){this.#Ce=new IntersectionObserver(e=>{e[0].isIntersecting&&this.renderURL(t)},{rootMargin:"0px 0px 0px 0px"}),this.#Ce.observe(this)}#H(t){this.querySelectorAll(`[${De.loadingClass}]`).forEach(e=>{const i=e.getAttribute(De.loadingClass);if(!i)return;const s=e.getAttribute(De.fetcherRef);s&&s!==this.id||(s||e.closest($e)===this)&&e.classList.toggle(i,t)})}async renderURL(t){this.#Ce?.unobserve(this),this.#Ce=null;const e=new URL(t,window.location.origin),i=this.getAttribute(De.sectionId);i&&e.searchParams.set("section_id",i);const s=$e+(this.getAttribute(De.sapiId)?"#"+this.id:"");let n=[];const o=r(this,`[${De.area}], [${De.loadingClass}]`),a=o.filter(t=>t.hasAttribute(De.area)),l=o.filter(t=>t.hasAttribute(De.loadingClass)).map(t=>({element:t,classList:t.getAttribute(De.loadingClass)||""}));n=a.length?[{target:a,source:`${s} [${De.area}]`}]:[{target:this,source:s}],this.#we.fetch(e,n,l).catch(t=>{"AbortError"!==t?.name&&console.error("[html-fetcher] fetch failed",t)})}};customElements.define($e,He);var Ie=class extends HTMLElement{constructor(){super(),this.addEventListener("click",this.#Ae.bind(this))}#Ae=t=>{const e=this.getAttribute("selector"),i=e?document.querySelector(e):this.closest($e);if(!i)throw new Error(`${$e} element not found`);i.renderURL(this.getAttribute("href")),t.preventDefault()}};customElements.define("html-fetcher-trigger",Ie);var Oe=class extends HTMLElement{#Le;#ke=0;#qe=0;#xe=1;#Te=1;#$e=0;#Me=0;
1#De=null;#He={mode:"idle",pointers:new Map,startScale:1,startTranslateX:0,startTranslateY:0,startDistance:0,startMidpointX:0,startMidpointY:0,currentMidpointX:0,currentMidpointY:0};#Ie=new Set;#Oe=!1;#Fe=0;#ze=0;#_e=!1;#Pe=0;#Re=0;#je=0;#Be=0;#ae=null;#Ne=0;#Ve=0;#Ue=null;static get observedAttributes(){return["min","max"]}constructor(){super(),this.handlers={}}get min(){const t=parseFloat(this.getAttribute("min")),e=parseFloat(this.getAttribute("max"));return Math.min(Number.isFinite(t)&&t>0?t:1,Number.isFinite(e)&&e>0?e:3)}get max(){const t=parseFloat(this.getAttribute("min")),e=parseFloat(this.getAttribute("max"));return Math.max(Number.isFinite(t)&&t>0?t:1,Number.isFinite(e)&&e>0?e:3)}get scale(){return this.#Te}get translateX(){return this.#$e}get translateY(){return this.#Me}connectedCallback(){this.queryDOM(),this.#Le&&(this.#Te=this.min,this.prepareForFit(),this.attachListeners(),this.#Le.complete&&this.#Le.naturalWidth?this.#Xe():this.#Le.addEventListener("load",()=>this.#Xe(),{once:!0}))}disconnectedCallback(){this.detachListeners(),this.#Be&&(cancelAnimationFrame(this.#Be),this.#Be=0),this.#Ne&&(cancelAnimationFrame(this.#Ne),this.#Ne=0),this.#He.pointers.clear(),this.#Ie.clear(),this.#He.mode="idle",this.#_e=!1,this.#Pe=0,this.removeAttribute("gesturing"),this.removeAttribute("transitioning")}attributeChangedCallback(t){this.#Ye()&&("min"!==t&&"max"!==t||(this.#Te<this.min?this.reset():this.#Te>this.max&&this.zoomTo(this.max)))}queryDOM(){this.#Le=this.querySelector("img")}attachListeners(){this.handlers.touchStart=this.#We.bind(this),this.handlers.touchMove=this.#Ge.bind(this),this.handlers.touchEnd=this.#Ke.bind(this),this.handlers.pointerDown=this.#Ze.bind(this),this.handlers.pointerMove=this.#Je.bind(this),this.handlers.pointerUp=this.#Qe.bind(this),this.handlers.dblClick=this.#ti.bind(this),this.handlers.transitionEnd=()=>this.removeAttribute("transitioning"),this.addEventListener("touchstart",this.handlers.touchStart,{passive:!1}),this.addEventListener("touchmove",this.handlers.touchMove,{passive:!1}),this.addEventListener("touchend",this.handlers.touchEnd),this.addEventListener("touchcancel",this.handlers.touchEnd),this.addEventListener("pointerdown",this.handlers.pointerDown),window.addEventListener("pointermove",this.handlers.pointerMove,{passive:!1}),window.addEventListener("pointerup",this.handlers.pointerUp),window.addEventListener("pointercancel",this.handlers.pointerUp),this.addEventListener("dblclick",this.handlers.dblClick),this.addEventListener("transitionend",this.handlers.transitionEnd),this.#ae=new ResizeObserver(()=>this.#ei()),this.#ae.observe(this)}detachListeners(){this.handlers.pointerDown&&(this.removeEventListener("touchstart",this.handlers.touchStart),this.removeEventListener("touchmove",this.handlers.touchMove),this.removeEventListener("touchend",this.handlers.touchEnd),this.removeEventListener("touchcancel",this.handlers.touchEnd),this.removeEventListener("pointerdown",this.handlers.pointerDown),window.removeEventListener("pointermove",this.handlers.pointerMove),window.removeEventListener("pointerup",this.handlers.pointerUp),window.removeEventListener("pointercancel",this.handlers.pointerUp),this.removeEventListener("dblclick",this.handlers.dblClick),this.removeEventListener("transitionend",this.handlers.transitionEnd),this.#ae&&(this.#ae.disconnect(),this.#ae=null))}reset({animate:t=!0}={}){if(!this.#Ye())return;const e=this.getBoundingClientRect();this.#De=e;const i=this.min,s=this.#ke*this.#xe*i,n=this.#qe*this.#xe*i,r=(e.width-s)/2,o=(e.height-n)/2;this.#ii(i,r,o,t)}recalculate(){this.#Le&&(this.#Le.complete&&this.#Le.naturalWidth?this.#si():this.#Le.addEventListener("load",()=>this.#si(),{once:!0}))}prepareForFit(){this.removeAttribute("ready"),this.#Ve=0,this.#Ue=null,this.#Ne&&(cancelAnimationFrame(this.#Ne),this.#Ne=0)}zoomTo(t,{animate:e=!0}={}){if(!this.#Ye())return;const i=this.getBoundingClientRect();this.#De=i;const s=Math.max(this.min,Math.min(this.max,t)),n=i.width/2,r=i.height/2,o=n-(n-this.#$e)*(s/this.#Te),a=r-(r-this.#Me)*(s/this.#Te),l=this.#ni(o,a,s);this.#ii(s,l.translateX,l.translateY,e)}#Ye(){return!(!this.#Le||!this.#ke)}#ri(t){return t.width&&t.height?(this.#Ue&&Math.abs(this.#Ue.width-t.width)<.5&&Math.abs(this.#Ue.height-t.height)<.5?this.#Ve+=1:(this.#Ve=1,this.#Ue={width:t.width,height:t.height}),this.#Ve>=2):(this.#Ve=0,this.#Ue=null,!1)}
1#oi(t=this.getBoundingClientRect()){const e=this.#Le.naturalWidth,i=this.#Le.naturalHeight;return!(!e||!i)&&(!(!t.width||!t.height)&&(this.#ke=e,this.#qe=i,this.#De=t,this.#xe=Math.min(t.width/e,t.height/i),!0))}#si({requireStableRect:t=!1}={}){const e=this.getBoundingClientRect();if(t&&!this.#ri(e))return!1;if(!this.#oi(e))return!1;const i=this.#De;this.#Te=this.min;const s=this.#ke*this.#xe*this.#Te,n=this.#qe*this.#xe*this.#Te;return this.#$e=(i.width-s)/2,this.#Me=(i.height-n)/2,this.#ai(),this.setAttribute("ready",""),this.#Ve=0,this.#Ue=null,!0}#Xe(){if(!this.#Le||this.hasAttribute("ready")||this.#Ne)return;let t=0;const e=()=>{this.#Ne=0,this.#Le&&!this.hasAttribute("ready")&&(this.#si({requireStableRect:!0})||(t+=1,t<24&&(this.#Ne=requestAnimationFrame(e))))};this.#Ne=requestAnimationFrame(e)}#ai(){const t=this.#Te*this.#xe;this.#Le.style.transform=`translate(${this.#$e}px, ${this.#Me}px) scale(${t})`,this.#Te>this.min+.001?this.setAttribute("zoomed",""):this.removeAttribute("zoomed"),this.dispatchEvent(new CustomEvent("image-zoom:change",{bubbles:!0,detail:{scale:this.#Te,translateX:this.#$e,translateY:this.#Me}}))}#li(t){const e=this.#De;return{x:t.clientX-e.left,y:t.clientY-e.top}}#ci(t){this.#He.pointers.clear();for(const e of t)this.#He.pointers.set(e.identifier,this.#li(e))}#ni(t,e,i){const s=this.#De||this.getBoundingClientRect(),n=this.#ke*this.#xe*i,r=this.#qe*this.#xe*i;let o,a;if(n<=s.width)o=(s.width-n)/2;else{const e=s.width-n;o=Math.min(0,Math.max(e,t))}if(r<=s.height)a=(s.height-r)/2;else{const t=s.height-r;a=Math.min(0,Math.max(t,e))}return{translateX:o,translateY:a}}#hi(t){const e=this.min,i=this.max;if(t<e){const i=e-t,s=.25*Math.sqrt(i)*e;return Math.max(.8*e,e-s)}if(t>i){const e=t-i,s=.25*Math.sqrt(e)*i;return Math.min(1.25*i,i+s)}return t}#Ze(t){if(this.#Ye())if("touch"!==t.pointerType){if(this.#De=this.getBoundingClientRect(),!(this.#Te<=this.min+.001&&0===this.#He.pointers.size)){if(this.setPointerCapture)try{this.setPointerCapture(t.pointerId)}catch{}this.removeAttribute("transitioning"),this.#He.pointers.set(t.pointerId,this.#li(t)),2===this.#He.pointers.size?this.#di():1===this.#He.pointers.size&&this.#ui()}}else this.#mi(t)}#mi(t){this.#Ie.add(t.pointerId);const e=this.#Ie.size>=2,i=this.#Te>this.min+.001;(e||i)&&(t.stopPropagation(),e&&this.#pi())}#pi(){this.#Oe=!0;for(const t of this.#Ie)this.dispatchEvent(new PointerEvent("pointercancel",{pointerId:t,bubbles:!0}));this.#Oe=!1}#Je(t){"touch"!==t.pointerType&&this.#He.pointers.has(t.pointerId)&&(t.cancelable&&t.preventDefault(),this.#He.pointers.set(t.pointerId,this.#li(t)),"pinch"===this.#He.mode&&this.#He.pointers.size>=2?this.#gi():"pan"===this.#He.mode&&this.#fi())}#Qe(t){this.#Oe||("touch"!==t.pointerType?this.#He.pointers.has(t.pointerId)&&(this.#He.pointers.delete(t.pointerId),"pinch"===this.#He.mode&&this.#He.pointers.size<2?1===this.#He.pointers.size&&this.#Te>this.min+.001?(this.#vi(),this.#ui()):(this.#bi(),this.#He.mode="idle",this.removeAttribute("gesturing")):0===this.#He.pointers.size&&("pan"===this.#He.mode&&this.#bi(),this.#He.mode="idle",this.removeAttribute("gesturing"))):this.#Ie.delete(t.pointerId))}#di(){const[t,e]=[...this.#He.pointers.values()],i=(t.x+e.x)/2,s=(t.y+e.y)/2;this.#He.mode="pinch",this.#He.startScale=this.#Te,this.#He.startTranslateX=this.#$e,this.#He.startTranslateY=this.#Me,this.#He.startDistance=Math.hypot(e.x-t.x,e.y-t.y)||1,this.#He.startMidpointX=i,this.#He.startMidpointY=s,this.#He.currentMidpointX=i,this.#He.currentMidpointY=s,this.setAttribute("gesturing",""),this.dispatchEvent(new CustomEvent("image-zoom:zoomstart",{bubbles:!0,detail:{scale:this.#Te}}))}#gi(){const[t,e]=[...this.#He.pointers.values()],i=Math.hypot(e.x-t.x,e.y-t.y),s=(t.x+e.x)/2,n=(t.y+e.y)/2,r=this.#He;r.currentMidpointX=s,r.currentMidpointY=n;const o=r.startScale*(i/r.startDistance),a=this.#hi(o),l=a/r.startScale;let c=s-(r.startMidpointX-r.startTranslateX)*l,h=n-(r.startMidpointY-r.startTranslateY)*l;if(this.#Te=a,a>=this.min&&a<=this.max){const t=this.#ni(c,h,a);c=t.translateX,h=t.translateY}this.#$e=c,this.#Me=h,this.#ai()}#ui(){if(this.#Te<=this.min+.001)return void(this.#He.mode="idle");const[t]=[...this.#He.pointers.values()];this.#He.mode="pan",this.#He.startScale=this.#Te,this.#He.startTranslateX=this.#$e,this.#He.startTranslateY=this.#Me,this.#He.startMidpointX=t.x,this.#He.startMidpointY=t.y,this.setAttribute("gesturing","")}#fi(){const[t]=[...this.#He.pointers.values()],e=this.#He,i=e.startTranslateX+(t.x-e.startMidpointX),s=e.startTranslateY+(t.y-e.startMidpointY),n=this.#ni(i,s,this.#Te);this.#$e=n.translateX,this.#Me=n.translateY,this.#ai()}#bi(){let t=this.#Te;t<this.min?t=this.min:t>this.max&&(t=this.max);let e=this.#$e,i=this.#Me;if(t!==this.#Te){const s=this.#He.currentMidpointX,n=this.#He.currentMidpointY,r=t/this.#Te;e=s-(s-this.#$e)*r,i=n-(n-this.#Me)*r}const s=this.#ni(e,i,t);this.#yi(t,s.translateX,s.translateY),this.dispatchEvent(new CustomEvent("image-zoom:zoomend",{bubbles:!0,detail:{scale:t}}))}#vi(){let t=this.#Te;t<this.min?t=this.min:t>this.max&&(t=this.max);let e=this.#$e,i=this.#Me;if(t!==this.#Te){const s=this.#He.currentMidpointX,n=this.#He.currentMidpointY,r=t/this.#Te;e=s-(s-this.#$e)*r,i=n-(n-this.#Me)*r}const s=this.#ni(e,i,t);this.#Te=t,this.#$e=s.translateX,this.#Me=s.translateY,this.#ai(),this.dispatchEvent(new CustomEvent("image-zoom:zoomend",{bubbles:!0,detail:{scale:t}}))}#yi(t,e,i){t===this.#Te&&e===this.#$e&&i===this.#Me||(this.setAttribute("transitioning",""),this.#Te=t,this.#$e=e,this.#Me=i,this.#ai())}#ii(t,e,i,s){t===this.#Te&&e===this.#$e&&i===this.#Me||(this.dispatchEvent(new CustomEvent("image-zoom:zoomstart",{bubbles:!0,detail:{scale:this.#Te}}
1)),s?this.#yi(t,e,i):(this.#Te=t,this.#$e=e,this.#Me=i,this.#ai()),this.dispatchEvent(new CustomEvent("image-zoom:zoomend",{bubbles:!0,detail:{scale:t}})))}#ti(t){if(!this.#Ye())return;this.#De=this.getBoundingClientRect();const e=this.#li(t);this.#Ei(e.x,e.y)}#Ei(t,e){if(this.#Te>this.min+.001)return void this.reset();const i=this.max,s=i/this.#Te,n=t-(t-this.#$e)*s,r=e-(e-this.#Me)*s,o=this.#ni(n,r,i);this.#ii(i,o.translateX,o.translateY,!0)}#We(t){if(this.#Ye()){if(this.#De=this.getBoundingClientRect(),this.removeAttribute("transitioning"),this.#ci(t.touches),this.#He.pointers.size>=2)return t.cancelable&&t.preventDefault(),void this.#di();if(1===this.#He.pointers.size){const[e]=[...this.#He.pointers.values()];this.#Fe=e.x,this.#ze=e.y,this.#_e=!1,this.#Te>this.min+.001&&(t.cancelable&&t.preventDefault(),this.#ui())}}}#Ge(t){if(0!==this.#He.pointers.size){if(this.#ci(t.touches),1===this.#He.pointers.size&&!this.#_e){const[t]=[...this.#He.pointers.values()],e=t.x-this.#Fe,i=t.y-this.#ze;e*e+i*i>100&&(this.#_e=!0)}"pinch"===this.#He.mode&&this.#He.pointers.size>=2?(t.cancelable&&t.preventDefault(),this.#gi()):"pan"===this.#He.mode&&(t.cancelable&&t.preventDefault(),this.#fi())}}#Ke(t){const e="touchcancel"===t.type,i=this.#He.pointers.size;if(this.#ci(t.touches),0===t.touches.length&&this.#Ie.clear(),"pinch"===this.#He.mode&&this.#He.pointers.size<2)if(!e&&1===this.#He.pointers.size&&this.#Te>this.min+.001){this.#vi();const[t]=[...this.#He.pointers.values()];this.#Fe=t.x,this.#ze=t.y,this.#_e=!0,this.#ui()}else this.#bi(),this.#He.mode="idle",this.removeAttribute("gesturing");else 0===this.#He.pointers.size&&("pan"===this.#He.mode&&this.#_e?this.#bi():e||1!==i||this.#_e||this.#wi(),this.#He.mode="idle",this.removeAttribute("gesturing"))}#wi(){const t=performance.now(),e=this.#Fe-this.#Re,i=this.#ze-this.#je;if(t-this.#Pe<300&&e*e+i*i<400)return this.#Ei(this.#Fe,this.#ze),void(this.#Pe=0);this.#Pe=t,this.#Re=this.#Fe,this.#je=this.#ze}#ei(){this.#Le&&(this.#Be||(this.#Be=requestAnimationFrame(()=>{if(this.#Be=0,!this.hasAttribute("ready"))return void(this.#Le.complete&&this.#Le.naturalWidth&&this.#Xe());if(!this.#oi())return;const t=this.#ni(this.#$e,this.#Me,this.#Te);this.#$e=t.translateX,this.#Me=t.translateY,this.#ai()})))}};customElements.get("image-zoom")||customElements.define("image-zoom",Oe);var Fe=class extends HTMLElement{#_=null;#Ci=!1;connectedCallback(){if(this.#Ci||this.hasAttribute("data-klaviyo-activated"))return;const t=this.querySelector(":scope > template");t&&("function"==typeof IntersectionObserver?(this.#_=new IntersectionObserver(e=>{e.some(t=>t.isIntersecting)&&this.#Si(t)},{rootMargin:"200px 0px",threshold:0}),this.#_.observe(this)):this.#Si(t))}disconnectedCallback(){this.#_?.disconnect(),this.#_=null}#Si(t){this.#Ci||(this.#Ci=!0,this.setAttribute("data-klaviyo-activated",""),this.#_?.disconnect(),this.#_=null,this.append(t.content.cloneNode(!0)),t.remove())}};customElements.define("klaviyo-form-lazy",Fe);var ze=class extends HTMLElement{constructor(){super()}connectedCallback(){["onDocumentClick","onDocumentKeydown","onDialogClick","onOpenableToggle","onMouseEnter","onMouseLeave"].forEach(t=>{this[t]=this[t].bind(this)}),this.closeOnOutsideClick=null!=this.dataset.closeOnOutsideClick,this.closeOnOutsideClickMediaQuery=this.dataset.closeOnOutsideClick?.includes("(")&&this.dataset.closeOnOutsideClick,this.closeOnEscapeKey=null!=this.dataset.closeOnEscapeKey,this.openOnHover=null!=this.dataset.openOnHover&&window.matchMedia("(hover: hover) and (pointer: fine)").matches,this.openableEl=this.querySelector("[data-openable]"),this.autofocusEl=this.querySelector("[autofocus]"),this.closeOnOutsideClickMediaQuery&&(window.matchMedia(this.closeOnOutsideClickMediaQuery).matches||(this.closeOnOutsideClick=!1)),this.openableEl&&(this.closeOnOutsideClick&&("DIALOG"==this.openableEl.tagName?this.openableEl.addEventListener("click",this.onDialogClick):(document.addEventListener("click",this.onDocumentClick),this.openableEl.addEventListener("toggle",this.onOpenableToggle))),this.closeOnEscapeKey&&document.addEventListener("keydown",this.onDocumentKeydown),this.openOnHover&&(this.addEventListener("mouseenter",this.onMouseEnter),this.addEventListener("mouseleave",this.onMouseLeave)))}disconnectedCallback(){this.openableEl&&(document.removeEventListener("click",this.onDocumentClick),document.removeEventListener("keydown",this.onDocumentKeydown),this.openableEl.removeEventListener("click",this.onDialogClick),this.openableEl.removeEventListener("toggle",this.onOpenableToggle),this.removeEventListener("mouseenter",this.onMouseEnter),this.removeEventListener("mouseleave",this.onMouseLeave),clearTimeout(this.leaveTimer),clearTimeout(this.closingTimer))}onMouseEnter(){clearTimeout(this.leaveTimer),this.open()}onMouseLeave(){clearTimeout(this.leaveTimer),this.leaveTimer=setTimeout(()=>this.close(),150)}open(){this.openableEl&&("DIALOG"==this.openableEl.tagName?this.openableEl.open||this.openableEl.showModal():(clearTimeout(this.closingTimer),this.openableEl.classList.remove("closing"),this.openableEl.open=!0))}onDocumentClick(t){this.openableEl.open&&!this.openableEl.contains(t.target)&&this.close()}onDocumentKeydown(t){this.openableEl.open&&"Escape"==t.key&&this.close()}onDialogClick(t){if(0===t.detail)return;if(t.target.closest("[data-dont-close-dialog]"))return;if(this.openableEl.querySelector("dialog[open]"))return;let e=this.openableEl.getBoundingClientRect();
1e.top<=t.clientY&&t.clientY<=e.top+e.height&&e.left<=t.clientX&&t.clientX<=e.left+e.width||this.close()}onOpenableToggle(){this.openableEl.open&&this.autofocus()}autofocus(){this.autofocusEl&&this.autofocusEl.focus()}close(){if("DIALOG"==this.openableEl.tagName)this.openableEl.close();else{const t=parseInt(this.dataset.closeDelayMs,10);t>0&&this.openableEl.open?(this.openableEl.classList.add("closing"),clearTimeout(this.closingTimer),this.closingTimer=setTimeout(()=>{this.openableEl.classList.remove("closing"),this.openableEl.open=!1},t)):this.openableEl.open=!1}}};customElements.define("openable-component",ze);var _e="data-ajax-pagination",Pe="shopify-section-",Re=!1,je=class t extends HTMLElement{constructor(){super();const t=this.querySelector("a");t.setAttribute("role","button"),t.addEventListener("click",this.clickHandler.bind(this))}clickHandler(e){if(e.preventDefault(),Re)return;const i=this.getAttribute("data-pagination-link-mode")||"replace",s=new URL(e.target.href,window.location.origin),n=t.getSections();e.target.removeAttribute("href"),"prepend"!==i&&window.history.pushState(Object.fromEntries(s.searchParams),"",s.href),s.search=s.search+`§ions=${n.join(",")}`,t.fetchSections(s,i)}static getSections(){const t=[];return document.querySelectorAll(`[${_e}]`).forEach(e=>{const i=e.closest(`[id^="${Pe}"]`);if(!i)throw"Pagination item must be inside a section";const s=i.id.replace(Pe,"");t.includes(s)||t.push(s)}),t}static fetchSections(e,i){t.toggleLoading(!0),fetch(e).then(t=>t.json()).then(e=>{let s="";for(let t in e)s+=e[t];t.renderPage(s,i),window.yotpoWidgetsContainer?.initWidgets?.()}).finally(()=>{t.toggleLoading(!1)})}static renderPage(t,e="replace"){const i=(new DOMParser).parseFromString(t,"text/html");document.querySelectorAll(`[${_e}]`).forEach(t=>{const s=t.getAttribute(_e);if(!s)return;const n=i.querySelector(`[${_e}="${s}"]`);n&&("append"===e&&"load_more"===s||"prepend"===e&&"load_prev"===s||"replace"===e?t.innerHTML=n.innerHTML:"content"===s&&t.insertAdjacentHTML("append"===e?"beforeEnd":"afterBegin",n.innerHTML))})}static toggleLoading(t){Re=t;const e="data-ajax-pagination-loading";document.querySelectorAll(`[${e}]`).forEach(i=>{const s=i.getAttribute(e);s&&(t?i.classList.add(s):i.classList.remove(s))})}};customElements.define("pagination-link",je);var Be=class extends HTMLElement{#Ai;#Li;#ki;#qi=null;connectedCallback(){this.#Ai=this.querySelector("[data-predictive-search-input]"),this.#Li=this.querySelector("[data-predictive-search-results]"),this.#ki=this.querySelector("[data-predictive-search-status]"),this.#Ai&&this.#Li&&this.#Ai.addEventListener("input",a(()=>this.#xi(),300))}#xi(){const t=this.#Ai.value.trim();if(!t)return this.#qi?.abort(),void(this.#Li.innerHTML="");this.#Ti(t)}async#Ti(t){this.#qi?.abort(),this.#qi=new AbortController;const e=new URL(window.routes.predictive_search_url,window.location.origin);e.searchParams.set("q",t),e.searchParams.set("resources[limit]","10"),e.searchParams.set("resources[options][fields]","title,product_type,variants.title,vendor,tag,body"),e.searchParams.set("section_id","sapi-predictive-search");try{const t=await fetch(e,{signal:this.#qi.signal});if(!t.ok)return;const i=await t.text(),s=(new DOMParser).parseFromString(i,"text/html"),n=s.querySelector("#shopify-section-sapi-predictive-search");n&&(this.#Li.innerHTML=n.innerHTML);const r=s.querySelector("[data-predictive-search-live-region-count-value]");r&&this.#ki&&(this.#ki.textContent=r.textContent)}catch(i){if("AbortError"===i.name)return}}};customElements.define("predictive-search",Be);var Ne=class extends HTMLElement{connectedCallback(){this._rangeMax=parseFloat(this.dataset.rangeMax)||100,this._minInput=this.querySelector('[data-price-range-input="min"]'),this._maxInput=this.querySelector('[data-price-range-input="max"]'),this._minHandle=this.querySelector('[data-price-range-handle="min"]'),this._maxHandle=this.querySelector('[data-price-range-handle="max"]'),this._fill=this.querySelector("[data-price-range-fill]"),this._minHandle.addEventListener("input",()=>
1{const t=parseFloat(this._minHandle.value),e=parseFloat(this._maxHandle.value);t>e&&(this._minHandle.value=e),this._minInput.value=this._minHandle.value,this._updateFill()}),this._maxHandle.addEventListener("input",()=>{const t=parseFloat(this._minHandle.value);parseFloat(this._maxHandle.value)<t&&(this._maxHandle.value=t),this._maxInput.value=this._maxHandle.value,this._updateFill()}),this._minHandle.addEventListener("change",()=>{this._minInput.dispatchEvent(new Event("change",{bubbles:!0}))}),this._maxHandle.addEventListener("change",()=>{this._maxInput.dispatchEvent(new Event("change",{bubbles:!0}))});const t=a(()=>{const t=parseFloat(this._minInput.value)||0,e=parseFloat(this._maxInput.value)||this._rangeMax;this._minHandle.value=Math.min(t,e),this._maxHandle.value=Math.max(t,e),this._updateFill()},300);this._minInput.addEventListener("input",t),this._maxInput.addEventListener("input",t),this._updateFill()}_updateFill(){const t=parseFloat(this._minHandle.value)||0,e=parseFloat(this._maxHandle.value)||this._rangeMax,i=t/this._rangeMax*100,s=e/this._rangeMax*100;this._fill.style.left=i+"%",this._fill.style.width=s-i+"%"}};customElements.define("price-range-slider",Ne);var Ve="data-product-fetcher-state",Ue="data-product-fetcher-area",Xe="sapi-id",Ye="update-url",We="preserve-options",Ge="disable-view-transition",Ke="data-product-fetcher-option-group",Ze="section",Je="data-product-color-option",Qe="data-product-color-link",ti=class extends HTMLElement{#$i=null;#we=window.VegaX.createHTMLFetcher({useViewTransition:!this.hasAttribute(Ge)});#Mi=new Map;constructor(){super(),this.addEventListener("product-option:change",this.#Di.bind(this)),this.addEventListener("product-option:hover",this.#Hi.bind(this))}connectedCallback(){this.#C(),this.#Ii(),this.#Oi()}get#Fi(){return[...new Set(r(this,"product-option[position]").map(t=>t.getAttribute("position")).filter(t=>t))]}get variantId(){return this.#$i?.variant?.id??null}get variantPrice(){const t=this.#$i?.variant?.price;return"number"==typeof t?t:null}get variantCompareAtPrice(){const t=this.#$i?.variant?.compare_at_price;return"number"==typeof t?t:null}get variantOnSale(){return Boolean(this.#$i?.variant?.sale)}get variantAvailable(){return Boolean(this.#$i?.variant?.available)}get publicData(){const t=this.#$i?.product;return t&&null!=t.handle?{handle:t.handle,title:t.title??null,type:t.type??null,image:t.image||null,collectionLabel:t.collection_label??null,url:t.url??null}:null}get variantFinalSale(){return Boolean(this.#$i?.variant?.final_sale)}get picksComplete(){return this.#Fi.every(t=>this.#Mi.has(t))}get isComplete(){return!!this.picksComplete&&Boolean(this.variantAvailable&&this.variantId)}#Ii(){this.#Mi.clear(),r(this,"product-option[position]").forEach(t=>{const e=t.getAttribute("position");if(!e)return;const i=t.querySelector("input[type='radio']:checked[data-product-option-value-id], option:checked[data-product-option-value-id]")?.getAttribute("data-product-option-value-id");i&&this.#Mi.set(e,i)})}#zi(){r(this,"product-option[position]").forEach(t=>{const e=t.getAttribute("position");if(!e)return;const i=this.#Mi.get(e);i?t.applySelection?.(String(i)):t.clearSelection?.()})}#_i(){const t=document.activeElement;if(!(t instanceof Element)||t===document.body)return null;const e=t.closest("product-option[position]");return e&&o(this,e)?{position:e.getAttribute("position")||"",valueId:t.getAttribute("data-product-option-value-id")}:null}#Pi(t){const e=document.activeElement;if(e&&e!==document.body&&e!==document.documentElement)return;const i=r(this,`product-option[position="${CSS.escape(t.position)}"]`)[0];if(!i)return;let s=null;t.valueId&&(s=i.querySelector(`input[type='radio'][data-product-option-value-id="${CSS.escape(t.valueId)}"]`)),s=s||i.querySelector("input[type='radio']:checked, select"),s?.focus({preventScroll:!0})}#Ri(t=null){return[...(t?new Map([...this.#Mi,...t]):this.#Mi).entries()].sort(([t],[e])=>Number(t)-Number(e)).map(([,t])=>t).join(",")}#ji(){const t=this.picksComplete&&!this.variantId,e=this.picksComplete&&Boolean(this.variantId)&&!this.variantAvailable;
1r(this,"[data-product-fetcher-unavailable]").forEach(e=>{e.hidden=!t}),r(this,"[data-product-fetcher-bis]").forEach(t=>{t.hidden=!e}),r(this,"[data-product-fetcher-atc]").forEach(i=>{i.hidden=e||t});const i=r(this,"button[name='add']"),s=r(this,"input[name='id']");if(0===i.length&&0===s.length)return;const n=this.isComplete;i.forEach(t=>{t.disabled=!n}),s.forEach(t=>{t.disabled=!n});const o=i[0]?.closest("ajax-cart-product-form")||i[0]?.closest("form")||this;n?o.removeAttribute("selection-incomplete"):o.setAttribute("selection-incomplete","")}#Oi(){this.#ji(),this.#Bi(),this.dispatchEvent(new CustomEvent("product-fetcher:state-change",{bubbles:!0,detail:{isComplete:this.isComplete,picksComplete:this.picksComplete,variantId:this.variantId,variantPrice:this.variantPrice,variantAvailable:this.variantAvailable,picks:new Map(this.#Mi)}}))}#Bi(){const t=r(this,`product-option[${Je}]`)[0];if(!t)return;const e=t?.selectedValue?.id;r(this,`a[${Qe}]`).forEach(t=>{const i=t.getAttribute("href");if(!i)return;const s=new URL(i,window.location.origin);e?s.searchParams.set("option_values",e):s.searchParams.delete("option_values"),t.setAttribute("href",`${s.pathname}${s.search}${s.hash}`)})}#C(){const t=this.querySelector(`[${Ve}]`);if(!t||t.closest("product-fetcher")!==this)throw new Error("The state attribute is not found.");this.#$i=JSON.parse(t.textContent||"{}")}#Di(t){if(!(t.target instanceof Element))return;if(!o(this,t.target))return;if(!t.target.getAttribute(Ke))return;const e=t.target.getAttribute("position"),i=t.target.selectedValue?.id;e&&i&&this.#Mi.set(e,String(i)),this.#Oi(),this.#Ni({product:t.target.selectedValue?.productUrl||null,optionValues:this.#Ri(),includeGallery:"1"===e})}#Hi(t){if(!(t.target instanceof Element))return;if(!o(this,t.target))return;if(!t.target.hoveredValue)return;if(t.target.hoveredValue.id===t.target.selectedValue?.id)return;if(!t.target.getAttribute(Ke))return;const e=t.target.hoveredValue,i=t.target.getAttribute("position"),s=i&&e.id?new Map([[i,String(e.id)]]):null,[n]=this.#Vi({product:e.productUrl||null,optionValues:this.#Ri(s)});this.#we.prefetch(n).catch(t=>{"AbortError"!==t?.name&&console.error("[product-fetcher] prefetch failed:",t)})}#Vi(t={}){if(!this.#$i)throw new Error("The state is not initialized.");const e=this.getAttribute(Ze)||n(this)[0];if(!e)throw new Error("The parent section ID is not found.");const i=t.product||this.#$i.product.url,s=new URL(i,window.location.origin);t.variant&&s.searchParams.set("variant",t.variant),t.optionValues&&s.searchParams.set("option_values",t.optionValues);const o="product-fetcher"+(this.getAttribute(Xe)?"#"+this.id:"");let a=[];if(i===this.#$i.product.url||this.hasAttribute(We)){s.searchParams.set("section_id",e);const i=r(this,`[${Ve}],[${Ue}]`),n=i.filter(t=>t.matches(`[${Ve}]`)),l=i.filter(t=>t.matches(`[${Ue}="variant"]`)),c=i.filter(t=>t.matches(`[${Ue}="badges"]`));if(a=[{target:n,source:`${o} [${Ve}]`},{target:l,source:`${o} [${Ue}="variant"]`},{target:c,source:`${o} [${Ue}="badges"]`}],!1!==t.includeGallery){const t=i.filter(t=>t.matches(`[${Ue}="gallery"]`));a.push({target:t,source:`${o} [${Ue}="gallery"]`})}}else this.hasAttribute(Ye),s.searchParams.set("section_id",e),a=[{target:this,source:o}];return[s,a]}async#Ni(t={}){const[e,i]=this.#Vi(t),s=this.#_i();try{await this.#we.fetch(e,i),this.isConnected?(this.#C(),this.#zi(),this.#Oi(),s&&this.#Pi(s),this.hasAttribute(Ye)&&this.updateMeta()):document.querySelector(`product-fetcher[${Ye}]`)?.updateMeta(),(this.isConnected?this:document).dispatchEvent(new CustomEvent("product-fetcher:rendered",{bubbles:!0}))}catch(n){if("AbortError"!==n.name)throw n}}updateMeta(){this.#Ui(),this.#Xi()}#Ui(){if(!this.#$i)throw new Error("The state is not initialized.");if(!this.#$i.page_title)return;const t=document.querySelector("head title");t&&(t.innerHTML=this.#$i.page_title)}#Xi(){if(!this.#$i)throw new Error("The state is not initialized.");const t=this.picksComplete&&this.#$i.variant?`?variant=${this.#$i.variant.id}`:"";window.history.replaceState({},"",`${this.#$i.product.url}${t}`)}};customElements.define("product-fetcher",ti);var ei=class extends HTMLElement{#Yi=null;#Wi=null;#Gi=null;#Ki=null;#Zi=null;#Ji=null;#Qi=null;#ts=null;#es=!1;#is=!1;connectedCallback(){this.#ss()}disconnectedCallback(){this.#ns()}async#ss(){if(await customElements.whenDefined("tarot-carousel"),!this.isConnected)return;const t=this.getAttribute("source-selector");this.#Yi=this.#rs(t),this.#Qi=this.querySelector("[data-product-zoom-dialog]"),this.#ts=this.querySelector("[data-product-zoom-carousel]"),this.#Yi&&this.#Qi&&this.#ts&&this.#os()}#ns(){this.#Yi?.isConnected&&this.#Wi&&this.#Yi.off("slides:click",this.#Wi),this.#ts?.isConnected&&this.#Ki&&this.#ts.off("render-index:changed",this.#Ki),this.#ts?.isConnected&&this.#Zi&&this.#ts.off("movement:completed",this.#Zi),this.#Gi&&this.removeEventListener("image-zoom:zoomend",this.#Gi),this.#Qi&&this.#Ji&&this.#Qi.removeEventListener("close",this.#Ji),this.#Yi=null,this.#Qi=null,this.#ts=null,this.#Wi=null,this.#Gi=null,this.#Ki=null,this.#Zi=null,this.#Ji=null,this.#es=!1,this.#is=!1}#rs(t){if(t){const e=this.parentElement?.querySelector(t);return e||document.querySelector(t)}return this.parentElement?.querySelector("tarot-carousel:not([data-product-zoom-carousel])")||document.querySelector("tarot-carousel:not([data-product-zoom-carousel])")}#os(){this.#Wi=this.#as.bind(this),this.#Yi.on("slides:click",this.#Wi),this.#Gi=this.#ls.bind(this),this.addEventListener("image-zoom:zoomend",this.#Gi),this.#Ki=this.#cs.bind(this),this.#ts.on("render-index:changed",this.#Ki),this.#Zi=this.#hs.bind(this),this.#ts.on("movement:completed",this.#Zi),this.#Ji=this.#ds.bind(this),this.#Qi.addEventListener("close",this.#Ji)}#as(){const t=this.#Yi.index??0,e=this.#Yi.querySelectorAll("tarot-slide")[t]?.dataset.productGalleryItem;if(!e)return;const i=this.#ts.querySelectorAll("tarot-slide");let s=-1;for(let n=0;n<i.length;n++)if(i[n].dataset.productGalleryItem===e){s=n;break}s<0||("function"==typeof this.#ts.jumpToSlide&&this.#ts.jumpToSlide(s),this.#us(),this.#Qi.showModal())}#ls(t){if(this.#es)return;const e=t.detail.scale>1.001;"function"==typeof this.#ts.updateOptions&&this.#ts.updateOptions({draggable:!e})}#cs({previousIndex:t}){if(null!=t){const e=this.#ts.querySelectorAll("tarot-slide")[t]?.querySelector("image-zoom");if(e){this.#es=!0;try{e.reset({animate:!1})}finally{this.#es=!1}}}this.#is=!0}#hs(){if(!this.#is)return;this.#is=!1;const t=(this.#ts.querySelectorAll("tarot-slide")[this.#ts.index??0]?.querySelector("image-zoom"))?.scale>1.001;"function"==typeof this.#ts.updateOptions&&this.#ts.updateOptions({draggable:!t})}#us(){this.querySelectorAll("[data-product-zoom-carousel] image-zoom").forEach(t=>{"function"==typeof t.prepareForFit&&t.prepareForFit()})}#ds(){this.querySelectorAll("[data-product-zoom-carousel] image-zoom").forEach(t=>{t.reset({animate:!1}),"function"==typeof t.prepareForFit&&t.prepareForFit()}),"function"==typeof this.#ts.updateOptions&&this.#ts.updateOptions({draggable:!0})}};customElements.define("product-zoom-gallery",ei);var ii=class extends HTMLElement{#ms=null;#ps=null;#gs=null;#fs=null;#vs=null;#bs=null;connectedCallback(){this.#ms=this.querySelector("tarot-carousel"),this.#ms&&this.#ss()}async#ss(){await customElements.whenDefined("tarot-carousel"),this.#ys(),this.#Es(),this.#ps=this.#ws.bind(this),this.#ms.on("render-index:changed",this.#ps),this.#Cs(0)}disconnectedCallback(){this.#ms?.isConnected&&this.#ps&&this.#ms.off("render-index:changed",this.#ps),this.#fs&&(this.#fs.disconnect(),this.#fs=null),this.#vs&&this.#bs&&this.#vs.removeEventListener("scroll",this.#bs)}
1#ys(){this.querySelectorAll("[data-product-gallery-thumbnail]").forEach(t=>{t.addEventListener("click",()=>{const e=parseInt(t.getAttribute("data-product-gallery-thumbnail"),10);this.#ms.goToSlide(e)})})}#ws({currentIndex:t,previousIndex:e}){this.#Ss(t),this.#As(e),this.#Cs(t)}#Ss(t){const e=this.querySelectorAll("[data-product-gallery-thumbnail]");let i=null;e.forEach(e=>{const s=parseInt(e.getAttribute("data-product-gallery-thumbnail"),10)===t;e.setAttribute("aria-current",s?"true":"false"),s&&(i=e)}),this.#Ls(i)}#Ls(t){const e=this.#vs;if(!e||!t)return;const i=Math.max(0,e.scrollHeight-e.clientHeight);if(i<=0)return;const s=e.getBoundingClientRect(),n=t.getBoundingClientRect(),r=n.top-s.top+e.scrollTop+n.height/2,o=Math.max(0,Math.min(r-e.clientHeight/2,i));Math.abs(e.scrollTop-o)<1||e.scrollTo({top:o,behavior:"smooth"})}#Es(){const t=this.querySelector("[data-product-gallery-thumbnails]")?.parentElement,e=this.querySelector("[data-product-gallery-thumbnails-scroll]");if(t&&(this.#vs=t,e)){e.addEventListener("click",()=>{t.scrollBy({top:.8*t.clientHeight,behavior:"smooth"})});const i=()=>{const i=t.scrollHeight>t.clientHeight+1,s=t.scrollTop+t.clientHeight>=t.scrollHeight-1;e.toggleAttribute("data-show",i&&!s)};i(),this.#bs=i,t.addEventListener("scroll",i,{passive:!0}),this.#fs=new ResizeObserver(i),this.#fs.observe(t)}}#ks(t){return this.#ms.querySelectorAll("tarot-slide")[t]||null}#Cs(t){const e=this.#ks(t);if(!e)return;const i=e.querySelector("deferred-media");if(!i)return;const s=i.querySelector("[data-deferred-media-button]");s&&!i.querySelector("video, iframe")&&s.click(),this.#gs=requestAnimationFrame(()=>{this.#gs=null;const t=i.querySelector("video");if(t)return void this.#qs(t);const e=i.querySelector("iframe");if(e){const t=e.src||"";t.includes("youtube.com")||t.includes("youtube-nocookie.com")?e.contentWindow?.postMessage(JSON.stringify({event:"command",func:"playVideo"}),"*"):t.includes("vimeo.com")&&e.contentWindow?.postMessage(JSON.stringify({method:"play"}),"*")}})}#qs(t){t.muted=!0,t.loop=!0,t.playsInline=!0,t.play().catch(()=>{})}#As(t){if(null==t)return;this.#gs&&(cancelAnimationFrame(this.#gs),this.#gs=null);const e=this.#ks(t);if(!e)return;const i=e.querySelector("video");i&&i.pause();const s=e.querySelector("iframe");if(s){const t=s.src||"";t.includes("youtube.com")||t.includes("youtube-nocookie.com")?s.contentWindow?.postMessage(JSON.stringify({event:"command",func:"pauseVideo"}),"*"):t.includes("vimeo.com")&&s.contentWindow?.postMessage(JSON.stringify({method:"pause"}),"*")}}};customElements.define("product-gallery",ii);var si="data-product-option-label",ni="data-product-option-value-id",ri="value",oi="data-product-option-display-value",ai="data-product-option-url",li=class extends HTMLElement{#xs=null;#Ts=null;#$s="";constructor(){super(),this.addEventListener("change",this.#Ms.bind(this)),this.addEventListener("mousemove",this.#Ds.bind(this)),this.addEventListener("mouseleave",this.#Hs.bind(this))}connectedCallback(){const t=this.querySelector(`[${si}]`);this.#$s=t?.textContent??"",this.selectedValue&&this.#Is()}get selectedValue(){const t=this.querySelector("option:checked, input:checked");return t?{id:t.getAttribute(ni)||"",name:t.getAttribute(ri)||"",displayName:t.getAttribute(oi)||"",productUrl:t.getAttribute(ai)||""}:null}applySelection(t){const e=CSS.escape(String(t)),i=this.querySelector(`input[type='radio'][${ni}="${e}"]`),s=this.querySelector(`option[${ni}="${e}"]`);if(i)i.checked||(i.checked=!0);else{if(!s)return!1;{s.selected=!0;const t=s.closest("select");t&&(t.value=s.value)}}return this.#Is(),!0}clearSelection(){this.querySelectorAll("input[type='radio']:checked").forEach(t=>{t.checked=!1}),this.querySelectorAll("select").forEach(t=>{const e=t.querySelector("option[value='']");e?(e.selected=!0,t.value=""):t.selectedIndex=-1});const t=this.querySelectorAll(`[${si}]`);if(0===t.length)return;t.forEach(t=>{t.textContent=""});(Array.from(t).find(t=>!t.closest("[data-swatch-group-label]"))||t[0]).textContent=this.#$s}get hoveredValue(){return this.#Ts?{id:this.#Ts.getAttribute(ni)||"",name:this.#Ts.getAttribute(ri)||"",dis
1playName:this.#Ts.getAttribute(oi)||"",productUrl:this.#Ts.getAttribute(ai)||""}:null}#Is(){const t=this.querySelectorAll(`[${si}]`);if(0===t.length)return;const e=this.#Ts?.getAttribute(oi)||this.selectedValue?.displayName||this.#$s;if(1===t.length)return void(t[0].textContent=e);const i=(this.#Ts||this.querySelector("input:checked"))?.closest("[data-swatch-group]")?.dataset.swatchGroup,s=Array.from(t).find(t=>!t.closest("[data-swatch-group-label]"));if(t.forEach(t=>{t.textContent=""}),!i||"-1"===i)return void(s&&(s.textContent=e));const n=this.querySelector(`[data-swatch-group-label="${CSS.escape(i)}"] [${si}]`);n&&(n.textContent=e)}#Ms(){this.#Is(),this.dispatchEvent(new CustomEvent("product-option:change",{detail:this.selectedValue,bubbles:!0}))}#Ds(t){this.#Os(t)}#Hs(){this.#Os(null)}#Os(t=null){if(this.#xs&&clearInterval(this.#xs),!t)return this.#Ts=null,void this.#Is();this.#xs=setInterval(()=>{let e=null;const i=t.target instanceof Element&&t.target?.closest("label");i&&(e=i.querySelector(`input[${oi}]`)),e!==this.#Ts&&(this.#Ts=e,this.#Is(),this.dispatchEvent(new CustomEvent("product-option:hover",{detail:this.hoveredValue,bubbles:!0})))},15)}};customElements.get("product-option")||customElements.define("product-option",li);var ci=class extends HTMLElement{connectedCallback(){this.#Fs()}get#zs(){return this.querySelector(":scope > product-fetcher")}get isComplete(){return Boolean(this.#zs?.isComplete)}get picksComplete(){return Boolean(this.#zs?.picksComplete)}get variantId(){return this.#zs?.variantId??null}get variantPrice(){const t=this.#zs?.variantPrice;return"number"==typeof t?t:null}get variantCompareAtPrice(){const t=this.#zs?.variantCompareAtPrice;return"number"==typeof t?t:null}get variantOnSale(){return Boolean(this.#zs?.variantOnSale)}get variantAvailable(){return Boolean(this.#zs?.variantAvailable)}get variantFinalSale(){return Boolean(this.#zs?.variantFinalSale)}#Fs(){const t=this.querySelector("[data-product-set-item-panel]");if(!t)return;const e=t.querySelector(":scope > summary"),i=this.querySelectorAll("[data-product-set-item-toggle]");if(!e||0===i.length)return;for(const n of i)n.addEventListener("click",()=>e.click());const s=()=>{const e=t.open?"true":"false";for(const t of i)t.setAttribute("aria-expanded",e)};s(),t.addEventListener("toggle",s)}};customElements.get("product-set-item")||customElements.define("product-set-item",ci);var hi="data-product-set-atc",di="data-product-set-price-fresh",ui="data-product-set-price-complete",mi="data-product-set-sale-badge",pi=class extends HTMLElement{#_s=null;#Ps=null;#Rs=null;#js=null;connectedCallback(){this.#_s=this.querySelector(`[${hi}]`),this.#Ps=this.querySelector(`[${di}]`),this.#Rs=this.querySelector(`[${ui}]`),this.#js=this.querySelector(`[${mi}]`),this.addEventListener("product-fetcher:state-change",this.#Bs.bind(this)),this.#_s?.addEventListener("click",this.#Ns.bind(this)),this.#Bs()}#tt(){return Array.from(this.querySelectorAll("product-set-item"))}#Bs(){const t=this.#tt();if(0===t.length)return;const e=t.every(t=>t.picksComplete),i=t.every(t=>t.isComplete),s=t.every(t=>"string"==typeof t.variantId&&t.variantId),n=e&&s;if(this.#_s&&(this.#_s.disabled=!i),this.#Ps&&(this.#Ps.hidden=n),this.#Rs&&(this.#Rs.hidden=!n,n)){const e=t.reduce((t,e)=>t+(e.variantPrice||0),0),i=t.reduce((t,e)=>t+(e.variantCompareAtPrice??e.variantPrice??0),0);this.#Rs.innerHTML=i>e?`<s class="text-grey-dark">${c(i)}</s> <span class="font-medium fs-body-lg">${c(e)}</span>`:`<span class="font-medium fs-body-lg">${c(e)}</span>`}this.#js&&(this.#js.hidden=!(n&&t.some(t=>t.variantOnSale)))}#Ns(t){if(t.preventDefault(),!this.#_s||this.#_s.disabled)return;if(!window.liquidAjaxCart)return void console.error("[product-set-group] liquid-ajax-cart not loaded.");const e=this.#tt(),i=e.map(t=>t.variantId);if(i.some(t=>!t))return void console.error("[product-set-group] Tried to add to cart with incomplete state.",i);const s=Math.random().toString(36).slice(2,9).padEnd(7,"0"),n=this.getAttribute("set-id")||"",r=this.getAttribute("set-title")||"",o=this.getAttribute("set-handle")||"",a=n?{_ProductID_set:n}:{},l=e.map((t,e)=>({id:t.variantId,quantity:1,properties:{_group_id:s,_group_role:0===e?"parent":"child",_sort_order:String(e+1),...a,...0===e?{_cart_template:"set",_set_title:r,_set_handle:o}:{},...t.variantFinalSale?{_final_sale:"true"}:{}}}));this.#_s.setAttribute("processing",""),window.liquidAjaxCart.add({items:l},{lastCallback:()=>this.#_s?.removeAttribute("processing")})}};customElements.get("product-set-group")||customElements.define("product-set-group",pi);var gi=class extends HTMLElement{#Vs=null;connectedCallback(){this.addEventListener("click",this.#Us.bind(this)),this.addEventListener("change",this.#B.bind(this))}get#Xs(){return h(this.getAttribute("line-keys"))}#Us(t){if(t.target.closest("[data-set-remove]"))return t.preventDefault(),void this.#Ys(0);const e=t.target.closest("[data-set-quantity-minus]"),i=t.target.closest("[data-set-quantity-plus]");if(!e&&!i)return;t.preventDefault();const s=this.querySelector("[data-set-quantity-input]");if(!s)return;const n=parseInt(s.value,10)||0,r=Math.max(0,n+(i?1:-1));s.value=String(r),this.#Ys(r)}#B(t){const e=t.target.closest("[data-set-quantity-input]");if(!e)return;const i=Math.max(0,parseInt(e.value,10)||0);e.value=String(i),this.#Ys(i)}#Ys(t){this.#Vs&&clearTimeout(this.#Vs),this.#Vs=setTimeout(()=>this.#Ws(t),300)}#Ws(t){d(this.#Xs,t)}};customElements.get("set-cart-item")||customElements.define("set-cart-item",gi);
1var fi=/^[A-Za-z0-9 !/'&.,\-]*$/,vi="data-embroidery-line-dirty",bi="[data-embroidery-config]",yi="[data-embroidery-open]",Ei="[data-embroidery-panel]",wi="[data-embroidery-status]",Ci="[data-embroidery-price]",Si="[data-embroidery-price-starting]",Ai="[data-embroidery-price-starting-value]",Li="[data-embroidery-price-applied]",ki="[data-embroidery-tab]",qi="[data-embroidery-tab-label]",xi="[data-embroidery-position-value]",Ti="[data-embroidery-line-count-value]",$i="[data-embroidery-color-value]",Mi="[data-embroidery-font-value]",Di="[data-embroidery-summary-icon]",Hi="[data-embroidery-editor]",Ii="[data-embroidery-summary]",Oi="[data-embroidery-summary-details]",Fi="[data-embroidery-line-count-input]",zi="[data-embroidery-line-field]",_i="[data-embroidery-line-input]",Pi="[data-embroidery-line-count-display]",Ri="[data-embroidery-line-error]",ji="[data-embroidery-color-input]",Bi="[data-embroidery-font-input]",Ni="[data-embroidery-dropdown]",Vi="[data-embroidery-dropdown-trigger]",Ui="[data-embroidery-dropdown-list]",Xi="[data-embroidery-dropdown-option]",Yi="[data-embroidery-dropdown-label]",Wi="[data-embroidery-apply]",Gi="[data-embroidery-cancel]",Ki="[data-embroidery-edit]",Zi="[data-embroidery-remove]",Ji="[data-embroidery-quantity-host]",Qi='button[type="submit"][name="add"]',ts=class extends HTMLElement{#se=null;#Gs="closed";#Ks="";#Zs=new Map;#Js=!1;#qi=null;connectedCallback(){this.#qi?.abort(),this.#qi=new AbortController;const{signal:t}=this.#qi,e=this.#Qs();this.#se=this.#tn(),this.#Ks=this.#en(),this.addEventListener("click",this.#Us,{signal:t}),this.addEventListener("change",this.#B,{signal:t}),this.addEventListener("input",this.#xi,{signal:t}),this.addEventListener("keydown",this.#in,{signal:t}),document.addEventListener("click",this.#sn,{signal:t}),e?.addEventListener("click",this.#nn,{capture:!0,signal:t}),e?.addEventListener("product-fetcher:state-change",this.#rn,{signal:t}),this.#on(),this.#an()}disconnectedCallback(){this.#qi?.abort(),this.#qi=null}#Us=t=>{if(!(t.target instanceof Element))return;if(this.#ln(t))return;const e=[[yi,()=>this.#cn()],[Wi,()=>this.#hn()],[Gi,()=>this.#dn()],[Ki,()=>this.#un()],[Zi,()=>this.#mn()]];for(const[i,s]of e)if(t.target.closest(i))return t.preventDefault(),void s()};#sn=t=>{t.target instanceof Element&&!this.contains(t.target)&&this.#pn()};#in=t=>{if(!(t.target instanceof Element))return;if("Escape"===t.key){const e=this.#gn();if(!(e instanceof HTMLElement))return;return t.preventDefault(),void this.#fn(e,{focusTrigger:!0})}const e=t.target.closest(Xi);if(e instanceof HTMLElement)return void this.#vn(t,e);const i=t.target.closest(Vi);i instanceof HTMLElement&&this.#bn(t,i)};#B=t=>{const e=t.target;e instanceof HTMLElement&&(e.matches(ki)&&e instanceof HTMLInputElement?this.#yn(e.value):e.matches(Fi)&&(this.#on(),this.#En(),this.#wn(),this.#Cn()))};#xi=t=>{t.target instanceof HTMLElement&&t.target.matches(_i)&&(t.target.setAttribute(vi,""),this.#Sn(),this.#En())};#cn(){this.#Zs.clear(),this.#Js=!1,this.#Ks=this.#en(),this.#An(),this.#Ln(this.#Ks),this.#Gs="editing",this.#an(),this.#kn(this.#qn.a11yStatusOpened),this.#xn()}#Tn({announceClosed:t=!0,focusOpen:e=!0}={}){this.#Zs.clear(),this.#Js=!1,this.#Gs="closed",this.#Ks=this.#en(),this.#An(),this.#an(),t&&this.#kn(this.#qn.a11yStatusClosed),e&&this.#$n(yi)}
1#yn(t){this.#Ks=t,this.#Js=!1,this.#Zs.has(t)?this.#Mn({focusEdit:!0}):(this.#Gs="editing",this.#An(),this.#an())}#hn(){const t=this.#Dn();t&&(this.#Zs.set(this.#Ks,t),this.#Js=!1,this.#Mn({announce:this.#qn.a11yStatusApplied.replace("__POSITION__",this.#Ks),focusEdit:!0}))}#dn(){if(0===this.#Zs.size)return void this.#Tn();if(this.#Js&&this.#Zs.has(this.#Ks))return this.#Js=!1,void this.#Mn({focusEdit:!0});const t=[...this.#Zs.keys()].find(t=>t!==this.#Ks)||[...this.#Zs.keys()][0];t?(this.#Ks=t,this.#Ln(t),this.#Js=!1,this.#Mn()):this.#Tn()}#un(){const t=this.#Zs.get(this.#Ks);t&&(this.#Js=!0,this.#Gs="editing",this.#Hn(t),this.#an(),this.#kn(this.#qn.a11yStatusEditing.replace("__POSITION__",this.#Ks)),this.#$n(ji))}#mn(){const t=this.#Ks;this.#Zs.delete(this.#Ks),this.#Js=!1;const e=this.#qn.a11yStatusRemoved.replace("__POSITION__",t);if(0===this.#Zs.size)return this.#Tn({announceClosed:!1}),void this.#kn(e);const i=[...this.#Zs.keys()][0];this.#Ks=i,this.#Ln(i),this.#Mn({announce:e,focusEdit:!0})}#Mn({announce:t="",focusEdit:e=!1}={}){this.#Gs="summary",this.#an(),t&&this.#kn(t),e&&this.#$n(Ki)}#An(){const t=this.querySelector(`${Fi}[value="1"]`);t instanceof HTMLInputElement&&(t.checked=!0),this.#In(this.querySelector(ji),""),this.#In(this.querySelector(Bi),""),this.#pn(),this.#On({clearValues:!0,clearDirty:!0}),this.#on(),this.#Fn()}#Hn(t){const e=this.querySelector(`${Fi}[value="${t.lineCount}"]`);e instanceof HTMLInputElement&&(e.checked=!0),this.#In(this.querySelector(ji),t.color),this.#In(this.querySelector(Bi),t.font),this.#pn(),this.querySelectorAll(_i).forEach(e=>{if(!(e instanceof HTMLInputElement))return;const i=Number(e.getAttribute("data-embroidery-line-input"));e.value=t.lines[i-1]||"",e.removeAttribute("aria-invalid"),e.removeAttribute(vi)}),this.#zn(),this.#on(),this.#Fn()}#On({clearValues:t=!1,clearDirty:e=!1}={}){this.querySelectorAll(_i).forEach(i=>{i instanceof HTMLInputElement&&(t&&(i.value=""),i.removeAttribute("aria-invalid"),e&&i.removeAttribute(vi))}),this.#zn()}#zn(){this.querySelectorAll(Ri).forEach(t=>{t.textContent="",t.setAttribute("hidden","")})}#on(){const t=this.#_n();this.querySelectorAll(zi).forEach(e=>{const i=Number(e.getAttribute("data-embroidery-line-field"))>t;if(e.toggleAttribute("hidden",i),!i)return;const s=e.querySelector(_i);s instanceof HTMLInputElement&&(s.value="",s.removeAttribute("aria-invalid"),s.removeAttribute(vi));const n=e.querySelector(Ri);n&&(n.textContent="",n.setAttribute("hidden",""))}),this.#Sn()}#Sn(){this.querySelectorAll(_i).forEach(t=>{if(!(t instanceof HTMLInputElement))return;const e=t.value,i=t.closest(zi);if(!i)return;const s=i.querySelector(Pi),n=i.querySelector(Ri),r=this.#Pn(t,i,e);s&&(s.textContent=`${e.length}/20`,s.setAttribute("aria-label",this.#qn.a11yCharacters.replace("__COUNT__",String(e.length)).replace("__MAX__",String(20)))),r?t.setAttribute("aria-invalid","true"):t.removeAttribute("aria-invalid");const o=[s?.id,r?n?.id:null].filter(Boolean).join(" ");o?t.setAttribute("aria-describedby",o):t.removeAttribute("aria-describedby"),n&&(n.textContent=r,n.toggleAttribute("hidden",!r))})}#Pn(t,e,i){return i?i.length>=20?this.#qn.maxCharacters:fi.test(i)?"":this.#qn.invalidCharacters:!e.hasAttribute("hidden")&&t.hasAttribute(vi)?this.#qn.fieldRequired:""}#_n(){const t=this.querySelector(`${Fi}:checked`);return Number(t instanceof HTMLInputElement?t.value:1)||1}#Dn(){const t=this.#Ks;if(!t)return null;const e=this.#_n(),i=this.querySelector(ji),s=this.querySelector(Bi),n=this.#Rn(i),r=this.#Rn(s);if(!n||!r)return null;const o=[];for(let l=1;l<=e;l+=1){const t=this.querySelector(`[data-embroidery-line-input="${l}"]`),e=t instanceof HTMLInputElement?t.value.trim():"";if(!e||e.length>20||!fi.test(e))return null;o.push(e)}const a=this.#jn(t,e);return a?{lineCount:e,color:n,colorCode:this.#Bn(i,n,"data-color-code"),font:r,lines:o,price:Number(a.price)||0,variantId:Number(a.id)}:null}#jn(t,e){const i=this.#se?.monogramProduct?.variants;if(!Array.isArray(i))return null;const s=t.toLowerCase();return i.find(t=>{const i=String(t.option1||"").toLowerCase(),n=String(t.option2||"").toLowerCase();return i.includes(s)&&n.includes(String(e))})||null}#En(){const t=this.querySelector(Wi);t instanceof HTMLButtonElement&&(t.disabled=!this.#Dn())}#ln(t){const e=t.target.closest(Xi);if(e instanceof HTMLElement){t.preventDefault();const i=e.closest(Ni);return!(i instanceof HTMLElement)||(this.#Nn(i,e),!0)}const i=t.target.closest(Vi);if(!(i instanceof HTMLElement))return!1;t.preventDefault();
1const s=i.closest(Ni);return s instanceof HTMLElement&&this.#Vn(s),!0}#bn(t,e){const i=e.closest(Ni);i instanceof HTMLElement&&("ArrowDown"!==t.key&&"ArrowUp"!==t.key||(t.preventDefault(),"true"!==e.getAttribute("aria-expanded")?this.#Un(i):this.#Xn(i,"ArrowUp"===t.key?"last":"first")))}#vn(t,e){const i=e.closest(Ni);if(!(i instanceof HTMLElement))return;const s=this.#Yn(i),n=s.indexOf(e);switch(t.key){case"ArrowDown":t.preventDefault(),this.#Wn(s[Math.min(n+1,s.length-1)]);break;case"ArrowUp":t.preventDefault(),this.#Wn(s[Math.max(n-1,0)]);break;case"Enter":case" ":t.preventDefault(),this.#Nn(i,e);break;case"Tab":this.#fn(i)}}#Nn(t,e){this.#In(t,e.getAttribute("data-value")||""),this.#fn(t,{focusTrigger:!0}),this.#Fn(),this.#En()}#Rn(t){return t instanceof HTMLElement&&t.getAttribute("data-value")||""}#In(t,e){if(!(t instanceof HTMLElement))return;const i=e||"";t.setAttribute("data-value",i);const s=t.querySelector(Yi);s&&(s.textContent=i||t.getAttribute("data-placeholder")||""),t.querySelectorAll(Xi).forEach(t=>{if(!(t instanceof HTMLElement))return;const e=Boolean(i)&&t.getAttribute("data-value")===i;t.setAttribute("aria-selected",String(e))})}#Bn(t,e,i){if(!(t instanceof HTMLElement&&e))return"";const s=t.querySelector(`${Xi}[data-value="${CSS.escape(e)}"]`);return s instanceof HTMLElement&&s.getAttribute(i)||""}#Yn(t){return[...t.querySelectorAll(Xi)].filter(t=>t instanceof HTMLElement)}#gn(){return[...this.querySelectorAll(Ni)].find(t=>t instanceof HTMLElement&&"true"===t.querySelector(Vi)?.getAttribute("aria-expanded"))||null}#Wn(t){t instanceof HTMLElement&&(t.focus(),t.scrollIntoView({block:"nearest"}))}#Xn(t,e="selected"){const i=this.#Yn(t);if(!i.length)return;let s=i[0];if("last"===e)s=i[i.length-1];else if("selected"===e){const e=this.#Rn(t);s=i.find(t=>t.getAttribute("data-value")===e)||i[0]}this.#Wn(s)}#Vn(t){"true"===t.querySelector(Vi)?.getAttribute("aria-expanded")?this.#fn(t,{focusTrigger:!0}):this.#Un(t)}#Un(t){this.#pn(t);const e=t.querySelector(Vi),i=t.querySelector(Ui);e instanceof HTMLElement&&i instanceof HTMLElement&&(e.setAttribute("aria-expanded","true"),i.hidden=!1,this.#Xn(t,"selected"))}#fn(t,{focusTrigger:e=!1}={}){const i=t.querySelector(Vi),s=t.querySelector(Ui);i instanceof HTMLElement&&i.setAttribute("aria-expanded","false"),s instanceof HTMLElement&&(s.hidden=!0),e&&i instanceof HTMLElement&&i.focus()}#pn(t=null){this.querySelectorAll(Ni).forEach(e=>{e instanceof HTMLElement&&e!==t&&this.#fn(e)})}#an(){const t="closed"!==this.#Gs,e=this.querySelector(yi),i=this.querySelector(Ei);e?.toggleAttribute("hidden",t),e?.setAttribute("aria-expanded",String(t)),i?.toggleAttribute("hidden",!t),this.querySelector(Hi)?.toggleAttribute("hidden","editing"!==this.#Gs),this.querySelector(Ii)?.toggleAttribute("hidden","summary"!==this.#Gs),t?(this.#Ln(this.#Ks),this.#Gn(),this.#Cn(),this.#wn(),this.#Fn(),"editing"===this.#Gs?this.#En():this.#pn(),"summary"===this.#Gs&&this.#Kn(),this.#rn()):this.#rn()}#Ln(t){this.querySelectorAll(ki).forEach(e=>{e instanceof HTMLInputElement&&(e.checked=e.value===t)})}#Gn(){const t=this.#Zs.size>0;this.querySelectorAll(ki).forEach(e=>{if(!(e instanceof HTMLInputElement))return;const i=e.closest("label")?.querySelector(qi);if(!i)return;if(i.classList.remove("text-brand-blue","underline","text-grey-dark","text-grey-medium"),!t)return void(i.textContent="");const s=this.#Zs.has(e.value),n=e.checked;if(s&&n)return i.textContent=this.#qn.summary,void i.classList.add("text-grey-dark");i.textContent=s?this.#qn.viewEmbroidery:this.#qn.addEmbroidery,i.classList.add("text-brand-blue")})}#Zn(){const t=this.#jn(this.#Ks,this.#_n());return Number(t?.price)||0}#Cn(){const t=this.querySelector(Ci);if(!t)return;const e=t.querySelector(Si),i=t.querySelector(Ai),s=t.querySelector(Li);let n=0;for(const[r,o]of this.#Zs)"editing"===this.#Gs&&r===this.#Ks||(n+=o.price);if("editing"===this.#Gs&&(n+=this.#Zn()),n>0)return t.dataset.state="applied",s&&(s.textContent=this.#qn.priceApplied.replace("__PRICE__",c(n)),s.hidden=!1),void e?.setAttribute("hidden","");t.dataset.state="starting",i&&(i.textContent=this.#qn.startingAtPrice.replace("__PRICE__",c(this.#se?.monogramProduct?.priceMin||
10))),e?.removeAttribute("hidden"),s&&(s.hidden=!0)}#wn(){const t=this.querySelector(xi);t&&(t.textContent=this.#Ks);const e=this.querySelector(Ti);if(!e||"editing"!==this.#Gs)return;const i=this.#_n();e.textContent=1===i?this.#qn.lineCountOne:this.#qn.lineCountOther.replace("__COUNT__",String(i))}#Fn(){const t=this.#Rn(this.querySelector(ji)),e=this.#Rn(this.querySelector(Bi)),i=this.querySelector($i),s=this.querySelector(Mi);i&&(i.textContent=t||this.#qn.pleaseSelect),s&&(s.textContent=e||this.#qn.pleaseSelect)}#Kn(){const t=this.#Zs.get(this.#Ks),e=this.querySelector(Oi);t&&e&&(e.innerHTML=[[this.#qn.threadColor,t.color],[this.#qn.fontStyle,t.font],...t.lines.map((t,e)=>[this.#qn.line.replace("__NUMBER__",String(e+1)),t])].map(([t,e])=>`<div><dt class="inline">${this.#Jn(t)}:</dt> <dd class="inline">${this.#Jn(e)}</dd></div>`).join(""),this.#Qn())}#Qn(){const t=this.querySelector(Di);if(!t)return;const e=[...this.querySelectorAll(ki)].find(t=>t instanceof HTMLInputElement&&t.value===this.#Ks),i=e instanceof HTMLElement&&e.getAttribute("data-position-image")||"";i&&(t.innerHTML=`<img src="${i}" alt="" class="size-full object-contain" loading="lazy" width="160" height="160">`)}#rn=()=>{const t=this.#Qs();if(!t)return;const e="closed"!==this.#Gs;t.querySelector(Ji)?.toggleAttribute("hidden",e);const i=t.querySelector(Qi);if(!i)return;const s="closed"===this.#Gs||"summary"===this.#Gs&&this.#Zs.size>0;i.disabled=!(t.isComplete&&s)};#nn=t=>{if("closed"===this.#Gs||0===this.#Zs.size)return;const e=(t.target instanceof Element?t.target:null)?.closest(Qi);!e||e.disabled||e.closest("[selection-incomplete]")||(t.preventDefault(),t.stopPropagation(),this.#tr(e))};#tr(t){if(!window.liquidAjaxCart||0===this.#Zs.size)return;const e=this.#Qs()?.variantId;if(!e)return;const i=this.#er(),s=[{id:Number(e),quantity:1,properties:{"_Set code":i,_final_sale:"true",_cart_template:"embroidery","_embroidery.status":"true"}}];for(const[r,o]of this.#Zs){const t={"_Set code":i,_final_sale:"true"};o.lines.forEach((e,i)=>{t[`Line ${i+1}`]=e}),t["Thread Color"]=o.color,t["Font Style"]=o.font,o.colorCode&&(t["_Color code"]=o.colorCode),s.push({id:o.variantId,quantity:1,properties:t})}const n=this.#Qs()?.querySelector("ajax-cart-product-form");n?.setAttribute("processing",""),window.liquidAjaxCart.add({items:s},{lastCallback:t=>{n?.removeAttribute("processing"),t.responseData?.ok&&this.#Tn({announceClosed:!1,focusOpen:!1})}})}#Qs(){return this.closest("product-fetcher")}get#qn(){return this.#se?.strings||{}}#tn(){try{return JSON.parse(this.querySelector(bi)?.textContent||"null")}catch{return null}}#Fi(){return[...this.querySelectorAll(ki)].map(t=>t instanceof HTMLInputElement?t.value:"")}#en(){const t=this.#Fi();return t.find(t=>t.toLowerCase().includes("left"))||t[0]||""}#Jn(t){return String(t).replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""")}#kn(t){const e=this.querySelector(wi);e&&t&&(e.textContent="",requestAnimationFrame(()=>{e.textContent=t}))}#$n(t){queueMicrotask(()=>{const e=this.querySelector(t);if(!(e instanceof HTMLElement))return;const i=e.matches(Ni)?e.querySelector(Vi):e;i instanceof HTMLElement&&i.focus()})}#xn(){queueMicrotask(()=>{const t=this.querySelector(`${ki}:checked`);t instanceof HTMLElement?t.focus():this.#$n(ji)})}#er(){const t=new Set;for(const n of window.liquidAjaxCart?.cart?.items||[]){if("embroidery"!==n.properties?._cart_template)continue;const e=String(n.properties["_Set code"]||n.properties._group_id||"");/^\d{2}$/.test(e)&&t.add(e)}const e=Array.from({length:100},(t,e)=>String(e).padStart(2,"0")),i=e.filter(e=>!t.has(e)),s=i.length?i:e;return s[Math.floor(Math.random()*s.length)]}};customElements.get("embroidery-configurator")||customElements.define("embroidery-configurator",ts);var es=class extends HTMLElement{#ir=null;connectedCallback(){this.#ir?.abort(),this.#ir=new AbortController,this.addEventListener("click",this.#Us,{signal:this.#ir.signal})}disconnectedCallback(){this.#ir?.abort(),this.#ir=null}get#Xs(){return h(this.getAttribute("line-keys"))}#Us=t=>{t.target?.closest?.("[data-embroidery-remove]")&&(t.preventDefault(),d(this.#Xs,0))}};customElements.get("embroidery-cart-item")||customElements.define("embroidery-cart-item",es);var is="data-quantity-input-decrease",ss="data-quantity-input-increase",ns=class extends HTMLElement{constructor(){super(),this.changeEvent=ne
1w Event("change",{bubbles:!0})}connectedCallback(){this.input=this.querySelector("input"),this.querySelectorAll(`[${is}], [${ss}]`).forEach(t=>t.addEventListener("click",this.onButtonClick.bind(this)))}onButtonClick(t){t.preventDefault();const e=this.input.value;t.currentTarget.hasAttribute(ss)?this.input.stepUp():this.input.stepDown(),e!==this.input.value&&this.input.dispatchEvent(this.changeEvent)}};customElements.define("quantity-input",ns);var rs=document.getElementById("quick-shop-dialog"),os=rs?.closest("openable-component");if(os){rs.addEventListener("click",t=>{if(!(t.target instanceof Element))return;const e=t.target.closest("a[data-product-color-link]");if(!e||!rs.contains(e))return;const i=(e.closest("product-fetcher")?.querySelector("product-option[data-product-color-option]"))?.selectedValue?.id,s=e.getAttribute("href");if(!i||!s)return;const n=new URL(s,window.location.origin);n.searchParams.set("option_values",i),e.setAttribute("href",`${n.pathname}${n.search}${n.hash}`)}),document.addEventListener("liquid-ajax-cart:request-end",t=>{const{requestState:e}=t.detail;"add"===e.requestType&&e.responseData?.ok&&rs.open&&os.close()});const Ds=t=>{const e=rs.querySelector("[data-quick-shop-price]");if(!e)return;const i=e.querySelector("[data-quick-shop-price-fresh]"),s=e.querySelector("[data-quick-shop-price-variant]");i&&s&&(i.hidden=t,s.hidden=!t)};rs.addEventListener("product-fetcher:state-change",t=>{Ds(Boolean(t.detail?.isComplete))}),rs.addEventListener("close",()=>{Ds(!1)})}var as=class extends HTMLElement{connectedCallback(){this.hasAttribute("ready")||(this.$assets=Array.from(this.querySelectorAll("img, iframe")),this.parentClass(),this.tables(),this.setAttribute("ready",""))}parentClass(){this.$assets.forEach(t=>{if("auto"===t.style.marginLeft&&"auto"===t.style.marginRight||"center"===t.parentNode.style.textAlign||"IFRAME"===t.tagName){const e=t.nextSibling,i=document.createElement("DIV");i.classList.add("extended-container"),t.insertAdjacentElement("afterend",i),i.appendChild(t),e&&e.nodeType===Node.TEXT_NODE&&i.appendChild(e)}})}tables(){this.querySelectorAll("table").forEach(t=>{const e=document.createElement("custom-scroll");e.className="block overflow-x-auto w-full no-scrollbar",t.insertAdjacentElement("afterend",e),e.appendChild(t)})}};customElements.define("rte-content",as);var ls=class extends HTMLElement{#zs=null;connectedCallback(){this.#zs=window.VegaX.createHTMLFetcher({useViewTransition:!1}),this.addEventListener("click",this.#Us),this.addEventListener("keydown",this.#sr),this.#nr()}disconnectedCallback(){this.removeEventListener("click",this.#Us),this.removeEventListener("keydown",this.#sr)}#Us=t=>{const e=t.target.closest("[data-shop-by-color-selector]");if(!e||!this.contains(e))return;if("true"===e.getAttribute("aria-selected"))return;const i=e.dataset.collectionUrl;i&&(this.#rr(e),this.#or(i),this.#ar(i))};#sr=t=>{const e=t.target.closest("[data-shop-by-color-selector]");if(!e||!this.contains(e))return;const i=this.#lr(),s=i.indexOf(e);if(-1===s)return;let n=null;switch(t.key){case"ArrowRight":n=i[(s+1)%i.length];break;case"ArrowLeft":n=i[(s-1+i.length)%i.length];break;case"Home":n=i[0];break;case"End":n=i[i.length-1];break;default:return}t.preventDefault(),this.#cr(n)};#lr(){return Array.from(this.querySelectorAll("[data-shop-by-color-selector]"))}#nr(){this.#lr().forEach(t=>{t.setAttribute("tabindex","true"===t.getAttribute("aria-selected")?"0":"-1")})}#cr(t){this.#lr().forEach(e=>{e.setAttribute("tabindex",e===t?"0":"-1")}),t.focus()}#rr(t){this.#lr().forEach(e=>{const i=e===t;e.setAttribute("aria-selected",i?"true":"false"),e.setAttribute("tabindex",i?"0":"-1")})}#or(t){this.querySelectorAll("[data-shop-by-color-cta]").forEach(e=>{e.setAttribute("href",t)})}#ar(t){const e=this.querySelector("[data-shop-by-color-area]");if(!e)return;const i=e.querySelector("tarot-track"),s=e.querySelector("tarot-carousel");if(!i||!s)return;const n=new URL(t,window.location.origin);n.searchParams.set("section_id","shop-by-color");const r=e.dataset.shopByColorLoadingClass,o=r?[{element:e,classList:r}]:[];this.#zs.fetch(n,[{target:[i],source:"tarot-track"}],o).then(()=>{s.jumpToSlide(0),window.yotpoWidgetsContainer?.initWidgets?.()}).catch(t=>{"AbortError"!==t?.name&&console.error("[shop-by-color] fetch failed",t)})}};customElements.define("shop-by-color",ls);var cs="ajax-cart-product-form",hs="ajax-cart-product-form button[name=add]",ds="product-option",us=".group\\/ajax-cart-product-form",ms="[data-action-scroll-to-form]",ps="visible",gs="processing",fs=class extends HTMLElement{#hr=null;#dr=null;#ur=null;#mr=null;#Ce=null;#pr=null;connectedCallback(){window.matchMedia("(min-width: 1024px)").matches||(this.#hr=document.querySelector(hs),this.#dr=document.querySelector(cs),this.#ur=document.querySelector(ds)||this.#hr,this.#mr=this.querySelector(us)||this,this.#hr&&(this.#Ce=new IntersectionObserver(([t])=>{const e=t.boundingClientRect.top<0;this.toggleAttribute(ps,!t.isIntersecting&&e)},{threshold:0}),this.#Ce.observe(this.#hr)),this.#dr&&(this.#gr(),this.#pr=new MutationObserver(()=>this.#gr()),this.#pr.observe(this.#dr,{attributes:!0,attributeFilter:[gs]})),this.addEventListener("click",this.#fr.bind(this)))}disconnectedCallback(){this.#Ce?.disconnect(),this.#pr?.disconnect()}#gr(){this.#dr&&this.#mr&&this.#mr.toggleAttribute(gs,this.#dr.hasAttribute(gs))}#fr(t){t.target.closest(ms)&&(t.preventDefault(),this.#ur?.scrollIntoView({behavior:"smooth",block:"center"}))}};customElements.define("sticky-add-to-cart",fs);var vs=class extends HTMLElement{constructor(){super()}connectedCallback(){this.onResize=this.onResize.bind(this),this.sentinel=document.createElement("div"),this.sentinel.setAttribute("aria-hidden","true"),this.sentinel.style.cssText="height:0;margin:0;padding:0;pointer-events:none;",this.parentNode.insertBefore(this.sentinel,this),this.resizeTimer=null,this.observe(),window.addEventListener("resize",this.onResize,{passive:!0})}disconnectedCallback(){window.removeEventListener("resize",this.onResize),clearTimeout(this.resizeTimer),this.observer?.disconnect(),this.sentinel?.remove()}observe(){this.observer?.disconnect();const t=parseFloat(getComputedStyle(this).top)||0;this.observer=new IntersectionObserver(([e])=>{const i=0===e.intersectionRatio&&e.boundingClientRect.top<t;this.toggleAttribute("stuck",i)},{rootMargin:`-${t}px 0px 0px 0px`,threshold:0}),this.observer.observe(this.sentinel)}onResize(){clearTimeout(this.resizeTimer),this.resizeTimer=setTimeout(()=>this.observe(),30)}};if(customElements.define("sticky-content",vs),!customElements.get("video-player")){class Hs extends HTMLElement{#vr=null;#br=0;#yr=null;
1connectedCallback(){this.overlay=this.querySelector("[data-video-overlay]"),this.video=this.querySelector("video"),this.overlay&&this.video&&this.overlay.addEventListener("click",()=>this.#Er(),{once:!0})}disconnectedCallback(){this.#wr()}#Er(){this.#Cr(),this.#Sr(),this.overlay.style.opacity="0",this.overlay.style.pointerEvents="none"}#Cr(){const t=parseInt(this.getAttribute("breakpoint")||"1024"),e=this.getAttribute("desktop-src"),i=this.getAttribute("mobile-src"),s=window.innerWidth>=t?e||i:i||e;s&&s!==this.#vr&&(this.#vr=s,this.video.src=s,this.video.play())}#Sr(){this.#yr||(this.#yr=()=>{this.#br||(this.#br=requestAnimationFrame(()=>{this.#br=0,this.#Cr()}))},window.addEventListener("resize",this.#yr,{passive:!0}))}#wr(){this.#yr&&window.removeEventListener("resize",this.#yr),this.#br&&(cancelAnimationFrame(this.#br),this.#br=0),this.#yr=null}}customElements.define("video-player",Hs)}var bs="yotpo-widget-instance",ys=new Set,Es=null,ws=null,Cs=0;function Ss(){if(Es=null,0!==ys.size){for(const t of ys)t.classList.add(bs);ys.clear(),function(){if(ws)return;const t=()=>"function"==typeof window.yotpoWidgetsContainer?.initWidgets?(ws=null,Cs=0,void window.yotpoWidgetsContainer.initWidgets()):(Cs+=1)>40?(ws=null,void(Cs=0)):void(ws=setTimeout(()=>{ws=null,t()},250));t()}()}}var As=class extends HTMLElement{#_=null;#Ci=!1;#Ar(){return this.querySelector(":scope > [data-yotpo-instance-id]")}connectedCallback(){if(this.#Ci||this.hasAttribute("data-yotpo-activated"))return void(this.#Ci=!0);const t=this.#Ar();return t?t.classList.contains(bs)||t.querySelector(".yotpo-reviews-star-ratings-widget")?(this.#Ci=!0,void this.setAttribute("data-yotpo-activated","")):void("function"==typeof IntersectionObserver?(this.#_=new IntersectionObserver(t=>{t.some(t=>t.isIntersecting)&&this.#Si()},{rootMargin:"200px 0px",threshold:0}),this.#_.observe(this)):this.#Si()):void 0}disconnectedCallback(){this.#_?.disconnect(),this.#_=null;const t=this.#Ar();t&&ys.delete(t)}#Si(){if(this.#Ci)return;this.#Ci=!0,this.setAttribute("data-yotpo-activated",""),this.#_?.disconnect(),this.#_=null;const t=this.#Ar();t&&(ys.add(t),null==Es&&(Es=requestAnimationFrame(Ss)))}};customElements.get("yotpo-stars")||customElements.define("yotpo-stars",As);var Ls="yotpo-widget-instance",ks=new Set,qs=class extends HTMLElement{#_=null;#Ci=!1;#Ar(){return this.querySelector(":scope > [data-yotpo-instance-id]")}connectedCallback(){if(this.#Ci||this.hasAttribute("data-yotpo-activated"))return void(this.#Ci=!0);const t=this.#Ar();return t?t.classList.contains(Ls)||t.childElementCount>0?(this.#Ci=!0,void this.setAttribute("data-yotpo-activated","")):void("function"==typeof IntersectionObserver?(this.#_=new IntersectionObserver(t=>{t.some(t=>t.isIntersecting)&&this.#Si()},{rootMargin:"200px 0px",threshold:0}),this.#_.observe(this)):this.#Si()):void 0}disconnectedCallback(){this.#_?.disconnect(),this.#_=null}async#Si(){if(this.#Ci)return;this.#Ci=!0,this.setAttribute("data-yotpo-activated",""),this.#_?.disconnect(),this.#_=null;const t=this.#Ar();if(!t)return;t.classList.add(Ls);const e=this.getAttribute("loader-src");e&&await this.#Lr(e),this.#kr()}#Lr(t){return ks.has(t)?Promise.resolve():document.querySelector(`script[src="${t}"]`)?(ks.add(t),Promise.resolve()):new Promise((e,i)=>{const s=document.createElement("script");s.src=t,s.async=!0,s.onload=()=>{ks.add(t),e()},s.onerror=()=>i(new Error(`[yotpo-lazy-widget] failed to load ${t}`)),document.head.appendChild(s)}).catch(t=>{console.error(t)})}#kr(t=0){"function"!=typeof window.yotpoWidgetsContainer?.initWidgets?t>40||setTimeout(()=>this.#kr(t+1),250):window.yotpoWidgetsContainer.initWidgets()}};customElements.get("yotpo-lazy-widget")||customElements.define("yotpo-lazy-widget",qs),document.addEventListener("click",t=>{const e=t.target.closest("[data-vegax-command], [data-vegax-commandfor]");if(!e)return;const i=e.getAttribute("data-vegax-command"),s=e.getAttribute("data-vegax-commandfor"),n=document.getElementById(s);switch(i){case"show-modal":n.showModal();break;case"close":n.close();break;default:throw new Error(`Unknown command: ${i}`)}t.preventDefault()});function xs(){if("#cart"!==window.location.hash)return;const t=document.getElementById("cart-dialog");t&&(history.replaceState(null,"",window.location.pathname+window.location.search),t.open||t.showModal())}"loading"===document.readyState?document.addEventListener("DOMContentLoaded",xs):xs(),window.addEventListener("hashchange",xs);
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.