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,a)=>(ot(l,t,"write to private field"),a?a.call(l,e):t.set(l,e),e),i=(l,t,e)=>(ot(l,t,"access private method"),e);class nt{constructor(t={}){this.storageKey=t.storageKey||"fc_utm_data",this.expirationDays=t.expirationDays||30,this.utmKeys=t.utmKeys||nt.getUtmParams(),this.collectFromURL()}collectFromURL(){const t=this.getURLParams();document.referrer&&new URL(document.referrer).hostname!==window.location.hostname&&(t.refer_url=document.referrer),Object.keys(t).length>0&&this.store(t)}getURLParams(){const t=new URLSearchParams(window.location.search),e={};return this.utmKeys.forEach(a=>{const r=t.get(a);r&&(e[a]=r)}),e}store(t){const e=this.getStoredData(),a=Date.now(),o={params:{...e.params,...t},timestamp:a};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"]}}var _t,St,I,L,v,G,z,H,N,Y,T,O,Z,j,it,c,Tt,lt,At,ut,D,qt,kt,Pt,xt,M,Mt,Ot,Ut,Dt,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,z,"?action=fluent_cart_checkout_routes&fc_checkout_action=fluent_cart_cart_update");d(this,H,window.fluentCartRestVars.ajaxurl);d(this,N,!1);d(this,Y,(_t=window.fluentcart_drawer_vars)==null?void 0:_t.is_admin_bar_showing);d(this,T,"open");d(this,O,"active");d(this,Z,((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,Dt).call(this),n(this,Z)||i(this,c,Ut).call(this),i(this,c,Ot).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,Tt).call(this),this)}broadcastCartCleared(){p.broadcastCartUpdate([],null)}static broadcastCartUpdate(t,e){var r;if(!n(p,L))return;const a=i(r=p,j,it).call(r);!t||t.length===0?n(p,L).postMessage({_token:a,type:"cart_cleared"}):n(p,L).postMessage({_token:a,type:"cart_updated",cart_data:t,fragments:e||[]})}async getCart(){let t=await new Promise((e,a)=>{fetch(n(this,H)+n(this,G),{method:"GET",headers:{"Content-Type":"application/json"}}).then(r=>{if(!r.ok)throw new Error(`HTTP error! status: ${r.status}`);return r.json()}).then(r=>{r&&r.cart_data?e(r.cart_data):e([])}).catch(r=>{a([])})});return g(this,v,t),window.dispatchEvent(new Event("fluentCartNotifyCartDrawerItemChanged")),t}async addProduct(t,e=1,a=!1,r=!1,o=!1){return i(this,c,D).call(this,t,e,a,r,o)}async removeProduct(t,e=!1){return t=t.toString(),await i(this,c,D).call(this,t,0,!1,e)}async incrementProduct(t,e=1){const a=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");return a&&a.classList.contains("active")&&g(this,N,!0),t=t.toString(),e=Math.abs(parseInt(e.toString())),await i(this,c,D).call(this,t,e)}async decrementProduct(t,e=1){const a=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");return a&&a.classList.contains("active")&&g(this,N,!0),t=t.toString(),e=Math.abs(parseInt(e.toString())),await i(this,c,D).call(this,t,e*-1)}async updateProductQuantity(t,e=1,a=!1){return e=parseInt(e.toString(),10),(isNaN(e)||e<1)&&(e=1),t=t.toString(),await i(this,c,D).call(this,t,e,a)}closeModal(){const t=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),e=document.querySelector("[data-fluent-cart-cart-drawer]"),a=document.body;t&&t.classList.remove(n(this,O)),e&&e.classList.remove(n(this,T)),a.style.overflow=""}openModal(){const t=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),e=document.querySelector("[data-fluent-cart-cart-drawer]"),a=document.body;t&&t.classList.add(n(this,O)),e&&e.classList.add(n(this,T)),a.style.overflow="hidden"}appendUtmSource(t){const e=new URLSearchParams(window.location.search);return nt.getUtmParams().forEach(a=>{e.has(a)&&(t[a]=e.get(a))}),t}getState(){return n(this,v)}updateCartTotalPrice(t=[]){var s,u;let e=0;const a=((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 r=String(parseFloat((e/100).toFixed(2))),o=`${a}${r}`;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,z=new WeakMap,H=new WeakMap,N=new WeakMap,Y=new WeakMap,T=new WeakMap,O=new WeakMap,Z=new WeakMap,j=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,Tt=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=a=>{var r;a.data&&a.data.type&&a.data._token===i(r=p,j,it).call(r)&&i(this,c,At).call(this,a.data)}},lt=function(t){return{distinctCount:t.length,totalQty:t.reduce((e,a)=>e+(a.quantity||1),0)}},At=function(t){if(t.type==="cart_updated"&&Array.isArray(t.fragments)){const e=Array.isArray(t.cart_data)?t.cart_data:[],{distinctCount:a,totalQty:r}=i(this,c,lt).call(this,e);window.fluentcart_drawer_vars&&(window.fluentcart_drawer_vars.cart_item_count=a,window.fluentcart_drawer_vars.cart_total_quantity=r),this.updateCartTotalPrice(e),i(this,c,B).call(this,a,r),document.querySelectorAll(".fct-cart-badge-count").forEach(u=>{u.textContent=a.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=a.toString()}),g(this,v,e),i(this,c,M).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,M).call(this))},ut=function(t,e=!1){const a="[data-fluent-cart-cart-drawer-container]";t.forEach(r=>{const o=document.querySelector(r.selector);if(r.selector===a){o?!e&&r.type==="replace"&&(o.outerHTML=r.content):(document.body.insertAdjacentHTML("beforeend",r.content),e&&this.closeModal());return}o&&r.type==="replace"&&(r.content?o.outerHTML=r.content:o.remove())})},D=async function(t=null,e=1,a=!1,r=!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};a&&(_.by_input=!0),(n(this,N)||r||a)&&(_.open_cart=!0),_.is_admin_bar_enabled=n(this,Y),_=this.appendUtmSource(_);let h=null,x=!1,w=await new Promise((C,ft)=>{const ht=new URL(n(this,H)+n(this,z));Object.entries(_).forEach(([V,J])=>{ht.searchParams.append(V,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 V,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=(V=y.data)==null?void 0:V.cart)==null?void 0:J.cart_data;if(Array.isArray(st)){const{distinctCount:Q,totalQty:R}=i(mt=f,c,lt).call(mt,st);window.fluentcart_drawer_vars.cart_item_count=Q,window.fluentcart_drawer_vars.cart_total_quantity=R,i(wt=f,c,B).call(wt,Q,R),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 R=document.querySelector("[data-fluent-cart-cart-drawer]");R&&R.classList.contains(n(f,T))&&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 r;const a=e.target.closest("[data-fluent-cart-cart-list-item-delete-button]");if(a){const o=a.dataset.itemId,s=await t.removeProduct(o,!0);s!=null&&(g(t,v,s),i(r=t,c,M).call(r))}})},kt=function(){const t=this;document.addEventListener("click",async function(e){var r;const a=e.target.closest("[data-fluent-cart-cart-list-item-increase-button]");if(a){const o=a.dataset.itemId,s=await t.incrementProduct(o);s!=null&&(g(t,v,s),i(r=t,c,M).call(r))}})},Pt=function(){const t=this;document.addEventListener("click",async function(e){var r;const a=e.target.closest("[data-fluent-cart-cart-list-item-decrease-button]");if(a){const o=a.dataset.itemId,s=await t.decrementProduct(o);s!=null&&(g(t,v,s),i(r=t,c,M).call(r))}})},xt=function(){const t=this;document.addEventListener("change",async function(e){var r;const a=e.target.closest("[data-fluent-cart-cart-list-item-quantity-input]");if(a){const o=a.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(r=t,c,M).call(r))}})},M=function(){if(i(this,c,Mt).call(this)){const t=document.querySelectorAll("[data-fluent-cart-cart-total-item]"),e=document.querySelectorAll("[data-fluent-cart-checkout-page-cart-item-count]"),a=document.querySelectorAll("[data-fluent-cart-cart-total-wrapper]"),r=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"),a&&a.forEach(s=>s.style.display="none"),o&&o.forEach(s=>s.style.display="none"),r&&r.forEach(s=>s.classList.add("is-hidden")),setTimeout(()=>{this.closeModal()},300)}},Mt=function(){return n(this,v)===void 0||n(this,v)==null||Object.keys(n(this,v)).length===0},Ot=function(){const t=this;document.addEventListener("click",function(e){const a=document.querySelector("[data-fluent-cart-cart-drawer-overlay]");a&&a.contains(e.target)&&t.closeModal()})},Ut=function(){const t=this,e=document.body;document.addEventListener("click",a=>{document.querySelector("[data-fluent-cart-cart-drawer-container]");const r=document.querySelector("[data-fluent-cart-cart-drawer]"),o=document.querySelector("[data-fluent-cart-cart-drawer-overlay]"),s=a.target.closest("[data-fluent-cart-cart-toggle-button]"),u=a.target.closest("[data-fluent-cart-cart-expand-button], .fcart-cart-toggle-button"),f=a.target.closest("[data-fluent-cart-cart-collapse-button]");if(s){r&&r.classList.toggle(n(t,T));return}if(u){r&&(r.classList.add(n(t,T)),e.style.overflow="hidden"),o&&o.classList.add(n(t,O));return}if(f){r&&r.classList.remove(n(t,T)),o&&o.classList.remove(n(t,O)),e.style.overflow="";return}})},Dt=function(){var e,a;i(this,c,B).call(this,((e=window.fluentcart_drawer_vars)==null?void 0:e.cart_item_count)||0,((a=window.fluentcart_drawer_vars)==null?void 0:a.cart_total_quantity)||0);const t=document.querySelector(".fluent-cart-menu-cart-open-button-container");if(t){const r=t.closest("li"),o=r==null?void 0:r.previousElementSibling;if(o&&r){const s=o.cloneNode(!0);s.removeAttribute("id"),s.innerHTML="",s.appendChild(t.cloneNode(!0)),r.parentNode.replaceChild(s,r)}}},B=function(t,e){document.querySelectorAll("[data-cart-badge-count]").forEach(a=>{const r=a.dataset.cartCountMode||"distinct_products";a.textContent=(r==="total_quantity"?e:t).toString()})},d(p,j),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 a=e.getAttribute("data-cart-id");if(!a)return;let r=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(a,r,!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 U,q,b,S,k,tt,K,P,m,It,Nt,Rt,Bt,X,Ht,et,W,at,F,rt,jt,Kt,Wt,Ft;const A=class A{constructor(){d(this,m);d(this,q,null);d(this,b,null);d(this,S,null);d(this,k,null);d(this,tt,300);d(this,K,null);d(this,P,null);d(this,et,()=>{i(this,m,Wt).call(this),n(this,W).call(this),n(this,at).call(this)});d(this,W,()=>{try{const t=n(this,b).contentDocument||n(this,b).contentWindow.document,e=t.querySelector("[data-fct-modal-checkout-form-inner]");let a=t.body.scrollHeight;if(e)for(const o of e.children)a=Math.max(a,o.scrollHeight);a+=20;const r=a+"px";n(this,b).style.height!==r&&(n(this,b).style.height=r)}catch{}});d(this,at,()=>{n(this,F).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,W).call(this)}))})),n(this,P).observe(t.body,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["class","style"]})}catch{}});d(this,F,()=>{n(this,P)&&(n(this,P).disconnect(),g(this,P,null))});d(this,rt,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,Nt).call(this)}static init(){return n(A,U)||g(A,U,new A),n(A,U)}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,Kt).call(this),n(this,b).src=t,n(this,b).addEventListener("load",()=>{n(this,et).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,rt))),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,F).call(this),n(this,b)&&(n(this,b).src=""),g(this,q,null),window.dispatchEvent(new CustomEvent("fluentCartModalCheckoutClosed"))},n(this,tt)))}};U=new WeakMap,q=new WeakMap,b=new WeakMap,S=new WeakMap,k=new WeakMap,tt=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]"))},Nt=function(){i(this,m,Rt).call(this),document.addEventListener("click",i(this,m,Ht).bind(this)),i(this,m,Bt).call(this)},Rt=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(a=>{a.addedNodes.forEach(r=>{var o;r.nodeType===1&&((o=r.hasAttribute)!=null&&o.call(r,"data-fct-instant-checkout-button")&&r.addEventListener("click",i(this,m,X).bind(this)),r.querySelectorAll&&r.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 a=t.currentTarget.getAttribute("href"),r=new URL(a,window.location.origin);r.searchParams.set("fluent-cart","modal_checkout"),this.openModal(r.toString())},Ht=function(t){t.target.closest("[data-fct-checkout-modal-close]")&&(t.preventDefault(),this.closeModal())},et=new WeakMap,W=new WeakMap,at=new WeakMap,F=new WeakMap,rt=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."))},Kt=function(){n(this,k)&&(n(this,k).style.display="")},Wt=function(){n(this,k)&&(n(this,k).style.display="none")},Ft=function(t){var e;try{const a=t.contentDocument||((e=t.contentWindow)==null?void 0:e.document);if(!a||!a.body)return;const r=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"))};a.querySelectorAll("a").forEach(r),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")&&r(h),(f=h.querySelectorAll)==null||f.call(h,"a").forEach(r))}).observe(a.body,{childList:!0,subtree:!0})}catch{}},d(A,U,null);let dt=A;var Ct,Et,Lt;const Jt={...((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=Jt[l]||l;const e=Array.prototype.slice.call(arguments,1);if(e.length===0)return t;const a=/%(\d*\$?)s|%d/g;let r=0;return t=t.replace(a,(o,s)=>{if(s){const u=parseInt(s,10)-1;return u<e.length?e[u]:o}else return r<e.length?e[r++]:o}),t}};const $t=function(l,t){return Object.keys(l).reduce(function(e,a){const r=t+"["+a+"]";return l[a]!==null&&typeof l[a]=="object"&&!Array.isArray(l[a])?Object.assign(e,$t(l[a],r)):e[r]=l[a],e},{})},vt=function(l,t={},e){const a=`${window.fluentCartRestVars.ajaxurl}`,r=new AbortController,o=r.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=a;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 $=new URLSearchParams(w).toString();x.indexOf("?")!==-1?x+="&"+$:x+="?"+$}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:r}:u};document.addEventListener("DOMContentLoaded",function(){window.fluentCartCart=new ct().init(),window.fluentCartUtmManager=new nt,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")})});