@letscooee/web-sdk 13.1.10 → 13.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-LW7ZESZN.js → chunk-6XVC72KV.js} +2 -2
- package/dist/{chunk-VOVXCOBB.js → chunk-CAFWCDWI.js} +1 -1
- package/dist/chunk-HC6OE5XR.js +4 -0
- package/dist/{chunk-Y3BMMUFH.js → chunk-ILIYCRW5.js} +1 -1
- package/dist/{chunk-2AHALCF3.js → chunk-KWG3YKM4.js} +1 -1
- package/dist/chunk-NOZTSVSX.js +8 -0
- package/dist/chunk-RF2WNRIW.js +39 -0
- package/dist/chunk-WQK746ER.js +1 -0
- package/dist/{debugger.component-G4NYQU2M.js → debugger.component-XOR6S75S.js} +1 -1
- package/dist/main.min.js +4 -4
- package/dist/renderer-TBPM7OV3.js +1 -0
- package/dist/sdk-debug-logs-XNSWT65Q.js +1 -0
- package/dist/{share-dialog.component-HDMDNACD.js → share-dialog.component-KYYLRKQ6.js} +1 -1
- package/dist/video-detail-dialog.component-E3IQ3CUB.js +2 -0
- package/dist/widget.min.js +5 -5
- package/package.json +1 -1
- package/dist/chunk-ALW6N5YB.js +0 -1
- package/dist/chunk-DTWV2VE6.js +0 -4
- package/dist/chunk-K3NDUCRB.js +0 -39
- package/dist/chunk-PC4YRNPG.js +0 -8
- package/dist/renderer-X5CF2PGG.js +0 -1
- package/dist/sdk-debug-logs-OECRZKTM.js +0 -1
- package/dist/video-detail-dialog.component-YQZ6AMST.js +0 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{$ as Gt,Aa as _i,B as G,Bb as Ci,C as W,Cb as Ee,E as zt,Fb as Bi,Ga as yi,Gb as Di,H as Zt,Ha as mi,Hb as xi,I as ht,Ia as vi,Ib as Ii,J as ui,Jb as Qt,K as pi,Kb as nt,Lb as et,Nb as te,Ob as It,Pb as Ri,Qb as Rt,R as Jt,Rb as Ti,Sb as Pi,T as wt,Tb as ee,U as Kt,V as we,W as be,X as ct,Z as xt,a as ri,ba as di,c as Y,ca as bt,d as ni,da as q,ea as ft,fa as gi,g as oi,ha as qt,hb as wi,i as si,ib as bi,kb as Ei,l as ai,m as ci,n as li,nb as Oi,o as hi,q as fi,qb as Si,rb as Ai,s as j,u as z,v as E,w as Xt,yb as Ni}from"./chunk-DTWV2VE6.js";import{a as U,b as ii,e as Mr,g as Lr}from"./chunk-U4XWPFUW.js";var Cr=Mr(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.URLBuilder=void 0;var to=(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})();ge.URLBuilder=to});var oo=new z("EngagementContext"),so=new z("EventData");function kr(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Fr=$r,Ur=Yr,jr=zr,rt=[],J=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,Mi=Oe.length;ut<Mi;++ut)rt[ut]=Oe[ut],J[Oe.charCodeAt(ut)]=ut;var ut,Mi;J[45]=62;J[95]=63;function Gi(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 $r(e){var t=Gi(e),i=t[0],r=t[1];return(i+r)*3/4-r}function Vr(e,t,i){return(t+i)*3/4-i}function Yr(e){var t,i=Gi(e),r=i[0],s=i[1],h=new Hr(Vr(e,r,s)),c=0,u=s>0?r-4:r,d;for(d=0;d<u;d+=4)t=J[e.charCodeAt(d)]<<18|J[e.charCodeAt(d+1)]<<12|J[e.charCodeAt(d+2)]<<6|J[e.charCodeAt(d+3)],h[c++]=t>>16&255,h[c++]=t>>8&255,h[c++]=t&255;return s===2&&(t=J[e.charCodeAt(d)]<<2|J[e.charCodeAt(d+1)]>>4,h[c++]=t&255),s===1&&(t=J[e.charCodeAt(d)]<<10|J[e.charCodeAt(d+1)]<<4|J[e.charCodeAt(d+2)]>>2,h[c++]=t>>8&255,h[c++]=t&255),h}function Wr(e){return rt[e>>18&63]+rt[e>>12&63]+rt[e>>6&63]+rt[e&63]}function Xr(e,t,i){for(var r,s=[],h=t;h<i;h+=3)r=(e[h]<<16&16711680)+(e[h+1]<<8&65280)+(e[h+2]&255),s.push(Wr(r));return s.join("")}function zr(e){for(var t,i=e.length,r=i%3,s=[],h=16383,c=0,u=i-r;c<u;c+=h)s.push(Xr(e,c,c+h>u?u:c+h));return r===1?(t=e[i-1],s.push(rt[t>>2]+rt[t<<4&63]+"==")):r===2&&(t=(e[i-2]<<8)+e[i-1],s.push(rt[t>>10]+rt[t>>4&63]+rt[t<<2&63]+"=")),s.join("")}var Se={byteLength:Fr,toByteArray:Ur,fromByteArray:jr};var Zr=function(t,i,r,s,h){var c,u,d=h*8-s-1,m=(1<<d)-1,y=m>>1,_=-7,v=r?h-1:0,S=r?-1:1,O=t[i+v];for(v+=S,c=O&(1<<-_)-1,O>>=-_,_+=d;_>0;c=c*256+t[i+v],v+=S,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=s;_>0;u=u*256+t[i+v],v+=S,_-=8);if(c===0)c=1-y;else{if(c===m)return u?NaN:(O?-1:1)*(1/0);u=u+Math.pow(2,s),c=c-y}return(O?-1:1)*u*Math.pow(2,c-s)},Jr=function(t,i,r,s,h,c){var u,d,m,y=c*8-h-1,_=(1<<y)-1,v=_>>1,S=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,O=s?0:c-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,u=_):(u=Math.floor(Math.log(i)/Math.LN2),i*(m=Math.pow(2,-u))<1&&(u--,m*=2),u+v>=1?i+=S/m:i+=S*Math.pow(2,1-v),i*m>=2&&(u++,m/=2),u+v>=_?(d=0,u=_):u+v>=1?(d=(i*m-1)*Math.pow(2,h),u=u+v):(d=i*Math.pow(2,v-1)*Math.pow(2,h),u=0));h>=8;t[r+O]=d&255,O+=A,d/=256,h-=8);for(u=u<<h|d,y+=h;y>0;t[r+O]=u&255,O+=A,u/=256,y-=8);t[r+O-A]|=k*128},Et={read:Zr,write:Jr},ne=kr(function(e,t){var i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=M,t.INSPECT_MAX_BYTES=50;var r=2147483647;t.kMaxLength=r,c.TYPED_ARRAY_SUPPORT=s(),!c.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 a=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(a,n),a.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function h(a){if(a>r)throw new RangeError('The value "'+a+'" is invalid for option "size"');var n=new Uint8Array(a);return Object.setPrototypeOf(n,c.prototype),n}function c(a,n,o){if(typeof a=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(a)}return u(a,n,o)}c.poolSize=8192;function u(a,n,o){if(typeof a=="string")return _(a,n);if(ArrayBuffer.isView(a))return S(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(tt(a,ArrayBuffer)||a&&tt(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(a,SharedArrayBuffer)||a&&tt(a.buffer,SharedArrayBuffer)))return O(a,n,o);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var l=a.valueOf&&a.valueOf();if(l!=null&&l!==a)return c.from(l,n,o);var f=A(a);if(f)return f;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return c.from(a[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(a))}c.from=function(a,n,o){return u(a,n,o)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function d(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function m(a,n,o){return d(a),a<=0?h(a):n!==void 0?typeof o=="string"?h(a).fill(n,o):h(a).fill(n):h(a)}c.alloc=function(a,n,o){return m(a,n,o)};function y(a){return d(a),h(a<0?0:k(a)|0)}c.allocUnsafe=function(a){return y(a)},c.allocUnsafeSlow=function(a){return y(a)};function _(a,n){if((typeof n!="string"||n==="")&&(n="utf8"),!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=L(a,n)|0,l=h(o),f=l.write(a,n);return f!==o&&(l=l.slice(0,f)),l}function v(a){for(var n=a.length<0?0:k(a.length)|0,o=h(n),l=0;l<n;l+=1)o[l]=a[l]&255;return o}function S(a){if(tt(a,Uint8Array)){var n=new Uint8Array(a);return O(n.buffer,n.byteOffset,n.byteLength)}return v(a)}function O(a,n,o){if(n<0||a.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');var l;return n===void 0&&o===void 0?l=new Uint8Array(a):o===void 0?l=new Uint8Array(a,n):l=new Uint8Array(a,n,o),Object.setPrototypeOf(l,c.prototype),l}function A(a){if(c.isBuffer(a)){var n=k(a.length)|0,o=h(n);return o.length===0||a.copy(o,0,0,n),o}if(a.length!==void 0)return typeof a.length!="number"||ve(a.length)?h(0):v(a);if(a.type==="Buffer"&&Array.isArray(a.data))return v(a.data)}function k(a){if(a>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return a|0}function M(a){return+a!=a&&(a=0),c.alloc(+a)}c.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==c.prototype},c.compare=function(n,o){if(tt(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),tt(o,Uint8Array)&&(o=c.from(o,o.offset,o.byteLength)),!c.isBuffer(n)||!c.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;for(var l=n.length,f=o.length,p=0,g=Math.min(l,f);p<g;++p)if(n[p]!==o[p]){l=n[p],f=o[p];break}return l<f?-1:f<l?1:0},c.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}},c.concat=function(n,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return c.alloc(0);var l;if(o===void 0)for(o=0,l=0;l<n.length;++l)o+=n[l].length;var f=c.allocUnsafe(o),p=0;for(l=0;l<n.length;++l){var g=n[l];if(tt(g,Uint8Array))p+g.length>f.length?c.from(g).copy(f,p):Uint8Array.prototype.set.call(f,g,p);else if(c.isBuffer(g))g.copy(f,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=g.length}return f};function L(a,n){if(c.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||tt(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var o=a.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&o===0)return 0;for(var f=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return me(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return Qe(a).length;default:if(f)return l?-1:me(a).length;n=(""+n).toLowerCase(),f=!0}}c.byteLength=L;function $(a,n,o){var l=!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(a||(a="utf8");;)switch(a){case"hex":return K(this,n,o);case"utf8":case"utf-8":return mt(this,n,o);case"ascii":return vt(this,n,o);case"latin1":case"binary":return R(this,n,o);case"base64":return yt(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,n,o);default:if(l)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),l=!0}}c.prototype._isBuffer=!0;function b(a,n,o){var l=a[n];a[n]=a[o],a[o]=l}c.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)b(this,o,o+1);return this},c.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)b(this,o,o+3),b(this,o+1,o+2);return this},c.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)b(this,o,o+7),b(this,o+1,o+6),b(this,o+2,o+5),b(this,o+3,o+4);return this},c.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?mt(this,0,n):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(n){if(!c.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:c.compare(this,n)===0},c.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&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(n,o,l,f,p){if(tt(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),!c.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),l===void 0&&(l=n?n.length:0),f===void 0&&(f=0),p===void 0&&(p=this.length),o<0||l>n.length||f<0||p>this.length)throw new RangeError("out of range index");if(f>=p&&o>=l)return 0;if(f>=p)return-1;if(o>=l)return 1;if(o>>>=0,l>>>=0,f>>>=0,p>>>=0,this===n)return 0;for(var g=p-f,C=l-o,x=Math.min(g,C),I=this.slice(f,p),F=n.slice(o,l),T=0;T<x;++T)if(I[T]!==F[T]){g=I[T],C=F[T];break}return g<C?-1:C<g?1:0};function X(a,n,o,l,f){if(a.length===0)return-1;if(typeof o=="string"?(l=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,ve(o)&&(o=f?0:a.length-1),o<0&&(o=a.length+o),o>=a.length){if(f)return-1;o=a.length-1}else if(o<0)if(f)o=0;else return-1;if(typeof n=="string"&&(n=c.from(n,l)),c.isBuffer(n))return n.length===0?-1:Q(a,n,o,l,f);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?f?Uint8Array.prototype.indexOf.call(a,n,o):Uint8Array.prototype.lastIndexOf.call(a,n,o):Q(a,[n],o,l,f);throw new TypeError("val must be string, number or Buffer")}function Q(a,n,o,l,f){var p=1,g=a.length,C=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(a.length<2||n.length<2)return-1;p=2,g/=2,C/=2,o/=2}function x(ti,ei){return p===1?ti[ei]:ti.readUInt16BE(ei*p)}var I;if(f){var F=-1;for(I=o;I<g;I++)if(x(a,I)===x(n,F===-1?0:I-F)){if(F===-1&&(F=I),I-F+1===C)return F*p}else F!==-1&&(I-=I-F),F=-1}else for(o+C>g&&(o=g-C),I=o;I>=0;I--){for(var T=!0,Wt=0;Wt<C;Wt++)if(x(a,I+Wt)!==x(n,Wt)){T=!1;break}if(T)return I}return-1}c.prototype.includes=function(n,o,l){return this.indexOf(n,o,l)!==-1},c.prototype.indexOf=function(n,o,l){return X(this,n,o,l,!0)},c.prototype.lastIndexOf=function(n,o,l){return X(this,n,o,l,!1)};function st(a,n,o,l){o=Number(o)||0;var f=a.length-o;l?(l=Number(l),l>f&&(l=f)):l=f;var p=n.length;l>p/2&&(l=p/2);for(var g=0;g<l;++g){var C=parseInt(n.substr(g*2,2),16);if(ve(C))return g;a[o+g]=C}return g}function _e(a,n,o,l){return Yt(me(n,a.length-o),a,o,l)}function Dt(a,n,o,l){return Yt(Rr(n),a,o,l)}function ye(a,n,o,l){return Yt(Qe(n),a,o,l)}function $t(a,n,o,l){return Yt(Tr(n,a.length-o),a,o,l)}c.prototype.write=function(n,o,l,f){if(o===void 0)f="utf8",l=this.length,o=0;else if(l===void 0&&typeof o=="string")f=o,l=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(l)?(l=l>>>0,f===void 0&&(f="utf8")):(f=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-o;if((l===void 0||l>p)&&(l=p),n.length>0&&(l<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(var g=!1;;)switch(f){case"hex":return st(this,n,o,l);case"utf8":case"utf-8":return _e(this,n,o,l);case"ascii":case"latin1":case"binary":return Dt(this,n,o,l);case"base64":return ye(this,n,o,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $t(this,n,o,l);default:if(g)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),g=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yt(a,n,o){return n===0&&o===a.length?Se.fromByteArray(a):Se.fromByteArray(a.slice(n,o))}function mt(a,n,o){o=Math.min(a.length,o);for(var l=[],f=n;f<o;){var p=a[f],g=null,C=p>239?4:p>223?3:p>191?2:1;if(f+C<=o){var x,I,F,T;switch(C){case 1:p<128&&(g=p);break;case 2:x=a[f+1],(x&192)===128&&(T=(p&31)<<6|x&63,T>127&&(g=T));break;case 3:x=a[f+1],I=a[f+2],(x&192)===128&&(I&192)===128&&(T=(p&15)<<12|(x&63)<<6|I&63,T>2047&&(T<55296||T>57343)&&(g=T));break;case 4:x=a[f+1],I=a[f+2],F=a[f+3],(x&192)===128&&(I&192)===128&&(F&192)===128&&(T=(p&15)<<18|(x&63)<<12|(I&63)<<6|F&63,T>65535&&T<1114112&&(g=T))}}g===null?(g=65533,C=1):g>65535&&(g-=65536,l.push(g>>>10&1023|55296),g=56320|g&1023),l.push(g),f+=C}return Vt(l)}var at=4096;function Vt(a){var n=a.length;if(n<=at)return String.fromCharCode.apply(String,a);for(var o="",l=0;l<n;)o+=String.fromCharCode.apply(String,a.slice(l,l+=at));return o}function vt(a,n,o){var l="";o=Math.min(a.length,o);for(var f=n;f<o;++f)l+=String.fromCharCode(a[f]&127);return l}function R(a,n,o){var l="";o=Math.min(a.length,o);for(var f=n;f<o;++f)l+=String.fromCharCode(a[f]);return l}function K(a,n,o){var l=a.length;(!n||n<0)&&(n=0),(!o||o<0||o>l)&&(o=l);for(var f="",p=n;p<o;++p)f+=Pr[a[p]];return f}function B(a,n,o){for(var l=a.slice(n,o),f="",p=0;p<l.length-1;p+=2)f+=String.fromCharCode(l[p]+l[p+1]*256);return f}c.prototype.slice=function(n,o){var l=this.length;n=~~n,o=o===void 0?l:~~o,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),o<0?(o+=l,o<0&&(o=0)):o>l&&(o=l),o<n&&(o=n);var f=this.subarray(n,o);return Object.setPrototypeOf(f,c.prototype),f};function N(a,n,o){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+n>o)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n],p=1,g=0;++g<o&&(p*=256);)f+=this[n+g]*p;return f},c.prototype.readUintBE=c.prototype.readUIntBE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n+--o],p=1;o>0&&(p*=256);)f+=this[n+--o]*p;return f},c.prototype.readUint8=c.prototype.readUInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]|this[n+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]<<8|this[n+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},c.prototype.readIntLE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n],p=1,g=0;++g<o&&(p*=256);)f+=this[n+g]*p;return p*=128,f>=p&&(f-=Math.pow(2,8*o)),f},c.prototype.readIntBE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=o,p=1,g=this[n+--f];f>0&&(p*=256);)g+=this[n+--f]*p;return p*=128,g>=p&&(g-=Math.pow(2,8*o)),g},c.prototype.readInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},c.prototype.readInt16LE=function(n,o){n=n>>>0,o||N(n,2,this.length);var l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(n,o){n=n>>>0,o||N(n,2,this.length);var l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},c.prototype.readInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},c.prototype.readFloatLE=function(n,o){return n=n>>>0,o||N(n,4,this.length),Et.read(this,n,!0,23,4)},c.prototype.readFloatBE=function(n,o){return n=n>>>0,o||N(n,4,this.length),Et.read(this,n,!1,23,4)},c.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||N(n,8,this.length),Et.read(this,n,!0,52,8)},c.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||N(n,8,this.length),Et.read(this,n,!1,52,8)};function V(a,n,o,l,f,p){if(!c.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>f||n<p)throw new RangeError('"value" argument is out of bounds');if(o+l>a.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(n,o,l,f){if(n=+n,o=o>>>0,l=l>>>0,!f){var p=Math.pow(2,8*l)-1;V(this,n,o,l,p,0)}var g=1,C=0;for(this[o]=n&255;++C<l&&(g*=256);)this[o+C]=n/g&255;return o+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(n,o,l,f){if(n=+n,o=o>>>0,l=l>>>0,!f){var p=Math.pow(2,8*l)-1;V(this,n,o,l,p,0)}var g=l-1,C=1;for(this[o+g]=n&255;--g>=0&&(C*=256);)this[o+g]=n/C&255;return o+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,1,255,0),this[o]=n&255,o+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeIntLE=function(n,o,l,f){if(n=+n,o=o>>>0,!f){var p=Math.pow(2,8*l-1);V(this,n,o,l,p-1,-p)}var g=0,C=1,x=0;for(this[o]=n&255;++g<l&&(C*=256);)n<0&&x===0&&this[o+g-1]!==0&&(x=1),this[o+g]=(n/C>>0)-x&255;return o+l},c.prototype.writeIntBE=function(n,o,l,f){if(n=+n,o=o>>>0,!f){var p=Math.pow(2,8*l-1);V(this,n,o,l,p-1,-p)}var g=l-1,C=1,x=0;for(this[o+g]=n&255;--g>=0&&(C*=256);)n<0&&x===0&&this[o+g+1]!==0&&(x=1),this[o+g]=(n/C>>0)-x&255;return o+l},c.prototype.writeInt8=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1},c.prototype.writeInt16LE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2},c.prototype.writeInt16BE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2},c.prototype.writeInt32LE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeInt32BE=function(n,o,l){return n=+n,o=o>>>0,l||V(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 Ke(a,n,o,l,f,p){if(o+l>a.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function Ge(a,n,o,l,f){return n=+n,o=o>>>0,f||Ke(a,n,o,4),Et.write(a,n,o,l,23,4),o+4}c.prototype.writeFloatLE=function(n,o,l){return Ge(this,n,o,!0,l)},c.prototype.writeFloatBE=function(n,o,l){return Ge(this,n,o,!1,l)};function qe(a,n,o,l,f){return n=+n,o=o>>>0,f||Ke(a,n,o,8),Et.write(a,n,o,l,52,8),o+8}c.prototype.writeDoubleLE=function(n,o,l){return qe(this,n,o,!0,l)},c.prototype.writeDoubleBE=function(n,o,l){return qe(this,n,o,!1,l)},c.prototype.copy=function(n,o,l,f){if(!c.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!f&&f!==0&&(f=this.length),o>=n.length&&(o=n.length),o||(o=0),f>0&&f<l&&(f=l),f===l||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),n.length-o<f-l&&(f=n.length-o+l);var p=f-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,l,f):Uint8Array.prototype.set.call(n,this.subarray(l,f),o),p},c.prototype.fill=function(n,o,l,f){if(typeof n=="string"){if(typeof o=="string"?(f=o,o=0,l=this.length):typeof l=="string"&&(f=l,l=this.length),f!==void 0&&typeof f!="string")throw new TypeError("encoding must be a string");if(typeof f=="string"&&!c.isEncoding(f))throw new TypeError("Unknown encoding: "+f);if(n.length===1){var p=n.charCodeAt(0);(f==="utf8"&&p<128||f==="latin1")&&(n=p)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<l)throw new RangeError("Out of range index");if(l<=o)return this;o=o>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);var g;if(typeof n=="number")for(g=o;g<l;++g)this[g]=n;else{var C=c.isBuffer(n)?n:c.from(n,f),x=C.length;if(x===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(g=0;g<l-o;++g)this[g+o]=C[g%x]}return this};var xr=/[^+/0-9A-Za-z-_]/g;function Ir(a){if(a=a.split("=")[0],a=a.trim().replace(xr,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function me(a,n){n=n||1/0;for(var o,l=a.length,f=null,p=[],g=0;g<l;++g){if(o=a.charCodeAt(g),o>55295&&o<57344){if(!f){if(o>56319){(n-=3)>-1&&p.push(239,191,189);continue}else if(g+1===l){(n-=3)>-1&&p.push(239,191,189);continue}f=o;continue}if(o<56320){(n-=3)>-1&&p.push(239,191,189),f=o;continue}o=(f-55296<<10|o-56320)+65536}else f&&(n-=3)>-1&&p.push(239,191,189);if(f=null,o<128){if((n-=1)<0)break;p.push(o)}else if(o<2048){if((n-=2)<0)break;p.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;p.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;p.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return p}function Rr(a){for(var n=[],o=0;o<a.length;++o)n.push(a.charCodeAt(o)&255);return n}function Tr(a,n){for(var o,l,f,p=[],g=0;g<a.length&&!((n-=2)<0);++g)o=a.charCodeAt(g),l=o>>8,f=o%256,p.push(f),p.push(l);return p}function Qe(a){return Se.toByteArray(Ir(a))}function Yt(a,n,o,l){for(var f=0;f<l&&!(f+o>=n.length||f>=a.length);++f)n[f+o]=a[f];return f}function tt(a,n){return a instanceof n||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===n.name}function ve(a){return a!==a}var Pr=(function(){for(var a="0123456789abcdef",n=new Array(256),o=0;o<16;++o)for(var l=o*16,f=0;f<16;++f)n[l+f]=a[o]+a[f];return n})()}),D=ne.Buffer;ne.SlowBuffer;ne.INSPECT_MAX_BYTES;ne.kMaxLength;var De=function(t,i){return De=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var h in s)s.hasOwnProperty(h)&&(r[h]=s[h])},De(t,i)};function oe(e,t){De(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var dt=(function(e){oe(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),P=(function(e){oe(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 ie(e){return e&&e.Math==Math&&e}function qi(){return ie(typeof globalThis=="object"&&globalThis)||ie(typeof window=="object"&&window)||ie(typeof self=="object"&&self)||ie(typeof global=="object"&&global)||Function("return this")()}function Kr(){var e=qi();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var Gr=function(t){var i=Kr()?"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=D.alloc(t),s=0;s<t;++s)r[s]=Math.floor(Math.random()*256);return r},qr=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(D.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(D.alloc(t))}:Gr}},Qi=qr();function Qr(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ie(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function tn(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function en(e){return Lt(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Lt(e){return typeof e=="object"&&e!==null}function se(e,t){var i=!1;function r(){for(var s=[],h=0;h<arguments.length;h++)s[h]=arguments[h];return i||(console.warn(t),i=!0),e.apply(this,s)}return r}function re(e){if(ArrayBuffer.isView(e))return D.from(e.buffer,e.byteOffset,e.byteLength);if(Qr(e))return D.from(e);throw new P("Must use either Buffer or TypedArray")}var rn=/^(?:[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,tr=function(e){return typeof e=="string"&&rn.test(e)},xe=function(e){if(!tr(e))throw new P('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 D.from(t,"hex")},Li=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 co=Math.pow(2,63)-1,lo=-Math.pow(2,63),nn=Math.pow(2,53),on=-Math.pow(2,53);var er=4;var gt=(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 P("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=D.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=D.from(t,"binary"):Array.isArray(t)?this.buffer=D.from(t):this.buffer=re(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new P("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new P("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 P("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=D.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=D.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(re(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 ki(this.buffer.slice(0,this.position));throw new dt('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=D.from(t.$binary,"base64")):typeof t.$binary!="string"&&(s=t.$binary.subType?parseInt(t.$binary.subType,16):0,r=D.from(t.$binary.base64,"base64")):"$uuid"in t&&(s=4,r=xe(t.$uuid)),!r)throw new P("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return s===er?new ki(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(gt.prototype,"_bsontype",{value:"Binary"});var Ae=16,ki=(function(e){oe(t,e);function t(i){var r=this,s,h;if(i==null)s=t.generate();else if(i instanceof t)s=D.from(i.buffer),h=i.__id;else if(ArrayBuffer.isView(i)&&i.byteLength===Ae)s=re(i);else if(typeof i=="string")s=xe(i);else throw new P("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,er)||this,r.__id=h,r}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(i){this.buffer=i,t.cacheHexString&&(this.__id=Li(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=Li(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 gt(this.id,gt.SUBTYPE_UUID)},t.generate=function(){var i=Qi(Ae);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,D.from(i)},t.isValid=function(i){return i?i instanceof t?!0:typeof i=="string"?tr(i):Ie(i)?i.length!==Ae?!1:(i[6]&240)===64&&(i[8]&128)===128:!1:!1},t.createFromHexString=function(i){var r=xe(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})(gt),ae=(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(ae.prototype,"_bsontype",{value:"Code"});function sn(e){return Lt(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 h=t.split(".");h.length===2&&(r=h.shift(),t=h.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 Fi=65536,an=1<<24,St=Fi*Fi,ir=St*St,Ui=ir/2,ji={},Hi={},w=(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,h;return i?(t>>>=0,(h=0<=t&&t<256)&&(s=Hi[t],s)?s:(r=e.fromBits(t,(t|0)<0?-1:0,!0),h&&(Hi[t]=r),r)):(t|=0,(h=-128<=t&&t<128)&&(s=ji[t],s)?s:(r=e.fromBits(t,t<0?-1:0,!1),h&&(ji[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>=ir)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Ui)return e.MIN_VALUE;if(t+1>=Ui)return e.MAX_VALUE}return t<0?e.fromNumber(-t,i).neg():e.fromBits(t%St|0,t/St|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 h=e.fromNumber(Math.pow(r,8)),c=e.ZERO,u=0;u<t.length;u+=8){var d=Math.min(8,t.length-u),m=parseInt(t.substring(u,u+d),r);if(d<8){var y=e.fromNumber(Math.pow(r,d));c=c.mul(y).add(e.fromNumber(m))}else c=c.mul(h),c=c.add(e.fromNumber(m))}return c.unsigned=i,c},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 Lt(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,h=this.low&65535,c=t.high>>>16,u=t.high&65535,d=t.low>>>16,m=t.low&65535,y=0,_=0,v=0,S=0;return S+=h+m,v+=S>>>16,S&=65535,v+=s+d,_+=v>>>16,v&=65535,_+=r+u,y+=_>>>16,_&=65535,y+=i+c,y&=65535,e.fromBits(v<<16|S,y<<16|_,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,h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;h=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 c=this.shr(1);return r=c.div(t).shl(1),r.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(s=this.sub(t.mul(r)),h=r.add(s.div(t)),h)}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();h=e.ZERO}for(s=this;s.gte(t);){r=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(r)/Math.LN2),d=u<=48?1:Math.pow(2,u-48),m=e.fromNumber(r),y=m.mul(t);y.isNegative()||y.gt(s);)r-=d,m=e.fromNumber(r,this.unsigned),y=m.mul(t);m.isZero()&&(m=e.ONE),h=h.add(m),s=s.sub(y)}return h},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,h=this.low>>>16,c=this.low&65535,u=t.high>>>16,d=t.high&65535,m=t.low>>>16,y=t.low&65535,_=0,v=0,S=0,O=0;return O+=c*y,S+=O>>>16,O&=65535,S+=h*y,v+=S>>>16,S&=65535,S+=c*m,v+=S>>>16,S&=65535,v+=s*y,_+=v>>>16,v&=65535,v+=h*m,_+=v>>>16,v&=65535,v+=c*d,_+=v>>>16,v&=65535,_+=r*y+s*m+h*d+c*u,_&=65535,e.fromBits(S<<16|O,_<<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)*St+(this.low>>>0):this.high*St+(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 h=e.fromNumber(Math.pow(t,6),this.unsigned),c=this,u="";;){var d=c.div(h),m=c.sub(d.mul(h)).toInt()>>>0,y=m.toString(t);if(c=d,c.isZero())return y+u;for(;y.length<6;)y="0"+y;u=""+y+u}},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(an),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(w.prototype,"__isLong__",{value:!0});Object.defineProperty(w.prototype,"_bsontype",{value:"Long"});var cn=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,ln=/^(\+|-)?(Infinity|inf)$/i,hn=/^(\+|-)?NaN$/i,Tt=6111,Ne=-6176,$i=6176,fn=34,Ce=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Vi=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Yi=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),un=/^([-+])?(\d+)?$/,pn=31,Wi=16383,dn=30,gn=31;function Xi(e){return!isNaN(parseInt(e,10))}function _n(e){var t=w.fromNumber(1e9),i=w.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 w(e.parts[r],0)),e.parts[r]=i.div(t).low,i=i.modulo(t);return{quotient:e,rem:i}}function yn(e,t){if(!e&&!t)return{high:w.fromNumber(0),low:w.fromNumber(0)};var i=e.shiftRightUnsigned(32),r=new w(e.getLowBits(),0),s=t.shiftRightUnsigned(32),h=new w(t.getLowBits(),0),c=i.multiply(s),u=i.multiply(h),d=r.multiply(s),m=r.multiply(h);return c=c.add(u.shiftRightUnsigned(32)),u=new w(u.getLowBits(),0).add(d).add(m.shiftRightUnsigned(32)),c=c.add(u.shiftRightUnsigned(32)),m=u.shiftLeft(32).add(new w(m.getLowBits(),0)),{high:c,low:m}}function mn(e,t){var i=e.high>>>0,r=t.high>>>0;if(i<r)return!0;if(i===r){var s=e.low>>>0,h=t.low>>>0;if(s<h)return!0}return!1}function Ot(e,t){throw new P('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Re=(function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ie(t)){if(t.byteLength!==16)throw new P("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new P("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var i=!1,r=!1,s=!1,h=0,c=0,u=0,d=0,m=0,y=[0],_=0,v=0,S=0,O=0,A=0,k=0,M=new w(0,0),L=new w(0,0),$=0,b=0;if(t.length>=7e3)throw new P(""+t+" not a valid Decimal128 string");var X=t.match(cn),Q=t.match(ln),st=t.match(hn);if(!X&&!Q&&!st||t.length===0)throw new P(""+t+" not a valid Decimal128 string");if(X){var _e=X[2],Dt=X[4],ye=X[5],$t=X[6];Dt&&$t===void 0&&Ot(t,"missing exponent power"),Dt&&_e===void 0&&Ot(t,"missing exponent base"),Dt===void 0&&(ye||$t)&&Ot(t,"missing e before exponent")}if((t[b]==="+"||t[b]==="-")&&(i=t[b++]==="-"),!Xi(t[b])&&t[b]!=="."){if(t[b]==="i"||t[b]==="I")return new e(D.from(i?Vi:Yi));if(t[b]==="N")return new e(D.from(Ce))}for(;Xi(t[b])||t[b]===".";){if(t[b]==="."){r&&Ot(t,"contains multiple periods"),r=!0,b=b+1;continue}_<34&&(t[b]!=="0"||s)&&(s||(m=c),s=!0,y[v++]=parseInt(t[b],10),_=_+1),s&&(u=u+1),r&&(d=d+1),c=c+1,b=b+1}if(r&&!c)throw new P(""+t+" not a valid Decimal128 string");if(t[b]==="e"||t[b]==="E"){var yt=t.substr(++b).match(un);if(!yt||!yt[2])return new e(D.from(Ce));A=parseInt(yt[0],10),b=b+yt[0].length}if(t[b])return new e(D.from(Ce));if(S=0,!_)S=0,O=0,y[0]=0,u=1,_=1,h=0;else if(O=_-1,h=u,h!==1)for(;y[m+h-1]===0;)h=h-1;for(A<=d&&d-A>16384?A=Ne:A=A-d;A>Tt;){if(O=O+1,O-S>fn){var mt=y.join("");if(mt.match(/^0+$/)){A=Tt;break}Ot(t,"overflow")}A=A-1}for(;A<Ne||_<u;){if(O===0&&h<_){A=Ne,h=0;break}if(_<u?u=u-1:O=O-1,A<Tt)A=A+1;else{var mt=y.join("");if(mt.match(/^0+$/)){A=Tt;break}Ot(t,"overflow")}}if(O-S+1<h){var at=c;r&&(m=m+1,at=at+1),i&&(m=m+1,at=at+1);var Vt=parseInt(t[m+O+1],10),vt=0;if(Vt>=5&&(vt=1,Vt===5)){for(vt=y[O]%2===1?1:0,k=m+O+2;k<at;k++)if(parseInt(t[k],10)){vt=1;break}}if(vt){for(var R=O;R>=0;R--)if(++y[R]>9&&(y[R]=0,R===0))if(A<Tt)A=A+1,y[R]=1;else return new e(D.from(i?Vi:Yi))}}if(M=w.fromNumber(0),L=w.fromNumber(0),h===0)M=w.fromNumber(0),L=w.fromNumber(0);else if(O-S<17){var R=S;for(L=w.fromNumber(y[R++]),M=new w(0,0);R<=O;R++)L=L.multiply(w.fromNumber(10)),L=L.add(w.fromNumber(y[R]))}else{var R=S;for(M=w.fromNumber(y[R++]);R<=O-17;R++)M=M.multiply(w.fromNumber(10)),M=M.add(w.fromNumber(y[R]));for(L=w.fromNumber(y[R++]);R<=O;R++)L=L.multiply(w.fromNumber(10)),L=L.add(w.fromNumber(y[R]))}var K=yn(M,w.fromString("100000000000000000"));K.low=K.low.add(L),mn(K.low,L)&&(K.high=K.high.add(w.fromNumber(1))),$=A+$i;var B={low:w.fromNumber(0),high:w.fromNumber(0)};K.high.shiftRightUnsigned(49).and(w.fromNumber(1)).equals(w.fromNumber(1))?(B.high=B.high.or(w.fromNumber(3).shiftLeft(61)),B.high=B.high.or(w.fromNumber($).and(w.fromNumber(16383).shiftLeft(47))),B.high=B.high.or(K.high.and(w.fromNumber(0x7fffffffffff)))):(B.high=B.high.or(w.fromNumber($&16383).shiftLeft(49)),B.high=B.high.or(K.high.and(w.fromNumber(562949953421311)))),B.low=K.low,i&&(B.high=B.high.or(w.fromString("9223372036854775808")));var N=D.alloc(16);return b=0,N[b++]=B.low.low&255,N[b++]=B.low.low>>8&255,N[b++]=B.low.low>>16&255,N[b++]=B.low.low>>24&255,N[b++]=B.low.high&255,N[b++]=B.low.high>>8&255,N[b++]=B.low.high>>16&255,N[b++]=B.low.high>>24&255,N[b++]=B.high.low&255,N[b++]=B.high.low>>8&255,N[b++]=B.high.low>>16&255,N[b++]=B.high.low>>24&255,N[b++]=B.high.high&255,N[b++]=B.high.high>>8&255,N[b++]=B.high.high>>16&255,N[b++]=B.high.high>>24&255,new e(N)},e.prototype.toString=function(){for(var t,i=0,r=new Array(36),s=0;s<r.length;s++)r[s]=0;var h=0,c=!1,u,d={parts:[0,0,0,0]},m,y,_=[];h=0;var v=this.bytes,S=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,O=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,A=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,k=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24;h=0;var M={low:new w(S,O),high:new w(A,k)};M.high.lessThan(w.ZERO)&&_.push("-");var L=k>>26&pn;if(L>>3===3){if(L===dn)return _.join("")+"Infinity";if(L===gn)return"NaN";t=k>>15&Wi,u=8+(k>>14&1)}else u=k>>14&7,t=k>>17&Wi;var $=t-$i;if(d.parts[0]=(k&16383)+((u&15)<<14),d.parts[1]=A,d.parts[2]=O,d.parts[3]=S,d.parts[0]===0&&d.parts[1]===0&&d.parts[2]===0&&d.parts[3]===0)c=!0;else for(y=3;y>=0;y--){var b=0,X=_n(d);if(d=X.quotient,b=X.rem.low,!!b)for(m=8;m>=0;m--)r[y*9+m]=b%10,b=Math.floor(b/10)}if(c)i=1,r[h]=0;else for(i=36;!r[h];)i=i-1,h=h+1;var Q=i-1+$;if(Q>=34||Q<=-7||$>0){if(i>34)return _.push("".concat(0)),$>0?_.push("E+".concat($)):$<0&&_.push("E".concat($)),_.join("");_.push("".concat(r[h++])),i=i-1,i&&_.push(".");for(var s=0;s<i;s++)_.push("".concat(r[h++]));_.push("E"),Q>0?_.push("+".concat(Q)):_.push("".concat(Q))}else if($>=0)for(var s=0;s<i;s++)_.push("".concat(r[h++]));else{var st=i+$;if(st>0)for(var s=0;s<st;s++)_.push("".concat(r[h++]));else _.push("0");for(_.push(".");st++<0;)_.push("0");for(var s=0;s<i-Math.max(st-1,0);s++)_.push("".concat(r[h++]))}return _.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(Re.prototype,"_bsontype",{value:"Decimal128"});var ce=(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(ce.prototype,"_bsontype",{value:"Double"});var le=(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(le.prototype,"_bsontype",{value:"Int32"});var Te=(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(Te.prototype,"_bsontype",{value:"MaxKey"});var Pe=(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(Pe.prototype,"_bsontype",{value:"MinKey"});var vn=new RegExp("^[0-9a-fA-F]{24}$"),pt=null,it=Symbol("id"),H=(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 P("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?i=D.from(t.toHexString(),"hex"):i=t.id}else i=t;if(i==null||typeof i=="number")this[it]=e.generate(typeof i=="number"?i:void 0);else if(ArrayBuffer.isView(i)&&i.byteLength===12)this[it]=i instanceof D?i:re(i);else if(typeof i=="string")if(i.length===12){var r=D.from(i);if(r.byteLength===12)this[it]=r;else throw new P("Argument passed in must be a string of 12 bytes")}else if(i.length===24&&vn.test(i))this[it]=D.from(i,"hex");else throw new P("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new P("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[it]},set:function(t){this[it]=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=D.alloc(12);return r.writeUInt32BE(t,0),pt===null&&(pt=Qi(5)),r[4]=pt[0],r[5]=pt[1],r[6]=pt[2],r[7]=pt[3],r[8]=pt[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[it][11]===t[it][11]&&this[it].equals(t[it]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&Ie(this.id))return t===D.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 D.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=D.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 P("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(D.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(H.prototype,"generate",{value:se(function(e){return H.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(H.prototype,"getInc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H.prototype,"get_inc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H,"get_inc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H.prototype,"_bsontype",{value:"ObjectID"});function wn(e){return e.split("").sort().join("")}var Mt=(function(){function e(t,i){if(!(this instanceof e))return new e(t,i);if(this.pattern=t,this.options=wn(i??""),this.pattern.indexOf("\0")!==-1)throw new dt("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new dt("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 dt("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 P("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e})();Object.defineProperty(Mt.prototype,"_bsontype",{value:"BSONRegExp"});var Me=(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(Me.prototype,"_bsontype",{value:"Symbol"});var bn=w,rr=(function(e){oe(t,e);function t(i,r){var s=this;return s instanceof t?(w.isLong(i)?s=e.call(this,i.low,i.high,!0)||this:Lt(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(w.fromInt(i,!0))},t.fromNumber=function(i){return new t(w.fromNumber(i,!0))},t.fromBits=function(i,r){return new t(i,r)},t.fromString=function(i,r){return new t(w.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=w.MAX_UNSIGNED_VALUE,t})(bn);function En(e){return Lt(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var nr=2147483647,or=-2147483648,sr=9223372036854776e3,ar=-9223372036854776e3,On={$oid:H,$binary:gt,$uuid:gt,$symbol:Me,$numberInt:le,$numberDecimal:Re,$numberDouble:ce,$numberLong:w,$minKey:Pe,$maxKey:Te,$regex:Mt,$regularExpression:Mt,$timestamp:rr};function cr(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=or&&e<=nr)return new le(e);if(e>=ar&&e<=sr)return w.fromNumber(e)}return new ce(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var i=Object.keys(e).filter(function(_){return _.startsWith("$")&&e[_]!=null}),r=0;r<i.length;r++){var s=On[i[r]];if(s)return s.fromExtendedJSON(e,t)}if(e.$date!=null){var h=e.$date,c=new Date;return t.legacy?typeof h=="number"?c.setTime(h):typeof h=="string"&&c.setTime(Date.parse(h)):typeof h=="string"?c.setTime(Date.parse(h)):w.isLong(h)?c.setTime(h.toNumber()):typeof h=="number"&&t.relaxed&&c.setTime(h),c}if(e.$code!=null){var u=Object.assign({},e);return e.$scope&&(u.$scope=cr(e.$scope)),ae.fromExtendedJSON(e)}if(sn(e)||e.$dbPointer){var d=e.$ref?e:e.$dbPointer;if(d instanceof Pt)return d;var m=Object.keys(d).filter(function(_){return _.startsWith("$")}),y=!0;if(m.forEach(function(_){["$ref","$id","$db"].indexOf(_)===-1&&(y=!1)}),y)return Pt.fromExtendedJSON(d)}return e}function Sn(e,t){return e.map(function(i,r){t.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return lt(i,t)}finally{t.seenObjects.pop()}})}function zi(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function lt(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(""),h=r[i],c=" -> "+r.slice(i+1,r.length-1).map(function(M){return"".concat(M," -> ")}).join(""),u=r[r.length-1],d=" ".repeat(s.length+h.length/2),m="-".repeat(c.length+(h.length+u.length)/2-1);throw new P(`Converting circular structure to EJSON:
|
|
1
|
+
import{$ as Gt,Aa as _i,Ab as Ci,B as G,C as W,Db as Bi,E as zt,Ga as yi,H as Zt,Ha as mi,I as ht,Ia as vi,Ib as Ee,J as ui,K as pi,Kb as Di,Lb as xi,Mb as Ii,Nb as Qt,Ob as nt,Pb as et,R as Jt,Rb as te,Sb as It,T as wt,Tb as Ri,U as Kt,Ub as Rt,V as we,Vb as Ti,W as be,Wb as Pi,X as ct,Xb as ee,Z as xt,a as ri,ba as di,c as Y,ca as bt,d as ni,da as q,ea as ft,fa as gi,g as oi,ha as qt,hb as wi,i as si,ib as bi,kb as Ei,l as ai,m as ci,n as li,nb as Oi,o as hi,q as fi,qb as Si,rb as Ai,s as j,u as z,v as E,w as Xt,yb as Ni}from"./chunk-HC6OE5XR.js";import{a as U,b as ii,e as Mr,g as Lr}from"./chunk-U4XWPFUW.js";var Cr=Mr(ge=>{"use strict";Object.defineProperty(ge,"__esModule",{value:!0});ge.URLBuilder=void 0;var to=(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})();ge.URLBuilder=to});var oo=new z("EngagementContext"),so=new z("EventData");function kr(e,t){return t={exports:{}},e(t,t.exports),t.exports}var Fr=$r,Ur=Yr,jr=zr,rt=[],J=[],Hr=typeof Uint8Array<"u"?Uint8Array:Array,Oe="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,Mi=Oe.length;ut<Mi;++ut)rt[ut]=Oe[ut],J[Oe.charCodeAt(ut)]=ut;var ut,Mi;J[45]=62;J[95]=63;function Gi(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 $r(e){var t=Gi(e),i=t[0],r=t[1];return(i+r)*3/4-r}function Vr(e,t,i){return(t+i)*3/4-i}function Yr(e){var t,i=Gi(e),r=i[0],s=i[1],h=new Hr(Vr(e,r,s)),c=0,u=s>0?r-4:r,d;for(d=0;d<u;d+=4)t=J[e.charCodeAt(d)]<<18|J[e.charCodeAt(d+1)]<<12|J[e.charCodeAt(d+2)]<<6|J[e.charCodeAt(d+3)],h[c++]=t>>16&255,h[c++]=t>>8&255,h[c++]=t&255;return s===2&&(t=J[e.charCodeAt(d)]<<2|J[e.charCodeAt(d+1)]>>4,h[c++]=t&255),s===1&&(t=J[e.charCodeAt(d)]<<10|J[e.charCodeAt(d+1)]<<4|J[e.charCodeAt(d+2)]>>2,h[c++]=t>>8&255,h[c++]=t&255),h}function Wr(e){return rt[e>>18&63]+rt[e>>12&63]+rt[e>>6&63]+rt[e&63]}function Xr(e,t,i){for(var r,s=[],h=t;h<i;h+=3)r=(e[h]<<16&16711680)+(e[h+1]<<8&65280)+(e[h+2]&255),s.push(Wr(r));return s.join("")}function zr(e){for(var t,i=e.length,r=i%3,s=[],h=16383,c=0,u=i-r;c<u;c+=h)s.push(Xr(e,c,c+h>u?u:c+h));return r===1?(t=e[i-1],s.push(rt[t>>2]+rt[t<<4&63]+"==")):r===2&&(t=(e[i-2]<<8)+e[i-1],s.push(rt[t>>10]+rt[t>>4&63]+rt[t<<2&63]+"=")),s.join("")}var Se={byteLength:Fr,toByteArray:Ur,fromByteArray:jr};var Zr=function(t,i,r,s,h){var c,u,d=h*8-s-1,m=(1<<d)-1,y=m>>1,_=-7,v=r?h-1:0,S=r?-1:1,O=t[i+v];for(v+=S,c=O&(1<<-_)-1,O>>=-_,_+=d;_>0;c=c*256+t[i+v],v+=S,_-=8);for(u=c&(1<<-_)-1,c>>=-_,_+=s;_>0;u=u*256+t[i+v],v+=S,_-=8);if(c===0)c=1-y;else{if(c===m)return u?NaN:(O?-1:1)*(1/0);u=u+Math.pow(2,s),c=c-y}return(O?-1:1)*u*Math.pow(2,c-s)},Jr=function(t,i,r,s,h,c){var u,d,m,y=c*8-h-1,_=(1<<y)-1,v=_>>1,S=h===23?Math.pow(2,-24)-Math.pow(2,-77):0,O=s?0:c-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,u=_):(u=Math.floor(Math.log(i)/Math.LN2),i*(m=Math.pow(2,-u))<1&&(u--,m*=2),u+v>=1?i+=S/m:i+=S*Math.pow(2,1-v),i*m>=2&&(u++,m/=2),u+v>=_?(d=0,u=_):u+v>=1?(d=(i*m-1)*Math.pow(2,h),u=u+v):(d=i*Math.pow(2,v-1)*Math.pow(2,h),u=0));h>=8;t[r+O]=d&255,O+=A,d/=256,h-=8);for(u=u<<h|d,y+=h;y>0;t[r+O]=u&255,O+=A,u/=256,y-=8);t[r+O-A]|=k*128},Et={read:Zr,write:Jr},ne=kr(function(e,t){var i=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=c,t.SlowBuffer=M,t.INSPECT_MAX_BYTES=50;var r=2147483647;t.kMaxLength=r,c.TYPED_ARRAY_SUPPORT=s(),!c.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 a=new Uint8Array(1),n={foo:function(){return 42}};return Object.setPrototypeOf(n,Uint8Array.prototype),Object.setPrototypeOf(a,n),a.foo()===42}catch{return!1}}Object.defineProperty(c.prototype,"parent",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.buffer}}),Object.defineProperty(c.prototype,"offset",{enumerable:!0,get:function(){if(c.isBuffer(this))return this.byteOffset}});function h(a){if(a>r)throw new RangeError('The value "'+a+'" is invalid for option "size"');var n=new Uint8Array(a);return Object.setPrototypeOf(n,c.prototype),n}function c(a,n,o){if(typeof a=="number"){if(typeof n=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return y(a)}return u(a,n,o)}c.poolSize=8192;function u(a,n,o){if(typeof a=="string")return _(a,n);if(ArrayBuffer.isView(a))return S(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(tt(a,ArrayBuffer)||a&&tt(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(tt(a,SharedArrayBuffer)||a&&tt(a.buffer,SharedArrayBuffer)))return O(a,n,o);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var l=a.valueOf&&a.valueOf();if(l!=null&&l!==a)return c.from(l,n,o);var f=A(a);if(f)return f;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return c.from(a[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(a))}c.from=function(a,n,o){return u(a,n,o)},Object.setPrototypeOf(c.prototype,Uint8Array.prototype),Object.setPrototypeOf(c,Uint8Array);function d(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function m(a,n,o){return d(a),a<=0?h(a):n!==void 0?typeof o=="string"?h(a).fill(n,o):h(a).fill(n):h(a)}c.alloc=function(a,n,o){return m(a,n,o)};function y(a){return d(a),h(a<0?0:k(a)|0)}c.allocUnsafe=function(a){return y(a)},c.allocUnsafeSlow=function(a){return y(a)};function _(a,n){if((typeof n!="string"||n==="")&&(n="utf8"),!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o=L(a,n)|0,l=h(o),f=l.write(a,n);return f!==o&&(l=l.slice(0,f)),l}function v(a){for(var n=a.length<0?0:k(a.length)|0,o=h(n),l=0;l<n;l+=1)o[l]=a[l]&255;return o}function S(a){if(tt(a,Uint8Array)){var n=new Uint8Array(a);return O(n.buffer,n.byteOffset,n.byteLength)}return v(a)}function O(a,n,o){if(n<0||a.byteLength<n)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<n+(o||0))throw new RangeError('"length" is outside of buffer bounds');var l;return n===void 0&&o===void 0?l=new Uint8Array(a):o===void 0?l=new Uint8Array(a,n):l=new Uint8Array(a,n,o),Object.setPrototypeOf(l,c.prototype),l}function A(a){if(c.isBuffer(a)){var n=k(a.length)|0,o=h(n);return o.length===0||a.copy(o,0,0,n),o}if(a.length!==void 0)return typeof a.length!="number"||ve(a.length)?h(0):v(a);if(a.type==="Buffer"&&Array.isArray(a.data))return v(a.data)}function k(a){if(a>=r)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+r.toString(16)+" bytes");return a|0}function M(a){return+a!=a&&(a=0),c.alloc(+a)}c.isBuffer=function(n){return n!=null&&n._isBuffer===!0&&n!==c.prototype},c.compare=function(n,o){if(tt(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),tt(o,Uint8Array)&&(o=c.from(o,o.offset,o.byteLength)),!c.isBuffer(n)||!c.isBuffer(o))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(n===o)return 0;for(var l=n.length,f=o.length,p=0,g=Math.min(l,f);p<g;++p)if(n[p]!==o[p]){l=n[p],f=o[p];break}return l<f?-1:f<l?1:0},c.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}},c.concat=function(n,o){if(!Array.isArray(n))throw new TypeError('"list" argument must be an Array of Buffers');if(n.length===0)return c.alloc(0);var l;if(o===void 0)for(o=0,l=0;l<n.length;++l)o+=n[l].length;var f=c.allocUnsafe(o),p=0;for(l=0;l<n.length;++l){var g=n[l];if(tt(g,Uint8Array))p+g.length>f.length?c.from(g).copy(f,p):Uint8Array.prototype.set.call(f,g,p);else if(c.isBuffer(g))g.copy(f,p);else throw new TypeError('"list" argument must be an Array of Buffers');p+=g.length}return f};function L(a,n){if(c.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||tt(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var o=a.length,l=arguments.length>2&&arguments[2]===!0;if(!l&&o===0)return 0;for(var f=!1;;)switch(n){case"ascii":case"latin1":case"binary":return o;case"utf8":case"utf-8":return me(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return o*2;case"hex":return o>>>1;case"base64":return Qe(a).length;default:if(f)return l?-1:me(a).length;n=(""+n).toLowerCase(),f=!0}}c.byteLength=L;function $(a,n,o){var l=!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(a||(a="utf8");;)switch(a){case"hex":return K(this,n,o);case"utf8":case"utf-8":return mt(this,n,o);case"ascii":return vt(this,n,o);case"latin1":case"binary":return R(this,n,o);case"base64":return yt(this,n,o);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,n,o);default:if(l)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),l=!0}}c.prototype._isBuffer=!0;function b(a,n,o){var l=a[n];a[n]=a[o],a[o]=l}c.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)b(this,o,o+1);return this},c.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)b(this,o,o+3),b(this,o+1,o+2);return this},c.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)b(this,o,o+7),b(this,o+1,o+6),b(this,o+2,o+5),b(this,o+3,o+4);return this},c.prototype.toString=function(){var n=this.length;return n===0?"":arguments.length===0?mt(this,0,n):$.apply(this,arguments)},c.prototype.toLocaleString=c.prototype.toString,c.prototype.equals=function(n){if(!c.isBuffer(n))throw new TypeError("Argument must be a Buffer");return this===n?!0:c.compare(this,n)===0},c.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&&(c.prototype[i]=c.prototype.inspect),c.prototype.compare=function(n,o,l,f,p){if(tt(n,Uint8Array)&&(n=c.from(n,n.offset,n.byteLength)),!c.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),l===void 0&&(l=n?n.length:0),f===void 0&&(f=0),p===void 0&&(p=this.length),o<0||l>n.length||f<0||p>this.length)throw new RangeError("out of range index");if(f>=p&&o>=l)return 0;if(f>=p)return-1;if(o>=l)return 1;if(o>>>=0,l>>>=0,f>>>=0,p>>>=0,this===n)return 0;for(var g=p-f,C=l-o,x=Math.min(g,C),I=this.slice(f,p),F=n.slice(o,l),T=0;T<x;++T)if(I[T]!==F[T]){g=I[T],C=F[T];break}return g<C?-1:C<g?1:0};function X(a,n,o,l,f){if(a.length===0)return-1;if(typeof o=="string"?(l=o,o=0):o>2147483647?o=2147483647:o<-2147483648&&(o=-2147483648),o=+o,ve(o)&&(o=f?0:a.length-1),o<0&&(o=a.length+o),o>=a.length){if(f)return-1;o=a.length-1}else if(o<0)if(f)o=0;else return-1;if(typeof n=="string"&&(n=c.from(n,l)),c.isBuffer(n))return n.length===0?-1:Q(a,n,o,l,f);if(typeof n=="number")return n=n&255,typeof Uint8Array.prototype.indexOf=="function"?f?Uint8Array.prototype.indexOf.call(a,n,o):Uint8Array.prototype.lastIndexOf.call(a,n,o):Q(a,[n],o,l,f);throw new TypeError("val must be string, number or Buffer")}function Q(a,n,o,l,f){var p=1,g=a.length,C=n.length;if(l!==void 0&&(l=String(l).toLowerCase(),l==="ucs2"||l==="ucs-2"||l==="utf16le"||l==="utf-16le")){if(a.length<2||n.length<2)return-1;p=2,g/=2,C/=2,o/=2}function x(ti,ei){return p===1?ti[ei]:ti.readUInt16BE(ei*p)}var I;if(f){var F=-1;for(I=o;I<g;I++)if(x(a,I)===x(n,F===-1?0:I-F)){if(F===-1&&(F=I),I-F+1===C)return F*p}else F!==-1&&(I-=I-F),F=-1}else for(o+C>g&&(o=g-C),I=o;I>=0;I--){for(var T=!0,Wt=0;Wt<C;Wt++)if(x(a,I+Wt)!==x(n,Wt)){T=!1;break}if(T)return I}return-1}c.prototype.includes=function(n,o,l){return this.indexOf(n,o,l)!==-1},c.prototype.indexOf=function(n,o,l){return X(this,n,o,l,!0)},c.prototype.lastIndexOf=function(n,o,l){return X(this,n,o,l,!1)};function st(a,n,o,l){o=Number(o)||0;var f=a.length-o;l?(l=Number(l),l>f&&(l=f)):l=f;var p=n.length;l>p/2&&(l=p/2);for(var g=0;g<l;++g){var C=parseInt(n.substr(g*2,2),16);if(ve(C))return g;a[o+g]=C}return g}function _e(a,n,o,l){return Yt(me(n,a.length-o),a,o,l)}function Dt(a,n,o,l){return Yt(Rr(n),a,o,l)}function ye(a,n,o,l){return Yt(Qe(n),a,o,l)}function $t(a,n,o,l){return Yt(Tr(n,a.length-o),a,o,l)}c.prototype.write=function(n,o,l,f){if(o===void 0)f="utf8",l=this.length,o=0;else if(l===void 0&&typeof o=="string")f=o,l=this.length,o=0;else if(isFinite(o))o=o>>>0,isFinite(l)?(l=l>>>0,f===void 0&&(f="utf8")):(f=l,l=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var p=this.length-o;if((l===void 0||l>p)&&(l=p),n.length>0&&(l<0||o<0)||o>this.length)throw new RangeError("Attempt to write outside buffer bounds");f||(f="utf8");for(var g=!1;;)switch(f){case"hex":return st(this,n,o,l);case"utf8":case"utf-8":return _e(this,n,o,l);case"ascii":case"latin1":case"binary":return Dt(this,n,o,l);case"base64":return ye(this,n,o,l);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $t(this,n,o,l);default:if(g)throw new TypeError("Unknown encoding: "+f);f=(""+f).toLowerCase(),g=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function yt(a,n,o){return n===0&&o===a.length?Se.fromByteArray(a):Se.fromByteArray(a.slice(n,o))}function mt(a,n,o){o=Math.min(a.length,o);for(var l=[],f=n;f<o;){var p=a[f],g=null,C=p>239?4:p>223?3:p>191?2:1;if(f+C<=o){var x,I,F,T;switch(C){case 1:p<128&&(g=p);break;case 2:x=a[f+1],(x&192)===128&&(T=(p&31)<<6|x&63,T>127&&(g=T));break;case 3:x=a[f+1],I=a[f+2],(x&192)===128&&(I&192)===128&&(T=(p&15)<<12|(x&63)<<6|I&63,T>2047&&(T<55296||T>57343)&&(g=T));break;case 4:x=a[f+1],I=a[f+2],F=a[f+3],(x&192)===128&&(I&192)===128&&(F&192)===128&&(T=(p&15)<<18|(x&63)<<12|(I&63)<<6|F&63,T>65535&&T<1114112&&(g=T))}}g===null?(g=65533,C=1):g>65535&&(g-=65536,l.push(g>>>10&1023|55296),g=56320|g&1023),l.push(g),f+=C}return Vt(l)}var at=4096;function Vt(a){var n=a.length;if(n<=at)return String.fromCharCode.apply(String,a);for(var o="",l=0;l<n;)o+=String.fromCharCode.apply(String,a.slice(l,l+=at));return o}function vt(a,n,o){var l="";o=Math.min(a.length,o);for(var f=n;f<o;++f)l+=String.fromCharCode(a[f]&127);return l}function R(a,n,o){var l="";o=Math.min(a.length,o);for(var f=n;f<o;++f)l+=String.fromCharCode(a[f]);return l}function K(a,n,o){var l=a.length;(!n||n<0)&&(n=0),(!o||o<0||o>l)&&(o=l);for(var f="",p=n;p<o;++p)f+=Pr[a[p]];return f}function B(a,n,o){for(var l=a.slice(n,o),f="",p=0;p<l.length-1;p+=2)f+=String.fromCharCode(l[p]+l[p+1]*256);return f}c.prototype.slice=function(n,o){var l=this.length;n=~~n,o=o===void 0?l:~~o,n<0?(n+=l,n<0&&(n=0)):n>l&&(n=l),o<0?(o+=l,o<0&&(o=0)):o>l&&(o=l),o<n&&(o=n);var f=this.subarray(n,o);return Object.setPrototypeOf(f,c.prototype),f};function N(a,n,o){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+n>o)throw new RangeError("Trying to access beyond buffer length")}c.prototype.readUintLE=c.prototype.readUIntLE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n],p=1,g=0;++g<o&&(p*=256);)f+=this[n+g]*p;return f},c.prototype.readUintBE=c.prototype.readUIntBE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n+--o],p=1;o>0&&(p*=256);)f+=this[n+--o]*p;return f},c.prototype.readUint8=c.prototype.readUInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]},c.prototype.readUint16LE=c.prototype.readUInt16LE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]|this[n+1]<<8},c.prototype.readUint16BE=c.prototype.readUInt16BE=function(n,o){return n=n>>>0,o||N(n,2,this.length),this[n]<<8|this[n+1]},c.prototype.readUint32LE=c.prototype.readUInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),(this[n]|this[n+1]<<8|this[n+2]<<16)+this[n+3]*16777216},c.prototype.readUint32BE=c.prototype.readUInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]*16777216+(this[n+1]<<16|this[n+2]<<8|this[n+3])},c.prototype.readIntLE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=this[n],p=1,g=0;++g<o&&(p*=256);)f+=this[n+g]*p;return p*=128,f>=p&&(f-=Math.pow(2,8*o)),f},c.prototype.readIntBE=function(n,o,l){n=n>>>0,o=o>>>0,l||N(n,o,this.length);for(var f=o,p=1,g=this[n+--f];f>0&&(p*=256);)g+=this[n+--f]*p;return p*=128,g>=p&&(g-=Math.pow(2,8*o)),g},c.prototype.readInt8=function(n,o){return n=n>>>0,o||N(n,1,this.length),this[n]&128?(255-this[n]+1)*-1:this[n]},c.prototype.readInt16LE=function(n,o){n=n>>>0,o||N(n,2,this.length);var l=this[n]|this[n+1]<<8;return l&32768?l|4294901760:l},c.prototype.readInt16BE=function(n,o){n=n>>>0,o||N(n,2,this.length);var l=this[n+1]|this[n]<<8;return l&32768?l|4294901760:l},c.prototype.readInt32LE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]|this[n+1]<<8|this[n+2]<<16|this[n+3]<<24},c.prototype.readInt32BE=function(n,o){return n=n>>>0,o||N(n,4,this.length),this[n]<<24|this[n+1]<<16|this[n+2]<<8|this[n+3]},c.prototype.readFloatLE=function(n,o){return n=n>>>0,o||N(n,4,this.length),Et.read(this,n,!0,23,4)},c.prototype.readFloatBE=function(n,o){return n=n>>>0,o||N(n,4,this.length),Et.read(this,n,!1,23,4)},c.prototype.readDoubleLE=function(n,o){return n=n>>>0,o||N(n,8,this.length),Et.read(this,n,!0,52,8)},c.prototype.readDoubleBE=function(n,o){return n=n>>>0,o||N(n,8,this.length),Et.read(this,n,!1,52,8)};function V(a,n,o,l,f,p){if(!c.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(n>f||n<p)throw new RangeError('"value" argument is out of bounds');if(o+l>a.length)throw new RangeError("Index out of range")}c.prototype.writeUintLE=c.prototype.writeUIntLE=function(n,o,l,f){if(n=+n,o=o>>>0,l=l>>>0,!f){var p=Math.pow(2,8*l)-1;V(this,n,o,l,p,0)}var g=1,C=0;for(this[o]=n&255;++C<l&&(g*=256);)this[o+C]=n/g&255;return o+l},c.prototype.writeUintBE=c.prototype.writeUIntBE=function(n,o,l,f){if(n=+n,o=o>>>0,l=l>>>0,!f){var p=Math.pow(2,8*l)-1;V(this,n,o,l,p,0)}var g=l-1,C=1;for(this[o+g]=n&255;--g>=0&&(C*=256);)this[o+g]=n/C&255;return o+l},c.prototype.writeUint8=c.prototype.writeUInt8=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,1,255,0),this[o]=n&255,o+1},c.prototype.writeUint16LE=c.prototype.writeUInt16LE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,65535,0),this[o]=n&255,this[o+1]=n>>>8,o+2},c.prototype.writeUint16BE=c.prototype.writeUInt16BE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,65535,0),this[o]=n>>>8,this[o+1]=n&255,o+2},c.prototype.writeUint32LE=c.prototype.writeUInt32LE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeUint32BE=c.prototype.writeUInt32BE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeIntLE=function(n,o,l,f){if(n=+n,o=o>>>0,!f){var p=Math.pow(2,8*l-1);V(this,n,o,l,p-1,-p)}var g=0,C=1,x=0;for(this[o]=n&255;++g<l&&(C*=256);)n<0&&x===0&&this[o+g-1]!==0&&(x=1),this[o+g]=(n/C>>0)-x&255;return o+l},c.prototype.writeIntBE=function(n,o,l,f){if(n=+n,o=o>>>0,!f){var p=Math.pow(2,8*l-1);V(this,n,o,l,p-1,-p)}var g=l-1,C=1,x=0;for(this[o+g]=n&255;--g>=0&&(C*=256);)n<0&&x===0&&this[o+g+1]!==0&&(x=1),this[o+g]=(n/C>>0)-x&255;return o+l},c.prototype.writeInt8=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,1,127,-128),n<0&&(n=255+n+1),this[o]=n&255,o+1},c.prototype.writeInt16LE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,32767,-32768),this[o]=n&255,this[o+1]=n>>>8,o+2},c.prototype.writeInt16BE=function(n,o,l){return n=+n,o=o>>>0,l||V(this,n,o,2,32767,-32768),this[o]=n>>>8,this[o+1]=n&255,o+2},c.prototype.writeInt32LE=function(n,o,l){return n=+n,o=o>>>0,l||V(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},c.prototype.writeInt32BE=function(n,o,l){return n=+n,o=o>>>0,l||V(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 Ke(a,n,o,l,f,p){if(o+l>a.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("Index out of range")}function Ge(a,n,o,l,f){return n=+n,o=o>>>0,f||Ke(a,n,o,4),Et.write(a,n,o,l,23,4),o+4}c.prototype.writeFloatLE=function(n,o,l){return Ge(this,n,o,!0,l)},c.prototype.writeFloatBE=function(n,o,l){return Ge(this,n,o,!1,l)};function qe(a,n,o,l,f){return n=+n,o=o>>>0,f||Ke(a,n,o,8),Et.write(a,n,o,l,52,8),o+8}c.prototype.writeDoubleLE=function(n,o,l){return qe(this,n,o,!0,l)},c.prototype.writeDoubleBE=function(n,o,l){return qe(this,n,o,!1,l)},c.prototype.copy=function(n,o,l,f){if(!c.isBuffer(n))throw new TypeError("argument should be a Buffer");if(l||(l=0),!f&&f!==0&&(f=this.length),o>=n.length&&(o=n.length),o||(o=0),f>0&&f<l&&(f=l),f===l||n.length===0||this.length===0)return 0;if(o<0)throw new RangeError("targetStart out of bounds");if(l<0||l>=this.length)throw new RangeError("Index out of range");if(f<0)throw new RangeError("sourceEnd out of bounds");f>this.length&&(f=this.length),n.length-o<f-l&&(f=n.length-o+l);var p=f-l;return this===n&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(o,l,f):Uint8Array.prototype.set.call(n,this.subarray(l,f),o),p},c.prototype.fill=function(n,o,l,f){if(typeof n=="string"){if(typeof o=="string"?(f=o,o=0,l=this.length):typeof l=="string"&&(f=l,l=this.length),f!==void 0&&typeof f!="string")throw new TypeError("encoding must be a string");if(typeof f=="string"&&!c.isEncoding(f))throw new TypeError("Unknown encoding: "+f);if(n.length===1){var p=n.charCodeAt(0);(f==="utf8"&&p<128||f==="latin1")&&(n=p)}}else typeof n=="number"?n=n&255:typeof n=="boolean"&&(n=Number(n));if(o<0||this.length<o||this.length<l)throw new RangeError("Out of range index");if(l<=o)return this;o=o>>>0,l=l===void 0?this.length:l>>>0,n||(n=0);var g;if(typeof n=="number")for(g=o;g<l;++g)this[g]=n;else{var C=c.isBuffer(n)?n:c.from(n,f),x=C.length;if(x===0)throw new TypeError('The value "'+n+'" is invalid for argument "value"');for(g=0;g<l-o;++g)this[g+o]=C[g%x]}return this};var xr=/[^+/0-9A-Za-z-_]/g;function Ir(a){if(a=a.split("=")[0],a=a.trim().replace(xr,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function me(a,n){n=n||1/0;for(var o,l=a.length,f=null,p=[],g=0;g<l;++g){if(o=a.charCodeAt(g),o>55295&&o<57344){if(!f){if(o>56319){(n-=3)>-1&&p.push(239,191,189);continue}else if(g+1===l){(n-=3)>-1&&p.push(239,191,189);continue}f=o;continue}if(o<56320){(n-=3)>-1&&p.push(239,191,189),f=o;continue}o=(f-55296<<10|o-56320)+65536}else f&&(n-=3)>-1&&p.push(239,191,189);if(f=null,o<128){if((n-=1)<0)break;p.push(o)}else if(o<2048){if((n-=2)<0)break;p.push(o>>6|192,o&63|128)}else if(o<65536){if((n-=3)<0)break;p.push(o>>12|224,o>>6&63|128,o&63|128)}else if(o<1114112){if((n-=4)<0)break;p.push(o>>18|240,o>>12&63|128,o>>6&63|128,o&63|128)}else throw new Error("Invalid code point")}return p}function Rr(a){for(var n=[],o=0;o<a.length;++o)n.push(a.charCodeAt(o)&255);return n}function Tr(a,n){for(var o,l,f,p=[],g=0;g<a.length&&!((n-=2)<0);++g)o=a.charCodeAt(g),l=o>>8,f=o%256,p.push(f),p.push(l);return p}function Qe(a){return Se.toByteArray(Ir(a))}function Yt(a,n,o,l){for(var f=0;f<l&&!(f+o>=n.length||f>=a.length);++f)n[f+o]=a[f];return f}function tt(a,n){return a instanceof n||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===n.name}function ve(a){return a!==a}var Pr=(function(){for(var a="0123456789abcdef",n=new Array(256),o=0;o<16;++o)for(var l=o*16,f=0;f<16;++f)n[l+f]=a[o]+a[f];return n})()}),D=ne.Buffer;ne.SlowBuffer;ne.INSPECT_MAX_BYTES;ne.kMaxLength;var De=function(t,i){return De=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,s){r.__proto__=s}||function(r,s){for(var h in s)s.hasOwnProperty(h)&&(r[h]=s[h])},De(t,i)};function oe(e,t){De(e,t);function i(){this.constructor=e}e.prototype=t===null?Object.create(t):(i.prototype=t.prototype,new i)}var dt=(function(e){oe(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),P=(function(e){oe(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 ie(e){return e&&e.Math==Math&&e}function qi(){return ie(typeof globalThis=="object"&&globalThis)||ie(typeof window=="object"&&window)||ie(typeof self=="object"&&self)||ie(typeof global=="object"&&global)||Function("return this")()}function Kr(){var e=qi();return typeof e.navigator=="object"&&e.navigator.product==="ReactNative"}var Gr=function(t){var i=Kr()?"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=D.alloc(t),s=0;s<t;++s)r[s]=Math.floor(Math.random()*256);return r},qr=function(){{if(typeof window<"u"){var e=window.crypto||window.msCrypto;if(e&&e.getRandomValues)return function(t){return e.getRandomValues(D.alloc(t))}}return typeof global<"u"&&global.crypto&&global.crypto.getRandomValues?function(t){return global.crypto.getRandomValues(D.alloc(t))}:Gr}},Qi=qr();function Qr(e){return["[object ArrayBuffer]","[object SharedArrayBuffer]"].includes(Object.prototype.toString.call(e))}function Ie(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}function tn(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function en(e){return Lt(e)&&Object.prototype.toString.call(e)==="[object Date]"}function Lt(e){return typeof e=="object"&&e!==null}function se(e,t){var i=!1;function r(){for(var s=[],h=0;h<arguments.length;h++)s[h]=arguments[h];return i||(console.warn(t),i=!0),e.apply(this,s)}return r}function re(e){if(ArrayBuffer.isView(e))return D.from(e.buffer,e.byteOffset,e.byteLength);if(Qr(e))return D.from(e);throw new P("Must use either Buffer or TypedArray")}var rn=/^(?:[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,tr=function(e){return typeof e=="string"&&rn.test(e)},xe=function(e){if(!tr(e))throw new P('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 D.from(t,"hex")},Li=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 co=Math.pow(2,63)-1,lo=-Math.pow(2,63),nn=Math.pow(2,53),on=-Math.pow(2,53);var er=4;var gt=(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 P("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=D.alloc(e.BUFFER_SIZE),this.position=0):(typeof t=="string"?this.buffer=D.from(t,"binary"):Array.isArray(t)?this.buffer=D.from(t):this.buffer=re(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if(typeof t=="string"&&t.length!==1)throw new P("only accepts single character String");if(typeof t!="number"&&t.length!==1)throw new P("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 P("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=D.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=D.alloc(this.buffer.length+t.length);this.buffer.copy(r,0,0,this.buffer.length),this.buffer=r}ArrayBuffer.isView(t)?(this.buffer.set(re(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 ki(this.buffer.slice(0,this.position));throw new dt('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=D.from(t.$binary,"base64")):typeof t.$binary!="string"&&(s=t.$binary.subType?parseInt(t.$binary.subType,16):0,r=D.from(t.$binary.base64,"base64")):"$uuid"in t&&(s=4,r=xe(t.$uuid)),!r)throw new P("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return s===er?new ki(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(gt.prototype,"_bsontype",{value:"Binary"});var Ae=16,ki=(function(e){oe(t,e);function t(i){var r=this,s,h;if(i==null)s=t.generate();else if(i instanceof t)s=D.from(i.buffer),h=i.__id;else if(ArrayBuffer.isView(i)&&i.byteLength===Ae)s=re(i);else if(typeof i=="string")s=xe(i);else throw new P("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,er)||this,r.__id=h,r}return Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(i){this.buffer=i,t.cacheHexString&&(this.__id=Li(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=Li(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 gt(this.id,gt.SUBTYPE_UUID)},t.generate=function(){var i=Qi(Ae);return i[6]=i[6]&15|64,i[8]=i[8]&63|128,D.from(i)},t.isValid=function(i){return i?i instanceof t?!0:typeof i=="string"?tr(i):Ie(i)?i.length!==Ae?!1:(i[6]&240)===64&&(i[8]&128)===128:!1:!1},t.createFromHexString=function(i){var r=xe(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})(gt),ae=(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(ae.prototype,"_bsontype",{value:"Code"});function sn(e){return Lt(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 h=t.split(".");h.length===2&&(r=h.shift(),t=h.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 Fi=65536,an=1<<24,St=Fi*Fi,ir=St*St,Ui=ir/2,ji={},Hi={},w=(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,h;return i?(t>>>=0,(h=0<=t&&t<256)&&(s=Hi[t],s)?s:(r=e.fromBits(t,(t|0)<0?-1:0,!0),h&&(Hi[t]=r),r)):(t|=0,(h=-128<=t&&t<128)&&(s=ji[t],s)?s:(r=e.fromBits(t,t<0?-1:0,!1),h&&(ji[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>=ir)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Ui)return e.MIN_VALUE;if(t+1>=Ui)return e.MAX_VALUE}return t<0?e.fromNumber(-t,i).neg():e.fromBits(t%St|0,t/St|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 h=e.fromNumber(Math.pow(r,8)),c=e.ZERO,u=0;u<t.length;u+=8){var d=Math.min(8,t.length-u),m=parseInt(t.substring(u,u+d),r);if(d<8){var y=e.fromNumber(Math.pow(r,d));c=c.mul(y).add(e.fromNumber(m))}else c=c.mul(h),c=c.add(e.fromNumber(m))}return c.unsigned=i,c},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 Lt(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,h=this.low&65535,c=t.high>>>16,u=t.high&65535,d=t.low>>>16,m=t.low&65535,y=0,_=0,v=0,S=0;return S+=h+m,v+=S>>>16,S&=65535,v+=s+d,_+=v>>>16,v&=65535,_+=r+u,y+=_>>>16,_&=65535,y+=i+c,y&=65535,e.fromBits(v<<16|S,y<<16|_,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,h;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;h=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 c=this.shr(1);return r=c.div(t).shl(1),r.eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(s=this.sub(t.mul(r)),h=r.add(s.div(t)),h)}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();h=e.ZERO}for(s=this;s.gte(t);){r=Math.max(1,Math.floor(s.toNumber()/t.toNumber()));for(var u=Math.ceil(Math.log(r)/Math.LN2),d=u<=48?1:Math.pow(2,u-48),m=e.fromNumber(r),y=m.mul(t);y.isNegative()||y.gt(s);)r-=d,m=e.fromNumber(r,this.unsigned),y=m.mul(t);m.isZero()&&(m=e.ONE),h=h.add(m),s=s.sub(y)}return h},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,h=this.low>>>16,c=this.low&65535,u=t.high>>>16,d=t.high&65535,m=t.low>>>16,y=t.low&65535,_=0,v=0,S=0,O=0;return O+=c*y,S+=O>>>16,O&=65535,S+=h*y,v+=S>>>16,S&=65535,S+=c*m,v+=S>>>16,S&=65535,v+=s*y,_+=v>>>16,v&=65535,v+=h*m,_+=v>>>16,v&=65535,v+=c*d,_+=v>>>16,v&=65535,_+=r*y+s*m+h*d+c*u,_&=65535,e.fromBits(S<<16|O,_<<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)*St+(this.low>>>0):this.high*St+(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 h=e.fromNumber(Math.pow(t,6),this.unsigned),c=this,u="";;){var d=c.div(h),m=c.sub(d.mul(h)).toInt()>>>0,y=m.toString(t);if(c=d,c.isZero())return y+u;for(;y.length<6;)y="0"+y;u=""+y+u}},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(an),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(w.prototype,"__isLong__",{value:!0});Object.defineProperty(w.prototype,"_bsontype",{value:"Long"});var cn=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,ln=/^(\+|-)?(Infinity|inf)$/i,hn=/^(\+|-)?NaN$/i,Tt=6111,Ne=-6176,$i=6176,fn=34,Ce=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Vi=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Yi=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),un=/^([-+])?(\d+)?$/,pn=31,Wi=16383,dn=30,gn=31;function Xi(e){return!isNaN(parseInt(e,10))}function _n(e){var t=w.fromNumber(1e9),i=w.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 w(e.parts[r],0)),e.parts[r]=i.div(t).low,i=i.modulo(t);return{quotient:e,rem:i}}function yn(e,t){if(!e&&!t)return{high:w.fromNumber(0),low:w.fromNumber(0)};var i=e.shiftRightUnsigned(32),r=new w(e.getLowBits(),0),s=t.shiftRightUnsigned(32),h=new w(t.getLowBits(),0),c=i.multiply(s),u=i.multiply(h),d=r.multiply(s),m=r.multiply(h);return c=c.add(u.shiftRightUnsigned(32)),u=new w(u.getLowBits(),0).add(d).add(m.shiftRightUnsigned(32)),c=c.add(u.shiftRightUnsigned(32)),m=u.shiftLeft(32).add(new w(m.getLowBits(),0)),{high:c,low:m}}function mn(e,t){var i=e.high>>>0,r=t.high>>>0;if(i<r)return!0;if(i===r){var s=e.low>>>0,h=t.low>>>0;if(s<h)return!0}return!1}function Ot(e,t){throw new P('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Re=(function(){function e(t){if(!(this instanceof e))return new e(t);if(typeof t=="string")this.bytes=e.fromString(t).bytes;else if(Ie(t)){if(t.byteLength!==16)throw new P("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}else throw new P("Decimal128 must take a Buffer or string")}return e.fromString=function(t){var i=!1,r=!1,s=!1,h=0,c=0,u=0,d=0,m=0,y=[0],_=0,v=0,S=0,O=0,A=0,k=0,M=new w(0,0),L=new w(0,0),$=0,b=0;if(t.length>=7e3)throw new P(""+t+" not a valid Decimal128 string");var X=t.match(cn),Q=t.match(ln),st=t.match(hn);if(!X&&!Q&&!st||t.length===0)throw new P(""+t+" not a valid Decimal128 string");if(X){var _e=X[2],Dt=X[4],ye=X[5],$t=X[6];Dt&&$t===void 0&&Ot(t,"missing exponent power"),Dt&&_e===void 0&&Ot(t,"missing exponent base"),Dt===void 0&&(ye||$t)&&Ot(t,"missing e before exponent")}if((t[b]==="+"||t[b]==="-")&&(i=t[b++]==="-"),!Xi(t[b])&&t[b]!=="."){if(t[b]==="i"||t[b]==="I")return new e(D.from(i?Vi:Yi));if(t[b]==="N")return new e(D.from(Ce))}for(;Xi(t[b])||t[b]===".";){if(t[b]==="."){r&&Ot(t,"contains multiple periods"),r=!0,b=b+1;continue}_<34&&(t[b]!=="0"||s)&&(s||(m=c),s=!0,y[v++]=parseInt(t[b],10),_=_+1),s&&(u=u+1),r&&(d=d+1),c=c+1,b=b+1}if(r&&!c)throw new P(""+t+" not a valid Decimal128 string");if(t[b]==="e"||t[b]==="E"){var yt=t.substr(++b).match(un);if(!yt||!yt[2])return new e(D.from(Ce));A=parseInt(yt[0],10),b=b+yt[0].length}if(t[b])return new e(D.from(Ce));if(S=0,!_)S=0,O=0,y[0]=0,u=1,_=1,h=0;else if(O=_-1,h=u,h!==1)for(;y[m+h-1]===0;)h=h-1;for(A<=d&&d-A>16384?A=Ne:A=A-d;A>Tt;){if(O=O+1,O-S>fn){var mt=y.join("");if(mt.match(/^0+$/)){A=Tt;break}Ot(t,"overflow")}A=A-1}for(;A<Ne||_<u;){if(O===0&&h<_){A=Ne,h=0;break}if(_<u?u=u-1:O=O-1,A<Tt)A=A+1;else{var mt=y.join("");if(mt.match(/^0+$/)){A=Tt;break}Ot(t,"overflow")}}if(O-S+1<h){var at=c;r&&(m=m+1,at=at+1),i&&(m=m+1,at=at+1);var Vt=parseInt(t[m+O+1],10),vt=0;if(Vt>=5&&(vt=1,Vt===5)){for(vt=y[O]%2===1?1:0,k=m+O+2;k<at;k++)if(parseInt(t[k],10)){vt=1;break}}if(vt){for(var R=O;R>=0;R--)if(++y[R]>9&&(y[R]=0,R===0))if(A<Tt)A=A+1,y[R]=1;else return new e(D.from(i?Vi:Yi))}}if(M=w.fromNumber(0),L=w.fromNumber(0),h===0)M=w.fromNumber(0),L=w.fromNumber(0);else if(O-S<17){var R=S;for(L=w.fromNumber(y[R++]),M=new w(0,0);R<=O;R++)L=L.multiply(w.fromNumber(10)),L=L.add(w.fromNumber(y[R]))}else{var R=S;for(M=w.fromNumber(y[R++]);R<=O-17;R++)M=M.multiply(w.fromNumber(10)),M=M.add(w.fromNumber(y[R]));for(L=w.fromNumber(y[R++]);R<=O;R++)L=L.multiply(w.fromNumber(10)),L=L.add(w.fromNumber(y[R]))}var K=yn(M,w.fromString("100000000000000000"));K.low=K.low.add(L),mn(K.low,L)&&(K.high=K.high.add(w.fromNumber(1))),$=A+$i;var B={low:w.fromNumber(0),high:w.fromNumber(0)};K.high.shiftRightUnsigned(49).and(w.fromNumber(1)).equals(w.fromNumber(1))?(B.high=B.high.or(w.fromNumber(3).shiftLeft(61)),B.high=B.high.or(w.fromNumber($).and(w.fromNumber(16383).shiftLeft(47))),B.high=B.high.or(K.high.and(w.fromNumber(0x7fffffffffff)))):(B.high=B.high.or(w.fromNumber($&16383).shiftLeft(49)),B.high=B.high.or(K.high.and(w.fromNumber(562949953421311)))),B.low=K.low,i&&(B.high=B.high.or(w.fromString("9223372036854775808")));var N=D.alloc(16);return b=0,N[b++]=B.low.low&255,N[b++]=B.low.low>>8&255,N[b++]=B.low.low>>16&255,N[b++]=B.low.low>>24&255,N[b++]=B.low.high&255,N[b++]=B.low.high>>8&255,N[b++]=B.low.high>>16&255,N[b++]=B.low.high>>24&255,N[b++]=B.high.low&255,N[b++]=B.high.low>>8&255,N[b++]=B.high.low>>16&255,N[b++]=B.high.low>>24&255,N[b++]=B.high.high&255,N[b++]=B.high.high>>8&255,N[b++]=B.high.high>>16&255,N[b++]=B.high.high>>24&255,new e(N)},e.prototype.toString=function(){for(var t,i=0,r=new Array(36),s=0;s<r.length;s++)r[s]=0;var h=0,c=!1,u,d={parts:[0,0,0,0]},m,y,_=[];h=0;var v=this.bytes,S=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,O=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,A=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24,k=v[h++]|v[h++]<<8|v[h++]<<16|v[h++]<<24;h=0;var M={low:new w(S,O),high:new w(A,k)};M.high.lessThan(w.ZERO)&&_.push("-");var L=k>>26&pn;if(L>>3===3){if(L===dn)return _.join("")+"Infinity";if(L===gn)return"NaN";t=k>>15&Wi,u=8+(k>>14&1)}else u=k>>14&7,t=k>>17&Wi;var $=t-$i;if(d.parts[0]=(k&16383)+((u&15)<<14),d.parts[1]=A,d.parts[2]=O,d.parts[3]=S,d.parts[0]===0&&d.parts[1]===0&&d.parts[2]===0&&d.parts[3]===0)c=!0;else for(y=3;y>=0;y--){var b=0,X=_n(d);if(d=X.quotient,b=X.rem.low,!!b)for(m=8;m>=0;m--)r[y*9+m]=b%10,b=Math.floor(b/10)}if(c)i=1,r[h]=0;else for(i=36;!r[h];)i=i-1,h=h+1;var Q=i-1+$;if(Q>=34||Q<=-7||$>0){if(i>34)return _.push("".concat(0)),$>0?_.push("E+".concat($)):$<0&&_.push("E".concat($)),_.join("");_.push("".concat(r[h++])),i=i-1,i&&_.push(".");for(var s=0;s<i;s++)_.push("".concat(r[h++]));_.push("E"),Q>0?_.push("+".concat(Q)):_.push("".concat(Q))}else if($>=0)for(var s=0;s<i;s++)_.push("".concat(r[h++]));else{var st=i+$;if(st>0)for(var s=0;s<st;s++)_.push("".concat(r[h++]));else _.push("0");for(_.push(".");st++<0;)_.push("0");for(var s=0;s<i-Math.max(st-1,0);s++)_.push("".concat(r[h++]))}return _.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(Re.prototype,"_bsontype",{value:"Decimal128"});var ce=(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(ce.prototype,"_bsontype",{value:"Double"});var le=(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(le.prototype,"_bsontype",{value:"Int32"});var Te=(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(Te.prototype,"_bsontype",{value:"MaxKey"});var Pe=(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(Pe.prototype,"_bsontype",{value:"MinKey"});var vn=new RegExp("^[0-9a-fA-F]{24}$"),pt=null,it=Symbol("id"),H=(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 P("Argument passed in must have an id that is of type string or Buffer");"toHexString"in t&&typeof t.toHexString=="function"?i=D.from(t.toHexString(),"hex"):i=t.id}else i=t;if(i==null||typeof i=="number")this[it]=e.generate(typeof i=="number"?i:void 0);else if(ArrayBuffer.isView(i)&&i.byteLength===12)this[it]=i instanceof D?i:re(i);else if(typeof i=="string")if(i.length===12){var r=D.from(i);if(r.byteLength===12)this[it]=r;else throw new P("Argument passed in must be a string of 12 bytes")}else if(i.length===24&&vn.test(i))this[it]=D.from(i,"hex");else throw new P("Argument passed in must be a string of 12 bytes or a string of 24 hex characters or an integer");else throw new P("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[it]},set:function(t){this[it]=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=D.alloc(12);return r.writeUInt32BE(t,0),pt===null&&(pt=Qi(5)),r[4]=pt[0],r[5]=pt[1],r[6]=pt[2],r[7]=pt[3],r[8]=pt[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[it][11]===t[it][11]&&this[it].equals(t[it]);if(typeof t=="string"&&e.isValid(t)&&t.length===12&&Ie(this.id))return t===D.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 D.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=D.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 P("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(D.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(H.prototype,"generate",{value:se(function(e){return H.generate(e)},"Please use the static `ObjectId.generate(time)` instead")});Object.defineProperty(H.prototype,"getInc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H.prototype,"get_inc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H,"get_inc",{value:se(function(){return H.getInc()},"Please use the static `ObjectId.getInc()` instead")});Object.defineProperty(H.prototype,"_bsontype",{value:"ObjectID"});function wn(e){return e.split("").sort().join("")}var Mt=(function(){function e(t,i){if(!(this instanceof e))return new e(t,i);if(this.pattern=t,this.options=wn(i??""),this.pattern.indexOf("\0")!==-1)throw new dt("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(this.options.indexOf("\0")!==-1)throw new dt("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 dt("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 P("Unexpected BSONRegExp EJSON object form: ".concat(JSON.stringify(t)))},e})();Object.defineProperty(Mt.prototype,"_bsontype",{value:"BSONRegExp"});var Me=(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(Me.prototype,"_bsontype",{value:"Symbol"});var bn=w,rr=(function(e){oe(t,e);function t(i,r){var s=this;return s instanceof t?(w.isLong(i)?s=e.call(this,i.low,i.high,!0)||this:Lt(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(w.fromInt(i,!0))},t.fromNumber=function(i){return new t(w.fromNumber(i,!0))},t.fromBits=function(i,r){return new t(i,r)},t.fromString=function(i,r){return new t(w.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=w.MAX_UNSIGNED_VALUE,t})(bn);function En(e){return Lt(e)&&Reflect.has(e,"_bsontype")&&typeof e._bsontype=="string"}var nr=2147483647,or=-2147483648,sr=9223372036854776e3,ar=-9223372036854776e3,On={$oid:H,$binary:gt,$uuid:gt,$symbol:Me,$numberInt:le,$numberDecimal:Re,$numberDouble:ce,$numberLong:w,$minKey:Pe,$maxKey:Te,$regex:Mt,$regularExpression:Mt,$timestamp:rr};function cr(e,t){if(t===void 0&&(t={}),typeof e=="number"){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=or&&e<=nr)return new le(e);if(e>=ar&&e<=sr)return w.fromNumber(e)}return new ce(e)}if(e==null||typeof e!="object")return e;if(e.$undefined)return null;for(var i=Object.keys(e).filter(function(_){return _.startsWith("$")&&e[_]!=null}),r=0;r<i.length;r++){var s=On[i[r]];if(s)return s.fromExtendedJSON(e,t)}if(e.$date!=null){var h=e.$date,c=new Date;return t.legacy?typeof h=="number"?c.setTime(h):typeof h=="string"&&c.setTime(Date.parse(h)):typeof h=="string"?c.setTime(Date.parse(h)):w.isLong(h)?c.setTime(h.toNumber()):typeof h=="number"&&t.relaxed&&c.setTime(h),c}if(e.$code!=null){var u=Object.assign({},e);return e.$scope&&(u.$scope=cr(e.$scope)),ae.fromExtendedJSON(e)}if(sn(e)||e.$dbPointer){var d=e.$ref?e:e.$dbPointer;if(d instanceof Pt)return d;var m=Object.keys(d).filter(function(_){return _.startsWith("$")}),y=!0;if(m.forEach(function(_){["$ref","$id","$db"].indexOf(_)===-1&&(y=!1)}),y)return Pt.fromExtendedJSON(d)}return e}function Sn(e,t){return e.map(function(i,r){t.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return lt(i,t)}finally{t.seenObjects.pop()}})}function zi(e){var t=e.toISOString();return e.getUTCMilliseconds()!==0?t:t.slice(0,-5)+"Z"}function lt(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(""),h=r[i],c=" -> "+r.slice(i+1,r.length-1).map(function(M){return"".concat(M," -> ")}).join(""),u=r[r.length-1],d=" ".repeat(s.length+h.length/2),m="-".repeat(c.length+(h.length+u.length)/2-1);throw new P(`Converting circular structure to EJSON:
|
|
2
2
|
`+" ".concat(s).concat(h).concat(c).concat(u,`
|
|
3
3
|
`)+" ".concat(d,"\\").concat(m,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return Sn(e,t);if(e===void 0)return null;if(e instanceof Date||en(e)){var y=e.getTime(),_=y>-1&&y<2534023188e5;return t.legacy?t.relaxed&&_?{$date:e.getTime()}:{$date:zi(e)}:t.relaxed&&_?{$date:zi(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(typeof e=="number"&&(!t.relaxed||!isFinite(e))){if(Math.floor(e)===e){var v=e>=or&&e<=nr,S=e>=ar&&e<=sr;if(v)return{$numberInt:e.toString()};if(S)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||tn(e)){var O=e.flags;if(O===void 0){var A=e.toString().match(/[gimuy]*$/);A&&(O=A[0])}var k=new Mt(e.source,O);return k.toExtendedJSON(t)}return e!=null&&typeof e=="object"?Nn(e,t):e}var An={Binary:function(e){return new gt(e.value(),e.sub_type)},Code:function(e){return new ae(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 Re(e.bytes)},Double:function(e){return new ce(e.value)},Int32:function(e){return new le(e.value)},Long:function(e){return w.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 Te},MinKey:function(){return new Pe},ObjectID:function(e){return new H(e)},ObjectId:function(e){return new H(e)},BSONRegExp:function(e){return new Mt(e.pattern,e.options)},Symbol:function(e){return new Me(e.value)},Timestamp:function(e){return rr.fromBits(e.low,e.high)}};function Nn(e,t){if(e==null||typeof e!="object")throw new dt("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 h=lt(e[s],t);s==="__proto__"?Object.defineProperty(r,s,{value:h,writable:!0,enumerable:!0,configurable:!0}):r[s]=h}finally{t.seenObjects.pop()}}return r}else if(En(e)){var c=e;if(typeof c.toExtendedJSON!="function"){var u=An[e._bsontype];if(!u)throw new P("Unrecognized or invalid _bsontype: "+e._bsontype);c=u(c)}return i==="Code"&&c.scope?c=new ae(c.code,lt(c.scope,t)):i==="DBRef"&&c.oid&&(c=new Pt(lt(c.collection,t),lt(c.oid,t),lt(c.db,t),lt(c.fields,t))),c.toExtendedJSON(t)}else throw new dt("_bsontype must be a string, but was: "+typeof i)}var Zi;(function(e){function t(h,c){var u=Object.assign({},{relaxed:!0,legacy:!1},c);return typeof u.relaxed=="boolean"&&(u.strict=!u.relaxed),typeof u.strict=="boolean"&&(u.relaxed=!u.strict),JSON.parse(h,function(d,m){if(d.indexOf("\0")!==-1)throw new dt("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(d)));return cr(m,u)})}e.parse=t;function i(h,c,u,d){u!=null&&typeof u=="object"&&(d=u,u=0),c!=null&&typeof c=="object"&&!Array.isArray(c)&&(d=c,c=void 0,u=0);var m=Object.assign({relaxed:!0,legacy:!1},d,{seenObjects:[{propertyName:"(root)",obj:null}]}),y=lt(h,m);return JSON.stringify(y,c,u)}e.stringify=i;function r(h,c){return c=c||{},JSON.parse(i(h,c))}e.serialize=r;function s(h,c){return c=c||{},t(JSON.stringify(h),c)}e.deserialize=s})(Zi||(Zi={}));var Ji,Ki=qi();Ki.Map?Ji=Ki.Map:Ji=(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],h=r[1];this._keys.push(s),this._values[s]={v:h,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 ho=w.fromNumber(nn),fo=w.fromNumber(on);var Be=new Uint8Array(8),uo=new DataView(Be.buffer,Be.byteOffset,Be.byteLength);var Cn=1024*1024*17,po=D.alloc(Cn);var he=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 lr=class{constructor(t,i={},r,s){this.name=t;this.properties=i;this.id=s?new H(s):new H,this.occurred=new Date,r&&(this.trigger=new he(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 kt=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}},At=class extends kt{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 kt{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()}},Le=class extends kt{element;constructor(t){super(),this.element=t instanceof ht?t.nativeElement:t}},Ct=class{_attachedPortal;_disposeFn;_isDisposed=!1;hasAttached(){return!!this._attachedPortal}attach(t){if(t instanceof At)return this._attachedPortal=t,this.attachComponentPortal(t);if(t instanceof Nt)return this._attachedPortal=t,this.attachTemplatePortal(t);if(this.attachDomPortal&&t instanceof Le)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)}},fe=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(be,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||G.NULL,h=s.get(Xt,r.injector);i=Si(t.component,{elementInjector:s,environmentInjector:h,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 Ue=(()=>{class e extends Ct{_moduleRef=E(be,{optional:!0});_document=E(W);_viewContainerRef=E(we);_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=xt({type:e,selectors:[["","cdkPortalOutlet",""]],inputs:{portal:[0,"cdkPortalOutlet","portal"]},outputs:{attached:"attached"},exportAs:["cdkPortalOutlet"],features:[Gt]})}return e})();var Ft;function Bn(){if(Ft==null&&typeof window<"u")try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>Ft=!0}))}finally{Ft=Ft||!1}return Ft}function hr(e){return Bn()?e:!!e.capture}var Dn=new z("cdk-input-modality-detector-options"),xn={ignoreKeys:[18,17,224,91,16]},fr=650,je={passive:!0,capture:!0},In=(()=>{class e{_platform=E(et);_listenerCleanups;modalityDetected;modalityChanged;get mostRecentModality(){return this._modality.value}_mostRecentTarget=null;_modality=new ni(null);_options;_lastTouchMs=0;_onKeydown=i=>{this._options?.ignoreKeys?.some(r=>r===i.keyCode)||(this._modality.next("keyboard"),this._mostRecentTarget=nt(i))};_onMousedown=i=>{Date.now()-this._lastTouchMs<fr||(this._modality.next(Di(i)?"keyboard":"mouse"),this._mostRecentTarget=nt(i))};_onTouchstart=i=>{if(xi(i)){this._modality.next("keyboard");return}this._lastTouchMs=Date.now(),this._modality.next("touch"),this._mostRecentTarget=nt(i)};constructor(){let i=E(q),r=E(W),s=E(Dn,{optional:!0});if(this._options=U(U({},xn),s),this.modalityDetected=this._modality.pipe(li(1)),this.modalityChanged=this.modalityDetected.pipe(ci()),this._platform.isBrowser){let h=E(wt).createRenderer(null,null);this._listenerCleanups=i.runOutsideAngular(()=>[h.listen(r,"keydown",this._onKeydown,je),h.listen(r,"mousedown",this._onMousedown,je),h.listen(r,"touchstart",this._onTouchstart,je)])}}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})(),pe=(function(e){return e[e.IMMEDIATE=0]="IMMEDIATE",e[e.EVENTUAL=1]="EVENTUAL",e})(pe||{}),Rn=new z("cdk-focus-monitor-default-options"),ue=hr({passive:!0,capture:!0}),ur=(()=>{class e{_ngZone=E(q);_platform=E(et);_inputModalityDetector=E(In);_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=E(W);_stopInputModalityDetector=new Y;constructor(){let i=E(Rn,{optional:!0});this._detectionMode=i?.detectionMode||pe.IMMEDIATE}_rootNodeFocusAndBlurListener=i=>{let r=nt(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=te(i);if(!this._platform.isBrowser||s.nodeType!==1)return oi();let h=Ii(s)||this._document,c=this._elementInfo.get(s);if(c)return r&&(c.checkChildren=!0),c.subject;let u={checkChildren:r,subject:new Y,rootNode:h};return this._elementInfo.set(s,u),this._registerGlobalListeners(u),u.subject}stopMonitoring(i){let r=te(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 h=te(i),c=this._document.activeElement;h===c?this._getClosestElementsInfo(h).forEach(([u,d])=>this._originChanged(u,r,d)):(this._setOrigin(r),typeof h.focus=="function"&&h.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===pe.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===pe.IMMEDIATE){clearTimeout(this._originTimeoutId);let s=this._originFromTouchInteraction?fr:1;this._originTimeoutId=setTimeout(()=>this._origin=null,s)}})}_onFocus(i,r){let s=this._elementInfo.get(r),h=nt(i);!s||!s.checkChildren&&r!==h||this._originChanged(r,this._getFocusOrigin(h),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,ue),r.addEventListener("blur",this._rootNodeFocusAndBlurListener,ue)}),this._rootNodeFocusListenerCount.set(r,s+1),++this._monitoredElementCount===1&&(this._ngZone.runOutsideAngular(()=>{this._getWindow().addEventListener("focus",this._windowFocusListener)}),this._inputModalityDetector.modalityDetected.pipe(fi(this._stopInputModalityDetector)).subscribe(h=>{this._setOrigin(h,!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,ue),r.removeEventListener("blur",this._rootNodeFocusAndBlurListener,ue),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,h)=>{(h===i||s.checkChildren&&h.contains(i))&&r.push([h,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 h=i.labels;if(h){for(let c=0;c<h.length;c++)if(h[c].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 pr=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ct({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
4
|
`],encapsulation:2,changeDetection:0})}return e})();var $e=(()=>{class e{_platform=E(et);constructor(){}isDisabled(i){return i.hasAttribute("disabled")}isVisible(i){return Ln(i)&&getComputedStyle(i).visibility==="visible"}isTabbable(i){if(!this._platform.isBrowser)return!1;let r=Mn(Yn(i));if(r&&(dr(r)===-1||!this.isVisible(r)))return!1;let s=i.nodeName.toLowerCase(),h=dr(i);return i.hasAttribute("contenteditable")?h!==-1:s==="iframe"||s==="object"||this._platform.WEBKIT&&this._platform.IOS&&!$n(i)?!1:s==="audio"?i.hasAttribute("controls")?h!==-1:!1:s==="video"?h===-1?!1:h!==null?!0:this._platform.FIREFOX||i.hasAttribute("controls"):i.tabIndex>=0}isFocusable(i,r){return Vn(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 Mn(e){try{return e.frameElement}catch{return null}}function Ln(e){return!!(e.offsetWidth||e.offsetHeight||typeof e.getClientRects=="function"&&e.getClientRects().length)}function kn(e){let t=e.nodeName.toLowerCase();return t==="input"||t==="select"||t==="button"||t==="textarea"}function Fn(e){return jn(e)&&e.type=="hidden"}function Un(e){return Hn(e)&&e.hasAttribute("href")}function jn(e){return e.nodeName.toLowerCase()=="input"}function Hn(e){return e.nodeName.toLowerCase()=="a"}function gr(e){if(!e.hasAttribute("tabindex")||e.tabIndex===void 0)return!1;let t=e.getAttribute("tabindex");return!!(t&&!isNaN(parseInt(t,10)))}function dr(e){if(!gr(e))return null;let t=parseInt(e.getAttribute("tabindex")||"",10);return isNaN(t)?-1:t}function $n(e){let t=e.nodeName.toLowerCase(),i=t==="input"&&e.type;return i==="text"||i==="password"||t==="select"||t==="textarea"}function Vn(e){return Fn(e)?!1:kn(e)||Un(e)||e.hasAttribute("contenteditable")||gr(e)}function Yn(e){return e.ownerDocument&&e.ownerDocument.defaultView||window}var He=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,h=!1,c){this._element=t,this._checker=i,this._ngZone=r,this._document=s,this._injector=c,h||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)}},_r=(()=>{class e{_checker=E($e);_ngZone=E(q);_document=E(W);_injector=E(G);constructor(){E(It).load(pr)}create(i,r=!1){return new He(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 yr(e,...t){return t.length?t.some(i=>e[i]):e.altKey||e.shiftKey||e.ctrlKey||e.metaKey}function Ve(){return typeof __karma__<"u"&&!!__karma__||typeof jasmine<"u"&&!!jasmine||typeof jest<"u"&&!!jest||typeof Mocha<"u"&&!!Mocha}function ot(e){return e==null?"":typeof e=="string"?e:`${e}px`}var mr=Ti();function br(e){return new Ye(e.get(Pi),e.get(W))}var Ye=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=ot(-this._previousScrollPosition.left),t.style.top=ot(-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,h=r.scrollBehavior||"",c=s.scrollBehavior||"";this._isEnabled=!1,r.left=this._previousHTMLStyles.left,r.top=this._previousHTMLStyles.top,t.classList.remove("cdk-global-scrollblock"),mr&&(r.scrollBehavior=s.scrollBehavior="auto"),window.scroll(this._previousScrollPosition.left,this._previousScrollPosition.top),mr&&(r.scrollBehavior=h,s.scrollBehavior=c)}}_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 We=class{enable(){}disable(){}attach(){}};var Ut=class{positionStrategy;scrollStrategy=new We;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 Er=(()=>{class e{_attachedOverlays=[];_document=E(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})(),Xn=(()=>{class e extends Er{_ngZone=E(q);_renderer=E(wt).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=Zt(e)))(s||e)}})();static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})(),zn=(()=>{class e extends Er{_platform=E(et);_ngZone=E(q);_renderer=E(wt).createRenderer(null,null);_cursorOriginalValue;_cursorStyleIsSet=!1;_pointerDownEventTarget;_cleanups;add(i){if(super.add(i),!this._isAttached){let r=this._document.body,s={capture:!0},h=this._renderer;this._cleanups=this._ngZone.runOutsideAngular(()=>[h.listen(r,"pointerdown",this._pointerDownListener,s),h.listen(r,"click",this._clickListener,s),h.listen(r,"auxclick",this._clickListener,s),h.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=nt(i)};_clickListener=i=>{let r=nt(i),s=i.type==="click"&&this._pointerDownEventTarget?this._pointerDownEventTarget:r;this._pointerDownEventTarget=null;let h=this._attachedOverlays.slice();for(let c=h.length-1;c>-1;c--){let u=h[c];if(u._outsidePointerEvents.observers.length<1||!u.hasAttached())continue;if(vr(u.overlayElement,r)||vr(u.overlayElement,s))break;let d=u._outsidePointerEvents;this._ngZone?this._ngZone.run(()=>d.next(i)):d.next(i)}};static \u0275fac=(()=>{let i;return function(s){return(i||(i=Zt(e)))(s||e)}})();static \u0275prov=j({token:e,factory:e.\u0275fac,providedIn:"root"})}return e})();function vr(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 Or=(()=>{class e{static \u0275fac=function(r){return new(r||e)};static \u0275cmp=ct({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}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{a as ee,b as lt,c as ue,e as dt,g as mt,h as he}from"./chunk-U4XWPFUW.js";var vt=dt((ht,ke)=>{"use strict";(function(s){if(typeof ht=="object"&&typeof ke<"u")ke.exports=s();else if(typeof define=="function"&&define.amd)define([],s);else{var n;typeof window<"u"?n=window:typeof global<"u"?n=global:typeof self<"u"?n=self:n=this,n.localforage=s()}})(function(){var s,n,h;return(function c(v,I,w){function R(T,V){if(!I[T]){if(!v[T]){var p=typeof ue=="function"&&ue;if(!V&&p)return p(T,!0);if(b)return b(T,!0);var _=new Error("Cannot find module '"+T+"'");throw _.code="MODULE_NOT_FOUND",_}var C=I[T]={exports:{}};v[T][0].call(C.exports,function(O){var j=v[T][1][O];return R(j||O)},C,C.exports,c,v,I,w)}return I[T].exports}for(var b=typeof ue=="function"&&ue,m=0;m<w.length;m++)R(w[m]);return R})({1:[function(c,v,I){(function(w){"use strict";var R=w.MutationObserver||w.WebKitMutationObserver,b;if(R){var m=0,T=new R(O),V=w.document.createTextNode("");T.observe(V,{characterData:!0}),b=function(){V.data=m=++m%2}}else if(!w.setImmediate&&typeof w.MessageChannel<"u"){var p=new w.MessageChannel;p.port1.onmessage=O,b=function(){p.port2.postMessage(0)}}else"document"in w&&"onreadystatechange"in w.document.createElement("script")?b=function(){var B=w.document.createElement("script");B.onreadystatechange=function(){O(),B.onreadystatechange=null,B.parentNode.removeChild(B),B=null},w.document.documentElement.appendChild(B)}:b=function(){setTimeout(O,0)};var _,C=[];function O(){_=!0;for(var B,z,F=C.length;F;){for(z=C,C=[],B=-1;++B<F;)z[B]();F=C.length}_=!1}v.exports=j;function j(B){C.push(B)===1&&!_&&b()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(c,v,I){"use strict";var w=c(1);function R(){}var b={},m=["REJECTED"],T=["FULFILLED"],V=["PENDING"];v.exports=p;function p(y){if(typeof y!="function")throw new TypeError("resolver must be a function");this.state=V,this.queue=[],this.outcome=void 0,y!==R&&j(this,y)}p.prototype.catch=function(y){return this.then(null,y)},p.prototype.then=function(y,A){if(typeof y!="function"&&this.state===T||typeof A!="function"&&this.state===m)return this;var D=new this.constructor(R);if(this.state!==V){var L=this.state===T?y:A;C(D,L,this.outcome)}else this.queue.push(new _(D,y,A));return D};function _(y,A,D){this.promise=y,typeof A=="function"&&(this.onFulfilled=A,this.callFulfilled=this.otherCallFulfilled),typeof D=="function"&&(this.onRejected=D,this.callRejected=this.otherCallRejected)}_.prototype.callFulfilled=function(y){b.resolve(this.promise,y)},_.prototype.otherCallFulfilled=function(y){C(this.promise,this.onFulfilled,y)},_.prototype.callRejected=function(y){b.reject(this.promise,y)},_.prototype.otherCallRejected=function(y){C(this.promise,this.onRejected,y)};function C(y,A,D){w(function(){var L;try{L=A(D)}catch(U){return b.reject(y,U)}L===y?b.reject(y,new TypeError("Cannot resolve promise with itself")):b.resolve(y,L)})}b.resolve=function(y,A){var D=B(O,A);if(D.status==="error")return b.reject(y,D.value);var L=D.value;if(L)j(y,L);else{y.state=T,y.outcome=A;for(var U=-1,k=y.queue.length;++U<k;)y.queue[U].callFulfilled(A)}return y},b.reject=function(y,A){y.state=m,y.outcome=A;for(var D=-1,L=y.queue.length;++D<L;)y.queue[D].callRejected(A);return y};function O(y){var A=y&&y.then;if(y&&(typeof y=="object"||typeof y=="function")&&typeof A=="function")return function(){A.apply(y,arguments)}}function j(y,A){var D=!1;function L(G){D||(D=!0,b.reject(y,G))}function U(G){D||(D=!0,b.resolve(y,G))}function k(){A(U,L)}var $=B(k);$.status==="error"&&L($.value)}function B(y,A){var D={};try{D.value=y(A),D.status="success"}catch(L){D.status="error",D.value=L}return D}p.resolve=z;function z(y){return y instanceof this?y:b.resolve(new this(R),y)}p.reject=F;function F(y){var A=new this(R);return b.reject(A,y)}p.all=Re;function Re(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=new Array(D),k=0,$=-1,G=new this(R);++$<D;)q(y[$],$);return G;function q(ie,me){A.resolve(ie).then(Ce,function(te){L||(L=!0,b.reject(G,te))});function Ce(te){U[me]=te,++k===D&&!L&&(L=!0,b.resolve(G,U))}}}p.race=Z;function Z(y){var A=this;if(Object.prototype.toString.call(y)!=="[object Array]")return this.reject(new TypeError("must be an array"));var D=y.length,L=!1;if(!D)return this.resolve([]);for(var U=-1,k=new this(R);++U<D;)$(y[U]);return k;function $(G){A.resolve(G).then(function(q){L||(L=!0,b.resolve(k,q))},function(q){L||(L=!0,b.reject(k,q))})}}},{1:1}],3:[function(c,v,I){(function(w){"use strict";typeof w.Promise!="function"&&(w.Promise=c(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(c,v,I){"use strict";var w=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};function R(e,r){if(!(e instanceof r))throw new TypeError("Cannot call a class as a function")}function b(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}var m=b();function T(){try{if(!m||!m.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),r=typeof fetch=="function"&&fetch.toString().indexOf("[native code")!==-1;return(!e||r)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}function V(e,r){e=e||[],r=r||{};try{return new Blob(e,r)}catch(o){if(o.name!=="TypeError")throw o;for(var t=typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder,i=new t,a=0;a<e.length;a+=1)i.append(e[a]);return i.getBlob(r.type)}}typeof Promise>"u"&&c(3);var p=Promise;function _(e,r){r&&e.then(function(t){r(null,t)},function(t){r(t)})}function C(e,r,t){typeof r=="function"&&e.then(r),typeof t=="function"&&e.catch(t)}function O(e){return typeof e!="string"&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function j(){if(arguments.length&&typeof arguments[arguments.length-1]=="function")return arguments[arguments.length-1]}var B="local-forage-detect-blob-support",z=void 0,F={},Re=Object.prototype.toString,Z="readonly",y="readwrite";function A(e){for(var r=e.length,t=new ArrayBuffer(r),i=new Uint8Array(t),a=0;a<r;a++)i[a]=e.charCodeAt(a);return t}function D(e){return new p(function(r){var t=e.transaction(B,y),i=V([""]);t.objectStore(B).put(i,"key"),t.onabort=function(a){a.preventDefault(),a.stopPropagation(),r(!1)},t.oncomplete=function(){var a=navigator.userAgent.match(/Chrome\/(\d+)/),o=navigator.userAgent.match(/Edge\//);r(o||!a||parseInt(a[1],10)>=43)}}).catch(function(){return!1})}function L(e){return typeof z=="boolean"?p.resolve(z):D(e).then(function(r){return z=r,z})}function U(e){var r=F[e.name],t={};t.promise=new p(function(i,a){t.resolve=i,t.reject=a}),r.deferredOperations.push(t),r.dbReady?r.dbReady=r.dbReady.then(function(){return t.promise}):r.dbReady=t.promise}function k(e){var r=F[e.name],t=r.deferredOperations.pop();if(t)return t.resolve(),t.promise}function $(e,r){var t=F[e.name],i=t.deferredOperations.pop();if(i)return i.reject(r),i.promise}function G(e,r){return new p(function(t,i){if(F[e.name]=F[e.name]||Ye(),e.db)if(r)U(e),e.db.close();else return t(e.db);var a=[e.name];r&&a.push(e.version);var o=m.open.apply(m,a);r&&(o.onupgradeneeded=function(u){var f=o.result;try{f.createObjectStore(e.storeName),u.oldVersion<=1&&f.createObjectStore(B)}catch(l){if(l.name==="ConstraintError")console.warn('The database "'+e.name+'" has been upgraded from version '+u.oldVersion+" to version "+u.newVersion+', but the storage "'+e.storeName+'" already exists.');else throw l}}),o.onerror=function(u){u.preventDefault(),i(o.error)},o.onsuccess=function(){var u=o.result;u.onversionchange=function(f){f.target.close()},t(u),k(e)}})}function q(e){return G(e,!1)}function ie(e){return G(e,!0)}function me(e,r){if(!e.db)return!0;var t=!e.db.objectStoreNames.contains(e.storeName),i=e.version<e.db.version,a=e.version>e.db.version;if(i&&(e.version!==r&&console.warn('The database "'+e.name+`" can't be downgraded from version `+e.db.version+" to version "+e.version+"."),e.version=e.db.version),a||t){if(t){var o=e.db.version+1;o>e.version&&(e.version=o)}return!0}return!1}function Ce(e){return new p(function(r,t){var i=new FileReader;i.onerror=t,i.onloadend=function(a){var o=btoa(a.target.result||"");r({__local_forage_encoded_blob:!0,data:o,type:e.type})},i.readAsBinaryString(e)})}function te(e){var r=A(atob(e.data));return V([r],{type:e.type})}function He(e){return e&&e.__local_forage_encoded_blob}function Lt(e){var r=this,t=r._initReady().then(function(){var i=F[r._dbInfo.name];if(i&&i.dbReady)return i.dbReady});return C(t,e,e),t}function Ot(e){U(e);for(var r=F[e.name],t=r.forages,i=0;i<t.length;i++){var a=t[i];a._dbInfo.db&&(a._dbInfo.db.close(),a._dbInfo.db=null)}return e.db=null,q(e).then(function(o){return e.db=o,me(e)?ie(e):o}).then(function(o){e.db=r.db=o;for(var u=0;u<t.length;u++)t[u]._dbInfo.db=o}).catch(function(o){throw $(e,o),o})}function K(e,r,t,i){i===void 0&&(i=1);try{var a=e.db.transaction(e.storeName,r);t(null,a)}catch(o){if(i>0&&(!e.db||o.name==="InvalidStateError"||o.name==="NotFoundError"))return p.resolve().then(function(){if(!e.db||o.name==="NotFoundError"&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),ie(e)}).then(function(){return Ot(e).then(function(){K(e,r,t,i-1)})}).catch(t);t(o)}}function Ye(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function Pt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=e[i];var a=F[t.name];a||(a=Ye(),F[t.name]=a),a.forages.push(r),r._initReady||(r._initReady=r.ready,r.ready=Lt);var o=[];function u(){return p.resolve()}for(var f=0;f<a.forages.length;f++){var l=a.forages[f];l!==r&&o.push(l._initReady().catch(u))}var d=a.forages.slice(0);return p.all(o).then(function(){return t.db=a.db,q(t)}).then(function(g){return t.db=g,me(t,r._defaultConfig.version)?ie(t):g}).then(function(g){t.db=a.db=g,r._dbInfo=t;for(var E=0;E<d.length;E++){var S=d[E];S!==r&&(S._dbInfo.db=t.db,S._dbInfo.version=t.version)}})}function Vt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.get(e);d.onsuccess=function(){var g=d.result;g===void 0&&(g=null),He(g)&&(g=te(g)),a(g)},d.onerror=function(){o(d.error)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Mt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.openCursor(),g=1;d.onsuccess=function(){var E=d.result;if(E){var S=E.value;He(S)&&(S=te(S));var N=e(S,E.key,g++);N!==void 0?a(N):E.continue()}else a()},d.onerror=function(){o(d.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function Bt(e,r,t){var i=this;e=O(e);var a=new p(function(o,u){var f;i.ready().then(function(){return f=i._dbInfo,Re.call(r)==="[object Blob]"?L(f.db).then(function(l){return l?r:Ce(r)}):r}).then(function(l){K(i._dbInfo,y,function(d,g){if(d)return u(d);try{var E=g.objectStore(i._dbInfo.storeName);l===null&&(l=void 0);var S=E.put(l,e);g.oncomplete=function(){l===void 0&&(l=null),o(l)},g.onabort=g.onerror=function(){var N=S.error?S.error:S.transaction.error;u(N)}}catch(N){u(N)}})}).catch(u)});return _(a,t),a}function Ft(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){K(t._dbInfo,y,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=l.delete(e);f.oncomplete=function(){a()},f.onerror=function(){o(d.error)},f.onabort=function(){var g=d.error?d.error:d.transaction.error;o(g)}}catch(g){o(g)}})}).catch(o)});return _(i,r),i}function Ut(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,y,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.clear();u.oncomplete=function(){i()},u.onabort=u.onerror=function(){var d=l.error?l.error:l.transaction.error;a(d)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function kt(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.count();l.onsuccess=function(){i(l.result)},l.onerror=function(){a(l.error)}}catch(d){a(d)}})}).catch(a)});return _(t,e),t}function Wt(e,r){var t=this,i=new p(function(a,o){if(e<0){a(null);return}t.ready().then(function(){K(t._dbInfo,Z,function(u,f){if(u)return o(u);try{var l=f.objectStore(t._dbInfo.storeName),d=!1,g=l.openKeyCursor();g.onsuccess=function(){var E=g.result;if(!E){a(null);return}e===0||d?a(E.key):(d=!0,E.advance(e))},g.onerror=function(){o(g.error)}}catch(E){o(E)}})}).catch(o)});return _(i,r),i}function $t(e){var r=this,t=new p(function(i,a){r.ready().then(function(){K(r._dbInfo,Z,function(o,u){if(o)return a(o);try{var f=u.objectStore(r._dbInfo.storeName),l=f.openKeyCursor(),d=[];l.onsuccess=function(){var g=l.result;if(!g){i(d);return}d.push(g.key),g.continue()},l.onerror=function(){a(l.error)}}catch(g){a(g)}})}).catch(a)});return _(t,e),t}function Gt(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;if(!e.name)a=p.reject("Invalid arguments");else{var o=e.name===t.name&&i._dbInfo.db,u=o?p.resolve(i._dbInfo.db):q(e).then(function(f){var l=F[e.name],d=l.forages;l.db=f;for(var g=0;g<d.length;g++)d[g]._dbInfo.db=f;return f});e.storeName?a=u.then(function(f){if(f.objectStoreNames.contains(e.storeName)){var l=f.version+1;U(e);var d=F[e.name],g=d.forages;f.close();for(var E=0;E<g.length;E++){var S=g[E];S._dbInfo.db=null,S._dbInfo.version=l}var N=new p(function(x,M){var P=m.open(e.name,l);P.onerror=function(H){var se=P.result;se.close(),M(H)},P.onupgradeneeded=function(){var H=P.result;H.deleteObjectStore(e.storeName)},P.onsuccess=function(){var H=P.result;H.close(),x(H)}});return N.then(function(x){d.db=x;for(var M=0;M<g.length;M++){var P=g[M];P._dbInfo.db=x,k(P._dbInfo)}}).catch(function(x){throw($(e,x)||p.resolve()).catch(function(){}),x})}}):a=u.then(function(f){U(e);var l=F[e.name],d=l.forages;f.close();for(var g=0;g<d.length;g++){var E=d[g];E._dbInfo.db=null}var S=new p(function(N,x){var M=m.deleteDatabase(e.name);M.onerror=function(){var P=M.result;P&&P.close(),x(M.error)},M.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},M.onsuccess=function(){var P=M.result;P&&P.close(),N(P)}});return S.then(function(N){l.db=N;for(var x=0;x<d.length;x++){var M=d[x];k(M._dbInfo)}}).catch(function(N){throw($(e,N)||p.resolve()).catch(function(){}),N})})}return _(a,r),a}var Ht={_driver:"asyncStorage",_initStorage:Pt,_support:T(),iterate:Mt,getItem:Vt,setItem:Bt,removeItem:Ft,clear:Ut,length:kt,key:Wt,keys:$t,dropInstance:Gt};function Yt(){return typeof openDatabase=="function"}var X="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",jt="~~local_forage_type~",je=/^~~local_forage_type~([^~]+)~/,ge="__lfsc__:",Ae=ge.length,Ne="arbf",xe="blob",ze="si08",qe="ui08",Ke="uic8",Xe="si16",Je="si32",Qe="ur16",Ze="ui32",et="fl32",tt="fl64",rt=Ae+Ne.length,nt=Object.prototype.toString;function ot(e){var r=e.length*.75,t=e.length,i,a=0,o,u,f,l;e[e.length-1]==="="&&(r--,e[e.length-2]==="="&&r--);var d=new ArrayBuffer(r),g=new Uint8Array(d);for(i=0;i<t;i+=4)o=X.indexOf(e[i]),u=X.indexOf(e[i+1]),f=X.indexOf(e[i+2]),l=X.indexOf(e[i+3]),g[a++]=o<<2|u>>4,g[a++]=(u&15)<<4|f>>2,g[a++]=(f&3)<<6|l&63;return d}function Le(e){var r=new Uint8Array(e),t="",i;for(i=0;i<r.length;i+=3)t+=X[r[i]>>2],t+=X[(r[i]&3)<<4|r[i+1]>>4],t+=X[(r[i+1]&15)<<2|r[i+2]>>6],t+=X[r[i+2]&63];return r.length%3===2?t=t.substring(0,t.length-1)+"=":r.length%3===1&&(t=t.substring(0,t.length-2)+"=="),t}function zt(e,r){var t="";if(e&&(t=nt.call(e)),e&&(t==="[object ArrayBuffer]"||e.buffer&&nt.call(e.buffer)==="[object ArrayBuffer]")){var i,a=ge;e instanceof ArrayBuffer?(i=e,a+=Ne):(i=e.buffer,t==="[object Int8Array]"?a+=ze:t==="[object Uint8Array]"?a+=qe:t==="[object Uint8ClampedArray]"?a+=Ke:t==="[object Int16Array]"?a+=Xe:t==="[object Uint16Array]"?a+=Qe:t==="[object Int32Array]"?a+=Je:t==="[object Uint32Array]"?a+=Ze:t==="[object Float32Array]"?a+=et:t==="[object Float64Array]"?a+=tt:r(new Error("Failed to get type for BinaryArray"))),r(a+Le(i))}else if(t==="[object Blob]"){var o=new FileReader;o.onload=function(){var u=jt+e.type+"~"+Le(this.result);r(ge+xe+u)},o.readAsArrayBuffer(e)}else try{r(JSON.stringify(e))}catch(u){console.error("Couldn't convert value into a JSON string: ",e),r(null,u)}}function qt(e){if(e.substring(0,Ae)!==ge)return JSON.parse(e);var r=e.substring(rt),t=e.substring(Ae,rt),i;if(t===xe&&je.test(r)){var a=r.match(je);i=a[1],r=r.substring(a[0].length)}var o=ot(r);switch(t){case Ne:return o;case xe:return V([o],{type:i});case ze:return new Int8Array(o);case qe:return new Uint8Array(o);case Ke:return new Uint8ClampedArray(o);case Xe:return new Int16Array(o);case Qe:return new Uint16Array(o);case Je:return new Int32Array(o);case Ze:return new Uint32Array(o);case et:return new Float32Array(o);case tt:return new Float64Array(o);default:throw new Error("Unkown type: "+t)}}var Oe={serialize:zt,deserialize:qt,stringToBuffer:ot,bufferToString:Le};function it(e,r,t,i){e.executeSql("CREATE TABLE IF NOT EXISTS "+r.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],t,i)}function Kt(e){var r=this,t={db:null};if(e)for(var i in e)t[i]=typeof e[i]!="string"?e[i].toString():e[i];var a=new p(function(o,u){try{t.db=openDatabase(t.name,String(t.version),t.description,t.size)}catch(f){return u(f)}t.db.transaction(function(f){it(f,t,function(){r._dbInfo=t,o()},function(l,d){u(d)})},u)});return t.serializer=Oe,a}function J(e,r,t,i,a,o){e.executeSql(t,i,a,function(u,f){f.code===f.SYNTAX_ERR?u.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[r.storeName],function(l,d){d.rows.length?o(l,f):it(l,r,function(){l.executeSql(t,i,a,o)},o)},o):o(u,f)},o)}function Xt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName+" WHERE key = ? LIMIT 1",[e],function(l,d){var g=d.rows.length?d.rows.item(0).value:null;g&&(g=u.serializer.deserialize(g)),a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function Jt(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT * FROM "+u.storeName,[],function(l,d){for(var g=d.rows,E=g.length,S=0;S<E;S++){var N=g.item(S),x=N.value;if(x&&(x=u.serializer.deserialize(x)),x=e(x,N.key,S+1),x!==void 0){a(x);return}}a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function at(e,r,t,i){var a=this;e=O(e);var o=new p(function(u,f){a.ready().then(function(){r===void 0&&(r=null);var l=r,d=a._dbInfo;d.serializer.serialize(r,function(g,E){E?f(E):d.db.transaction(function(S){J(S,d,"INSERT OR REPLACE INTO "+d.storeName+" (key, value) VALUES (?, ?)",[e,g],function(){u(l)},function(N,x){f(x)})},function(S){if(S.code===S.QUOTA_ERR){if(i>0){u(at.apply(a,[e,l,t,i-1]));return}f(S)}})})}).catch(f)});return _(o,t),o}function Qt(e,r,t){return at.apply(this,[e,r,t,1])}function Zt(e,r){var t=this;e=O(e);var i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"DELETE FROM "+u.storeName+" WHERE key = ?",[e],function(){a()},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function er(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"DELETE FROM "+o.storeName,[],function(){i()},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function tr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT COUNT(key) as c FROM "+o.storeName,[],function(f,l){var d=l.rows.item(0).c;i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function rr(e,r){var t=this,i=new p(function(a,o){t.ready().then(function(){var u=t._dbInfo;u.db.transaction(function(f){J(f,u,"SELECT key FROM "+u.storeName+" WHERE id = ? LIMIT 1",[e+1],function(l,d){var g=d.rows.length?d.rows.item(0).key:null;a(g)},function(l,d){o(d)})})}).catch(o)});return _(i,r),i}function nr(e){var r=this,t=new p(function(i,a){r.ready().then(function(){var o=r._dbInfo;o.db.transaction(function(u){J(u,o,"SELECT key FROM "+o.storeName,[],function(f,l){for(var d=[],g=0;g<l.rows.length;g++)d.push(l.rows.item(g).key);i(d)},function(f,l){a(l)})})}).catch(a)});return _(t,e),t}function or(e){return new p(function(r,t){e.transaction(function(i){i.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],function(a,o){for(var u=[],f=0;f<o.rows.length;f++)u.push(o.rows.item(f).name);r({db:e,storeNames:u})},function(a,o){t(o)})},function(i){t(i)})})}function ir(e,r){r=j.apply(this,arguments);var t=this.config();e=typeof e!="function"&&e||{},e.name||(e.name=e.name||t.name,e.storeName=e.storeName||t.storeName);var i=this,a;return e.name?a=new p(function(o){var u;e.name===t.name?u=i._dbInfo.db:u=openDatabase(e.name,"","",0),e.storeName?o({db:u,storeNames:[e.storeName]}):o(or(u))}).then(function(o){return new p(function(u,f){o.db.transaction(function(l){function d(N){return new p(function(x,M){l.executeSql("DROP TABLE IF EXISTS "+N,[],function(){x()},function(P,H){M(H)})})}for(var g=[],E=0,S=o.storeNames.length;E<S;E++)g.push(d(o.storeNames[E]));p.all(g).then(function(){u()}).catch(function(N){f(N)})},function(l){f(l)})})}):a=p.reject("Invalid arguments"),_(a,r),a}var ar={_driver:"webSQLStorage",_initStorage:Kt,_support:Yt(),iterate:Jt,getItem:Xt,setItem:Qt,removeItem:Zt,clear:er,length:tr,key:rr,keys:nr,dropInstance:ir};function sr(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}function st(e,r){var t=e.name+"/";return e.storeName!==r.storeName&&(t+=e.storeName+"/"),t}function ur(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}function cr(){return!ur()||localStorage.length>0}function fr(e){var r=this,t={};if(e)for(var i in e)t[i]=e[i];return t.keyPrefix=st(e,r._defaultConfig),cr()?(r._dbInfo=t,t.serializer=Oe,p.resolve()):p.reject()}function lr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo.keyPrefix,a=localStorage.length-1;a>=0;a--){var o=localStorage.key(a);o.indexOf(i)===0&&localStorage.removeItem(o)}});return _(t,e),t}function dr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo,o=localStorage.getItem(a.keyPrefix+e);return o&&(o=a.serializer.deserialize(o)),o});return _(i,r),i}function mr(e,r){var t=this,i=t.ready().then(function(){for(var a=t._dbInfo,o=a.keyPrefix,u=o.length,f=localStorage.length,l=1,d=0;d<f;d++){var g=localStorage.key(d);if(g.indexOf(o)===0){var E=localStorage.getItem(g);if(E&&(E=a.serializer.deserialize(E)),E=e(E,g.substring(u),l++),E!==void 0)return E}}});return _(i,r),i}function gr(e,r){var t=this,i=t.ready().then(function(){var a=t._dbInfo,o;try{o=localStorage.key(e)}catch{o=null}return o&&(o=o.substring(a.keyPrefix.length)),o});return _(i,r),i}function pr(e){var r=this,t=r.ready().then(function(){for(var i=r._dbInfo,a=localStorage.length,o=[],u=0;u<a;u++){var f=localStorage.key(u);f.indexOf(i.keyPrefix)===0&&o.push(f.substring(i.keyPrefix.length))}return o});return _(t,e),t}function hr(e){var r=this,t=r.keys().then(function(i){return i.length});return _(t,e),t}function vr(e,r){var t=this;e=O(e);var i=t.ready().then(function(){var a=t._dbInfo;localStorage.removeItem(a.keyPrefix+e)});return _(i,r),i}function yr(e,r,t){var i=this;e=O(e);var a=i.ready().then(function(){r===void 0&&(r=null);var o=r;return new p(function(u,f){var l=i._dbInfo;l.serializer.serialize(r,function(d,g){if(g)f(g);else try{localStorage.setItem(l.keyPrefix+e,d),u(o)}catch(E){(E.name==="QuotaExceededError"||E.name==="NS_ERROR_DOM_QUOTA_REACHED")&&f(E),f(E)}})})});return _(a,t),a}function Er(e,r){if(r=j.apply(this,arguments),e=typeof e!="function"&&e||{},!e.name){var t=this.config();e.name=e.name||t.name,e.storeName=e.storeName||t.storeName}var i=this,a;return e.name?a=new p(function(o){e.storeName?o(st(e,i._defaultConfig)):o(e.name+"/")}).then(function(o){for(var u=localStorage.length-1;u>=0;u--){var f=localStorage.key(u);f.indexOf(o)===0&&localStorage.removeItem(f)}}):a=p.reject("Invalid arguments"),_(a,r),a}var _r={_driver:"localStorageWrapper",_initStorage:fr,_support:sr(),iterate:mr,getItem:dr,setItem:yr,removeItem:vr,clear:lr,length:hr,key:gr,keys:pr,dropInstance:Er},br=function(r,t){return r===t||typeof r=="number"&&typeof t=="number"&&isNaN(r)&&isNaN(t)},Tr=function(r,t){for(var i=r.length,a=0;a<i;){if(br(r[a],t))return!0;a++}return!1},ut=Array.isArray||function(e){return Object.prototype.toString.call(e)==="[object Array]"},ae={},ct={},re={INDEXEDDB:Ht,WEBSQL:ar,LOCALSTORAGE:_r},wr=[re.INDEXEDDB._driver,re.WEBSQL._driver,re.LOCALSTORAGE._driver],pe=["dropInstance"],Pe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(pe),Ir={description:"",driver:wr.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function Sr(e,r){e[r]=function(){var t=arguments;return e.ready().then(function(){return e[r].apply(e,t)})}}function Ve(){for(var e=1;e<arguments.length;e++){var r=arguments[e];if(r)for(var t in r)r.hasOwnProperty(t)&&(ut(r[t])?arguments[0][t]=r[t].slice():arguments[0][t]=r[t])}return arguments[0]}var Dr=(function(){function e(r){R(this,e);for(var t in re)if(re.hasOwnProperty(t)){var i=re[t],a=i._driver;this[t]=a,ae[a]||this.defineDriver(i)}this._defaultConfig=Ve({},Ir),this._config=Ve({},this._defaultConfig,r),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch(function(){})}return e.prototype.config=function(t){if((typeof t>"u"?"undefined":w(t))==="object"){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var i in t){if(i==="storeName"&&(t[i]=t[i].replace(/\W/g,"_")),i==="version"&&typeof t[i]!="number")return new Error("Database version must be a number.");this._config[i]=t[i]}return"driver"in t&&t.driver?this.setDriver(this._config.driver):!0}else return typeof t=="string"?this._config[t]:this._config},e.prototype.defineDriver=function(t,i,a){var o=new p(function(u,f){try{var l=t._driver,d=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!t._driver){f(d);return}for(var g=Pe.concat("_initStorage"),E=0,S=g.length;E<S;E++){var N=g[E],x=!Tr(pe,N);if((x||t[N])&&typeof t[N]!="function"){f(d);return}}var M=function(){for(var se=function(Ar){return function(){var Nr=new Error("Method "+Ar+" is not implemented by the current driver"),ft=p.reject(Nr);return _(ft,arguments[arguments.length-1]),ft}},Me=0,Cr=pe.length;Me<Cr;Me++){var Be=pe[Me];t[Be]||(t[Be]=se(Be))}};M();var P=function(se){ae[l]&&console.info("Redefining LocalForage driver: "+l),ae[l]=t,ct[l]=se,u()};"_support"in t?t._support&&typeof t._support=="function"?t._support().then(P,f):P(!!t._support):P(!0)}catch(H){f(H)}});return C(o,i,a),o},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(t,i,a){var o=ae[t]?p.resolve(ae[t]):p.reject(new Error("Driver not found."));return C(o,i,a),o},e.prototype.getSerializer=function(t){var i=p.resolve(Oe);return C(i,t),i},e.prototype.ready=function(t){var i=this,a=i._driverSet.then(function(){return i._ready===null&&(i._ready=i._initDriver()),i._ready});return C(a,t,t),a},e.prototype.setDriver=function(t,i,a){var o=this;ut(t)||(t=[t]);var u=this._getSupportedDrivers(t);function f(){o._config.driver=o.driver()}function l(E){return o._extend(E),f(),o._ready=o._initStorage(o._config),o._ready}function d(E){return function(){var S=0;function N(){for(;S<E.length;){var x=E[S];return S++,o._dbInfo=null,o._ready=null,o.getDriver(x).then(l).catch(N)}f();var M=new Error("No available storage method found.");return o._driverSet=p.reject(M),o._driverSet}return N()}}var g=this._driverSet!==null?this._driverSet.catch(function(){return p.resolve()}):p.resolve();return this._driverSet=g.then(function(){var E=u[0];return o._dbInfo=null,o._ready=null,o.getDriver(E).then(function(S){o._driver=S._driver,f(),o._wrapLibraryMethodsWithReady(),o._initDriver=d(u)})}).catch(function(){f();var E=new Error("No available storage method found.");return o._driverSet=p.reject(E),o._driverSet}),C(this._driverSet,i,a),this._driverSet},e.prototype.supports=function(t){return!!ct[t]},e.prototype._extend=function(t){Ve(this,t)},e.prototype._getSupportedDrivers=function(t){for(var i=[],a=0,o=t.length;a<o;a++){var u=t[a];this.supports(u)&&i.push(u)}return i},e.prototype._wrapLibraryMethodsWithReady=function(){for(var t=0,i=Pe.length;t<i;t++)Sr(this,Pe[t])},e.prototype.createInstance=function(t){return new e(t)},e})(),Rr=new Dr;v.exports=Rr},{3:3}]},{},[4])(4)})});var wt=dt((Tt,we)=>{"use strict";(function(s){"use strict";var n={};n.VERSION="1.6.1";var h,c={},v=function(m,T){return function(){return T.apply(m,arguments)}},I=function(){var m=arguments,T=m[0],V,p;for(p=1;p<m.length;p++)for(V in m[p])!(V in T)&&m[p].hasOwnProperty(V)&&(T[V]=m[p][V]);return T},w=function(m,T){return{value:m,name:T}};n.TRACE=w(1,"TRACE"),n.DEBUG=w(2,"DEBUG"),n.INFO=w(3,"INFO"),n.TIME=w(4,"TIME"),n.WARN=w(5,"WARN"),n.ERROR=w(8,"ERROR"),n.OFF=w(99,"OFF");var R=function(m){this.context=m,this.setLevel(m.filterLevel),this.log=this.info};R.prototype={setLevel:function(m){m&&"value"in m&&(this.context.filterLevel=m)},getLevel:function(){return this.context.filterLevel},enabledFor:function(m){var T=this.context.filterLevel;return m.value>=T.value},trace:function(){this.invoke(n.TRACE,arguments)},debug:function(){this.invoke(n.DEBUG,arguments)},info:function(){this.invoke(n.INFO,arguments)},warn:function(){this.invoke(n.WARN,arguments)},error:function(){this.invoke(n.ERROR,arguments)},time:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"start"])},timeEnd:function(m){typeof m=="string"&&m.length>0&&this.invoke(n.TIME,[m,"end"])},invoke:function(m,T){h&&this.enabledFor(m)&&h(T,I({level:m},this.context))}};var b=new R({filterLevel:n.OFF});(function(){var m=n;m.enabledFor=v(b,b.enabledFor),m.trace=v(b,b.trace),m.debug=v(b,b.debug),m.time=v(b,b.time),m.timeEnd=v(b,b.timeEnd),m.info=v(b,b.info),m.warn=v(b,b.warn),m.error=v(b,b.error),m.log=m.info})(),n.setHandler=function(m){h=m},n.setLevel=function(m){b.setLevel(m);for(var T in c)c.hasOwnProperty(T)&&c[T].setLevel(m)},n.getLevel=function(){return b.getLevel()},n.get=function(m){return c[m]||(c[m]=new R(I({name:m},b.context)))},n.createDefaultHandler=function(m){m=m||{},m.formatter=m.formatter||function(_,C){C.name&&_.unshift("["+C.name+"]")};var T={},V=function(p,_){Function.prototype.apply.call(p,console,_)};return typeof console>"u"?function(){}:function(p,_){p=Array.prototype.slice.call(p);var C=console.log,O;_.level===n.TIME?(O=(_.name?"["+_.name+"] ":"")+p[0],p[1]==="start"?console.time?console.time(O):T[O]=new Date().getTime():console.timeEnd?console.timeEnd(O):V(C,[O+": "+(new Date().getTime()-T[O])+"ms"])):(_.level===n.WARN&&console.warn?C=console.warn:_.level===n.ERROR&&console.error?C=console.error:_.level===n.INFO&&console.info?C=console.info:_.level===n.DEBUG&&console.debug?C=console.debug:_.level===n.TRACE&&console.trace&&(C=console.trace),m.formatter(p,_),V(C,p))}},n.useDefaults=function(m){n.setLevel(m&&m.defaultLevel||n.DEBUG),n.setHandler(n.createDefaultHandler(m))},n.setDefaults=n.useDefaults,typeof define=="function"&&define.amd?define(n):typeof we<"u"&&we.exports?we.exports=n:(n._prevLogger=s.Logger,n.noConflict=function(){return s.Logger=n._prevLogger,n},s.Logger=n)})(Tt)});var Fe="13.1.12";var Lr=Fe.split("-")[0].split(".").slice(0,3).map(s=>s.padStart(2,"0")).join(""),qr="WEB",gt="CooeeSDK",Q=Fe,Kr=parseInt(Lr,10);var Xr=["collection","product","cart"],Jr=[{identifier:"#flo-checkout-wrapper",gateway:"Shopflow"},{identifier:"#fastrr-main-container",gateway:"Shiprocket"},{identifier:"#gokwik-modal-wrapper",gateway:"Gokwik"},{identifier:"#zecpe",gateway:"Ecom 360"}],Qr=["View Item","View Cart","View Collection"],Zr=["CE Screen View","View Collection","View Item","View Cart"],pt="https://cdn.jsdelivr.net/npm/swiper@11";var Ue=`https://cdn.jsdelivr.net/npm/@letscooee/web-sdk@${Q}/dist`,ce={apiURL:"https://api.sdk.letscooee.com",debug:!1,mode:"production",baseURL:Ue,styleURL:`${Ue}/widget.min.css`,widgetURL:`${Ue}/widget.min.js`,swiperStyleURL:`${pt}/swiper-bundle.min.css`};var ve=class{static ISO_WITHOUT_MS_REGEX=new RegExp(/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/);static isObject(n){return typeof n=="object"&&!Array.isArray(n)&&n!==null}static parseToAny(n){try{return JSON.parse(n.toString())}catch{}return n.toString().match(this.ISO_WITHOUT_MS_REGEX)?new Date(n.toString()):n}static async sleep(n){return new Promise(h=>setTimeout(h,n))}static hasKeys(n){return n?Object.keys(n).length>=1:!1}static convertObjectToArray(n,h){return h.reduce((c,v)=>(n.hasOwnProperty(v)&&n[v]!=null&&c.push({[v]:n[v]}),c),[])}static removeNullUndefinedKeys(n){return Object.keys(n).reduce((h,c)=>(n[c]!==null&&n[c]!==void 0&&(h[c]=n[c]),h),{})}static stringify(n){return JSON.stringify(n,function(h,c){return c===void 0?null:c})}};var ye=class{gaEnabled;gaMeasurementID;pixelPush;website;currencyCount;money;storefrontToken;skipItemAttribute;widgetCustomisation;currency;static get(){return window.CooeeSDK.config}update(n){return n??={},this.gaEnabled=n.gaEnabled,this.gaMeasurementID=n.gaMeasurementID,this.pixelPush=n.pixelPush,this.website=n.website??{},this.currencyCount=n.currencyCount??0,this.money=n.money,this.currency=n.currency,this.storefrontToken=n.storefrontToken,this.skipItemAttribute=n.skipItemAttribute,this.widgetCustomisation=n.widgetCustomisation,this}};var We=mt(vt());function Ee(s){return We.default.createInstance({name:"lc",storeName:s,driver:We.default.LOCALSTORAGE})}var ne=class{static storage;static async get(n,h){return await this.storage?.getItem(n)??h}static set(n,h){return this.storage?.setItem(n,h)}static remove(n){return this.storage?.removeItem(n)}static clear(){return this.storage?.clear()}static getForage(){return this.storage}};var fe=class fe extends ne{};he(fe,"storeName","ses"),fe.storage=Ee(fe.storeName);var _e=fe;var le=class le extends ne{};he(le,"storeName","usr"),le.storage=Ee(le.storeName);var de=le;var be=class{static format(n,h){let c=/{{\s*(\w+)\s*}}/;return h.replace(c,(v,I)=>{switch(I){case"amount":return this.formatWithDelimiters(n,2);case"amount_no_decimals":return this.formatWithDelimiters(n,0);case"amount_with_comma_separator":return this.formatWithDelimiters(n,2,".",",");case"amount_no_decimals_with_comma_separator":return this.formatWithDelimiters(n,0,".",",");case"amount_with_apostrophe_separator":return this.formatWithDelimiters(n,2,"'",".");case"amount_no_decimals_with_space_separator":return this.formatWithDelimiters(n,0," ");case"amount_with_space_separator":return this.formatWithDelimiters(n,2," ",",");case"amount_with_period_and_space_separator":return this.formatWithDelimiters(n,2," ",".");default:return v}})}static formatWithDelimiters(n,h=2,c=",",v="."){if(isNaN(n)||n==null)return"0";let w=(n/100).toFixed(h).split("."),R=w[0].replace(/(\d)(?=(\d\d\d)+(?!\d))/g,"$1"+c),b=w[1]?v+w[1]:"";return R+b}};function yt(s){if(s<0)return`${s}ms`;let n=new Date(Date.UTC(0,0,0,0,0,0,s)),h=[];return n.getUTCMinutes()&&h.push(n.getUTCMinutes()+"m"),n.getUTCSeconds()&&h.push(n.getUTCSeconds()+"s"),n.getUTCMilliseconds()&&h.push(n.getUTCMilliseconds()+"ms"),h.length||h.push("0ms"),h.join(" ")}function $e(){return window.CooeeSDK.runtimeData}function yn(){return yt(Date.now()-$e().sdkLoadTime.getTime())}function Nn(s){try{return new URL(s)}catch{return}}function xn(s){return!s||s==="null"||s==="undefined"}function Ln(s,n){let h=s.indexOf(n);return h===-1?!1:(s.splice(h,1),!0)}function On(s,n,h){return{[s]:Or(n,h),[s+"_wo_currency"]:n}}function Or(s,n){if(s==0&&n)return"Free";let h=$e(),c=ye.get(),v=h.shopCurrencyCode||c.currency,I=h.currencyCode;I||Y.warn("Currency code is not set in RuntimeData");let w=c.money?.format??h.moneyFormat,R;if(w&&v===I)R=be.format(s*100,w);else{let b;try{b=new Intl.NumberFormat(Et(),{style:"currency",currency:I||v,minimumFractionDigits:0,maximumFractionDigits:2})}catch(m){return Ge(m,"format-currency",{extra:{currentCurrency:I,shopCurrency:v}}),""}R=b.format(s),R=R.replace("\u20B9","Rs. "),c.money?.showCurrency&&I!=="INR"&&(R=R.concat(` ${I}`))}return R}function Pn(s){let n=Et();try{return new Intl.NumberFormat(n,{notation:"compact"}).format(s)}catch(h){return Ge(h,"format-number",{extra:{lang:n,value:s}}),s.toString()}}function Et(){let s="en";return typeof navigator<"u"&&(navigator.languages!==void 0&&navigator.languages.length>0?s=navigator.languages[0]:navigator.language&&(s=navigator.language)),s=s.split(";")[0],s=s.split("-")[0],s||"en"}var Te;function _t(){if(Te)return Te;try{return Te=Intl.DateTimeFormat().resolvedOptions().timeZone,Te}catch{return""}}function bt(s){document.readyState!=="loading"?s():document.addEventListener("DOMContentLoaded",s)}function Vn(s){let n=document.createElement("span");n.id="snackbar",n.innerText=s,document.body.appendChild(n),n.className="show",setTimeout(()=>{n.classList.remove("show"),document.body.removeChild(n)},5e3)}async function Pr(s,n=7,h=document){let c=1,v=document.querySelectorAll("nonexistent-tag");for(;c<=n;){let I=Math.min(50*2**c,1e3);if(c>1&&await ve.sleep(I),v=h.querySelectorAll(s),v.length)return Y.verbose(`Attempt ${c}: ${v.length} elements found with ${s}`),v;Y.verbose(`Attempt ${c}: Elements not found with ${s}. Will retry after ${I}ms.`),c++}return Y.verbose(`\u26A0\uFE0F Max attempts reached. Element not found with ${s}.`),v}async function Mn(s,n=10,h=document){return(await Pr(s,n,h)).item(0)}async function Vr(s){let[n,h,c]=await Promise.all([de.get("did"),_e.get("id",""),de.get("sessionNumber",1)]),v={letscooee_did:n,letscooee_sid:h,letscooee_sn:`${c}`,__letscooee_time:new Date().toLocaleString()};return s&&(v.__letscooee_via=s),v}async function Bn(s){let n=await Vr(s);return Object.entries(n).map(([h,c])=>({key:h,value:c.toString()}))}function Fn(s,n,h,c=!1){Object.defineProperty(s,n,{enumerable:!1,configurable:!1,writable:c,value:h})}function Un(s){if(s%100>=11&&s%100<=13)return s+"th";switch(s%10){case 1:return s+"st";case 2:return s+"nd";case 3:return s+"rd";default:return s+"th"}}var W=mt(wt());var Y=class{static debuggerEl;static infoLogs=[];static log(...n){W.default.info(...n)}static verbose(...n){W.default.debug(...n)}static error(...n){W.default.error(...n)}static warn(...n){W.default.warn(...n)}static info(...n){W.default.info(...n),this.infoLogs.push({time:new Date,message:n.join(" ")}),this.addToDebugger()}static trace(...n){W.default.trace(...n)}static addToDebugger(){sessionStorage.cooeeDebug&&(this.debuggerEl=this.debuggerEl??document.querySelector("cooee-debugger"),this.debuggerEl&&this.debuggerEl&&(this.debuggerEl.logs=[...this.infoLogs]))}};function Hn(s=gt){W.default.useDefaults({formatter:function(n){n.unshift(`${s} (v${Q}):`)}}),Mr()&&(localStorage.cooeeLogLevel="TRACE"),localStorage.cooeeLogLevel?W.default.setLevel(W.default[localStorage.cooeeLogLevel]):W.default.setLevel(ce.debug?W.default.TRACE:W.default.OFF)}function Mr(){let s=It();return s==="1"||s==="on"}function It(){return new URL(location.href).searchParams?.get("cooee-debug")}function Yn(){let s=["display: inline-block;","font-size: 14px;","background: linear-gradient(90deg, #d52dc8 25%, #2179e2 82%);","color: white;","padding: 4px;","border-radius: 4px;"].join(" "),n=`
|
|
2
|
+
`;n+=`\u{1F4E3} Drive higher conversions with AI-powered onsite engagement
|
|
3
|
+
`,n+=`\u{1F50D} Track real-time visitor intent & optimize engagement
|
|
4
|
+
`,n+=`\u{1F4CA} Improve Meta Ads ROAS with intent-driven campaigns
|
|
5
|
+
`,n+=`\u{1F6CD}\uFE0F Boost purchases & repeat sales effortlessly
|
|
6
|
+
`,n+=`
|
|
7
|
+
|
|
8
|
+
`,n+="Learn more: https://www.letscooee.com",console.group("%c Elevate your ecommerce experience with Cooee \u{1F680} ",s),console.log(`%c${n}`,"font-size: 13px; line-height: 1.8;"),console.log(`SDK v${Q}`),console.groupEnd(),Y.info(`SDK v${Q} loaded`)}function jn(){let s=localStorage.getItem("cooeeDebugTill"),n=It();if(n==="1"||n==="on"){let h=Fr();s||(s=h.toString(),localStorage.setItem("cooeeDebugTill",s))}n==="on"?sessionStorage.cooeeDebug="1":n==="off"&&sessionStorage.removeItem("cooeeDebug"),sessionStorage.cooeeDebug&&Br(),s&&new Date(+s)<new Date&&localStorage.removeItem("cooeeDebugTill")}function Br(){let s=document.createElement("cooee-debugger");bt(()=>{document.body.appendChild(s)})}function Fr(){return new Date().getTime()+360*60*1e3}var St=5,Ur=500,oe=class extends Error{request;response;status;requestBody;responseText;constructor(n){super(n),this.name="FetchError",Object.setPrototypeOf(this,new.target.prototype)}is40x(){return!!this.response&&this.response.status>=400&&this.response.status<500}};async function Kn(s,n){let h=Date.now(),c;try{c=await kr(s,n)}catch{}let v=c?new Request(c.url,{method:n?.method||"GET"}):new Request(s,n);if(!c||!c.ok){let m="Failed to fetch";c?.statusText&&(m+=`: ${c.statusText}`);let T=new oe(m);throw T.request=v,T.response=c?.clone(),T.status=c?.status,T.requestBody=n?.body,T.responseText=await Dt(c),T}let I,w=(c.headers.get("content-type")||"").toLowerCase(),R=c.headers.get("content-length"),b=n?.method?.toUpperCase()||"GET";if(c.status===204||c.status===205||b==="HEAD"||R==="0")I=void 0;else if(w.includes("application/json")||w.includes("application/problem+json")||w.includes("text/javascript"))try{I=await c.clone().json()}catch(m){let T=new oe(`Failed to parse JSON response: ${m?.message}`);throw T.request=v,T.response=c.clone(),T.status=c.status,T.requestBody=n?.body,T.responseText=await Dt(c),T}else w.includes("text/")||w.includes("image/svg+xml")?I=await c.text():I=await c.arrayBuffer();return{data:I,status:c.status,statusText:c.statusText,headers:c.headers,timeTakenMs:Date.now()-h,options:n,request:v}}async function kr(s,n){let h=null,c;for(let v=0;v<=St;v++){try{let I=new Headers(n?.headers);(s.includes("letscooee.com")||s.includes("localhost"))&&I.set("Cooee-Retry-Attempt",v.toString());let w=lt(ee({},n),{headers:I});if(c=await fetch(s,w),c.ok||c.status>=400&&c.status<500)return c;h=new Error(`Server error: ${c.status} ${c.statusText}`)}catch(I){h=I instanceof Error?I:new Error(String(I))}if(v<St){let I=Math.pow(2,v)*Ur;Y.info(`Request to ${s} failed. Retrying in ${I}ms...`),await new Promise(w=>setTimeout(w,I))}}if(c&&!c.ok)return c;throw h||new Error("Request failed after retries")}async function Dt(s){if(s){try{return s=s.clone(),await s.json()}catch{}try{return await s.text()}catch{}}}var Ie={},Se,De,Ct,At,Rt;async function Nt(){if(!De)return Rt??=Wr(),Rt}async function Wr(){let{BrowserClient:s,Scope:n,defaultStackParser:h,getDefaultIntegrations:c,makeFetchTransport:v}=await import("./esm-EYV26LOR.js");At=n;let I=c({}).filter(w=>!["BrowserApiErrors","Breadcrumbs","GlobalHandlers"].includes(w.name));De=new s({dsn:"https://1bc3dda4c861f60cd6be1b67584f4bc6@o559187.ingest.us.sentry.io/4507626484203520",transport:v,stackParser:h,integrations:I,environment:ce.mode,release:`web-sdk@${Q}`,debug:ce.debug,sampleRate:.5}),De.init()}function Ge(s,n,h){Y.error(`${n}:`,s),Nt().then(()=>{let c=xt(h);if(c.setTag("operation",n),s instanceof oe){$r(c,s,n);return}c.captureException(s)})}function no(s,n,h){Nt().then(()=>{xt(h).captureMessage(s,n??"error")})}function $r(s,n,h){if(Gr(s,n),n.response){let c=n.response,v=n.responseText;s.setTag("error.message",n.message),c.status!=null&&s.setTag("http.status_code",c.status),c.statusText&&s.setTag("http.status_text",c.statusText),v&&typeof v=="object"&&"error"in v&&(s.setTag("http.error_code",v.error.code),s.setTag("http.error_message",v.error.message)),s.setExtras({responseText:n.responseText,statusText:c.statusText,responseType:c.type,redirected:c.redirected,responseUrl:c.url,originalError:n.message}),s.captureMessage(`${h} failed with ${c.status}`,"error");return}if(n.request){s.captureMessage(`No response was received for ${h}`,"error");return}}function Gr(s,n){let h=n.request;if(!h)return;s.setExtras({body:n.requestBody,headers:h.headers,method:h.method,url:h.url});let c=h.headers?.get("Cooee-Retry-Attempt");c!==null&&s.setTag("retry.attempt",c)}function oo(s){Ct=s}function io(s,n){Ie[s]=ee(ee({},Ie[s]),n)}function ao(s){Se=ee(ee({},Se),s)}function xt(s){s??={};let{extra:n,tags:h}=s,c=new At;if(c.setClient(De),c.setUser(Ct),s.triggerContext&&!s.engagementTrigger&&(s.engagementTrigger=s.triggerContext.triggerData),s.engagementTrigger){let v=s.engagementTrigger;c.setTags({"engagement.id":v.engagementID,"engagement.short_id":v.shortID,"engagement.objective":v.objective,"engagement.delivery_type":v.onsiteDeliveryType,"engagement.content_id":v.contentID,"engagement.variation":v.variation,"engagement.currency":v.currency})}return n&&c.setExtras(n),h&&c.setTags(h),Se&&c.setTags(Se),Object.keys(Ie).forEach(v=>{c.setContext(v,Ie[v])}),c.setTag("language",navigator.language),c.setTag("timezone",_t()),Hr(c),c}function Hr(s){window.Shopify&&(s.setTag("shopify.shop",window.Shopify.shop),s.setTag("shopify.currency",window.Shopify.currency?.active),s.setTag("shopify.locale",window.Shopify.locale),s.setTag("theme.schema_name",window.Shopify.theme?.schema_name),s.setTag("theme.schema_version",window.Shopify.theme?.schema_version))}export{qr as a,Q as b,Kr as c,Xr as d,Jr as e,Qr as f,Zr as g,pt as h,ce as i,ve as j,ye as k,Ee as l,ne as m,_e as n,de as o,oe as p,Kn as q,Ge as r,no as s,oo as t,io as u,ao as v,yt as w,$e as x,yn as y,Nn as z,xn as A,Ln as B,On as C,Or as D,Pn as E,bt as F,Vn as G,Pr as H,Mn as I,Vr as J,Bn as K,Fn as L,Un as M,wt as N,Y as O,Hn as P,Mr as Q,Yn as R,jn as S};
|