@letscooee/web-sdk 13.0.22 → 13.1.1

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 ta,b as Kt,c as Ce,e as Cn,f as nr,g as na,h as ra,l as Xt}from"./chunk-UUU5YTKU.js";import{a as rr}from"./chunk-T6RU7RSX.js";import{$ as vi,$a as Lt,Aa as Gs,Ba as be,Ca as $s,D as Ot,Da as L,E as ct,Ea as js,Fa as Ws,I as Rt,Ja as zs,K as Mt,Ka as Ys,L as St,La as _e,Na as Sn,O as D,Oa as Qn,Pa as Zn,Qa as ne,Ra as lt,Sa as Pt,Wa as Be,X as Se,Xa as He,Y as _i,Ya as Ie,Za as qs,_ as Vs,_a as er,ab as tr,b as Rs,ba as Ue,bb as Ks,ca as En,cb as Ge,db as $e,fb as It,ga as Fs,ha as qt,hb as dt,ia as X,ib as ft,ja as J,jb as Ke,ka as ks,kb as he,lb as Xs,ma as bt,mb as bn,na as Ct,o as Ms,oa as $,pa as P,q as Ps,qa as U,ra as te,s as hi,sa as qe,sb as Js,t as gi,ta as ut,tb as Qs,u as Ls,ua as Jn,ub as Zs,v as ae,va as Us,wa as Bs,wb as ea,x as ye,xa as ge,y as Ee,ya as Hs,za as Le}from"./chunk-K77Q3IPF.js";import{a as _,b as k,c as yn,d as Os,e as jl,f as Wl,g as Xn}from"./chunk-V7UGKYBN.js";var da=jl((la,Ei)=>{"use strict";(function(e){if(typeof la=="object"&&typeof Ei<"u")Ei.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return(function r(i,o,s){function c(y,f){if(!o[y]){if(!i[y]){var E=typeof yn=="function"&&yn;if(!f&&E)return E(y,!0);if(l)return l(y,!0);var v=new Error("Cannot find module '"+y+"'");throw v.code="MODULE_NOT_FOUND",v}var N=o[y]={exports:{}};i[y][0].call(N.exports,function(G){var M=i[y][1][G];return c(M||G)},N,N.exports,r,i,o,s)}return o[y].exports}for(var l=typeof yn=="function"&&yn,h=0;h<s.length;h++)c(s[h]);return c})({1:[function(r,i,o){(function(s){"use strict";var c=s.MutationObserver||s.WebKitMutationObserver,l;if(c){var h=0,y=new c(G),f=s.document.createTextNode("");y.observe(f,{characterData:!0}),l=function(){f.data=h=++h%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=G,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var O=s.document.createElement("script");O.onreadystatechange=function(){G(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},s.document.documentElement.appendChild(O)}:l=function(){setTimeout(G,0)};var v,N=[];function G(){v=!0;for(var O,B,Z=N.length;Z;){for(B=N,N=[],O=-1;++O<Z;)B[O]();Z=N.length}v=!1}i.exports=M;function M(O){N.push(O)===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 c(){}var l={},h=["REJECTED"],y=["FULFILLED"],f=["PENDING"];i.exports=E;function E(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,x!==c&&M(this,x)}E.prototype.catch=function(x){return this.then(null,x)},E.prototype.then=function(x,j){if(typeof x!="function"&&this.state===y||typeof j!="function"&&this.state===h)return this;var F=new this.constructor(c);if(this.state!==f){var W=this.state===y?x:j;N(F,W,this.outcome)}else this.queue.push(new v(F,x,j));return F};function v(x,j,F){this.promise=x,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(x){l.resolve(this.promise,x)},v.prototype.otherCallFulfilled=function(x){N(this.promise,this.onFulfilled,x)},v.prototype.callRejected=function(x){l.reject(this.promise,x)},v.prototype.otherCallRejected=function(x){N(this.promise,this.onRejected,x)};function N(x,j,F){s(function(){var W;try{W=j(F)}catch(ie){return l.reject(x,ie)}W===x?l.reject(x,new TypeError("Cannot resolve promise with itself")):l.resolve(x,W)})}l.resolve=function(x,j){var F=O(G,j);if(F.status==="error")return l.reject(x,F.value);var W=F.value;if(W)M(x,W);else{x.state=y,x.outcome=j;for(var ie=-1,ee=x.queue.length;++ie<ee;)x.queue[ie].callFulfilled(j)}return x},l.reject=function(x,j){x.state=h,x.outcome=j;for(var F=-1,W=x.queue.length;++F<W;)x.queue[F].callRejected(j);return x};function G(x){var j=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof j=="function")return function(){j.apply(x,arguments)}}function M(x,j){var F=!1;function W(Me){F||(F=!0,l.reject(x,Me))}function ie(Me){F||(F=!0,l.resolve(x,Me))}function ee(){j(ie,W)}var me=O(ee);me.status==="error"&&W(me.value)}function O(x,j){var F={};try{F.value=x(j),F.status="success"}catch(W){F.status="error",F.value=W}return F}E.resolve=B;function B(x){return x instanceof this?x:l.resolve(new this(c),x)}E.reject=Z;function Z(x){var j=new this(c);return l.reject(j,x)}E.all=Oe;function Oe(x){var j=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=x.length,W=!1;if(!F)return this.resolve([]);for(var ie=new Array(F),ee=0,me=-1,Me=new this(c);++me<F;)st(x[me],me);return Me;function st(gn,Yn){j.resolve(gn).then(oi,function(zt){W||(W=!0,l.reject(Me,zt))});function oi(zt){ie[Yn]=zt,++ee===F&&!W&&(W=!0,l.resolve(Me,ie))}}}E.race=Re;function Re(x){var j=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=x.length,W=!1;if(!F)return this.resolve([]);for(var ie=-1,ee=new this(c);++ie<F;)me(x[ie]);return ee;function me(Me){j.resolve(Me).then(function(st){W||(W=!0,l.resolve(ee,st))},function(st){W||(W=!0,l.reject(ee,st))})}}},{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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function c(a,d){if(!(a instanceof d))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 h=l();function y(){try{if(!h||!h.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(a,d){a=a||[],d=d||{};try{return new Blob(a,d)}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,g=0;g<a.length;g+=1)m.append(a[g]);return m.getBlob(d.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(a,d){d&&a.then(function(u){d(null,u)},function(u){d(u)})}function N(a,d,u){typeof d=="function"&&a.then(d),typeof u=="function"&&a.catch(u)}function G(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",B=void 0,Z={},Oe=Object.prototype.toString,Re="readonly",x="readwrite";function j(a){for(var d=a.length,u=new ArrayBuffer(d),m=new Uint8Array(u),g=0;g<d;g++)m[g]=a.charCodeAt(g);return u}function F(a){return new E(function(d){var u=a.transaction(O,x),m=f([""]);u.objectStore(O).put(m,"key"),u.onabort=function(g){g.preventDefault(),g.stopPropagation(),d(!1)},u.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);d(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function W(a){return typeof B=="boolean"?E.resolve(B):F(a).then(function(d){return B=d,B})}function ie(a){var d=Z[a.name],u={};u.promise=new E(function(m,g){u.resolve=m,u.reject=g}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function ee(a){var d=Z[a.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function me(a,d){var u=Z[a.name],m=u.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Me(a,d){return new E(function(u,m){if(Z[a.name]=Z[a.name]||ds(),a.db)if(d)ie(a),a.db.close();else return u(a.db);var g=[a.name];d&&g.push(a.version);var p=h.open.apply(h,g);d&&(p.onupgradeneeded=function(S){var b=p.result;try{b.createObjectStore(a.storeName),S.oldVersion<=1&&b.createObjectStore(O)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+a.name+'" has been upgraded from version '+S.oldVersion+" to version "+S.newVersion+', but the storage "'+a.storeName+'" already exists.');else throw C}}),p.onerror=function(S){S.preventDefault(),m(p.error)},p.onsuccess=function(){var S=p.result;S.onversionchange=function(b){b.target.close()},u(S),ee(a)}})}function st(a){return Me(a,!1)}function gn(a){return Me(a,!0)}function Yn(a,d){if(!a.db)return!0;var u=!a.db.objectStoreNames.contains(a.storeName),m=a.version<a.db.version,g=a.version>a.db.version;if(m&&(a.version!==d&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),g||u){if(u){var p=a.db.version+1;p>a.version&&(a.version=p)}return!0}return!1}function oi(a){return new E(function(d,u){var m=new FileReader;m.onerror=u,m.onloadend=function(g){var p=btoa(g.target.result||"");d({__local_forage_encoded_blob:!0,data:p,type:a.type})},m.readAsBinaryString(a)})}function zt(a){var d=j(atob(a.data));return f([d],{type:a.type})}function ls(a){return a&&a.__local_forage_encoded_blob}function Wu(a){var d=this,u=d._initReady().then(function(){var m=Z[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return N(u,a,a),u}function zu(a){ie(a);for(var d=Z[a.name],u=d.forages,m=0;m<u.length;m++){var g=u[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return a.db=null,st(a).then(function(p){return a.db=p,Yn(a)?gn(a):p}).then(function(p){a.db=d.db=p;for(var S=0;S<u.length;S++)u[S]._dbInfo.db=p}).catch(function(p){throw me(a,p),p})}function at(a,d,u,m){m===void 0&&(m=1);try{var g=a.db.transaction(a.storeName,d);u(null,g)}catch(p){if(m>0&&(!a.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return E.resolve().then(function(){if(!a.db||p.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),gn(a)}).then(function(){return zu(a).then(function(){at(a,d,u,m-1)})}).catch(u);u(p)}}function ds(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Yu(a){var d=this,u={db:null};if(a)for(var m in a)u[m]=a[m];var g=Z[u.name];g||(g=ds(),Z[u.name]=g),g.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Wu);var p=[];function S(){return E.resolve()}for(var b=0;b<g.forages.length;b++){var C=g.forages[b];C!==d&&p.push(C._initReady().catch(S))}var I=g.forages.slice(0);return E.all(p).then(function(){return u.db=g.db,st(u)}).then(function(T){return u.db=T,Yn(u,d._defaultConfig.version)?gn(u):T}).then(function(T){u.db=g.db=T,d._dbInfo=u;for(var A=0;A<I.length;A++){var H=I[A];H!==d&&(H._dbInfo.db=u.db,H._dbInfo.version=u.version)}})}function qu(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.get(a);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),ls(T)&&(T=zt(T)),g(T)},I.onerror=function(){p(I.error)}}catch(T){p(T)}})}).catch(p)});return v(m,d),m}function Ku(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var A=I.result;if(A){var H=A.value;ls(H)&&(H=zt(H));var z=a(H,A.key,T++);z!==void 0?g(z):A.continue()}else g()},I.onerror=function(){p(I.error)}}catch(A){p(A)}})}).catch(p)});return v(m,d),m}function Xu(a,d,u){var m=this;a=G(a);var g=new E(function(p,S){var b;m.ready().then(function(){return b=m._dbInfo,Oe.call(d)==="[object Blob]"?W(b.db).then(function(C){return C?d:oi(d)}):d}).then(function(C){at(m._dbInfo,x,function(I,T){if(I)return S(I);try{var A=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var H=A.put(C,a);T.oncomplete=function(){C===void 0&&(C=null),p(C)},T.onabort=T.onerror=function(){var z=H.error?H.error:H.transaction.error;S(z)}}catch(z){S(z)}})}).catch(S)});return v(g,u),g}function Ju(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,x,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.delete(a);b.oncomplete=function(){g()},b.onerror=function(){p(I.error)},b.onabort=function(){var T=I.error?I.error:I.transaction.error;p(T)}}catch(T){p(T)}})}).catch(p)});return v(m,d),m}function Qu(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,x,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.clear();S.oncomplete=function(){m()},S.onabort=S.onerror=function(){var I=C.error?C.error:C.transaction.error;g(I)}}catch(I){g(I)}})}).catch(g)});return v(u,a),u}function Zu(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,Re,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){g(C.error)}}catch(I){g(I)}})}).catch(g)});return v(u,a),u}function el(a,d){var u=this,m=new E(function(g,p){if(a<0){g(null);return}u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var A=T.result;if(!A){g(null);return}a===0||I?g(A.key):(I=!0,A.advance(a))},T.onerror=function(){p(T.error)}}catch(A){p(A)}})}).catch(p)});return v(m,d),m}function tl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,Re,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return v(u,a),u}function nl(a,d){d=M.apply(this,arguments);var u=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||u.name,a.storeName=a.storeName||u.storeName);var m=this,g;if(!a.name)g=E.reject("Invalid arguments");else{var p=a.name===u.name&&m._dbInfo.db,S=p?E.resolve(m._dbInfo.db):st(a).then(function(b){var C=Z[a.name],I=C.forages;C.db=b;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=b;return b});a.storeName?g=S.then(function(b){if(b.objectStoreNames.contains(a.storeName)){var C=b.version+1;ie(a);var I=Z[a.name],T=I.forages;b.close();for(var A=0;A<T.length;A++){var H=T[A];H._dbInfo.db=null,H._dbInfo.version=C}var z=new E(function(Y,se){var oe=h.open(a.name,C);oe.onerror=function(Pe){var vn=oe.result;vn.close(),se(Pe)},oe.onupgradeneeded=function(){var Pe=oe.result;Pe.deleteObjectStore(a.storeName)},oe.onsuccess=function(){var Pe=oe.result;Pe.close(),Y(Pe)}});return z.then(function(Y){I.db=Y;for(var se=0;se<T.length;se++){var oe=T[se];oe._dbInfo.db=Y,ee(oe._dbInfo)}}).catch(function(Y){throw(me(a,Y)||E.resolve()).catch(function(){}),Y})}}):g=S.then(function(b){ie(a);var C=Z[a.name],I=C.forages;b.close();for(var T=0;T<I.length;T++){var A=I[T];A._dbInfo.db=null}var H=new E(function(z,Y){var se=h.deleteDatabase(a.name);se.onerror=function(){var oe=se.result;oe&&oe.close(),Y(se.error)},se.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},se.onsuccess=function(){var oe=se.result;oe&&oe.close(),z(oe)}});return H.then(function(z){C.db=z;for(var Y=0;Y<I.length;Y++){var se=I[Y];ee(se._dbInfo)}}).catch(function(z){throw(me(a,z)||E.resolve()).catch(function(){}),z})})}return v(g,d),g}var rl={_driver:"asyncStorage",_initStorage:Yu,_support:y(),iterate:Ku,getItem:qu,setItem:Xu,removeItem:Ju,clear:Qu,length:Zu,key:el,keys:tl,dropInstance:nl};function il(){return typeof openDatabase=="function"}var yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ol="~~local_forage_type~",fs=/^~~local_forage_type~([^~]+)~/,qn="__lfsc__:",si=qn.length,ai="arbf",ci="blob",ps="si08",ms="ui08",hs="uic8",gs="si16",_s="si32",vs="ur16",ys="ui32",Es="fl32",Ss="fl64",bs=si+ai.length,Cs=Object.prototype.toString;function Is(a){var d=a.length*.75,u=a.length,m,g=0,p,S,b,C;a[a.length-1]==="="&&(d--,a[a.length-2]==="="&&d--);var I=new ArrayBuffer(d),T=new Uint8Array(I);for(m=0;m<u;m+=4)p=yt.indexOf(a[m]),S=yt.indexOf(a[m+1]),b=yt.indexOf(a[m+2]),C=yt.indexOf(a[m+3]),T[g++]=p<<2|S>>4,T[g++]=(S&15)<<4|b>>2,T[g++]=(b&3)<<6|C&63;return I}function ui(a){var d=new Uint8Array(a),u="",m;for(m=0;m<d.length;m+=3)u+=yt[d[m]>>2],u+=yt[(d[m]&3)<<4|d[m+1]>>4],u+=yt[(d[m+1]&15)<<2|d[m+2]>>6],u+=yt[d[m+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function sl(a,d){var u="";if(a&&(u=Cs.call(a)),a&&(u==="[object ArrayBuffer]"||a.buffer&&Cs.call(a.buffer)==="[object ArrayBuffer]")){var m,g=qn;a instanceof ArrayBuffer?(m=a,g+=ai):(m=a.buffer,u==="[object Int8Array]"?g+=ps:u==="[object Uint8Array]"?g+=ms:u==="[object Uint8ClampedArray]"?g+=hs:u==="[object Int16Array]"?g+=gs:u==="[object Uint16Array]"?g+=vs:u==="[object Int32Array]"?g+=_s:u==="[object Uint32Array]"?g+=ys:u==="[object Float32Array]"?g+=Es:u==="[object Float64Array]"?g+=Ss:d(new Error("Failed to get type for BinaryArray"))),d(g+ui(m))}else if(u==="[object Blob]"){var p=new FileReader;p.onload=function(){var S=ol+a.type+"~"+ui(this.result);d(qn+ci+S)},p.readAsArrayBuffer(a)}else try{d(JSON.stringify(a))}catch(S){console.error("Couldn't convert value into a JSON string: ",a),d(null,S)}}function al(a){if(a.substring(0,si)!==qn)return JSON.parse(a);var d=a.substring(bs),u=a.substring(si,bs),m;if(u===ci&&fs.test(d)){var g=d.match(fs);m=g[1],d=d.substring(g[0].length)}var p=Is(d);switch(u){case ai:return p;case ci:return f([p],{type:m});case ps:return new Int8Array(p);case ms:return new Uint8Array(p);case hs:return new Uint8ClampedArray(p);case gs:return new Int16Array(p);case vs:return new Uint16Array(p);case _s:return new Int32Array(p);case ys:return new Uint32Array(p);case Es:return new Float32Array(p);case Ss:return new Float64Array(p);default:throw new Error("Unkown type: "+u)}}var li={serialize:sl,deserialize:al,stringToBuffer:Is,bufferToString:ui};function Ts(a,d,u,m){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function cl(a){var d=this,u={db:null};if(a)for(var m in a)u[m]=typeof a[m]!="string"?a[m].toString():a[m];var g=new E(function(p,S){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(b){return S(b)}u.db.transaction(function(b){Ts(b,u,function(){d._dbInfo=u,p()},function(C,I){S(I)})},S)});return u.serializer=li,g}function Et(a,d,u,m,g,p){a.executeSql(u,m,g,function(S,b){b.code===b.SYNTAX_ERR?S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(C,I){I.rows.length?p(C,b):Ts(C,d,function(){C.executeSql(u,m,g,p)},p)},p):p(S,b)},p)}function ul(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT * FROM "+S.storeName+" WHERE key = ? LIMIT 1",[a],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=S.serializer.deserialize(T)),g(T)},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function ll(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT * FROM "+S.storeName,[],function(C,I){for(var T=I.rows,A=T.length,H=0;H<A;H++){var z=T.item(H),Y=z.value;if(Y&&(Y=S.serializer.deserialize(Y)),Y=a(Y,z.key,H+1),Y!==void 0){g(Y);return}}g()},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function xs(a,d,u,m){var g=this;a=G(a);var p=new E(function(S,b){g.ready().then(function(){d===void 0&&(d=null);var C=d,I=g._dbInfo;I.serializer.serialize(d,function(T,A){A?b(A):I.db.transaction(function(H){Et(H,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[a,T],function(){S(C)},function(z,Y){b(Y)})},function(H){if(H.code===H.QUOTA_ERR){if(m>0){S(xs.apply(g,[a,C,u,m-1]));return}b(H)}})})}).catch(b)});return v(p,u),p}function dl(a,d,u){return xs.apply(this,[a,d,u,1])}function fl(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"DELETE FROM "+S.storeName+" WHERE key = ?",[a],function(){g()},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function pl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"DELETE FROM "+p.storeName,[],function(){m()},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function ml(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(b,C){var I=C.rows.item(0).c;m(I)},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function hl(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT key FROM "+S.storeName+" WHERE id = ? LIMIT 1",[a+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;g(T)},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function gl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"SELECT key FROM "+p.storeName,[],function(b,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function _l(a){return new E(function(d,u){a.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var S=[],b=0;b<p.rows.length;b++)S.push(p.rows.item(b).name);d({db:a,storeNames:S})},function(g,p){u(p)})},function(m){u(m)})})}function vl(a,d){d=M.apply(this,arguments);var u=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||u.name,a.storeName=a.storeName||u.storeName);var m=this,g;return a.name?g=new E(function(p){var S;a.name===u.name?S=m._dbInfo.db:S=openDatabase(a.name,"","",0),a.storeName?p({db:S,storeNames:[a.storeName]}):p(_l(S))}).then(function(p){return new E(function(S,b){p.db.transaction(function(C){function I(z){return new E(function(Y,se){C.executeSql("DROP TABLE IF EXISTS "+z,[],function(){Y()},function(oe,Pe){se(Pe)})})}for(var T=[],A=0,H=p.storeNames.length;A<H;A++)T.push(I(p.storeNames[A]));E.all(T).then(function(){S()}).catch(function(z){b(z)})},function(C){b(C)})})}):g=E.reject("Invalid arguments"),v(g,d),g}var yl={_driver:"webSQLStorage",_initStorage:cl,_support:il(),iterate:ll,getItem:ul,setItem:dl,removeItem:fl,clear:pl,length:ml,key:hl,keys:gl,dropInstance:vl};function El(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ds(a,d){var u=a.name+"/";return a.storeName!==d.storeName&&(u+=a.storeName+"/"),u}function Sl(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function bl(){return!Sl()||localStorage.length>0}function Cl(a){var d=this,u={};if(a)for(var m in a)u[m]=a[m];return u.keyPrefix=Ds(a,d._defaultConfig),bl()?(d._dbInfo=u,u.serializer=li,E.resolve()):E.reject()}function Il(a){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(m)===0&&localStorage.removeItem(p)}});return v(u,a),u}function Tl(a,d){var u=this;a=G(a);var m=u.ready().then(function(){var g=u._dbInfo,p=localStorage.getItem(g.keyPrefix+a);return p&&(p=g.serializer.deserialize(p)),p});return v(m,d),m}function xl(a,d){var u=this,m=u.ready().then(function(){for(var g=u._dbInfo,p=g.keyPrefix,S=p.length,b=localStorage.length,C=1,I=0;I<b;I++){var T=localStorage.key(I);if(T.indexOf(p)===0){var A=localStorage.getItem(T);if(A&&(A=g.serializer.deserialize(A)),A=a(A,T.substring(S),C++),A!==void 0)return A}}});return v(m,d),m}function Dl(a,d){var u=this,m=u.ready().then(function(){var g=u._dbInfo,p;try{p=localStorage.key(a)}catch{p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return v(m,d),m}function wl(a){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo,g=localStorage.length,p=[],S=0;S<g;S++){var b=localStorage.key(S);b.indexOf(m.keyPrefix)===0&&p.push(b.substring(m.keyPrefix.length))}return p});return v(u,a),u}function Al(a){var d=this,u=d.keys().then(function(m){return m.length});return v(u,a),u}function Nl(a,d){var u=this;a=G(a);var m=u.ready().then(function(){var g=u._dbInfo;localStorage.removeItem(g.keyPrefix+a)});return v(m,d),m}function Ol(a,d,u){var m=this;a=G(a);var g=m.ready().then(function(){d===void 0&&(d=null);var p=d;return new E(function(S,b){var C=m._dbInfo;C.serializer.serialize(d,function(I,T){if(T)b(T);else try{localStorage.setItem(C.keyPrefix+a,I),S(p)}catch(A){(A.name==="QuotaExceededError"||A.name==="NS_ERROR_DOM_QUOTA_REACHED")&&b(A),b(A)}})})});return v(g,u),g}function Rl(a,d){if(d=M.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var u=this.config();a.name=a.name||u.name,a.storeName=a.storeName||u.storeName}var m=this,g;return a.name?g=new E(function(p){a.storeName?p(Ds(a,m._defaultConfig)):p(a.name+"/")}).then(function(p){for(var S=localStorage.length-1;S>=0;S--){var b=localStorage.key(S);b.indexOf(p)===0&&localStorage.removeItem(b)}}):g=E.reject("Invalid arguments"),v(g,d),g}var Ml={_driver:"localStorageWrapper",_initStorage:Cl,_support:El(),iterate:xl,getItem:Tl,setItem:Ol,removeItem:Nl,clear:Il,length:Al,key:Dl,keys:wl,dropInstance:Rl},Pl=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},Ll=function(d,u){for(var m=d.length,g=0;g<m;){if(Pl(d[g],u))return!0;g++}return!1},ws=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},_n={},As={},Yt={INDEXEDDB:rl,WEBSQL:yl,LOCALSTORAGE:Ml},Vl=[Yt.INDEXEDDB._driver,Yt.WEBSQL._driver,Yt.LOCALSTORAGE._driver],Kn=["dropInstance"],di=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Kn),Fl={description:"",driver:Vl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function kl(a,d){a[d]=function(){var u=arguments;return a.ready().then(function(){return a[d].apply(a,u)})}}function fi(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var u in d)d.hasOwnProperty(u)&&(ws(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var Ul=(function(){function a(d){c(this,a);for(var u in Yt)if(Yt.hasOwnProperty(u)){var m=Yt[u],g=m._driver;this[u]=g,_n[g]||this.defineDriver(m)}this._defaultConfig=fi({},Fl),this._config=fi({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.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},a.prototype.defineDriver=function(u,m,g){var p=new E(function(S,b){try{var C=u._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){b(I);return}for(var T=di.concat("_initStorage"),A=0,H=T.length;A<H;A++){var z=T[A],Y=!Ll(Kn,z);if((Y||u[z])&&typeof u[z]!="function"){b(I);return}}var se=function(){for(var vn=function(Gl){return function(){var $l=new Error("Method "+Gl+" is not implemented by the current driver"),Ns=E.reject($l);return v(Ns,arguments[arguments.length-1]),Ns}},pi=0,Hl=Kn.length;pi<Hl;pi++){var mi=Kn[pi];u[mi]||(u[mi]=vn(mi))}};se();var oe=function(vn){_n[C]&&console.info("Redefining LocalForage driver: "+C),_n[C]=u,As[C]=vn,S()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(oe,b):oe(!!u._support):oe(!0)}catch(Pe){b(Pe)}});return N(p,m,g),p},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(u,m,g){var p=_n[u]?E.resolve(_n[u]):E.reject(new Error("Driver not found."));return N(p,m,g),p},a.prototype.getSerializer=function(u){var m=E.resolve(li);return N(m,u),m},a.prototype.ready=function(u){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return N(g,u,u),g},a.prototype.setDriver=function(u,m,g){var p=this;ws(u)||(u=[u]);var S=this._getSupportedDrivers(u);function b(){p._config.driver=p.driver()}function C(A){return p._extend(A),b(),p._ready=p._initStorage(p._config),p._ready}function I(A){return function(){var H=0;function z(){for(;H<A.length;){var Y=A[H];return H++,p._dbInfo=null,p._ready=null,p.getDriver(Y).then(C).catch(z)}b();var se=new Error("No available storage method found.");return p._driverSet=E.reject(se),p._driverSet}return z()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var A=S[0];return p._dbInfo=null,p._ready=null,p.getDriver(A).then(function(H){p._driver=H._driver,b(),p._wrapLibraryMethodsWithReady(),p._initDriver=I(S)})}).catch(function(){b();var A=new Error("No available storage method found.");return p._driverSet=E.reject(A),p._driverSet}),N(this._driverSet,m,g),this._driverSet},a.prototype.supports=function(u){return!!As[u]},a.prototype._extend=function(u){fi(this,u)},a.prototype._getSupportedDrivers=function(u){for(var m=[],g=0,p=u.length;g<p;g++){var S=u[g];this.supports(S)&&m.push(S)}return m},a.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=di.length;u<m;u++)kl(this,di[u])},a.prototype.createInstance=function(u){return new a(u)},a})(),Bl=new Ul;i.exports=Bl},{3:3}]},{},[4])(4)})});var Xe=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this}};var ia=0;function zl(e=document.head){return oa(Kt.styleURL,e,"cooee-global-styles")}function Yl(e=document.head){return oa(Kt.swiperStyleURL,e,"cooee-swiper-styles")}function oa(e,t=document.head,n){return new Promise(r=>{if(t.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",e),r()},t.appendChild(o)})}function In(e,t=document.head){if(!e)return;ia++;let n=document.createElement("style");n.id=`cooee-app-css-${ia}`,n.textContent=e,t.appendChild(n)}async function ir(){let e=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=e}async function or(e,t=!0){if(!e)return;let n=[];t&&n.push(Yl(e)),n.push(zl(e)),await Promise.all(n);let r=Xe.get().website.commonCSS;In(r,e)}var Xl={"[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"},sg=k(_({},Xl),{"[class.ng-submitted]":"isSubmitted"});var Jl=new Ls("",{providedIn:"root",factory:()=>sa}),sa="always";var Ql=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=_i({type:e});static \u0275inj=gi({})}return e})();var aa=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:Jl,useValue:n.callSetDisabledState??sa}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=_i({type:e});static \u0275inj=gi({imports:[Ql]})}return e})();var yi=(function(e){return e.SHOPIFY_CHECKOUT="shopify_checkout",e.THIRD_PARTY_CHECKOUT="third_party_checkout",e.CART_PAGE="cart_page",e.CART_DRAWER="cart_drawer",e})(yi||{});var je=(function(e){return e[e.NONE=0]="NONE",e[e.REJECT_POPUP=1]="REJECT_POPUP",e[e.ACCEPT_POPUP=2]="ACCEPT_POPUP",e[e.GO_TO_URL=4]="GO_TO_URL",e[e.SHARE=5]="SHARE",e[e.KEY_VALUE=100]="KEY_VALUE",e[e.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",e[e.ADD_TO_CART=102]="ADD_TO_CART",e[e.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",e[e.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",e[e.OPEN_CART=105]="OPEN_CART",e[e.SUBMIT_FORM=106]="SUBMIT_FORM",e[e.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",e[e.ADD_BUNDLE=108]="ADD_BUNDLE",e[e.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",e[e.BUY_NOW=110]="BUY_NOW",e[e.QUICK_VIEW=111]="QUICK_VIEW",e})(je||{});var Zl=(function(e){return e.FREE_SHIPPING="FREE_SHIPPING",e.DISCOUNT="DISCOUNT",e.FREE_AUTO_GIFT="FREE_AUTO_GIFT",e.FREE_GIFT_SELECT="FREE_GIFT_SELECT",e.UI_ONLY="UI_ONLY",e})(Zl||{});var We=class e{engagementContext=ae(Cn);eventData=ae(nr);constructor(){}executeCTA(t,n){let r,i=this.engagementContext();if(!i){Ce.error("Engagement context is not available; aborting executeCTA.");return}if(t===je.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t===je.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t===je.OPEN_CART)r="CE Open Cart Clicked",i.triggerData.redirectBehaviour=yi.CART_DRAWER;else{Ce.warn(`Unsupported CTA type: ${t}`);return}window.CooeeSDK.executeCTA(i,_({clickAction:{at:t}},n));let o=new na(r,this.eventData.props,i.triggerData);n?.video?o.setVideos(n.video):this.eventData.video&&o.setVideos(this.eventData.video),window.CooeeSDK.sendEvent(o)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=hi({token:e,factory:e.\u0275fac})};function ca(e,t){return[We,...ed(e,t)]}function ed(e,t){return[{provide:Cn,useValue:ct(e)},{provide:nr,useValue:_({},t)}]}var sr=class e{elementRef=ae(Rt);engagementService=ae(We);hasSwiper=!1;_engagementTrigger=ct(null);_triggerContext=ae(Cn);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let t=["letscooee-widget"],n=this._engagementTrigger();return t.push(`widget-${n?.shortID}`),t}get triggerContext(){return this._triggerContext()}set triggerContext(t){this._triggerContext.set(t),this._engagementTrigger.set(t.triggerData),this.engagementTriggerReceived(t.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){Ce.verbose("Init",this.constructor.name);let t=this.elementRef.nativeElement.shadowRoot;t&&(or(t,this.hasSwiper),In(this.engagementTrigger?.content?.innerCSS,t))}ngOnDestroy(){Ce.verbose("Destroying",this.constructor.name)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Se({type:e,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Zn(r.classes)},inputs:{triggerContext:"triggerContext"},decls:1,vars:0,template:function(n,r){n&1&&Hs(0)},encapsulation:2})};var ua=(e,t)=>t.id;function td(e,t){if(e&1&&(P(0,"span",6),ne(1),U()),e&2){L();let n=Ie(0);D(),lt(n)}}function nd(e,t){if(e&1){let n=Le();Be(0),P(1,"button",5),be("click",function(){let i=ye(n).$implicit,o=L().$implicit,s=L();return Ee(s.onOptionChange(o,i))}),X(2,td,2,1,"span",6),U()}if(e&2){let n=t.$implicit,r=L().$implicit,i=Ie(1),o=L(),s=n.name,c=He(n.displayName||n.name),l=n.swatch,h=i?n.hexColor??s:"",y=o.selectedOptions()[r.name]===s,f=!!(l!=null&&l.color),E=!!(!(l==null||l.image==null)&&l.image.url);D(),Sn("swatch-color-type",f)("swatch-image-type",E)("selected",y)("disabled",n.disabled),$("title",c)("ngStyle",o.getSwatchStyles(l,h)),qt("aria-checked",y?"true":"false")("data-value",s)("aria-disabled",n.disabled?"true":null)("aria-label",c),D(),J(!i&&!f&&!E?2:-1)}}function rd(e,t){if(e&1&&(P(0,"div"),Be(1),P(2,"div",1),ne(3),U(),P(4,"div",2),ne(5),U(),P(6,"div",3),bt(7,nd,3,16,"button",4,ua),U()()),e&2){let n=t.$implicit,r=L();Zn(er("option-group ",n.name.toLowerCase())),D(),He(r.hasHexColors(n)),D(2),Pt("",n.name,":"),D(2),lt(r.selectedOptions()[n.name]),D(),qt("aria-label",n.name),D(),Ct(n.optionValues)}}var Tn=e=>e.trim().toLowerCase(),ar=class e extends sr{selectedVariant=new En;item=he.required();selectedOptions=ct({});options=dt(()=>{let t=this.item();if(!t.options||t.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(t,this.engagementTrigger)}catch(n){Ce.error(n)}return t.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),t.options});matchedVariant=dt(()=>{let t=this.item(),n=this.selectedOptions();return t.vars.find(r=>t.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=dt(()=>{let t=this.item(),n=new Map;return t?.vars?.length&&t.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=Tn(o.name),c=o.value,l=n.get(s);l||n.set(s,l=new Map);let h=l.get(c);h||l.set(c,h=new Set),h.add(i)}}),n});constructor(){super(),ft(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let t=ft(()=>{let n=this.item();if(!n?.options)return;let r=_({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(c=>c.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),t.destroy()})}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.shadowRoot;if(!t)return;let n=Xe.get().website?.itemSwatchMapping;n&&In(n,t)}onOptionChange(t,n){let r=_({},this.selectedOptions());r[t.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(t){return!!t.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getSwatchStyles(t,n){let r={};return!t&&n?(r["--option-color"]=n,r["background-color"]=n,r):(t?.image?.url?r["background-image"]=`url("${t.image.url}")`:t?.color&&(r["--option-color"]=t.color,r["background-color"]=t.color),r)}getCandidateVariantsExcluding(t){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,c)=>{s.isAvailable&&i.add(c)});let o=i;for(let[s,c]of Object.entries(this.selectedOptions())){if(Tn(s)===Tn(t))continue;let l=r.get(Tn(s));if(!l)return new Set;let h=l.get(String(c));if(!h)return new Set;if(o=new Set([...o].filter(y=>h.has(y))),o.size===0)return o}return o}isOptionValueDisabledFast(t,n){let i=this.availabilityIndex().get(Tn(t.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let c=this.getCandidateVariantsExcluding(t.name);if(c.size===0)return!0;for(let l of c)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Se({type:e,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[Lt(ca()),vi],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,"swatch-color-type","swatch-image-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&bt(0,rd,9,7,"div",0,ua),n&2&&Ct(r.options())},dependencies:[ea,Qs,aa],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)));background-size:cover;background-position:center;background-repeat:no-repeat}.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 ta,b as Kt,c as Ce,e as Cn,f as nr,g as na,h as ra,l as Xt}from"./chunk-KCEU25FK.js";import{a as rr}from"./chunk-T6RU7RSX.js";import{$ as vi,$a as Lt,Aa as Gs,Ba as be,Ca as $s,D as Ot,Da as L,E as ct,Ea as js,Fa as Ws,I as Rt,Ja as zs,K as Mt,Ka as Ys,L as St,La as _e,Na as Sn,O as D,Oa as Qn,Pa as Zn,Qa as ne,Ra as lt,Sa as Pt,Wa as Be,X as Se,Xa as He,Y as _i,Ya as Ie,Za as qs,_ as Vs,_a as er,ab as tr,b as Rs,ba as Ue,bb as Ks,ca as En,cb as Ge,db as $e,fb as It,ga as Fs,ha as qt,hb as dt,ia as X,ib as ft,ja as J,jb as Ke,ka as ks,kb as he,lb as Xs,ma as bt,mb as bn,na as Ct,o as Ms,oa as $,pa as P,q as Ps,qa as U,ra as te,s as hi,sa as qe,sb as Js,t as gi,ta as ut,tb as Qs,u as Ls,ua as Jn,ub as Zs,v as ae,va as Us,wa as Bs,wb as ea,x as ye,xa as ge,y as Ee,ya as Hs,za as Le}from"./chunk-K77Q3IPF.js";import{a as _,b as k,c as yn,d as Os,e as jl,f as Wl,g as Xn}from"./chunk-V7UGKYBN.js";var da=jl((la,Ei)=>{"use strict";(function(e){if(typeof la=="object"&&typeof Ei<"u")Ei.exports=e();else if(typeof define=="function"&&define.amd)define([],e);else{var t;typeof window<"u"?t=window:typeof global<"u"?t=global:typeof self<"u"?t=self:t=this,t.localforage=e()}})(function(){var e,t,n;return(function r(i,o,s){function c(y,f){if(!o[y]){if(!i[y]){var E=typeof yn=="function"&&yn;if(!f&&E)return E(y,!0);if(l)return l(y,!0);var v=new Error("Cannot find module '"+y+"'");throw v.code="MODULE_NOT_FOUND",v}var N=o[y]={exports:{}};i[y][0].call(N.exports,function(G){var M=i[y][1][G];return c(M||G)},N,N.exports,r,i,o,s)}return o[y].exports}for(var l=typeof yn=="function"&&yn,h=0;h<s.length;h++)c(s[h]);return c})({1:[function(r,i,o){(function(s){"use strict";var c=s.MutationObserver||s.WebKitMutationObserver,l;if(c){var h=0,y=new c(G),f=s.document.createTextNode("");y.observe(f,{characterData:!0}),l=function(){f.data=h=++h%2}}else if(!s.setImmediate&&typeof s.MessageChannel<"u"){var E=new s.MessageChannel;E.port1.onmessage=G,l=function(){E.port2.postMessage(0)}}else"document"in s&&"onreadystatechange"in s.document.createElement("script")?l=function(){var O=s.document.createElement("script");O.onreadystatechange=function(){G(),O.onreadystatechange=null,O.parentNode.removeChild(O),O=null},s.document.documentElement.appendChild(O)}:l=function(){setTimeout(G,0)};var v,N=[];function G(){v=!0;for(var O,B,Z=N.length;Z;){for(B=N,N=[],O=-1;++O<Z;)B[O]();Z=N.length}v=!1}i.exports=M;function M(O){N.push(O)===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 c(){}var l={},h=["REJECTED"],y=["FULFILLED"],f=["PENDING"];i.exports=E;function E(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=f,this.queue=[],this.outcome=void 0,x!==c&&M(this,x)}E.prototype.catch=function(x){return this.then(null,x)},E.prototype.then=function(x,j){if(typeof x!="function"&&this.state===y||typeof j!="function"&&this.state===h)return this;var F=new this.constructor(c);if(this.state!==f){var W=this.state===y?x:j;N(F,W,this.outcome)}else this.queue.push(new v(F,x,j));return F};function v(x,j,F){this.promise=x,typeof j=="function"&&(this.onFulfilled=j,this.callFulfilled=this.otherCallFulfilled),typeof F=="function"&&(this.onRejected=F,this.callRejected=this.otherCallRejected)}v.prototype.callFulfilled=function(x){l.resolve(this.promise,x)},v.prototype.otherCallFulfilled=function(x){N(this.promise,this.onFulfilled,x)},v.prototype.callRejected=function(x){l.reject(this.promise,x)},v.prototype.otherCallRejected=function(x){N(this.promise,this.onRejected,x)};function N(x,j,F){s(function(){var W;try{W=j(F)}catch(ie){return l.reject(x,ie)}W===x?l.reject(x,new TypeError("Cannot resolve promise with itself")):l.resolve(x,W)})}l.resolve=function(x,j){var F=O(G,j);if(F.status==="error")return l.reject(x,F.value);var W=F.value;if(W)M(x,W);else{x.state=y,x.outcome=j;for(var ie=-1,ee=x.queue.length;++ie<ee;)x.queue[ie].callFulfilled(j)}return x},l.reject=function(x,j){x.state=h,x.outcome=j;for(var F=-1,W=x.queue.length;++F<W;)x.queue[F].callRejected(j);return x};function G(x){var j=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof j=="function")return function(){j.apply(x,arguments)}}function M(x,j){var F=!1;function W(Me){F||(F=!0,l.reject(x,Me))}function ie(Me){F||(F=!0,l.resolve(x,Me))}function ee(){j(ie,W)}var me=O(ee);me.status==="error"&&W(me.value)}function O(x,j){var F={};try{F.value=x(j),F.status="success"}catch(W){F.status="error",F.value=W}return F}E.resolve=B;function B(x){return x instanceof this?x:l.resolve(new this(c),x)}E.reject=Z;function Z(x){var j=new this(c);return l.reject(j,x)}E.all=Oe;function Oe(x){var j=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=x.length,W=!1;if(!F)return this.resolve([]);for(var ie=new Array(F),ee=0,me=-1,Me=new this(c);++me<F;)st(x[me],me);return Me;function st(gn,Yn){j.resolve(gn).then(oi,function(zt){W||(W=!0,l.reject(Me,zt))});function oi(zt){ie[Yn]=zt,++ee===F&&!W&&(W=!0,l.resolve(Me,ie))}}}E.race=Re;function Re(x){var j=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var F=x.length,W=!1;if(!F)return this.resolve([]);for(var ie=-1,ee=new this(c);++ie<F;)me(x[ie]);return ee;function me(Me){j.resolve(Me).then(function(st){W||(W=!0,l.resolve(ee,st))},function(st){W||(W=!0,l.reject(ee,st))})}}},{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(a){return typeof a}:function(a){return a&&typeof Symbol=="function"&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a};function c(a,d){if(!(a instanceof d))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 h=l();function y(){try{if(!h||!h.open)return!1;var a=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),d=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!a||d)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function f(a,d){a=a||[],d=d||{};try{return new Blob(a,d)}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,g=0;g<a.length;g+=1)m.append(a[g]);return m.getBlob(d.type)}}typeof Promise>"u"&&r(3);var E=Promise;function v(a,d){d&&a.then(function(u){d(null,u)},function(u){d(u)})}function N(a,d,u){typeof d=="function"&&a.then(d),typeof u=="function"&&a.catch(u)}function G(a){return typeof a!="string"&&(console.warn(a+" used as a key, but it is not a string."),a=String(a)),a}function M(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var O="local-forage-detect-blob-support",B=void 0,Z={},Oe=Object.prototype.toString,Re="readonly",x="readwrite";function j(a){for(var d=a.length,u=new ArrayBuffer(d),m=new Uint8Array(u),g=0;g<d;g++)m[g]=a.charCodeAt(g);return u}function F(a){return new E(function(d){var u=a.transaction(O,x),m=f([""]);u.objectStore(O).put(m,"key"),u.onabort=function(g){g.preventDefault(),g.stopPropagation(),d(!1)},u.oncomplete=function(){var g=navigator.userAgent.match(/Chrome\/(\d+)/),p=navigator.userAgent.match(/Edge\//);d(p||!g||parseInt(g[1],10)>=43)}}).catch(function(){return!1})}function W(a){return typeof B=="boolean"?E.resolve(B):F(a).then(function(d){return B=d,B})}function ie(a){var d=Z[a.name],u={};u.promise=new E(function(m,g){u.resolve=m,u.reject=g}),d.deferredOperations.push(u),d.dbReady?d.dbReady=d.dbReady.then(function(){return u.promise}):d.dbReady=u.promise}function ee(a){var d=Z[a.name],u=d.deferredOperations.pop();if(u)return u.resolve(),u.promise}function me(a,d){var u=Z[a.name],m=u.deferredOperations.pop();if(m)return m.reject(d),m.promise}function Me(a,d){return new E(function(u,m){if(Z[a.name]=Z[a.name]||ds(),a.db)if(d)ie(a),a.db.close();else return u(a.db);var g=[a.name];d&&g.push(a.version);var p=h.open.apply(h,g);d&&(p.onupgradeneeded=function(S){var b=p.result;try{b.createObjectStore(a.storeName),S.oldVersion<=1&&b.createObjectStore(O)}catch(C){if(C.name==="ConstraintError")console.warn('The database "'+a.name+'" has been upgraded from version '+S.oldVersion+" to version "+S.newVersion+', but the storage "'+a.storeName+'" already exists.');else throw C}}),p.onerror=function(S){S.preventDefault(),m(p.error)},p.onsuccess=function(){var S=p.result;S.onversionchange=function(b){b.target.close()},u(S),ee(a)}})}function st(a){return Me(a,!1)}function gn(a){return Me(a,!0)}function Yn(a,d){if(!a.db)return!0;var u=!a.db.objectStoreNames.contains(a.storeName),m=a.version<a.db.version,g=a.version>a.db.version;if(m&&(a.version!==d&&console.warn('The database "'+a.name+`" can't be downgraded from version `+a.db.version+" to version "+a.version+"."),a.version=a.db.version),g||u){if(u){var p=a.db.version+1;p>a.version&&(a.version=p)}return!0}return!1}function oi(a){return new E(function(d,u){var m=new FileReader;m.onerror=u,m.onloadend=function(g){var p=btoa(g.target.result||"");d({__local_forage_encoded_blob:!0,data:p,type:a.type})},m.readAsBinaryString(a)})}function zt(a){var d=j(atob(a.data));return f([d],{type:a.type})}function ls(a){return a&&a.__local_forage_encoded_blob}function Wu(a){var d=this,u=d._initReady().then(function(){var m=Z[d._dbInfo.name];if(m&&m.dbReady)return m.dbReady});return N(u,a,a),u}function zu(a){ie(a);for(var d=Z[a.name],u=d.forages,m=0;m<u.length;m++){var g=u[m];g._dbInfo.db&&(g._dbInfo.db.close(),g._dbInfo.db=null)}return a.db=null,st(a).then(function(p){return a.db=p,Yn(a)?gn(a):p}).then(function(p){a.db=d.db=p;for(var S=0;S<u.length;S++)u[S]._dbInfo.db=p}).catch(function(p){throw me(a,p),p})}function at(a,d,u,m){m===void 0&&(m=1);try{var g=a.db.transaction(a.storeName,d);u(null,g)}catch(p){if(m>0&&(!a.db||p.name==="InvalidStateError"||p.name==="NotFoundError"))return E.resolve().then(function(){if(!a.db||p.name==="NotFoundError"&&!a.db.objectStoreNames.contains(a.storeName)&&a.version<=a.db.version)return a.db&&(a.version=a.db.version+1),gn(a)}).then(function(){return zu(a).then(function(){at(a,d,u,m-1)})}).catch(u);u(p)}}function ds(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Yu(a){var d=this,u={db:null};if(a)for(var m in a)u[m]=a[m];var g=Z[u.name];g||(g=ds(),Z[u.name]=g),g.forages.push(d),d._initReady||(d._initReady=d.ready,d.ready=Wu);var p=[];function S(){return E.resolve()}for(var b=0;b<g.forages.length;b++){var C=g.forages[b];C!==d&&p.push(C._initReady().catch(S))}var I=g.forages.slice(0);return E.all(p).then(function(){return u.db=g.db,st(u)}).then(function(T){return u.db=T,Yn(u,d._defaultConfig.version)?gn(u):T}).then(function(T){u.db=g.db=T,d._dbInfo=u;for(var A=0;A<I.length;A++){var H=I[A];H!==d&&(H._dbInfo.db=u.db,H._dbInfo.version=u.version)}})}function qu(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.get(a);I.onsuccess=function(){var T=I.result;T===void 0&&(T=null),ls(T)&&(T=zt(T)),g(T)},I.onerror=function(){p(I.error)}}catch(T){p(T)}})}).catch(p)});return v(m,d),m}function Ku(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.openCursor(),T=1;I.onsuccess=function(){var A=I.result;if(A){var H=A.value;ls(H)&&(H=zt(H));var z=a(H,A.key,T++);z!==void 0?g(z):A.continue()}else g()},I.onerror=function(){p(I.error)}}catch(A){p(A)}})}).catch(p)});return v(m,d),m}function Xu(a,d,u){var m=this;a=G(a);var g=new E(function(p,S){var b;m.ready().then(function(){return b=m._dbInfo,Oe.call(d)==="[object Blob]"?W(b.db).then(function(C){return C?d:oi(d)}):d}).then(function(C){at(m._dbInfo,x,function(I,T){if(I)return S(I);try{var A=T.objectStore(m._dbInfo.storeName);C===null&&(C=void 0);var H=A.put(C,a);T.oncomplete=function(){C===void 0&&(C=null),p(C)},T.onabort=T.onerror=function(){var z=H.error?H.error:H.transaction.error;S(z)}}catch(z){S(z)}})}).catch(S)});return v(g,u),g}function Ju(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){at(u._dbInfo,x,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=C.delete(a);b.oncomplete=function(){g()},b.onerror=function(){p(I.error)},b.onabort=function(){var T=I.error?I.error:I.transaction.error;p(T)}}catch(T){p(T)}})}).catch(p)});return v(m,d),m}function Qu(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,x,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.clear();S.oncomplete=function(){m()},S.onabort=S.onerror=function(){var I=C.error?C.error:C.transaction.error;g(I)}}catch(I){g(I)}})}).catch(g)});return v(u,a),u}function Zu(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,Re,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.count();C.onsuccess=function(){m(C.result)},C.onerror=function(){g(C.error)}}catch(I){g(I)}})}).catch(g)});return v(u,a),u}function el(a,d){var u=this,m=new E(function(g,p){if(a<0){g(null);return}u.ready().then(function(){at(u._dbInfo,Re,function(S,b){if(S)return p(S);try{var C=b.objectStore(u._dbInfo.storeName),I=!1,T=C.openKeyCursor();T.onsuccess=function(){var A=T.result;if(!A){g(null);return}a===0||I?g(A.key):(I=!0,A.advance(a))},T.onerror=function(){p(T.error)}}catch(A){p(A)}})}).catch(p)});return v(m,d),m}function tl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){at(d._dbInfo,Re,function(p,S){if(p)return g(p);try{var b=S.objectStore(d._dbInfo.storeName),C=b.openKeyCursor(),I=[];C.onsuccess=function(){var T=C.result;if(!T){m(I);return}I.push(T.key),T.continue()},C.onerror=function(){g(C.error)}}catch(T){g(T)}})}).catch(g)});return v(u,a),u}function nl(a,d){d=M.apply(this,arguments);var u=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||u.name,a.storeName=a.storeName||u.storeName);var m=this,g;if(!a.name)g=E.reject("Invalid arguments");else{var p=a.name===u.name&&m._dbInfo.db,S=p?E.resolve(m._dbInfo.db):st(a).then(function(b){var C=Z[a.name],I=C.forages;C.db=b;for(var T=0;T<I.length;T++)I[T]._dbInfo.db=b;return b});a.storeName?g=S.then(function(b){if(b.objectStoreNames.contains(a.storeName)){var C=b.version+1;ie(a);var I=Z[a.name],T=I.forages;b.close();for(var A=0;A<T.length;A++){var H=T[A];H._dbInfo.db=null,H._dbInfo.version=C}var z=new E(function(Y,se){var oe=h.open(a.name,C);oe.onerror=function(Pe){var vn=oe.result;vn.close(),se(Pe)},oe.onupgradeneeded=function(){var Pe=oe.result;Pe.deleteObjectStore(a.storeName)},oe.onsuccess=function(){var Pe=oe.result;Pe.close(),Y(Pe)}});return z.then(function(Y){I.db=Y;for(var se=0;se<T.length;se++){var oe=T[se];oe._dbInfo.db=Y,ee(oe._dbInfo)}}).catch(function(Y){throw(me(a,Y)||E.resolve()).catch(function(){}),Y})}}):g=S.then(function(b){ie(a);var C=Z[a.name],I=C.forages;b.close();for(var T=0;T<I.length;T++){var A=I[T];A._dbInfo.db=null}var H=new E(function(z,Y){var se=h.deleteDatabase(a.name);se.onerror=function(){var oe=se.result;oe&&oe.close(),Y(se.error)},se.onblocked=function(){console.warn('dropInstance blocked for database "'+a.name+'" until all open connections are closed')},se.onsuccess=function(){var oe=se.result;oe&&oe.close(),z(oe)}});return H.then(function(z){C.db=z;for(var Y=0;Y<I.length;Y++){var se=I[Y];ee(se._dbInfo)}}).catch(function(z){throw(me(a,z)||E.resolve()).catch(function(){}),z})})}return v(g,d),g}var rl={_driver:"asyncStorage",_initStorage:Yu,_support:y(),iterate:Ku,getItem:qu,setItem:Xu,removeItem:Ju,clear:Qu,length:Zu,key:el,keys:tl,dropInstance:nl};function il(){return typeof openDatabase=="function"}var yt="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ol="~~local_forage_type~",fs=/^~~local_forage_type~([^~]+)~/,qn="__lfsc__:",si=qn.length,ai="arbf",ci="blob",ps="si08",ms="ui08",hs="uic8",gs="si16",_s="si32",vs="ur16",ys="ui32",Es="fl32",Ss="fl64",bs=si+ai.length,Cs=Object.prototype.toString;function Is(a){var d=a.length*.75,u=a.length,m,g=0,p,S,b,C;a[a.length-1]==="="&&(d--,a[a.length-2]==="="&&d--);var I=new ArrayBuffer(d),T=new Uint8Array(I);for(m=0;m<u;m+=4)p=yt.indexOf(a[m]),S=yt.indexOf(a[m+1]),b=yt.indexOf(a[m+2]),C=yt.indexOf(a[m+3]),T[g++]=p<<2|S>>4,T[g++]=(S&15)<<4|b>>2,T[g++]=(b&3)<<6|C&63;return I}function ui(a){var d=new Uint8Array(a),u="",m;for(m=0;m<d.length;m+=3)u+=yt[d[m]>>2],u+=yt[(d[m]&3)<<4|d[m+1]>>4],u+=yt[(d[m+1]&15)<<2|d[m+2]>>6],u+=yt[d[m+2]&63];return d.length%3===2?u=u.substring(0,u.length-1)+"=":d.length%3===1&&(u=u.substring(0,u.length-2)+"=="),u}function sl(a,d){var u="";if(a&&(u=Cs.call(a)),a&&(u==="[object ArrayBuffer]"||a.buffer&&Cs.call(a.buffer)==="[object ArrayBuffer]")){var m,g=qn;a instanceof ArrayBuffer?(m=a,g+=ai):(m=a.buffer,u==="[object Int8Array]"?g+=ps:u==="[object Uint8Array]"?g+=ms:u==="[object Uint8ClampedArray]"?g+=hs:u==="[object Int16Array]"?g+=gs:u==="[object Uint16Array]"?g+=vs:u==="[object Int32Array]"?g+=_s:u==="[object Uint32Array]"?g+=ys:u==="[object Float32Array]"?g+=Es:u==="[object Float64Array]"?g+=Ss:d(new Error("Failed to get type for BinaryArray"))),d(g+ui(m))}else if(u==="[object Blob]"){var p=new FileReader;p.onload=function(){var S=ol+a.type+"~"+ui(this.result);d(qn+ci+S)},p.readAsArrayBuffer(a)}else try{d(JSON.stringify(a))}catch(S){console.error("Couldn't convert value into a JSON string: ",a),d(null,S)}}function al(a){if(a.substring(0,si)!==qn)return JSON.parse(a);var d=a.substring(bs),u=a.substring(si,bs),m;if(u===ci&&fs.test(d)){var g=d.match(fs);m=g[1],d=d.substring(g[0].length)}var p=Is(d);switch(u){case ai:return p;case ci:return f([p],{type:m});case ps:return new Int8Array(p);case ms:return new Uint8Array(p);case hs:return new Uint8ClampedArray(p);case gs:return new Int16Array(p);case vs:return new Uint16Array(p);case _s:return new Int32Array(p);case ys:return new Uint32Array(p);case Es:return new Float32Array(p);case Ss:return new Float64Array(p);default:throw new Error("Unkown type: "+u)}}var li={serialize:sl,deserialize:al,stringToBuffer:Is,bufferToString:ui};function Ts(a,d,u,m){a.executeSql("CREATE TABLE IF NOT EXISTS "+d.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],u,m)}function cl(a){var d=this,u={db:null};if(a)for(var m in a)u[m]=typeof a[m]!="string"?a[m].toString():a[m];var g=new E(function(p,S){try{u.db=openDatabase(u.name,String(u.version),u.description,u.size)}catch(b){return S(b)}u.db.transaction(function(b){Ts(b,u,function(){d._dbInfo=u,p()},function(C,I){S(I)})},S)});return u.serializer=li,g}function Et(a,d,u,m,g,p){a.executeSql(u,m,g,function(S,b){b.code===b.SYNTAX_ERR?S.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[d.storeName],function(C,I){I.rows.length?p(C,b):Ts(C,d,function(){C.executeSql(u,m,g,p)},p)},p):p(S,b)},p)}function ul(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT * FROM "+S.storeName+" WHERE key = ? LIMIT 1",[a],function(C,I){var T=I.rows.length?I.rows.item(0).value:null;T&&(T=S.serializer.deserialize(T)),g(T)},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function ll(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT * FROM "+S.storeName,[],function(C,I){for(var T=I.rows,A=T.length,H=0;H<A;H++){var z=T.item(H),Y=z.value;if(Y&&(Y=S.serializer.deserialize(Y)),Y=a(Y,z.key,H+1),Y!==void 0){g(Y);return}}g()},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function xs(a,d,u,m){var g=this;a=G(a);var p=new E(function(S,b){g.ready().then(function(){d===void 0&&(d=null);var C=d,I=g._dbInfo;I.serializer.serialize(d,function(T,A){A?b(A):I.db.transaction(function(H){Et(H,I,"INSERT OR REPLACE INTO "+I.storeName+" (key, value) VALUES (?, ?)",[a,T],function(){S(C)},function(z,Y){b(Y)})},function(H){if(H.code===H.QUOTA_ERR){if(m>0){S(xs.apply(g,[a,C,u,m-1]));return}b(H)}})})}).catch(b)});return v(p,u),p}function dl(a,d,u){return xs.apply(this,[a,d,u,1])}function fl(a,d){var u=this;a=G(a);var m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"DELETE FROM "+S.storeName+" WHERE key = ?",[a],function(){g()},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function pl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"DELETE FROM "+p.storeName,[],function(){m()},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function ml(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"SELECT COUNT(key) as c FROM "+p.storeName,[],function(b,C){var I=C.rows.item(0).c;m(I)},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function hl(a,d){var u=this,m=new E(function(g,p){u.ready().then(function(){var S=u._dbInfo;S.db.transaction(function(b){Et(b,S,"SELECT key FROM "+S.storeName+" WHERE id = ? LIMIT 1",[a+1],function(C,I){var T=I.rows.length?I.rows.item(0).key:null;g(T)},function(C,I){p(I)})})}).catch(p)});return v(m,d),m}function gl(a){var d=this,u=new E(function(m,g){d.ready().then(function(){var p=d._dbInfo;p.db.transaction(function(S){Et(S,p,"SELECT key FROM "+p.storeName,[],function(b,C){for(var I=[],T=0;T<C.rows.length;T++)I.push(C.rows.item(T).key);m(I)},function(b,C){g(C)})})}).catch(g)});return v(u,a),u}function _l(a){return new E(function(d,u){a.transaction(function(m){m.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(g,p){for(var S=[],b=0;b<p.rows.length;b++)S.push(p.rows.item(b).name);d({db:a,storeNames:S})},function(g,p){u(p)})},function(m){u(m)})})}function vl(a,d){d=M.apply(this,arguments);var u=this.config();a=typeof a!="function"&&a||{},a.name||(a.name=a.name||u.name,a.storeName=a.storeName||u.storeName);var m=this,g;return a.name?g=new E(function(p){var S;a.name===u.name?S=m._dbInfo.db:S=openDatabase(a.name,"","",0),a.storeName?p({db:S,storeNames:[a.storeName]}):p(_l(S))}).then(function(p){return new E(function(S,b){p.db.transaction(function(C){function I(z){return new E(function(Y,se){C.executeSql("DROP TABLE IF EXISTS "+z,[],function(){Y()},function(oe,Pe){se(Pe)})})}for(var T=[],A=0,H=p.storeNames.length;A<H;A++)T.push(I(p.storeNames[A]));E.all(T).then(function(){S()}).catch(function(z){b(z)})},function(C){b(C)})})}):g=E.reject("Invalid arguments"),v(g,d),g}var yl={_driver:"webSQLStorage",_initStorage:cl,_support:il(),iterate:ll,getItem:ul,setItem:dl,removeItem:fl,clear:pl,length:ml,key:hl,keys:gl,dropInstance:vl};function El(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function Ds(a,d){var u=a.name+"/";return a.storeName!==d.storeName&&(u+=a.storeName+"/"),u}function Sl(){var a="_localforage_support_test";try{return localStorage.setItem(a,!0),localStorage.removeItem(a),!1}catch{return!0}}function bl(){return!Sl()||localStorage.length>0}function Cl(a){var d=this,u={};if(a)for(var m in a)u[m]=a[m];return u.keyPrefix=Ds(a,d._defaultConfig),bl()?(d._dbInfo=u,u.serializer=li,E.resolve()):E.reject()}function Il(a){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo.keyPrefix,g=localStorage.length-1;g>=0;g--){var p=localStorage.key(g);p.indexOf(m)===0&&localStorage.removeItem(p)}});return v(u,a),u}function Tl(a,d){var u=this;a=G(a);var m=u.ready().then(function(){var g=u._dbInfo,p=localStorage.getItem(g.keyPrefix+a);return p&&(p=g.serializer.deserialize(p)),p});return v(m,d),m}function xl(a,d){var u=this,m=u.ready().then(function(){for(var g=u._dbInfo,p=g.keyPrefix,S=p.length,b=localStorage.length,C=1,I=0;I<b;I++){var T=localStorage.key(I);if(T.indexOf(p)===0){var A=localStorage.getItem(T);if(A&&(A=g.serializer.deserialize(A)),A=a(A,T.substring(S),C++),A!==void 0)return A}}});return v(m,d),m}function Dl(a,d){var u=this,m=u.ready().then(function(){var g=u._dbInfo,p;try{p=localStorage.key(a)}catch{p=null}return p&&(p=p.substring(g.keyPrefix.length)),p});return v(m,d),m}function wl(a){var d=this,u=d.ready().then(function(){for(var m=d._dbInfo,g=localStorage.length,p=[],S=0;S<g;S++){var b=localStorage.key(S);b.indexOf(m.keyPrefix)===0&&p.push(b.substring(m.keyPrefix.length))}return p});return v(u,a),u}function Al(a){var d=this,u=d.keys().then(function(m){return m.length});return v(u,a),u}function Nl(a,d){var u=this;a=G(a);var m=u.ready().then(function(){var g=u._dbInfo;localStorage.removeItem(g.keyPrefix+a)});return v(m,d),m}function Ol(a,d,u){var m=this;a=G(a);var g=m.ready().then(function(){d===void 0&&(d=null);var p=d;return new E(function(S,b){var C=m._dbInfo;C.serializer.serialize(d,function(I,T){if(T)b(T);else try{localStorage.setItem(C.keyPrefix+a,I),S(p)}catch(A){(A.name==="QuotaExceededError"||A.name==="NS_ERROR_DOM_QUOTA_REACHED")&&b(A),b(A)}})})});return v(g,u),g}function Rl(a,d){if(d=M.apply(this,arguments),a=typeof a!="function"&&a||{},!a.name){var u=this.config();a.name=a.name||u.name,a.storeName=a.storeName||u.storeName}var m=this,g;return a.name?g=new E(function(p){a.storeName?p(Ds(a,m._defaultConfig)):p(a.name+"/")}).then(function(p){for(var S=localStorage.length-1;S>=0;S--){var b=localStorage.key(S);b.indexOf(p)===0&&localStorage.removeItem(b)}}):g=E.reject("Invalid arguments"),v(g,d),g}var Ml={_driver:"localStorageWrapper",_initStorage:Cl,_support:El(),iterate:xl,getItem:Tl,setItem:Ol,removeItem:Nl,clear:Il,length:Al,key:Dl,keys:wl,dropInstance:Rl},Pl=function(d,u){return d===u||typeof d=="number"&&typeof u=="number"&&isNaN(d)&&isNaN(u)},Ll=function(d,u){for(var m=d.length,g=0;g<m;){if(Pl(d[g],u))return!0;g++}return!1},ws=Array.isArray||function(a){return Object.prototype.toString.call(a)==="[object Array]"},_n={},As={},Yt={INDEXEDDB:rl,WEBSQL:yl,LOCALSTORAGE:Ml},Vl=[Yt.INDEXEDDB._driver,Yt.WEBSQL._driver,Yt.LOCALSTORAGE._driver],Kn=["dropInstance"],di=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(Kn),Fl={description:"",driver:Vl.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function kl(a,d){a[d]=function(){var u=arguments;return a.ready().then(function(){return a[d].apply(a,u)})}}function fi(){for(var a=1;a<arguments.length;a++){var d=arguments[a];if(d)for(var u in d)d.hasOwnProperty(u)&&(ws(d[u])?arguments[0][u]=d[u].slice():arguments[0][u]=d[u])}return arguments[0]}var Ul=(function(){function a(d){c(this,a);for(var u in Yt)if(Yt.hasOwnProperty(u)){var m=Yt[u],g=m._driver;this[u]=g,_n[g]||this.defineDriver(m)}this._defaultConfig=fi({},Fl),this._config=fi({},this._defaultConfig,d),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return a.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},a.prototype.defineDriver=function(u,m,g){var p=new E(function(S,b){try{var C=u._driver,I=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!u._driver){b(I);return}for(var T=di.concat("_initStorage"),A=0,H=T.length;A<H;A++){var z=T[A],Y=!Ll(Kn,z);if((Y||u[z])&&typeof u[z]!="function"){b(I);return}}var se=function(){for(var vn=function(Gl){return function(){var $l=new Error("Method "+Gl+" is not implemented by the current driver"),Ns=E.reject($l);return v(Ns,arguments[arguments.length-1]),Ns}},pi=0,Hl=Kn.length;pi<Hl;pi++){var mi=Kn[pi];u[mi]||(u[mi]=vn(mi))}};se();var oe=function(vn){_n[C]&&console.info("Redefining LocalForage driver: "+C),_n[C]=u,As[C]=vn,S()};"_support"in u?u._support&&typeof u._support=="function"?u._support().then(oe,b):oe(!!u._support):oe(!0)}catch(Pe){b(Pe)}});return N(p,m,g),p},a.prototype.driver=function(){return this._driver||null},a.prototype.getDriver=function(u,m,g){var p=_n[u]?E.resolve(_n[u]):E.reject(new Error("Driver not found."));return N(p,m,g),p},a.prototype.getSerializer=function(u){var m=E.resolve(li);return N(m,u),m},a.prototype.ready=function(u){var m=this,g=m._driverSet.then(function(){return m._ready===null&&(m._ready=m._initDriver()),m._ready});return N(g,u,u),g},a.prototype.setDriver=function(u,m,g){var p=this;ws(u)||(u=[u]);var S=this._getSupportedDrivers(u);function b(){p._config.driver=p.driver()}function C(A){return p._extend(A),b(),p._ready=p._initStorage(p._config),p._ready}function I(A){return function(){var H=0;function z(){for(;H<A.length;){var Y=A[H];return H++,p._dbInfo=null,p._ready=null,p.getDriver(Y).then(C).catch(z)}b();var se=new Error("No available storage method found.");return p._driverSet=E.reject(se),p._driverSet}return z()}}var T=this._driverSet!==null?this._driverSet.catch(function(){return E.resolve()}):E.resolve();return this._driverSet=T.then(function(){var A=S[0];return p._dbInfo=null,p._ready=null,p.getDriver(A).then(function(H){p._driver=H._driver,b(),p._wrapLibraryMethodsWithReady(),p._initDriver=I(S)})}).catch(function(){b();var A=new Error("No available storage method found.");return p._driverSet=E.reject(A),p._driverSet}),N(this._driverSet,m,g),this._driverSet},a.prototype.supports=function(u){return!!As[u]},a.prototype._extend=function(u){fi(this,u)},a.prototype._getSupportedDrivers=function(u){for(var m=[],g=0,p=u.length;g<p;g++){var S=u[g];this.supports(S)&&m.push(S)}return m},a.prototype._wrapLibraryMethodsWithReady=function(){for(var u=0,m=di.length;u<m;u++)kl(this,di[u])},a.prototype.createInstance=function(u){return new a(u)},a})(),Bl=new Ul;i.exports=Bl},{3:3}]},{},[4])(4)})});var Xe=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;currency;static get(){return window.CooeeSDK.config}update(t){return t??={},this.gaEnabled=t.gaEnabled,this.gaMeasurementID=t.gaMeasurementID,this.pixelPush=t.pixelPush,this.website=t.website??{},this.currencyCount=t.currencyCount??0,this.money=t.money,this.currency=t.currency,this.storefrontToken=t.storefrontToken,this.skipItemAttribute=t.skipItemAttribute,this}};var ia=0;function zl(e=document.head){return oa(Kt.styleURL,e,"cooee-global-styles")}function Yl(e=document.head){return oa(Kt.swiperStyleURL,e,"cooee-swiper-styles")}function oa(e,t=document.head,n){return new Promise(r=>{if(t.querySelector(`#${n}`)){r();return}let o=document.createElement("link");o.rel="stylesheet",o.href=e,o.id=n,o.onload=()=>{r()},o.onerror=()=>{console.error("Failed to load stylesheet:",e),r()},t.appendChild(o)})}function In(e,t=document.head){if(!e)return;ia++;let n=document.createElement("style");n.id=`cooee-app-css-${ia}`,n.textContent=e,t.appendChild(n)}async function ir(){let e=(await import("./swiper-bundle-WHJS64TU.js")).default;return window.CooeeSDK.Swiper=e}async function or(e,t=!0){if(!e)return;let n=[];t&&n.push(Yl(e)),n.push(zl(e)),await Promise.all(n);let r=Xe.get().website.commonCSS;In(r,e)}var Xl={"[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"},sg=k(_({},Xl),{"[class.ng-submitted]":"isSubmitted"});var Jl=new Ls("",{providedIn:"root",factory:()=>sa}),sa="always";var Ql=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275mod=_i({type:e});static \u0275inj=gi({})}return e})();var aa=(()=>{class e{static withConfig(n){return{ngModule:e,providers:[{provide:Jl,useValue:n.callSetDisabledState??sa}]}}static \u0275fac=function(r){return new(r||e)};static \u0275mod=_i({type:e});static \u0275inj=gi({imports:[Ql]})}return e})();var yi=(function(e){return e.SHOPIFY_CHECKOUT="shopify_checkout",e.THIRD_PARTY_CHECKOUT="third_party_checkout",e.CART_PAGE="cart_page",e.CART_DRAWER="cart_drawer",e})(yi||{});var je=(function(e){return e[e.NONE=0]="NONE",e[e.REJECT_POPUP=1]="REJECT_POPUP",e[e.ACCEPT_POPUP=2]="ACCEPT_POPUP",e[e.GO_TO_URL=4]="GO_TO_URL",e[e.SHARE=5]="SHARE",e[e.KEY_VALUE=100]="KEY_VALUE",e[e.GO_TO_PRODUCT=101]="GO_TO_PRODUCT",e[e.ADD_TO_CART=102]="ADD_TO_CART",e[e.COPY_COUPON_CODE=103]="COPY_COUPON_CODE",e[e.GO_TO_COLLECTION=104]="GO_TO_COLLECTION",e[e.OPEN_CART=105]="OPEN_CART",e[e.SUBMIT_FORM=106]="SUBMIT_FORM",e[e.INITIATE_CHECKOUT=107]="INITIATE_CHECKOUT",e[e.ADD_BUNDLE=108]="ADD_BUNDLE",e[e.UPGRADE_TO_SUBSCRIPTION=109]="UPGRADE_TO_SUBSCRIPTION",e[e.BUY_NOW=110]="BUY_NOW",e[e.QUICK_VIEW=111]="QUICK_VIEW",e})(je||{});var Zl=(function(e){return e.FREE_SHIPPING="FREE_SHIPPING",e.DISCOUNT="DISCOUNT",e.FREE_AUTO_GIFT="FREE_AUTO_GIFT",e.FREE_GIFT_SELECT="FREE_GIFT_SELECT",e.UI_ONLY="UI_ONLY",e})(Zl||{});var We=class e{engagementContext=ae(Cn);eventData=ae(nr);constructor(){}executeCTA(t,n){let r,i=this.engagementContext();if(!i){Ce.error("Engagement context is not available; aborting executeCTA.");return}if(t===je.ADD_TO_CART)r="CE Add To Cart Clicked";else if(t===je.GO_TO_PRODUCT)r="CE View Item Clicked";else if(t===je.OPEN_CART)r="CE Open Cart Clicked",i.triggerData.redirectBehaviour=yi.CART_DRAWER;else{Ce.warn(`Unsupported CTA type: ${t}`);return}window.CooeeSDK.executeCTA(i,_({clickAction:{at:t}},n));let o=new na(r,this.eventData.props,i.triggerData);n?.video?o.setVideos(n.video):this.eventData.video&&o.setVideos(this.eventData.video),window.CooeeSDK.sendEvent(o)}static \u0275fac=function(n){return new(n||e)};static \u0275prov=hi({token:e,factory:e.\u0275fac})};function ca(e,t){return[We,...ed(e,t)]}function ed(e,t){return[{provide:Cn,useValue:ct(e)},{provide:nr,useValue:_({},t)}]}var sr=class e{elementRef=ae(Rt);engagementService=ae(We);hasSwiper=!1;_engagementTrigger=ct(null);_triggerContext=ae(Cn);constructor(){this.elementRef.nativeElement.update=this.update.bind(this)}get classes(){let t=["letscooee-widget"],n=this._engagementTrigger();return t.push(`widget-${n?.shortID}`),t}get triggerContext(){return this._triggerContext()}set triggerContext(t){this._triggerContext.set(t),this._engagementTrigger.set(t.triggerData),this.engagementTriggerReceived(t.triggerData)}get engagementTrigger(){return this._engagementTrigger()}ngOnInit(){Ce.verbose("Init",this.constructor.name);let t=this.elementRef.nativeElement.shadowRoot;t&&(or(t,this.hasSwiper),In(this.engagementTrigger?.content?.innerCSS,t))}ngOnDestroy(){Ce.verbose("Destroying",this.constructor.name)}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Se({type:e,selectors:[["ng-component"]],hostVars:2,hostBindings:function(n,r){n&2&&Zn(r.classes)},inputs:{triggerContext:"triggerContext"},decls:1,vars:0,template:function(n,r){n&1&&Hs(0)},encapsulation:2})};var ua=(e,t)=>t.id;function td(e,t){if(e&1&&(P(0,"span",6),ne(1),U()),e&2){L();let n=Ie(0);D(),lt(n)}}function nd(e,t){if(e&1){let n=Le();Be(0),P(1,"button",5),be("click",function(){let i=ye(n).$implicit,o=L().$implicit,s=L();return Ee(s.onOptionChange(o,i))}),X(2,td,2,1,"span",6),U()}if(e&2){let n=t.$implicit,r=L().$implicit,i=Ie(1),o=L(),s=n.name,c=He(n.displayName||n.name),l=n.swatch,h=i?n.hexColor??s:"",y=o.selectedOptions()[r.name]===s,f=!!(l!=null&&l.color),E=!!(!(l==null||l.image==null)&&l.image.url);D(),Sn("swatch-color-type",f)("swatch-image-type",E)("selected",y)("disabled",n.disabled),$("title",c)("ngStyle",o.getSwatchStyles(l,h)),qt("aria-checked",y?"true":"false")("data-value",s)("aria-disabled",n.disabled?"true":null)("aria-label",c),D(),J(!i&&!f&&!E?2:-1)}}function rd(e,t){if(e&1&&(P(0,"div"),Be(1),P(2,"div",1),ne(3),U(),P(4,"div",2),ne(5),U(),P(6,"div",3),bt(7,nd,3,16,"button",4,ua),U()()),e&2){let n=t.$implicit,r=L();Zn(er("option-group ",n.name.toLowerCase())),D(),He(r.hasHexColors(n)),D(2),Pt("",n.name,":"),D(2),lt(r.selectedOptions()[n.name]),D(),qt("aria-label",n.name),D(),Ct(n.optionValues)}}var Tn=e=>e.trim().toLowerCase(),ar=class e extends sr{selectedVariant=new En;item=he.required();selectedOptions=ct({});options=dt(()=>{let t=this.item();if(!t.options||t.vars.length===1)return[];if(window.cooeeManipulateProduct)try{window.cooeeManipulateProduct(t,this.engagementTrigger)}catch(n){Ce.error(n)}return t.options.forEach(n=>{n.optionValues.forEach(r=>{r.disabled=this.isOptionValueDisabledFast(n,r)})}),t.options});matchedVariant=dt(()=>{let t=this.item(),n=this.selectedOptions();return t.vars.find(r=>t.options.every(i=>{let o=r.selectedOptions.find(s=>s.name===i.name)?.value;return n[i.name]===o}))});availabilityIndex=dt(()=>{let t=this.item(),n=new Map;return t?.vars?.length&&t.vars.forEach((r,i)=>{if(r.isAvailable)for(let o of r.selectedOptions){let s=Tn(o.name),c=o.value,l=n.get(s);l||n.set(s,l=new Map);let h=l.get(c);h||l.set(c,h=new Set),h.add(i)}}),n});constructor(){super(),ft(()=>{let n=this.matchedVariant();n&&(this.item().setSelectedVariant(n),this.selectedVariant.emit(n))});let t=ft(()=>{let n=this.item();if(!n?.options)return;let r=_({},this.selectedOptions()),i=n.vars.find(o=>o.isAvailable)??n.vars[0];n.options.forEach(o=>{let s=i?.selectedOptions.find(c=>c.name===o.name)?.value;s&&(r[o.name]=s)}),this.selectedOptions.set(r),t.destroy()})}ngOnInit(){super.ngOnInit();let t=this.elementRef.nativeElement.shadowRoot;if(!t)return;let n=Xe.get().website?.itemSwatchMapping;n&&In(n,t)}onOptionChange(t,n){let r=_({},this.selectedOptions());r[t.name]=n.name,this.selectedOptions.set(r)}engagementTriggerReceived(){}update(){}hasHexColors(t){return!!t.optionValues[0]?.name.match(/#[a-f0-9]{6}\b/i)}getSwatchStyles(t,n){let r={};return!t&&n?(r["--option-color"]=n,r["background-color"]=n,r):(t?.image?.url?r["background-image"]=`url("${t.image.url}")`:t?.color&&(r["--option-color"]=t.color,r["background-color"]=t.color),r)}getCandidateVariantsExcluding(t){let n=this.item(),r=this.availabilityIndex(),i=new Set;n.vars.forEach((s,c)=>{s.isAvailable&&i.add(c)});let o=i;for(let[s,c]of Object.entries(this.selectedOptions())){if(Tn(s)===Tn(t))continue;let l=r.get(Tn(s));if(!l)return new Set;let h=l.get(String(c));if(!h)return new Set;if(o=new Set([...o].filter(y=>h.has(y))),o.size===0)return o}return o}isOptionValueDisabledFast(t,n){let i=this.availabilityIndex().get(Tn(t.name));if(!i)return!0;let o=n.name,s=i.get(o);if(!s||s.size===0)return!0;let c=this.getCandidateVariantsExcluding(t.name);if(c.size===0)return!0;for(let l of c)if(s.has(l))return!1;return!0}static \u0275fac=function(n){return new(n||e)};static \u0275cmp=Se({type:e,selectors:[["cooee-item-options-picker"]],inputs:{item:[1,"item"]},outputs:{selectedVariant:"selectedVariant"},features:[Lt(ca()),vi],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,"swatch-color-type","swatch-image-type","selected","disabled","title","ngStyle"],["type","button","role","radio",1,"option-value",3,"click","title","ngStyle"],[1,"title"]],template:function(n,r){n&1&&bt(0,rd,9,7,"div",0,ua),n&2&&Ct(r.options())},dependencies:[ea,Qs,aa],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)));background-size:cover;background-position:center;background-repeat:no-repeat}.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 Si=Wl(da());function cr(e){return Si.default.createInstance({name:"lc",storeName:e,driver:Si.default.LOCALSTORAGE})}var Jt=class{static storage;static async get(t,n){return await this.storage?.getItem(t)??n}static set(t,n){return this.storage?.setItem(t,n)}static remove(t){return this.storage?.removeItem(t)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var xn=class xn extends Jt{};Xn(xn,"storeName","usr"),xn.storage=cr(xn.storeName);var bi=xn;function Ci(){return window.CooeeSDK?.uaParser.getDevice().type==="mobile"}var r_=()=>typeof navigator<"u"&&"share"in navigator;var Qt=class{lastWidth;lastHeight;resizeTimeout=null;debounceDelay=200;onResizeCallback;constructor(t){this.onResizeCallback=t,this.lastWidth=window.innerWidth,this.lastHeight=window.innerHeight,window.addEventListener("resize",this.debouncedResize),window.addEventListener("orientationchange",this.handleImmediateResize)}destroy(){window.removeEventListener("resize",this.debouncedResize),window.removeEventListener("orientationchange",this.handleImmediateResize)}handleImmediateResize=()=>{this.triggerResize()};debouncedResize=()=>{this.resizeTimeout!==null&&clearTimeout(this.resizeTimeout),this.resizeTimeout=window.setTimeout(()=>{this.triggerResize()},this.debounceDelay)};triggerResize(){let t=window.innerWidth,n=window.innerHeight;(n!==this.lastHeight||t!==this.lastWidth)&&(this.onResizeCallback(),this.lastWidth=t,this.lastHeight=n)}};var Dn=class Dn extends Jt{};Xn(Dn,"storeName","ses"),Dn.storage=cr(Dn.storeName);var Ii=Dn;var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var V=globalThis;var Qe="9.42.0";function Ft(){return kt(V),V}function kt(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||Qe,t[Qe]=t[Qe]||{}}function pt(e,t,n=V){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[Qe]=r[Qe]||{};return i[e]||(i[e]=t())}var Ti=["debug","info","warn","error","log","assert","trace"],id="Sentry Logger ",Zt={};function Tt(e){if(!("console"in V))return e();let t=V.console,n={},r=Object.keys(Zt);r.forEach(i=>{let o=Zt[i];n[i]=t[i],t[i]=o});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function od(){Di().enabled=!0}function sd(){Di().enabled=!1}function fa(){return Di().enabled}function ad(...e){xi("log",...e)}function cd(...e){xi("warn",...e)}function ud(...e){xi("error",...e)}function xi(e,...t){R&&fa()&&Tt(()=>{V.console[e](`${id}[${e}]:`,...t)})}function Di(){return R?pt("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var w={enable:od,disable:sd,isEnabled:fa,log:ad,warn:cd,error:ud};var pa=/\(error: (.*)\)/,ma=/captureMessage|captureException/;function Ai(...e){let t=e.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 c=r;c<s.length;c++){let l=s[c];if(l.length>1024)continue;let h=pa.test(l)?l.replace(pa,"$1"):l;if(!h.match(/\S*Error: /)){for(let y of t){let f=y(h);if(f){o.push(f);break}}if(o.length>=50+i)break}}return ha(o.slice(i))}}function ha(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(ur(t).function||"")&&t.pop(),t.reverse(),ma.test(ur(t).function||"")&&(t.pop(),ma.test(ur(t).function||"")&&t.pop()),t.slice(0,50).map(n=>k(_({},n),{filename:n.filename||ur(t).filename,function:n.function||"?"}))}function ur(e){return e[e.length-1]||{}}var wi="<anonymous>";function Ve(e){try{return!e||typeof e!="function"?wi:e.name||wi}catch{return wi}}function lr(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}var dr={},ga={};function Te(e,t){dr[e]=dr[e]||[],dr[e].push(t)}function xe(e,t){if(!ga[e]){ga[e]=!0;try{t()}catch(n){R&&w.error(`Error while instrumenting ${e}`,n)}}}function ce(e,t){let n=e&&dr[e];if(n)for(let r of n)try{r(t)}catch(i){R&&w.error(`Error while triggering instrumentation handler.
4
4
  Type: ${e}
@@ -1,4 +1,4 @@
1
- import{e as D,f as A}from"./chunk-V7UGKYBN.js";var V=D((C,m)=>{"use strict";(function(r){"use strict";var e={};e.VERSION="1.6.1";var s,f={},E=function(o,t){return function(){return t.apply(o,arguments)}},h=function(){var o=arguments,t=o[0],u,n;for(n=1;n<o.length;n++)for(u in o[n])!(u in t)&&o[n].hasOwnProperty(u)&&(t[u]=o[n][u]);return t},g=function(o,t){return{value:o,name:t}};e.TRACE=g(1,"TRACE"),e.DEBUG=g(2,"DEBUG"),e.INFO=g(3,"INFO"),e.TIME=g(4,"TIME"),e.WARN=g(5,"WARN"),e.ERROR=g(8,"ERROR"),e.OFF=g(99,"OFF");var _=function(o){this.context=o,this.setLevel(o.filterLevel),this.log=this.info};_.prototype={setLevel:function(o){o&&"value"in o&&(this.context.filterLevel=o)},getLevel:function(){return this.context.filterLevel},enabledFor:function(o){var t=this.context.filterLevel;return o.value>=t.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(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"start"])},timeEnd:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"end"])},invoke:function(o,t){s&&this.enabledFor(o)&&s(t,h({level:o},this.context))}};var i=new _({filterLevel:e.OFF});(function(){var o=e;o.enabledFor=E(i,i.enabledFor),o.trace=E(i,i.trace),o.debug=E(i,i.debug),o.time=E(i,i.time),o.timeEnd=E(i,i.timeEnd),o.info=E(i,i.info),o.warn=E(i,i.warn),o.error=E(i,i.error),o.log=o.info})(),e.setHandler=function(o){s=o},e.setLevel=function(o){i.setLevel(o);for(var t in f)f.hasOwnProperty(t)&&f[t].setLevel(o)},e.getLevel=function(){return i.getLevel()},e.get=function(o){return f[o]||(f[o]=new _(h({name:o},i.context)))},e.createDefaultHandler=function(o){o=o||{},o.formatter=o.formatter||function(l,c){c.name&&l.unshift("["+c.name+"]")};var t={},u=function(n,l){Function.prototype.apply.call(n,console,l)};return typeof console>"u"?function(){}:function(n,l){n=Array.prototype.slice.call(n);var c=console.log,d;l.level===e.TIME?(d=(l.name?"["+l.name+"] ":"")+n[0],n[1]==="start"?console.time?console.time(d):t[d]=new Date().getTime():console.timeEnd?console.timeEnd(d):u(c,[d+": "+(new Date().getTime()-t[d])+"ms"])):(l.level===e.WARN&&console.warn?c=console.warn:l.level===e.ERROR&&console.error?c=console.error:l.level===e.INFO&&console.info?c=console.info:l.level===e.DEBUG&&console.debug?c=console.debug:l.level===e.TRACE&&console.trace&&(c=console.trace),o.formatter(n,l),u(c,n))}},e.useDefaults=function(o){e.setLevel(o&&o.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(o))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof m<"u"&&m.exports?m.exports=e:(e._prevLogger=r.Logger,e.noConflict=function(){return r.Logger=e._prevLogger,e},r.Logger=e)})(C)});var I="13.0.22";var b=I.split("-")[0].split(".").slice(0,3).map(r=>r.padStart(2,"0")).join(""),S="WEB",N="CooeeSDK",p=I,M=parseInt(b,10);var P=["collection","product","cart"],U=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],x=["View Item","View Cart","View Collection"],F=["CE Screen View","View Collection","View Item","View Cart"];var T=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${p}/dist`,L={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:T,styleURL:`${T}/widget.min.css`,widgetURL:`${T}/widget.min.js`,swiperStyleURL:`${T}/swiper-bundle.min.css`};var a=A(V());var v=class{static debuggerEl;static infoLogs=[];static log(...e){a.default.info(...e)}static verbose(...e){a.default.debug(...e)}static error(...e){a.default.error(...e)}static warn(...e){a.default.warn(...e)}static info(...e){a.default.info(...e),this.infoLogs.push({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){a.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 K(r=N){a.default.useDefaults({formatter:function(e){e.unshift(`${r} (v${p}):`)}}),w()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?a.default.setLevel(a.default[localStorage.cooeeLogLevel]):a.default.setLevel(L.debug?a.default.TRACE:a.default.OFF)}function w(){let r=O();return r==="1"||r==="on"}function O(){return new URL(location.href).searchParams?.get("cooee-debug")}function $(){let r=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),e=`
1
+ import{e as D,f as A}from"./chunk-V7UGKYBN.js";var V=D((C,m)=>{"use strict";(function(r){"use strict";var e={};e.VERSION="1.6.1";var s,f={},E=function(o,t){return function(){return t.apply(o,arguments)}},h=function(){var o=arguments,t=o[0],u,n;for(n=1;n<o.length;n++)for(u in o[n])!(u in t)&&o[n].hasOwnProperty(u)&&(t[u]=o[n][u]);return t},g=function(o,t){return{value:o,name:t}};e.TRACE=g(1,"TRACE"),e.DEBUG=g(2,"DEBUG"),e.INFO=g(3,"INFO"),e.TIME=g(4,"TIME"),e.WARN=g(5,"WARN"),e.ERROR=g(8,"ERROR"),e.OFF=g(99,"OFF");var _=function(o){this.context=o,this.setLevel(o.filterLevel),this.log=this.info};_.prototype={setLevel:function(o){o&&"value"in o&&(this.context.filterLevel=o)},getLevel:function(){return this.context.filterLevel},enabledFor:function(o){var t=this.context.filterLevel;return o.value>=t.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(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"start"])},timeEnd:function(o){typeof o=="string"&&o.length>0&&this.invoke(e.TIME,[o,"end"])},invoke:function(o,t){s&&this.enabledFor(o)&&s(t,h({level:o},this.context))}};var i=new _({filterLevel:e.OFF});(function(){var o=e;o.enabledFor=E(i,i.enabledFor),o.trace=E(i,i.trace),o.debug=E(i,i.debug),o.time=E(i,i.time),o.timeEnd=E(i,i.timeEnd),o.info=E(i,i.info),o.warn=E(i,i.warn),o.error=E(i,i.error),o.log=o.info})(),e.setHandler=function(o){s=o},e.setLevel=function(o){i.setLevel(o);for(var t in f)f.hasOwnProperty(t)&&f[t].setLevel(o)},e.getLevel=function(){return i.getLevel()},e.get=function(o){return f[o]||(f[o]=new _(h({name:o},i.context)))},e.createDefaultHandler=function(o){o=o||{},o.formatter=o.formatter||function(l,c){c.name&&l.unshift("["+c.name+"]")};var t={},u=function(n,l){Function.prototype.apply.call(n,console,l)};return typeof console>"u"?function(){}:function(n,l){n=Array.prototype.slice.call(n);var c=console.log,d;l.level===e.TIME?(d=(l.name?"["+l.name+"] ":"")+n[0],n[1]==="start"?console.time?console.time(d):t[d]=new Date().getTime():console.timeEnd?console.timeEnd(d):u(c,[d+": "+(new Date().getTime()-t[d])+"ms"])):(l.level===e.WARN&&console.warn?c=console.warn:l.level===e.ERROR&&console.error?c=console.error:l.level===e.INFO&&console.info?c=console.info:l.level===e.DEBUG&&console.debug?c=console.debug:l.level===e.TRACE&&console.trace&&(c=console.trace),o.formatter(n,l),u(c,n))}},e.useDefaults=function(o){e.setLevel(o&&o.defaultLevel||e.DEBUG),e.setHandler(e.createDefaultHandler(o))},e.setDefaults=e.useDefaults,typeof define=="function"&&define.amd?define(e):typeof m<"u"&&m.exports?m.exports=e:(e._prevLogger=r.Logger,e.noConflict=function(){return r.Logger=e._prevLogger,e},r.Logger=e)})(C)});var I="13.1.1";var b=I.split("-")[0].split(".").slice(0,3).map(r=>r.padStart(2,"0")).join(""),S="WEB",N="CooeeSDK",p=I,M=parseInt(b,10);var P=["collection","product","cart"],U=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],x=["View Item","View Cart","View Collection"],F=["CE Screen View","View Collection","View Item","View Cart"];var T=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${p}/dist`,L={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:T,styleURL:`${T}/widget.min.css`,widgetURL:`${T}/widget.min.js`,swiperStyleURL:`${T}/swiper-bundle.min.css`};var a=A(V());var v=class{static debuggerEl;static infoLogs=[];static log(...e){a.default.info(...e)}static verbose(...e){a.default.debug(...e)}static error(...e){a.default.error(...e)}static warn(...e){a.default.warn(...e)}static info(...e){a.default.info(...e),this.infoLogs.push({time:new Date,message:e.join(" ")}),this.addToDebugger()}static trace(...e){a.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 K(r=N){a.default.useDefaults({formatter:function(e){e.unshift(`${r} (v${p}):`)}}),w()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?a.default.setLevel(a.default[localStorage.cooeeLogLevel]):a.default.setLevel(L.debug?a.default.TRACE:a.default.OFF)}function w(){let r=O();return r==="1"||r==="on"}function O(){return new URL(location.href).searchParams?.get("cooee-debug")}function $(){let r=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),e=`
2
2
  `;e+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
3
3
  `,e+=`\u{1F50D} Track real-time visitor intent & optimize engagement
4
4
  `,e+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
@@ -0,0 +1,6 @@
1
+ import{$ as te,Aa as Ai,Ab as ki,B as q,Bb as Fi,C as W,Cb as ie,Db as ot,E as Kt,Eb as it,Ga as Ti,Gb as re,H as Jt,Ha as Ni,Hb as xt,I as ut,Ia as Ci,Ib as Ui,J as Ei,Jb as Bt,K as bi,Kb as ji,Lb as Vi,Mb as ne,R as qt,T as Et,U as Qt,V as Ce,W as Ie,X as lt,Z as Rt,a as fi,ba as Oi,c as Y,ca as bt,d as pi,da as Q,ea as ft,fa as Si,g as di,ha as ee,hb as Ii,i as gi,ib as Di,kb as Ri,l as _i,m as mi,n as yi,nb as xi,o as vi,q as wi,qb as Bi,rb as Li,s as j,u as G,v as S,w as Zt,yb as Mi,zb as Pi}from"./chunk-K77Q3IPF.js";import{a as F,b as Gt,e as hi,f as ui}from"./chunk-V7UGKYBN.js";var Yi=hi(($i,ce)=>{"use strict";(function(e){"use strict";var t={};t.VERSION="1.6.1";var i,r={},s=function(p,g){return function(){return g.apply(p,arguments)}},l=function(){var p=arguments,g=p[0],m,v;for(v=1;v<p.length;v++)for(m in p[v])!(m in g)&&p[v].hasOwnProperty(m)&&(g[m]=p[v][m]);return g},a=function(p,g){return{value:p,name:g}};t.TRACE=a(1,"TRACE"),t.DEBUG=a(2,"DEBUG"),t.INFO=a(3,"INFO"),t.TIME=a(4,"TIME"),t.WARN=a(5,"WARN"),t.ERROR=a(8,"ERROR"),t.OFF=a(99,"OFF");var f=function(p){this.context=p,this.setLevel(p.filterLevel),this.log=this.info};f.prototype={setLevel:function(p){p&&"value"in p&&(this.context.filterLevel=p)},getLevel:function(){return this.context.filterLevel},enabledFor:function(p){var g=this.context.filterLevel;return p.value>=g.value},trace:function(){this.invoke(t.TRACE,arguments)},debug:function(){this.invoke(t.DEBUG,arguments)},info:function(){this.invoke(t.INFO,arguments)},warn:function(){this.invoke(t.WARN,arguments)},error:function(){this.invoke(t.ERROR,arguments)},time:function(p){typeof p=="string"&&p.length>0&&this.invoke(t.TIME,[p,"start"])},timeEnd:function(p){typeof p=="string"&&p.length>0&&this.invoke(t.TIME,[p,"end"])},invoke:function(p,g){i&&this.enabledFor(p)&&i(g,l({level:p},this.context))}};var d=new f({filterLevel:t.OFF});(function(){var p=t;p.enabledFor=s(d,d.enabledFor),p.trace=s(d,d.trace),p.debug=s(d,d.debug),p.time=s(d,d.time),p.timeEnd=s(d,d.timeEnd),p.info=s(d,d.info),p.warn=s(d,d.warn),p.error=s(d,d.error),p.log=p.info})(),t.setHandler=function(p){i=p},t.setLevel=function(p){d.setLevel(p);for(var g in r)r.hasOwnProperty(g)&&r[g].setLevel(p)},t.getLevel=function(){return d.getLevel()},t.get=function(p){return r[p]||(r[p]=new f(l({name:p},d.context)))},t.createDefaultHandler=function(p){p=p||{},p.formatter=p.formatter||function(b,w){w.name&&b.unshift("["+w.name+"]")};var g={},m=function(v,b){Function.prototype.apply.call(v,console,b)};return typeof console>"u"?function(){}:function(v,b){v=Array.prototype.slice.call(v);var w=console.log,A;b.level===t.TIME?(A=(b.name?"["+b.name+"] ":"")+v[0],v[1]==="start"?console.time?console.time(A):g[A]=new Date().getTime():console.timeEnd?console.timeEnd(A):m(w,[A+": "+(new Date().getTime()-g[A])+"ms"])):(b.level===t.WARN&&console.warn?w=console.warn:b.level===t.ERROR&&console.error?w=console.error:b.level===t.INFO&&console.info?w=console.info:b.level===t.DEBUG&&console.debug?w=console.debug:b.level===t.TRACE&&console.trace&&(w=console.trace),p.formatter(v,b),m(w,v))}},t.useDefaults=function(p){t.setLevel(p&&p.defaultLevel||t.DEBUG),t.setHandler(t.createDefaultHandler(p))},t.setDefaults=t.useDefaults,typeof define=="function"&&define.amd?define(t):typeof ce<"u"&&ce.exports?ce.exports=t:(t._prevLogger=e.Logger,t.noConflict=function(){return e.Logger=t._prevLogger,t},e.Logger=t)})($i)});var Ur=hi(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.URLBuilder=void 0;var _o=(function(){function e(t){try{this.base=new URL(t),this.params=new URLSearchParams(this.base.search.slice(1))}catch(i){console.error("Un-parsable URL",i)}}return e.prototype.appendQueryParam=function(t,i){this.params.append(t,i?i.toString():"")},e.prototype.clearQueryParams=function(){return this.params=new URLSearchParams,this},e.prototype.deleteQueryParam=function(t){this.params.delete(t)},e.prototype.getBase=function(){return this.base},e.prototype.getPath=function(){return this.base.pathname},e.prototype.getHostname=function(){return this.base.hostname},e.prototype.getParams=function(){return this.params},e.prototype.getQueryParam=function(t){if(!this.params)return"";var i=this.params.get(t);return!i||i==="undefined"||i==="null"?void 0:i},e.prototype.getQueryString=function(){return this.params.toString()},e.prototype.setPath=function(t){return this.base.pathname=t,this},e.prototype.setQueryParam=function(t,i){return this.params.set(t,i?i.toString():""),this},e.prototype.setQueryString=function(t){if(t)return t[0]==="?"&&(t=t.slice(1)),this.params=new URLSearchParams(t),this},e.prototype.toString=function(){var t=this.params.toString();return t===""?this.base.search="":this.base.search="?"+t,this.base.toString()},e})();Oe.URLBuilder=_o});var De="13.1.1";var Gr=De.split("-")[0].split(".").slice(0,3).map(e=>e.padStart(2,"0")).join("");var Hi="CooeeSDK",oe=De,Eo=parseInt(Gr,10);var se=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${oe}/dist`,ae={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:se,styleURL:`${se}/widget.min.css`,widgetURL:`${se}/widget.min.js`,swiperStyleURL:`${se}/swiper-bundle.min.css`};var X=ui(Yi());var Lt=class{static debuggerEl;static infoLogs=[];static log(...t){X.default.info(...t)}static verbose(...t){X.default.debug(...t)}static error(...t){X.default.error(...t)}static warn(...t){X.default.warn(...t)}static info(...t){X.default.info(...t),this.infoLogs.push({time:new Date,message:t.join(" ")}),this.addToDebugger()}static trace(...t){X.default.trace(...t)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function No(e=Hi){X.default.useDefaults({formatter:function(t){t.unshift(`${e} (v${oe}):`)}}),Zr()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?X.default.setLevel(X.default[localStorage.cooeeLogLevel]):X.default.setLevel(ae.debug?X.default.TRACE:X.default.OFF)}function Zr(){let e=Kr();return e==="1"||e==="on"}function Kr(){return new URL(location.href).searchParams?.get("cooee-debug")}var Ro=new G("EngagementContext"),xo=new G("EventData");function Jr(e,t){return t={exports:{}},e(t,t.exports),t.exports}var qr=rn,Qr=on,tn=cn,nt=[],K=[],en=typeof Uint8Array<"u"?Uint8Array:Array,Re="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(pt=0,Wi=Re.length;pt<Wi;++pt)nt[pt]=Re[pt],K[Re.charCodeAt(pt)]=pt;var pt,Wi;K[45]=62;K[95]=63;function ar(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var r=i===t?0:4-i%4;return[i,r]}function rn(e){var t=ar(e),i=t[0],r=t[1];return(i+r)*3/4-r}function nn(e,t,i){return(t+i)*3/4-i}function on(e){var t,i=ar(e),r=i[0],s=i[1],l=new en(nn(e,r,s)),a=0,f=s>0?r-4:r,d;for(d=0;d<f;d+=4)t=K[e.charCodeAt(d)]<<18|K[e.charCodeAt(d+1)]<<12|K[e.charCodeAt(d+2)]<<6|K[e.charCodeAt(d+3)],l[a++]=t>>16&255,l[a++]=t>>8&255,l[a++]=t&255;return s===2&&(t=K[e.charCodeAt(d)]<<2|K[e.charCodeAt(d+1)]>>4,l[a++]=t&255),s===1&&(t=K[e.charCodeAt(d)]<<10|K[e.charCodeAt(d+1)]<<4|K[e.charCodeAt(d+2)]>>2,l[a++]=t>>8&255,l[a++]=t&255),l}function sn(e){return nt[e>>18&63]+nt[e>>12&63]+nt[e>>6&63]+nt[e&63]}function an(e,t,i){for(var r,s=[],l=t;l<i;l+=3)r=(e[l]<<16&16711680)+(e[l+1]<<8&65280)+(e[l+2]&255),s.push(sn(r));return s.join("")}function cn(e){for(var t,i=e.length,r=i%3,s=[],l=16383,a=0,f=i-r;a<f;a+=l)s.push(an(e,a,a+l>f?f:a+l));return r===1?(t=e[i-1],s.push(nt[t>>2]+nt[t<<4&63]+"==")):r===2&&(t=(e[i-2]<<8)+e[i-1],s.push(nt[t>>10]+nt[t>>4&63]+nt[t<<2&63]+"=")),s.join("")}var xe={byteLength:qr,toByteArray:Qr,fromByteArray:tn};var ln=function(t,i,r,s,l){var a,f,d=l*8-s-1,p=(1<<d)-1,g=p>>1,m=-7,v=r?l-1:0,b=r?-1:1,w=t[i+v];for(v+=b,a=w&(1<<-m)-1,w>>=-m,m+=d;m>0;a=a*256+t[i+v],v+=b,m-=8);for(f=a&(1<<-m)-1,a>>=-m,m+=s;m>0;f=f*256+t[i+v],v+=b,m-=8);if(a===0)a=1-g;else{if(a===p)return f?NaN:(w?-1:1)*(1/0);f=f+Math.pow(2,s),a=a-g}return(w?-1:1)*f*Math.pow(2,a-s)},hn=function(t,i,r,s,l,a){var f,d,p,g=a*8-l-1,m=(1<<g)-1,v=m>>1,b=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,w=s?0:a-1,A=s?1:-1,k=i<0||i===0&&1/i<0?1:0;for(i=Math.abs(i),isNaN(i)||i===1/0?(d=isNaN(i)?1:0,f=m):(f=Math.floor(Math.log(i)/Math.LN2),i*(p=Math.pow(2,-f))<1&&(f--,p*=2),f+v>=1?i+=b/p:i+=b*Math.pow(2,1-v),i*p>=2&&(f++,p/=2),f+v>=m?(d=0,f=m):f+v>=1?(d=(i*p-1)*Math.pow(2,l),f=f+v):(d=i*Math.pow(2,v-1)*Math.pow(2,l),f=0));l>=8;t[r+w]=d&255,w+=A,d/=256,l-=8);for(f=f<<l|d,g+=l;g>0;t[r+w]=f&255,w+=A,f/=256,g-=8);t[r+w-A]|=k*128},Ot={read:ln,write:hn},ue=Jr(function(e,t){var i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=a,t.SlowBuffer=M,t.INSPECT_MAX_BYTES=50;var r=2147483647;t.kMaxLength=r,a.TYPED_ARRAY_SUPPORT=s(),!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 s(){try{var c=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(c,n),c.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(c){if(c>r)throw new RangeError('The value "'+c+'" is invalid for option "size"');var n=new Uint8Array(c);return Object.setPrototypeOf(n,a.prototype),n}function a(c,n,o){if(typeof c=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(c)}return f(c,n,o)}a.poolSize=8192;function f(c,n,o){if(typeof c=="string")return m(c,n);if(ArrayBuffer.isView(c))return b(c);if(c==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(c));if(et(c,ArrayBuffer)||c&&et(c.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(et(c,SharedArrayBuffer)||c&&et(c.buffer,SharedArrayBuffer)))return w(c,n,o);if(typeof c=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var h=c.valueOf&&c.valueOf();if(h!=null&&h!==c)return a.from(h,n,o);var u=A(c);if(u)return u;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof c[Symbol.toPrimitive]=="function")return a.from(c[Symbol.toPrimitive]("string"),n,o);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(c))}a.from=function(c,n,o){return f(c,n,o)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function d(c){if(typeof c!="number")throw new TypeError('"size" argument must be of type number');if(c<0)throw new RangeError('The value "'+c+'" is invalid for option "size"')}function p(c,n,o){return d(c),c<=0?l(c):n!==void 0?typeof o=="string"?l(c).fill(n,o):l(c).fill(n):l(c)}a.alloc=function(c,n,o){return p(c,n,o)};function g(c){return d(c),l(c<0?0:k(c)|0)}a.allocUnsafe=function(c){return g(c)},a.allocUnsafeSlow=function(c){return g(c)};function m(c,n){if((typeof n!="string"||n==="")&&(n="utf8"),!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=P(c,n)|0,h=l(o),u=h.write(c,n);return u!==o&&(h=h.slice(0,u)),h}function v(c){for(var n=c.length<0?0:k(c.length)|0,o=l(n),h=0;h<n;h+=1)o[h]=c[h]&255;return o}function b(c){if(et(c,Uint8Array)){var n=new Uint8Array(c);return w(n.buffer,n.byteOffset,n.byteLength)}return v(c)}function w(c,n,o){if(n<0||c.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(c.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');var h;return n===void 0&&o===void 0?h=new Uint8Array(c):o===void 0?h=new Uint8Array(c,n):h=new Uint8Array(c,n,o),Object.setPrototypeOf(h,a.prototype),h}function A(c){if(a.isBuffer(c)){var n=k(c.length)|0,o=l(n);return o.length===0||c.copy(o,0,0,n),o}if(c.length!==void 0)return typeof c.length!="number"||Ne(c.length)?l(0):v(c);if(c.type==="Buffer"&&Array.isArray(c.data))return v(c.data)}function k(c){if(c>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return c|0}function M(c){return+c!=c&&(c=0),a.alloc(+c)}a.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==a.prototype},a.compare=function(n,o){if(et(n,Uint8Array)&&(n=a.from(n,n.offset,n.byteLength)),et(o,Uint8Array)&&(o=a.from(o,o.offset,o.byteLength)),!a.isBuffer(n)||!a.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;for(var h=n.length,u=o.length,_=0,y=Math.min(h,u);_<y;++_)if(n[_]!==o[_]){h=n[_],u=o[_];break}return h<u?-1:u<h?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,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return a.alloc(0);var h;if(o===void 0)for(o=0,h=0;h<n.length;++h)o+=n[h].length;var u=a.allocUnsafe(o),_=0;for(h=0;h<n.length;++h){var y=n[h];if(et(y,Uint8Array))_+y.length>u.length?a.from(y).copy(u,_):Uint8Array.prototype.set.call(u,y,_);else if(a.isBuffer(y))y.copy(u,_);else throw new TypeError('"list" argument must be an Array of Buffers');_+=y.length}return u};function P(c,n){if(a.isBuffer(c))return c.length;if(ArrayBuffer.isView(c)||et(c,ArrayBuffer))return c.byteLength;if(typeof c!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(c));var o=c.length,h=arguments.length>2&&arguments[2]===!0;if(!h&&o===0)return 0;for(var u=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return Te(c).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return ai(c).length;default:if(u)return h?-1:Te(c).length;n=(""+n).toLowerCase(),u=!0}}a.byteLength=P;function H(c,n,o){var h=!1;if((n===void 0||n<0)&&(n=0),n>this.length||((o===void 0||o>this.length)&&(o=this.length),o<=0)||(o>>>=0,n>>>=0,o<=n))return"";for(c||(c="utf8");;)switch(c){case"hex":return J(this,n,o);case"utf8":case"utf-8":return vt(this,n,o);case"ascii":return wt(this,n,o);case"latin1":case"binary":return x(this,n,o);case"base64":return yt(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,n,o);default:if(h)throw new TypeError("Unknown encoding: "+c);c=(c+"").toLowerCase(),h=!0}}a.prototype._isBuffer=!0;function O(c,n,o){var h=c[n];c[n]=c[o],c[o]=h}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 o=0;o<n;o+=2)O(this,o,o+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 o=0;o<n;o+=4)O(this,o,o+3),O(this,o+1,o+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 o=0;o<n;o+=8)O(this,o,o+7),O(this,o+1,o+6),O(this,o+2,o+5),O(this,o+3,o+4);return this},a.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?vt(this,0,n):H.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="",o=t.INSPECT_MAX_BYTES;return n=this.toString("hex",0,o).replace(/(.{2})/g,"$1 ").trim(),this.length>o&&(n+=" ... "),"<Buffer "+n+">"},i&&(a.prototype[i]=a.prototype.inspect),a.prototype.compare=function(n,o,h,u,_){if(et(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(o===void 0&&(o=0),h===void 0&&(h=n?n.length:0),u===void 0&&(u=0),_===void 0&&(_=this.length),o<0||h>n.length||u<0||_>this.length)throw new RangeError("out of range index");if(u>=_&&o>=h)return 0;if(u>=_)return-1;if(o>=h)return 1;if(o>>>=0,h>>>=0,u>>>=0,_>>>=0,this===n)return 0;for(var y=_-u,N=h-o,D=Math.min(y,N),R=this.slice(u,_),U=n.slice(o,h),B=0;B<D;++B)if(R[B]!==U[B]){y=R[B],N=U[B];break}return y<N?-1:N<y?1:0};function z(c,n,o,h,u){if(c.length===0)return-1;if(typeof o=="string"?(h=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,Ne(o)&&(o=u?0:c.length-1),o<0&&(o=c.length+o),o>=c.length){if(u)return-1;o=c.length-1}else if(o<0)if(u)o=0;else return-1;if(typeof n=="string"&&(n=a.from(n,h)),a.isBuffer(n))return n.length===0?-1:tt(c,n,o,h,u);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?u?Uint8Array.prototype.indexOf.call(c,n,o):Uint8Array.prototype.lastIndexOf.call(c,n,o):tt(c,[n],o,h,u);throw new TypeError("val must be string, number or Buffer")}function tt(c,n,o,h,u){var _=1,y=c.length,N=n.length;if(h!==void 0&&(h=String(h).toLowerCase(),h==="ucs2"||h==="ucs-2"||h==="utf16le"||h==="utf-16le")){if(c.length<2||n.length<2)return-1;_=2,y/=2,N/=2,o/=2}function D(ci,li){return _===1?ci[li]:ci.readUInt16BE(li*_)}var R;if(u){var U=-1;for(R=o;R<y;R++)if(D(c,R)===D(n,U===-1?0:R-U)){if(U===-1&&(U=R),R-U+1===N)return U*_}else U!==-1&&(R-=R-U),U=-1}else for(o+N>y&&(o=y-N),R=o;R>=0;R--){for(var B=!0,zt=0;zt<N;zt++)if(D(c,R+zt)!==D(n,zt)){B=!1;break}if(B)return R}return-1}a.prototype.includes=function(n,o,h){return this.indexOf(n,o,h)!==-1},a.prototype.indexOf=function(n,o,h){return z(this,n,o,h,!0)},a.prototype.lastIndexOf=function(n,o,h){return z(this,n,o,h,!1)};function at(c,n,o,h){o=Number(o)||0;var u=c.length-o;h?(h=Number(h),h>u&&(h=u)):h=u;var _=n.length;h>_/2&&(h=_/2);for(var y=0;y<h;++y){var N=parseInt(n.substr(y*2,2),16);if(Ne(N))return y;c[o+y]=N}return y}function Se(c,n,o,h){return Xt(Te(n,c.length-o),c,o,h)}function Dt(c,n,o,h){return Xt(Yr(n),c,o,h)}function Ae(c,n,o,h){return Xt(ai(n),c,o,h)}function Yt(c,n,o,h){return Xt(Wr(n,c.length-o),c,o,h)}a.prototype.write=function(n,o,h,u){if(o===void 0)u="utf8",h=this.length,o=0;else if(h===void 0&&typeof o=="string")u=o,h=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(h)?(h=h>>>0,u===void 0&&(u="utf8")):(u=h,h=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var _=this.length-o;if((h===void 0||h>_)&&(h=_),n.length>0&&(h<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");u||(u="utf8");for(var y=!1;;)switch(u){case"hex":return at(this,n,o,h);case"utf8":case"utf-8":return Se(this,n,o,h);case"ascii":case"latin1":case"binary":return Dt(this,n,o,h);case"base64":return Ae(this,n,o,h);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Yt(this,n,o,h);default:if(y)throw new TypeError("Unknown encoding: "+u);u=(""+u).toLowerCase(),y=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yt(c,n,o){return n===0&&o===c.length?xe.fromByteArray(c):xe.fromByteArray(c.slice(n,o))}function vt(c,n,o){o=Math.min(c.length,o);for(var h=[],u=n;u<o;){var _=c[u],y=null,N=_>239?4:_>223?3:_>191?2:1;if(u+N<=o){var D,R,U,B;switch(N){case 1:_<128&&(y=_);break;case 2:D=c[u+1],(D&192)===128&&(B=(_&31)<<6|D&63,B>127&&(y=B));break;case 3:D=c[u+1],R=c[u+2],(D&192)===128&&(R&192)===128&&(B=(_&15)<<12|(D&63)<<6|R&63,B>2047&&(B<55296||B>57343)&&(y=B));break;case 4:D=c[u+1],R=c[u+2],U=c[u+3],(D&192)===128&&(R&192)===128&&(U&192)===128&&(B=(_&15)<<18|(D&63)<<12|(R&63)<<6|U&63,B>65535&&B<1114112&&(y=B))}}y===null?(y=65533,N=1):y>65535&&(y-=65536,h.push(y>>>10&1023|55296),y=56320|y&1023),h.push(y),u+=N}return Wt(h)}var ct=4096;function Wt(c){var n=c.length;if(n<=ct)return String.fromCharCode.apply(String,c);for(var o="",h=0;h<n;)o+=String.fromCharCode.apply(String,c.slice(h,h+=ct));return o}function wt(c,n,o){var h="";o=Math.min(c.length,o);for(var u=n;u<o;++u)h+=String.fromCharCode(c[u]&127);return h}function x(c,n,o){var h="";o=Math.min(c.length,o);for(var u=n;u<o;++u)h+=String.fromCharCode(c[u]);return h}function J(c,n,o){var h=c.length;(!n||n<0)&&(n=0),(!o||o<0||o>h)&&(o=h);for(var u="",_=n;_<o;++_)u+=Xr[c[_]];return u}function C(c,n,o){for(var h=c.slice(n,o),u="",_=0;_<h.length-1;_+=2)u+=String.fromCharCode(h[_]+h[_+1]*256);return u}a.prototype.slice=function(n,o){var h=this.length;n=~~n,o=o===void 0?h:~~o,n<0?(n+=h,n<0&&(n=0)):n>h&&(n=h),o<0?(o+=h,o<0&&(o=0)):o>h&&(o=h),o<n&&(o=n);var u=this.subarray(n,o);return Object.setPrototypeOf(u,a.prototype),u};function T(c,n,o){if(c%1!==0||c<0)throw new RangeError("offset is not uint");if(c+n>o)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(n,o,h){n=n>>>0,o=o>>>0,h||T(n,o,this.length);for(var u=this[n],_=1,y=0;++y<o&&(_*=256);)u+=this[n+y]*_;return u},a.prototype.readUintBE=a.prototype.readUIntBE=function(n,o,h){n=n>>>0,o=o>>>0,h||T(n,o,this.length);for(var u=this[n+--o],_=1;o>0&&(_*=256);)u+=this[n+--o]*_;return u},a.prototype.readUint8=a.prototype.readUInt8=function(n,o){return n=n>>>0,o||T(n,1,this.length),this[n]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||T(n,2,this.length),this[n]|this[n+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||T(n,2,this.length),this[n]<<8|this[n+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||T(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,o){return n=n>>>0,o||T(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},a.prototype.readIntLE=function(n,o,h){n=n>>>0,o=o>>>0,h||T(n,o,this.length);for(var u=this[n],_=1,y=0;++y<o&&(_*=256);)u+=this[n+y]*_;return _*=128,u>=_&&(u-=Math.pow(2,8*o)),u},a.prototype.readIntBE=function(n,o,h){n=n>>>0,o=o>>>0,h||T(n,o,this.length);for(var u=o,_=1,y=this[n+--u];u>0&&(_*=256);)y+=this[n+--u]*_;return _*=128,y>=_&&(y-=Math.pow(2,8*o)),y},a.prototype.readInt8=function(n,o){return n=n>>>0,o||T(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},a.prototype.readInt16LE=function(n,o){n=n>>>0,o||T(n,2,this.length);var h=this[n]|this[n+1]<<8;return h&32768?h|4294901760:h},a.prototype.readInt16BE=function(n,o){n=n>>>0,o||T(n,2,this.length);var h=this[n+1]|this[n]<<8;return h&32768?h|4294901760:h},a.prototype.readInt32LE=function(n,o){return n=n>>>0,o||T(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},a.prototype.readInt32BE=function(n,o){return n=n>>>0,o||T(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},a.prototype.readFloatLE=function(n,o){return n=n>>>0,o||T(n,4,this.length),Ot.read(this,n,!0,23,4)},a.prototype.readFloatBE=function(n,o){return n=n>>>0,o||T(n,4,this.length),Ot.read(this,n,!1,23,4)},a.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||T(n,8,this.length),Ot.read(this,n,!0,52,8)},a.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||T(n,8,this.length),Ot.read(this,n,!1,52,8)};function $(c,n,o,h,u,_){if(!a.isBuffer(c))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>u||n<_)throw new RangeError('"value" argument is out of bounds');if(o+h>c.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(n,o,h,u){if(n=+n,o=o>>>0,h=h>>>0,!u){var _=Math.pow(2,8*h)-1;$(this,n,o,h,_,0)}var y=1,N=0;for(this[o]=n&255;++N<h&&(y*=256);)this[o+N]=n/y&255;return o+h},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(n,o,h,u){if(n=+n,o=o>>>0,h=h>>>0,!u){var _=Math.pow(2,8*h)-1;$(this,n,o,h,_,0)}var y=h-1,N=1;for(this[o+y]=n&255;--y>=0&&(N*=256);)this[o+y]=n/N&255;return o+h},a.prototype.writeUint8=a.prototype.writeUInt8=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,1,255,0),this[o]=n&255,o+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,4,4294967295,0),this[o+3]=n>>>24,this[o+2]=n>>>16,this[o+1]=n>>>8,this[o]=n&255,o+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,4,4294967295,0),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4},a.prototype.writeIntLE=function(n,o,h,u){if(n=+n,o=o>>>0,!u){var _=Math.pow(2,8*h-1);$(this,n,o,h,_-1,-_)}var y=0,N=1,D=0;for(this[o]=n&255;++y<h&&(N*=256);)n<0&&D===0&&this[o+y-1]!==0&&(D=1),this[o+y]=(n/N>>0)-D&255;return o+h},a.prototype.writeIntBE=function(n,o,h,u){if(n=+n,o=o>>>0,!u){var _=Math.pow(2,8*h-1);$(this,n,o,h,_-1,-_)}var y=h-1,N=1,D=0;for(this[o+y]=n&255;--y>=0&&(N*=256);)n<0&&D===0&&this[o+y+1]!==0&&(D=1),this[o+y]=(n/N>>0)-D&255;return o+h},a.prototype.writeInt8=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1},a.prototype.writeInt16LE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2},a.prototype.writeInt16BE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2},a.prototype.writeInt32LE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,4,2147483647,-2147483648),this[o]=n&255,this[o+1]=n>>>8,this[o+2]=n>>>16,this[o+3]=n>>>24,o+4},a.prototype.writeInt32BE=function(n,o,h){return n=+n,o=o>>>0,h||$(this,n,o,4,2147483647,-2147483648),n<0&&(n=4294967295+n+1),this[o]=n>>>24,this[o+1]=n>>>16,this[o+2]=n>>>8,this[o+3]=n&255,o+4};function ni(c,n,o,h,u,_){if(o+h>c.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function oi(c,n,o,h,u){return n=+n,o=o>>>0,u||ni(c,n,o,4),Ot.write(c,n,o,h,23,4),o+4}a.prototype.writeFloatLE=function(n,o,h){return oi(this,n,o,!0,h)},a.prototype.writeFloatBE=function(n,o,h){return oi(this,n,o,!1,h)};function si(c,n,o,h,u){return n=+n,o=o>>>0,u||ni(c,n,o,8),Ot.write(c,n,o,h,52,8),o+8}a.prototype.writeDoubleLE=function(n,o,h){return si(this,n,o,!0,h)},a.prototype.writeDoubleBE=function(n,o,h){return si(this,n,o,!1,h)},a.prototype.copy=function(n,o,h,u){if(!a.isBuffer(n))throw new TypeError("argument should be a Buffer");if(h||(h=0),!u&&u!==0&&(u=this.length),o>=n.length&&(o=n.length),o||(o=0),u>0&&u<h&&(u=h),u===h||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(h<0||h>=this.length)throw new RangeError("Index out of range");if(u<0)throw new RangeError("sourceEnd out of bounds");u>this.length&&(u=this.length),n.length-o<u-h&&(u=n.length-o+h);var _=u-h;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,h,u):Uint8Array.prototype.set.call(n,this.subarray(h,u),o),_},a.prototype.fill=function(n,o,h,u){if(typeof n=="string"){if(typeof o=="string"?(u=o,o=0,h=this.length):typeof h=="string"&&(u=h,h=this.length),u!==void 0&&typeof u!="string")throw new TypeError("encoding must be a string");if(typeof u=="string"&&!a.isEncoding(u))throw new TypeError("Unknown encoding: "+u);if(n.length===1){var _=n.charCodeAt(0);(u==="utf8"&&_<128||u==="latin1")&&(n=_)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<h)throw new RangeError("Out of range index");if(h<=o)return this;o=o>>>0,h=h===void 0?this.length:h>>>0,n||(n=0);var y;if(typeof n=="number")for(y=o;y<h;++y)this[y]=n;else{var N=a.isBuffer(n)?n:a.from(n,u),D=N.length;if(D===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(y=0;y<h-o;++y)this[y+o]=N[y%D]}return this};var Hr=/[^+/0-9A-Za-z-_]/g;function $r(c){if(c=c.split("=")[0],c=c.trim().replace(Hr,""),c.length<2)return"";for(;c.length%4!==0;)c=c+"=";return c}function Te(c,n){n=n||1/0;for(var o,h=c.length,u=null,_=[],y=0;y<h;++y){if(o=c.charCodeAt(y),o>55295&&o<57344){if(!u){if(o>56319){(n-=3)>-1&&_.push(239,191,189);continue}else if(y+1===h){(n-=3)>-1&&_.push(239,191,189);continue}u=o;continue}if(o<56320){(n-=3)>-1&&_.push(239,191,189),u=o;continue}o=(u-55296<<10|o-56320)+65536}else u&&(n-=3)>-1&&_.push(239,191,189);if(u=null,o<128){if((n-=1)<0)break;_.push(o)}else if(o<2048){if((n-=2)<0)break;_.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;_.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;_.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return _}function Yr(c){for(var n=[],o=0;o<c.length;++o)n.push(c.charCodeAt(o)&255);return n}function Wr(c,n){for(var o,h,u,_=[],y=0;y<c.length&&!((n-=2)<0);++y)o=c.charCodeAt(y),h=o>>8,u=o%256,_.push(u),_.push(h);return _}function ai(c){return xe.toByteArray($r(c))}function Xt(c,n,o,h){for(var u=0;u<h&&!(u+o>=n.length||u>=c.length);++u)n[u+o]=c[u];return u}function et(c,n){return c instanceof n||c!=null&&c.constructor!=null&&c.constructor.name!=null&&c.constructor.name===n.name}function Ne(c){return c!==c}var Xr=(function(){for(var c="0123456789abcdef",n=new Array(256),o=0;o<16;++o)for(var h=o*16,u=0;u<16;++u)n[h+u]=c[o]+c[u];return n})()}),I=ue.Buffer;ue.SlowBuffer;ue.INSPECT_MAX_BYTES;ue.kMaxLength;var ke=function(t,i){return ke=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var l in s)s.hasOwnProperty(l)&&(r[l]=s[l])},ke(t,i)};function fe(e,t){ke(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var gt=(function(e){fe(t,e);function t(i){var r=e.call(this,i)||this;return Object.setPrototypeOf(r,t.prototype),r}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONError"},enumerable:!1,configurable:!0}),t})(Error),L=(function(e){fe(t,e);function t(i){var r=e.call(this,i)||this;return Object.setPrototypeOf(r,t.prototype),r}return Object.defineProperty(t.prototype,"name",{get:function(){return"BSONTypeError"},enumerable:!1,configurable:!0}),t})(TypeError);function le(e){return e&&e.Math==Math&&e}function cr(){return le(typeof globalThis=="object"&&globalThis)||le(typeof window=="object"&&window)||le(typeof self=="object"&&self)||le(typeof global=="object"&&global)||Function("return this")()}function un(){var e=cr();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var fn=function(t){var i=un()?"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(i);for(var r=I.alloc(t),s=0;s<t;++s)r[s]=Math.floor(Math.random()*256);return r},pn=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(I.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(I.alloc(t))}:fn}},lr=pn();function dn(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ue(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function gn(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function _n(e){return Ft(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Ft(e){return typeof e=="object"&&e!==null}function pe(e,t){var i=!1;function r(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return i||(console.warn(t),i=!0),e.apply(this,s)}return r}function he(e){if(ArrayBuffer.isView(e))return I.from(e.buffer,e.byteOffset,e.byteLength);if(dn(e))return I.from(e);throw new L("Must use either Buffer or TypedArray")}var mn=/^(?:[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,hr=function(e){return typeof e=="string"&&mn.test(e)},Fe=function(e){if(!hr(e))throw new L('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 I.from(t,"hex")},Xi=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 Lo=Math.pow(2,63)-1,Mo=-Math.pow(2,63),yn=Math.pow(2,53),vn=-Math.pow(2,53);var ur=4;var _t=(function(){function e(t,i){if(!(this instanceof e))return new e(t,i);if(t!=null&&typeof t!="string"&&!ArrayBuffer.isView(t)&&!(t instanceof ArrayBuffer)&&!Array.isArray(t))throw new L("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=i??e.BSON_BINARY_SUBTYPE_DEFAULT,t==null?(this.buffer=I.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=I.from(t,"binary"):Array.isArray(t)?this.buffer=I.from(t):this.buffer=he(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new L("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new L("only accepts single character Uint8Array or Array");var i;if(typeof t=="string"?i=t.charCodeAt(0):typeof t=="number"?i=t:i=t[0],i<0||i>255)throw new L("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=i;else{var r=I.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r,this.buffer[this.position++]=i}},e.prototype.write=function(t,i){if(i=typeof i=="number"?i:this.position,this.buffer.length<i+t.length){var r=I.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(he(t),i),this.position=i+t.byteLength>this.position?i+t.length:this.position):typeof t=="string"&&(this.buffer.write(t,i,t.length,"binary"),this.position=i+t.length>this.position?i+t.length:this.position)},e.prototype.read=function(t,i){return i=i&&i>0?i:this.position,this.buffer.slice(t,t+i)},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 i=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return t.legacy?{$binary:i,$type:r.length===1?"0"+r:r}:{$binary:{base64:i,subType:r.length===1?"0"+r:r}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new zi(this.buffer.slice(0,this.position));throw new gt('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,i){i=i||{};var r,s;if("$binary"in t?i.legacy&&typeof t.$binary=="string"&&"$type"in t?(s=t.$type?parseInt(t.$type,16):0,r=I.from(t.$binary,"base64")):typeof t.$binary!="string"&&(s=t.$binary.subType?parseInt(t.$binary.subType,16):0,r=I.from(t.$binary.base64,"base64")):"$uuid"in t&&(s=4,r=Fe(t.$uuid)),!r)throw new L("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return s===ur?new zi(r):new e(r,s)},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(_t.prototype,"_bsontype",{value:"Binary"});var Be=16,zi=(function(e){fe(t,e);function t(i){var r=this,s,l;if(i==null)s=t.generate();else if(i instanceof t)s=I.from(i.buffer),l=i.__id;else if(ArrayBuffer.isView(i)&&i.byteLength===Be)s=he(i);else if(typeof i=="string")s=Fe(i);else throw new L("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 r=e.call(this,s,ur)||this,r.__id=l,r}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(i){this.buffer=i,t.cacheHexString&&(this.__id=Xi(i))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(i){if(i===void 0&&(i=!0),t.cacheHexString&&this.__id)return this.__id;var r=Xi(this.id,i);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(i){return i?this.id.toString(i):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(i){if(!i)return!1;if(i instanceof t)return i.id.equals(this.id);try{return new t(i).id.equals(this.id)}catch{return!1}},t.prototype.toBinary=function(){return new _t(this.id,_t.SUBTYPE_UUID)},t.generate=function(){var i=lr(Be);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,I.from(i)},t.isValid=function(i){return i?i instanceof t?!0:typeof i=="string"?hr(i):Ue(i)?i.length!==Be?!1:(i[6]&240)===64&&(i[8]&128)===128:!1:!1},t.createFromHexString=function(i){var r=Fe(i);return new t(r)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t})(_t),de=(function(){function e(t,i){if(!(this instanceof e))return new e(t,i);this.code=t,this.scope=i}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(de.prototype,"_bsontype",{value:"Code"});function wn(e){return Ft(e)&&e.$id!=null&&typeof e.$ref=="string"&&(e.$db==null||typeof e.$db=="string")}var Pt=(function(){function e(t,i,r,s){if(!(this instanceof e))return new e(t,i,r,s);var l=t.split(".");l.length===2&&(r=l.shift(),t=l.shift()),this.collection=t,this.oid=i,this.db=r,this.fields=s||{}}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 i={$ref:this.collection,$id:this.oid};return t.legacy||(this.db&&(i.$db=this.db),i=Object.assign(i,this.fields)),i},e.fromExtendedJSON=function(t){var i=Object.assign({},t);return delete i.$ref,delete i.$id,delete i.$db,new e(t.$ref,t.$id,t.$db,i)},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(Pt.prototype,"_bsontype",{value:"DBRef"});var Z=void 0;try{Z=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 Gi=65536,En=1<<24,At=Gi*Gi,fr=At*At,Zi=fr/2,Ki={},Ji={},E=(function(){function e(t,i,r){if(t===void 0&&(t=0),!(this instanceof e))return new e(t,i,r);typeof t=="bigint"?Object.assign(this,e.fromBigInt(t,!!i)):typeof t=="string"?Object.assign(this,e.fromString(t,!!i)):(this.low=t|0,this.high=i|0,this.unsigned=!!r),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,i,r){return new e(t,i,r)},e.fromInt=function(t,i){var r,s,l;return i?(t>>>=0,(l=0<=t&&t<256)&&(s=Ji[t],s)?s:(r=e.fromBits(t,(t|0)<0?-1:0,!0),l&&(Ji[t]=r),r)):(t|=0,(l=-128<=t&&t<128)&&(s=Ki[t],s)?s:(r=e.fromBits(t,t<0?-1:0,!1),l&&(Ki[t]=r),r))},e.fromNumber=function(t,i){if(isNaN(t))return i?e.UZERO:e.ZERO;if(i){if(t<0)return e.UZERO;if(t>=fr)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Zi)return e.MIN_VALUE;if(t+1>=Zi)return e.MAX_VALUE}return t<0?e.fromNumber(-t,i).neg():e.fromBits(t%At|0,t/At|0,i)},e.fromBigInt=function(t,i){return e.fromString(t.toString(),i)},e.fromString=function(t,i,r){if(t.length===0)throw Error("empty string");if(t==="NaN"||t==="Infinity"||t==="+Infinity"||t==="-Infinity")return e.ZERO;if(typeof i=="number"?(r=i,i=!1):i=!!i,r=r||10,r<2||36<r)throw RangeError("radix");var s;if((s=t.indexOf("-"))>0)throw Error("interior hyphen");if(s===0)return e.fromString(t.substring(1),i,r).neg();for(var l=e.fromNumber(Math.pow(r,8)),a=e.ZERO,f=0;f<t.length;f+=8){var d=Math.min(8,t.length-f),p=parseInt(t.substring(f,f+d),r);if(d<8){var g=e.fromNumber(Math.pow(r,d));a=a.mul(g).add(e.fromNumber(p))}else a=a.mul(l),a=a.add(e.fromNumber(p))}return a.unsigned=i,a},e.fromBytes=function(t,i,r){return r?e.fromBytesLE(t,i):e.fromBytesBE(t,i)},e.fromBytesLE=function(t,i){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,i)},e.fromBytesBE=function(t,i){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],i)},e.isLong=function(t){return Ft(t)&&t.__isLong__===!0},e.fromValue=function(t,i){return typeof t=="number"?e.fromNumber(t,i):typeof t=="string"?e.fromString(t,i):e.fromBits(t.low,t.high,typeof i=="boolean"?i:t.unsigned)},e.prototype.add=function(t){e.isLong(t)||(t=e.fromValue(t));var i=this.high>>>16,r=this.high&65535,s=this.low>>>16,l=this.low&65535,a=t.high>>>16,f=t.high&65535,d=t.low>>>16,p=t.low&65535,g=0,m=0,v=0,b=0;return b+=l+p,v+=b>>>16,b&=65535,v+=s+d,m+=v>>>16,v&=65535,m+=r+f,g+=m>>>16,m&=65535,g+=i+a,g&=65535,e.fromBits(v<<16|b,g<<16|m,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 i=this.isNegative(),r=t.isNegative();return i&&!r?-1:!i&&r?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(Z){if(!this.unsigned&&this.high===-2147483648&&t.low===-1&&t.high===-1)return this;var i=(this.unsigned?Z.div_u:Z.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(i,Z.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var r,s,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 r=a.div(t).shl(1),r.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(s=this.sub(t.mul(r)),l=r.add(s.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(s=this;s.gte(t);){r=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var f=Math.ceil(Math.log(r)/Math.LN2),d=f<=48?1:Math.pow(2,f-48),p=e.fromNumber(r),g=p.mul(t);g.isNegative()||g.gt(s);)r-=d,p=e.fromNumber(r,this.unsigned),g=p.mul(t);p.isZero()&&(p=e.ONE),l=l.add(p),s=s.sub(g)}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,i;for(i=31;i>0&&(t&1<<i)===0;i--);return this.high!==0?i+33:i+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)),Z){var i=(this.unsigned?Z.rem_u:Z.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(i,Z.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)),Z){var i=Z.mul(this.low,this.high,t.low,t.high);return e.fromBits(i,Z.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 r=this.high>>>16,s=this.high&65535,l=this.low>>>16,a=this.low&65535,f=t.high>>>16,d=t.high&65535,p=t.low>>>16,g=t.low&65535,m=0,v=0,b=0,w=0;return w+=a*g,b+=w>>>16,w&=65535,b+=l*g,v+=b>>>16,b&=65535,b+=a*p,v+=b>>>16,b&=65535,v+=s*g,m+=v>>>16,v&=65535,v+=l*p,m+=v>>>16,v&=65535,v+=a*d,m+=v>>>16,v&=65535,m+=r*g+s*p+l*d+a*f,m&=65535,e.fromBits(b<<16|w,m<<16|v,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 i=this.high;if(t<32){var r=this.low;return e.fromBits(r>>>t|i<<32-t,i>>>t,this.unsigned)}else return t===32?e.fromBits(i,0,this.unsigned):e.fromBits(i>>>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)*At+(this.low>>>0):this.high*At+(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,i=this.low;return[i&255,i>>>8&255,i>>>16&255,i>>>24,t&255,t>>>8&255,t>>>16&255,t>>>24]},e.prototype.toBytesBE=function(){var t=this.high,i=this.low;return[t>>>24,t>>>16&255,t>>>8&255,t&255,i>>>24,i>>>16&255,i>>>8&255,i&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 i=e.fromNumber(t),r=this.div(i),s=r.mul(i).sub(this);return r.toString(t)+s.toInt().toString(t)}else return"-"+this.neg().toString(t);for(var l=e.fromNumber(Math.pow(t,6),this.unsigned),a=this,f="";;){var d=a.div(l),p=a.sub(d.mul(l)).toInt()>>>0,g=p.toString(t);if(a=d,a.isZero())return g+f;for(;g.length<6;)g="0"+g;f=""+g+f}},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,i){var r=e.fromString(t.$numberLong);return i&&i.relaxed?r.toNumber():r},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(En),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(E.prototype,"__isLong__",{value:!0});Object.defineProperty(E.prototype,"_bsontype",{value:"Long"});var bn=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,On=/^(\+|-)?(Infinity|inf)$/i,Sn=/^(\+|-)?NaN$/i,Mt=6111,Le=-6176,qi=6176,An=34,Me=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Qi=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),tr=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Tn=/^([-+])?(\d+)?$/,Nn=31,er=16383,Cn=30,In=31;function ir(e){return!isNaN(parseInt(e,10))}function Dn(e){var t=E.fromNumber(1e9),i=E.fromNumber(0);if(!e.parts[0]&&!e.parts[1]&&!e.parts[2]&&!e.parts[3])return{quotient:e,rem:i};for(var r=0;r<=3;r++)i=i.shiftLeft(32),i=i.add(new E(e.parts[r],0)),e.parts[r]=i.div(t).low,i=i.modulo(t);return{quotient:e,rem:i}}function Rn(e,t){if(!e&&!t)return{high:E.fromNumber(0),low:E.fromNumber(0)};var i=e.shiftRightUnsigned(32),r=new E(e.getLowBits(),0),s=t.shiftRightUnsigned(32),l=new E(t.getLowBits(),0),a=i.multiply(s),f=i.multiply(l),d=r.multiply(s),p=r.multiply(l);return a=a.add(f.shiftRightUnsigned(32)),f=new E(f.getLowBits(),0).add(d).add(p.shiftRightUnsigned(32)),a=a.add(f.shiftRightUnsigned(32)),p=f.shiftLeft(32).add(new E(p.getLowBits(),0)),{high:a,low:p}}function xn(e,t){var i=e.high>>>0,r=t.high>>>0;if(i<r)return!0;if(i===r){var s=e.low>>>0,l=t.low>>>0;if(s<l)return!0}return!1}function St(e,t){throw new L('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var je=(function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ue(t)){if(t.byteLength!==16)throw new L("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new L("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var i=!1,r=!1,s=!1,l=0,a=0,f=0,d=0,p=0,g=[0],m=0,v=0,b=0,w=0,A=0,k=0,M=new E(0,0),P=new E(0,0),H=0,O=0;if(t.length>=7e3)throw new L(""+t+" not a valid Decimal128 string");var z=t.match(bn),tt=t.match(On),at=t.match(Sn);if(!z&&!tt&&!at||t.length===0)throw new L(""+t+" not a valid Decimal128 string");if(z){var Se=z[2],Dt=z[4],Ae=z[5],Yt=z[6];Dt&&Yt===void 0&&St(t,"missing exponent power"),Dt&&Se===void 0&&St(t,"missing exponent base"),Dt===void 0&&(Ae||Yt)&&St(t,"missing e before exponent")}if((t[O]==="+"||t[O]==="-")&&(i=t[O++]==="-"),!ir(t[O])&&t[O]!=="."){if(t[O]==="i"||t[O]==="I")return new e(I.from(i?Qi:tr));if(t[O]==="N")return new e(I.from(Me))}for(;ir(t[O])||t[O]===".";){if(t[O]==="."){r&&St(t,"contains multiple periods"),r=!0,O=O+1;continue}m<34&&(t[O]!=="0"||s)&&(s||(p=a),s=!0,g[v++]=parseInt(t[O],10),m=m+1),s&&(f=f+1),r&&(d=d+1),a=a+1,O=O+1}if(r&&!a)throw new L(""+t+" not a valid Decimal128 string");if(t[O]==="e"||t[O]==="E"){var yt=t.substr(++O).match(Tn);if(!yt||!yt[2])return new e(I.from(Me));A=parseInt(yt[0],10),O=O+yt[0].length}if(t[O])return new e(I.from(Me));if(b=0,!m)b=0,w=0,g[0]=0,f=1,m=1,l=0;else if(w=m-1,l=f,l!==1)for(;g[p+l-1]===0;)l=l-1;for(A<=d&&d-A>16384?A=Le:A=A-d;A>Mt;){if(w=w+1,w-b>An){var vt=g.join("");if(vt.match(/^0+$/)){A=Mt;break}St(t,"overflow")}A=A-1}for(;A<Le||m<f;){if(w===0&&l<m){A=Le,l=0;break}if(m<f?f=f-1:w=w-1,A<Mt)A=A+1;else{var vt=g.join("");if(vt.match(/^0+$/)){A=Mt;break}St(t,"overflow")}}if(w-b+1<l){var ct=a;r&&(p=p+1,ct=ct+1),i&&(p=p+1,ct=ct+1);var Wt=parseInt(t[p+w+1],10),wt=0;if(Wt>=5&&(wt=1,Wt===5)){for(wt=g[w]%2===1?1:0,k=p+w+2;k<ct;k++)if(parseInt(t[k],10)){wt=1;break}}if(wt){for(var x=w;x>=0;x--)if(++g[x]>9&&(g[x]=0,x===0))if(A<Mt)A=A+1,g[x]=1;else return new e(I.from(i?Qi:tr))}}if(M=E.fromNumber(0),P=E.fromNumber(0),l===0)M=E.fromNumber(0),P=E.fromNumber(0);else if(w-b<17){var x=b;for(P=E.fromNumber(g[x++]),M=new E(0,0);x<=w;x++)P=P.multiply(E.fromNumber(10)),P=P.add(E.fromNumber(g[x]))}else{var x=b;for(M=E.fromNumber(g[x++]);x<=w-17;x++)M=M.multiply(E.fromNumber(10)),M=M.add(E.fromNumber(g[x]));for(P=E.fromNumber(g[x++]);x<=w;x++)P=P.multiply(E.fromNumber(10)),P=P.add(E.fromNumber(g[x]))}var J=Rn(M,E.fromString("100000000000000000"));J.low=J.low.add(P),xn(J.low,P)&&(J.high=J.high.add(E.fromNumber(1))),H=A+qi;var C={low:E.fromNumber(0),high:E.fromNumber(0)};J.high.shiftRightUnsigned(49).and(E.fromNumber(1)).equals(E.fromNumber(1))?(C.high=C.high.or(E.fromNumber(3).shiftLeft(61)),C.high=C.high.or(E.fromNumber(H).and(E.fromNumber(16383).shiftLeft(47))),C.high=C.high.or(J.high.and(E.fromNumber(0x7fffffffffff)))):(C.high=C.high.or(E.fromNumber(H&16383).shiftLeft(49)),C.high=C.high.or(J.high.and(E.fromNumber(562949953421311)))),C.low=J.low,i&&(C.high=C.high.or(E.fromString("9223372036854775808")));var T=I.alloc(16);return O=0,T[O++]=C.low.low&255,T[O++]=C.low.low>>8&255,T[O++]=C.low.low>>16&255,T[O++]=C.low.low>>24&255,T[O++]=C.low.high&255,T[O++]=C.low.high>>8&255,T[O++]=C.low.high>>16&255,T[O++]=C.low.high>>24&255,T[O++]=C.high.low&255,T[O++]=C.high.low>>8&255,T[O++]=C.high.low>>16&255,T[O++]=C.high.low>>24&255,T[O++]=C.high.high&255,T[O++]=C.high.high>>8&255,T[O++]=C.high.high>>16&255,T[O++]=C.high.high>>24&255,new e(T)},e.prototype.toString=function(){for(var t,i=0,r=new Array(36),s=0;s<r.length;s++)r[s]=0;var l=0,a=!1,f,d={parts:[0,0,0,0]},p,g,m=[];l=0;var v=this.bytes,b=v[l++]|v[l++]<<8|v[l++]<<16|v[l++]<<24,w=v[l++]|v[l++]<<8|v[l++]<<16|v[l++]<<24,A=v[l++]|v[l++]<<8|v[l++]<<16|v[l++]<<24,k=v[l++]|v[l++]<<8|v[l++]<<16|v[l++]<<24;l=0;var M={low:new E(b,w),high:new E(A,k)};M.high.lessThan(E.ZERO)&&m.push("-");var P=k>>26&Nn;if(P>>3===3){if(P===Cn)return m.join("")+"Infinity";if(P===In)return"NaN";t=k>>15&er,f=8+(k>>14&1)}else f=k>>14&7,t=k>>17&er;var H=t-qi;if(d.parts[0]=(k&16383)+((f&15)<<14),d.parts[1]=A,d.parts[2]=w,d.parts[3]=b,d.parts[0]===0&&d.parts[1]===0&&d.parts[2]===0&&d.parts[3]===0)a=!0;else for(g=3;g>=0;g--){var O=0,z=Dn(d);if(d=z.quotient,O=z.rem.low,!!O)for(p=8;p>=0;p--)r[g*9+p]=O%10,O=Math.floor(O/10)}if(a)i=1,r[l]=0;else for(i=36;!r[l];)i=i-1,l=l+1;var tt=i-1+H;if(tt>=34||tt<=-7||H>0){if(i>34)return m.push("".concat(0)),H>0?m.push("E+".concat(H)):H<0&&m.push("E".concat(H)),m.join("");m.push("".concat(r[l++])),i=i-1,i&&m.push(".");for(var s=0;s<i;s++)m.push("".concat(r[l++]));m.push("E"),tt>0?m.push("+".concat(tt)):m.push("".concat(tt))}else if(H>=0)for(var s=0;s<i;s++)m.push("".concat(r[l++]));else{var at=i+H;if(at>0)for(var s=0;s<at;s++)m.push("".concat(r[l++]));else m.push("0");for(m.push(".");at++<0;)m.push("0");for(var s=0;s<i-Math.max(at-1,0);s++)m.push("".concat(r[l++]))}return m.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(je.prototype,"_bsontype",{value:"Decimal128"});var ge=(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,i){var r=parseFloat(t.$numberDouble);return i&&i.relaxed?r:new e(r)},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(ge.prototype,"_bsontype",{value:"Double"});var _e=(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,i){return i&&i.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(_e.prototype,"_bsontype",{value:"Int32"});var Ve=(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(Ve.prototype,"_bsontype",{value:"MaxKey"});var He=(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(He.prototype,"_bsontype",{value:"MinKey"});var Bn=new RegExp("^[0-9a-fA-F]{24}$"),dt=null,rt=Symbol("id"),V=(function(){function e(t){if(!(this instanceof e))return new e(t);var i;if(typeof t=="object"&&t&&"id"in t){if(typeof t.id!="string"&&!ArrayBuffer.isView(t.id))throw new L("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?i=I.from(t.toHexString(),"hex"):i=t.id}else i=t;if(i==null||typeof i=="number")this[rt]=e.generate(typeof i=="number"?i:void 0);else if(ArrayBuffer.isView(i)&&i.byteLength===12)this[rt]=i instanceof I?i:he(i);else if(typeof i=="string")if(i.length===12){var r=I.from(i);if(r.byteLength===12)this[rt]=r;else throw new L("Argument passed in must be a string of 12 bytes")}else if(i.length===24&&Bn.test(i))this[rt]=I.from(i,"hex");else throw new L("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new L("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[rt]},set:function(t){this[rt]=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 i=e.getInc(),r=I.alloc(12);return r.writeUInt32BE(t,0),dt===null&&(dt=lr(5)),r[4]=dt[0],r[5]=dt[1],r[6]=dt[2],r[7]=dt[3],r[8]=dt[4],r[11]=i&255,r[10]=i>>8&255,r[9]=i>>16&255,r},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[rt][11]===t[rt][11]&&this[rt].equals(t[rt]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&Ue(this.id))return t===I.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 I.from(t).equals(this.id);if(typeof t=="object"&&"toHexString"in t&&typeof t.toHexString=="function"){var i=t.toHexString(),r=this.toHexString().toLowerCase();return typeof i=="string"&&i.toLowerCase()===r}return!1},e.prototype.getTimestamp=function(){var t=new Date,i=this.id.readUInt32BE(0);return t.setTime(Math.floor(i)*1e3),t},e.createPk=function(){return new e},e.createFromTime=function(t){var i=I.from([0,0,0,0,0,0,0,0,0,0,0,0]);return i.writeUInt32BE(t,0),new e(i)},e.createFromHexString=function(t){if(typeof t>"u"||t!=null&&t.length!==24)throw new L("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(I.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(V.prototype,"generate",{value:pe(function(e){return V.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(V.prototype,"getInc",{value:pe(function(){return V.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(V.prototype,"get_inc",{value:pe(function(){return V.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(V,"get_inc",{value:pe(function(){return V.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(V.prototype,"_bsontype",{value:"ObjectID"});function Ln(e){return e.split("").sort().join("")}var kt=(function(){function e(t,i){if(!(this instanceof e))return new e(t,i);if(this.pattern=t,this.options=Ln(i??""),this.pattern.indexOf("\0")!==-1)throw new gt("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new gt("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var r=0;r<this.options.length;r++)if(!(this.options[r]==="i"||this.options[r]==="m"||this.options[r]==="x"||this.options[r]==="l"||this.options[r]==="s"||this.options[r]==="u"))throw new gt("The regular expression option [".concat(this.options[r],"] 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 L("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e})();Object.defineProperty(kt.prototype,"_bsontype",{value:"BSONRegExp"});var $e=(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($e.prototype,"_bsontype",{value:"Symbol"});var Mn=E,pr=(function(e){fe(t,e);function t(i,r){var s=this;return s instanceof t?(E.isLong(i)?s=e.call(this,i.low,i.high,!0)||this:Ft(i)&&typeof i.t<"u"&&typeof i.i<"u"?s=e.call(this,i.i,i.t,!0)||this:s=e.call(this,i,r,!0)||this,Object.defineProperty(s,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1}),s):new t(i,r)}return t.prototype.toJSON=function(){return{$timestamp:this.toString()}},t.fromInt=function(i){return new t(E.fromInt(i,!0))},t.fromNumber=function(i){return new t(E.fromNumber(i,!0))},t.fromBits=function(i,r){return new t(i,r)},t.fromString=function(i,r){return new t(E.fromString(i,!0,r))},t.prototype.toExtendedJSON=function(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(i){return new t(i.$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=E.MAX_UNSIGNED_VALUE,t})(Mn);function Pn(e){return Ft(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var dr=2147483647,gr=-2147483648,_r=9223372036854776e3,mr=-9223372036854776e3,kn={$oid:V,$binary:_t,$uuid:_t,$symbol:$e,$numberInt:_e,$numberDecimal:je,$numberDouble:ge,$numberLong:E,$minKey:He,$maxKey:Ve,$regex:kt,$regularExpression:kt,$timestamp:pr};function yr(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=gr&&e<=dr)return new _e(e);if(e>=mr&&e<=_r)return E.fromNumber(e)}return new ge(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var i=Object.keys(e).filter(function(m){return m.startsWith("$")&&e[m]!=null}),r=0;r<i.length;r++){var s=kn[i[r]];if(s)return s.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)):E.isLong(l)?a.setTime(l.toNumber()):typeof l=="number"&&t.relaxed&&a.setTime(l),a}if(e.$code!=null){var f=Object.assign({},e);return e.$scope&&(f.$scope=yr(e.$scope)),de.fromExtendedJSON(e)}if(wn(e)||e.$dbPointer){var d=e.$ref?e:e.$dbPointer;if(d instanceof Pt)return d;var p=Object.keys(d).filter(function(m){return m.startsWith("$")}),g=!0;if(p.forEach(function(m){["$ref","$id","$db"].indexOf(m)===-1&&(g=!1)}),g)return Pt.fromExtendedJSON(d)}return e}function Fn(e,t){return e.map(function(i,r){t.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return ht(i,t)}finally{t.seenObjects.pop()}})}function rr(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function ht(e,t){if((typeof e=="object"||typeof e=="function")&&e!==null){var i=t.seenObjects.findIndex(function(M){return M.obj===e});if(i!==-1){var r=t.seenObjects.map(function(M){return M.propertyName}),s=r.slice(0,i).map(function(M){return"".concat(M," -> ")}).join(""),l=r[i],a=" -> "+r.slice(i+1,r.length-1).map(function(M){return"".concat(M," -> ")}).join(""),f=r[r.length-1],d=" ".repeat(s.length+l.length/2),p="-".repeat(a.length+(l.length+f.length)/2-1);throw new L(`Converting circular structure to EJSON:
2
+ `+" ".concat(s).concat(l).concat(a).concat(f,`
3
+ `)+" ".concat(d,"\\").concat(p,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return Fn(e,t);if(e===void 0)return null;if(e instanceof Date||_n(e)){var g=e.getTime(),m=g>-1&&g<2534023188e5;return t.legacy?t.relaxed&&m?{$date:e.getTime()}:{$date:rr(e)}:t.relaxed&&m?{$date:rr(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var v=e>=gr&&e<=dr,b=e>=mr&&e<=_r;if(v)return{$numberInt:e.toString()};if(b)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||gn(e)){var w=e.flags;if(w===void 0){var A=e.toString().match(/[gimuy]*$/);A&&(w=A[0])}var k=new kt(e.source,w);return k.toExtendedJSON(t)}return e!=null&&typeof e=="object"?jn(e,t):e}var Un={Binary:function(e){return new _t(e.value(),e.sub_type)},Code:function(e){return new de(e.code,e.scope)},DBRef:function(e){return new Pt(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new je(e.bytes)},Double:function(e){return new ge(e.value)},Int32:function(e){return new _e(e.value)},Long:function(e){return E.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 Ve},MinKey:function(){return new He},ObjectID:function(e){return new V(e)},ObjectId:function(e){return new V(e)},BSONRegExp:function(e){return new kt(e.pattern,e.options)},Symbol:function(e){return new $e(e.value)},Timestamp:function(e){return pr.fromBits(e.low,e.high)}};function jn(e,t){if(e==null||typeof e!="object")throw new gt("not an object instance");var i=e._bsontype;if(typeof i>"u"){var r={};for(var s in e){t.seenObjects.push({propertyName:s,obj:null});try{var l=ht(e[s],t);s==="__proto__"?Object.defineProperty(r,s,{value:l,writable:!0,enumerable:!0,configurable:!0}):r[s]=l}finally{t.seenObjects.pop()}}return r}else if(Pn(e)){var a=e;if(typeof a.toExtendedJSON!="function"){var f=Un[e._bsontype];if(!f)throw new L("Unrecognized or invalid _bsontype: "+e._bsontype);a=f(a)}return i==="Code"&&a.scope?a=new de(a.code,ht(a.scope,t)):i==="DBRef"&&a.oid&&(a=new Pt(ht(a.collection,t),ht(a.oid,t),ht(a.db,t),ht(a.fields,t))),a.toExtendedJSON(t)}else throw new gt("_bsontype must be a string, but was: "+typeof i)}var nr;(function(e){function t(l,a){var f=Object.assign({},{relaxed:!0,legacy:!1},a);return typeof f.relaxed=="boolean"&&(f.strict=!f.relaxed),typeof f.strict=="boolean"&&(f.relaxed=!f.strict),JSON.parse(l,function(d,p){if(d.indexOf("\0")!==-1)throw new gt("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(d)));return yr(p,f)})}e.parse=t;function i(l,a,f,d){f!=null&&typeof f=="object"&&(d=f,f=0),a!=null&&typeof a=="object"&&!Array.isArray(a)&&(d=a,a=void 0,f=0);var p=Object.assign({relaxed:!0,legacy:!1},d,{seenObjects:[{propertyName:"(root)",obj:null}]}),g=ht(l,p);return JSON.stringify(g,a,f)}e.stringify=i;function r(l,a){return a=a||{},JSON.parse(i(l,a))}e.serialize=r;function s(l,a){return a=a||{},t(JSON.stringify(l),a)}e.deserialize=s})(nr||(nr={}));var or,sr=cr();sr.Map?or=sr.Map:or=(function(){function e(t){t===void 0&&(t=[]),this._keys=[],this._values={};for(var i=0;i<t.length;i++)if(t[i]!=null){var r=t[i],s=r[0],l=r[1];this._keys.push(s),this._values[s]={v:l,i:this._keys.length-1}}}return e.prototype.clear=function(){this._keys=[],this._values={}},e.prototype.delete=function(t){var i=this._values[t];return i==null?!1:(delete this._values[t],this._keys.splice(i.i,1),!0)},e.prototype.entries=function(){var t=this,i=0;return{next:function(){var r=t._keys[i++];return{value:r!==void 0?[r,t._values[r].v]:void 0,done:r===void 0}}}},e.prototype.forEach=function(t,i){i=i||this;for(var r=0;r<this._keys.length;r++){var s=this._keys[r];t.call(i,this._values[s].v,s,i)}},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,i=0;return{next:function(){var r=t._keys[i++];return{value:r!==void 0?r:void 0,done:r===void 0}}}},e.prototype.set=function(t,i){return this._values[t]?(this._values[t].v=i,this):(this._keys.push(t),this._values[t]={v:i,i:this._keys.length-1},this)},e.prototype.values=function(){var t=this,i=0;return{next:function(){var r=t._keys[i++];return{value:r!==void 0?t._values[r].v:void 0,done:r===void 0}}}},Object.defineProperty(e.prototype,"size",{get:function(){return this._keys.length},enumerable:!1,configurable:!0}),e})();var Po=E.fromNumber(yn),ko=E.fromNumber(vn);var Pe=new Uint8Array(8),Fo=new DataView(Pe.buffer,Pe.byteOffset,Pe.byteLength);var Vn=1024*1024*17,Uo=I.alloc(Vn);var me=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 vr=class{constructor(t,i={},r,s){this.name=t;this.properties=i;this.id=s?new V(s):new V,this.occurred=new Date,r&&(this.trigger=new me(r)),this.newEvent=!s}trigger;items;videos;id;newEvent;cart;currentItem;deviceProps;landingPage;occurred;page;sessionID;sessionNumber;locale;setVideos(t){t&&(this.videos=[t.id],this.properties.current??={videoID:t.id})}};var Ut=class{_attachedHost;attach(t){return this._attachedHost=t,t.attach(this)}detach(){let t=this._attachedHost;t!=null&&(this._attachedHost=null,t.detach())}get isAttached(){return this._attachedHost!=null}setAttachedHost(t){this._attachedHost=t}},Tt=class extends Ut{component;viewContainerRef;injector;projectableNodes;constructor(t,i,r,s){super(),this.component=t,this.viewContainerRef=i,this.injector=r,this.projectableNodes=s}},Nt=class extends Ut{templateRef;viewContainerRef;context;injector;constructor(t,i,r,s){super(),this.templateRef=t,this.viewContainerRef=i,this.context=r,this.injector=s}get origin(){return this.templateRef.elementRef}attach(t,i=this.context){return this.context=i,super.attach(t)}detach(){return this.context=void 0,super.detach()}},Ye=class extends Ut{element;constructor(t){super(),this.element=t instanceof ut?t.nativeElement:t}},Ct=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof Tt)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof Nt)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Ye)return this._attachedPortal=t,this.attachDomPortal(t)}attachDomPortal=null;detach(){this._attachedPortal&&(this._attachedPortal.setAttachedHost(null),this._attachedPortal=null),this._invokeDisposeFn()}dispose(){this.hasAttached()&&this.detach(),this._invokeDisposeFn(),this._isDisposed=!0}setDisposeFn(t){this._disposeFn=t}_invokeDisposeFn(){this._disposeFn&&(this._disposeFn(),this._disposeFn=null)}},ye=class extends Ct{outletElement;_appRef;_defaultInjector;constructor(t,i,r){super(),this.outletElement=t,this._appRef=i,this._defaultInjector=r}attachComponentPortal(t){let i;if(t.viewContainerRef){let r=t.injector||t.viewContainerRef.injector,s=r.get(Ie,null,{optional:!0})||void 0;i=t.viewContainerRef.createComponent(t.component,{index:t.viewContainerRef.length,injector:r,ngModuleRef:s,projectableNodes:t.projectableNodes||void 0}),this.setDisposeFn(()=>i.destroy())}else{let r=this._appRef,s=t.injector||this._defaultInjector||q.NULL,l=s.get(Zt,r.injector);i=Bi(t.component,{elementInjector:s,environmentInjector:l,projectableNodes:t.projectableNodes||void 0}),r.attachView(i.hostView),this.setDisposeFn(()=>{r.viewCount>0&&r.detachView(i.hostView),i.destroy()})}return this.outletElement.appendChild(this._getComponentRootNode(i)),this._attachedPortal=t,i}attachTemplatePortal(t){let i=t.viewContainerRef,r=i.createEmbeddedView(t.templateRef,t.context,{injector:t.injector});return r.rootNodes.forEach(s=>this.outletElement.appendChild(s)),r.detectChanges(),this.setDisposeFn(()=>{let s=i.indexOf(r);s!==-1&&i.remove(s)}),this._attachedPortal=t,r}attachDomPortal=t=>{let i=t.element;i.parentNode;let r=this.outletElement.ownerDocument.createComment("dom-portal");i.parentNode.insertBefore(r,i),this.outletElement.appendChild(i),this._attachedPortal=t,super.setDisposeFn(()=>{r.parentNode&&r.parentNode.replaceChild(i,r)})};dispose(){super.dispose(),this.outletElement.remove()}_getComponentRootNode(t){return t.hostView.rootNodes[0]}};var ze=(()=>{class e extends Ct{_moduleRef=S(Ie,{optional:!0});_document=S(W);_viewContainerRef=S(Ce);_isInitialized=!1;_attachedRef;constructor(){super()}get portal(){return this._attachedPortal}set portal(i){this.hasAttached()&&!i&&!this._isInitialized||(this.hasAttached()&&super.detach(),i&&super.attach(i),this._attachedPortal=i||null)}attached=new bt;get attachedRef(){return this._attachedRef}ngOnInit(){this._isInitialized=!0}ngOnDestroy(){super.dispose(),this._attachedRef=this._attachedPortal=null}attachComponentPortal(i){i.setAttachedHost(this);let r=i.viewContainerRef!=null?i.viewContainerRef:this._viewContainerRef,s=r.createComponent(i.component,{index:r.length,injector:i.injector||r.injector,projectableNodes:i.projectableNodes||void 0,ngModuleRef:this._moduleRef||void 0});return r!==this._viewContainerRef&&this._getRootNode().appendChild(s.hostView.rootNodes[0]),super.setDisposeFn(()=>s.destroy()),this._attachedPortal=i,this._attachedRef=s,this.attached.emit(s),s}attachTemplatePortal(i){i.setAttachedHost(this);let r=this._viewContainerRef.createEmbeddedView(i.templateRef,i.context,{injector:i.injector});return super.setDisposeFn(()=>this._viewContainerRef.clear()),this._attachedPortal=i,this._attachedRef=r,this.attached.emit(r),r}attachDomPortal=i=>{let r=i.element;r.parentNode;let s=this._document.createComment("dom-portal");i.setAttachedHost(this),r.parentNode.insertBefore(s,r),this._getRootNode().appendChild(r),this._attachedPortal=i,super.setDisposeFn(()=>{s.parentNode&&s.parentNode.replaceChild(r,s)})};_getRootNode(){let i=this._viewContainerRef.element.nativeElement;return i.nodeType===i.ELEMENT_NODE?i:i.parentNode}static \u0275fac=function(r){return new(r||e)};static \u0275dir=Rt({type:e,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[te]})}return e})();var jt;function Hn(){if(jt==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>jt=!0}))}finally{jt=jt||!1}return jt}function wr(e){return Hn()?e:!!e.capture}var $n=new G("cdk-input-modality-detector-options"),Yn={ignoreKeys:[18,17,224,91,16]},Er=650,Ge={passive:!0,capture:!0},Wn=(()=>{class e{_platform=S(it);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new pi(null);_options;_lastTouchMs=0;_onKeydown=i=>{this._options?.ignoreKeys?.some(r=>r===i.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=ot(i))};_onMousedown=i=>{Date.now()-this._lastTouchMs<Er||(this._modality.next(Pi(i)?"keyboard":"mouse"),this._mostRecentTarget=ot(i))};_onTouchstart=i=>{if(ki(i)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=ot(i)};constructor(){let i=S(Q),r=S(W),s=S($n,{optional:!0});if(this._options=F(F({},Yn),s),this.modalityDetected=this._modality.pipe(yi(1)),this.modalityChanged=this.modalityDetected.pipe(mi()),this._platform.isBrowser){let l=S(Et).createRenderer(null,null);this._listenerCleanups=i.runOutsideAngular(()=>[l.listen(r,"keydown",this._onKeydown,Ge),l.listen(r,"mousedown",this._onMousedown,Ge),l.listen(r,"touchstart",this._onTouchstart,Ge)])}}ngOnDestroy(){this._modality.complete(),this._listenerCleanups?.forEach(i=>i())}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),we=(function(e){return e[e.IMMEDIATE=0]="IMMEDIATE",e[e.EVENTUAL=1]="EVENTUAL",e})(we||{}),Xn=new G("cdk-focus-monitor-default-options"),ve=wr({passive:!0,capture:!0}),br=(()=>{class e{_ngZone=S(Q);_platform=S(it);_inputModalityDetector=S(Wn);_origin=null;_lastFocusOrigin;_windowFocused=!1;_windowFocusTimeoutId;_originTimeoutId;_originFromTouchInteraction=!1;_elementInfo=new Map;_monitoredElementCount=0;_rootNodeFocusListenerCount=new Map;_detectionMode;_windowFocusListener=()=>{this._windowFocused=!0,this._windowFocusTimeoutId=setTimeout(()=>this._windowFocused=!1)};_document=S(W);_stopInputModalityDetector=new Y;constructor(){let i=S(Xn,{optional:!0});this._detectionMode=i?.detectionMode||we.IMMEDIATE}_rootNodeFocusAndBlurListener=i=>{let r=ot(i);for(let s=r;s;s=s.parentElement)i.type==="focus"?this._onFocus(i,s):this._onBlur(i,s)};monitor(i,r=!1){let s=re(i);if(!this._platform.isBrowser||s.nodeType!==1)return di();let l=Fi(s)||this._document,a=this._elementInfo.get(s);if(a)return r&&(a.checkChildren=!0),a.subject;let f={checkChildren:r,subject:new Y,rootNode:l};return this._elementInfo.set(s,f),this._registerGlobalListeners(f),f.subject}stopMonitoring(i){let r=re(i),s=this._elementInfo.get(r);s&&(s.subject.complete(),this._setClasses(r),this._elementInfo.delete(r),this._removeGlobalListeners(s))}focusVia(i,r,s){let l=re(i),a=this._document.activeElement;l===a?this._getClosestElementsInfo(l).forEach(([f,d])=>this._originChanged(f,r,d)):(this._setOrigin(r),typeof l.focus=="function"&&l.focus(s))}ngOnDestroy(){this._elementInfo.forEach((i,r)=>this.stopMonitoring(r))}_getWindow(){return this._document.defaultView||window}_getFocusOrigin(i){return this._origin?this._originFromTouchInteraction?this._shouldBeAttributedToTouch(i)?"touch":"program":this._origin:this._windowFocused&&this._lastFocusOrigin?this._lastFocusOrigin:i&&this._isLastInteractionFromInputLabel(i)?"mouse":"program"}_shouldBeAttributedToTouch(i){return this._detectionMode===we.EVENTUAL||!!i?.contains(this._inputModalityDetector._mostRecentTarget)}_setClasses(i,r){i.classList.toggle("cdk-focused",!!r),i.classList.toggle("cdk-touch-focused",r==="touch"),i.classList.toggle("cdk-keyboard-focused",r==="keyboard"),i.classList.toggle("cdk-mouse-focused",r==="mouse"),i.classList.toggle("cdk-program-focused",r==="program")}_setOrigin(i,r=!1){this._ngZone.runOutsideAngular(()=>{if(this._origin=i,this._originFromTouchInteraction=i==="touch"&&r,this._detectionMode===we.IMMEDIATE){clearTimeout(this._originTimeoutId);let s=this._originFromTouchInteraction?Er:1;this._originTimeoutId=setTimeout(()=>this._origin=null,s)}})}_onFocus(i,r){let s=this._elementInfo.get(r),l=ot(i);!s||!s.checkChildren&&r!==l||this._originChanged(r,this._getFocusOrigin(l),s)}_onBlur(i,r){let s=this._elementInfo.get(r);!s||s.checkChildren&&i.relatedTarget instanceof Node&&r.contains(i.relatedTarget)||(this._setClasses(r),this._emitOrigin(s,null))}_emitOrigin(i,r){i.subject.observers.length&&this._ngZone.run(()=>i.subject.next(r))}_registerGlobalListeners(i){if(!this._platform.isBrowser)return;let r=i.rootNode,s=this._rootNodeFocusListenerCount.get(r)||0;s||this._ngZone.runOutsideAngular(()=>{r.addEventListener("focus",this._rootNodeFocusAndBlurListener,ve),r.addEventListener("blur",this._rootNodeFocusAndBlurListener,ve)}),this._rootNodeFocusListenerCount.set(r,s+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(wi(this._stopInputModalityDetector)).subscribe(l=>{this._setOrigin(l,!0)}))}_removeGlobalListeners(i){let r=i.rootNode;if(this._rootNodeFocusListenerCount.has(r)){let s=this._rootNodeFocusListenerCount.get(r);s>1?this._rootNodeFocusListenerCount.set(r,s-1):(r.removeEventListener("focus",this._rootNodeFocusAndBlurListener,ve),r.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ve),this._rootNodeFocusListenerCount.delete(r))}--this._monitoredElementCount||(this._getWindow().removeEventListener("focus",this._windowFocusListener),this._stopInputModalityDetector.next(),clearTimeout(this._windowFocusTimeoutId),clearTimeout(this._originTimeoutId))}_originChanged(i,r,s){this._setClasses(i,r),this._emitOrigin(s,r),this._lastFocusOrigin=r}_getClosestElementsInfo(i){let r=[];return this._elementInfo.forEach((s,l)=>{(l===i||s.checkChildren&&l.contains(i))&&r.push([l,s])}),r}_isLastInteractionFromInputLabel(i){let{_mostRecentTarget:r,mostRecentModality:s}=this._inputModalityDetector;if(s!=="mouse"||!r||r===i||i.nodeName!=="INPUT"&&i.nodeName!=="TEXTAREA"||i.disabled)return!1;let l=i.labels;if(l){for(let a=0;a<l.length;a++)if(l[a].contains(r))return!0}return!1}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();var Or=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=lt({type:e,selectors:[["ng-component"]],exportAs:["cdkVisuallyHidden"],decls:0,vars:0,template:function(r,s){},styles:[`.cdk-visually-hidden{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px;white-space:nowrap;outline:0;-webkit-appearance:none;-moz-appearance:none;left:0}[dir=rtl] .cdk-visually-hidden{left:auto;right:0}
4
+ `],encapsulation:2,changeDetection:0})}return e})();var Ke=(()=>{class e{_platform=S(it);constructor(){}isDisabled(i){return i.hasAttribute("disabled")}isVisible(i){return Kn(i)&&getComputedStyle(i).visibility==="visible"}isTabbable(i){if(!this._platform.isBrowser)return!1;let r=Zn(no(i));if(r&&(Sr(r)===-1||!this.isVisible(r)))return!1;let s=i.nodeName.toLowerCase(),l=Sr(i);return i.hasAttribute("contenteditable")?l!==-1:s==="iframe"||s==="object"||this._platform.WEBKIT&&this._platform.IOS&&!io(i)?!1:s==="audio"?i.hasAttribute("controls")?l!==-1:!1:s==="video"?l===-1?!1:l!==null?!0:this._platform.FIREFOX||i.hasAttribute("controls"):i.tabIndex>=0}isFocusable(i,r){return ro(i)&&!this.isDisabled(i)&&(r?.ignoreVisibility||this.isVisible(i))}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Zn(e){try{return e.frameElement}catch{return null}}function Kn(e){return!!(e.offsetWidth||e.offsetHeight||typeof e.getClientRects=="function"&&e.getClientRects().length)}function Jn(e){let t=e.nodeName.toLowerCase();return t==="input"||t==="select"||t==="button"||t==="textarea"}function qn(e){return to(e)&&e.type=="hidden"}function Qn(e){return eo(e)&&e.hasAttribute("href")}function to(e){return e.nodeName.toLowerCase()=="input"}function eo(e){return e.nodeName.toLowerCase()=="a"}function Ar(e){if(!e.hasAttribute("tabindex")||e.tabIndex===void 0)return!1;let t=e.getAttribute("tabindex");return!!(t&&!isNaN(parseInt(t,10)))}function Sr(e){if(!Ar(e))return null;let t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}function io(e){let t=e.nodeName.toLowerCase(),i=t==="input"&&e.type;return i==="text"||i==="password"||t==="select"||t==="textarea"}function ro(e){return qn(e)?!1:Jn(e)||Qn(e)||e.hasAttribute("contenteditable")||Ar(e)}function no(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}var Ze=class{_element;_checker;_ngZone;_document;_injector;_startAnchor;_endAnchor;_hasAttached=!1;startAnchorListener=()=>this.focusLastTabbableElement();endAnchorListener=()=>this.focusFirstTabbableElement();get enabled(){return this._enabled}set enabled(t){this._enabled=t,this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_enabled=!0;constructor(t,i,r,s,l=!1,a){this._element=t,this._checker=i,this._ngZone=r,this._document=s,this._injector=a,l||this.attachAnchors()}destroy(){let t=this._startAnchor,i=this._endAnchor;t&&(t.removeEventListener("focus",this.startAnchorListener),t.remove()),i&&(i.removeEventListener("focus",this.endAnchorListener),i.remove()),this._startAnchor=this._endAnchor=null,this._hasAttached=!1}attachAnchors(){return this._hasAttached?!0:(this._ngZone.runOutsideAngular(()=>{this._startAnchor||(this._startAnchor=this._createAnchor(),this._startAnchor.addEventListener("focus",this.startAnchorListener)),this._endAnchor||(this._endAnchor=this._createAnchor(),this._endAnchor.addEventListener("focus",this.endAnchorListener))}),this._element.parentNode&&(this._element.parentNode.insertBefore(this._startAnchor,this._element),this._element.parentNode.insertBefore(this._endAnchor,this._element.nextSibling),this._hasAttached=!0),this._hasAttached)}focusInitialElementWhenReady(t){return new Promise(i=>{this._executeOnStable(()=>i(this.focusInitialElement(t)))})}focusFirstTabbableElementWhenReady(t){return new Promise(i=>{this._executeOnStable(()=>i(this.focusFirstTabbableElement(t)))})}focusLastTabbableElementWhenReady(t){return new Promise(i=>{this._executeOnStable(()=>i(this.focusLastTabbableElement(t)))})}_getRegionBoundary(t){let i=this._element.querySelectorAll(`[cdk-focus-region-${t}], [cdkFocusRegion${t}], [cdk-focus-${t}]`);return t=="start"?i.length?i[0]:this._getFirstTabbableElement(this._element):i.length?i[i.length-1]:this._getLastTabbableElement(this._element)}focusInitialElement(t){let i=this._element.querySelector("[cdk-focus-initial], [cdkFocusInitial]");if(i){if(!this._checker.isFocusable(i)){let r=this._getFirstTabbableElement(i);return r?.focus(t),!!r}return i.focus(t),!0}return this.focusFirstTabbableElement(t)}focusFirstTabbableElement(t){let i=this._getRegionBoundary("start");return i&&i.focus(t),!!i}focusLastTabbableElement(t){let i=this._getRegionBoundary("end");return i&&i.focus(t),!!i}hasAttached(){return this._hasAttached}_getFirstTabbableElement(t){if(this._checker.isFocusable(t)&&this._checker.isTabbable(t))return t;let i=t.children;for(let r=0;r<i.length;r++){let s=i[r].nodeType===this._document.ELEMENT_NODE?this._getFirstTabbableElement(i[r]):null;if(s)return s}return null}_getLastTabbableElement(t){if(this._checker.isFocusable(t)&&this._checker.isTabbable(t))return t;let i=t.children;for(let r=i.length-1;r>=0;r--){let s=i[r].nodeType===this._document.ELEMENT_NODE?this._getLastTabbableElement(i[r]):null;if(s)return s}return null}_createAnchor(){let t=this._document.createElement("div");return this._toggleAnchorTabIndex(this._enabled,t),t.classList.add("cdk-visually-hidden"),t.classList.add("cdk-focus-trap-anchor"),t.setAttribute("aria-hidden","true"),t}_toggleAnchorTabIndex(t,i){t?i.setAttribute("tabindex","0"):i.removeAttribute("tabindex")}toggleAnchors(t){this._startAnchor&&this._endAnchor&&(this._toggleAnchorTabIndex(t,this._startAnchor),this._toggleAnchorTabIndex(t,this._endAnchor))}_executeOnStable(t){this._injector?ft(t,{injector:this._injector}):setTimeout(t)}},Tr=(()=>{class e{_checker=S(Ke);_ngZone=S(Q);_document=S(W);_injector=S(q);constructor(){S(xt).load(Or)}create(i,r=!1){return new Ze(i,this._checker,this._ngZone,this._document,r,this._injector)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Nr(e,...t){return t.length?t.some(i=>e[i]):e.altKey||e.shiftKey||e.ctrlKey||e.metaKey}function Je(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function st(e){return e==null?"":typeof e=="string"?e:`${e}px`}var Cr=ji();function Rr(e){return new qe(e.get(Vi),e.get(W))}var qe=class{_viewportRuler;_previousHTMLStyles={top:"",left:""};_previousScrollPosition;_isEnabled=!1;_document;constructor(t,i){this._viewportRuler=t,this._document=i}attach(){}enable(){if(this._canBeEnabled()){let t=this._document.documentElement;this._previousScrollPosition=this._viewportRuler.getViewportScrollPosition(),this._previousHTMLStyles.left=t.style.left||"",this._previousHTMLStyles.top=t.style.top||"",t.style.left=st(-this._previousScrollPosition.left),t.style.top=st(-this._previousScrollPosition.top),t.classList.add("cdk-global-scrollblock"),this._isEnabled=!0}}disable(){if(this._isEnabled){let t=this._document.documentElement,i=this._document.body,r=t.style,s=i.style,l=r.scrollBehavior||"",a=s.scrollBehavior||"";this._isEnabled=!1,r.left=this._previousHTMLStyles.left,r.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),Cr&&(r.scrollBehavior=s.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),Cr&&(r.scrollBehavior=l,s.scrollBehavior=a)}}_canBeEnabled(){if(this._document.documentElement.classList.contains("cdk-global-scrollblock")||this._isEnabled)return!1;let i=this._document.documentElement,r=this._viewportRuler.getViewportSize();return i.scrollHeight>r.height||i.scrollWidth>r.width}};var Qe=class{enable(){}disable(){}attach(){}};var Vt=class{positionStrategy;scrollStrategy=new Qe;panelClass="";hasBackdrop=!1;backdropClass="cdk-overlay-dark-backdrop";disableAnimations;width;height;minWidth;minHeight;maxWidth;maxHeight;direction;disposeOnNavigation=!1;constructor(t){if(t){let i=Object.keys(t);for(let r of i)t[r]!==void 0&&(this[r]=t[r])}}};var xr=(()=>{class e{_attachedOverlays=[];_document=S(W);_isAttached;constructor(){}ngOnDestroy(){this.detach()}add(i){this.remove(i),this._attachedOverlays.push(i)}remove(i){let r=this._attachedOverlays.indexOf(i);r>-1&&this._attachedOverlays.splice(r,1),this._attachedOverlays.length===0&&this.detach()}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),so=(()=>{class e extends xr{_ngZone=S(Q);_renderer=S(Et).createRenderer(null,null);_cleanupKeydown;add(i){super.add(i),this._isAttached||(this._ngZone.runOutsideAngular(()=>{this._cleanupKeydown=this._renderer.listen("body","keydown",this._keydownListener)}),this._isAttached=!0)}detach(){this._isAttached&&(this._cleanupKeydown?.(),this._isAttached=!1)}_keydownListener=i=>{let r=this._attachedOverlays;for(let s=r.length-1;s>-1;s--)if(r[s]._keydownEvents.observers.length>0){this._ngZone.run(()=>r[s]._keydownEvents.next(i));break}};static \u0275fac=(()=>{let i;return function(s){return(i||(i=Jt(e)))(s||e)}})();static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ao=(()=>{class e extends xr{_platform=S(it);_ngZone=S(Q);_renderer=S(Et).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(i){if(super.add(i),!this._isAttached){let r=this._document.body,s={capture:!0},l=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[l.listen(r,"pointerdown",this._pointerDownListener,s),l.listen(r,"click",this._clickListener,s),l.listen(r,"auxclick",this._clickListener,s),l.listen(r,"contextmenu",this._clickListener,s)]),this._platform.IOS&&!this._cursorStyleIsSet&&(this._cursorOriginalValue=r.style.cursor,r.style.cursor="pointer",this._cursorStyleIsSet=!0),this._isAttached=!0}}detach(){this._isAttached&&(this._cleanups?.forEach(i=>i()),this._cleanups=void 0,this._platform.IOS&&this._cursorStyleIsSet&&(this._document.body.style.cursor=this._cursorOriginalValue,this._cursorStyleIsSet=!1),this._isAttached=!1)}_pointerDownListener=i=>{this._pointerDownEventTarget=ot(i)};_clickListener=i=>{let r=ot(i),s=i.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:r;this._pointerDownEventTarget=null;let l=this._attachedOverlays.slice();for(let a=l.length-1;a>-1;a--){let f=l[a];if(f._outsidePointerEvents.observers.length<1||!f.hasAttached())continue;if(Ir(f.overlayElement,r)||Ir(f.overlayElement,s))break;let d=f._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>d.next(i)):d.next(i)}};static \u0275fac=(()=>{let i;return function(s){return(i||(i=Jt(e)))(s||e)}})();static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function Ir(e,t){let i=typeof ShadowRoot<"u"&&ShadowRoot,r=t;for(;r;){if(r===e)return!0;r=i&&r instanceof ShadowRoot?r.host:r.parentNode}return!1}var Br=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=lt({type:e,selectors:[["ng-component"]],hostAttrs:["cdk-overlay-style-loader",""],decls:0,vars:0,template:function(r,s){},styles:[`.cdk-overlay-container,.cdk-global-overlay-wrapper{pointer-events:none;top:0;left:0;height:100%;width:100%}.cdk-overlay-container{position:fixed}@layer cdk-overlay{.cdk-overlay-container{z-index:1000}}.cdk-overlay-container:empty{display:none}.cdk-global-overlay-wrapper{display:flex;position:absolute}@layer cdk-overlay{.cdk-global-overlay-wrapper{z-index:1000}}.cdk-overlay-pane{position:absolute;pointer-events:auto;box-sizing:border-box;display:flex;max-width:100%;max-height:100%}@layer cdk-overlay{.cdk-overlay-pane{z-index:1000}}.cdk-overlay-backdrop{position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:auto;-webkit-tap-highlight-color:rgba(0,0,0,0);opacity:0;touch-action:manipulation}@layer cdk-overlay{.cdk-overlay-backdrop{z-index:1000;transition:opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1)}}@media(prefers-reduced-motion){.cdk-overlay-backdrop{transition-duration:1ms}}.cdk-overlay-backdrop-showing{opacity:1}@media(forced-colors: active){.cdk-overlay-backdrop-showing{opacity:.6}}@layer cdk-overlay{.cdk-overlay-dark-backdrop{background:rgba(0,0,0,.32)}}.cdk-overlay-transparent-backdrop{transition:visibility 1ms linear,opacity 1ms linear;visibility:hidden;opacity:1}.cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing,.cdk-high-contrast-active .cdk-overlay-transparent-backdrop{opacity:0;visibility:visible}.cdk-overlay-backdrop-noop-animation{transition:none}.cdk-overlay-connected-position-bounding-box{position:absolute;display:flex;flex-direction:column;min-width:1px;min-height:1px}@layer cdk-overlay{.cdk-overlay-connected-position-bounding-box{z-index:1000}}.cdk-global-scrollblock{position:fixed;width:100%;overflow-y:scroll}
5
+ `],encapsulation:2,changeDetection:0})}return e})(),ii=(()=>{class e{_platform=S(it);_containerElement;_document=S(W);_styleLoader=S(xt);constructor(){}ngOnDestroy(){this._containerElement?.remove()}getContainerElement(){return this._loadStyles(),this._containerElement||this._createContainer(),this._containerElement}_createContainer(){let i="cdk-overlay-container";if(this._platform.isBrowser||Je()){let s=this._document.querySelectorAll(`.${i}[platform="server"], .${i}[platform="test"]`);for(let l=0;l<s.length;l++)s[l].remove()}let r=this._document.createElement("div");r.classList.add(i),Je()?r.setAttribute("platform","test"):this._platform.isBrowser||r.setAttribute("platform","server"),this._document.body.appendChild(r),this._containerElement=r}_loadStyles(){this._styleLoader.load(Br)}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),ti=class{_renderer;_ngZone;element;_cleanupClick;_cleanupTransitionEnd;_fallbackTimeout;constructor(t,i,r,s){this._renderer=i,this._ngZone=r,this.element=t.createElement("div"),this.element.classList.add("cdk-overlay-backdrop"),this._cleanupClick=i.listen(this.element,"click",s)}detach(){this._ngZone.runOutsideAngular(()=>{let t=this.element;clearTimeout(this._fallbackTimeout),this._cleanupTransitionEnd?.(),this._cleanupTransitionEnd=this._renderer.listen(t,"transitionend",this.dispose),this._fallbackTimeout=setTimeout(this.dispose,500),t.style.pointerEvents="none",t.classList.remove("cdk-overlay-backdrop-showing")})}dispose=()=>{clearTimeout(this._fallbackTimeout),this._cleanupClick?.(),this._cleanupTransitionEnd?.(),this._cleanupClick=this._cleanupTransitionEnd=this._fallbackTimeout=void 0,this.element.remove()}},Ht=class{_portalOutlet;_host;_pane;_config;_ngZone;_keyboardDispatcher;_document;_location;_outsideClickDispatcher;_animationsDisabled;_injector;_renderer;_backdropClick=new Y;_attachments=new Y;_detachments=new Y;_positionStrategy;_scrollStrategy;_locationChanges=fi.EMPTY;_backdropRef=null;_detachContentMutationObserver;_detachContentAfterRenderRef;_previousHostParent;_keydownEvents=new Y;_outsidePointerEvents=new Y;_afterNextRenderRef;constructor(t,i,r,s,l,a,f,d,p,g=!1,m,v){this._portalOutlet=t,this._host=i,this._pane=r,this._config=s,this._ngZone=l,this._keyboardDispatcher=a,this._document=f,this._location=d,this._outsideClickDispatcher=p,this._animationsDisabled=g,this._injector=m,this._renderer=v,s.scrollStrategy&&(this._scrollStrategy=s.scrollStrategy,this._scrollStrategy.attach(this)),this._positionStrategy=s.positionStrategy}get overlayElement(){return this._pane}get backdropElement(){return this._backdropRef?.element||null}get hostElement(){return this._host}attach(t){!this._host.parentElement&&this._previousHostParent&&this._previousHostParent.appendChild(this._host);let i=this._portalOutlet.attach(t);return this._positionStrategy&&this._positionStrategy.attach(this),this._updateStackingOrder(),this._updateElementSize(),this._updateElementDirection(),this._scrollStrategy&&this._scrollStrategy.enable(),this._afterNextRenderRef?.destroy(),this._afterNextRenderRef=ft(()=>{this.hasAttached()&&this.updatePosition()},{injector:this._injector}),this._togglePointerEvents(!0),this._config.hasBackdrop&&this._attachBackdrop(),this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!0),this._attachments.next(),this._completeDetachContent(),this._keyboardDispatcher.add(this),this._config.disposeOnNavigation&&(this._locationChanges=this._location.subscribe(()=>this.dispose())),this._outsideClickDispatcher.add(this),typeof i?.onDestroy=="function"&&i.onDestroy(()=>{this.hasAttached()&&this._ngZone.runOutsideAngular(()=>Promise.resolve().then(()=>this.detach()))}),i}detach(){if(!this.hasAttached())return;this.detachBackdrop(),this._togglePointerEvents(!1),this._positionStrategy&&this._positionStrategy.detach&&this._positionStrategy.detach(),this._scrollStrategy&&this._scrollStrategy.disable();let t=this._portalOutlet.detach();return this._detachments.next(),this._completeDetachContent(),this._keyboardDispatcher.remove(this),this._detachContentWhenEmpty(),this._locationChanges.unsubscribe(),this._outsideClickDispatcher.remove(this),t}dispose(){let t=this.hasAttached();this._positionStrategy&&this._positionStrategy.dispose(),this._disposeScrollStrategy(),this._backdropRef?.dispose(),this._locationChanges.unsubscribe(),this._keyboardDispatcher.remove(this),this._portalOutlet.dispose(),this._attachments.complete(),this._backdropClick.complete(),this._keydownEvents.complete(),this._outsidePointerEvents.complete(),this._outsideClickDispatcher.remove(this),this._host?.remove(),this._afterNextRenderRef?.destroy(),this._previousHostParent=this._pane=this._host=this._backdropRef=null,t&&this._detachments.next(),this._detachments.complete(),this._completeDetachContent()}hasAttached(){return this._portalOutlet.hasAttached()}backdropClick(){return this._backdropClick}attachments(){return this._attachments}detachments(){return this._detachments}keydownEvents(){return this._keydownEvents}outsidePointerEvents(){return this._outsidePointerEvents}getConfig(){return this._config}updatePosition(){this._positionStrategy&&this._positionStrategy.apply()}updatePositionStrategy(t){t!==this._positionStrategy&&(this._positionStrategy&&this._positionStrategy.dispose(),this._positionStrategy=t,this.hasAttached()&&(t.attach(this),this.updatePosition()))}updateSize(t){this._config=F(F({},this._config),t),this._updateElementSize()}setDirection(t){this._config=Gt(F({},this._config),{direction:t}),this._updateElementDirection()}addPanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!0)}removePanelClass(t){this._pane&&this._toggleClasses(this._pane,t,!1)}getDirection(){let t=this._config.direction;return t?typeof t=="string"?t:t.value:"ltr"}updateScrollStrategy(t){t!==this._scrollStrategy&&(this._disposeScrollStrategy(),this._scrollStrategy=t,this.hasAttached()&&(t.attach(this),t.enable()))}_updateElementDirection(){this._host.setAttribute("dir",this.getDirection())}_updateElementSize(){if(!this._pane)return;let t=this._pane.style;t.width=st(this._config.width),t.height=st(this._config.height),t.minWidth=st(this._config.minWidth),t.minHeight=st(this._config.minHeight),t.maxWidth=st(this._config.maxWidth),t.maxHeight=st(this._config.maxHeight)}_togglePointerEvents(t){this._pane.style.pointerEvents=t?"":"none"}_attachBackdrop(){let t="cdk-overlay-backdrop-showing";this._backdropRef?.dispose(),this._backdropRef=new ti(this._document,this._renderer,this._ngZone,i=>{this._backdropClick.next(i)}),this._animationsDisabled&&this._backdropRef.element.classList.add("cdk-overlay-backdrop-noop-animation"),this._config.backdropClass&&this._toggleClasses(this._backdropRef.element,this._config.backdropClass,!0),this._host.parentElement.insertBefore(this._backdropRef.element,this._host),!this._animationsDisabled&&typeof requestAnimationFrame<"u"?this._ngZone.runOutsideAngular(()=>{requestAnimationFrame(()=>this._backdropRef?.element.classList.add(t))}):this._backdropRef.element.classList.add(t)}_updateStackingOrder(){this._host.nextSibling&&this._host.parentNode.appendChild(this._host)}detachBackdrop(){this._animationsDisabled?(this._backdropRef?.dispose(),this._backdropRef=null):this._backdropRef?.detach()}_toggleClasses(t,i,r){let s=Ui(i||[]).filter(l=>!!l);s.length&&(r?t.classList.add(...s):t.classList.remove(...s))}_detachContentWhenEmpty(){let t=!1;try{this._detachContentAfterRenderRef=ft(()=>{t=!0,this._detachContent()},{injector:this._injector})}catch(i){if(t)throw i;this._detachContent()}globalThis.MutationObserver&&this._pane&&(this._detachContentMutationObserver||=new globalThis.MutationObserver(()=>{this._detachContent()}),this._detachContentMutationObserver.observe(this._pane,{childList:!0}))}_detachContent(){(!this._pane||!this._host||this._pane.children.length===0)&&(this._pane&&this._config.panelClass&&this._toggleClasses(this._pane,this._config.panelClass,!1),this._host&&this._host.parentElement&&(this._previousHostParent=this._host.parentElement,this._host.remove()),this._completeDetachContent())}_completeDetachContent(){this._detachContentAfterRenderRef?.destroy(),this._detachContentAfterRenderRef=void 0,this._detachContentMutationObserver?.disconnect()}_disposeScrollStrategy(){let t=this._scrollStrategy;t?.disable(),t?.detach?.()}};var Dr="cdk-global-overlay-wrapper";function Lr(e){return new ei}var ei=class{_overlayRef;_cssPosition="static";_topOffset="";_bottomOffset="";_alignItems="";_xPosition="";_xOffset="";_width="";_height="";_isDisposed=!1;attach(t){let i=t.getConfig();this._overlayRef=t,this._width&&!i.width&&t.updateSize({width:this._width}),this._height&&!i.height&&t.updateSize({height:this._height}),t.hostElement.classList.add(Dr),this._isDisposed=!1}top(t=""){return this._bottomOffset="",this._topOffset=t,this._alignItems="flex-start",this}left(t=""){return this._xOffset=t,this._xPosition="left",this}bottom(t=""){return this._topOffset="",this._bottomOffset=t,this._alignItems="flex-end",this}right(t=""){return this._xOffset=t,this._xPosition="right",this}start(t=""){return this._xOffset=t,this._xPosition="start",this}end(t=""){return this._xOffset=t,this._xPosition="end",this}width(t=""){return this._overlayRef?this._overlayRef.updateSize({width:t}):this._width=t,this}height(t=""){return this._overlayRef?this._overlayRef.updateSize({height:t}):this._height=t,this}centerHorizontally(t=""){return this.left(t),this._xPosition="center",this}centerVertically(t=""){return this.top(t),this._alignItems="center",this}apply(){if(!this._overlayRef||!this._overlayRef.hasAttached())return;let t=this._overlayRef.overlayElement.style,i=this._overlayRef.hostElement.style,r=this._overlayRef.getConfig(),{width:s,height:l,maxWidth:a,maxHeight:f}=r,d=(s==="100%"||s==="100vw")&&(!a||a==="100%"||a==="100vw"),p=(l==="100%"||l==="100vh")&&(!f||f==="100%"||f==="100vh"),g=this._xPosition,m=this._xOffset,v=this._overlayRef.getConfig().direction==="rtl",b="",w="",A="";d?A="flex-start":g==="center"?(A="center",v?w=m:b=m):v?g==="left"||g==="end"?(A="flex-end",b=m):(g==="right"||g==="start")&&(A="flex-start",w=m):g==="left"||g==="start"?(A="flex-start",b=m):(g==="right"||g==="end")&&(A="flex-end",w=m),t.position=this._cssPosition,t.marginLeft=d?"0":b,t.marginTop=p?"0":this._topOffset,t.marginBottom=this._bottomOffset,t.marginRight=d?"0":w,i.justifyContent=A,i.alignItems=p?"flex-start":this._alignItems}dispose(){if(this._isDisposed||!this._overlayRef)return;let t=this._overlayRef.overlayElement.style,i=this._overlayRef.hostElement,r=i.style;i.classList.remove(Dr),r.justifyContent=r.alignItems=t.marginTop=t.marginBottom=t.marginLeft=t.marginRight=t.position="",this._overlayRef=null,this._isDisposed=!0}};function Mr(e,t){e.get(xt).load(Br);let i=e.get(ii),r=e.get(W),s=e.get(ne),l=e.get(Si),a=e.get(Bt),f=r.createElement("div"),d=r.createElement("div");d.id=s.getId("cdk-overlay-"),d.classList.add("cdk-overlay-pane"),f.appendChild(d),i.getContainerElement().appendChild(f);let p=new ye(d,l,e),g=new Vt(t),m=e.get(Qt,null,{optional:!0})||e.get(Et).createRenderer(null,null);return g.direction=g.direction||a.value,new Ht(p,f,d,g,e.get(Q),e.get(so),r,e.get(Li),e.get(ao),t?.disableAnimations??e.get(Ei,null,{optional:!0})==="NoopAnimations",e.get(Zt),m)}function co(e,t){}var It=class{viewContainerRef;injector;id;role="dialog";panelClass="";hasBackdrop=!0;backdropClass="";disableClose=!1;closePredicate;width="";height="";minWidth;minHeight;maxWidth;maxHeight;positionStrategy;data=null;direction;ariaDescribedBy=null;ariaLabelledBy=null;ariaLabel=null;ariaModal=!1;autoFocus="first-tabbable";restoreFocus=!0;scrollStrategy;closeOnNavigation=!0;closeOnDestroy=!0;closeOnOverlayDetachments=!0;disableAnimations=!1;providers;container;templateContext};var lo=(()=>{class e extends Ct{_elementRef=S(ut);_focusTrapFactory=S(Tr);_config;_interactivityChecker=S(Ke);_ngZone=S(Q);_focusMonitor=S(br);_renderer=S(Qt);_changeDetectorRef=S(xi);_injector=S(q);_platform=S(it);_document=S(W);_portalOutlet;_focusTrapped=new Y;_focusTrap=null;_elementFocusedBeforeDialogWasOpened=null;_closeInteractionType=null;_ariaLabelledByQueue=[];_isDestroyed=!1;constructor(){super(),this._config=S(It,{optional:!0})||new It,this._config.ariaLabelledBy&&this._ariaLabelledByQueue.push(this._config.ariaLabelledBy)}_addAriaLabelledBy(i){this._ariaLabelledByQueue.push(i),this._changeDetectorRef.markForCheck()}_removeAriaLabelledBy(i){let r=this._ariaLabelledByQueue.indexOf(i);r>-1&&(this._ariaLabelledByQueue.splice(r,1),this._changeDetectorRef.markForCheck())}_contentAttached(){this._initializeFocusTrap(),this._captureInitialFocus()}_captureInitialFocus(){this._trapFocus()}ngOnDestroy(){this._focusTrapped.complete(),this._isDestroyed=!0,this._restoreFocus()}attachComponentPortal(i){this._portalOutlet.hasAttached();let r=this._portalOutlet.attachComponentPortal(i);return this._contentAttached(),r}attachTemplatePortal(i){this._portalOutlet.hasAttached();let r=this._portalOutlet.attachTemplatePortal(i);return this._contentAttached(),r}attachDomPortal=i=>{this._portalOutlet.hasAttached();let r=this._portalOutlet.attachDomPortal(i);return this._contentAttached(),r};_recaptureFocus(){this._containsFocus()||this._trapFocus()}_forceFocus(i,r){this._interactivityChecker.isFocusable(i)||(i.tabIndex=-1,this._ngZone.runOutsideAngular(()=>{let s=()=>{l(),a(),i.removeAttribute("tabindex")},l=this._renderer.listen(i,"blur",s),a=this._renderer.listen(i,"mousedown",s)})),i.focus(r)}_focusByCssSelector(i,r){let s=this._elementRef.nativeElement.querySelector(i);s&&this._forceFocus(s,r)}_trapFocus(i){this._isDestroyed||ft(()=>{let r=this._elementRef.nativeElement;switch(this._config.autoFocus){case!1:case"dialog":this._containsFocus()||r.focus(i);break;case!0:case"first-tabbable":this._focusTrap?.focusInitialElement(i)||this._focusDialogContainer(i);break;case"first-heading":this._focusByCssSelector('h1, h2, h3, h4, h5, h6, [role="heading"]',i);break;default:this._focusByCssSelector(this._config.autoFocus,i);break}this._focusTrapped.next()},{injector:this._injector})}_restoreFocus(){let i=this._config.restoreFocus,r=null;if(typeof i=="string"?r=this._document.querySelector(i):typeof i=="boolean"?r=i?this._elementFocusedBeforeDialogWasOpened:null:i&&(r=i),this._config.restoreFocus&&r&&typeof r.focus=="function"){let s=ie(),l=this._elementRef.nativeElement;(!s||s===this._document.body||s===l||l.contains(s))&&(this._focusMonitor?(this._focusMonitor.focusVia(r,this._closeInteractionType),this._closeInteractionType=null):r.focus())}this._focusTrap&&this._focusTrap.destroy()}_focusDialogContainer(i){this._elementRef.nativeElement.focus?.(i)}_containsFocus(){let i=this._elementRef.nativeElement,r=ie();return i===r||i.contains(r)}_initializeFocusTrap(){this._platform.isBrowser&&(this._focusTrap=this._focusTrapFactory.create(this._elementRef.nativeElement),this._document&&(this._elementFocusedBeforeDialogWasOpened=ie()))}static \u0275fac=function(r){return new(r||e)};static \u0275cmp=lt({type:e,selectors:[["cdk-dialog-container"]],viewQuery:function(r,s){if(r&1&&Ti(ze,7),r&2){let l;Ni(l=Ci())&&(s._portalOutlet=l.first)}},hostAttrs:["tabindex","-1",1,"cdk-dialog-container"],hostVars:6,hostBindings:function(r,s){r&2&&ee("id",s._config.id||null)("role",s._config.role)("aria-modal",s._config.ariaModal)("aria-labelledby",s._config.ariaLabel?null:s._ariaLabelledByQueue[0])("aria-label",s._config.ariaLabel)("aria-describedby",s._config.ariaDescribedBy||null)},features:[te],decls:1,vars:0,consts:[["cdkPortalOutlet",""]],template:function(r,s){r&1&&Oi(0,co,0,0,"ng-template",0)},dependencies:[ze],styles:[`.cdk-dialog-container{display:block;width:100%;height:100%;min-height:inherit;max-height:inherit}
6
+ `],encapsulation:2})}return e})(),$t=class{overlayRef;config;componentInstance;componentRef;containerInstance;disableClose;closed=new Y;backdropClick;keydownEvents;outsidePointerEvents;id;_detachSubscription;constructor(t,i){this.overlayRef=t,this.config=i,this.disableClose=i.disableClose,this.backdropClick=t.backdropClick(),this.keydownEvents=t.keydownEvents(),this.outsidePointerEvents=t.outsidePointerEvents(),this.id=i.id,this.keydownEvents.subscribe(r=>{r.keyCode===27&&!this.disableClose&&!Nr(r)&&(r.preventDefault(),this.close(void 0,{focusOrigin:"keyboard"}))}),this.backdropClick.subscribe(()=>{!this.disableClose&&this._canClose()?this.close(void 0,{focusOrigin:"mouse"}):this.containerInstance._recaptureFocus?.()}),this._detachSubscription=t.detachments().subscribe(()=>{i.closeOnOverlayDetachments!==!1&&this.close()})}close(t,i){if(this._canClose(t)){let r=this.closed;this.containerInstance._closeInteractionType=i?.focusOrigin||"program",this._detachSubscription.unsubscribe(),this.overlayRef.dispose(),r.next(t),r.complete(),this.componentInstance=this.containerInstance=null}}updatePosition(){return this.overlayRef.updatePosition(),this}updateSize(t="",i=""){return this.overlayRef.updateSize({width:t,height:i}),this}addPanelClass(t){return this.overlayRef.addPanelClass(t),this}removePanelClass(t){return this.overlayRef.removePanelClass(t),this}_canClose(t){let i=this.config;return!!this.containerInstance&&(!i.closePredicate||i.closePredicate(t,i,this.componentInstance))}},ho=new G("DialogScrollStrategy",{providedIn:"root",factory:()=>{let e=S(q);return()=>Rr(e)}}),uo=new G("DialogData"),fo=new G("DefaultDialogConfig");function po(e){let t=Kt(e),i=new bt;return{valueSignal:t,get value(){return t()},change:i,ngOnDestroy(){i.complete()}}}var Oa=(()=>{class e{_injector=S(q);_defaultOptions=S(fo,{optional:!0});_parentDialog=S(e,{optional:!0,skipSelf:!0});_overlayContainer=S(ii);_idGenerator=S(ne);_openDialogsAtThisLevel=[];_afterAllClosedAtThisLevel=new Y;_afterOpenedAtThisLevel=new Y;_ariaHiddenElements=new Map;_scrollStrategy=S(ho);get openDialogs(){return this._parentDialog?this._parentDialog.openDialogs:this._openDialogsAtThisLevel}get afterOpened(){return this._parentDialog?this._parentDialog.afterOpened:this._afterOpenedAtThisLevel}afterAllClosed=gi(()=>this.openDialogs.length?this._getAfterAllClosed():this._getAfterAllClosed().pipe(vi(void 0)));constructor(){}open(i,r){let s=this._defaultOptions||new It;r=F(F({},s),r),r.id=r.id||this._idGenerator.getId("cdk-dialog-"),r.id&&this.getDialogById(r.id);let l=this._getOverlayConfig(r),a=Mr(this._injector,l),f=new $t(a,r),d=this._attachContainer(a,f,r);if(f.containerInstance=d,!this.openDialogs.length){let p=this._overlayContainer.getContainerElement();d._focusTrapped?d._focusTrapped.pipe(_i(1)).subscribe(()=>{this._hideNonDialogContentFromAssistiveTechnology(p)}):this._hideNonDialogContentFromAssistiveTechnology(p)}return this._attachDialogContent(i,f,d,r),this.openDialogs.push(f),f.closed.subscribe(()=>this._removeOpenDialog(f,!0)),this.afterOpened.next(f),f}closeAll(){ri(this.openDialogs,i=>i.close())}getDialogById(i){return this.openDialogs.find(r=>r.id===i)}ngOnDestroy(){ri(this._openDialogsAtThisLevel,i=>{i.config.closeOnDestroy===!1&&this._removeOpenDialog(i,!1)}),ri(this._openDialogsAtThisLevel,i=>i.close()),this._afterAllClosedAtThisLevel.complete(),this._afterOpenedAtThisLevel.complete(),this._openDialogsAtThisLevel=[]}_getOverlayConfig(i){let r=new Vt({positionStrategy:i.positionStrategy||Lr().centerHorizontally().centerVertically(),scrollStrategy:i.scrollStrategy||this._scrollStrategy(),panelClass:i.panelClass,hasBackdrop:i.hasBackdrop,direction:i.direction,minWidth:i.minWidth,minHeight:i.minHeight,maxWidth:i.maxWidth,maxHeight:i.maxHeight,width:i.width,height:i.height,disposeOnNavigation:i.closeOnNavigation,disableAnimations:i.disableAnimations});return i.backdropClass&&(r.backdropClass=i.backdropClass),r}_attachContainer(i,r,s){let l=s.injector||s.viewContainerRef?.injector,a=[{provide:It,useValue:s},{provide:$t,useValue:r},{provide:Ht,useValue:i}],f;s.container?typeof s.container=="function"?f=s.container:(f=s.container.type,a.push(...s.container.providers(s))):f=lo;let d=new Tt(f,s.viewContainerRef,q.create({parent:l||this._injector,providers:a}));return i.attach(d).instance}_attachDialogContent(i,r,s,l){if(i instanceof qt){let a=this._createInjector(l,r,s,void 0),f={$implicit:l.data,dialogRef:r};l.templateContext&&(f=F(F({},f),typeof l.templateContext=="function"?l.templateContext():l.templateContext)),s.attachTemplatePortal(new Nt(i,null,f,a))}else{let a=this._createInjector(l,r,s,this._injector),f=s.attachComponentPortal(new Tt(i,l.viewContainerRef,a));r.componentRef=f,r.componentInstance=f.instance}}_createInjector(i,r,s,l){let a=i.injector||i.viewContainerRef?.injector,f=[{provide:uo,useValue:i.data},{provide:$t,useValue:r}];return i.providers&&(typeof i.providers=="function"?f.push(...i.providers(r,i,s)):f.push(...i.providers)),i.direction&&(!a||!a.get(Bt,null,{optional:!0}))&&f.push({provide:Bt,useValue:po(i.direction)}),q.create({parent:a||l,providers:f})}_removeOpenDialog(i,r){let s=this.openDialogs.indexOf(i);s>-1&&(this.openDialogs.splice(s,1),this.openDialogs.length||(this._ariaHiddenElements.forEach((l,a)=>{l?a.setAttribute("aria-hidden",l):a.removeAttribute("aria-hidden")}),this._ariaHiddenElements.clear(),r&&this._getAfterAllClosed().next()))}_hideNonDialogContentFromAssistiveTechnology(i){if(i.parentElement){let r=i.parentElement.children;for(let s=r.length-1;s>-1;s--){let l=r[s];l!==i&&l.nodeName!=="SCRIPT"&&l.nodeName!=="STYLE"&&!l.hasAttribute("aria-live")&&(this._ariaHiddenElements.set(l,l.getAttribute("aria-hidden")),l.setAttribute("aria-hidden","true"))}}}_getAfterAllClosed(){let i=this._parentDialog;return i?i._getAfterAllClosed():this._afterAllClosedAtThisLevel}static \u0275fac=function(r){return new(r||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function ri(e,t){let i=e.length;for(;i--;)t(e[i])}var Ee=class extends Error{request;response;status;requestBody;responseText;constructor(t){super(t),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function kr(e,t){let i=Date.now(),r;try{r=await go(e,t)}catch{}let s=r?new Request(r.url,{method:t?.method||"GET"}):new Request(e,t);if(!r||!r.ok){let p="Failed to fetch";r?.statusText&&(p+=`: ${r.statusText}`);let g=new Ee(p);throw g.request=s,g.response=r?.clone(),g.status=r?.status,g.requestBody=t?.body,g.responseText=await Pr(r),g}let l,a=(r.headers.get("content-type")||"").toLowerCase(),f=r.headers.get("content-length"),d=t?.method?.toUpperCase()||"GET";if(r.status===204||r.status===205||d==="HEAD"||f==="0")l=void 0;else if(a.includes("application/json")||a.includes("application/problem+json")||a.includes("text/javascript"))try{l=await r.clone().json()}catch(p){let g=new Ee(`Failed to parse JSON response: ${p?.message}`);throw g.request=s,g.response=r.clone(),g.status=r.status,g.requestBody=t?.body,g.responseText=await Pr(r),g}else a.includes("text/")||a.includes("image/svg+xml")?l=await r.text():l=await r.arrayBuffer();return{data:l,status:r.status,statusText:r.statusText,headers:r.headers,timeTakenMs:Date.now()-i,options:t,request:s}}async function go(e,t){let i=null,r;for(let s=0;s<=5;s++){try{let l=new Headers(t?.headers);(e.includes("letscooee.com")||e.includes("localhost"))&&l.set("Cooee-Retry-Attempt",s.toString());let a=Gt(F({},t),{headers:l});if(r=await fetch(e,a),r.ok||r.status>=400&&r.status<500)return r;i=new Error(`Server error: ${r.status} ${r.statusText}`)}catch(l){i=l instanceof Error?l:new Error(String(l))}if(s<5){let l=Math.pow(2,s)*500;await new Promise(a=>setTimeout(a,l))}}if(r&&!r.ok)return r;throw i||new Error("Request failed after retries")}async function Pr(e){if(e){try{return e=e.clone(),await e.json()}catch{}try{return await e.text()}catch{}}}var be=class e{static cache=new Map;static loadingPromises=new Map;async getSvg(t){if(e.cache.has(t))return e.cache.get(t);if(e.loadingPromises.has(t))return e.loadingPromises.get(t);let i=this.fetchSvgContent(t);e.loadingPromises.set(t,i);try{let r=await i;return e.cache.set(t,r),r}finally{e.loadingPromises.delete(t)}}getCachedSvg(t){return e.cache.get(t)??null}async preloadIcons(t){let i=t.map(r=>this.getSvg(r).catch(s=>(Lt.error(`Failed to preload icon: ${r}`,s),"")));await Promise.all(i)}clearCache(){e.cache.clear(),e.loadingPromises.clear()}async fetchSvgContent(t){let i=`${ae.baseURL}/svg/${t}.svg`;try{return(await kr(i,{cache:"force-cache",headers:{Accept:"image/svg+xml,text/plain"}})).data}catch(r){return Lt.error(`Unable to get the icon: ${t}`,r),""}}static \u0275fac=function(i){return new(i||e)};static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})};var Fr=class e{name=Ri.required();rawSvg=Kt("");sanitisedSvg=Ii(()=>this.sanitizer.bypassSecurityTrustHtml(this.rawSvg()));sanitizer=S(Mi);iconService=S(be);constructor(){Di(()=>{let t=this.name();this.loadIcon(t)})}async loadIcon(t){try{let i=await this.iconService.getSvg(t);this.rawSvg.set(i)}catch{this.rawSvg.set("")}}static \u0275fac=function(i){return new(i||e)};static \u0275cmp=lt({type:e,selectors:[["cooee-icon"]],hostAttrs:["role","img"],hostVars:2,hostBindings:function(i,r){i&2&&(Ai("innerHTML",r.sanitisedSvg(),bi),ee("aria-label",r.name()))},inputs:{name:[1,"name"]},decls:0,vars:0,template:function(i,r){},encapsulation:2})};var Vr=ui(Ur());var mo=["utm_source","utm_medium","utm_campaign","utm_term","utm_content","utm_id"],jr={utm_source:"tw_source",utm_campaign:"tw_campaign"},yo="cooee_ai";var ja=()=>{let e;try{e=new Vr.URLBuilder(location.href)}catch{return{}}let t={};mo.forEach(r=>{let s=e.getQueryParam(r);s&&(t[r]=s)});let i={};return Object.keys(jr).forEach(r=>{let s=e.getQueryParam(jr[r]);s&&(i[r]=s)}),F(F({},i),t)};function Va(e,t){if(!e)return"";let i=t?t.objective.toLowerCase().toString():"cooee_widget",r=t?t.shortID:"",s=new URL(e,location.origin);return s.searchParams.set("utm_source",yo),s.searchParams.set("utm_medium","onsite_widget"),s.searchParams.set("utm_campaign",i),s.searchParams.set("utm_content",r),s.toString()}var Ha=(e,t)=>{let i=new URL(e);return t.shortID&&i.searchParams.set("ceevid",t.shortID+""),i.toString()},$a=()=>new URLSearchParams(location.search).get("ceevid");export{oe as a,ae as b,Lt as c,No as d,Ro as e,xo as f,vr as g,Ee as h,$t as i,uo as j,Oa as k,Fr as l,yo as m,ja as n,Va as o,Ha as p,$a as q};