var bt=l=>{throw TypeError(l)};var ot=(l,t,e)=>t.has(l)||bt("Cannot "+e);var n=(l,t,e)=>(ot(l,t,"read from private field"),e?e.call(l):t.get(l)),d=(l,t,e)=>t.has(l)?bt("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(l):t.set(l,e),g=(l,t,e,r)=>(ot(l,t,"write to private field"),r?r.call(l,e):t.set(l,e),e),i=(l,t,e)=>(ot(l,t,"access private method"),e);class H{constructor(t={}){this.storageKey=t.storageKey||"fc_utm_data",this.expirationDays=t.expirationDays||30,this.utmKeys=t.utmKeys||H.getUtmParams(),this.internalDomains=t.internalDomains||H.getInternalDomains(),this.collectFromURL()}collectFromURL(){const t=this.getURLParams();if(t.refer_url&&(t.refer_url=this.normalizeReferUrl(t.refer_url)),!t.refer_url&&document.referrer)try{const e=new URL(document.referrer).hostname;e!==window.location.hostname&&!this.isInternalHost(e)&&(t.refer_url=this.normalizeReferUrl(document.referrer))}catch{}Object.keys(t).length>0&&this.store(t)}normalizeReferUrl(t){const e=String(t||"").trim();if(!e)return"";const r=/^[a-z][a-z0-9+.-]*:\/\//i.test(e)?e:"https://"+e.replace(/^\/+/,"");try{return new URL(r).hostname.toLowerCase().replace(/^www\./,"")}catch{return e}}isInternalHost(t){const e=(t||"").toLowerCase();return this.internalDomains.some(r=>{const a=String(r).toLowerCase().replace(/^www\./,"");return e===a||e==="www."+a||e.endsWith("."+a)})}getURLParams(){const t=new URLSearchParams(window.location.search),e={};return this.utmKeys.forEach(r=>{const a=t.get(r);a&&(e[r]=a)}),e}store(t){const e=this.getStoredData(),r=Date.now(),o={params:{...e.params,...t},timestamp:r};try{localStorage.setItem(this.storageKey,JSON.stringify(o))}catch{}}getStoredData(){try{const t=localStorage.getItem(this.storageKey);if(t){let e=JSON.parse(t);if(e&&e.timestamp)return e}}catch{}return{params:{},timestamp:null}}get(){return this.getStoredData().params||{}}clear(){try{localStorage.removeItem(this.storageKey)}catch{}}static getUtmParams(){return window.fluentcart_utm_vars.allowed_keys||["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"]}static getInternalDomains(){return window.fluentcart_utm_vars&&window.fluentcart_utm_vars.internal_domains||[]}}var _t,St,I,L,v,G,Y,j,R,Z,A,U,tt,W,it,c,At,lt,Tt,ut,M,qt,kt,Pt,xt,D,Dt,Ut,Ot,Mt,B;const p=class p{constructor(){d(this,c);d(this,v,[]);d(this,G,"?action=fluent_cart_checkout_routes&fc_checkout_action=fluent_cart_cart_status");d(this,Y,"?action=fluent_cart_checkout_routes&fc_checkout_action=fluent_cart_cart_update");d(this,j,window.fluentCartRestVars.ajaxurl);d(this,R,!1);d(this,Z,(_t=window.fluentcart_drawer_vars)==null?void 0:_t.is_admin_bar_showing);d(this,A,"open");d(this,U,"active");d(this,tt,((St=window.fluentcart_drawer_vars)==null?void 0:St.is_drawer_hidden)=="1")}init(){return n(p,I)!==null?n(p,I):(g(p,I,this),i(this,c,Mt).call(this),n(this,tt)||i(this,c,Ot).call(this),i(this,c,Ut).call(this),i(this,c,qt).call(this),i(this,c,kt).call(this),i(this,c,Pt).call(this),i(this,c,xt).call(this),i(this,c,At).call(this),this)}broadcastCartCleared(){p.broadcastCartUpdate([],null)}static broadcastCartUpdate(t,e){var a;if(!n(p,L))return;const r=i(a=p,W,it).call(a);!t||t.length===0?n(p,L).postMessage({_token:r,type:"cart_cleared"}):n(p,L).postMessage({_token:r,type:"cart_updated",cart_data:t,fragments:e||[]})}async getCart(){let t=await new Promise((e,r)=>{fetch(n(this,j)+n(this,G),{method:"GET",headers:{"Content-Type":"application/json"}}).then(a=>{if(!a.ok)throw new Error(`HTTP error! status: ${a.status}`);return a.json()}).then(a=>{a&&a.cart_data?e(a.cart_data):e([])}).catch(a=>{r([])})});return g(this,v,t),window.dispatchEvent(new Event("fluentCartNotifyCartDrawerItemChanged")),t}async addProduct(t,e=1,r=!1,a=!1,o=!1){return i(this,c,M).call(this,t,e,r,a,o)}async removeProduct(t,e=!1){return t=t.toString(),await i(this,c,M).call(this,t,0,!1,e)}async incrementProduct(t,e=1){const r=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");return r&&r.classList.contains("active")&&g(this,R,!0),t=t.toString(),e=Math.abs(parseInt(e.toString())),await i(this,c,M).call(this,t,e)}async decrementProduct(t,e=1){const r=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");return r&&r.classList.contains("active")&&g(this,R,!0),t=t.toString(),e=Math.abs(parseInt(e.toString())),await i(this,c,M).call(this,t,e*-1)}async updateProductQuantity(t,e=1,r=!1){return e=parseInt(e.toString(),10),(isNaN(e)||e<1)&&(e=1),t=t.toString(),await i(this,c,M).call(this,t,e,r)}closeModal(){const t=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),e=document.querySelector("[data-fluent-cart-cart-drawer]"),r=document.body;t&&t.classList.remove(n(this,U)),e&&e.classList.remove(n(this,A)),r.style.overflow=""}openModal(){const t=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),e=document.querySelector("[data-fluent-cart-cart-drawer]"),r=document.body;t&&t.classList.add(n(this,U)),e&&e.classList.add(n(this,A)),r.style.overflow="hidden"}appendUtmSource(t){const e=new URLSearchParams(window.location.search);return H.getUtmParams().forEach(r=>{e.has(r)&&(t[r]=e.get(r))}),t}getState(){return n(this,v)}updateCartTotalPrice(t=[]){var s,u;let e=0;const r=((u=(s=window.fluentcart_drawer_vars)==null?void 0:s.currency_settings)==null?void 0:u.currency_sign)||"$";t.forEach(f=>{f.subtotal&&(e+=f.subtotal)});const a=String(parseFloat((e/100).toFixed(2))),o=`${r}${a}`;return document.querySelectorAll("[data-fluent-cart-cart-total-price]").forEach(f=>{f.textContent=o}),o}};I=new WeakMap,L=new WeakMap,v=new WeakMap,G=new WeakMap,Y=new WeakMap,j=new WeakMap,R=new WeakMap,Z=new WeakMap,A=new WeakMap,U=new WeakMap,tt=new WeakMap,W=new WeakSet,it=function(){const t="fc_bc_token";let e=localStorage.getItem(t);return e||(e=typeof crypto<"u"&&crypto.randomUUID?crypto.randomUUID():Math.random().toString(36).slice(2),localStorage.setItem(t,e)),e},c=new WeakSet,At=function(){var e;if(typeof BroadcastChannel>"u"||n(p,L))return;const t=((e=window.fluentCartRestVars)==null?void 0:e.ajaxurl)||window.location.origin;g(p,L,new BroadcastChannel("fluent_cart_cart:"+t)),n(p,L).onmessage=r=>{var a;r.data&&r.data.type&&r.data._token===i(a=p,W,it).call(a)&&i(this,c,Tt).call(this,r.data)}},lt=function(t){return{distinctCount:t.length,totalQty:t.reduce((e,r)=>e+(r.quantity||1),0)}},Tt=function(t){if(t.type==="cart_updated"&&Array.isArray(t.fragments)){const e=Array.isArray(t.cart_data)?t.cart_data:[],{distinctCount:r,totalQty:a}=i(this,c,lt).call(this,e);window.fluentcart_drawer_vars&&(window.fluentcart_drawer_vars.cart_item_count=r,window.fluentcart_drawer_vars.cart_total_quantity=a),this.updateCartTotalPrice(e),i(this,c,B).call(this,r,a),document.querySelectorAll(".fct-cart-badge-count").forEach(u=>{u.textContent=r.toString()});const o=document.querySelector("[data-fluent-cart-cart-drawer]"),s=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");o&&(o.style.transition="none"),s&&(s.style.transition="none"),i(this,c,ut).call(this,t.fragments,!0),requestAnimationFrame(()=>{const u=document.querySelector("[data-fluent-cart-cart-drawer]"),f=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");u&&(u.style.transition=""),f&&(f.style.transition="")}),document.querySelectorAll("[data-fluent-cart-cart-total-item]").forEach(u=>{u.textContent=r.toString()}),g(this,v,e),i(this,c,D).call(this)}t.type==="cart_cleared"&&(g(this,v,[]),window.fluentcart_drawer_vars&&(window.fluentcart_drawer_vars.cart_item_count=0,window.fluentcart_drawer_vars.cart_total_quantity=0),i(this,c,B).call(this,0,0),document.querySelectorAll(".fct-cart-badge-count").forEach(e=>{e.textContent="0"}),this.updateCartTotalPrice([]),i(this,c,D).call(this))},ut=function(t,e=!1){const r="[data-fluent-cart-cart-drawer-container]";t.forEach(a=>{const o=document.querySelector(a.selector);if(a.selector===r){o?!e&&a.type==="replace"&&(o.outerHTML=a.content):(document.body.insertAdjacentHTML("beforeend",a.content),e&&this.closeModal());return}o&&a.type==="replace"&&(a.content?o.outerHTML=a.content:o.remove())})},M=async function(t=null,e=1,r=!1,a=!1,o=!1){if(t==null)return;const s=document.querySelector("[data-fluent-cart-cart-drawer]");let u="";s&&(u=s.querySelector("[data-fluent-cart-cart-drawer-loader]"),u&&u.classList.add("show"));const f=this;let _={item_id:t,quantity:e,is_custom:o};r&&(_.by_input=!0),(n(this,R)||a||r)&&(_.open_cart=!0),_.is_admin_bar_enabled=n(this,Z),_=this.appendUtmSource(_);let h=null,x=!1,w=await new Promise((C,ft)=>{const ht=new URL(n(this,j)+n(this,Y));Object.entries(_).forEach(([z,J])=>{ht.searchParams.append(z,J)});const E=new XMLHttpRequest;E.open("GET",ht.toString(),!0),E.setRequestHeader("Content-Type","application/json"),E.setRequestHeader("X-WP-Nonce",window.fluentCartRestVars.rest.nonce),E.onreadystatechange=function(){var z,J,mt,wt,yt,gt,pt;if(E.readyState===XMLHttpRequest.DONE)try{if(E.status>=200&&E.status<300){const y=JSON.parse(E.responseText),st=(J=(z=y.data)==null?void 0:z.cart)==null?void 0:J.cart_data;if(Array.isArray(st)){const{distinctCount:Q,totalQty:N}=i(mt=f,c,lt).call(mt,st);window.fluentcart_drawer_vars.cart_item_count=Q,window.fluentcart_drawer_vars.cart_total_quantity=N,i(wt=f,c,B).call(wt,Q,N),f.updateCartTotalPrice(st)}if(y!=null&&y.fragments){const Q=Array.isArray(y.fragments)?y.fragments:[y.fragments];h=Array.isArray(y.fragments)?y.fragments:null,i(yt=f,c,ut).call(yt,Q);const N=document.querySelector("[data-fluent-cart-cart-drawer]");N&&N.classList.contains(n(f,A))&&f.openModal()}(pt=(gt=y==null?void 0:y.data)==null?void 0:gt.cart)!=null&&pt.cart_data?(x=!0,C(y.data.cart.cart_data)):(y.message&&new Toastify({text:y.message,className:"warning",duration:3e3,gravity:"top",position:"right",slideFrom:"right",type:"warning"}).showToast(),C([])),u&&u.classList.remove("show")}else{const y=E.responseText&&JSON.parse(E.responseText).message||"An error occurred";new Toastify({text:y,className:"info",duration:2e3,style:{background:"#eabe11"}}).showToast(),u&&u.classList.remove("show"),ft(new Error(y))}}catch(y){y.message&&new Toastify({text:y.message,className:"info",duration:2e3,style:{background:"#eabe11"}}).showToast(),u&&u.classList.remove("show"),ft(y)}},E.send()});return w.length,g(this,v,w),x&&p.broadcastCartUpdate(w,h),new URLSearchParams(window.location.search).has("fct_cart_hash")||window.dispatchEvent(new CustomEvent("fluentCartNotifyCartDrawerItemChanged",{detail:{response:w}})),w},qt=function(){const t=this;document.addEventListener("click",async function(e){var a;const r=e.target.closest("[data-fluent-cart-cart-list-item-delete-button]");if(r){const o=r.dataset.itemId,s=await t.removeProduct(o,!0);s!=null&&(g(t,v,s),i(a=t,c,D).call(a))}})},kt=function(){const t=this;document.addEventListener("click",async function(e){var a;const r=e.target.closest("[data-fluent-cart-cart-list-item-increase-button]");if(r){const o=r.dataset.itemId,s=await t.incrementProduct(o);s!=null&&(g(t,v,s),i(a=t,c,D).call(a))}})},Pt=function(){const t=this;document.addEventListener("click",async function(e){var a;const r=e.target.closest("[data-fluent-cart-cart-list-item-decrease-button]");if(r){const o=r.dataset.itemId,s=await t.decrementProduct(o);s!=null&&(g(t,v,s),i(a=t,c,D).call(a))}})},xt=function(){const t=this;document.addEventListener("change",async function(e){var a;const r=e.target.closest("[data-fluent-cart-cart-list-item-quantity-input]");if(r){const o=r.dataset.itemId;let s=parseInt(event.target.value,10);parseInt(event.target.dataset.oldValue||"0",10),s<1&&(s=1);let u=s;const f=await t.updateProductQuantity(o,u,!0);f!=null&&(g(t,v,f),i(a=t,c,D).call(a))}})},D=function(){if(i(this,c,Dt).call(this)){const t=document.querySelectorAll("[data-fluent-cart-cart-total-item]"),e=document.querySelectorAll("[data-fluent-cart-checkout-page-cart-item-count]"),r=document.querySelectorAll("[data-fluent-cart-cart-total-wrapper]"),a=document.querySelectorAll("[data-fluent-cart-cart-expand-button]"),o=document.querySelectorAll("[data-fluent-cart-cart-checkout-button-wrap]");t&&t.forEach(s=>s.textContent="0"),e&&e.forEach(s=>s.textContent="0"),r&&r.forEach(s=>s.style.display="none"),o&&o.forEach(s=>s.style.display="none"),a&&a.forEach(s=>s.classList.add("is-hidden")),setTimeout(()=>{this.closeModal()},300)}},Dt=function(){return n(this,v)===void 0||n(this,v)==null||Object.keys(n(this,v)).length===0},Ut=function(){const t=this;document.addEventListener("click",function(e){const r=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");r&&r.contains(e.target)&&t.closeModal()})},Ot=function(){const t=this,e=document.body;document.addEventListener("click",r=>{document.querySelector("[data-fluent-cart-cart-drawer-container]");const a=document.querySelector("[data-fluent-cart-cart-drawer]"),o=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),s=r.target.closest("[data-fluent-cart-cart-toggle-button]"),u=r.target.closest("[data-fluent-cart-cart-expand-button], .fcart-cart-toggle-button"),f=r.target.closest("[data-fluent-cart-cart-collapse-button]");if(s){a&&a.classList.toggle(n(t,A));return}if(u){a&&(a.classList.add(n(t,A)),e.style.overflow="hidden"),o&&o.classList.add(n(t,U));return}if(f){a&&a.classList.remove(n(t,A)),o&&o.classList.remove(n(t,U)),e.style.overflow="";return}})},Mt=function(){var e,r;i(this,c,B).call(this,((e=window.fluentcart_drawer_vars)==null?void 0:e.cart_item_count)||0,((r=window.fluentcart_drawer_vars)==null?void 0:r.cart_total_quantity)||0);const t=document.querySelector(".fluent-cart-menu-cart-open-button-container");if(t){const a=t.closest("li"),o=a==null?void 0:a.previousElementSibling;if(o&&a){const s=o.cloneNode(!0);s.removeAttribute("id"),s.innerHTML="",s.appendChild(t.cloneNode(!0)),a.parentNode.replaceChild(s,a)}}},B=function(t,e){document.querySelectorAll("[data-cart-badge-count]").forEach(r=>{const a=r.dataset.cartCountMode||"distinct_products";r.textContent=(a==="total_quantity"?e:t).toString()})},d(p,W),d(p,I,null),d(p,L,null);let ct=p;class Vt{static init(){document.addEventListener("click",function(t){var f;const e=t.target.closest("[data-fluent-cart-add-to-cart-button]");if(!e||(t.preventDefault(),e.classList.contains("fct-loading")))return;e.classList.add("fct-loading");const r=e.getAttribute("data-cart-id");if(!r)return;let a=parseInt(e.getAttribute("data-quantity"),10)||1;const o=e.getAttribute("data-action-name"),s=e.getAttribute("data-error-action-name");e.setAttribute("data-quantity","1");const u=e.getAttribute("data-is-custom");(f=window.fluentCartCart)==null||f.addProduct(r,a,!1,!0,u).then(_=>{setTimeout(()=>{e.classList.remove("fct-loading")},300),document.dispatchEvent(new Event(o))}).catch(_=>{e.classList.remove("fct-loading"),document.dispatchEvent(new Event(s))})})}}var O,q,b,S,k,et,K,P,m,It,Rt,Nt,Bt,X,Ht,rt,F,at,$,nt,jt,Wt,Kt,Ft;const T=class T{constructor(){d(this,m);d(this,q,null);d(this,b,null);d(this,S,null);d(this,k,null);d(this,et,300);d(this,K,null);d(this,P,null);d(this,rt,()=>{i(this,m,Kt).call(this),n(this,F).call(this),n(this,at).call(this)});d(this,F,()=>{try{const t=n(this,b).contentDocument||n(this,b).contentWindow.document,e=t.querySelector("[data-fct-modal-checkout-form-inner]");let r=t.body.scrollHeight;if(e)for(const o of e.children)r=Math.max(r,o.scrollHeight);r+=20;const a=r+"px";n(this,b).style.height!==a&&(n(this,b).style.height=a)}catch{}});d(this,at,()=>{n(this,$).call(this);try{const t=n(this,b).contentDocument||n(this,b).contentWindow.document;let e=null;g(this,P,new MutationObserver(()=>{e||(e=requestAnimationFrame(()=>{e=null,n(this,F).call(this)}))})),n(this,P).observe(t.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]})}catch{}});d(this,$,()=>{n(this,P)&&(n(this,P).disconnect(),g(this,P,null))});d(this,nt,t=>{var e;t.origin===window.location.origin&&((e=t.data)==null?void 0:e.type)==="fluentCartCheckoutComplete"&&(t.data.redirectUrl?window.location.href=t.data.redirectUrl:this.closeModal())});var t;this.translate=((t=window.fluentcart)==null?void 0:t.$t)||(e=>e),i(this,m,It).call(this),i(this,m,Rt).call(this)}static init(){return n(T,O)||g(T,O,new T),n(T,O)}openModal(t){if(n(this,q)||!n(this,S)||!n(this,b)){(!n(this,S)||!n(this,b))&&i(this,m,jt).call(this);return}g(this,q,n(this,S)),i(this,m,Wt).call(this),n(this,b).src=t,n(this,b).addEventListener("load",()=>{n(this,rt).call(this),i(this,m,Ft).call(this,n(this,b))},{once:!0}),n(this,K)||(g(this,K,!0),window.addEventListener("message",n(this,nt))),n(this,S).classList.add("fct-checkout-modal-open"),n(this,S).style.opacity="1",n(this,S).style.visibility="visible",window.dispatchEvent(new CustomEvent("fluentCartModalCheckoutOpened",{detail:{checkoutUrl:t}}))}closeModal(){n(this,q)&&(n(this,q).classList.remove("fct-checkout-modal-open"),n(this,S).style.opacity="0",n(this,S).style.visibility="hidden",setTimeout(()=>{n(this,$).call(this),n(this,b)&&(n(this,b).src=""),g(this,q,null),window.dispatchEvent(new CustomEvent("fluentCartModalCheckoutClosed"))},n(this,et)))}};O=new WeakMap,q=new WeakMap,b=new WeakMap,S=new WeakMap,k=new WeakMap,et=new WeakMap,K=new WeakMap,P=new WeakMap,m=new WeakSet,It=function(){g(this,k,document.querySelector("[data-fct-checkout-modal-loader]")),g(this,S,document.querySelector("[data-fct-checkout-modal-container]")),g(this,b,document.querySelector("[data-fct-checkout-modal-iframe]"))},Rt=function(){i(this,m,Nt).call(this),document.addEventListener("click",i(this,m,Ht).bind(this)),i(this,m,Bt).call(this)},Nt=function(){document.querySelectorAll("[data-fct-instant-checkout-button]").forEach(e=>{e.addEventListener("click",i(this,m,X).bind(this))})},Bt=function(){new MutationObserver(e=>{e.forEach(r=>{r.addedNodes.forEach(a=>{var o;a.nodeType===1&&((o=a.hasAttribute)!=null&&o.call(a,"data-fct-instant-checkout-button")&&a.addEventListener("click",i(this,m,X).bind(this)),a.querySelectorAll&&a.querySelectorAll("[data-fct-instant-checkout-button]").forEach(u=>{u.addEventListener("click",i(this,m,X).bind(this))}))})})}).observe(document.body,{childList:!0,subtree:!0})},X=function(t){t.preventDefault();const r=t.currentTarget.getAttribute("href"),a=new URL(r,window.location.origin);a.searchParams.set("fluent-cart","modal_checkout"),this.openModal(a.toString())},Ht=function(t){t.target.closest("[data-fct-checkout-modal-close]")&&(t.preventDefault(),this.closeModal())},rt=new WeakMap,F=new WeakMap,at=new WeakMap,$=new WeakMap,nt=new WeakMap,jt=function(){typeof Toastify<"u"?new Toastify({text:this.translate("Modal checkout is not available. Please try again."),className:"info",duration:3e3,style:{background:"linear-gradient(to right, rgb(255 30 30), rgb(252 133 101))",color:"#fff"}}).showToast():alert(this.translate("Modal checkout is not available. Please try again."))},Wt=function(){n(this,k)&&(n(this,k).style.display="")},Kt=function(){n(this,k)&&(n(this,k).style.display="none")},Ft=function(t){var e;try{const r=t.contentDocument||((e=t.contentWindow)==null?void 0:e.document);if(!r||!r.body)return;const a=s=>{if(s.tagName!=="A")return;const u=s.getAttribute("href")||"";u.startsWith("#")||u.startsWith("mailto:")||u.startsWith("tel:")||(s.hasAttribute("target")||(s.target="_blank"),s.rel||(s.rel="noopener noreferrer"))};r.querySelectorAll("a").forEach(a),new MutationObserver(s=>{var u,f;for(const _ of s)for(const h of _.addedNodes)h.nodeType===1&&((u=h.matches)!=null&&u.call(h,"a")&&a(h),(f=h.querySelectorAll)==null||f.call(h,"a").forEach(a))}).observe(r.body,{childList:!0,subtree:!0})}catch{}},d(T,O,null);let dt=T;var Ct,Et,Lt;const zt={...((Ct=window.fluentcart_checkout_vars)==null?void 0:Ct.trans)||{},...((Et=window.fluentcart_checkout_vars)==null?void 0:Et.payments_trans)||{},...((Lt=window.fluentcart_shop_vars)==null?void 0:Lt.trans)||{}};window.fluentcart={$t:function(l){let t=zt[l]||l;const e=Array.prototype.slice.call(arguments,1);if(e.length===0)return t;const r=/%(\d*\$?)s|%d/g;let a=0;return t=t.replace(r,(o,s)=>{if(s){const u=parseInt(s,10)-1;return u<e.length?e[u]:o}else return a<e.length?e[a++]:o}),t}};const $t=function(l,t){return Object.keys(l).reduce(function(e,r){const a=t+"["+r+"]";return l[r]!==null&&typeof l[r]=="object"&&!Array.isArray(l[r])?Object.assign(e,$t(l[r],a)):e[a]=l[r],e},{})},vt=function(l,t={},e){const r=`${window.fluentCartRestVars.ajaxurl}`,a=new AbortController,o=a.signal,s={"X-WP-Nonce":window.fluentCartRestVars.rest.nonce};["PUT","PATCH","DELETE"].indexOf(l.toUpperCase())!==-1&&(s["X-HTTP-Method-Override"]=l,l="POST"),t.query_timestamp=Date.now();const u=new Promise((f,_)=>{const h=new XMLHttpRequest;let x=r;if(l.toUpperCase()==="GET"){let w={};Object.keys(t).forEach(C=>{t[C]===null||t[C]===!1?delete t[C]:typeof t[C]=="object"?w=Object.assign(w,$t(t[C],C)):w[C]=t[C]});let V=new URLSearchParams(w).toString();x.indexOf("?")!==-1?x+="&"+V:x+="?"+V}h.open(l,x,!0),o.addEventListener("abort",()=>{h.abort(),_({aborted:!0,message:"Request aborted"})}),Object.keys(s).forEach(w=>{h.setRequestHeader(w,s[w])}),h.onload=function(){let w;try{w=JSON.parse(h.responseText)}catch{w=null}this.status>=200&&this.status<300?f(w):(w&&(typeof w=="object"&&(w.xhr_status=h.status),w.code=="rest_cookie_invalid_nonce"&&document.dispatchEvent(new CustomEvent("fcart_renew_rest_nonce",{detail:w}))),_(w))},h.onerror=function(){_({status:h.status,statusText:h.statusText})},l.toUpperCase()==="GET"?h.send():(h.setRequestHeader("Content-Type","application/json;charset=UTF-8"),h.send(JSON.stringify(t)))});return e?{request:u,controller:a}:u};document.addEventListener("DOMContentLoaded",function(){window.fluentCartCart=new ct().init(),window.fluentCartUtmManager=new H,Vt.init(),window.fluentCartAjax={get:function(l={},t=!1){return vt("GET",l,t)},post:function(l={},t=!1){return vt("POST",l,t)}},window.fluentcart.ajax=window.fluentCartAjax,dt.init(),window.dispatchEvent(new CustomEvent("fluent_cart_app_loaded",{})),document.addEventListener("click",function(l){const t=l.target.closest("[data-fluent-cart-collapsible-toggle]");if(!t)return;l.preventDefault(),t.closest("[data-fluent-cart-collapsibles]").classList.toggle("show-all")})});