@letscooee/web-sdk 11.0.0-rc.12 → 11.0.0-rc.13

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.
@@ -1,4 +1,4 @@
1
- import{$a as Na,Aa as wn,Ab as ja,B as De,Ba as Dn,Bb as pr,C as _e,Ca as Re,Cb as ot,Da as Ta,Db as $e,E as Ue,Ea as wa,Fa as Da,Fb as mr,Ga as Aa,Gb as Rn,H as Sn,Ha as Oa,Hb as Ga,I as Ae,Ib as Nn,J as va,Jb as Wa,K as Cn,Kb as $a,L as In,Lb as _r,Ma as An,N as $,Na as hr,Oa as ye,Pa as Xt,Q as fr,Qa as Kt,S as $t,T as Tn,U as Ni,Ua as Nt,V as Mi,Va as Mt,W as ee,Wa as gt,X as Ot,Xa as xa,Y as Yt,Ya as Ra,Z as ya,_ as xt,a as la,aa as Ea,ab as On,ba as Oe,bb as xn,c as me,ca as Fe,d as ua,da as mt,ea as Pi,fa as He,fb as rt,g as da,ga as je,gb as it,ha as Ge,hb as vt,i as fa,ib as Ne,ja as ki,ka as Li,kb as Ma,l as ha,la as ba,lb as Vi,m as pa,ma as nt,n as ma,na as _t,o as _a,oa as Fi,ob as Pa,pa as ge,pb as ka,q as ga,qa as xe,ra as Rt,rb as La,s as ue,t as wt,u as Le,ub as Fa,v as x,va as Sa,w as dr,wa as Ca,wb as Va,x as Dt,xa as Ia,xb as Ba,y as At,ya as zt,yb as Ua,za as We,zb as Ha}from"./chunk-MJD4XKII.js";import{a as y,b as V,c as bn,d as ca,e as xi,f as Ri,g as ur}from"./chunk-V7UGKYBN.js";var Xa=xi((za,vr)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var n,r={},i=function(d,g){return function(){return g.apply(d,arguments)}},o=function(){var d=arguments,g=d[0],f,E;for(E=1;E<d.length;E++)for(f in d[E])!(f in g)&&d[E].hasOwnProperty(f)&&(g[f]=d[E][f]);return g},s=function(d,g){return{value:d,name:g}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(d){this.context=d,this.setLevel(d.filterLevel),this.log=this.info};a.prototype={setLevel:function(d){d&&"value"in d&&(this.context.filterLevel=d)},getLevel:function(){return this.context.filterLevel},enabledFor:function(d){var g=this.context.filterLevel;return d.value>=g.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"start"])},timeEnd:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"end"])},invoke:function(d,g){n&&this.enabledFor(d)&&n(g,o({level:d},this.context))}};var l=new a({filterLevel:e.OFF});(function(){var d=e;d.enabledFor=i(l,l.enabledFor),d.trace=i(l,l.trace),d.debug=i(l,l.debug),d.time=i(l,l.time),d.timeEnd=i(l,l.timeEnd),d.info=i(l,l.info),d.warn=i(l,l.warn),d.error=i(l,l.error),d.log=d.info})(),e.setHandler=function(d){n=d},e.setLevel=function(d){l.setLevel(d);for(var g in r)r.hasOwnProperty(g)&&r[g].setLevel(d)},e.getLevel=function(){return l.getLevel()},e.get=function(d){return r[d]||(r[d]=new a(o({name:d},l.context)))},e.createDefaultHandler=function(d){d=d||{},d.formatter=d.formatter||function(v,w){w.name&&v.unshift("["+w.name+"]")};var g={},f=function(E,v){Function.prototype.apply.call(E,console,v)};return typeof console>"u"?function(){}:function(E,v){E=Array.prototype.slice.call(E);var w=console.log,N;v.level===e.TIME?(N=(v.name?"["+v.name+"] ":"")+E[0],E[1]==="start"?console.time?console.time(N):g[N]=new Date().getTime():console.timeEnd?console.timeEnd(N):f(w,[N+": "+(new Date().getTime()-g[N])+"ms"])):(v.level===e.WARN&&console.warn?w=console.warn:v.level===e.ERROR&&console.error?w=console.error:v.level===e.INFO&&console.info?w=console.info:v.level===e.DEBUG&&console.debug?w=console.debug:v.level===e.TRACE&&console.trace&&(w=console.trace),d.formatter(E,v),f(w,E))}},e.useDefaults=function(d){e.setLevel(d&&d.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(d))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof vr<"u"&&vr.exports?vr.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(za)});var sc=xi((oc,Hi)=>{"use strict";(function(t){if(typeof oc=="object"&&typeof Hi<"u")Hi.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return(function r(i,o,s){function a(g,f){if(!o[g]){if(!i[g]){var E=typeof bn=="function"&&bn;if(!f&&E)return E(g,!0);if(l)return l(g,!0);var v=new Error("Cannot find module '"+g+"'");throw v.code="MODULE_NOT_FOUND",v}var w=o[g]={exports:{}};i[g][0].call(w.exports,function(N){var R=i[g][1][N];return a(R||N)},w,w.exports,r,i,o,s)}return o[g].exports}for(var l=typeof bn=="function"&&bn,d=0;d<s.length;d++)a(s[d]);return a})({1:[function(r,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var d=0,g=new a(N),f=s.document.createTextNode("");g.observe(f,{characterData:!0}),l=function(){f.data=d=++d%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=N,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var P=s.document.createElement("script");P.onreadystatechange=function(){N(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},s.document.documentElement.appendChild(P)}:l=function(){setTimeout(N,0)};var v,w=[];function N(){v=!0;for(var P,M,U=w.length;U;){for(M=w,w=[],P=-1;++P<U;)M[P]();U=w.length}v=!1}i.exports=R;function R(P){w.push(P)===1&&!v&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function a(){}var l={},d=["REJECTED"],g=["FULFILLED"],f=["PENDING"];i.exports=E;function E(D){if(typeof D!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,D!==a&&R(this,D)}E.prototype.catch=function(D){return this.then(null,D)},E.prototype.then=function(D,H){if(typeof D!="function"&&this.state===g||typeof H!="function"&&this.state===d)return this;var F=new this.constructor(a);if(this.state!==f){var j=this.state===g?D:H;w(F,j,this.outcome)}else this.queue.push(new v(F,D,H));return F};function v(D,H,F){this.promise=D,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(D){l.resolve(this.promise,D)},v.prototype.otherCallFulfilled=function(D){w(this.promise,this.onFulfilled,D)},v.prototype.callRejected=function(D){l.reject(this.promise,D)},v.prototype.otherCallRejected=function(D){w(this.promise,this.onRejected,D)};function w(D,H,F){s(function(){var j;try{j=H(F)}catch(Z){return l.reject(D,Z)}j===D?l.reject(D,new TypeError("Cannot resolve promise with itself")):l.resolve(D,j)})}l.resolve=function(D,H){var F=P(N,H);if(F.status==="error")return l.reject(D,F.value);var j=F.value;if(j)R(D,j);else{D.state=g,D.outcome=H;for(var Z=-1,K=D.queue.length;++Z<K;)D.queue[Z].callFulfilled(H)}return D},l.reject=function(D,H){D.state=d,D.outcome=H;for(var F=-1,j=D.queue.length;++F<j;)D.queue[F].callRejected(H);return D};function N(D){var H=D&&D.then;if(D&&(typeof D=="object"||typeof D=="function")&&typeof H=="function")return function(){H.apply(D,arguments)}}function R(D,H){var F=!1;function j(Te){F||(F=!0,l.reject(D,Te))}function Z(Te){F||(F=!0,l.resolve(D,Te))}function K(){H(Z,j)}var se=P(K);se.status==="error"&&j(se.value)}function P(D,H){var F={};try{F.value=D(H),F.status="success"}catch(j){F.status="error",F.value=j}return F}E.resolve=M;function M(D){return D instanceof this?D:l.resolve(new this(a),D)}E.reject=U;function U(D){var H=new this(a);return l.reject(H,D)}E.all=Ce;function Ce(D){var H=this;if(Object.prototype.toString.call(D)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=D.length,j=!1;if(!F)return this.resolve([]);for(var Z=new Array(F),K=0,se=-1,Te=new this(a);++se<F;)et(D[se],se);return Te;function et(vn,ar){H.resolve(vn).then(Ei,function(Gt){j||(j=!0,l.reject(Te,Gt))});function Ei(Gt){Z[ar]=Gt,++K===F&&!j&&(j=!0,l.resolve(Te,Z))}}}E.race=Ie;function Ie(D){var H=this;if(Object.prototype.toString.call(D)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=D.length,j=!1;if(!F)return this.resolve([]);for(var Z=-1,K=new this(a);++Z<F;)se(D[Z]);return K;function se(Te){H.resolve(Te).then(function(et){j||(j=!0,l.resolve(K,et))},function(et){j||(j=!0,l.reject(K,et))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function a(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function l(){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 d=l();function g(){try{if(!d||!d.open)return!1;var c=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||h)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(c,h){c=c||[],h=h||{};try{return new Blob(c,h)}catch(p){if(p.name!=="TypeError")throw p;for(var u=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,m=new u,_=0;_<c.length;_+=1)m.append(c[_]);return m.getBlob(h.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(c,h){h&&c.then(function(u){h(null,u)},function(u){h(u)})}function w(c,h,u){typeof h=="function"&&c.then(h),typeof u=="function"&&c.catch(u)}function N(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",M=void 0,U={},Ce=Object.prototype.toString,Ie="readonly",D="readwrite";function H(c){for(var h=c.length,u=new ArrayBuffer(h),m=new Uint8Array(u),_=0;_<h;_++)m[_]=c.charCodeAt(_);return u}function F(c){return new E(function(h){var u=c.transaction(P,D),m=f([""]);u.objectStore(P).put(m,"key"),u.onabort=function(_){_.preventDefault(),_.stopPropagation(),h(!1)},u.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);h(p||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function j(c){return typeof M=="boolean"?E.resolve(M):F(c).then(function(h){return M=h,M})}function Z(c){var h=U[c.name],u={};u.promise=new E(function(m,_){u.resolve=m,u.reject=_}),h.deferredOperations.push(u),h.dbReady?h.dbReady=h.dbReady.then(function(){return u.promise}):h.dbReady=u.promise}function K(c){var h=U[c.name],u=h.deferredOperations.pop();if(u)return u.resolve(),u.promise}function se(c,h){var u=U[c.name],m=u.deferredOperations.pop();if(m)return m.reject(h),m.promise}function Te(c,h){return new E(function(u,m){if(U[c.name]=U[c.name]||js(),c.db)if(h)Z(c),c.db.close();else return u(c.db);var _=[c.name];h&&_.push(c.version);var p=d.open.apply(d,_);h&&(p.onupgradeneeded=function(b){var S=p.result;try{S.createObjectStore(c.storeName),b.oldVersion<=1&&S.createObjectStore(P)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw C}}),p.onerror=function(b){b.preventDefault(),m(p.error)},p.onsuccess=function(){var b=p.result;b.onversionchange=function(S){S.target.close()},u(b),K(c)}})}function et(c){return Te(c,!1)}function vn(c){return Te(c,!0)}function ar(c,h){if(!c.db)return!0;var u=!c.db.objectStoreNames.contains(c.storeName),m=c.version<c.db.version,_=c.version>c.db.version;if(m&&(c.version!==h&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),_||u){if(u){var p=c.db.version+1;p>c.version&&(c.version=p)}return!0}return!1}function Ei(c){return new E(function(h,u){var m=new FileReader;m.onerror=u,m.onloadend=function(_){var p=btoa(_.target.result||"");h({__local_forage_encoded_blob:!0,data:p,type:c.type})},m.readAsBinaryString(c)})}function Gt(c){var h=H(atob(c.data));return f([h],{type:c.type})}function Hs(c){return c&&c.__local_forage_encoded_blob}function nd(c){var h=this,u=h._initReady().then(function(){var m=U[h._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(u,c,c),u}function rd(c){Z(c);for(var h=U[c.name],u=h.forages,m=0;m<u.length;m++){var _=u[m];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,et(c).then(function(p){return c.db=p,ar(c)?vn(c):p}).then(function(p){c.db=h.db=p;for(var b=0;b<u.length;b++)u[b]._dbInfo.db=p}).catch(function(p){throw se(c,p),p})}function tt(c,h,u,m){m===void 0&&(m=1);try{var _=c.db.transaction(c.storeName,h);u(null,_)}catch(p){if(m>0&&(!c.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return E.resolve().then(function(){if(!c.db||p.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),vn(c)}).then(function(){return rd(c).then(function(){tt(c,h,u,m-1)})}).catch(u);u(p)}}function js(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function id(c){var h=this,u={db:null};if(c)for(var m in c)u[m]=c[m];var _=U[u.name];_||(_=js(),U[u.name]=_),_.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=nd);var p=[];function b(){return E.resolve()}for(var S=0;S<_.forages.length;S++){var C=_.forages[S];C!==h&&p.push(C._initReady().catch(b))}var I=_.forages.slice(0);return E.all(p).then(function(){return u.db=_.db,et(u)}).then(function(T){return u.db=T,ar(u,h._defaultConfig.version)?vn(u):T}).then(function(T){u.db=_.db=T,h._dbInfo=u;for(var O=0;O<I.length;O++){var B=I[O];B!==h&&(B._dbInfo.db=u.db,B._dbInfo.version=u.version)}})}function od(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.get(c);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),Hs(T)&&(T=Gt(T)),_(T)},I.onerror=function(){p(I.error)}}catch(T){p(T)}})}).catch(p)});return v(m,h),m}function sd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var O=I.result;if(O){var B=O.value;Hs(B)&&(B=Gt(B));var G=c(B,O.key,T++);G!==void 0?_(G):O.continue()}else _()},I.onerror=function(){p(I.error)}}catch(O){p(O)}})}).catch(p)});return v(m,h),m}function ad(c,h,u){var m=this;c=N(c);var _=new E(function(p,b){var S;m.ready().then(function(){return S=m._dbInfo,Ce.call(h)==="[object Blob]"?j(S.db).then(function(C){return C?h:Ei(h)}):h}).then(function(C){tt(m._dbInfo,D,function(I,T){if(I)return b(I);try{var O=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var B=O.put(C,c);T.oncomplete=function(){C===void 0&&(C=null),p(C)},T.onabort=T.onerror=function(){var G=B.error?B.error:B.transaction.error;b(G)}}catch(G){b(G)}})}).catch(b)});return v(_,u),_}function cd(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,D,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.delete(c);S.oncomplete=function(){_()},S.onerror=function(){p(I.error)},S.onabort=function(){var T=I.error?I.error:I.transaction.error;p(T)}}catch(T){p(T)}})}).catch(p)});return v(m,h),m}function ld(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,D,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.clear();b.oncomplete=function(){m()},b.onabort=b.onerror=function(){var I=C.error?C.error:C.transaction.error;_(I)}}catch(I){_(I)}})}).catch(_)});return v(u,c),u}function ud(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,Ie,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){_(C.error)}}catch(I){_(I)}})}).catch(_)});return v(u,c),u}function dd(c,h){var u=this,m=new E(function(_,p){if(c<0){_(null);return}u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var O=T.result;if(!O){_(null);return}c===0||I?_(O.key):(I=!0,O.advance(c))},T.onerror=function(){p(T.error)}}catch(O){p(O)}})}).catch(p)});return v(m,h),m}function fd(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,Ie,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){_(C.error)}}catch(T){_(T)}})}).catch(_)});return v(u,c),u}function hd(c,h){h=R.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var m=this,_;if(!c.name)_=E.reject("Invalid arguments");else{var p=c.name===u.name&&m._dbInfo.db,b=p?E.resolve(m._dbInfo.db):et(c).then(function(S){var C=U[c.name],I=C.forages;C.db=S;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=S;return S});c.storeName?_=b.then(function(S){if(S.objectStoreNames.contains(c.storeName)){var C=S.version+1;Z(c);var I=U[c.name],T=I.forages;S.close();for(var O=0;O<T.length;O++){var B=T[O];B._dbInfo.db=null,B._dbInfo.version=C}var G=new E(function(W,Q){var J=d.open(c.name,C);J.onerror=function(we){var En=J.result;En.close(),Q(we)},J.onupgradeneeded=function(){var we=J.result;we.deleteObjectStore(c.storeName)},J.onsuccess=function(){var we=J.result;we.close(),W(we)}});return G.then(function(W){I.db=W;for(var Q=0;Q<T.length;Q++){var J=T[Q];J._dbInfo.db=W,K(J._dbInfo)}}).catch(function(W){throw(se(c,W)||E.resolve()).catch(function(){}),W})}}):_=b.then(function(S){Z(c);var C=U[c.name],I=C.forages;S.close();for(var T=0;T<I.length;T++){var O=I[T];O._dbInfo.db=null}var B=new E(function(G,W){var Q=d.deleteDatabase(c.name);Q.onerror=function(){var J=Q.result;J&&J.close(),W(Q.error)},Q.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},Q.onsuccess=function(){var J=Q.result;J&&J.close(),G(J)}});return B.then(function(G){C.db=G;for(var W=0;W<I.length;W++){var Q=I[W];K(Q._dbInfo)}}).catch(function(G){throw(se(c,G)||E.resolve()).catch(function(){}),G})})}return v(_,h),_}var pd={_driver:"asyncStorage",_initStorage:id,_support:g(),iterate:sd,getItem:od,setItem:ad,removeItem:cd,clear:ld,length:ud,key:dd,keys:fd,dropInstance:hd};function md(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_d="~~local_forage_type~",Gs=/^~~local_forage_type~([^~]+)~/,cr="__lfsc__:",bi=cr.length,Si="arbf",Ci="blob",Ws="si08",$s="ui08",Ys="uic8",zs="si16",Xs="si32",Ks="ur16",qs="ui32",Zs="fl32",Js="fl64",Qs=bi+Si.length,ea=Object.prototype.toString;function ta(c){var h=c.length*.75,u=c.length,m,_=0,p,b,S,C;c[c.length-1]==="="&&(h--,c[c.length-2]==="="&&h--);var I=new ArrayBuffer(h),T=new Uint8Array(I);for(m=0;m<u;m+=4)p=ht.indexOf(c[m]),b=ht.indexOf(c[m+1]),S=ht.indexOf(c[m+2]),C=ht.indexOf(c[m+3]),T[_++]=p<<2|b>>4,T[_++]=(b&15)<<4|S>>2,T[_++]=(S&3)<<6|C&63;return I}function Ii(c){var h=new Uint8Array(c),u="",m;for(m=0;m<h.length;m+=3)u+=ht[h[m]>>2],u+=ht[(h[m]&3)<<4|h[m+1]>>4],u+=ht[(h[m+1]&15)<<2|h[m+2]>>6],u+=ht[h[m+2]&63];return h.length%3===2?u=u.substring(0,u.length-1)+"=":h.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function gd(c,h){var u="";if(c&&(u=ea.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&ea.call(c.buffer)==="[object ArrayBuffer]")){var m,_=cr;c instanceof ArrayBuffer?(m=c,_+=Si):(m=c.buffer,u==="[object Int8Array]"?_+=Ws:u==="[object Uint8Array]"?_+=$s:u==="[object Uint8ClampedArray]"?_+=Ys:u==="[object Int16Array]"?_+=zs:u==="[object Uint16Array]"?_+=Ks:u==="[object Int32Array]"?_+=Xs:u==="[object Uint32Array]"?_+=qs:u==="[object Float32Array]"?_+=Zs:u==="[object Float64Array]"?_+=Js:h(new Error("Failed to get type for BinaryArray"))),h(_+Ii(m))}else if(u==="[object Blob]"){var p=new FileReader;p.onload=function(){var b=_d+c.type+"~"+Ii(this.result);h(cr+Ci+b)},p.readAsArrayBuffer(c)}else try{h(JSON.stringify(c))}catch(b){console.error("Couldn't convert value into a JSON string: ",c),h(null,b)}}function vd(c){if(c.substring(0,bi)!==cr)return JSON.parse(c);var h=c.substring(Qs),u=c.substring(bi,Qs),m;if(u===Ci&&Gs.test(h)){var _=h.match(Gs);m=_[1],h=h.substring(_[0].length)}var p=ta(h);switch(u){case Si:return p;case Ci:return f([p],{type:m});case Ws:return new Int8Array(p);case $s:return new Uint8Array(p);case Ys:return new Uint8ClampedArray(p);case zs:return new Int16Array(p);case Ks:return new Uint16Array(p);case Xs:return new Int32Array(p);case qs:return new Uint32Array(p);case Zs:return new Float32Array(p);case Js:return new Float64Array(p);default:throw new Error("Unkown type: "+u)}}var Ti={serialize:gd,deserialize:vd,stringToBuffer:ta,bufferToString:Ii};function na(c,h,u,m){c.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function yd(c){var h=this,u={db:null};if(c)for(var m in c)u[m]=typeof c[m]!="string"?c[m].toString():c[m];var _=new E(function(p,b){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(S){return b(S)}u.db.transaction(function(S){na(S,u,function(){h._dbInfo=u,p()},function(C,I){b(I)})},b)});return u.serializer=Ti,_}function pt(c,h,u,m,_,p){c.executeSql(u,m,_,function(b,S){S.code===S.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(C,I){I.rows.length?p(C,S):na(C,h,function(){C.executeSql(u,m,_,p)},p)},p):p(b,S)},p)}function Ed(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[c],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=b.serializer.deserialize(T)),_(T)},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function bd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT * FROM "+b.storeName,[],function(C,I){for(var T=I.rows,O=T.length,B=0;B<O;B++){var G=T.item(B),W=G.value;if(W&&(W=b.serializer.deserialize(W)),W=c(W,G.key,B+1),W!==void 0){_(W);return}}_()},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function ra(c,h,u,m){var _=this;c=N(c);var p=new E(function(b,S){_.ready().then(function(){h===void 0&&(h=null);var C=h,I=_._dbInfo;I.serializer.serialize(h,function(T,O){O?S(O):I.db.transaction(function(B){pt(B,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[c,T],function(){b(C)},function(G,W){S(W)})},function(B){if(B.code===B.QUOTA_ERR){if(m>0){b(ra.apply(_,[c,C,u,m-1]));return}S(B)}})})}).catch(S)});return v(p,u),p}function Sd(c,h,u){return ra.apply(this,[c,h,u,1])}function Cd(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[c],function(){_()},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function Id(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"DELETE FROM "+p.storeName,[],function(){m()},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function Td(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(S,C){var I=C.rows.item(0).c;m(I)},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function wd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[c+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;_(T)},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function Dd(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"SELECT key FROM "+p.storeName,[],function(S,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function Ad(c){return new E(function(h,u){c.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,p){for(var b=[],S=0;S<p.rows.length;S++)b.push(p.rows.item(S).name);h({db:c,storeNames:b})},function(_,p){u(p)})},function(m){u(m)})})}function Od(c,h){h=R.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var m=this,_;return c.name?_=new E(function(p){var b;c.name===u.name?b=m._dbInfo.db:b=openDatabase(c.name,"","",0),c.storeName?p({db:b,storeNames:[c.storeName]}):p(Ad(b))}).then(function(p){return new E(function(b,S){p.db.transaction(function(C){function I(G){return new E(function(W,Q){C.executeSql("DROP TABLE IF EXISTS "+G,[],function(){W()},function(J,we){Q(we)})})}for(var T=[],O=0,B=p.storeNames.length;O<B;O++)T.push(I(p.storeNames[O]));E.all(T).then(function(){b()}).catch(function(G){S(G)})},function(C){S(C)})})}):_=E.reject("Invalid arguments"),v(_,h),_}var xd={_driver:"webSQLStorage",_initStorage:yd,_support:md(),iterate:bd,getItem:Ed,setItem:Sd,removeItem:Cd,clear:Id,length:Td,key:wd,keys:Dd,dropInstance:Od};function Rd(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ia(c,h){var u=c.name+"/";return c.storeName!==h.storeName&&(u+=c.storeName+"/"),u}function Nd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Md(){return!Nd()||localStorage.length>0}function Pd(c){var h=this,u={};if(c)for(var m in c)u[m]=c[m];return u.keyPrefix=ia(c,h._defaultConfig),Md()?(h._dbInfo=u,u.serializer=Ti,E.resolve()):E.reject()}function kd(c){var h=this,u=h.ready().then(function(){for(var m=h._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var p=localStorage.key(_);p.indexOf(m)===0&&localStorage.removeItem(p)}});return v(u,c),u}function Ld(c,h){var u=this;c=N(c);var m=u.ready().then(function(){var _=u._dbInfo,p=localStorage.getItem(_.keyPrefix+c);return p&&(p=_.serializer.deserialize(p)),p});return v(m,h),m}function Fd(c,h){var u=this,m=u.ready().then(function(){for(var _=u._dbInfo,p=_.keyPrefix,b=p.length,S=localStorage.length,C=1,I=0;I<S;I++){var T=localStorage.key(I);if(T.indexOf(p)===0){var O=localStorage.getItem(T);if(O&&(O=_.serializer.deserialize(O)),O=c(O,T.substring(b),C++),O!==void 0)return O}}});return v(m,h),m}function Vd(c,h){var u=this,m=u.ready().then(function(){var _=u._dbInfo,p;try{p=localStorage.key(c)}catch{p=null}return p&&(p=p.substring(_.keyPrefix.length)),p});return v(m,h),m}function Bd(c){var h=this,u=h.ready().then(function(){for(var m=h._dbInfo,_=localStorage.length,p=[],b=0;b<_;b++){var S=localStorage.key(b);S.indexOf(m.keyPrefix)===0&&p.push(S.substring(m.keyPrefix.length))}return p});return v(u,c),u}function Ud(c){var h=this,u=h.keys().then(function(m){return m.length});return v(u,c),u}function Hd(c,h){var u=this;c=N(c);var m=u.ready().then(function(){var _=u._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return v(m,h),m}function jd(c,h,u){var m=this;c=N(c);var _=m.ready().then(function(){h===void 0&&(h=null);var p=h;return new E(function(b,S){var C=m._dbInfo;C.serializer.serialize(h,function(I,T){if(T)S(T);else try{localStorage.setItem(C.keyPrefix+c,I),b(p)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(O),S(O)}})})});return v(_,u),_}function Gd(c,h){if(h=R.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var u=this.config();c.name=c.name||u.name,c.storeName=c.storeName||u.storeName}var m=this,_;return c.name?_=new E(function(p){c.storeName?p(ia(c,m._defaultConfig)):p(c.name+"/")}).then(function(p){for(var b=localStorage.length-1;b>=0;b--){var S=localStorage.key(b);S.indexOf(p)===0&&localStorage.removeItem(S)}}):_=E.reject("Invalid arguments"),v(_,h),_}var Wd={_driver:"localStorageWrapper",_initStorage:Pd,_support:Rd(),iterate:Fd,getItem:Ld,setItem:jd,removeItem:Hd,clear:kd,length:Ud,key:Vd,keys:Bd,dropInstance:Gd},$d=function(h,u){return h===u||typeof h=="number"&&typeof u=="number"&&isNaN(h)&&isNaN(u)},Yd=function(h,u){for(var m=h.length,_=0;_<m;){if($d(h[_],u))return!0;_++}return!1},oa=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},yn={},sa={},Wt={INDEXEDDB:pd,WEBSQL:xd,LOCALSTORAGE:Wd},zd=[Wt.INDEXEDDB._driver,Wt.WEBSQL._driver,Wt.LOCALSTORAGE._driver],lr=["dropInstance"],wi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(lr),Xd={description:"",driver:zd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Kd(c,h){c[h]=function(){var u=arguments;return c.ready().then(function(){return c[h].apply(c,u)})}}function Di(){for(var c=1;c<arguments.length;c++){var h=arguments[c];if(h)for(var u in h)h.hasOwnProperty(u)&&(oa(h[u])?arguments[0][u]=h[u].slice():arguments[0][u]=h[u])}return arguments[0]}var qd=(function(){function c(h){a(this,c);for(var u in Wt)if(Wt.hasOwnProperty(u)){var m=Wt[u],_=m._driver;this[u]=_,yn[_]||this.defineDriver(m)}this._defaultConfig=Di({},Xd),this._config=Di({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(u){if((typeof u>"u"?"undefined":s(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in u){if(m==="storeName"&&(u[m]=u[m].replace(/\W/g,"_")),m==="version"&&typeof u[m]!="number")return new Error("Database version must be a number.");this._config[m]=u[m]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},c.prototype.defineDriver=function(u,m,_){var p=new E(function(b,S){try{var C=u._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){S(I);return}for(var T=wi.concat("_initStorage"),O=0,B=T.length;O<B;O++){var G=T[O],W=!Yd(lr,G);if((W||u[G])&&typeof u[G]!="function"){S(I);return}}var Q=function(){for(var En=function(Qd){return function(){var ef=new Error("Method "+Qd+" is not implemented by the current driver"),aa=E.reject(ef);return v(aa,arguments[arguments.length-1]),aa}},Ai=0,Jd=lr.length;Ai<Jd;Ai++){var Oi=lr[Ai];u[Oi]||(u[Oi]=En(Oi))}};Q();var J=function(En){yn[C]&&console.info("Redefining LocalForage driver: "+C),yn[C]=u,sa[C]=En,b()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(J,S):J(!!u._support):J(!0)}catch(we){S(we)}});return w(p,m,_),p},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,m,_){var p=yn[u]?E.resolve(yn[u]):E.reject(new Error("Driver not found."));return w(p,m,_),p},c.prototype.getSerializer=function(u){var m=E.resolve(Ti);return w(m,u),m},c.prototype.ready=function(u){var m=this,_=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(_,u,u),_},c.prototype.setDriver=function(u,m,_){var p=this;oa(u)||(u=[u]);var b=this._getSupportedDrivers(u);function S(){p._config.driver=p.driver()}function C(O){return p._extend(O),S(),p._ready=p._initStorage(p._config),p._ready}function I(O){return function(){var B=0;function G(){for(;B<O.length;){var W=O[B];return B++,p._dbInfo=null,p._ready=null,p.getDriver(W).then(C).catch(G)}S();var Q=new Error("No available storage method found.");return p._driverSet=E.reject(Q),p._driverSet}return G()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var O=b[0];return p._dbInfo=null,p._ready=null,p.getDriver(O).then(function(B){p._driver=B._driver,S(),p._wrapLibraryMethodsWithReady(),p._initDriver=I(b)})}).catch(function(){S();var O=new Error("No available storage method found.");return p._driverSet=E.reject(O),p._driverSet}),w(this._driverSet,m,_),this._driverSet},c.prototype.supports=function(u){return!!sa[u]},c.prototype._extend=function(u){Di(this,u)},c.prototype._getSupportedDrivers=function(u){for(var m=[],_=0,p=u.length;_<p;_++){var b=u[_];this.supports(b)&&m.push(b)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=wi.length;u<m;u++)Kd(this,wi[u])},c.prototype.createInstance=function(u){return new c(u)},c})(),Zd=new qd;i.exports=Zd},{3:3}]},{},[4])(4)})});var ac=xi(($i,Yi)=>{"use strict";(function(t,e){typeof $i=="object"&&typeof Yi<"u"?Yi.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})($i,function(){"use strict";var t=function(r,i){if(i=i||{},typeof r!="function")throw new n("fetch must be a function");if(typeof i!="object")throw new n("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new n("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new n("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,l){var d=i.retries,g=i.retryDelay,f=i.retryOn;if(l&&l.retries!==void 0)if(e(l.retries))d=l.retries;else throw new n("retries must be a positive integer");if(l&&l.retryDelay!==void 0)if(e(l.retryDelay)||typeof l.retryDelay=="function")g=l.retryDelay;else throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(l&&l.retryOn)if(Array.isArray(l.retryOn)||typeof l.retryOn=="function")f=l.retryOn;else throw new n("retryOn property expects an array or function");return new Promise(function(E,v){var w=function(R){var P=typeof Request<"u"&&a instanceof Request?a.clone():a;r(P,l).then(function(M){if(Array.isArray(f)&&f.indexOf(M.status)===-1)E(M);else if(typeof f=="function")try{return Promise.resolve(f(R,null,M)).then(function(U){U?N(R,null,M):E(M)}).catch(v)}catch(U){v(U)}else R<d?N(R,null,M):E(M)}).catch(function(M){if(typeof f=="function")try{Promise.resolve(f(R,M,null)).then(function(U){U?N(R,M,null):v(M)}).catch(function(U){v(U)})}catch(U){v(U)}else R<d?N(R,M,null):v(M)})};function N(R,P,M){var U=typeof g=="function"?g(R,P,M):g;setTimeout(function(){w(++R)},U)}w(0)})}};function e(r){return Number.isInteger(r)&&r>=0}function n(r){this.name="ArgumentError",this.message=r}return t})});var Bi="11.0.0-rc.12";var nf=Bi.split("-")[0].split(".").slice(0,3).map(t=>t.padStart(2,"0")).join("");var Ya="CooeeSDK",qt=Bi,A_=parseInt(nf,10);var gr=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${qt}/dist`,Ye={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:gr,styleURL:`${gr}/widget.min.css`,widgetURL:`${gr}/widget.min.js`,swiperStyleURL:`${gr}/swiper-bundle.min.css`};var Ee=Ri(Xa());var ae=class{static debuggerEl;static infoLogs=[];static log(...e){Ee.default.info(...e)}static verbose(...e){Ee.default.debug(...e)}static error(...e){Ee.default.error(...e)}static warn(...e){Ee.default.warn(...e)}static info(...e){Ee.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Ee.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function P_(t=Ya){Ee.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${qt}):`)}});let e=rf();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ee.default.setLevel(Ee.default[localStorage.cooeeLogLevel]):Ee.default.setLevel(Ye.debug?Ee.default.TRACE:Ee.default.OFF)}function rf(){return new URL(location.href).searchParams?.get("cooee-debug")}var yt=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var Ka=0;function of(t=document.head){return qa(Ye.styleURL,t,"cooee-global-styles")}function sf(t=document.head){return qa(Ye.swiperStyleURL,t,"cooee-swiper-styles")}function qa(t,e=document.head,n){return new Promise(r=>{if(e.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=t,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",t),r()},e.appendChild(o)})}function Ui(t,e=document.head){if(!t)return;Ka++;let n=document.createElement("style");n.id=`cooee-app-css-${Ka}`,n.textContent=t,e.appendChild(n)}async function Za(){let t=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=t}async function Ja(t,e=!0){if(!t)return;let n=[];e&&n.push(sf(t)),n.push(of(t)),await Promise.all(n);let r=yt.get().website.commonCSS;Ui(r,t)}var cf={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},og=V(y({},cf),{"[class.ng-submitted]":"isSubmitted"});var lf=new Le("",{providedIn:"root",factory:()=>tc}),tc="always";var uf=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Ot({type:t});static \u0275inj=wt({})}return t})();var nc=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:lf,useValue:n.callSetDisabledState??tc}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Ot({type:t});static \u0275inj=wt({imports:[uf]})}return t})();var yr=class t{cooeeEvent=new Oe;cooeeCTA=new Oe;elementRef=x(Ae);hasSwiper=!1;_engagementTrigger=Ue(null);_triggerContext=Ue(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ae.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&Ja(e,this.hasSwiper)}ngOnDestroy(){ae.verbose("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ee({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&hr(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:1,vars:0,template:function(n,r){n&1&&Ia(0)},encapsulation:2})};var df=(t,e)=>({"--option-color":t,"background-color":e}),ic=(t,e)=>e.id;function ff(t,e){if(t&1&&(nt(0,"span",6),ye(1),_t()),t&2){Re();let n=gt(0);$(),Xt(n)}}function hf(t,e){if(t&1){let n=zt();Nt(0),nt(1,"button",5),wn("click",function(){let i=Dt(n).$implicit,o=Re().$implicit,s=Re();return At(s.onOptionChange(o,i))}),je(2,ff,2,1,"span",6),_t()}if(t&2){let n=e.$implicit,r=Re().$implicit,i=gt(1),o=n.name,s=Mt(n.displayName||n.name),a=i?n.hexColor??o:"",l=Re().selectedOptions()[r.name]===o;$(),An("color-type",i)("selected",l)("disabled",n.disabled),ba("title",s)("ngStyle",Na(14,df,a,a)),He("aria-checked",l?"true":"false")("data-value",o)("aria-disabled",n.disabled?"true":null)("aria-label",s),$(),Ge(i?-1:2)}}function pf(t,e){if(t&1&&(nt(0,"div"),Nt(1),nt(2,"div",1),ye(3),_t(),nt(4,"div",2),ye(5),_t(),nt(6,"div",3),ki(7,hf,3,17,"button",4,ic),_t()()),t&2){let n=e.$implicit,r=Re();hr(Ra("option-group ",n.name.toLowerCase())),$(),Mt(r.hasHexColors(n)),$(2),Kt("",n.name,":"),$(2),Xt(r.selectedOptions()[n.name]),$(),He("aria-label",n.name),$(),Li(n.optionValues)}}var Mn=t=>t.trim().toLowerCase(),rc=class t extends yr{selectedVariant=new Oe;item=Ne.required();selectedOptions=Ue({});options=rt(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ae.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),e.options});matchedVariant=rt(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=rt(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=Mn(o.name),a=o.value,l=n.get(s);l||n.set(s,l=new Map);let d=l.get(a);d||l.set(a,d=new Set),d.add(i)}}),n});constructor(){super(),it(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=it(()=>{let n=this.item();if(!n?.options)return;let r=y({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(a=>a.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=yt.get().website?.itemSwatchMapping;n&&Ui(n,e)}onOptionChange(e,n){let r=y({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getCandidateVariantsExcluding(e){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,a)=>{s.isAvailable&&i.add(a)});let o=i;for(let[s,a]of Object.entries(this.selectedOptions())){if(Mn(s)===Mn(e))continue;let l=r.get(Mn(s));if(!l)return new Set;let d=l.get(String(a));if(!d)return new Set;if(o=new Set([...o].filter(g=>d.has(g))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let i=this.availabilityIndex().get(Mn(e.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let a=this.getCandidateVariantsExcluding(e.name);if(a.size===0)return!0;for(let l of a)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ee({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[xt],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"color-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&ki(0,pf,9,7,"div",0,ic),n&2&&Li(r.options())},dependencies:[Fa,La,nc],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px;scrollbar-gutter:stable both-edges;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;flex-shrink:0;--selected-color: var(--option-color, rgba(var(--lc-primary-button-bg-color, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
1
+ import{$a as Na,Aa as wn,Ab as ja,B as De,Ba as Dn,Bb as pr,C as _e,Ca as Re,Cb as ot,Da as Ta,Db as $e,E as Ue,Ea as wa,Fa as Da,Fb as mr,Ga as Aa,Gb as Rn,H as Sn,Ha as Oa,Hb as Ga,I as Ae,Ib as Nn,J as va,Jb as Wa,K as Cn,Kb as $a,L as In,Lb as _r,Ma as An,N as $,Na as hr,Oa as ye,Pa as Xt,Q as fr,Qa as Kt,S as $t,T as Tn,U as Ni,Ua as Nt,V as Mi,Va as Mt,W as ee,Wa as gt,X as Ot,Xa as xa,Y as Yt,Ya as Ra,Z as ya,_ as xt,a as la,aa as Ea,ab as On,ba as Oe,bb as xn,c as me,ca as Fe,d as ua,da as mt,ea as Pi,fa as He,fb as rt,g as da,ga as je,gb as it,ha as Ge,hb as vt,i as fa,ib as Ne,ja as ki,ka as Li,kb as Ma,l as ha,la as ba,lb as Vi,m as pa,ma as nt,n as ma,na as _t,o as _a,oa as Fi,ob as Pa,pa as ge,pb as ka,q as ga,qa as xe,ra as Rt,rb as La,s as ue,t as wt,u as Le,ub as Fa,v as x,va as Sa,w as dr,wa as Ca,wb as Va,x as Dt,xa as Ia,xb as Ba,y as At,ya as zt,yb as Ua,za as We,zb as Ha}from"./chunk-MJD4XKII.js";import{a as y,b as V,c as bn,d as ca,e as xi,f as Ri,g as ur}from"./chunk-V7UGKYBN.js";var Xa=xi((za,vr)=>{"use strict";(function(t){"use strict";var e={};e.VERSION="1.6.1";var n,r={},i=function(d,g){return function(){return g.apply(d,arguments)}},o=function(){var d=arguments,g=d[0],f,E;for(E=1;E<d.length;E++)for(f in d[E])!(f in g)&&d[E].hasOwnProperty(f)&&(g[f]=d[E][f]);return g},s=function(d,g){return{value:d,name:g}};e.TRACE=s(1,"TRACE"),e.DEBUG=s(2,"DEBUG"),e.INFO=s(3,"INFO"),e.TIME=s(4,"TIME"),e.WARN=s(5,"WARN"),e.ERROR=s(8,"ERROR"),e.OFF=s(99,"OFF");var a=function(d){this.context=d,this.setLevel(d.filterLevel),this.log=this.info};a.prototype={setLevel:function(d){d&&"value"in d&&(this.context.filterLevel=d)},getLevel:function(){return this.context.filterLevel},enabledFor:function(d){var g=this.context.filterLevel;return d.value>=g.value},trace:function(){this.invoke(e.TRACE,arguments)},debug:function(){this.invoke(e.DEBUG,arguments)},info:function(){this.invoke(e.INFO,arguments)},warn:function(){this.invoke(e.WARN,arguments)},error:function(){this.invoke(e.ERROR,arguments)},time:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"start"])},timeEnd:function(d){typeof d=="string"&&d.length>0&&this.invoke(e.TIME,[d,"end"])},invoke:function(d,g){n&&this.enabledFor(d)&&n(g,o({level:d},this.context))}};var l=new a({filterLevel:e.OFF});(function(){var d=e;d.enabledFor=i(l,l.enabledFor),d.trace=i(l,l.trace),d.debug=i(l,l.debug),d.time=i(l,l.time),d.timeEnd=i(l,l.timeEnd),d.info=i(l,l.info),d.warn=i(l,l.warn),d.error=i(l,l.error),d.log=d.info})(),e.setHandler=function(d){n=d},e.setLevel=function(d){l.setLevel(d);for(var g in r)r.hasOwnProperty(g)&&r[g].setLevel(d)},e.getLevel=function(){return l.getLevel()},e.get=function(d){return r[d]||(r[d]=new a(o({name:d},l.context)))},e.createDefaultHandler=function(d){d=d||{},d.formatter=d.formatter||function(v,w){w.name&&v.unshift("["+w.name+"]")};var g={},f=function(E,v){Function.prototype.apply.call(E,console,v)};return typeof console>"u"?function(){}:function(E,v){E=Array.prototype.slice.call(E);var w=console.log,N;v.level===e.TIME?(N=(v.name?"["+v.name+"] ":"")+E[0],E[1]==="start"?console.time?console.time(N):g[N]=new Date().getTime():console.timeEnd?console.timeEnd(N):f(w,[N+": "+(new Date().getTime()-g[N])+"ms"])):(v.level===e.WARN&&console.warn?w=console.warn:v.level===e.ERROR&&console.error?w=console.error:v.level===e.INFO&&console.info?w=console.info:v.level===e.DEBUG&&console.debug?w=console.debug:v.level===e.TRACE&&console.trace&&(w=console.trace),d.formatter(E,v),f(w,E))}},e.useDefaults=function(d){e.setLevel(d&&d.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(d))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof vr<"u"&&vr.exports?vr.exports=e:(e._prevLogger=t.Logger,e.noConflict=function(){return t.Logger=e._prevLogger,e},t.Logger=e)})(za)});var sc=xi((oc,Hi)=>{"use strict";(function(t){if(typeof oc=="object"&&typeof Hi<"u")Hi.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var e;typeof window<"u"?e=window:typeof global<"u"?e=global:typeof self<"u"?e=self:e=this,e.localforage=t()}})(function(){var t,e,n;return(function r(i,o,s){function a(g,f){if(!o[g]){if(!i[g]){var E=typeof bn=="function"&&bn;if(!f&&E)return E(g,!0);if(l)return l(g,!0);var v=new Error("Cannot find module '"+g+"'");throw v.code="MODULE_NOT_FOUND",v}var w=o[g]={exports:{}};i[g][0].call(w.exports,function(N){var R=i[g][1][N];return a(R||N)},w,w.exports,r,i,o,s)}return o[g].exports}for(var l=typeof bn=="function"&&bn,d=0;d<s.length;d++)a(s[d]);return a})({1:[function(r,i,o){(function(s){"use strict";var a=s.MutationObserver||s.WebKitMutationObserver,l;if(a){var d=0,g=new a(N),f=s.document.createTextNode("");g.observe(f,{characterData:!0}),l=function(){f.data=d=++d%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=N,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var P=s.document.createElement("script");P.onreadystatechange=function(){N(),P.onreadystatechange=null,P.parentNode.removeChild(P),P=null},s.document.documentElement.appendChild(P)}:l=function(){setTimeout(N,0)};var v,w=[];function N(){v=!0;for(var P,M,U=w.length;U;){for(M=w,w=[],P=-1;++P<U;)M[P]();U=w.length}v=!1}i.exports=R;function R(P){w.push(P)===1&&!v&&l()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(r,i,o){"use strict";var s=r(1);function a(){}var l={},d=["REJECTED"],g=["FULFILLED"],f=["PENDING"];i.exports=E;function E(D){if(typeof D!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,D!==a&&R(this,D)}E.prototype.catch=function(D){return this.then(null,D)},E.prototype.then=function(D,H){if(typeof D!="function"&&this.state===g||typeof H!="function"&&this.state===d)return this;var F=new this.constructor(a);if(this.state!==f){var j=this.state===g?D:H;w(F,j,this.outcome)}else this.queue.push(new v(F,D,H));return F};function v(D,H,F){this.promise=D,typeof H=="function"&&(this.onFulfilled=H,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(D){l.resolve(this.promise,D)},v.prototype.otherCallFulfilled=function(D){w(this.promise,this.onFulfilled,D)},v.prototype.callRejected=function(D){l.reject(this.promise,D)},v.prototype.otherCallRejected=function(D){w(this.promise,this.onRejected,D)};function w(D,H,F){s(function(){var j;try{j=H(F)}catch(Z){return l.reject(D,Z)}j===D?l.reject(D,new TypeError("Cannot resolve promise with itself")):l.resolve(D,j)})}l.resolve=function(D,H){var F=P(N,H);if(F.status==="error")return l.reject(D,F.value);var j=F.value;if(j)R(D,j);else{D.state=g,D.outcome=H;for(var Z=-1,K=D.queue.length;++Z<K;)D.queue[Z].callFulfilled(H)}return D},l.reject=function(D,H){D.state=d,D.outcome=H;for(var F=-1,j=D.queue.length;++F<j;)D.queue[F].callRejected(H);return D};function N(D){var H=D&&D.then;if(D&&(typeof D=="object"||typeof D=="function")&&typeof H=="function")return function(){H.apply(D,arguments)}}function R(D,H){var F=!1;function j(Te){F||(F=!0,l.reject(D,Te))}function Z(Te){F||(F=!0,l.resolve(D,Te))}function K(){H(Z,j)}var se=P(K);se.status==="error"&&j(se.value)}function P(D,H){var F={};try{F.value=D(H),F.status="success"}catch(j){F.status="error",F.value=j}return F}E.resolve=M;function M(D){return D instanceof this?D:l.resolve(new this(a),D)}E.reject=U;function U(D){var H=new this(a);return l.reject(H,D)}E.all=Ce;function Ce(D){var H=this;if(Object.prototype.toString.call(D)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=D.length,j=!1;if(!F)return this.resolve([]);for(var Z=new Array(F),K=0,se=-1,Te=new this(a);++se<F;)et(D[se],se);return Te;function et(vn,ar){H.resolve(vn).then(Ei,function(Gt){j||(j=!0,l.reject(Te,Gt))});function Ei(Gt){Z[ar]=Gt,++K===F&&!j&&(j=!0,l.resolve(Te,Z))}}}E.race=Ie;function Ie(D){var H=this;if(Object.prototype.toString.call(D)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=D.length,j=!1;if(!F)return this.resolve([]);for(var Z=-1,K=new this(a);++Z<F;)se(D[Z]);return K;function se(Te){H.resolve(Te).then(function(et){j||(j=!0,l.resolve(K,et))},function(et){j||(j=!0,l.reject(K,et))})}}},{1:1}],3:[function(r,i,o){(function(s){"use strict";typeof s.Promise!="function"&&(s.Promise=r(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(r,i,o){"use strict";var s=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(c){return typeof c}:function(c){return c&&typeof Symbol=="function"&&c.constructor===Symbol&&c!==Symbol.prototype?"symbol":typeof c};function a(c,h){if(!(c instanceof h))throw new TypeError("Cannot call a class as a function")}function l(){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 d=l();function g(){try{if(!d||!d.open)return!1;var c=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),h=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!c||h)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(c,h){c=c||[],h=h||{};try{return new Blob(c,h)}catch(p){if(p.name!=="TypeError")throw p;for(var u=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,m=new u,_=0;_<c.length;_+=1)m.append(c[_]);return m.getBlob(h.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(c,h){h&&c.then(function(u){h(null,u)},function(u){h(u)})}function w(c,h,u){typeof h=="function"&&c.then(h),typeof u=="function"&&c.catch(u)}function N(c){return typeof c!="string"&&(console.warn(c+" used as a key, but it is not a string."),c=String(c)),c}function R(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var P="local-forage-detect-blob-support",M=void 0,U={},Ce=Object.prototype.toString,Ie="readonly",D="readwrite";function H(c){for(var h=c.length,u=new ArrayBuffer(h),m=new Uint8Array(u),_=0;_<h;_++)m[_]=c.charCodeAt(_);return u}function F(c){return new E(function(h){var u=c.transaction(P,D),m=f([""]);u.objectStore(P).put(m,"key"),u.onabort=function(_){_.preventDefault(),_.stopPropagation(),h(!1)},u.oncomplete=function(){var _=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);h(p||!_||parseInt(_[1],10)>=43)}}).catch(function(){return!1})}function j(c){return typeof M=="boolean"?E.resolve(M):F(c).then(function(h){return M=h,M})}function Z(c){var h=U[c.name],u={};u.promise=new E(function(m,_){u.resolve=m,u.reject=_}),h.deferredOperations.push(u),h.dbReady?h.dbReady=h.dbReady.then(function(){return u.promise}):h.dbReady=u.promise}function K(c){var h=U[c.name],u=h.deferredOperations.pop();if(u)return u.resolve(),u.promise}function se(c,h){var u=U[c.name],m=u.deferredOperations.pop();if(m)return m.reject(h),m.promise}function Te(c,h){return new E(function(u,m){if(U[c.name]=U[c.name]||js(),c.db)if(h)Z(c),c.db.close();else return u(c.db);var _=[c.name];h&&_.push(c.version);var p=d.open.apply(d,_);h&&(p.onupgradeneeded=function(b){var S=p.result;try{S.createObjectStore(c.storeName),b.oldVersion<=1&&S.createObjectStore(P)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+c.name+'" has been upgraded from version '+b.oldVersion+" to version "+b.newVersion+', but the storage "'+c.storeName+'" already exists.');else throw C}}),p.onerror=function(b){b.preventDefault(),m(p.error)},p.onsuccess=function(){var b=p.result;b.onversionchange=function(S){S.target.close()},u(b),K(c)}})}function et(c){return Te(c,!1)}function vn(c){return Te(c,!0)}function ar(c,h){if(!c.db)return!0;var u=!c.db.objectStoreNames.contains(c.storeName),m=c.version<c.db.version,_=c.version>c.db.version;if(m&&(c.version!==h&&console.warn('The database "'+c.name+`" can't be downgraded from version `+c.db.version+" to version "+c.version+"."),c.version=c.db.version),_||u){if(u){var p=c.db.version+1;p>c.version&&(c.version=p)}return!0}return!1}function Ei(c){return new E(function(h,u){var m=new FileReader;m.onerror=u,m.onloadend=function(_){var p=btoa(_.target.result||"");h({__local_forage_encoded_blob:!0,data:p,type:c.type})},m.readAsBinaryString(c)})}function Gt(c){var h=H(atob(c.data));return f([h],{type:c.type})}function Hs(c){return c&&c.__local_forage_encoded_blob}function nd(c){var h=this,u=h._initReady().then(function(){var m=U[h._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return w(u,c,c),u}function rd(c){Z(c);for(var h=U[c.name],u=h.forages,m=0;m<u.length;m++){var _=u[m];_._dbInfo.db&&(_._dbInfo.db.close(),_._dbInfo.db=null)}return c.db=null,et(c).then(function(p){return c.db=p,ar(c)?vn(c):p}).then(function(p){c.db=h.db=p;for(var b=0;b<u.length;b++)u[b]._dbInfo.db=p}).catch(function(p){throw se(c,p),p})}function tt(c,h,u,m){m===void 0&&(m=1);try{var _=c.db.transaction(c.storeName,h);u(null,_)}catch(p){if(m>0&&(!c.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return E.resolve().then(function(){if(!c.db||p.name==="NotFoundError"&&!c.db.objectStoreNames.contains(c.storeName)&&c.version<=c.db.version)return c.db&&(c.version=c.db.version+1),vn(c)}).then(function(){return rd(c).then(function(){tt(c,h,u,m-1)})}).catch(u);u(p)}}function js(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function id(c){var h=this,u={db:null};if(c)for(var m in c)u[m]=c[m];var _=U[u.name];_||(_=js(),U[u.name]=_),_.forages.push(h),h._initReady||(h._initReady=h.ready,h.ready=nd);var p=[];function b(){return E.resolve()}for(var S=0;S<_.forages.length;S++){var C=_.forages[S];C!==h&&p.push(C._initReady().catch(b))}var I=_.forages.slice(0);return E.all(p).then(function(){return u.db=_.db,et(u)}).then(function(T){return u.db=T,ar(u,h._defaultConfig.version)?vn(u):T}).then(function(T){u.db=_.db=T,h._dbInfo=u;for(var O=0;O<I.length;O++){var B=I[O];B!==h&&(B._dbInfo.db=u.db,B._dbInfo.version=u.version)}})}function od(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.get(c);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),Hs(T)&&(T=Gt(T)),_(T)},I.onerror=function(){p(I.error)}}catch(T){p(T)}})}).catch(p)});return v(m,h),m}function sd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var O=I.result;if(O){var B=O.value;Hs(B)&&(B=Gt(B));var G=c(B,O.key,T++);G!==void 0?_(G):O.continue()}else _()},I.onerror=function(){p(I.error)}}catch(O){p(O)}})}).catch(p)});return v(m,h),m}function ad(c,h,u){var m=this;c=N(c);var _=new E(function(p,b){var S;m.ready().then(function(){return S=m._dbInfo,Ce.call(h)==="[object Blob]"?j(S.db).then(function(C){return C?h:Ei(h)}):h}).then(function(C){tt(m._dbInfo,D,function(I,T){if(I)return b(I);try{var O=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var B=O.put(C,c);T.oncomplete=function(){C===void 0&&(C=null),p(C)},T.onabort=T.onerror=function(){var G=B.error?B.error:B.transaction.error;b(G)}}catch(G){b(G)}})}).catch(b)});return v(_,u),_}function cd(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){tt(u._dbInfo,D,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=C.delete(c);S.oncomplete=function(){_()},S.onerror=function(){p(I.error)},S.onabort=function(){var T=I.error?I.error:I.transaction.error;p(T)}}catch(T){p(T)}})}).catch(p)});return v(m,h),m}function ld(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,D,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.clear();b.oncomplete=function(){m()},b.onabort=b.onerror=function(){var I=C.error?C.error:C.transaction.error;_(I)}}catch(I){_(I)}})}).catch(_)});return v(u,c),u}function ud(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,Ie,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){_(C.error)}}catch(I){_(I)}})}).catch(_)});return v(u,c),u}function dd(c,h){var u=this,m=new E(function(_,p){if(c<0){_(null);return}u.ready().then(function(){tt(u._dbInfo,Ie,function(b,S){if(b)return p(b);try{var C=S.objectStore(u._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var O=T.result;if(!O){_(null);return}c===0||I?_(O.key):(I=!0,O.advance(c))},T.onerror=function(){p(T.error)}}catch(O){p(O)}})}).catch(p)});return v(m,h),m}function fd(c){var h=this,u=new E(function(m,_){h.ready().then(function(){tt(h._dbInfo,Ie,function(p,b){if(p)return _(p);try{var S=b.objectStore(h._dbInfo.storeName),C=S.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){_(C.error)}}catch(T){_(T)}})}).catch(_)});return v(u,c),u}function hd(c,h){h=R.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var m=this,_;if(!c.name)_=E.reject("Invalid arguments");else{var p=c.name===u.name&&m._dbInfo.db,b=p?E.resolve(m._dbInfo.db):et(c).then(function(S){var C=U[c.name],I=C.forages;C.db=S;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=S;return S});c.storeName?_=b.then(function(S){if(S.objectStoreNames.contains(c.storeName)){var C=S.version+1;Z(c);var I=U[c.name],T=I.forages;S.close();for(var O=0;O<T.length;O++){var B=T[O];B._dbInfo.db=null,B._dbInfo.version=C}var G=new E(function(W,Q){var J=d.open(c.name,C);J.onerror=function(we){var En=J.result;En.close(),Q(we)},J.onupgradeneeded=function(){var we=J.result;we.deleteObjectStore(c.storeName)},J.onsuccess=function(){var we=J.result;we.close(),W(we)}});return G.then(function(W){I.db=W;for(var Q=0;Q<T.length;Q++){var J=T[Q];J._dbInfo.db=W,K(J._dbInfo)}}).catch(function(W){throw(se(c,W)||E.resolve()).catch(function(){}),W})}}):_=b.then(function(S){Z(c);var C=U[c.name],I=C.forages;S.close();for(var T=0;T<I.length;T++){var O=I[T];O._dbInfo.db=null}var B=new E(function(G,W){var Q=d.deleteDatabase(c.name);Q.onerror=function(){var J=Q.result;J&&J.close(),W(Q.error)},Q.onblocked=function(){console.warn('dropInstance blocked for database "'+c.name+'" until all open connections are closed')},Q.onsuccess=function(){var J=Q.result;J&&J.close(),G(J)}});return B.then(function(G){C.db=G;for(var W=0;W<I.length;W++){var Q=I[W];K(Q._dbInfo)}}).catch(function(G){throw(se(c,G)||E.resolve()).catch(function(){}),G})})}return v(_,h),_}var pd={_driver:"asyncStorage",_initStorage:id,_support:g(),iterate:sd,getItem:od,setItem:ad,removeItem:cd,clear:ld,length:ud,key:dd,keys:fd,dropInstance:hd};function md(){return typeof openDatabase=="function"}var ht="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",_d="~~local_forage_type~",Gs=/^~~local_forage_type~([^~]+)~/,cr="__lfsc__:",bi=cr.length,Si="arbf",Ci="blob",Ws="si08",$s="ui08",Ys="uic8",zs="si16",Xs="si32",Ks="ur16",qs="ui32",Zs="fl32",Js="fl64",Qs=bi+Si.length,ea=Object.prototype.toString;function ta(c){var h=c.length*.75,u=c.length,m,_=0,p,b,S,C;c[c.length-1]==="="&&(h--,c[c.length-2]==="="&&h--);var I=new ArrayBuffer(h),T=new Uint8Array(I);for(m=0;m<u;m+=4)p=ht.indexOf(c[m]),b=ht.indexOf(c[m+1]),S=ht.indexOf(c[m+2]),C=ht.indexOf(c[m+3]),T[_++]=p<<2|b>>4,T[_++]=(b&15)<<4|S>>2,T[_++]=(S&3)<<6|C&63;return I}function Ii(c){var h=new Uint8Array(c),u="",m;for(m=0;m<h.length;m+=3)u+=ht[h[m]>>2],u+=ht[(h[m]&3)<<4|h[m+1]>>4],u+=ht[(h[m+1]&15)<<2|h[m+2]>>6],u+=ht[h[m+2]&63];return h.length%3===2?u=u.substring(0,u.length-1)+"=":h.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function gd(c,h){var u="";if(c&&(u=ea.call(c)),c&&(u==="[object ArrayBuffer]"||c.buffer&&ea.call(c.buffer)==="[object ArrayBuffer]")){var m,_=cr;c instanceof ArrayBuffer?(m=c,_+=Si):(m=c.buffer,u==="[object Int8Array]"?_+=Ws:u==="[object Uint8Array]"?_+=$s:u==="[object Uint8ClampedArray]"?_+=Ys:u==="[object Int16Array]"?_+=zs:u==="[object Uint16Array]"?_+=Ks:u==="[object Int32Array]"?_+=Xs:u==="[object Uint32Array]"?_+=qs:u==="[object Float32Array]"?_+=Zs:u==="[object Float64Array]"?_+=Js:h(new Error("Failed to get type for BinaryArray"))),h(_+Ii(m))}else if(u==="[object Blob]"){var p=new FileReader;p.onload=function(){var b=_d+c.type+"~"+Ii(this.result);h(cr+Ci+b)},p.readAsArrayBuffer(c)}else try{h(JSON.stringify(c))}catch(b){console.error("Couldn't convert value into a JSON string: ",c),h(null,b)}}function vd(c){if(c.substring(0,bi)!==cr)return JSON.parse(c);var h=c.substring(Qs),u=c.substring(bi,Qs),m;if(u===Ci&&Gs.test(h)){var _=h.match(Gs);m=_[1],h=h.substring(_[0].length)}var p=ta(h);switch(u){case Si:return p;case Ci:return f([p],{type:m});case Ws:return new Int8Array(p);case $s:return new Uint8Array(p);case Ys:return new Uint8ClampedArray(p);case zs:return new Int16Array(p);case Ks:return new Uint16Array(p);case Xs:return new Int32Array(p);case qs:return new Uint32Array(p);case Zs:return new Float32Array(p);case Js:return new Float64Array(p);default:throw new Error("Unkown type: "+u)}}var Ti={serialize:gd,deserialize:vd,stringToBuffer:ta,bufferToString:Ii};function na(c,h,u,m){c.executeSql("CREATE TABLE IF NOT EXISTS "+h.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function yd(c){var h=this,u={db:null};if(c)for(var m in c)u[m]=typeof c[m]!="string"?c[m].toString():c[m];var _=new E(function(p,b){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(S){return b(S)}u.db.transaction(function(S){na(S,u,function(){h._dbInfo=u,p()},function(C,I){b(I)})},b)});return u.serializer=Ti,_}function pt(c,h,u,m,_,p){c.executeSql(u,m,_,function(b,S){S.code===S.SYNTAX_ERR?b.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[h.storeName],function(C,I){I.rows.length?p(C,S):na(C,h,function(){C.executeSql(u,m,_,p)},p)},p):p(b,S)},p)}function Ed(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT * FROM "+b.storeName+" WHERE key = ? LIMIT 1",[c],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=b.serializer.deserialize(T)),_(T)},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function bd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT * FROM "+b.storeName,[],function(C,I){for(var T=I.rows,O=T.length,B=0;B<O;B++){var G=T.item(B),W=G.value;if(W&&(W=b.serializer.deserialize(W)),W=c(W,G.key,B+1),W!==void 0){_(W);return}}_()},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function ra(c,h,u,m){var _=this;c=N(c);var p=new E(function(b,S){_.ready().then(function(){h===void 0&&(h=null);var C=h,I=_._dbInfo;I.serializer.serialize(h,function(T,O){O?S(O):I.db.transaction(function(B){pt(B,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[c,T],function(){b(C)},function(G,W){S(W)})},function(B){if(B.code===B.QUOTA_ERR){if(m>0){b(ra.apply(_,[c,C,u,m-1]));return}S(B)}})})}).catch(S)});return v(p,u),p}function Sd(c,h,u){return ra.apply(this,[c,h,u,1])}function Cd(c,h){var u=this;c=N(c);var m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"DELETE FROM "+b.storeName+" WHERE key = ?",[c],function(){_()},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function Id(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"DELETE FROM "+p.storeName,[],function(){m()},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function Td(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(S,C){var I=C.rows.item(0).c;m(I)},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function wd(c,h){var u=this,m=new E(function(_,p){u.ready().then(function(){var b=u._dbInfo;b.db.transaction(function(S){pt(S,b,"SELECT key FROM "+b.storeName+" WHERE id = ? LIMIT 1",[c+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;_(T)},function(C,I){p(I)})})}).catch(p)});return v(m,h),m}function Dd(c){var h=this,u=new E(function(m,_){h.ready().then(function(){var p=h._dbInfo;p.db.transaction(function(b){pt(b,p,"SELECT key FROM "+p.storeName,[],function(S,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(S,C){_(C)})})}).catch(_)});return v(u,c),u}function Ad(c){return new E(function(h,u){c.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(_,p){for(var b=[],S=0;S<p.rows.length;S++)b.push(p.rows.item(S).name);h({db:c,storeNames:b})},function(_,p){u(p)})},function(m){u(m)})})}function Od(c,h){h=R.apply(this,arguments);var u=this.config();c=typeof c!="function"&&c||{},c.name||(c.name=c.name||u.name,c.storeName=c.storeName||u.storeName);var m=this,_;return c.name?_=new E(function(p){var b;c.name===u.name?b=m._dbInfo.db:b=openDatabase(c.name,"","",0),c.storeName?p({db:b,storeNames:[c.storeName]}):p(Ad(b))}).then(function(p){return new E(function(b,S){p.db.transaction(function(C){function I(G){return new E(function(W,Q){C.executeSql("DROP TABLE IF EXISTS "+G,[],function(){W()},function(J,we){Q(we)})})}for(var T=[],O=0,B=p.storeNames.length;O<B;O++)T.push(I(p.storeNames[O]));E.all(T).then(function(){b()}).catch(function(G){S(G)})},function(C){S(C)})})}):_=E.reject("Invalid arguments"),v(_,h),_}var xd={_driver:"webSQLStorage",_initStorage:yd,_support:md(),iterate:bd,getItem:Ed,setItem:Sd,removeItem:Cd,clear:Id,length:Td,key:wd,keys:Dd,dropInstance:Od};function Rd(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function ia(c,h){var u=c.name+"/";return c.storeName!==h.storeName&&(u+=c.storeName+"/"),u}function Nd(){var c="_localforage_support_test";try{return localStorage.setItem(c,!0),localStorage.removeItem(c),!1}catch{return!0}}function Md(){return!Nd()||localStorage.length>0}function Pd(c){var h=this,u={};if(c)for(var m in c)u[m]=c[m];return u.keyPrefix=ia(c,h._defaultConfig),Md()?(h._dbInfo=u,u.serializer=Ti,E.resolve()):E.reject()}function kd(c){var h=this,u=h.ready().then(function(){for(var m=h._dbInfo.keyPrefix,_=localStorage.length-1;_>=0;_--){var p=localStorage.key(_);p.indexOf(m)===0&&localStorage.removeItem(p)}});return v(u,c),u}function Ld(c,h){var u=this;c=N(c);var m=u.ready().then(function(){var _=u._dbInfo,p=localStorage.getItem(_.keyPrefix+c);return p&&(p=_.serializer.deserialize(p)),p});return v(m,h),m}function Fd(c,h){var u=this,m=u.ready().then(function(){for(var _=u._dbInfo,p=_.keyPrefix,b=p.length,S=localStorage.length,C=1,I=0;I<S;I++){var T=localStorage.key(I);if(T.indexOf(p)===0){var O=localStorage.getItem(T);if(O&&(O=_.serializer.deserialize(O)),O=c(O,T.substring(b),C++),O!==void 0)return O}}});return v(m,h),m}function Vd(c,h){var u=this,m=u.ready().then(function(){var _=u._dbInfo,p;try{p=localStorage.key(c)}catch{p=null}return p&&(p=p.substring(_.keyPrefix.length)),p});return v(m,h),m}function Bd(c){var h=this,u=h.ready().then(function(){for(var m=h._dbInfo,_=localStorage.length,p=[],b=0;b<_;b++){var S=localStorage.key(b);S.indexOf(m.keyPrefix)===0&&p.push(S.substring(m.keyPrefix.length))}return p});return v(u,c),u}function Ud(c){var h=this,u=h.keys().then(function(m){return m.length});return v(u,c),u}function Hd(c,h){var u=this;c=N(c);var m=u.ready().then(function(){var _=u._dbInfo;localStorage.removeItem(_.keyPrefix+c)});return v(m,h),m}function jd(c,h,u){var m=this;c=N(c);var _=m.ready().then(function(){h===void 0&&(h=null);var p=h;return new E(function(b,S){var C=m._dbInfo;C.serializer.serialize(h,function(I,T){if(T)S(T);else try{localStorage.setItem(C.keyPrefix+c,I),b(p)}catch(O){(O.name==="QuotaExceededError"||O.name==="NS_ERROR_DOM_QUOTA_REACHED")&&S(O),S(O)}})})});return v(_,u),_}function Gd(c,h){if(h=R.apply(this,arguments),c=typeof c!="function"&&c||{},!c.name){var u=this.config();c.name=c.name||u.name,c.storeName=c.storeName||u.storeName}var m=this,_;return c.name?_=new E(function(p){c.storeName?p(ia(c,m._defaultConfig)):p(c.name+"/")}).then(function(p){for(var b=localStorage.length-1;b>=0;b--){var S=localStorage.key(b);S.indexOf(p)===0&&localStorage.removeItem(S)}}):_=E.reject("Invalid arguments"),v(_,h),_}var Wd={_driver:"localStorageWrapper",_initStorage:Pd,_support:Rd(),iterate:Fd,getItem:Ld,setItem:jd,removeItem:Hd,clear:kd,length:Ud,key:Vd,keys:Bd,dropInstance:Gd},$d=function(h,u){return h===u||typeof h=="number"&&typeof u=="number"&&isNaN(h)&&isNaN(u)},Yd=function(h,u){for(var m=h.length,_=0;_<m;){if($d(h[_],u))return!0;_++}return!1},oa=Array.isArray||function(c){return Object.prototype.toString.call(c)==="[object Array]"},yn={},sa={},Wt={INDEXEDDB:pd,WEBSQL:xd,LOCALSTORAGE:Wd},zd=[Wt.INDEXEDDB._driver,Wt.WEBSQL._driver,Wt.LOCALSTORAGE._driver],lr=["dropInstance"],wi=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(lr),Xd={description:"",driver:zd.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Kd(c,h){c[h]=function(){var u=arguments;return c.ready().then(function(){return c[h].apply(c,u)})}}function Di(){for(var c=1;c<arguments.length;c++){var h=arguments[c];if(h)for(var u in h)h.hasOwnProperty(u)&&(oa(h[u])?arguments[0][u]=h[u].slice():arguments[0][u]=h[u])}return arguments[0]}var qd=(function(){function c(h){a(this,c);for(var u in Wt)if(Wt.hasOwnProperty(u)){var m=Wt[u],_=m._driver;this[u]=_,yn[_]||this.defineDriver(m)}this._defaultConfig=Di({},Xd),this._config=Di({},this._defaultConfig,h),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return c.prototype.config=function(u){if((typeof u>"u"?"undefined":s(u))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var m in u){if(m==="storeName"&&(u[m]=u[m].replace(/\W/g,"_")),m==="version"&&typeof u[m]!="number")return new Error("Database version must be a number.");this._config[m]=u[m]}return"driver"in u&&u.driver?this.setDriver(this._config.driver):!0}else return typeof u=="string"?this._config[u]:this._config},c.prototype.defineDriver=function(u,m,_){var p=new E(function(b,S){try{var C=u._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){S(I);return}for(var T=wi.concat("_initStorage"),O=0,B=T.length;O<B;O++){var G=T[O],W=!Yd(lr,G);if((W||u[G])&&typeof u[G]!="function"){S(I);return}}var Q=function(){for(var En=function(Qd){return function(){var ef=new Error("Method "+Qd+" is not implemented by the current driver"),aa=E.reject(ef);return v(aa,arguments[arguments.length-1]),aa}},Ai=0,Jd=lr.length;Ai<Jd;Ai++){var Oi=lr[Ai];u[Oi]||(u[Oi]=En(Oi))}};Q();var J=function(En){yn[C]&&console.info("Redefining LocalForage driver: "+C),yn[C]=u,sa[C]=En,b()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(J,S):J(!!u._support):J(!0)}catch(we){S(we)}});return w(p,m,_),p},c.prototype.driver=function(){return this._driver||null},c.prototype.getDriver=function(u,m,_){var p=yn[u]?E.resolve(yn[u]):E.reject(new Error("Driver not found."));return w(p,m,_),p},c.prototype.getSerializer=function(u){var m=E.resolve(Ti);return w(m,u),m},c.prototype.ready=function(u){var m=this,_=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return w(_,u,u),_},c.prototype.setDriver=function(u,m,_){var p=this;oa(u)||(u=[u]);var b=this._getSupportedDrivers(u);function S(){p._config.driver=p.driver()}function C(O){return p._extend(O),S(),p._ready=p._initStorage(p._config),p._ready}function I(O){return function(){var B=0;function G(){for(;B<O.length;){var W=O[B];return B++,p._dbInfo=null,p._ready=null,p.getDriver(W).then(C).catch(G)}S();var Q=new Error("No available storage method found.");return p._driverSet=E.reject(Q),p._driverSet}return G()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var O=b[0];return p._dbInfo=null,p._ready=null,p.getDriver(O).then(function(B){p._driver=B._driver,S(),p._wrapLibraryMethodsWithReady(),p._initDriver=I(b)})}).catch(function(){S();var O=new Error("No available storage method found.");return p._driverSet=E.reject(O),p._driverSet}),w(this._driverSet,m,_),this._driverSet},c.prototype.supports=function(u){return!!sa[u]},c.prototype._extend=function(u){Di(this,u)},c.prototype._getSupportedDrivers=function(u){for(var m=[],_=0,p=u.length;_<p;_++){var b=u[_];this.supports(b)&&m.push(b)}return m},c.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=wi.length;u<m;u++)Kd(this,wi[u])},c.prototype.createInstance=function(u){return new c(u)},c})(),Zd=new qd;i.exports=Zd},{3:3}]},{},[4])(4)})});var ac=xi(($i,Yi)=>{"use strict";(function(t,e){typeof $i=="object"&&typeof Yi<"u"?Yi.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t.fetchRetry=e())})($i,function(){"use strict";var t=function(r,i){if(i=i||{},typeof r!="function")throw new n("fetch must be a function");if(typeof i!="object")throw new n("defaults must be an object");if(i.retries!==void 0&&!e(i.retries))throw new n("retries must be a positive integer");if(i.retryDelay!==void 0&&!e(i.retryDelay)&&typeof i.retryDelay!="function")throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(i.retryOn!==void 0&&!Array.isArray(i.retryOn)&&typeof i.retryOn!="function")throw new n("retryOn property expects an array or function");var o={retries:3,retryDelay:1e3,retryOn:[]};return i=Object.assign(o,i),function(a,l){var d=i.retries,g=i.retryDelay,f=i.retryOn;if(l&&l.retries!==void 0)if(e(l.retries))d=l.retries;else throw new n("retries must be a positive integer");if(l&&l.retryDelay!==void 0)if(e(l.retryDelay)||typeof l.retryDelay=="function")g=l.retryDelay;else throw new n("retryDelay must be a positive integer or a function returning a positive integer");if(l&&l.retryOn)if(Array.isArray(l.retryOn)||typeof l.retryOn=="function")f=l.retryOn;else throw new n("retryOn property expects an array or function");return new Promise(function(E,v){var w=function(R){var P=typeof Request<"u"&&a instanceof Request?a.clone():a;r(P,l).then(function(M){if(Array.isArray(f)&&f.indexOf(M.status)===-1)E(M);else if(typeof f=="function")try{return Promise.resolve(f(R,null,M)).then(function(U){U?N(R,null,M):E(M)}).catch(v)}catch(U){v(U)}else R<d?N(R,null,M):E(M)}).catch(function(M){if(typeof f=="function")try{Promise.resolve(f(R,M,null)).then(function(U){U?N(R,M,null):v(M)}).catch(function(U){v(U)})}catch(U){v(U)}else R<d?N(R,M,null):v(M)})};function N(R,P,M){var U=typeof g=="function"?g(R,P,M):g;setTimeout(function(){w(++R)},U)}w(0)})}};function e(r){return Number.isInteger(r)&&r>=0}function n(r){this.name="ArgumentError",this.message=r}return t})});var Bi="11.0.0-rc.13";var nf=Bi.split("-")[0].split(".").slice(0,3).map(t=>t.padStart(2,"0")).join("");var Ya="CooeeSDK",qt=Bi,A_=parseInt(nf,10);var gr=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${qt}/dist`,Ye={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:gr,styleURL:`${gr}/widget.min.css`,widgetURL:`${gr}/widget.min.js`,swiperStyleURL:`${gr}/swiper-bundle.min.css`};var Ee=Ri(Xa());var ae=class{static debuggerEl;static infoLogs=[];static log(...e){Ee.default.info(...e)}static verbose(...e){Ee.default.debug(...e)}static error(...e){Ee.default.error(...e)}static warn(...e){Ee.default.warn(...e)}static info(...e){Ee.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Ee.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function P_(t=Ya){Ee.default.useDefaults({formatter:function(n){n.unshift(`${t} (v${qt}):`)}});let e=rf();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Ee.default.setLevel(Ee.default[localStorage.cooeeLogLevel]):Ee.default.setLevel(Ye.debug?Ee.default.TRACE:Ee.default.OFF)}function rf(){return new URL(location.href).searchParams?.get("cooee-debug")}var yt=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(e){return e??={},this.gaEnabled=e.gaEnabled,this.gaMeasurementID=e.gaMeasurementID,this.pixelPush=e.pixelPush,this.website=e.website??{},this.currencyCount=e.currencyCount??0,this.money=e.money,this.currency=e.currency,this.storefrontToken=e.storefrontToken,this.skipItemAttribute=e.skipItemAttribute,this}};var Ka=0;function of(t=document.head){return qa(Ye.styleURL,t,"cooee-global-styles")}function sf(t=document.head){return qa(Ye.swiperStyleURL,t,"cooee-swiper-styles")}function qa(t,e=document.head,n){return new Promise(r=>{if(e.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=t,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",t),r()},e.appendChild(o)})}function Ui(t,e=document.head){if(!t)return;Ka++;let n=document.createElement("style");n.id=`cooee-app-css-${Ka}`,n.textContent=t,e.appendChild(n)}async function Za(){let t=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=t}async function Ja(t,e=!0){if(!t)return;let n=[];e&&n.push(sf(t)),n.push(of(t)),await Promise.all(n);let r=yt.get().website.commonCSS;Ui(r,t)}var cf={"[class.ng-untouched]":"isUntouched","[class.ng-touched]":"isTouched","[class.ng-pristine]":"isPristine","[class.ng-dirty]":"isDirty","[class.ng-valid]":"isValid","[class.ng-invalid]":"isInvalid","[class.ng-pending]":"isPending"},og=V(y({},cf),{"[class.ng-submitted]":"isSubmitted"});var lf=new Le("",{providedIn:"root",factory:()=>tc}),tc="always";var uf=(()=>{class t{static \u0275fac=function(r){return new(r||t)};static \u0275mod=Ot({type:t});static \u0275inj=wt({})}return t})();var nc=(()=>{class t{static withConfig(n){return{ngModule:t,providers:[{provide:lf,useValue:n.callSetDisabledState??tc}]}}static \u0275fac=function(r){return new(r||t)};static \u0275mod=Ot({type:t});static \u0275inj=wt({imports:[uf]})}return t})();var yr=class t{cooeeEvent=new Oe;cooeeCTA=new Oe;elementRef=x(Ae);hasSwiper=!1;_engagementTrigger=Ue(null);_triggerContext=Ue(null);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let e=["letscooee-widget"],n=this._engagementTrigger();return e.push(`widget-${n?.shortID}`),e}get triggerContext(){return this._triggerContext()}set triggerContext(e){this._triggerContext.set(e),this._engagementTrigger.set(e.triggerData),this.engagementTriggerReceived(e.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){ae.verbose("Init",this.constructor.name);let e=this.elementRef.nativeElement.shadowRoot;e&&Ja(e,this.hasSwiper)}ngOnDestroy(){ae.verbose("Destroying",this.constructor.name)}sendEventToRenderer(e){this.cooeeEvent.emit(e)}executeCTAViaRenderer(e){this.cooeeCTA.emit(e)}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ee({type:t,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&hr(r.classes)},inputs:{triggerContext:"triggerContext"},outputs:{cooeeEvent:"cooeeEvent",cooeeCTA:"cooeeCTA"},decls:1,vars:0,template:function(n,r){n&1&&Ia(0)},encapsulation:2})};var df=(t,e)=>({"--option-color":t,"background-color":e}),ic=(t,e)=>e.id;function ff(t,e){if(t&1&&(nt(0,"span",6),ye(1),_t()),t&2){Re();let n=gt(0);$(),Xt(n)}}function hf(t,e){if(t&1){let n=zt();Nt(0),nt(1,"button",5),wn("click",function(){let i=Dt(n).$implicit,o=Re().$implicit,s=Re();return At(s.onOptionChange(o,i))}),je(2,ff,2,1,"span",6),_t()}if(t&2){let n=e.$implicit,r=Re().$implicit,i=gt(1),o=n.name,s=Mt(n.displayName||n.name),a=i?n.hexColor??o:"",l=Re().selectedOptions()[r.name]===o;$(),An("color-type",i)("selected",l)("disabled",n.disabled),ba("title",s)("ngStyle",Na(14,df,a,a)),He("aria-checked",l?"true":"false")("data-value",o)("aria-disabled",n.disabled?"true":null)("aria-label",s),$(),Ge(i?-1:2)}}function pf(t,e){if(t&1&&(nt(0,"div"),Nt(1),nt(2,"div",1),ye(3),_t(),nt(4,"div",2),ye(5),_t(),nt(6,"div",3),ki(7,hf,3,17,"button",4,ic),_t()()),t&2){let n=e.$implicit,r=Re();hr(Ra("option-group ",n.name.toLowerCase())),$(),Mt(r.hasHexColors(n)),$(2),Kt("",n.name,":"),$(2),Xt(r.selectedOptions()[n.name]),$(),He("aria-label",n.name),$(),Li(n.optionValues)}}var Mn=t=>t.trim().toLowerCase(),rc=class t extends yr{selectedVariant=new Oe;item=Ne.required();selectedOptions=Ue({});options=rt(()=>{let e=this.item();if(!e.options||e.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(e,this.engagementTrigger)}catch(n){ae.error(n)}return e.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),e.options});matchedVariant=rt(()=>{let e=this.item(),n=this.selectedOptions();return e.vars.find(r=>e.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=rt(()=>{let e=this.item(),n=new Map;return e?.vars?.length&&e.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=Mn(o.name),a=o.value,l=n.get(s);l||n.set(s,l=new Map);let d=l.get(a);d||l.set(a,d=new Set),d.add(i)}}),n});constructor(){super(),it(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let e=it(()=>{let n=this.item();if(!n?.options)return;let r=y({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(a=>a.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),e.destroy()})}ngOnInit(){super.ngOnInit();let e=this.elementRef.nativeElement.shadowRoot;if(!e)return;let n=yt.get().website?.itemSwatchMapping;n&&Ui(n,e)}onOptionChange(e,n){let r=y({},this.selectedOptions());r[e.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(e){return!!e.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getCandidateVariantsExcluding(e){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,a)=>{s.isAvailable&&i.add(a)});let o=i;for(let[s,a]of Object.entries(this.selectedOptions())){if(Mn(s)===Mn(e))continue;let l=r.get(Mn(s));if(!l)return new Set;let d=l.get(String(a));if(!d)return new Set;if(o=new Set([...o].filter(g=>d.has(g))),o.size===0)return o}return o}isOptionValueDisabledFast(e,n){let i=this.availabilityIndex().get(Mn(e.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let a=this.getCandidateVariantsExcluding(e.name);if(a.size===0)return!0;for(let l of a)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||t)};static \u0275cmp=ee({type:t,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[xt],decls:2,vars:0,consts:[[3,"class"],[1,"name"],[1,"selected-value"],["role","radiogroup",1,"option-values"],["type","button","role","radio",1,"option-value",3,"color-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&ki(0,pf,9,7,"div",0,ic),n&2&&Li(r.options())},dependencies:[Fa,La,nc],styles:[`.option-group{display:flex;gap:4px;align-items:center}.option-group+.option-group{margin-top:8px}.option-values{display:flex;flex-wrap:nowrap;overflow-x:auto;padding:6px;gap:4px;scrollbar-gutter:stable both-edges;scrollbar-width:none}.option-values::-webkit-scrollbar{display:none}.selected-value{display:none}.option-value{padding:5px 10px;border:1px solid #ccc;cursor:pointer;border-radius:4px;min-width:32px;min-height:32px;text-align:center;position:relative;flex-shrink:0;--selected-color: var(--option-color, rgba(var(--lc-primary-button-bg-color, 0 0 0)))}.option-value.selected{box-shadow:#fff 0 0 0 2px,var(--selected-color) 0 0 0 4px}.option-value.disabled{opacity:.5;pointer-events:none}
2
2
  `],encapsulation:3})};var mf=(function(t){return t.SHOPIFY_CHECKOUT="shopify_checkout",t.THIRD_PARTY_CHECKOUT="third_party_checkout",t.CART_PAGE="cart_page",t.CART_DRAWER="cart_drawer",t})(mf||{});var _f=(function(t){return t[t.NONE=0]="NONE",t[t.REJECT_POPUP=1]="REJECT_POPUP",t[t.ACCEPT_POPUP=2]="ACCEPT_POPUP",t[t.GO_TO_URL=4]="GO_TO_URL",t[t.SHARE=5]="SHARE",t[t.KEY_VALUE=100]="KEY_VALUE",t[t.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",t[t.ADD_TO_CART=102]="ADD_TO_CART",t[t.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",t[t.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",t[t.OPEN_CART=105]="OPEN_CART",t[t.SUBMIT_FORM=106]="SUBMIT_FORM",t[t.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",t[t.ADD_BUNDLE=108]="ADD_BUNDLE",t[t.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",t})(_f||{});var gf=(function(t){return t.FREE_SHIPPING="FREE_SHIPPING",t.DISCOUNT="DISCOUNT",t.FREE_AUTO_GIFT="FREE_AUTO_GIFT",t.FREE_GIFT_SELECT="FREE_GIFT_SELECT",t.UI_ONLY="UI_ONLY",t})(gf||{});var ji=Ri(sc());function Er(t){return ji.default.createInstance({name:"lc",storeName:t,driver:ji.default.LOCALSTORAGE})}var Jt=class{static storage;static async get(e,n){return await this.storage?.getItem(e)??n}static set(e,n){return this.storage?.setItem(e,n)}static remove(e){return this.storage?.removeItem(e)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var Pn=class Pn extends Jt{};ur(Pn,"storeName","usr"),Pn.storage=Er(Pn.storeName);var Gi=Pn;var kn=class kn extends Jt{};ur(kn,"storeName","ses"),kn.storage=Er(kn.storeName);var Wi=kn;var cc=Ri(ac());var vf=5,yf=500,Ef=(0,cc.default)(fetch),bf={retryDelay:t=>Math.pow(2,t)*yf,retryOn:(t,e,n)=>t>=vf?!1:!!(e!==null||n?.status&&n?.status>=500)},Ln=class extends Error{request;response;status;requestBody;responseText;constructor(e="Failed to fetch"){super(e),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function lc(t,e,n){let r=Date.now(),i=new Request(t,e),o;try{o=await Ef(i,y(y({},bf),n))}catch{}if(!o||!o.ok){let g=new Ln;throw g.request=i.clone(),g.response=o?.clone(),g.status=o?.status,g.requestBody=e?.body,g.responseText=await Sf(o),g}let s,a=(o.headers.get("content-type")||"").toLowerCase(),l=o.headers.get("content-length"),d=i.method?.toUpperCase()||"GET";return o.status===204||o.status===205||d==="HEAD"||l==="0"?s=void 0:a.includes("application/json")||a.includes("application/problem+json")||a.includes("text/javascript")?s=await o.json():a.includes("text/")||a.includes("image/svg+xml")?s=await o.text():s=await o.arrayBuffer(),{data:s,status:o.status,statusText:o.statusText,headers:o.headers,timeTakenMs:Date.now()-r,options:e,request:i}}async function Sf(t){if(t){try{return t=t.clone(),await t.json()}catch{}try{return await t.text()}catch{}}}var k=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var L=globalThis;var ze="9.42.0";function Pt(){return kt(L),L}function kt(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||ze,e[ze]=e[ze]||{}}function st(t,e,n=L){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[ze]=r[ze]||{};return i[t]||(i[t]=e())}var zi=["debug","info","warn","error","log","assert","trace"],Cf="Sentry Logger ",Qt={};function Et(t){if(!("console"in L))return t();let e=L.console,n={},r=Object.keys(Qt);r.forEach(i=>{let o=Qt[i];n[i]=e[i],e[i]=o});try{return t()}finally{r.forEach(i=>{e[i]=n[i]})}}function If(){Ki().enabled=!0}function Tf(){Ki().enabled=!1}function uc(){return Ki().enabled}function wf(...t){Xi("log",...t)}function Df(...t){Xi("warn",...t)}function Af(...t){Xi("error",...t)}function Xi(t,...e){k&&uc()&&Et(()=>{L.console[t](`${Cf}[${t}]:`,...e)})}function Ki(){return k?st("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var A={enable:If,disable:Tf,isEnabled:uc,log:wf,warn:Df,error:Af};var dc=/\(error: (.*)\)/,fc=/captureMessage|captureException/;function Zi(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
3
3
  `);for(let a=r;a<s.length;a++){let l=s[a];if(l.length>1024)continue;let d=dc.test(l)?l.replace(dc,"$1"):l;if(!d.match(/\S*Error: /)){for(let g of e){let f=g(d);if(f){o.push(f);break}}if(o.length>=50+i)break}}return hc(o.slice(i))}}function hc(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(br(e).function||"")&&e.pop(),e.reverse(),fc.test(br(e).function||"")&&(e.pop(),fc.test(br(e).function||"")&&e.pop()),e.slice(0,50).map(n=>V(y({},n),{filename:n.filename||br(e).filename,function:n.function||"?"}))}function br(t){return t[t.length-1]||{}}var qi="<anonymous>";function Me(t){try{return!t||typeof t!="function"?qi:t.name||qi}catch{return qi}}function Sr(t){let e=t.exception;if(e){let n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var Cr={},pc={};function fe(t,e){Cr[t]=Cr[t]||[],Cr[t].push(e)}function he(t,e){if(!pc[t]){pc[t]=!0;try{e()}catch(n){k&&A.error(`Error while instrumenting ${t}`,n)}}}function te(t,e){let n=t&&Cr[t];if(n)for(let r of n)try{r(e)}catch(i){k&&A.error(`Error while triggering instrumentation handler.
4
4
  Type: ${t}
package/dist/main.min.js CHANGED
@@ -7,7 +7,7 @@ import{a as _,b as Z,c as Oo,d as mm,e as Po,f as Cr,g as bi}from"./chunk-V7UGKY
7
7
 
8
8
  `+ne.message+`
9
9
  `+Array(ne.message.length+1).join("=")+`
10
- `+I(A,k)):ne}}function Bt(A,R){var W;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(W=typeof A=="function"?A:Ze(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,W),W)}Ce.l.bind(Ce),t.compile=Ze,t.compileScope=M,t.compileScopeIntoFunction=H,t.compileToString=I,t.defaultConfig=Ce,t.filters=Ie,t.getConfig=qe,t.helpers=me,t.nativeHelpers=Me,t.parse=y,t.render=function(A,R,W,k){var $=qe(W||{});if(!$.async)return Bt(A,$)(R,$);if(!k){if(typeof n=="function")return new n(function(ne,he){try{ne(Bt(A,$)(R,$))}catch(Ke){he(Ke)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Bt(A,$)(R,$,k)}catch(ne){return k(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var ou="11.0.0-rc.12";var Bv=ou.split("-")[0].split(".").slice(0,3).map(t=>t.padStart(2,"0")).join(""),Zs="WEB",dm="CooeeSDK",Kr=ou,hm=parseInt(Bv,10);var gm=["collection","product","cart"],ym=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],vm=["View Item","View Cart","View Collection"];var ea=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Kr}/dist`,Gt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:ea,styleURL:`${ea}/widget.min.css`,widgetURL:`${ea}/widget.min.js`,swiperStyleURL:`${ea}/swiper-bundle.min.css`};var Yt=Cr(wi());var b=class{static debuggerEl;static infoLogs=[];static log(...e){Yt.default.info(...e)}static verbose(...e){Yt.default.debug(...e)}static error(...e){Yt.default.error(...e)}static warn(...e){Yt.default.warn(...e)}static info(...e){Yt.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Yt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function _m(t=dm){Yt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${Kr}):`)}});let e=su();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Yt.default.setLevel(Yt.default[localStorage.cooeeLogLevel]):Yt.default.setLevel(Gt.debug?Yt.default.TRACE:Yt.default.OFF)}function su(){return new URL(location.href).searchParams?.get("cooee-debug")}function bm(){let t=`
10
+ `+I(A,k)):ne}}function Bt(A,R){var W;return R.cache&&R.name&&R.storage.templates.get(R.name)?R.storage.templates.get(R.name):(W=typeof A=="function"?A:Ze(A,R),R.cache&&R.name&&R.storage.templates.define(R.name,W),W)}Ce.l.bind(Ce),t.compile=Ze,t.compileScope=M,t.compileScopeIntoFunction=H,t.compileToString=I,t.defaultConfig=Ce,t.filters=Ie,t.getConfig=qe,t.helpers=me,t.nativeHelpers=Me,t.parse=y,t.render=function(A,R,W,k){var $=qe(W||{});if(!$.async)return Bt(A,$)(R,$);if(!k){if(typeof n=="function")return new n(function(ne,he){try{ne(Bt(A,$)(R,$))}catch(Ke){he(Ke)}});throw e("Please provide a callback function, this env doesn't support Promises")}try{Bt(A,$)(R,$,k)}catch(ne){return k(ne)}},t.templates=se,Object.defineProperty(t,"__esModule",{value:!0})})});var ou="11.0.0-rc.13";var Bv=ou.split("-")[0].split(".").slice(0,3).map(t=>t.padStart(2,"0")).join(""),Zs="WEB",dm="CooeeSDK",Kr=ou,hm=parseInt(Bv,10);var gm=["collection","product","cart"],ym=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],vm=["View Item","View Cart","View Collection"];var ea=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Kr}/dist`,Gt={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:ea,styleURL:`${ea}/widget.min.css`,widgetURL:`${ea}/widget.min.js`,swiperStyleURL:`${ea}/swiper-bundle.min.css`};var Yt=Cr(wi());var b=class{static debuggerEl;static infoLogs=[];static log(...e){Yt.default.info(...e)}static verbose(...e){Yt.default.debug(...e)}static error(...e){Yt.default.error(...e)}static warn(...e){Yt.default.warn(...e)}static info(...e){Yt.default.info(...e),this.infoLogs.unshift({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){Yt.default.trace(...e)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function _m(t=dm){Yt.default.useDefaults({formatter:function(r){r.unshift(`${t} (v${Kr}):`)}});let e=su();(e==="1"||e==="on")&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?Yt.default.setLevel(Yt.default[localStorage.cooeeLogLevel]):Yt.default.setLevel(Gt.debug?Yt.default.TRACE:Yt.default.OFF)}function su(){return new URL(location.href).searchParams?.get("cooee-debug")}function bm(){let t=`
11
11
  display: inline-block;
12
12
  font-size: 14px;
13
13
  background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);
@@ -1,3 +1,3 @@
1
- import{a as be,c as ye,e as H,g as Ve,i as E,k as Z,o as De,q as Ie,r as Ee,s as ke,u as Pe,v as $,w as Me,x as Oe,y as Se,z as Ae}from"./chunk-VXRG4MHP.js";import{Aa as g,Ca as d,D as oe,E as D,Fa as K,Ga as G,Ha as Y,I as M,Ia as se,Ja as ce,K as O,Ka as P,L as k,La as N,N as a,Oa as w,Pa as pe,Ra as me,Sa as ue,Ta as ge,Ua as ve,Va as he,W as x,Wa as z,Xa as _e,_a as Ce,aa as S,ab as T,ba as Q,bb as I,db as fe,fa as A,ga as v,gb as L,ha as h,hb as J,ia as F,ib as R,ja as b,jb as we,ka as y,kb as X,la as c,ma as s,na as l,oa as u,pa as ne,qa as re,qb as B,ra as ae,sa as de,sb as xe,ta as le,ua as q,v as V,x as p,xb as Te,y as m,ya as _}from"./chunk-MJD4XKII.js";import"./chunk-V7UGKYBN.js";var Ne=o=>({active:o}),ze=(o,t)=>t.mID;function Le(o,t){if(o&1&&u(0,"img",7),o&2){let e=t.$implicit,i=d();c("src",e.url,k)("alt",i.item().name)}}function Re(o,t){if(o&1&&(u(0,"span",16),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.d)),O)}}function Be(o,t){if(o&1&&(u(0,"span",17),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.cmp)),O)}}function He(o,t){if(o&1&&(s(0,"div",10),v(1,Re,3,5,"span",16),v(2,Be,3,5,"span",17),l()),o&2){d();let e=z(13);a(),h(e.d?1:-1),a(),h(e.cmp?2:-1)}}function $e(o,t){if(o&1){let e=_();s(0,"a",20),g("click",function(n){let r=p(e).$implicit,C=d(2);return m(C.changeItem(n,r))}),u(1,"img",21),l()}if(o&2){let e=t.$implicit,i=d(2);c("ngClass",Ce(3,Ne,e.mID===i.item().mID+"")),a(),c("src",e.firstImageURL,k)("alt",i.item().name)}}function je(o,t){if(o&1&&(s(0,"span",18),w(1,"Select product"),l(),s(2,"div",6),b(3,$e,2,5,"a",19,ze),l()),o&2){let e=d();a(3),y(e.similarItems())}}function Ue(o,t){if(o&1&&(s(0,"span",22),w(1,"Select variant"),l(),u(2,"cooee-item-options-picker",23)),o&2){let e=d();a(2),c("item",e.item())}}function We(o,t){if(o&1&&(s(0,"div",24),w(1,"Description"),l(),u(2,"div",25),T(3,"safeHtml")),o&2){let e=d();a(2),c("innerHTML",I(3,1,e.item().desc),O)}}function Qe(o,t){o&1&&w(0," Add To Cart ")}function qe(o,t){o&1&&w(0," Out of stock ")}var j=class o{closeModel=new Q;performCTA=new Q;item=X.required();similarItems=X.required();closeDialog(){this.closeModel.emit()}clickAddToCart(){this.performCTA.emit({item:this.item(),cta:E.ADD_TO_CART})}openCart(){this.performCTA.emit({item:this.item(),cta:E.OPEN_CART})}changeItem(t,e){t.stopPropagation(),t.preventDefault(),this.item.set(e)}goToPDP(){this.performCTA.emit({item:this.item(),cta:E.GO_TO_PRODUCT})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-item-detail"]],hostAttrs:[1,"letscooee-widget"],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{closeModel:"closeModel",performCTA:"performCTA",item:"itemChange",similarItems:"similarItemsChange"},decls:26,vars:8,consts:[[1,"lc-card-wrapper","card-wrapper"],[1,"lc-card-header","card-header"],[1,"lc-header","header"],["type","button","aria-label","Close product details",1,"lc-close-button","close-button",3,"click"],["name","close","aria-hidden","true"],[1,"card-content"],[1,"lc-image-strip","image-strip"],[1,"w-28","h-28","object-contain",3,"src","alt"],[1,"lc-inner-body","inner-body"],[1,"lc-item-name","item-name"],[1,"lc-prices","prices"],[1,"lc-card-footer","card-footer"],["type","button",1,"lc-cta-button","cta-button",3,"click","disabled"],["type","button",1,"lc-more-info-button","more-info-button",3,"click"],["type","button","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],[1,"lc-item-price","item-price",3,"innerHTML"],[1,"lc-item-cmp-price","item-cmp-price",3,"innerHTML"],[1,"lc-selected-product-title","selected-product-title"],["href","#",1,"product-selector",3,"ngClass"],["href","#",1,"product-selector",3,"click","ngClass"],[3,"src","alt"],[1,"selected-variant-title"],[3,"item"],[1,"lc-description-title","description-title"],[1,"lc-description","description",3,"innerHTML"]],template:function(e,i){if(e&1){let n=_();s(0,"div",0)(1,"div",1)(2,"div",2),w(3,"Shop Now"),l(),s(4,"button",3),g("click",function(){return p(n),m(i.closeDialog())}),u(5,"cooee-icon",4),l()(),s(6,"div",5)(7,"div",6),b(8,Le,1,2,"img",7,F),l(),s(10,"div",8)(11,"div",9),w(12),l(),ve(13),v(14,He,3,2,"div",10),v(15,je,5,0),v(16,Ue,3,1),v(17,We,4,3),l()(),s(18,"div",11)(19,"button",12),g("click",function(){return p(n),m(i.clickAddToCart())}),v(20,Qe,1,0)(21,qe,1,0),l(),s(22,"button",13),g("click",function(){return p(n),m(i.goToPDP())}),w(23," More Info "),l(),s(24,"button",14),g("click",function(){return p(n),m(i.openCart())}),u(25,"img",15),l()()()}if(e&2){let n=i.item().selectedOrFirstVariant.value;a(8),y(i.item().imgs),a(4),pe(i.item().name),a();let r=he(n.price);a(),h(r?14:-1),a(),h(i.similarItems().length>1?15:-1),a(),h(i.item().hasVariants()?16:-1),a(),h(i.item().desc?17:-1),a(2),c("disabled",!n.isAvailable),a(),h(n.isAvailable?20:21)}},dependencies:[B,Ve,$,Te,De],styles:["[_nghost-%COMP%]{display:block;background:#fff}.card-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;overflow:auto}.card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.header[_ngcontent-%COMP%]{font-size:24px;font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color))}.close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px}.close-button[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{color:#000000b3}.card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain}.inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:8px;flex-wrap:nowrap}.image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;border-radius:var(--lc-media-radius);padding:2px}.product-selector.active[_ngcontent-%COMP%]{border:1px solid rgba(var(--lc-primary-color))}.product-selector[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:100%;border-radius:var(--lc-media-radius)}.description-title[_ngcontent-%COMP%], .selected-product-title[_ngcontent-%COMP%], .selected-variant-title[_ngcontent-%COMP%]{font-size:var(--lc-subheading-size);font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color));margin-top:8px;line-height:normal}.description[_ngcontent-%COMP%]{line-height:normal;color:#000;font-size:var(--lc-description-size);font-weight:var(--lc-description-weight)}.card-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:var(--lc-item-detail-footer-padding);background-color:rgba(var(--lc-item-detail-footer-bg-color));box-shadow:var(--lc-item-detail-footer-box-shadow);gap:12px}.cta-button[_ngcontent-%COMP%], .more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;display:flex;justify-content:center;align-items:center}.more-info-button[_ngcontent-%COMP%]{background-color:rgba(var(--lc-secondary-button-bg-color));color:rgba(var(--lc-secondary-button-color));font-weight:var(--lc-secondary-button-weight);text-transform:var(--lc-secondary-button-transform);border-radius:var(--lc-button-radius);font-size:var(--lc-button-size);font-family:var(--lc-button-family),serif;height:var(--lc-button-height);letter-spacing:var(--lc-button-letter-spacing);transition:filter .12s ease,background-color .2s ease,color .2s ease;border-width:1px;border-style:solid;border-color:rgba(var(--lc-secondary-button-border-color))}.more-info-button[_ngcontent-%COMP%]:hover{filter:brightness(.95)}.more-info-button[_ngcontent-%COMP%]:active{filter:brightness(.9)}.more-info-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(var(--lc-primary-color, 0, 0, 0));outline-offset:2px}"]})};var U=class o{video=R.required();progress=D(0);constructor(){L(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100)};e.addEventListener("timeupdate",i),t(()=>{e.removeEventListener("timeupdate",i)})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(e,i){e&1&&(ne(0,"div",0)(1,"div",1),ae(2,"div"),re()()),e&2&&(a(),N("width",i.progress(),"%"),A("aria-valuenow",i.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var Ke=["swiperContainer"],Ge=(o,t)=>t.id;function Ye(o,t){if(o&1){let e=_();s(0,"div",3)(1,"cooee-item-card",4),g("buttonClick",function(n){p(e);let r=d();return m(r.onButtonClick(n))})("click",function(){let n=p(e).$implicit,r=d();return m(r.cardClick.emit(n))}),l()()}if(o&2){let e=t.$implicit;a(),c("item",e)}}var W=class o{items=R.required();cardClick=J();buttonClick=J();destroyRef=V(oe);elementRef=V(M);swiperContainerRef=we.required("swiperContainer");swiperInstance;constructor(){L(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){H(this.elementRef.nativeElement.shadowRoot)}onButtonClick(t){let e=ye.get().website?.canChangeVariantInCart;if(this.items()?.length>1||t.hasVariants()&&!e){this.cardClick.emit(t);return}this.buttonClick.emit(t)}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-promoted-items"]],viewQuery:function(e,i){e&1&&se(i.swiperContainerRef,Ke,5),e&2&&ce()},hostAttrs:[1,"letscooee-widget"],inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick",buttonClick:"buttonClick"},decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(e,i){e&1&&(s(0,"div",1,0)(2,"div",2),b(3,Ye,2,1,"div",3,Ge),l()()),e&2&&(a(3),y(i.items()))},dependencies:[Ae],styles:[`:host{display:block;width:100%}cooee-item-card{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgba(var(--lc-card-bg-color));cursor:pointer;border-radius:var(--lc-card-radius)}
1
+ import{a as be,c as ye,e as H,g as Ve,i as E,k as Z,o as De,q as Ie,r as Ee,s as ke,u as Pe,v as $,w as Me,x as Oe,y as Se,z as Ae}from"./chunk-HVQGML7G.js";import{Aa as g,Ca as d,D as oe,E as D,Fa as K,Ga as G,Ha as Y,I as M,Ia as se,Ja as ce,K as O,Ka as P,L as k,La as N,N as a,Oa as w,Pa as pe,Ra as me,Sa as ue,Ta as ge,Ua as ve,Va as he,W as x,Wa as z,Xa as _e,_a as Ce,aa as S,ab as T,ba as Q,bb as I,db as fe,fa as A,ga as v,gb as L,ha as h,hb as J,ia as F,ib as R,ja as b,jb as we,ka as y,kb as X,la as c,ma as s,na as l,oa as u,pa as ne,qa as re,qb as B,ra as ae,sa as de,sb as xe,ta as le,ua as q,v as V,x as p,xb as Te,y as m,ya as _}from"./chunk-MJD4XKII.js";import"./chunk-V7UGKYBN.js";var Ne=o=>({active:o}),ze=(o,t)=>t.mID;function Le(o,t){if(o&1&&u(0,"img",7),o&2){let e=t.$implicit,i=d();c("src",e.url,k)("alt",i.item().name)}}function Re(o,t){if(o&1&&(u(0,"span",16),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.d)),O)}}function Be(o,t){if(o&1&&(u(0,"span",17),T(1,"cooeeCurrency"),T(2,"safeHtml")),o&2){d(2);let e=z(13);c("innerHTML",I(2,3,I(1,1,e.cmp)),O)}}function He(o,t){if(o&1&&(s(0,"div",10),v(1,Re,3,5,"span",16),v(2,Be,3,5,"span",17),l()),o&2){d();let e=z(13);a(),h(e.d?1:-1),a(),h(e.cmp?2:-1)}}function $e(o,t){if(o&1){let e=_();s(0,"a",20),g("click",function(n){let r=p(e).$implicit,C=d(2);return m(C.changeItem(n,r))}),u(1,"img",21),l()}if(o&2){let e=t.$implicit,i=d(2);c("ngClass",Ce(3,Ne,e.mID===i.item().mID+"")),a(),c("src",e.firstImageURL,k)("alt",i.item().name)}}function je(o,t){if(o&1&&(s(0,"span",18),w(1,"Select product"),l(),s(2,"div",6),b(3,$e,2,5,"a",19,ze),l()),o&2){let e=d();a(3),y(e.similarItems())}}function Ue(o,t){if(o&1&&(s(0,"span",22),w(1,"Select variant"),l(),u(2,"cooee-item-options-picker",23)),o&2){let e=d();a(2),c("item",e.item())}}function We(o,t){if(o&1&&(s(0,"div",24),w(1,"Description"),l(),u(2,"div",25),T(3,"safeHtml")),o&2){let e=d();a(2),c("innerHTML",I(3,1,e.item().desc),O)}}function Qe(o,t){o&1&&w(0," Add To Cart ")}function qe(o,t){o&1&&w(0," Out of stock ")}var j=class o{closeModel=new Q;performCTA=new Q;item=X.required();similarItems=X.required();closeDialog(){this.closeModel.emit()}clickAddToCart(){this.performCTA.emit({item:this.item(),cta:E.ADD_TO_CART})}openCart(){this.performCTA.emit({item:this.item(),cta:E.OPEN_CART})}changeItem(t,e){t.stopPropagation(),t.preventDefault(),this.item.set(e)}goToPDP(){this.performCTA.emit({item:this.item(),cta:E.GO_TO_PRODUCT})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-item-detail"]],hostAttrs:[1,"letscooee-widget"],inputs:{item:[1,"item"],similarItems:[1,"similarItems"]},outputs:{closeModel:"closeModel",performCTA:"performCTA",item:"itemChange",similarItems:"similarItemsChange"},decls:26,vars:8,consts:[[1,"lc-card-wrapper","card-wrapper"],[1,"lc-card-header","card-header"],[1,"lc-header","header"],["type","button","aria-label","Close product details",1,"lc-close-button","close-button",3,"click"],["name","close","aria-hidden","true"],[1,"card-content"],[1,"lc-image-strip","image-strip"],[1,"w-28","h-28","object-contain",3,"src","alt"],[1,"lc-inner-body","inner-body"],[1,"lc-item-name","item-name"],[1,"lc-prices","prices"],[1,"lc-card-footer","card-footer"],["type","button",1,"lc-cta-button","cta-button",3,"click","disabled"],["type","button",1,"lc-more-info-button","more-info-button",3,"click"],["type","button","title","View Cart",1,"view-cart-button",3,"click"],["width","32","height","32","src","https://img.icons8.com/material-sharp/48/shopping-cart.png","alt","shopping-cart"],[1,"lc-item-price","item-price",3,"innerHTML"],[1,"lc-item-cmp-price","item-cmp-price",3,"innerHTML"],[1,"lc-selected-product-title","selected-product-title"],["href","#",1,"product-selector",3,"ngClass"],["href","#",1,"product-selector",3,"click","ngClass"],[3,"src","alt"],[1,"selected-variant-title"],[3,"item"],[1,"lc-description-title","description-title"],[1,"lc-description","description",3,"innerHTML"]],template:function(e,i){if(e&1){let n=_();s(0,"div",0)(1,"div",1)(2,"div",2),w(3,"Shop Now"),l(),s(4,"button",3),g("click",function(){return p(n),m(i.closeDialog())}),u(5,"cooee-icon",4),l()(),s(6,"div",5)(7,"div",6),b(8,Le,1,2,"img",7,F),l(),s(10,"div",8)(11,"div",9),w(12),l(),ve(13),v(14,He,3,2,"div",10),v(15,je,5,0),v(16,Ue,3,1),v(17,We,4,3),l()(),s(18,"div",11)(19,"button",12),g("click",function(){return p(n),m(i.clickAddToCart())}),v(20,Qe,1,0)(21,qe,1,0),l(),s(22,"button",13),g("click",function(){return p(n),m(i.goToPDP())}),w(23," More Info "),l(),s(24,"button",14),g("click",function(){return p(n),m(i.openCart())}),u(25,"img",15),l()()()}if(e&2){let n=i.item().selectedOrFirstVariant.value;a(8),y(i.item().imgs),a(4),pe(i.item().name),a();let r=he(n.price);a(),h(r?14:-1),a(),h(i.similarItems().length>1?15:-1),a(),h(i.item().hasVariants()?16:-1),a(),h(i.item().desc?17:-1),a(2),c("disabled",!n.isAvailable),a(),h(n.isAvailable?20:21)}},dependencies:[B,Ve,$,Te,De],styles:["[_nghost-%COMP%]{display:block;background:#fff}.card-wrapper[_ngcontent-%COMP%]{position:relative;display:flex;flex-direction:column;height:100%;overflow:auto}.card-header[_ngcontent-%COMP%]{display:var(--header-display, flex);flex-direction:row;justify-content:space-between;align-items:center;padding:8px 16px;border-bottom:1px solid var(--lc-color-gray-300)}.header[_ngcontent-%COMP%]{font-size:24px;font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color))}.close-button[_ngcontent-%COMP%]{background:transparent;border:none;width:36px;height:36px}.close-button[_ngcontent-%COMP%] cooee-icon[_ngcontent-%COMP%]{color:#000000b3}.card-content[_ngcontent-%COMP%]{flex:1;overflow-y:auto;overscroll-behavior:contain}.inner-body[_ngcontent-%COMP%]{padding:16px;display:flex;flex-direction:column;gap:8px}.image-strip[_ngcontent-%COMP%]{width:100%;display:flex;overflow-x:auto;gap:8px;flex-wrap:nowrap}.image-strip[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{width:auto;height:200px}.product-selector[_ngcontent-%COMP%]{height:100px;flex-shrink:0;border-radius:var(--lc-media-radius);padding:2px}.product-selector.active[_ngcontent-%COMP%]{border:1px solid rgba(var(--lc-primary-color))}.product-selector[_ngcontent-%COMP%] img[_ngcontent-%COMP%]{max-height:100%;border-radius:var(--lc-media-radius)}.description-title[_ngcontent-%COMP%], .selected-product-title[_ngcontent-%COMP%], .selected-variant-title[_ngcontent-%COMP%]{font-size:var(--lc-subheading-size);font-weight:var(--lc-subheading-weight);color:rgba(var(--lc-subheading-color));margin-top:8px;line-height:normal}.description[_ngcontent-%COMP%]{line-height:normal;color:#000;font-size:var(--lc-description-size);font-weight:var(--lc-description-weight)}.card-footer[_ngcontent-%COMP%]{display:flex;justify-content:center;align-items:center;padding:var(--lc-item-detail-footer-padding);background-color:rgba(var(--lc-item-detail-footer-bg-color));box-shadow:var(--lc-item-detail-footer-box-shadow);gap:12px}.cta-button[_ngcontent-%COMP%], .more-info-button[_ngcontent-%COMP%]{width:50%;padding:12px;display:flex;justify-content:center;align-items:center}.more-info-button[_ngcontent-%COMP%]{background-color:rgba(var(--lc-secondary-button-bg-color));color:rgba(var(--lc-secondary-button-color));font-weight:var(--lc-secondary-button-weight);text-transform:var(--lc-secondary-button-transform);border-radius:var(--lc-button-radius);font-size:var(--lc-button-size);font-family:var(--lc-button-family),serif;height:var(--lc-button-height);letter-spacing:var(--lc-button-letter-spacing);transition:filter .12s ease,background-color .2s ease,color .2s ease;border-width:1px;border-style:solid;border-color:rgba(var(--lc-secondary-button-border-color))}.more-info-button[_ngcontent-%COMP%]:hover{filter:brightness(.95)}.more-info-button[_ngcontent-%COMP%]:active{filter:brightness(.9)}.more-info-button[_ngcontent-%COMP%]:focus-visible{outline:2px solid rgba(var(--lc-primary-color, 0, 0, 0));outline-offset:2px}"]})};var U=class o{video=R.required();progress=D(0);constructor(){L(t=>{let e=this.video(),i=()=>{this.progress.set(e.currentTime/e.duration*100)};e.addEventListener("timeupdate",i),t(()=>{e.removeEventListener("timeupdate",i)})})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-progress-bar"]],inputs:{video:[1,"video"]},decls:3,vars:3,consts:[[1,"video-untracked-path"],["role","progressbar",1,"video-tracked-path"]],template:function(e,i){e&1&&(ne(0,"div",0)(1,"div",1),ae(2,"div"),re()()),e&2&&(a(),N("width",i.progress(),"%"),A("aria-valuenow",i.progress()))},styles:["[_nghost-%COMP%]{display:block;width:100%;position:absolute;z-index:10;top:4px;padding-inline:8px;box-sizing:border-box}.video-untracked-path[_ngcontent-%COMP%], .video-tracked-path[_ngcontent-%COMP%]{height:4px;border-radius:var(--lc-video-progress-bar-radius)}.video-untracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-bg-color));width:100%;margin-bottom:2px}.video-tracked-path[_ngcontent-%COMP%]{background-color:rgba(var(--lc-video-progress-bar-color));transition:width .5s ease-in-out}@media (prefers-reduced-motion: reduce){.video-tracked-path[_ngcontent-%COMP%]{transition:none}}"]})};var Ke=["swiperContainer"],Ge=(o,t)=>t.id;function Ye(o,t){if(o&1){let e=_();s(0,"div",3)(1,"cooee-item-card",4),g("buttonClick",function(n){p(e);let r=d();return m(r.onButtonClick(n))})("click",function(){let n=p(e).$implicit,r=d();return m(r.cardClick.emit(n))}),l()()}if(o&2){let e=t.$implicit;a(),c("item",e)}}var W=class o{items=R.required();cardClick=J();buttonClick=J();destroyRef=V(oe);elementRef=V(M);swiperContainerRef=we.required("swiperContainer");swiperInstance;constructor(){L(()=>{this.initSwiper()}),this.destroyRef.onDestroy(()=>{this.swiperInstance?.destroy()})}ngOnInit(){H(this.elementRef.nativeElement.shadowRoot)}onButtonClick(t){let e=ye.get().website?.canChangeVariantInCart;if(this.items()?.length>1||t.hasVariants()&&!e){this.cardClick.emit(t);return}this.buttonClick.emit(t)}initSwiper(){this.swiperInstance=new window.CooeeSDK.Swiper(this.swiperContainerRef().nativeElement,{direction:"horizontal",effect:"slide",slidesPerView:1.2,nested:!0,centeredSlides:!0,spaceBetween:12,mousewheel:{enabled:!0,thresholdDelta:10,thresholdTime:200}})}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-promoted-items"]],viewQuery:function(e,i){e&1&&se(i.swiperContainerRef,Ke,5),e&2&&ce()},hostAttrs:[1,"letscooee-widget"],inputs:{items:[1,"items"]},outputs:{cardClick:"cardClick",buttonClick:"buttonClick"},decls:5,vars:0,consts:[["swiperContainer",""],[1,"swiper-container"],[1,"swiper-wrapper"],[1,"swiper-slide"],["tabindex","0",3,"buttonClick","click","item"]],template:function(e,i){e&1&&(s(0,"div",1,0)(2,"div",2),b(3,Ye,2,1,"div",3,Ge),l()()),e&2&&(a(3),y(i.items()))},dependencies:[Ae],styles:[`:host{display:block;width:100%}cooee-item-card{-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px);background-color:rgba(var(--lc-card-bg-color));cursor:pointer;border-radius:var(--lc-card-radius)}
2
2
  `],encapsulation:3})};var Je=["swiperComp"],Xe=["videoEl"],Ze=(o,t)=>t.url;function et(o,t){o&1&&(s(0,"div",11),u(1,"div",15),l())}function tt(o,t){if(o&1&&u(0,"source",13),o&2){let e=t.$implicit;c("type",_e(e.mimeType))("src",e.url,k)}}function it(o,t){o&1&&q(0)}function ot(o,t){if(o&1){let e=_();s(0,"cooee-video-promoted-items",22),g("buttonClick",function(n){p(e);let r=d(2).$implicit,C=d();return m(C.itemButtonClicked(n,r))})("cardClick",function(n){p(e);let r=d(2).$implicit,C=d();return m(C.productCardClicked(n,r))}),l()}if(o&2){let e=d(2).$implicit;c("items",e.items)}}function nt(o,t){if(o&1&&u(0,"cooee-video-card",21),o&2){let e=d(2).$implicit;c("card",e.card)}}function rt(o,t){if(o&1){let e=_();u(0,"cooee-video-progress-bar",16),s(1,"div",17)(2,"cooee-mute-toggle",18),ge("mutedChange",function(n){p(e);let r=d(2);return ue(r.muted,n)||(r.muted=n),m(n)}),g("toggled",function(){p(e);let n=d(2);return m(n.muteToggled())}),l(),S(3,it,1,0,"ng-container",8),l(),s(4,"div",19),v(5,ot,1,1,"cooee-video-promoted-items",20)(6,nt,1,1,"cooee-video-card",21),l()}if(o&2){let e=d().$implicit,i=P(5),n=d(),r=P(9);c("video",i),a(2),me("muted",n.muted),c("videoEl",i),a(),c("ngTemplateOutlet",r),a(2),h(e.items.length&&n.footerContent===n.VideoConfigFooterContent.FIRST_ITEM?5:e.card&&n.footerContent===n.VideoConfigFooterContent.CARD?6:-1)}}function at(o,t){if(o&1){let e=_();s(0,"cooee-item-detail",23),g("performCTA",function(n){p(e);let r=d(2);return m(r.performClickToAction(n,r.selectedVideo))})("closeModel",function(){p(e);let n=d(2);return m(n.productModalClosed())}),l()}if(o&2){let e=d(2);c("item",e.selectedItem)("similarItems",e.selectedVideo.items)}}function dt(o,t){if(o&1){let e=_();s(0,"div",6)(1,"div",9)(2,"div",10),v(3,et,2,0,"div",11),s(4,"video",12,2),g("click",function(){let n=p(e).$index,r=d();return m(r.currentIndex===n&&r.toggleMute())})("ended",function(){p(e);let n=P(5),r=d();return m(r.onVideoEnded(n))})("loadstart",function(){let n=p(e).$index,r=d();return m(r.onVideoLoadStart(n))})("canplay",function(){let n=p(e).$index,r=d();return m(r.onVideoCanPlay(n))}),b(6,tt,1,3,"source",13,Ze),l(),v(8,rt,7,5),l(),v(9,at,1,2,"cooee-item-detail",14),l()()}if(o&2){let e=t.$implicit,i=t.$index,n=d();a(2),N("background-image",e.thumbnail?"url("+e.thumbnail+")":null),a(),h(n.shouldShowVideoSpinner(i)?3:-1),a(),c("ngClass",n.viewTemplateClassName),A("preload",n.isVideoVisible(i)?"metadata":"none")("data-video-id",e.id)("autoplay",n.currentIndex===i||null)("muted",n.muted||null),a(2),y(e.sources),a(2),h(n.currentIndex===i?8:-1),a(),h(n.selectedItem&&n.currentIndex===i?9:-1)}}function lt(o,t){o&1&&q(0)}function st(o,t){if(o&1){let e=_();s(0,"button",24),g("click",function(){p(e);let n=d();return m(n.close())}),u(1,"cooee-icon",25),l()}}var Fe=class o{swiperComponent;videoElements;VideoConfigFooterContent=Ie;currentIndex=0;muted=D(!1);selectedItem=null;selectedVideo;detailPopupTemplate;footerContent;viewTemplateClassName="lc-video-only-view";data=V(ke);elementRef=V(M);dialogRef=V(Ee);swiperInitialized=D(!1);swiperOptions=D(null);videos=[];triggerContext;engagementTrigger;isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";cssLoadedPromise;resizeDebouncer=new Pe(this.onResize.bind(this));videoLoadingStates=new Map;constructor(){this.videos=this.data.videos,this.currentIndex=this.data.currentIndex,this.triggerContext=this.data.triggerContext,this.engagementTrigger=this.triggerContext.triggerData,this.cssLoadedPromise=H(this.elementRef.nativeElement.shadowRoot)}async ngOnInit(){this.muted.set(await Z.get("muted",!1));let t=this.engagementTrigger?.content?.videoConfig;switch(this.detailPopupTemplate=t?.detailPopup.template??"VIDEO_ONLY_VIEW",this.footerContent=t?.footerContent??"FIRST_ITEM",this.detailPopupTemplate){case"PRODUCT_DETAIL_VIEW":this.selectItemForDetailView(),this.viewTemplateClassName="lc-product-detail-view";break;case"VIDEO_ONLY_VIEW":this.viewTemplateClassName="lc-video-only-view";break}}ngAfterViewInit(){this.initializeSwiperWithVideoDimensions()}ngOnDestroy(){this.resizeDebouncer?.destroy()}initializeSwiperWithVideoDimensions(){this.applyOptimalVideoDimensions(),this.initSwiperOptions()}close(t=this.videos[this.currentIndex],e=this.currentIndex){let i=this.getCurrentVideoElement();this.dialogRef.close({lastVideo:t,lastVideoIndex:e,lastVideoDuration:i?.currentTime})}itemButtonClicked(t,e){this.performClickToAction({cta:E.ADD_TO_CART,item:t},e)}performClickToAction(t,e){this.data.onCTAPerformed({cta:t.cta,item:t.item,video:e})}getCurrentVideoElement(){return this.videoElements.get(this.currentIndex)?.nativeElement}moveToNextVideo(){this.swiperComponent.swiper.slideTo(this.currentIndex+1)}productModalClosed(){this.selectedItem=null,this.selectedVideo=void 0}pauseAll(){this.videoElements.forEach(t=>t.nativeElement.pause())}toggleMute(){this.muted.update(t=>!t)}async muteToggled(){await Z.set("muted",this.muted());let e=[this.muted()?"CE Video Muted":"CE Video Unmuted",{current:this.currentVideoProps()},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(e)}playActiveVideo(){this.pauseAll();let t=this.getCurrentVideoElement();t&&this.playVideo(t)}playVideo(t){t.currentTime=0,t.play().catch(e=>be.error(e))}onVideoEnded(t){if(this.currentIndex<this.videos.length-1)this.selectedItem?this.playVideo(t):this.moveToNextVideo();else{let e=this.getPreviousVideoDataForEvent(),i=["CE Last Video Ended",{previous:e},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(i),this.playVideo(t)}}onSlideChange(t){let e=this.getPreviousVideoDataForEvent();this.currentIndex=t.realIndex,this.playActiveVideo(),this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"?this.selectItemForDetailView():(this.selectedItem=null,delete this.selectedVideo);let i=this.currentVideoProps(),n={previous:e,current:i},r=["CE Video Changed",n,{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(r)}productCardClicked(t,e){let i={videoID:e.id,videoIndex:this.currentIndex},n=["CE More Item Info Clicked",{current:i},{triggerData:this.engagementTrigger}];window.CooeeSDK.events.push(n),this.selectedItem=t,this.selectedVideo=e}onVideoLoadStart(t){this.videoLoadingStates.set(t,!0)}onVideoCanPlay(t){this.videoLoadingStates.set(t,!1)}shouldShowVideoSpinner(t){return this.swiperInitialized()?this.videoLoadingStates.get(t)===!0&&this.isVideoVisible(t):this.isVideoVisible(t)}isVideoVisible(t){let e=this.currentIndex-1,i=this.currentIndex+1;return t===this.currentIndex||t===e||t===i}async initSwiperOptions(){await this.cssLoadedPromise;let t=this.isMobile?1:"auto",e=0;this.isProductDetailView()&&(t="auto",e=10),this.swiperOptions.set({direction:this.isMobile?"vertical":"horizontal",effect:this.isMobile?"slide":"coverflow",slidesPerView:t,initialSlide:this.currentIndex,centeredSlides:!0,spaceBetween:e,coverflowEffect:{rotate:0,stretch:0,depth:400,modifier:1,slideShadows:!1},on:{init:i=>{this.swiperInitialized.set(!0),setTimeout(()=>{i.update()},100)}},mousewheel:{enabled:!this.isMobile,invert:!1,thresholdDelta:20}})}isProductDetailView(){return this.detailPopupTemplate==="PRODUCT_DETAIL_VIEW"}currentVideoProps(){return{videoID:this.videos[this.currentIndex].id,videoIndex:this.currentIndex}}getPreviousVideoDataForEvent(){let t=this.currentVideoProps(),e=this.videoElements.find(n=>n.nativeElement.dataset.videoId===this.videos[this.currentIndex].id)?.nativeElement;t.playedTillMS=Math.ceil(e?.currentTime*1e3);let i=e?.duration*1e3;return t.playedTillPercent=+(t.playedTillMS/i).toFixed(4),t}selectItemForDetailView(){this.selectedVideo=this.videos[this.currentIndex],this.selectedItem=this.isMobile?null:this.selectedVideo?.items?.[0]??null}applyOptimalVideoDimensions(){if(this.isMobile||this.isProductDetailView())return;let t=this.calculateOptimalVideoDimensions();t&&this.setVideoContainerDimensions(t.width,t.height)}calculateOptimalVideoDimensions(){let t=this.videos.map(f=>f.sources?.[0]).filter(f=>f?.width&&f?.height).map(f=>({width:f.width,height:f.height,aspectRatio:f.width/f.height}));if(t.length===0)return null;let e=t[0],i=window.innerWidth*.9,n=window.innerHeight*.9,r=i/e.width,C=n/e.height,ie=Math.min(r,C);return{width:Math.floor(e.width*ie),height:Math.floor(e.height*ie)}}setVideoContainerDimensions(t,e){let i=this.elementRef.nativeElement;i.style.setProperty("--video-container-width",`${t}px`),i.style.setProperty("--video-container-height",`${e}px`)}onResize(){this.applyOptimalVideoDimensions()}static \u0275fac=function(e){return new(e||o)};static \u0275cmp=x({type:o,selectors:[["cooee-video-detail-dialog"]],viewQuery:function(e,i){if(e&1&&(K(Je,7),K(Xe,5)),e&2){let n;G(n=Y())&&(i.swiperComponent=n.first),G(n=Y())&&(i.videoElements=n)}},hostAttrs:[1,"letscooee-widget"],decls:10,vars:3,consts:[["swiperComp",""],["closeButtonTemplate",""],["videoEl",""],[1,"lc-shadow-inner",3,"ngClass"],[1,"video-swiper",3,"slideChange","options"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-slide"],[1,"lc-desktop-controls"],[4,"ngTemplateOutlet"],[1,"lc-video-modal-row"],[1,"lc-video-container"],[1,"video-loading-overlay"],["playsinline","",1,"lc-video-el",3,"click","ended","loadstart","canplay","ngClass"],[3,"src","type"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"item","similarItems"],[1,"loading-spinner"],[3,"video"],[1,"lc-video-controls"],[3,"mutedChange","toggled","muted","videoEl"],[1,"lc-card-container"],[3,"items"],[3,"card"],[3,"buttonClick","cardClick","items"],[1,"swiper-no-swiping","swiper-no-mousewheel",3,"performCTA","closeModel","item","similarItems"],["type","button","aria-label","Close",1,"lc-close-button",3,"click"],["name","close","aria-hidden","true"]],template:function(e,i){if(e&1){let n=_();s(0,"div",3)(1,"cooee-swiper",4,0),g("slideChange",function(C){return p(n),m(i.onSlideChange(C))}),de(3,5),b(4,dt,10,10,"div",6,F),le(),l(),s(6,"div",7),S(7,lt,1,0,"ng-container",8),l()(),S(8,st,2,0,"ng-template",null,1,fe)}if(e&2){let n=P(9);c("ngClass",i.viewTemplateClassName),a(),c("options",i.swiperOptions()),a(3),y(i.videos),a(3),c("ngTemplateOutlet",n)}},dependencies:[W,j,Se,U,xe,B,Oe,Me,$],styles:[`:host{display:flex}.lc-shadow-inner{position:relative;width:100vw;height:100vh;display:flex}@media (min-width: 768px){.lc-shadow-inner{background-color:color-mix(in oklab,#000 70%,transparent);justify-content:center;align-items:center}}.video-swiper{--swiper-navigation-size: 50px;--swiper-navigation-color: white;width:100dvw;height:100dvh}.lc-product-detail-view .video-swiper{align-items:center}@media (min-width: 768px){.video-swiper{width:100%;height:100%;max-width:90vw;max-height:90vh}}.video-swiper>.swiper-wrapper{max-height:100%}.lc-product-detail-view .video-swiper>.swiper-wrapper{align-items:center}@media (max-width: 768px){.video-swiper>.swiper-button-prev,.video-swiper>.swiper-button-next{display:none!important}}.video-slide{position:relative;display:flex;align-items:center;visibility:hidden}.lc-product-detail-view .video-slide{width:40vw!important;height:70vh!important}@media (min-width: 768px){.lc-product-detail-view .video-slide{min-width:650px!important}}@media (max-width: 768px){.lc-product-detail-view .video-slide{width:100%!important;height:100%!important}}@media (min-width: 768px){.lc-video-only-view .video-slide{width:fit-content!important}}@media (min-width: 768px){.video-slide{border-radius:var(--lc-media-radius);overflow:hidden}}.video-slide.swiper-slide-active,.video-slide.swiper-slide-prev,.video-slide.swiper-slide-next{visibility:visible}video{width:100%;height:100%;object-fit:cover;position:relative;z-index:3}.lc-desktop-controls{position:absolute;top:2rem;right:4rem;z-index:10;display:flex;gap:.5rem}@media (max-width: 768px){.lc-desktop-controls{display:none}}.lc-video-controls{position:absolute;top:1rem;z-index:10;right:.5rem;display:flex;gap:.25rem}@media (min-width: 768px){.lc-video-controls .lc-close-button{display:none}}.lc-close-button{width:var(--lc-icon-button-size, 44px);height:var(--lc-icon-button-size, 44px);display:flex;justify-content:center;align-items:center;border:none;border-radius:100%;background:#00000080;background:color-mix(in oklab,#000 50%,transparent)}.lc-video-container{position:relative;height:100%;width:100%;background:#000000b3 no-repeat center;background-size:cover}@media (min-width: 768px){.lc-product-detail-view .lc-video-container{width:50%}}@media (min-width: 768px){.lc-video-only-view .lc-video-container{width:var(--video-container-width, 100%);height:var(--video-container-height, 100%)}}.lc-card-container{position:absolute;bottom:12px;z-index:10;width:100%;padding-inline:12px;box-sizing:border-box}.lc-product-detail-view .lc-card-container{display:none}@media (max-width: 768px){.lc-product-detail-view .lc-card-container{display:block}}.lc-product-detail-view .lc-video-modal-row{display:flex;justify-content:center;height:100%;width:100%}.lc-video-only-view .lc-video-modal-row{display:block;height:100%}.lc-product-detail-view cooee-item-detail{--header-display: none;width:50%;flex:1}@media (max-width: 768px){.lc-product-detail-view cooee-item-detail{--header-display: flex;width:100%;height:70dvh;position:absolute;bottom:0;z-index:2147483646}}.lc-video-only-view cooee-item-detail{width:100%;height:70dvh;z-index:2147483646;bottom:0;position:absolute;border-radius:var(--lc-card-radius) var(--lc-card-radius) 0 0}@keyframes spin{0%{transform:rotate(0)}to{transform:rotate(360deg)}}.video-loading-overlay{position:absolute;top:0;left:0;width:100%;height:100%;display:flex;align-items:center;justify-content:center;background-color:#0000004d;z-index:2}.video-loading-overlay .loading-spinner{width:30px;height:30px;border:3px solid rgba(255,255,255,.3);border-top:3px solid #fff;border-radius:50%;animation:spin 1s linear infinite}
3
3
  `],encapsulation:3})};export{Fe as VideoDetailDialogComponent};
@@ -1,20 +1,20 @@
1
- import{a as vt,b as qr,c as Zr,d as Gr,f as Qt,g as Xr,h as Kr,i as ne,j as De,l as Qr,m as tn,n as he,o as en,p as rn,q as nr,t as nn,v as on,w as sn,x as an,y as cn,z as ln}from"./chunk-VXRG4MHP.js";import{a as Re}from"./chunk-KCKQTWWG.js";import{$ as Rr,$a as zr,A as Or,Aa as Nt,B as er,Ba as jr,Ca as q,D as Nr,E as Wt,F as Tr,Fa as Te,Ga as Be,Ha as Ae,K as At,Ka as Ut,L as Xt,La as be,M as Br,N as Y,Na as $r,O as Ar,Oa as Dt,P as Mr,Pa as kr,Qa as ue,R as rr,Ua as xe,Va as re,W as mt,Wa as Jt,Xa as pe,Z as Dr,_ as gt,_a as Hr,ab as jt,b as Oe,bb as qt,ca as Fr,cb as Wr,e as tr,ea as Vr,eb as Yr,fa as Ne,ga as lt,ha as ft,ia as Lr,ja as Ct,k as Er,ka as It,la as yt,ma as rt,na as nt,oa as Kt,p as Sr,pa as Mt,q as Cr,qa as Pt,qb as Me,ra as Ot,sa as Pr,ta as Ur,v as fe,vb as Jr,x as at,xb as de,y as ct,ya as Yt,z as Ir,za as _t}from"./chunk-MJD4XKII.js";import{a as Lt,b as Qe,e as Yn,f as Jn}from"./chunk-V7UGKYBN.js";var hn=Yn((Fe,pn)=>{"use strict";(function(e,t){typeof Fe=="object"&&typeof pn<"u"?t(Fe):typeof define=="function"&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Sqrl={})})(Fe,function(e){"use strict";function t(g){var m,b,w=new Error(g);return m=w,b=t.prototype,Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b,w}function r(g,m,b){var w=m.slice(0,b).split(/\n/),u=w.length,p=w[u-1].length+1;throw t(g+=" at line "+u+" col "+p+`:
1
+ import{a as wt,b as qr,c as Zr,d as Gr,f as Qt,g as Xr,h as Kr,i as ne,j as De,l as Qr,m as tn,n as he,o as en,p as rn,q as nr,t as nn,v as on,w as sn,x as an,y as cn,z as ln}from"./chunk-HVQGML7G.js";import{a as Re}from"./chunk-KCKQTWWG.js";import{$ as Rr,$a as zr,A as Or,Aa as Nt,B as er,Ba as jr,Ca as q,D as Nr,E as Wt,F as Tr,Fa as Te,Ga as Be,Ha as Ae,K as At,Ka as Ut,L as Xt,La as be,M as Br,N as Y,Na as $r,O as Ar,Oa as Dt,P as Mr,Pa as kr,Qa as ue,R as rr,Ua as xe,Va as re,W as mt,Wa as Jt,Xa as pe,Z as Dr,_ as gt,_a as Hr,ab as jt,b as Oe,bb as qt,ca as Fr,cb as Wr,e as tr,ea as Vr,eb as Yr,fa as Ne,ga as lt,ha as ft,ia as Lr,ja as Ct,k as Er,ka as It,la as yt,ma as rt,na as nt,oa as Kt,p as Sr,pa as Mt,q as Cr,qa as Pt,qb as Me,ra as Ot,sa as Pr,ta as Ur,v as fe,vb as Jr,x as at,xb as de,y as ct,ya as Yt,z as Ir,za as vt}from"./chunk-MJD4XKII.js";import{a as Lt,b as Qe,e as Yn,f as Jn}from"./chunk-V7UGKYBN.js";var hn=Yn((Fe,pn)=>{"use strict";(function(e,t){typeof Fe=="object"&&typeof pn<"u"?t(Fe):typeof define=="function"&&define.amd?define(["exports"],t):t((e=typeof globalThis<"u"?globalThis:e||self).Sqrl={})})(Fe,function(e){"use strict";function t(g){var m,b,w=new Error(g);return m=w,b=t.prototype,Object.setPrototypeOf?Object.setPrototypeOf(m,b):m.__proto__=b,w}function r(g,m,b){var w=m.slice(0,b).split(/\n/),u=w.length,p=w[u-1].length+1;throw t(g+=" at line "+u+" col "+p+`:
2
2
 
3
3
  `+m.split(/\n/)[u-1]+`
4
4
  `+Array(p).join(" ")+"^")}t.prototype=Object.create(Error.prototype,{name:{value:"Squirrelly Error",enumerable:!1}});var o=new Function("return this")().Promise,f=!1;try{f=new Function("return (async function(){}).constructor")()}catch(g){if(!(g instanceof SyntaxError))throw g}function l(g,m){return Object.prototype.hasOwnProperty.call(g,m)}function a(g,m,b){for(var w in m)l(m,w)&&(m[w]==null||typeof m[w]!="object"||w!=="storage"&&w!=="prefixes"||b?g[w]=m[w]:g[w]=a({},m[w]));return g}var d=/^async +/,v=/`(?:\\[\s\S]|\${(?:[^{}]|{(?:[^{}]|{[^}]*})*})*}|(?!\${)[^\\`])*`/g,x=/'(?:\\[\s\w"'\\`]|[^\n\r'\\])*?'/g,C=/"(?:\\[\s\w"'\\`]|[^\n\r"\\])*?"/g,S=/[.*+\-?^${}()|[\]\\]/g;function I(g){return S.test(g)?g.replace(S,"\\$&"):g}function z(g,m){m.rmWhitespace&&(g=g.replace(/[\r\n]+/g,`
5
5
  `).replace(/^\s+|\s+$/gm,"")),v.lastIndex=0,x.lastIndex=0,C.lastIndex=0;var b=m.prefixes,w=[b.h,b.b,b.i,b.r,b.c,b.e].reduce(function(R,B){return R&&B?R+"|"+I(B):B?I(B):R},""),u=new RegExp("([|()]|=>)|('|\"|`|\\/\\*)|\\s*((\\/)?(-|_)?"+I(m.tags[1])+")","g"),p=new RegExp("([^]*?)"+I(m.tags[0])+"(-|_)?\\s*("+w+")?\\s*","g"),E=0,O=!1;function A(R,B){var P,F={f:[]},U=0,j="c";function $(H){var Z=g.slice(E,H),W=Z.trim();if(j==="f")W==="safe"?F.raw=!0:m.async&&d.test(W)?(W=W.replace(d,""),F.f.push([W,"",!0])):F.f.push([W,""]);else if(j==="fp")F.f[F.f.length-1][1]+=W;else if(j==="err"){if(W){var Q=Z.search(/\S/);r("invalid syntax",g,E+Q)}}else F[j]=W;E=H+1}for(B==="h"||B==="b"||B==="c"?j="n":B==="r"&&(F.raw=!0,B="i"),u.lastIndex=E;(P=u.exec(g))!==null;){var s=P[1],n=P[2],i=P[3],c=P[4],h=P[5],y=P.index;if(s)s==="("?(U===0&&(j==="n"?($(y),j="p"):j==="f"&&($(y),j="fp")),U++):s===")"?--U===0&&j!=="c"&&($(y),j="err"):U===0&&s==="|"?($(y),j="f"):s==="=>"&&($(y),E+=1,j="res");else if(n)if(n==="/*"){var _=g.indexOf("*/",u.lastIndex);_===-1&&r("unclosed comment",g,P.index),u.lastIndex=_+2}else n==="'"?(x.lastIndex=P.index,x.exec(g)?u.lastIndex=x.lastIndex:r("unclosed string",g,P.index)):n==='"'?(C.lastIndex=P.index,C.exec(g)?u.lastIndex=C.lastIndex:r("unclosed string",g,P.index)):n==="`"&&(v.lastIndex=P.index,v.exec(g)?u.lastIndex=v.lastIndex:r("unclosed string",g,P.index));else if(i)return $(y),E=y+P[0].length,p.lastIndex=E,O=h,c&&B==="h"&&(B="s"),F.t=B,F}return r("unclosed tag",g,R),F}var M=(function R(B,P){B.b=[],B.d=[];var F,U=!1,j=[];function $(Q,tt){Q&&(Q=(function(st,Ft,zt,le){var St,Vt;return typeof Ft.autoTrim=="string"?St=Vt=Ft.autoTrim:Array.isArray(Ft.autoTrim)&&(St=Ft.autoTrim[1],Vt=Ft.autoTrim[0]),(zt||zt===!1)&&(St=zt),(le||le===!1)&&(Vt=le),St==="slurp"&&Vt==="slurp"?st.trim():(St==="_"||St==="slurp"?st=String.prototype.trimLeft?st.trimLeft():st.replace(/^[\s\uFEFF\xA0]+/,""):St!=="-"&&St!=="nl"||(st=st.replace(/^(?:\n|\r|\r\n)/,"")),Vt==="_"||Vt==="slurp"?st=String.prototype.trimRight?st.trimRight():st.replace(/[\s\uFEFF\xA0]+$/,""):Vt!=="-"&&Vt!=="nl"||(st=st.replace(/(?:\n|\r|\r\n)$/,"")),st)})(Q,m,O,tt))&&(Q=Q.replace(/\\|'/g,"\\$&").replace(/\r\n|\n|\r/g,"\\n"),j.push(Q))}for(;(F=p.exec(g))!==null;){var s,n=F[1],i=F[2],c=F[3]||"";for(var h in b)if(b[h]===c){s=h;break}$(n,i),E=F.index+F[0].length,s||r("unrecognized tag type: "+c,g,E);var y=A(F.index,s),_=y.t;if(_==="h"){var H=y.n||"";m.async&&d.test(H)&&(y.a=!0,y.n=H.replace(d,"")),y=R(y),j.push(y)}else if(_==="c"){if(B.n===y.n)return U?(U.d=j,B.b.push(U)):B.d=j,B;r("Helper start and end don't match",g,F.index+F[0].length)}else if(_==="b"){U?(U.d=j,B.b.push(U)):B.d=j;var Z=y.n||"";m.async&&d.test(Z)&&(y.a=!0,y.n=Z.replace(d,"")),U=y,j=[]}else if(_==="s"){var W=y.n||"";m.async&&d.test(W)&&(y.a=!0,y.n=W.replace(d,"")),j.push(y)}else j.push(y)}if(!P)throw t('unclosed helper "'+B.n+'"');return $(g.slice(E,g.length),!1),B.d=j,B})({f:[]},!0);if(m.plugins)for(var V=0;V<m.plugins.length;V++){var N=m.plugins[V];N.processAST&&(M.d=N.processAST(M.d,m))}return M.d}function L(g,m){var b=z(g,m),w="var tR='';"+(m.useWith?"with("+m.varName+"||{}){":"")+K(b,m)+"if(cb){cb(null,tR)} return tR"+(m.useWith?"}":"");if(m.plugins)for(var u=0;u<m.plugins.length;u++){var p=m.plugins[u];p.processFnString&&(w=p.processFnString(w,m))}return w}function J(g,m){for(var b=0;b<m.length;b++){var w=m[b][0],u=m[b][1];g=(m[b][2]?"await ":"")+"c.l('F','"+w+"')("+g,u&&(g+=","+u),g+=")"}return g}function k(g,m,b,w,u,p){var E="{exec:"+(u?"async ":"")+X(b,m,g)+",params:["+w+"]";return p&&(E+=",name:'"+p+"'"),u&&(E+=",async:true"),E+="}"}function et(g,m){for(var b="[",w=0;w<g.length;w++){var u=g[w];b+=k(m,u.res||"",u.d,u.p||"",u.a,u.n),w<g.length&&(b+=",")}return b+="]"}function X(g,m,b){return"function("+m+"){var tR='';"+K(g,b)+"return tR}"}function K(g,m){for(var b=0,w=g.length,u="";b<w;b++){var p=g[b];if(typeof p=="string")u+="tR+='"+p+"';";else{var E=p.t,O=p.c||"",A=p.f,M=p.n||"",V=p.p||"",N=p.res||"",R=p.b,B=!!p.a;if(E==="i"){m.defaultFilter&&(O="c.l('F','"+m.defaultFilter+"')("+O+")");var P=J(O,A);!p.raw&&m.autoEscape&&(P="c.l('F','e')("+P+")"),u+="tR+="+P+";"}else if(E==="h")if(m.storage.nativeHelpers.get(M))u+=m.storage.nativeHelpers.get(M)(p,m);else{var F=(B?"await ":"")+"c.l('H','"+M+"')("+k(m,N,p.d,V,B);F+=R?","+et(R,m):",[]",u+="tR+="+J(F+=",c)",A)+";"}else E==="s"?u+="tR+="+J((B?"await ":"")+"c.l('H','"+M+"')({params:["+V+"]},[],c)",A)+";":E==="e"&&(u+=O+`
6
- `)}}return u}var T=(function(){function g(m){this.cache=m}return g.prototype.define=function(m,b){this.cache[m]=b},g.prototype.get=function(m){return this.cache[m]},g.prototype.remove=function(m){delete this.cache[m]},g.prototype.reset=function(){this.cache={}},g.prototype.load=function(m){a(this.cache,m,!0)},g})();function it(g,m,b,w){if(m&&m.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept blocks");if(b&&b.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept filters")}var ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function bt(g){return ht[g]}var Zt=new T({}),Rt=new T({each:function(g,m){var b="",w=g.params[0];if(it("each",m,!1),g.async)return new Promise(function(p){(function E(O,A,M,V,N){M(O[A],A).then(function(R){V+=R,A===O.length-1?N(V):E(O,A+1,M,V,N)})})(w,0,g.exec,b,p)});for(var u=0;u<w.length;u++)b+=g.exec(w[u],u);return b},foreach:function(g,m){var b=g.params[0];if(it("foreach",m,!1),g.async)return new Promise(function(p){(function E(O,A,M,V,N,R){V(A[M],O[A[M]]).then(function(B){N+=B,M===A.length-1?R(N):E(O,A,M+1,V,N,R)})})(b,Object.keys(b),0,g.exec,"",p)});var w="";for(var u in b)l(b,u)&&(w+=g.exec(u,b[u]));return w},include:function(g,m,b){it("include",m,!1);var w=b.storage.templates.get(g.params[0]);if(!w)throw t('Could not fetch template "'+g.params[0]+'"');return w(g.params[1],b)},extends:function(g,m,b){var w=g.params[1]||{};w.content=g.exec();for(var u=0;u<m.length;u++){var p=m[u];w[p.name]=p.exec()}var E=b.storage.templates.get(g.params[0]);if(!E)throw t('Could not fetch template "'+g.params[0]+'"');return E(w,b)},useScope:function(g,m){return it("useScope",m,!1),g.exec(g.params[0])}}),Gt=new T({if:function(g,m){it("if",!1,g.f,!0);var b="if("+g.p+"){"+K(g.d,m)+"}";if(g.b)for(var w=0;w<g.b.length;w++){var u=g.b[w];u.n==="else"?b+="else{"+K(u.d,m)+"}":u.n==="elif"&&(b+="else if("+u.p+"){"+K(u.d,m)+"}")}return b},try:function(g,m){if(it("try",!1,g.f,!0),!g.b||g.b.length!==1||g.b[0].n!=="catch")throw t("native helper 'try' only accepts 1 block, 'catch'");var b="try{"+K(g.d,m)+"}",w=g.b[0];return b+="catch"+(w.res?"("+w.res+")":"")+"{"+K(w.d,m)+"}"},block:function(g,m){return it("block",g.b,g.f,!0),"if(!"+m.varName+"["+g.p+"]){tR+=("+X(g.d,"",m)+")()}else{tR+="+m.varName+"["+g.p+"]}"}}),Ht=new T({e:function(g){var m=String(g);return/[&<>"']/.test(m)?m.replace(/[&<>"']/g,bt):m}}),wt={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(g,m){if(g==="H"){var b=this.storage.helpers.get(m);if(b)return b;throw t("Can't find helper '"+m+"'")}if(g==="F"){var w=this.storage.filters.get(m);if(w)return w;throw t("Can't find filter '"+m+"'")}},async:!1,storage:{helpers:Rt,nativeHelpers:Gt,filters:Ht,templates:Zt},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function xt(g,m){var b={};return a(b,wt),m&&a(b,m),g&&a(b,g),b.l.bind(b),b}function dt(g,m){var b,w=xt(m||{}),u=Function;if(w.async){if(!f)throw t("This environment doesn't support async/await");u=f}if(w.varName&&(b=w.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(b)===!1))throw t("options.varName must be a valid JS identifier");try{return new u(w.varName,"c","cb",L(g,w))}catch(p){throw p instanceof SyntaxError?t(`Bad template syntax
6
+ `)}}return u}var T=(function(){function g(m){this.cache=m}return g.prototype.define=function(m,b){this.cache[m]=b},g.prototype.get=function(m){return this.cache[m]},g.prototype.remove=function(m){delete this.cache[m]},g.prototype.reset=function(){this.cache={}},g.prototype.load=function(m){a(this.cache,m,!0)},g})();function it(g,m,b,w){if(m&&m.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept blocks");if(b&&b.length>0)throw t((w?"Native":"")+"Helper '"+g+"' doesn't accept filters")}var ht={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"};function bt(g){return ht[g]}var Zt=new T({}),Rt=new T({each:function(g,m){var b="",w=g.params[0];if(it("each",m,!1),g.async)return new Promise(function(p){(function E(O,A,M,V,N){M(O[A],A).then(function(R){V+=R,A===O.length-1?N(V):E(O,A+1,M,V,N)})})(w,0,g.exec,b,p)});for(var u=0;u<w.length;u++)b+=g.exec(w[u],u);return b},foreach:function(g,m){var b=g.params[0];if(it("foreach",m,!1),g.async)return new Promise(function(p){(function E(O,A,M,V,N,R){V(A[M],O[A[M]]).then(function(B){N+=B,M===A.length-1?R(N):E(O,A,M+1,V,N,R)})})(b,Object.keys(b),0,g.exec,"",p)});var w="";for(var u in b)l(b,u)&&(w+=g.exec(u,b[u]));return w},include:function(g,m,b){it("include",m,!1);var w=b.storage.templates.get(g.params[0]);if(!w)throw t('Could not fetch template "'+g.params[0]+'"');return w(g.params[1],b)},extends:function(g,m,b){var w=g.params[1]||{};w.content=g.exec();for(var u=0;u<m.length;u++){var p=m[u];w[p.name]=p.exec()}var E=b.storage.templates.get(g.params[0]);if(!E)throw t('Could not fetch template "'+g.params[0]+'"');return E(w,b)},useScope:function(g,m){return it("useScope",m,!1),g.exec(g.params[0])}}),Gt=new T({if:function(g,m){it("if",!1,g.f,!0);var b="if("+g.p+"){"+K(g.d,m)+"}";if(g.b)for(var w=0;w<g.b.length;w++){var u=g.b[w];u.n==="else"?b+="else{"+K(u.d,m)+"}":u.n==="elif"&&(b+="else if("+u.p+"){"+K(u.d,m)+"}")}return b},try:function(g,m){if(it("try",!1,g.f,!0),!g.b||g.b.length!==1||g.b[0].n!=="catch")throw t("native helper 'try' only accepts 1 block, 'catch'");var b="try{"+K(g.d,m)+"}",w=g.b[0];return b+="catch"+(w.res?"("+w.res+")":"")+"{"+K(w.d,m)+"}"},block:function(g,m){return it("block",g.b,g.f,!0),"if(!"+m.varName+"["+g.p+"]){tR+=("+X(g.d,"",m)+")()}else{tR+="+m.varName+"["+g.p+"]}"}}),Ht=new T({e:function(g){var m=String(g);return/[&<>"']/.test(m)?m.replace(/[&<>"']/g,bt):m}}),_t={varName:"it",autoTrim:[!1,"nl"],autoEscape:!0,defaultFilter:!1,tags:["{{","}}"],l:function(g,m){if(g==="H"){var b=this.storage.helpers.get(m);if(b)return b;throw t("Can't find helper '"+m+"'")}if(g==="F"){var w=this.storage.filters.get(m);if(w)return w;throw t("Can't find filter '"+m+"'")}},async:!1,storage:{helpers:Rt,nativeHelpers:Gt,filters:Ht,templates:Zt},prefixes:{h:"@",b:"#",i:"",r:"*",c:"/",e:"!"},cache:!1,plugins:[],useWith:!1};function xt(g,m){var b={};return a(b,_t),m&&a(b,m),g&&a(b,g),b.l.bind(b),b}function dt(g,m){var b,w=xt(m||{}),u=Function;if(w.async){if(!f)throw t("This environment doesn't support async/await");u=f}if(w.varName&&(b=w.varName,/^[a-zA-Z_$][a-zA-Z0-9_$]*$/.test(b)===!1))throw t("options.varName must be a valid JS identifier");try{return new u(w.varName,"c","cb",L(g,w))}catch(p){throw p instanceof SyntaxError?t(`Bad template syntax
7
7
 
8
8
  `+p.message+`
9
9
  `+Array(p.message.length+1).join("=")+`
10
- `+L(g,w)):p}}function Et(g,m){var b;return m.cache&&m.name&&m.storage.templates.get(m.name)?m.storage.templates.get(m.name):(b=typeof g=="function"?g:dt(g,m),m.cache&&m.name&&m.storage.templates.define(m.name,b),b)}wt.l.bind(wt),e.compile=dt,e.compileScope=K,e.compileScopeIntoFunction=X,e.compileToString=L,e.defaultConfig=wt,e.filters=Ht,e.getConfig=xt,e.helpers=Rt,e.nativeHelpers=Gt,e.parse=z,e.render=function(g,m,b,w){var u=xt(b||{});if(!u.async)return Et(g,u)(m,u);if(!w){if(typeof o=="function")return new o(function(p,E){try{p(Et(g,u)(m,u))}catch(O){E(O)}});throw t("Please provide a callback function, this env doesn't support Promises")}try{Et(g,u)(m,u,w)}catch(p){return w(p)}},e.templates=Zt,Object.defineProperty(e,"__esModule",{value:!0})})});var qn={schedule(e,t){let r=setTimeout(e,t);return()=>clearTimeout(r)}};function Zn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Gn(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}var ir;function Xn(e,t){if(!ir){let r=Element.prototype;ir=r.matches||r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE?ir.call(e,t):!1}function Kn(e){let t={};return e.forEach(({propName:r,templateName:o,transform:f})=>{t[Zn(o)]=[r,f]}),t}function Qn(e,t){return t.get(rr).resolveComponentFactory(e).inputs}function ti(e,t){let r=e.childNodes,o=t.map(()=>[]),f=-1;t.some((l,a)=>l==="*"?(f=a,!0):!1);for(let l=0,a=r.length;l<a;++l){let d=r[l],v=ei(d,t,f);v!==-1&&o[v].push(d)}return o}function ei(e,t,r){let o=r;return Gn(e)&&t.some((f,l)=>f!=="*"&&Xn(e,f)?(o=l,!0):!1),o}var ri=10,or=class{componentFactory;inputMap=new Map;constructor(t,r){this.componentFactory=r.get(rr).resolveComponentFactory(t);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(t){return new sr(this.componentFactory,t,this.inputMap)}},sr=class{componentFactory;injector;inputMap;eventEmitters=new tr(1);events=this.eventEmitters.pipe(Sr(t=>Er(...t)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(t,r,o){this.componentFactory=t,this.injector=r,this.inputMap=o,this.ngZone=this.injector.get(Fr),this.appRef=this.injector.get(Vr),this.cdScheduler=r.get(Tr),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=qn.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},ri))})}getInputValue(t){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,r){if(this.componentRef===null){this.initialInputValues.set(t,r);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(t)??t,r),Ar(this.componentRef.hostView)&&(Mr(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(t){let r=er.create({providers:[],parent:this.injector}),o=ti(t,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(r,o,t),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[t,r]of this.initialInputValues)this.setInputValue(t,r);this.initialInputValues.clear()}initializeOutputs(t){let r=this.componentFactory.outputs.map(({propName:o,templateName:f})=>{let l=t.instance[o];return new Oe(a=>{let d=l.subscribe(v=>a.next({name:f,value:v}));return()=>d.unsubscribe()})});this.eventEmitters.next(r)}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}},ar=class extends HTMLElement{ngElementEventsSubscription=null};function fn(e,t){let r=Qn(e,t.injector),o=t.strategyFactory||new or(e,t.injector),f=Kn(r);class l extends ar{injector;static observedAttributes=Object.keys(f);get ngElementStrategy(){if(!this._ngElementStrategy){let d=this._ngElementStrategy=o.create(this.injector||t.injector);r.forEach(({propName:v,transform:x})=>{if(!this.hasOwnProperty(v))return;let C=this[v];delete this[v],d.setInputValue(v,C,x)})}return this._ngElementStrategy}_ngElementStrategy;constructor(d){super(),this.injector=d}attributeChangedCallback(d,v,x,C){let[S,I]=f[d];this.ngElementStrategy.setInputValue(S,x,I)}connectedCallback(){let d=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),d=!0),this.ngElementStrategy.connect(this),d||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(d=>{let v=new CustomEvent(d.name,{detail:d.value});this.dispatchEvent(v)})}}return r.forEach(({propName:a,transform:d})=>{Object.defineProperty(l.prototype,a,{get(){return this.ngElementStrategy.getInputValue(a)},set(v){this.ngElementStrategy.setInputValue(a,v,d)},configurable:!0,enumerable:!0})}),l}var un={providers:[Yr()]};var cr=(r=>(r.CART_AMOUNT="CART_AMOUNT",r.ITEM_COUNT="ITEM_COUNT",r))(cr||{});var ut=Jn(hn());ut.filters.define("default",function(e){return typeof e>"u"||e==null?"":ii(e)});+ut.filters.define("max",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r>o?t:e});ut.filters.define("min",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r<o?t:e});ut.filters.define("fallback",(e,t)=>e==null||e===""?t:e);ut.filters.define("manipulate_quantity",(e,t,r)=>{if(t??=1,r??=100,t>r)return vt.error("Invalid range: min should be less than or equal to max."),e;if(e>=t&&e<=r)return e;let o=e%r;return o<t?t:o});ut.filters.define("apply_discount_perc",(e,t,r=1/0)=>{if(e=+e,isNaN(e))return vt.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(t<0||t>100)return vt.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=e*t/100;return e-Math.min(r,o)});ut.filters.define("apply_discount_fixed",(e,t)=>(e=+e,isNaN(e)?(vt.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,e-t)));ut.filters.define("currency",e=>(e=+e,isNaN(e)?(vt.error("Need value as a number for `currency` filter"),NaN):he(e)));ut.defaultConfig.defaultFilter="default";ut.defaultConfig.useWith=!0;ut.defaultConfig.autoEscape=!1;var ni={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function ii(e){return String(e).replace(/["\\\n]/g,t=>ni[t])}function oi(e){if(!e)return"";let t=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return e.replace(t,(r,o,f,l)=>`{{ ${(f||l||"").trim()} }}`)}var me=(e,t,r)=>{t=Lt({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},t);try{return ut.render(oi(e),t)}catch(o){throw Qr(o,"squirrelly-render",{extra:{template:e,values:t},triggerContext:r}),o}};var Ve=class e{transform(t,r){return t?me(t,Lt({},r)):null}static \u0275fac=function(r){return new(r||e)};static \u0275pipe=Dr({name:"cooeeDynamicVariables",type:e,pure:!0})};var lr={};(function e(t,r,o,f){var l=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),a=typeof Path2D=="function"&&typeof DOMMatrix=="function",d=(function(){if(!t.OffscreenCanvas)return!1;var u=new OffscreenCanvas(1,1),p=u.getContext("2d");p.fillRect(0,0,1,1);var E=u.transferToImageBitmap();try{p.createPattern(E,"no-repeat")}catch{return!1}return!0})();function v(){}function x(u){var p=r.exports.Promise,E=p!==void 0?p:t.Promise;return typeof E=="function"?new E(u):(u(v,v),null)}var C=(function(u,p){return{transform:function(E){if(u)return E;if(p.has(E))return p.get(E);var O=new OffscreenCanvas(E.width,E.height),A=O.getContext("2d");return A.drawImage(E,0,0),p.set(E,O),O},clear:function(){p.clear()}}})(d,new Map),S=(function(){var u=Math.floor(16.666666666666668),p,E,O={},A=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(p=function(M){var V=Math.random();return O[V]=requestAnimationFrame(function N(R){A===R||A+u-1<R?(A=R,delete O[V],M()):O[V]=requestAnimationFrame(N)}),V},E=function(M){O[M]&&cancelAnimationFrame(O[M])}):(p=function(M){return setTimeout(M,u)},E=function(M){return clearTimeout(M)}),{frame:p,cancel:E}})(),I=(function(){var u,p,E={};function O(A){function M(V,N){A.postMessage({options:V||{},callback:N})}A.init=function(N){var R=N.transferControlToOffscreen();A.postMessage({canvas:R},[R])},A.fire=function(N,R,B){if(p)return M(N,null),p;var P=Math.random().toString(36).slice(2);return p=x(function(F){function U(j){j.data.callback===P&&(delete E[P],A.removeEventListener("message",U),p=null,C.clear(),B(),F())}A.addEventListener("message",U),M(N,P),E[P]=U.bind(null,{data:{callback:P}})}),p},A.reset=function(){A.postMessage({reset:!0});for(var N in E)E[N](),delete E[N]}}return function(){if(u)return u;if(!o&&l){var A=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
11
- `);try{u=new Worker(URL.createObjectURL(new Blob([A])))}catch(M){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",M),null}O(u)}return u}})(),z={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function L(u,p){return p?p(u):u}function J(u){return u!=null}function k(u,p,E){return L(u&&J(u[p])?u[p]:z[p],E)}function et(u){return u<0?0:Math.floor(u)}function X(u,p){return Math.floor(Math.random()*(p-u))+u}function K(u){return parseInt(u,16)}function T(u){return u.map(it)}function it(u){var p=String(u).replace(/[^0-9a-f]/gi,"");return p.length<6&&(p=p[0]+p[0]+p[1]+p[1]+p[2]+p[2]),{r:K(p.substring(0,2)),g:K(p.substring(2,4)),b:K(p.substring(4,6))}}function ht(u){var p=k(u,"origin",Object);return p.x=k(p,"x",Number),p.y=k(p,"y",Number),p}function bt(u){u.width=document.documentElement.clientWidth,u.height=document.documentElement.clientHeight}function Zt(u){var p=u.getBoundingClientRect();u.width=p.width,u.height=p.height}function Rt(u){var p=document.createElement("canvas");return p.style.position="fixed",p.style.top="0px",p.style.left="0px",p.style.pointerEvents="none",p.style.zIndex=u,p}function Gt(u,p,E,O,A,M,V,N,R){u.save(),u.translate(p,E),u.rotate(M),u.scale(O,A),u.arc(0,0,1,V,N,R),u.restore()}function Ht(u){var p=u.angle*(Math.PI/180),E=u.spread*(Math.PI/180);return{x:u.x,y:u.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:u.startVelocity*.5+Math.random()*u.startVelocity,angle2D:-p+(.5*E-Math.random()*E),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:u.color,shape:u.shape,tick:0,totalTicks:u.ticks,decay:u.decay,drift:u.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:u.gravity*3,ovalScalar:.6,scalar:u.scalar,flat:u.flat}}function wt(u,p){p.x+=Math.cos(p.angle2D)*p.velocity+p.drift,p.y+=Math.sin(p.angle2D)*p.velocity+p.gravity,p.velocity*=p.decay,p.flat?(p.wobble=0,p.wobbleX=p.x+10*p.scalar,p.wobbleY=p.y+10*p.scalar,p.tiltSin=0,p.tiltCos=0,p.random=1):(p.wobble+=p.wobbleSpeed,p.wobbleX=p.x+10*p.scalar*Math.cos(p.wobble),p.wobbleY=p.y+10*p.scalar*Math.sin(p.wobble),p.tiltAngle+=.1,p.tiltSin=Math.sin(p.tiltAngle),p.tiltCos=Math.cos(p.tiltAngle),p.random=Math.random()+2);var E=p.tick++/p.totalTicks,O=p.x+p.random*p.tiltCos,A=p.y+p.random*p.tiltSin,M=p.wobbleX+p.random*p.tiltCos,V=p.wobbleY+p.random*p.tiltSin;if(u.fillStyle="rgba("+p.color.r+", "+p.color.g+", "+p.color.b+", "+(1-E)+")",u.beginPath(),a&&p.shape.type==="path"&&typeof p.shape.path=="string"&&Array.isArray(p.shape.matrix))u.fill(m(p.shape.path,p.shape.matrix,p.x,p.y,Math.abs(M-O)*.1,Math.abs(V-A)*.1,Math.PI/10*p.wobble));else if(p.shape.type==="bitmap"){var N=Math.PI/10*p.wobble,R=Math.abs(M-O)*.1,B=Math.abs(V-A)*.1,P=p.shape.bitmap.width*p.scalar,F=p.shape.bitmap.height*p.scalar,U=new DOMMatrix([Math.cos(N)*R,Math.sin(N)*R,-Math.sin(N)*B,Math.cos(N)*B,p.x,p.y]);U.multiplySelf(new DOMMatrix(p.shape.matrix));var j=u.createPattern(C.transform(p.shape.bitmap),"no-repeat");j.setTransform(U),u.globalAlpha=1-E,u.fillStyle=j,u.fillRect(p.x-P/2,p.y-F/2,P,F),u.globalAlpha=1}else if(p.shape==="circle")u.ellipse?u.ellipse(p.x,p.y,Math.abs(M-O)*p.ovalScalar,Math.abs(V-A)*p.ovalScalar,Math.PI/10*p.wobble,0,2*Math.PI):Gt(u,p.x,p.y,Math.abs(M-O)*p.ovalScalar,Math.abs(V-A)*p.ovalScalar,Math.PI/10*p.wobble,0,2*Math.PI);else if(p.shape==="star")for(var $=Math.PI/2*3,s=4*p.scalar,n=8*p.scalar,i=p.x,c=p.y,h=5,y=Math.PI/h;h--;)i=p.x+Math.cos($)*n,c=p.y+Math.sin($)*n,u.lineTo(i,c),$+=y,i=p.x+Math.cos($)*s,c=p.y+Math.sin($)*s,u.lineTo(i,c),$+=y;else u.moveTo(Math.floor(p.x),Math.floor(p.y)),u.lineTo(Math.floor(p.wobbleX),Math.floor(A)),u.lineTo(Math.floor(M),Math.floor(V)),u.lineTo(Math.floor(O),Math.floor(p.wobbleY));return u.closePath(),u.fill(),p.tick<p.totalTicks}function xt(u,p,E,O,A){var M=p.slice(),V=u.getContext("2d"),N,R,B=x(function(P){function F(){N=R=null,V.clearRect(0,0,O.width,O.height),C.clear(),A(),P()}function U(){o&&!(O.width===f.width&&O.height===f.height)&&(O.width=u.width=f.width,O.height=u.height=f.height),!O.width&&!O.height&&(E(u),O.width=u.width,O.height=u.height),V.clearRect(0,0,O.width,O.height),M=M.filter(function(j){return wt(V,j)}),M.length?N=S.frame(U):F()}N=S.frame(U),R=F});return{addFettis:function(P){return M=M.concat(P),B},canvas:u,promise:B,reset:function(){N&&S.cancel(N),R&&R()}}}function dt(u,p){var E=!u,O=!!k(p||{},"resize"),A=!1,M=k(p,"disableForReducedMotion",Boolean),V=l&&!!k(p||{},"useWorker"),N=V?I():null,R=E?bt:Zt,B=u&&N?!!u.__confetti_initialized:!1,P=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,F;function U($,s,n){for(var i=k($,"particleCount",et),c=k($,"angle",Number),h=k($,"spread",Number),y=k($,"startVelocity",Number),_=k($,"decay",Number),H=k($,"gravity",Number),Z=k($,"drift",Number),W=k($,"colors",T),Q=k($,"ticks",Number),tt=k($,"shapes"),st=k($,"scalar"),Ft=!!k($,"flat"),zt=ht($),le=i,St=[],Vt=u.width*zt.x,Wn=u.height*zt.y;le--;)St.push(Ht({x:Vt,y:Wn,angle:c,spread:h,startVelocity:y,color:W[le%W.length],shape:tt[X(0,tt.length)],ticks:Q,decay:_,gravity:H,drift:Z,scalar:st,flat:Ft}));return F?F.addFettis(St):(F=xt(u,St,R,s,n),F.promise)}function j($){var s=M||k($,"disableForReducedMotion",Boolean),n=k($,"zIndex",Number);if(s&&P)return x(function(y){y()});E&&F?u=F.canvas:E&&!u&&(u=Rt(n),document.body.appendChild(u)),O&&!B&&R(u);var i={width:u.width,height:u.height};N&&!B&&N.init(u),B=!0,N&&(u.__confetti_initialized=!0);function c(){if(N){var y={getBoundingClientRect:function(){if(!E)return u.getBoundingClientRect()}};R(y),N.postMessage({resize:{width:y.width,height:y.height}});return}i.width=i.height=null}function h(){F=null,O&&(A=!1,t.removeEventListener("resize",c)),E&&u&&(document.body.contains(u)&&document.body.removeChild(u),u=null,B=!1)}return O&&!A&&(A=!0,t.addEventListener("resize",c,!1)),N?N.fire($,i,h):U($,i,h)}return j.reset=function(){N&&N.reset(),F&&F.reset()},j}var Et;function g(){return Et||(Et=dt(null,{useWorker:!0,resize:!0})),Et}function m(u,p,E,O,A,M,V){var N=new Path2D(u),R=new Path2D;R.addPath(N,new DOMMatrix(p));var B=new Path2D;return B.addPath(R,new DOMMatrix([Math.cos(V)*A,Math.sin(V)*A,-Math.sin(V)*M,Math.cos(V)*M,E,O])),B}function b(u){if(!a)throw new Error("path confetti are not supported in this browser");var p,E;typeof u=="string"?p=u:(p=u.path,E=u.matrix);var O=new Path2D(p),A=document.createElement("canvas"),M=A.getContext("2d");if(!E){for(var V=1e3,N=V,R=V,B=0,P=0,F,U,j=0;j<V;j+=2)for(var $=0;$<V;$+=2)M.isPointInPath(O,j,$,"nonzero")&&(N=Math.min(N,j),R=Math.min(R,$),B=Math.max(B,j),P=Math.max(P,$));F=B-N,U=P-R;var s=10,n=Math.min(s/F,s/U);E=[n,0,0,n,-Math.round(F/2+N)*n,-Math.round(U/2+R)*n]}return{type:"path",path:p,matrix:E}}function w(u){var p,E=1,O="#000000",A='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof u=="string"?p=u:(p=u.text,E="scalar"in u?u.scalar:E,A="fontFamily"in u?u.fontFamily:A,O="color"in u?u.color:O);var M=10*E,V=""+M+"px "+A,N=new OffscreenCanvas(M,M),R=N.getContext("2d");R.font=V;var B=R.measureText(p),P=Math.ceil(B.actualBoundingBoxRight+B.actualBoundingBoxLeft),F=Math.ceil(B.actualBoundingBoxAscent+B.actualBoundingBoxDescent),U=2,j=B.actualBoundingBoxLeft+U,$=B.actualBoundingBoxAscent+U;P+=U+U,F+=U+U,N=new OffscreenCanvas(P,F),R=N.getContext("2d"),R.font=V,R.fillStyle=O,R.fillText(p,j,$);var s=1/E;return{type:"bitmap",bitmap:N.transferToImageBitmap(),matrix:[s,0,0,s,-P*s/2,-F*s/2]}}r.exports=function(){return g().apply(this,arguments)},r.exports.reset=function(){g().reset()},r.exports.create=dt,r.exports.shapeFromPath=b,r.exports.shapeFromText=w})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),lr,!1);var dn=lr.exports,Jo=lr.exports.create;var Le=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(t=100){let r=[],o=Date.now()+2e3,f=()=>{r.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&t>0&&(requestAnimationFrame(f),t--)};f(),await Promise.all(r)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(t){Object.assign(t,this.DEFAULTS,t),t.particleCount=t.particleCount??this.DEFAULTS.colors.length,await dn(t)}static async realisticFire(t,r){let f={origin:{y:.7}};await this.fire(Object.assign({},f,r,{particleCount:Math.floor(200*t)}))}};var si=(e,t)=>t.minValue;function ai(e,t){if(e&1&&(Ot(0,"div",7),jt(1,"safeHtml")),e&2){let r=q().$implicit;_t("innerHTML",qt(1,1,r.minValue+" Products"),At)}}function ci(e,t){if(e&1&&(Ot(0,"div",7),jt(1,"cooeeCurrency"),jt(2,"safeHtml")),e&2){let r=q().$implicit;_t("innerHTML",qt(2,3,qt(1,1,r.minValue)),At)}}function li(e,t){if(e&1&&(Mt(0,"li",6)(1,"div"),lt(2,ai,2,3,"div",7)(3,ci,3,5,"div",7),Ot(4,"img",8),Mt(5,"div",9),Dt(6),Pt()()()),e&2){let r=t.$implicit,o=q(2);be("left",r.calculatedAlignment+"%"),Y(2),ft((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),Y(2),_t("src",o.getIconURL(r),Xt),Y(2),kr(r.label)}}function fi(e,t){if(e&1&&(Ot(0,"div",0),jt(1,"cooeeDynamicVariables"),jt(2,"safeHtml"),Mt(3,"div",1)(4,"ul",2)(5,"div",3),Ot(6,"div",4),Pt(),Ct(7,li,7,5,"li",5,si),Pt()()),e&2){let r=q(),o=r.calculatedState(),f=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;_t("innerHTML",qt(2,6,Wr(1,3,f,r.localDynamicVariables())),At),Y(6),be("width",o.cartValuePercentage+"%"),Y(),It(o.milestones)}}var Pe=class e extends Qt{cart;localDynamicVariables=Wt({});calculatedState=Wt({});progressBarConfig;RewardBasis=cr;constructor(){super()}engagementTriggerReceived(t){this.progressBarConfig=t.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(t){return t.rewardType===De.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":t.rewardType===De.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":t.rewardType===De.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(t=>vt.error(t))}async calculateMilestones(){let t=this.engagementTrigger,r=this.progressBarConfig;if(!r?.milestones?.length){vt.warn("Milestones not available in progress bar config",t);return}let o=await this.cart.getNormalisedCart(),f=r.milestones.at(-1),l=r?.reachedAmountOrCount??o.originalAmount,a=r.totalProgress??0;vt.verbose("Cart value:",l,`, percentage: ${a}%`),this.celebrate(t,l);let d={milestonesReady:!0,cartValuePercentage:a,milestones:r.milestones},v=r.milestones.find(x=>!x.reached);if(v){let x=he(v.minValue-l);if(r.rewardBasis==="ITEM_COUNT"){let C=v.minValue-l;x=`${C} ${C===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:x}),d.nextMilestone=v,this.calculatedState.set(d);return}d.lastMilestone=f,this.calculatedState.set(d)}celebrate(t,r){let l=[...t.progressBarConfig.milestones].reverse().find(v=>v.minValue<r);if(!l)return;let a=`lc/en/${t.shortID}/${l.minValue}`;sessionStorage.getItem(a)||(sessionStorage.setItem(a,"1"),this.progressBarConfig?.noConfetti||Le.realistic())}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[gt],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(r,o){r&1&&lt(0,fi,9,8),r&2&&ft(o.calculatedState().milestonesReady?0:-1)},dependencies:[Ve,de,en],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-primary-color),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgba(var(--lc-primary-color));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgba(var(--lc-primary-color))}
12
- `],encapsulation:3})};var ui=["numberVariable"],Ue=class e extends Qt{numberSlot;savingsBarConfig;textParts=Wt({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(t){this.savingsBarConfig=t.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+t.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let t=Lt(Lt({},this.engagementTrigger.getCartMagicVariables()),tn("total_savings",this.savingsBarConfig.totalSavings)),r=me(this.savingsBarConfig.text,{cart:t},this.triggerContext),o=r.match(/[\d.,]+/)?.[0];if(!o){vt.error("No amount found in text",r);return}let[f,l]=r.split(o);this.textParts.set({start:f,end:l}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(t="0"){let r=this.numberSlot.nativeElement;r.innerHTML="";let o=this.savingsBarConfig.animationDuration/t.length;this.clearPreviousIntervals();for(let f=0;f<t.length;f++){let l=document.createElement("div");l.className="digit",l.style.display="inline-block",r.appendChild(l);let a=setInterval(()=>{let d=Math.floor(Math.random()*10);l.innerHTML=`<div>${d}</div>`},50);this.globalIntervals.push(a),setTimeout(()=>{clearInterval(a);let d=t?.[f]??Math.floor(Math.random()*10);l.innerHTML=`${d}`},(f+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(t){let r=performance.now(),o=f=>{let l=Math.min((f-r)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(t*l).toString(),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(t){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(t):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(t))}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-savings-bar"]],viewQuery:function(r,o){if(r&1&&Te(ui,5),r&2){let f;Be(f=Ae())&&(o.numberSlot=f.first)}},features:[gt],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(r,o){r&1&&(Mt(0,"div",1),Ot(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),Pt()),r&2&&(Y(2),_t("innerHTML",o.textParts().start,At),Y(3),_t("innerHTML",o.textParts().end,At))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgba(var(--lc-primary-button-bg-color, 0 162 81));color:rgba(var(--lc-primary-button-color, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
10
+ `+L(g,w)):p}}function Et(g,m){var b;return m.cache&&m.name&&m.storage.templates.get(m.name)?m.storage.templates.get(m.name):(b=typeof g=="function"?g:dt(g,m),m.cache&&m.name&&m.storage.templates.define(m.name,b),b)}_t.l.bind(_t),e.compile=dt,e.compileScope=K,e.compileScopeIntoFunction=X,e.compileToString=L,e.defaultConfig=_t,e.filters=Ht,e.getConfig=xt,e.helpers=Rt,e.nativeHelpers=Gt,e.parse=z,e.render=function(g,m,b,w){var u=xt(b||{});if(!u.async)return Et(g,u)(m,u);if(!w){if(typeof o=="function")return new o(function(p,E){try{p(Et(g,u)(m,u))}catch(O){E(O)}});throw t("Please provide a callback function, this env doesn't support Promises")}try{Et(g,u)(m,u,w)}catch(p){return w(p)}},e.templates=Zt,Object.defineProperty(e,"__esModule",{value:!0})})});var qn={schedule(e,t){let r=setTimeout(e,t);return()=>clearTimeout(r)}};function Zn(e){return e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Gn(e){return!!e&&e.nodeType===Node.ELEMENT_NODE}var ir;function Xn(e,t){if(!ir){let r=Element.prototype;ir=r.matches||r.matchesSelector||r.mozMatchesSelector||r.msMatchesSelector||r.oMatchesSelector||r.webkitMatchesSelector}return e.nodeType===Node.ELEMENT_NODE?ir.call(e,t):!1}function Kn(e){let t={};return e.forEach(({propName:r,templateName:o,transform:f})=>{t[Zn(o)]=[r,f]}),t}function Qn(e,t){return t.get(rr).resolveComponentFactory(e).inputs}function ti(e,t){let r=e.childNodes,o=t.map(()=>[]),f=-1;t.some((l,a)=>l==="*"?(f=a,!0):!1);for(let l=0,a=r.length;l<a;++l){let d=r[l],v=ei(d,t,f);v!==-1&&o[v].push(d)}return o}function ei(e,t,r){let o=r;return Gn(e)&&t.some((f,l)=>f!=="*"&&Xn(e,f)?(o=l,!0):!1),o}var ri=10,or=class{componentFactory;inputMap=new Map;constructor(t,r){this.componentFactory=r.get(rr).resolveComponentFactory(t);for(let o of this.componentFactory.inputs)this.inputMap.set(o.propName,o.templateName)}create(t){return new sr(this.componentFactory,t,this.inputMap)}},sr=class{componentFactory;injector;inputMap;eventEmitters=new tr(1);events=this.eventEmitters.pipe(Sr(t=>Er(...t)));componentRef=null;scheduledDestroyFn=null;initialInputValues=new Map;ngZone;elementZone;appRef;cdScheduler;constructor(t,r,o){this.componentFactory=t,this.injector=r,this.inputMap=o,this.ngZone=this.injector.get(Fr),this.appRef=this.injector.get(Vr),this.cdScheduler=r.get(Tr),this.elementZone=typeof Zone>"u"?null:this.ngZone.run(()=>Zone.current)}connect(t){this.runInZone(()=>{if(this.scheduledDestroyFn!==null){this.scheduledDestroyFn(),this.scheduledDestroyFn=null;return}this.componentRef===null&&this.initializeComponent(t)})}disconnect(){this.runInZone(()=>{this.componentRef===null||this.scheduledDestroyFn!==null||(this.scheduledDestroyFn=qn.schedule(()=>{this.componentRef!==null&&(this.componentRef.destroy(),this.componentRef=null)},ri))})}getInputValue(t){return this.runInZone(()=>this.componentRef===null?this.initialInputValues.get(t):this.componentRef.instance[t])}setInputValue(t,r){if(this.componentRef===null){this.initialInputValues.set(t,r);return}this.runInZone(()=>{this.componentRef.setInput(this.inputMap.get(t)??t,r),Ar(this.componentRef.hostView)&&(Mr(this.componentRef.changeDetectorRef),this.cdScheduler.notify(6))})}initializeComponent(t){let r=er.create({providers:[],parent:this.injector}),o=ti(t,this.componentFactory.ngContentSelectors);this.componentRef=this.componentFactory.create(r,o,t),this.initializeInputs(),this.initializeOutputs(this.componentRef),this.appRef.attachView(this.componentRef.hostView),this.componentRef.hostView.detectChanges()}initializeInputs(){for(let[t,r]of this.initialInputValues)this.setInputValue(t,r);this.initialInputValues.clear()}initializeOutputs(t){let r=this.componentFactory.outputs.map(({propName:o,templateName:f})=>{let l=t.instance[o];return new Oe(a=>{let d=l.subscribe(v=>a.next({name:f,value:v}));return()=>d.unsubscribe()})});this.eventEmitters.next(r)}runInZone(t){return this.elementZone&&Zone.current!==this.elementZone?this.ngZone.run(t):t()}},ar=class extends HTMLElement{ngElementEventsSubscription=null};function fn(e,t){let r=Qn(e,t.injector),o=t.strategyFactory||new or(e,t.injector),f=Kn(r);class l extends ar{injector;static observedAttributes=Object.keys(f);get ngElementStrategy(){if(!this._ngElementStrategy){let d=this._ngElementStrategy=o.create(this.injector||t.injector);r.forEach(({propName:v,transform:x})=>{if(!this.hasOwnProperty(v))return;let C=this[v];delete this[v],d.setInputValue(v,C,x)})}return this._ngElementStrategy}_ngElementStrategy;constructor(d){super(),this.injector=d}attributeChangedCallback(d,v,x,C){let[S,I]=f[d];this.ngElementStrategy.setInputValue(S,x,I)}connectedCallback(){let d=!1;this.ngElementStrategy.events&&(this.subscribeToEvents(),d=!0),this.ngElementStrategy.connect(this),d||this.subscribeToEvents()}disconnectedCallback(){this._ngElementStrategy&&this._ngElementStrategy.disconnect(),this.ngElementEventsSubscription&&(this.ngElementEventsSubscription.unsubscribe(),this.ngElementEventsSubscription=null)}subscribeToEvents(){this.ngElementEventsSubscription=this.ngElementStrategy.events.subscribe(d=>{let v=new CustomEvent(d.name,{detail:d.value});this.dispatchEvent(v)})}}return r.forEach(({propName:a,transform:d})=>{Object.defineProperty(l.prototype,a,{get(){return this.ngElementStrategy.getInputValue(a)},set(v){this.ngElementStrategy.setInputValue(a,v,d)},configurable:!0,enumerable:!0})}),l}var un={providers:[Yr()]};var cr=(r=>(r.CART_AMOUNT="CART_AMOUNT",r.ITEM_COUNT="ITEM_COUNT",r))(cr||{});var ut=Jn(hn());ut.filters.define("default",function(e){return typeof e>"u"||e==null?"":ii(e)});+ut.filters.define("max",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r>o?t:e});ut.filters.define("min",(e,t)=>{let r=Number(e),o=Number(t);return isNaN(r)||isNaN(o)?e:r<o?t:e});ut.filters.define("fallback",(e,t)=>e==null||e===""?t:e);ut.filters.define("manipulate_quantity",(e,t,r)=>{if(t??=1,r??=100,t>r)return wt.error("Invalid range: min should be less than or equal to max."),e;if(e>=t&&e<=r)return e;let o=e%r;return o<t?t:o});ut.filters.define("apply_discount_perc",(e,t,r=1/0)=>{if(e=+e,isNaN(e))return wt.error("Need value as a number for `apply_discount_perc` filter"),NaN;if(t<0||t>100)return wt.error("Invalid percent value for `apply_discount_perc` filter. Must be between 0 and 100."),NaN;let o=e*t/100;return e-Math.min(r,o)});ut.filters.define("apply_discount_fixed",(e,t)=>(e=+e,isNaN(e)?(wt.error("Need value as a number for `apply_discount_fixed` filter"),NaN):Math.max(0,e-t)));ut.filters.define("currency",e=>(e=+e,isNaN(e)?(wt.error("Need value as a number for `currency` filter"),NaN):he(e)));ut.defaultConfig.defaultFilter="default";ut.defaultConfig.useWith=!0;ut.defaultConfig.autoEscape=!1;var ni={'"':"&quot;","\\":"&bsol;","\n":"\\n"};function ii(e){return String(e).replace(/["\\\n]/g,t=>ni[t])}function oi(e){if(!e)return"";let t=/({{{\s*([^}]+?)\s*}}}|{{\s*&\s*([^}]+?)\s*}})/g;return e.replace(t,(r,o,f,l)=>`{{ ${(f||l||"").trim()} }}`)}var me=(e,t,r)=>{t=Lt({discount:{},cart:{},product:{},bundle:{},variant:{},customer:{},svg:{},form:{},amount_left:null},t);try{return ut.render(oi(e),t)}catch(o){throw Qr(o,"squirrelly-render",{extra:{template:e,values:t},triggerContext:r}),o}};var Ve=class e{transform(t,r){return t?me(t,Lt({},r)):null}static \u0275fac=function(r){return new(r||e)};static \u0275pipe=Dr({name:"cooeeDynamicVariables",type:e,pure:!0})};var lr={};(function e(t,r,o,f){var l=!!(t.Worker&&t.Blob&&t.Promise&&t.OffscreenCanvas&&t.OffscreenCanvasRenderingContext2D&&t.HTMLCanvasElement&&t.HTMLCanvasElement.prototype.transferControlToOffscreen&&t.URL&&t.URL.createObjectURL),a=typeof Path2D=="function"&&typeof DOMMatrix=="function",d=(function(){if(!t.OffscreenCanvas)return!1;var u=new OffscreenCanvas(1,1),p=u.getContext("2d");p.fillRect(0,0,1,1);var E=u.transferToImageBitmap();try{p.createPattern(E,"no-repeat")}catch{return!1}return!0})();function v(){}function x(u){var p=r.exports.Promise,E=p!==void 0?p:t.Promise;return typeof E=="function"?new E(u):(u(v,v),null)}var C=(function(u,p){return{transform:function(E){if(u)return E;if(p.has(E))return p.get(E);var O=new OffscreenCanvas(E.width,E.height),A=O.getContext("2d");return A.drawImage(E,0,0),p.set(E,O),O},clear:function(){p.clear()}}})(d,new Map),S=(function(){var u=Math.floor(16.666666666666668),p,E,O={},A=0;return typeof requestAnimationFrame=="function"&&typeof cancelAnimationFrame=="function"?(p=function(M){var V=Math.random();return O[V]=requestAnimationFrame(function N(R){A===R||A+u-1<R?(A=R,delete O[V],M()):O[V]=requestAnimationFrame(N)}),V},E=function(M){O[M]&&cancelAnimationFrame(O[M])}):(p=function(M){return setTimeout(M,u)},E=function(M){return clearTimeout(M)}),{frame:p,cancel:E}})(),I=(function(){var u,p,E={};function O(A){function M(V,N){A.postMessage({options:V||{},callback:N})}A.init=function(N){var R=N.transferControlToOffscreen();A.postMessage({canvas:R},[R])},A.fire=function(N,R,B){if(p)return M(N,null),p;var P=Math.random().toString(36).slice(2);return p=x(function(F){function U(j){j.data.callback===P&&(delete E[P],A.removeEventListener("message",U),p=null,C.clear(),B(),F())}A.addEventListener("message",U),M(N,P),E[P]=U.bind(null,{data:{callback:P}})}),p},A.reset=function(){A.postMessage({reset:!0});for(var N in E)E[N](),delete E[N]}}return function(){if(u)return u;if(!o&&l){var A=["var CONFETTI, SIZE = {}, module = {};","("+e.toString()+")(this, module, true, SIZE);","onmessage = function(msg) {"," if (msg.data.options) {"," CONFETTI(msg.data.options).then(function () {"," if (msg.data.callback) {"," postMessage({ callback: msg.data.callback });"," }"," });"," } else if (msg.data.reset) {"," CONFETTI && CONFETTI.reset();"," } else if (msg.data.resize) {"," SIZE.width = msg.data.resize.width;"," SIZE.height = msg.data.resize.height;"," } else if (msg.data.canvas) {"," SIZE.width = msg.data.canvas.width;"," SIZE.height = msg.data.canvas.height;"," CONFETTI = module.exports.create(msg.data.canvas);"," }","}"].join(`
11
+ `);try{u=new Worker(URL.createObjectURL(new Blob([A])))}catch(M){return typeof console!==void 0&&typeof console.warn=="function"&&console.warn("\u{1F38A} Could not load worker",M),null}O(u)}return u}})(),z={particleCount:50,angle:90,spread:45,startVelocity:45,decay:.9,gravity:1,drift:0,ticks:200,x:.5,y:.5,shapes:["square","circle"],zIndex:100,colors:["#26ccff","#a25afd","#ff5e7e","#88ff5a","#fcff42","#ffa62d","#ff36ff"],disableForReducedMotion:!1,scalar:1};function L(u,p){return p?p(u):u}function J(u){return u!=null}function k(u,p,E){return L(u&&J(u[p])?u[p]:z[p],E)}function et(u){return u<0?0:Math.floor(u)}function X(u,p){return Math.floor(Math.random()*(p-u))+u}function K(u){return parseInt(u,16)}function T(u){return u.map(it)}function it(u){var p=String(u).replace(/[^0-9a-f]/gi,"");return p.length<6&&(p=p[0]+p[0]+p[1]+p[1]+p[2]+p[2]),{r:K(p.substring(0,2)),g:K(p.substring(2,4)),b:K(p.substring(4,6))}}function ht(u){var p=k(u,"origin",Object);return p.x=k(p,"x",Number),p.y=k(p,"y",Number),p}function bt(u){u.width=document.documentElement.clientWidth,u.height=document.documentElement.clientHeight}function Zt(u){var p=u.getBoundingClientRect();u.width=p.width,u.height=p.height}function Rt(u){var p=document.createElement("canvas");return p.style.position="fixed",p.style.top="0px",p.style.left="0px",p.style.pointerEvents="none",p.style.zIndex=u,p}function Gt(u,p,E,O,A,M,V,N,R){u.save(),u.translate(p,E),u.rotate(M),u.scale(O,A),u.arc(0,0,1,V,N,R),u.restore()}function Ht(u){var p=u.angle*(Math.PI/180),E=u.spread*(Math.PI/180);return{x:u.x,y:u.y,wobble:Math.random()*10,wobbleSpeed:Math.min(.11,Math.random()*.1+.05),velocity:u.startVelocity*.5+Math.random()*u.startVelocity,angle2D:-p+(.5*E-Math.random()*E),tiltAngle:(Math.random()*(.75-.25)+.25)*Math.PI,color:u.color,shape:u.shape,tick:0,totalTicks:u.ticks,decay:u.decay,drift:u.drift,random:Math.random()+2,tiltSin:0,tiltCos:0,wobbleX:0,wobbleY:0,gravity:u.gravity*3,ovalScalar:.6,scalar:u.scalar,flat:u.flat}}function _t(u,p){p.x+=Math.cos(p.angle2D)*p.velocity+p.drift,p.y+=Math.sin(p.angle2D)*p.velocity+p.gravity,p.velocity*=p.decay,p.flat?(p.wobble=0,p.wobbleX=p.x+10*p.scalar,p.wobbleY=p.y+10*p.scalar,p.tiltSin=0,p.tiltCos=0,p.random=1):(p.wobble+=p.wobbleSpeed,p.wobbleX=p.x+10*p.scalar*Math.cos(p.wobble),p.wobbleY=p.y+10*p.scalar*Math.sin(p.wobble),p.tiltAngle+=.1,p.tiltSin=Math.sin(p.tiltAngle),p.tiltCos=Math.cos(p.tiltAngle),p.random=Math.random()+2);var E=p.tick++/p.totalTicks,O=p.x+p.random*p.tiltCos,A=p.y+p.random*p.tiltSin,M=p.wobbleX+p.random*p.tiltCos,V=p.wobbleY+p.random*p.tiltSin;if(u.fillStyle="rgba("+p.color.r+", "+p.color.g+", "+p.color.b+", "+(1-E)+")",u.beginPath(),a&&p.shape.type==="path"&&typeof p.shape.path=="string"&&Array.isArray(p.shape.matrix))u.fill(m(p.shape.path,p.shape.matrix,p.x,p.y,Math.abs(M-O)*.1,Math.abs(V-A)*.1,Math.PI/10*p.wobble));else if(p.shape.type==="bitmap"){var N=Math.PI/10*p.wobble,R=Math.abs(M-O)*.1,B=Math.abs(V-A)*.1,P=p.shape.bitmap.width*p.scalar,F=p.shape.bitmap.height*p.scalar,U=new DOMMatrix([Math.cos(N)*R,Math.sin(N)*R,-Math.sin(N)*B,Math.cos(N)*B,p.x,p.y]);U.multiplySelf(new DOMMatrix(p.shape.matrix));var j=u.createPattern(C.transform(p.shape.bitmap),"no-repeat");j.setTransform(U),u.globalAlpha=1-E,u.fillStyle=j,u.fillRect(p.x-P/2,p.y-F/2,P,F),u.globalAlpha=1}else if(p.shape==="circle")u.ellipse?u.ellipse(p.x,p.y,Math.abs(M-O)*p.ovalScalar,Math.abs(V-A)*p.ovalScalar,Math.PI/10*p.wobble,0,2*Math.PI):Gt(u,p.x,p.y,Math.abs(M-O)*p.ovalScalar,Math.abs(V-A)*p.ovalScalar,Math.PI/10*p.wobble,0,2*Math.PI);else if(p.shape==="star")for(var $=Math.PI/2*3,s=4*p.scalar,n=8*p.scalar,i=p.x,c=p.y,h=5,y=Math.PI/h;h--;)i=p.x+Math.cos($)*n,c=p.y+Math.sin($)*n,u.lineTo(i,c),$+=y,i=p.x+Math.cos($)*s,c=p.y+Math.sin($)*s,u.lineTo(i,c),$+=y;else u.moveTo(Math.floor(p.x),Math.floor(p.y)),u.lineTo(Math.floor(p.wobbleX),Math.floor(A)),u.lineTo(Math.floor(M),Math.floor(V)),u.lineTo(Math.floor(O),Math.floor(p.wobbleY));return u.closePath(),u.fill(),p.tick<p.totalTicks}function xt(u,p,E,O,A){var M=p.slice(),V=u.getContext("2d"),N,R,B=x(function(P){function F(){N=R=null,V.clearRect(0,0,O.width,O.height),C.clear(),A(),P()}function U(){o&&!(O.width===f.width&&O.height===f.height)&&(O.width=u.width=f.width,O.height=u.height=f.height),!O.width&&!O.height&&(E(u),O.width=u.width,O.height=u.height),V.clearRect(0,0,O.width,O.height),M=M.filter(function(j){return _t(V,j)}),M.length?N=S.frame(U):F()}N=S.frame(U),R=F});return{addFettis:function(P){return M=M.concat(P),B},canvas:u,promise:B,reset:function(){N&&S.cancel(N),R&&R()}}}function dt(u,p){var E=!u,O=!!k(p||{},"resize"),A=!1,M=k(p,"disableForReducedMotion",Boolean),V=l&&!!k(p||{},"useWorker"),N=V?I():null,R=E?bt:Zt,B=u&&N?!!u.__confetti_initialized:!1,P=typeof matchMedia=="function"&&matchMedia("(prefers-reduced-motion)").matches,F;function U($,s,n){for(var i=k($,"particleCount",et),c=k($,"angle",Number),h=k($,"spread",Number),y=k($,"startVelocity",Number),_=k($,"decay",Number),H=k($,"gravity",Number),Z=k($,"drift",Number),W=k($,"colors",T),Q=k($,"ticks",Number),tt=k($,"shapes"),st=k($,"scalar"),Ft=!!k($,"flat"),zt=ht($),le=i,St=[],Vt=u.width*zt.x,Wn=u.height*zt.y;le--;)St.push(Ht({x:Vt,y:Wn,angle:c,spread:h,startVelocity:y,color:W[le%W.length],shape:tt[X(0,tt.length)],ticks:Q,decay:_,gravity:H,drift:Z,scalar:st,flat:Ft}));return F?F.addFettis(St):(F=xt(u,St,R,s,n),F.promise)}function j($){var s=M||k($,"disableForReducedMotion",Boolean),n=k($,"zIndex",Number);if(s&&P)return x(function(y){y()});E&&F?u=F.canvas:E&&!u&&(u=Rt(n),document.body.appendChild(u)),O&&!B&&R(u);var i={width:u.width,height:u.height};N&&!B&&N.init(u),B=!0,N&&(u.__confetti_initialized=!0);function c(){if(N){var y={getBoundingClientRect:function(){if(!E)return u.getBoundingClientRect()}};R(y),N.postMessage({resize:{width:y.width,height:y.height}});return}i.width=i.height=null}function h(){F=null,O&&(A=!1,t.removeEventListener("resize",c)),E&&u&&(document.body.contains(u)&&document.body.removeChild(u),u=null,B=!1)}return O&&!A&&(A=!0,t.addEventListener("resize",c,!1)),N?N.fire($,i,h):U($,i,h)}return j.reset=function(){N&&N.reset(),F&&F.reset()},j}var Et;function g(){return Et||(Et=dt(null,{useWorker:!0,resize:!0})),Et}function m(u,p,E,O,A,M,V){var N=new Path2D(u),R=new Path2D;R.addPath(N,new DOMMatrix(p));var B=new Path2D;return B.addPath(R,new DOMMatrix([Math.cos(V)*A,Math.sin(V)*A,-Math.sin(V)*M,Math.cos(V)*M,E,O])),B}function b(u){if(!a)throw new Error("path confetti are not supported in this browser");var p,E;typeof u=="string"?p=u:(p=u.path,E=u.matrix);var O=new Path2D(p),A=document.createElement("canvas"),M=A.getContext("2d");if(!E){for(var V=1e3,N=V,R=V,B=0,P=0,F,U,j=0;j<V;j+=2)for(var $=0;$<V;$+=2)M.isPointInPath(O,j,$,"nonzero")&&(N=Math.min(N,j),R=Math.min(R,$),B=Math.max(B,j),P=Math.max(P,$));F=B-N,U=P-R;var s=10,n=Math.min(s/F,s/U);E=[n,0,0,n,-Math.round(F/2+N)*n,-Math.round(U/2+R)*n]}return{type:"path",path:p,matrix:E}}function w(u){var p,E=1,O="#000000",A='"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji", "EmojiOne Color", "Android Emoji", "Twemoji Mozilla", "system emoji", sans-serif';typeof u=="string"?p=u:(p=u.text,E="scalar"in u?u.scalar:E,A="fontFamily"in u?u.fontFamily:A,O="color"in u?u.color:O);var M=10*E,V=""+M+"px "+A,N=new OffscreenCanvas(M,M),R=N.getContext("2d");R.font=V;var B=R.measureText(p),P=Math.ceil(B.actualBoundingBoxRight+B.actualBoundingBoxLeft),F=Math.ceil(B.actualBoundingBoxAscent+B.actualBoundingBoxDescent),U=2,j=B.actualBoundingBoxLeft+U,$=B.actualBoundingBoxAscent+U;P+=U+U,F+=U+U,N=new OffscreenCanvas(P,F),R=N.getContext("2d"),R.font=V,R.fillStyle=O,R.fillText(p,j,$);var s=1/E;return{type:"bitmap",bitmap:N.transferToImageBitmap(),matrix:[s,0,0,s,-P*s/2,-F*s/2]}}r.exports=function(){return g().apply(this,arguments)},r.exports.reset=function(){g().reset()},r.exports.create=dt,r.exports.shapeFromPath=b,r.exports.shapeFromText=w})((function(){return typeof window<"u"?window:typeof self<"u"?self:this||{}})(),lr,!1);var dn=lr.exports,Jo=lr.exports.create;var Le=class{static DEFAULTS={scalar:1.4,zIndex:1e4,shapes:["circle","circle","square"],colors:["#f51c8f","#2179e2","#d52dc8","#01a9d9","#78ff44","#fdff6a"]};static async basic(){await this.fire({particleCount:100,spread:70,origin:{y:.6}})}static async leftRight(t=100){let r=[],o=Date.now()+2e3,f=()=>{r.push(this.fire({angle:60,spread:55,origin:{x:0}}),this.fire({angle:120,spread:55,origin:{x:1}})),Date.now()<o&&t>0&&(requestAnimationFrame(f),t--)};f(),await Promise.all(r)}static async realistic(){await Promise.all([this.realisticFire(.25,{spread:26,startVelocity:55}),this.realisticFire(.2,{spread:60}),this.realisticFire(.35,{spread:100,decay:.91,scalar:.8}),this.realisticFire(.1,{spread:120,startVelocity:25,decay:.92,scalar:1.2}),this.realisticFire(.1,{spread:120,startVelocity:45})])}static async fire(t){Object.assign(t,this.DEFAULTS,t),t.particleCount=t.particleCount??this.DEFAULTS.colors.length,await dn(t)}static async realisticFire(t,r){let f={origin:{y:.7}};await this.fire(Object.assign({},f,r,{particleCount:Math.floor(200*t)}))}};var si=(e,t)=>t.minValue;function ai(e,t){if(e&1&&(Ot(0,"div",7),jt(1,"safeHtml")),e&2){let r=q().$implicit;vt("innerHTML",qt(1,1,r.minValue+" Products"),At)}}function ci(e,t){if(e&1&&(Ot(0,"div",7),jt(1,"cooeeCurrency"),jt(2,"safeHtml")),e&2){let r=q().$implicit;vt("innerHTML",qt(2,3,qt(1,1,r.minValue)),At)}}function li(e,t){if(e&1&&(Mt(0,"li",6)(1,"div"),lt(2,ai,2,3,"div",7)(3,ci,3,5,"div",7),Ot(4,"img",8),Mt(5,"div",9),Dt(6),Pt()()()),e&2){let r=t.$implicit,o=q(2);be("left",r.calculatedAlignment+"%"),Y(2),ft((o.progressBarConfig==null?null:o.progressBarConfig.rewardBasis)===o.RewardBasis.ITEM_COUNT?2:3),Y(2),vt("src",o.getIconURL(r),Xt),Y(2),kr(r.label)}}function fi(e,t){if(e&1&&(Ot(0,"div",0),jt(1,"cooeeDynamicVariables"),jt(2,"safeHtml"),Mt(3,"div",1)(4,"ul",2)(5,"div",3),Ot(6,"div",4),Pt(),Ct(7,li,7,5,"li",5,si),Pt()()),e&2){let r=q(),o=r.calculatedState(),f=o.nextMilestone?o.nextMilestone.reachingText:o.lastMilestone.reachedText;vt("innerHTML",qt(2,6,Wr(1,3,f,r.localDynamicVariables())),At),Y(6),be("width",o.cartValuePercentage+"%"),Y(),It(o.milestones)}}var Pe=class e extends Qt{cart;localDynamicVariables=Wt({});calculatedState=Wt({});progressBarConfig;RewardBasis=cr;constructor(){super()}engagementTriggerReceived(t){this.progressBarConfig=t.progressBarConfig}ngOnInit(){super.ngOnInit(),this.calculateMilestonesSilently()}update(){this.calculateMilestonesSilently()}getIconURL(t){return t.rewardType===De.FREE_SHIPPING?"https://img.icons8.com/ios-filled/50/FFFFFF/free-shipping.png":t.rewardType===De.DISCOUNT?"https://img.icons8.com/ios-glyphs/30/FFFFFF/sale-price-tag.png":t.rewardType===De.FREE_AUTO_GIFT?"https://img.icons8.com/ios-filled/50/FFFFFF/gift--v1.png":""}calculateMilestonesSilently(){this.calculateMilestones().catch(t=>wt.error(t))}async calculateMilestones(){let t=this.engagementTrigger,r=this.progressBarConfig;if(!r?.milestones?.length){wt.warn("Milestones not available in progress bar config",t);return}let o=await this.cart.getNormalisedCart(),f=r.milestones.at(-1),l=r?.reachedAmountOrCount??o.originalAmount,a=r.totalProgress??0;wt.verbose("Cart value:",l,`, percentage: ${a}%`),this.celebrate(t,l);let d={milestonesReady:!0,cartValuePercentage:a,milestones:r.milestones},v=r.milestones.find(x=>!x.reached);if(v){let x=he(v.minValue-l);if(r.rewardBasis==="ITEM_COUNT"){let C=v.minValue-l;x=`${C} ${C===1?"product":"products"}`}this.localDynamicVariables.set({amount_left:x}),d.nextMilestone=v,this.calculatedState.set(d);return}d.lastMilestone=f,this.calculatedState.set(d)}celebrate(t,r){let l=[...t.progressBarConfig.milestones].reverse().find(v=>v.minValue<r);if(!l)return;let a=`lc/en/${t.shortID}/${l.minValue}`;sessionStorage.getItem(a)||(sessionStorage.setItem(a,"1"),this.progressBarConfig?.noConfetti||Le.realistic())}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-progressbar"]],inputs:{cart:"cart"},features:[gt],decls:1,vars:1,consts:[[1,"heading",3,"innerHTML"],[1,"milestone-container"],[1,"milestone-list"],[1,"untracked-path"],[1,"tracked-path"],[1,"milestone-list-item",3,"left"],[1,"milestone-list-item"],[1,"milestone-value",3,"innerHTML"],["width","20","height","20","alt","milestone icon",1,"milestone-icon",3,"src"],[1,"milestone-label"]],template:function(r,o){r&1&&lt(0,fi,9,8),r&2&&ft(o.calculatedState().milestonesReady?0:-1)},dependencies:[Ve,de,en],styles:[`:host{display:block;padding:10px;background:linear-gradient(0deg,rgba(var(--lc-primary-color),.1) 0%,transparent 100%)}.milestone-container{width:95%;margin:8px 0}.heading{font-weight:500;text-align:center;font-size:12px}.milestone-list{display:flex;align-items:center;position:relative;font-size:10px;font-weight:500}.untracked-path{width:100%;background-color:#e5e7eb;height:4px;position:absolute}.tracked-path{background-color:rgba(var(--lc-primary-color));height:100%;display:block;transition:width .5s ease-in-out}.milestone-list{padding:0;margin:0}.milestone-list-item{position:relative;display:flex;flex-direction:column;align-items:center;height:75px}.milestone-list-item>div{display:flex;flex-direction:column;align-items:center;justify-content:space-between;position:absolute;height:100%;width:100px}.milestone-icon{padding:5px;border-radius:1000px;background-color:rgba(var(--lc-primary-color))}
12
+ `],encapsulation:3})};var ui=["numberVariable"],Ue=class e extends Qt{numberSlot;savingsBarConfig;textParts=Wt({start:"",end:""});globalIntervals=[];constructor(){super()}ngAfterViewInit(){this.updateUIVars()}engagementTriggerReceived(t){this.savingsBarConfig=t.content.savingsBarConfig,this.elementRef.nativeElement.classList.add("lc_"+t.entryAnimation?.toLowerCase()),this.savingsBarConfig.iconURL&&this.elementRef.nativeElement.style.setProperty("--lc-discount-icon",this.savingsBarConfig.iconURL)}update(){this.updateUIVars()}updateUIVars(){let t=Lt(Lt({},this.engagementTrigger.getCartMagicVariables()),tn("total_savings",this.savingsBarConfig.totalSavings)),r=me(this.savingsBarConfig.text,{cart:t},this.triggerContext),o=r.match(/[\d.,]+/)?.[0];if(!o){wt.error("No amount found in text",r);return}let[f,l]=r.split(o);this.textParts.set({start:f,end:l}),this.savingsBarConfig.animateNumber?this.runAnimation(o):this.numberSlot.nativeElement.innerHTML=o}runSlotMachineAnimation(t="0"){let r=this.numberSlot.nativeElement;r.innerHTML="";let o=this.savingsBarConfig.animationDuration/t.length;this.clearPreviousIntervals();for(let f=0;f<t.length;f++){let l=document.createElement("div");l.className="digit",l.style.display="inline-block",r.appendChild(l);let a=setInterval(()=>{let d=Math.floor(Math.random()*10);l.innerHTML=`<div>${d}</div>`},50);this.globalIntervals.push(a),setTimeout(()=>{clearInterval(a);let d=t?.[f]??Math.floor(Math.random()*10);l.innerHTML=`${d}`},(f+1)*o)}}clearPreviousIntervals(){this.globalIntervals.forEach(clearInterval),this.globalIntervals=[]}runIncrementalAnimation(t){let r=performance.now(),o=f=>{let l=Math.min((f-r)/this.savingsBarConfig.animationDuration,1);this.numberSlot.nativeElement.innerHTML=Math.floor(t*l).toString(),l<1&&requestAnimationFrame(o)};requestAnimationFrame(o)}runAnimation(t){this.savingsBarConfig.animation==="SLOT_MACHINE"?this.runSlotMachineAnimation(t):this.savingsBarConfig.animation==="INCREMENTAL"&&this.runIncrementalAnimation(Number(t))}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-savings-bar"]],viewQuery:function(r,o){if(r&1&&Te(ui,5),r&2){let f;Be(f=Ae())&&(o.numberSlot=f.first)}},features:[gt],decls:6,vars:2,consts:[["numberVariable",""],[1,"container"],[1,"icon"],[1,"primary-text",3,"innerHTML"],[1,"counter-text"],[1,"final-text",3,"innerHTML"]],template:function(r,o){r&1&&(Mt(0,"div",1),Ot(1,"div",2)(2,"div",3)(3,"div",4,0)(5,"div",5),Pt()),r&2&&(Y(2),vt("innerHTML",o.textParts().start,At),Y(3),vt("innerHTML",o.textParts().end,At))},styles:[`:host{display:block}.container{white-space:pre;display:flex;justify-content:center;align-items:center;background-color:rgba(var(--lc-primary-button-bg-color, 0 162 81));color:rgba(var(--lc-primary-button-color, 255 255 255));padding:8px;border-radius:4px 4px 0 0;overflow:hidden}.container .icon{background-image:var(--lc-discount-icon, url(https://img.icons8.com/ios-glyphs/30/FFFFFF/discount--v1.png));background-position:center;background-size:cover;height:20px;width:20px;margin-right:2px}
13
13
  `],encapsulation:3})};var pi=(e,t)=>({enter:e,exit:t});function hi(e,t){if(e&1&&(rt(0,"div",7),Dt(1),nt(),rt(2,"div",8),Dt(3),nt()),e&2){let r=q(2);Y(),ue(" ",r.getCurrency(r.selectedVariant().price.cmp)," "),Y(2),ue(" ",r.getDiscountPercentage(r.selectedVariant().price),"% off ")}}function di(e,t){if(e&1&&(rt(0,"div",6),Dt(1),nt()),e&2){let r=q(2);Y(),ue(" ",r.stickyATCConfig.leftText," ")}}function mi(e,t){if(e&1&&(rt(0,"div",1)(1,"div",5),Dt(2),nt(),lt(3,hi,4,2),lt(4,di,2,1,"div",6),nt()),e&2){let r=q();Y(2),ue(" ",r.getCurrency(r.selectedVariant().price.d)," "),Y(),ft(r.selectedVariant().price.cmp?3:-1),Y(),ft(r.stickyATCConfig.leftText?4:-1)}}function gi(e,t){if(e&1&&(rt(0,"div",9),Dt(1),nt()),e&2){let r=t.$implicit,o=t.$index;q(2);let f=Jt(5);yt("ngClass",zr(2,pi,o===f.currentIndex,o===f.previousIndex)),Y(),ue(" ",r," ")}}function yi(e,t){if(e&1&&(rt(0,"div",4),Ct(1,gi,2,5,"div",9,Lr),nt()),e&2){q();let r=Jt(5);Y(),It(r.features)}}var je=class e extends Qt{currentItem;stickyATCConfig;selectedVariant=Wt(void 0);featureSlider=Wt({features:[],currentIndex:0});constructor(){super()}onVariantChange(t){this.currentItem&&(this.currentItem.setSelectedVariantByID(t.detail.variantID),this.selectedVariant.set(this.currentItem.selectedOrFirstVariant.value))}engagementTriggerReceived(t){this.stickyATCConfig=t.stickyATCConfig??{},this.currentItem=t.items[0],this.selectedVariant.set(this.currentItem.vars[0]),this.stickyATCConfig.leftText=this.replaceVariables(this.stickyATCConfig.leftText),this.stickyATCConfig.rightText=this.replaceVariables(this.stickyATCConfig.rightText),this.startFeatureRotation()}update(){}getCurrency(t){return he(t)}getDiscountPercentage(t){return((t.cmp-t.d)/t.cmp*100).toFixed(0)}async addToCart(){this.executeCTAViaRenderer({clickAction:{at:102},item:this.currentItem})}startFeatureRotation(){if(!this.stickyATCConfig.rightText)return;let t=this.stickyATCConfig.rightText.split(`
14
14
  `),r=t.length===1?null:setInterval(()=>{this.featureSlider.update(o=>Qe(Lt({},o),{previousIndex:o.currentIndex,currentIndex:(o.currentIndex+1)%o.features.length}))},3e3);this.featureSlider.set({intervalRef:r,currentIndex:0,features:t})}replaceVariables(t){return t?me(t,this.currentItem.getTemplateVariables(),this.triggerContext):""}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-sticky-atc"]],hostBindings:function(r,o){r&1&&Nt("letscooee:variant-change",function(l){return o.onVariantChange(l)},Br)},features:[gt],decls:7,vars:3,consts:[[1,"lc-wrapper"],[1,"lc-prices"],[1,"lc-button-wrapper"],["type","button",1,"lc-button","lc-button-atc",3,"click"],[1,"lc-features"],[1,"lc-sale-price"],[1,"lc-additional-text"],[1,"lc-compare-price"],[1,"lc-discount-label"],[1,"lc-feature",3,"ngClass"]],template:function(r,o){if(r&1){let f=Yt();rt(0,"div",0),lt(1,mi,5,3,"div",1),rt(2,"div",2)(3,"button",3),Nt("click",function(){return at(f),ct(o.addToCart())}),Dt(4,"Add To Cart"),nt(),xe(5),lt(6,yi,3,0,"div",4),nt()()}if(r&2){Y(),ft(o.selectedVariant()&&o.stickyATCConfig.showProductInfo?1:-1),Y(4);let f=re(o.featureSlider());Y(),ft(f.features.length?6:-1)}},dependencies:[Me],styles:[`:host{display:flex;justify-content:center;padding:10px;background-color:#fff;width:100%;box-shadow:4px 0 10px #0006;line-height:normal}.lc-wrapper{display:flex;justify-content:space-between;align-items:center;gap:8px;max-width:1100px;width:100%}.lc-prices{flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:6px}@media (min-width: 768px){.lc-prices{gap:8px}}.lc-sale-price{font-size:24px;font-weight:600}.lc-compare-price{font-size:18px;font-weight:600;color:red;text-decoration:line-through}.lc-discount-label{font-size:12px;font-weight:500;color:green}.lc-button-wrapper{flex:1 1 100%;display:flex;flex-direction:column;gap:4px;align-items:center}.lc-button{background-color:#000;color:#fff;opacity:1;pointer-events:auto;border-radius:4px;min-width:150px;width:100%;padding:8px}.lc-additional-text,.lc-feature{font-size:12px;color:#666}.lc-features{position:relative;overflow:hidden;height:16px;text-align:center;width:100%}.lc-features .lc-feature{position:absolute;width:100%;opacity:0;transform:translateY(100%);transition:transform .5s ease,opacity .5s ease}.lc-features .lc-feature.enter{opacity:1;transform:translateY(0);z-index:2}.lc-features .lc-feature.exit{opacity:0;transform:translateY(-100%);z-index:1}
15
- `],encapsulation:3})};function vi(e,t){return t={exports:{}},e(t,t.exports),t.exports}var wi=Ei,_i=Ci,bi=Ni,kt=[],Bt=[],xi=typeof Uint8Array<"u"?Uint8Array:Array,fr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oe=0,mn=fr.length;oe<mn;++oe)kt[oe]=fr[oe],Bt[fr.charCodeAt(oe)]=oe;var oe,mn;Bt[45]=62;Bt[95]=63;function An(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function Ei(e){var t=An(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Si(e,t,r){return(t+r)*3/4-r}function Ci(e){var t,r=An(e),o=r[0],f=r[1],l=new xi(Si(e,o,f)),a=0,d=f>0?o-4:o,v;for(v=0;v<d;v+=4)t=Bt[e.charCodeAt(v)]<<18|Bt[e.charCodeAt(v+1)]<<12|Bt[e.charCodeAt(v+2)]<<6|Bt[e.charCodeAt(v+3)],l[a++]=t>>16&255,l[a++]=t>>8&255,l[a++]=t&255;return f===2&&(t=Bt[e.charCodeAt(v)]<<2|Bt[e.charCodeAt(v+1)]>>4,l[a++]=t&255),f===1&&(t=Bt[e.charCodeAt(v)]<<10|Bt[e.charCodeAt(v+1)]<<4|Bt[e.charCodeAt(v+2)]>>2,l[a++]=t>>8&255,l[a++]=t&255),l}function Ii(e){return kt[e>>18&63]+kt[e>>12&63]+kt[e>>6&63]+kt[e&63]}function Oi(e,t,r){for(var o,f=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),f.push(Ii(o));return f.join("")}function Ni(e){for(var t,r=e.length,o=r%3,f=[],l=16383,a=0,d=r-o;a<d;a+=l)f.push(Oi(e,a,a+l>d?d:a+l));return o===1?(t=e[r-1],f.push(kt[t>>2]+kt[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],f.push(kt[t>>10]+kt[t>>4&63]+kt[t<<2&63]+"=")),f.join("")}var ur={byteLength:wi,toByteArray:_i,fromByteArray:bi};var Ti=function(t,r,o,f,l){var a,d,v=l*8-f-1,x=(1<<v)-1,C=x>>1,S=-7,I=o?l-1:0,z=o?-1:1,L=t[r+I];for(I+=z,a=L&(1<<-S)-1,L>>=-S,S+=v;S>0;a=a*256+t[r+I],I+=z,S-=8);for(d=a&(1<<-S)-1,a>>=-S,S+=f;S>0;d=d*256+t[r+I],I+=z,S-=8);if(a===0)a=1-C;else{if(a===x)return d?NaN:(L?-1:1)*(1/0);d=d+Math.pow(2,f),a=a-C}return(L?-1:1)*d*Math.pow(2,a-f)},Bi=function(t,r,o,f,l,a){var d,v,x,C=a*8-l-1,S=(1<<C)-1,I=S>>1,z=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=f?0:a-1,J=f?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(v=isNaN(r)?1:0,d=S):(d=Math.floor(Math.log(r)/Math.LN2),r*(x=Math.pow(2,-d))<1&&(d--,x*=2),d+I>=1?r+=z/x:r+=z*Math.pow(2,1-I),r*x>=2&&(d++,x/=2),d+I>=S?(v=0,d=S):d+I>=1?(v=(r*x-1)*Math.pow(2,l),d=d+I):(v=r*Math.pow(2,I-1)*Math.pow(2,l),d=0));l>=8;t[o+L]=v&255,L+=J,v/=256,l-=8);for(d=d<<l|v,C+=l;C>0;t[o+L]=d&255,L+=J,d/=256,C-=8);t[o+L-J]|=k*128},ye={read:Ti,write:Bi},He=vi(function(e,t){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=et,t.INSPECT_MAX_BYTES=50;var o=2147483647;t.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=f(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{var s=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(s,n),s.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function l(s){if(s>o)throw new RangeError('The value "'+s+'" is invalid for option "size"');var n=new Uint8Array(s);return Object.setPrototypeOf(n,a.prototype),n}function a(s,n,i){if(typeof s=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(s)}return d(s,n,i)}a.poolSize=8192;function d(s,n,i){if(typeof s=="string")return S(s,n);if(ArrayBuffer.isView(s))return z(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s));if(U(s,ArrayBuffer)||s&&U(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(U(s,SharedArrayBuffer)||s&&U(s.buffer,SharedArrayBuffer)))return L(s,n,i);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var c=s.valueOf&&s.valueOf();if(c!=null&&c!==s)return a.from(c,n,i);var h=J(s);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return a.from(s[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s))}a.from=function(s,n,i){return d(s,n,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function v(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function x(s,n,i){return v(s),s<=0?l(s):n!==void 0?typeof i=="string"?l(s).fill(n,i):l(s).fill(n):l(s)}a.alloc=function(s,n,i){return x(s,n,i)};function C(s){return v(s),l(s<0?0:k(s)|0)}a.allocUnsafe=function(s){return C(s)},a.allocUnsafeSlow=function(s){return C(s)};function S(s,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=X(s,n)|0,c=l(i),h=c.write(s,n);return h!==i&&(c=c.slice(0,h)),c}function I(s){for(var n=s.length<0?0:k(s.length)|0,i=l(n),c=0;c<n;c+=1)i[c]=s[c]&255;return i}function z(s){if(U(s,Uint8Array)){var n=new Uint8Array(s);return L(n.buffer,n.byteOffset,n.byteLength)}return I(s)}function L(s,n,i){if(n<0||s.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');var c;return n===void 0&&i===void 0?c=new Uint8Array(s):i===void 0?c=new Uint8Array(s,n):c=new Uint8Array(s,n,i),Object.setPrototypeOf(c,a.prototype),c}function J(s){if(a.isBuffer(s)){var n=k(s.length)|0,i=l(n);return i.length===0||s.copy(i,0,0,n),i}if(s.length!==void 0)return typeof s.length!="number"||j(s.length)?l(0):I(s);if(s.type==="Buffer"&&Array.isArray(s.data))return I(s.data)}function k(s){if(s>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return s|0}function et(s){return+s!=s&&(s=0),a.alloc(+s)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,i){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),U(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(n)||!a.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;for(var c=n.length,h=i.length,y=0,_=Math.min(c,h);y<_;++y)if(n[y]!==i[y]){c=n[y],h=i[y];break}return c<h?-1:h<c?1:0},a.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);var c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;var h=a.allocUnsafe(i),y=0;for(c=0;c<n.length;++c){var _=n[c];if(U(_,Uint8Array))y+_.length>h.length?a.from(_).copy(h,y):Uint8Array.prototype.set.call(h,_,y);else if(a.isBuffer(_))_.copy(h,y);else throw new TypeError('"list" argument must be an Array of Buffers');y+=_.length}return h};function X(s,n){if(a.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||U(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(s));var i=s.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&i===0)return 0;for(var h=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return N(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return P(s).length;default:if(h)return c?-1:N(s).length;n=(""+n).toLowerCase(),h=!0}}a.byteLength=X;function K(s,n,i){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(s||(s="utf8");;)switch(s){case"hex":return b(this,n,i);case"utf8":case"utf-8":return xt(this,n,i);case"ascii":return g(this,n,i);case"latin1":case"binary":return m(this,n,i);case"base64":return wt(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),c=!0}}a.prototype._isBuffer=!0;function T(s,n,i){var c=s[n];s[n]=s[i],s[i]=c}a.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<n;i+=2)T(this,i,i+1);return this},a.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<n;i+=4)T(this,i,i+3),T(this,i+1,i+2);return this},a.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<n;i+=8)T(this,i,i+7),T(this,i+1,i+6),T(this,i+2,i+5),T(this,i+3,i+4);return this},a.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?xt(this,0,n):K.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(n){if(!a.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:a.compare(this,n)===0},a.prototype.inspect=function(){var n="",i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(n,i,c,h,y){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(n));if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),h===void 0&&(h=0),y===void 0&&(y=this.length),i<0||c>n.length||h<0||y>this.length)throw new RangeError("out of range index");if(h>=y&&i>=c)return 0;if(h>=y)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,h>>>=0,y>>>=0,this===n)return 0;for(var _=y-h,H=c-i,Z=Math.min(_,H),W=this.slice(h,y),Q=n.slice(i,c),tt=0;tt<Z;++tt)if(W[tt]!==Q[tt]){_=W[tt],H=Q[tt];break}return _<H?-1:H<_?1:0};function it(s,n,i,c,h){if(s.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,j(i)&&(i=h?0:s.length-1),i<0&&(i=s.length+i),i>=s.length){if(h)return-1;i=s.length-1}else if(i<0)if(h)i=0;else return-1;if(typeof n=="string"&&(n=a.from(n,c)),a.isBuffer(n))return n.length===0?-1:ht(s,n,i,c,h);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(s,n,i):Uint8Array.prototype.lastIndexOf.call(s,n,i):ht(s,[n],i,c,h);throw new TypeError("val must be string, number or Buffer")}function ht(s,n,i,c,h){var y=1,_=s.length,H=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(s.length<2||n.length<2)return-1;y=2,_/=2,H/=2,i/=2}function Z(Ft,zt){return y===1?Ft[zt]:Ft.readUInt16BE(zt*y)}var W;if(h){var Q=-1;for(W=i;W<_;W++)if(Z(s,W)===Z(n,Q===-1?0:W-Q)){if(Q===-1&&(Q=W),W-Q+1===H)return Q*y}else Q!==-1&&(W-=W-Q),Q=-1}else for(i+H>_&&(i=_-H),W=i;W>=0;W--){for(var tt=!0,st=0;st<H;st++)if(Z(s,W+st)!==Z(n,st)){tt=!1;break}if(tt)return W}return-1}a.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},a.prototype.indexOf=function(n,i,c){return it(this,n,i,c,!0)},a.prototype.lastIndexOf=function(n,i,c){return it(this,n,i,c,!1)};function bt(s,n,i,c){i=Number(i)||0;var h=s.length-i;c?(c=Number(c),c>h&&(c=h)):c=h;var y=n.length;c>y/2&&(c=y/2);for(var _=0;_<c;++_){var H=parseInt(n.substr(_*2,2),16);if(j(H))return _;s[i+_]=H}return _}function Zt(s,n,i,c){return F(N(n,s.length-i),s,i,c)}function Rt(s,n,i,c){return F(R(n),s,i,c)}function Gt(s,n,i,c){return F(P(n),s,i,c)}function Ht(s,n,i,c){return F(B(n,s.length-i),s,i,c)}a.prototype.write=function(n,i,c,h){if(i===void 0)h="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")h=i,c=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(c)?(c=c>>>0,h===void 0&&(h="utf8")):(h=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var y=this.length-i;if((c===void 0||c>y)&&(c=y),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");h||(h="utf8");for(var _=!1;;)switch(h){case"hex":return bt(this,n,i,c);case"utf8":case"utf-8":return Zt(this,n,i,c);case"ascii":case"latin1":case"binary":return Rt(this,n,i,c);case"base64":return Gt(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ht(this,n,i,c);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(""+h).toLowerCase(),_=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function wt(s,n,i){return n===0&&i===s.length?ur.fromByteArray(s):ur.fromByteArray(s.slice(n,i))}function xt(s,n,i){i=Math.min(s.length,i);for(var c=[],h=n;h<i;){var y=s[h],_=null,H=y>239?4:y>223?3:y>191?2:1;if(h+H<=i){var Z,W,Q,tt;switch(H){case 1:y<128&&(_=y);break;case 2:Z=s[h+1],(Z&192)===128&&(tt=(y&31)<<6|Z&63,tt>127&&(_=tt));break;case 3:Z=s[h+1],W=s[h+2],(Z&192)===128&&(W&192)===128&&(tt=(y&15)<<12|(Z&63)<<6|W&63,tt>2047&&(tt<55296||tt>57343)&&(_=tt));break;case 4:Z=s[h+1],W=s[h+2],Q=s[h+3],(Z&192)===128&&(W&192)===128&&(Q&192)===128&&(tt=(y&15)<<18|(Z&63)<<12|(W&63)<<6|Q&63,tt>65535&&tt<1114112&&(_=tt))}}_===null?(_=65533,H=1):_>65535&&(_-=65536,c.push(_>>>10&1023|55296),_=56320|_&1023),c.push(_),h+=H}return Et(c)}var dt=4096;function Et(s){var n=s.length;if(n<=dt)return String.fromCharCode.apply(String,s);for(var i="",c=0;c<n;)i+=String.fromCharCode.apply(String,s.slice(c,c+=dt));return i}function g(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]&127);return c}function m(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]);return c}function b(s,n,i){var c=s.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);for(var h="",y=n;y<i;++y)h+=$[s[y]];return h}function w(s,n,i){for(var c=s.slice(n,i),h="",y=0;y<c.length-1;y+=2)h+=String.fromCharCode(c[y]+c[y+1]*256);return h}a.prototype.slice=function(n,i){var c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);var h=this.subarray(n,i);return Object.setPrototypeOf(h,a.prototype),h};function u(s,n,i){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+n>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return h},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n+--i],y=1;i>0&&(y*=256);)h+=this[n+--i]*y;return h},a.prototype.readUint8=a.prototype.readUInt8=function(n,i){return n=n>>>0,i||u(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||u(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||u(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||u(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return y*=128,h>=y&&(h-=Math.pow(2,8*i)),h},a.prototype.readIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=i,y=1,_=this[n+--h];h>0&&(y*=256);)_+=this[n+--h]*y;return y*=128,_>=y&&(_-=Math.pow(2,8*i)),_},a.prototype.readInt8=function(n,i){return n=n>>>0,i||u(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,i){n=n>>>0,i||u(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},a.prototype.readInt16BE=function(n,i){n=n>>>0,i||u(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},a.prototype.readInt32LE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readFloatLE=function(n,i){return n=n>>>0,i||u(n,4,this.length),ye.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,i){return n=n>>>0,i||u(n,4,this.length),ye.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||u(n,8,this.length),ye.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||u(n,8,this.length),ye.read(this,n,!1,52,8)};function p(s,n,i,c,h,y){if(!a.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>h||n<y)throw new RangeError('"value" argument is out of bounds');if(i+c>s.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;p(this,n,i,c,y,0)}var _=1,H=0;for(this[i]=n&255;++H<c&&(_*=256);)this[i+H]=n/_&255;return i+c},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;p(this,n,i,c,y,0)}var _=c-1,H=1;for(this[i+_]=n&255;--_>=0&&(H*=256);)this[i+_]=n/H&255;return i+c},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,1,255,0),this[i]=n&255,i+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},a.prototype.writeIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);p(this,n,i,c,y-1,-y)}var _=0,H=1,Z=0;for(this[i]=n&255;++_<c&&(H*=256);)n<0&&Z===0&&this[i+_-1]!==0&&(Z=1),this[i+_]=(n/H>>0)-Z&255;return i+c},a.prototype.writeIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);p(this,n,i,c,y-1,-y)}var _=c-1,H=1,Z=0;for(this[i+_]=n&255;--_>=0&&(H*=256);)n<0&&Z===0&&this[i+_+1]!==0&&(Z=1),this[i+_]=(n/H>>0)-Z&255;return i+c},a.prototype.writeInt8=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},a.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},a.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function E(s,n,i,c,h,y){if(i+c>s.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(s,n,i,c,h){return n=+n,i=i>>>0,h||E(s,n,i,4),ye.write(s,n,i,c,23,4),i+4}a.prototype.writeFloatLE=function(n,i,c){return O(this,n,i,!0,c)},a.prototype.writeFloatBE=function(n,i,c){return O(this,n,i,!1,c)};function A(s,n,i,c,h){return n=+n,i=i>>>0,h||E(s,n,i,8),ye.write(s,n,i,c,52,8),i+8}a.prototype.writeDoubleLE=function(n,i,c){return A(this,n,i,!0,c)},a.prototype.writeDoubleBE=function(n,i,c){return A(this,n,i,!1,c)},a.prototype.copy=function(n,i,c,h){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(c||(c=0),!h&&h!==0&&(h=this.length),i>=n.length&&(i=n.length),i||(i=0),h>0&&h<c&&(h=c),h===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("sourceEnd out of bounds");h>this.length&&(h=this.length),n.length-i<h-c&&(h=n.length-i+c);var y=h-c;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,c,h):Uint8Array.prototype.set.call(n,this.subarray(c,h),i),y},a.prototype.fill=function(n,i,c,h){if(typeof n=="string"){if(typeof i=="string"?(h=i,i=0,c=this.length):typeof c=="string"&&(h=c,c=this.length),h!==void 0&&typeof h!="string")throw new TypeError("encoding must be a string");if(typeof h=="string"&&!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);if(n.length===1){var y=n.charCodeAt(0);(h==="utf8"&&y<128||h==="latin1")&&(n=y)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var _;if(typeof n=="number")for(_=i;_<c;++_)this[_]=n;else{var H=a.isBuffer(n)?n:a.from(n,h),Z=H.length;if(Z===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(_=0;_<c-i;++_)this[_+i]=H[_%Z]}return this};var M=/[^+/0-9A-Za-z-_]/g;function V(s){if(s=s.split("=")[0],s=s.trim().replace(M,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function N(s,n){n=n||1/0;for(var i,c=s.length,h=null,y=[],_=0;_<c;++_){if(i=s.charCodeAt(_),i>55295&&i<57344){if(!h){if(i>56319){(n-=3)>-1&&y.push(239,191,189);continue}else if(_+1===c){(n-=3)>-1&&y.push(239,191,189);continue}h=i;continue}if(i<56320){(n-=3)>-1&&y.push(239,191,189),h=i;continue}i=(h-55296<<10|i-56320)+65536}else h&&(n-=3)>-1&&y.push(239,191,189);if(h=null,i<128){if((n-=1)<0)break;y.push(i)}else if(i<2048){if((n-=2)<0)break;y.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;y.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;y.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return y}function R(s){for(var n=[],i=0;i<s.length;++i)n.push(s.charCodeAt(i)&255);return n}function B(s,n){for(var i,c,h,y=[],_=0;_<s.length&&!((n-=2)<0);++_)i=s.charCodeAt(_),c=i>>8,h=i%256,y.push(h),y.push(c);return y}function P(s){return ur.toByteArray(V(s))}function F(s,n,i,c){for(var h=0;h<c&&!(h+i>=n.length||h>=s.length);++h)n[h+i]=s[h];return h}function U(s,n){return s instanceof n||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===n.name}function j(s){return s!==s}var $=(function(){for(var s="0123456789abcdef",n=new Array(256),i=0;i<16;++i)for(var c=i*16,h=0;h<16;++h)n[c+h]=s[i]+s[h];return n})()}),G=He.Buffer;He.SlowBuffer;He.INSPECT_MAX_BYTES;He.kMaxLength;var gr=function(t,r){return gr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,f){o.__proto__=f}||function(o,f){for(var l in f)f.hasOwnProperty(l)&&(o[l]=f[l])},gr(t,r)};function ze(e,t){gr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ae=(function(e){ze(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t})(Error),ot=(function(e){ze(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t})(TypeError);function $e(e){return e&&e.Math==Math&&e}function Mn(){return $e(typeof globalThis=="object"&&globalThis)||$e(typeof window=="object"&&window)||$e(typeof self=="object"&&self)||$e(typeof global=="object"&&global)||Function("return this")()}function Ai(){var e=Mn();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var Mi=function(t){var r=Ai()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var o=G.alloc(t),f=0;f<t;++f)o[f]=Math.floor(Math.random()*256);return o},Di=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(G.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(G.alloc(t))}:Mi}},Dn=Di();function Ri(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function vr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function Fi(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Vi(e){return Ie(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Ie(e){return typeof e=="object"&&e!==null}function We(e,t){var r=!1;function o(){for(var f=[],l=0;l<arguments.length;l++)f[l]=arguments[l];return r||(console.warn(t),r=!0),e.apply(this,f)}return o}function ke(e){if(ArrayBuffer.isView(e))return G.from(e.buffer,e.byteOffset,e.byteLength);if(Ri(e))return G.from(e);throw new ot("Must use either Buffer or TypedArray")}var Li=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Rn=function(e){return typeof e=="string"&&Li.test(e)},yr=function(e){if(!Rn(e))throw new ot('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return G.from(t,"hex")},gn=function(e,t){return t===void 0&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")};var Ws=Math.pow(2,63)-1,Ys=-Math.pow(2,63),Pi=Math.pow(2,53),Ui=-Math.pow(2,53);var Fn=4;var ce=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new ot("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=G.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=G.from(t,"binary"):Array.isArray(t)?this.buffer=G.from(t):this.buffer=ke(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new ot("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new ot("only accepts single character Uint8Array or Array");var r;if(typeof t=="string"?r=t.charCodeAt(0):typeof t=="number"?r=t:r=t[0],r<0||r>255)throw new ot("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var o=G.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=r}},e.prototype.write=function(t,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+t.length){var o=G.alloc(this.buffer.length+t.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o}ArrayBuffer.isView(t)?(this.buffer.set(ke(t),r),this.position=r+t.byteLength>this.position?r+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,r,t.length,"binary"),this.position=r+t.length>this.position?r+t.length:this.position)},e.prototype.read=function(t,r){return r=r&&r>0?r:this.position,this.buffer.slice(t,t+r)},e.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(t){return this.buffer.toString(t)},e.prototype.toExtendedJSON=function(t){t=t||{};var r=this.buffer.toString("base64"),o=Number(this.sub_type).toString(16);return t.legacy?{$binary:r,$type:o.length===1?"0"+o:o}:{$binary:{base64:r,subType:o.length===1?"0"+o:o}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new yn(this.buffer.slice(0,this.position));throw new ae('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){r=r||{};var o,f;if("$binary"in t?r.legacy&&typeof t.$binary=="string"&&"$type"in t?(f=t.$type?parseInt(t.$type,16):0,o=G.from(t.$binary,"base64")):typeof t.$binary!="string"&&(f=t.$binary.subType?parseInt(t.$binary.subType,16):0,o=G.from(t.$binary.base64,"base64")):"$uuid"in t&&(f=4,o=yr(t.$uuid)),!o)throw new ot("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return f===Fn?new yn(o):new e(o,f)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e})();Object.defineProperty(ce.prototype,"_bsontype",{value:"Binary"});var pr=16,yn=(function(e){ze(t,e);function t(r){var o=this,f,l;if(r==null)f=t.generate();else if(r instanceof t)f=G.from(r.buffer),l=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===pr)f=ke(r);else if(typeof r=="string")f=yr(r);else throw new ot("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return o=e.call(this,f,Fn)||this,o.__id=l,o}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,t.cacheHexString&&(this.__id=gn(r))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(r){if(r===void 0&&(r=!0),t.cacheHexString&&this.__id)return this.__id;var o=gn(this.id,r);return t.cacheHexString&&(this.__id=o),o},t.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(r){if(!r)return!1;if(r instanceof t)return r.id.equals(this.id);try{return new t(r).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new ce(this.id,ce.SUBTYPE_UUID)},t.generate=function(){var r=Dn(pr);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,G.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?Rn(r):vr(r)?r.length!==pr?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var o=yr(r);return new t(o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t})(ce),Ye=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},e})();Object.defineProperty(Ye.prototype,"_bsontype",{value:"Code"});function ji(e){return Ie(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Se=(function(){function e(t,r,o,f){if(!(this instanceof e))return new e(t,r,o,f);var l=t.split(".");l.length===2&&(o=l.shift(),t=l.shift()),this.collection=t,this.oid=r,this.db=o,this.fields=f||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},e.prototype.toExtendedJSON=function(t){t=t||{};var r={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e})();Object.defineProperty(Se.prototype,"_bsontype",{value:"DBRef"});var Tt=void 0;try{Tt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var vn=65536,$i=1<<24,we=vn*vn,Vn=we*we,wn=Vn/2,_n={},bn={},D=(function(){function e(t,r,o){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,r,o);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!r)):typeof t=="string"?Object.assign(this,e.fromString(t,!!r)):(this.low=t|0,this.high=r|0,this.unsigned=!!o),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,o){return new e(t,r,o)},e.fromInt=function(t,r){var o,f,l;return r?(t>>>=0,(l=0<=t&&t<256)&&(f=bn[t],f)?f:(o=e.fromBits(t,(t|0)<0?-1:0,!0),l&&(bn[t]=o),o)):(t|=0,(l=-128<=t&&t<128)&&(f=_n[t],f)?f:(o=e.fromBits(t,t<0?-1:0,!1),l&&(_n[t]=o),o))},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=Vn)return e.MAX_UNSIGNED_VALUE}else{if(t<=-wn)return e.MIN_VALUE;if(t+1>=wn)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%we|0,t/we|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,o){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof r=="number"?(o=r,r=!1):r=!!r,o=o||10,o<2||36<o)throw RangeError("radix");var f;if((f=t.indexOf("-"))>0)throw Error("interior hyphen");if(f===0)return e.fromString(t.substring(1),r,o).neg();for(var l=e.fromNumber(Math.pow(o,8)),a=e.ZERO,d=0;d<t.length;d+=8){var v=Math.min(8,t.length-d),x=parseInt(t.substring(d,d+v),o);if(v<8){var C=e.fromNumber(Math.pow(o,v));a=a.mul(C).add(e.fromNumber(x))}else a=a.mul(l),a=a.add(e.fromNumber(x))}return a.unsigned=r,a},e.fromBytes=function(t,r,o){return o?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(t){return Ie(t)&&t.__isLong__===!0},e.fromValue=function(t,r){return typeof t=="number"?e.fromNumber(t,r):typeof t=="string"?e.fromString(t,r):e.fromBits(t.low,t.high,typeof r=="boolean"?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,o=this.high&65535,f=this.low>>>16,l=this.low&65535,a=t.high>>>16,d=t.high&65535,v=t.low>>>16,x=t.low&65535,C=0,S=0,I=0,z=0;return z+=l+x,I+=z>>>16,z&=65535,I+=f+v,S+=I>>>16,I&=65535,S+=o+d,C+=S>>>16,S&=65535,C+=r+a,C&=65535,e.fromBits(I<<16|z,C<<16|S,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),o=t.isNegative();return r&&!o?-1:!r&&o?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(t){return this.compare(t)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(Tt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Tt.div_u:Tt.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var o,f,l;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;l=e.UZERO}else{if(this.eq(e.MIN_VALUE)){if(t.eq(e.ONE)||t.eq(e.NEG_ONE))return e.MIN_VALUE;if(t.eq(e.MIN_VALUE))return e.ONE;var a=this.shr(1);return o=a.div(t).shl(1),o.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(f=this.sub(t.mul(o)),l=o.add(f.div(t)),l)}else if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();l=e.ZERO}for(f=this;f.gte(t);){o=Math.max(1,Math.floor(f.toNumber()/t.toNumber()));for(var d=Math.ceil(Math.log(o)/Math.LN2),v=d<=48?1:Math.pow(2,d-48),x=e.fromNumber(o),C=x.mul(t);C.isNegative()||C.gt(f);)o-=v,x=e.fromNumber(o,this.unsigned),C=x.mul(t);x.isZero()&&(x=e.ONE),l=l.add(x),f=f.sub(C)}return l},e.prototype.div=function(t){return this.divide(t)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},e.prototype.eq=function(t){return this.equals(t)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(t&1<<r)===0;r--);return this.high!==0?r+33:r+1},e.prototype.greaterThan=function(t){return this.comp(t)>0},e.prototype.gt=function(t){return this.greaterThan(t)},e.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},e.prototype.gte=function(t){return this.greaterThanOrEqual(t)},e.prototype.ge=function(t){return this.greaterThanOrEqual(t)},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.lessThan=function(t){return this.comp(t)<0},e.prototype.lt=function(t){return this.lessThan(t)},e.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},e.prototype.lte=function(t){return this.lessThanOrEqual(t)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),Tt){var r=(this.unsigned?Tt.rem_u:Tt.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(t){return this.modulo(t)},e.prototype.rem=function(t){return this.modulo(t)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),Tt){var r=Tt.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var o=this.high>>>16,f=this.high&65535,l=this.low>>>16,a=this.low&65535,d=t.high>>>16,v=t.high&65535,x=t.low>>>16,C=t.low&65535,S=0,I=0,z=0,L=0;return L+=a*C,z+=L>>>16,L&=65535,z+=l*C,I+=z>>>16,z&=65535,z+=a*x,I+=z>>>16,z&=65535,I+=f*C,S+=I>>>16,I&=65535,I+=l*x,S+=I>>>16,I&=65535,I+=a*v,S+=I>>>16,I&=65535,S+=o*C+f*x+l*v+a*d,S&=65535,e.fromBits(z<<16|L,S<<16|I,this.unsigned)},e.prototype.mul=function(t){return this.multiply(t)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(t){return!this.equals(t)},e.prototype.neq=function(t){return this.notEquals(t)},e.prototype.ne=function(t){return this.notEquals(t)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(t){return this.shiftLeft(t)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(t){return this.shiftRight(t)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var r=this.high;if(t<32){var o=this.low;return e.fromBits(o>>>t|r<<32-t,r>>>t,this.unsigned)}else return t===32?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},e.prototype.shru=function(t){return this.shiftRightUnsigned(t)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(t){return this.subtract(t)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*we+(this.low>>>0):this.high*we+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),o=this.div(r),f=o.mul(r).sub(this);return o.toString(t)+f.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var l=e.fromNumber(Math.pow(t,6),this.unsigned),a=this,d="";;){var v=a.div(l),x=a.sub(v.mul(l)).toInt()>>>0,C=x.toString(t);if(a=v,a.isZero())return C+d;for(;C.length<6;)C="0"+C;d=""+C+d}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(t){return this.lessThanOrEqual(t)},e.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var o=e.fromString(t.$numberLong);return r&&r.relaxed?o.toNumber():o},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt($i),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e})();Object.defineProperty(D.prototype,"__isLong__",{value:!0});Object.defineProperty(D.prototype,"_bsontype",{value:"Long"});var ki=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Hi=/^(\+|-)?(Infinity|inf)$/i,zi=/^(\+|-)?NaN$/i,Ee=6111,hr=-6176,xn=6176,Wi=34,dr=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),En=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Sn=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Yi=/^([-+])?(\d+)?$/,Ji=31,Cn=16383,qi=30,Zi=31;function In(e){return!isNaN(parseInt(e,10))}function Gi(e){var t=D.fromNumber(1e9),r=D.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(var o=0;o<=3;o++)r=r.shiftLeft(32),r=r.add(new D(e.parts[o],0)),e.parts[o]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function Xi(e,t){if(!e&&!t)return{high:D.fromNumber(0),low:D.fromNumber(0)};var r=e.shiftRightUnsigned(32),o=new D(e.getLowBits(),0),f=t.shiftRightUnsigned(32),l=new D(t.getLowBits(),0),a=r.multiply(f),d=r.multiply(l),v=o.multiply(f),x=o.multiply(l);return a=a.add(d.shiftRightUnsigned(32)),d=new D(d.getLowBits(),0).add(v).add(x.shiftRightUnsigned(32)),a=a.add(d.shiftRightUnsigned(32)),x=d.shiftLeft(32).add(new D(x.getLowBits(),0)),{high:a,low:x}}function Ki(e,t){var r=e.high>>>0,o=t.high>>>0;if(r<o)return!0;if(r===o){var f=e.low>>>0,l=t.low>>>0;if(f<l)return!0}return!1}function ve(e,t){throw new ot('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var wr=(function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(vr(t)){if(t.byteLength!==16)throw new ot("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new ot("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var r=!1,o=!1,f=!1,l=0,a=0,d=0,v=0,x=0,C=[0],S=0,I=0,z=0,L=0,J=0,k=0,et=new D(0,0),X=new D(0,0),K=0,T=0;if(t.length>=7e3)throw new ot(""+t+" not a valid Decimal128 string");var it=t.match(ki),ht=t.match(Hi),bt=t.match(zi);if(!it&&!ht&&!bt||t.length===0)throw new ot(""+t+" not a valid Decimal128 string");if(it){var Zt=it[2],Rt=it[4],Gt=it[5],Ht=it[6];Rt&&Ht===void 0&&ve(t,"missing exponent power"),Rt&&Zt===void 0&&ve(t,"missing exponent base"),Rt===void 0&&(Gt||Ht)&&ve(t,"missing e before exponent")}if((t[T]==="+"||t[T]==="-")&&(r=t[T++]==="-"),!In(t[T])&&t[T]!=="."){if(t[T]==="i"||t[T]==="I")return new e(G.from(r?En:Sn));if(t[T]==="N")return new e(G.from(dr))}for(;In(t[T])||t[T]===".";){if(t[T]==="."){o&&ve(t,"contains multiple periods"),o=!0,T=T+1;continue}S<34&&(t[T]!=="0"||f)&&(f||(x=a),f=!0,C[I++]=parseInt(t[T],10),S=S+1),f&&(d=d+1),o&&(v=v+1),a=a+1,T=T+1}if(o&&!a)throw new ot(""+t+" not a valid Decimal128 string");if(t[T]==="e"||t[T]==="E"){var wt=t.substr(++T).match(Yi);if(!wt||!wt[2])return new e(G.from(dr));J=parseInt(wt[0],10),T=T+wt[0].length}if(t[T])return new e(G.from(dr));if(z=0,!S)z=0,L=0,C[0]=0,d=1,S=1,l=0;else if(L=S-1,l=d,l!==1)for(;C[x+l-1]===0;)l=l-1;for(J<=v&&v-J>16384?J=hr:J=J-v;J>Ee;){if(L=L+1,L-z>Wi){var xt=C.join("");if(xt.match(/^0+$/)){J=Ee;break}ve(t,"overflow")}J=J-1}for(;J<hr||S<d;){if(L===0&&l<S){J=hr,l=0;break}if(S<d?d=d-1:L=L-1,J<Ee)J=J+1;else{var xt=C.join("");if(xt.match(/^0+$/)){J=Ee;break}ve(t,"overflow")}}if(L-z+1<l){var dt=a;o&&(x=x+1,dt=dt+1),r&&(x=x+1,dt=dt+1);var Et=parseInt(t[x+L+1],10),g=0;if(Et>=5&&(g=1,Et===5)){for(g=C[L]%2===1?1:0,k=x+L+2;k<dt;k++)if(parseInt(t[k],10)){g=1;break}}if(g){for(var m=L;m>=0;m--)if(++C[m]>9&&(C[m]=0,m===0))if(J<Ee)J=J+1,C[m]=1;else return new e(G.from(r?En:Sn))}}if(et=D.fromNumber(0),X=D.fromNumber(0),l===0)et=D.fromNumber(0),X=D.fromNumber(0);else if(L-z<17){var m=z;for(X=D.fromNumber(C[m++]),et=new D(0,0);m<=L;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}else{var m=z;for(et=D.fromNumber(C[m++]);m<=L-17;m++)et=et.multiply(D.fromNumber(10)),et=et.add(D.fromNumber(C[m]));for(X=D.fromNumber(C[m++]);m<=L;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}var b=Xi(et,D.fromString("100000000000000000"));b.low=b.low.add(X),Ki(b.low,X)&&(b.high=b.high.add(D.fromNumber(1))),K=J+xn;var w={low:D.fromNumber(0),high:D.fromNumber(0)};b.high.shiftRightUnsigned(49).and(D.fromNumber(1)).equals(D.fromNumber(1))?(w.high=w.high.or(D.fromNumber(3).shiftLeft(61)),w.high=w.high.or(D.fromNumber(K).and(D.fromNumber(16383).shiftLeft(47))),w.high=w.high.or(b.high.and(D.fromNumber(0x7fffffffffff)))):(w.high=w.high.or(D.fromNumber(K&16383).shiftLeft(49)),w.high=w.high.or(b.high.and(D.fromNumber(562949953421311)))),w.low=b.low,r&&(w.high=w.high.or(D.fromString("9223372036854775808")));var u=G.alloc(16);return T=0,u[T++]=w.low.low&255,u[T++]=w.low.low>>8&255,u[T++]=w.low.low>>16&255,u[T++]=w.low.low>>24&255,u[T++]=w.low.high&255,u[T++]=w.low.high>>8&255,u[T++]=w.low.high>>16&255,u[T++]=w.low.high>>24&255,u[T++]=w.high.low&255,u[T++]=w.high.low>>8&255,u[T++]=w.high.low>>16&255,u[T++]=w.high.low>>24&255,u[T++]=w.high.high&255,u[T++]=w.high.high>>8&255,u[T++]=w.high.high>>16&255,u[T++]=w.high.high>>24&255,new e(u)},e.prototype.toString=function(){for(var t,r=0,o=new Array(36),f=0;f<o.length;f++)o[f]=0;var l=0,a=!1,d,v={parts:[0,0,0,0]},x,C,S=[];l=0;var I=this.bytes,z=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,L=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,J=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,k=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24;l=0;var et={low:new D(z,L),high:new D(J,k)};et.high.lessThan(D.ZERO)&&S.push("-");var X=k>>26&Ji;if(X>>3===3){if(X===qi)return S.join("")+"Infinity";if(X===Zi)return"NaN";t=k>>15&Cn,d=8+(k>>14&1)}else d=k>>14&7,t=k>>17&Cn;var K=t-xn;if(v.parts[0]=(k&16383)+((d&15)<<14),v.parts[1]=J,v.parts[2]=L,v.parts[3]=z,v.parts[0]===0&&v.parts[1]===0&&v.parts[2]===0&&v.parts[3]===0)a=!0;else for(C=3;C>=0;C--){var T=0,it=Gi(v);if(v=it.quotient,T=it.rem.low,!!T)for(x=8;x>=0;x--)o[C*9+x]=T%10,T=Math.floor(T/10)}if(a)r=1,o[l]=0;else for(r=36;!o[l];)r=r-1,l=l+1;var ht=r-1+K;if(ht>=34||ht<=-7||K>0){if(r>34)return S.push("".concat(0)),K>0?S.push("E+".concat(K)):K<0&&S.push("E".concat(K)),S.join("");S.push("".concat(o[l++])),r=r-1,r&&S.push(".");for(var f=0;f<r;f++)S.push("".concat(o[l++]));S.push("E"),ht>0?S.push("+".concat(ht)):S.push("".concat(ht))}else if(K>=0)for(var f=0;f<r;f++)S.push("".concat(o[l++]));else{var bt=r+K;if(bt>0)for(var f=0;f<bt;f++)S.push("".concat(o[l++]));else S.push("0");for(S.push(".");bt++<0;)S.push("0");for(var f=0;f<r-Math.max(bt-1,0);f++)S.push("".concat(o[l++]))}return S.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e})();Object.defineProperty(wr.prototype,"_bsontype",{value:"Decimal128"});var Je=(function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var o=parseFloat(t.$numberDouble);return r&&r.relaxed?o:new e(o)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},e})();Object.defineProperty(Je.prototype,"_bsontype",{value:"Double"});var qe=(function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e})();Object.defineProperty(qe.prototype,"_bsontype",{value:"Int32"});var _r=(function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e})();Object.defineProperty(_r.prototype,"_bsontype",{value:"MaxKey"});var br=(function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e})();Object.defineProperty(br.prototype,"_bsontype",{value:"MinKey"});var Qi=new RegExp("^[0-9a-fA-F]{24}$"),se=null,$t=Symbol("id"),pt=(function(){function e(t){if(!(this instanceof e))return new e(t);var r;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new ot("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=G.from(t.toHexString(),"hex"):r=t.id}else r=t;if(r==null||typeof r=="number")this[$t]=e.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[$t]=r instanceof G?r:ke(r);else if(typeof r=="string")if(r.length===12){var o=G.from(r);if(o.byteLength===12)this[$t]=o;else throw new ot("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Qi.test(r))this[$t]=G.from(r,"hex");else throw new ot("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new ot("Argument passed in does not match the accepted types");e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[$t]},set:function(t){this[$t]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){typeof t!="number"&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),o=G.alloc(12);return o.writeUInt32BE(t,0),se===null&&(se=Dn(5)),o[4]=se[0],o[5]=se[1],o[6]=se[2],o[7]=se[3],o[8]=se[4],o[11]=r&255,o[10]=r>>8&255,o[9]=r>>16&255,o},e.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(t==null)return!1;if(t instanceof e)return this[$t][11]===t[$t][11]&&this[$t].equals(t[$t]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&vr(this.id))return t===G.prototype.toString.call(this.id,"latin1");if(typeof t=="string"&&e.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t=="string"&&e.isValid(t)&&t.length===12)return G.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var r=t.toHexString(),o=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===o}return!1},e.prototype.getTimestamp=function(){var t=new Date,r=this.id.readUInt32BE(0);return t.setTime(Math.floor(r)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var r=G.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new ot("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(G.from(t,"hex"))},e.isValid=function(t){if(t==null)return!1;try{return new e(t),!0}catch{return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(Math.random()*16777215),e})();Object.defineProperty(pt.prototype,"generate",{value:We(function(e){return pt.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(pt.prototype,"getInc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt.prototype,"get_inc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt,"get_inc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt.prototype,"_bsontype",{value:"ObjectID"});function to(e){return e.split("").sort().join("")}var Ce=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=to(r??""),this.pattern.indexOf("\0")!==-1)throw new ae("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new ae("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var o=0;o<this.options.length;o++)if(!(this.options[o]==="i"||this.options[o]==="m"||this.options[o]==="x"||this.options[o]==="l"||this.options[o]==="s"||this.options[o]==="u"))throw new ae("The regular expression option [".concat(this.options[o],"] is not supported"))}return e.parseOptions=function(t){return t?t.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t)if(typeof t.$regex!="string"){if(t.$regex._bsontype==="BSONRegExp")return t}else return new e(t.$regex,e.parseOptions(t.$options));if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new ot("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e})();Object.defineProperty(Ce.prototype,"_bsontype",{value:"BSONRegExp"});var xr=(function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e})();Object.defineProperty(xr.prototype,"_bsontype",{value:"Symbol"});var eo=D,Ln=(function(e){ze(t,e);function t(r,o){var f=this;return f instanceof t?(D.isLong(r)?f=e.call(this,r.low,r.high,!0)||this:Ie(r)&&typeof r.t<"u"&&typeof r.i<"u"?f=e.call(this,r.i,r.t,!0)||this:f=e.call(this,r,o,!0)||this,Object.defineProperty(f,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),f):new t(r,o)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(r){return new t(D.fromInt(r,!0))},t.fromNumber=function(r){return new t(D.fromNumber(r,!0))},t.fromBits=function(r,o){return new t(r,o)},t.fromString=function(r,o){return new t(D.fromString(r,!0,o))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(r){return new t(r.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=D.MAX_UNSIGNED_VALUE,t})(eo);function ro(e){return Ie(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var Pn=2147483647,Un=-2147483648,jn=9223372036854776e3,$n=-9223372036854776e3,no={$oid:pt,$binary:ce,$uuid:ce,$symbol:xr,$numberInt:qe,$numberDecimal:wr,$numberDouble:Je,$numberLong:D,$minKey:br,$maxKey:_r,$regex:Ce,$regularExpression:Ce,$timestamp:Ln};function kn(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Un&&e<=Pn)return new qe(e);if(e>=$n&&e<=jn)return D.fromNumber(e)}return new Je(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter(function(S){return S.startsWith("$")&&e[S]!=null}),o=0;o<r.length;o++){var f=no[r[o]];if(f)return f.fromExtendedJSON(e,t)}if(e.$date!=null){var l=e.$date,a=new Date;return t.legacy?typeof l=="number"?a.setTime(l):typeof l=="string"&&a.setTime(Date.parse(l)):typeof l=="string"?a.setTime(Date.parse(l)):D.isLong(l)?a.setTime(l.toNumber()):typeof l=="number"&&t.relaxed&&a.setTime(l),a}if(e.$code!=null){var d=Object.assign({},e);return e.$scope&&(d.$scope=kn(e.$scope)),Ye.fromExtendedJSON(e)}if(ji(e)||e.$dbPointer){var v=e.$ref?e:e.$dbPointer;if(v instanceof Se)return v;var x=Object.keys(v).filter(function(S){return S.startsWith("$")}),C=!0;if(x.forEach(function(S){["$ref","$id","$db"].indexOf(S)===-1&&(C=!1)}),C)return Se.fromExtendedJSON(v)}return e}function io(e,t){return e.map(function(r,o){t.seenObjects.push({propertyName:"index ".concat(o),obj:null});try{return te(r,t)}finally{t.seenObjects.pop()}})}function On(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function te(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var r=t.seenObjects.findIndex(function(et){return et.obj===e});if(r!==-1){var o=t.seenObjects.map(function(et){return et.propertyName}),f=o.slice(0,r).map(function(et){return"".concat(et," -> ")}).join(""),l=o[r],a=" -> "+o.slice(r+1,o.length-1).map(function(et){return"".concat(et," -> ")}).join(""),d=o[o.length-1],v=" ".repeat(f.length+l.length/2),x="-".repeat(a.length+(l.length+d.length)/2-1);throw new ot(`Converting circular structure to EJSON:
15
+ `],encapsulation:3})};function vi(e,t){return t={exports:{}},e(t,t.exports),t.exports}var wi=Ei,_i=Ci,bi=Ni,kt=[],Bt=[],xi=typeof Uint8Array<"u"?Uint8Array:Array,fr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(oe=0,mn=fr.length;oe<mn;++oe)kt[oe]=fr[oe],Bt[fr.charCodeAt(oe)]=oe;var oe,mn;Bt[45]=62;Bt[95]=63;function An(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var o=r===t?0:4-r%4;return[r,o]}function Ei(e){var t=An(e),r=t[0],o=t[1];return(r+o)*3/4-o}function Si(e,t,r){return(t+r)*3/4-r}function Ci(e){var t,r=An(e),o=r[0],f=r[1],l=new xi(Si(e,o,f)),a=0,d=f>0?o-4:o,v;for(v=0;v<d;v+=4)t=Bt[e.charCodeAt(v)]<<18|Bt[e.charCodeAt(v+1)]<<12|Bt[e.charCodeAt(v+2)]<<6|Bt[e.charCodeAt(v+3)],l[a++]=t>>16&255,l[a++]=t>>8&255,l[a++]=t&255;return f===2&&(t=Bt[e.charCodeAt(v)]<<2|Bt[e.charCodeAt(v+1)]>>4,l[a++]=t&255),f===1&&(t=Bt[e.charCodeAt(v)]<<10|Bt[e.charCodeAt(v+1)]<<4|Bt[e.charCodeAt(v+2)]>>2,l[a++]=t>>8&255,l[a++]=t&255),l}function Ii(e){return kt[e>>18&63]+kt[e>>12&63]+kt[e>>6&63]+kt[e&63]}function Oi(e,t,r){for(var o,f=[],l=t;l<r;l+=3)o=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),f.push(Ii(o));return f.join("")}function Ni(e){for(var t,r=e.length,o=r%3,f=[],l=16383,a=0,d=r-o;a<d;a+=l)f.push(Oi(e,a,a+l>d?d:a+l));return o===1?(t=e[r-1],f.push(kt[t>>2]+kt[t<<4&63]+"==")):o===2&&(t=(e[r-2]<<8)+e[r-1],f.push(kt[t>>10]+kt[t>>4&63]+kt[t<<2&63]+"=")),f.join("")}var ur={byteLength:wi,toByteArray:_i,fromByteArray:bi};var Ti=function(t,r,o,f,l){var a,d,v=l*8-f-1,x=(1<<v)-1,C=x>>1,S=-7,I=o?l-1:0,z=o?-1:1,L=t[r+I];for(I+=z,a=L&(1<<-S)-1,L>>=-S,S+=v;S>0;a=a*256+t[r+I],I+=z,S-=8);for(d=a&(1<<-S)-1,a>>=-S,S+=f;S>0;d=d*256+t[r+I],I+=z,S-=8);if(a===0)a=1-C;else{if(a===x)return d?NaN:(L?-1:1)*(1/0);d=d+Math.pow(2,f),a=a-C}return(L?-1:1)*d*Math.pow(2,a-f)},Bi=function(t,r,o,f,l,a){var d,v,x,C=a*8-l-1,S=(1<<C)-1,I=S>>1,z=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,L=f?0:a-1,J=f?1:-1,k=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(v=isNaN(r)?1:0,d=S):(d=Math.floor(Math.log(r)/Math.LN2),r*(x=Math.pow(2,-d))<1&&(d--,x*=2),d+I>=1?r+=z/x:r+=z*Math.pow(2,1-I),r*x>=2&&(d++,x/=2),d+I>=S?(v=0,d=S):d+I>=1?(v=(r*x-1)*Math.pow(2,l),d=d+I):(v=r*Math.pow(2,I-1)*Math.pow(2,l),d=0));l>=8;t[o+L]=v&255,L+=J,v/=256,l-=8);for(d=d<<l|v,C+=l;C>0;t[o+L]=d&255,L+=J,d/=256,C-=8);t[o+L-J]|=k*128},ye={read:Ti,write:Bi},He=vi(function(e,t){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=et,t.INSPECT_MAX_BYTES=50;var o=2147483647;t.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=f(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function f(){try{var s=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(s,n),s.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function l(s){if(s>o)throw new RangeError('The value "'+s+'" is invalid for option "size"');var n=new Uint8Array(s);return Object.setPrototypeOf(n,a.prototype),n}function a(s,n,i){if(typeof s=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return C(s)}return d(s,n,i)}a.poolSize=8192;function d(s,n,i){if(typeof s=="string")return S(s,n);if(ArrayBuffer.isView(s))return z(s);if(s==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s));if(U(s,ArrayBuffer)||s&&U(s.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(U(s,SharedArrayBuffer)||s&&U(s.buffer,SharedArrayBuffer)))return L(s,n,i);if(typeof s=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var c=s.valueOf&&s.valueOf();if(c!=null&&c!==s)return a.from(c,n,i);var h=J(s);if(h)return h;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof s[Symbol.toPrimitive]=="function")return a.from(s[Symbol.toPrimitive]("string"),n,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(s))}a.from=function(s,n,i){return d(s,n,i)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function v(s){if(typeof s!="number")throw new TypeError('"size" argument must be of type number');if(s<0)throw new RangeError('The value "'+s+'" is invalid for option "size"')}function x(s,n,i){return v(s),s<=0?l(s):n!==void 0?typeof i=="string"?l(s).fill(n,i):l(s).fill(n):l(s)}a.alloc=function(s,n,i){return x(s,n,i)};function C(s){return v(s),l(s<0?0:k(s)|0)}a.allocUnsafe=function(s){return C(s)},a.allocUnsafeSlow=function(s){return C(s)};function S(s,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var i=X(s,n)|0,c=l(i),h=c.write(s,n);return h!==i&&(c=c.slice(0,h)),c}function I(s){for(var n=s.length<0?0:k(s.length)|0,i=l(n),c=0;c<n;c+=1)i[c]=s[c]&255;return i}function z(s){if(U(s,Uint8Array)){var n=new Uint8Array(s);return L(n.buffer,n.byteOffset,n.byteLength)}return I(s)}function L(s,n,i){if(n<0||s.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(s.byteLength<n+(i||0))throw new RangeError('"length" is outside of buffer bounds');var c;return n===void 0&&i===void 0?c=new Uint8Array(s):i===void 0?c=new Uint8Array(s,n):c=new Uint8Array(s,n,i),Object.setPrototypeOf(c,a.prototype),c}function J(s){if(a.isBuffer(s)){var n=k(s.length)|0,i=l(n);return i.length===0||s.copy(i,0,0,n),i}if(s.length!==void 0)return typeof s.length!="number"||j(s.length)?l(0):I(s);if(s.type==="Buffer"&&Array.isArray(s.data))return I(s.data)}function k(s){if(s>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return s|0}function et(s){return+s!=s&&(s=0),a.alloc(+s)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,i){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),U(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(n)||!a.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===i)return 0;for(var c=n.length,h=i.length,y=0,_=Math.min(c,h);y<_;++y)if(n[y]!==i[y]){c=n[y],h=i[y];break}return c<h?-1:h<c?1:0},a.isEncoding=function(n){switch(String(n).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(n,i){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);var c;if(i===void 0)for(i=0,c=0;c<n.length;++c)i+=n[c].length;var h=a.allocUnsafe(i),y=0;for(c=0;c<n.length;++c){var _=n[c];if(U(_,Uint8Array))y+_.length>h.length?a.from(_).copy(h,y):Uint8Array.prototype.set.call(h,_,y);else if(a.isBuffer(_))_.copy(h,y);else throw new TypeError('"list" argument must be an Array of Buffers');y+=_.length}return h};function X(s,n){if(a.isBuffer(s))return s.length;if(ArrayBuffer.isView(s)||U(s,ArrayBuffer))return s.byteLength;if(typeof s!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(s));var i=s.length,c=arguments.length>2&&arguments[2]===!0;if(!c&&i===0)return 0;for(var h=!1;;)switch(n){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return N(s).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return P(s).length;default:if(h)return c?-1:N(s).length;n=(""+n).toLowerCase(),h=!0}}a.byteLength=X;function K(s,n,i){var c=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,n>>>=0,i<=n))return"";for(s||(s="utf8");;)switch(s){case"hex":return b(this,n,i);case"utf8":case"utf-8":return xt(this,n,i);case"ascii":return g(this,n,i);case"latin1":case"binary":return m(this,n,i);case"base64":return _t(this,n,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,n,i);default:if(c)throw new TypeError("Unknown encoding: "+s);s=(s+"").toLowerCase(),c=!0}}a.prototype._isBuffer=!0;function T(s,n,i){var c=s[n];s[n]=s[i],s[i]=c}a.prototype.swap16=function(){var n=this.length;if(n%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var i=0;i<n;i+=2)T(this,i,i+1);return this},a.prototype.swap32=function(){var n=this.length;if(n%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var i=0;i<n;i+=4)T(this,i,i+3),T(this,i+1,i+2);return this},a.prototype.swap64=function(){var n=this.length;if(n%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var i=0;i<n;i+=8)T(this,i,i+7),T(this,i+1,i+6),T(this,i+2,i+5),T(this,i+3,i+4);return this},a.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?xt(this,0,n):K.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(n){if(!a.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:a.compare(this,n)===0},a.prototype.inspect=function(){var n="",i=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(n+=" ... "),"<Buffer "+n+">"},r&&(a.prototype[r]=a.prototype.inspect),a.prototype.compare=function(n,i,c,h,y){if(U(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),!a.isBuffer(n))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(n));if(i===void 0&&(i=0),c===void 0&&(c=n?n.length:0),h===void 0&&(h=0),y===void 0&&(y=this.length),i<0||c>n.length||h<0||y>this.length)throw new RangeError("out of range index");if(h>=y&&i>=c)return 0;if(h>=y)return-1;if(i>=c)return 1;if(i>>>=0,c>>>=0,h>>>=0,y>>>=0,this===n)return 0;for(var _=y-h,H=c-i,Z=Math.min(_,H),W=this.slice(h,y),Q=n.slice(i,c),tt=0;tt<Z;++tt)if(W[tt]!==Q[tt]){_=W[tt],H=Q[tt];break}return _<H?-1:H<_?1:0};function it(s,n,i,c,h){if(s.length===0)return-1;if(typeof i=="string"?(c=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,j(i)&&(i=h?0:s.length-1),i<0&&(i=s.length+i),i>=s.length){if(h)return-1;i=s.length-1}else if(i<0)if(h)i=0;else return-1;if(typeof n=="string"&&(n=a.from(n,c)),a.isBuffer(n))return n.length===0?-1:ht(s,n,i,c,h);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?h?Uint8Array.prototype.indexOf.call(s,n,i):Uint8Array.prototype.lastIndexOf.call(s,n,i):ht(s,[n],i,c,h);throw new TypeError("val must be string, number or Buffer")}function ht(s,n,i,c,h){var y=1,_=s.length,H=n.length;if(c!==void 0&&(c=String(c).toLowerCase(),c==="ucs2"||c==="ucs-2"||c==="utf16le"||c==="utf-16le")){if(s.length<2||n.length<2)return-1;y=2,_/=2,H/=2,i/=2}function Z(Ft,zt){return y===1?Ft[zt]:Ft.readUInt16BE(zt*y)}var W;if(h){var Q=-1;for(W=i;W<_;W++)if(Z(s,W)===Z(n,Q===-1?0:W-Q)){if(Q===-1&&(Q=W),W-Q+1===H)return Q*y}else Q!==-1&&(W-=W-Q),Q=-1}else for(i+H>_&&(i=_-H),W=i;W>=0;W--){for(var tt=!0,st=0;st<H;st++)if(Z(s,W+st)!==Z(n,st)){tt=!1;break}if(tt)return W}return-1}a.prototype.includes=function(n,i,c){return this.indexOf(n,i,c)!==-1},a.prototype.indexOf=function(n,i,c){return it(this,n,i,c,!0)},a.prototype.lastIndexOf=function(n,i,c){return it(this,n,i,c,!1)};function bt(s,n,i,c){i=Number(i)||0;var h=s.length-i;c?(c=Number(c),c>h&&(c=h)):c=h;var y=n.length;c>y/2&&(c=y/2);for(var _=0;_<c;++_){var H=parseInt(n.substr(_*2,2),16);if(j(H))return _;s[i+_]=H}return _}function Zt(s,n,i,c){return F(N(n,s.length-i),s,i,c)}function Rt(s,n,i,c){return F(R(n),s,i,c)}function Gt(s,n,i,c){return F(P(n),s,i,c)}function Ht(s,n,i,c){return F(B(n,s.length-i),s,i,c)}a.prototype.write=function(n,i,c,h){if(i===void 0)h="utf8",c=this.length,i=0;else if(c===void 0&&typeof i=="string")h=i,c=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(c)?(c=c>>>0,h===void 0&&(h="utf8")):(h=c,c=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var y=this.length-i;if((c===void 0||c>y)&&(c=y),n.length>0&&(c<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");h||(h="utf8");for(var _=!1;;)switch(h){case"hex":return bt(this,n,i,c);case"utf8":case"utf-8":return Zt(this,n,i,c);case"ascii":case"latin1":case"binary":return Rt(this,n,i,c);case"base64":return Gt(this,n,i,c);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ht(this,n,i,c);default:if(_)throw new TypeError("Unknown encoding: "+h);h=(""+h).toLowerCase(),_=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function _t(s,n,i){return n===0&&i===s.length?ur.fromByteArray(s):ur.fromByteArray(s.slice(n,i))}function xt(s,n,i){i=Math.min(s.length,i);for(var c=[],h=n;h<i;){var y=s[h],_=null,H=y>239?4:y>223?3:y>191?2:1;if(h+H<=i){var Z,W,Q,tt;switch(H){case 1:y<128&&(_=y);break;case 2:Z=s[h+1],(Z&192)===128&&(tt=(y&31)<<6|Z&63,tt>127&&(_=tt));break;case 3:Z=s[h+1],W=s[h+2],(Z&192)===128&&(W&192)===128&&(tt=(y&15)<<12|(Z&63)<<6|W&63,tt>2047&&(tt<55296||tt>57343)&&(_=tt));break;case 4:Z=s[h+1],W=s[h+2],Q=s[h+3],(Z&192)===128&&(W&192)===128&&(Q&192)===128&&(tt=(y&15)<<18|(Z&63)<<12|(W&63)<<6|Q&63,tt>65535&&tt<1114112&&(_=tt))}}_===null?(_=65533,H=1):_>65535&&(_-=65536,c.push(_>>>10&1023|55296),_=56320|_&1023),c.push(_),h+=H}return Et(c)}var dt=4096;function Et(s){var n=s.length;if(n<=dt)return String.fromCharCode.apply(String,s);for(var i="",c=0;c<n;)i+=String.fromCharCode.apply(String,s.slice(c,c+=dt));return i}function g(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]&127);return c}function m(s,n,i){var c="";i=Math.min(s.length,i);for(var h=n;h<i;++h)c+=String.fromCharCode(s[h]);return c}function b(s,n,i){var c=s.length;(!n||n<0)&&(n=0),(!i||i<0||i>c)&&(i=c);for(var h="",y=n;y<i;++y)h+=$[s[y]];return h}function w(s,n,i){for(var c=s.slice(n,i),h="",y=0;y<c.length-1;y+=2)h+=String.fromCharCode(c[y]+c[y+1]*256);return h}a.prototype.slice=function(n,i){var c=this.length;n=~~n,i=i===void 0?c:~~i,n<0?(n+=c,n<0&&(n=0)):n>c&&(n=c),i<0?(i+=c,i<0&&(i=0)):i>c&&(i=c),i<n&&(i=n);var h=this.subarray(n,i);return Object.setPrototypeOf(h,a.prototype),h};function u(s,n,i){if(s%1!==0||s<0)throw new RangeError("offset is not uint");if(s+n>i)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return h},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n+--i],y=1;i>0&&(y*=256);)h+=this[n+--i]*y;return h},a.prototype.readUint8=a.prototype.readUInt8=function(n,i){return n=n>>>0,i||u(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,i){return n=n>>>0,i||u(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,i){return n=n>>>0,i||u(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,i){return n=n>>>0,i||u(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readIntLE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=this[n],y=1,_=0;++_<i&&(y*=256);)h+=this[n+_]*y;return y*=128,h>=y&&(h-=Math.pow(2,8*i)),h},a.prototype.readIntBE=function(n,i,c){n=n>>>0,i=i>>>0,c||u(n,i,this.length);for(var h=i,y=1,_=this[n+--h];h>0&&(y*=256);)_+=this[n+--h]*y;return y*=128,_>=y&&(_-=Math.pow(2,8*i)),_},a.prototype.readInt8=function(n,i){return n=n>>>0,i||u(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,i){n=n>>>0,i||u(n,2,this.length);var c=this[n]|this[n+1]<<8;return c&32768?c|4294901760:c},a.prototype.readInt16BE=function(n,i){n=n>>>0,i||u(n,2,this.length);var c=this[n+1]|this[n]<<8;return c&32768?c|4294901760:c},a.prototype.readInt32LE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,i){return n=n>>>0,i||u(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readFloatLE=function(n,i){return n=n>>>0,i||u(n,4,this.length),ye.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,i){return n=n>>>0,i||u(n,4,this.length),ye.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,i){return n=n>>>0,i||u(n,8,this.length),ye.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,i){return n=n>>>0,i||u(n,8,this.length),ye.read(this,n,!1,52,8)};function p(s,n,i,c,h,y){if(!a.isBuffer(s))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>h||n<y)throw new RangeError('"value" argument is out of bounds');if(i+c>s.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;p(this,n,i,c,y,0)}var _=1,H=0;for(this[i]=n&255;++H<c&&(_*=256);)this[i+H]=n/_&255;return i+c},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,c=c>>>0,!h){var y=Math.pow(2,8*c)-1;p(this,n,i,c,y,0)}var _=c-1,H=1;for(this[i+_]=n&255;--_>=0&&(H*=256);)this[i+_]=n/H&255;return i+c},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,1,255,0),this[i]=n&255,i+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,65535,0),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,65535,0),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,4294967295,0),this[i+3]=n>>>24,this[i+2]=n>>>16,this[i+1]=n>>>8,this[i]=n&255,i+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,4294967295,0),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4},a.prototype.writeIntLE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);p(this,n,i,c,y-1,-y)}var _=0,H=1,Z=0;for(this[i]=n&255;++_<c&&(H*=256);)n<0&&Z===0&&this[i+_-1]!==0&&(Z=1),this[i+_]=(n/H>>0)-Z&255;return i+c},a.prototype.writeIntBE=function(n,i,c,h){if(n=+n,i=i>>>0,!h){var y=Math.pow(2,8*c-1);p(this,n,i,c,y-1,-y)}var _=c-1,H=1,Z=0;for(this[i+_]=n&255;--_>=0&&(H*=256);)n<0&&Z===0&&this[i+_+1]!==0&&(Z=1),this[i+_]=(n/H>>0)-Z&255;return i+c},a.prototype.writeInt8=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,1,127,-128),n<0&&(n=255+n+1),this[i]=n&255,i+1},a.prototype.writeInt16LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,32767,-32768),this[i]=n&255,this[i+1]=n>>>8,i+2},a.prototype.writeInt16BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,2,32767,-32768),this[i]=n>>>8,this[i+1]=n&255,i+2},a.prototype.writeInt32LE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,2147483647,-2147483648),this[i]=n&255,this[i+1]=n>>>8,this[i+2]=n>>>16,this[i+3]=n>>>24,i+4},a.prototype.writeInt32BE=function(n,i,c){return n=+n,i=i>>>0,c||p(this,n,i,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[i]=n>>>24,this[i+1]=n>>>16,this[i+2]=n>>>8,this[i+3]=n&255,i+4};function E(s,n,i,c,h,y){if(i+c>s.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function O(s,n,i,c,h){return n=+n,i=i>>>0,h||E(s,n,i,4),ye.write(s,n,i,c,23,4),i+4}a.prototype.writeFloatLE=function(n,i,c){return O(this,n,i,!0,c)},a.prototype.writeFloatBE=function(n,i,c){return O(this,n,i,!1,c)};function A(s,n,i,c,h){return n=+n,i=i>>>0,h||E(s,n,i,8),ye.write(s,n,i,c,52,8),i+8}a.prototype.writeDoubleLE=function(n,i,c){return A(this,n,i,!0,c)},a.prototype.writeDoubleBE=function(n,i,c){return A(this,n,i,!1,c)},a.prototype.copy=function(n,i,c,h){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(c||(c=0),!h&&h!==0&&(h=this.length),i>=n.length&&(i=n.length),i||(i=0),h>0&&h<c&&(h=c),h===c||n.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(c<0||c>=this.length)throw new RangeError("Index out of range");if(h<0)throw new RangeError("sourceEnd out of bounds");h>this.length&&(h=this.length),n.length-i<h-c&&(h=n.length-i+c);var y=h-c;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,c,h):Uint8Array.prototype.set.call(n,this.subarray(c,h),i),y},a.prototype.fill=function(n,i,c,h){if(typeof n=="string"){if(typeof i=="string"?(h=i,i=0,c=this.length):typeof c=="string"&&(h=c,c=this.length),h!==void 0&&typeof h!="string")throw new TypeError("encoding must be a string");if(typeof h=="string"&&!a.isEncoding(h))throw new TypeError("Unknown encoding: "+h);if(n.length===1){var y=n.charCodeAt(0);(h==="utf8"&&y<128||h==="latin1")&&(n=y)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(i<0||this.length<i||this.length<c)throw new RangeError("Out of range index");if(c<=i)return this;i=i>>>0,c=c===void 0?this.length:c>>>0,n||(n=0);var _;if(typeof n=="number")for(_=i;_<c;++_)this[_]=n;else{var H=a.isBuffer(n)?n:a.from(n,h),Z=H.length;if(Z===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(_=0;_<c-i;++_)this[_+i]=H[_%Z]}return this};var M=/[^+/0-9A-Za-z-_]/g;function V(s){if(s=s.split("=")[0],s=s.trim().replace(M,""),s.length<2)return"";for(;s.length%4!==0;)s=s+"=";return s}function N(s,n){n=n||1/0;for(var i,c=s.length,h=null,y=[],_=0;_<c;++_){if(i=s.charCodeAt(_),i>55295&&i<57344){if(!h){if(i>56319){(n-=3)>-1&&y.push(239,191,189);continue}else if(_+1===c){(n-=3)>-1&&y.push(239,191,189);continue}h=i;continue}if(i<56320){(n-=3)>-1&&y.push(239,191,189),h=i;continue}i=(h-55296<<10|i-56320)+65536}else h&&(n-=3)>-1&&y.push(239,191,189);if(h=null,i<128){if((n-=1)<0)break;y.push(i)}else if(i<2048){if((n-=2)<0)break;y.push(i>>6|192,i&63|128)}else if(i<65536){if((n-=3)<0)break;y.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((n-=4)<0)break;y.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return y}function R(s){for(var n=[],i=0;i<s.length;++i)n.push(s.charCodeAt(i)&255);return n}function B(s,n){for(var i,c,h,y=[],_=0;_<s.length&&!((n-=2)<0);++_)i=s.charCodeAt(_),c=i>>8,h=i%256,y.push(h),y.push(c);return y}function P(s){return ur.toByteArray(V(s))}function F(s,n,i,c){for(var h=0;h<c&&!(h+i>=n.length||h>=s.length);++h)n[h+i]=s[h];return h}function U(s,n){return s instanceof n||s!=null&&s.constructor!=null&&s.constructor.name!=null&&s.constructor.name===n.name}function j(s){return s!==s}var $=(function(){for(var s="0123456789abcdef",n=new Array(256),i=0;i<16;++i)for(var c=i*16,h=0;h<16;++h)n[c+h]=s[i]+s[h];return n})()}),G=He.Buffer;He.SlowBuffer;He.INSPECT_MAX_BYTES;He.kMaxLength;var gr=function(t,r){return gr=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,f){o.__proto__=f}||function(o,f){for(var l in f)f.hasOwnProperty(l)&&(o[l]=f[l])},gr(t,r)};function ze(e,t){gr(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var ae=(function(e){ze(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t})(Error),ot=(function(e){ze(t,e);function t(r){var o=e.call(this,r)||this;return Object.setPrototypeOf(o,t.prototype),o}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t})(TypeError);function $e(e){return e&&e.Math==Math&&e}function Mn(){return $e(typeof globalThis=="object"&&globalThis)||$e(typeof window=="object"&&window)||$e(typeof self=="object"&&self)||$e(typeof global=="object"&&global)||Function("return this")()}function Ai(){var e=Mn();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var Mi=function(t){var r=Ai()?"BSON: For React Native please polyfill crypto.getRandomValues, e.g. using: https://www.npmjs.com/package/react-native-get-random-values.":"BSON: No cryptographic implementation for random bytes present, falling back to a less secure implementation.";console.warn(r);for(var o=G.alloc(t),f=0;f<t;++f)o[f]=Math.floor(Math.random()*256);return o},Di=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(G.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(G.alloc(t))}:Mi}},Dn=Di();function Ri(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function vr(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function Fi(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function Vi(e){return Ie(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Ie(e){return typeof e=="object"&&e!==null}function We(e,t){var r=!1;function o(){for(var f=[],l=0;l<arguments.length;l++)f[l]=arguments[l];return r||(console.warn(t),r=!0),e.apply(this,f)}return o}function ke(e){if(ArrayBuffer.isView(e))return G.from(e.buffer,e.byteOffset,e.byteLength);if(Ri(e))return G.from(e);throw new ot("Must use either Buffer or TypedArray")}var Li=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|[0-9a-f]{12}4[0-9a-f]{3}[89ab][0-9a-f]{15})$/i,Rn=function(e){return typeof e=="string"&&Li.test(e)},yr=function(e){if(!Rn(e))throw new ot('UUID string representations must be a 32 or 36 character hex string (dashes excluded/included). Format: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" or "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx".');var t=e.replace(/-/g,"");return G.from(t,"hex")},gn=function(e,t){return t===void 0&&(t=!0),t?e.toString("hex",0,4)+"-"+e.toString("hex",4,6)+"-"+e.toString("hex",6,8)+"-"+e.toString("hex",8,10)+"-"+e.toString("hex",10,16):e.toString("hex")};var Ws=Math.pow(2,63)-1,Ys=-Math.pow(2,63),Pi=Math.pow(2,53),Ui=-Math.pow(2,53);var Fn=4;var ce=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new ot("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=r??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=G.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=G.from(t,"binary"):Array.isArray(t)?this.buffer=G.from(t):this.buffer=ke(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new ot("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new ot("only accepts single character Uint8Array or Array");var r;if(typeof t=="string"?r=t.charCodeAt(0):typeof t=="number"?r=t:r=t[0],r<0||r>255)throw new ot("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var o=G.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=r}},e.prototype.write=function(t,r){if(r=typeof r=="number"?r:this.position,this.buffer.length<r+t.length){var o=G.alloc(this.buffer.length+t.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o}ArrayBuffer.isView(t)?(this.buffer.set(ke(t),r),this.position=r+t.byteLength>this.position?r+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,r,t.length,"binary"),this.position=r+t.length>this.position?r+t.length:this.position)},e.prototype.read=function(t,r){return r=r&&r>0?r:this.position,this.buffer.slice(t,t+r)},e.prototype.value=function(t){return t=!!t,t&&this.buffer.length===this.position?this.buffer:t?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(t){return this.buffer.toString(t)},e.prototype.toExtendedJSON=function(t){t=t||{};var r=this.buffer.toString("base64"),o=Number(this.sub_type).toString(16);return t.legacy?{$binary:r,$type:o.length===1?"0"+o:o}:{$binary:{base64:r,subType:o.length===1?"0"+o:o}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new yn(this.buffer.slice(0,this.position));throw new ae('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){r=r||{};var o,f;if("$binary"in t?r.legacy&&typeof t.$binary=="string"&&"$type"in t?(f=t.$type?parseInt(t.$type,16):0,o=G.from(t.$binary,"base64")):typeof t.$binary!="string"&&(f=t.$binary.subType?parseInt(t.$binary.subType,16):0,o=G.from(t.$binary.base64,"base64")):"$uuid"in t&&(f=4,o=yr(t.$uuid)),!o)throw new ot("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return f===Fn?new yn(o):new e(o,f)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.value(!0);return'new Binary(Buffer.from("'.concat(t.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e})();Object.defineProperty(ce.prototype,"_bsontype",{value:"Binary"});var pr=16,yn=(function(e){ze(t,e);function t(r){var o=this,f,l;if(r==null)f=t.generate();else if(r instanceof t)f=G.from(r.buffer),l=r.__id;else if(ArrayBuffer.isView(r)&&r.byteLength===pr)f=ke(r);else if(typeof r=="string")f=yr(r);else throw new ot("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");return o=e.call(this,f,Fn)||this,o.__id=l,o}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(r){this.buffer=r,t.cacheHexString&&(this.__id=gn(r))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(r){if(r===void 0&&(r=!0),t.cacheHexString&&this.__id)return this.__id;var o=gn(this.id,r);return t.cacheHexString&&(this.__id=o),o},t.prototype.toString=function(r){return r?this.id.toString(r):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(r){if(!r)return!1;if(r instanceof t)return r.id.equals(this.id);try{return new t(r).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new ce(this.id,ce.SUBTYPE_UUID)},t.generate=function(){var r=Dn(pr);return r[6]=r[6]&15|64,r[8]=r[8]&63|128,G.from(r)},t.isValid=function(r){return r?r instanceof t?!0:typeof r=="string"?Rn(r):vr(r)?r.length!==pr?!1:(r[6]&240)===64&&(r[8]&128)===128:!1:!1},t.createFromHexString=function(r){var o=yr(r);return new t(o)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t})(ce),Ye=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toJSON();return'new Code("'.concat(String(t.code),'"').concat(t.scope?", ".concat(JSON.stringify(t.scope)):"",")")},e})();Object.defineProperty(Ye.prototype,"_bsontype",{value:"Code"});function ji(e){return Ie(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Se=(function(){function e(t,r,o,f){if(!(this instanceof e))return new e(t,r,o,f);var l=t.split(".");l.length===2&&(o=l.shift(),t=l.shift()),this.collection=t,this.oid=r,this.db=o,this.fields=f||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(t){this.collection=t},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var t=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(t.$db=this.db),t},e.prototype.toExtendedJSON=function(t){t=t||{};var r={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(r.$db=this.db),r=Object.assign(r,this.fields)),r},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.oid===void 0||this.oid.toString===void 0?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(t),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e})();Object.defineProperty(Se.prototype,"_bsontype",{value:"DBRef"});var Tt=void 0;try{Tt=new WebAssembly.Instance(new WebAssembly.Module(new Uint8Array([0,97,115,109,1,0,0,0,1,13,2,96,0,1,127,96,4,127,127,127,127,1,127,3,7,6,0,1,1,1,1,1,6,6,1,127,1,65,0,11,7,50,6,3,109,117,108,0,1,5,100,105,118,95,115,0,2,5,100,105,118,95,117,0,3,5,114,101,109,95,115,0,4,5,114,101,109,95,117,0,5,8,103,101,116,95,104,105,103,104,0,0,10,191,1,6,4,0,35,0,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,126,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,127,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,128,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,129,34,4,66,32,135,167,36,0,32,4,167,11,36,1,1,126,32,0,173,32,1,173,66,32,134,132,32,2,173,32,3,173,66,32,134,132,130,34,4,66,32,135,167,36,0,32,4,167,11])),{}).exports}catch{}var vn=65536,$i=1<<24,we=vn*vn,Vn=we*we,wn=Vn/2,_n={},bn={},D=(function(){function e(t,r,o){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,r,o);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!r)):typeof t=="string"?Object.assign(this,e.fromString(t,!!r)):(this.low=t|0,this.high=r|0,this.unsigned=!!o),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,o){return new e(t,r,o)},e.fromInt=function(t,r){var o,f,l;return r?(t>>>=0,(l=0<=t&&t<256)&&(f=bn[t],f)?f:(o=e.fromBits(t,(t|0)<0?-1:0,!0),l&&(bn[t]=o),o)):(t|=0,(l=-128<=t&&t<128)&&(f=_n[t],f)?f:(o=e.fromBits(t,t<0?-1:0,!1),l&&(_n[t]=o),o))},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=Vn)return e.MAX_UNSIGNED_VALUE}else{if(t<=-wn)return e.MIN_VALUE;if(t+1>=wn)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%we|0,t/we|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,o){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof r=="number"?(o=r,r=!1):r=!!r,o=o||10,o<2||36<o)throw RangeError("radix");var f;if((f=t.indexOf("-"))>0)throw Error("interior hyphen");if(f===0)return e.fromString(t.substring(1),r,o).neg();for(var l=e.fromNumber(Math.pow(o,8)),a=e.ZERO,d=0;d<t.length;d+=8){var v=Math.min(8,t.length-d),x=parseInt(t.substring(d,d+v),o);if(v<8){var C=e.fromNumber(Math.pow(o,v));a=a.mul(C).add(e.fromNumber(x))}else a=a.mul(l),a=a.add(e.fromNumber(x))}return a.unsigned=r,a},e.fromBytes=function(t,r,o){return o?e.fromBytesLE(t,r):e.fromBytesBE(t,r)},e.fromBytesLE=function(t,r){return new e(t[0]|t[1]<<8|t[2]<<16|t[3]<<24,t[4]|t[5]<<8|t[6]<<16|t[7]<<24,r)},e.fromBytesBE=function(t,r){return new e(t[4]<<24|t[5]<<16|t[6]<<8|t[7],t[0]<<24|t[1]<<16|t[2]<<8|t[3],r)},e.isLong=function(t){return Ie(t)&&t.__isLong__===!0},e.fromValue=function(t,r){return typeof t=="number"?e.fromNumber(t,r):typeof t=="string"?e.fromString(t,r):e.fromBits(t.low,t.high,typeof r=="boolean"?r:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var r=this.high>>>16,o=this.high&65535,f=this.low>>>16,l=this.low&65535,a=t.high>>>16,d=t.high&65535,v=t.low>>>16,x=t.low&65535,C=0,S=0,I=0,z=0;return z+=l+x,I+=z>>>16,z&=65535,I+=f+v,S+=I>>>16,I&=65535,S+=o+d,C+=S>>>16,S&=65535,C+=r+a,C&=65535,e.fromBits(I<<16|z,C<<16|S,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),o=t.isNegative();return r&&!o?-1:!r&&o?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(t){return this.compare(t)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(Tt){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var r=(this.unsigned?Tt.div_u:Tt.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var o,f,l;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;l=e.UZERO}else{if(this.eq(e.MIN_VALUE)){if(t.eq(e.ONE)||t.eq(e.NEG_ONE))return e.MIN_VALUE;if(t.eq(e.MIN_VALUE))return e.ONE;var a=this.shr(1);return o=a.div(t).shl(1),o.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(f=this.sub(t.mul(o)),l=o.add(f.div(t)),l)}else if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();l=e.ZERO}for(f=this;f.gte(t);){o=Math.max(1,Math.floor(f.toNumber()/t.toNumber()));for(var d=Math.ceil(Math.log(o)/Math.LN2),v=d<=48?1:Math.pow(2,d-48),x=e.fromNumber(o),C=x.mul(t);C.isNegative()||C.gt(f);)o-=v,x=e.fromNumber(o,this.unsigned),C=x.mul(t);x.isZero()&&(x=e.ONE),l=l.add(x),f=f.sub(C)}return l},e.prototype.div=function(t){return this.divide(t)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.unsigned!==t.unsigned&&this.high>>>31===1&&t.high>>>31===1?!1:this.high===t.high&&this.low===t.low},e.prototype.eq=function(t){return this.equals(t)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t=this.high!==0?this.high:this.low,r;for(r=31;r>0&&(t&1<<r)===0;r--);return this.high!==0?r+33:r+1},e.prototype.greaterThan=function(t){return this.comp(t)>0},e.prototype.gt=function(t){return this.greaterThan(t)},e.prototype.greaterThanOrEqual=function(t){return this.comp(t)>=0},e.prototype.gte=function(t){return this.greaterThanOrEqual(t)},e.prototype.ge=function(t){return this.greaterThanOrEqual(t)},e.prototype.isEven=function(){return(this.low&1)===0},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return(this.low&1)===1},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return this.high===0&&this.low===0},e.prototype.lessThan=function(t){return this.comp(t)<0},e.prototype.lt=function(t){return this.lessThan(t)},e.prototype.lessThanOrEqual=function(t){return this.comp(t)<=0},e.prototype.lte=function(t){return this.lessThanOrEqual(t)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),Tt){var r=(this.unsigned?Tt.rem_u:Tt.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(t){return this.modulo(t)},e.prototype.rem=function(t){return this.modulo(t)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),Tt){var r=Tt.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,Tt.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var o=this.high>>>16,f=this.high&65535,l=this.low>>>16,a=this.low&65535,d=t.high>>>16,v=t.high&65535,x=t.low>>>16,C=t.low&65535,S=0,I=0,z=0,L=0;return L+=a*C,z+=L>>>16,L&=65535,z+=l*C,I+=z>>>16,z&=65535,z+=a*x,I+=z>>>16,z&=65535,I+=f*C,S+=I>>>16,I&=65535,I+=l*x,S+=I>>>16,I&=65535,I+=a*v,S+=I>>>16,I&=65535,S+=o*C+f*x+l*v+a*d,S&=65535,e.fromBits(z<<16|L,S<<16|I,this.unsigned)},e.prototype.mul=function(t){return this.multiply(t)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(t){return!this.equals(t)},e.prototype.neq=function(t){return this.notEquals(t)},e.prototype.ne=function(t){return this.notEquals(t)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low<<t,this.high<<t|this.low>>>32-t,this.unsigned):e.fromBits(0,this.low<<t-32,this.unsigned)},e.prototype.shl=function(t){return this.shiftLeft(t)},e.prototype.shiftRight=function(t){return e.isLong(t)&&(t=t.toInt()),(t&=63)===0?this:t<32?e.fromBits(this.low>>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(t){return this.shiftRight(t)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),t&=63,t===0)return this;var r=this.high;if(t<32){var o=this.low;return e.fromBits(o>>>t|r<<32-t,r>>>t,this.unsigned)}else return t===32?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(t){return this.shiftRightUnsigned(t)},e.prototype.shru=function(t){return this.shiftRightUnsigned(t)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(t){return this.subtract(t)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*we+(this.low>>>0):this.high*we+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(t){return t?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var t=this.high,r=this.low;return[r&255,r>>>8&255,r>>>16&255,r>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,r=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,r>>>24,r>>>16&255,r>>>8&255,r&255]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if(t=t||10,t<2||36<t)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(e.MIN_VALUE)){var r=e.fromNumber(t),o=this.div(r),f=o.mul(r).sub(this);return o.toString(t)+f.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var l=e.fromNumber(Math.pow(t,6),this.unsigned),a=this,d="";;){var v=a.div(l),x=a.sub(v.mul(l)).toInt()>>>0,C=x.toString(t);if(a=v,a.isZero())return C+d;for(;C.length<6;)C="0"+C;d=""+C+d}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(t){return this.lessThanOrEqual(t)},e.prototype.toExtendedJSON=function(t){return t&&t.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var o=e.fromString(t.$numberLong);return r&&r.relaxed?o.toNumber():o},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt($i),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e})();Object.defineProperty(D.prototype,"__isLong__",{value:!0});Object.defineProperty(D.prototype,"_bsontype",{value:"Long"});var ki=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Hi=/^(\+|-)?(Infinity|inf)$/i,zi=/^(\+|-)?NaN$/i,Ee=6111,hr=-6176,xn=6176,Wi=34,dr=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),En=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Sn=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Yi=/^([-+])?(\d+)?$/,Ji=31,Cn=16383,qi=30,Zi=31;function In(e){return!isNaN(parseInt(e,10))}function Gi(e){var t=D.fromNumber(1e9),r=D.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:r};for(var o=0;o<=3;o++)r=r.shiftLeft(32),r=r.add(new D(e.parts[o],0)),e.parts[o]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function Xi(e,t){if(!e&&!t)return{high:D.fromNumber(0),low:D.fromNumber(0)};var r=e.shiftRightUnsigned(32),o=new D(e.getLowBits(),0),f=t.shiftRightUnsigned(32),l=new D(t.getLowBits(),0),a=r.multiply(f),d=r.multiply(l),v=o.multiply(f),x=o.multiply(l);return a=a.add(d.shiftRightUnsigned(32)),d=new D(d.getLowBits(),0).add(v).add(x.shiftRightUnsigned(32)),a=a.add(d.shiftRightUnsigned(32)),x=d.shiftLeft(32).add(new D(x.getLowBits(),0)),{high:a,low:x}}function Ki(e,t){var r=e.high>>>0,o=t.high>>>0;if(r<o)return!0;if(r===o){var f=e.low>>>0,l=t.low>>>0;if(f<l)return!0}return!1}function ve(e,t){throw new ot('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var wr=(function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(vr(t)){if(t.byteLength!==16)throw new ot("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new ot("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var r=!1,o=!1,f=!1,l=0,a=0,d=0,v=0,x=0,C=[0],S=0,I=0,z=0,L=0,J=0,k=0,et=new D(0,0),X=new D(0,0),K=0,T=0;if(t.length>=7e3)throw new ot(""+t+" not a valid Decimal128 string");var it=t.match(ki),ht=t.match(Hi),bt=t.match(zi);if(!it&&!ht&&!bt||t.length===0)throw new ot(""+t+" not a valid Decimal128 string");if(it){var Zt=it[2],Rt=it[4],Gt=it[5],Ht=it[6];Rt&&Ht===void 0&&ve(t,"missing exponent power"),Rt&&Zt===void 0&&ve(t,"missing exponent base"),Rt===void 0&&(Gt||Ht)&&ve(t,"missing e before exponent")}if((t[T]==="+"||t[T]==="-")&&(r=t[T++]==="-"),!In(t[T])&&t[T]!=="."){if(t[T]==="i"||t[T]==="I")return new e(G.from(r?En:Sn));if(t[T]==="N")return new e(G.from(dr))}for(;In(t[T])||t[T]===".";){if(t[T]==="."){o&&ve(t,"contains multiple periods"),o=!0,T=T+1;continue}S<34&&(t[T]!=="0"||f)&&(f||(x=a),f=!0,C[I++]=parseInt(t[T],10),S=S+1),f&&(d=d+1),o&&(v=v+1),a=a+1,T=T+1}if(o&&!a)throw new ot(""+t+" not a valid Decimal128 string");if(t[T]==="e"||t[T]==="E"){var _t=t.substr(++T).match(Yi);if(!_t||!_t[2])return new e(G.from(dr));J=parseInt(_t[0],10),T=T+_t[0].length}if(t[T])return new e(G.from(dr));if(z=0,!S)z=0,L=0,C[0]=0,d=1,S=1,l=0;else if(L=S-1,l=d,l!==1)for(;C[x+l-1]===0;)l=l-1;for(J<=v&&v-J>16384?J=hr:J=J-v;J>Ee;){if(L=L+1,L-z>Wi){var xt=C.join("");if(xt.match(/^0+$/)){J=Ee;break}ve(t,"overflow")}J=J-1}for(;J<hr||S<d;){if(L===0&&l<S){J=hr,l=0;break}if(S<d?d=d-1:L=L-1,J<Ee)J=J+1;else{var xt=C.join("");if(xt.match(/^0+$/)){J=Ee;break}ve(t,"overflow")}}if(L-z+1<l){var dt=a;o&&(x=x+1,dt=dt+1),r&&(x=x+1,dt=dt+1);var Et=parseInt(t[x+L+1],10),g=0;if(Et>=5&&(g=1,Et===5)){for(g=C[L]%2===1?1:0,k=x+L+2;k<dt;k++)if(parseInt(t[k],10)){g=1;break}}if(g){for(var m=L;m>=0;m--)if(++C[m]>9&&(C[m]=0,m===0))if(J<Ee)J=J+1,C[m]=1;else return new e(G.from(r?En:Sn))}}if(et=D.fromNumber(0),X=D.fromNumber(0),l===0)et=D.fromNumber(0),X=D.fromNumber(0);else if(L-z<17){var m=z;for(X=D.fromNumber(C[m++]),et=new D(0,0);m<=L;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}else{var m=z;for(et=D.fromNumber(C[m++]);m<=L-17;m++)et=et.multiply(D.fromNumber(10)),et=et.add(D.fromNumber(C[m]));for(X=D.fromNumber(C[m++]);m<=L;m++)X=X.multiply(D.fromNumber(10)),X=X.add(D.fromNumber(C[m]))}var b=Xi(et,D.fromString("100000000000000000"));b.low=b.low.add(X),Ki(b.low,X)&&(b.high=b.high.add(D.fromNumber(1))),K=J+xn;var w={low:D.fromNumber(0),high:D.fromNumber(0)};b.high.shiftRightUnsigned(49).and(D.fromNumber(1)).equals(D.fromNumber(1))?(w.high=w.high.or(D.fromNumber(3).shiftLeft(61)),w.high=w.high.or(D.fromNumber(K).and(D.fromNumber(16383).shiftLeft(47))),w.high=w.high.or(b.high.and(D.fromNumber(0x7fffffffffff)))):(w.high=w.high.or(D.fromNumber(K&16383).shiftLeft(49)),w.high=w.high.or(b.high.and(D.fromNumber(562949953421311)))),w.low=b.low,r&&(w.high=w.high.or(D.fromString("9223372036854775808")));var u=G.alloc(16);return T=0,u[T++]=w.low.low&255,u[T++]=w.low.low>>8&255,u[T++]=w.low.low>>16&255,u[T++]=w.low.low>>24&255,u[T++]=w.low.high&255,u[T++]=w.low.high>>8&255,u[T++]=w.low.high>>16&255,u[T++]=w.low.high>>24&255,u[T++]=w.high.low&255,u[T++]=w.high.low>>8&255,u[T++]=w.high.low>>16&255,u[T++]=w.high.low>>24&255,u[T++]=w.high.high&255,u[T++]=w.high.high>>8&255,u[T++]=w.high.high>>16&255,u[T++]=w.high.high>>24&255,new e(u)},e.prototype.toString=function(){for(var t,r=0,o=new Array(36),f=0;f<o.length;f++)o[f]=0;var l=0,a=!1,d,v={parts:[0,0,0,0]},x,C,S=[];l=0;var I=this.bytes,z=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,L=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,J=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24,k=I[l++]|I[l++]<<8|I[l++]<<16|I[l++]<<24;l=0;var et={low:new D(z,L),high:new D(J,k)};et.high.lessThan(D.ZERO)&&S.push("-");var X=k>>26&Ji;if(X>>3===3){if(X===qi)return S.join("")+"Infinity";if(X===Zi)return"NaN";t=k>>15&Cn,d=8+(k>>14&1)}else d=k>>14&7,t=k>>17&Cn;var K=t-xn;if(v.parts[0]=(k&16383)+((d&15)<<14),v.parts[1]=J,v.parts[2]=L,v.parts[3]=z,v.parts[0]===0&&v.parts[1]===0&&v.parts[2]===0&&v.parts[3]===0)a=!0;else for(C=3;C>=0;C--){var T=0,it=Gi(v);if(v=it.quotient,T=it.rem.low,!!T)for(x=8;x>=0;x--)o[C*9+x]=T%10,T=Math.floor(T/10)}if(a)r=1,o[l]=0;else for(r=36;!o[l];)r=r-1,l=l+1;var ht=r-1+K;if(ht>=34||ht<=-7||K>0){if(r>34)return S.push("".concat(0)),K>0?S.push("E+".concat(K)):K<0&&S.push("E".concat(K)),S.join("");S.push("".concat(o[l++])),r=r-1,r&&S.push(".");for(var f=0;f<r;f++)S.push("".concat(o[l++]));S.push("E"),ht>0?S.push("+".concat(ht)):S.push("".concat(ht))}else if(K>=0)for(var f=0;f<r;f++)S.push("".concat(o[l++]));else{var bt=r+K;if(bt>0)for(var f=0;f<bt;f++)S.push("".concat(o[l++]));else S.push("0");for(S.push(".");bt++<0;)S.push("0");for(var f=0;f<r-Math.max(bt-1,0);f++)S.push("".concat(o[l++]))}return S.join("")},e.prototype.toJSON=function(){return{$numberDecimal:this.toString()}},e.prototype.toExtendedJSON=function(){return{$numberDecimal:this.toString()}},e.fromExtendedJSON=function(t){return e.fromString(t.$numberDecimal)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Decimal128("'.concat(this.toString(),'")')},e})();Object.defineProperty(wr.prototype,"_bsontype",{value:"Decimal128"});var Je=(function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t}return e.prototype.valueOf=function(){return this.value},e.prototype.toJSON=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toExtendedJSON=function(t){return t&&(t.legacy||t.relaxed&&isFinite(this.value))?this.value:Object.is(Math.sign(this.value),-0)?{$numberDouble:"-".concat(this.value.toFixed(1))}:{$numberDouble:Number.isInteger(this.value)?this.value.toFixed(1):this.value.toString()}},e.fromExtendedJSON=function(t,r){var o=parseFloat(t.$numberDouble);return r&&r.relaxed?o:new e(o)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var t=this.toExtendedJSON();return"new Double(".concat(t.$numberDouble,")")},e})();Object.defineProperty(Je.prototype,"_bsontype",{value:"Double"});var qe=(function(){function e(t){if(!(this instanceof e))return new e(t);t instanceof Number&&(t=t.valueOf()),this.value=+t|0}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(t){return this.value.toString(t)},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(t){return t&&(t.relaxed||t.legacy)?this.value:{$numberInt:this.value.toString()}},e.fromExtendedJSON=function(t,r){return r&&r.relaxed?parseInt(t.$numberInt,10):new e(t.$numberInt)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new Int32(".concat(this.valueOf(),")")},e})();Object.defineProperty(qe.prototype,"_bsontype",{value:"Int32"});var _r=(function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$maxKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MaxKey()"},e})();Object.defineProperty(_r.prototype,"_bsontype",{value:"MaxKey"});var br=(function(){function e(){if(!(this instanceof e))return new e}return e.prototype.toExtendedJSON=function(){return{$minKey:1}},e.fromExtendedJSON=function(){return new e},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return"new MinKey()"},e})();Object.defineProperty(br.prototype,"_bsontype",{value:"MinKey"});var Qi=new RegExp("^[0-9a-fA-F]{24}$"),se=null,$t=Symbol("id"),pt=(function(){function e(t){if(!(this instanceof e))return new e(t);var r;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new ot("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?r=G.from(t.toHexString(),"hex"):r=t.id}else r=t;if(r==null||typeof r=="number")this[$t]=e.generate(typeof r=="number"?r:void 0);else if(ArrayBuffer.isView(r)&&r.byteLength===12)this[$t]=r instanceof G?r:ke(r);else if(typeof r=="string")if(r.length===12){var o=G.from(r);if(o.byteLength===12)this[$t]=o;else throw new ot("Argument passed in must be a string of 12 bytes")}else if(r.length===24&&Qi.test(r))this[$t]=G.from(r,"hex");else throw new ot("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new ot("Argument passed in does not match the accepted types");e.cacheHexString&&(this.__id=this.id.toString("hex"))}return Object.defineProperty(e.prototype,"id",{get:function(){return this[$t]},set:function(t){this[$t]=t,e.cacheHexString&&(this.__id=t.toString("hex"))},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"generationTime",{get:function(){return this.id.readInt32BE(0)},set:function(t){this.id.writeUInt32BE(t,0)},enumerable:!1,configurable:!0}),e.prototype.toHexString=function(){if(e.cacheHexString&&this.__id)return this.__id;var t=this.id.toString("hex");return e.cacheHexString&&!this.__id&&(this.__id=t),t},e.getInc=function(){return e.index=(e.index+1)%16777215},e.generate=function(t){typeof t!="number"&&(t=Math.floor(Date.now()/1e3));var r=e.getInc(),o=G.alloc(12);return o.writeUInt32BE(t,0),se===null&&(se=Dn(5)),o[4]=se[0],o[5]=se[1],o[6]=se[2],o[7]=se[3],o[8]=se[4],o[11]=r&255,o[10]=r>>8&255,o[9]=r>>16&255,o},e.prototype.toString=function(t){return t?this.id.toString(t):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(t==null)return!1;if(t instanceof e)return this[$t][11]===t[$t][11]&&this[$t].equals(t[$t]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&vr(this.id))return t===G.prototype.toString.call(this.id,"latin1");if(typeof t=="string"&&e.isValid(t)&&t.length===24)return t.toLowerCase()===this.toHexString();if(typeof t=="string"&&e.isValid(t)&&t.length===12)return G.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var r=t.toHexString(),o=this.toHexString().toLowerCase();return typeof r=="string"&&r.toLowerCase()===o}return!1},e.prototype.getTimestamp=function(){var t=new Date,r=this.id.readUInt32BE(0);return t.setTime(Math.floor(r)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var r=G.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new ot("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(G.from(t,"hex"))},e.isValid=function(t){if(t==null)return!1;try{return new e(t),!0}catch{return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(Math.random()*16777215),e})();Object.defineProperty(pt.prototype,"generate",{value:We(function(e){return pt.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(pt.prototype,"getInc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt.prototype,"get_inc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt,"get_inc",{value:We(function(){return pt.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(pt.prototype,"_bsontype",{value:"ObjectID"});function to(e){return e.split("").sort().join("")}var Ce=(function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=to(r??""),this.pattern.indexOf("\0")!==-1)throw new ae("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new ae("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var o=0;o<this.options.length;o++)if(!(this.options[o]==="i"||this.options[o]==="m"||this.options[o]==="x"||this.options[o]==="l"||this.options[o]==="s"||this.options[o]==="u"))throw new ae("The regular expression option [".concat(this.options[o],"] is not supported"))}return e.parseOptions=function(t){return t?t.split("").sort().join(""):""},e.prototype.toExtendedJSON=function(t){return t=t||{},t.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}},e.fromExtendedJSON=function(t){if("$regex"in t)if(typeof t.$regex!="string"){if(t.$regex._bsontype==="BSONRegExp")return t}else return new e(t.$regex,e.parseOptions(t.$options));if("$regularExpression"in t)return new e(t.$regularExpression.pattern,e.parseOptions(t.$regularExpression.options));throw new ot("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e})();Object.defineProperty(Ce.prototype,"_bsontype",{value:"BSONRegExp"});var xr=(function(){function e(t){if(!(this instanceof e))return new e(t);this.value=t}return e.prototype.valueOf=function(){return this.value},e.prototype.toString=function(){return this.value},e.prototype.inspect=function(){return'new BSONSymbol("'.concat(this.value,'")')},e.prototype.toJSON=function(){return this.value},e.prototype.toExtendedJSON=function(){return{$symbol:this.value}},e.fromExtendedJSON=function(t){return new e(t.$symbol)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e})();Object.defineProperty(xr.prototype,"_bsontype",{value:"Symbol"});var eo=D,Ln=(function(e){ze(t,e);function t(r,o){var f=this;return f instanceof t?(D.isLong(r)?f=e.call(this,r.low,r.high,!0)||this:Ie(r)&&typeof r.t<"u"&&typeof r.i<"u"?f=e.call(this,r.i,r.t,!0)||this:f=e.call(this,r,o,!0)||this,Object.defineProperty(f,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),f):new t(r,o)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(r){return new t(D.fromInt(r,!0))},t.fromNumber=function(r){return new t(D.fromNumber(r,!0))},t.fromBits=function(r,o){return new t(r,o)},t.fromString=function(r,o){return new t(D.fromString(r,!0,o))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(r){return new t(r.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=D.MAX_UNSIGNED_VALUE,t})(eo);function ro(e){return Ie(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var Pn=2147483647,Un=-2147483648,jn=9223372036854776e3,$n=-9223372036854776e3,no={$oid:pt,$binary:ce,$uuid:ce,$symbol:xr,$numberInt:qe,$numberDecimal:wr,$numberDouble:Je,$numberLong:D,$minKey:br,$maxKey:_r,$regex:Ce,$regularExpression:Ce,$timestamp:Ln};function kn(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=Un&&e<=Pn)return new qe(e);if(e>=$n&&e<=jn)return D.fromNumber(e)}return new Je(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter(function(S){return S.startsWith("$")&&e[S]!=null}),o=0;o<r.length;o++){var f=no[r[o]];if(f)return f.fromExtendedJSON(e,t)}if(e.$date!=null){var l=e.$date,a=new Date;return t.legacy?typeof l=="number"?a.setTime(l):typeof l=="string"&&a.setTime(Date.parse(l)):typeof l=="string"?a.setTime(Date.parse(l)):D.isLong(l)?a.setTime(l.toNumber()):typeof l=="number"&&t.relaxed&&a.setTime(l),a}if(e.$code!=null){var d=Object.assign({},e);return e.$scope&&(d.$scope=kn(e.$scope)),Ye.fromExtendedJSON(e)}if(ji(e)||e.$dbPointer){var v=e.$ref?e:e.$dbPointer;if(v instanceof Se)return v;var x=Object.keys(v).filter(function(S){return S.startsWith("$")}),C=!0;if(x.forEach(function(S){["$ref","$id","$db"].indexOf(S)===-1&&(C=!1)}),C)return Se.fromExtendedJSON(v)}return e}function io(e,t){return e.map(function(r,o){t.seenObjects.push({propertyName:"index ".concat(o),obj:null});try{return te(r,t)}finally{t.seenObjects.pop()}})}function On(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function te(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var r=t.seenObjects.findIndex(function(et){return et.obj===e});if(r!==-1){var o=t.seenObjects.map(function(et){return et.propertyName}),f=o.slice(0,r).map(function(et){return"".concat(et," -> ")}).join(""),l=o[r],a=" -> "+o.slice(r+1,o.length-1).map(function(et){return"".concat(et," -> ")}).join(""),d=o[o.length-1],v=" ".repeat(f.length+l.length/2),x="-".repeat(a.length+(l.length+d.length)/2-1);throw new ot(`Converting circular structure to EJSON:
16
16
  `+" ".concat(f).concat(l).concat(a).concat(d,`
17
- `)+" ".concat(v,"\\").concat(x,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return io(e,t);if(e===void 0)return null;if(e instanceof Date||Vi(e)){var C=e.getTime(),S=C>-1&&C<2534023188e5;return t.legacy?t.relaxed&&S?{$date:e.getTime()}:{$date:On(e)}:t.relaxed&&S?{$date:On(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var I=e>=Un&&e<=Pn,z=e>=$n&&e<=jn;if(I)return{$numberInt:e.toString()};if(z)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Fi(e)){var L=e.flags;if(L===void 0){var J=e.toString().match(/[gimuy]*$/);J&&(L=J[0])}var k=new Ce(e.source,L);return k.toExtendedJSON(t)}return e!=null&&typeof e=="object"?so(e,t):e}var oo={Binary:function(e){return new ce(e.value(),e.sub_type)},Code:function(e){return new Ye(e.code,e.scope)},DBRef:function(e){return new Se(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new wr(e.bytes)},Double:function(e){return new Je(e.value)},Int32:function(e){return new qe(e.value)},Long:function(e){return D.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 _r},MinKey:function(){return new br},ObjectID:function(e){return new pt(e)},ObjectId:function(e){return new pt(e)},BSONRegExp:function(e){return new Ce(e.pattern,e.options)},Symbol:function(e){return new xr(e.value)},Timestamp:function(e){return Ln.fromBits(e.low,e.high)}};function so(e,t){if(e==null||typeof e!="object")throw new ae("not an object instance");var r=e._bsontype;if(typeof r>"u"){var o={};for(var f in e){t.seenObjects.push({propertyName:f,obj:null});try{var l=te(e[f],t);f==="__proto__"?Object.defineProperty(o,f,{value:l,writable:!0,enumerable:!0,configurable:!0}):o[f]=l}finally{t.seenObjects.pop()}}return o}else if(ro(e)){var a=e;if(typeof a.toExtendedJSON!="function"){var d=oo[e._bsontype];if(!d)throw new ot("Unrecognized or invalid _bsontype: "+e._bsontype);a=d(a)}return r==="Code"&&a.scope?a=new Ye(a.code,te(a.scope,t)):r==="DBRef"&&a.oid&&(a=new Se(te(a.collection,t),te(a.oid,t),te(a.db,t),te(a.fields,t))),a.toExtendedJSON(t)}else throw new ae("_bsontype must be a string, but was: "+typeof r)}var Nn;(function(e){function t(l,a){var d=Object.assign({},{relaxed:!0,legacy:!1},a);return typeof d.relaxed=="boolean"&&(d.strict=!d.relaxed),typeof d.strict=="boolean"&&(d.relaxed=!d.strict),JSON.parse(l,function(v,x){if(v.indexOf("\0")!==-1)throw new ae("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(v)));return kn(x,d)})}e.parse=t;function r(l,a,d,v){d!=null&&typeof d=="object"&&(v=d,d=0),a!=null&&typeof a=="object"&&!Array.isArray(a)&&(v=a,a=void 0,d=0);var x=Object.assign({relaxed:!0,legacy:!1},v,{seenObjects:[{propertyName:"(root)",obj:null}]}),C=te(l,x);return JSON.stringify(C,a,d)}e.stringify=r;function o(l,a){return a=a||{},JSON.parse(r(l,a))}e.serialize=o;function f(l,a){return a=a||{},t(JSON.stringify(l),a)}e.deserialize=f})(Nn||(Nn={}));var Tn,Bn=Mn();Bn.Map?Tn=Bn.Map:Tn=(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 o=t[r],f=o[0],l=o[1];this._keys.push(f),this._values[f]={v:l,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 o=t._keys[r++];return{value:o!==void 0?[o,t._values[o].v]:void 0,done:o===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var o=0;o<this._keys.length;o++){var f=this._keys[o];t.call(r,this._values[f].v,f,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 o=t._keys[r++];return{value:o!==void 0?o:void 0,done:o===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 o=t._keys[r++];return{value:o!==void 0?t._values[o].v:void 0,done:o===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e})();var Js=D.fromNumber(Pi),qs=D.fromNumber(Ui);var mr=new Uint8Array(8),Zs=new DataView(mr.buffer,mr.byteOffset,mr.byteLength);var ao=1024*1024*17,Gs=G.alloc(ao);var Ze=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(t){t=t||{},this.triggerID=t.id||t.triggerID,this.nudgeID=t.nudgeID,this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.contentID=t.contentID,this.variation=t.variation,this.props=t.props,this.objective=t.objective,this.onsiteDeliveryType=t.onsiteDeliveryType,this.holdout=t.holdout}};var _e=class{constructor(t,r={},o,f){this.name=t;this.properties=r;this.id=f?new pt(f):new pt,this.occurred=new Date,o&&(this.trigger=new Ze(o)),this.newEvent=!f}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale};var lo=["videoEl"];async function Hn(){return(await import("./video-detail-dialog.component-OXVXQLX3.js")).VideoDetailDialogComponent}var ee=class e extends Qt{videoElements;videos;videoConfig;dialogRef=null;dialog=fe(nn);isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";constructor(){super(),Hn()}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(t,r){t||this.videoElements.forEach(o=>{o.nativeElement!==r&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(t,r){let o=new _e("CE Trigger Clicked",{},this.triggerContext?.triggerData);o.videos=[t.id],r&&(o.items=[r]),this.sendEventToRenderer(o)}onVideoTap(t,r,o,f){t?.stopPropagation(),t?.preventDefault();let l=r.items?.[0];if(this.sendTriggerClicked(r,l?.toEmbed()),this.videoConfig.footerContent==="NONE"){f&&(f.muted=!1,f.play(),this.onMuteToggled(!1,f));return}Gr().then(()=>this.openDialog(r,o))}async performCTA(t){let r,o=this.triggerContext;if(t.cta===ne.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t.cta===ne.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t.cta===ne.OPEN_CART)r="CE Open Cart Clicked",o.triggerData.redirectBehaviour=Kr.CART_DRAWER;else{vt.warn(`Unsupported CTA type: ${t.cta}`);return}let f={at:t.cta},l={videoID:t.video.id};this.sendEvent(r,{current:l},t.video,t.item),this.executeCTAViaRenderer({clickAction:f,embeddedItem:t.item.toEmbed()})}sendEvent(t,r,o,f){let l=new _e(t,r,this.engagementTrigger);o&&(l.videos=[o.id]),f&&(l.items=[f.toEmbed()]),this.sendEventToRenderer(l)}onDialogClosed(){}async openDialog(t,r){let o={videos:this.videos,currentIndex:r,triggerContext:this.triggerContext,onCTAPerformed:a=>this.performCTA(a)};this.dialogRef&&this.dialogRef.close();let f=await Hn();this.dialogRef=this.dialog.open(f,{width:"100vw",height:"100vh",data:o});let l={videoID:t.id,videoIndex:r};this.sendEvent("CE Video Dialog Opened",{current:l},t),this.dialogRef.closed.subscribe(a=>{if(this.dialogRef=null,!a)return;let d=a.lastVideoDuration*1e3,v={videoID:a.lastVideo.id,videoIndex:a.lastVideoIndex,playedTillMS:d,playedTillPercent:d/a.lastVideo.durationMS},x=new _e("CE Video Dialog Closed",{current:v},this.triggerContext?.triggerData);x.videos=[a.lastVideo.id],this.sendEventToRenderer(x),this.onDialogClosed()})}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-abstract-video"]],viewQuery:function(r,o){if(r&1&&Te(lo,5),r&2){let f;Be(f=Ae())&&(o.videoElements=f)}},features:[gt],decls:0,vars:0,template:function(r,o){},encapsulation:2})};var fo=(e,t)=>t.id,uo=(e,t)=>t.url;function po(e,t){if(e&1&&(Kt(0,"div",1),jt(1,"safeHtml")),e&2){let r=q();yt("innerHTML",qt(1,1,r.videoConfig.heading),At)}}function ho(e,t){e&1&&(rt(0,"div",6),Kt(1,"div",14),nt())}function mo(e,t){if(e&1&&Kt(0,"source",8),e&2){let r=t.$implicit;yt("type",pe(r.mimeType))("src",r.url,Xt)}}function go(e,t){if(e&1){let r=Yt();rt(0,"cooee-mute-toggle",15),Nt("toggled",function(f){at(r),q();let l=Ut(6),a=q();return ct(a.onMuteToggled(f,l))}),nt()}if(e&2){q();let r=Ut(6);yt("muted",r.muted)("videoEl",r)}}function yo(e,t){if(e&1){let r=Yt();rt(0,"cooee-item-card",16),Nt("buttonClick",function(){at(r);let f=q(),l=f.$implicit,a=f.$index,d=Ut(6),v=q();return ct(v.addToCartClicked(null,l,a,d))})("click",function(f){at(r);let l=q(),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))}),nt()}if(e&2){q();let r=Jt(0);yt("item",r)}}function vo(e,t){if(e&1){let r=Yt();rt(0,"cooee-video-card",17),Nt("linkClicked",function(){at(r);let f=q().$implicit,l=q();return ct(l.sendTriggerClicked(f))}),nt()}if(e&2){q();let r=Jt(1);yt("card",r)}}function wo(e,t){if(e&1){let r=Yt();xe(0)(1),rt(2,"div",4)(3,"div",5),Nt("click",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))})("keydown.enter",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))})("keydown.space",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))}),lt(4,ho,2,0,"div",6),rt(5,"video",7,0),Nt("mouseenter",function(){at(r);let f=Ut(6);q();let l=Jt(1);return ct(l&&f.play())})("mouseleave",function(){at(r);let f=Ut(6);q();let l=Jt(1);return ct(l&&f.pause())})("loadstart",function(){let f=at(r).$implicit,l=q();return ct(l.onVideoLoadStart(f.id))})("canplay",function(){let f=at(r).$implicit,l=q();return ct(l.onVideoCanPlay(f.id))}),Ct(7,mo,1,3,"source",8,uo),nt(),rt(9,"div",9),lt(10,go,1,2,"cooee-mute-toggle",10),nt()(),rt(11,"div",11),lt(12,yo,1,1,"cooee-item-card",12)(13,vo,1,1,"cooee-video-card",13),nt()()}if(e&2){let r=t.$implicit,o=q(),f=Jt(0),l=re(r.items[0]);Y();let a=re(r.card),d=l&&o.videoConfig.footerContent==o.VideoConfigFooterContent.FIRST_ITEM,v=a&&o.videoConfig.footerContent==o.VideoConfigFooterContent.CARD;Y(2),be("background-image",r.thumbnail?"url("+r.thumbnail+")":null),Y(),ft(o.isVideoLoading(r.id)?4:-1),Y(),yt("muted",!0),Ne("preload",f?"metadata":"none")("autoplay",null)("data-video-id",r.id),Y(2),It(r.sources),Y(3),ft(o.videoConfig.showMuteButton?10:-1),Y(2),ft(d?12:v?13:-1)}}var Ge=class e extends ee{VideoConfigFooterContent=nr;VideoConfigAutoPlay=rn;swiperOptions;videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),this.hasSwiper=!0,this.swiperOptions={direction:"horizontal",effect:"slide",slidesPerView:"auto",spaceBetween:window.cooeePlaylistGap??24,mousewheel:{enabled:!0,forceToAxis:!0},navigation:{enabled:!1},freeMode:!0}}ngAfterViewInit(){this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}addToCartClicked(t,r,o,f){let l=r.items?.[0],a=Zr.get().website?.canChangeVariantInCart;if(r.items?.length>1||l?.hasVariants()&&!a){this.onVideoTap(t,r,o,f);return}this.performCTA({cta:ne.ADD_TO_CART,item:l,video:r})}goToPDP(t,r){t?.stopPropagation(),t?.preventDefault();let o=r.items?.[0];this.performCTA({cta:ne.GO_TO_PRODUCT,item:o,video:r})}update(){}isVideoLoading(t){return this.videoLoadingStates.get(t)??!0}onVideoLoadStart(t){this.videoLoadingStates.set(t,!0)}onVideoCanPlay(t){this.videoLoadingStates.set(t,!1)}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(r=>{let o=r.target,f=o.dataset.videoId;f&&(r.isIntersecting?(this.visibleVideos.add(f),this.handleVideoVisibilityChange(o,!0)):(this.visibleVideos.delete(f),this.handleVideoVisibilityChange(o,!1)))})},{threshold:.5,rootMargin:"50px"}),setTimeout(()=>{this.videoElements.forEach(t=>{this.intersectionObserver?.observe(t.nativeElement)})},100)}handleVideoVisibilityChange(t,r){r?this.shouldAutoPlay()&&t.play().catch(()=>{}):t.pause()}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-playlist"]],features:[gt],decls:7,vars:4,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","muted"],[3,"src","type"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(r,o){r&1&&(xe(0)(1),lt(2,po,2,3,"div",1),rt(3,"cooee-swiper",2),Pr(4,3),Ct(5,wo,14,11,"div",4,fo),Ur(),nt()),r&2&&(re(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),Y(),re(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),Y(),ft(o.videoConfig.heading?2:-1),Y(),yt("options",o.swiperOptions),Y(2),It(o.videos))},dependencies:[cn,an,sn,ln,de],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-info{font-size:14px;line-height:normal}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
18
- `],encapsulation:3})};function zn(e){e||(e=fe(Nr));let t=new Oe(r=>{if(e.destroyed){r.next();return}return e.onDestroy(r.next.bind(r))});return r=>r.pipe(Cr(t))}var _o=e=>({"cursor-grab":e}),bo=(e,t)=>t.url;function xo(e,t){if(e&1&&Kt(0,"source",7),e&2){let r=t.$implicit;yt("type",pe(r.mimeType))("src",r.url,Xt)}}var Xe=class e extends ee{video;isDragging=!1;hidden=!1;cdkDrag=fe(Re,{self:!0});untilDestroyed=zn();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(".letscooee-engagement");t&&(t.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:t})}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-popup"]],hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(r,o){r&1&&Nt("keydown.enter",function(l){return o.onClick(l)})("keydown.space",function(l){return o.onClick(l)})("click",function(l){return o.onClick(l)}),r&2&&(_t("cdkDragBoundary","body"),$r(o.popupClasses))},features:[Rr([{directive:Re,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),gt],decls:10,vars:4,consts:[[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","auto","playsinline","","autoplay","",3,"muted"],[3,"src","type"]],template:function(r,o){r&1&&(rt(0,"div",0)(1,"button",1),Nt("click",function(l){return l.stopPropagation(),o.close()}),Kt(2,"cooee-icon",2),nt(),rt(3,"div",3),Kt(4,"cooee-icon",4),rt(5,"div",5),Dt(6,"Tap to unmute"),nt()(),rt(7,"video",6),Ct(8,xo,1,3,"source",7,bo),nt()()),r&2&&(yt("ngClass",Hr(2,_o,o.isDragging)),Y(7),yt("muted",!0),Y(),It(o.video.sources))},dependencies:[Me,on],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
19
- `],encapsulation:3})};var Eo=(e,t)=>t.id,So=(e,t)=>t.url;function Co(e,t){if(e&1&&(Ot(0,"div",0),jt(1,"safeHtml")),e&2){let r=q();_t("innerHTML",qt(1,1,r.videoConfig.heading),At)}}function Io(e,t){if(e&1&&Ot(0,"source",9),e&2){let r=t.$implicit;_t("type",pe(r.mimeType))("src",r.url,Xt)}}function Oo(e,t){if(e&1){let r=Yt();Mt(0,"div",3),jr("click",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))})("keydown.enter",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))})("keydown.space",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))}),Ir(),Mt(1,"svg",4),Ot(2,"circle",5)(3,"circle",6),Pt(),Or(),Mt(4,"div",7)(5,"video",8),Ct(6,Io,1,3,"source",9,So),Pt()()()}if(e&2){let r=t.$implicit,o=t.$index;Ne("aria-label","Open video story "+(o+1)),Y(6),It(r.sources)}}var Ke=class e extends ee{constructor(){super()}update(){}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-stories"]],features:[gt],decls:4,vars:1,consts:[[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],["autoplay","","loop","","muted","","playsinline","","preload","metadata"],[3,"src","type"]],template:function(r,o){r&1&&(lt(0,Co,2,3,"div",0),Mt(1,"div",1),Ct(2,Oo,8,1,"div",2,Eo),Pt()),r&2&&(ft(o.videoConfig.heading?0:-1),Y(2),It(o.videos))},dependencies:[de],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px}
17
+ `)+" ".concat(v,"\\").concat(x,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return io(e,t);if(e===void 0)return null;if(e instanceof Date||Vi(e)){var C=e.getTime(),S=C>-1&&C<2534023188e5;return t.legacy?t.relaxed&&S?{$date:e.getTime()}:{$date:On(e)}:t.relaxed&&S?{$date:On(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var I=e>=Un&&e<=Pn,z=e>=$n&&e<=jn;if(I)return{$numberInt:e.toString()};if(z)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Fi(e)){var L=e.flags;if(L===void 0){var J=e.toString().match(/[gimuy]*$/);J&&(L=J[0])}var k=new Ce(e.source,L);return k.toExtendedJSON(t)}return e!=null&&typeof e=="object"?so(e,t):e}var oo={Binary:function(e){return new ce(e.value(),e.sub_type)},Code:function(e){return new Ye(e.code,e.scope)},DBRef:function(e){return new Se(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new wr(e.bytes)},Double:function(e){return new Je(e.value)},Int32:function(e){return new qe(e.value)},Long:function(e){return D.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 _r},MinKey:function(){return new br},ObjectID:function(e){return new pt(e)},ObjectId:function(e){return new pt(e)},BSONRegExp:function(e){return new Ce(e.pattern,e.options)},Symbol:function(e){return new xr(e.value)},Timestamp:function(e){return Ln.fromBits(e.low,e.high)}};function so(e,t){if(e==null||typeof e!="object")throw new ae("not an object instance");var r=e._bsontype;if(typeof r>"u"){var o={};for(var f in e){t.seenObjects.push({propertyName:f,obj:null});try{var l=te(e[f],t);f==="__proto__"?Object.defineProperty(o,f,{value:l,writable:!0,enumerable:!0,configurable:!0}):o[f]=l}finally{t.seenObjects.pop()}}return o}else if(ro(e)){var a=e;if(typeof a.toExtendedJSON!="function"){var d=oo[e._bsontype];if(!d)throw new ot("Unrecognized or invalid _bsontype: "+e._bsontype);a=d(a)}return r==="Code"&&a.scope?a=new Ye(a.code,te(a.scope,t)):r==="DBRef"&&a.oid&&(a=new Se(te(a.collection,t),te(a.oid,t),te(a.db,t),te(a.fields,t))),a.toExtendedJSON(t)}else throw new ae("_bsontype must be a string, but was: "+typeof r)}var Nn;(function(e){function t(l,a){var d=Object.assign({},{relaxed:!0,legacy:!1},a);return typeof d.relaxed=="boolean"&&(d.strict=!d.relaxed),typeof d.strict=="boolean"&&(d.relaxed=!d.strict),JSON.parse(l,function(v,x){if(v.indexOf("\0")!==-1)throw new ae("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(v)));return kn(x,d)})}e.parse=t;function r(l,a,d,v){d!=null&&typeof d=="object"&&(v=d,d=0),a!=null&&typeof a=="object"&&!Array.isArray(a)&&(v=a,a=void 0,d=0);var x=Object.assign({relaxed:!0,legacy:!1},v,{seenObjects:[{propertyName:"(root)",obj:null}]}),C=te(l,x);return JSON.stringify(C,a,d)}e.stringify=r;function o(l,a){return a=a||{},JSON.parse(r(l,a))}e.serialize=o;function f(l,a){return a=a||{},t(JSON.stringify(l),a)}e.deserialize=f})(Nn||(Nn={}));var Tn,Bn=Mn();Bn.Map?Tn=Bn.Map:Tn=(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 o=t[r],f=o[0],l=o[1];this._keys.push(f),this._values[f]={v:l,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 o=t._keys[r++];return{value:o!==void 0?[o,t._values[o].v]:void 0,done:o===void 0}}}},e.prototype.forEach=function(t,r){r=r||this;for(var o=0;o<this._keys.length;o++){var f=this._keys[o];t.call(r,this._values[f].v,f,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 o=t._keys[r++];return{value:o!==void 0?o:void 0,done:o===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 o=t._keys[r++];return{value:o!==void 0?t._values[o].v:void 0,done:o===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e})();var Js=D.fromNumber(Pi),qs=D.fromNumber(Ui);var mr=new Uint8Array(8),Zs=new DataView(mr.buffer,mr.byteOffset,mr.byteLength);var ao=1024*1024*17,Gs=G.alloc(ao);var Ze=class{triggerID;nudgeID;engagementID;contentID;shortID;contentType;variation;props;objective;onsiteDeliveryType;holdout;constructor(t){t=t||{},this.triggerID=t.id||t.triggerID,this.nudgeID=t.nudgeID,this.shortID=t.shortID,this.contentType=t.contentType,this.engagementID=t.engagementID,this.contentID=t.contentID,this.variation=t.variation,this.props=t.props,this.objective=t.objective,this.onsiteDeliveryType=t.onsiteDeliveryType,this.holdout=t.holdout}};var _e=class{constructor(t,r={},o,f){this.name=t;this.properties=r;this.id=f?new pt(f):new pt,this.occurred=new Date,o&&(this.trigger=new Ze(o)),this.newEvent=!f}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale};var lo=["videoEl"];async function Hn(){return(await import("./video-detail-dialog.component-RCGP5FZO.js")).VideoDetailDialogComponent}var ee=class e extends Qt{videoElements;videos;videoConfig;dialogRef=null;dialog=fe(nn);isMobile=window.CooeeSDK.uaParser.getDevice().type==="mobile";constructor(){super(),Hn()}engagementTriggerReceived(t){this.videoConfig=t.content?.videoConfig,this.videos=this.videoConfig.videos}onMuteToggled(t,r){t||this.videoElements.forEach(o=>{o.nativeElement!==r&&(o.nativeElement.muted=!0,o.nativeElement.pause())})}sendTriggerClicked(t,r){let o=new _e("CE Trigger Clicked",{},this.triggerContext?.triggerData);o.videos=[t.id],r&&(o.items=[r]),this.sendEventToRenderer(o)}onVideoTap(t,r,o,f){t?.stopPropagation(),t?.preventDefault();let l=r.items?.[0];if(this.sendTriggerClicked(r,l?.toEmbed()),this.videoConfig.footerContent==="NONE"){f&&(f.muted=!1,f.play(),this.onMuteToggled(!1,f));return}Gr().then(()=>this.openDialog(r,o))}async performCTA(t){let r,o=this.triggerContext;if(t.cta===ne.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t.cta===ne.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t.cta===ne.OPEN_CART)r="CE Open Cart Clicked",o.triggerData.redirectBehaviour=Kr.CART_DRAWER;else{wt.warn(`Unsupported CTA type: ${t.cta}`);return}let f={at:t.cta},l={videoID:t.video.id};this.sendEvent(r,{current:l},t.video,t.item),this.executeCTAViaRenderer({clickAction:f,embeddedItem:t.item.toEmbed()})}sendEvent(t,r,o,f){let l=new _e(t,r,this.engagementTrigger);o&&(l.videos=[o.id]),f&&(l.items=[f.toEmbed()]),this.sendEventToRenderer(l)}onDialogClosed(){}async openDialog(t,r){let o={videos:this.videos,currentIndex:r,triggerContext:this.triggerContext,onCTAPerformed:a=>this.performCTA(a)};this.dialogRef&&this.dialogRef.close();let f=await Hn();this.dialogRef=this.dialog.open(f,{width:"100vw",height:"100vh",data:o});let l={videoID:t.id,videoIndex:r};this.sendEvent("CE Video Dialog Opened",{current:l},t),this.dialogRef.closed.subscribe(a=>{if(this.dialogRef=null,!a)return;let d=a.lastVideoDuration*1e3,v={videoID:a.lastVideo.id,videoIndex:a.lastVideoIndex,playedTillMS:d,playedTillPercent:d/a.lastVideo.durationMS},x=new _e("CE Video Dialog Closed",{current:v},this.triggerContext?.triggerData);x.videos=[a.lastVideo.id],this.sendEventToRenderer(x),this.onDialogClosed()})}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-abstract-video"]],viewQuery:function(r,o){if(r&1&&Te(lo,5),r&2){let f;Be(f=Ae())&&(o.videoElements=f)}},features:[gt],decls:0,vars:0,template:function(r,o){},encapsulation:2})};var fo=(e,t)=>t.id,uo=(e,t)=>t.url;function po(e,t){if(e&1&&(Kt(0,"div",1),jt(1,"safeHtml")),e&2){let r=q();yt("innerHTML",qt(1,1,r.videoConfig.heading),At)}}function ho(e,t){e&1&&(rt(0,"div",6),Kt(1,"div",14),nt())}function mo(e,t){if(e&1&&Kt(0,"source",8),e&2){let r=t.$implicit;yt("type",pe(r.mimeType))("src",r.url,Xt)}}function go(e,t){if(e&1){let r=Yt();rt(0,"cooee-mute-toggle",15),Nt("toggled",function(f){at(r),q();let l=Ut(6),a=q();return ct(a.onMuteToggled(f,l))}),nt()}if(e&2){q();let r=Ut(6);yt("muted",r.muted)("videoEl",r)}}function yo(e,t){if(e&1){let r=Yt();rt(0,"cooee-item-card",16),Nt("buttonClick",function(){at(r);let f=q(),l=f.$implicit,a=f.$index,d=Ut(6),v=q();return ct(v.addToCartClicked(null,l,a,d))})("click",function(f){at(r);let l=q(),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))}),nt()}if(e&2){q();let r=Jt(0);yt("item",r)}}function vo(e,t){if(e&1){let r=Yt();rt(0,"cooee-video-card",17),Nt("linkClicked",function(){at(r);let f=q().$implicit,l=q();return ct(l.sendTriggerClicked(f))}),nt()}if(e&2){q();let r=Jt(1);yt("card",r)}}function wo(e,t){if(e&1){let r=Yt();xe(0)(1),rt(2,"div",4)(3,"div",5),Nt("click",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))})("keydown.enter",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))})("keydown.space",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=Ut(6),x=q();return ct(x.onVideoTap(f,a,d,v))}),lt(4,ho,2,0,"div",6),rt(5,"video",7,0),Nt("mouseenter",function(){at(r);let f=Ut(6);q();let l=Jt(1);return ct(l&&f.play())})("mouseleave",function(){at(r);let f=Ut(6);q();let l=Jt(1);return ct(l&&f.pause())})("loadstart",function(){let f=at(r).$implicit,l=q();return ct(l.onVideoLoadStart(f.id))})("canplay",function(){let f=at(r).$implicit,l=q();return ct(l.onVideoCanPlay(f.id))}),Ct(7,mo,1,3,"source",8,uo),nt(),rt(9,"div",9),lt(10,go,1,2,"cooee-mute-toggle",10),nt()(),rt(11,"div",11),lt(12,yo,1,1,"cooee-item-card",12)(13,vo,1,1,"cooee-video-card",13),nt()()}if(e&2){let r=t.$implicit,o=q(),f=Jt(0),l=re(r.items[0]);Y();let a=re(r.card),d=l&&o.videoConfig.footerContent==o.VideoConfigFooterContent.FIRST_ITEM,v=a&&o.videoConfig.footerContent==o.VideoConfigFooterContent.CARD;Y(2),be("background-image",r.thumbnail?"url("+r.thumbnail+")":null),Y(),ft(o.isVideoLoading(r.id)?4:-1),Y(),yt("muted",!0),Ne("preload",f?"metadata":"none")("autoplay",null)("data-video-id",r.id),Y(2),It(r.sources),Y(3),ft(o.videoConfig.showMuteButton?10:-1),Y(2),ft(d?12:v?13:-1)}}var Ge=class e extends ee{VideoConfigFooterContent=nr;VideoConfigAutoPlay=rn;swiperOptions;videoLoadingStates=new Map;intersectionObserver;visibleVideos=new Set;constructor(){super(),this.hasSwiper=!0,this.swiperOptions={direction:"horizontal",effect:"slide",slidesPerView:"auto",spaceBetween:window.cooeePlaylistGap??24,mousewheel:{enabled:!0,forceToAxis:!0},navigation:{enabled:!1},freeMode:!0}}ngAfterViewInit(){this.setupIntersectionObserver(),this.playFirstVideo()}ngOnDestroy(){super.ngOnDestroy(),this.intersectionObserver?.disconnect()}addToCartClicked(t,r,o,f){let l=r.items?.[0],a=Zr.get().website?.canChangeVariantInCart;if(r.items?.length>1||l?.hasVariants()&&!a){this.onVideoTap(t,r,o,f);return}this.performCTA({cta:ne.ADD_TO_CART,item:l,video:r})}goToPDP(t,r){t?.stopPropagation(),t?.preventDefault();let o=r.items?.[0];this.performCTA({cta:ne.GO_TO_PRODUCT,item:o,video:r})}update(){}isVideoLoading(t){return this.videoLoadingStates.get(t)??!0}onVideoLoadStart(t){this.videoLoadingStates.set(t,!0)}onVideoCanPlay(t){this.videoLoadingStates.set(t,!1)}setupIntersectionObserver(){this.intersectionObserver=new IntersectionObserver(t=>{t.forEach(r=>{let o=r.target,f=o.dataset.videoId;f&&(r.isIntersecting?(this.visibleVideos.add(f),this.handleVideoVisibilityChange(o,!0)):(this.visibleVideos.delete(f),this.handleVideoVisibilityChange(o,!1)))})},{threshold:.5,rootMargin:"50px"}),setTimeout(()=>{this.videoElements.forEach(t=>{this.intersectionObserver?.observe(t.nativeElement)})},100)}handleVideoVisibilityChange(t,r){r?this.shouldAutoPlay()&&t.play().catch(()=>{}):t.pause()}shouldAutoPlay(){return this.videoConfig.autoPlay==="ON"||this.videoConfig.autoPlay==="ON_HOVER"&&this.isMobile}playFirstVideo(){}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-playlist"]],features:[gt],decls:7,vars:4,consts:[["videoEl",""],[1,"heading-text",3,"innerHTML"],[3,"options"],["ngProjectAs","swiper-slides",5,["swiper-slides"]],[1,"swiper-slide","video-card"],["role","button","tabindex","0","aria-label","Play video","aria-haspopup","dialog",1,"video-wrapper",3,"click","keydown.enter","keydown.space"],[1,"video-loading-overlay"],["width","100%","playsinline","","loop","",3,"mouseenter","mouseleave","loadstart","canplay","muted"],[3,"src","type"],[1,"video-controls"],[3,"muted","videoEl"],["role","region","aria-label","Video details",1,"video-footer"],["role","button","tabindex","0","aria-label","Product detail",3,"item"],[3,"card"],[1,"loading-spinner"],[3,"toggled","muted","videoEl"],["role","button","tabindex","0","aria-label","Product detail",3,"buttonClick","click","item"],[3,"linkClicked","card"]],template:function(r,o){r&1&&(xe(0)(1),lt(2,po,2,3,"div",1),rt(3,"cooee-swiper",2),Pr(4,3),Ct(5,wo,14,11,"div",4,fo),Ur(),nt()),r&2&&(re(!o.videoConfig.autoPlay||o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON),Y(),re(o.videoConfig.autoPlay===o.VideoConfigAutoPlay.ON_HOVER),Y(),ft(o.videoConfig.heading?2:-1),Y(),yt("options",o.swiperOptions),Y(2),It(o.videos))},dependencies:[cn,an,sn,ln,de],styles:[`:host{display:block}cooee-swiper.swiper{margin:8px;padding-top:25px;padding-bottom:25px}.video-wrapper{position:relative;cursor:pointer;outline:none;border-radius:var(--lc-media-radius, 8px);background-size:cover;background-position:center;background-repeat:no-repeat}.video-wrapper video{width:100%;height:var(--lc-video-card-height);object-fit:cover;border-radius:var(--lc-media-radius, 8px);position:relative}.video-card.swiper-slide{width:var(--lc-video-card-width);transition:transform .3s ease}.video-card.swiper-slide:hover{transform:scale(1.05)}@media (max-width: 768px),(prefers-reduced-motion: reduce){.video-card.swiper-slide{transition:none}.video-card.swiper-slide:hover{transform:none}}.video-controls{position:absolute;bottom:8px;z-index:10;right:8px;display:flex;gap:8px}cooee-item-card{cursor:pointer;padding-left:0!important;padding-right:0!important}cooee-item-card .item-image{width:50px;height:50px;display:none}cooee-item-card .item-info{font-size:14px;line-height:normal}cooee-item-card .item-info .item-name{-webkit-line-clamp:1;overflow:hidden}.video-loading-overlay{border-radius:var(--lc-media-radius, 8px)}
18
+ `],encapsulation:3})};function zn(e){e||(e=fe(Nr));let t=new Oe(r=>{if(e.destroyed){r.next();return}return e.onDestroy(r.next.bind(r))});return r=>r.pipe(Cr(t))}var _o=e=>({"cursor-grab":e}),bo=(e,t)=>t.url;function xo(e,t){if(e&1&&Kt(0,"source",7),e&2){let r=t.$implicit;yt("type",pe(r.mimeType))("src",r.url,Xt)}}var Xe=class e extends ee{video;isDragging=!1;hidden=!1;cdkDrag=fe(Re,{self:!0});untilDestroyed=zn();constructor(){super()}get popupClasses(){return this.hidden?["hidden"]:["visible"]}onClick(t){t.stopPropagation(),t.preventDefault(),this.onVideoClick()}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.closest(".letscooee-engagement");t&&(t.style.zIndex="10000"),this.cdkDrag.moved.pipe(this.untilDestroyed).subscribe(()=>this.isDragging=!0)}onVideoClick(){if(this.isDragging){this.isDragging=!1;return}this.hidden=!0,this.onVideoTap(null,this.video,0)}close(){this.hidden=!0;let t=(new Date().getTime()-this.triggerContext.startTime.getTime())/1e3;this.sendEvent("CE Trigger Closed",{duration:t})}engagementTriggerReceived(t){super.engagementTriggerReceived(t),this.video=this.videos[0]}update(){}onDialogClosed(){this.hidden=!1}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-popup"]],hostAttrs:["role","button","tabindex","0","aria-label","Open video popup "],hostVars:3,hostBindings:function(r,o){r&1&&Nt("keydown.enter",function(l){return o.onClick(l)})("keydown.space",function(l){return o.onClick(l)})("click",function(l){return o.onClick(l)}),r&2&&(vt("cdkDragBoundary","body"),$r(o.popupClasses))},features:[Rr([{directive:Re,inputs:["cdkDragBoundary","cdkDragBoundary"]}]),gt],decls:10,vars:4,consts:[[1,"popup-inner",3,"ngClass"],["type","button","aria-label","Close video popup",1,"close-button",3,"click"],["name","close","aria-hidden","true"],[1,"play-button"],["name","unmute","aria-hidden","true"],[1,"text"],["loop","","preload","auto","playsinline","","autoplay","",3,"muted"],[3,"src","type"]],template:function(r,o){r&1&&(rt(0,"div",0)(1,"button",1),Nt("click",function(l){return l.stopPropagation(),o.close()}),Kt(2,"cooee-icon",2),nt(),rt(3,"div",3),Kt(4,"cooee-icon",4),rt(5,"div",5),Dt(6,"Tap to unmute"),nt()(),rt(7,"video",6),Ct(8,xo,1,3,"source",7,bo),nt()()),r&2&&(yt("ngClass",Hr(2,_o,o.isDragging)),Y(7),yt("muted",!0),Y(),It(o.video.sources))},dependencies:[Me,on],styles:[`:host{position:fixed;display:block;right:24px;bottom:24px;min-height:150px;max-width:150px;box-shadow:0 25px 50px -12px #00000040}:host(.hidden){display:none}.popup-inner{display:flex;justify-content:center;align-items:center;position:relative}video{width:100%;border-radius:8px}.close-button{position:absolute;top:-14px;right:-14px;background-color:#00000080;border-radius:9999px;width:32px;height:32px;border:none;z-index:10;display:flex;justify-content:center;align-items:center}.play-button{display:flex;justify-content:center;align-items:center;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%) scale(1);transition:all .1s ease-in-out;z-index:999;flex-wrap:wrap;width:100%;max-width:130px;border-radius:5px;padding:5px 10px;background-color:#97979761;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}.play-button cooee-icon{width:14px;height:14px}.play-button .text{font-size:11px;line-height:1;color:#fff;font-weight:400;margin-left:5px;text-align:center}
19
+ `],encapsulation:3})};var Eo=(e,t)=>t.id,So=(e,t)=>t.url;function Co(e,t){if(e&1&&(Ot(0,"div",0),jt(1,"safeHtml")),e&2){let r=q();vt("innerHTML",qt(1,1,r.videoConfig.heading),At)}}function Io(e,t){if(e&1&&Ot(0,"source",9),e&2){let r=t.$implicit;vt("type",pe(r.mimeType))("src",r.url,Xt)}}function Oo(e,t){if(e&1){let r=Yt();Mt(0,"div",3),jr("click",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))})("keydown.enter",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))})("keydown.space",function(f){let l=at(r),a=l.$implicit,d=l.$index,v=q();return ct(v.onVideoTap(f,a,d))}),Ir(),Mt(1,"svg",4),Ot(2,"circle",5)(3,"circle",6),Pt(),Or(),Mt(4,"div",7)(5,"video",8),Ct(6,Io,1,3,"source",9,So),Pt()()()}if(e&2){let r=t.$implicit,o=t.$index;Ne("aria-label","Open video story "+(o+1)),Y(5),vt("muted",!0),Y(),It(r.sources)}}var Ke=class e extends ee{constructor(){super()}update(){}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=mt({type:e,selectors:[["cooee-video-stories"]],features:[gt],decls:4,vars:1,consts:[[1,"heading-text",3,"innerHTML"],[1,"video-stories"],["role","button","tabindex","0",1,"video-story"],["role","button","tabindex","0",1,"video-story",3,"click","keydown.enter","keydown.space"],["viewBox","0 0 100 100"],["cx","50","cy","50","r","48","fill","none","stroke-width","4"],["cx","50","cy","50","r","48","fill","none","stroke-width","4","stroke-linecap","round","stroke-dasharray","301.6","stroke-dashoffset","301.6",1,"video-story-circle"],[1,"video-wrapper"],["autoplay","","loop","","playsinline","","preload","metadata",3,"muted"],[3,"src","type"]],template:function(r,o){r&1&&(lt(0,Co,2,3,"div",0),Mt(1,"div",1),Ct(2,Oo,8,2,"div",2,Eo),Pt()),r&2&&(ft(o.videoConfig.heading?0:-1),Y(2),It(o.videos))},dependencies:[de],styles:[`:host{display:block}.video-stories{display:flex;overflow:auto;margin:.75rem;gap:.75rem;justify-content:center;align-items:center;scrollbar-width:none}.video-stories::-webkit-scrollbar{display:none}@media (max-width: 768px){.video-stories{justify-content:start!important}}.video-story{position:relative;width:5rem;height:5rem;cursor:pointer;flex-shrink:0}.video-story svg{position:absolute;top:0;left:0;width:100%;height:100%}.video-story svg circle:first-child{stroke:#d1d5db}.video-story svg circle:last-child{stroke:#3b82f6}.video-story .video-wrapper{width:100%;height:100%;border-radius:9999px;overflow:hidden}.video-story .video-wrapper video{width:100%;height:100%;object-fit:cover;border-radius:9999px}
20
20
  `],encapsulation:3})};qr("CooeeWidgetSDK");(async()=>{let e=await Jr(un),t=(r,o)=>{let f=fn(r,{injector:e.injector});customElements.define(o,f)};t(je,"cooee-sticky-atc"),t(Ue,"cooee-savings-bar"),t(Pe,"cooee-progressbar"),t(Ge,"cooee-video-playlist"),t(Xe,"cooee-video-popup"),t(Ke,"cooee-video-stories"),t(Xr,"cooee-product-options-picker"),sessionStorage.cooeeDebug&&import("./debugger.component-XYXLN5J5.js").then(r=>{t(r.DebuggerComponent,"cooee-debugger")})})();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@letscooee/web-sdk",
3
3
  "description": "Engage uniquely and boost conversions with AI-powered customer journeys driven by real-time intent",
4
- "version": "11.0.0-rc.12",
4
+ "version": "11.0.0-rc.13",
5
5
  "scripts": {
6
6
  "lint": "ng lint",
7
7
  "integrity": "./scripts/validate-integrity.sh",