@letscooee/web-sdk 13.1.11 → 13.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-Z7UUW7XD.js → chunk-6XVC72KV.js} +1 -1
- package/dist/{chunk-BJ5UBWZZ.js → chunk-CAFWCDWI.js} +1 -1
- package/dist/{chunk-GIEYLCFF.js → chunk-HC6OE5XR.js} +1 -1
- package/dist/{chunk-ZFMH37WK.js → chunk-ILIYCRW5.js} +1 -1
- package/dist/{chunk-CFZOV3EF.js → chunk-KWG3YKM4.js} +1 -1
- package/dist/{chunk-MHKDPBHM.js → chunk-NOZTSVSX.js} +1 -1
- package/dist/{chunk-JAIJ74CO.js → chunk-RF2WNRIW.js} +2 -2
- package/dist/{chunk-7XDM4HDH.js → chunk-WQK746ER.js} +1 -1
- package/dist/{debugger.component-UQRQT3KM.js → debugger.component-XOR6S75S.js} +1 -1
- package/dist/main.min.js +2 -2
- package/dist/{renderer-7THALERZ.js → renderer-TBPM7OV3.js} +1 -1
- package/dist/{sdk-debug-logs-PG5BE6E3.js → sdk-debug-logs-XNSWT65Q.js} +1 -1
- package/dist/{share-dialog.component-OXWTLKYG.js → share-dialog.component-KYYLRKQ6.js} +1 -1
- package/dist/{video-detail-dialog.component-E4FB7GMC.js → video-detail-dialog.component-E3IQ3CUB.js} +1 -1
- package/dist/widget.min.js +3 -3
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as ee,b as lt,c as ue,e as dt,g as mt,h as he}from"./chunk-U4XWPFUW.js";var vt=dt((ht,ke)=>{"use strict";(function(s){if(typeof ht=="object"&&typeof ke<"u")ke.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=s()}})(function(){var s,n,h;return(function c(v,I,w){function R(T,V){if(!I[T]){if(!v[T]){var p=typeof ue=="function"&&ue;if(!V&&p)return p(T,!0);if(b)return b(T,!0);var _=new Error("Cannot find module '"+T+"'");throw _.code="MODULE_NOT_FOUND",_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w)}return I[T].exports}for(var b=typeof ue=="function"&&ue,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){"use strict";var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),V=w.document.createTextNode("");T.observe(V,{characterData:!0}),b=function(){V.data=m=++m%2}}else if(!w.setImmediate&&typeof w.MessageChannel<"u"){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0)}}else"document"in w&&"onreadystatechange"in w.document.createElement("script")?b=function(){var B=w.document.createElement("script");B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},w.document.documentElement.appendChild(B)}:b=function(){setTimeout(O,0)};var _,C=[];function O(){_=!0;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length}_=!1}v.exports=j;function j(B){C.push(B)===1&&!_&&b()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(c,v,I){"use strict";var w=c(1);function R(){}var b={},m=["REJECTED"],T=["FULFILLED"],V=["PENDING"];v.exports=p;function p(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=V,this.queue=[],this.outcome=void 0,y!==R&&j(this,y)}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!="function"&&this.state===T||typeof A!="function"&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==V){var L=this.state===T?y:A;C(D,L,this.outcome)}else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y)},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y)},_.prototype.callRejected=function(y){b.reject(this.promise,y)},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y)};function C(y,A,D){w(function(){var L;try{L=A(D)}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError("Cannot resolve promise with itself")):b.resolve(y,L)})}b.resolve=function(y,A){var D=B(O,A);if(D.status==="error")return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else{y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A)}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof A=="function")return function(){A.apply(y,arguments)}}function j(y,A){var D=!1;function L(G){D||(D=!0,b.reject(y,G))}function U(G){D||(D=!0,b.resolve(y,G))}function k(){A(U,L)}var $=B(k);$.status==="error"&&L($.value)}function B(y,A){var D={};try{D.value=y(A),D.status="success"}catch(L){D.status="error",D.value=L}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Re;function Re(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,me){A.resolve(ie).then(Ce,function(te){L||(L=!0,b.reject(G,te))});function Ce(te){U[me]=te,++k===D&&!L&&(L=!0,b.resolve(G,U))}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=!0,b.resolve(k,q))},function(q){L||(L=!0,b.reject(k,q))})}}},{1:1}],3:[function(c,v,I){(function(w){"use strict";typeof w.Promise!="function"&&(w.Promise=c(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(c,v,I){"use strict";var w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function b(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function V(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!=="TypeError")throw o;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,i=new t,a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>"u"&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function C(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function O(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",z=void 0,F={},Re=Object.prototype.toString,Z="readonly",y="readwrite";function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=V([""]);t.objectStore(B).put(i,"key"),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(!1)},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),o=navigator.userAgent.match(/Edge\//);r(o||!a||parseInt(a[1],10)>=43)}}).catch(function(){return!1})}function L(e){return typeof z=="boolean"?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function k(e){var r=F[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var t=F[e.name],i=t.deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||Ye(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B)}catch(l){if(l.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error)},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close()},t(u),k(e)}})}function q(e){return G(e,!1)}function ie(e){return G(e,!0)}function me(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function Ce(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){var o=btoa(a.target.result||"");r({__local_forage_encoded_blob:!0,data:o,type:e.type})},i.readAsBinaryString(e)})}function te(e){var r=A(atob(e.data));return V([r],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Lt(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function Ot(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null)}return e.db=null,q(e).then(function(o){return e.db=o,me(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{var a=e.db.transaction(e.storeName,r);t(null,a)}catch(o){if(i>0&&(!e.db||o.name==="InvalidStateError"||o.name==="NotFoundError"))return p.resolve().then(function(){if(!e.db||o.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return Ot(e).then(function(){K(e,r,t,i-1)})}).catch(t);t(o)}}function Ye(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Pt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=Ye(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Lt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u))}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,me(t,r._defaultConfig.version)?ie(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function Vt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=te(g)),a(g)},d.onerror=function(){o(d.error)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Mt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=te(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue()}else a()},d.onerror=function(){o(d.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function Bt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Re.call(r)==="[object Blob]"?L(f.db).then(function(l){return l?r:Ce(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l)},g.onabort=g.onerror=function(){var N=S.error?S.error:S.transaction.error;u(N)}}catch(N){u(N)}})}).catch(u)});return _(a,t),a}function Ft(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.delete(e);f.oncomplete=function(){a()},f.onerror=function(){o(d.error)},f.onabort=function(){var g=d.error?d.error:d.transaction.error;o(g)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Ut(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.clear();u.oncomplete=function(){i()},u.onabort=u.onerror=function(){var d=l.error?l.error:l.transaction.error;a(d)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.count();l.onsuccess=function(){i(l.result)},l.onerror=function(){a(l.error)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function Wt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e))},g.onerror=function(){o(g.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function $t(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue()},l.onerror=function(){a(l.error)}}catch(g){a(g)}})}).catch(a)});return _(t,e),t}function Gt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject("Invalid arguments");else{var o=e.name===t.name&&i._dbInfo.db,u=o?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l}var N=new p(function(x,M){var P=m.open(e.name,l);P.onerror=function(H){var se=P.result;se.close(),M(H)},P.onupgradeneeded=function(){var H=P.result;H.deleteObjectStore(e.storeName)},P.onsuccess=function(){var H=P.result;H.close(),x(H)}});return N.then(function(x){d.db=x;for(var M=0;M<g.length;M++){var P=g[M];P._dbInfo.db=x,k(P._dbInfo)}}).catch(function(x){throw($(e,x)||p.resolve()).catch(function(){}),x})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null}var S=new p(function(N,x){var M=m.deleteDatabase(e.name);M.onerror=function(){var P=M.result;P&&P.close(),x(M.error)},M.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},M.onsuccess=function(){var P=M.result;P&&P.close(),N(P)}});return S.then(function(N){l.db=N;for(var x=0;x<d.length;x++){var M=d[x];k(M._dbInfo)}}).catch(function(N){throw($(e,N)||p.resolve()).catch(function(){}),N})})}return _(a,r),a}var Ht={_driver:"asyncStorage",_initStorage:Pt,_support:T(),iterate:Mt,getItem:Vt,setItem:Bt,removeItem:Ft,clear:Ut,length:kt,key:Wt,keys:$t,dropInstance:Gt};function Yt(){return typeof openDatabase=="function"}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jt="~~local_forage_type~",je=/^~~local_forage_type~([^~]+)~/,ge="__lfsc__:",Ae=ge.length,Ne="arbf",xe="blob",ze="si08",qe="ui08",Ke="uic8",Xe="si16",Je="si32",Qe="ur16",Ze="ui32",et="fl32",tt="fl64",rt=Ae+Ne.length,nt=Object.prototype.toString;function ot(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Le(e){var r=new Uint8Array(e),t="",i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function zt(e,r){var t="";if(e&&(t=nt.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&nt.call(e.buffer)==="[object ArrayBuffer]")){var i,a=ge;e instanceof ArrayBuffer?(i=e,a+=Ne):(i=e.buffer,t==="[object Int8Array]"?a+=ze:t==="[object Uint8Array]"?a+=qe:t==="[object Uint8ClampedArray]"?a+=Ke:t==="[object Int16Array]"?a+=Xe:t==="[object Uint16Array]"?a+=Qe:t==="[object Int32Array]"?a+=Je:t==="[object Uint32Array]"?a+=Ze:t==="[object Float32Array]"?a+=et:t==="[object Float64Array]"?a+=tt:r(new Error("Failed to get type for BinaryArray"))),r(a+Le(i))}else if(t==="[object Blob]"){var o=new FileReader;o.onload=function(){var u=jt+e.type+"~"+Le(this.result);r(ge+xe+u)},o.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function qt(e){if(e.substring(0,Ae)!==ge)return JSON.parse(e);var r=e.substring(rt),t=e.substring(Ae,rt),i;if(t===xe&&je.test(r)){var a=r.match(je);i=a[1],r=r.substring(a[0].length)}var o=ot(r);switch(t){case Ne:return o;case xe:return V([o],{type:i});case ze:return new Int8Array(o);case qe:return new Uint8Array(o);case Ke:return new Uint8ClampedArray(o);case Xe:return new Int16Array(o);case Qe:return new Uint16Array(o);case Je:return new Int32Array(o);case Ze:return new Uint32Array(o);case et:return new Float32Array(o);case tt:return new Float64Array(o);default:throw new Error("Unkown type: "+t)}}var Oe={serialize:zt,deserialize:qt,stringToBuffer:ot,bufferToString:Le};function it(e,r,t,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,i)}function Kt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!="string"?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(f){return u(f)}t.db.transaction(function(f){it(f,t,function(){r._dbInfo=t,o()},function(l,d){u(d)})},u)});return t.serializer=Oe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(l,d){d.rows.length?o(l,f):it(l,r,function(){l.executeSql(t,i,a,o)},o)},o):o(u,f)},o)}function Xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=u.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function at(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,"INSERT OR REPLACE INTO "+d.storeName+" (key, value) VALUES (?, ?)",[e,g],function(){u(l)},function(N,x){f(x)})},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(at.apply(a,[e,l,t,i-1]));return}f(S)}})})}).catch(f)});return _(o,t),o}function Qt(e,r,t){return at.apply(this,[e,r,t,1])}function Zt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function er(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"DELETE FROM "+o.storeName,[],function(){i()},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function tr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function rr(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(l,d){var g=d.rows.length?d.rows.item(0).key:null;a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function nr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT key FROM "+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function or(e){return new p(function(r,t){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u})},function(a,o){t(o)})},function(i){t(i)})})}function ir(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(or(u))}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(N){return new p(function(x,M){l.executeSql("DROP TABLE IF EXISTS "+N,[],function(){x()},function(P,H){M(H)})})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u()}).catch(function(N){f(N)})},function(l){f(l)})})}):a=p.reject("Invalid arguments"),_(a,r),a}var ar={_driver:"webSQLStorage",_initStorage:Kt,_support:Yt(),iterate:Jt,getItem:Xt,setItem:Qt,removeItem:Zt,clear:er,length:tr,key:rr,keys:nr,dropInstance:ir};function sr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function st(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function ur(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function cr(){return!ur()||localStorage.length>0}function fr(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=st(e,r._defaultConfig),cr()?(r._dbInfo=t,t.serializer=Oe,p.resolve()):p.reject()}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o)}});return _(t,e),t}function dr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function mr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function gr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e)}catch{o=null}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function pr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length))}return o});return _(t,e),t}function hr(e){var r=this,t=r.keys().then(function(i){return i.length});return _(t,e),t}function vr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e)});return _(i,r),i}function yr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o)}catch(E){(E.name==="QuotaExceededError"||E.name==="NS_ERROR_DOM_QUOTA_REACHED")&&f(E),f(E)}})})});return _(a,t),a}function Er(e,r){if(r=j.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(st(e,i._defaultConfig)):o(e.name+"/")}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f)}}):a=p.reject("Invalid arguments"),_(a,r),a}var _r={_driver:"localStorageWrapper",_initStorage:fr,_support:sr(),iterate:mr,getItem:dr,setItem:yr,removeItem:vr,clear:lr,length:hr,key:gr,keys:pr,dropInstance:Er},br=function(r,t){return r===t||typeof r=="number"&&typeof t=="number"&&isNaN(r)&&isNaN(t)},Tr=function(r,t){for(var i=r.length,a=0;a<i;){if(br(r[a],t))return!0;a++}return!1},ut=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ae={},ct={},re={INDEXEDDB:Ht,WEBSQL:ar,LOCALSTORAGE:_r},wr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],pe=["dropInstance"],Pe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pe),Ir={description:"",driver:wr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Sr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Ve(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(ut(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var Dr=(function(){function e(r){R(this,e);for(var t in re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i)}this._defaultConfig=Ve({},Ir),this._config=Ve({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(t){if((typeof t>"u"?"undefined":w(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var i in t){if(i==="storeName"&&(t[i]=t[i].replace(/\W/g,"_")),i==="version"&&typeof t[i]!="number")return new Error("Database version must be a number.");this._config[i]=t[i]}return"driver"in t&&t.driver?this.setDriver(this._config.driver):!0}else return typeof t=="string"?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){f(d);return}for(var g=Pe.concat("_initStorage"),E=0,S=g.length;E<S;E++){var N=g[E],x=!Tr(pe,N);if((x||t[N])&&typeof t[N]!="function"){f(d);return}}var M=function(){for(var se=function(Ar){return function(){var Nr=new Error("Method "+Ar+" is not implemented by the current driver"),ft=p.reject(Nr);return _(ft,arguments[arguments.length-1]),ft}},Me=0,Cr=pe.length;Me<Cr;Me++){var Be=pe[Me];t[Be]||(t[Be]=se(Be))}};M();var P=function(se){ae[l]&&console.info("Redefining LocalForage driver: "+l),ae[l]=t,ct[l]=se,u()};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(P,f):P(!!t._support):P(!0)}catch(H){f(H)}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error("Driver not found."));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Oe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;ut(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver()}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var M=new Error("No available storage method found.");return o._driverSet=p.reject(M),o._driverSet}return N()}}var g=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=g.then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u)})}).catch(function(){f();var E=new Error("No available storage method found.");return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return!!ct[t]},e.prototype._extend=function(t){Ve(this,t)},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u)}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Pe.length;t<i;t++)Sr(this,Pe[t])},e.prototype.createInstance=function(t){return new e(t)},e})(),Rr=new Dr;v.exports=Rr},{3:3}]},{},[4])(4)})});var wt=dt((Tt,we)=>{"use strict";(function(s){"use strict";var n={};n.VERSION="1.6.1";var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],V,p;for(p=1;p<m.length;p++)for(V in m[p])!(V in T)&&m[p].hasOwnProperty(V)&&(T[V]=m[p][V]);return T},w=function(m,T){return{value:m,name:T}};n.TRACE=w(1,"TRACE"),n.DEBUG=w(2,"DEBUG"),n.INFO=w(3,"INFO"),n.TIME=w(4,"TIME"),n.WARN=w(5,"WARN"),n.ERROR=w(8,"ERROR"),n.OFF=w(99,"OFF");var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};R.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"end"])},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context))}};var b=new R({filterLevel:n.OFF});(function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info})(),n.setHandler=function(m){h=m},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m)},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift("["+C.name+"]")};var T={},V=function(p,_){Function.prototype.apply.call(p,console,_)};return typeof console>"u"?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?"["+_.name+"] ":"")+p[0],p[1]==="start"?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):V(C,[O+": "+(new Date().getTime()-T[O])+"ms"])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),V(C,p))}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof we<"u"&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n)})(Tt)});var Fe="13.1.11";var Lr=Fe.split("-")[0].split(".").slice(0,3).map(s=>s.padStart(2,"0")).join(""),qr="WEB",gt="CooeeSDK",Q=Fe,Kr=parseInt(Lr,10);var Xr=["collection","product","cart"],Jr=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],Qr=["View Item","View Cart","View Collection"],Zr=["CE Screen View","View Collection","View Item","View Cart"],pt="https://cdn.jsdelivr.net/npm/swiper@11";var Ue=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ce={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:Ue,styleURL:`${Ue}/widget.min.css`,widgetURL:`${Ue}/widget.min.js`,swiperStyleURL:`${pt}/swiper-bundle.min.css`};var ve=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var ye=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var We=mt(vt());function Ee(s){return We.default.createInstance({name:"lc",storeName:s,driver:We.default.LOCALSTORAGE})}var ne=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class fe extends ne{};he(fe,"storeName","ses"),fe.storage=Ee(fe.storeName);var _e=fe;var le=class le extends ne{};he(le,"storeName","usr"),le.storage=Ee(le.storeName);var de=le;var be=class{static format(n,h){let c=/{{\s*(\w+)\s*}}/;return h.replace(c,(v,I)=>{switch(I){case"amount":return this.formatWithDelimiters(n,2);case"amount_no_decimals":return this.formatWithDelimiters(n,0);case"amount_with_comma_separator":return this.formatWithDelimiters(n,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(n,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(n,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(n,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(n,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(n,2," ",".");default:return v}})}static formatWithDelimiters(n,h=2,c=",",v="."){if(isNaN(n)||n==null)return"0";let w=(n/100).toFixed(h).split("."),R=w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+c),b=w[1]?v+w[1]:"";return R+b}};function yt(s){if(s<0)return`${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+"m"),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+"s"),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+"ms"),h.length||h.push("0ms"),h.join(" ")}function $e(){return window.CooeeSDK.runtimeData}function yn(){return yt(Date.now()-$e().sdkLoadTime.getTime())}function Nn(s){try{return new URL(s)}catch{return}}function xn(s){return!s||s==="null"||s==="undefined"}function Ln(s,n){let h=s.indexOf(n);return h===-1?!1:(s.splice(h,1),!0)}function On(s,n,h){return{[s]:Or(n,h),[s+"_wo_currency"]:n}}function Or(s,n){if(s==0&&n)return"Free";let h=$e(),c=ye.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn("Currency code is not set in RuntimeData");let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=be.format(s*100,w);else{let b;try{b=new Intl.NumberFormat(Et(),{style:"currency",currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2})}catch(m){return Ge(m,"format-currency",{extra:{currentCurrency:I,shopCurrency:v}}),""}R=b.format(s),R=R.replace("\u20B9","Rs. "),c.money?.showCurrency&&I!=="INR"&&(R=R.concat(` ${I}`))}return R}function Pn(s){let n=Et();try{return new Intl.NumberFormat(n,{notation:"compact"}).format(s)}catch(h){return Ge(h,"format-number",{extra:{lang:n,value:s}}),s.toString()}}function Et(){let s="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(";")[0],s=s.split("-")[0],s||"en"}var Te;function _t(){if(Te)return Te;try{return Te=Intl.DateTimeFormat().resolvedOptions().timeZone,Te}catch{return""}}function bt(s){document.readyState!=="loading"?s():document.addEventListener("DOMContentLoaded",s)}function Vn(s){let n=document.createElement("span");n.id="snackbar",n.innerText=s,document.body.appendChild(n),n.className="show",setTimeout(()=>{n.classList.remove("show"),document.body.removeChild(n)},5e3)}async function Pr(s,n=7,h=document){let c=1,v=document.querySelectorAll("nonexistent-tag");for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await ve.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Mn(s,n=10,h=document){return(await Pr(s,n,h)).item(0)}async function Vr(s){let[n,h,c]=await Promise.all([de.get("did"),_e.get("id",""),de.get("sessionNumber",1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Bn(s){let n=await Vr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Fn(s,n,h,c=!1){Object.defineProperty(s,n,{enumerable:!1,configurable:!1,writable:c,value:h})}function Un(s){if(s%100>=11&&s%100<=13)return s+"th";switch(s%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd";default:return s+"th"}}var W=mt(wt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n)}static verbose(...n){W.default.debug(...n)}static error(...n){W.default.error(...n)}static warn(...n){W.default.warn(...n)}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(" ")}),this.addToDebugger()}static trace(...n){W.default.trace(...n)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Hn(s=gt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`)}}),Mr()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(ce.debug?W.default.TRACE:W.default.OFF)}function Mr(){let s=It();return s==="1"||s==="on"}function It(){return new URL(location.href).searchParams?.get("cooee-debug")}function Yn(){let s=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),n=`
|
|
1
|
+
import{a as ee,b as lt,c as ue,e as dt,g as mt,h as he}from"./chunk-U4XWPFUW.js";var vt=dt((ht,ke)=>{"use strict";(function(s){if(typeof ht=="object"&&typeof ke<"u")ke.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=s()}})(function(){var s,n,h;return(function c(v,I,w){function R(T,V){if(!I[T]){if(!v[T]){var p=typeof ue=="function"&&ue;if(!V&&p)return p(T,!0);if(b)return b(T,!0);var _=new Error("Cannot find module '"+T+"'");throw _.code="MODULE_NOT_FOUND",_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w)}return I[T].exports}for(var b=typeof ue=="function"&&ue,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){"use strict";var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),V=w.document.createTextNode("");T.observe(V,{characterData:!0}),b=function(){V.data=m=++m%2}}else if(!w.setImmediate&&typeof w.MessageChannel<"u"){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0)}}else"document"in w&&"onreadystatechange"in w.document.createElement("script")?b=function(){var B=w.document.createElement("script");B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},w.document.documentElement.appendChild(B)}:b=function(){setTimeout(O,0)};var _,C=[];function O(){_=!0;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length}_=!1}v.exports=j;function j(B){C.push(B)===1&&!_&&b()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(c,v,I){"use strict";var w=c(1);function R(){}var b={},m=["REJECTED"],T=["FULFILLED"],V=["PENDING"];v.exports=p;function p(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=V,this.queue=[],this.outcome=void 0,y!==R&&j(this,y)}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!="function"&&this.state===T||typeof A!="function"&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==V){var L=this.state===T?y:A;C(D,L,this.outcome)}else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y)},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y)},_.prototype.callRejected=function(y){b.reject(this.promise,y)},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y)};function C(y,A,D){w(function(){var L;try{L=A(D)}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError("Cannot resolve promise with itself")):b.resolve(y,L)})}b.resolve=function(y,A){var D=B(O,A);if(D.status==="error")return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else{y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A)}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof A=="function")return function(){A.apply(y,arguments)}}function j(y,A){var D=!1;function L(G){D||(D=!0,b.reject(y,G))}function U(G){D||(D=!0,b.resolve(y,G))}function k(){A(U,L)}var $=B(k);$.status==="error"&&L($.value)}function B(y,A){var D={};try{D.value=y(A),D.status="success"}catch(L){D.status="error",D.value=L}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Re;function Re(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,me){A.resolve(ie).then(Ce,function(te){L||(L=!0,b.reject(G,te))});function Ce(te){U[me]=te,++k===D&&!L&&(L=!0,b.resolve(G,U))}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=!0,b.resolve(k,q))},function(q){L||(L=!0,b.reject(k,q))})}}},{1:1}],3:[function(c,v,I){(function(w){"use strict";typeof w.Promise!="function"&&(w.Promise=c(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(c,v,I){"use strict";var w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function b(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function V(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!=="TypeError")throw o;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,i=new t,a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>"u"&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function C(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function O(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",z=void 0,F={},Re=Object.prototype.toString,Z="readonly",y="readwrite";function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=V([""]);t.objectStore(B).put(i,"key"),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(!1)},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),o=navigator.userAgent.match(/Edge\//);r(o||!a||parseInt(a[1],10)>=43)}}).catch(function(){return!1})}function L(e){return typeof z=="boolean"?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function k(e){var r=F[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var t=F[e.name],i=t.deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||Ye(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B)}catch(l){if(l.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error)},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close()},t(u),k(e)}})}function q(e){return G(e,!1)}function ie(e){return G(e,!0)}function me(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function Ce(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){var o=btoa(a.target.result||"");r({__local_forage_encoded_blob:!0,data:o,type:e.type})},i.readAsBinaryString(e)})}function te(e){var r=A(atob(e.data));return V([r],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Lt(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function Ot(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null)}return e.db=null,q(e).then(function(o){return e.db=o,me(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{var a=e.db.transaction(e.storeName,r);t(null,a)}catch(o){if(i>0&&(!e.db||o.name==="InvalidStateError"||o.name==="NotFoundError"))return p.resolve().then(function(){if(!e.db||o.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return Ot(e).then(function(){K(e,r,t,i-1)})}).catch(t);t(o)}}function Ye(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Pt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=Ye(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Lt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u))}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,me(t,r._defaultConfig.version)?ie(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function Vt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=te(g)),a(g)},d.onerror=function(){o(d.error)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Mt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=te(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue()}else a()},d.onerror=function(){o(d.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function Bt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Re.call(r)==="[object Blob]"?L(f.db).then(function(l){return l?r:Ce(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l)},g.onabort=g.onerror=function(){var N=S.error?S.error:S.transaction.error;u(N)}}catch(N){u(N)}})}).catch(u)});return _(a,t),a}function Ft(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.delete(e);f.oncomplete=function(){a()},f.onerror=function(){o(d.error)},f.onabort=function(){var g=d.error?d.error:d.transaction.error;o(g)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Ut(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.clear();u.oncomplete=function(){i()},u.onabort=u.onerror=function(){var d=l.error?l.error:l.transaction.error;a(d)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.count();l.onsuccess=function(){i(l.result)},l.onerror=function(){a(l.error)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function Wt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e))},g.onerror=function(){o(g.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function $t(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue()},l.onerror=function(){a(l.error)}}catch(g){a(g)}})}).catch(a)});return _(t,e),t}function Gt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject("Invalid arguments");else{var o=e.name===t.name&&i._dbInfo.db,u=o?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l}var N=new p(function(x,M){var P=m.open(e.name,l);P.onerror=function(H){var se=P.result;se.close(),M(H)},P.onupgradeneeded=function(){var H=P.result;H.deleteObjectStore(e.storeName)},P.onsuccess=function(){var H=P.result;H.close(),x(H)}});return N.then(function(x){d.db=x;for(var M=0;M<g.length;M++){var P=g[M];P._dbInfo.db=x,k(P._dbInfo)}}).catch(function(x){throw($(e,x)||p.resolve()).catch(function(){}),x})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null}var S=new p(function(N,x){var M=m.deleteDatabase(e.name);M.onerror=function(){var P=M.result;P&&P.close(),x(M.error)},M.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},M.onsuccess=function(){var P=M.result;P&&P.close(),N(P)}});return S.then(function(N){l.db=N;for(var x=0;x<d.length;x++){var M=d[x];k(M._dbInfo)}}).catch(function(N){throw($(e,N)||p.resolve()).catch(function(){}),N})})}return _(a,r),a}var Ht={_driver:"asyncStorage",_initStorage:Pt,_support:T(),iterate:Mt,getItem:Vt,setItem:Bt,removeItem:Ft,clear:Ut,length:kt,key:Wt,keys:$t,dropInstance:Gt};function Yt(){return typeof openDatabase=="function"}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jt="~~local_forage_type~",je=/^~~local_forage_type~([^~]+)~/,ge="__lfsc__:",Ae=ge.length,Ne="arbf",xe="blob",ze="si08",qe="ui08",Ke="uic8",Xe="si16",Je="si32",Qe="ur16",Ze="ui32",et="fl32",tt="fl64",rt=Ae+Ne.length,nt=Object.prototype.toString;function ot(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Le(e){var r=new Uint8Array(e),t="",i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function zt(e,r){var t="";if(e&&(t=nt.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&nt.call(e.buffer)==="[object ArrayBuffer]")){var i,a=ge;e instanceof ArrayBuffer?(i=e,a+=Ne):(i=e.buffer,t==="[object Int8Array]"?a+=ze:t==="[object Uint8Array]"?a+=qe:t==="[object Uint8ClampedArray]"?a+=Ke:t==="[object Int16Array]"?a+=Xe:t==="[object Uint16Array]"?a+=Qe:t==="[object Int32Array]"?a+=Je:t==="[object Uint32Array]"?a+=Ze:t==="[object Float32Array]"?a+=et:t==="[object Float64Array]"?a+=tt:r(new Error("Failed to get type for BinaryArray"))),r(a+Le(i))}else if(t==="[object Blob]"){var o=new FileReader;o.onload=function(){var u=jt+e.type+"~"+Le(this.result);r(ge+xe+u)},o.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function qt(e){if(e.substring(0,Ae)!==ge)return JSON.parse(e);var r=e.substring(rt),t=e.substring(Ae,rt),i;if(t===xe&&je.test(r)){var a=r.match(je);i=a[1],r=r.substring(a[0].length)}var o=ot(r);switch(t){case Ne:return o;case xe:return V([o],{type:i});case ze:return new Int8Array(o);case qe:return new Uint8Array(o);case Ke:return new Uint8ClampedArray(o);case Xe:return new Int16Array(o);case Qe:return new Uint16Array(o);case Je:return new Int32Array(o);case Ze:return new Uint32Array(o);case et:return new Float32Array(o);case tt:return new Float64Array(o);default:throw new Error("Unkown type: "+t)}}var Oe={serialize:zt,deserialize:qt,stringToBuffer:ot,bufferToString:Le};function it(e,r,t,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,i)}function Kt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!="string"?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(f){return u(f)}t.db.transaction(function(f){it(f,t,function(){r._dbInfo=t,o()},function(l,d){u(d)})},u)});return t.serializer=Oe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(l,d){d.rows.length?o(l,f):it(l,r,function(){l.executeSql(t,i,a,o)},o)},o):o(u,f)},o)}function Xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=u.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function at(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,"INSERT OR REPLACE INTO "+d.storeName+" (key, value) VALUES (?, ?)",[e,g],function(){u(l)},function(N,x){f(x)})},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(at.apply(a,[e,l,t,i-1]));return}f(S)}})})}).catch(f)});return _(o,t),o}function Qt(e,r,t){return at.apply(this,[e,r,t,1])}function Zt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function er(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"DELETE FROM "+o.storeName,[],function(){i()},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function tr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function rr(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(l,d){var g=d.rows.length?d.rows.item(0).key:null;a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function nr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT key FROM "+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function or(e){return new p(function(r,t){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u})},function(a,o){t(o)})},function(i){t(i)})})}function ir(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(or(u))}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(N){return new p(function(x,M){l.executeSql("DROP TABLE IF EXISTS "+N,[],function(){x()},function(P,H){M(H)})})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u()}).catch(function(N){f(N)})},function(l){f(l)})})}):a=p.reject("Invalid arguments"),_(a,r),a}var ar={_driver:"webSQLStorage",_initStorage:Kt,_support:Yt(),iterate:Jt,getItem:Xt,setItem:Qt,removeItem:Zt,clear:er,length:tr,key:rr,keys:nr,dropInstance:ir};function sr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function st(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function ur(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function cr(){return!ur()||localStorage.length>0}function fr(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=st(e,r._defaultConfig),cr()?(r._dbInfo=t,t.serializer=Oe,p.resolve()):p.reject()}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o)}});return _(t,e),t}function dr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function mr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function gr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e)}catch{o=null}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function pr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length))}return o});return _(t,e),t}function hr(e){var r=this,t=r.keys().then(function(i){return i.length});return _(t,e),t}function vr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e)});return _(i,r),i}function yr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o)}catch(E){(E.name==="QuotaExceededError"||E.name==="NS_ERROR_DOM_QUOTA_REACHED")&&f(E),f(E)}})})});return _(a,t),a}function Er(e,r){if(r=j.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(st(e,i._defaultConfig)):o(e.name+"/")}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f)}}):a=p.reject("Invalid arguments"),_(a,r),a}var _r={_driver:"localStorageWrapper",_initStorage:fr,_support:sr(),iterate:mr,getItem:dr,setItem:yr,removeItem:vr,clear:lr,length:hr,key:gr,keys:pr,dropInstance:Er},br=function(r,t){return r===t||typeof r=="number"&&typeof t=="number"&&isNaN(r)&&isNaN(t)},Tr=function(r,t){for(var i=r.length,a=0;a<i;){if(br(r[a],t))return!0;a++}return!1},ut=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ae={},ct={},re={INDEXEDDB:Ht,WEBSQL:ar,LOCALSTORAGE:_r},wr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],pe=["dropInstance"],Pe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pe),Ir={description:"",driver:wr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Sr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Ve(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(ut(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var Dr=(function(){function e(r){R(this,e);for(var t in re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i)}this._defaultConfig=Ve({},Ir),this._config=Ve({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(t){if((typeof t>"u"?"undefined":w(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var i in t){if(i==="storeName"&&(t[i]=t[i].replace(/\W/g,"_")),i==="version"&&typeof t[i]!="number")return new Error("Database version must be a number.");this._config[i]=t[i]}return"driver"in t&&t.driver?this.setDriver(this._config.driver):!0}else return typeof t=="string"?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){f(d);return}for(var g=Pe.concat("_initStorage"),E=0,S=g.length;E<S;E++){var N=g[E],x=!Tr(pe,N);if((x||t[N])&&typeof t[N]!="function"){f(d);return}}var M=function(){for(var se=function(Ar){return function(){var Nr=new Error("Method "+Ar+" is not implemented by the current driver"),ft=p.reject(Nr);return _(ft,arguments[arguments.length-1]),ft}},Me=0,Cr=pe.length;Me<Cr;Me++){var Be=pe[Me];t[Be]||(t[Be]=se(Be))}};M();var P=function(se){ae[l]&&console.info("Redefining LocalForage driver: "+l),ae[l]=t,ct[l]=se,u()};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(P,f):P(!!t._support):P(!0)}catch(H){f(H)}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error("Driver not found."));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Oe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;ut(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver()}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var M=new Error("No available storage method found.");return o._driverSet=p.reject(M),o._driverSet}return N()}}var g=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=g.then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u)})}).catch(function(){f();var E=new Error("No available storage method found.");return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return!!ct[t]},e.prototype._extend=function(t){Ve(this,t)},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u)}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Pe.length;t<i;t++)Sr(this,Pe[t])},e.prototype.createInstance=function(t){return new e(t)},e})(),Rr=new Dr;v.exports=Rr},{3:3}]},{},[4])(4)})});var wt=dt((Tt,we)=>{"use strict";(function(s){"use strict";var n={};n.VERSION="1.6.1";var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],V,p;for(p=1;p<m.length;p++)for(V in m[p])!(V in T)&&m[p].hasOwnProperty(V)&&(T[V]=m[p][V]);return T},w=function(m,T){return{value:m,name:T}};n.TRACE=w(1,"TRACE"),n.DEBUG=w(2,"DEBUG"),n.INFO=w(3,"INFO"),n.TIME=w(4,"TIME"),n.WARN=w(5,"WARN"),n.ERROR=w(8,"ERROR"),n.OFF=w(99,"OFF");var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};R.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"end"])},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context))}};var b=new R({filterLevel:n.OFF});(function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info})(),n.setHandler=function(m){h=m},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m)},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift("["+C.name+"]")};var T={},V=function(p,_){Function.prototype.apply.call(p,console,_)};return typeof console>"u"?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?"["+_.name+"] ":"")+p[0],p[1]==="start"?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):V(C,[O+": "+(new Date().getTime()-T[O])+"ms"])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),V(C,p))}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof we<"u"&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n)})(Tt)});var Fe="13.1.12";var Lr=Fe.split("-")[0].split(".").slice(0,3).map(s=>s.padStart(2,"0")).join(""),qr="WEB",gt="CooeeSDK",Q=Fe,Kr=parseInt(Lr,10);var Xr=["collection","product","cart"],Jr=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],Qr=["View Item","View Cart","View Collection"],Zr=["CE Screen View","View Collection","View Item","View Cart"],pt="https://cdn.jsdelivr.net/npm/swiper@11";var Ue=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ce={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:Ue,styleURL:`${Ue}/widget.min.css`,widgetURL:`${Ue}/widget.min.js`,swiperStyleURL:`${pt}/swiper-bundle.min.css`};var ve=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var ye=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var We=mt(vt());function Ee(s){return We.default.createInstance({name:"lc",storeName:s,driver:We.default.LOCALSTORAGE})}var ne=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class fe extends ne{};he(fe,"storeName","ses"),fe.storage=Ee(fe.storeName);var _e=fe;var le=class le extends ne{};he(le,"storeName","usr"),le.storage=Ee(le.storeName);var de=le;var be=class{static format(n,h){let c=/{{\s*(\w+)\s*}}/;return h.replace(c,(v,I)=>{switch(I){case"amount":return this.formatWithDelimiters(n,2);case"amount_no_decimals":return this.formatWithDelimiters(n,0);case"amount_with_comma_separator":return this.formatWithDelimiters(n,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(n,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(n,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(n,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(n,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(n,2," ",".");default:return v}})}static formatWithDelimiters(n,h=2,c=",",v="."){if(isNaN(n)||n==null)return"0";let w=(n/100).toFixed(h).split("."),R=w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+c),b=w[1]?v+w[1]:"";return R+b}};function yt(s){if(s<0)return`${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+"m"),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+"s"),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+"ms"),h.length||h.push("0ms"),h.join(" ")}function $e(){return window.CooeeSDK.runtimeData}function yn(){return yt(Date.now()-$e().sdkLoadTime.getTime())}function Nn(s){try{return new URL(s)}catch{return}}function xn(s){return!s||s==="null"||s==="undefined"}function Ln(s,n){let h=s.indexOf(n);return h===-1?!1:(s.splice(h,1),!0)}function On(s,n,h){return{[s]:Or(n,h),[s+"_wo_currency"]:n}}function Or(s,n){if(s==0&&n)return"Free";let h=$e(),c=ye.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn("Currency code is not set in RuntimeData");let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=be.format(s*100,w);else{let b;try{b=new Intl.NumberFormat(Et(),{style:"currency",currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2})}catch(m){return Ge(m,"format-currency",{extra:{currentCurrency:I,shopCurrency:v}}),""}R=b.format(s),R=R.replace("\u20B9","Rs. "),c.money?.showCurrency&&I!=="INR"&&(R=R.concat(` ${I}`))}return R}function Pn(s){let n=Et();try{return new Intl.NumberFormat(n,{notation:"compact"}).format(s)}catch(h){return Ge(h,"format-number",{extra:{lang:n,value:s}}),s.toString()}}function Et(){let s="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(";")[0],s=s.split("-")[0],s||"en"}var Te;function _t(){if(Te)return Te;try{return Te=Intl.DateTimeFormat().resolvedOptions().timeZone,Te}catch{return""}}function bt(s){document.readyState!=="loading"?s():document.addEventListener("DOMContentLoaded",s)}function Vn(s){let n=document.createElement("span");n.id="snackbar",n.innerText=s,document.body.appendChild(n),n.className="show",setTimeout(()=>{n.classList.remove("show"),document.body.removeChild(n)},5e3)}async function Pr(s,n=7,h=document){let c=1,v=document.querySelectorAll("nonexistent-tag");for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await ve.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Mn(s,n=10,h=document){return(await Pr(s,n,h)).item(0)}async function Vr(s){let[n,h,c]=await Promise.all([de.get("did"),_e.get("id",""),de.get("sessionNumber",1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Bn(s){let n=await Vr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Fn(s,n,h,c=!1){Object.defineProperty(s,n,{enumerable:!1,configurable:!1,writable:c,value:h})}function Un(s){if(s%100>=11&&s%100<=13)return s+"th";switch(s%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd";default:return s+"th"}}var W=mt(wt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n)}static verbose(...n){W.default.debug(...n)}static error(...n){W.default.error(...n)}static warn(...n){W.default.warn(...n)}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(" ")}),this.addToDebugger()}static trace(...n){W.default.trace(...n)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Hn(s=gt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`)}}),Mr()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(ce.debug?W.default.TRACE:W.default.OFF)}function Mr(){let s=It();return s==="1"||s==="on"}function It(){return new URL(location.href).searchParams?.get("cooee-debug")}function Yn(){let s=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),n=`
|
|
2
2
|
`;n+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
|
|
3
3
|
`,n+=`\u{1F50D} Track real-time visitor intent & optimize engagement
|
|
4
4
|
`,n+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{B as Yo,C as Ct,D as zo,E as Jo,G as ne,I as Ei,J as Xo,K as Ko,N as Gr,O as S,a as $r,b as $o,c as jo,g as Ho,i as vi,j as je,k as Tt,n as Rt,o as xt,p as jr,q as re,r as tt,s as Wo,t as Go,u as Hr,v as He,w as Wr,x as rt,z as qo}from"./chunk-
|
|
1
|
+
import{B as Yo,C as Ct,D as zo,E as Jo,G as ne,I as Ei,J as Xo,K as Ko,N as Gr,O as S,a as $r,b as $o,c as jo,g as Ho,i as vi,j as je,k as Tt,n as Rt,o as xt,p as jr,q as re,r as tt,s as Wo,t as Go,u as Hr,v as He,w as Wr,x as rt,z as qo}from"./chunk-NOZTSVSX.js";import{a as B,b as It,e as Vo,g as me}from"./chunk-U4XWPFUW.js";var qi=Vo((En,Ds)=>{"use strict";(function(e,t){typeof En=="object"&&typeof Ds<"u"?t(En):typeof define=="function"&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Sqrl={})})(En,function(e){"use strict";function t(w){var _,T,I=new Error(w);return _=I,T=t.prototype,Object.setPrototypeOf?Object.setPrototypeOf(_,T):_.__proto__=T,I}function r(w,_,T){var I=_.slice(0,T).split(/\n/),x=I.length,L=I[x-1].length+1;throw t(w+=" at line "+x+" col "+L+`:
|
|
2
2
|
|
|
3
3
|
`+_.split(/\n/)[x-1]+`
|
|
4
4
|
`+Array(L).join(" ")+"^")}t.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var n=new Function("return this")().Promise,i=!1;try{i=new Function("return (async function(){}).constructor")()}catch(w){if(!(w instanceof SyntaxError))throw w}function o(w,_){return Object.prototype.hasOwnProperty.call(w,_)}function s(w,_,T){for(var I in _)o(_,I)&&(_[I]==null||typeof _[I]!="object"||I!=="storage"&&I!=="prefixes"||T?w[I]=_[I]:w[I]=s({},_[I]));return w}var f=/^async +/,p=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,d=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,m=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,h=/[.*+\-?^${}()|[\]\\]/g;function b(w){return h.test(w)?w.replace(h,"\\$&"):w}function y(w,_){_.rmWhitespace&&(w=w.replace(/[\r\n]+/g,`
|
|
@@ -11,7 +11,7 @@ import{B as Yo,C as Ct,D as zo,E as Jo,G as ne,I as Ei,J as Xo,K as Ko,N as Gr,O
|
|
|
11
11
|
`+" ".concat(i).concat(o).concat(s).concat(f,`
|
|
12
12
|
`)+" ".concat(p,"\\").concat(d,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return Wu(e,t);if(e===void 0)return null;if(e instanceof Date||bu(e)){var m=e.getTime(),h=m>-1&&m<2534023188e5;return t.legacy?t.relaxed&&h?{$date:e.getTime()}:{$date:Ys(e)}:t.relaxed&&h?{$date:Ys(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var b=e>=oa&&e<=ia,y=e>=aa&&e<=sa;if(b)return{$numberInt:e.toString()};if(y)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Eu(e)){var E=e.flags;if(E===void 0){var D=e.toString().match(/[gimuy]*$/);D&&(E=D[0])}var C=new Nr(e.source,E);return C.toExtendedJSON(t)}return e!=null&&typeof e=="object"?qu(e,t):e}var Gu={Binary:function(e){return new Ae(e.value(),e.sub_type)},Code:function(e){return new Jn(e.code,e.scope)},DBRef:function(e){return new Cr(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new ho(e.bytes)},Double:function(e){return new Xn(e.value)},Int32:function(e){return new Kn(e.value)},Long:function(e){return U.fromBits(e.low!=null?e.low:e.low_,e.low!=null?e.high:e.high_,e.low!=null?e.unsigned:e.unsigned_)},MaxKey:function(){return new mo},MinKey:function(){return new go},ObjectID:function(e){return new mt(e)},ObjectId:function(e){return new mt(e)},BSONRegExp:function(e){return new Nr(e.pattern,e.options)},Symbol:function(e){return new yo(e.value)},Timestamp:function(e){return na.fromBits(e.low,e.high)}};function qu(e,t){if(e==null||typeof e!="object")throw new Pe("not an object instance");var r=e._bsontype;if(typeof r>"u"){var n={};for(var i in e){t.seenObjects.push({propertyName:i,obj:null});try{var o=_e(e[i],t);i==="__proto__"?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{t.seenObjects.pop()}}return n}else if(ju(e)){var s=e;if(typeof s.toExtendedJSON!="function"){var f=Gu[e._bsontype];if(!f)throw new nt("Unrecognized or invalid _bsontype: "+e._bsontype);s=f(s)}return r==="Code"&&s.scope?s=new Jn(s.code,_e(s.scope,t)):r==="DBRef"&&s.oid&&(s=new Cr(_e(s.collection,t),_e(s.oid,t),_e(s.db,t),_e(s.fields,t))),s.toExtendedJSON(t)}else throw new Pe("_bsontype must be a string, but was: "+typeof r)}var zs;(function(e){function t(o,s){var f=Object.assign({},{relaxed:!0,legacy:!1},s);return typeof f.relaxed=="boolean"&&(f.strict=!f.relaxed),typeof f.strict=="boolean"&&(f.relaxed=!f.strict),JSON.parse(o,function(p,d){if(p.indexOf("\0")!==-1)throw new Pe("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(p)));return ca(d,f)})}e.parse=t;function r(o,s,f,p){f!=null&&typeof f=="object"&&(p=f,f=0),s!=null&&typeof s=="object"&&!Array.isArray(s)&&(p=s,s=void 0,f=0);var d=Object.assign({relaxed:!0,legacy:!1},p,{seenObjects:[{propertyName:"(root)",obj:null}]}),m=_e(o,d);return JSON.stringify(m,s,f)}e.stringify=r;function n(o,s){return s=s||{},JSON.parse(r(o,s))}e.serialize=n;function i(o,s){return s=s||{},t(JSON.stringify(o),s)}e.deserialize=i})(zs||(zs={}));var Js,Xs=Qs();Xs.Map?Js=Xs.Map:Js=(function(){function e(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var r=0;r<t.length;r++)if(t[r]!=null){var n=t[r],i=n[0],o=n[1];this._keys.push(i),this._values[i]={v:o,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(t){var r=this._values[t];return r==null?!1:(delete this._values[t],this._keys.splice(r.i,1),!0)},e.prototype.entries=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?[n,t._values[n].v]:void 0,done:n===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var n=0;n<this._keys.length;n++){var i=this._keys[n];t.call(r,this._values[i].v,i,r)}},e.prototype.get=function(t){return this._values[t]?this._values[t].v:void 0},e.prototype.has=function(t){return this._values[t]!=null},e.prototype.keys=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?n:void 0,done:n===void 0}}}},e.prototype.set=function(t,r){return this._values[t]?(this._values[t].v=r,this):(this._keys.push(t),this._values[t]={v:r,i:this._keys.length-1},this)},e.prototype.values=function(){var t=this,r=0;return{next:function(){var n=t._keys[r++];return{value:n!==void 0?t._values[n].v:void 0,done:n===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e})();var Rg=U.fromNumber(Iu),Pg=U.fromNumber(xu);var uo=new Uint8Array(8),Ag=new DataView(uo.buffer,uo.byteOffset,uo.byteLength);var Yu=1024*1024*17,Lg=H.alloc(Yu);var Mt=class{constructor(t,r={},n,i){this.name=t;this.properties=r;this.id=i?new mt(i):new mt,this.occurred=new Date,n&&(this.trigger=new Hn(n)),this.newEvent=!i}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(t){t&&(this.videos=[t.id],this.properties.current??={videoID:t.id})}};function kg(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}function Vg(e,t){Object.assign(e.style,t)}function $g(e,t,r){if(t){if(!r){e.style.removeProperty(t);return}e.style.setProperty(t,r,"important")}}function _o(e){if(!e)return!1;if(e.tagName.toLowerCase()==="cart-drawer"&&e.hasAttribute("open"))return!0;let r=e.getBoundingClientRect(),n=(window.innerHeight||document.documentElement.clientHeight)+.5,i=(window.innerWidth||document.documentElement.clientWidth)+.5,o=getComputedStyle(e);if(o.display==="none"||o.visibility==="hidden"||parseFloat(o.opacity)===0||e.hidden||!(e.offsetWidth>0||e.offsetHeight>0||e.getClientRects().length>0))return!1;let d=Math.max(0,Math.min(r.right,i)-Math.max(r.left,0)),m=Math.max(0,Math.min(r.bottom,n)-Math.max(r.top,0)),h=d*m,b=r.width*r.height;if(!(b>0&&h/b>=.1))return!1;let E=r.top<=n&&r.bottom>=0,D=r.left<=i&&r.right>=0,C=E&&D,R=o.transform.match(/matrix\(([^)]+)\)/),A=0,N=0;if(R){let G=R[1].split(", ").map(parseFloat);A=G[4],N=G[5]}let P=A+r.left>i||A+r.right<0||N+r.top>n||N+r.bottom<0;return C||!P}var jg=e=>new Promise((t,r)=>{let n=new Image;n.onload=()=>{t({width:n.width,height:n.height})},n.onerror=r,n.src=e,n.style.display="none"});var Ic=me(Gr());function M(e){return typeof e=="function"}function ar(e){let r=e(n=>{Error.call(n),n.stack=new Error().stack});return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Qn=ar(e=>function(r){e(this),this.message=r?`${r.length} errors occurred during unsubscription:
|
|
13
13
|
${r.map((n,i)=>`${i+1}) ${n.toString()}`).join(`
|
|
14
|
-
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function Le(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ft=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let o of r)o.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(o){t=o instanceof Qn?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{ua(o)}catch(s){t=t??[],s instanceof Qn?t=[...t,...s.errors]:t.push(s)}}if(t)throw new Qn(t)}}add(t){var r;if(t&&t!==this)if(this.closed)ua(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Le(r,t)}remove(t){let{_finalizers:r}=this;r&&Le(r,t),t instanceof e&&t._removeParent(this)}};Ft.EMPTY=(()=>{let e=new Ft;return e.closed=!0,e})();var wo=Ft.EMPTY;function Zn(e){return e instanceof Ft||e&&"closed"in e&&M(e.remove)&&M(e.add)&&M(e.unsubscribe)}function ua(e){M(e)?e():e.unsubscribe()}var Gt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var cr={setTimeout(e,t,...r){let{delegate:n}=cr;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=cr;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function ti(e){cr.setTimeout(()=>{let{onUnhandledError:t}=Gt;if(t)t(e);else throw e})}function vo(){}var fa=Eo("C",void 0,void 0);function la(e){return Eo("E",void 0,e)}function pa(e){return Eo("N",e,void 0)}function Eo(e,t,r){return{kind:e,value:t,error:r}}var Ue=null;function ur(e){if(Gt.useDeprecatedSynchronousErrorHandling){let t=!Ue;if(t&&(Ue={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=Ue;if(Ue=null,r)throw n}}else e()}function ha(e){Gt.useDeprecatedSynchronousErrorHandling&&Ue&&(Ue.errorThrown=!0,Ue.error=e)}var Be=class extends Ft{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Zn(t)&&t.add(this)):this.destination=Xu}static create(t,r,n){return new we(t,r,n)}next(t){this.isStopped?So(pa(t),this):this._next(t)}error(t){this.isStopped?So(la(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?So(fa,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},zu=Function.prototype.bind;function bo(e,t){return zu.call(e,t)}var Io=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){ei(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){ei(n)}else ei(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){ei(r)}}},we=class extends Be{constructor(t,r,n){super();let i;if(M(t)||!t)i={next:t??void 0,error:r??void 0,complete:n??void 0};else{let o;this&&Gt.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&bo(t.next,o),error:t.error&&bo(t.error,o),complete:t.complete&&bo(t.complete,o)}):i=t}this.destination=new Io(i)}};function ei(e){Gt.useDeprecatedSynchronousErrorHandling?ha(e):ti(e)}function Ju(e){throw e}function So(e,t){let{onStoppedNotification:r}=Gt;r&&cr.setTimeout(()=>r(e,t))}var Xu={closed:!0,next:vo,error:Ju,complete:vo};var fr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ma(e){return e}function da(e){return e.length===0?ma:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var vt=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,i){let o=Qu(r)?r:new we(r,n,i);return ur(()=>{let{operator:s,source:f}=this;o.add(s?s.call(o,f):f?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=ga(n),new n((i,o)=>{let s=new we({next:f=>{try{r(f)}catch(p){o(p),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[fr](){return this}pipe(...r){return da(r)(this)}toPromise(r){return r=ga(r),new r((n,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>n(o))})}}return e.create=t=>new e(t),e})();function ga(e){var t;return(t=e??Gt.Promise)!==null&&t!==void 0?t:Promise}function Ku(e){return e&&M(e.next)&&M(e.error)&&M(e.complete)}function Qu(e){return e&&e instanceof Be||Ku(e)&&Zn(e)}function Zu(e){return M(e?.lift)}function te(e){return t=>{if(Zu(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function kt(e,t,r,n,i){return new xo(e,t,r,n,i)}var xo=class extends Be{constructor(t,r,n,i,o,s){super(t),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=r?function(f){try{r(f)}catch(p){t.error(p)}}:super._next,this._error=i?function(f){try{i(f)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(f){t.error(f)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}}};var ya=ar(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var qt=(()=>{class e extends vt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new ri(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new ya}next(r){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:i,observers:o}=this;return n||i?wo:(this.currentObservers=null,o.push(r),new Ft(()=>{this.currentObservers=null,Le(o,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:i,isStopped:o}=this;n?r.error(i):o&&r.complete()}asObservable(){let r=new vt;return r.source=this,r}}return e.create=(t,r)=>new ri(t,r),e})(),ri=class extends qt{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,t)}error(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,t)}complete(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)}_subscribe(t){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&n!==void 0?n:wo}};var Rr=class extends qt{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){let r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){let{hasError:t,thrownError:r,_value:n}=this;if(t)throw r;return this._throwIfClosed(),n}next(t){super.next(this._value=t)}};var Pr={now(){return(Pr.delegate||Date).now()},delegate:void 0};var Ar=class extends qt{constructor(t=1/0,r=1/0,n=Pr){super(),this._bufferSize=t,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,r)}next(t){let{isStopped:r,_buffer:n,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;r||(n.push(t),!i&&n.push(o.now()+s)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(t),{_infiniteTimeWindow:n,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!t.closed;s+=n?1:2)t.next(o[s]);return this._checkFinalizedStatuses(t),r}_trimBuffer(){let{_bufferSize:t,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:i}=this,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){let s=r.now(),f=0;for(let p=1;p<n.length&&n[p]<=s;p+=2)f=p;f&&n.splice(0,f+1)}}};var ni=class extends Ft{constructor(t,r){super()}schedule(t,r=0){return this}};var Lr={setInterval(e,t,...r){let{delegate:n}=Lr;return n?.setInterval?n.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){let{delegate:t}=Lr;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};var ii=class extends ni{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var n;if(this.closed)return this;this.state=t;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,n=0){return Lr.setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Lr.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(t,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let n=!1,i;try{this.work(t)}catch(o){n=!0,i=o||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:t,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Le(n,this),t!=null&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}};var lr=class e{constructor(t,r=e.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,n){return new this.schedulerActionCtor(this,t).schedule(n,r)}};lr.now=Pr.now;var oi=class extends lr{constructor(t,r=lr.now){super(t,r),this.actions=[],this._active=!1}flush(t){let{actions:r}=this;if(this._active){r.push(t);return}let n;this._active=!0;do if(n=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,n){for(;t=r.shift();)t.unsubscribe();throw n}}};var Ur=new oi(ii),_a=Ur;function wa(e){return e&&M(e.schedule)}function Ea(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function f(m){try{d(n.next(m))}catch(h){s(h)}}function p(m){try{d(n.throw(m))}catch(h){s(h)}}function d(m){m.done?o(m.value):i(m.value).then(f,p)}d((n=n.apply(e,t||[])).next())})}function va(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function ba(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(y){return function(E){return Promise.resolve(E).then(y,h)}}function f(y,E){n[y]&&(i[y]=function(D){return new Promise(function(C,R){o.push([y,D,C,R])>1||p(y,D)})},E&&(i[y]=E(i[y])))}function p(y,E){try{d(n[y](E))}catch(D){b(o[0][3],D)}}function d(y){y.value instanceof Me?Promise.resolve(y.value.v).then(m,h):b(o[0][2],y)}function m(y){p("next",y)}function h(y){p("throw",y)}function b(y,E){y(E),o.shift(),o.length&&p(o[0][0],o[0][1])}}function Sa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof va=="function"?va(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(f,p){s=e[o](s),i(f,p,s.done,s.value)})}}function i(o,s,f,p){Promise.resolve(p).then(function(d){o({value:d,done:f})},s)}}var si=e=>e&&typeof e.length=="number"&&typeof e!="function";function Ia(e){return M(e?.then)}function xa(e){return M(e[fr])}function Oa(e){return Symbol.asyncIterator&&M(e?.[Symbol.asyncIterator])}function Ta(e){return new TypeError(`You provided ${e!==null&&typeof e=="object"?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function tf(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ca=tf();function Na(e){return M(e?.[Ca])}function Da(e){return ba(this,arguments,function*(){let r=e.getReader();try{for(;;){let{value:n,done:i}=yield Me(r.read());if(i)return yield Me(void 0);yield yield Me(n)}}finally{r.releaseLock()}})}function Ra(e){return M(e?.getReader)}function ve(e){if(e instanceof vt)return e;if(e!=null){if(xa(e))return ef(e);if(si(e))return rf(e);if(Ia(e))return nf(e);if(Oa(e))return Pa(e);if(Na(e))return of(e);if(Ra(e))return sf(e)}throw Ta(e)}function ef(e){return new vt(t=>{let r=e[fr]();if(M(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function rf(e){return new vt(t=>{for(let r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function nf(e){return new vt(t=>{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,ti)})}function of(e){return new vt(t=>{for(let r of e)if(t.next(r),t.closed)return;t.complete()})}function Pa(e){return new vt(t=>{af(e,t).catch(r=>t.error(r))})}function sf(e){return Pa(Da(e))}function af(e,t){var r,n,i,o;return Ea(this,void 0,void 0,function*(){try{for(r=Sa(e);n=yield r.next(),!n.done;){let s=n.value;if(t.next(s),t.closed)return}}catch(s){i={error:s}}finally{try{n&&!n.done&&(o=r.return)&&(yield o.call(r))}finally{if(i)throw i.error}}t.complete()})}function Aa(e,t,r,n=0,i=!1){let o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}var La=ar(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Fe(e,t){let r=typeof t=="object";return new Promise((n,i)=>{let o=new we({next:s=>{n(s),o.unsubscribe()},error:i,complete:()=>{r?n(t.defaultValue):i(new La)}});e.subscribe(o)})}function Ua(e){return e instanceof Date&&!isNaN(e)}function Br(e,t){return te((r,n)=>{let i=0;r.subscribe(kt(n,o=>{n.next(e.call(t,o,i++))}))})}var{isArray:cf}=Array;function uf(e,t){return cf(t)?e(...t):e(t)}function ai(e){return Br(t=>uf(e,t))}function Ba(e,t,r,n,i,o,s,f){let p=[],d=0,m=0,h=!1,b=()=>{h&&!p.length&&!d&&t.complete()},y=D=>d<n?E(D):p.push(D),E=D=>{o&&t.next(D),d++;let C=!1;ve(r(D,m++)).subscribe(kt(t,R=>{i?.(R),o?y(R):t.next(R)},()=>{C=!0},void 0,()=>{if(C)try{for(d--;p.length&&d<n;){let R=p.shift();s?Aa(t,s,()=>E(R)):E(R)}b()}catch(R){t.error(R)}}))};return e.subscribe(kt(t,y,()=>{h=!0,b()})),()=>{f?.()}}function Oo(e,t,r=1/0){return M(t)?Oo((n,i)=>Br((o,s)=>t(n,o,i,s))(ve(e(n,i))),r):(typeof t=="number"&&(r=t),te((n,i)=>Ba(n,i,e,r)))}var ff=["addListener","removeListener"],lf=["addEventListener","removeEventListener"],pf=["on","off"];function To(e,t,r,n){if(M(r)&&(n=r,r=void 0),n)return To(e,t,r).pipe(ai(n));let[i,o]=df(e)?lf.map(s=>f=>e[s](t,f,r)):hf(e)?ff.map(Ma(e,t)):mf(e)?pf.map(Ma(e,t)):[];if(!i&&si(e))return Oo(s=>To(s,t,r))(ve(e));if(!i)throw new TypeError("Invalid event target");return new vt(s=>{let f=(...p)=>s.next(1<p.length?p:p[0]);return i(f),()=>o(f)})}function Ma(e,t){return r=>n=>e[r](t,n)}function hf(e){return M(e.addListener)&&M(e.removeListener)}function mf(e){return M(e.on)&&M(e.off)}function df(e){return M(e.addEventListener)&&M(e.removeEventListener)}function Fa(e,t,r){return r?Fa(e,t).pipe(ai(r)):new vt(n=>{let i=(...s)=>n.next(s.length===1?s[0]:s),o=e(i);return M(t)?()=>t(i,o):void 0})}function ka(e=0,t,r=_a){let n=-1;return t!=null&&(wa(t)?r=t:n=t),new vt(i=>{let o=Ua(e)?+e-r.now():e;o<0&&(o=0);let s=0;return r.schedule(function(){i.closed||(i.next(s++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function gf(e,t){return te((r,n)=>{let i=0;r.subscribe(kt(n,o=>e.call(t,o,i++)&&n.next(o)))})}function Co(e,t=Ur){return te((r,n)=>{let i=null,o=null,s=null,f=()=>{if(i){i.unsubscribe(),i=null;let d=o;o=null,n.next(d)}};function p(){let d=s+e,m=t.now();if(m<d){i=this.schedule(void 0,d-m),n.add(i);return}f()}r.subscribe(kt(n,d=>{o=d,s=t.now(),i||(i=t.schedule(p,e),n.add(i))},()=>{f(),n.complete()},void 0,()=>{o=i=null}))})}function Va(e,t){return te((r,n)=>{let{leading:i=!0,trailing:o=!1}=t??{},s=!1,f=null,p=null,d=!1,m=()=>{p?.unsubscribe(),p=null,o&&(y(),d&&n.complete())},h=()=>{p=null,d&&n.complete()},b=E=>p=ve(e(E)).subscribe(kt(n,m,h)),y=()=>{if(s){s=!1;let E=f;f=null,n.next(E),!d&&b(E)}};r.subscribe(kt(n,E=>{s=!0,f=E,!(p&&!p.closed)&&(i?y():b(E))},()=>{d=!0,!(o&&s&&p&&!p.closed)&&n.complete()}))})}function No(e,t=Ur,r){let n=ka(e,t);return Va(()=>n,r)}var ke=(n=>(n[n.LOW=1]="LOW",n[n.MEDIUM=2]="MEDIUM",n[n.HIGH=3]="HIGH",n))(ke||{});var yf="2024-10",_f=`/api/${yf}/graphql.json`,$a={"Content-Type":"application/json"};async function ci(e,t,r,n){let i=Tt.get().storefrontToken;if(!i)throw new Error("Storefront token not set for the store");let o=new Headers($a);o.append("X-Shopify-Storefront-Access-Token",i);let s=JSON.stringify({query:e,variables:t});try{return await re(_f,{method:"POST",headers:o,body:s})}catch(f){throw tt(f,r,{engagementTrigger:n}),f}}function Ve(e,t){return wf(bn(e),t)}async function wf(e,t){let r={body:JSON.stringify(t),method:"POST",headers:$a};return re(e,r)}var ui=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(t=>this.queue.push(t));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let t=this.queue.shift();t&&t()}else this.isLocked=!1}},fi=class e{static LOCK_TIMEOUT=1e4;static RETRY_INTERVAL=200;static MAX_RETRIES=50;static async request(t,r){if(t=`__cooee_${t}_lock__`,"locks"in navigator&&!Ef())try{return await vf(t,r,this.LOCK_TIMEOUT)}catch(s){S.verbose(`Web Locks API failed, falling back to localStorage: ${s}`)}let n=!1,i=0,o=Math.random().toString(36).substring(2,10);for(;i++<this.MAX_RETRIES&&(S.verbose(`Lock retry ${i} for ${t}`),n=await this.acquire(t,o,i),!n);)await this.sleep(e.RETRY_INTERVAL*i+Math.random()*100);try{return await r()}finally{this.release(t,o)}}static async acquire(t,r,n){let i=Date.now(),o=localStorage.getItem(t),s=o?JSON.parse(o):null;if(s&&i<=s.expiry)return!1;let f={owner:r,expiry:i+e.LOCK_TIMEOUT};return localStorage.setItem(t,JSON.stringify(f)),await this.sleep(150+Math.random()*100),JSON.parse(localStorage.getItem(t)||"{}").owner===r?(S.verbose(`${r}: Lock acquired for ${t} after ${n} attempts!`),!0):(S.verbose(`${r}: Race lost. Another tab acquired the lock.`),!1)}static release(t,r){let n=localStorage.getItem(t);if(!n)return;let i=JSON.parse(n);i.owner===r?(localStorage.removeItem(t),S.verbose(`${r}: Lock released`)):S.verbose(`${r}: Cannot release lock. Current owner: ${i.owner}`)}static sleep(t){return new Promise(r=>setTimeout(r,t))}};async function vf(e,t,r){return new Promise((n,i)=>{let o=setTimeout(()=>{i(new Error(`Web Locks API timeout after ${r}ms`))},r);navigator.locks.request(e,async()=>{try{let s=await t();return clearTimeout(o),n(s),s}catch(s){throw clearTimeout(o),i(s),s}}).catch(s=>{clearTimeout(o),i(s)})})}function Ef(){let e=navigator.userAgent||"";return/Safari/.test(e)&&!/Chrome/.test(e)&&!/Chromium/.test(e)||/iPhone|iPad|iPod/i.test(e)&&(/(FBAV|FBAN|Instagram|Twitter|Line|WhatsApp)/i.test(e)||!window.safari?.pushNotificaTion)||/Macintosh/.test(e)&&/Safari/.test(e)&&!/Chrome/.test(e)&&!/Chromium/.test(e)&&!window.safari?.pushNotification?!0:bf()}function bf(){try{return window.safari?.pushNotification?window.safari.pushNotification.toString()==="[object SafariRemoteNotification]":!window.indexedDB||!window.localStorage}catch{return!0}}var Do=new ui;function ja(){Sf().catch(e=>{S.error("Fail to add attributes in cart",e)})}async function Sf(){await Do.acquire();let e=z.getCurrent(),t=await Xo();if(e.attributes?.letscooee_did===t.letscooee_did&&e.attributes?.letscooee_sn===t.letscooee_sn){S.verbose("Not calling Shopify update.js API.","Current attributes:",e.attributes),Do.release();return}try{let r=await Ve("/cart/update.js",{attributes:t});S.verbose("Updated cart attributes",JSON.stringify(r.data)),e.update(r.data)}catch(r){S.error("Failed to add cart attributes",r)}Do.release()}var Ha=me(Ro()),pi=class e{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(t){this.adID=t.adID,this.campaignID=t.campaignID,this.source=t.source}static getAdParams(){let t;try{t=new Ha.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(o=>Array.from(t.getParams().keys()).includes(o)))return r={source:"META",adID:t.getQueryParam("ad_id")?.trim(),campaignID:t.getQueryParam("campaign_id")?.trim()},new e(r);if(this.GOOGLE_REQUIRED_FIELDS.every(o=>Array.from(t.getParams().keys()).includes(o)))return r={source:"GOOGLE"},new e(r)}};var Ga=me(Ro());var xf=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],Wa={utm_source:"tw_source",utm_campaign:"tw_campaign"};var qa=()=>{if(document.referrer)return document.referrer.replace(location.origin,"")},Ya=()=>{let e;try{e=new Ga.URLBuilder(location.href)}catch{return{}}let t={};xf.forEach(n=>{let i=e.getQueryParam(n);i&&(t[n]=i)});let r={};return Object.keys(Wa).forEach(n=>{let i=e.getQueryParam(Wa[n]);i&&(r[n]=i)}),B(B({},r),t)};var Po=class{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(t){this.name=t.name,this.path=t.path,this.qs=t.qs,this.referrer=t.referrer,this.utmSource=t.utmSource||t.utm_source,this.utmMedium=t.utmMedium||t.utm_medium,this.utmCampaign=t.utmCampaign||t.utm_campaign,this.utmId=t.utmId||t.utm_id,this.utmTerm=t.utmTerm||t.utm_term,this.utmContent=t.utmContent||t.utm_content}};function hi(){let e=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new Po(B({origin:location.origin,path:e,qs:location.search,referrer:qa(),name:rt().pageName},Ya()))}function _w(){let e=rt(),t=new URLSearchParams(location.search),r=t.get("cooee-preview");if(r){let i=r.split(",").map(o=>o.trim()).filter(o=>Number.isInteger(+o));i.length&&(e.previewIDs=i)}let n=t.get("cooee-variant")?.trim();n&&(e.previewVariant=n)}function mi(){let e=rt();return It(B(It(B({},e.customContext),{page:hi(),locale:e.locale,currentItem:e.currentItem,previewIDs:e.previewIDs,previewVariant:e.previewVariant,engagementIDs:Tf(),cart:Ji()}),Of()),{host:window.location.host})}function Of(){let e=window.CooeeSDK.uaParser.getResult();return{os:e.os,device:e.device,browser:e.browser}}function Tf(){let e=document.querySelectorAll(".letscooee-engagement"),t=[];return e.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&t.push(n)}),t}var Cf="keepalive"in new Request(""),ee=new Headers;Pf();async function Ja(){let[e]=await Promise.all([za()]);return B(B({},mi()),e)}function Xa(e){Fe(Ee).then(()=>Nf(e??{}))}function Nf(e){tc("/v1/user/update",e).then(()=>{S.verbose("Updated user profile")}).catch(t=>{S.error("Error saving user profile",t)})}function Ka(e){return pr("/v1/event/generate-discount",e)}function kw(e){Fe(Ee).then(()=>Df({props:e}))}function Df(e){tc("/v1/device/update",e).then(()=>{S.verbose("Updated device properties")}).catch(async t=>{S.error("Error saving device property",t)})}function Qa(e){e&&ee.set("cooee-device-id",e)}function Za(e){e&&ee.set("cooee-first-seen",e.toUTCString())}function pr(e,t){return ec("POST",e,t)}function tc(e,t){return ec("PUT",e,t)}function ec(e,t,r){if(!xr()&&!rt().flags?.allowEvents)return S.log(`Rejecting ${e} ${t} as this is not e-commerce app`),Promise.reject();if(t.startsWith("http")||(t=vi.apiURL+t),r&&!Cf&&t.includes(Ao))return Rf(t,ee,r);let n={method:e,headers:ee,keepalive:!1};return r&&(n.body=JSON.stringify(r)),re(t,n)}function Rf(e,t,r){return new Promise((n,i)=>{let o=new XMLHttpRequest;o.open("POST",e,!0),t.forEach((s,f)=>{o.setRequestHeader(f,s)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{if(o.getResponseHeader("Content-Type")?.includes("application/json")){let f=JSON.parse(o.responseText);n({data:f,headers:t,request:o,status:o.status,statusText:o.statusText})}else i(new Error("Content-Type of response header is not json"))}catch(s){i(s)}else i(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{i(new Error("Network error occurred during the request."))},o.send(JSON.stringify(r))})}function Pf(){ee.set("Content-Type","application/json; charset=utf-8"),ee.set("cooee-sdk",$r),ee.set("cooee-sdk-code",jo.toString()),ee.set("cooee-sdk-version",$o),ee.set("cooee-shop-name",Rs()??"");let e=localStorage.getItem("cooeeDebugTill");(vi.debug||e&&new Date(e)>new Date)&&ee.set("cooee-sdk-debug","true")}var Lo={d:(e,t)=>{for(var r in t)Lo.o(t,r)&&!Lo.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},Uo={};Lo.d(Uo,{A:()=>Af,k:()=>Bo});var Mr=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(d){try{p(n.next(d))}catch(m){o(m)}}function f(d){try{p(n.throw(d))}catch(m){o(m)}}function p(d){var m;d.done?i(d.value):(m=d.value,m instanceof r?m:new r(function(h){h(m)})).then(s,f)}p((n=n.apply(e,t||[])).next())})},Fr=function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(p){return function(d){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,m[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&m[0]?n.return:m[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,m[1])).done)return i;switch(n=0,i&&(m=[2&m[0],i.value]),m[0]){case 0:case 1:i=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,n=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||m[0]!==6&&m[0]!==2)){s=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){s.label=m[1];break}if(m[0]===6&&s.label<i[1]){s.label=i[1],i=m;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(m);break}i[2]&&s.ops.pop(),s.trys.pop();continue}m=t.call(e,s)}catch(h){m=[6,h],n=0}finally{r=i=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([p,d])}}};function Bo(){return Mr(this,void 0,Promise,function(){return Fr(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n="Unknown",i=!1;function o(y){i||(i=!0,t({isPrivate:y,browserName:n}))}function s(){var y=0,E=parseInt("-1");try{E.toFixed(E)}catch(D){y=D.message.length}return y}function f(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return!1}})(39)}function p(){var y;return Mr(this,void 0,void 0,function(){var E,D;return Fr(this,function(C){switch(C.label){case 0:return C.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return C.sent(),o(!1),[3,3];case 2:return E=C.sent(),D=E,E instanceof Error&&(D=(y=E.message)!==null&&y!==void 0?y:E),typeof D!="string"?(o(!1),[2]):(o(!!D.includes("unknown transient reason")),[3,3]);case 3:return[2]}})})}function d(){var y;return Mr(this,void 0,Promise,function(){return Fr(this,function(E){switch(E.label){case 0:return((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,p()];case 1:return E.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var D=String(Math.random());try{var C=indexedDB.open(D,1);C.onupgradeneeded=function(R){var A=R.target.result,N=function(P){o(P)};try{A.createObjectStore("t",{autoIncrement:!0}).put(new Blob),N(!1)}catch(P){(P.message||"").includes("are not yet supported")?N(!0):N(!1)}finally{A.close(),indexedDB.deleteDatabase(D)}},C.onerror=function(){return o(!1)}}catch{o(!1)}})():(function(){var D=window.openDatabase,C=window.localStorage;try{D(null,null,null,null)}catch{return void o(!0)}try{C.setItem("test","1"),C.removeItem("test")}catch{return void o(!0)}o(!1)})(),E.label=3;case 3:return[2]}})})}function m(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,E){var D;o(Math.round(E/1048576)<2*Math.round(((D=window).performance!==void 0&&D.performance.memory!==void 0&&D.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(y){r(new Error("detectIncognito somehow failed to query storage quota: "+y.message))})}function h(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?m():(0,window.webkitRequestFileSystem)(0,1,function(){o(!1)},function(){o(!0)})}function b(){return Mr(this,void 0,Promise,function(){var y,E;return Fr(this,function(D){switch(D.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return[3,4];D.label=1;case 1:return D.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return D.sent(),o(!1),[3,4];case 3:return y=D.sent(),typeof(E=y instanceof Error&&typeof y.message=="string"?y.message:String(y))!="string"?(o(!1),[2]):(o(E.includes("Security error")),[2]);case 4:return o(navigator.serviceWorker===void 0),[2]}})})}(function(){return Mr(this,void 0,Promise,function(){return Fr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(n="Safari",[4,d()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(E=navigator.userAgent,n=E.match(/Chrome/)?navigator.brave!==void 0?"Brave":E.match(/Edg/)?"Edge":E.match(/OPR/)?"Opera":"Chrome":"Chromium",h(),[3,6]);case 3:return s()!==25?[3,5]:(n="Firefox",[4,b()]);case 4:return y.sent(),[3,6];case 5:f()?(n="Internet Explorer",o(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),y.label=6;case 6:return[2]}var E})})})().catch(r)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bo);var Af=Bo,rc=Uo.A,jw=Uo.k;var nc=me(Gr()),ic=async()=>{let e={};try{return await Lf(e)}catch(t){return tt(t,"device-properties"),e}},Lf=async e=>{let t=window.CooeeSDK.uaParser;Uf(e),Bf(e),Mf(e),e.referrer=document.referrer,e.host=location.origin,e.path=location.pathname,e.qs=location.search,e.locale=navigator.language,e.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:Ff()},e.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(e.headless=!0,He({headless:!0}));let r=t.getResult();return e.browser=r.browser,e.device=r.device,e.engine=r.engine,e.cpu=r.cpu,e.os=r.os,e.navigatorUA=navigator.userAgent,await Promise.all([$f(e),kf(e),jf(e)]),e},Uf=e=>{let t=navigator;if(!t.deviceMemory)return;let r=t.deviceMemory;e.mem={tot:r*1024}},Bf=e=>{let t=navigator,r=t.connection||t.mozConnection||t.webkitConnection;r?.effectiveType&&(e.net={type:r.effectiveType})},Mf=e=>{let t=screen.orientation?.type;t&&(e.orientation=t)},Ff=()=>{if(!document.body)return;let e=document.createElement("div");e.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(e);let t=window.devicePixelRatio||1,r=e.offsetWidth*t;return document.body.removeChild(e),r},kf=async e=>{try{await Vf(e)}catch(t){S.error("Unable to get location",t)}},Vf=async e=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(r=>{navigator.geolocation.getCurrentPosition(n=>{e.coords=[n.coords.latitude,n.coords.longitude],r()},()=>r())})},$f=async e=>{if("getBattery"in navigator)try{let r=await navigator.getBattery();e.bat={l:r.level*100,c:r.charging},He({"battery.level":e.bat.l,"battery.charging":e.bat.c})}catch{}},jf=async e=>{try{(await rc())?.isPrivate&&(e.incognito=!0,He({incognito:!0}))}catch(t){nc.default.error("Unable to detect private/incognito window",t)}};function oc(e){ac()}function sc(e){if(!ac())return;let t=ke[e]?.toLowerCase();t&&(S.verbose(`Sending ${t} intent to MS Clarity`),window.clarity("set","Cooee Intent",t))}function ac(){return window.clarity&&typeof window.clarity=="function"}var Ee=new Ar(1),uc="App ID or Shopify shop is not set",Mo="",be="",Fo="",di;function gv(e){Mo=e.appID,Fo=e.shopifyShop,Hf().then(async()=>{Ee.next(!0),Ee.complete()}).catch(t=>{t?.message?.includes(uc)&&tt(t,"initiate-session",{extra:e}),S.error("Unable to initiate session",t)})}async function za(){return await fc(),di}async function yv(){let e=Date.now();await fi.request("gen_did",async()=>{be=await xt.get("did"),be||(be=new mt().toHexString(),await xt.set("did",be)),S.info("Device ID:",be),pc(be)}),S.info(`Device ID set/get done in \u23F0 ${Wr(Date.now()-e)}`)}async function cc(){if(di)return;let[e,t,r]=await Promise.all([Rt.get("id",""),xt.get("sessionNumber",1),Rt.get("landing",{})]);lc(e,t,r)}async function Hf(){await fc()}async function fc(){let e=!1;await Gf()?(await Wf(),e=!0):await qf()?(await cc(),e=!0):await cc(),e&&await zf()}async function Wf(){S.info("Starting new session"),await Rt.clear();let e=new Date,t=new mt().toHexString(),r=await xt.get("sessionNumber",0)+1,n=hi();await Promise.all([xt.set("sessionNumber",r),Rt.set("id",t),Rt.set("lastUsedTime",e.getTime()),Rt.set("landing",n)]),lc(t,r,n)}async function Gf(){let e=await Rt.get("lastUsedTime",0);return e?(new Date().getTime()-e)/1e3>1800:!0}async function qf(){return!await Rt.get("synced",!1)}async function Yf(){if(!Mo&&!Fo)throw new Error(uc);let e=await ic(),t=mi();return It(B(B({deviceID:be,deviceProps:e,appID:Mo,shopifyShop:Fo},di),t),{sdk:$r,ad:pi.getAdParams(),occurred:Xf(rt().jsLoadTime),properties:{},uuid:await xt.get("uuid")})}async function zf(){S.info("Ensuring session on server"),await Jf();let e=Date.now(),t=await Yf();S.info(`Session data fetched in \u23F0 ${Wr(Date.now()-e)}`);try{let r=await pr("/v1/event/validate-session",t);S.info(`Auth finished in \u23F0 ${Wr(r.timeTakenMs)}`),await Rt.set("synced",!0),r.data.deviceID&&(await xt.set("did",be),pc(r.data.deviceID))}catch(r){throw S.error(r),r}}async function Jf(){let e=await xt.get("firstSeen"),t=e?new Date(e):new Date;e||await xt.set("firstSeen",t.toISOString()),Za(t),Hr("Visitor Info",{first_seen:t.toISOString()})}function lc(e,t,r){He({"cooee_session.number":t}),Hr("Visitor Session",{id:e,number:t,landing_page:r}),S.info(`Session number: ${t}, id: ${e}`),di={sessionID:e,sessionNumber:t,landingPage:r}}function pc(e){oc(e),Qa(e);let t=`device_id_${Math.floor(Math.random()*1e4)}`;Hr("Visitor Info",{device_id:e,[t]:e}),Go({id:e})}function Xf(e){return(new Date().getTime()-e.getTime())/1e3>1800?new Date:e}function Sv(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?Kf():document.visibilityState==="hidden"&&Qf()}}async function Kf(){}async function Qf(){let e=await Zf();if(e===0){S.info("Not sending duration as user was inactive on website");return}mc(e)}async function Zf(){let e=rt();return e.inInactive?0:(e.inInactive=!0,e.lastEnterInactive=new Date,Math.max(e.lastEnterInactive.getTime()-e.lastEnterActive.getTime(),0))}function hc(){let e=rt();return e.inInactive?(e.inInactive=!1,e.lastEnterActive=new Date,Math.max((e.lastEnterActive.getTime()-e.lastEnterInactive.getTime())/1e3,0)):0}var gi=class{triggerData;render(t){t.contentSource===vr.KLAVIYO&&(this.triggerData=t,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",t.klaviyoFormID]))}handleKlaviyoEvents(t){if(t.type!=="klaviyoForms")return;let r=t.detail;if(r.formId!==this.triggerData.klaviyoFormID){S.warn("Received invalid trigger callback");return}switch(r.type){case"open":ce(new Mt("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);ce(new Mt("CE Form Submitted",{form:n},this.triggerData)),Xa(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),ce(new Mt("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(t){let r={id:t.formId},n=t.metaData;if(je.hasKeys(n)){let i=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(f=>{i.includes(f)||(r[f]=n[f])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let o=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(o?.length||s?.length)&&(r.name=o+" "+s)}return r}};function dc(e){if(!tl()||!Tt.get().pixelPush)return;let r=ke[e.intent]?.toLowerCase();r&&(S.verbose(`Sending ${r} intent to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:r}))}function tl(){return window.fbq&&typeof window.fbq=="function"}var ko=new Map,yc=async e=>{for(let o of e.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(o,e)}catch(s){S.error(s)}if(e.isCartEmbed()&&!e.isSubscriptionUpsell()){let s=(await z.getCurrent().getNormalisedCart()).items.map(f=>f.mID);e.items=e.items.filter(f=>!s.includes(f.mID))}if(e.items=gc(e),Tt.get().currencyCount<=1)return e.items;if(e.isShoppableVideo())return await el(e.content.videoConfig,e),e.items;let t=e.items.length,r=e.items.map(o=>_c(o,e)),i=(await Promise.all(r)).filter(o=>o!=null);if(t&&!i.length){let o="Failed to fetch any product from Ajax API",s=new Mt("CE Campaign Failed",{reason:o,currency:e.currency},e);throw ce(s),new Error(o)}return gc(e,i)},gc=(e,t=e.items)=>{if(!e.isCartRecovery())return t;let r=z.getCurrent().items,n=[];for(let i of t)for(let o of i.vars){if(!o.isAvailable)continue;let s=r.find(d=>d.variant_id.toString()===o.mID);if(!s)continue;let f=new Lt(i);f.name=s.title;let p=new Ke(o);p.name=s.variant_title,p.price.d=s.discounted_price/100,f.variants=[p],n.push(f)}return n},el=async(e,t)=>{await Promise.all(e.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let i=await _c(n,t);return i||n}))}))},_c=async(e,t)=>{if(ko.has(e.mID))return ko.get(e.mID);let r,n=`/products/${e.slug}.js`;try{r=(await re(n)).data}catch(i){return i instanceof jr&&i.response?.status===404||tt(i,"fetch-shopify-product",{extra:{item:e,path:n},engagementTrigger:t}),null}return r?rl(e,r):(S.error("Item not found after AJAX call for:",e),null)},rl=(e,t)=>{if(!e||!t)return e;e.name=t.title,e.tags=t.tags,e.slug=t.handle;let r=e.selectedOrFirstVariant.value;return e.vars.map(n=>{let i=t.variants.find(o=>o.id===+n.mID);i!=null&&(n.name=i.title,n.isAvailable=i.available,n.price.d=i.price?i.price/100:i.price,n.price.effective=n.price.d,n.price.cmp=i.compare_at_price?i.compare_at_price/100:i.compare_at_price,+r.mID===i.id&&(r.effectivePrice.value=n.price.d))}),ko.set(e.mID,e),e};var kr=e=>{let t=e instanceof Lt?e.selectedOrFirstVariant.value.mID:e.vID,r=e instanceof Lt?e.selectedOrFirstVariant.value.name:e.vName;return{product_id:e.mID,product_name:e.name,variant_id:t,variant_name:r}};var Ao="/v1/event/track-page-unload";function wc(e){S.verbose(`Waiting for auth to send event ${e.name}`),Fe(Ee).then(()=>ce(e))}function mc(e){Fe(Ee).then(()=>{nl(e)})}async function nl(e){let t=rt().currentPageViewEvent;if(!t){S.warn("No page view event was stored previously");return}let r={pageViewEventID:t.id,pageViewEventName:t.name,pageActiveTimeMS:e};S.verbose("Sending page unload",r);try{await pr(Ao,r)}catch(n){throw S.error(`Error sending page unload for ${t} to server`,n),n}}function ce(e){il(e)}async function il(e){if(S.verbose(`Sending event: ${e.name}`,e),fl(e)){S.warn(`Rejecting event ${e.name}`);return}ja();let t=await Ja();Object.assign(e,t),hc(),Rt.set("lastUsedTime",new Date().getTime());let r=ul(e.name),n=r.toLowerCase().replace(/\s+/g,"-");try{let i=await pr(`/v1/event/track/${n}`,e);S.info("Event tracked:",r),ol(e)&&(rt().currentPageViewEvent={id:e.id,name:e.name}),sl(e,i.data)}catch(i){throw S.error(`Error sending event ${e.name} to server`,i),i}}function ol(e){return Ho.includes(e.name)?e.name==="View Cart"?!e.properties.drawer:!0:!1}function sl(e,t){al(e,t).catch(r=>{tt(r,"process-popup-response",{extra:{event:e,response:t}})}),cl(t)}async function al(e,t){if(!t.triggerData)return;let r=new jn(t.triggerData);r.occurred=e.occurred,S.log(`${r} will be shown`);let n;try{n=await yc(r)}catch(o){S.error("Failed to refresh the products",o);return}if(r.items=n,r.contentSource===vr.KLAVIYO){new gi().render(r);return}let i=await import("./renderer-7THALERZ.js");new i.FreeformRenderer().renderEngagement(r).catch(o=>{tt(o,"render-popup",{extra:{event:e},engagementTrigger:r})})}function cl(e){e.intent&&(sc(e.intent),dc(e),S.info(`Intent is ${ke[e.intent]}`))}function ul(e){return e.replace("CE ","").replace("Trigger","Campaign").replace("Screen","Page").replace("App ","")}function fl(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(S.warn("Not sending event as this is a test trigger"),!0):!1}var Ec=new qt,bc=new qt;function SE(){return bc.asObservable()}function yi(){Ec.next()}Ec.pipe(Co(100)).subscribe(dl.bind(void 0));function IE(){yi(),ll(),pl()}function ll(){let e=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){Sc(this._url).catch(t=>S.error("Unable to process cart change in XMLHttpRequest",t))}),e.apply(this,arguments)},S.verbose("Securely overwritten window.XMLHttpRequest.send method")}function pl(){let e=window.fetch;try{window.fetch=async function(t,r){return e(t,r).then(n=>{let i="";try{i=typeof t=="string"||t instanceof URL?t.toString():t?.url??n?.url??""}catch{}return Sc(i).catch(o=>S.error("Unable to process cart change in fetch",o)),n})},S.verbose("Securely overwritten window.fetch method")}catch(t){console.warn("Fail to override fetch.",`Cooee won't be able to track "Add To Cart" and "Remove From Cart" KPI.`),S.error(t)}}async function Sc(e){hl(e)&&yi()}function hl(e){return/\/cart\/(add|change|update|clear)/.test(e)}function ml(e,t){let r=e?.items,n=t.items,i=[],o=[];if(S.verbose(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(s=>{let f=r?.find(p=>p.vID===s.vID);if(f){if(f.quantity!==s.quantity){let p=f.quantity<s.quantity,d=Math.abs(f.quantity-s.quantity),m=It(B({},s),{quantity:d});p?i.push(m):o.push(m)}r&&Yo(r,f)}else i.push(s)}),r)for(let s of r)o.push(s);S.verbose(`Cart delta: added: ${i.length}, removed: ${o.length}`),i.length&&vc("Add To Cart",{items:i}),o.length&&e.token===t.token&&vc("Remove From Cart",{items:o}),(o.length||i.length)&&bc.next({itemsAdded:i,itemsRemoved:o,cart:t})}function vc(e,t){let r=new Mt(e,t);wc(r)}async function dl(){let e=await xt.get("cart",{}),t=await z.getCurrent().getNormalisedCart(!0);ml(e,t)}var ue=class e{static cartDrawerToggle$=new Rr({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Tt.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[e.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return e._instance||(e._instance=new e),e._instance}static initialize(){e.get()}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id==="rebuy-cart")return!!window.Rebuy?.SmartCart?.visible;let t=this.inShadow?this.isPresent():_o(this.cartDrawerElement);return S.info(`Cart drawer is currently ${t?"open":"close"}`),t}open(){if(this.isOpen()){S.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let t=document.querySelector(this.iconSelector);if(!t){S.verbose("No clickable cart icon found with selector",this.iconSelector);return}t.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===e.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(t,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(t)}catch(n){tt(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:t}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&t)this.element.classList.remove("is-empty"),this.element.renderContents?.(t);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!t?.items?.[0])return;let n=t.items[0].id,i=t.items[0].quantity,o=t.items[0].price;window.cartGiftUpdate(n,o,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?z.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(z.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,t?.items?.[0]?.id+""):(S.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:t,currentCart:z.getCurrent()}})),r&&yi()}async initialize(){let t=this.configWebsite.cartDrawerSelector;if(!t){await this.findCartDrawer();return}let r=t.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!xr())return;let t=this.selector||this.cartSelector;if(this.cartDrawerElement=await Ei(t),!this.cartDrawerElement){Ic.default.warn("Max attempts exhausted to find cart drawer");return}S.verbose("Found",this.cartDrawerElement,`from selector: ${t}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Ei(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let t=this.cartDrawerElement||this.cartDrawerShadowElement,r=new qt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(t,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(No(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,e.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let t=this.cartDrawerShadowElement.querySelector(this.selector);return t?_o(t):!1}async updateBubble(){let t=(await z.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=t+"")}manualCartIconClicked(t){!t.target.closest(this.iconSelector)||!t.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}};var xc=class{constructor(t){this.scalingFactor=t}getLayoutStyles(t){if(!t)return{display:"block"};let r={display:t.disp};return t.of&&(r.objectFit=t.of),t.pos==="absolute"&&(r.width="auto !important",r.position="absolute",r.right=t.right+"px",r.left=t.left+"px",r.top=t.top+"px",r.bottom=t.bottom+"px"),r}getSizeStyles(t){let r={};return t?.w&&(r.width=t.w),t?.h&&(r.height=t.h),t?.maxW&&(r.maxWidth=t.maxW),t?.maxH&&(r.maxHeight=t.maxH),t?.minW&&(r.minWidth=t.minW),t?.minH&&(r.minHeight=t.minH),r}getBorderStyles(t){if(!t)return{};let r={};return t.radius&&t.radius>0&&(r.borderRadius=this.getSizePx(t.radius)),t.width&&t.width>0&&(r.borderWidth=this.getSizePx(t.width),r.borderStyle=t.style?.toLowerCase(),t.color?this.getColourStyles(t.color,"border-color",r):r.borderColor="black"),r}getFlexStyles(t){return t?{gap:t.gap+"px",flexWrap:t.wrap,flexDirection:t.dir,justifyContent:t.jc,alignItems:t.ai,width:"100%"}:{}}getSpaceStyles(t){let r={};return t?(r.paddingTop=this.getSizePx(t.pt),r.paddingBottom=this.getSizePx(t.pb),r.paddingLeft=this.getSizePx(t.pl),r.paddingRight=this.getSizePx(t.pr),r.marginTop=this.getSizePx(t.mt),r.marginBottom=this.getSizePx(t.mb),r.marginLeft=t.cent?"auto":this.getSizePx(t.ml),r.marginRight=t.cent?"auto":this.getSizePx(t.mr),r):(r.margin="0 !important",r.padding="unset",r)}getBackgroundStyles(t){if(!t)return{};let r={};if(t.glossy){let n="backdrop-filter",i="-webkit-"+n,o=`blur(${t.glossy.radius}px)`;if(!CSS.supports(i,o)&&!CSS.supports(n,o))return{background:t.glossy.fallback.rgba};if(r[i]=o,r[n]=o,t.glossy.color)return this.getColourStyles(t.glossy.color,"background",r)}else if(t.solid){if(t.solid.grad)return this.getGradientStyles(t.solid.grad,"background",r);if(t.solid.hex)return{backgroundColor:t.solid.rgba}}else if(t.img){if(!t.img.src)return{};let n=(t.img.a??0)/100;r.background=`linear-gradient(rgba(0, 0, 0, ${n}), rgba(0, 0, 0, ${n})),url("${t.img.src}") no-repeat center`,r.backgroundSize="cover",t.img.a&&(r["-webkit-backdrop-filter"]=`opacity(${t.img.a})`,r.backdropFilter=`opacity(${t.img.a})`)}return r}getGradientStyles(t,r,n){if(n??={},t.type==="LINEAR"){let i=`linear-gradient(${t.ang}deg, ${t.c1}, ${t.c2}`;t.c3&&(i+=`, ${t.c3}`),i+=")",n[r]=i}return n}getColourStyles(t,r="color",n){return n??={},t?t.grad?this.getGradientStyles(t.grad,r,n):(t.hex&&(n[r]=t.rgba),n):n}getSizePx(t){return this.getScaledSize(t)+"px"}getScaledSize(t){return(t??0)*this.scalingFactor}};var Nc=me(Gr());var gl=`
|
|
14
|
+
`)}`:"",this.name="UnsubscriptionError",this.errors=r});function Le(e,t){if(e){let r=e.indexOf(t);0<=r&&e.splice(r,1)}}var Ft=class e{constructor(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}unsubscribe(){let t;if(!this.closed){this.closed=!0;let{_parentage:r}=this;if(r)if(this._parentage=null,Array.isArray(r))for(let o of r)o.remove(this);else r.remove(this);let{initialTeardown:n}=this;if(M(n))try{n()}catch(o){t=o instanceof Qn?o.errors:[o]}let{_finalizers:i}=this;if(i){this._finalizers=null;for(let o of i)try{ua(o)}catch(s){t=t??[],s instanceof Qn?t=[...t,...s.errors]:t.push(s)}}if(t)throw new Qn(t)}}add(t){var r;if(t&&t!==this)if(this.closed)ua(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}}_hasParent(t){let{_parentage:r}=this;return r===t||Array.isArray(r)&&r.includes(t)}_addParent(t){let{_parentage:r}=this;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t}_removeParent(t){let{_parentage:r}=this;r===t?this._parentage=null:Array.isArray(r)&&Le(r,t)}remove(t){let{_finalizers:r}=this;r&&Le(r,t),t instanceof e&&t._removeParent(this)}};Ft.EMPTY=(()=>{let e=new Ft;return e.closed=!0,e})();var wo=Ft.EMPTY;function Zn(e){return e instanceof Ft||e&&"closed"in e&&M(e.remove)&&M(e.add)&&M(e.unsubscribe)}function ua(e){M(e)?e():e.unsubscribe()}var Gt={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};var cr={setTimeout(e,t,...r){let{delegate:n}=cr;return n?.setTimeout?n.setTimeout(e,t,...r):setTimeout(e,t,...r)},clearTimeout(e){let{delegate:t}=cr;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function ti(e){cr.setTimeout(()=>{let{onUnhandledError:t}=Gt;if(t)t(e);else throw e})}function vo(){}var fa=Eo("C",void 0,void 0);function la(e){return Eo("E",void 0,e)}function pa(e){return Eo("N",e,void 0)}function Eo(e,t,r){return{kind:e,value:t,error:r}}var Ue=null;function ur(e){if(Gt.useDeprecatedSynchronousErrorHandling){let t=!Ue;if(t&&(Ue={errorThrown:!1,error:null}),e(),t){let{errorThrown:r,error:n}=Ue;if(Ue=null,r)throw n}}else e()}function ha(e){Gt.useDeprecatedSynchronousErrorHandling&&Ue&&(Ue.errorThrown=!0,Ue.error=e)}var Be=class extends Ft{constructor(t){super(),this.isStopped=!1,t?(this.destination=t,Zn(t)&&t.add(this)):this.destination=Xu}static create(t,r,n){return new we(t,r,n)}next(t){this.isStopped?So(pa(t),this):this._next(t)}error(t){this.isStopped?So(la(t),this):(this.isStopped=!0,this._error(t))}complete(){this.isStopped?So(fa,this):(this.isStopped=!0,this._complete())}unsubscribe(){this.closed||(this.isStopped=!0,super.unsubscribe(),this.destination=null)}_next(t){this.destination.next(t)}_error(t){try{this.destination.error(t)}finally{this.unsubscribe()}}_complete(){try{this.destination.complete()}finally{this.unsubscribe()}}},zu=Function.prototype.bind;function bo(e,t){return zu.call(e,t)}var Io=class{constructor(t){this.partialObserver=t}next(t){let{partialObserver:r}=this;if(r.next)try{r.next(t)}catch(n){ei(n)}}error(t){let{partialObserver:r}=this;if(r.error)try{r.error(t)}catch(n){ei(n)}else ei(t)}complete(){let{partialObserver:t}=this;if(t.complete)try{t.complete()}catch(r){ei(r)}}},we=class extends Be{constructor(t,r,n){super();let i;if(M(t)||!t)i={next:t??void 0,error:r??void 0,complete:n??void 0};else{let o;this&&Gt.useDeprecatedNextContext?(o=Object.create(t),o.unsubscribe=()=>this.unsubscribe(),i={next:t.next&&bo(t.next,o),error:t.error&&bo(t.error,o),complete:t.complete&&bo(t.complete,o)}):i=t}this.destination=new Io(i)}};function ei(e){Gt.useDeprecatedSynchronousErrorHandling?ha(e):ti(e)}function Ju(e){throw e}function So(e,t){let{onStoppedNotification:r}=Gt;r&&cr.setTimeout(()=>r(e,t))}var Xu={closed:!0,next:vo,error:Ju,complete:vo};var fr=typeof Symbol=="function"&&Symbol.observable||"@@observable";function ma(e){return e}function da(e){return e.length===0?ma:e.length===1?e[0]:function(r){return e.reduce((n,i)=>i(n),r)}}var vt=(()=>{class e{constructor(r){r&&(this._subscribe=r)}lift(r){let n=new e;return n.source=this,n.operator=r,n}subscribe(r,n,i){let o=Qu(r)?r:new we(r,n,i);return ur(()=>{let{operator:s,source:f}=this;o.add(s?s.call(o,f):f?this._subscribe(o):this._trySubscribe(o))}),o}_trySubscribe(r){try{return this._subscribe(r)}catch(n){r.error(n)}}forEach(r,n){return n=ga(n),new n((i,o)=>{let s=new we({next:f=>{try{r(f)}catch(p){o(p),s.unsubscribe()}},error:o,complete:i});this.subscribe(s)})}_subscribe(r){var n;return(n=this.source)===null||n===void 0?void 0:n.subscribe(r)}[fr](){return this}pipe(...r){return da(r)(this)}toPromise(r){return r=ga(r),new r((n,i)=>{let o;this.subscribe(s=>o=s,s=>i(s),()=>n(o))})}}return e.create=t=>new e(t),e})();function ga(e){var t;return(t=e??Gt.Promise)!==null&&t!==void 0?t:Promise}function Ku(e){return e&&M(e.next)&&M(e.error)&&M(e.complete)}function Qu(e){return e&&e instanceof Be||Ku(e)&&Zn(e)}function Zu(e){return M(e?.lift)}function te(e){return t=>{if(Zu(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}function kt(e,t,r,n,i){return new xo(e,t,r,n,i)}var xo=class extends Be{constructor(t,r,n,i,o,s){super(t),this.onFinalize=o,this.shouldUnsubscribe=s,this._next=r?function(f){try{r(f)}catch(p){t.error(p)}}:super._next,this._error=i?function(f){try{i(f)}catch(p){t.error(p)}finally{this.unsubscribe()}}:super._error,this._complete=n?function(){try{n()}catch(f){t.error(f)}finally{this.unsubscribe()}}:super._complete}unsubscribe(){var t;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){let{closed:r}=this;super.unsubscribe(),!r&&((t=this.onFinalize)===null||t===void 0||t.call(this))}}};var ya=ar(e=>function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"});var qt=(()=>{class e extends vt{constructor(){super(),this.closed=!1,this.currentObservers=null,this.observers=[],this.isStopped=!1,this.hasError=!1,this.thrownError=null}lift(r){let n=new ri(this,this);return n.operator=r,n}_throwIfClosed(){if(this.closed)throw new ya}next(r){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.currentObservers||(this.currentObservers=Array.from(this.observers));for(let n of this.currentObservers)n.next(r)}})}error(r){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.hasError=this.isStopped=!0,this.thrownError=r;let{observers:n}=this;for(;n.length;)n.shift().error(r)}})}complete(){ur(()=>{if(this._throwIfClosed(),!this.isStopped){this.isStopped=!0;let{observers:r}=this;for(;r.length;)r.shift().complete()}})}unsubscribe(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null}get observed(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0}_trySubscribe(r){return this._throwIfClosed(),super._trySubscribe(r)}_subscribe(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)}_innerSubscribe(r){let{hasError:n,isStopped:i,observers:o}=this;return n||i?wo:(this.currentObservers=null,o.push(r),new Ft(()=>{this.currentObservers=null,Le(o,r)}))}_checkFinalizedStatuses(r){let{hasError:n,thrownError:i,isStopped:o}=this;n?r.error(i):o&&r.complete()}asObservable(){let r=new vt;return r.source=this,r}}return e.create=(t,r)=>new ri(t,r),e})(),ri=class extends qt{constructor(t,r){super(),this.destination=t,this.source=r}next(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.next)===null||n===void 0||n.call(r,t)}error(t){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.error)===null||n===void 0||n.call(r,t)}complete(){var t,r;(r=(t=this.destination)===null||t===void 0?void 0:t.complete)===null||r===void 0||r.call(t)}_subscribe(t){var r,n;return(n=(r=this.source)===null||r===void 0?void 0:r.subscribe(t))!==null&&n!==void 0?n:wo}};var Rr=class extends qt{constructor(t){super(),this._value=t}get value(){return this.getValue()}_subscribe(t){let r=super._subscribe(t);return!r.closed&&t.next(this._value),r}getValue(){let{hasError:t,thrownError:r,_value:n}=this;if(t)throw r;return this._throwIfClosed(),n}next(t){super.next(this._value=t)}};var Pr={now(){return(Pr.delegate||Date).now()},delegate:void 0};var Ar=class extends qt{constructor(t=1/0,r=1/0,n=Pr){super(),this._bufferSize=t,this._windowTime=r,this._timestampProvider=n,this._buffer=[],this._infiniteTimeWindow=!0,this._infiniteTimeWindow=r===1/0,this._bufferSize=Math.max(1,t),this._windowTime=Math.max(1,r)}next(t){let{isStopped:r,_buffer:n,_infiniteTimeWindow:i,_timestampProvider:o,_windowTime:s}=this;r||(n.push(t),!i&&n.push(o.now()+s)),this._trimBuffer(),super.next(t)}_subscribe(t){this._throwIfClosed(),this._trimBuffer();let r=this._innerSubscribe(t),{_infiniteTimeWindow:n,_buffer:i}=this,o=i.slice();for(let s=0;s<o.length&&!t.closed;s+=n?1:2)t.next(o[s]);return this._checkFinalizedStatuses(t),r}_trimBuffer(){let{_bufferSize:t,_timestampProvider:r,_buffer:n,_infiniteTimeWindow:i}=this,o=(i?1:2)*t;if(t<1/0&&o<n.length&&n.splice(0,n.length-o),!i){let s=r.now(),f=0;for(let p=1;p<n.length&&n[p]<=s;p+=2)f=p;f&&n.splice(0,f+1)}}};var ni=class extends Ft{constructor(t,r){super()}schedule(t,r=0){return this}};var Lr={setInterval(e,t,...r){let{delegate:n}=Lr;return n?.setInterval?n.setInterval(e,t,...r):setInterval(e,t,...r)},clearInterval(e){let{delegate:t}=Lr;return(t?.clearInterval||clearInterval)(e)},delegate:void 0};var ii=class extends ni{constructor(t,r){super(t,r),this.scheduler=t,this.work=r,this.pending=!1}schedule(t,r=0){var n;if(this.closed)return this;this.state=t;let i=this.id,o=this.scheduler;return i!=null&&(this.id=this.recycleAsyncId(o,i,r)),this.pending=!0,this.delay=r,this.id=(n=this.id)!==null&&n!==void 0?n:this.requestAsyncId(o,this.id,r),this}requestAsyncId(t,r,n=0){return Lr.setInterval(t.flush.bind(t,this),n)}recycleAsyncId(t,r,n=0){if(n!=null&&this.delay===n&&this.pending===!1)return r;r!=null&&Lr.clearInterval(r)}execute(t,r){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;let n=this._execute(t,r);if(n)return n;this.pending===!1&&this.id!=null&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))}_execute(t,r){let n=!1,i;try{this.work(t)}catch(o){n=!0,i=o||new Error("Scheduled action threw falsy error")}if(n)return this.unsubscribe(),i}unsubscribe(){if(!this.closed){let{id:t,scheduler:r}=this,{actions:n}=r;this.work=this.state=this.scheduler=null,this.pending=!1,Le(n,this),t!=null&&(this.id=this.recycleAsyncId(r,t,null)),this.delay=null,super.unsubscribe()}}};var lr=class e{constructor(t,r=e.now){this.schedulerActionCtor=t,this.now=r}schedule(t,r=0,n){return new this.schedulerActionCtor(this,t).schedule(n,r)}};lr.now=Pr.now;var oi=class extends lr{constructor(t,r=lr.now){super(t,r),this.actions=[],this._active=!1}flush(t){let{actions:r}=this;if(this._active){r.push(t);return}let n;this._active=!0;do if(n=t.execute(t.state,t.delay))break;while(t=r.shift());if(this._active=!1,n){for(;t=r.shift();)t.unsubscribe();throw n}}};var Ur=new oi(ii),_a=Ur;function wa(e){return e&&M(e.schedule)}function Ea(e,t,r,n){function i(o){return o instanceof r?o:new r(function(s){s(o)})}return new(r||(r=Promise))(function(o,s){function f(m){try{d(n.next(m))}catch(h){s(h)}}function p(m){try{d(n.throw(m))}catch(h){s(h)}}function d(m){m.done?o(m.value):i(m.value).then(f,p)}d((n=n.apply(e,t||[])).next())})}function va(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Me(e){return this instanceof Me?(this.v=e,this):new Me(e)}function ba(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),i,o=[];return i=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),f("next"),f("throw"),f("return",s),i[Symbol.asyncIterator]=function(){return this},i;function s(y){return function(E){return Promise.resolve(E).then(y,h)}}function f(y,E){n[y]&&(i[y]=function(D){return new Promise(function(C,R){o.push([y,D,C,R])>1||p(y,D)})},E&&(i[y]=E(i[y])))}function p(y,E){try{d(n[y](E))}catch(D){b(o[0][3],D)}}function d(y){y.value instanceof Me?Promise.resolve(y.value.v).then(m,h):b(o[0][2],y)}function m(y){p("next",y)}function h(y){p("throw",y)}function b(y,E){y(E),o.shift(),o.length&&p(o[0][0],o[0][1])}}function Sa(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof va=="function"?va(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(o){r[o]=e[o]&&function(s){return new Promise(function(f,p){s=e[o](s),i(f,p,s.done,s.value)})}}function i(o,s,f,p){Promise.resolve(p).then(function(d){o({value:d,done:f})},s)}}var si=e=>e&&typeof e.length=="number"&&typeof e!="function";function Ia(e){return M(e?.then)}function xa(e){return M(e[fr])}function Oa(e){return Symbol.asyncIterator&&M(e?.[Symbol.asyncIterator])}function Ta(e){return new TypeError(`You provided ${e!==null&&typeof e=="object"?"an invalid object":`'${e}'`} where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.`)}function tf(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var Ca=tf();function Na(e){return M(e?.[Ca])}function Da(e){return ba(this,arguments,function*(){let r=e.getReader();try{for(;;){let{value:n,done:i}=yield Me(r.read());if(i)return yield Me(void 0);yield yield Me(n)}}finally{r.releaseLock()}})}function Ra(e){return M(e?.getReader)}function ve(e){if(e instanceof vt)return e;if(e!=null){if(xa(e))return ef(e);if(si(e))return rf(e);if(Ia(e))return nf(e);if(Oa(e))return Pa(e);if(Na(e))return of(e);if(Ra(e))return sf(e)}throw Ta(e)}function ef(e){return new vt(t=>{let r=e[fr]();if(M(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function rf(e){return new vt(t=>{for(let r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function nf(e){return new vt(t=>{e.then(r=>{t.closed||(t.next(r),t.complete())},r=>t.error(r)).then(null,ti)})}function of(e){return new vt(t=>{for(let r of e)if(t.next(r),t.closed)return;t.complete()})}function Pa(e){return new vt(t=>{af(e,t).catch(r=>t.error(r))})}function sf(e){return Pa(Da(e))}function af(e,t){var r,n,i,o;return Ea(this,void 0,void 0,function*(){try{for(r=Sa(e);n=yield r.next(),!n.done;){let s=n.value;if(t.next(s),t.closed)return}}catch(s){i={error:s}}finally{try{n&&!n.done&&(o=r.return)&&(yield o.call(r))}finally{if(i)throw i.error}}t.complete()})}function Aa(e,t,r,n=0,i=!1){let o=t.schedule(function(){r(),i?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(o),!i)return o}var La=ar(e=>function(){e(this),this.name="EmptyError",this.message="no elements in sequence"});function Fe(e,t){let r=typeof t=="object";return new Promise((n,i)=>{let o=new we({next:s=>{n(s),o.unsubscribe()},error:i,complete:()=>{r?n(t.defaultValue):i(new La)}});e.subscribe(o)})}function Ua(e){return e instanceof Date&&!isNaN(e)}function Br(e,t){return te((r,n)=>{let i=0;r.subscribe(kt(n,o=>{n.next(e.call(t,o,i++))}))})}var{isArray:cf}=Array;function uf(e,t){return cf(t)?e(...t):e(t)}function ai(e){return Br(t=>uf(e,t))}function Ba(e,t,r,n,i,o,s,f){let p=[],d=0,m=0,h=!1,b=()=>{h&&!p.length&&!d&&t.complete()},y=D=>d<n?E(D):p.push(D),E=D=>{o&&t.next(D),d++;let C=!1;ve(r(D,m++)).subscribe(kt(t,R=>{i?.(R),o?y(R):t.next(R)},()=>{C=!0},void 0,()=>{if(C)try{for(d--;p.length&&d<n;){let R=p.shift();s?Aa(t,s,()=>E(R)):E(R)}b()}catch(R){t.error(R)}}))};return e.subscribe(kt(t,y,()=>{h=!0,b()})),()=>{f?.()}}function Oo(e,t,r=1/0){return M(t)?Oo((n,i)=>Br((o,s)=>t(n,o,i,s))(ve(e(n,i))),r):(typeof t=="number"&&(r=t),te((n,i)=>Ba(n,i,e,r)))}var ff=["addListener","removeListener"],lf=["addEventListener","removeEventListener"],pf=["on","off"];function To(e,t,r,n){if(M(r)&&(n=r,r=void 0),n)return To(e,t,r).pipe(ai(n));let[i,o]=df(e)?lf.map(s=>f=>e[s](t,f,r)):hf(e)?ff.map(Ma(e,t)):mf(e)?pf.map(Ma(e,t)):[];if(!i&&si(e))return Oo(s=>To(s,t,r))(ve(e));if(!i)throw new TypeError("Invalid event target");return new vt(s=>{let f=(...p)=>s.next(1<p.length?p:p[0]);return i(f),()=>o(f)})}function Ma(e,t){return r=>n=>e[r](t,n)}function hf(e){return M(e.addListener)&&M(e.removeListener)}function mf(e){return M(e.on)&&M(e.off)}function df(e){return M(e.addEventListener)&&M(e.removeEventListener)}function Fa(e,t,r){return r?Fa(e,t).pipe(ai(r)):new vt(n=>{let i=(...s)=>n.next(s.length===1?s[0]:s),o=e(i);return M(t)?()=>t(i,o):void 0})}function ka(e=0,t,r=_a){let n=-1;return t!=null&&(wa(t)?r=t:n=t),new vt(i=>{let o=Ua(e)?+e-r.now():e;o<0&&(o=0);let s=0;return r.schedule(function(){i.closed||(i.next(s++),0<=n?this.schedule(void 0,n):i.complete())},o)})}function gf(e,t){return te((r,n)=>{let i=0;r.subscribe(kt(n,o=>e.call(t,o,i++)&&n.next(o)))})}function Co(e,t=Ur){return te((r,n)=>{let i=null,o=null,s=null,f=()=>{if(i){i.unsubscribe(),i=null;let d=o;o=null,n.next(d)}};function p(){let d=s+e,m=t.now();if(m<d){i=this.schedule(void 0,d-m),n.add(i);return}f()}r.subscribe(kt(n,d=>{o=d,s=t.now(),i||(i=t.schedule(p,e),n.add(i))},()=>{f(),n.complete()},void 0,()=>{o=i=null}))})}function Va(e,t){return te((r,n)=>{let{leading:i=!0,trailing:o=!1}=t??{},s=!1,f=null,p=null,d=!1,m=()=>{p?.unsubscribe(),p=null,o&&(y(),d&&n.complete())},h=()=>{p=null,d&&n.complete()},b=E=>p=ve(e(E)).subscribe(kt(n,m,h)),y=()=>{if(s){s=!1;let E=f;f=null,n.next(E),!d&&b(E)}};r.subscribe(kt(n,E=>{s=!0,f=E,!(p&&!p.closed)&&(i?y():b(E))},()=>{d=!0,!(o&&s&&p&&!p.closed)&&n.complete()}))})}function No(e,t=Ur,r){let n=ka(e,t);return Va(()=>n,r)}var ke=(n=>(n[n.LOW=1]="LOW",n[n.MEDIUM=2]="MEDIUM",n[n.HIGH=3]="HIGH",n))(ke||{});var yf="2024-10",_f=`/api/${yf}/graphql.json`,$a={"Content-Type":"application/json"};async function ci(e,t,r,n){let i=Tt.get().storefrontToken;if(!i)throw new Error("Storefront token not set for the store");let o=new Headers($a);o.append("X-Shopify-Storefront-Access-Token",i);let s=JSON.stringify({query:e,variables:t});try{return await re(_f,{method:"POST",headers:o,body:s})}catch(f){throw tt(f,r,{engagementTrigger:n}),f}}function Ve(e,t){return wf(bn(e),t)}async function wf(e,t){let r={body:JSON.stringify(t),method:"POST",headers:$a};return re(e,r)}var ui=class{isLocked=!1;queue=[];async acquire(){if(this.isLocked)await new Promise(t=>this.queue.push(t));else{this.isLocked=!0;return}}release(){if(this.queue.length>0){let t=this.queue.shift();t&&t()}else this.isLocked=!1}},fi=class e{static LOCK_TIMEOUT=1e4;static RETRY_INTERVAL=200;static MAX_RETRIES=50;static async request(t,r){if(t=`__cooee_${t}_lock__`,"locks"in navigator&&!Ef())try{return await vf(t,r,this.LOCK_TIMEOUT)}catch(s){S.verbose(`Web Locks API failed, falling back to localStorage: ${s}`)}let n=!1,i=0,o=Math.random().toString(36).substring(2,10);for(;i++<this.MAX_RETRIES&&(S.verbose(`Lock retry ${i} for ${t}`),n=await this.acquire(t,o,i),!n);)await this.sleep(e.RETRY_INTERVAL*i+Math.random()*100);try{return await r()}finally{this.release(t,o)}}static async acquire(t,r,n){let i=Date.now(),o=localStorage.getItem(t),s=o?JSON.parse(o):null;if(s&&i<=s.expiry)return!1;let f={owner:r,expiry:i+e.LOCK_TIMEOUT};return localStorage.setItem(t,JSON.stringify(f)),await this.sleep(150+Math.random()*100),JSON.parse(localStorage.getItem(t)||"{}").owner===r?(S.verbose(`${r}: Lock acquired for ${t} after ${n} attempts!`),!0):(S.verbose(`${r}: Race lost. Another tab acquired the lock.`),!1)}static release(t,r){let n=localStorage.getItem(t);if(!n)return;let i=JSON.parse(n);i.owner===r?(localStorage.removeItem(t),S.verbose(`${r}: Lock released`)):S.verbose(`${r}: Cannot release lock. Current owner: ${i.owner}`)}static sleep(t){return new Promise(r=>setTimeout(r,t))}};async function vf(e,t,r){return new Promise((n,i)=>{let o=setTimeout(()=>{i(new Error(`Web Locks API timeout after ${r}ms`))},r);navigator.locks.request(e,async()=>{try{let s=await t();return clearTimeout(o),n(s),s}catch(s){throw clearTimeout(o),i(s),s}}).catch(s=>{clearTimeout(o),i(s)})})}function Ef(){let e=navigator.userAgent||"";return/Safari/.test(e)&&!/Chrome/.test(e)&&!/Chromium/.test(e)||/iPhone|iPad|iPod/i.test(e)&&(/(FBAV|FBAN|Instagram|Twitter|Line|WhatsApp)/i.test(e)||!window.safari?.pushNotificaTion)||/Macintosh/.test(e)&&/Safari/.test(e)&&!/Chrome/.test(e)&&!/Chromium/.test(e)&&!window.safari?.pushNotification?!0:bf()}function bf(){try{return window.safari?.pushNotification?window.safari.pushNotification.toString()==="[object SafariRemoteNotification]":!window.indexedDB||!window.localStorage}catch{return!0}}var Do=new ui;function ja(){Sf().catch(e=>{S.error("Fail to add attributes in cart",e)})}async function Sf(){await Do.acquire();let e=z.getCurrent(),t=await Xo();if(e.attributes?.letscooee_did===t.letscooee_did&&e.attributes?.letscooee_sn===t.letscooee_sn){S.verbose("Not calling Shopify update.js API.","Current attributes:",e.attributes),Do.release();return}try{let r=await Ve("/cart/update.js",{attributes:t});S.verbose("Updated cart attributes",JSON.stringify(r.data)),e.update(r.data)}catch(r){S.error("Failed to add cart attributes",r)}Do.release()}var Ha=me(Ro()),pi=class e{static META_REQUIRED_FIELDS=["ad_id"];static GOOGLE_REQUIRED_FIELDS=["gad_source","gclid"];source;adID;campaignID;adName;campaignName;constructor(t){this.adID=t.adID,this.campaignID=t.campaignID,this.source=t.source}static getAdParams(){let t;try{t=new Ha.URLBuilder(location.href)}catch{return{}}let r={};if(this.META_REQUIRED_FIELDS.every(o=>Array.from(t.getParams().keys()).includes(o)))return r={source:"META",adID:t.getQueryParam("ad_id")?.trim(),campaignID:t.getQueryParam("campaign_id")?.trim()},new e(r);if(this.GOOGLE_REQUIRED_FIELDS.every(o=>Array.from(t.getParams().keys()).includes(o)))return r={source:"GOOGLE"},new e(r)}};var Ga=me(Ro());var xf=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],Wa={utm_source:"tw_source",utm_campaign:"tw_campaign"};var qa=()=>{if(document.referrer)return document.referrer.replace(location.origin,"")},Ya=()=>{let e;try{e=new Ga.URLBuilder(location.href)}catch{return{}}let t={};xf.forEach(n=>{let i=e.getQueryParam(n);i&&(t[n]=i)});let r={};return Object.keys(Wa).forEach(n=>{let i=e.getQueryParam(Wa[n]);i&&(r[n]=i)}),B(B({},r),t)};var Po=class{origin;path;qs;name;referrer;utmSource;utmMedium;utmCampaign;utmId;utmTerm;utmContent;constructor(t){this.name=t.name,this.path=t.path,this.qs=t.qs,this.referrer=t.referrer,this.utmSource=t.utmSource||t.utm_source,this.utmMedium=t.utmMedium||t.utm_medium,this.utmCampaign=t.utmCampaign||t.utm_campaign,this.utmId=t.utmId||t.utm_id,this.utmTerm=t.utmTerm||t.utm_term,this.utmContent=t.utmContent||t.utm_content}};function hi(){let e=location.pathname==="/"?location.pathname:location.pathname.replace(/\/+$/,"");return new Po(B({origin:location.origin,path:e,qs:location.search,referrer:qa(),name:rt().pageName},Ya()))}function _w(){let e=rt(),t=new URLSearchParams(location.search),r=t.get("cooee-preview");if(r){let i=r.split(",").map(o=>o.trim()).filter(o=>Number.isInteger(+o));i.length&&(e.previewIDs=i)}let n=t.get("cooee-variant")?.trim();n&&(e.previewVariant=n)}function mi(){let e=rt();return It(B(It(B({},e.customContext),{page:hi(),locale:e.locale,currentItem:e.currentItem,previewIDs:e.previewIDs,previewVariant:e.previewVariant,engagementIDs:Tf(),cart:Ji()}),Of()),{host:window.location.host})}function Of(){let e=window.CooeeSDK.uaParser.getResult();return{os:e.os,device:e.device,browser:e.browser}}function Tf(){let e=document.querySelectorAll(".letscooee-engagement"),t=[];return e.forEach(r=>{let n=r.dataset.engagementId;n&&+n&&t.push(n)}),t}var Cf="keepalive"in new Request(""),ee=new Headers;Pf();async function Ja(){let[e]=await Promise.all([za()]);return B(B({},mi()),e)}function Xa(e){Fe(Ee).then(()=>Nf(e??{}))}function Nf(e){tc("/v1/user/update",e).then(()=>{S.verbose("Updated user profile")}).catch(t=>{S.error("Error saving user profile",t)})}function Ka(e){return pr("/v1/event/generate-discount",e)}function kw(e){Fe(Ee).then(()=>Df({props:e}))}function Df(e){tc("/v1/device/update",e).then(()=>{S.verbose("Updated device properties")}).catch(async t=>{S.error("Error saving device property",t)})}function Qa(e){e&&ee.set("cooee-device-id",e)}function Za(e){e&&ee.set("cooee-first-seen",e.toUTCString())}function pr(e,t){return ec("POST",e,t)}function tc(e,t){return ec("PUT",e,t)}function ec(e,t,r){if(!xr()&&!rt().flags?.allowEvents)return S.log(`Rejecting ${e} ${t} as this is not e-commerce app`),Promise.reject();if(t.startsWith("http")||(t=vi.apiURL+t),r&&!Cf&&t.includes(Ao))return Rf(t,ee,r);let n={method:e,headers:ee,keepalive:!1};return r&&(n.body=JSON.stringify(r)),re(t,n)}function Rf(e,t,r){return new Promise((n,i)=>{let o=new XMLHttpRequest;o.open("POST",e,!0),t.forEach((s,f)=>{o.setRequestHeader(f,s)}),o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE)if(o.status>=200&&o.status<300)try{if(o.getResponseHeader("Content-Type")?.includes("application/json")){let f=JSON.parse(o.responseText);n({data:f,headers:t,request:o,status:o.status,statusText:o.statusText})}else i(new Error("Content-Type of response header is not json"))}catch(s){i(s)}else i(new Error(`Received status - ${o.status}(${o.statusText})`))},o.onerror=()=>{i(new Error("Network error occurred during the request."))},o.send(JSON.stringify(r))})}function Pf(){ee.set("Content-Type","application/json; charset=utf-8"),ee.set("cooee-sdk",$r),ee.set("cooee-sdk-code",jo.toString()),ee.set("cooee-sdk-version",$o),ee.set("cooee-shop-name",Rs()??"");let e=localStorage.getItem("cooeeDebugTill");(vi.debug||e&&new Date(e)>new Date)&&ee.set("cooee-sdk-debug","true")}var Lo={d:(e,t)=>{for(var r in t)Lo.o(t,r)&&!Lo.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},Uo={};Lo.d(Uo,{A:()=>Af,k:()=>Bo});var Mr=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(d){try{p(n.next(d))}catch(m){o(m)}}function f(d){try{p(n.throw(d))}catch(m){o(m)}}function p(d){var m;d.done?i(d.value):(m=d.value,m instanceof r?m:new r(function(h){h(m)})).then(s,f)}p((n=n.apply(e,t||[])).next())})},Fr=function(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:f(0),throw:f(1),return:f(2)},typeof Symbol=="function"&&(o[Symbol.iterator]=function(){return this}),o;function f(p){return function(d){return(function(m){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,m[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&m[0]?n.return:m[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,m[1])).done)return i;switch(n=0,i&&(m=[2&m[0],i.value]),m[0]){case 0:case 1:i=m;break;case 4:return s.label++,{value:m[1],done:!1};case 5:s.label++,n=m[1],m=[0];continue;case 7:m=s.ops.pop(),s.trys.pop();continue;default:if(i=s.trys,!((i=i.length>0&&i[i.length-1])||m[0]!==6&&m[0]!==2)){s=0;continue}if(m[0]===3&&(!i||m[1]>i[0]&&m[1]<i[3])){s.label=m[1];break}if(m[0]===6&&s.label<i[1]){s.label=i[1],i=m;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(m);break}i[2]&&s.ops.pop(),s.trys.pop();continue}m=t.call(e,s)}catch(h){m=[6,h],n=0}finally{r=i=0}if(5&m[0])throw m[1];return{value:m[0]?m[1]:void 0,done:!0}})([p,d])}}};function Bo(){return Mr(this,void 0,Promise,function(){return Fr(this,function(e){switch(e.label){case 0:return[4,new Promise(function(t,r){var n="Unknown",i=!1;function o(y){i||(i=!0,t({isPrivate:y,browserName:n}))}function s(){var y=0,E=parseInt("-1");try{E.toFixed(E)}catch(D){y=D.message.length}return y}function f(){return navigator.msSaveBlob!==void 0&&(function(y){try{return y===eval.toString().length}catch{return!1}})(39)}function p(){var y;return Mr(this,void 0,void 0,function(){var E,D;return Fr(this,function(C){switch(C.label){case 0:return C.trys.push([0,2,,3]),[4,navigator.storage.getDirectory()];case 1:return C.sent(),o(!1),[3,3];case 2:return E=C.sent(),D=E,E instanceof Error&&(D=(y=E.message)!==null&&y!==void 0?y:E),typeof D!="string"?(o(!1),[2]):(o(!!D.includes("unknown transient reason")),[3,3]);case 3:return[2]}})})}function d(){var y;return Mr(this,void 0,Promise,function(){return Fr(this,function(E){switch(E.label){case 0:return((y=navigator.storage)===null||y===void 0?void 0:y.getDirectory)===void 0?[3,2]:[4,p()];case 1:return E.sent(),[3,3];case 2:navigator.maxTouchPoints!==void 0?(function(){var D=String(Math.random());try{var C=indexedDB.open(D,1);C.onupgradeneeded=function(R){var A=R.target.result,N=function(P){o(P)};try{A.createObjectStore("t",{autoIncrement:!0}).put(new Blob),N(!1)}catch(P){(P.message||"").includes("are not yet supported")?N(!0):N(!1)}finally{A.close(),indexedDB.deleteDatabase(D)}},C.onerror=function(){return o(!1)}}catch{o(!1)}})():(function(){var D=window.openDatabase,C=window.localStorage;try{D(null,null,null,null)}catch{return void o(!0)}try{C.setItem("test","1"),C.removeItem("test")}catch{return void o(!0)}o(!1)})(),E.label=3;case 3:return[2]}})})}function m(){navigator.webkitTemporaryStorage.queryUsageAndQuota(function(y,E){var D;o(Math.round(E/1048576)<2*Math.round(((D=window).performance!==void 0&&D.performance.memory!==void 0&&D.performance.memory.jsHeapSizeLimit!==void 0?performance.memory.jsHeapSizeLimit:1073741824)/1048576))},function(y){r(new Error("detectIncognito somehow failed to query storage quota: "+y.message))})}function h(){self.Promise!==void 0&&self.Promise.allSettled!==void 0?m():(0,window.webkitRequestFileSystem)(0,1,function(){o(!1)},function(){o(!0)})}function b(){return Mr(this,void 0,Promise,function(){var y,E;return Fr(this,function(D){switch(D.label){case 0:if(!navigator.storage||!navigator.storage.getDirectory)return[3,4];D.label=1;case 1:return D.trys.push([1,3,,4]),[4,navigator.storage.getDirectory()];case 2:return D.sent(),o(!1),[3,4];case 3:return y=D.sent(),typeof(E=y instanceof Error&&typeof y.message=="string"?y.message:String(y))!="string"?(o(!1),[2]):(o(E.includes("Security error")),[2]);case 4:return o(navigator.serviceWorker===void 0),[2]}})})}(function(){return Mr(this,void 0,Promise,function(){return Fr(this,function(y){switch(y.label){case 0:return s()!==44?[3,2]:(n="Safari",[4,d()]);case 1:return y.sent(),[3,6];case 2:return s()!==51?[3,3]:(E=navigator.userAgent,n=E.match(/Chrome/)?navigator.brave!==void 0?"Brave":E.match(/Edg/)?"Edge":E.match(/OPR/)?"Opera":"Chrome":"Chromium",h(),[3,6]);case 3:return s()!==25?[3,5]:(n="Firefox",[4,b()]);case 4:return y.sent(),[3,6];case 5:f()?(n="Internet Explorer",o(window.indexedDB===void 0)):r(new Error("detectIncognito cannot determine the browser")),y.label=6;case 6:return[2]}var E})})})().catch(r)})];case 1:return[2,e.sent()]}})})}typeof window<"u"&&(window.detectIncognito=Bo);var Af=Bo,rc=Uo.A,jw=Uo.k;var nc=me(Gr()),ic=async()=>{let e={};try{return await Lf(e)}catch(t){return tt(t,"device-properties"),e}},Lf=async e=>{let t=window.CooeeSDK.uaParser;Uf(e),Bf(e),Mf(e),e.referrer=document.referrer,e.host=location.origin,e.path=location.pathname,e.qs=location.search,e.locale=navigator.language,e.display={w:screen.width,h:screen.height,pd:screen.pixelDepth,dpi:Ff()},e.win={ow:window.outerWidth,oh:window.outerHeight,iw:window.innerWidth,ih:window.innerHeight,dpr:window.devicePixelRatio},navigator.webdriver&&(e.headless=!0,He({headless:!0}));let r=t.getResult();return e.browser=r.browser,e.device=r.device,e.engine=r.engine,e.cpu=r.cpu,e.os=r.os,e.navigatorUA=navigator.userAgent,await Promise.all([$f(e),kf(e),jf(e)]),e},Uf=e=>{let t=navigator;if(!t.deviceMemory)return;let r=t.deviceMemory;e.mem={tot:r*1024}},Bf=e=>{let t=navigator,r=t.connection||t.mozConnection||t.webkitConnection;r?.effectiveType&&(e.net={type:r.effectiveType})},Mf=e=>{let t=screen.orientation?.type;t&&(e.orientation=t)},Ff=()=>{if(!document.body)return;let e=document.createElement("div");e.setAttribute("style","height: 1in; left: -100%; position: absolute; top: -100%; width: 1in;"),document.body.appendChild(e);let t=window.devicePixelRatio||1,r=e.offsetWidth*t;return document.body.removeChild(e),r},kf=async e=>{try{await Vf(e)}catch(t){S.error("Unable to get location",t)}},Vf=async e=>{if(!(!navigator.geolocation||!navigator.permissions||(await navigator.permissions.query({name:"geolocation"})).state!="granted"))return new Promise(r=>{navigator.geolocation.getCurrentPosition(n=>{e.coords=[n.coords.latitude,n.coords.longitude],r()},()=>r())})},$f=async e=>{if("getBattery"in navigator)try{let r=await navigator.getBattery();e.bat={l:r.level*100,c:r.charging},He({"battery.level":e.bat.l,"battery.charging":e.bat.c})}catch{}},jf=async e=>{try{(await rc())?.isPrivate&&(e.incognito=!0,He({incognito:!0}))}catch(t){nc.default.error("Unable to detect private/incognito window",t)}};function oc(e){ac()}function sc(e){if(!ac())return;let t=ke[e]?.toLowerCase();t&&(S.verbose(`Sending ${t} intent to MS Clarity`),window.clarity("set","Cooee Intent",t))}function ac(){return window.clarity&&typeof window.clarity=="function"}var Ee=new Ar(1),uc="App ID or Shopify shop is not set",Mo="",be="",Fo="",di;function gv(e){Mo=e.appID,Fo=e.shopifyShop,Hf().then(async()=>{Ee.next(!0),Ee.complete()}).catch(t=>{t?.message?.includes(uc)&&tt(t,"initiate-session",{extra:e}),S.error("Unable to initiate session",t)})}async function za(){return await fc(),di}async function yv(){let e=Date.now();await fi.request("gen_did",async()=>{be=await xt.get("did"),be||(be=new mt().toHexString(),await xt.set("did",be)),S.info("Device ID:",be),pc(be)}),S.info(`Device ID set/get done in \u23F0 ${Wr(Date.now()-e)}`)}async function cc(){if(di)return;let[e,t,r]=await Promise.all([Rt.get("id",""),xt.get("sessionNumber",1),Rt.get("landing",{})]);lc(e,t,r)}async function Hf(){await fc()}async function fc(){let e=!1;await Gf()?(await Wf(),e=!0):await qf()?(await cc(),e=!0):await cc(),e&&await zf()}async function Wf(){S.info("Starting new session"),await Rt.clear();let e=new Date,t=new mt().toHexString(),r=await xt.get("sessionNumber",0)+1,n=hi();await Promise.all([xt.set("sessionNumber",r),Rt.set("id",t),Rt.set("lastUsedTime",e.getTime()),Rt.set("landing",n)]),lc(t,r,n)}async function Gf(){let e=await Rt.get("lastUsedTime",0);return e?(new Date().getTime()-e)/1e3>1800:!0}async function qf(){return!await Rt.get("synced",!1)}async function Yf(){if(!Mo&&!Fo)throw new Error(uc);let e=await ic(),t=mi();return It(B(B({deviceID:be,deviceProps:e,appID:Mo,shopifyShop:Fo},di),t),{sdk:$r,ad:pi.getAdParams(),occurred:Xf(rt().jsLoadTime),properties:{},uuid:await xt.get("uuid")})}async function zf(){S.info("Ensuring session on server"),await Jf();let e=Date.now(),t=await Yf();S.info(`Session data fetched in \u23F0 ${Wr(Date.now()-e)}`);try{let r=await pr("/v1/event/validate-session",t);S.info(`Auth finished in \u23F0 ${Wr(r.timeTakenMs)}`),await Rt.set("synced",!0),r.data.deviceID&&(await xt.set("did",be),pc(r.data.deviceID))}catch(r){throw S.error(r),r}}async function Jf(){let e=await xt.get("firstSeen"),t=e?new Date(e):new Date;e||await xt.set("firstSeen",t.toISOString()),Za(t),Hr("Visitor Info",{first_seen:t.toISOString()})}function lc(e,t,r){He({"cooee_session.number":t}),Hr("Visitor Session",{id:e,number:t,landing_page:r}),S.info(`Session number: ${t}, id: ${e}`),di={sessionID:e,sessionNumber:t,landingPage:r}}function pc(e){oc(e),Qa(e);let t=`device_id_${Math.floor(Math.random()*1e4)}`;Hr("Visitor Info",{device_id:e,[t]:e}),Go({id:e})}function Xf(e){return(new Date().getTime()-e.getTime())/1e3>1800?new Date:e}function Sv(){document.onvisibilitychange=()=>{document.visibilityState==="visible"?Kf():document.visibilityState==="hidden"&&Qf()}}async function Kf(){}async function Qf(){let e=await Zf();if(e===0){S.info("Not sending duration as user was inactive on website");return}mc(e)}async function Zf(){let e=rt();return e.inInactive?0:(e.inInactive=!0,e.lastEnterInactive=new Date,Math.max(e.lastEnterInactive.getTime()-e.lastEnterActive.getTime(),0))}function hc(){let e=rt();return e.inInactive?(e.inInactive=!1,e.lastEnterActive=new Date,Math.max((e.lastEnterActive.getTime()-e.lastEnterInactive.getTime())/1e3,0)):0}var gi=class{triggerData;render(t){t.contentSource===vr.KLAVIYO&&(this.triggerData=t,window.addEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),window._klOnsite=window._klOnsite||[],window._klOnsite.push(["openForm",t.klaviyoFormID]))}handleKlaviyoEvents(t){if(t.type!=="klaviyoForms")return;let r=t.detail;if(r.formId!==this.triggerData.klaviyoFormID){S.warn("Received invalid trigger callback");return}switch(r.type){case"open":ce(new Mt("CE Trigger Displayed",{form:{id:r.formId}},this.triggerData));break;case"stepSubmit":{let n=this.getFormDetails(r);ce(new Mt("CE Form Submitted",{form:n},this.triggerData)),Xa(n);break}case"close":window.removeEventListener("klaviyoForms",this.handleKlaviyoEvents.bind(this)),ce(new Mt("CE Trigger Closed",{form:{id:r.formId}},this.triggerData));break}}getFormDetails(t){let r={id:t.formId},n=t.metaData;if(je.hasKeys(n)){let i=["email","phone_number","first_name","last_name","$email","$phone_number","$first_name","$last_name"];Object.keys(n).forEach(f=>{i.includes(f)||(r[f]=n[f])}),r.email=n.$email??n.email,r.mobile=n.$phone_number??n.phone_number;let o=n.$first_name??n.first_name,s=n.$last_name??n.last_name;(o?.length||s?.length)&&(r.name=o+" "+s)}return r}};function dc(e){if(!tl()||!Tt.get().pixelPush)return;let r=ke[e.intent]?.toLowerCase();r&&(S.verbose(`Sending ${r} intent to Facebook Pixel`),window.fbq("trackCustom","CooeeIntent",{intent_value:r}))}function tl(){return window.fbq&&typeof window.fbq=="function"}var ko=new Map,yc=async e=>{for(let o of e.items)if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(o,e)}catch(s){S.error(s)}if(e.isCartEmbed()&&!e.isSubscriptionUpsell()){let s=(await z.getCurrent().getNormalisedCart()).items.map(f=>f.mID);e.items=e.items.filter(f=>!s.includes(f.mID))}if(e.items=gc(e),Tt.get().currencyCount<=1)return e.items;if(e.isShoppableVideo())return await el(e.content.videoConfig,e),e.items;let t=e.items.length,r=e.items.map(o=>_c(o,e)),i=(await Promise.all(r)).filter(o=>o!=null);if(t&&!i.length){let o="Failed to fetch any product from Ajax API",s=new Mt("CE Campaign Failed",{reason:o,currency:e.currency},e);throw ce(s),new Error(o)}return gc(e,i)},gc=(e,t=e.items)=>{if(!e.isCartRecovery())return t;let r=z.getCurrent().items,n=[];for(let i of t)for(let o of i.vars){if(!o.isAvailable)continue;let s=r.find(d=>d.variant_id.toString()===o.mID);if(!s)continue;let f=new Lt(i);f.name=s.title;let p=new Ke(o);p.name=s.variant_title,p.price.d=s.discounted_price/100,f.variants=[p],n.push(f)}return n},el=async(e,t)=>{await Promise.all(e.videos.map(async r=>{r.items=await Promise.all(r.items.map(async n=>{let i=await _c(n,t);return i||n}))}))},_c=async(e,t)=>{if(ko.has(e.mID))return ko.get(e.mID);let r,n=`/products/${e.slug}.js`;try{r=(await re(n)).data}catch(i){return i instanceof jr&&i.response?.status===404||tt(i,"fetch-shopify-product",{extra:{item:e,path:n},engagementTrigger:t}),null}return r?rl(e,r):(S.error("Item not found after AJAX call for:",e),null)},rl=(e,t)=>{if(!e||!t)return e;e.name=t.title,e.tags=t.tags,e.slug=t.handle;let r=e.selectedOrFirstVariant.value;return e.vars.map(n=>{let i=t.variants.find(o=>o.id===+n.mID);i!=null&&(n.name=i.title,n.isAvailable=i.available,n.price.d=i.price?i.price/100:i.price,n.price.effective=n.price.d,n.price.cmp=i.compare_at_price?i.compare_at_price/100:i.compare_at_price,+r.mID===i.id&&(r.effectivePrice.value=n.price.d))}),ko.set(e.mID,e),e};var kr=e=>{let t=e instanceof Lt?e.selectedOrFirstVariant.value.mID:e.vID,r=e instanceof Lt?e.selectedOrFirstVariant.value.name:e.vName;return{product_id:e.mID,product_name:e.name,variant_id:t,variant_name:r}};var Ao="/v1/event/track-page-unload";function wc(e){S.verbose(`Waiting for auth to send event ${e.name}`),Fe(Ee).then(()=>ce(e))}function mc(e){Fe(Ee).then(()=>{nl(e)})}async function nl(e){let t=rt().currentPageViewEvent;if(!t){S.warn("No page view event was stored previously");return}let r={pageViewEventID:t.id,pageViewEventName:t.name,pageActiveTimeMS:e};S.verbose("Sending page unload",r);try{await pr(Ao,r)}catch(n){throw S.error(`Error sending page unload for ${t} to server`,n),n}}function ce(e){il(e)}async function il(e){if(S.verbose(`Sending event: ${e.name}`,e),fl(e)){S.warn(`Rejecting event ${e.name}`);return}ja();let t=await Ja();Object.assign(e,t),hc(),Rt.set("lastUsedTime",new Date().getTime());let r=ul(e.name),n=r.toLowerCase().replace(/\s+/g,"-");try{let i=await pr(`/v1/event/track/${n}`,e);S.info("Event tracked:",r),ol(e)&&(rt().currentPageViewEvent={id:e.id,name:e.name}),sl(e,i.data)}catch(i){throw S.error(`Error sending event ${e.name} to server`,i),i}}function ol(e){return Ho.includes(e.name)?e.name==="View Cart"?!e.properties.drawer:!0:!1}function sl(e,t){al(e,t).catch(r=>{tt(r,"process-popup-response",{extra:{event:e,response:t}})}),cl(t)}async function al(e,t){if(!t.triggerData)return;let r=new jn(t.triggerData);r.occurred=e.occurred,S.log(`${r} will be shown`);let n;try{n=await yc(r)}catch(o){S.error("Failed to refresh the products",o);return}if(r.items=n,r.contentSource===vr.KLAVIYO){new gi().render(r);return}let i=await import("./renderer-TBPM7OV3.js");new i.FreeformRenderer().renderEngagement(r).catch(o=>{tt(o,"render-popup",{extra:{event:e},engagementTrigger:r})})}function cl(e){e.intent&&(sc(e.intent),dc(e),S.info(`Intent is ${ke[e.intent]}`))}function ul(e){return e.replace("CE ","").replace("Trigger","Campaign").replace("Screen","Page").replace("App ","")}function fl(e){return e.trigger?.triggerID==="test"||e.trigger?.triggerID==="preview"?(S.warn("Not sending event as this is a test trigger"),!0):!1}var Ec=new qt,bc=new qt;function SE(){return bc.asObservable()}function yi(){Ec.next()}Ec.pipe(Co(100)).subscribe(dl.bind(void 0));function IE(){yi(),ll(),pl()}function ll(){let e=window.XMLHttpRequest.prototype.send;window.XMLHttpRequest.prototype.send=function(){return this.addEventListener("load",function(){Sc(this._url).catch(t=>S.error("Unable to process cart change in XMLHttpRequest",t))}),e.apply(this,arguments)},S.verbose("Securely overwritten window.XMLHttpRequest.send method")}function pl(){let e=window.fetch;try{window.fetch=async function(t,r){return e(t,r).then(n=>{let i="";try{i=typeof t=="string"||t instanceof URL?t.toString():t?.url??n?.url??""}catch{}return Sc(i).catch(o=>S.error("Unable to process cart change in fetch",o)),n})},S.verbose("Securely overwritten window.fetch method")}catch(t){console.warn("Fail to override fetch.",`Cooee won't be able to track "Add To Cart" and "Remove From Cart" KPI.`),S.error(t)}}async function Sc(e){hl(e)&&yi()}function hl(e){return/\/cart\/(add|change|update|clear)/.test(e)}function ml(e,t){let r=e?.items,n=t.items,i=[],o=[];if(S.verbose(`Comparing cart change with old count ${r?.length} to new count ${n.length}`),n?.forEach(s=>{let f=r?.find(p=>p.vID===s.vID);if(f){if(f.quantity!==s.quantity){let p=f.quantity<s.quantity,d=Math.abs(f.quantity-s.quantity),m=It(B({},s),{quantity:d});p?i.push(m):o.push(m)}r&&Yo(r,f)}else i.push(s)}),r)for(let s of r)o.push(s);S.verbose(`Cart delta: added: ${i.length}, removed: ${o.length}`),i.length&&vc("Add To Cart",{items:i}),o.length&&e.token===t.token&&vc("Remove From Cart",{items:o}),(o.length||i.length)&&bc.next({itemsAdded:i,itemsRemoved:o,cart:t})}function vc(e,t){let r=new Mt(e,t);wc(r)}async function dl(){let e=await xt.get("cart",{}),t=await z.getCurrent().getNormalisedCart(!0);ml(e,t)}var ue=class e{static cartDrawerToggle$=new Rr({open:!1,firstOpen:!1});static DEFAULT_SELECTOR="cart-drawer";static _instance;inShadow=!1;cartDrawerElement;cartDrawerShadowElement;configWebsite=Tt.get().website??{};currentState=!1;mutationSubscription;mutationObserver;firstOpen=!0;selector;shadowParentElementSelector;clickEventListener;refreshUIEventListener;iconSelector=['button[drawer-to-open="cart-drawer"]','a[href="/cart"]',".header__icon--cart","#cart-icon-bubble",".cart-icon-bubble",".cart-count",'a[onclick*="handleFloCartBtn"]'].join(",");cartSelector=[e.DEFAULT_SELECTOR,"#halo-cart-sidebar",'[role="dialog"][class*="cart" i]','[id*="section-cart" i]',"#sidebar-cart","#rebuy-cart","#mini-cart","#flo-cart-wrapper","#drawer-cart","#UpcartPopupBackDrop",'[id$="CartDrawer" i]'].join(",");constructor(){this.initialize(),this.refreshUIEventListener=this.updateBubble.bind(this),this.clickEventListener=this.manualCartIconClicked.bind(this),document.addEventListener("letscooee:outbound:refresh-ui",this.refreshUIEventListener),document.addEventListener("click",this.clickEventListener,{capture:!0,passive:!0})}get element(){return this.cartDrawerElement}static get(){return e._instance||(e._instance=new e),e._instance}static initialize(){e.get()}isOpen(){if(window.cooeeIsCartDrawerVisible)return window.cooeeIsCartDrawerVisible();if(this.cartDrawerElement?.id==="rebuy-cart")return!!window.Rebuy?.SmartCart?.visible;let t=this.inShadow?this.isPresent():_o(this.cartDrawerElement);return S.info(`Cart drawer is currently ${t?"open":"close"}`),t}open(){if(this.isOpen()){S.log("Drawer is already open");return}document.dispatchEvent(new CustomEvent("letscooee:outbound:open-cart"));let t=document.querySelector(this.iconSelector);if(!t){S.verbose("No clickable cart icon found with selector",this.iconSelector);return}t.click()}isShopifyDefaultDrawer(){return this.element?.tagName.toLowerCase()===e.DEFAULT_SELECTOR}isMiniCart(){return this.isShopifyDefaultDrawer()&&this.element?.id==="mini-cart"}refreshUI(t,r=!0){if(window.cooeeUpdateCartDrawer)try{window.cooeeUpdateCartDrawer(t)}catch(n){tt(n,"execute-cooeeUpdateCartDrawer")}else if(this.isMiniCart()&&this.element?._rerenderCart)this.element._rerenderCart({detail:{cart:t}});else if(window.MinimogTheme?.Cart?.renderNewCart)window.MinimogTheme.Cart.renderNewCart();else if(this.isShopifyDefaultDrawer()&&this.element?.renderContents&&t)this.element.classList.remove("is-empty"),this.element.renderContents?.(t);else if(this.element?.onCartDrawerUpdate)this.element.onCartDrawerUpdate();else if(window.cartGiftUpdate){if(!t?.items?.[0])return;let n=t.items[0].id,i=t.items[0].quantity,o=t.items[0].price;window.cartGiftUpdate(n,o,i,"","ADD_TO_CART")}else if(window.icartCartActivityEvent)window.icartCartActivityEvent();else if(window.theme?.CartDrawer&&typeof window.theme?.CartDrawer=="function")window.theme?.CartDrawer.init?new window.theme.CartDrawer().init():new window.theme.CartDrawer;else if(window.Hs_CartDrawer?.updateSlideCart)window.Hs_CartDrawer.updateSlideCart();else if(window.theme?.fetch_side_cart)window.theme.fetch_side_cart();else if(window.theme?.Cart?.updateCart)window.theme.Cart.updateCart();else if(window.cartUpdate)window.cartUpdate();else if(this.element?._onCartRefresh)this.element._onCartRefresh();else if(window.cart?.getCart)window.cart.getCart();else if(this.element?.tagName?.toLowerCase()==="cart-drawer-component")document.dispatchEvent(new CustomEvent("action:cart:updateCartandShowCart"));else if(this.element?.id==="sidebar-cart")document.body.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0,detail:{}}));else if(this.element?.id==="quick-cart"){let n=document.querySelector('a[href="/cart"]');n&&n.click()}else window.Shopify?.KT_onItemAdded?window.Shopify.KT_onItemAdded():window.sideCart?.updateCart?window.sideCart.updateCart():window.SLIDECART_UPDATE?(window.SLIDECART_UPDATE(),window.SLIDECART_OPEN?.()):window.refreshCart?z.getCurrent().getNormalisedCart(!0).then(()=>{window.refreshCart(z.getCurrent())}):window.OPEN_CART?window.OPEN_CART():window.updateCart?window.updateCart():window.sjRefreshCart?window.sjRefreshCart():window.CartJS?.getCart?window.CartJS?.getCart():window.updateCartItemJS?window.updateCartItemJS(1,t?.items?.[0]?.id+""):(S.info("No method found to update the cart drawer. Blindly firing some events to try"),document.dispatchEvent(new CustomEvent("cart:refresh",{bubbles:!0})));document.dispatchEvent(new CustomEvent("letscooee:outbound:refresh-ui",{detail:{responseJSON:t,currentCart:z.getCurrent()}})),r&&yi()}async initialize(){let t=this.configWebsite.cartDrawerSelector;if(!t){await this.findCartDrawer();return}let r=t.split(":shadow");r.length===1?(this.selector=r[0],await this.findCartDrawer()):(this.inShadow=!0,this.shadowParentElementSelector=r[0]?.trim(),this.selector=r[1]?.trim(),await this.findCartDrawerWithShadow())}async findCartDrawer(){if(!xr())return;let t=this.selector||this.cartSelector;if(this.cartDrawerElement=await Ei(t),!this.cartDrawerElement){Ic.default.warn("Max attempts exhausted to find cart drawer");return}S.verbose("Found",this.cartDrawerElement,`from selector: ${t}`),this.createMutationObservers()}async findCartDrawerWithShadow(){if(!this.shadowParentElementSelector)return;let r=(await Ei(this.shadowParentElementSelector))?.shadowRoot;r?.mode==="open"&&(this.cartDrawerShadowElement=r,this.createMutationObservers())}createMutationObservers(){!this.cartDrawerElement&&!this.cartDrawerShadowElement||this.watchForCartToggle()}watchForCartToggle(){let t=this.cartDrawerElement||this.cartDrawerShadowElement,r=new qt;this.mutationObserver=new MutationObserver(()=>{r.next()}),this.mutationObserver.observe(t,{attributes:!0,subtree:!0,childList:this.inShadow}),this.mutationSubscription=r.pipe(No(800,void 0,{leading:!1,trailing:!0})).subscribe(()=>{let n=this.isOpen();this.currentState!==n&&(this.currentState=n,e.cartDrawerToggle$.next({open:n,firstOpen:this.firstOpen}),this.firstOpen&&(this.firstOpen=!1))})}isPresent(){if(!this.selector||!this.cartDrawerShadowElement)return!1;let t=this.cartDrawerShadowElement.querySelector(this.selector);return t?_o(t):!1}async updateBubble(){let t=(await z.getCurrent().getNormalisedCart(!0)).itemCount,r=document.querySelector(".cart-link__bubble");r&&(r.innerText=t+"")}manualCartIconClicked(t){!t.target.closest(this.iconSelector)||!t.isTrusted||window.CooeeSDK.events.push(["Open Cart"])}};var xc=class{constructor(t){this.scalingFactor=t}getLayoutStyles(t){if(!t)return{display:"block"};let r={display:t.disp};return t.of&&(r.objectFit=t.of),t.pos==="absolute"&&(r.width="auto !important",r.position="absolute",r.right=t.right+"px",r.left=t.left+"px",r.top=t.top+"px",r.bottom=t.bottom+"px"),r}getSizeStyles(t){let r={};return t?.w&&(r.width=t.w),t?.h&&(r.height=t.h),t?.maxW&&(r.maxWidth=t.maxW),t?.maxH&&(r.maxHeight=t.maxH),t?.minW&&(r.minWidth=t.minW),t?.minH&&(r.minHeight=t.minH),r}getBorderStyles(t){if(!t)return{};let r={};return t.radius&&t.radius>0&&(r.borderRadius=this.getSizePx(t.radius)),t.width&&t.width>0&&(r.borderWidth=this.getSizePx(t.width),r.borderStyle=t.style?.toLowerCase(),t.color?this.getColourStyles(t.color,"border-color",r):r.borderColor="black"),r}getFlexStyles(t){return t?{gap:t.gap+"px",flexWrap:t.wrap,flexDirection:t.dir,justifyContent:t.jc,alignItems:t.ai,width:"100%"}:{}}getSpaceStyles(t){let r={};return t?(r.paddingTop=this.getSizePx(t.pt),r.paddingBottom=this.getSizePx(t.pb),r.paddingLeft=this.getSizePx(t.pl),r.paddingRight=this.getSizePx(t.pr),r.marginTop=this.getSizePx(t.mt),r.marginBottom=this.getSizePx(t.mb),r.marginLeft=t.cent?"auto":this.getSizePx(t.ml),r.marginRight=t.cent?"auto":this.getSizePx(t.mr),r):(r.margin="0 !important",r.padding="unset",r)}getBackgroundStyles(t){if(!t)return{};let r={};if(t.glossy){let n="backdrop-filter",i="-webkit-"+n,o=`blur(${t.glossy.radius}px)`;if(!CSS.supports(i,o)&&!CSS.supports(n,o))return{background:t.glossy.fallback.rgba};if(r[i]=o,r[n]=o,t.glossy.color)return this.getColourStyles(t.glossy.color,"background",r)}else if(t.solid){if(t.solid.grad)return this.getGradientStyles(t.solid.grad,"background",r);if(t.solid.hex)return{backgroundColor:t.solid.rgba}}else if(t.img){if(!t.img.src)return{};let n=(t.img.a??0)/100;r.background=`linear-gradient(rgba(0, 0, 0, ${n}), rgba(0, 0, 0, ${n})),url("${t.img.src}") no-repeat center`,r.backgroundSize="cover",t.img.a&&(r["-webkit-backdrop-filter"]=`opacity(${t.img.a})`,r.backdropFilter=`opacity(${t.img.a})`)}return r}getGradientStyles(t,r,n){if(n??={},t.type==="LINEAR"){let i=`linear-gradient(${t.ang}deg, ${t.c1}, ${t.c2}`;t.c3&&(i+=`, ${t.c3}`),i+=")",n[r]=i}return n}getColourStyles(t,r="color",n){return n??={},t?t.grad?this.getGradientStyles(t.grad,r,n):(t.hex&&(n[r]=t.rgba),n):n}getSizePx(t){return this.getScaledSize(t)+"px"}getScaledSize(t){return(t??0)*this.scalingFactor}};var Nc=me(Gr());var gl=`
|
|
15
15
|
mutation cartDiscountCodesUpdate($cartId: ID!, $discountCodes: [String!]) {
|
|
16
16
|
cartDiscountCodesUpdate(cartId: $cartId, discountCodes: $discountCodes) {
|
|
17
17
|
cart {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{_ as n,v as i,yb as o}from"./chunk-
|
|
1
|
+
import{_ as n,v as i,yb as o}from"./chunk-HC6OE5XR.js";var r=class e{sanitizer=i(o);transform(t){return t?this.sanitizer.bypassSecurityTrustHtml(t):""}static \u0275fac=function(s){return new(s||e)};static \u0275pipe=n({name:"safeHtml",type:e,pure:!0})};function m(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}var u=()=>typeof navigator<"u"&&"share"in navigator;export{r as a,m as b,u as c};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{a as k}from"./chunk-
|
|
1
|
+
import{a as k}from"./chunk-ILIYCRW5.js";import{a as w,b as P}from"./chunk-WQK746ER.js";import{Aa as h,Ca as x,Hb as E,K as d,O as r,Qa as a,Ra as S,X as f,aa as m,cb as c,db as b,eb as $,kb as T,la as p,ma as u,na as g,sa as s,ta as n,ua as l,vb as v}from"./chunk-HC6OE5XR.js";import"./chunk-U4XWPFUW.js";var D=["/v1/engagement/cart-widgets","/v1/engagement/page-widgets","/v1/event/validate-session"];function A(){let i=performance.getEntriesByType?.("resource");return i?i.filter(o=>D.some(e=>o.name.includes(e))):[]}function R(){let i=A();return i.length?i.map(e=>JSON.stringify(e.toJSON())).join(`
|
|
2
2
|
`):""}function z(i,o){if(i&1&&(s(0,"li")(1,"span",1),a(2),c(3,"date"),n(),a(4,"\xA0 "),l(5,"span",2),c(6,"safeHtml"),n()),i&2){let e=o.$implicit;r(2),S($(3,2,e.time,"hh:mm:ss a")),r(3),h("innerHTML",b(6,5,e.message),d)}}var C=class i{logs=T.required();constructor(){}async shareLogs(){let o=this.logs().map(t=>`[${new Date(t.time).toLocaleString("en-US",{year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",fractionalSecondDigits:3,hour12:!1,timeZoneName:"short"})}] ${t.message}`).join(`
|
|
3
3
|
`);o=o.replaceAll("\xA0"," ");let e=R();if(e&&(o+=`
|
|
4
4
|
|