@loaders.gl/bson
Version:
Framework-independent loader for JSON and streaming JSON formats
16 lines • 106 kB
JavaScript
(function webpackUniversalModuleDefinition(root, factory) {
if (typeof exports === 'object' && typeof module === 'object')
module.exports = factory();
else if (typeof define === 'function' && define.amd) define([], factory);
else if (typeof exports === 'object') exports['loaders'] = factory();
else root['loaders'] = factory();})(globalThis, function () {
"use strict";var __exports__=(()=>{var Ye=Object.create;var zt=Object.defineProperty;var Le=Object.getOwnPropertyDescriptor;var ve=Object.getOwnPropertyNames;var Ce=Object.getPrototypeOf,ze=Object.prototype.hasOwnProperty;var Je=(B,t)=>()=>(t||B((t={exports:{}}).exports,t),t.exports),We=(B,t)=>{for(var h in t)zt(B,h,{get:t[h],enumerable:!0})},Ct=(B,t,h,d)=>{if(t&&typeof t=="object"||typeof t=="function")for(let l of ve(t))!ze.call(B,l)&&l!==h&&zt(B,l,{get:()=>t[l],enumerable:!(d=Le(t,l))||d.enumerable});return B},Jt=(B,t,h)=>(Ct(B,t,"default"),h&&Ct(h,t,"default")),ke=(B,t,h)=>(h=B!=null?Ye(Ce(B)):{},Ct(t||!B||!B.__esModule?zt(h,"default",{value:B,enumerable:!0}):h,B)),Xe=B=>Ct(zt({},"__esModule",{value:!0}),B);var Ee=Je((br,me)=>{me.exports=globalThis.loaders});var Yt={};We(Yt,{BSONLoader:()=>ee,BSONWriter:()=>Fe});Jt(Yt,ke(Ee(),1));var Vt=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function st(B){return B&&B.__esModule&&Object.prototype.hasOwnProperty.call(B,"default")?B.default:B}function ot(B,t){return t={exports:{}},B(t,t.exports),t.exports}var Ke=xe,Ve=qe,He=tr,Nt=[],yt=[],Ge=typeof Uint8Array<"u"?Uint8Array:Array,ne="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Tt=0,we=ne.length;Tt<we;++Tt)Nt[Tt]=ne[Tt],yt[ne.charCodeAt(Tt)]=Tt;var Tt,we;yt["-".charCodeAt(0)]=62;yt["_".charCodeAt(0)]=63;function Te(B){var t=B.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var h=B.indexOf("=");h===-1&&(h=t);var d=h===t?0:4-h%4;return[h,d]}function xe(B){var t=Te(B),h=t[0],d=t[1];return(h+d)*3/4-d}function Ze(B,t,h){return(t+h)*3/4-h}function qe(B){var t,h=Te(B),d=h[0],l=h[1],f=new Ge(Ze(B,d,l)),u=0,m=l>0?d-4:d,o;for(o=0;o<m;o+=4)t=yt[B.charCodeAt(o)]<<18|yt[B.charCodeAt(o+1)]<<12|yt[B.charCodeAt(o+2)]<<6|yt[B.charCodeAt(o+3)],f[u++]=t>>16&255,f[u++]=t>>8&255,f[u++]=t&255;return l===2&&(t=yt[B.charCodeAt(o)]<<2|yt[B.charCodeAt(o+1)]>>4,f[u++]=t&255),l===1&&(t=yt[B.charCodeAt(o)]<<10|yt[B.charCodeAt(o+1)]<<4|yt[B.charCodeAt(o+2)]>>2,f[u++]=t>>8&255,f[u++]=t&255),f}function Qe(B){return Nt[B>>18&63]+Nt[B>>12&63]+Nt[B>>6&63]+Nt[B&63]}function $e(B,t,h){for(var d,l=[],f=t;f<h;f+=3)d=(B[f]<<16&16711680)+(B[f+1]<<8&65280)+(B[f+2]&255),l.push(Qe(d));return l.join("")}function tr(B){for(var t,h=B.length,d=h%3,l=[],f=16383,u=0,m=h-d;u<m;u+=f)l.push($e(B,u,u+f>m?m:u+f));return d===1?(t=B[h-1],l.push(Nt[t>>2]+Nt[t<<4&63]+"==")):d===2&&(t=(B[h-2]<<8)+B[h-1],l.push(Nt[t>>10]+Nt[t>>4&63]+Nt[t<<2&63]+"=")),l.join("")}var ie={byteLength:Ke,toByteArray:Ve,fromByteArray:He},er=function(t,h,d,l,f){var u,m,o=f*8-l-1,c=(1<<o)-1,_=c>>1,g=-7,n=d?f-1:0,w=d?-1:1,U=t[h+n];for(n+=w,u=U&(1<<-g)-1,U>>=-g,g+=o;g>0;u=u*256+t[h+n],n+=w,g-=8);for(m=u&(1<<-g)-1,u>>=-g,g+=l;g>0;m=m*256+t[h+n],n+=w,g-=8);if(u===0)u=1-_;else{if(u===c)return m?NaN:(U?-1:1)*(1/0);m=m+Math.pow(2,l),u=u-_}return(U?-1:1)*m*Math.pow(2,u-l)},rr=function(t,h,d,l,f,u){var m,o,c,_=u*8-f-1,g=(1<<_)-1,n=g>>1,w=f===23?Math.pow(2,-24)-Math.pow(2,-77):0,U=l?0:u-1,p=l?1:-1,F=h<0||h===0&&1/h<0?1:0;for(h=Math.abs(h),isNaN(h)||h===1/0?(o=isNaN(h)?1:0,m=g):(m=Math.floor(Math.log(h)/Math.LN2),h*(c=Math.pow(2,-m))<1&&(m--,c*=2),m+n>=1?h+=w/c:h+=w*Math.pow(2,1-n),h*c>=2&&(m++,c/=2),m+n>=g?(o=0,m=g):m+n>=1?(o=(h*c-1)*Math.pow(2,f),m=m+n):(o=h*Math.pow(2,n-1)*Math.pow(2,f),m=0));f>=8;t[d+U]=o&255,U+=p,o/=256,f-=8);for(m=m<<f|o,_+=f;_>0;t[d+U]=m&255,U+=p,m/=256,_-=8);t[d+U-p]|=F*128},It={read:er,write:rr},C=ot(function(B,t){var h=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=F,t.INSPECT_MAX_BYTES=50;var d=2147483647;t.kMaxLength=d,u.TYPED_ARRAY_SUPPORT=l(),!u.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function l(){try{var a=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(a,e),a.foo()===42}catch{return!1}}Object.defineProperty(u.prototype,"parent",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.buffer}}),Object.defineProperty(u.prototype,"offset",{enumerable:!0,get:function(){if(u.isBuffer(this))return this.byteOffset}});function f(a){if(a>d)throw new RangeError('The value "'+a+'" is invalid for option "size"');var e=new Uint8Array(a);return Object.setPrototypeOf(e,u.prototype),e}function u(a,e,r){if(typeof a=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return _(a)}return m(a,e,r)}u.poolSize=8192;function m(a,e,r){if(typeof a=="string")return g(a,e);if(ArrayBuffer.isView(a))return n(a);if(a==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a));if(q(a,ArrayBuffer)||a&&q(a.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(q(a,SharedArrayBuffer)||a&&q(a.buffer,SharedArrayBuffer)))return w(a,e,r);if(typeof a=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');var y=a.valueOf&&a.valueOf();if(y!=null&&y!==a)return u.from(y,e,r);var S=U(a);if(S)return S;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof a[Symbol.toPrimitive]=="function")return u.from(a[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(a))}u.from=function(a,e,r){return m(a,e,r)},Object.setPrototypeOf(u.prototype,Uint8Array.prototype),Object.setPrototypeOf(u,Uint8Array);function o(a){if(typeof a!="number")throw new TypeError('"size" argument must be of type number');if(a<0)throw new RangeError('The value "'+a+'" is invalid for option "size"')}function c(a,e,r){return o(a),a<=0?f(a):e!==void 0?typeof r=="string"?f(a).fill(e,r):f(a).fill(e):f(a)}u.alloc=function(a,e,r){return c(a,e,r)};function _(a){return o(a),f(a<0?0:p(a)|0)}u.allocUnsafe=function(a){return _(a)},u.allocUnsafeSlow=function(a){return _(a)};function g(a,e){if((typeof e!="string"||e==="")&&(e="utf8"),!u.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=J(a,e)|0,y=f(r),S=y.write(a,e);return S!==r&&(y=y.slice(0,S)),y}function n(a){for(var e=a.length<0?0:p(a.length)|0,r=f(e),y=0;y<e;y+=1)r[y]=a[y]&255;return r}function w(a,e,r){if(e<0||a.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(a.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var y;return e===void 0&&r===void 0?y=new Uint8Array(a):r===void 0?y=new Uint8Array(a,e):y=new Uint8Array(a,e,r),Object.setPrototypeOf(y,u.prototype),y}function U(a){if(u.isBuffer(a)){var e=p(a.length)|0,r=f(e);return r.length===0||a.copy(r,0,0,e),r}if(a.length!==void 0)return typeof a.length!="number"||ut(a.length)?f(0):n(a);if(a.type==="Buffer"&&Array.isArray(a.data))return n(a.data)}function p(a){if(a>=d)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+d.toString(16)+" bytes");return a|0}function F(a){return+a!=a&&(a=0),u.alloc(+a)}u.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==u.prototype},u.compare=function(e,r){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),q(r,Uint8Array)&&(r=u.from(r,r.offset,r.byteLength)),!u.isBuffer(e)||!u.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;for(var y=e.length,S=r.length,P=0,Y=Math.min(y,S);P<Y;++P)if(e[P]!==r[P]){y=e[P],S=r[P];break}return y<S?-1:S<y?1:0},u.isEncoding=function(e){switch(String(e).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}},u.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return u.alloc(0);var y;if(r===void 0)for(r=0,y=0;y<e.length;++y)r+=e[y].length;var S=u.allocUnsafe(r),P=0;for(y=0;y<e.length;++y){var Y=e[y];if(q(Y,Uint8Array)&&(Y=u.from(Y)),!u.isBuffer(Y))throw new TypeError('"list" argument must be an Array of Buffers');Y.copy(S,P),P+=Y.length}return S};function J(a,e){if(u.isBuffer(a))return a.length;if(ArrayBuffer.isView(a)||q(a,ArrayBuffer))return a.byteLength;if(typeof a!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(a));var r=a.length,y=arguments.length>2&&arguments[2]===!0;if(!y&&r===0)return 0;for(var S=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return X(a).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Lt(a).length;default:if(S)return y?-1:X(a).length;e=(""+e).toLowerCase(),S=!0}}u.byteLength=J;function R(a,e,r){var y=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(a||(a="utf8");;)switch(a){case"hex":return N(this,e,r);case"utf8":case"utf-8":return i(this,e,r);case"ascii":return j(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return A(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $(this,e,r);default:if(y)throw new TypeError("Unknown encoding: "+a);a=(a+"").toLowerCase(),y=!0}}u.prototype._isBuffer=!0;function W(a,e,r){var y=a[e];a[e]=a[r],a[r]=y}u.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var r=0;r<e;r+=2)W(this,r,r+1);return this},u.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var r=0;r<e;r+=4)W(this,r,r+3),W(this,r+1,r+2);return this},u.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var r=0;r<e;r+=8)W(this,r,r+7),W(this,r+1,r+6),W(this,r+2,r+5),W(this,r+3,r+4);return this},u.prototype.toString=function(){var e=this.length;return e===0?"":arguments.length===0?i(this,0,e):R.apply(this,arguments)},u.prototype.toLocaleString=u.prototype.toString,u.prototype.equals=function(e){if(!u.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:u.compare(this,e)===0},u.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},h&&(u.prototype[h]=u.prototype.inspect),u.prototype.compare=function(e,r,y,S,P){if(q(e,Uint8Array)&&(e=u.from(e,e.offset,e.byteLength)),!u.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(e));if(r===void 0&&(r=0),y===void 0&&(y=e?e.length:0),S===void 0&&(S=0),P===void 0&&(P=this.length),r<0||y>e.length||S<0||P>this.length)throw new RangeError("out of range index");if(S>=P&&r>=y)return 0;if(S>=P)return-1;if(r>=y)return 1;if(r>>>=0,y>>>=0,S>>>=0,P>>>=0,this===e)return 0;for(var Y=P-S,tt=y-r,it=Math.min(Y,tt),ft=this.slice(S,P),ct=e.slice(r,y),at=0;at<it;++at)if(ft[at]!==ct[at]){Y=ft[at],tt=ct[at];break}return Y<tt?-1:tt<Y?1:0};function Q(a,e,r,y,S){if(a.length===0)return-1;if(typeof r=="string"?(y=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,ut(r)&&(r=S?0:a.length-1),r<0&&(r=a.length+r),r>=a.length){if(S)return-1;r=a.length-1}else if(r<0)if(S)r=0;else return-1;if(typeof e=="string"&&(e=u.from(e,y)),u.isBuffer(e))return e.length===0?-1:H(a,e,r,y,S);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?S?Uint8Array.prototype.indexOf.call(a,e,r):Uint8Array.prototype.lastIndexOf.call(a,e,r):H(a,[e],r,y,S);throw new TypeError("val must be string, number or Buffer")}function H(a,e,r,y,S){var P=1,Y=a.length,tt=e.length;if(y!==void 0&&(y=String(y).toLowerCase(),y==="ucs2"||y==="ucs-2"||y==="utf16le"||y==="utf-16le")){if(a.length<2||e.length<2)return-1;P=2,Y/=2,tt/=2,r/=2}function it(Se,Oe){return P===1?Se[Oe]:Se.readUInt16BE(Oe*P)}var ft;if(S){var ct=-1;for(ft=r;ft<Y;ft++)if(it(a,ft)===it(e,ct===-1?0:ft-ct)){if(ct===-1&&(ct=ft),ft-ct+1===tt)return ct*P}else ct!==-1&&(ft-=ft-ct),ct=-1}else for(r+tt>Y&&(r=Y-tt),ft=r;ft>=0;ft--){for(var at=!0,vt=0;vt<tt;vt++)if(it(a,ft+vt)!==it(e,vt)){at=!1;break}if(at)return ft}return-1}u.prototype.includes=function(e,r,y){return this.indexOf(e,r,y)!==-1},u.prototype.indexOf=function(e,r,y){return Q(this,e,r,y,!0)},u.prototype.lastIndexOf=function(e,r,y){return Q(this,e,r,y,!1)};function M(a,e,r,y){r=Number(r)||0;var S=a.length-r;y?(y=Number(y),y>S&&(y=S)):y=S;var P=e.length;y>P/2&&(y=P/2);for(var Y=0;Y<y;++Y){var tt=parseInt(e.substr(Y*2,2),16);if(ut(tt))return Y;a[r+Y]=tt}return Y}function G(a,e,r,y){return ht(X(e,a.length-r),a,r,y)}function z(a,e,r,y){return ht(lt(e),a,r,y)}function x(a,e,r,y){return z(a,e,r,y)}function s(a,e,r,y){return ht(Lt(e),a,r,y)}function O(a,e,r,y){return ht(re(e,a.length-r),a,r,y)}u.prototype.write=function(e,r,y,S){if(r===void 0)S="utf8",y=this.length,r=0;else if(y===void 0&&typeof r=="string")S=r,y=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(y)?(y=y>>>0,S===void 0&&(S="utf8")):(S=y,y=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");var P=this.length-r;if((y===void 0||y>P)&&(y=P),e.length>0&&(y<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");S||(S="utf8");for(var Y=!1;;)switch(S){case"hex":return M(this,e,r,y);case"utf8":case"utf-8":return G(this,e,r,y);case"ascii":return z(this,e,r,y);case"latin1":case"binary":return x(this,e,r,y);case"base64":return s(this,e,r,y);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return O(this,e,r,y);default:if(Y)throw new TypeError("Unknown encoding: "+S);S=(""+S).toLowerCase(),Y=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function A(a,e,r){return e===0&&r===a.length?ie.fromByteArray(a):ie.fromByteArray(a.slice(e,r))}function i(a,e,r){r=Math.min(a.length,r);for(var y=[],S=e;S<r;){var P=a[S],Y=null,tt=P>239?4:P>223?3:P>191?2:1;if(S+tt<=r){var it,ft,ct,at;switch(tt){case 1:P<128&&(Y=P);break;case 2:it=a[S+1],(it&192)===128&&(at=(P&31)<<6|it&63,at>127&&(Y=at));break;case 3:it=a[S+1],ft=a[S+2],(it&192)===128&&(ft&192)===128&&(at=(P&15)<<12|(it&63)<<6|ft&63,at>2047&&(at<55296||at>57343)&&(Y=at));break;case 4:it=a[S+1],ft=a[S+2],ct=a[S+3],(it&192)===128&&(ft&192)===128&&(ct&192)===128&&(at=(P&15)<<18|(it&63)<<12|(ft&63)<<6|ct&63,at>65535&&at<1114112&&(Y=at))}}Y===null?(Y=65533,tt=1):Y>65535&&(Y-=65536,y.push(Y>>>10&1023|55296),Y=56320|Y&1023),y.push(Y),S+=tt}return I(y)}var E=4096;function I(a){var e=a.length;if(e<=E)return String.fromCharCode.apply(String,a);for(var r="",y=0;y<e;)r+=String.fromCharCode.apply(String,a.slice(y,y+=E));return r}function j(a,e,r){var y="";r=Math.min(a.length,r);for(var S=e;S<r;++S)y+=String.fromCharCode(a[S]&127);return y}function L(a,e,r){var y="";r=Math.min(a.length,r);for(var S=e;S<r;++S)y+=String.fromCharCode(a[S]);return y}function N(a,e,r){var y=a.length;(!e||e<0)&&(e=0),(!r||r<0||r>y)&&(r=y);for(var S="",P=e;P<r;++P)S+=nt[a[P]];return S}function $(a,e,r){for(var y=a.slice(e,r),S="",P=0;P<y.length;P+=2)S+=String.fromCharCode(y[P]+y[P+1]*256);return S}u.prototype.slice=function(e,r){var y=this.length;e=~~e,r=r===void 0?y:~~r,e<0?(e+=y,e<0&&(e=0)):e>y&&(e=y),r<0?(r+=y,r<0&&(r=0)):r>y&&(r=y),r<e&&(r=e);var S=this.subarray(e,r);return Object.setPrototypeOf(S,u.prototype),S};function v(a,e,r){if(a%1!==0||a<0)throw new RangeError("offset is not uint");if(a+e>r)throw new RangeError("Trying to access beyond buffer length")}u.prototype.readUIntLE=function(e,r,y){e=e>>>0,r=r>>>0,y||v(e,r,this.length);for(var S=this[e],P=1,Y=0;++Y<r&&(P*=256);)S+=this[e+Y]*P;return S},u.prototype.readUIntBE=function(e,r,y){e=e>>>0,r=r>>>0,y||v(e,r,this.length);for(var S=this[e+--r],P=1;r>0&&(P*=256);)S+=this[e+--r]*P;return S},u.prototype.readUInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]},u.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||v(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},u.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readIntLE=function(e,r,y){e=e>>>0,r=r>>>0,y||v(e,r,this.length);for(var S=this[e],P=1,Y=0;++Y<r&&(P*=256);)S+=this[e+Y]*P;return P*=128,S>=P&&(S-=Math.pow(2,8*r)),S},u.prototype.readIntBE=function(e,r,y){e=e>>>0,r=r>>>0,y||v(e,r,this.length);for(var S=r,P=1,Y=this[e+--S];S>0&&(P*=256);)Y+=this[e+--S]*P;return P*=128,Y>=P&&(Y-=Math.pow(2,8*r)),Y},u.prototype.readInt8=function(e,r){return e=e>>>0,r||v(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},u.prototype.readInt16LE=function(e,r){e=e>>>0,r||v(e,2,this.length);var y=this[e]|this[e+1]<<8;return y&32768?y|4294901760:y},u.prototype.readInt16BE=function(e,r){e=e>>>0,r||v(e,2,this.length);var y=this[e+1]|this[e]<<8;return y&32768?y|4294901760:y},u.prototype.readInt32LE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,r){return e=e>>>0,r||v(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readFloatLE=function(e,r){return e=e>>>0,r||v(e,4,this.length),It.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,r){return e=e>>>0,r||v(e,4,this.length),It.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||v(e,8,this.length),It.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||v(e,8,this.length),It.read(this,e,!1,52,8)};function T(a,e,r,y,S,P){if(!u.isBuffer(a))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>S||e<P)throw new RangeError('"value" argument is out of bounds');if(r+y>a.length)throw new RangeError("Index out of range")}u.prototype.writeUIntLE=function(e,r,y,S){if(e=+e,r=r>>>0,y=y>>>0,!S){var P=Math.pow(2,8*y)-1;T(this,e,r,y,P,0)}var Y=1,tt=0;for(this[r]=e&255;++tt<y&&(Y*=256);)this[r+tt]=e/Y&255;return r+y},u.prototype.writeUIntBE=function(e,r,y,S){if(e=+e,r=r>>>0,y=y>>>0,!S){var P=Math.pow(2,8*y)-1;T(this,e,r,y,P,0)}var Y=y-1,tt=1;for(this[r+Y]=e&255;--Y>=0&&(tt*=256);)this[r+Y]=e/tt&255;return r+y},u.prototype.writeUInt8=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,1,255,0),this[r]=e&255,r+1},u.prototype.writeUInt16LE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},u.prototype.writeUInt16BE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},u.prototype.writeUInt32LE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},u.prototype.writeUInt32BE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},u.prototype.writeIntLE=function(e,r,y,S){if(e=+e,r=r>>>0,!S){var P=Math.pow(2,8*y-1);T(this,e,r,y,P-1,-P)}var Y=0,tt=1,it=0;for(this[r]=e&255;++Y<y&&(tt*=256);)e<0&&it===0&&this[r+Y-1]!==0&&(it=1),this[r+Y]=(e/tt>>0)-it&255;return r+y},u.prototype.writeIntBE=function(e,r,y,S){if(e=+e,r=r>>>0,!S){var P=Math.pow(2,8*y-1);T(this,e,r,y,P-1,-P)}var Y=y-1,tt=1,it=0;for(this[r+Y]=e&255;--Y>=0&&(tt*=256);)e<0&&it===0&&this[r+Y+1]!==0&&(it=1),this[r+Y]=(e/tt>>0)-it&255;return r+y},u.prototype.writeInt8=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},u.prototype.writeInt16LE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},u.prototype.writeInt16BE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},u.prototype.writeInt32LE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},u.prototype.writeInt32BE=function(e,r,y){return e=+e,r=r>>>0,y||T(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function D(a,e,r,y,S,P){if(r+y>a.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Z(a,e,r,y,S){return e=+e,r=r>>>0,S||D(a,e,r,4),It.write(a,e,r,y,23,4),r+4}u.prototype.writeFloatLE=function(e,r,y){return Z(this,e,r,!0,y)},u.prototype.writeFloatBE=function(e,r,y){return Z(this,e,r,!1,y)};function k(a,e,r,y,S){return e=+e,r=r>>>0,S||D(a,e,r,8),It.write(a,e,r,y,52,8),r+8}u.prototype.writeDoubleLE=function(e,r,y){return k(this,e,r,!0,y)},u.prototype.writeDoubleBE=function(e,r,y){return k(this,e,r,!1,y)},u.prototype.copy=function(e,r,y,S){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(y||(y=0),!S&&S!==0&&(S=this.length),r>=e.length&&(r=e.length),r||(r=0),S>0&&S<y&&(S=y),S===y||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(y<0||y>=this.length)throw new RangeError("Index out of range");if(S<0)throw new RangeError("sourceEnd out of bounds");S>this.length&&(S=this.length),e.length-r<S-y&&(S=e.length-r+y);var P=S-y;if(this===e&&typeof Uint8Array.prototype.copyWithin=="function")this.copyWithin(r,y,S);else if(this===e&&y<r&&r<S)for(var Y=P-1;Y>=0;--Y)e[Y+r]=this[Y+y];else Uint8Array.prototype.set.call(e,this.subarray(y,S),r);return P},u.prototype.fill=function(e,r,y,S){if(typeof e=="string"){if(typeof r=="string"?(S=r,r=0,y=this.length):typeof y=="string"&&(S=y,y=this.length),S!==void 0&&typeof S!="string")throw new TypeError("encoding must be a string");if(typeof S=="string"&&!u.isEncoding(S))throw new TypeError("Unknown encoding: "+S);if(e.length===1){var P=e.charCodeAt(0);(S==="utf8"&&P<128||S==="latin1")&&(e=P)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<y)throw new RangeError("Out of range index");if(y<=r)return this;r=r>>>0,y=y===void 0?this.length:y>>>0,e||(e=0);var Y;if(typeof e=="number")for(Y=r;Y<y;++Y)this[Y]=e;else{var tt=u.isBuffer(e)?e:u.from(e,S),it=tt.length;if(it===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(Y=0;Y<y-r;++Y)this[Y+r]=tt[Y%it]}return this};var et=/[^+/0-9A-Za-z-_]/g;function Bt(a){if(a=a.split("=")[0],a=a.trim().replace(et,""),a.length<2)return"";for(;a.length%4!==0;)a=a+"=";return a}function X(a,e){e=e||1/0;for(var r,y=a.length,S=null,P=[],Y=0;Y<y;++Y){if(r=a.charCodeAt(Y),r>55295&&r<57344){if(!S){if(r>56319){(e-=3)>-1&&P.push(239,191,189);continue}else if(Y+1===y){(e-=3)>-1&&P.push(239,191,189);continue}S=r;continue}if(r<56320){(e-=3)>-1&&P.push(239,191,189),S=r;continue}r=(S-55296<<10|r-56320)+65536}else S&&(e-=3)>-1&&P.push(239,191,189);if(S=null,r<128){if((e-=1)<0)break;P.push(r)}else if(r<2048){if((e-=2)<0)break;P.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;P.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;P.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return P}function lt(a){for(var e=[],r=0;r<a.length;++r)e.push(a.charCodeAt(r)&255);return e}function re(a,e){for(var r,y,S,P=[],Y=0;Y<a.length&&!((e-=2)<0);++Y)r=a.charCodeAt(Y),y=r>>8,S=r%256,P.push(S),P.push(y);return P}function Lt(a){return ie.toByteArray(Bt(a))}function ht(a,e,r,y){for(var S=0;S<y&&!(S+r>=e.length||S>=a.length);++S)e[S+r]=a[S];return S}function q(a,e){return a instanceof e||a!=null&&a.constructor!=null&&a.constructor.name!=null&&a.constructor.name===e.name}function ut(a){return a!==a}var nt=function(){for(var a="0123456789abcdef",e=new Array(256),r=0;r<16;++r)for(var y=r*16,S=0;S<16;++S)e[y+S]=a[r]+a[S];return e}()}),dr=C.Buffer,Ir=C.SlowBuffer,Dr=C.INSPECT_MAX_BYTES,Rr=C.kMaxLength,Et=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.ensureBuffer=void 0;function h(d){if(C.Buffer.isBuffer(d))return d;if(ArrayBuffer.isView(d))return C.Buffer.from(d.buffer);if(d instanceof ArrayBuffer)return C.Buffer.from(d);throw new TypeError("Must use either Buffer or TypedArray")}t.ensureBuffer=h});st(Et);var Ur=Et.ensureBuffer,ce=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.parseUUID=void 0;let h=/^(?:[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 d(l){if(typeof l!="string")throw new TypeError("Invalid type for UUID, expected string but got "+typeof l);if(!h.test(l))throw new TypeError("Invalid format for UUID: "+l);let f,u=new Uint8Array(16);return u[0]=(f=parseInt(l.slice(0,8),16))>>>24,u[1]=f>>>16&255,u[2]=f>>>8&255,u[3]=f&255,u[4]=(f=parseInt(l.slice(9,13),16))>>>8,u[5]=f&255,u[6]=(f=parseInt(l.slice(14,18),16))>>>8,u[7]=f&255,u[8]=(f=parseInt(l.slice(19,23),16))>>>8,u[9]=f&255,u[10]=(f=parseInt(l.slice(24,36),16))/1099511627776&255,u[11]=f/4294967296&255,u[12]=f>>>24&255,u[13]=f>>>16&255,u[14]=f>>>8&255,u[15]=f&255,u}t.parseUUID=d});st(ce);var Mr=ce.parseUUID,_t=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Binary=void 0;class h{constructor(l,f){if(l!=null&&typeof l!="string"&&!ArrayBuffer.isView(l)&&!(l instanceof ArrayBuffer)&&!Array.isArray(l))throw new TypeError("Binary can only be constructed from string, Buffer, TypedArray, or Array<number>");this.sub_type=f??h.BSON_BINARY_SUBTYPE_DEFAULT,l==null?(this.buffer=C.Buffer.alloc(h.BUFFER_SIZE),this.position=0):(typeof l=="string"?this.buffer=C.Buffer.from(l,"binary"):Array.isArray(l)?this.buffer=C.Buffer.from(l):this.buffer=Et.ensureBuffer(l),this.position=this.buffer.byteLength)}put(l){if(typeof l=="string"&&l.length!==1)throw new TypeError("only accepts single character String");if(typeof l!="number"&&l.length!==1)throw new TypeError("only accepts single character Uint8Array or Array");let f;if(typeof l=="string"?f=l.charCodeAt(0):typeof l=="number"?f=l:f=l[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 u=C.Buffer.alloc(h.BUFFER_SIZE+this.buffer.length);this.buffer.copy(u,0,0,this.buffer.length),this.buffer=u,this.buffer[this.position++]=f}}write(l,f){if(f=typeof f=="number"?f:this.position,this.buffer.length<f+l.length){let u=C.Buffer.alloc(this.buffer.length+l.length);this.buffer.copy(u,0,0,this.buffer.length),this.buffer=u}ArrayBuffer.isView(l)?(this.buffer.set(Et.ensureBuffer(l),f),this.position=f+l.byteLength>this.position?f+l.length:this.position):typeof l=="string"&&(this.buffer.write(l,f,l.length,"binary"),this.position=f+l.length>this.position?f+l.length:this.position)}read(l,f){return f=f&&f>0?f:this.position,this.buffer.slice(l,l+f)}value(l){return l=!!l,l&&this.buffer.length===this.position?this.buffer:l?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)}length(){return this.position}toJSON(){return this.buffer.toString("base64")}toString(l){return this.buffer.toString(l)}toExtendedJSON(l){l=l||{};let f=this.buffer.toString("base64"),u=Number(this.sub_type).toString(16);return l.legacy?{$binary:f,$type:u.length===1?"0"+u:u}:{$binary:{base64:f,subType:u.length===1?"0"+u:u}}}static fromExtendedJSON(l,f){f=f||{};let u,m;if("$binary"in l?f.legacy&&typeof l.$binary=="string"&&"$type"in l?(m=l.$type?parseInt(l.$type,16):0,u=C.Buffer.from(l.$binary,"base64")):typeof l.$binary!="string"&&(m=l.$binary.subType?parseInt(l.$binary.subType,16):0,u=C.Buffer.from(l.$binary.base64,"base64")):"$uuid"in l&&(m=4,u=C.Buffer.from(ce.parseUUID(l.$uuid))),!u)throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(l)}`);return new h(u,m)}}t.Binary=h,h.BSON_BINARY_SUBTYPE_DEFAULT=0,h.BUFFER_SIZE=256,h.SUBTYPE_DEFAULT=0,h.SUBTYPE_FUNCTION=1,h.SUBTYPE_BYTE_ARRAY=2,h.SUBTYPE_UUID_OLD=3,h.SUBTYPE_UUID=4,h.SUBTYPE_MD5=5,h.SUBTYPE_USER_DEFINED=128,Object.defineProperty(h.prototype,"_bsontype",{value:"Binary"})});st(_t);var Pr=_t.Binary,mt=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Code=void 0;class h{constructor(l,f){this.code=l,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(l){return new h(l.$code,l.$scope)}}t.Code=h,Object.defineProperty(h.prototype,"_bsontype",{value:"Code"})});st(mt);var jr=mt.Code,nr={},ae;typeof Object.create=="function"?ae=function(t,h){t.super_=h,t.prototype=Object.create(h.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}:ae=function(t,h){t.super_=h;var d=function(){};d.prototype=h.prototype,t.prototype=new d,t.prototype.constructor=t};var ir=ae,or=/%[sdj%]/g;function he(B){if(!Qt(B)){for(var t=[],h=0;h<arguments.length;h++)t.push(At(arguments[h]));return t.join(" ")}for(var h=1,d=arguments,l=d.length,f=String(B).replace(or,function(m){if(m==="%%")return"%";if(h>=l)return m;switch(m){case"%s":return String(d[h++]);case"%d":return Number(d[h++]);case"%j":try{return JSON.stringify(d[h++])}catch{return"[Circular]"}default:return m}}),u=d[h];h<l;u=d[++h])qt(u)||!Pt(u)?f+=" "+u:f+=" "+At(u);return f}function be(B,t){if(gt(global.process))return function(){return be(B,t).apply(this,arguments)};var h=!1;function d(){return h||(console.error(t),h=!0),B.apply(this,arguments)}return d}var Wt={},oe;function sr(B){if(gt(oe)&&(oe=""),B=B.toUpperCase(),!Wt[B])if(new RegExp("\\b"+B+"\\b","i").test(oe)){var t=0;Wt[B]=function(){var h=he.apply(null,arguments);console.error("%s %d: %s",B,t,h)}}else Wt[B]=function(){};return Wt[B]}function At(B,t){var h={seen:[],stylize:ar};return arguments.length>=3&&(h.depth=arguments[2]),arguments.length>=4&&(h.colors=arguments[3]),_e(t)?h.showHidden=t:t&&De(h,t),gt(h.showHidden)&&(h.showHidden=!1),gt(h.depth)&&(h.depth=2),gt(h.colors)&&(h.colors=!1),gt(h.customInspect)&&(h.customInspect=!0),h.colors&&(h.stylize=fr),Ht(h,B,h.depth)}At.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]};At.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function fr(B,t){var h=At.styles[t];return h?"\x1B["+At.colors[h][0]+"m"+B+"\x1B["+At.colors[h][1]+"m":B}function ar(B,t){return B}function ur(B){var t={};return B.forEach(function(h,d){t[h]=!0}),t}function Ht(B,t,h){if(B.customInspect&&t&&Kt(t.inspect)&&t.inspect!==At&&!(t.constructor&&t.constructor.prototype===t)){var d=t.inspect(h,B);return Qt(d)||(d=Ht(B,d,h)),d}var l=lr(B,t);if(l)return l;var f=Object.keys(t),u=ur(f);if(B.showHidden&&(f=Object.getOwnPropertyNames(t)),Xt(t)&&(f.indexOf("message")>=0||f.indexOf("description")>=0))return se(t);if(f.length===0){if(Kt(t)){var m=t.name?": "+t.name:"";return B.stylize("[Function"+m+"]","special")}if(kt(t))return B.stylize(RegExp.prototype.toString.call(t),"regexp");if(le(t))return B.stylize(Date.prototype.toString.call(t),"date");if(Xt(t))return se(t)}var o="",c=!1,_=["{","}"];if(de(t)&&(c=!0,_=["[","]"]),Kt(t)){var g=t.name?": "+t.name:"";o=" [Function"+g+"]"}if(kt(t)&&(o=" "+RegExp.prototype.toString.call(t)),le(t)&&(o=" "+Date.prototype.toUTCString.call(t)),Xt(t)&&(o=" "+se(t)),f.length===0&&(!c||t.length==0))return _[0]+o+_[1];if(h<0)return kt(t)?B.stylize(RegExp.prototype.toString.call(t),"regexp"):B.stylize("[Object]","special");B.seen.push(t);var n;return c?n=cr(B,t,h,u,f):n=f.map(function(w){return ue(B,t,h,u,w,c)}),B.seen.pop(),hr(n,o,_)}function lr(B,t){if(gt(t))return B.stylize("undefined","undefined");if(Qt(t)){var h="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return B.stylize(h,"string")}if(Ie(t))return B.stylize(""+t,"number");if(_e(t))return B.stylize(""+t,"boolean");if(qt(t))return B.stylize("null","null")}function se(B){return"["+Error.prototype.toString.call(B)+"]"}function cr(B,t,h,d,l){for(var f=[],u=0,m=t.length;u<m;++u)Re(t,String(u))?f.push(ue(B,t,h,d,String(u),!0)):f.push("");return l.forEach(function(o){o.match(/^\d+$/)||f.push(ue(B,t,h,d,o,!0))}),f}function ue(B,t,h,d,l,f){var u,m,o;if(o=Object.getOwnPropertyDescriptor(t,l)||{value:t[l]},o.get?o.set?m=B.stylize("[Getter/Setter]","special"):m=B.stylize("[Getter]","special"):o.set&&(m=B.stylize("[Setter]","special")),Re(d,l)||(u="["+l+"]"),m||(B.seen.indexOf(o.value)<0?(qt(h)?m=Ht(B,o.value,null):m=Ht(B,o.value,h-1),m.indexOf(`
`)>-1&&(f?m=m.split(`
`).map(function(c){return" "+c}).join(`
`).substr(2):m=`
`+m.split(`
`).map(function(c){return" "+c}).join(`
`))):m=B.stylize("[Circular]","special")),gt(u)){if(f&&l.match(/^\d+$/))return m;u=JSON.stringify(""+l),u.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=B.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=B.stylize(u,"string"))}return u+": "+m}function hr(B,t,h){var d=B.reduce(function(l,f){return f.indexOf(`
`)>=0,l+f.replace(/\u001b\[\d\d?m/g,"").length+1},0);return d>60?h[0]+(t===""?"":t+`
`)+" "+B.join(`,
`)+" "+h[1]:h[0]+t+" "+B.join(", ")+" "+h[1]}function de(B){return Array.isArray(B)}function _e(B){return typeof B=="boolean"}function qt(B){return B===null}function _r(B){return B==null}function Ie(B){return typeof B=="number"}function Qt(B){return typeof B=="string"}function yr(B){return babelHelpers.typeof(B)==="symbol"}function gt(B){return B===void 0}function kt(B){return Pt(B)&&ye(B)==="[object RegExp]"}function Pt(B){return babelHelpers.typeof(B)==="object"&&B!==null}function le(B){return Pt(B)&&ye(B)==="[object Date]"}function Xt(B){return Pt(B)&&(ye(B)==="[object Error]"||B instanceof Error)}function Kt(B){return typeof B=="function"}function Br(B){return B===null||typeof B=="boolean"||typeof B=="number"||typeof B=="string"||babelHelpers.typeof(B)==="symbol"||typeof B>"u"}function pr(B){return Buffer.isBuffer(B)}function ye(B){return Object.prototype.toString.call(B)}function fe(B){return B<10?"0"+B.toString(10):B.toString(10)}var Nr=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gr(){var B=new Date,t=[fe(B.getHours()),fe(B.getMinutes()),fe(B.getSeconds())].join(":");return[B.getDate(),Nr[B.getMonth()],t].join(" ")}function Ar(){console.log("%s - %s",gr(),he.apply(null,arguments))}function De(B,t){if(!t||!Pt(t))return B;for(var h=Object.keys(t),d=h.length;d--;)B[h[d]]=t[h[d]];return B}function Re(B,t){return Object.prototype.hasOwnProperty.call(B,t)}var Sr={inherits:ir,_extend:De,log:Ar,isBuffer:pr,isPrimitive:Br,isFunction:Kt,isError:Xt,isDate:le,isObject:Pt,isRegExp:kt,isUndefined:gt,isSymbol:yr,isString:Qt,isNumber:Ie,isNullOrUndefined:_r,isNull:qt,isBoolean:_e,isArray:de,inspect:At,deprecate:be,format:he,debuglog:sr},rt=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.deprecate=t.isObjectLike=t.isDate=t.isBuffer=t.haveBuffer=t.isBigUInt64Array=t.isBigInt64Array=t.isUint8Array=t.randomBytes=t.normalizedFunctionString=void 0;function h(n){return n.toString().replace("function(","function (")}t.normalizedFunctionString=h;function d(n){let w=C.Buffer.alloc(n);for(let U=0;U<n;++U)w[U]=Math.floor(Math.random()*256);return w}if(t.randomBytes=d,typeof window<"u"&&window.crypto&&window.crypto.getRandomValues)t.randomBytes=n=>window.crypto.getRandomValues(C.Buffer.alloc(n));else{try{t.randomBytes=nr.randomBytes}catch{}t.randomBytes==null&&(t.randomBytes=d)}function l(n){return Object.prototype.toString.call(n)==="[object Uint8Array]"}t.isUint8Array=l;function f(n){return Object.prototype.toString.call(n)==="[object BigInt64Array]"}t.isBigInt64Array=f;function u(n){return Object.prototype.toString.call(n)==="[object BigUint64Array]"}t.isBigUInt64Array=u;function m(){return typeof Vt<"u"&&typeof Vt.Buffer<"u"}t.haveBuffer=m;function o(n){return m()&&C.Buffer.isBuffer(n)}t.isBuffer=o;function c(n){return _(n)&&Object.prototype.toString.call(n)==="[object Date]"}t.isDate=c;function _(n){return typeof n=="object"&&n!==null}t.isObjectLike=_;function g(n,w){if(typeof window>"u"||typeof self>"u")return Sr.deprecate(n,w);let U=!1;function p(...F){return U||(console.warn(w),U=!0),n.apply(this,...F)}return p}t.deprecate=g});st(rt);var Fr=rt.deprecate,Yr=rt.isObjectLike,Lr=rt.isDate,vr=rt.isBuffer,Cr=rt.haveBuffer,zr=rt.isBigUInt64Array,Jr=rt.isBigInt64Array,Wr=rt.isUint8Array,kr=rt.randomBytes,Xr=rt.normalizedFunctionString,pt=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.DBRef=t.isDBRefLike=void 0;function h(l){return rt.isObjectLike(l)&&l.$id!=null&&l.$ref!=null}t.isDBRefLike=h;class d{constructor(f,u,m,o){let c=f.split(".");c.length===2&&(m=c.shift(),f=c.shift()),this.collection=f,this.oid=u,this.db=m,this.fields=o||{}}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 u={$ref:this.collection,$id:this.oid};return f.legacy||(this.db&&(u.$db=this.db),u=Object.assign(u,this.fields)),u}static fromExtendedJSON(f){let u=Object.assign({},f);return delete u.$ref,delete u.$id,delete u.$db,new d(f.$ref,f.$id,f.$db,u)}}t.DBRef=d,Object.defineProperty(d.prototype,"_bsontype",{value:"DBRef"})});st(pt);var Kr=pt.DBRef,Vr=pt.isDBRefLike,K=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Long=void 0;let h;try{h=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 d=1<<16,l=1<<24,f=d*d,u=f*f,m=u/2,o={},c={};class _{constructor(n=0,w=0,U){this.comp=_.prototype.compare,this.div=_.prototype.divide,this.eq=_.prototype.equals,this.gt=_.prototype.greaterThan,this.gte=_.prototype.greaterThanOrEqual,this.ge=_.prototype.greaterThanOrEqual,this.lt=_.prototype.lessThan,this.lte=_.prototype.lessThanOrEqual,this.mod=_.prototype.modulo,this.rem=_.prototype.modulo,this.mul=_.prototype.multiply,this.neg=_.prototype.negate,this.neq=_.prototype.notEquals,this.ne=_.prototype.notEquals,this.shl=_.prototype.shiftLeft,this.shr=_.prototype.shiftRight,this.shr_u=_.prototype.shiftRightUnsigned,this.shru=_.prototype.shiftRightUnsigned,this.sub=_.prototype.subtract,this.eqz=_.prototype.isZero,this.le=_.prototype.lessThanOrEqual,this.low=n|0,this.high=w|0,this.unsigned=!!U,Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}static fromBits(n,w,U){return new _(n,w,U)}static fromInt(n,w){let U,p,F;return w?(n>>>=0,(F=0<=n&&n<256)&&(p=c[n],p)?p:(U=_.fromBits(n,(n|0)<0?-1:0,!0),F&&(c[n]=U),U)):(n|=0,(F=-128<=n&&n<128)&&(p=o[n],p)?p:(U=_.fromBits(n,n<0?-1:0,!1),F&&(o[n]=U),U))}static fromNumber(n,w){if(isNaN(n))return w?_.UZERO:_.ZERO;if(w){if(n<0)return _.UZERO;if(n>=u)return _.MAX_UNSIGNED_VALUE}else{if(n<=-m)return _.MIN_VALUE;if(n+1>=m)return _.MAX_VALUE}return n<0?_.fromNumber(-n,w).neg():_.fromBits(n%f|0,n/f|0,w)}static fromBigInt(n,w){return _.fromString(n.toString(),w)}static fromString(n,w,U){if(n.length===0)throw Error("empty string");if(n==="NaN"||n==="Infinity"||n==="+Infinity"||n==="-Infinity")return _.ZERO;if(typeof w=="number"?(U=w,w=!1):w=!!w,U=U||10,U<2||36<U)throw RangeError("radix");let p;if((p=n.indexOf("-"))>0)throw Error("interior hyphen");if(p===0)return _.fromString(n.substring(1),w,U).neg();let F=_.fromNumber(Math.pow(U,8)),J=_.ZERO;for(let R=0;R<n.length;R+=8){let W=Math.min(8,n.length-R),Q=parseInt(n.substring(R,R+W),U);if(W<8){let H=_.fromNumber(Math.pow(U,W));J=J.mul(H).add(_.fromNumber(Q))}else J=J.mul(F),J=J.add(_.fromNumber(Q))}return J.unsigned=w,J}static fromBytes(n,w,U){return U?_.fromBytesLE(n,w):_.fromBytesBE(n,w)}static fromBytesLE(n,w){return new _(n[0]|n[1]<<8|n[2]<<16|n[3]<<24,n[4]|n[5]<<8|n[6]<<16|n[7]<<24,w)}static fromBytesBE(n,w){return new _(n[4]<<24|n[5]<<16|n[6]<<8|n[7],n[0]<<24|n[1]<<16|n[2]<<8|n[3],w)}static isLong(n){return rt.isObjectLike(n)&&n.__isLong__===!0}static fromValue(n,w){return typeof n=="number"?_.fromNumber(n,w):typeof n=="string"?_.fromString(n,w):_.fromBits(n.low,n.high,typeof w=="boolean"?w:n.unsigned)}add(n){_.isLong(n)||(n=_.fromValue(n));let w=this.high>>>16,U=this.high&65535,p=this.low>>>16,F=this.low&65535,J=n.high>>>16,R=n.high&65535,W=n.low>>>16,Q=n.low&65535,H=0,M=0,G=0,z=0;return z+=F+Q,G+=z>>>16,z&=65535,G+=p+W,M+=G>>>16,G&=65535,M+=U+R,H+=M>>>16,M&=65535,H+=w+J,H&=65535,_.fromBits(G<<16|z,H<<16|M,this.unsigned)}and(n){return _.isLong(n)||(n=_.fromValue(n)),_.fromBits(this.low&n.low,this.high&n.high,this.unsigned)}compare(n){if(_.isLong(n)||(n=_.fromValue(n)),this.eq(n))return 0;let w=this.isNegative(),U=n.isNegative();return w&&!U?-1:!w&&U?1:this.unsigned?n.high>>>0>this.high>>>0||n.high===this.high&&n.low>>>0>this.low>>>0?-1:1:this.sub(n).isNegative()?-1:1}divide(n){if(_.isLong(n)||(n=_.fromValue(n)),n.isZero())throw Error("division by zero");if(h){if(!this.unsigned&&this.high===-2147483648&&n.low===-1&&n.high===-1)return this;let F=(this.unsigned?h.div_u:h.div_s)(this.low,this.high,n.low,n.high);return _.fromBits(F,h.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?_.UZERO:_.ZERO;let w,U,p;if(this.unsigned){if(n.unsigned||(n=n.toUnsigned()),n.gt(this))return _.UZERO;if(n.gt(this.shru(1)))return _.UONE;p=_.UZERO}else{if(this.eq(_.MIN_VALUE))return n.eq(_.ONE)||n.eq(_.NEG_ONE)?_.MIN_VALUE:n.eq(_.MIN_VALUE)?_.ONE:(w=this.shr(1).div(n).shl(1),w.eq(_.ZERO)?n.isNegative()?_.ONE:_.NEG_ONE:(U=this.sub(n.mul(w)),p=w.add(U.div(n)),p));if(n.eq(_.MIN_VALUE))return this.unsigned?_.UZERO:_.ZERO;if(this.isNegative())return n.isNegative()?this.neg().div(n.neg()):this.neg().div(n).neg();if(n.isNegative())return this.div(n.neg()).neg();p=_.ZERO}for(U=this;U.gte(n);){w=Math.max(1,Math.floor(U.toNumber()/n.toNumber()));let F=Math.ceil(Math.log(w)/Math.LN2),J=F<=48?1:Math.pow(2,F-48),R=_.fromNumber(w),W=R.mul(n);for(;W.isNegative()||W.gt(U);)w-=J,R=_.fromNumber(w,this.unsigned),W=R.mul(n);R.isZero()&&(R=_.ONE),p=p.add(R),U=U.sub(W)}return p}equals(n){return _.isLong(n)||(n=_.fromValue(n)),this.unsigned!==n.unsigned&&this.high>>>31===1&&n.high>>>31===1?!1:this.high===n.high&&this.low===n.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(_.MIN_VALUE)?64:this.neg().getNumBitsAbs();let n=this.high!==0?this.high:this.low,w;for(w=31;w>0&&!(n&1<<w);w--);return this.high!==0?w+33:w+1}greaterThan(n){return this.comp(n)>0}greaterThanOrEqual(n){return this.comp(n)>=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(n){return this.comp(n)<0}lessThanOrEqual(n){return this.comp(n)<=0}modulo(n){if(_.isLong(n)||(n=_.fromValue(n)),h){let w=(this.unsigned?h.rem_u:h.rem_s)(this.low,this.high,n.low,n.high);return _.fromBits(w,h.get_high(),this.unsigned)}return this.sub(this.div(n).mul(n))}multiply(n){if(this.isZero())return _.ZERO;if(_.isLong(n)||(n=_.fromValue(n)),h){let x=h.mul(this.low,this.high,n.low,n.high);return _.fromBits(x,h.get_high(),this.unsigned)}if(n.isZero())return _.ZERO;if(this.eq(_.MIN_VALUE))return n.isOdd()?_.MIN_VALUE:_.ZERO;if(n.eq(_.MIN_VALUE))return this.isOdd()?_.MIN_VALUE:_.ZERO;if(this.isNegative())return n.isNegative()?this.neg().mul(n.neg()):this.neg().mul(n).neg();if(n.isNegative())return this.mul(n.neg()).neg();if(this.lt(_.TWO_PWR_24)&&n.lt(_.TWO_PWR_24))return _.fromNumber(this.toNumber()*n.toNumber(),this.unsigned);let w=this.high>>>16,U=this.high&65535,p=this.low>>>16,F=this.low&65535,J=n.high>>>16,R=n.high&65535,W=n.low>>>16,Q=n.low&65535,H=0,M=0,G=0,z=0;return z+=F*Q,G+=z>>>16,z&=65535,G+=p*Q,M+=G>>>16,G&=65535,G+=F*W,M+=G>>>16,G&=65535,M+=U*Q,H+=M>>>16,M&=65535,M+=p*W,H+=M>>>16,M&=65535,M+=F*R,H+=M>>>16,M&=65535,H+=w*Q+U*W+p*R+F*J,H&=65535,_.fromBits(G<<16|z,H<<16|M,this.unsigned)}negate(){return!this.unsigned&&this.eq(_.MIN_VALUE)?_.MIN_VALUE:this.not().add(_.ONE)}not(){return _.fromBits(~this.low,~this.high,this.unsigned)}notEquals(n){return!this.equals(n)}or(n){return _.isLong(n)||(n=_.fromValue(n)),_.fromBits(this.low|n.low,this.high|n.high,this.unsigned)}shiftLeft(n){return _.isLong(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?_.fromBits(this.low<<n,this.high<<n|this.low>>>32-n,this.unsigned):_.fromBits(0,this.low<<n-32,this.unsigned)}shiftRight(n){return _.isLong(n)&&(n=n.toInt()),(n&=63)===0?this:n<32?_.fromBits(this.low>>>n|this.high<<32-n,this.high>>n,this.unsigned):_.fromBits(this.high>>n-32,this.high>=0?0:-1,this.unsigned)}shiftRightUnsigned(n){if(_.isLong(n)&&(n=n.toInt()),n&=63,n===0)return this;{let w=this.high;if(n<32){let U=this.low;return _.fromBits(U>>>n|w<<32-n,w>>>n,this.unsigned)}else return n===32?_.fromBits(w,0,this.unsigned):_.fromBits(w>>>n-32,0,this.unsigned)}}subtract(n){return _.isLong(n)||(n=_.fromValue(n)),this.add(n.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(n){return n?this.toBytesLE():this.toBytesBE()}toBytesLE(){let n=this.high,w=this.low;return[w&255,w>>>8&255,w>>>16&255,w>>>24,n&255,n>>>8&255,n>>>16&255,n>>>24]}toBytesBE(){let n=this.high,w=this.low;return[n>>>24,n>>>16&255,n>>>8&255,n&255,w>>>24,w>>>16&255,w>>>8&255,w&255]}toSigned(){return this.unsigned?_.fromBits(this.low,this.high,!1):this}toString(n){if(n=n||10,n<2||36<n)throw RangeError("radix");if(this.isZero())return"0";if(this.isNegative())if(this.eq(_.MIN_VALUE)){let F=_.fromNumber(n),J=this.div(F),R=J.mul(F).sub(this);return J.toString(n)+R.toInt().toString(n)}else return"-"+this.neg().toString(n);let w=_.fromNumber(Math.pow(n,6),this.unsigned),U=this,p="";for(;;){let F=U.div(w),R=(U.sub(F.mul(w)).toInt()>>>0).toString(n);if(U=F,U.isZero())return R+p;for(;R.length<6;)R="0"+R;p=""+R+p}}toUnsigned(){return this.unsigned?this:_.fromBits(this.low,this.high,!0)}xor(n){return _.isLong(n)||(n=_.fromValue(n)),_.fromBits(this.low^n.low,this.high^n.high,this.unsigned)}toExtendedJSON(n){return n&&n.relaxed?this.toNumber():{$numberLong:this.toString()}}static fromExtendedJSON(n,w){let U=_.fromString(n.$numberLong);return w&&w.relaxed?U.toNumber():U}}t.Long=_,_.TWO_PWR_24=_.fromInt(l),_.MAX_UNSIGNED_VALUE=_.fromBits(-1,-1,!0),_.ZERO=_.fromInt(0),_.UZERO=_.fromInt(0,!0),_.ONE=_.fromInt(1),_.UONE=_.fromInt(1,!0),_.NEG_ONE=_.fromInt(-1),_.MAX_VALUE=_.fromBits(-1,2147483647,!1),_.MIN_VALUE=_.fromBits(0,-2147483648,!1),Object.defineProperty(_.prototype,"__isLong__",{value:!0}),Object.defineProperty(_.prototype,"_bsontype",{value:"Long"})});st(K);var Hr=K.Long,Dt=ot(function(B,t){Object.defineProperty(t,"__esModule",{value:!0}),t.Decimal128=void 0;let h=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,d=/^(\+|-)?(Infinity|inf)$/i,l=/^(\+|-)?NaN$/i,f=6111,u=-6176,m=6176,o=34,c=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),_=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),g=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),n=/^([-+])?(\d+)?$/,w=31,U=16383,p=30,F=31;function J(G){return!isNaN(parseInt(G,10))}function R(G){let z=K.Long.fromNumber(1e9),x=K.Long.fromNumber(0);if(!G.parts[0]&&!G.parts[1]&&!G.parts[2]&&!G.parts[3])return{quotient:G,rem:x};for(let s=0;s<=3;s++)x=x.shiftLeft(32),x=x.add(new K.Long(G.parts[s],0)),G.parts[s]=x.div(z).low,x=x.modulo(z);return{quotient:G,rem:x}}function W(G,z){if(!G&&!z)return{high:K.Long.fromNumber(0),low:K.Long.fromNumber(0)};let x=G.shiftRightUnsigned(32),s=new K.Long(G.getLowBits(),0),O=z.shiftRightUnsigned(32),A=new K.Long(z.getLowBits(),0),i=x.multiply(O),E=x.multiply(A),I=s.multiply(O),j=s.multiply(A);return i=i.add(E.shiftRightUnsigned(32)),E=new K.Long(E.getLowBits(),0).add(I).add(j.shiftRightUnsigned(32)),i=i.add(E.shiftRightUnsigned(32)),j=E.shiftLeft(32).add(new K.Long(j.getLowBits(),0)),{high:i,low:j}}function Q(G,z){let x=G.high>>>0,s=z.high>>>0;if(x<s)return!0;if(x===s){let O=G.low>>>0,A=z.low>>>0;if(O<A)return!0}return!1}function H(G,z){throw new TypeError(`"${G}" is not a valid Decimal128 string - ${z}`)}class M{constructor(z){this.bytes=z}static fromString(z){let x=!1,s=!1,O=!1,A=0,i=0,E=0,I=0,j=0,L=[0],N=0