@loaders.gl/parquet 4.0.0-alpha.10 → 4.0.0-alpha.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/dist.min.js +1 -1
- package/dist/es5/parquet-loader.js +1 -1
- package/dist/es5/parquet-wasm-loader.js +1 -1
- package/dist/es5/parquet-wasm-writer.js +1 -1
- package/dist/es5/parquet-writer.js +1 -1
- package/dist/esm/parquet-loader.js +1 -1
- package/dist/esm/parquet-wasm-loader.js +1 -1
- package/dist/esm/parquet-wasm-writer.js +1 -1
- package/dist/esm/parquet-writer.js +1 -1
- package/dist/parquet-worker.js +3 -3
- package/package.json +6 -6
package/dist/dist.min.js
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
`))):s=t.stylize("[Circular]","special")),Vi(o)){if(f&&i.match(/^\d+$/))return s;o=JSON.stringify(""+i),o.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=t.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=t.stylize(o,"string"))}return o+": "+s}function Z1(t,e,r){var n=t.reduce(function(i,f){return f.indexOf(`
|
|
10
10
|
`)>=0,i+f.replace(/\u001b\[\d\d?m/g,"").length+1},0);return n>60?r[0]+(e===""?"":e+`
|
|
11
11
|
`)+" "+t.join(`,
|
|
12
|
-
`)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Z0(t){return Array.isArray(t)}function Pd(t){return typeof t=="boolean"}function cu(t){return t===null}function X1(t){return t==null}function X0(t){return typeof t=="number"}function mu(t){return typeof t=="string"}function Q1(t){return babelHelpers.typeof(t)==="symbol"}function Vi(t){return t===void 0}function du(t){return _s(t)&&Ud(t)==="[object RegExp]"}function _s(t){return babelHelpers.typeof(t)==="object"&&t!==null}function Ld(t){return _s(t)&&Ud(t)==="[object Date]"}function wu(t){return _s(t)&&(Ud(t)==="[object Error]"||t instanceof Error)}function hu(t){return typeof t=="function"}function $1(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||babelHelpers.typeof(t)==="symbol"||typeof t=="undefined"}function eE(t){return Buffer.isBuffer(t)}function Ud(t){return Object.prototype.toString.call(t)}function Md(t){return t<10?"0"+t.toString(10):t.toString(10)}function rE(){var t=new Date,e=[Md(t.getHours()),Md(t.getMinutes()),Md(t.getSeconds())].join(":");return[t.getDate(),tE[t.getMonth()],e].join(" ")}function nE(){console.log("%s - %s",rE(),Hd.apply(null,arguments))}function Q0(t,e){if(!e||!_s(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function $0(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var au,x1,E1,A1,bi,En,O1,Ad,Bo,K0,Od,P1,L1,ys,ae,TH,kH,BH,IH,Af,SH,Nd,xH,an,EH,Of,AH,U1,Rd,M1,C1,pu,Dd,tE,iE,ut,OH,NH,RH,HH,DH,zH,FH,PH,LH,UH,Zn,MH,CH,de,VH,vs,WH,Io,YH,So,KH,bu,JH,qs,ZH,Ts,XH,Wi,QH,W,$H,eD,tD,rD,nD,iD,fD,oD,sD,lD,aD,pD,uD,cD,mD,dD,wD,hD,bD,gD,jD,yD,_D,vD,qD,TD,kD,BD,ID,SD,xD,ED,AD,OD,Cd,ND,Nf,RD,ks,HD,Rf,DD,zD,gu,FD,ju,PD,Ql,LD,UD,$l,MD,CD,yu,VD,we,WD,YD,KD,e_,GD,t_,JD,ZD,XD,QD,$D,ez,tz,rz,nz,iz,fz,oz,sz,lz,az,pz,uz,cz,mz,dz,wz,hz,bz,gz,jz,yz,_z,vz,qz,Tz,kz,Bz,Iz,Sz,xz,Ez,Az,Oz,Nz,Rz,Hz,Dz,zz,Fz,Pz,Lz,Uz,Mz,Cz,Vz,Wz,Yz,Vd=I(()=>{au=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};x1=N1,E1=H1,A1=F1,bi=[],En=[],O1=typeof Uint8Array!="undefined"?Uint8Array:Array,Ad="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Bo=0,K0=Ad.length;Bo<K0;++Bo)bi[Bo]=Ad[Bo],En[Ad.charCodeAt(Bo)]=Bo;En["-".charCodeAt(0)]=62;En["_".charCodeAt(0)]=63;Od={byteLength:x1,toByteArray:E1,fromByteArray:A1},P1=function(e,r,n,i,f){var o,s,l=f*8-i-1,p=(1<<l)-1,u=p>>1,b=-7,c=n?f-1:0,h=n?-1:1,k=e[r+c];for(c+=h,o=k&(1<<-b)-1,k>>=-b,b+=l;b>0;o=o*256+e[r+c],c+=h,b-=8);for(s=o&(1<<-b)-1,o>>=-b,b+=i;b>0;s=s*256+e[r+c],c+=h,b-=8);if(o===0)o=1-u;else{if(o===p)return s?NaN:(k?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-u}return(k?-1:1)*s*Math.pow(2,o-i)},L1=function(e,r,n,i,f,o){var s,l,p,u=o*8-f-1,b=(1<<u)-1,c=b>>1,h=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=i?0:o-1,y=i?1:-1,R=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,s=b):(s=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+c>=1?r+=h/p:r+=h*Math.pow(2,1-c),r*p>=2&&(s++,p/=2),s+c>=b?(l=0,s=b):s+c>=1?(l=(r*p-1)*Math.pow(2,f),s=s+c):(l=r*Math.pow(2,c-1)*Math.pow(2,f),s=0));f>=8;e[n+k]=l&255,k+=y,l/=256,f-=8);for(s=s<<f|l,u+=f;u>0;e[n+k]=s&255,k+=y,s/=256,u-=8);e[n+k-y]|=R*128},ys={read:P1,write:L1},ae=kt(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=R,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&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 i(){try{var _=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(_,m),_.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(!!o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(!!o.isBuffer(this))return this.byteOffset}});function f(_){if(_>n)throw new RangeError('The value "'+_+'" is invalid for option "size"');var m=new Uint8Array(_);return Object.setPrototypeOf(m,o.prototype),m}function o(_,m,d){if(typeof _=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(_)}return s(_,m,d)}o.poolSize=8192;function s(_,m,d){if(typeof _=="string")return b(_,m);if(ArrayBuffer.isView(_))return c(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(_));if(Ee(_,ArrayBuffer)||_&&Ee(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ee(_,SharedArrayBuffer)||_&&Ee(_.buffer,SharedArrayBuffer)))return h(_,m,d);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var q=_.valueOf&&_.valueOf();if(q!=null&&q!==_)return o.from(q,m,d);var F=k(_);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return o.from(_[Symbol.toPrimitive]("string"),m,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(_))}o.from=function(_,m,d){return s(_,m,d)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function p(_,m,d){return l(_),_<=0?f(_):m!==void 0?typeof d=="string"?f(_).fill(m,d):f(_).fill(m):f(_)}o.alloc=function(_,m,d){return p(_,m,d)};function u(_){return l(_),f(_<0?0:y(_)|0)}o.allocUnsafe=function(_){return u(_)},o.allocUnsafeSlow=function(_){return u(_)};function b(_,m){if((typeof m!="string"||m==="")&&(m="utf8"),!o.isEncoding(m))throw new TypeError("Unknown encoding: "+m);var d=L(_,m)|0,q=f(d),F=q.write(_,m);return F!==d&&(q=q.slice(0,F)),q}function c(_){for(var m=_.length<0?0:y(_.length)|0,d=f(m),q=0;q<m;q+=1)d[q]=_[q]&255;return d}function h(_,m,d){if(m<0||_.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<m+(d||0))throw new RangeError('"length" is outside of buffer bounds');var q;return m===void 0&&d===void 0?q=new Uint8Array(_):d===void 0?q=new Uint8Array(_,m):q=new Uint8Array(_,m,d),Object.setPrototypeOf(q,o.prototype),q}function k(_){if(o.isBuffer(_)){var m=y(_.length)|0,d=f(m);return d.length===0||_.copy(d,0,0,m),d}if(_.length!==void 0)return typeof _.length!="number"||At(_.length)?f(0):c(_);if(_.type==="Buffer"&&Array.isArray(_.data))return c(_.data)}function y(_){if(_>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return _|0}function R(_){return+_!=_&&(_=0),o.alloc(+_)}o.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==o.prototype},o.compare=function(m,d){if(Ee(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),Ee(d,Uint8Array)&&(d=o.from(d,d.offset,d.byteLength)),!o.isBuffer(m)||!o.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===d)return 0;for(var q=m.length,F=d.length,ee=0,te=Math.min(q,F);ee<te;++ee)if(m[ee]!==d[ee]){q=m[ee],F=d[ee];break}return q<F?-1:F<q?1:0},o.isEncoding=function(m){switch(String(m).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}},o.concat=function(m,d){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return o.alloc(0);var q;if(d===void 0)for(d=0,q=0;q<m.length;++q)d+=m[q].length;var F=o.allocUnsafe(d),ee=0;for(q=0;q<m.length;++q){var te=m[q];if(Ee(te,Uint8Array)&&(te=o.from(te)),!o.isBuffer(te))throw new TypeError('"list" argument must be an Array of Buffers');te.copy(F,ee),ee+=te.length}return F};function L(_,m){if(o.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||Ee(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(_));var d=_.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&d===0)return 0;for(var F=!1;;)switch(m){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return pe(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return jf(_).length;default:if(F)return q?-1:pe(_).length;m=(""+m).toLowerCase(),F=!0}}o.byteLength=L;function D(_,m,d){var q=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,m>>>=0,d<=m))return"";for(_||(_="utf8");;)switch(_){case"hex":return E(this,m,d);case"utf8":case"utf-8":return w(this,m,d);case"ascii":return U(this,m,d);case"latin1":case"binary":return $(this,m,d);case"base64":return O(this,m,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,m,d);default:if(q)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),q=!0}}o.prototype._isBuffer=!0;function K(_,m,d){var q=_[m];_[m]=_[d],_[d]=q}o.prototype.swap16=function(){var m=this.length;if(m%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var d=0;d<m;d+=2)K(this,d,d+1);return this},o.prototype.swap32=function(){var m=this.length;if(m%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var d=0;d<m;d+=4)K(this,d,d+3),K(this,d+1,d+2);return this},o.prototype.swap64=function(){var m=this.length;if(m%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var d=0;d<m;d+=8)K(this,d,d+7),K(this,d+1,d+6),K(this,d+2,d+5),K(this,d+3,d+4);return this},o.prototype.toString=function(){var m=this.length;return m===0?"":arguments.length===0?w(this,0,m):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(m){if(!o.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:o.compare(this,m)===0},o.prototype.inspect=function(){var m="",d=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(m+=" ... "),"<Buffer "+m+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(m,d,q,F,ee){if(Ee(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),!o.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(m));if(d===void 0&&(d=0),q===void 0&&(q=m?m.length:0),F===void 0&&(F=0),ee===void 0&&(ee=this.length),d<0||q>m.length||F<0||ee>this.length)throw new RangeError("out of range index");if(F>=ee&&d>=q)return 0;if(F>=ee)return-1;if(d>=q)return 1;if(d>>>=0,q>>>=0,F>>>=0,ee>>>=0,this===m)return 0;for(var te=ee-F,Ke=q-d,De=Math.min(te,Ke),wt=this.slice(F,ee),fr=m.slice(d,q),me=0;me<De;++me)if(wt[me]!==fr[me]){te=wt[me],Ke=fr[me];break}return te<Ke?-1:Ke<te?1:0};function ne(_,m,d,q,F){if(_.length===0)return-1;if(typeof d=="string"?(q=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,At(d)&&(d=F?0:_.length-1),d<0&&(d=_.length+d),d>=_.length){if(F)return-1;d=_.length-1}else if(d<0)if(F)d=0;else return-1;if(typeof m=="string"&&(m=o.from(m,q)),o.isBuffer(m))return m.length===0?-1:Y(_,m,d,q,F);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(_,m,d):Uint8Array.prototype.lastIndexOf.call(_,m,d):Y(_,[m],d,q,F);throw new TypeError("val must be string, number or Buffer")}function Y(_,m,d,q,F){var ee=1,te=_.length,Ke=m.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(_.length<2||m.length<2)return-1;ee=2,te/=2,Ke/=2,d/=2}function De(v,B){return ee===1?v[B]:v.readUInt16BE(B*ee)}var wt;if(F){var fr=-1;for(wt=d;wt<te;wt++)if(De(_,wt)===De(m,fr===-1?0:wt-fr)){if(fr===-1&&(fr=wt),wt-fr+1===Ke)return fr*ee}else fr!==-1&&(wt-=wt-fr),fr=-1}else for(d+Ke>te&&(d=te-Ke),wt=d;wt>=0;wt--){for(var me=!0,Yn=0;Yn<Ke;Yn++)if(De(_,wt+Yn)!==De(m,Yn)){me=!1;break}if(me)return wt}return-1}o.prototype.includes=function(m,d,q){return this.indexOf(m,d,q)!==-1},o.prototype.indexOf=function(m,d,q){return ne(this,m,d,q,!0)},o.prototype.lastIndexOf=function(m,d,q){return ne(this,m,d,q,!1)};function N(_,m,d,q){d=Number(d)||0;var F=_.length-d;q?(q=Number(q),q>F&&(q=F)):q=F;var ee=m.length;q>ee/2&&(q=ee/2);for(var te=0;te<q;++te){var Ke=parseInt(m.substr(te*2,2),16);if(At(Ke))return te;_[d+te]=Ke}return te}function re(_,m,d,q){return jt(pe(m,_.length-d),_,d,q)}function C(_,m,d,q){return jt(Et(m),_,d,q)}function ie(_,m,d,q){return C(_,m,d,q)}function j(_,m,d,q){return jt(jf(m),_,d,q)}function g(_,m,d,q){return jt(gf(m,_.length-d),_,d,q)}o.prototype.write=function(m,d,q,F){if(d===void 0)F="utf8",q=this.length,d=0;else if(q===void 0&&typeof d=="string")F=d,q=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(q)?(q=q>>>0,F===void 0&&(F="utf8")):(F=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ee=this.length-d;if((q===void 0||q>ee)&&(q=ee),m.length>0&&(q<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");for(var te=!1;;)switch(F){case"hex":return N(this,m,d,q);case"utf8":case"utf-8":return re(this,m,d,q);case"ascii":return C(this,m,d,q);case"latin1":case"binary":return ie(this,m,d,q);case"base64":return j(this,m,d,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,m,d,q);default:if(te)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),te=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(_,m,d){return m===0&&d===_.length?Od.fromByteArray(_):Od.fromByteArray(_.slice(m,d))}function w(_,m,d){d=Math.min(_.length,d);for(var q=[],F=m;F<d;){var ee=_[F],te=null,Ke=ee>239?4:ee>223?3:ee>191?2:1;if(F+Ke<=d){var De,wt,fr,me;switch(Ke){case 1:ee<128&&(te=ee);break;case 2:De=_[F+1],(De&192)==128&&(me=(ee&31)<<6|De&63,me>127&&(te=me));break;case 3:De=_[F+1],wt=_[F+2],(De&192)==128&&(wt&192)==128&&(me=(ee&15)<<12|(De&63)<<6|wt&63,me>2047&&(me<55296||me>57343)&&(te=me));break;case 4:De=_[F+1],wt=_[F+2],fr=_[F+3],(De&192)==128&&(wt&192)==128&&(fr&192)==128&&(me=(ee&15)<<18|(De&63)<<12|(wt&63)<<6|fr&63,me>65535&&me<1114112&&(te=me))}}te===null?(te=65533,Ke=1):te>65535&&(te-=65536,q.push(te>>>10&1023|55296),te=56320|te&1023),q.push(te),F+=Ke}return V(q)}var P=4096;function V(_){var m=_.length;if(m<=P)return String.fromCharCode.apply(String,_);for(var d="",q=0;q<m;)d+=String.fromCharCode.apply(String,_.slice(q,q+=P));return d}function U(_,m,d){var q="";d=Math.min(_.length,d);for(var F=m;F<d;++F)q+=String.fromCharCode(_[F]&127);return q}function $(_,m,d){var q="";d=Math.min(_.length,d);for(var F=m;F<d;++F)q+=String.fromCharCode(_[F]);return q}function E(_,m,d){var q=_.length;(!m||m<0)&&(m=0),(!d||d<0||d>q)&&(d=q);for(var F="",ee=m;ee<d;++ee)F+=ft[_[ee]];return F}function xe(_,m,d){for(var q=_.slice(m,d),F="",ee=0;ee<q.length;ee+=2)F+=String.fromCharCode(q[ee]+q[ee+1]*256);return F}o.prototype.slice=function(m,d){var q=this.length;m=~~m,d=d===void 0?q:~~d,m<0?(m+=q,m<0&&(m=0)):m>q&&(m=q),d<0?(d+=q,d<0&&(d=0)):d>q&&(d=q),d<m&&(d=m);var F=this.subarray(m,d);return Object.setPrototypeOf(F,o.prototype),F};function fe(_,m,d){if(_%1!=0||_<0)throw new RangeError("offset is not uint");if(_+m>d)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m],ee=1,te=0;++te<d&&(ee*=256);)F+=this[m+te]*ee;return F},o.prototype.readUIntBE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m+--d],ee=1;d>0&&(ee*=256);)F+=this[m+--d]*ee;return F},o.prototype.readUInt8=function(m,d){return m=m>>>0,d||fe(m,1,this.length),this[m]},o.prototype.readUInt16LE=function(m,d){return m=m>>>0,d||fe(m,2,this.length),this[m]|this[m+1]<<8},o.prototype.readUInt16BE=function(m,d){return m=m>>>0,d||fe(m,2,this.length),this[m]<<8|this[m+1]},o.prototype.readUInt32LE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},o.prototype.readUInt32BE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},o.prototype.readIntLE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m],ee=1,te=0;++te<d&&(ee*=256);)F+=this[m+te]*ee;return ee*=128,F>=ee&&(F-=Math.pow(2,8*d)),F},o.prototype.readIntBE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=d,ee=1,te=this[m+--F];F>0&&(ee*=256);)te+=this[m+--F]*ee;return ee*=128,te>=ee&&(te-=Math.pow(2,8*d)),te},o.prototype.readInt8=function(m,d){return m=m>>>0,d||fe(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},o.prototype.readInt16LE=function(m,d){m=m>>>0,d||fe(m,2,this.length);var q=this[m]|this[m+1]<<8;return q&32768?q|4294901760:q},o.prototype.readInt16BE=function(m,d){m=m>>>0,d||fe(m,2,this.length);var q=this[m+1]|this[m]<<8;return q&32768?q|4294901760:q},o.prototype.readInt32LE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},o.prototype.readInt32BE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},o.prototype.readFloatLE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),ys.read(this,m,!0,23,4)},o.prototype.readFloatBE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),ys.read(this,m,!1,23,4)},o.prototype.readDoubleLE=function(m,d){return m=m>>>0,d||fe(m,8,this.length),ys.read(this,m,!0,52,8)},o.prototype.readDoubleBE=function(m,d){return m=m>>>0,d||fe(m,8,this.length),ys.read(this,m,!1,52,8)};function M(_,m,d,q,F,ee){if(!o.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>F||m<ee)throw new RangeError('"value" argument is out of bounds');if(d+q>_.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(m,d,q,F){if(m=+m,d=d>>>0,q=q>>>0,!F){var ee=Math.pow(2,8*q)-1;M(this,m,d,q,ee,0)}var te=1,Ke=0;for(this[d]=m&255;++Ke<q&&(te*=256);)this[d+Ke]=m/te&255;return d+q},o.prototype.writeUIntBE=function(m,d,q,F){if(m=+m,d=d>>>0,q=q>>>0,!F){var ee=Math.pow(2,8*q)-1;M(this,m,d,q,ee,0)}var te=q-1,Ke=1;for(this[d+te]=m&255;--te>=0&&(Ke*=256);)this[d+te]=m/Ke&255;return d+q},o.prototype.writeUInt8=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,1,255,0),this[d]=m&255,d+1},o.prototype.writeUInt16LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,65535,0),this[d]=m&255,this[d+1]=m>>>8,d+2},o.prototype.writeUInt16BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,65535,0),this[d]=m>>>8,this[d+1]=m&255,d+2},o.prototype.writeUInt32LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,4294967295,0),this[d+3]=m>>>24,this[d+2]=m>>>16,this[d+1]=m>>>8,this[d]=m&255,d+4},o.prototype.writeUInt32BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,4294967295,0),this[d]=m>>>24,this[d+1]=m>>>16,this[d+2]=m>>>8,this[d+3]=m&255,d+4},o.prototype.writeIntLE=function(m,d,q,F){if(m=+m,d=d>>>0,!F){var ee=Math.pow(2,8*q-1);M(this,m,d,q,ee-1,-ee)}var te=0,Ke=1,De=0;for(this[d]=m&255;++te<q&&(Ke*=256);)m<0&&De===0&&this[d+te-1]!==0&&(De=1),this[d+te]=(m/Ke>>0)-De&255;return d+q},o.prototype.writeIntBE=function(m,d,q,F){if(m=+m,d=d>>>0,!F){var ee=Math.pow(2,8*q-1);M(this,m,d,q,ee-1,-ee)}var te=q-1,Ke=1,De=0;for(this[d+te]=m&255;--te>=0&&(Ke*=256);)m<0&&De===0&&this[d+te+1]!==0&&(De=1),this[d+te]=(m/Ke>>0)-De&255;return d+q},o.prototype.writeInt8=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,1,127,-128),m<0&&(m=255+m+1),this[d]=m&255,d+1},o.prototype.writeInt16LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,32767,-32768),this[d]=m&255,this[d+1]=m>>>8,d+2},o.prototype.writeInt16BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,32767,-32768),this[d]=m>>>8,this[d+1]=m&255,d+2},o.prototype.writeInt32LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,2147483647,-2147483648),this[d]=m&255,this[d+1]=m>>>8,this[d+2]=m>>>16,this[d+3]=m>>>24,d+4},o.prototype.writeInt32BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[d]=m>>>24,this[d+1]=m>>>16,this[d+2]=m>>>8,this[d+3]=m&255,d+4};function G(_,m,d,q,F,ee){if(d+q>_.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Se(_,m,d,q,F){return m=+m,d=d>>>0,F||G(_,m,d,4),ys.write(_,m,d,q,23,4),d+4}o.prototype.writeFloatLE=function(m,d,q){return Se(this,m,d,!0,q)},o.prototype.writeFloatBE=function(m,d,q){return Se(this,m,d,!1,q)};function se(_,m,d,q,F){return m=+m,d=d>>>0,F||G(_,m,d,8),ys.write(_,m,d,q,52,8),d+8}o.prototype.writeDoubleLE=function(m,d,q){return se(this,m,d,!0,q)},o.prototype.writeDoubleBE=function(m,d,q){return se(this,m,d,!1,q)},o.prototype.copy=function(m,d,q,F){if(!o.isBuffer(m))throw new TypeError("argument should be a Buffer");if(q||(q=0),!F&&F!==0&&(F=this.length),d>=m.length&&(d=m.length),d||(d=0),F>0&&F<q&&(F=q),F===q||m.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=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),m.length-d<F-q&&(F=m.length-d+q);var ee=F-q;if(this===m&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(d,q,F);else if(this===m&&q<d&&d<F)for(var te=ee-1;te>=0;--te)m[te+d]=this[te+q];else Uint8Array.prototype.set.call(m,this.subarray(q,F),d);return ee},o.prototype.fill=function(m,d,q,F){if(typeof m=="string"){if(typeof d=="string"?(F=d,d=0,q=this.length):typeof q=="string"&&(F=q,q=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!o.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(m.length===1){var ee=m.charCodeAt(0);(F==="utf8"&&ee<128||F==="latin1")&&(m=ee)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(d<0||this.length<d||this.length<q)throw new RangeError("Out of range index");if(q<=d)return this;d=d>>>0,q=q===void 0?this.length:q>>>0,m||(m=0);var te;if(typeof m=="number")for(te=d;te<q;++te)this[te]=m;else{var Ke=o.isBuffer(m)?m:o.from(m,F),De=Ke.length;if(De===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(te=0;te<q-d;++te)this[te+d]=Ke[te%De]}return this};var Ye=/[^+/0-9A-Za-z-_]/g;function wr(_){if(_=_.split("=")[0],_=_.trim().replace(Ye,""),_.length<2)return"";for(;_.length%4!=0;)_=_+"=";return _}function pe(_,m){m=m||1/0;for(var d,q=_.length,F=null,ee=[],te=0;te<q;++te){if(d=_.charCodeAt(te),d>55295&&d<57344){if(!F){if(d>56319){(m-=3)>-1&&ee.push(239,191,189);continue}else if(te+1===q){(m-=3)>-1&&ee.push(239,191,189);continue}F=d;continue}if(d<56320){(m-=3)>-1&&ee.push(239,191,189),F=d;continue}d=(F-55296<<10|d-56320)+65536}else F&&(m-=3)>-1&&ee.push(239,191,189);if(F=null,d<128){if((m-=1)<0)break;ee.push(d)}else if(d<2048){if((m-=2)<0)break;ee.push(d>>6|192,d&63|128)}else if(d<65536){if((m-=3)<0)break;ee.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((m-=4)<0)break;ee.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return ee}function Et(_){for(var m=[],d=0;d<_.length;++d)m.push(_.charCodeAt(d)&255);return m}function gf(_,m){for(var d,q,F,ee=[],te=0;te<_.length&&!((m-=2)<0);++te)d=_.charCodeAt(te),q=d>>8,F=d%256,ee.push(F),ee.push(q);return ee}function jf(_){return Od.toByteArray(wr(_))}function jt(_,m,d,q){for(var F=0;F<q&&!(F+d>=m.length||F>=_.length);++F)m[F+d]=_[F];return F}function Ee(_,m){return _ instanceof m||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===m.name}function At(_){return _!==_}var ft=function(){for(var _="0123456789abcdef",m=new Array(256),d=0;d<16;++d)for(var q=d*16,F=0;F<16;++F)m[q+F]=_[d]+_[F];return m}()}),TH=ae.Buffer,kH=ae.SlowBuffer,BH=ae.INSPECT_MAX_BYTES,IH=ae.kMaxLength,Af=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBuffer=void 0;function r(n){if(ae.Buffer.isBuffer(n))return n;if(ArrayBuffer.isView(n))return ae.Buffer.from(n.buffer);if(n instanceof ArrayBuffer)return ae.Buffer.from(n);throw new TypeError("Must use either Buffer or TypedArray")}e.ensureBuffer=r});Nt(Af);SH=Af.ensureBuffer,Nd=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseUUID=void 0;let r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function n(i){if(typeof i!="string")throw new TypeError("Invalid type for UUID, expected string but got "+typeof i);if(!r.test(i))throw new TypeError("Invalid format for UUID: "+i);let f,o=new Uint8Array(16);return o[0]=(f=parseInt(i.slice(0,8),16))>>>24,o[1]=f>>>16&255,o[2]=f>>>8&255,o[3]=f&255,o[4]=(f=parseInt(i.slice(9,13),16))>>>8,o[5]=f&255,o[6]=(f=parseInt(i.slice(14,18),16))>>>8,o[7]=f&255,o[8]=(f=parseInt(i.slice(19,23),16))>>>8,o[9]=f&255,o[10]=(f=parseInt(i.slice(24,36),16))/1099511627776&255,o[11]=f/4294967296&255,o[12]=f>>>24&255,o[13]=f>>>16&255,o[14]=f>>>8&255,o[15]=f&255,o}e.parseUUID=n});Nt(Nd);xH=Nd.parseUUID,an=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binary=void 0;class r{constructor(i,f){if(i!=null&&typeof i!="string"&&!ArrayBuffer.isView(i)&&!(i instanceof ArrayBuffer)&&!Array.isArray(i))throw new TypeError("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=f??r.BSON_BINARY_SUBTYPE_DEFAULT,i==null?(this.buffer=ae.Buffer.alloc(r.BUFFER_SIZE),this.position=0):(typeof i=="string"?this.buffer=ae.Buffer.from(i,"binary"):Array.isArray(i)?this.buffer=ae.Buffer.from(i):this.buffer=Af.ensureBuffer(i),this.position=this.buffer.byteLength)}put(i){if(typeof i=="string"&&i.length!==1)throw new TypeError("only accepts single character String");if(typeof i!="number"&&i.length!==1)throw new TypeError("only accepts single character Uint8Array or Array");let f;if(typeof i=="string"?f=i.charCodeAt(0):typeof i=="number"?f=i:f=i[0],f<0||f>255)throw new TypeError("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=f;else{let o=ae.Buffer.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=f}}write(i,f){if(f=typeof f=="number"?f:this.position,this.buffer.length<f+i.length){let o=ae.Buffer.alloc(this.buffer.length+i.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o}ArrayBuffer.isView(i)?(this.buffer.set(Af.ensureBuffer(i),f),this.position=f+i.byteLength>this.position?f+i.length:this.position):typeof i=="string"&&(this.buffer.write(i,f,i.length,"binary"),this.position=f+i.length>this.position?f+i.length:this.position)}read(i,f){return f=f&&f>0?f:this.position,this.buffer.slice(i,i+f)}value(i){return i=!!i,i&&this.buffer.length===this.position?this.buffer:i?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)}length(){return this.position}toJSON(){return this.buffer.toString("base64")}toString(i){return this.buffer.toString(i)}toExtendedJSON(i){i=i||{};let f=this.buffer.toString("base64"),o=Number(this.sub_type).toString(16);return i.legacy?{$binary:f,$type:o.length===1?"0"+o:o}:{$binary:{base64:f,subType:o.length===1?"0"+o:o}}}static fromExtendedJSON(i,f){f=f||{};let o,s;if("$binary"in i?f.legacy&&typeof i.$binary=="string"&&"$type"in i?(s=i.$type?parseInt(i.$type,16):0,o=ae.Buffer.from(i.$binary,"base64")):typeof i.$binary!="string"&&(s=i.$binary.subType?parseInt(i.$binary.subType,16):0,o=ae.Buffer.from(i.$binary.base64,"base64")):"$uuid"in i&&(s=4,o=ae.Buffer.from(Nd.parseUUID(i.$uuid))),!o)throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(i)}`);return new r(o,s)}}e.Binary=r,r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_USER_DEFINED=128,Object.defineProperty(r.prototype,"_bsontype",{value:"Binary"})});Nt(an);EH=an.Binary,Of=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Code=void 0;class r{constructor(i,f){this.code=i,this.scope=f}toJSON(){return{code:this.code,scope:this.scope}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(i){return new r(i.$code,i.$scope)}}e.Code=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Code"})});Nt(Of);AH=Of.Code,U1={};typeof Object.create=="function"?Rd=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Rd=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};M1=Rd,C1=/%[sdj%]/g;pu={};Ci.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ci.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};tE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];iE={inherits:M1,_extend:Q0,log:nE,isBuffer:eE,isPrimitive:$1,isFunction:hu,isError:wu,isDate:Ld,isObject:_s,isRegExp:du,isUndefined:Vi,isSymbol:Q1,isString:mu,isNumber:X0,isNullOrUndefined:X1,isNull:cu,isBoolean:Pd,isArray:Z0,inspect:Ci,deprecate:J0,format:Hd,debuglog:V1},ut=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deprecate=e.isObjectLike=e.isDate=e.isBuffer=e.haveBuffer=e.isBigUInt64Array=e.isBigInt64Array=e.isUint8Array=e.randomBytes=e.normalizedFunctionString=void 0;function r(c){return c.toString().replace("function(","function (")}e.normalizedFunctionString=r;function n(c){let h=ae.Buffer.alloc(c);for(let k=0;k<c;++k)h[k]=Math.floor(Math.random()*256);return h}if(e.randomBytes=n,typeof window!="undefined"&&window.crypto&&window.crypto.getRandomValues)e.randomBytes=c=>window.crypto.getRandomValues(ae.Buffer.alloc(c));else{try{e.randomBytes=U1.randomBytes}catch{}e.randomBytes==null&&(e.randomBytes=n)}function i(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}e.isUint8Array=i;function f(c){return Object.prototype.toString.call(c)==="[object BigInt64Array]"}e.isBigInt64Array=f;function o(c){return Object.prototype.toString.call(c)==="[object BigUint64Array]"}e.isBigUInt64Array=o;function s(){return typeof au!="undefined"&&typeof au.Buffer!="undefined"}e.haveBuffer=s;function l(c){return s()&&ae.Buffer.isBuffer(c)}e.isBuffer=l;function p(c){return u(c)&&Object.prototype.toString.call(c)==="[object Date]"}e.isDate=p;function u(c){return typeof c=="object"&&c!==null}e.isObjectLike=u;function b(c,h){if(typeof window=="undefined"||typeof self=="undefined")return iE.deprecate(c,h);let k=!1;function y(...R){return k||(console.warn(h),k=!0),c.apply(this,...R)}return y}e.deprecate=b});Nt(ut);OH=ut.deprecate,NH=ut.isObjectLike,RH=ut.isDate,HH=ut.isBuffer,DH=ut.haveBuffer,zH=ut.isBigUInt64Array,FH=ut.isBigInt64Array,PH=ut.isUint8Array,LH=ut.randomBytes,UH=ut.normalizedFunctionString,Zn=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DBRef=e.isDBRefLike=void 0;function r(i){return ut.isObjectLike(i)&&i.$id!=null&&i.$ref!=null}e.isDBRefLike=r;class n{constructor(f,o,s,l){let p=f.split(".");p.length===2&&(s=p.shift(),f=p.shift()),this.collection=f,this.oid=o,this.db=s,this.fields=l||{}}get namespace(){return this.collection}set namespace(f){this.collection=f}toJSON(){let f=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(f.$db=this.db),f}toExtendedJSON(f){f=f||{};let o={$ref:this.collection,$id:this.oid};return f.legacy||(this.db&&(o.$db=this.db),o=Object.assign(o,this.fields)),o}static fromExtendedJSON(f){let o=Object.assign({},f);return delete o.$ref,delete o.$id,delete o.$db,new n(f.$ref,f.$id,f.$db,o)}}e.DBRef=n,Object.defineProperty(n.prototype,"_bsontype",{value:"DBRef"})});Nt(Zn);MH=Zn.DBRef,CH=Zn.isDBRefLike,de=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Long=void 0;let r;try{r=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{}let n=1<<16,i=1<<24,f=n*n,o=f*f,s=o/2,l={},p={};class u{constructor(c=0,h=0,k){this.comp=u.prototype.compare,this.div=u.prototype.divide,this.eq=u.prototype.equals,this.gt=u.prototype.greaterThan,this.gte=u.prototype.greaterThanOrEqual,this.ge=u.prototype.greaterThanOrEqual,this.lt=u.prototype.lessThan,this.lte=u.prototype.lessThanOrEqual,this.mod=u.prototype.modulo,this.rem=u.prototype.modulo,this.mul=u.prototype.multiply,this.neg=u.prototype.negate,this.neq=u.prototype.notEquals,this.ne=u.prototype.notEquals,this.shl=u.prototype.shiftLeft,this.shr=u.prototype.shiftRight,this.shr_u=u.prototype.shiftRightUnsigned,this.shru=u.prototype.shiftRightUnsigned,this.sub=u.prototype.subtract,this.eqz=u.prototype.isZero,this.le=u.prototype.lessThanOrEqual,this.low=c|0,this.high=h|0,this.unsigned=!!k,Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}static fromBits(c,h,k){return new u(c,h,k)}static fromInt(c,h){let k,y,R;return h?(c>>>=0,(R=0<=c&&c<256)&&(y=p[c],y)?y:(k=u.fromBits(c,(c|0)<0?-1:0,!0),R&&(p[c]=k),k)):(c|=0,(R=-128<=c&&c<128)&&(y=l[c],y)?y:(k=u.fromBits(c,c<0?-1:0,!1),R&&(l[c]=k),k))}static fromNumber(c,h){if(isNaN(c))return h?u.UZERO:u.ZERO;if(h){if(c<0)return u.UZERO;if(c>=o)return u.MAX_UNSIGNED_VALUE}else{if(c<=-s)return u.MIN_VALUE;if(c+1>=s)return u.MAX_VALUE}return c<0?u.fromNumber(-c,h).neg():u.fromBits(c%f|0,c/f|0,h)}static fromBigInt(c,h){return u.fromString(c.toString(),h)}static fromString(c,h,k){if(c.length===0)throw Error("empty string");if(c==="NaN"||c==="Infinity"||c==="+Infinity"||c==="-Infinity")return u.ZERO;if(typeof h=="number"?(k=h,h=!1):h=!!h,k=k||10,k<2||36<k)throw RangeError("radix");let y;if((y=c.indexOf("-"))>0)throw Error("interior hyphen");if(y===0)return u.fromString(c.substring(1),h,k).neg();let R=u.fromNumber(Math.pow(k,8)),L=u.ZERO;for(let D=0;D<c.length;D+=8){let K=Math.min(8,c.length-D),ne=parseInt(c.substring(D,D+K),k);if(K<8){let Y=u.fromNumber(Math.pow(k,K));L=L.mul(Y).add(u.fromNumber(ne))}else L=L.mul(R),L=L.add(u.fromNumber(ne))}return L.unsigned=h,L}static fromBytes(c,h,k){return k?u.fromBytesLE(c,h):u.fromBytesBE(c,h)}static fromBytesLE(c,h){return new u(c[0]|c[1]<<8|c[2]<<16|c[3]<<24,c[4]|c[5]<<8|c[6]<<16|c[7]<<24,h)}static fromBytesBE(c,h){return new u(c[4]<<24|c[5]<<16|c[6]<<8|c[7],c[0]<<24|c[1]<<16|c[2]<<8|c[3],h)}static isLong(c){return ut.isObjectLike(c)&&c.__isLong__===!0}static fromValue(c,h){return typeof c=="number"?u.fromNumber(c,h):typeof c=="string"?u.fromString(c,h):u.fromBits(c.low,c.high,typeof h=="boolean"?h:c.unsigned)}add(c){u.isLong(c)||(c=u.fromValue(c));let h=this.high>>>16,k=this.high&65535,y=this.low>>>16,R=this.low&65535,L=c.high>>>16,D=c.high&65535,K=c.low>>>16,ne=c.low&65535,Y=0,N=0,re=0,C=0;return C+=R+ne,re+=C>>>16,C&=65535,re+=y+K,N+=re>>>16,re&=65535,N+=k+D,Y+=N>>>16,N&=65535,Y+=h+L,Y&=65535,u.fromBits(re<<16|C,Y<<16|N,this.unsigned)}and(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low&c.low,this.high&c.high,this.unsigned)}compare(c){if(u.isLong(c)||(c=u.fromValue(c)),this.eq(c))return 0;let h=this.isNegative(),k=c.isNegative();return h&&!k?-1:!h&&k?1:this.unsigned?c.high>>>0>this.high>>>0||c.high===this.high&&c.low>>>0>this.low>>>0?-1:1:this.sub(c).isNegative()?-1:1}divide(c){if(u.isLong(c)||(c=u.fromValue(c)),c.isZero())throw Error("division by zero");if(r){if(!this.unsigned&&this.high===-2147483648&&c.low===-1&&c.high===-1)return this;let R=(this.unsigned?r.div_u:r.div_s)(this.low,this.high,c.low,c.high);return u.fromBits(R,r.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?u.UZERO:u.ZERO;let h,k,y;if(this.unsigned){if(c.unsigned||(c=c.toUnsigned()),c.gt(this))return u.UZERO;if(c.gt(this.shru(1)))return u.UONE;y=u.UZERO}else{if(this.eq(u.MIN_VALUE))return c.eq(u.ONE)||c.eq(u.NEG_ONE)?u.MIN_VALUE:c.eq(u.MIN_VALUE)?u.ONE:(h=this.shr(1).div(c).shl(1),h.eq(u.ZERO)?c.isNegative()?u.ONE:u.NEG_ONE:(k=this.sub(c.mul(h)),y=h.add(k.div(c)),y));if(c.eq(u.MIN_VALUE))return this.unsigned?u.UZERO:u.ZERO;if(this.isNegative())return c.isNegative()?this.neg().div(c.neg()):this.neg().div(c).neg();if(c.isNegative())return this.div(c.neg()).neg();y=u.ZERO}for(k=this;k.gte(c);){h=Math.max(1,Math.floor(k.toNumber()/c.toNumber()));let R=Math.ceil(Math.log(h)/Math.LN2),L=R<=48?1:Math.pow(2,R-48),D=u.fromNumber(h),K=D.mul(c);for(;K.isNegative()||K.gt(k);)h-=L,D=u.fromNumber(h,this.unsigned),K=D.mul(c);D.isZero()&&(D=u.ONE),y=y.add(D),k=k.sub(K)}return y}equals(c){return u.isLong(c)||(c=u.fromValue(c)),this.unsigned!==c.unsigned&&this.high>>>31==1&&c.high>>>31==1?!1:this.high===c.high&&this.low===c.low}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq(u.MIN_VALUE)?64:this.neg().getNumBitsAbs();let c=this.high!==0?this.high:this.low,h;for(h=31;h>0&&(c&1<<h)==0;h--);return this.high!==0?h+33:h+1}greaterThan(c){return this.comp(c)>0}greaterThanOrEqual(c){return this.comp(c)>=0}isEven(){return(this.low&1)==0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)==1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(c){return this.comp(c)<0}lessThanOrEqual(c){return this.comp(c)<=0}modulo(c){if(u.isLong(c)||(c=u.fromValue(c)),r){let h=(this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,c.low,c.high);return u.fromBits(h,r.get_high(),this.unsigned)}return this.sub(this.div(c).mul(c))}multiply(c){if(this.isZero())return u.ZERO;if(u.isLong(c)||(c=u.fromValue(c)),r){let ie=r.mul(this.low,this.high,c.low,c.high);return u.fromBits(ie,r.get_high(),this.unsigned)}if(c.isZero())return u.ZERO;if(this.eq(u.MIN_VALUE))return c.isOdd()?u.MIN_VALUE:u.ZERO;if(c.eq(u.MIN_VALUE))return this.isOdd()?u.MIN_VALUE:u.ZERO;if(this.isNegative())return c.isNegative()?this.neg().mul(c.neg()):this.neg().mul(c).neg();if(c.isNegative())return this.mul(c.neg()).neg();if(this.lt(u.TWO_PWR_24)&&c.lt(u.TWO_PWR_24))return u.fromNumber(this.toNumber()*c.toNumber(),this.unsigned);let h=this.high>>>16,k=this.high&65535,y=this.low>>>16,R=this.low&65535,L=c.high>>>16,D=c.high&65535,K=c.low>>>16,ne=c.low&65535,Y=0,N=0,re=0,C=0;return C+=R*ne,re+=C>>>16,C&=65535,re+=y*ne,N+=re>>>16,re&=65535,re+=R*K,N+=re>>>16,re&=65535,N+=k*ne,Y+=N>>>16,N&=65535,N+=y*K,Y+=N>>>16,N&=65535,N+=R*D,Y+=N>>>16,N&=65535,Y+=h*ne+k*K+y*D+R*L,Y&=65535,u.fromBits(re<<16|C,Y<<16|N,this.unsigned)}negate(){return!this.unsigned&&this.eq(u.MIN_VALUE)?u.MIN_VALUE:this.not().add(u.ONE)}not(){return u.fromBits(~this.low,~this.high,this.unsigned)}notEquals(c){return!this.equals(c)}or(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low|c.low,this.high|c.high,this.unsigned)}shiftLeft(c){return u.isLong(c)&&(c=c.toInt()),(c&=63)==0?this:c<32?u.fromBits(this.low<<c,this.high<<c|this.low>>>32-c,this.unsigned):u.fromBits(0,this.low<<c-32,this.unsigned)}shiftRight(c){return u.isLong(c)&&(c=c.toInt()),(c&=63)==0?this:c<32?u.fromBits(this.low>>>c|this.high<<32-c,this.high>>c,this.unsigned):u.fromBits(this.high>>c-32,this.high>=0?0:-1,this.unsigned)}shiftRightUnsigned(c){if(u.isLong(c)&&(c=c.toInt()),c&=63,c===0)return this;{let h=this.high;if(c<32){let k=this.low;return u.fromBits(k>>>c|h<<32-c,h>>>c,this.unsigned)}else return c===32?u.fromBits(h,0,this.unsigned):u.fromBits(h>>>c-32,0,this.unsigned)}}subtract(c){return u.isLong(c)||(c=u.fromValue(c)),this.add(c.neg())}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(c){return c?this.toBytesLE():this.toBytesBE()}toBytesLE(){let c=this.high,h=this.low;return[h&255,h>>>8&255,h>>>16&255,h>>>24,c&255,c>>>8&255,c>>>16&255,c>>>24]}toBytesBE(){let c=this.high,h=this.low;return[c>>>24,c>>>16&255,c>>>8&255,c&255,h>>>24,h>>>16&255,h>>>8&255,h&255]}toSigned(){return this.unsigned?u.fromBits(this.low,this.high,!1):this}toString(c){if(c=c||10,c<2||36<c)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(u.MIN_VALUE)){let R=u.fromNumber(c),L=this.div(R),D=L.mul(R).sub(this);return L.toString(c)+D.toInt().toString(c)}else return"-"+this.neg().toString(c);let h=u.fromNumber(Math.pow(c,6),this.unsigned),k=this,y="";for(;;){let R=k.div(h),D=(k.sub(R.mul(h)).toInt()>>>0).toString(c);if(k=R,k.isZero())return D+y;for(;D.length<6;)D="0"+D;y=""+D+y}}toUnsigned(){return this.unsigned?this:u.fromBits(this.low,this.high,!0)}xor(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low^c.low,this.high^c.high,this.unsigned)}toExtendedJSON(c){return c&&c.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(c,h){let k=u.fromString(c.$numberLong);return h&&h.relaxed?k.toNumber():k}}e.Long=u,u.TWO_PWR_24=u.fromInt(i),u.MAX_UNSIGNED_VALUE=u.fromBits(4294967295|0,4294967295|0,!0),u.ZERO=u.fromInt(0),u.UZERO=u.fromInt(0,!0),u.ONE=u.fromInt(1),u.UONE=u.fromInt(1,!0),u.NEG_ONE=u.fromInt(-1),u.MAX_VALUE=u.fromBits(4294967295|0,2147483647|0,!1),u.MIN_VALUE=u.fromBits(0,2147483648|0,!1),Object.defineProperty(u.prototype,"__isLong__",{value:!0}),Object.defineProperty(u.prototype,"_bsontype",{value:"Long"})});Nt(de);VH=de.Long,vs=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decimal128=void 0;let r=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,n=/^(\+|-)?(Infinity|inf)$/i,i=/^(\+|-)?NaN$/i,f=6111,o=-6176,s=6176,l=34,p=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),u=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),b=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),c=/^([-+])?(\d+)?$/,h=31,k=16383,y=30,R=31;function L(re){return!isNaN(parseInt(re,10))}function D(re){let C=de.Long.fromNumber(1e3*1e3*1e3),ie=de.Long.fromNumber(0);if(!re.parts[0]&&!re.parts[1]&&!re.parts[2]&&!re.parts[3])return{quotient:re,rem:ie};for(let j=0;j<=3;j++)ie=ie.shiftLeft(32),ie=ie.add(new de.Long(re.parts[j],0)),re.parts[j]=ie.div(C).low,ie=ie.modulo(C);return{quotient:re,rem:ie}}function K(re,C){if(!re&&!C)return{high:de.Long.fromNumber(0),low:de.Long.fromNumber(0)};let ie=re.shiftRightUnsigned(32),j=new de.Long(re.getLowBits(),0),g=C.shiftRightUnsigned(32),O=new de.Long(C.getLowBits(),0),w=ie.multiply(g),P=ie.multiply(O),V=j.multiply(g),U=j.multiply(O);return w=w.add(P.shiftRightUnsigned(32)),P=new de.Long(P.getLowBits(),0).add(V).add(U.shiftRightUnsigned(32)),w=w.add(P.shiftRightUnsigned(32)),U=P.shiftLeft(32).add(new de.Long(U.getLowBits(),0)),{high:w,low:U}}function ne(re,C){let ie=re.high>>>0,j=C.high>>>0;if(ie<j)return!0;if(ie===j){let g=re.low>>>0,O=C.low>>>0;if(g<O)return!0}return!1}function Y(re,C){throw new TypeError(`"${re}" is not a valid Decimal128 string - ${C}`)}class N{constructor(C){this.bytes=C}static fromString(C){let ie=!1,j=!1,g=!1,O=0,w=0,P=0,V=0,U=0,$=[0],E=0,xe=0,fe=0,M=0,G=0,Se=0,se=new de.Long(0,0),Ye=new de.Long(0,0),wr=0,pe=0;if(C.length>=7e3)throw new TypeError(""+C+" not a valid Decimal128 string");let Et=C.match(r),gf=C.match(n),jf=C.match(i);if(!Et&&!gf&&!jf||C.length===0)throw new TypeError(""+C+" not a valid Decimal128 string");if(Et){let ft=Et[2],_=Et[4],m=Et[5],d=Et[6];_&&d===void 0&&Y(C,"missing exponent power"),_&&ft===void 0&&Y(C,"missing exponent base"),_===void 0&&(m||d)&&Y(C,"missing e before exponent")}if((C[pe]==="+"||C[pe]==="-")&&(ie=C[pe++]==="-"),!L(C[pe])&&C[pe]!=="."){if(C[pe]==="i"||C[pe]==="I")return new N(ae.Buffer.from(ie?u:b));if(C[pe]==="N")return new N(ae.Buffer.from(p))}for(;L(C[pe])||C[pe]===".";){if(C[pe]==="."){j&&Y(C,"contains multiple periods"),j=!0,pe=pe+1;continue}E<34&&(C[pe]!=="0"||g)&&(g||(U=w),g=!0,$[xe++]=parseInt(C[pe],10),E=E+1),g&&(P=P+1),j&&(V=V+1),w=w+1,pe=pe+1}if(j&&!w)throw new TypeError(""+C+" not a valid Decimal128 string");if(C[pe]==="e"||C[pe]==="E"){let ft=C.substr(++pe).match(c);if(!ft||!ft[2])return new N(ae.Buffer.from(p));G=parseInt(ft[0],10),pe=pe+ft[0].length}if(C[pe])return new N(ae.Buffer.from(p));if(fe=0,!E)fe=0,M=0,$[0]=0,P=1,E=1,O=0;else if(M=E-1,O=P,O!==1)for(;C[U+O-1]==="0";)O=O-1;for(G<=V&&V-G>1<<14?G=o:G=G-V;G>f;){if(M=M+1,M-fe>l){if($.join("").match(/^0+$/)){G=f;break}Y(C,"overflow")}G=G-1}for(;G<o||E<P;){if(M===0&&O<E){G=o,O=0;break}if(E<P?P=P-1:M=M-1,G<f)G=G+1;else{if($.join("").match(/^0+$/)){G=f;break}Y(C,"overflow")}}if(M-fe+1<O){let ft=w;j&&(U=U+1,ft=ft+1),ie&&(U=U+1,ft=ft+1);let _=parseInt(C[U+M+1],10),m=0;if(_>=5&&(m=1,_===5)){for(m=$[M]%2==1?1:0,Se=U+M+2;Se<ft;Se++)if(parseInt(C[Se],10)){m=1;break}}if(m){let d=M;for(;d>=0;d--)if(++$[d]>9&&($[d]=0,d===0))if(G<f)G=G+1,$[d]=1;else return new N(ae.Buffer.from(ie?u:b))}}if(se=de.Long.fromNumber(0),Ye=de.Long.fromNumber(0),O===0)se=de.Long.fromNumber(0),Ye=de.Long.fromNumber(0);else if(M-fe<17){let ft=fe;for(Ye=de.Long.fromNumber($[ft++]),se=new de.Long(0,0);ft<=M;ft++)Ye=Ye.multiply(de.Long.fromNumber(10)),Ye=Ye.add(de.Long.fromNumber($[ft]))}else{let ft=fe;for(se=de.Long.fromNumber($[ft++]);ft<=M-17;ft++)se=se.multiply(de.Long.fromNumber(10)),se=se.add(de.Long.fromNumber($[ft]));for(Ye=de.Long.fromNumber($[ft++]);ft<=M;ft++)Ye=Ye.multiply(de.Long.fromNumber(10)),Ye=Ye.add(de.Long.fromNumber($[ft]))}let jt=K(se,de.Long.fromString("100000000000000000"));jt.low=jt.low.add(Ye),ne(jt.low,Ye)&&(jt.high=jt.high.add(de.Long.fromNumber(1))),wr=G+s;let Ee={low:de.Long.fromNumber(0),high:de.Long.fromNumber(0)};jt.high.shiftRightUnsigned(49).and(de.Long.fromNumber(1)).equals(de.Long.fromNumber(1))?(Ee.high=Ee.high.or(de.Long.fromNumber(3).shiftLeft(61)),Ee.high=Ee.high.or(de.Long.fromNumber(wr).and(de.Long.fromNumber(16383).shiftLeft(47))),Ee.high=Ee.high.or(jt.high.and(de.Long.fromNumber(140737488355327)))):(Ee.high=Ee.high.or(de.Long.fromNumber(wr&16383).shiftLeft(49)),Ee.high=Ee.high.or(jt.high.and(de.Long.fromNumber(562949953421311)))),Ee.low=jt.low,ie&&(Ee.high=Ee.high.or(de.Long.fromString("9223372036854775808")));let At=ae.Buffer.alloc(16);return pe=0,At[pe++]=Ee.low.low&255,At[pe++]=Ee.low.low>>8&255,At[pe++]=Ee.low.low>>16&255,At[pe++]=Ee.low.low>>24&255,At[pe++]=Ee.low.high&255,At[pe++]=Ee.low.high>>8&255,At[pe++]=Ee.low.high>>16&255,At[pe++]=Ee.low.high>>24&255,At[pe++]=Ee.high.low&255,At[pe++]=Ee.high.low>>8&255,At[pe++]=Ee.high.low>>16&255,At[pe++]=Ee.high.low>>24&255,At[pe++]=Ee.high.high&255,At[pe++]=Ee.high.high>>8&255,At[pe++]=Ee.high.high>>16&255,At[pe++]=Ee.high.high>>24&255,new N(At)}toString(){let C,ie=0,j=new Array(36);for(let pe=0;pe<j.length;pe++)j[pe]=0;let g=0,O=!1,w,P={parts:[0,0,0,0]},V,U,$=[];g=0;let E=this.bytes,xe=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,fe=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,M=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,G=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24;g=0,{low:new de.Long(xe,fe),high:new de.Long(M,G)}.high.lessThan(de.Long.ZERO)&&$.push("-");let se=G>>26&h;if(se>>3==3){if(se===y)return $.join("")+"Infinity";if(se===R)return"NaN";C=G>>15&k,w=8+(G>>14&1)}else w=G>>14&7,C=G>>17&k;let Ye=C-s;if(P.parts[0]=(G&16383)+((w&15)<<14),P.parts[1]=M,P.parts[2]=fe,P.parts[3]=xe,P.parts[0]===0&&P.parts[1]===0&&P.parts[2]===0&&P.parts[3]===0)O=!0;else for(U=3;U>=0;U--){let pe=0,Et=D(P);if(P=Et.quotient,pe=Et.rem.low,!!pe)for(V=8;V>=0;V--)j[U*9+V]=pe%10,pe=Math.floor(pe/10)}if(O)ie=1,j[g]=0;else for(ie=36;!j[g];)ie=ie-1,g=g+1;let wr=ie-1+Ye;if(wr>=34||wr<=-7||Ye>0){if(ie>34)return $.push(`${0}`),Ye>0?$.push("E+"+Ye):Ye<0&&$.push("E"+Ye),$.join("");$.push(`${j[g++]}`),ie=ie-1,ie&&$.push(".");for(let pe=0;pe<ie;pe++)$.push(`${j[g++]}`);$.push("E"),wr>0?$.push("+"+wr):$.push(`${wr}`)}else if(Ye>=0)for(let pe=0;pe<ie;pe++)$.push(`${j[g++]}`);else{let pe=ie+Ye;if(pe>0)for(let Et=0;Et<pe;Et++)$.push(`${j[g++]}`);else $.push("0");for($.push(".");pe++<0;)$.push("0");for(let Et=0;Et<ie-Math.max(pe-1,0);Et++)$.push(`${j[g++]}`)}return $.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(C){return N.fromString(C.$numberDecimal)}}e.Decimal128=N,Object.defineProperty(N.prototype,"_bsontype",{value:"Decimal128"})});Nt(vs);WH=vs.Decimal128,Io=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Double=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){if(i&&(i.legacy||i.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:`-${this.value.toFixed(1)}`};let f;return Number.isInteger(this.value)?(f=this.value.toFixed(1),f.length>=13&&(f=this.value.toExponential(13).toUpperCase())):f=this.value.toString(),{$numberDouble:f}}static fromExtendedJSON(i,f){let o=parseFloat(i.$numberDouble);return f&&f.relaxed?o:new r(o)}}e.Double=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Double"})});Nt(Io);YH=Io.Double,So=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Int32=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){return i&&(i.relaxed||i.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(i,f){return f&&f.relaxed?parseInt(i.$numberInt,10):new r(i.$numberInt)}}e.Int32=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Int32"})});Nt(So);KH=So.Int32,bu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;let r;e.Map=r;let n=function(o){return o&&o.Math==Math&&o};function i(){return n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof au=="object"&&au)||Function("return this")()}let f=i();Object.prototype.hasOwnProperty.call(f,"Map")?e.Map=r=f.Map:e.Map=r=class{constructor(s=[]){this._keys=[],this._values={};for(let l=0;l<s.length;l++){if(s[l]==null)continue;let p=s[l],u=p[0],b=p[1];this._keys.push(u),this._values[u]={v:b,i:this._keys.length-1}}}clear(){this._keys=[],this._values={}}delete(s){let l=this._values[s];return l==null?!1:(delete this._values[s],this._keys.splice(l.i,1),!0)}entries(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?[l,this._values[l].v]:void 0,done:l===void 0}}}}forEach(s,l){l=l||this;for(let p=0;p<this._keys.length;p++){let u=this._keys[p];s.call(l,this._values[u].v,u,l)}}get(s){return this._values[s]?this._values[s].v:void 0}has(s){return this._values[s]!=null}keys(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?l:void 0,done:l===void 0}}}}set(s,l){return this._values[s]?(this._values[s].v=l,this):(this._keys.push(s),this._values[s]={v:l,i:this._keys.length-1},this)}values(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?this._values[l].v:void 0,done:l===void 0}}}}get size(){return this._keys.length}}});Nt(bu);JH=bu.Map,qs=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MaxKey=void 0;class r{toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new r}}e.MaxKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MaxKey"})});Nt(qs);ZH=qs.MaxKey,Ts=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MinKey=void 0;class r{toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new r}}e.MinKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MinKey"})});Nt(Ts);XH=Ts.MinKey,Wi=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectId=void 0;let r=ut.randomBytes(5),n=new RegExp("^[0-9a-fA-F]{24}$"),i=[];for(let u=0;u<256;u++)i[u]=(u<=15?"0":"")+u.toString(16);let f=[],o=0;for(;o<10;)f[48+o]=o++;for(;o<16;)f[65-10+o]=f[97-10+o]=o++;let s=Symbol("id");class l{constructor(b){if(b instanceof l&&(this[s]=b.id,this.__id=b.__id),typeof b=="object"&&b&&"id"in b&&("toHexString"in b&&typeof b.toHexString=="function"?this[s]=ae.Buffer.from(b.toHexString(),"hex"):this[s]=typeof b.id=="string"?ae.Buffer.from(b.id):b.id),(b==null||typeof b=="number")&&(this[s]=l.generate(typeof b=="number"?b:void 0),l.cacheHexString&&(this.__id=this.id.toString("hex"))),ArrayBuffer.isView(b)&&b.byteLength===12&&(this[s]=Af.ensureBuffer(b)),typeof b=="string")if(b.length===12){let c=ae.Buffer.from(b);c.byteLength===12&&(this[s]=c)}else if(b.length===24&&n.test(b))this[s]=ae.Buffer.from(b,"hex");else throw new TypeError("Argument passed in must be a Buffer or string of 12 bytes or a string of 24 hex characters");l.cacheHexString&&(this.__id=this.id.toString("hex"))}get id(){return this[s]}set id(b){this[s]=b,l.cacheHexString&&(this.__id=b.toString("hex"))}get generationTime(){return this.id.readInt32BE(0)}set generationTime(b){this.id.writeUInt32BE(b,0)}toHexString(){if(l.cacheHexString&&this.__id)return this.__id;let b=this.id.toString("hex");return l.cacheHexString&&!this.__id&&(this.__id=b),b}static getInc(){return l.index=(l.index+1)%16777215}static generate(b){typeof b!="number"&&(b=~~(Date.now()/1e3));let c=l.getInc(),h=ae.Buffer.alloc(12);return h.writeUInt32BE(b,0),h[4]=r[0],h[5]=r[1],h[6]=r[2],h[7]=r[3],h[8]=r[4],h[11]=c&255,h[10]=c>>8&255,h[9]=c>>16&255,h}toString(b){return b?this.id.toString(b):this.toHexString()}toJSON(){return this.toHexString()}equals(b){return b==null?!1:b instanceof l?this.toString()===b.toString():typeof b=="string"&&l.isValid(b)&&b.length===12&&this.id instanceof ae.Buffer?b===this.id.toString("binary"):typeof b=="string"&&l.isValid(b)&&b.length===24?b.toLowerCase()===this.toHexString():typeof b=="string"&&l.isValid(b)&&b.length===12?ae.Buffer.from(b).equals(this.id):typeof b=="object"&&"toHexString"in b&&typeof b.toHexString=="function"?b.toHexString()===this.toHexString():!1}getTimestamp(){let b=new Date,c=this.id.readUInt32BE(0);return b.setTime(Math.floor(c)*1e3),b}static createPk(){return new l}static createFromTime(b){let c=ae.Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0]);return c.writeUInt32BE(b,0),new l(c)}static createFromHexString(b){if(typeof b=="undefined"||b!=null&&b.length!==24)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new l(ae.Buffer.from(b,"hex"))}static isValid(b){return b==null?!1:typeof b=="number"?!0:typeof b=="string"?b.length===12||b.length===24&&n.test(b):b instanceof l||b instanceof ae.Buffer&&b.length===12?!0:typeof b=="object"&&"toHexString"in b&&typeof b.toHexString=="function"?typeof b.id=="string"?b.id.length===12:b.toHexString().length===24&&n.test(b.id.toString("hex")):!1}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(b){return new l(b.$oid)}}e.ObjectId=l,l.index=~~(Math.random()*16777215),Object.defineProperty(l.prototype,"generate",{value:ut.deprecate(u=>l.generate(u),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(l.prototype,"getInc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(l.prototype,"get_inc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(l,"get_inc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")});let p=Symbol.for("nodejs.util.inspect.custom");Object.defineProperty(l.prototype,p,l.prototype.toString),Object.defineProperty(l.prototype,"inspect",l.prototype.toString),Object.defineProperty(l.prototype,"_bsontype",{value:"ObjectID"})});Nt(Wi);QH=Wi.ObjectId,W=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_DATA_MAX_KEY=e.BSON_DATA_MIN_KEY=e.BSON_DATA_DECIMAL128=e.BSON_DATA_LONG=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_INT=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_SYMBOL=e.BSON_DATA_CODE=e.BSON_DATA_DBPOINTER=e.BSON_DATA_REGEXP=e.BSON_DATA_NULL=e.BSON_DATA_DATE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_OID=e.BSON_DATA_UNDEFINED=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_DATA_OBJECT=e.BSON_DATA_STRING=e.BSON_DATA_NUMBER=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=void 0,e.BSON_INT32_MAX=2147483647,e.BSON_INT32_MIN=-2147483648,e.BSON_INT64_MAX=Math.pow(2,63)-1,e.BSON_INT64_MIN=-Math.pow(2,63),e.JS_INT_MAX=Math.pow(2,53),e.JS_INT_MIN=-Math.pow(2,53),e.BSON_DATA_NUMBER=1,e.BSON_DATA_STRING=2,e.BSON_DATA_OBJECT=3,e.BSON_DATA_ARRAY=4,e.BSON_DATA_BINARY=5,e.BSON_DATA_UNDEFINED=6,e.BSON_DATA_OID=7,e.BSON_DATA_BOOLEAN=8,e.BSON_DATA_DATE=9,e.BSON_DATA_NULL=10,e.BSON_DATA_REGEXP=11,e.BSON_DATA_DBPOINTER=12,e.BSON_DATA_CODE=13,e.BSON_DATA_SYMBOL=14,e.BSON_DATA_CODE_W_SCOPE=15,e.BSON_DATA_INT=16,e.BSON_DATA_TIMESTAMP=17,e.BSON_DATA_LONG=18,e.BSON_DATA_DECIMAL128=19,e.BSON_DATA_MIN_KEY=255,e.BSON_DATA_MAX_KEY=127,e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BSON_BINARY_SUBTYPE_FUNCTION=1,e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=2,e.BSON_BINARY_SUBTYPE_UUID=3,e.BSON_BINARY_SUBTYPE_UUID_NEW=4,e.BSON_BINARY_SUBTYPE_MD5=5,e.BSON_BINARY_SUBTYPE_USER_DEFINED=128});Nt(W);$H=W.BSON_BINARY_SUBTYPE_USER_DEFINED,eD=W.BSON_BINARY_SUBTYPE_MD5,tD=W.BSON_BINARY_SUBTYPE_UUID_NEW,rD=W.BSON_BINARY_SUBTYPE_UUID,nD=W.BSON_BINARY_SUBTYPE_BYTE_ARRAY,iD=W.BSON_BINARY_SUBTYPE_FUNCTION,fD=W.BSON_BINARY_SUBTYPE_DEFAULT,oD=W.BSON_DATA_MAX_KEY,sD=W.BSON_DATA_MIN_KEY,lD=W.BSON_DATA_DECIMAL128,aD=W.BSON_DATA_LONG,pD=W.BSON_DATA_TIMESTAMP,uD=W.BSON_DATA_INT,cD=W.BSON_DATA_CODE_W_SCOPE,mD=W.BSON_DATA_SYMBOL,dD=W.BSON_DATA_CODE,wD=W.BSON_DATA_DBPOINTER,hD=W.BSON_DATA_REGEXP,bD=W.BSON_DATA_NULL,gD=W.BSON_DATA_DATE,jD=W.BSON_DATA_BOOLEAN,yD=W.BSON_DATA_OID,_D=W.BSON_DATA_UNDEFINED,vD=W.BSON_DATA_BINARY,qD=W.BSON_DATA_ARRAY,TD=W.BSON_DATA_OBJECT,kD=W.BSON_DATA_STRING,BD=W.BSON_DATA_NUMBER,ID=W.JS_INT_MIN,SD=W.JS_INT_MAX,xD=W.BSON_INT64_MIN,ED=W.BSON_INT64_MAX,AD=W.BSON_INT32_MIN,OD=W.BSON_INT32_MAX,Cd=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateObjectSize=void 0;function r(i,f,o){let s=4+1;if(Array.isArray(i))for(let l=0;l<i.length;l++)s+=n(l.toString(),i[l],f,!0,o);else{i.toBSON&&(i=i.toBSON());for(let l in i)s+=n(l,i[l],f,!1,o)}return s}e.calculateObjectSize=r;function n(i,f,o=!1,s=!1,l=!1){switch(f&&f.toBSON&&(f=f.toBSON()),typeof f){case"string":return 1+ae.Buffer.byteLength(i,"utf8")+1+4+ae.Buffer.byteLength(f,"utf8")+1;case"number":return Math.floor(f)===f&&f>=W.JS_INT_MIN&&f<=W.JS_INT_MAX&&f>=W.BSON_INT32_MIN&&f<=W.BSON_INT32_MAX?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(4+1):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);case"undefined":return s||!l?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1:0;case"boolean":return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(1+1);case"object":if(f==null||f._bsontype==="MinKey"||f._bsontype==="MaxKey")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1;if(f._bsontype==="ObjectId"||f._bsontype==="ObjectID")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(12+1);if(f instanceof Date||ut.isDate(f))return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(ArrayBuffer.isView(f)||f instanceof ArrayBuffer)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(1+4+1)+f.byteLength;if(f._bsontype==="Long"||f._bsontype==="Double"||f._bsontype==="Timestamp")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(f._bsontype==="Decimal128")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(16+1);if(f._bsontype==="Code")return f.scope!=null&&Object.keys(f.scope).length>0?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ae.Buffer.byteLength(f.code.toString(),"utf8")+1+r(f.scope,o,l):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+ae.Buffer.byteLength(f.code.toString(),"utf8")+1;if(f._bsontype==="Binary")return f.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(f.position+1+4+1+4):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(f.position+1+4+1);if(f._bsontype==="Symbol")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+ae.Buffer.byteLength(f.value,"utf8")+4+1+1;if(f._bsontype==="DBRef"){let p=Object.assign({$ref:f.collection,$id:f.oid},f.fields);return f.db!=null&&(p.$db=f.db),(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+r(p,o,l)}else return f instanceof RegExp||Object.prototype.toString.call(f)==="[object RegExp]"?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.source,"utf8")+1+(f.global?1:0)+(f.ignoreCase?1:0)+(f.multiline?1:0)+1:f._bsontype==="BSONRegExp"?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.pattern,"utf8")+1+ae.Buffer.byteLength(f.options,"utf8")+1:(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+r(f,o,l)+1;case"function":if(f instanceof RegExp||Object.prototype.toString.call(f)==="[object RegExp]"||String.call(f)==="[object RegExp]")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.source,"utf8")+1+(f.global?1:0)+(f.ignoreCase?1:0)+(f.multiline?1:0)+1;if(o&&f.scope!=null&&Object.keys(f.scope).length>0)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ae.Buffer.byteLength(ut.normalizedFunctionString(f),"utf8")+1+r(f.scope,o,l);if(o)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+ae.Buffer.byteLength(ut.normalizedFunctionString(f),"utf8")+1}return 0}});Nt(Cd);ND=Cd.calculateObjectSize,Nf=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONRegExp=void 0;function r(i){return i.split("").sort().join("")}class n{constructor(f,o){this.pattern=f,this.options=o??"",r(this.options);for(let s=0;s<this.options.length;s++)if(!(this.options[s]==="i"||this.options[s]==="m"||this.options[s]==="x"||this.options[s]==="l"||this.options[s]==="s"||this.options[s]==="u"))throw new Error(`The regular expression option [${this.options[s]}] is not supported`)}static parseOptions(f){return f?f.split("").sort().join(""):""}toExtendedJSON(f){return f=f||{},f.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(f){if("$regex"in f)if(typeof f.$regex!="string"){if(f.$regex._bsontype==="BSONRegExp")return f}else return new n(f.$regex,n.parseOptions(f.$options));if("$regularExpression"in f)return new n(f.$regularExpression.pattern,n.parseOptions(f.$regularExpression.options));throw new TypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(f)}`)}}e.BSONRegExp=n,Object.defineProperty(n.prototype,"_bsontype",{value:"BSONRegExp"})});Nt(Nf);RD=Nf.BSONRegExp,ks=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONSymbol=void 0;class r{constructor(i){this.value=i}valueOf(){return this.value}toString(){return this.value}inspect(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(i){return new r(i.$symbol)}}e.BSONSymbol=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Symbol"})});Nt(ks);HD=ks.BSONSymbol,Rf=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.LongWithoutOverridesClass=void 0,e.LongWithoutOverridesClass=de.Long;class r extends e.LongWithoutOverridesClass{constructor(i,f){de.Long.isLong(i)?super(i.low,i.high,!0):super(i,f,!0),Object.defineProperty(this,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1})}toJSON(){return{$timestamp:this.toString()}}static fromInt(i){return new r(de.Long.fromInt(i,!0))}static fromNumber(i){return new r(de.Long.fromNumber(i,!0))}static fromBits(i,f){return new r(i,f)}static fromString(i,f){return new r(de.Long.fromString(i,!0,f))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(i){return new r(i.$timestamp.i,i.$timestamp.t)}}e.Timestamp=r,r.MAX_VALUE=de.Long.MAX_UNSIGNED_VALUE});Nt(Rf);DD=Rf.Timestamp,zD=Rf.LongWithoutOverridesClass,gu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUtf8=void 0;let r=128,n=192,i=224,f=240,o=248,s=192,l=224,p=240,u=128;function b(c,h,k){let y=0;for(let R=h;R<k;R+=1){let L=c[R];if(y){if((L&n)!==u)return!1;y-=1}else if(L&r)if((L&i)===s)y=1;else if((L&f)===l)y=2;else if((L&o)===p)y=3;else return!1}return!y}e.validateUtf8=b});Nt(gu);FD=gu.validateUtf8,ju=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserialize=void 0;let r=de.Long.fromNumber(W.JS_INT_MAX),n=de.Long.fromNumber(W.JS_INT_MIN),i={};function f(l,p,u){p=p??{};let b=p&&p.index?p.index:0,c=l[b]|l[b+1]<<8|l[b+2]<<16|l[b+3]<<24;if(c<5)throw new Error(`bson size must be >= 5, is ${c}`);if(p.allowObjectSmallerThanBufferSize&&l.length<c)throw new Error(`buffer length ${l.length} must be >= bson size ${c}`);if(!p.allowObjectSmallerThanBufferSize&&l.length!==c)throw new Error(`buffer length ${l.length} must === bson size ${c}`);if(c+b>l.byteLength)throw new Error(`(bson size ${c} + options.index ${b} must be <= buffer length ${l.byteLength})`);if(l[b+c-1]!==0)throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return o(l,b,p,u)}e.deserialize=f;function o(l,p,u,b=!1){let c=u.evalFunctions==null?!1:u.evalFunctions,h=u.cacheFunctions==null?!1:u.cacheFunctions,k=u.fieldsAsRaw==null?null:u.fieldsAsRaw,y=u.raw==null?!1:u.raw,R=typeof u.bsonRegExp=="boolean"?u.bsonRegExp:!1,L=u.promoteBuffers==null?!1:u.promoteBuffers,D=u.promoteLongs==null?!0:u.promoteLongs,K=u.promoteValues==null?!0:u.promoteValues,ne=p;if(l.length<5)throw new Error("corrupt bson message < 5 bytes long");let Y=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(Y<5||Y>l.length)throw new Error("corrupt bson message");let N=b?[]:{},re=0,C=!1;for(;!C;){let g=l[p++];if(g===0)break;let O=p;for(;l[O]!==0&&O<l.length;)O++;if(O>=l.byteLength)throw new Error("Bad BSON Document: illegal CString");let w=b?re++:l.toString("utf8",p,O);if(p=O+1,g===W.BSON_DATA_STRING){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");if(!gu.validateUtf8(l,p,p+P-1))throw new Error("Invalid UTF-8 string in BSON document");let V=l.toString("utf8",p,p+P-1);N[w]=V,p=p+P}else if(g===W.BSON_DATA_OID){let P=ae.Buffer.alloc(12);l.copy(P,0,p,p+12),N[w]=new Wi.ObjectId(P),p=p+12}else if(g===W.BSON_DATA_INT&&K===!1)N[w]=new So.Int32(l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24);else if(g===W.BSON_DATA_INT)N[w]=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;else if(g===W.BSON_DATA_NUMBER&&K===!1)N[w]=new Io.Double(l.readDoubleLE(p)),p=p+8;else if(g===W.BSON_DATA_NUMBER)N[w]=l.readDoubleLE(p),p=p+8;else if(g===W.BSON_DATA_DATE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;N[w]=new Date(new de.Long(P,V).toNumber())}else if(g===W.BSON_DATA_BOOLEAN){if(l[p]!==0&&l[p]!==1)throw new Error("illegal boolean type value");N[w]=l[p++]===1}else if(g===W.BSON_DATA_OBJECT){let P=p,V=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24;if(V<=0||V>l.length-p)throw new Error("bad embedded document length in bson");y?N[w]=l.slice(p,p+V):N[w]=o(l,P,u,!1),p=p+V}else if(g===W.BSON_DATA_ARRAY){let P=p,V=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24,U=u,$=p+V;if(k&&k[w]){U={};for(let E in u)U[E]=u[E];U.raw=!0}if(N[w]=o(l,P,U,!0),p=p+V,l[p-1]!==0)throw new Error("invalid array terminator byte");if(p!==$)throw new Error("corrupted array bson")}else if(g===W.BSON_DATA_UNDEFINED)N[w]=void 0;else if(g===W.BSON_DATA_NULL)N[w]=null;else if(g===W.BSON_DATA_LONG){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,U=new de.Long(P,V);D&&K===!0?N[w]=U.lessThanOrEqual(r)&&U.greaterThanOrEqual(n)?U.toNumber():U:N[w]=U}else if(g===W.BSON_DATA_DECIMAL128){let P=ae.Buffer.alloc(16);l.copy(P,0,p,p+16),p=p+16;let V=new vs.Decimal128(P);"toObject"in V&&typeof V.toObject=="function"?N[w]=V.toObject():N[w]=V}else if(g===W.BSON_DATA_BINARY){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=P,U=l[p++];if(P<0)throw new Error("Negative binary type element size found");if(P>l.byteLength)throw new Error("Binary type size larger than document size");if(l.slice!=null){if(U===an.Binary.SUBTYPE_BYTE_ARRAY){if(P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,P<0)throw new Error("Negative binary type element size found for subtype 0x02");if(P>V-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(P<V-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}L&&K?N[w]=l.slice(p,p+P):N[w]=new an.Binary(l.slice(p,p+P),U)}else{let $=ae.Buffer.alloc(P);if(U===an.Binary.SUBTYPE_BYTE_ARRAY){if(P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,P<0)throw new Error("Negative binary type element size found for subtype 0x02");if(P>V-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(P<V-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}for(O=0;O<P;O++)$[O]=l[p+O];L&&K?N[w]=$:N[w]=new an.Binary($,U)}p=p+P}else if(g===W.BSON_DATA_REGEXP&&R===!1){for(O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let P=l.toString("utf8",p,O);for(p=O+1,O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let V=l.toString("utf8",p,O);p=O+1;let U=new Array(V.length);for(O=0;O<V.length;O++)switch(V[O]){case"m":U[O]="m";break;case"s":U[O]="g";break;case"i":U[O]="i";break}N[w]=new RegExp(P,U.join(""))}else if(g===W.BSON_DATA_REGEXP&&R===!0){for(O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let P=l.toString("utf8",p,O);for(p=O+1,O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let V=l.toString("utf8",p,O);p=O+1,N[w]=new Nf.BSONRegExp(P,V)}else if(g===W.BSON_DATA_SYMBOL){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");let V=l.toString("utf8",p,p+P-1);N[w]=K?V:new ks.BSONSymbol(V),p=p+P}else if(g===W.BSON_DATA_TIMESTAMP){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;N[w]=new Rf.Timestamp(P,V)}else if(g===W.BSON_DATA_MIN_KEY)N[w]=new Ts.MinKey;else if(g===W.BSON_DATA_MAX_KEY)N[w]=new qs.MaxKey;else if(g===W.BSON_DATA_CODE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");let V=l.toString("utf8",p,p+P-1);c?h?N[w]=s(V,i,N):N[w]=s(V):N[w]=new Of.Code(V),p=p+P}else if(g===W.BSON_DATA_CODE_W_SCOPE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<4+4+4+1)throw new Error("code_w_scope total size shorter minimum expected length");let V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(V<=0||V>l.length-p||l[p+V-1]!==0)throw new Error("bad string length in bson");let U=l.toString("utf8",p,p+V-1);p=p+V;let $=p,E=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24,xe=o(l,$,u,!1);if(p=p+E,P<4+4+E+V)throw new Error("code_w_scope total size is too short, truncating scope");if(P>4+4+E+V)throw new Error("code_w_scope total size is too long, clips outer document");c?(h?N[w]=s(U,i,N):N[w]=s(U),N[w].scope=xe):N[w]=new Of.Code(U,xe)}else if(g===W.BSON_DATA_DBPOINTER){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");if(!gu.validateUtf8(l,p,p+P-1))throw new Error("Invalid UTF-8 string in BSON document");let V=l.toString("utf8",p,p+P-1);p=p+P;let U=ae.Buffer.alloc(12);l.copy(U,0,p,p+12);let $=new Wi.ObjectId(U);p=p+12,N[w]=new Zn.DBRef(V,$)}else throw new Error("Detected unknown BSON type "+g.toString(16)+' for fieldname "'+w+'"')}if(Y!==p-ne)throw b?new Error("corrupt array bson"):new Error("corrupt object bson");let ie=Object.keys(N).filter(g=>g.startsWith("$")),j=!0;if(ie.forEach(g=>{["$ref","$id","$db"].indexOf(g)===-1&&(j=!1)}),!j)return N;if(Zn.isDBRefLike(N)){let g=Object.assign({},N);return delete g.$ref,delete g.$id,delete g.$db,new Zn.DBRef(N.$ref,N.$id,N.$db,g)}return N}function s(l,p,u){return p?(p[l]==null&&(p[l]=new Function(l)),p[l].bind(u)):new Function(l)}});Nt(ju);PD=ju.deserialize,Ql=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=e.isBSONType=void 0;function r(y){return ut.isObjectLike(y)&&Reflect.has(y,"_bsontype")&&typeof y._bsontype=="string"}e.isBSONType=r;let n=2147483647,i=-2147483648,f=9223372036854776e3,o=-9223372036854776e3,s={$oid:Wi.ObjectId,$binary:an.Binary,$uuid:an.Binary,$symbol:ks.BSONSymbol,$numberInt:So.Int32,$numberDecimal:vs.Decimal128,$numberDouble:Io.Double,$numberLong:de.Long,$minKey:Ts.MinKey,$maxKey:qs.MaxKey,$regex:Nf.BSONRegExp,$regularExpression:Nf.BSONRegExp,$timestamp:Rf.Timestamp};function l(y,R={}){if(typeof y=="number"){if(R.relaxed||R.legacy)return y;if(Math.floor(y)===y){if(y>=i&&y<=n)return new So.Int32(y);if(y>=o&&y<=f)return de.Long.fromNumber(y)}return new Io.Double(y)}if(y==null||typeof y!="object")return y;if(y.$undefined)return null;let L=Object.keys(y).filter(D=>D.startsWith("$")&&y[D]!=null);for(let D=0;D<L.length;D++){let K=s[L[D]];if(K)return K.fromExtendedJSON(y,R)}if(y.$date!=null){let D=y.$date,K=new Date;return R.legacy?typeof D=="number"?K.setTime(D):typeof D=="string"&&K.setTime(Date.parse(D)):typeof D=="string"?K.setTime(Date.parse(D)):de.Long.isLong(D)?K.setTime(D.toNumber()):typeof D=="number"&&R.relaxed&&K.setTime(D),K}if(y.$code!=null){let D=Object.assign({},y);return y.$scope&&(D.$scope=l(y.$scope)),Of.Code.fromExtendedJSON(y)}if(y.$ref!=null||y.$dbPointer!=null){let D=y.$ref?y:y.$dbPointer;if(D instanceof Zn.DBRef)return D;let K=Object.keys(D).filter(Y=>Y.startsWith("$")),ne=!0;if(K.forEach(Y=>{["$ref","$id","$db"].indexOf(Y)===-1&&(ne=!1)}),ne)return Zn.DBRef.fromExtendedJSON(D)}return y}function p(y,R){return y.map(L=>b(L,R))}function u(y){let R=y.toISOString();return y.getUTCMilliseconds()!==0?R:R.slice(0,-5)+"Z"}function b(y,R){if(Array.isArray(y))return p(y,R);if(y===void 0)return null;if(y instanceof Date){let L=y.getTime(),D=L>-1&&L<2534023188e5;return R.legacy?R.relaxed&&D?{$date:y.getTime()}:{$date:u(y)}:R.relaxed&&D?{$date:u(y)}:{$date:{$numberLong:y.getTime().toString()}}}if(typeof y=="number"&&!R.relaxed){if(Math.floor(y)===y){let L=y>=i&&y<=n,D=y>=o&&y<=f;if(L)return{$numberInt:y.toString()};if(D)return{$numberLong:y.toString()}}return{$numberDouble:y.toString()}}if(y instanceof RegExp){let L=y.flags;if(L===void 0){let K=y.toString().match(/[gimuy]*$/);K&&(L=K[0])}return new Nf.BSONRegExp(y.source,L).toExtendedJSON(R)}return y!=null&&typeof y=="object"?h(y,R):y}let c={Binary:y=>new an.Binary(y.value(),y.sub_type),Code:y=>new Of.Code(y.code,y.scope),DBRef:y=>new Zn.DBRef(y.collection||y.namespace,y.oid,y.db,y.fields),Decimal128:y=>new vs.Decimal128(y.bytes),Double:y=>new Io.Double(y.value),Int32:y=>new So.Int32(y.value),Long:y=>de.Long.fromBits(y.low!=null?y.low:y.low_,y.low!=null?y.high:y.high_,y.low!=null?y.unsigned:y.unsigned_),MaxKey:()=>new qs.MaxKey,MinKey:()=>new Ts.MinKey,ObjectID:y=>new Wi.ObjectId(y),ObjectId:y=>new Wi.ObjectId(y),BSONRegExp:y=>new Nf.BSONRegExp(y.pattern,y.options),Symbol:y=>new ks.BSONSymbol(y.value),Timestamp:y=>Rf.Timestamp.fromBits(y.low,y.high)};function h(y,R){if(y==null||typeof y!="object")throw new Error("not an object instance");let L=y._bsontype;if(typeof L=="undefined"){let D={};for(let K in y)D[K]=b(y[K],R);return D}else if(r(y)){let D=y;if(typeof D.toExtendedJSON!="function"){let K=c[y._bsontype];if(!K)throw new TypeError("Unrecognized or invalid _bsontype: "+y._bsontype);D=K(D)}return L==="Code"&&D.scope?D=new Of.Code(D.code,b(D.scope,R)):L==="DBRef"&&D.oid&&(D=new Zn.DBRef(D.collection,b(D.oid,R),D.db,D.fields)),D.toExtendedJSON(R)}else throw new Error("_bsontype must be a string, but was: "+typeof L)}var k;(function(y){function R(ne,Y){let N=Object.assign({},{relaxed:!0,legacy:!1},Y);return typeof N.relaxed=="boolean"&&(N.strict=!N.relaxed),typeof N.strict=="boolean"&&(N.relaxed=!N.strict),JSON.parse(ne,(re,C)=>l(C,N))}y.parse=R;function L(ne,Y,N,re){N!=null&&typeof N=="object"&&(re=N,N=0),Y!=null&&typeof Y=="object"&&!Array.isArray(Y)&&(re=Y,Y=void 0,N=0),re=Object.assign({},{relaxed:!0,legacy:!1},re);let C=b(ne,re);return JSON.stringify(C,Y,N)}y.stringify=L;function D(ne,Y){return Y=Y||{},JSON.parse(L(ne,Y))}y.serialize=D;function K(ne,Y){return Y=Y||{},R(JSON.stringify(ne),Y)}y.deserialize=K})(k=e.EJSON||(e.EJSON={}))});Nt(Ql);LD=Ql.EJSON,UD=Ql.isBSONType,$l=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.writeIEEE754=e.readIEEE754=void 0;function r(i,f,o,s,l){let p,u,b=o==="big",c=l*8-s-1,h=(1<<c)-1,k=h>>1,y=-7,R=b?0:l-1,L=b?1:-1,D=i[f+R];for(R+=L,p=D&(1<<-y)-1,D>>=-y,y+=c;y>0;p=p*256+i[f+R],R+=L,y-=8);for(u=p&(1<<-y)-1,p>>=-y,y+=s;y>0;u=u*256+i[f+R],R+=L,y-=8);if(p===0)p=1-k;else{if(p===h)return u?NaN:(D?-1:1)*(1/0);u=u+Math.pow(2,s),p=p-k}return(D?-1:1)*u*Math.pow(2,p-s)}e.readIEEE754=r;function n(i,f,o,s,l,p){let u,b,c,h=s==="big",k=p*8-l-1,y=(1<<k)-1,R=y>>1,L=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=h?p-1:0,K=h?-1:1,ne=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(b=isNaN(f)?1:0,u=y):(u=Math.floor(Math.log(f)/Math.LN2),f*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+R>=1?f+=L/c:f+=L*Math.pow(2,1-R),f*c>=2&&(u++,c/=2),u+R>=y?(b=0,u=y):u+R>=1?(b=(f*c-1)*Math.pow(2,l),u=u+R):(b=f*Math.pow(2,R-1)*Math.pow(2,l),u=0)),isNaN(f)&&(b=0);l>=8;)i[o+D]=b&255,D+=K,b/=256,l-=8;for(u=u<<l|b,isNaN(f)&&(u+=8),k+=l;k>0;)i[o+D]=u&255,D+=K,u/=256,k-=8;i[o+D-K]|=ne*128}e.writeIEEE754=n});Nt($l);MD=$l.writeIEEE754,CD=$l.readIEEE754,yu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeInto=void 0;let r=/\x00/,n=new Set(["$db","$ref","$id","$clusterTime"]);function i(j){return Object.prototype.toString.call(j)==="[object RegExp]"}function f(j,g,O,w,P){j[w++]=W.BSON_DATA_STRING;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V+1,j[w-1]=0;let U=j.write(O,w+4,void 0,"utf8");return j[w+3]=U+1>>24&255,j[w+2]=U+1>>16&255,j[w+1]=U+1>>8&255,j[w]=U+1&255,w=w+4+U,j[w++]=0,w}function o(j,g,O,w,P){if(Number.isInteger(O)&&O>=W.BSON_INT32_MIN&&O<=W.BSON_INT32_MAX){j[w++]=W.BSON_DATA_INT;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0,j[w++]=O&255,j[w++]=O>>8&255,j[w++]=O>>16&255,j[w++]=O>>24&255}else{j[w++]=W.BSON_DATA_NUMBER;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0,$l.writeIEEE754(j,O,w,"little",52,8),w=w+8}return w}function s(j,g,O,w,P){j[w++]=W.BSON_DATA_NULL;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,w}function l(j,g,O,w,P){j[w++]=W.BSON_DATA_BOOLEAN;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,j[w++]=O?1:0,w}function p(j,g,O,w,P){j[w++]=W.BSON_DATA_DATE;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=de.Long.fromNumber(O.getTime()),$=U.getLowBits(),E=U.getHighBits();return j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,j[w++]=E&255,j[w++]=E>>8&255,j[w++]=E>>16&255,j[w++]=E>>24&255,w}function u(j,g,O,w,P){j[w++]=W.BSON_DATA_REGEXP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,O.source&&O.source.match(r)!=null)throw Error("value "+O.source+" must not contain null bytes");return w=w+j.write(O.source,w,void 0,"utf8"),j[w++]=0,O.ignoreCase&&(j[w++]=105),O.global&&(j[w++]=115),O.multiline&&(j[w++]=109),j[w++]=0,w}function b(j,g,O,w,P){j[w++]=W.BSON_DATA_REGEXP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,O.pattern.match(r)!=null)throw Error("pattern "+O.pattern+" must not contain null bytes");return w=w+j.write(O.pattern,w,void 0,"utf8"),j[w++]=0,w=w+j.write(O.options.split("").sort().join(""),w,void 0,"utf8"),j[w++]=0,w}function c(j,g,O,w,P){O===null?j[w++]=W.BSON_DATA_NULL:O._bsontype==="MinKey"?j[w++]=W.BSON_DATA_MIN_KEY:j[w++]=W.BSON_DATA_MAX_KEY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,w}function h(j,g,O,w,P){j[w++]=W.BSON_DATA_OID;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,typeof O.id=="string")j.write(O.id,w,void 0,"binary");else if(O.id&&O.id.copy)O.id.copy(j,w,0,12);else throw new TypeError("object ["+JSON.stringify(O)+"] is not a valid ObjectId");return w+12}function k(j,g,O,w,P){j[w++]=W.BSON_DATA_BINARY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.length;return j[w++]=U&255,j[w++]=U>>8&255,j[w++]=U>>16&255,j[w++]=U>>24&255,j[w++]=W.BSON_BINARY_SUBTYPE_DEFAULT,j.set(Af.ensureBuffer(O),w),w=w+U,w}function y(j,g,O,w,P=!1,V=0,U=!1,$=!0,E=!1,xe=[]){for(let G=0;G<xe.length;G++)if(xe[G]===O)throw new Error("cyclic dependency detected");xe.push(O),j[w++]=Array.isArray(O)?W.BSON_DATA_ARRAY:W.BSON_DATA_OBJECT;let fe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+fe,j[w++]=0;let M=ie(j,O,P,w,V+1,U,$,xe);return xe.pop(),M}function R(j,g,O,w,P){j[w++]=W.BSON_DATA_DECIMAL128;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,O.bytes.copy(j,w,0,16),w+16}function L(j,g,O,w,P){j[w++]=O._bsontype==="Long"?W.BSON_DATA_LONG:W.BSON_DATA_TIMESTAMP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.getLowBits(),$=O.getHighBits();return j[w++]=U&255,j[w++]=U>>8&255,j[w++]=U>>16&255,j[w++]=U>>24&255,j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,w}function D(j,g,O,w,P){O=O.valueOf(),j[w++]=W.BSON_DATA_INT;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,j[w++]=O&255,j[w++]=O>>8&255,j[w++]=O>>16&255,j[w++]=O>>24&255,w}function K(j,g,O,w,P){j[w++]=W.BSON_DATA_NUMBER;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,$l.writeIEEE754(j,O.value,w,"little",52,8),w=w+8,w}function ne(j,g,O,w,P=!1,V=0,U){j[w++]=W.BSON_DATA_CODE;let $=U?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+$,j[w++]=0;let E=ut.normalizedFunctionString(O),xe=j.write(E,w+4,void 0,"utf8")+1;return j[w]=xe&255,j[w+1]=xe>>8&255,j[w+2]=xe>>16&255,j[w+3]=xe>>24&255,w=w+4+xe-1,j[w++]=0,w}function Y(j,g,O,w,P=!1,V=0,U=!1,$=!0,E=!1){if(O.scope&&typeof O.scope=="object"){j[w++]=W.BSON_DATA_CODE_W_SCOPE;let xe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+xe,j[w++]=0;let fe=w,M=typeof O.code=="string"?O.code:O.code.toString();w=w+4;let G=j.write(M,w+4,void 0,"utf8")+1;j[w]=G&255,j[w+1]=G>>8&255,j[w+2]=G>>16&255,j[w+3]=G>>24&255,j[w+4+G-1]=0,w=w+G+4;let Se=ie(j,O.scope,P,w,V+1,U,$);w=Se-1;let se=Se-fe;j[fe++]=se&255,j[fe++]=se>>8&255,j[fe++]=se>>16&255,j[fe++]=se>>24&255,j[w++]=0}else{j[w++]=W.BSON_DATA_CODE;let xe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+xe,j[w++]=0;let fe=O.code.toString(),M=j.write(fe,w+4,void 0,"utf8")+1;j[w]=M&255,j[w+1]=M>>8&255,j[w+2]=M>>16&255,j[w+3]=M>>24&255,w=w+4+M-1,j[w++]=0}return w}function N(j,g,O,w,P){j[w++]=W.BSON_DATA_BINARY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.value(!0),$=O.position;return O.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY&&($=$+4),j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,j[w++]=O.sub_type,O.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY&&($=$-4,j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255),j.set(U,w),w=w+O.position,w}function re(j,g,O,w,P){j[w++]=W.BSON_DATA_SYMBOL;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=j.write(O.value,w+4,void 0,"utf8")+1;return j[w]=U&255,j[w+1]=U>>8&255,j[w+2]=U>>16&255,j[w+3]=U>>24&255,w=w+4+U-1,j[w++]=0,w}function C(j,g,O,w,P,V,U){j[w++]=W.BSON_DATA_OBJECT;let $=U?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+$,j[w++]=0;let E=w,xe={$ref:O.collection||O.namespace,$id:O.oid};O.db!=null&&(xe.$db=O.db),xe=Object.assign(xe,O.fields);let fe=ie(j,xe,!1,w,P+1,V),M=fe-E;return j[E++]=M&255,j[E++]=M>>8&255,j[E++]=M>>16&255,j[E++]=M>>24&255,fe}function ie(j,g,O=!1,w=0,P=0,V=!1,U=!0,$=[]){w=w||0,$=$||[],$.push(g);let E=w+4;if(Array.isArray(g))for(let fe=0;fe<g.length;fe++){let M=""+fe,G=g[fe];if(G&&G.toBSON){if(typeof G.toBSON!="function")throw new TypeError("toBSON is not a function");G=G.toBSON()}if(typeof G=="string")E=f(j,M,G,E,!0);else if(typeof G=="number")E=o(j,M,G,E,!0);else{if(typeof G=="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(typeof G=="boolean")E=l(j,M,G,E,!0);else if(G instanceof Date||ut.isDate(G))E=p(j,M,G,E,!0);else if(G===void 0)E=s(j,M,G,E,!0);else if(G===null)E=s(j,M,G,E,!0);else if(G._bsontype==="ObjectId"||G._bsontype==="ObjectID")E=h(j,M,G,E,!0);else if(ae.Buffer.isBuffer(G)||ut.isUint8Array(G))E=k(j,M,G,E,!0);else if(G instanceof RegExp||i(G))E=u(j,M,G,E,!0);else if(typeof G=="object"&&G._bsontype==null)E=y(j,M,G,E,O,P,V,U,!0,$);else if(typeof G=="object"&&Ql.isBSONType(G)&&G._bsontype==="Decimal128")E=R(j,M,G,E,!0);else if(G._bsontype==="Long"||G._bsontype==="Timestamp")E=L(j,M,G,E,!0);else if(G._bsontype==="Double")E=K(j,M,G,E,!0);else if(typeof G=="function"&&V)E=ne(j,M,G,E,O,P,!0);else if(G._bsontype==="Code")E=Y(j,M,G,E,O,P,V,U,!0);else if(G._bsontype==="Binary")E=N(j,M,G,E,!0);else if(G._bsontype==="Symbol")E=re(j,M,G,E,!0);else if(G._bsontype==="DBRef")E=C(j,M,G,E,P,V,!0);else if(G._bsontype==="BSONRegExp")E=b(j,M,G,E,!0);else if(G._bsontype==="Int32")E=D(j,M,G,E,!0);else if(G._bsontype==="MinKey"||G._bsontype==="MaxKey")E=c(j,M,G,E,!0);else if(typeof G._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+G._bsontype)}}else if(g instanceof bu.Map){let fe=g.entries(),M=!1;for(;!M;){let G=fe.next();if(M=!!G.done,M)continue;let Se=G.value[0],se=G.value[1],Ye=typeof se;if(typeof Se=="string"&&!n.has(Se)){if(Se.match(r)!=null)throw Error("key "+Se+" must not contain null bytes");if(O){if(Se[0]==="$")throw Error("key "+Se+" must not start with '$'");if(~Se.indexOf("."))throw Error("key "+Se+" must not contain '.'")}}if(Ye==="string")E=f(j,Se,se,E);else if(Ye==="number")E=o(j,Se,se,E);else{if(Ye==="bigint"||ut.isBigInt64Array(se)||ut.isBigUInt64Array(se))throw new TypeError("Unsupported type BigInt, please use Decimal128");if(Ye==="boolean")E=l(j,Se,se,E);else if(se instanceof Date||ut.isDate(se))E=p(j,Se,se,E);else if(se===null||se===void 0&&U===!1)E=s(j,Se,se,E);else if(se._bsontype==="ObjectId"||se._bsontype==="ObjectID")E=h(j,Se,se,E);else if(ae.Buffer.isBuffer(se)||ut.isUint8Array(se))E=k(j,Se,se,E);else if(se instanceof RegExp||i(se))E=u(j,Se,se,E);else if(Ye==="object"&&se._bsontype==null)E=y(j,Se,se,E,O,P,V,U,!1,$);else if(Ye==="object"&&se._bsontype==="Decimal128")E=R(j,Se,se,E);else if(se._bsontype==="Long"||se._bsontype==="Timestamp")E=L(j,Se,se,E);else if(se._bsontype==="Double")E=K(j,Se,se,E);else if(se._bsontype==="Code")E=Y(j,Se,se,E,O,P,V,U);else if(typeof se=="function"&&V)E=ne(j,Se,se,E,O,P,V);else if(se._bsontype==="Binary")E=N(j,Se,se,E);else if(se._bsontype==="Symbol")E=re(j,Se,se,E);else if(se._bsontype==="DBRef")E=C(j,Se,se,E,P,V);else if(se._bsontype==="BSONRegExp")E=b(j,Se,se,E);else if(se._bsontype==="Int32")E=D(j,Se,se,E);else if(se._bsontype==="MinKey"||se._bsontype==="MaxKey")E=c(j,Se,se,E);else if(typeof se._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+se._bsontype)}}}else{if(g.toBSON){if(typeof g.toBSON!="function")throw new TypeError("toBSON is not a function");if(g=g.toBSON(),g!=null&&typeof g!="object")throw new TypeError("toBSON function did not return an object")}for(let fe in g){let M=g[fe];if(M&&M.toBSON){if(typeof M.toBSON!="function")throw new TypeError("toBSON is not a function");M=M.toBSON()}let G=typeof M;if(typeof fe=="string"&&!n.has(fe)){if(fe.match(r)!=null)throw Error("key "+fe+" must not contain null bytes");if(O){if(fe[0]==="$")throw Error("key "+fe+" must not start with '$'");if(~fe.indexOf("."))throw Error("key "+fe+" must not contain '.'")}}if(G==="string")E=f(j,fe,M,E);else if(G==="number")E=o(j,fe,M,E);else{if(G==="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(G==="boolean")E=l(j,fe,M,E);else if(M instanceof Date||ut.isDate(M))E=p(j,fe,M,E);else if(M===void 0)U===!1&&(E=s(j,fe,M,E));else if(M===null)E=s(j,fe,M,E);else if(M._bsontype==="ObjectId"||M._bsontype==="ObjectID")E=h(j,fe,M,E);else if(ae.Buffer.isBuffer(M)||ut.isUint8Array(M))E=k(j,fe,M,E);else if(M instanceof RegExp||i(M))E=u(j,fe,M,E);else if(G==="object"&&M._bsontype==null)E=y(j,fe,M,E,O,P,V,U,!1,$);else if(G==="object"&&M._bsontype==="Decimal128")E=R(j,fe,M,E);else if(M._bsontype==="Long"||M._bsontype==="Timestamp")E=L(j,fe,M,E);else if(M._bsontype==="Double")E=K(j,fe,M,E);else if(M._bsontype==="Code")E=Y(j,fe,M,E,O,P,V,U);else if(typeof M=="function"&&V)E=ne(j,fe,M,E,O,P,V);else if(M._bsontype==="Binary")E=N(j,fe,M,E);else if(M._bsontype==="Symbol")E=re(j,fe,M,E);else if(M._bsontype==="DBRef")E=C(j,fe,M,E,P,V);else if(M._bsontype==="BSONRegExp")E=b(j,fe,M,E);else if(M._bsontype==="Int32")E=D(j,fe,M,E);else if(M._bsontype==="MinKey"||M._bsontype==="MaxKey")E=c(j,fe,M,E);else if(typeof M._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+M._bsontype)}}}$.pop(),j[E++]=0;let xe=E-w;return j[w++]=xe&255,j[w++]=xe>>8&255,j[w++]=xe>>16&255,j[w++]=xe>>24&255,E}e.serializeInto=ie});Nt(yu);VD=yu.serializeInto,we=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeStream=e.calculateObjectSize=e.deserialize=e.serializeWithBufferAndIndex=e.serialize=e.setInternalBufferSize=e.ObjectID=e.Decimal128=e.BSONRegExp=e.MaxKey=e.MinKey=e.Int32=e.Double=e.Timestamp=e.Long=e.ObjectId=e.Binary=e.DBRef=e.BSONSymbol=e.Map=e.Code=e.LongWithoutOverridesClass=e.EJSON=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=e.BSON_DATA_UNDEFINED=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_SYMBOL=e.BSON_DATA_STRING=e.BSON_DATA_REGEXP=e.BSON_DATA_OID=e.BSON_DATA_OBJECT=e.BSON_DATA_NUMBER=e.BSON_DATA_NULL=e.BSON_DATA_MIN_KEY=e.BSON_DATA_MAX_KEY=e.BSON_DATA_LONG=e.BSON_DATA_INT=e.BSON_DATA_DECIMAL128=e.BSON_DATA_DBPOINTER=e.BSON_DATA_DATE=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_CODE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=void 0,Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return an.Binary}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return Of.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return Zn.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return vs.Decimal128}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return Io.Double}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return So.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return de.Long}}),Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return bu.Map}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return qs.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return Ts.MinKey}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return Wi.ObjectId}}),Object.defineProperty(e,"ObjectID",{enumerable:!0,get:function(){return Wi.ObjectId}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return Nf.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return ks.BSONSymbol}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return Rf.Timestamp}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_BYTE_ARRAY",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_BYTE_ARRAY}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_DEFAULT",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_DEFAULT}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_FUNCTION",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_FUNCTION}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_MD5",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_MD5}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_USER_DEFINED",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_USER_DEFINED}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_UUID}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID_NEW",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_UUID_NEW}}),Object.defineProperty(e,"BSON_DATA_ARRAY",{enumerable:!0,get:function(){return W.BSON_DATA_ARRAY}}),Object.defineProperty(e,"BSON_DATA_BINARY",{enumerable:!0,get:function(){return W.BSON_DATA_BINARY}}),Object.defineProperty(e,"BSON_DATA_BOOLEAN",{enumerable:!0,get:function(){return W.BSON_DATA_BOOLEAN}}),Object.defineProperty(e,"BSON_DATA_CODE",{enumerable:!0,get:function(){return W.BSON_DATA_CODE}}),Object.defineProperty(e,"BSON_DATA_CODE_W_SCOPE",{enumerable:!0,get:function(){return W.BSON_DATA_CODE_W_SCOPE}}),Object.defineProperty(e,"BSON_DATA_DATE",{enumerable:!0,get:function(){return W.BSON_DATA_DATE}}),Object.defineProperty(e,"BSON_DATA_DBPOINTER",{enumerable:!0,get:function(){return W.BSON_DATA_DBPOINTER}}),Object.defineProperty(e,"BSON_DATA_DECIMAL128",{enumerable:!0,get:function(){return W.BSON_DATA_DECIMAL128}}),Object.defineProperty(e,"BSON_DATA_INT",{enumerable:!0,get:function(){return W.BSON_DATA_INT}}),Object.defineProperty(e,"BSON_DATA_LONG",{enumerable:!0,get:function(){return W.BSON_DATA_LONG}}),Object.defineProperty(e,"BSON_DATA_MAX_KEY",{enumerable:!0,get:function(){return W.BSON_DATA_MAX_KEY}}),Object.defineProperty(e,"BSON_DATA_MIN_KEY",{enumerable:!0,get:function(){return W.BSON_DATA_MIN_KEY}}),Object.defineProperty(e,"BSON_DATA_NULL",{enumerable:!0,get:function(){return W.BSON_DATA_NULL}}),Object.defineProperty(e,"BSON_DATA_NUMBER",{enumerable:!0,get:function(){return W.BSON_DATA_NUMBER}}),Object.defineProperty(e,"BSON_DATA_OBJECT",{enumerable:!0,get:function(){return W.BSON_DATA_OBJECT}}),Object.defineProperty(e,"BSON_DATA_OID",{enumerable:!0,get:function(){return W.BSON_DATA_OID}}),Object.defineProperty(e,"BSON_DATA_REGEXP",{enumerable:!0,get:function(){return W.BSON_DATA_REGEXP}}),Object.defineProperty(e,"BSON_DATA_STRING",{enumerable:!0,get:function(){return W.BSON_DATA_STRING}}),Object.defineProperty(e,"BSON_DATA_SYMBOL",{enumerable:!0,get:function(){return W.BSON_DATA_SYMBOL}}),Object.defineProperty(e,"BSON_DATA_TIMESTAMP",{enumerable:!0,get:function(){return W.BSON_DATA_TIMESTAMP}}),Object.defineProperty(e,"BSON_DATA_UNDEFINED",{enumerable:!0,get:function(){return W.BSON_DATA_UNDEFINED}}),Object.defineProperty(e,"BSON_INT32_MAX",{enumerable:!0,get:function(){return W.BSON_INT32_MAX}}),Object.defineProperty(e,"BSON_INT32_MIN",{enumerable:!0,get:function(){return W.BSON_INT32_MIN}}),Object.defineProperty(e,"BSON_INT64_MAX",{enumerable:!0,get:function(){return W.BSON_INT64_MAX}}),Object.defineProperty(e,"BSON_INT64_MIN",{enumerable:!0,get:function(){return W.BSON_INT64_MIN}}),Object.defineProperty(e,"JS_INT_MAX",{enumerable:!0,get:function(){return W.JS_INT_MAX}}),Object.defineProperty(e,"JS_INT_MIN",{enumerable:!0,get:function(){return W.JS_INT_MIN}}),Object.defineProperty(e,"EJSON",{enumerable:!0,get:function(){return Ql.EJSON}});var r=Rf;Object.defineProperty(e,"LongWithoutOverridesClass",{enumerable:!0,get:function(){return r.LongWithoutOverridesClass}});let n=1024*1024*17,i=ae.Buffer.alloc(n);function f(b){i.length<b&&(i=ae.Buffer.alloc(b))}e.setInternalBufferSize=f;function o(b,c={}){let h=typeof c.checkKeys=="boolean"?c.checkKeys:!1,k=typeof c.serializeFunctions=="boolean"?c.serializeFunctions:!1,y=typeof c.ignoreUndefined=="boolean"?c.ignoreUndefined:!0,R=typeof c.minInternalBufferSize=="number"?c.minInternalBufferSize:n;i.length<R&&(i=ae.Buffer.alloc(R));let L=yu.serializeInto(i,b,h,0,0,k,y,[]),D=ae.Buffer.alloc(L);return i.copy(D,0,0,D.length),D}e.serialize=o;function s(b,c,h={}){let k=typeof h.checkKeys=="boolean"?h.checkKeys:!1,y=typeof h.serializeFunctions=="boolean"?h.serializeFunctions:!1,R=typeof h.ignoreUndefined=="boolean"?h.ignoreUndefined:!0,L=typeof h.index=="number"?h.index:0,D=yu.serializeInto(i,b,k,0,0,y,R);return i.copy(c,L,0,D),L+D-1}e.serializeWithBufferAndIndex=s;function l(b,c={}){return ju.deserialize(Af.ensureBuffer(b),c)}e.deserialize=l;function p(b,c={}){c=c||{};let h=typeof c.serializeFunctions=="boolean"?c.serializeFunctions:!1,k=typeof c.ignoreUndefined=="boolean"?c.ignoreUndefined:!0;return Cd.calculateObjectSize(b,h,k)}e.calculateObjectSize=p;function u(b,c,h,k,y,R){let L=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},R),D=Af.ensureBuffer(b),K=c;for(let ne=0;ne<h;ne++){let Y=D[K]|D[K+1]<<8|D[K+2]<<16|D[K+3]<<24;L.index=K,k[y+ne]=ju.deserialize(D,L),K=K+Y}return K}e.deserializeStream=u}),WD=Nt(we),YD=we.deserializeStream,KD=we.calculateObjectSize,e_=we.deserialize,GD=we.serializeWithBufferAndIndex,t_=we.serialize,JD=we.setInternalBufferSize,ZD=we.ObjectID,XD=we.Decimal128,QD=we.BSONRegExp,$D=we.MaxKey,ez=we.MinKey,tz=we.Int32,rz=we.Double,nz=we.Timestamp,iz=we.Long,fz=we.ObjectId,oz=we.Binary,sz=we.DBRef,lz=we.BSONSymbol,az=we.Map,pz=we.Code,uz=we.LongWithoutOverridesClass,cz=we.EJSON,mz=we.JS_INT_MIN,dz=we.JS_INT_MAX,wz=we.BSON_INT64_MIN,hz=we.BSON_INT64_MAX,bz=we.BSON_INT32_MIN,gz=we.BSON_INT32_MAX,jz=we.BSON_DATA_UNDEFINED,yz=we.BSON_DATA_TIMESTAMP,_z=we.BSON_DATA_SYMBOL,vz=we.BSON_DATA_STRING,qz=we.BSON_DATA_REGEXP,Tz=we.BSON_DATA_OID,kz=we.BSON_DATA_OBJECT,Bz=we.BSON_DATA_NUMBER,Iz=we.BSON_DATA_NULL,Sz=we.BSON_DATA_MIN_KEY,xz=we.BSON_DATA_MAX_KEY,Ez=we.BSON_DATA_LONG,Az=we.BSON_DATA_INT,Oz=we.BSON_DATA_DECIMAL128,Nz=we.BSON_DATA_DBPOINTER,Rz=we.BSON_DATA_DATE,Hz=we.BSON_DATA_CODE_W_SCOPE,Dz=we.BSON_DATA_CODE,zz=we.BSON_DATA_BOOLEAN,Fz=we.BSON_DATA_BINARY,Pz=we.BSON_DATA_ARRAY,Lz=we.BSON_BINARY_SUBTYPE_UUID_NEW,Uz=we.BSON_BINARY_SUBTYPE_UUID,Mz=we.BSON_BINARY_SUBTYPE_USER_DEFINED,Cz=we.BSON_BINARY_SUBTYPE_MD5,Vz=we.BSON_BINARY_SUBTYPE_FUNCTION,Wz=we.BSON_BINARY_SUBTYPE_DEFAULT,Yz=we.BSON_BINARY_SUBTYPE_BYTE_ARRAY});function Wd(t,e){return e_(new Uint8Array(t),e)}var r_=I(()=>{Vd()});async function oE(t,e){let r={...Yd.bson,...e==null?void 0:e.bson};return Wd(t,r)}function sE(t,e){let r={...Yd.bson,...e==null?void 0:e.bson};return Wd(t,r)}var fE,Yd,Kd,n_=I(()=>{r_();fE="4.0.0-alpha.10",Yd={bson:{}},Kd={name:"BSON",id:"bson",module:"bson",version:fE,extensions:["bson"],mimeTypes:["application/bson"],category:"json",binary:!0,parse:oE,parseSync:sE,options:Yd}});function Gd(t,e){return t_(t).buffer}var i_=I(()=>{Vd()});var lE,Jd,f_=I(()=>{i_();lE="4.0.0-alpha.10",Jd={name:"BSON",id:"bson",module:"bson",version:lE,extensions:["bson"],options:{bson:{}},async encode(t,e){return Gd(t,{})},encodeSync(t,e){return Gd(t,{})}}});var o_=I(()=>{n_();f_()});function s_(t,e,r){if(!(t in xo))throw new Error(`invalid type: ${t}`);return xo[t].toPrimitive(e,r)}function Zd(t,e,r){if(!(t in xo))throw new Error(`invalid type: ${t}`);return"fromPrimitive"in xo[t]?xo[t].fromPrimitive?.(e,r):e}function aE(t){return Boolean(t)}function pE(t){return Boolean(t)}function uE(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for FLOAT: ${t}`);return e}function cE(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for DOUBLE: ${t}`);return e}function mE(t){let e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error(`invalid value for INT8: ${t}`);return e}function dE(t){let e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error(`invalid value for UINT8: ${t}`);return e}function wE(t){let e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error(`invalid value for INT16: ${t}`);return e}function hE(t){let e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error(`invalid value for UINT16: ${t}`);return e}function l_(t){let e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error(`invalid value for INT32: ${t}`);return e}function bE(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(n<-2147483648||n>2147483647||isNaN(n))throw new Error(`invalid value for INT32: ${t}`);return n}function gE(t){let e=parseInt(t,10);if(e<0||e>281474976710655||isNaN(e))throw new Error(`invalid value for UINT32: ${t}`);return e}function a_(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT64: ${t}`);return e}function jE(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(isNaN(n))throw new Error(`invalid value for INT64: ${t}`);return n}function yE(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for UINT64: ${t}`);return e}function _E(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT96: ${t}`);return e}function p_(t){return Buffer.from(t)}function u_(t){return Buffer.from(t)}function vE(t){return Buffer.from(t,"utf8")}function qE(t){return t.toString()}function TE(t){return Buffer.from(JSON.stringify(t))}function kE(t){return JSON.parse(t)}function BE(t){let e=Jd.encodeSync?.(t);return Buffer.from(e)}function IE(t){return Kd.parseSync?.(t)}function SE(t){let e=parseInt(t,10);if(e<0||e>18446744073709552e3||isNaN(e))throw new Error(`invalid value for TIME_MILLIS: ${t}`);return e}function xE(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIME_MICROS: ${t}`);return e}function EE(t){if(t instanceof Date)return t.getTime()/c_;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for DATE: ${t}`);return e}}function AE(t){return new Date(t*c_)}function OE(t){if(t instanceof Date)return t.getTime();{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MILLIS: ${t}`);return e}}function NE(t){return new Date(t)}function RE(t){if(t instanceof Date)return t.getTime()*1e3;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MICROS: ${t}`);return e}}function HE(t){return new Date(t/1e3)}function DE(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");let e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e}function zE(t){let e=Buffer.from(t),r=e.readUInt32LE(0),n=e.readUInt32LE(4),i=e.readUInt32LE(8);return{months:r,days:n,milliseconds:i}}function m_(t,e){return Math.round(t*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}function d_(t,e){let r=0;if(t.length<=4)for(let i=0;i<t.length;i++)r+=t[i]<<8*(t.length-i-1);else for(let i=0;i<t.length;i++)r+=t[i]*2**(8*(t.length-1-i));return Math.round(r*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}var xo,c_,Xd=I(()=>{o_();xo={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:aE,fromPrimitive:pE},INT32:{primitiveType:"INT32",toPrimitive:l_},INT64:{primitiveType:"INT64",toPrimitive:a_},INT96:{primitiveType:"INT96",toPrimitive:_E},FLOAT:{primitiveType:"FLOAT",toPrimitive:uE},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:cE},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:p_},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:p_},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:vE,fromPrimitive:qE},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:SE},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:xE},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:EE,fromPrimitive:AE},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:OE,fromPrimitive:NE},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:RE,fromPrimitive:HE},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:dE},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:hE},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:gE},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:yE},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:mE},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:wE},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:l_},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:a_},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:TE,fromPrimitive:kE},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:BE,fromPrimitive:IE},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:DE,fromPrimitive:zE},DECIMAL_INT32:{primitiveType:"INT32",originalType:"DECIMAL_INT32",toPrimitive:bE,fromPrimitive:m_},DECIMAL_INT64:{primitiveType:"INT64",originalType:"DECIMAL_INT64",toPrimitive:jE,fromPrimitive:m_},DECIMAL_BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",originalType:"DECIMAL_BYTE_ARRAY",toPrimitive:u_,fromPrimitive:d_},DECIMAL_FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"DECIMAL_FIXED_LEN_BYTE_ARRAY",toPrimitive:u_,fromPrimitive:d_}};c_=864e5});function Qd(t){let e={};for(let r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],pageHeaders:[],count:0};return{rowCount:0,columnData:e}}function _u(t,e,r){let n=Qd(t).columnData;if($d(t.fields,e,n,0,0),r.rowCount===0){r.rowCount=1,r.columnData=n;return}r.rowCount+=1;for(let i of t.fieldList)Array.prototype.push.apply(r.columnData[i.key].rlevels,n[i.key].rlevels),Array.prototype.push.apply(r.columnData[i.key].dlevels,n[i.key].dlevels),Array.prototype.push.apply(r.columnData[i.key].values,n[i.key].values),r.columnData[i.key].count+=n[i.key].count}function $d(t,e,r,n,i){for(let f in t){let o=t[f],s=[];if(e&&o.name in e&&e[o.name]!==void 0&&e[o.name]!==null&&(e[o.name].constructor===Array?s=e[o.name]:s.push(e[o.name])),s.length===0&&Boolean(e)&&o.repetitionType==="REQUIRED")throw new Error(`missing required field: ${o.name}`);if(s.length>1&&o.repetitionType!=="REPEATED")throw new Error(`too many values for field: ${o.name}`);if(s.length===0){o.isNested?$d(o.fields,null,r,n,i):(r[o.key].count+=1,r[o.key].rlevels.push(n),r[o.key].dlevels.push(i));continue}for(let l=0;l<s.length;l++){let p=l===0?n:o.rLevelMax;o.isNested?$d(o.fields,s[l],r,p,o.dLevelMax):(r[o.key].count+=1,r[o.key].rlevels.push(p),r[o.key].dlevels.push(o.dLevelMax),r[o.key].values.push(s_(o.originalType||o.primitiveType,s[l])))}}}function vu(t,e){let r=[];for(let n=0;n<e.rowCount;n++)r.push({});for(let n in e.columnData){let i=e.columnData[n];i.count&&FE(t,i,n,r)}return r}function FE(t,e,r,n){let i=t.findField(r),f=t.findFieldBranch(r),o=new Array(i.rLevelMax+1).fill(0),s=0;for(let l=0;l<e.count;l++){let p=e.dlevels[l],u=e.rlevels[l];o[u]++,o.fill(0,u+1);let b=0,c=n[o[b++]-1];for(let h of f){if(h===i||p<h.dLevelMax)break;switch(h.repetitionType){case"REPEATED":h.name in c||(c[h.name]=[]);let k=o[b++];for(;c[h.name].length<=k;)c[h.name].push({});c=c[h.name][k];break;default:c[h.name]=c[h.name]||{},c=c[h.name]}}if(p===i.dLevelMax){let h=Zd(i.originalType||i.primitiveType,e.values[s],i);switch(s++,i.repetitionType){case"REPEATED":i.name in c||(c[i.name]=[]);let k=o[b];for(;c[i.name].length<=k;)c[i.name].push(null);c[i.name][k]=h;break;default:c[i.name]=h}}}}function w_(t,e){let r={};for(let n in e.columnData){let i=e.columnData[n];i.count&&PE(t,i,e.rowCount,n,r)}return r}function PE(t,e,r,n,i){if(e.count<=0)return;let f=t.findField(n),o=t.findFieldBranch(n),s=o[0].name,l,{values:p}=e;if(p.length===r&&o[0].primitiveType&&(l=p),l){i[s]=l;return}l=new Array(r);for(let c=0;c<r;c++)l[c]={};i[s]=l;let u=new Array(f.rLevelMax+1).fill(0),b=0;for(let c=0;c<e.count;c++){let h=e.dlevels[c],k=e.rlevels[c];u[k]++,u.fill(0,k+1);let y=0,R=l[u[y++]-1];for(let L of o){if(L===f||h<L.dLevelMax)break;switch(L.repetitionType){case"REPEATED":L.name in R||(R[L.name]=[]);let D=u[y++];for(;R[L.name].length<=D;)R[L.name].push({});R=R[L.name][D];break;default:R[L.name]=R[L.name]||{},R=R[L.name]}}if(h===f.dLevelMax){let L=Zd(f.originalType||f.primitiveType,e.values[b],f);switch(b++,f.repetitionType){case"REPEATED":f.name in R||(R[f.name]=[]);let D=u[y];for(;R[f.name].length<=D;)R[f.name].push(null);R[f.name][D]=L;break;default:R[f.name]=L}}}for(let c=0;c<r;++c)s in l[c]&&(l[c]=l[c][s])}var ea=I(()=>{Xd()});function ew(t,e){for(let r in t){let n=t[r];n.fields?ew(n.fields,e):n.compression=e}}function h_(t,e,r,n){let i={};for(let f in t){let o=t[f],s=!o.optional,l=Boolean(o.repeated),p=e,u=r,b="REQUIRED";if(s||(b="OPTIONAL",u++),l&&(b="REPEATED",p++,s&&u++),o.fields){let k=n.concat([f]);i[f]={name:f,path:k,key:k.join(),repetitionType:b,rLevelMax:p,dLevelMax:u,isNested:!0,fieldCount:Object.keys(o.fields).length,fields:h_(o.fields,p,u,k)};continue}let c=xo[o.type];if(!c)throw new Error(`invalid parquet type: ${o.type}`);if(o.encoding=o.encoding||"PLAIN",!(o.encoding in Tf))throw new Error(`unsupported parquet encoding: ${o.encoding}`);if(o.compression=o.compression||"UNCOMPRESSED",!(o.compression in Zl))throw new Error(`unsupported compression method: ${o.compression}`);let h=n.concat([f]);i[f]={name:f,primitiveType:c.primitiveType,originalType:c.originalType,path:h,key:h.join(),repetitionType:b,encoding:o.encoding,compression:o.compression,typeLength:o.typeLength||c.typeLength,presision:o.presision,scale:o.scale,rLevelMax:p,dLevelMax:u}}return i}function b_(t){let e=[];for(let r in t)e.push(t[r]),t[r].isNested&&(e=e.concat(b_(t[r].fields)));return e}var ta,tw=I(()=>{Sp();Xl();ea();Xd();ta=class{constructor(e){this.schema=e,this.fields=h_(e,0,0,[]),this.fieldList=b_(this.fields)}findField(e){typeof e=="string"?e=e.split(","):e=e.slice(0);let r=this.fields;for(;e.length>1;e.shift())r=r[e[0]].fields;return r[e[0]]}findFieldBranch(e){typeof e=="string"&&(e=e.split(","));let r=[],n=this.fields;for(;e.length>0;e.shift())r.push(n[e[0]]),e.length>1&&(n=n[e[0]].fields);return r}shredRecord(e,r){_u(this,e,r)}materializeRows(e){return vu(this,e)}compress(e){return ew(this.schema,e),ew(this.fields,e),this}rowGroup(){return Qd(this)}}});var Yi,g_=I(()=>{(function(l){l[l.BOOLEAN=0]="BOOLEAN",l[l.INT32=1]="INT32",l[l.INT64=2]="INT64",l[l.INT96=3]="INT96",l[l.FLOAT=4]="FLOAT",l[l.DOUBLE=5]="DOUBLE",l[l.BYTE_ARRAY=6]="BYTE_ARRAY",l[l.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"})(Yi||(Yi={}))});var Bs,j_=I(()=>{(function(N){N[N.UTF8=0]="UTF8",N[N.MAP=1]="MAP",N[N.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",N[N.LIST=3]="LIST",N[N.ENUM=4]="ENUM",N[N.DECIMAL=5]="DECIMAL",N[N.DATE=6]="DATE",N[N.TIME_MILLIS=7]="TIME_MILLIS",N[N.TIME_MICROS=8]="TIME_MICROS",N[N.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",N[N.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",N[N.UINT_8=11]="UINT_8",N[N.UINT_16=12]="UINT_16",N[N.UINT_32=13]="UINT_32",N[N.UINT_64=14]="UINT_64",N[N.INT_8=15]="INT_8",N[N.INT_16=16]="INT_16",N[N.INT_32=17]="INT_32",N[N.INT_64=18]="INT_64",N[N.JSON=19]="JSON",N[N.BSON=20]="BSON",N[N.INTERVAL=21]="INTERVAL"})(Bs||(Bs={}))});var Is,y_=I(()=>{(function(n){n[n.REQUIRED=0]="REQUIRED",n[n.OPTIONAL=1]="OPTIONAL",n[n.REPEATED=2]="REPEATED"})(Is||(Is={}))});var Wr,__=I(()=>{(function(l){l[l.PLAIN=0]="PLAIN",l[l.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",l[l.RLE=3]="RLE",l[l.BIT_PACKED=4]="BIT_PACKED",l[l.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",l[l.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",l[l.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",l[l.RLE_DICTIONARY=8]="RLE_DICTIONARY"})(Wr||(Wr={}))});var Ss,v_=I(()=>{(function(l){l[l.UNCOMPRESSED=0]="UNCOMPRESSED",l[l.SNAPPY=1]="SNAPPY",l[l.GZIP=2]="GZIP",l[l.LZO=3]="LZO",l[l.BROTLI=4]="BROTLI",l[l.LZ4=5]="LZ4",l[l.ZSTD=6]="ZSTD",l[l.LZ4_RAW=7]="LZ4_RAW"})(Ss||(Ss={}))});var Eo,q_=I(()=>{(function(i){i[i.DATA_PAGE=0]="DATA_PAGE",i[i.INDEX_PAGE=1]="INDEX_PAGE",i[i.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",i[i.DATA_PAGE_V2=3]="DATA_PAGE_V2"})(Eo||(Eo={}))});var T_,k_=I(()=>{(function(n){n[n.UNORDERED=0]="UNORDERED",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(T_||(T_={}))});var Nr=he((_3,I_)=>{var rw=4294967296,B_=[];for(xs=0;xs<256;xs++)B_[xs]=(xs>15?"":"0")+xs.toString(16);var xs,ra=I_.exports=function(t,e){t instanceof Buffer?(this.buffer=t,this.offset=e||0):Object.prototype.toString.call(t)=="[object Uint8Array]"?(this.buffer=new Buffer(t),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};ra.MAX_INT=Math.pow(2,53);ra.MIN_INT=-Math.pow(2,53);ra.prototype={constructor:ra,_2scomp:function(){for(var t=this.buffer,e=this.offset,r=1,n=e+7;n>=e;n--){var i=(t[n]^255)+r;t[n]=i&255,r=i>>8}},setValue:function(t,e){var r=!1;if(arguments.length==1)if(typeof t=="number"){if(r=t<0,t=Math.abs(t),e=t%rw,t=t/rw,t>rw)throw new RangeError(t+" is outside Int64 range");t=t|0}else if(typeof t=="string")t=(t+"").replace(/^0x/,""),e=t.substr(-8),t=t.length>8?t.substr(0,t.length-8):"",t=parseInt(t,16),e=parseInt(e,16);else throw new Error(t+" must be a Number or String");for(var n=this.buffer,i=this.offset,f=7;f>=0;f--)n[i+f]=e&255,e=f==4?t:e>>>8;r&&this._2scomp()},toNumber:function(t){for(var e=this.buffer,r=this.offset,n=e[r]&128,i=0,f=1,o=7,s=1;o>=0;o--,s*=256){var l=e[r+o];n&&(l=(l^255)+f,f=l>>8,l=l&255),i+=l*s}return!t&&i>=ra.MAX_INT?n?-1/0:1/0:n?-i:i},valueOf:function(){return this.toNumber(!1)},toString:function(t){return this.valueOf().toString(t||10)},toOctetString:function(t){for(var e=new Array(8),r=this.buffer,n=this.offset,i=0;i<8;i++)e[i]=B_[r[n+i]];return e.join(t||"")},toBuffer:function(t){if(t&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(t,e){this.buffer.copy(t,e||0,this.offset,this.offset+8)},compare:function(t){if((this.buffer[this.offset]&128)!=(t.buffer[t.offset]&128))return t.buffer[t.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==t.buffer[t.offset+e])return this.buffer[this.offset+e]-t.buffer[t.offset+e];return 0},equals:function(t){return this.compare(t)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var x_=he((v3,S_)=>{S_.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var E_=he((q3,nw)=>{typeof Object.create=="function"?nw.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:nw.exports=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}});var Ki=he(st=>{var A_=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},LE=/%[sdj%]/g;st.format=function(t){if(!Bu(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Hf(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,f=String(t).replace(LE,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),o=n[r];r<i;o=n[++r])ku(o)||!Es(o)?f+=" "+o:f+=" "+Hf(o);return f};st.deprecate=function(t,e){if(typeof process!="undefined"&&process.noDeprecation===!0)return t;if(typeof process=="undefined")return function(){return st.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var qu={},iw;st.debuglog=function(t){if(Df(iw)&&(iw=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!qu[t])if(new RegExp("\\b"+t+"\\b","i").test(iw)){var e=process.pid;qu[t]=function(){var r=st.format.apply(st,arguments);console.error("%s %d: %s",t,e,r)}}else qu[t]=function(){};return qu[t]};function Hf(t,e){var r={seen:[],stylize:ME};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),sw(e)?r.showHidden=e:e&&st._extend(r,e),Df(r.showHidden)&&(r.showHidden=!1),Df(r.depth)&&(r.depth=2),Df(r.colors)&&(r.colors=!1),Df(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=UE),Tu(r,t,r.depth)}st.inspect=Hf;Hf.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Hf.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function UE(t,e){var r=Hf.styles[e];return r?"["+Hf.colors[r][0]+"m"+t+"["+Hf.colors[r][1]+"m":t}function ME(t,e){return t}function CE(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Tu(t,e,r){if(t.customInspect&&e&&xu(e.inspect)&&e.inspect!==st.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Bu(n)||(n=Tu(t,n,r)),n}var i=VE(t,e);if(i)return i;var f=Object.keys(e),o=CE(f);if(t.showHidden&&(f=Object.getOwnPropertyNames(e)),Su(e)&&(f.indexOf("message")>=0||f.indexOf("description")>=0))return fw(e);if(f.length===0){if(xu(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Iu(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(lw(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Su(e))return fw(e)}var l="",p=!1,u=["{","}"];if(O_(e)&&(p=!0,u=["[","]"]),xu(e)){var b=e.name?": "+e.name:"";l=" [Function"+b+"]"}if(Iu(e)&&(l=" "+RegExp.prototype.toString.call(e)),lw(e)&&(l=" "+Date.prototype.toUTCString.call(e)),Su(e)&&(l=" "+fw(e)),f.length===0&&(!p||e.length==0))return u[0]+l+u[1];if(r<0)return Iu(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var c;return p?c=WE(t,e,r,o,f):c=f.map(function(h){return ow(t,e,r,o,h,p)}),t.seen.pop(),YE(c,l,u)}function VE(t,e){if(Df(e))return t.stylize("undefined","undefined");if(Bu(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(N_(e))return t.stylize(""+e,"number");if(sw(e))return t.stylize(""+e,"boolean");if(ku(e))return t.stylize("null","null")}function fw(t){return"["+Error.prototype.toString.call(t)+"]"}function WE(t,e,r,n,i){for(var f=[],o=0,s=e.length;o<s;++o)R_(e,String(o))?f.push(ow(t,e,r,n,String(o),!0)):f.push("");return i.forEach(function(l){l.match(/^\d+$/)||f.push(ow(t,e,r,n,l,!0))}),f}function ow(t,e,r,n,i,f){var o,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?l.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),R_(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(ku(r)?s=Tu(t,l.value,null):s=Tu(t,l.value,r-1),s.indexOf(`
|
|
12
|
+
`)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}function Z0(t){return Array.isArray(t)}function Pd(t){return typeof t=="boolean"}function cu(t){return t===null}function X1(t){return t==null}function X0(t){return typeof t=="number"}function mu(t){return typeof t=="string"}function Q1(t){return babelHelpers.typeof(t)==="symbol"}function Vi(t){return t===void 0}function du(t){return _s(t)&&Ud(t)==="[object RegExp]"}function _s(t){return babelHelpers.typeof(t)==="object"&&t!==null}function Ld(t){return _s(t)&&Ud(t)==="[object Date]"}function wu(t){return _s(t)&&(Ud(t)==="[object Error]"||t instanceof Error)}function hu(t){return typeof t=="function"}function $1(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||babelHelpers.typeof(t)==="symbol"||typeof t=="undefined"}function eE(t){return Buffer.isBuffer(t)}function Ud(t){return Object.prototype.toString.call(t)}function Md(t){return t<10?"0"+t.toString(10):t.toString(10)}function rE(){var t=new Date,e=[Md(t.getHours()),Md(t.getMinutes()),Md(t.getSeconds())].join(":");return[t.getDate(),tE[t.getMonth()],e].join(" ")}function nE(){console.log("%s - %s",rE(),Hd.apply(null,arguments))}function Q0(t,e){if(!e||!_s(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t}function $0(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var au,x1,E1,A1,bi,En,O1,Ad,Bo,K0,Od,P1,L1,ys,ae,TH,kH,BH,IH,Af,SH,Nd,xH,an,EH,Of,AH,U1,Rd,M1,C1,pu,Dd,tE,iE,ut,OH,NH,RH,HH,DH,zH,FH,PH,LH,UH,Zn,MH,CH,de,VH,vs,WH,Io,YH,So,KH,bu,JH,qs,ZH,Ts,XH,Wi,QH,W,$H,eD,tD,rD,nD,iD,fD,oD,sD,lD,aD,pD,uD,cD,mD,dD,wD,hD,bD,gD,jD,yD,_D,vD,qD,TD,kD,BD,ID,SD,xD,ED,AD,OD,Cd,ND,Nf,RD,ks,HD,Rf,DD,zD,gu,FD,ju,PD,Ql,LD,UD,$l,MD,CD,yu,VD,we,WD,YD,KD,e_,GD,t_,JD,ZD,XD,QD,$D,ez,tz,rz,nz,iz,fz,oz,sz,lz,az,pz,uz,cz,mz,dz,wz,hz,bz,gz,jz,yz,_z,vz,qz,Tz,kz,Bz,Iz,Sz,xz,Ez,Az,Oz,Nz,Rz,Hz,Dz,zz,Fz,Pz,Lz,Uz,Mz,Cz,Vz,Wz,Yz,Vd=I(()=>{au=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};x1=N1,E1=H1,A1=F1,bi=[],En=[],O1=typeof Uint8Array!="undefined"?Uint8Array:Array,Ad="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Bo=0,K0=Ad.length;Bo<K0;++Bo)bi[Bo]=Ad[Bo],En[Ad.charCodeAt(Bo)]=Bo;En["-".charCodeAt(0)]=62;En["_".charCodeAt(0)]=63;Od={byteLength:x1,toByteArray:E1,fromByteArray:A1},P1=function(e,r,n,i,f){var o,s,l=f*8-i-1,p=(1<<l)-1,u=p>>1,b=-7,c=n?f-1:0,h=n?-1:1,k=e[r+c];for(c+=h,o=k&(1<<-b)-1,k>>=-b,b+=l;b>0;o=o*256+e[r+c],c+=h,b-=8);for(s=o&(1<<-b)-1,o>>=-b,b+=i;b>0;s=s*256+e[r+c],c+=h,b-=8);if(o===0)o=1-u;else{if(o===p)return s?NaN:(k?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-u}return(k?-1:1)*s*Math.pow(2,o-i)},L1=function(e,r,n,i,f,o){var s,l,p,u=o*8-f-1,b=(1<<u)-1,c=b>>1,h=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,k=i?0:o-1,y=i?1:-1,R=r<0||r===0&&1/r<0?1:0;for(r=Math.abs(r),isNaN(r)||r===1/0?(l=isNaN(r)?1:0,s=b):(s=Math.floor(Math.log(r)/Math.LN2),r*(p=Math.pow(2,-s))<1&&(s--,p*=2),s+c>=1?r+=h/p:r+=h*Math.pow(2,1-c),r*p>=2&&(s++,p/=2),s+c>=b?(l=0,s=b):s+c>=1?(l=(r*p-1)*Math.pow(2,f),s=s+c):(l=r*Math.pow(2,c-1)*Math.pow(2,f),s=0));f>=8;e[n+k]=l&255,k+=y,l/=256,f-=8);for(s=s<<f|l,u+=f;u>0;e[n+k]=s&255,k+=y,s/=256,u-=8);e[n+k-y]|=R*128},ys={read:P1,write:L1},ae=kt(function(t,e){var r=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=o,e.SlowBuffer=R,e.INSPECT_MAX_BYTES=50;var n=2147483647;e.kMaxLength=n,o.TYPED_ARRAY_SUPPORT=i(),!o.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&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 i(){try{var _=new Uint8Array(1),m={foo:function(){return 42}};return Object.setPrototypeOf(m,Uint8Array.prototype),Object.setPrototypeOf(_,m),_.foo()===42}catch{return!1}}Object.defineProperty(o.prototype,"parent",{enumerable:!0,get:function(){if(!!o.isBuffer(this))return this.buffer}}),Object.defineProperty(o.prototype,"offset",{enumerable:!0,get:function(){if(!!o.isBuffer(this))return this.byteOffset}});function f(_){if(_>n)throw new RangeError('The value "'+_+'" is invalid for option "size"');var m=new Uint8Array(_);return Object.setPrototypeOf(m,o.prototype),m}function o(_,m,d){if(typeof _=="number"){if(typeof m=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return u(_)}return s(_,m,d)}o.poolSize=8192;function s(_,m,d){if(typeof _=="string")return b(_,m);if(ArrayBuffer.isView(_))return c(_);if(_==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(_));if(Ee(_,ArrayBuffer)||_&&Ee(_.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(Ee(_,SharedArrayBuffer)||_&&Ee(_.buffer,SharedArrayBuffer)))return h(_,m,d);if(typeof _=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var q=_.valueOf&&_.valueOf();if(q!=null&&q!==_)return o.from(q,m,d);var F=k(_);if(F)return F;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof _[Symbol.toPrimitive]=="function")return o.from(_[Symbol.toPrimitive]("string"),m,d);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(_))}o.from=function(_,m,d){return s(_,m,d)},Object.setPrototypeOf(o.prototype,Uint8Array.prototype),Object.setPrototypeOf(o,Uint8Array);function l(_){if(typeof _!="number")throw new TypeError('"size" argument must be of type number');if(_<0)throw new RangeError('The value "'+_+'" is invalid for option "size"')}function p(_,m,d){return l(_),_<=0?f(_):m!==void 0?typeof d=="string"?f(_).fill(m,d):f(_).fill(m):f(_)}o.alloc=function(_,m,d){return p(_,m,d)};function u(_){return l(_),f(_<0?0:y(_)|0)}o.allocUnsafe=function(_){return u(_)},o.allocUnsafeSlow=function(_){return u(_)};function b(_,m){if((typeof m!="string"||m==="")&&(m="utf8"),!o.isEncoding(m))throw new TypeError("Unknown encoding: "+m);var d=L(_,m)|0,q=f(d),F=q.write(_,m);return F!==d&&(q=q.slice(0,F)),q}function c(_){for(var m=_.length<0?0:y(_.length)|0,d=f(m),q=0;q<m;q+=1)d[q]=_[q]&255;return d}function h(_,m,d){if(m<0||_.byteLength<m)throw new RangeError('"offset" is outside of buffer bounds');if(_.byteLength<m+(d||0))throw new RangeError('"length" is outside of buffer bounds');var q;return m===void 0&&d===void 0?q=new Uint8Array(_):d===void 0?q=new Uint8Array(_,m):q=new Uint8Array(_,m,d),Object.setPrototypeOf(q,o.prototype),q}function k(_){if(o.isBuffer(_)){var m=y(_.length)|0,d=f(m);return d.length===0||_.copy(d,0,0,m),d}if(_.length!==void 0)return typeof _.length!="number"||At(_.length)?f(0):c(_);if(_.type==="Buffer"&&Array.isArray(_.data))return c(_.data)}function y(_){if(_>=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return _|0}function R(_){return+_!=_&&(_=0),o.alloc(+_)}o.isBuffer=function(m){return m!=null&&m._isBuffer===!0&&m!==o.prototype},o.compare=function(m,d){if(Ee(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),Ee(d,Uint8Array)&&(d=o.from(d,d.offset,d.byteLength)),!o.isBuffer(m)||!o.isBuffer(d))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(m===d)return 0;for(var q=m.length,F=d.length,ee=0,te=Math.min(q,F);ee<te;++ee)if(m[ee]!==d[ee]){q=m[ee],F=d[ee];break}return q<F?-1:F<q?1:0},o.isEncoding=function(m){switch(String(m).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}},o.concat=function(m,d){if(!Array.isArray(m))throw new TypeError('"list" argument must be an Array of Buffers');if(m.length===0)return o.alloc(0);var q;if(d===void 0)for(d=0,q=0;q<m.length;++q)d+=m[q].length;var F=o.allocUnsafe(d),ee=0;for(q=0;q<m.length;++q){var te=m[q];if(Ee(te,Uint8Array)&&(te=o.from(te)),!o.isBuffer(te))throw new TypeError('"list" argument must be an Array of Buffers');te.copy(F,ee),ee+=te.length}return F};function L(_,m){if(o.isBuffer(_))return _.length;if(ArrayBuffer.isView(_)||Ee(_,ArrayBuffer))return _.byteLength;if(typeof _!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(_));var d=_.length,q=arguments.length>2&&arguments[2]===!0;if(!q&&d===0)return 0;for(var F=!1;;)switch(m){case"ascii":case"latin1":case"binary":return d;case"utf8":case"utf-8":return pe(_).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return d*2;case"hex":return d>>>1;case"base64":return jf(_).length;default:if(F)return q?-1:pe(_).length;m=(""+m).toLowerCase(),F=!0}}o.byteLength=L;function D(_,m,d){var q=!1;if((m===void 0||m<0)&&(m=0),m>this.length||((d===void 0||d>this.length)&&(d=this.length),d<=0)||(d>>>=0,m>>>=0,d<=m))return"";for(_||(_="utf8");;)switch(_){case"hex":return E(this,m,d);case"utf8":case"utf-8":return w(this,m,d);case"ascii":return U(this,m,d);case"latin1":case"binary":return $(this,m,d);case"base64":return O(this,m,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return xe(this,m,d);default:if(q)throw new TypeError("Unknown encoding: "+_);_=(_+"").toLowerCase(),q=!0}}o.prototype._isBuffer=!0;function K(_,m,d){var q=_[m];_[m]=_[d],_[d]=q}o.prototype.swap16=function(){var m=this.length;if(m%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var d=0;d<m;d+=2)K(this,d,d+1);return this},o.prototype.swap32=function(){var m=this.length;if(m%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var d=0;d<m;d+=4)K(this,d,d+3),K(this,d+1,d+2);return this},o.prototype.swap64=function(){var m=this.length;if(m%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var d=0;d<m;d+=8)K(this,d,d+7),K(this,d+1,d+6),K(this,d+2,d+5),K(this,d+3,d+4);return this},o.prototype.toString=function(){var m=this.length;return m===0?"":arguments.length===0?w(this,0,m):D.apply(this,arguments)},o.prototype.toLocaleString=o.prototype.toString,o.prototype.equals=function(m){if(!o.isBuffer(m))throw new TypeError("Argument must be a Buffer");return this===m?!0:o.compare(this,m)===0},o.prototype.inspect=function(){var m="",d=e.INSPECT_MAX_BYTES;return m=this.toString("hex",0,d).replace(/(.{2})/g,"$1 ").trim(),this.length>d&&(m+=" ... "),"<Buffer "+m+">"},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(m,d,q,F,ee){if(Ee(m,Uint8Array)&&(m=o.from(m,m.offset,m.byteLength)),!o.isBuffer(m))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(m));if(d===void 0&&(d=0),q===void 0&&(q=m?m.length:0),F===void 0&&(F=0),ee===void 0&&(ee=this.length),d<0||q>m.length||F<0||ee>this.length)throw new RangeError("out of range index");if(F>=ee&&d>=q)return 0;if(F>=ee)return-1;if(d>=q)return 1;if(d>>>=0,q>>>=0,F>>>=0,ee>>>=0,this===m)return 0;for(var te=ee-F,Ke=q-d,De=Math.min(te,Ke),wt=this.slice(F,ee),fr=m.slice(d,q),me=0;me<De;++me)if(wt[me]!==fr[me]){te=wt[me],Ke=fr[me];break}return te<Ke?-1:Ke<te?1:0};function ne(_,m,d,q,F){if(_.length===0)return-1;if(typeof d=="string"?(q=d,d=0):d>2147483647?d=2147483647:d<-2147483648&&(d=-2147483648),d=+d,At(d)&&(d=F?0:_.length-1),d<0&&(d=_.length+d),d>=_.length){if(F)return-1;d=_.length-1}else if(d<0)if(F)d=0;else return-1;if(typeof m=="string"&&(m=o.from(m,q)),o.isBuffer(m))return m.length===0?-1:Y(_,m,d,q,F);if(typeof m=="number")return m=m&255,typeof Uint8Array.prototype.indexOf=="function"?F?Uint8Array.prototype.indexOf.call(_,m,d):Uint8Array.prototype.lastIndexOf.call(_,m,d):Y(_,[m],d,q,F);throw new TypeError("val must be string, number or Buffer")}function Y(_,m,d,q,F){var ee=1,te=_.length,Ke=m.length;if(q!==void 0&&(q=String(q).toLowerCase(),q==="ucs2"||q==="ucs-2"||q==="utf16le"||q==="utf-16le")){if(_.length<2||m.length<2)return-1;ee=2,te/=2,Ke/=2,d/=2}function De(v,B){return ee===1?v[B]:v.readUInt16BE(B*ee)}var wt;if(F){var fr=-1;for(wt=d;wt<te;wt++)if(De(_,wt)===De(m,fr===-1?0:wt-fr)){if(fr===-1&&(fr=wt),wt-fr+1===Ke)return fr*ee}else fr!==-1&&(wt-=wt-fr),fr=-1}else for(d+Ke>te&&(d=te-Ke),wt=d;wt>=0;wt--){for(var me=!0,Yn=0;Yn<Ke;Yn++)if(De(_,wt+Yn)!==De(m,Yn)){me=!1;break}if(me)return wt}return-1}o.prototype.includes=function(m,d,q){return this.indexOf(m,d,q)!==-1},o.prototype.indexOf=function(m,d,q){return ne(this,m,d,q,!0)},o.prototype.lastIndexOf=function(m,d,q){return ne(this,m,d,q,!1)};function N(_,m,d,q){d=Number(d)||0;var F=_.length-d;q?(q=Number(q),q>F&&(q=F)):q=F;var ee=m.length;q>ee/2&&(q=ee/2);for(var te=0;te<q;++te){var Ke=parseInt(m.substr(te*2,2),16);if(At(Ke))return te;_[d+te]=Ke}return te}function re(_,m,d,q){return jt(pe(m,_.length-d),_,d,q)}function C(_,m,d,q){return jt(Et(m),_,d,q)}function ie(_,m,d,q){return C(_,m,d,q)}function j(_,m,d,q){return jt(jf(m),_,d,q)}function g(_,m,d,q){return jt(gf(m,_.length-d),_,d,q)}o.prototype.write=function(m,d,q,F){if(d===void 0)F="utf8",q=this.length,d=0;else if(q===void 0&&typeof d=="string")F=d,q=this.length,d=0;else if(isFinite(d))d=d>>>0,isFinite(q)?(q=q>>>0,F===void 0&&(F="utf8")):(F=q,q=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var ee=this.length-d;if((q===void 0||q>ee)&&(q=ee),m.length>0&&(q<0||d<0)||d>this.length)throw new RangeError("Attempt to write outside buffer bounds");F||(F="utf8");for(var te=!1;;)switch(F){case"hex":return N(this,m,d,q);case"utf8":case"utf-8":return re(this,m,d,q);case"ascii":return C(this,m,d,q);case"latin1":case"binary":return ie(this,m,d,q);case"base64":return j(this,m,d,q);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return g(this,m,d,q);default:if(te)throw new TypeError("Unknown encoding: "+F);F=(""+F).toLowerCase(),te=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function O(_,m,d){return m===0&&d===_.length?Od.fromByteArray(_):Od.fromByteArray(_.slice(m,d))}function w(_,m,d){d=Math.min(_.length,d);for(var q=[],F=m;F<d;){var ee=_[F],te=null,Ke=ee>239?4:ee>223?3:ee>191?2:1;if(F+Ke<=d){var De,wt,fr,me;switch(Ke){case 1:ee<128&&(te=ee);break;case 2:De=_[F+1],(De&192)==128&&(me=(ee&31)<<6|De&63,me>127&&(te=me));break;case 3:De=_[F+1],wt=_[F+2],(De&192)==128&&(wt&192)==128&&(me=(ee&15)<<12|(De&63)<<6|wt&63,me>2047&&(me<55296||me>57343)&&(te=me));break;case 4:De=_[F+1],wt=_[F+2],fr=_[F+3],(De&192)==128&&(wt&192)==128&&(fr&192)==128&&(me=(ee&15)<<18|(De&63)<<12|(wt&63)<<6|fr&63,me>65535&&me<1114112&&(te=me))}}te===null?(te=65533,Ke=1):te>65535&&(te-=65536,q.push(te>>>10&1023|55296),te=56320|te&1023),q.push(te),F+=Ke}return V(q)}var P=4096;function V(_){var m=_.length;if(m<=P)return String.fromCharCode.apply(String,_);for(var d="",q=0;q<m;)d+=String.fromCharCode.apply(String,_.slice(q,q+=P));return d}function U(_,m,d){var q="";d=Math.min(_.length,d);for(var F=m;F<d;++F)q+=String.fromCharCode(_[F]&127);return q}function $(_,m,d){var q="";d=Math.min(_.length,d);for(var F=m;F<d;++F)q+=String.fromCharCode(_[F]);return q}function E(_,m,d){var q=_.length;(!m||m<0)&&(m=0),(!d||d<0||d>q)&&(d=q);for(var F="",ee=m;ee<d;++ee)F+=ft[_[ee]];return F}function xe(_,m,d){for(var q=_.slice(m,d),F="",ee=0;ee<q.length;ee+=2)F+=String.fromCharCode(q[ee]+q[ee+1]*256);return F}o.prototype.slice=function(m,d){var q=this.length;m=~~m,d=d===void 0?q:~~d,m<0?(m+=q,m<0&&(m=0)):m>q&&(m=q),d<0?(d+=q,d<0&&(d=0)):d>q&&(d=q),d<m&&(d=m);var F=this.subarray(m,d);return Object.setPrototypeOf(F,o.prototype),F};function fe(_,m,d){if(_%1!=0||_<0)throw new RangeError("offset is not uint");if(_+m>d)throw new RangeError("Trying to access beyond buffer length")}o.prototype.readUIntLE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m],ee=1,te=0;++te<d&&(ee*=256);)F+=this[m+te]*ee;return F},o.prototype.readUIntBE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m+--d],ee=1;d>0&&(ee*=256);)F+=this[m+--d]*ee;return F},o.prototype.readUInt8=function(m,d){return m=m>>>0,d||fe(m,1,this.length),this[m]},o.prototype.readUInt16LE=function(m,d){return m=m>>>0,d||fe(m,2,this.length),this[m]|this[m+1]<<8},o.prototype.readUInt16BE=function(m,d){return m=m>>>0,d||fe(m,2,this.length),this[m]<<8|this[m+1]},o.prototype.readUInt32LE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),(this[m]|this[m+1]<<8|this[m+2]<<16)+this[m+3]*16777216},o.prototype.readUInt32BE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]*16777216+(this[m+1]<<16|this[m+2]<<8|this[m+3])},o.prototype.readIntLE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=this[m],ee=1,te=0;++te<d&&(ee*=256);)F+=this[m+te]*ee;return ee*=128,F>=ee&&(F-=Math.pow(2,8*d)),F},o.prototype.readIntBE=function(m,d,q){m=m>>>0,d=d>>>0,q||fe(m,d,this.length);for(var F=d,ee=1,te=this[m+--F];F>0&&(ee*=256);)te+=this[m+--F]*ee;return ee*=128,te>=ee&&(te-=Math.pow(2,8*d)),te},o.prototype.readInt8=function(m,d){return m=m>>>0,d||fe(m,1,this.length),this[m]&128?(255-this[m]+1)*-1:this[m]},o.prototype.readInt16LE=function(m,d){m=m>>>0,d||fe(m,2,this.length);var q=this[m]|this[m+1]<<8;return q&32768?q|4294901760:q},o.prototype.readInt16BE=function(m,d){m=m>>>0,d||fe(m,2,this.length);var q=this[m+1]|this[m]<<8;return q&32768?q|4294901760:q},o.prototype.readInt32LE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]|this[m+1]<<8|this[m+2]<<16|this[m+3]<<24},o.prototype.readInt32BE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),this[m]<<24|this[m+1]<<16|this[m+2]<<8|this[m+3]},o.prototype.readFloatLE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),ys.read(this,m,!0,23,4)},o.prototype.readFloatBE=function(m,d){return m=m>>>0,d||fe(m,4,this.length),ys.read(this,m,!1,23,4)},o.prototype.readDoubleLE=function(m,d){return m=m>>>0,d||fe(m,8,this.length),ys.read(this,m,!0,52,8)},o.prototype.readDoubleBE=function(m,d){return m=m>>>0,d||fe(m,8,this.length),ys.read(this,m,!1,52,8)};function M(_,m,d,q,F,ee){if(!o.isBuffer(_))throw new TypeError('"buffer" argument must be a Buffer instance');if(m>F||m<ee)throw new RangeError('"value" argument is out of bounds');if(d+q>_.length)throw new RangeError("Index out of range")}o.prototype.writeUIntLE=function(m,d,q,F){if(m=+m,d=d>>>0,q=q>>>0,!F){var ee=Math.pow(2,8*q)-1;M(this,m,d,q,ee,0)}var te=1,Ke=0;for(this[d]=m&255;++Ke<q&&(te*=256);)this[d+Ke]=m/te&255;return d+q},o.prototype.writeUIntBE=function(m,d,q,F){if(m=+m,d=d>>>0,q=q>>>0,!F){var ee=Math.pow(2,8*q)-1;M(this,m,d,q,ee,0)}var te=q-1,Ke=1;for(this[d+te]=m&255;--te>=0&&(Ke*=256);)this[d+te]=m/Ke&255;return d+q},o.prototype.writeUInt8=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,1,255,0),this[d]=m&255,d+1},o.prototype.writeUInt16LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,65535,0),this[d]=m&255,this[d+1]=m>>>8,d+2},o.prototype.writeUInt16BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,65535,0),this[d]=m>>>8,this[d+1]=m&255,d+2},o.prototype.writeUInt32LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,4294967295,0),this[d+3]=m>>>24,this[d+2]=m>>>16,this[d+1]=m>>>8,this[d]=m&255,d+4},o.prototype.writeUInt32BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,4294967295,0),this[d]=m>>>24,this[d+1]=m>>>16,this[d+2]=m>>>8,this[d+3]=m&255,d+4},o.prototype.writeIntLE=function(m,d,q,F){if(m=+m,d=d>>>0,!F){var ee=Math.pow(2,8*q-1);M(this,m,d,q,ee-1,-ee)}var te=0,Ke=1,De=0;for(this[d]=m&255;++te<q&&(Ke*=256);)m<0&&De===0&&this[d+te-1]!==0&&(De=1),this[d+te]=(m/Ke>>0)-De&255;return d+q},o.prototype.writeIntBE=function(m,d,q,F){if(m=+m,d=d>>>0,!F){var ee=Math.pow(2,8*q-1);M(this,m,d,q,ee-1,-ee)}var te=q-1,Ke=1,De=0;for(this[d+te]=m&255;--te>=0&&(Ke*=256);)m<0&&De===0&&this[d+te+1]!==0&&(De=1),this[d+te]=(m/Ke>>0)-De&255;return d+q},o.prototype.writeInt8=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,1,127,-128),m<0&&(m=255+m+1),this[d]=m&255,d+1},o.prototype.writeInt16LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,32767,-32768),this[d]=m&255,this[d+1]=m>>>8,d+2},o.prototype.writeInt16BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,2,32767,-32768),this[d]=m>>>8,this[d+1]=m&255,d+2},o.prototype.writeInt32LE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,2147483647,-2147483648),this[d]=m&255,this[d+1]=m>>>8,this[d+2]=m>>>16,this[d+3]=m>>>24,d+4},o.prototype.writeInt32BE=function(m,d,q){return m=+m,d=d>>>0,q||M(this,m,d,4,2147483647,-2147483648),m<0&&(m=4294967295+m+1),this[d]=m>>>24,this[d+1]=m>>>16,this[d+2]=m>>>8,this[d+3]=m&255,d+4};function G(_,m,d,q,F,ee){if(d+q>_.length)throw new RangeError("Index out of range");if(d<0)throw new RangeError("Index out of range")}function Se(_,m,d,q,F){return m=+m,d=d>>>0,F||G(_,m,d,4),ys.write(_,m,d,q,23,4),d+4}o.prototype.writeFloatLE=function(m,d,q){return Se(this,m,d,!0,q)},o.prototype.writeFloatBE=function(m,d,q){return Se(this,m,d,!1,q)};function se(_,m,d,q,F){return m=+m,d=d>>>0,F||G(_,m,d,8),ys.write(_,m,d,q,52,8),d+8}o.prototype.writeDoubleLE=function(m,d,q){return se(this,m,d,!0,q)},o.prototype.writeDoubleBE=function(m,d,q){return se(this,m,d,!1,q)},o.prototype.copy=function(m,d,q,F){if(!o.isBuffer(m))throw new TypeError("argument should be a Buffer");if(q||(q=0),!F&&F!==0&&(F=this.length),d>=m.length&&(d=m.length),d||(d=0),F>0&&F<q&&(F=q),F===q||m.length===0||this.length===0)return 0;if(d<0)throw new RangeError("targetStart out of bounds");if(q<0||q>=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),m.length-d<F-q&&(F=m.length-d+q);var ee=F-q;if(this===m&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(d,q,F);else if(this===m&&q<d&&d<F)for(var te=ee-1;te>=0;--te)m[te+d]=this[te+q];else Uint8Array.prototype.set.call(m,this.subarray(q,F),d);return ee},o.prototype.fill=function(m,d,q,F){if(typeof m=="string"){if(typeof d=="string"?(F=d,d=0,q=this.length):typeof q=="string"&&(F=q,q=this.length),F!==void 0&&typeof F!="string")throw new TypeError("encoding must be a string");if(typeof F=="string"&&!o.isEncoding(F))throw new TypeError("Unknown encoding: "+F);if(m.length===1){var ee=m.charCodeAt(0);(F==="utf8"&&ee<128||F==="latin1")&&(m=ee)}}else typeof m=="number"?m=m&255:typeof m=="boolean"&&(m=Number(m));if(d<0||this.length<d||this.length<q)throw new RangeError("Out of range index");if(q<=d)return this;d=d>>>0,q=q===void 0?this.length:q>>>0,m||(m=0);var te;if(typeof m=="number")for(te=d;te<q;++te)this[te]=m;else{var Ke=o.isBuffer(m)?m:o.from(m,F),De=Ke.length;if(De===0)throw new TypeError('The value "'+m+'" is invalid for argument "value"');for(te=0;te<q-d;++te)this[te+d]=Ke[te%De]}return this};var Ye=/[^+/0-9A-Za-z-_]/g;function wr(_){if(_=_.split("=")[0],_=_.trim().replace(Ye,""),_.length<2)return"";for(;_.length%4!=0;)_=_+"=";return _}function pe(_,m){m=m||1/0;for(var d,q=_.length,F=null,ee=[],te=0;te<q;++te){if(d=_.charCodeAt(te),d>55295&&d<57344){if(!F){if(d>56319){(m-=3)>-1&&ee.push(239,191,189);continue}else if(te+1===q){(m-=3)>-1&&ee.push(239,191,189);continue}F=d;continue}if(d<56320){(m-=3)>-1&&ee.push(239,191,189),F=d;continue}d=(F-55296<<10|d-56320)+65536}else F&&(m-=3)>-1&&ee.push(239,191,189);if(F=null,d<128){if((m-=1)<0)break;ee.push(d)}else if(d<2048){if((m-=2)<0)break;ee.push(d>>6|192,d&63|128)}else if(d<65536){if((m-=3)<0)break;ee.push(d>>12|224,d>>6&63|128,d&63|128)}else if(d<1114112){if((m-=4)<0)break;ee.push(d>>18|240,d>>12&63|128,d>>6&63|128,d&63|128)}else throw new Error("Invalid code point")}return ee}function Et(_){for(var m=[],d=0;d<_.length;++d)m.push(_.charCodeAt(d)&255);return m}function gf(_,m){for(var d,q,F,ee=[],te=0;te<_.length&&!((m-=2)<0);++te)d=_.charCodeAt(te),q=d>>8,F=d%256,ee.push(F),ee.push(q);return ee}function jf(_){return Od.toByteArray(wr(_))}function jt(_,m,d,q){for(var F=0;F<q&&!(F+d>=m.length||F>=_.length);++F)m[F+d]=_[F];return F}function Ee(_,m){return _ instanceof m||_!=null&&_.constructor!=null&&_.constructor.name!=null&&_.constructor.name===m.name}function At(_){return _!==_}var ft=function(){for(var _="0123456789abcdef",m=new Array(256),d=0;d<16;++d)for(var q=d*16,F=0;F<16;++F)m[q+F]=_[d]+_[F];return m}()}),TH=ae.Buffer,kH=ae.SlowBuffer,BH=ae.INSPECT_MAX_BYTES,IH=ae.kMaxLength,Af=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ensureBuffer=void 0;function r(n){if(ae.Buffer.isBuffer(n))return n;if(ArrayBuffer.isView(n))return ae.Buffer.from(n.buffer);if(n instanceof ArrayBuffer)return ae.Buffer.from(n);throw new TypeError("Must use either Buffer or TypedArray")}e.ensureBuffer=r});Nt(Af);SH=Af.ensureBuffer,Nd=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.parseUUID=void 0;let r=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function n(i){if(typeof i!="string")throw new TypeError("Invalid type for UUID, expected string but got "+typeof i);if(!r.test(i))throw new TypeError("Invalid format for UUID: "+i);let f,o=new Uint8Array(16);return o[0]=(f=parseInt(i.slice(0,8),16))>>>24,o[1]=f>>>16&255,o[2]=f>>>8&255,o[3]=f&255,o[4]=(f=parseInt(i.slice(9,13),16))>>>8,o[5]=f&255,o[6]=(f=parseInt(i.slice(14,18),16))>>>8,o[7]=f&255,o[8]=(f=parseInt(i.slice(19,23),16))>>>8,o[9]=f&255,o[10]=(f=parseInt(i.slice(24,36),16))/1099511627776&255,o[11]=f/4294967296&255,o[12]=f>>>24&255,o[13]=f>>>16&255,o[14]=f>>>8&255,o[15]=f&255,o}e.parseUUID=n});Nt(Nd);xH=Nd.parseUUID,an=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Binary=void 0;class r{constructor(i,f){if(i!=null&&typeof i!="string"&&!ArrayBuffer.isView(i)&&!(i instanceof ArrayBuffer)&&!Array.isArray(i))throw new TypeError("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=f??r.BSON_BINARY_SUBTYPE_DEFAULT,i==null?(this.buffer=ae.Buffer.alloc(r.BUFFER_SIZE),this.position=0):(typeof i=="string"?this.buffer=ae.Buffer.from(i,"binary"):Array.isArray(i)?this.buffer=ae.Buffer.from(i):this.buffer=Af.ensureBuffer(i),this.position=this.buffer.byteLength)}put(i){if(typeof i=="string"&&i.length!==1)throw new TypeError("only accepts single character String");if(typeof i!="number"&&i.length!==1)throw new TypeError("only accepts single character Uint8Array or Array");let f;if(typeof i=="string"?f=i.charCodeAt(0):typeof i=="number"?f=i:f=i[0],f<0||f>255)throw new TypeError("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=f;else{let o=ae.Buffer.alloc(r.BUFFER_SIZE+this.buffer.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o,this.buffer[this.position++]=f}}write(i,f){if(f=typeof f=="number"?f:this.position,this.buffer.length<f+i.length){let o=ae.Buffer.alloc(this.buffer.length+i.length);this.buffer.copy(o,0,0,this.buffer.length),this.buffer=o}ArrayBuffer.isView(i)?(this.buffer.set(Af.ensureBuffer(i),f),this.position=f+i.byteLength>this.position?f+i.length:this.position):typeof i=="string"&&(this.buffer.write(i,f,i.length,"binary"),this.position=f+i.length>this.position?f+i.length:this.position)}read(i,f){return f=f&&f>0?f:this.position,this.buffer.slice(i,i+f)}value(i){return i=!!i,i&&this.buffer.length===this.position?this.buffer:i?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)}length(){return this.position}toJSON(){return this.buffer.toString("base64")}toString(i){return this.buffer.toString(i)}toExtendedJSON(i){i=i||{};let f=this.buffer.toString("base64"),o=Number(this.sub_type).toString(16);return i.legacy?{$binary:f,$type:o.length===1?"0"+o:o}:{$binary:{base64:f,subType:o.length===1?"0"+o:o}}}static fromExtendedJSON(i,f){f=f||{};let o,s;if("$binary"in i?f.legacy&&typeof i.$binary=="string"&&"$type"in i?(s=i.$type?parseInt(i.$type,16):0,o=ae.Buffer.from(i.$binary,"base64")):typeof i.$binary!="string"&&(s=i.$binary.subType?parseInt(i.$binary.subType,16):0,o=ae.Buffer.from(i.$binary.base64,"base64")):"$uuid"in i&&(s=4,o=ae.Buffer.from(Nd.parseUUID(i.$uuid))),!o)throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(i)}`);return new r(o,s)}}e.Binary=r,r.BSON_BINARY_SUBTYPE_DEFAULT=0,r.BUFFER_SIZE=256,r.SUBTYPE_DEFAULT=0,r.SUBTYPE_FUNCTION=1,r.SUBTYPE_BYTE_ARRAY=2,r.SUBTYPE_UUID_OLD=3,r.SUBTYPE_UUID=4,r.SUBTYPE_MD5=5,r.SUBTYPE_USER_DEFINED=128,Object.defineProperty(r.prototype,"_bsontype",{value:"Binary"})});Nt(an);EH=an.Binary,Of=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Code=void 0;class r{constructor(i,f){this.code=i,this.scope=f}toJSON(){return{code:this.code,scope:this.scope}}toExtendedJSON(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}}static fromExtendedJSON(i){return new r(i.$code,i.$scope)}}e.Code=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Code"})});Nt(Of);AH=Of.Code,U1={};typeof Object.create=="function"?Rd=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:Rd=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e};M1=Rd,C1=/%[sdj%]/g;pu={};Ci.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Ci.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};tE=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];iE={inherits:M1,_extend:Q0,log:nE,isBuffer:eE,isPrimitive:$1,isFunction:hu,isError:wu,isDate:Ld,isObject:_s,isRegExp:du,isUndefined:Vi,isSymbol:Q1,isString:mu,isNumber:X0,isNullOrUndefined:X1,isNull:cu,isBoolean:Pd,isArray:Z0,inspect:Ci,deprecate:J0,format:Hd,debuglog:V1},ut=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deprecate=e.isObjectLike=e.isDate=e.isBuffer=e.haveBuffer=e.isBigUInt64Array=e.isBigInt64Array=e.isUint8Array=e.randomBytes=e.normalizedFunctionString=void 0;function r(c){return c.toString().replace("function(","function (")}e.normalizedFunctionString=r;function n(c){let h=ae.Buffer.alloc(c);for(let k=0;k<c;++k)h[k]=Math.floor(Math.random()*256);return h}if(e.randomBytes=n,typeof window!="undefined"&&window.crypto&&window.crypto.getRandomValues)e.randomBytes=c=>window.crypto.getRandomValues(ae.Buffer.alloc(c));else{try{e.randomBytes=U1.randomBytes}catch{}e.randomBytes==null&&(e.randomBytes=n)}function i(c){return Object.prototype.toString.call(c)==="[object Uint8Array]"}e.isUint8Array=i;function f(c){return Object.prototype.toString.call(c)==="[object BigInt64Array]"}e.isBigInt64Array=f;function o(c){return Object.prototype.toString.call(c)==="[object BigUint64Array]"}e.isBigUInt64Array=o;function s(){return typeof au!="undefined"&&typeof au.Buffer!="undefined"}e.haveBuffer=s;function l(c){return s()&&ae.Buffer.isBuffer(c)}e.isBuffer=l;function p(c){return u(c)&&Object.prototype.toString.call(c)==="[object Date]"}e.isDate=p;function u(c){return typeof c=="object"&&c!==null}e.isObjectLike=u;function b(c,h){if(typeof window=="undefined"||typeof self=="undefined")return iE.deprecate(c,h);let k=!1;function y(...R){return k||(console.warn(h),k=!0),c.apply(this,...R)}return y}e.deprecate=b});Nt(ut);OH=ut.deprecate,NH=ut.isObjectLike,RH=ut.isDate,HH=ut.isBuffer,DH=ut.haveBuffer,zH=ut.isBigUInt64Array,FH=ut.isBigInt64Array,PH=ut.isUint8Array,LH=ut.randomBytes,UH=ut.normalizedFunctionString,Zn=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.DBRef=e.isDBRefLike=void 0;function r(i){return ut.isObjectLike(i)&&i.$id!=null&&i.$ref!=null}e.isDBRefLike=r;class n{constructor(f,o,s,l){let p=f.split(".");p.length===2&&(s=p.shift(),f=p.shift()),this.collection=f,this.oid=o,this.db=s,this.fields=l||{}}get namespace(){return this.collection}set namespace(f){this.collection=f}toJSON(){let f=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return this.db!=null&&(f.$db=this.db),f}toExtendedJSON(f){f=f||{};let o={$ref:this.collection,$id:this.oid};return f.legacy||(this.db&&(o.$db=this.db),o=Object.assign(o,this.fields)),o}static fromExtendedJSON(f){let o=Object.assign({},f);return delete o.$ref,delete o.$id,delete o.$db,new n(f.$ref,f.$id,f.$db,o)}}e.DBRef=n,Object.defineProperty(n.prototype,"_bsontype",{value:"DBRef"})});Nt(Zn);MH=Zn.DBRef,CH=Zn.isDBRefLike,de=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Long=void 0;let r;try{r=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{}let n=1<<16,i=1<<24,f=n*n,o=f*f,s=o/2,l={},p={};class u{constructor(c=0,h=0,k){this.comp=u.prototype.compare,this.div=u.prototype.divide,this.eq=u.prototype.equals,this.gt=u.prototype.greaterThan,this.gte=u.prototype.greaterThanOrEqual,this.ge=u.prototype.greaterThanOrEqual,this.lt=u.prototype.lessThan,this.lte=u.prototype.lessThanOrEqual,this.mod=u.prototype.modulo,this.rem=u.prototype.modulo,this.mul=u.prototype.multiply,this.neg=u.prototype.negate,this.neq=u.prototype.notEquals,this.ne=u.prototype.notEquals,this.shl=u.prototype.shiftLeft,this.shr=u.prototype.shiftRight,this.shr_u=u.prototype.shiftRightUnsigned,this.shru=u.prototype.shiftRightUnsigned,this.sub=u.prototype.subtract,this.eqz=u.prototype.isZero,this.le=u.prototype.lessThanOrEqual,this.low=c|0,this.high=h|0,this.unsigned=!!k,Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}static fromBits(c,h,k){return new u(c,h,k)}static fromInt(c,h){let k,y,R;return h?(c>>>=0,(R=0<=c&&c<256)&&(y=p[c],y)?y:(k=u.fromBits(c,(c|0)<0?-1:0,!0),R&&(p[c]=k),k)):(c|=0,(R=-128<=c&&c<128)&&(y=l[c],y)?y:(k=u.fromBits(c,c<0?-1:0,!1),R&&(l[c]=k),k))}static fromNumber(c,h){if(isNaN(c))return h?u.UZERO:u.ZERO;if(h){if(c<0)return u.UZERO;if(c>=o)return u.MAX_UNSIGNED_VALUE}else{if(c<=-s)return u.MIN_VALUE;if(c+1>=s)return u.MAX_VALUE}return c<0?u.fromNumber(-c,h).neg():u.fromBits(c%f|0,c/f|0,h)}static fromBigInt(c,h){return u.fromString(c.toString(),h)}static fromString(c,h,k){if(c.length===0)throw Error("empty string");if(c==="NaN"||c==="Infinity"||c==="+Infinity"||c==="-Infinity")return u.ZERO;if(typeof h=="number"?(k=h,h=!1):h=!!h,k=k||10,k<2||36<k)throw RangeError("radix");let y;if((y=c.indexOf("-"))>0)throw Error("interior hyphen");if(y===0)return u.fromString(c.substring(1),h,k).neg();let R=u.fromNumber(Math.pow(k,8)),L=u.ZERO;for(let D=0;D<c.length;D+=8){let K=Math.min(8,c.length-D),ne=parseInt(c.substring(D,D+K),k);if(K<8){let Y=u.fromNumber(Math.pow(k,K));L=L.mul(Y).add(u.fromNumber(ne))}else L=L.mul(R),L=L.add(u.fromNumber(ne))}return L.unsigned=h,L}static fromBytes(c,h,k){return k?u.fromBytesLE(c,h):u.fromBytesBE(c,h)}static fromBytesLE(c,h){return new u(c[0]|c[1]<<8|c[2]<<16|c[3]<<24,c[4]|c[5]<<8|c[6]<<16|c[7]<<24,h)}static fromBytesBE(c,h){return new u(c[4]<<24|c[5]<<16|c[6]<<8|c[7],c[0]<<24|c[1]<<16|c[2]<<8|c[3],h)}static isLong(c){return ut.isObjectLike(c)&&c.__isLong__===!0}static fromValue(c,h){return typeof c=="number"?u.fromNumber(c,h):typeof c=="string"?u.fromString(c,h):u.fromBits(c.low,c.high,typeof h=="boolean"?h:c.unsigned)}add(c){u.isLong(c)||(c=u.fromValue(c));let h=this.high>>>16,k=this.high&65535,y=this.low>>>16,R=this.low&65535,L=c.high>>>16,D=c.high&65535,K=c.low>>>16,ne=c.low&65535,Y=0,N=0,re=0,C=0;return C+=R+ne,re+=C>>>16,C&=65535,re+=y+K,N+=re>>>16,re&=65535,N+=k+D,Y+=N>>>16,N&=65535,Y+=h+L,Y&=65535,u.fromBits(re<<16|C,Y<<16|N,this.unsigned)}and(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low&c.low,this.high&c.high,this.unsigned)}compare(c){if(u.isLong(c)||(c=u.fromValue(c)),this.eq(c))return 0;let h=this.isNegative(),k=c.isNegative();return h&&!k?-1:!h&&k?1:this.unsigned?c.high>>>0>this.high>>>0||c.high===this.high&&c.low>>>0>this.low>>>0?-1:1:this.sub(c).isNegative()?-1:1}divide(c){if(u.isLong(c)||(c=u.fromValue(c)),c.isZero())throw Error("division by zero");if(r){if(!this.unsigned&&this.high===-2147483648&&c.low===-1&&c.high===-1)return this;let R=(this.unsigned?r.div_u:r.div_s)(this.low,this.high,c.low,c.high);return u.fromBits(R,r.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?u.UZERO:u.ZERO;let h,k,y;if(this.unsigned){if(c.unsigned||(c=c.toUnsigned()),c.gt(this))return u.UZERO;if(c.gt(this.shru(1)))return u.UONE;y=u.UZERO}else{if(this.eq(u.MIN_VALUE))return c.eq(u.ONE)||c.eq(u.NEG_ONE)?u.MIN_VALUE:c.eq(u.MIN_VALUE)?u.ONE:(h=this.shr(1).div(c).shl(1),h.eq(u.ZERO)?c.isNegative()?u.ONE:u.NEG_ONE:(k=this.sub(c.mul(h)),y=h.add(k.div(c)),y));if(c.eq(u.MIN_VALUE))return this.unsigned?u.UZERO:u.ZERO;if(this.isNegative())return c.isNegative()?this.neg().div(c.neg()):this.neg().div(c).neg();if(c.isNegative())return this.div(c.neg()).neg();y=u.ZERO}for(k=this;k.gte(c);){h=Math.max(1,Math.floor(k.toNumber()/c.toNumber()));let R=Math.ceil(Math.log(h)/Math.LN2),L=R<=48?1:Math.pow(2,R-48),D=u.fromNumber(h),K=D.mul(c);for(;K.isNegative()||K.gt(k);)h-=L,D=u.fromNumber(h,this.unsigned),K=D.mul(c);D.isZero()&&(D=u.ONE),y=y.add(D),k=k.sub(K)}return y}equals(c){return u.isLong(c)||(c=u.fromValue(c)),this.unsigned!==c.unsigned&&this.high>>>31==1&&c.high>>>31==1?!1:this.high===c.high&&this.low===c.low}getHighBits(){return this.high}getHighBitsUnsigned(){return this.high>>>0}getLowBits(){return this.low}getLowBitsUnsigned(){return this.low>>>0}getNumBitsAbs(){if(this.isNegative())return this.eq(u.MIN_VALUE)?64:this.neg().getNumBitsAbs();let c=this.high!==0?this.high:this.low,h;for(h=31;h>0&&(c&1<<h)==0;h--);return this.high!==0?h+33:h+1}greaterThan(c){return this.comp(c)>0}greaterThanOrEqual(c){return this.comp(c)>=0}isEven(){return(this.low&1)==0}isNegative(){return!this.unsigned&&this.high<0}isOdd(){return(this.low&1)==1}isPositive(){return this.unsigned||this.high>=0}isZero(){return this.high===0&&this.low===0}lessThan(c){return this.comp(c)<0}lessThanOrEqual(c){return this.comp(c)<=0}modulo(c){if(u.isLong(c)||(c=u.fromValue(c)),r){let h=(this.unsigned?r.rem_u:r.rem_s)(this.low,this.high,c.low,c.high);return u.fromBits(h,r.get_high(),this.unsigned)}return this.sub(this.div(c).mul(c))}multiply(c){if(this.isZero())return u.ZERO;if(u.isLong(c)||(c=u.fromValue(c)),r){let ie=r.mul(this.low,this.high,c.low,c.high);return u.fromBits(ie,r.get_high(),this.unsigned)}if(c.isZero())return u.ZERO;if(this.eq(u.MIN_VALUE))return c.isOdd()?u.MIN_VALUE:u.ZERO;if(c.eq(u.MIN_VALUE))return this.isOdd()?u.MIN_VALUE:u.ZERO;if(this.isNegative())return c.isNegative()?this.neg().mul(c.neg()):this.neg().mul(c).neg();if(c.isNegative())return this.mul(c.neg()).neg();if(this.lt(u.TWO_PWR_24)&&c.lt(u.TWO_PWR_24))return u.fromNumber(this.toNumber()*c.toNumber(),this.unsigned);let h=this.high>>>16,k=this.high&65535,y=this.low>>>16,R=this.low&65535,L=c.high>>>16,D=c.high&65535,K=c.low>>>16,ne=c.low&65535,Y=0,N=0,re=0,C=0;return C+=R*ne,re+=C>>>16,C&=65535,re+=y*ne,N+=re>>>16,re&=65535,re+=R*K,N+=re>>>16,re&=65535,N+=k*ne,Y+=N>>>16,N&=65535,N+=y*K,Y+=N>>>16,N&=65535,N+=R*D,Y+=N>>>16,N&=65535,Y+=h*ne+k*K+y*D+R*L,Y&=65535,u.fromBits(re<<16|C,Y<<16|N,this.unsigned)}negate(){return!this.unsigned&&this.eq(u.MIN_VALUE)?u.MIN_VALUE:this.not().add(u.ONE)}not(){return u.fromBits(~this.low,~this.high,this.unsigned)}notEquals(c){return!this.equals(c)}or(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low|c.low,this.high|c.high,this.unsigned)}shiftLeft(c){return u.isLong(c)&&(c=c.toInt()),(c&=63)==0?this:c<32?u.fromBits(this.low<<c,this.high<<c|this.low>>>32-c,this.unsigned):u.fromBits(0,this.low<<c-32,this.unsigned)}shiftRight(c){return u.isLong(c)&&(c=c.toInt()),(c&=63)==0?this:c<32?u.fromBits(this.low>>>c|this.high<<32-c,this.high>>c,this.unsigned):u.fromBits(this.high>>c-32,this.high>=0?0:-1,this.unsigned)}shiftRightUnsigned(c){if(u.isLong(c)&&(c=c.toInt()),c&=63,c===0)return this;{let h=this.high;if(c<32){let k=this.low;return u.fromBits(k>>>c|h<<32-c,h>>>c,this.unsigned)}else return c===32?u.fromBits(h,0,this.unsigned):u.fromBits(h>>>c-32,0,this.unsigned)}}subtract(c){return u.isLong(c)||(c=u.fromValue(c)),this.add(c.neg())}toInt(){return this.unsigned?this.low>>>0:this.low}toNumber(){return this.unsigned?(this.high>>>0)*f+(this.low>>>0):this.high*f+(this.low>>>0)}toBigInt(){return BigInt(this.toString())}toBytes(c){return c?this.toBytesLE():this.toBytesBE()}toBytesLE(){let c=this.high,h=this.low;return[h&255,h>>>8&255,h>>>16&255,h>>>24,c&255,c>>>8&255,c>>>16&255,c>>>24]}toBytesBE(){let c=this.high,h=this.low;return[c>>>24,c>>>16&255,c>>>8&255,c&255,h>>>24,h>>>16&255,h>>>8&255,h&255]}toSigned(){return this.unsigned?u.fromBits(this.low,this.high,!1):this}toString(c){if(c=c||10,c<2||36<c)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(u.MIN_VALUE)){let R=u.fromNumber(c),L=this.div(R),D=L.mul(R).sub(this);return L.toString(c)+D.toInt().toString(c)}else return"-"+this.neg().toString(c);let h=u.fromNumber(Math.pow(c,6),this.unsigned),k=this,y="";for(;;){let R=k.div(h),D=(k.sub(R.mul(h)).toInt()>>>0).toString(c);if(k=R,k.isZero())return D+y;for(;D.length<6;)D="0"+D;y=""+D+y}}toUnsigned(){return this.unsigned?this:u.fromBits(this.low,this.high,!0)}xor(c){return u.isLong(c)||(c=u.fromValue(c)),u.fromBits(this.low^c.low,this.high^c.high,this.unsigned)}toExtendedJSON(c){return c&&c.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(c,h){let k=u.fromString(c.$numberLong);return h&&h.relaxed?k.toNumber():k}}e.Long=u,u.TWO_PWR_24=u.fromInt(i),u.MAX_UNSIGNED_VALUE=u.fromBits(4294967295|0,4294967295|0,!0),u.ZERO=u.fromInt(0),u.UZERO=u.fromInt(0,!0),u.ONE=u.fromInt(1),u.UONE=u.fromInt(1,!0),u.NEG_ONE=u.fromInt(-1),u.MAX_VALUE=u.fromBits(4294967295|0,2147483647|0,!1),u.MIN_VALUE=u.fromBits(0,2147483648|0,!1),Object.defineProperty(u.prototype,"__isLong__",{value:!0}),Object.defineProperty(u.prototype,"_bsontype",{value:"Long"})});Nt(de);VH=de.Long,vs=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Decimal128=void 0;let r=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,n=/^(\+|-)?(Infinity|inf)$/i,i=/^(\+|-)?NaN$/i,f=6111,o=-6176,s=6176,l=34,p=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),u=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),b=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),c=/^([-+])?(\d+)?$/,h=31,k=16383,y=30,R=31;function L(re){return!isNaN(parseInt(re,10))}function D(re){let C=de.Long.fromNumber(1e3*1e3*1e3),ie=de.Long.fromNumber(0);if(!re.parts[0]&&!re.parts[1]&&!re.parts[2]&&!re.parts[3])return{quotient:re,rem:ie};for(let j=0;j<=3;j++)ie=ie.shiftLeft(32),ie=ie.add(new de.Long(re.parts[j],0)),re.parts[j]=ie.div(C).low,ie=ie.modulo(C);return{quotient:re,rem:ie}}function K(re,C){if(!re&&!C)return{high:de.Long.fromNumber(0),low:de.Long.fromNumber(0)};let ie=re.shiftRightUnsigned(32),j=new de.Long(re.getLowBits(),0),g=C.shiftRightUnsigned(32),O=new de.Long(C.getLowBits(),0),w=ie.multiply(g),P=ie.multiply(O),V=j.multiply(g),U=j.multiply(O);return w=w.add(P.shiftRightUnsigned(32)),P=new de.Long(P.getLowBits(),0).add(V).add(U.shiftRightUnsigned(32)),w=w.add(P.shiftRightUnsigned(32)),U=P.shiftLeft(32).add(new de.Long(U.getLowBits(),0)),{high:w,low:U}}function ne(re,C){let ie=re.high>>>0,j=C.high>>>0;if(ie<j)return!0;if(ie===j){let g=re.low>>>0,O=C.low>>>0;if(g<O)return!0}return!1}function Y(re,C){throw new TypeError(`"${re}" is not a valid Decimal128 string - ${C}`)}class N{constructor(C){this.bytes=C}static fromString(C){let ie=!1,j=!1,g=!1,O=0,w=0,P=0,V=0,U=0,$=[0],E=0,xe=0,fe=0,M=0,G=0,Se=0,se=new de.Long(0,0),Ye=new de.Long(0,0),wr=0,pe=0;if(C.length>=7e3)throw new TypeError(""+C+" not a valid Decimal128 string");let Et=C.match(r),gf=C.match(n),jf=C.match(i);if(!Et&&!gf&&!jf||C.length===0)throw new TypeError(""+C+" not a valid Decimal128 string");if(Et){let ft=Et[2],_=Et[4],m=Et[5],d=Et[6];_&&d===void 0&&Y(C,"missing exponent power"),_&&ft===void 0&&Y(C,"missing exponent base"),_===void 0&&(m||d)&&Y(C,"missing e before exponent")}if((C[pe]==="+"||C[pe]==="-")&&(ie=C[pe++]==="-"),!L(C[pe])&&C[pe]!=="."){if(C[pe]==="i"||C[pe]==="I")return new N(ae.Buffer.from(ie?u:b));if(C[pe]==="N")return new N(ae.Buffer.from(p))}for(;L(C[pe])||C[pe]===".";){if(C[pe]==="."){j&&Y(C,"contains multiple periods"),j=!0,pe=pe+1;continue}E<34&&(C[pe]!=="0"||g)&&(g||(U=w),g=!0,$[xe++]=parseInt(C[pe],10),E=E+1),g&&(P=P+1),j&&(V=V+1),w=w+1,pe=pe+1}if(j&&!w)throw new TypeError(""+C+" not a valid Decimal128 string");if(C[pe]==="e"||C[pe]==="E"){let ft=C.substr(++pe).match(c);if(!ft||!ft[2])return new N(ae.Buffer.from(p));G=parseInt(ft[0],10),pe=pe+ft[0].length}if(C[pe])return new N(ae.Buffer.from(p));if(fe=0,!E)fe=0,M=0,$[0]=0,P=1,E=1,O=0;else if(M=E-1,O=P,O!==1)for(;C[U+O-1]==="0";)O=O-1;for(G<=V&&V-G>1<<14?G=o:G=G-V;G>f;){if(M=M+1,M-fe>l){if($.join("").match(/^0+$/)){G=f;break}Y(C,"overflow")}G=G-1}for(;G<o||E<P;){if(M===0&&O<E){G=o,O=0;break}if(E<P?P=P-1:M=M-1,G<f)G=G+1;else{if($.join("").match(/^0+$/)){G=f;break}Y(C,"overflow")}}if(M-fe+1<O){let ft=w;j&&(U=U+1,ft=ft+1),ie&&(U=U+1,ft=ft+1);let _=parseInt(C[U+M+1],10),m=0;if(_>=5&&(m=1,_===5)){for(m=$[M]%2==1?1:0,Se=U+M+2;Se<ft;Se++)if(parseInt(C[Se],10)){m=1;break}}if(m){let d=M;for(;d>=0;d--)if(++$[d]>9&&($[d]=0,d===0))if(G<f)G=G+1,$[d]=1;else return new N(ae.Buffer.from(ie?u:b))}}if(se=de.Long.fromNumber(0),Ye=de.Long.fromNumber(0),O===0)se=de.Long.fromNumber(0),Ye=de.Long.fromNumber(0);else if(M-fe<17){let ft=fe;for(Ye=de.Long.fromNumber($[ft++]),se=new de.Long(0,0);ft<=M;ft++)Ye=Ye.multiply(de.Long.fromNumber(10)),Ye=Ye.add(de.Long.fromNumber($[ft]))}else{let ft=fe;for(se=de.Long.fromNumber($[ft++]);ft<=M-17;ft++)se=se.multiply(de.Long.fromNumber(10)),se=se.add(de.Long.fromNumber($[ft]));for(Ye=de.Long.fromNumber($[ft++]);ft<=M;ft++)Ye=Ye.multiply(de.Long.fromNumber(10)),Ye=Ye.add(de.Long.fromNumber($[ft]))}let jt=K(se,de.Long.fromString("100000000000000000"));jt.low=jt.low.add(Ye),ne(jt.low,Ye)&&(jt.high=jt.high.add(de.Long.fromNumber(1))),wr=G+s;let Ee={low:de.Long.fromNumber(0),high:de.Long.fromNumber(0)};jt.high.shiftRightUnsigned(49).and(de.Long.fromNumber(1)).equals(de.Long.fromNumber(1))?(Ee.high=Ee.high.or(de.Long.fromNumber(3).shiftLeft(61)),Ee.high=Ee.high.or(de.Long.fromNumber(wr).and(de.Long.fromNumber(16383).shiftLeft(47))),Ee.high=Ee.high.or(jt.high.and(de.Long.fromNumber(140737488355327)))):(Ee.high=Ee.high.or(de.Long.fromNumber(wr&16383).shiftLeft(49)),Ee.high=Ee.high.or(jt.high.and(de.Long.fromNumber(562949953421311)))),Ee.low=jt.low,ie&&(Ee.high=Ee.high.or(de.Long.fromString("9223372036854775808")));let At=ae.Buffer.alloc(16);return pe=0,At[pe++]=Ee.low.low&255,At[pe++]=Ee.low.low>>8&255,At[pe++]=Ee.low.low>>16&255,At[pe++]=Ee.low.low>>24&255,At[pe++]=Ee.low.high&255,At[pe++]=Ee.low.high>>8&255,At[pe++]=Ee.low.high>>16&255,At[pe++]=Ee.low.high>>24&255,At[pe++]=Ee.high.low&255,At[pe++]=Ee.high.low>>8&255,At[pe++]=Ee.high.low>>16&255,At[pe++]=Ee.high.low>>24&255,At[pe++]=Ee.high.high&255,At[pe++]=Ee.high.high>>8&255,At[pe++]=Ee.high.high>>16&255,At[pe++]=Ee.high.high>>24&255,new N(At)}toString(){let C,ie=0,j=new Array(36);for(let pe=0;pe<j.length;pe++)j[pe]=0;let g=0,O=!1,w,P={parts:[0,0,0,0]},V,U,$=[];g=0;let E=this.bytes,xe=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,fe=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,M=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24,G=E[g++]|E[g++]<<8|E[g++]<<16|E[g++]<<24;g=0,{low:new de.Long(xe,fe),high:new de.Long(M,G)}.high.lessThan(de.Long.ZERO)&&$.push("-");let se=G>>26&h;if(se>>3==3){if(se===y)return $.join("")+"Infinity";if(se===R)return"NaN";C=G>>15&k,w=8+(G>>14&1)}else w=G>>14&7,C=G>>17&k;let Ye=C-s;if(P.parts[0]=(G&16383)+((w&15)<<14),P.parts[1]=M,P.parts[2]=fe,P.parts[3]=xe,P.parts[0]===0&&P.parts[1]===0&&P.parts[2]===0&&P.parts[3]===0)O=!0;else for(U=3;U>=0;U--){let pe=0,Et=D(P);if(P=Et.quotient,pe=Et.rem.low,!!pe)for(V=8;V>=0;V--)j[U*9+V]=pe%10,pe=Math.floor(pe/10)}if(O)ie=1,j[g]=0;else for(ie=36;!j[g];)ie=ie-1,g=g+1;let wr=ie-1+Ye;if(wr>=34||wr<=-7||Ye>0){if(ie>34)return $.push(`${0}`),Ye>0?$.push("E+"+Ye):Ye<0&&$.push("E"+Ye),$.join("");$.push(`${j[g++]}`),ie=ie-1,ie&&$.push(".");for(let pe=0;pe<ie;pe++)$.push(`${j[g++]}`);$.push("E"),wr>0?$.push("+"+wr):$.push(`${wr}`)}else if(Ye>=0)for(let pe=0;pe<ie;pe++)$.push(`${j[g++]}`);else{let pe=ie+Ye;if(pe>0)for(let Et=0;Et<pe;Et++)$.push(`${j[g++]}`);else $.push("0");for($.push(".");pe++<0;)$.push("0");for(let Et=0;Et<ie-Math.max(pe-1,0);Et++)$.push(`${j[g++]}`)}return $.join("")}toJSON(){return{$numberDecimal:this.toString()}}toExtendedJSON(){return{$numberDecimal:this.toString()}}static fromExtendedJSON(C){return N.fromString(C.$numberDecimal)}}e.Decimal128=N,Object.defineProperty(N.prototype,"_bsontype",{value:"Decimal128"})});Nt(vs);WH=vs.Decimal128,Io=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Double=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){if(i&&(i.legacy||i.relaxed&&isFinite(this.value)))return this.value;if(Object.is(Math.sign(this.value),-0))return{$numberDouble:`-${this.value.toFixed(1)}`};let f;return Number.isInteger(this.value)?(f=this.value.toFixed(1),f.length>=13&&(f=this.value.toExponential(13).toUpperCase())):f=this.value.toString(),{$numberDouble:f}}static fromExtendedJSON(i,f){let o=parseFloat(i.$numberDouble);return f&&f.relaxed?o:new r(o)}}e.Double=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Double"})});Nt(Io);YH=Io.Double,So=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Int32=void 0;class r{constructor(i){i instanceof Number&&(i=i.valueOf()),this.value=+i}valueOf(){return this.value}toJSON(){return this.value}toExtendedJSON(i){return i&&(i.relaxed||i.legacy)?this.value:{$numberInt:this.value.toString()}}static fromExtendedJSON(i,f){return f&&f.relaxed?parseInt(i.$numberInt,10):new r(i.$numberInt)}}e.Int32=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Int32"})});Nt(So);KH=So.Int32,bu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Map=void 0;let r;e.Map=r;let n=function(o){return o&&o.Math==Math&&o};function i(){return n(typeof globalThis=="object"&&globalThis)||n(typeof window=="object"&&window)||n(typeof self=="object"&&self)||n(typeof au=="object"&&au)||Function("return this")()}let f=i();Object.prototype.hasOwnProperty.call(f,"Map")?e.Map=r=f.Map:e.Map=r=class{constructor(s=[]){this._keys=[],this._values={};for(let l=0;l<s.length;l++){if(s[l]==null)continue;let p=s[l],u=p[0],b=p[1];this._keys.push(u),this._values[u]={v:b,i:this._keys.length-1}}}clear(){this._keys=[],this._values={}}delete(s){let l=this._values[s];return l==null?!1:(delete this._values[s],this._keys.splice(l.i,1),!0)}entries(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?[l,this._values[l].v]:void 0,done:l===void 0}}}}forEach(s,l){l=l||this;for(let p=0;p<this._keys.length;p++){let u=this._keys[p];s.call(l,this._values[u].v,u,l)}}get(s){return this._values[s]?this._values[s].v:void 0}has(s){return this._values[s]!=null}keys(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?l:void 0,done:l===void 0}}}}set(s,l){return this._values[s]?(this._values[s].v=l,this):(this._keys.push(s),this._values[s]={v:l,i:this._keys.length-1},this)}values(){let s=0;return{next:()=>{let l=this._keys[s++];return{value:l!==void 0?this._values[l].v:void 0,done:l===void 0}}}}get size(){return this._keys.length}}});Nt(bu);JH=bu.Map,qs=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MaxKey=void 0;class r{toExtendedJSON(){return{$maxKey:1}}static fromExtendedJSON(){return new r}}e.MaxKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MaxKey"})});Nt(qs);ZH=qs.MaxKey,Ts=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.MinKey=void 0;class r{toExtendedJSON(){return{$minKey:1}}static fromExtendedJSON(){return new r}}e.MinKey=r,Object.defineProperty(r.prototype,"_bsontype",{value:"MinKey"})});Nt(Ts);XH=Ts.MinKey,Wi=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.ObjectId=void 0;let r=ut.randomBytes(5),n=new RegExp("^[0-9a-fA-F]{24}$"),i=[];for(let u=0;u<256;u++)i[u]=(u<=15?"0":"")+u.toString(16);let f=[],o=0;for(;o<10;)f[48+o]=o++;for(;o<16;)f[65-10+o]=f[97-10+o]=o++;let s=Symbol("id");class l{constructor(b){if(b instanceof l&&(this[s]=b.id,this.__id=b.__id),typeof b=="object"&&b&&"id"in b&&("toHexString"in b&&typeof b.toHexString=="function"?this[s]=ae.Buffer.from(b.toHexString(),"hex"):this[s]=typeof b.id=="string"?ae.Buffer.from(b.id):b.id),(b==null||typeof b=="number")&&(this[s]=l.generate(typeof b=="number"?b:void 0),l.cacheHexString&&(this.__id=this.id.toString("hex"))),ArrayBuffer.isView(b)&&b.byteLength===12&&(this[s]=Af.ensureBuffer(b)),typeof b=="string")if(b.length===12){let c=ae.Buffer.from(b);c.byteLength===12&&(this[s]=c)}else if(b.length===24&&n.test(b))this[s]=ae.Buffer.from(b,"hex");else throw new TypeError("Argument passed in must be a Buffer or string of 12 bytes or a string of 24 hex characters");l.cacheHexString&&(this.__id=this.id.toString("hex"))}get id(){return this[s]}set id(b){this[s]=b,l.cacheHexString&&(this.__id=b.toString("hex"))}get generationTime(){return this.id.readInt32BE(0)}set generationTime(b){this.id.writeUInt32BE(b,0)}toHexString(){if(l.cacheHexString&&this.__id)return this.__id;let b=this.id.toString("hex");return l.cacheHexString&&!this.__id&&(this.__id=b),b}static getInc(){return l.index=(l.index+1)%16777215}static generate(b){typeof b!="number"&&(b=~~(Date.now()/1e3));let c=l.getInc(),h=ae.Buffer.alloc(12);return h.writeUInt32BE(b,0),h[4]=r[0],h[5]=r[1],h[6]=r[2],h[7]=r[3],h[8]=r[4],h[11]=c&255,h[10]=c>>8&255,h[9]=c>>16&255,h}toString(b){return b?this.id.toString(b):this.toHexString()}toJSON(){return this.toHexString()}equals(b){return b==null?!1:b instanceof l?this.toString()===b.toString():typeof b=="string"&&l.isValid(b)&&b.length===12&&this.id instanceof ae.Buffer?b===this.id.toString("binary"):typeof b=="string"&&l.isValid(b)&&b.length===24?b.toLowerCase()===this.toHexString():typeof b=="string"&&l.isValid(b)&&b.length===12?ae.Buffer.from(b).equals(this.id):typeof b=="object"&&"toHexString"in b&&typeof b.toHexString=="function"?b.toHexString()===this.toHexString():!1}getTimestamp(){let b=new Date,c=this.id.readUInt32BE(0);return b.setTime(Math.floor(c)*1e3),b}static createPk(){return new l}static createFromTime(b){let c=ae.Buffer.from([0,0,0,0,0,0,0,0,0,0,0,0]);return c.writeUInt32BE(b,0),new l(c)}static createFromHexString(b){if(typeof b=="undefined"||b!=null&&b.length!==24)throw new TypeError("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new l(ae.Buffer.from(b,"hex"))}static isValid(b){return b==null?!1:typeof b=="number"?!0:typeof b=="string"?b.length===12||b.length===24&&n.test(b):b instanceof l||b instanceof ae.Buffer&&b.length===12?!0:typeof b=="object"&&"toHexString"in b&&typeof b.toHexString=="function"?typeof b.id=="string"?b.id.length===12:b.toHexString().length===24&&n.test(b.id.toString("hex")):!1}toExtendedJSON(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}}static fromExtendedJSON(b){return new l(b.$oid)}}e.ObjectId=l,l.index=~~(Math.random()*16777215),Object.defineProperty(l.prototype,"generate",{value:ut.deprecate(u=>l.generate(u),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(l.prototype,"getInc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(l.prototype,"get_inc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(l,"get_inc",{value:ut.deprecate(()=>l.getInc(),"Please use the static `ObjectId.getInc()` instead")});let p=Symbol.for("nodejs.util.inspect.custom");Object.defineProperty(l.prototype,p,l.prototype.toString),Object.defineProperty(l.prototype,"inspect",l.prototype.toString),Object.defineProperty(l.prototype,"_bsontype",{value:"ObjectID"})});Nt(Wi);QH=Wi.ObjectId,W=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_DATA_MAX_KEY=e.BSON_DATA_MIN_KEY=e.BSON_DATA_DECIMAL128=e.BSON_DATA_LONG=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_INT=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_SYMBOL=e.BSON_DATA_CODE=e.BSON_DATA_DBPOINTER=e.BSON_DATA_REGEXP=e.BSON_DATA_NULL=e.BSON_DATA_DATE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_OID=e.BSON_DATA_UNDEFINED=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_DATA_OBJECT=e.BSON_DATA_STRING=e.BSON_DATA_NUMBER=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=void 0,e.BSON_INT32_MAX=2147483647,e.BSON_INT32_MIN=-2147483648,e.BSON_INT64_MAX=Math.pow(2,63)-1,e.BSON_INT64_MIN=-Math.pow(2,63),e.JS_INT_MAX=Math.pow(2,53),e.JS_INT_MIN=-Math.pow(2,53),e.BSON_DATA_NUMBER=1,e.BSON_DATA_STRING=2,e.BSON_DATA_OBJECT=3,e.BSON_DATA_ARRAY=4,e.BSON_DATA_BINARY=5,e.BSON_DATA_UNDEFINED=6,e.BSON_DATA_OID=7,e.BSON_DATA_BOOLEAN=8,e.BSON_DATA_DATE=9,e.BSON_DATA_NULL=10,e.BSON_DATA_REGEXP=11,e.BSON_DATA_DBPOINTER=12,e.BSON_DATA_CODE=13,e.BSON_DATA_SYMBOL=14,e.BSON_DATA_CODE_W_SCOPE=15,e.BSON_DATA_INT=16,e.BSON_DATA_TIMESTAMP=17,e.BSON_DATA_LONG=18,e.BSON_DATA_DECIMAL128=19,e.BSON_DATA_MIN_KEY=255,e.BSON_DATA_MAX_KEY=127,e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BSON_BINARY_SUBTYPE_FUNCTION=1,e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=2,e.BSON_BINARY_SUBTYPE_UUID=3,e.BSON_BINARY_SUBTYPE_UUID_NEW=4,e.BSON_BINARY_SUBTYPE_MD5=5,e.BSON_BINARY_SUBTYPE_USER_DEFINED=128});Nt(W);$H=W.BSON_BINARY_SUBTYPE_USER_DEFINED,eD=W.BSON_BINARY_SUBTYPE_MD5,tD=W.BSON_BINARY_SUBTYPE_UUID_NEW,rD=W.BSON_BINARY_SUBTYPE_UUID,nD=W.BSON_BINARY_SUBTYPE_BYTE_ARRAY,iD=W.BSON_BINARY_SUBTYPE_FUNCTION,fD=W.BSON_BINARY_SUBTYPE_DEFAULT,oD=W.BSON_DATA_MAX_KEY,sD=W.BSON_DATA_MIN_KEY,lD=W.BSON_DATA_DECIMAL128,aD=W.BSON_DATA_LONG,pD=W.BSON_DATA_TIMESTAMP,uD=W.BSON_DATA_INT,cD=W.BSON_DATA_CODE_W_SCOPE,mD=W.BSON_DATA_SYMBOL,dD=W.BSON_DATA_CODE,wD=W.BSON_DATA_DBPOINTER,hD=W.BSON_DATA_REGEXP,bD=W.BSON_DATA_NULL,gD=W.BSON_DATA_DATE,jD=W.BSON_DATA_BOOLEAN,yD=W.BSON_DATA_OID,_D=W.BSON_DATA_UNDEFINED,vD=W.BSON_DATA_BINARY,qD=W.BSON_DATA_ARRAY,TD=W.BSON_DATA_OBJECT,kD=W.BSON_DATA_STRING,BD=W.BSON_DATA_NUMBER,ID=W.JS_INT_MIN,SD=W.JS_INT_MAX,xD=W.BSON_INT64_MIN,ED=W.BSON_INT64_MAX,AD=W.BSON_INT32_MIN,OD=W.BSON_INT32_MAX,Cd=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.calculateObjectSize=void 0;function r(i,f,o){let s=4+1;if(Array.isArray(i))for(let l=0;l<i.length;l++)s+=n(l.toString(),i[l],f,!0,o);else{i.toBSON&&(i=i.toBSON());for(let l in i)s+=n(l,i[l],f,!1,o)}return s}e.calculateObjectSize=r;function n(i,f,o=!1,s=!1,l=!1){switch(f&&f.toBSON&&(f=f.toBSON()),typeof f){case"string":return 1+ae.Buffer.byteLength(i,"utf8")+1+4+ae.Buffer.byteLength(f,"utf8")+1;case"number":return Math.floor(f)===f&&f>=W.JS_INT_MIN&&f<=W.JS_INT_MAX&&f>=W.BSON_INT32_MIN&&f<=W.BSON_INT32_MAX?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(4+1):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);case"undefined":return s||!l?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1:0;case"boolean":return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(1+1);case"object":if(f==null||f._bsontype==="MinKey"||f._bsontype==="MaxKey")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1;if(f._bsontype==="ObjectId"||f._bsontype==="ObjectID")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(12+1);if(f instanceof Date||ut.isDate(f))return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(ArrayBuffer.isView(f)||f instanceof ArrayBuffer)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(1+4+1)+f.byteLength;if(f._bsontype==="Long"||f._bsontype==="Double"||f._bsontype==="Timestamp")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(8+1);if(f._bsontype==="Decimal128")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(16+1);if(f._bsontype==="Code")return f.scope!=null&&Object.keys(f.scope).length>0?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ae.Buffer.byteLength(f.code.toString(),"utf8")+1+r(f.scope,o,l):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+ae.Buffer.byteLength(f.code.toString(),"utf8")+1;if(f._bsontype==="Binary")return f.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(f.position+1+4+1+4):(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+(f.position+1+4+1);if(f._bsontype==="Symbol")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+ae.Buffer.byteLength(f.value,"utf8")+4+1+1;if(f._bsontype==="DBRef"){let p=Object.assign({$ref:f.collection,$id:f.oid},f.fields);return f.db!=null&&(p.$db=f.db),(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+r(p,o,l)}else return f instanceof RegExp||Object.prototype.toString.call(f)==="[object RegExp]"?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.source,"utf8")+1+(f.global?1:0)+(f.ignoreCase?1:0)+(f.multiline?1:0)+1:f._bsontype==="BSONRegExp"?(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.pattern,"utf8")+1+ae.Buffer.byteLength(f.options,"utf8")+1:(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+r(f,o,l)+1;case"function":if(f instanceof RegExp||Object.prototype.toString.call(f)==="[object RegExp]"||String.call(f)==="[object RegExp]")return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+ae.Buffer.byteLength(f.source,"utf8")+1+(f.global?1:0)+(f.ignoreCase?1:0)+(f.multiline?1:0)+1;if(o&&f.scope!=null&&Object.keys(f.scope).length>0)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+4+ae.Buffer.byteLength(ut.normalizedFunctionString(f),"utf8")+1+r(f.scope,o,l);if(o)return(i!=null?ae.Buffer.byteLength(i,"utf8")+1:0)+1+4+ae.Buffer.byteLength(ut.normalizedFunctionString(f),"utf8")+1}return 0}});Nt(Cd);ND=Cd.calculateObjectSize,Nf=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONRegExp=void 0;function r(i){return i.split("").sort().join("")}class n{constructor(f,o){this.pattern=f,this.options=o??"",r(this.options);for(let s=0;s<this.options.length;s++)if(!(this.options[s]==="i"||this.options[s]==="m"||this.options[s]==="x"||this.options[s]==="l"||this.options[s]==="s"||this.options[s]==="u"))throw new Error(`The regular expression option [${this.options[s]}] is not supported`)}static parseOptions(f){return f?f.split("").sort().join(""):""}toExtendedJSON(f){return f=f||{},f.legacy?{$regex:this.pattern,$options:this.options}:{$regularExpression:{pattern:this.pattern,options:this.options}}}static fromExtendedJSON(f){if("$regex"in f)if(typeof f.$regex!="string"){if(f.$regex._bsontype==="BSONRegExp")return f}else return new n(f.$regex,n.parseOptions(f.$options));if("$regularExpression"in f)return new n(f.$regularExpression.pattern,n.parseOptions(f.$regularExpression.options));throw new TypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(f)}`)}}e.BSONRegExp=n,Object.defineProperty(n.prototype,"_bsontype",{value:"BSONRegExp"})});Nt(Nf);RD=Nf.BSONRegExp,ks=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BSONSymbol=void 0;class r{constructor(i){this.value=i}valueOf(){return this.value}toString(){return this.value}inspect(){return this.value}toJSON(){return this.value}toExtendedJSON(){return{$symbol:this.value}}static fromExtendedJSON(i){return new r(i.$symbol)}}e.BSONSymbol=r,Object.defineProperty(r.prototype,"_bsontype",{value:"Symbol"})});Nt(ks);HD=ks.BSONSymbol,Rf=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Timestamp=e.LongWithoutOverridesClass=void 0,e.LongWithoutOverridesClass=de.Long;class r extends e.LongWithoutOverridesClass{constructor(i,f){de.Long.isLong(i)?super(i.low,i.high,!0):super(i,f,!0),Object.defineProperty(this,"_bsontype",{value:"Timestamp",writable:!1,configurable:!1,enumerable:!1})}toJSON(){return{$timestamp:this.toString()}}static fromInt(i){return new r(de.Long.fromInt(i,!0))}static fromNumber(i){return new r(de.Long.fromNumber(i,!0))}static fromBits(i,f){return new r(i,f)}static fromString(i,f){return new r(de.Long.fromString(i,!0,f))}toExtendedJSON(){return{$timestamp:{t:this.high>>>0,i:this.low>>>0}}}static fromExtendedJSON(i){return new r(i.$timestamp.i,i.$timestamp.t)}}e.Timestamp=r,r.MAX_VALUE=de.Long.MAX_UNSIGNED_VALUE});Nt(Rf);DD=Rf.Timestamp,zD=Rf.LongWithoutOverridesClass,gu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.validateUtf8=void 0;let r=128,n=192,i=224,f=240,o=248,s=192,l=224,p=240,u=128;function b(c,h,k){let y=0;for(let R=h;R<k;R+=1){let L=c[R];if(y){if((L&n)!==u)return!1;y-=1}else if(L&r)if((L&i)===s)y=1;else if((L&f)===l)y=2;else if((L&o)===p)y=3;else return!1}return!y}e.validateUtf8=b});Nt(gu);FD=gu.validateUtf8,ju=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserialize=void 0;let r=de.Long.fromNumber(W.JS_INT_MAX),n=de.Long.fromNumber(W.JS_INT_MIN),i={};function f(l,p,u){p=p??{};let b=p&&p.index?p.index:0,c=l[b]|l[b+1]<<8|l[b+2]<<16|l[b+3]<<24;if(c<5)throw new Error(`bson size must be >= 5, is ${c}`);if(p.allowObjectSmallerThanBufferSize&&l.length<c)throw new Error(`buffer length ${l.length} must be >= bson size ${c}`);if(!p.allowObjectSmallerThanBufferSize&&l.length!==c)throw new Error(`buffer length ${l.length} must === bson size ${c}`);if(c+b>l.byteLength)throw new Error(`(bson size ${c} + options.index ${b} must be <= buffer length ${l.byteLength})`);if(l[b+c-1]!==0)throw new Error("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return o(l,b,p,u)}e.deserialize=f;function o(l,p,u,b=!1){let c=u.evalFunctions==null?!1:u.evalFunctions,h=u.cacheFunctions==null?!1:u.cacheFunctions,k=u.fieldsAsRaw==null?null:u.fieldsAsRaw,y=u.raw==null?!1:u.raw,R=typeof u.bsonRegExp=="boolean"?u.bsonRegExp:!1,L=u.promoteBuffers==null?!1:u.promoteBuffers,D=u.promoteLongs==null?!0:u.promoteLongs,K=u.promoteValues==null?!0:u.promoteValues,ne=p;if(l.length<5)throw new Error("corrupt bson message < 5 bytes long");let Y=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(Y<5||Y>l.length)throw new Error("corrupt bson message");let N=b?[]:{},re=0,C=!1;for(;!C;){let g=l[p++];if(g===0)break;let O=p;for(;l[O]!==0&&O<l.length;)O++;if(O>=l.byteLength)throw new Error("Bad BSON Document: illegal CString");let w=b?re++:l.toString("utf8",p,O);if(p=O+1,g===W.BSON_DATA_STRING){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");if(!gu.validateUtf8(l,p,p+P-1))throw new Error("Invalid UTF-8 string in BSON document");let V=l.toString("utf8",p,p+P-1);N[w]=V,p=p+P}else if(g===W.BSON_DATA_OID){let P=ae.Buffer.alloc(12);l.copy(P,0,p,p+12),N[w]=new Wi.ObjectId(P),p=p+12}else if(g===W.BSON_DATA_INT&&K===!1)N[w]=new So.Int32(l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24);else if(g===W.BSON_DATA_INT)N[w]=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;else if(g===W.BSON_DATA_NUMBER&&K===!1)N[w]=new Io.Double(l.readDoubleLE(p)),p=p+8;else if(g===W.BSON_DATA_NUMBER)N[w]=l.readDoubleLE(p),p=p+8;else if(g===W.BSON_DATA_DATE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;N[w]=new Date(new de.Long(P,V).toNumber())}else if(g===W.BSON_DATA_BOOLEAN){if(l[p]!==0&&l[p]!==1)throw new Error("illegal boolean type value");N[w]=l[p++]===1}else if(g===W.BSON_DATA_OBJECT){let P=p,V=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24;if(V<=0||V>l.length-p)throw new Error("bad embedded document length in bson");y?N[w]=l.slice(p,p+V):N[w]=o(l,P,u,!1),p=p+V}else if(g===W.BSON_DATA_ARRAY){let P=p,V=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24,U=u,$=p+V;if(k&&k[w]){U={};for(let E in u)U[E]=u[E];U.raw=!0}if(N[w]=o(l,P,U,!0),p=p+V,l[p-1]!==0)throw new Error("invalid array terminator byte");if(p!==$)throw new Error("corrupted array bson")}else if(g===W.BSON_DATA_UNDEFINED)N[w]=void 0;else if(g===W.BSON_DATA_NULL)N[w]=null;else if(g===W.BSON_DATA_LONG){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,U=new de.Long(P,V);D&&K===!0?N[w]=U.lessThanOrEqual(r)&&U.greaterThanOrEqual(n)?U.toNumber():U:N[w]=U}else if(g===W.BSON_DATA_DECIMAL128){let P=ae.Buffer.alloc(16);l.copy(P,0,p,p+16),p=p+16;let V=new vs.Decimal128(P);"toObject"in V&&typeof V.toObject=="function"?N[w]=V.toObject():N[w]=V}else if(g===W.BSON_DATA_BINARY){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=P,U=l[p++];if(P<0)throw new Error("Negative binary type element size found");if(P>l.byteLength)throw new Error("Binary type size larger than document size");if(l.slice!=null){if(U===an.Binary.SUBTYPE_BYTE_ARRAY){if(P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,P<0)throw new Error("Negative binary type element size found for subtype 0x02");if(P>V-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(P<V-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}L&&K?N[w]=l.slice(p,p+P):N[w]=new an.Binary(l.slice(p,p+P),U)}else{let $=ae.Buffer.alloc(P);if(U===an.Binary.SUBTYPE_BYTE_ARRAY){if(P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,P<0)throw new Error("Negative binary type element size found for subtype 0x02");if(P>V-4)throw new Error("Binary type with subtype 0x02 contains too long binary size");if(P<V-4)throw new Error("Binary type with subtype 0x02 contains too short binary size")}for(O=0;O<P;O++)$[O]=l[p+O];L&&K?N[w]=$:N[w]=new an.Binary($,U)}p=p+P}else if(g===W.BSON_DATA_REGEXP&&R===!1){for(O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let P=l.toString("utf8",p,O);for(p=O+1,O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let V=l.toString("utf8",p,O);p=O+1;let U=new Array(V.length);for(O=0;O<V.length;O++)switch(V[O]){case"m":U[O]="m";break;case"s":U[O]="g";break;case"i":U[O]="i";break}N[w]=new RegExp(P,U.join(""))}else if(g===W.BSON_DATA_REGEXP&&R===!0){for(O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let P=l.toString("utf8",p,O);for(p=O+1,O=p;l[O]!==0&&O<l.length;)O++;if(O>=l.length)throw new Error("Bad BSON Document: illegal CString");let V=l.toString("utf8",p,O);p=O+1,N[w]=new Nf.BSONRegExp(P,V)}else if(g===W.BSON_DATA_SYMBOL){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");let V=l.toString("utf8",p,p+P-1);N[w]=K?V:new ks.BSONSymbol(V),p=p+P}else if(g===W.BSON_DATA_TIMESTAMP){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24,V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;N[w]=new Rf.Timestamp(P,V)}else if(g===W.BSON_DATA_MIN_KEY)N[w]=new Ts.MinKey;else if(g===W.BSON_DATA_MAX_KEY)N[w]=new qs.MaxKey;else if(g===W.BSON_DATA_CODE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");let V=l.toString("utf8",p,p+P-1);c?h?N[w]=s(V,i,N):N[w]=s(V):N[w]=new Of.Code(V),p=p+P}else if(g===W.BSON_DATA_CODE_W_SCOPE){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<4+4+4+1)throw new Error("code_w_scope total size shorter minimum expected length");let V=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(V<=0||V>l.length-p||l[p+V-1]!==0)throw new Error("bad string length in bson");let U=l.toString("utf8",p,p+V-1);p=p+V;let $=p,E=l[p]|l[p+1]<<8|l[p+2]<<16|l[p+3]<<24,xe=o(l,$,u,!1);if(p=p+E,P<4+4+E+V)throw new Error("code_w_scope total size is too short, truncating scope");if(P>4+4+E+V)throw new Error("code_w_scope total size is too long, clips outer document");c?(h?N[w]=s(U,i,N):N[w]=s(U),N[w].scope=xe):N[w]=new Of.Code(U,xe)}else if(g===W.BSON_DATA_DBPOINTER){let P=l[p++]|l[p++]<<8|l[p++]<<16|l[p++]<<24;if(P<=0||P>l.length-p||l[p+P-1]!==0)throw new Error("bad string length in bson");if(!gu.validateUtf8(l,p,p+P-1))throw new Error("Invalid UTF-8 string in BSON document");let V=l.toString("utf8",p,p+P-1);p=p+P;let U=ae.Buffer.alloc(12);l.copy(U,0,p,p+12);let $=new Wi.ObjectId(U);p=p+12,N[w]=new Zn.DBRef(V,$)}else throw new Error("Detected unknown BSON type "+g.toString(16)+' for fieldname "'+w+'"')}if(Y!==p-ne)throw b?new Error("corrupt array bson"):new Error("corrupt object bson");let ie=Object.keys(N).filter(g=>g.startsWith("$")),j=!0;if(ie.forEach(g=>{["$ref","$id","$db"].indexOf(g)===-1&&(j=!1)}),!j)return N;if(Zn.isDBRefLike(N)){let g=Object.assign({},N);return delete g.$ref,delete g.$id,delete g.$db,new Zn.DBRef(N.$ref,N.$id,N.$db,g)}return N}function s(l,p,u){return p?(p[l]==null&&(p[l]=new Function(l)),p[l].bind(u)):new Function(l)}});Nt(ju);PD=ju.deserialize,Ql=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.EJSON=e.isBSONType=void 0;function r(y){return ut.isObjectLike(y)&&Reflect.has(y,"_bsontype")&&typeof y._bsontype=="string"}e.isBSONType=r;let n=2147483647,i=-2147483648,f=9223372036854776e3,o=-9223372036854776e3,s={$oid:Wi.ObjectId,$binary:an.Binary,$uuid:an.Binary,$symbol:ks.BSONSymbol,$numberInt:So.Int32,$numberDecimal:vs.Decimal128,$numberDouble:Io.Double,$numberLong:de.Long,$minKey:Ts.MinKey,$maxKey:qs.MaxKey,$regex:Nf.BSONRegExp,$regularExpression:Nf.BSONRegExp,$timestamp:Rf.Timestamp};function l(y,R={}){if(typeof y=="number"){if(R.relaxed||R.legacy)return y;if(Math.floor(y)===y){if(y>=i&&y<=n)return new So.Int32(y);if(y>=o&&y<=f)return de.Long.fromNumber(y)}return new Io.Double(y)}if(y==null||typeof y!="object")return y;if(y.$undefined)return null;let L=Object.keys(y).filter(D=>D.startsWith("$")&&y[D]!=null);for(let D=0;D<L.length;D++){let K=s[L[D]];if(K)return K.fromExtendedJSON(y,R)}if(y.$date!=null){let D=y.$date,K=new Date;return R.legacy?typeof D=="number"?K.setTime(D):typeof D=="string"&&K.setTime(Date.parse(D)):typeof D=="string"?K.setTime(Date.parse(D)):de.Long.isLong(D)?K.setTime(D.toNumber()):typeof D=="number"&&R.relaxed&&K.setTime(D),K}if(y.$code!=null){let D=Object.assign({},y);return y.$scope&&(D.$scope=l(y.$scope)),Of.Code.fromExtendedJSON(y)}if(y.$ref!=null||y.$dbPointer!=null){let D=y.$ref?y:y.$dbPointer;if(D instanceof Zn.DBRef)return D;let K=Object.keys(D).filter(Y=>Y.startsWith("$")),ne=!0;if(K.forEach(Y=>{["$ref","$id","$db"].indexOf(Y)===-1&&(ne=!1)}),ne)return Zn.DBRef.fromExtendedJSON(D)}return y}function p(y,R){return y.map(L=>b(L,R))}function u(y){let R=y.toISOString();return y.getUTCMilliseconds()!==0?R:R.slice(0,-5)+"Z"}function b(y,R){if(Array.isArray(y))return p(y,R);if(y===void 0)return null;if(y instanceof Date){let L=y.getTime(),D=L>-1&&L<2534023188e5;return R.legacy?R.relaxed&&D?{$date:y.getTime()}:{$date:u(y)}:R.relaxed&&D?{$date:u(y)}:{$date:{$numberLong:y.getTime().toString()}}}if(typeof y=="number"&&!R.relaxed){if(Math.floor(y)===y){let L=y>=i&&y<=n,D=y>=o&&y<=f;if(L)return{$numberInt:y.toString()};if(D)return{$numberLong:y.toString()}}return{$numberDouble:y.toString()}}if(y instanceof RegExp){let L=y.flags;if(L===void 0){let K=y.toString().match(/[gimuy]*$/);K&&(L=K[0])}return new Nf.BSONRegExp(y.source,L).toExtendedJSON(R)}return y!=null&&typeof y=="object"?h(y,R):y}let c={Binary:y=>new an.Binary(y.value(),y.sub_type),Code:y=>new Of.Code(y.code,y.scope),DBRef:y=>new Zn.DBRef(y.collection||y.namespace,y.oid,y.db,y.fields),Decimal128:y=>new vs.Decimal128(y.bytes),Double:y=>new Io.Double(y.value),Int32:y=>new So.Int32(y.value),Long:y=>de.Long.fromBits(y.low!=null?y.low:y.low_,y.low!=null?y.high:y.high_,y.low!=null?y.unsigned:y.unsigned_),MaxKey:()=>new qs.MaxKey,MinKey:()=>new Ts.MinKey,ObjectID:y=>new Wi.ObjectId(y),ObjectId:y=>new Wi.ObjectId(y),BSONRegExp:y=>new Nf.BSONRegExp(y.pattern,y.options),Symbol:y=>new ks.BSONSymbol(y.value),Timestamp:y=>Rf.Timestamp.fromBits(y.low,y.high)};function h(y,R){if(y==null||typeof y!="object")throw new Error("not an object instance");let L=y._bsontype;if(typeof L=="undefined"){let D={};for(let K in y)D[K]=b(y[K],R);return D}else if(r(y)){let D=y;if(typeof D.toExtendedJSON!="function"){let K=c[y._bsontype];if(!K)throw new TypeError("Unrecognized or invalid _bsontype: "+y._bsontype);D=K(D)}return L==="Code"&&D.scope?D=new Of.Code(D.code,b(D.scope,R)):L==="DBRef"&&D.oid&&(D=new Zn.DBRef(D.collection,b(D.oid,R),D.db,D.fields)),D.toExtendedJSON(R)}else throw new Error("_bsontype must be a string, but was: "+typeof L)}var k;(function(y){function R(ne,Y){let N=Object.assign({},{relaxed:!0,legacy:!1},Y);return typeof N.relaxed=="boolean"&&(N.strict=!N.relaxed),typeof N.strict=="boolean"&&(N.relaxed=!N.strict),JSON.parse(ne,(re,C)=>l(C,N))}y.parse=R;function L(ne,Y,N,re){N!=null&&typeof N=="object"&&(re=N,N=0),Y!=null&&typeof Y=="object"&&!Array.isArray(Y)&&(re=Y,Y=void 0,N=0),re=Object.assign({},{relaxed:!0,legacy:!1},re);let C=b(ne,re);return JSON.stringify(C,Y,N)}y.stringify=L;function D(ne,Y){return Y=Y||{},JSON.parse(L(ne,Y))}y.serialize=D;function K(ne,Y){return Y=Y||{},R(JSON.stringify(ne),Y)}y.deserialize=K})(k=e.EJSON||(e.EJSON={}))});Nt(Ql);LD=Ql.EJSON,UD=Ql.isBSONType,$l=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.writeIEEE754=e.readIEEE754=void 0;function r(i,f,o,s,l){let p,u,b=o==="big",c=l*8-s-1,h=(1<<c)-1,k=h>>1,y=-7,R=b?0:l-1,L=b?1:-1,D=i[f+R];for(R+=L,p=D&(1<<-y)-1,D>>=-y,y+=c;y>0;p=p*256+i[f+R],R+=L,y-=8);for(u=p&(1<<-y)-1,p>>=-y,y+=s;y>0;u=u*256+i[f+R],R+=L,y-=8);if(p===0)p=1-k;else{if(p===h)return u?NaN:(D?-1:1)*(1/0);u=u+Math.pow(2,s),p=p-k}return(D?-1:1)*u*Math.pow(2,p-s)}e.readIEEE754=r;function n(i,f,o,s,l,p){let u,b,c,h=s==="big",k=p*8-l-1,y=(1<<k)-1,R=y>>1,L=l===23?Math.pow(2,-24)-Math.pow(2,-77):0,D=h?p-1:0,K=h?-1:1,ne=f<0||f===0&&1/f<0?1:0;for(f=Math.abs(f),isNaN(f)||f===1/0?(b=isNaN(f)?1:0,u=y):(u=Math.floor(Math.log(f)/Math.LN2),f*(c=Math.pow(2,-u))<1&&(u--,c*=2),u+R>=1?f+=L/c:f+=L*Math.pow(2,1-R),f*c>=2&&(u++,c/=2),u+R>=y?(b=0,u=y):u+R>=1?(b=(f*c-1)*Math.pow(2,l),u=u+R):(b=f*Math.pow(2,R-1)*Math.pow(2,l),u=0)),isNaN(f)&&(b=0);l>=8;)i[o+D]=b&255,D+=K,b/=256,l-=8;for(u=u<<l|b,isNaN(f)&&(u+=8),k+=l;k>0;)i[o+D]=u&255,D+=K,u/=256,k-=8;i[o+D-K]|=ne*128}e.writeIEEE754=n});Nt($l);MD=$l.writeIEEE754,CD=$l.readIEEE754,yu=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.serializeInto=void 0;let r=/\x00/,n=new Set(["$db","$ref","$id","$clusterTime"]);function i(j){return Object.prototype.toString.call(j)==="[object RegExp]"}function f(j,g,O,w,P){j[w++]=W.BSON_DATA_STRING;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V+1,j[w-1]=0;let U=j.write(O,w+4,void 0,"utf8");return j[w+3]=U+1>>24&255,j[w+2]=U+1>>16&255,j[w+1]=U+1>>8&255,j[w]=U+1&255,w=w+4+U,j[w++]=0,w}function o(j,g,O,w,P){if(Number.isInteger(O)&&O>=W.BSON_INT32_MIN&&O<=W.BSON_INT32_MAX){j[w++]=W.BSON_DATA_INT;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0,j[w++]=O&255,j[w++]=O>>8&255,j[w++]=O>>16&255,j[w++]=O>>24&255}else{j[w++]=W.BSON_DATA_NUMBER;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0,$l.writeIEEE754(j,O,w,"little",52,8),w=w+8}return w}function s(j,g,O,w,P){j[w++]=W.BSON_DATA_NULL;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,w}function l(j,g,O,w,P){j[w++]=W.BSON_DATA_BOOLEAN;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,j[w++]=O?1:0,w}function p(j,g,O,w,P){j[w++]=W.BSON_DATA_DATE;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=de.Long.fromNumber(O.getTime()),$=U.getLowBits(),E=U.getHighBits();return j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,j[w++]=E&255,j[w++]=E>>8&255,j[w++]=E>>16&255,j[w++]=E>>24&255,w}function u(j,g,O,w,P){j[w++]=W.BSON_DATA_REGEXP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,O.source&&O.source.match(r)!=null)throw Error("value "+O.source+" must not contain null bytes");return w=w+j.write(O.source,w,void 0,"utf8"),j[w++]=0,O.ignoreCase&&(j[w++]=105),O.global&&(j[w++]=115),O.multiline&&(j[w++]=109),j[w++]=0,w}function b(j,g,O,w,P){j[w++]=W.BSON_DATA_REGEXP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,O.pattern.match(r)!=null)throw Error("pattern "+O.pattern+" must not contain null bytes");return w=w+j.write(O.pattern,w,void 0,"utf8"),j[w++]=0,w=w+j.write(O.options.split("").sort().join(""),w,void 0,"utf8"),j[w++]=0,w}function c(j,g,O,w,P){O===null?j[w++]=W.BSON_DATA_NULL:O._bsontype==="MinKey"?j[w++]=W.BSON_DATA_MIN_KEY:j[w++]=W.BSON_DATA_MAX_KEY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,w}function h(j,g,O,w,P){j[w++]=W.BSON_DATA_OID;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");if(w=w+V,j[w++]=0,typeof O.id=="string")j.write(O.id,w,void 0,"binary");else if(O.id&&O.id.copy)O.id.copy(j,w,0,12);else throw new TypeError("object ["+JSON.stringify(O)+"] is not a valid ObjectId");return w+12}function k(j,g,O,w,P){j[w++]=W.BSON_DATA_BINARY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.length;return j[w++]=U&255,j[w++]=U>>8&255,j[w++]=U>>16&255,j[w++]=U>>24&255,j[w++]=W.BSON_BINARY_SUBTYPE_DEFAULT,j.set(Af.ensureBuffer(O),w),w=w+U,w}function y(j,g,O,w,P=!1,V=0,U=!1,$=!0,E=!1,xe=[]){for(let G=0;G<xe.length;G++)if(xe[G]===O)throw new Error("cyclic dependency detected");xe.push(O),j[w++]=Array.isArray(O)?W.BSON_DATA_ARRAY:W.BSON_DATA_OBJECT;let fe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+fe,j[w++]=0;let M=ie(j,O,P,w,V+1,U,$,xe);return xe.pop(),M}function R(j,g,O,w,P){j[w++]=W.BSON_DATA_DECIMAL128;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,O.bytes.copy(j,w,0,16),w+16}function L(j,g,O,w,P){j[w++]=O._bsontype==="Long"?W.BSON_DATA_LONG:W.BSON_DATA_TIMESTAMP;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.getLowBits(),$=O.getHighBits();return j[w++]=U&255,j[w++]=U>>8&255,j[w++]=U>>16&255,j[w++]=U>>24&255,j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,w}function D(j,g,O,w,P){O=O.valueOf(),j[w++]=W.BSON_DATA_INT;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,j[w++]=O&255,j[w++]=O>>8&255,j[w++]=O>>16&255,j[w++]=O>>24&255,w}function K(j,g,O,w,P){j[w++]=W.BSON_DATA_NUMBER;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");return w=w+V,j[w++]=0,$l.writeIEEE754(j,O.value,w,"little",52,8),w=w+8,w}function ne(j,g,O,w,P=!1,V=0,U){j[w++]=W.BSON_DATA_CODE;let $=U?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+$,j[w++]=0;let E=ut.normalizedFunctionString(O),xe=j.write(E,w+4,void 0,"utf8")+1;return j[w]=xe&255,j[w+1]=xe>>8&255,j[w+2]=xe>>16&255,j[w+3]=xe>>24&255,w=w+4+xe-1,j[w++]=0,w}function Y(j,g,O,w,P=!1,V=0,U=!1,$=!0,E=!1){if(O.scope&&typeof O.scope=="object"){j[w++]=W.BSON_DATA_CODE_W_SCOPE;let xe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+xe,j[w++]=0;let fe=w,M=typeof O.code=="string"?O.code:O.code.toString();w=w+4;let G=j.write(M,w+4,void 0,"utf8")+1;j[w]=G&255,j[w+1]=G>>8&255,j[w+2]=G>>16&255,j[w+3]=G>>24&255,j[w+4+G-1]=0,w=w+G+4;let Se=ie(j,O.scope,P,w,V+1,U,$);w=Se-1;let se=Se-fe;j[fe++]=se&255,j[fe++]=se>>8&255,j[fe++]=se>>16&255,j[fe++]=se>>24&255,j[w++]=0}else{j[w++]=W.BSON_DATA_CODE;let xe=E?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+xe,j[w++]=0;let fe=O.code.toString(),M=j.write(fe,w+4,void 0,"utf8")+1;j[w]=M&255,j[w+1]=M>>8&255,j[w+2]=M>>16&255,j[w+3]=M>>24&255,w=w+4+M-1,j[w++]=0}return w}function N(j,g,O,w,P){j[w++]=W.BSON_DATA_BINARY;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=O.value(!0),$=O.position;return O.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY&&($=$+4),j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255,j[w++]=O.sub_type,O.sub_type===an.Binary.SUBTYPE_BYTE_ARRAY&&($=$-4,j[w++]=$&255,j[w++]=$>>8&255,j[w++]=$>>16&255,j[w++]=$>>24&255),j.set(U,w),w=w+O.position,w}function re(j,g,O,w,P){j[w++]=W.BSON_DATA_SYMBOL;let V=P?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+V,j[w++]=0;let U=j.write(O.value,w+4,void 0,"utf8")+1;return j[w]=U&255,j[w+1]=U>>8&255,j[w+2]=U>>16&255,j[w+3]=U>>24&255,w=w+4+U-1,j[w++]=0,w}function C(j,g,O,w,P,V,U){j[w++]=W.BSON_DATA_OBJECT;let $=U?j.write(g,w,void 0,"ascii"):j.write(g,w,void 0,"utf8");w=w+$,j[w++]=0;let E=w,xe={$ref:O.collection||O.namespace,$id:O.oid};O.db!=null&&(xe.$db=O.db),xe=Object.assign(xe,O.fields);let fe=ie(j,xe,!1,w,P+1,V),M=fe-E;return j[E++]=M&255,j[E++]=M>>8&255,j[E++]=M>>16&255,j[E++]=M>>24&255,fe}function ie(j,g,O=!1,w=0,P=0,V=!1,U=!0,$=[]){w=w||0,$=$||[],$.push(g);let E=w+4;if(Array.isArray(g))for(let fe=0;fe<g.length;fe++){let M=""+fe,G=g[fe];if(G&&G.toBSON){if(typeof G.toBSON!="function")throw new TypeError("toBSON is not a function");G=G.toBSON()}if(typeof G=="string")E=f(j,M,G,E,!0);else if(typeof G=="number")E=o(j,M,G,E,!0);else{if(typeof G=="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(typeof G=="boolean")E=l(j,M,G,E,!0);else if(G instanceof Date||ut.isDate(G))E=p(j,M,G,E,!0);else if(G===void 0)E=s(j,M,G,E,!0);else if(G===null)E=s(j,M,G,E,!0);else if(G._bsontype==="ObjectId"||G._bsontype==="ObjectID")E=h(j,M,G,E,!0);else if(ae.Buffer.isBuffer(G)||ut.isUint8Array(G))E=k(j,M,G,E,!0);else if(G instanceof RegExp||i(G))E=u(j,M,G,E,!0);else if(typeof G=="object"&&G._bsontype==null)E=y(j,M,G,E,O,P,V,U,!0,$);else if(typeof G=="object"&&Ql.isBSONType(G)&&G._bsontype==="Decimal128")E=R(j,M,G,E,!0);else if(G._bsontype==="Long"||G._bsontype==="Timestamp")E=L(j,M,G,E,!0);else if(G._bsontype==="Double")E=K(j,M,G,E,!0);else if(typeof G=="function"&&V)E=ne(j,M,G,E,O,P,!0);else if(G._bsontype==="Code")E=Y(j,M,G,E,O,P,V,U,!0);else if(G._bsontype==="Binary")E=N(j,M,G,E,!0);else if(G._bsontype==="Symbol")E=re(j,M,G,E,!0);else if(G._bsontype==="DBRef")E=C(j,M,G,E,P,V,!0);else if(G._bsontype==="BSONRegExp")E=b(j,M,G,E,!0);else if(G._bsontype==="Int32")E=D(j,M,G,E,!0);else if(G._bsontype==="MinKey"||G._bsontype==="MaxKey")E=c(j,M,G,E,!0);else if(typeof G._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+G._bsontype)}}else if(g instanceof bu.Map){let fe=g.entries(),M=!1;for(;!M;){let G=fe.next();if(M=!!G.done,M)continue;let Se=G.value[0],se=G.value[1],Ye=typeof se;if(typeof Se=="string"&&!n.has(Se)){if(Se.match(r)!=null)throw Error("key "+Se+" must not contain null bytes");if(O){if(Se[0]==="$")throw Error("key "+Se+" must not start with '$'");if(~Se.indexOf("."))throw Error("key "+Se+" must not contain '.'")}}if(Ye==="string")E=f(j,Se,se,E);else if(Ye==="number")E=o(j,Se,se,E);else{if(Ye==="bigint"||ut.isBigInt64Array(se)||ut.isBigUInt64Array(se))throw new TypeError("Unsupported type BigInt, please use Decimal128");if(Ye==="boolean")E=l(j,Se,se,E);else if(se instanceof Date||ut.isDate(se))E=p(j,Se,se,E);else if(se===null||se===void 0&&U===!1)E=s(j,Se,se,E);else if(se._bsontype==="ObjectId"||se._bsontype==="ObjectID")E=h(j,Se,se,E);else if(ae.Buffer.isBuffer(se)||ut.isUint8Array(se))E=k(j,Se,se,E);else if(se instanceof RegExp||i(se))E=u(j,Se,se,E);else if(Ye==="object"&&se._bsontype==null)E=y(j,Se,se,E,O,P,V,U,!1,$);else if(Ye==="object"&&se._bsontype==="Decimal128")E=R(j,Se,se,E);else if(se._bsontype==="Long"||se._bsontype==="Timestamp")E=L(j,Se,se,E);else if(se._bsontype==="Double")E=K(j,Se,se,E);else if(se._bsontype==="Code")E=Y(j,Se,se,E,O,P,V,U);else if(typeof se=="function"&&V)E=ne(j,Se,se,E,O,P,V);else if(se._bsontype==="Binary")E=N(j,Se,se,E);else if(se._bsontype==="Symbol")E=re(j,Se,se,E);else if(se._bsontype==="DBRef")E=C(j,Se,se,E,P,V);else if(se._bsontype==="BSONRegExp")E=b(j,Se,se,E);else if(se._bsontype==="Int32")E=D(j,Se,se,E);else if(se._bsontype==="MinKey"||se._bsontype==="MaxKey")E=c(j,Se,se,E);else if(typeof se._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+se._bsontype)}}}else{if(g.toBSON){if(typeof g.toBSON!="function")throw new TypeError("toBSON is not a function");if(g=g.toBSON(),g!=null&&typeof g!="object")throw new TypeError("toBSON function did not return an object")}for(let fe in g){let M=g[fe];if(M&&M.toBSON){if(typeof M.toBSON!="function")throw new TypeError("toBSON is not a function");M=M.toBSON()}let G=typeof M;if(typeof fe=="string"&&!n.has(fe)){if(fe.match(r)!=null)throw Error("key "+fe+" must not contain null bytes");if(O){if(fe[0]==="$")throw Error("key "+fe+" must not start with '$'");if(~fe.indexOf("."))throw Error("key "+fe+" must not contain '.'")}}if(G==="string")E=f(j,fe,M,E);else if(G==="number")E=o(j,fe,M,E);else{if(G==="bigint")throw new TypeError("Unsupported type BigInt, please use Decimal128");if(G==="boolean")E=l(j,fe,M,E);else if(M instanceof Date||ut.isDate(M))E=p(j,fe,M,E);else if(M===void 0)U===!1&&(E=s(j,fe,M,E));else if(M===null)E=s(j,fe,M,E);else if(M._bsontype==="ObjectId"||M._bsontype==="ObjectID")E=h(j,fe,M,E);else if(ae.Buffer.isBuffer(M)||ut.isUint8Array(M))E=k(j,fe,M,E);else if(M instanceof RegExp||i(M))E=u(j,fe,M,E);else if(G==="object"&&M._bsontype==null)E=y(j,fe,M,E,O,P,V,U,!1,$);else if(G==="object"&&M._bsontype==="Decimal128")E=R(j,fe,M,E);else if(M._bsontype==="Long"||M._bsontype==="Timestamp")E=L(j,fe,M,E);else if(M._bsontype==="Double")E=K(j,fe,M,E);else if(M._bsontype==="Code")E=Y(j,fe,M,E,O,P,V,U);else if(typeof M=="function"&&V)E=ne(j,fe,M,E,O,P,V);else if(M._bsontype==="Binary")E=N(j,fe,M,E);else if(M._bsontype==="Symbol")E=re(j,fe,M,E);else if(M._bsontype==="DBRef")E=C(j,fe,M,E,P,V);else if(M._bsontype==="BSONRegExp")E=b(j,fe,M,E);else if(M._bsontype==="Int32")E=D(j,fe,M,E);else if(M._bsontype==="MinKey"||M._bsontype==="MaxKey")E=c(j,fe,M,E);else if(typeof M._bsontype!="undefined")throw new TypeError("Unrecognized or invalid _bsontype: "+M._bsontype)}}}$.pop(),j[E++]=0;let xe=E-w;return j[w++]=xe&255,j[w++]=xe>>8&255,j[w++]=xe>>16&255,j[w++]=xe>>24&255,E}e.serializeInto=ie});Nt(yu);VD=yu.serializeInto,we=kt(function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.deserializeStream=e.calculateObjectSize=e.deserialize=e.serializeWithBufferAndIndex=e.serialize=e.setInternalBufferSize=e.ObjectID=e.Decimal128=e.BSONRegExp=e.MaxKey=e.MinKey=e.Int32=e.Double=e.Timestamp=e.Long=e.ObjectId=e.Binary=e.DBRef=e.BSONSymbol=e.Map=e.Code=e.LongWithoutOverridesClass=e.EJSON=e.JS_INT_MIN=e.JS_INT_MAX=e.BSON_INT64_MIN=e.BSON_INT64_MAX=e.BSON_INT32_MIN=e.BSON_INT32_MAX=e.BSON_DATA_UNDEFINED=e.BSON_DATA_TIMESTAMP=e.BSON_DATA_SYMBOL=e.BSON_DATA_STRING=e.BSON_DATA_REGEXP=e.BSON_DATA_OID=e.BSON_DATA_OBJECT=e.BSON_DATA_NUMBER=e.BSON_DATA_NULL=e.BSON_DATA_MIN_KEY=e.BSON_DATA_MAX_KEY=e.BSON_DATA_LONG=e.BSON_DATA_INT=e.BSON_DATA_DECIMAL128=e.BSON_DATA_DBPOINTER=e.BSON_DATA_DATE=e.BSON_DATA_CODE_W_SCOPE=e.BSON_DATA_CODE=e.BSON_DATA_BOOLEAN=e.BSON_DATA_BINARY=e.BSON_DATA_ARRAY=e.BSON_BINARY_SUBTYPE_UUID_NEW=e.BSON_BINARY_SUBTYPE_UUID=e.BSON_BINARY_SUBTYPE_USER_DEFINED=e.BSON_BINARY_SUBTYPE_MD5=e.BSON_BINARY_SUBTYPE_FUNCTION=e.BSON_BINARY_SUBTYPE_DEFAULT=e.BSON_BINARY_SUBTYPE_BYTE_ARRAY=void 0,Object.defineProperty(e,"Binary",{enumerable:!0,get:function(){return an.Binary}}),Object.defineProperty(e,"Code",{enumerable:!0,get:function(){return Of.Code}}),Object.defineProperty(e,"DBRef",{enumerable:!0,get:function(){return Zn.DBRef}}),Object.defineProperty(e,"Decimal128",{enumerable:!0,get:function(){return vs.Decimal128}}),Object.defineProperty(e,"Double",{enumerable:!0,get:function(){return Io.Double}}),Object.defineProperty(e,"Int32",{enumerable:!0,get:function(){return So.Int32}}),Object.defineProperty(e,"Long",{enumerable:!0,get:function(){return de.Long}}),Object.defineProperty(e,"Map",{enumerable:!0,get:function(){return bu.Map}}),Object.defineProperty(e,"MaxKey",{enumerable:!0,get:function(){return qs.MaxKey}}),Object.defineProperty(e,"MinKey",{enumerable:!0,get:function(){return Ts.MinKey}}),Object.defineProperty(e,"ObjectId",{enumerable:!0,get:function(){return Wi.ObjectId}}),Object.defineProperty(e,"ObjectID",{enumerable:!0,get:function(){return Wi.ObjectId}}),Object.defineProperty(e,"BSONRegExp",{enumerable:!0,get:function(){return Nf.BSONRegExp}}),Object.defineProperty(e,"BSONSymbol",{enumerable:!0,get:function(){return ks.BSONSymbol}}),Object.defineProperty(e,"Timestamp",{enumerable:!0,get:function(){return Rf.Timestamp}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_BYTE_ARRAY",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_BYTE_ARRAY}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_DEFAULT",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_DEFAULT}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_FUNCTION",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_FUNCTION}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_MD5",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_MD5}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_USER_DEFINED",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_USER_DEFINED}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_UUID}}),Object.defineProperty(e,"BSON_BINARY_SUBTYPE_UUID_NEW",{enumerable:!0,get:function(){return W.BSON_BINARY_SUBTYPE_UUID_NEW}}),Object.defineProperty(e,"BSON_DATA_ARRAY",{enumerable:!0,get:function(){return W.BSON_DATA_ARRAY}}),Object.defineProperty(e,"BSON_DATA_BINARY",{enumerable:!0,get:function(){return W.BSON_DATA_BINARY}}),Object.defineProperty(e,"BSON_DATA_BOOLEAN",{enumerable:!0,get:function(){return W.BSON_DATA_BOOLEAN}}),Object.defineProperty(e,"BSON_DATA_CODE",{enumerable:!0,get:function(){return W.BSON_DATA_CODE}}),Object.defineProperty(e,"BSON_DATA_CODE_W_SCOPE",{enumerable:!0,get:function(){return W.BSON_DATA_CODE_W_SCOPE}}),Object.defineProperty(e,"BSON_DATA_DATE",{enumerable:!0,get:function(){return W.BSON_DATA_DATE}}),Object.defineProperty(e,"BSON_DATA_DBPOINTER",{enumerable:!0,get:function(){return W.BSON_DATA_DBPOINTER}}),Object.defineProperty(e,"BSON_DATA_DECIMAL128",{enumerable:!0,get:function(){return W.BSON_DATA_DECIMAL128}}),Object.defineProperty(e,"BSON_DATA_INT",{enumerable:!0,get:function(){return W.BSON_DATA_INT}}),Object.defineProperty(e,"BSON_DATA_LONG",{enumerable:!0,get:function(){return W.BSON_DATA_LONG}}),Object.defineProperty(e,"BSON_DATA_MAX_KEY",{enumerable:!0,get:function(){return W.BSON_DATA_MAX_KEY}}),Object.defineProperty(e,"BSON_DATA_MIN_KEY",{enumerable:!0,get:function(){return W.BSON_DATA_MIN_KEY}}),Object.defineProperty(e,"BSON_DATA_NULL",{enumerable:!0,get:function(){return W.BSON_DATA_NULL}}),Object.defineProperty(e,"BSON_DATA_NUMBER",{enumerable:!0,get:function(){return W.BSON_DATA_NUMBER}}),Object.defineProperty(e,"BSON_DATA_OBJECT",{enumerable:!0,get:function(){return W.BSON_DATA_OBJECT}}),Object.defineProperty(e,"BSON_DATA_OID",{enumerable:!0,get:function(){return W.BSON_DATA_OID}}),Object.defineProperty(e,"BSON_DATA_REGEXP",{enumerable:!0,get:function(){return W.BSON_DATA_REGEXP}}),Object.defineProperty(e,"BSON_DATA_STRING",{enumerable:!0,get:function(){return W.BSON_DATA_STRING}}),Object.defineProperty(e,"BSON_DATA_SYMBOL",{enumerable:!0,get:function(){return W.BSON_DATA_SYMBOL}}),Object.defineProperty(e,"BSON_DATA_TIMESTAMP",{enumerable:!0,get:function(){return W.BSON_DATA_TIMESTAMP}}),Object.defineProperty(e,"BSON_DATA_UNDEFINED",{enumerable:!0,get:function(){return W.BSON_DATA_UNDEFINED}}),Object.defineProperty(e,"BSON_INT32_MAX",{enumerable:!0,get:function(){return W.BSON_INT32_MAX}}),Object.defineProperty(e,"BSON_INT32_MIN",{enumerable:!0,get:function(){return W.BSON_INT32_MIN}}),Object.defineProperty(e,"BSON_INT64_MAX",{enumerable:!0,get:function(){return W.BSON_INT64_MAX}}),Object.defineProperty(e,"BSON_INT64_MIN",{enumerable:!0,get:function(){return W.BSON_INT64_MIN}}),Object.defineProperty(e,"JS_INT_MAX",{enumerable:!0,get:function(){return W.JS_INT_MAX}}),Object.defineProperty(e,"JS_INT_MIN",{enumerable:!0,get:function(){return W.JS_INT_MIN}}),Object.defineProperty(e,"EJSON",{enumerable:!0,get:function(){return Ql.EJSON}});var r=Rf;Object.defineProperty(e,"LongWithoutOverridesClass",{enumerable:!0,get:function(){return r.LongWithoutOverridesClass}});let n=1024*1024*17,i=ae.Buffer.alloc(n);function f(b){i.length<b&&(i=ae.Buffer.alloc(b))}e.setInternalBufferSize=f;function o(b,c={}){let h=typeof c.checkKeys=="boolean"?c.checkKeys:!1,k=typeof c.serializeFunctions=="boolean"?c.serializeFunctions:!1,y=typeof c.ignoreUndefined=="boolean"?c.ignoreUndefined:!0,R=typeof c.minInternalBufferSize=="number"?c.minInternalBufferSize:n;i.length<R&&(i=ae.Buffer.alloc(R));let L=yu.serializeInto(i,b,h,0,0,k,y,[]),D=ae.Buffer.alloc(L);return i.copy(D,0,0,D.length),D}e.serialize=o;function s(b,c,h={}){let k=typeof h.checkKeys=="boolean"?h.checkKeys:!1,y=typeof h.serializeFunctions=="boolean"?h.serializeFunctions:!1,R=typeof h.ignoreUndefined=="boolean"?h.ignoreUndefined:!0,L=typeof h.index=="number"?h.index:0,D=yu.serializeInto(i,b,k,0,0,y,R);return i.copy(c,L,0,D),L+D-1}e.serializeWithBufferAndIndex=s;function l(b,c={}){return ju.deserialize(Af.ensureBuffer(b),c)}e.deserialize=l;function p(b,c={}){c=c||{};let h=typeof c.serializeFunctions=="boolean"?c.serializeFunctions:!1,k=typeof c.ignoreUndefined=="boolean"?c.ignoreUndefined:!0;return Cd.calculateObjectSize(b,h,k)}e.calculateObjectSize=p;function u(b,c,h,k,y,R){let L=Object.assign({allowObjectSmallerThanBufferSize:!0,index:0},R),D=Af.ensureBuffer(b),K=c;for(let ne=0;ne<h;ne++){let Y=D[K]|D[K+1]<<8|D[K+2]<<16|D[K+3]<<24;L.index=K,k[y+ne]=ju.deserialize(D,L),K=K+Y}return K}e.deserializeStream=u}),WD=Nt(we),YD=we.deserializeStream,KD=we.calculateObjectSize,e_=we.deserialize,GD=we.serializeWithBufferAndIndex,t_=we.serialize,JD=we.setInternalBufferSize,ZD=we.ObjectID,XD=we.Decimal128,QD=we.BSONRegExp,$D=we.MaxKey,ez=we.MinKey,tz=we.Int32,rz=we.Double,nz=we.Timestamp,iz=we.Long,fz=we.ObjectId,oz=we.Binary,sz=we.DBRef,lz=we.BSONSymbol,az=we.Map,pz=we.Code,uz=we.LongWithoutOverridesClass,cz=we.EJSON,mz=we.JS_INT_MIN,dz=we.JS_INT_MAX,wz=we.BSON_INT64_MIN,hz=we.BSON_INT64_MAX,bz=we.BSON_INT32_MIN,gz=we.BSON_INT32_MAX,jz=we.BSON_DATA_UNDEFINED,yz=we.BSON_DATA_TIMESTAMP,_z=we.BSON_DATA_SYMBOL,vz=we.BSON_DATA_STRING,qz=we.BSON_DATA_REGEXP,Tz=we.BSON_DATA_OID,kz=we.BSON_DATA_OBJECT,Bz=we.BSON_DATA_NUMBER,Iz=we.BSON_DATA_NULL,Sz=we.BSON_DATA_MIN_KEY,xz=we.BSON_DATA_MAX_KEY,Ez=we.BSON_DATA_LONG,Az=we.BSON_DATA_INT,Oz=we.BSON_DATA_DECIMAL128,Nz=we.BSON_DATA_DBPOINTER,Rz=we.BSON_DATA_DATE,Hz=we.BSON_DATA_CODE_W_SCOPE,Dz=we.BSON_DATA_CODE,zz=we.BSON_DATA_BOOLEAN,Fz=we.BSON_DATA_BINARY,Pz=we.BSON_DATA_ARRAY,Lz=we.BSON_BINARY_SUBTYPE_UUID_NEW,Uz=we.BSON_BINARY_SUBTYPE_UUID,Mz=we.BSON_BINARY_SUBTYPE_USER_DEFINED,Cz=we.BSON_BINARY_SUBTYPE_MD5,Vz=we.BSON_BINARY_SUBTYPE_FUNCTION,Wz=we.BSON_BINARY_SUBTYPE_DEFAULT,Yz=we.BSON_BINARY_SUBTYPE_BYTE_ARRAY});function Wd(t,e){return e_(new Uint8Array(t),e)}var r_=I(()=>{Vd()});async function oE(t,e){let r={...Yd.bson,...e==null?void 0:e.bson};return Wd(t,r)}function sE(t,e){let r={...Yd.bson,...e==null?void 0:e.bson};return Wd(t,r)}var fE,Yd,Kd,n_=I(()=>{r_();fE="4.0.0-alpha.12",Yd={bson:{}},Kd={name:"BSON",id:"bson",module:"bson",version:fE,extensions:["bson"],mimeTypes:["application/bson"],category:"json",binary:!0,parse:oE,parseSync:sE,options:Yd}});function Gd(t,e){return t_(t).buffer}var i_=I(()=>{Vd()});var lE,Jd,f_=I(()=>{i_();lE="4.0.0-alpha.12",Jd={name:"BSON",id:"bson",module:"bson",version:lE,extensions:["bson"],options:{bson:{}},async encode(t,e){return Gd(t,{})},encodeSync(t,e){return Gd(t,{})}}});var o_=I(()=>{n_();f_()});function s_(t,e,r){if(!(t in xo))throw new Error(`invalid type: ${t}`);return xo[t].toPrimitive(e,r)}function Zd(t,e,r){if(!(t in xo))throw new Error(`invalid type: ${t}`);return"fromPrimitive"in xo[t]?xo[t].fromPrimitive?.(e,r):e}function aE(t){return Boolean(t)}function pE(t){return Boolean(t)}function uE(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for FLOAT: ${t}`);return e}function cE(t){let e=parseFloat(t);if(isNaN(e))throw new Error(`invalid value for DOUBLE: ${t}`);return e}function mE(t){let e=parseInt(t,10);if(e<-128||e>127||isNaN(e))throw new Error(`invalid value for INT8: ${t}`);return e}function dE(t){let e=parseInt(t,10);if(e<0||e>255||isNaN(e))throw new Error(`invalid value for UINT8: ${t}`);return e}function wE(t){let e=parseInt(t,10);if(e<-32768||e>32767||isNaN(e))throw new Error(`invalid value for INT16: ${t}`);return e}function hE(t){let e=parseInt(t,10);if(e<0||e>65535||isNaN(e))throw new Error(`invalid value for UINT16: ${t}`);return e}function l_(t){let e=parseInt(t,10);if(e<-2147483648||e>2147483647||isNaN(e))throw new Error(`invalid value for INT32: ${t}`);return e}function bE(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(n<-2147483648||n>2147483647||isNaN(n))throw new Error(`invalid value for INT32: ${t}`);return n}function gE(t){let e=parseInt(t,10);if(e<0||e>281474976710655||isNaN(e))throw new Error(`invalid value for UINT32: ${t}`);return e}function a_(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT64: ${t}`);return e}function jE(t,e){let r=t*10**(e.scale||0),n=Math.round(r*10**-e.presision%1*10**e.presision);if(isNaN(n))throw new Error(`invalid value for INT64: ${t}`);return n}function yE(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for UINT64: ${t}`);return e}function _E(t){let e=parseInt(t,10);if(isNaN(e))throw new Error(`invalid value for INT96: ${t}`);return e}function p_(t){return Buffer.from(t)}function u_(t){return Buffer.from(t)}function vE(t){return Buffer.from(t,"utf8")}function qE(t){return t.toString()}function TE(t){return Buffer.from(JSON.stringify(t))}function kE(t){return JSON.parse(t)}function BE(t){let e=Jd.encodeSync?.(t);return Buffer.from(e)}function IE(t){return Kd.parseSync?.(t)}function SE(t){let e=parseInt(t,10);if(e<0||e>18446744073709552e3||isNaN(e))throw new Error(`invalid value for TIME_MILLIS: ${t}`);return e}function xE(t){let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIME_MICROS: ${t}`);return e}function EE(t){if(t instanceof Date)return t.getTime()/c_;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for DATE: ${t}`);return e}}function AE(t){return new Date(t*c_)}function OE(t){if(t instanceof Date)return t.getTime();{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MILLIS: ${t}`);return e}}function NE(t){return new Date(t)}function RE(t){if(t instanceof Date)return t.getTime()*1e3;{let e=parseInt(t,10);if(e<0||isNaN(e))throw new Error(`invalid value for TIMESTAMP_MICROS: ${t}`);return e}}function HE(t){return new Date(t/1e3)}function DE(t){if(!t.months||!t.days||!t.milliseconds)throw new Error("value for INTERVAL must be object { months: ..., days: ..., milliseconds: ... }");let e=Buffer.alloc(12);return e.writeUInt32LE(t.months,0),e.writeUInt32LE(t.days,4),e.writeUInt32LE(t.milliseconds,8),e}function zE(t){let e=Buffer.from(t),r=e.readUInt32LE(0),n=e.readUInt32LE(4),i=e.readUInt32LE(8);return{months:r,days:n,milliseconds:i}}function m_(t,e){return Math.round(t*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}function d_(t,e){let r=0;if(t.length<=4)for(let i=0;i<t.length;i++)r+=t[i]<<8*(t.length-i-1);else for(let i=0;i<t.length;i++)r+=t[i]*2**(8*(t.length-1-i));return Math.round(r*10**-e.presision%1*10**e.presision)*10**-(e.scale||0)}var xo,c_,Xd=I(()=>{o_();xo={BOOLEAN:{primitiveType:"BOOLEAN",toPrimitive:aE,fromPrimitive:pE},INT32:{primitiveType:"INT32",toPrimitive:l_},INT64:{primitiveType:"INT64",toPrimitive:a_},INT96:{primitiveType:"INT96",toPrimitive:_E},FLOAT:{primitiveType:"FLOAT",toPrimitive:uE},DOUBLE:{primitiveType:"DOUBLE",toPrimitive:cE},BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",toPrimitive:p_},FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",toPrimitive:p_},UTF8:{primitiveType:"BYTE_ARRAY",originalType:"UTF8",toPrimitive:vE,fromPrimitive:qE},TIME_MILLIS:{primitiveType:"INT32",originalType:"TIME_MILLIS",toPrimitive:SE},TIME_MICROS:{primitiveType:"INT64",originalType:"TIME_MICROS",toPrimitive:xE},DATE:{primitiveType:"INT32",originalType:"DATE",toPrimitive:EE,fromPrimitive:AE},TIMESTAMP_MILLIS:{primitiveType:"INT64",originalType:"TIMESTAMP_MILLIS",toPrimitive:OE,fromPrimitive:NE},TIMESTAMP_MICROS:{primitiveType:"INT64",originalType:"TIMESTAMP_MICROS",toPrimitive:RE,fromPrimitive:HE},UINT_8:{primitiveType:"INT32",originalType:"UINT_8",toPrimitive:dE},UINT_16:{primitiveType:"INT32",originalType:"UINT_16",toPrimitive:hE},UINT_32:{primitiveType:"INT32",originalType:"UINT_32",toPrimitive:gE},UINT_64:{primitiveType:"INT64",originalType:"UINT_64",toPrimitive:yE},INT_8:{primitiveType:"INT32",originalType:"INT_8",toPrimitive:mE},INT_16:{primitiveType:"INT32",originalType:"INT_16",toPrimitive:wE},INT_32:{primitiveType:"INT32",originalType:"INT_32",toPrimitive:l_},INT_64:{primitiveType:"INT64",originalType:"INT_64",toPrimitive:a_},JSON:{primitiveType:"BYTE_ARRAY",originalType:"JSON",toPrimitive:TE,fromPrimitive:kE},BSON:{primitiveType:"BYTE_ARRAY",originalType:"BSON",toPrimitive:BE,fromPrimitive:IE},INTERVAL:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"INTERVAL",typeLength:12,toPrimitive:DE,fromPrimitive:zE},DECIMAL_INT32:{primitiveType:"INT32",originalType:"DECIMAL_INT32",toPrimitive:bE,fromPrimitive:m_},DECIMAL_INT64:{primitiveType:"INT64",originalType:"DECIMAL_INT64",toPrimitive:jE,fromPrimitive:m_},DECIMAL_BYTE_ARRAY:{primitiveType:"BYTE_ARRAY",originalType:"DECIMAL_BYTE_ARRAY",toPrimitive:u_,fromPrimitive:d_},DECIMAL_FIXED_LEN_BYTE_ARRAY:{primitiveType:"FIXED_LEN_BYTE_ARRAY",originalType:"DECIMAL_FIXED_LEN_BYTE_ARRAY",toPrimitive:u_,fromPrimitive:d_}};c_=864e5});function Qd(t){let e={};for(let r of t.fieldList)e[r.key]={dlevels:[],rlevels:[],values:[],pageHeaders:[],count:0};return{rowCount:0,columnData:e}}function _u(t,e,r){let n=Qd(t).columnData;if($d(t.fields,e,n,0,0),r.rowCount===0){r.rowCount=1,r.columnData=n;return}r.rowCount+=1;for(let i of t.fieldList)Array.prototype.push.apply(r.columnData[i.key].rlevels,n[i.key].rlevels),Array.prototype.push.apply(r.columnData[i.key].dlevels,n[i.key].dlevels),Array.prototype.push.apply(r.columnData[i.key].values,n[i.key].values),r.columnData[i.key].count+=n[i.key].count}function $d(t,e,r,n,i){for(let f in t){let o=t[f],s=[];if(e&&o.name in e&&e[o.name]!==void 0&&e[o.name]!==null&&(e[o.name].constructor===Array?s=e[o.name]:s.push(e[o.name])),s.length===0&&Boolean(e)&&o.repetitionType==="REQUIRED")throw new Error(`missing required field: ${o.name}`);if(s.length>1&&o.repetitionType!=="REPEATED")throw new Error(`too many values for field: ${o.name}`);if(s.length===0){o.isNested?$d(o.fields,null,r,n,i):(r[o.key].count+=1,r[o.key].rlevels.push(n),r[o.key].dlevels.push(i));continue}for(let l=0;l<s.length;l++){let p=l===0?n:o.rLevelMax;o.isNested?$d(o.fields,s[l],r,p,o.dLevelMax):(r[o.key].count+=1,r[o.key].rlevels.push(p),r[o.key].dlevels.push(o.dLevelMax),r[o.key].values.push(s_(o.originalType||o.primitiveType,s[l])))}}}function vu(t,e){let r=[];for(let n=0;n<e.rowCount;n++)r.push({});for(let n in e.columnData){let i=e.columnData[n];i.count&&FE(t,i,n,r)}return r}function FE(t,e,r,n){let i=t.findField(r),f=t.findFieldBranch(r),o=new Array(i.rLevelMax+1).fill(0),s=0;for(let l=0;l<e.count;l++){let p=e.dlevels[l],u=e.rlevels[l];o[u]++,o.fill(0,u+1);let b=0,c=n[o[b++]-1];for(let h of f){if(h===i||p<h.dLevelMax)break;switch(h.repetitionType){case"REPEATED":h.name in c||(c[h.name]=[]);let k=o[b++];for(;c[h.name].length<=k;)c[h.name].push({});c=c[h.name][k];break;default:c[h.name]=c[h.name]||{},c=c[h.name]}}if(p===i.dLevelMax){let h=Zd(i.originalType||i.primitiveType,e.values[s],i);switch(s++,i.repetitionType){case"REPEATED":i.name in c||(c[i.name]=[]);let k=o[b];for(;c[i.name].length<=k;)c[i.name].push(null);c[i.name][k]=h;break;default:c[i.name]=h}}}}function w_(t,e){let r={};for(let n in e.columnData){let i=e.columnData[n];i.count&&PE(t,i,e.rowCount,n,r)}return r}function PE(t,e,r,n,i){if(e.count<=0)return;let f=t.findField(n),o=t.findFieldBranch(n),s=o[0].name,l,{values:p}=e;if(p.length===r&&o[0].primitiveType&&(l=p),l){i[s]=l;return}l=new Array(r);for(let c=0;c<r;c++)l[c]={};i[s]=l;let u=new Array(f.rLevelMax+1).fill(0),b=0;for(let c=0;c<e.count;c++){let h=e.dlevels[c],k=e.rlevels[c];u[k]++,u.fill(0,k+1);let y=0,R=l[u[y++]-1];for(let L of o){if(L===f||h<L.dLevelMax)break;switch(L.repetitionType){case"REPEATED":L.name in R||(R[L.name]=[]);let D=u[y++];for(;R[L.name].length<=D;)R[L.name].push({});R=R[L.name][D];break;default:R[L.name]=R[L.name]||{},R=R[L.name]}}if(h===f.dLevelMax){let L=Zd(f.originalType||f.primitiveType,e.values[b],f);switch(b++,f.repetitionType){case"REPEATED":f.name in R||(R[f.name]=[]);let D=u[y];for(;R[f.name].length<=D;)R[f.name].push(null);R[f.name][D]=L;break;default:R[f.name]=L}}}for(let c=0;c<r;++c)s in l[c]&&(l[c]=l[c][s])}var ea=I(()=>{Xd()});function ew(t,e){for(let r in t){let n=t[r];n.fields?ew(n.fields,e):n.compression=e}}function h_(t,e,r,n){let i={};for(let f in t){let o=t[f],s=!o.optional,l=Boolean(o.repeated),p=e,u=r,b="REQUIRED";if(s||(b="OPTIONAL",u++),l&&(b="REPEATED",p++,s&&u++),o.fields){let k=n.concat([f]);i[f]={name:f,path:k,key:k.join(),repetitionType:b,rLevelMax:p,dLevelMax:u,isNested:!0,fieldCount:Object.keys(o.fields).length,fields:h_(o.fields,p,u,k)};continue}let c=xo[o.type];if(!c)throw new Error(`invalid parquet type: ${o.type}`);if(o.encoding=o.encoding||"PLAIN",!(o.encoding in Tf))throw new Error(`unsupported parquet encoding: ${o.encoding}`);if(o.compression=o.compression||"UNCOMPRESSED",!(o.compression in Zl))throw new Error(`unsupported compression method: ${o.compression}`);let h=n.concat([f]);i[f]={name:f,primitiveType:c.primitiveType,originalType:c.originalType,path:h,key:h.join(),repetitionType:b,encoding:o.encoding,compression:o.compression,typeLength:o.typeLength||c.typeLength,presision:o.presision,scale:o.scale,rLevelMax:p,dLevelMax:u}}return i}function b_(t){let e=[];for(let r in t)e.push(t[r]),t[r].isNested&&(e=e.concat(b_(t[r].fields)));return e}var ta,tw=I(()=>{Sp();Xl();ea();Xd();ta=class{constructor(e){this.schema=e,this.fields=h_(e,0,0,[]),this.fieldList=b_(this.fields)}findField(e){typeof e=="string"?e=e.split(","):e=e.slice(0);let r=this.fields;for(;e.length>1;e.shift())r=r[e[0]].fields;return r[e[0]]}findFieldBranch(e){typeof e=="string"&&(e=e.split(","));let r=[],n=this.fields;for(;e.length>0;e.shift())r.push(n[e[0]]),e.length>1&&(n=n[e[0]].fields);return r}shredRecord(e,r){_u(this,e,r)}materializeRows(e){return vu(this,e)}compress(e){return ew(this.schema,e),ew(this.fields,e),this}rowGroup(){return Qd(this)}}});var Yi,g_=I(()=>{(function(l){l[l.BOOLEAN=0]="BOOLEAN",l[l.INT32=1]="INT32",l[l.INT64=2]="INT64",l[l.INT96=3]="INT96",l[l.FLOAT=4]="FLOAT",l[l.DOUBLE=5]="DOUBLE",l[l.BYTE_ARRAY=6]="BYTE_ARRAY",l[l.FIXED_LEN_BYTE_ARRAY=7]="FIXED_LEN_BYTE_ARRAY"})(Yi||(Yi={}))});var Bs,j_=I(()=>{(function(N){N[N.UTF8=0]="UTF8",N[N.MAP=1]="MAP",N[N.MAP_KEY_VALUE=2]="MAP_KEY_VALUE",N[N.LIST=3]="LIST",N[N.ENUM=4]="ENUM",N[N.DECIMAL=5]="DECIMAL",N[N.DATE=6]="DATE",N[N.TIME_MILLIS=7]="TIME_MILLIS",N[N.TIME_MICROS=8]="TIME_MICROS",N[N.TIMESTAMP_MILLIS=9]="TIMESTAMP_MILLIS",N[N.TIMESTAMP_MICROS=10]="TIMESTAMP_MICROS",N[N.UINT_8=11]="UINT_8",N[N.UINT_16=12]="UINT_16",N[N.UINT_32=13]="UINT_32",N[N.UINT_64=14]="UINT_64",N[N.INT_8=15]="INT_8",N[N.INT_16=16]="INT_16",N[N.INT_32=17]="INT_32",N[N.INT_64=18]="INT_64",N[N.JSON=19]="JSON",N[N.BSON=20]="BSON",N[N.INTERVAL=21]="INTERVAL"})(Bs||(Bs={}))});var Is,y_=I(()=>{(function(n){n[n.REQUIRED=0]="REQUIRED",n[n.OPTIONAL=1]="OPTIONAL",n[n.REPEATED=2]="REPEATED"})(Is||(Is={}))});var Wr,__=I(()=>{(function(l){l[l.PLAIN=0]="PLAIN",l[l.PLAIN_DICTIONARY=2]="PLAIN_DICTIONARY",l[l.RLE=3]="RLE",l[l.BIT_PACKED=4]="BIT_PACKED",l[l.DELTA_BINARY_PACKED=5]="DELTA_BINARY_PACKED",l[l.DELTA_LENGTH_BYTE_ARRAY=6]="DELTA_LENGTH_BYTE_ARRAY",l[l.DELTA_BYTE_ARRAY=7]="DELTA_BYTE_ARRAY",l[l.RLE_DICTIONARY=8]="RLE_DICTIONARY"})(Wr||(Wr={}))});var Ss,v_=I(()=>{(function(l){l[l.UNCOMPRESSED=0]="UNCOMPRESSED",l[l.SNAPPY=1]="SNAPPY",l[l.GZIP=2]="GZIP",l[l.LZO=3]="LZO",l[l.BROTLI=4]="BROTLI",l[l.LZ4=5]="LZ4",l[l.ZSTD=6]="ZSTD",l[l.LZ4_RAW=7]="LZ4_RAW"})(Ss||(Ss={}))});var Eo,q_=I(()=>{(function(i){i[i.DATA_PAGE=0]="DATA_PAGE",i[i.INDEX_PAGE=1]="INDEX_PAGE",i[i.DICTIONARY_PAGE=2]="DICTIONARY_PAGE",i[i.DATA_PAGE_V2=3]="DATA_PAGE_V2"})(Eo||(Eo={}))});var T_,k_=I(()=>{(function(n){n[n.UNORDERED=0]="UNORDERED",n[n.ASCENDING=1]="ASCENDING",n[n.DESCENDING=2]="DESCENDING"})(T_||(T_={}))});var Nr=he((_3,I_)=>{var rw=4294967296,B_=[];for(xs=0;xs<256;xs++)B_[xs]=(xs>15?"":"0")+xs.toString(16);var xs,ra=I_.exports=function(t,e){t instanceof Buffer?(this.buffer=t,this.offset=e||0):Object.prototype.toString.call(t)=="[object Uint8Array]"?(this.buffer=new Buffer(t),this.offset=e||0):(this.buffer=this.buffer||new Buffer(8),this.offset=0,this.setValue.apply(this,arguments))};ra.MAX_INT=Math.pow(2,53);ra.MIN_INT=-Math.pow(2,53);ra.prototype={constructor:ra,_2scomp:function(){for(var t=this.buffer,e=this.offset,r=1,n=e+7;n>=e;n--){var i=(t[n]^255)+r;t[n]=i&255,r=i>>8}},setValue:function(t,e){var r=!1;if(arguments.length==1)if(typeof t=="number"){if(r=t<0,t=Math.abs(t),e=t%rw,t=t/rw,t>rw)throw new RangeError(t+" is outside Int64 range");t=t|0}else if(typeof t=="string")t=(t+"").replace(/^0x/,""),e=t.substr(-8),t=t.length>8?t.substr(0,t.length-8):"",t=parseInt(t,16),e=parseInt(e,16);else throw new Error(t+" must be a Number or String");for(var n=this.buffer,i=this.offset,f=7;f>=0;f--)n[i+f]=e&255,e=f==4?t:e>>>8;r&&this._2scomp()},toNumber:function(t){for(var e=this.buffer,r=this.offset,n=e[r]&128,i=0,f=1,o=7,s=1;o>=0;o--,s*=256){var l=e[r+o];n&&(l=(l^255)+f,f=l>>8,l=l&255),i+=l*s}return!t&&i>=ra.MAX_INT?n?-1/0:1/0:n?-i:i},valueOf:function(){return this.toNumber(!1)},toString:function(t){return this.valueOf().toString(t||10)},toOctetString:function(t){for(var e=new Array(8),r=this.buffer,n=this.offset,i=0;i<8;i++)e[i]=B_[r[n+i]];return e.join(t||"")},toBuffer:function(t){if(t&&this.offset===0)return this.buffer;var e=new Buffer(8);return this.buffer.copy(e,0,this.offset,this.offset+8),e},copy:function(t,e){this.buffer.copy(t,e||0,this.offset,this.offset+8)},compare:function(t){if((this.buffer[this.offset]&128)!=(t.buffer[t.offset]&128))return t.buffer[t.offset]-this.buffer[this.offset];for(var e=0;e<8;e++)if(this.buffer[this.offset+e]!==t.buffer[t.offset+e])return this.buffer[this.offset+e]-t.buffer[t.offset+e];return 0},equals:function(t){return this.compare(t)===0},inspect:function(){return"[Int64 value:"+this+" octets:"+this.toOctetString(" ")+"]"}}});var x_=he((v3,S_)=>{S_.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var E_=he((q3,nw)=>{typeof Object.create=="function"?nw.exports=function(e,r){e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:nw.exports=function(e,r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e}});var Ki=he(st=>{var A_=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},LE=/%[sdj%]/g;st.format=function(t){if(!Bu(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(Hf(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,f=String(t).replace(LE,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),o=n[r];r<i;o=n[++r])ku(o)||!Es(o)?f+=" "+o:f+=" "+Hf(o);return f};st.deprecate=function(t,e){if(typeof process!="undefined"&&process.noDeprecation===!0)return t;if(typeof process=="undefined")return function(){return st.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(process.throwDeprecation)throw new Error(e);process.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var qu={},iw;st.debuglog=function(t){if(Df(iw)&&(iw=process.env.NODE_DEBUG||""),t=t.toUpperCase(),!qu[t])if(new RegExp("\\b"+t+"\\b","i").test(iw)){var e=process.pid;qu[t]=function(){var r=st.format.apply(st,arguments);console.error("%s %d: %s",t,e,r)}}else qu[t]=function(){};return qu[t]};function Hf(t,e){var r={seen:[],stylize:ME};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),sw(e)?r.showHidden=e:e&&st._extend(r,e),Df(r.showHidden)&&(r.showHidden=!1),Df(r.depth)&&(r.depth=2),Df(r.colors)&&(r.colors=!1),Df(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=UE),Tu(r,t,r.depth)}st.inspect=Hf;Hf.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};Hf.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function UE(t,e){var r=Hf.styles[e];return r?"["+Hf.colors[r][0]+"m"+t+"["+Hf.colors[r][1]+"m":t}function ME(t,e){return t}function CE(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Tu(t,e,r){if(t.customInspect&&e&&xu(e.inspect)&&e.inspect!==st.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Bu(n)||(n=Tu(t,n,r)),n}var i=VE(t,e);if(i)return i;var f=Object.keys(e),o=CE(f);if(t.showHidden&&(f=Object.getOwnPropertyNames(e)),Su(e)&&(f.indexOf("message")>=0||f.indexOf("description")>=0))return fw(e);if(f.length===0){if(xu(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Iu(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(lw(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Su(e))return fw(e)}var l="",p=!1,u=["{","}"];if(O_(e)&&(p=!0,u=["[","]"]),xu(e)){var b=e.name?": "+e.name:"";l=" [Function"+b+"]"}if(Iu(e)&&(l=" "+RegExp.prototype.toString.call(e)),lw(e)&&(l=" "+Date.prototype.toUTCString.call(e)),Su(e)&&(l=" "+fw(e)),f.length===0&&(!p||e.length==0))return u[0]+l+u[1];if(r<0)return Iu(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var c;return p?c=WE(t,e,r,o,f):c=f.map(function(h){return ow(t,e,r,o,h,p)}),t.seen.pop(),YE(c,l,u)}function VE(t,e){if(Df(e))return t.stylize("undefined","undefined");if(Bu(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(N_(e))return t.stylize(""+e,"number");if(sw(e))return t.stylize(""+e,"boolean");if(ku(e))return t.stylize("null","null")}function fw(t){return"["+Error.prototype.toString.call(t)+"]"}function WE(t,e,r,n,i){for(var f=[],o=0,s=e.length;o<s;++o)R_(e,String(o))?f.push(ow(t,e,r,n,String(o),!0)):f.push("");return i.forEach(function(l){l.match(/^\d+$/)||f.push(ow(t,e,r,n,l,!0))}),f}function ow(t,e,r,n,i,f){var o,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?l.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),R_(n,i)||(o="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(ku(r)?s=Tu(t,l.value,null):s=Tu(t,l.value,r-1),s.indexOf(`
|
|
13
13
|
`)>-1&&(f?s=s.split(`
|
|
14
14
|
`).map(function(p){return" "+p}).join(`
|
|
15
15
|
`).substr(2):s=`
|