/*! For license information please see Serialise.js.LICENSE.txt */ (()=>{var e={34529:(e,t,r)=>{"use strict";function n(e,t){if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i=0;c--)if(f[c]!==l[c])return!1;for(c=f.length-1;c>=0;c--)if(!v(e[u=f[c]],t[u],r,n))return!1;return!0}(e,t,r,s))}return r?e===t:e==t}function b(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function _(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function w(e,t,r,n){var i;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof r&&(n=r,r=null),i=function(e){var t;try{e()}catch(e){t=e}return t}(t),n=(r&&r.name?" ("+r.name+").":".")+(n?" "+n:"."),e&&!i&&g(i,r,"Missing expected exception"+n);var s="string"==typeof n,a=!e&&i&&!r;if((!e&&o.isError(i)&&s&&_(i,r)||a)&&g(i,r,"Got unwanted exception"+n),e&&i&&r&&!_(i,r)||!e&&i)throw i}l.AssertionError=function(e){this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=function(e){return d(y(e.actual),128)+" "+e.operator+" "+d(y(e.expected),128)}(this),this.generatedMessage=!0);var t=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,t);else{var r=new Error;if(r.stack){var n=r.stack,i=p(t),o=n.indexOf("\n"+i);if(o>=0){var s=n.indexOf("\n",o+1);n=n.substring(s+1)}this.stack=n}}},o.inherits(l.AssertionError,Error),l.fail=g,l.ok=m,l.equal=function(e,t,r){e!=t&&g(e,t,r,"==",l.equal)},l.notEqual=function(e,t,r){e==t&&g(e,t,r,"!=",l.notEqual)},l.deepEqual=function(e,t,r){v(e,t,!1)||g(e,t,r,"deepEqual",l.deepEqual)},l.deepStrictEqual=function(e,t,r){v(e,t,!0)||g(e,t,r,"deepStrictEqual",l.deepStrictEqual)},l.notDeepEqual=function(e,t,r){v(e,t,!1)&&g(e,t,r,"notDeepEqual",l.notDeepEqual)},l.notDeepStrictEqual=function e(t,r,n){v(t,r,!0)&&g(t,r,n,"notDeepStrictEqual",e)},l.strictEqual=function(e,t,r){e!==t&&g(e,t,r,"===",l.strictEqual)},l.notStrictEqual=function(e,t,r){e===t&&g(e,t,r,"!==",l.notStrictEqual)},l.throws=function(e,t,r){w(!0,e,t,r)},l.doesNotThrow=function(e,t,r){w(!1,e,t,r)},l.ifError=function(e){if(e)throw e};var E=Object.keys||function(e){var t=[];for(var r in e)s.call(e,r)&&t.push(r);return t}},34138:(e,t,r)=>{"use strict";var n=r(91185),i=r(75942),o=r(78412),s=r(22561);e.exports={Service:i.Service,assembleProtocol:o.assembleProtocol,discoverProtocol:i.discoverProtocol,parse:function(e,t){var r=o.read(e);return r.protocol?i.Service.forProtocol(r,t):n.Type.forSchema(r,t)},readProtocol:o.readProtocol,readSchema:o.readSchema},s.copyOwnProperties(n,e.exports)},91185:(e,t,r)=>{"use strict";var n=r(77725);e.exports={Type:n.Type,parse:function(e,t){var r;if("string"==typeof e)try{r=JSON.parse(e)}catch(t){r=e}else r=e;return n.Type.forSchema(r,t)},types:n.builtins,combine:n.Type.forTypes,infer:n.Type.forValue}},23809:(e,t,r)=>{"use strict";var n=r(34138),i=r(21946),o=r(22561),s=r(88310),a=r(40537);function u(e,t){s.Readable.call(this),t=t||{},this._batchSize=t.batchSize||65536,this._blob=e,this._pos=0}function c(){s.Transform.call(this,{readableObjectMode:!0}),this._bufs=[]}a.inherits(u,s.Readable),u.prototype._read=function(){var e=this._pos;if(e>=this._blob.size)this.push(null);else{this._pos+=this._batchSize;var t=this._blob.slice(e,this._pos,this._blob.type),r=new FileReader,n=this;r.addEventListener("loadend",(function e(t){r.removeEventListener("loadend",e,!1),t.error?n.emit("error",t.error):n.push(o.bufferFrom(r.result))}),!1),r.readAsArrayBuffer(t)}},a.inherits(c,s.Transform),c.prototype._transform=function(e,t,r){this._bufs.push(e),r()},c.prototype._flush=function(e){this.push(new Blob(this._bufs,{type:"application/octet-binary"})),e()},e.exports={createBlobDecoder:function(e,t){return new u(e).pipe(new i.streams.BlockDecoder(t))},createBlobEncoder:function(e,t){var r=new i.streams.BlockEncoder(e,t),n=new c;return r.pipe(n),new s.Duplex({objectMode:!0,read:function(){var e=n.read();e?r(e):n.once("readable",r);var t=this;function r(e){t.push(e||n.read()),t.push(null)}},write:function(e,t,n){return r.write(e,t,n)}}).on("finish",(function(){r.end()}))},streams:i.streams},o.copyOwnProperties(n,e.exports)},78505:(e,t,r)=>{"use strict";var n=r(48287).Buffer;function i(){this.data=void 0}function o(e,t){var r=e[0],n=e[1],i=e[2],o=e[3];r=a(r,n,i,o,t[0],7,-680876936),o=a(o,r,n,i,t[1],12,-389564586),i=a(i,o,r,n,t[2],17,606105819),n=a(n,i,o,r,t[3],22,-1044525330),r=a(r,n,i,o,t[4],7,-176418897),o=a(o,r,n,i,t[5],12,1200080426),i=a(i,o,r,n,t[6],17,-1473231341),n=a(n,i,o,r,t[7],22,-45705983),r=a(r,n,i,o,t[8],7,1770035416),o=a(o,r,n,i,t[9],12,-1958414417),i=a(i,o,r,n,t[10],17,-42063),n=a(n,i,o,r,t[11],22,-1990404162),r=a(r,n,i,o,t[12],7,1804603682),o=a(o,r,n,i,t[13],12,-40341101),i=a(i,o,r,n,t[14],17,-1502002290),r=u(r,n=a(n,i,o,r,t[15],22,1236535329),i,o,t[1],5,-165796510),o=u(o,r,n,i,t[6],9,-1069501632),i=u(i,o,r,n,t[11],14,643717713),n=u(n,i,o,r,t[0],20,-373897302),r=u(r,n,i,o,t[5],5,-701558691),o=u(o,r,n,i,t[10],9,38016083),i=u(i,o,r,n,t[15],14,-660478335),n=u(n,i,o,r,t[4],20,-405537848),r=u(r,n,i,o,t[9],5,568446438),o=u(o,r,n,i,t[14],9,-1019803690),i=u(i,o,r,n,t[3],14,-187363961),n=u(n,i,o,r,t[8],20,1163531501),r=u(r,n,i,o,t[13],5,-1444681467),o=u(o,r,n,i,t[2],9,-51403784),i=u(i,o,r,n,t[7],14,1735328473),r=c(r,n=u(n,i,o,r,t[12],20,-1926607734),i,o,t[5],4,-378558),o=c(o,r,n,i,t[8],11,-2022574463),i=c(i,o,r,n,t[11],16,1839030562),n=c(n,i,o,r,t[14],23,-35309556),r=c(r,n,i,o,t[1],4,-1530992060),o=c(o,r,n,i,t[4],11,1272893353),i=c(i,o,r,n,t[7],16,-155497632),n=c(n,i,o,r,t[10],23,-1094730640),r=c(r,n,i,o,t[13],4,681279174),o=c(o,r,n,i,t[0],11,-358537222),i=c(i,o,r,n,t[3],16,-722521979),n=c(n,i,o,r,t[6],23,76029189),r=c(r,n,i,o,t[9],4,-640364487),o=c(o,r,n,i,t[12],11,-421815835),i=c(i,o,r,n,t[15],16,530742520),r=f(r,n=c(n,i,o,r,t[2],23,-995338651),i,o,t[0],6,-198630844),o=f(o,r,n,i,t[7],10,1126891415),i=f(i,o,r,n,t[14],15,-1416354905),n=f(n,i,o,r,t[5],21,-57434055),r=f(r,n,i,o,t[12],6,1700485571),o=f(o,r,n,i,t[3],10,-1894986606),i=f(i,o,r,n,t[10],15,-1051523),n=f(n,i,o,r,t[1],21,-2054922799),r=f(r,n,i,o,t[8],6,1873313359),o=f(o,r,n,i,t[15],10,-30611744),i=f(i,o,r,n,t[6],15,-1560198380),n=f(n,i,o,r,t[13],21,1309151649),r=f(r,n,i,o,t[4],6,-145523070),o=f(o,r,n,i,t[11],10,-1120210379),i=f(i,o,r,n,t[2],15,718787259),n=f(n,i,o,r,t[9],21,-343485551),e[0]=h(r,e[0]),e[1]=h(n,e[1]),e[2]=h(i,e[2]),e[3]=h(o,e[3])}function s(e,t,r,n,i,o){return t=h(h(t,e),h(n,o)),h(t<>>32-i,r)}function a(e,t,r,n,i,o,a){return s(t&r|~t&n,e,t,i,o,a)}function u(e,t,r,n,i,o,a){return s(t&n|r&~n,e,t,i,o,a)}function c(e,t,r,n,i,o,a){return s(t^r^n,e,t,i,o,a)}function f(e,t,r,n,i,o,a){return s(r^(t|~n),e,t,i,o,a)}function l(e){var t,r=[];for(t=0;t<64;t+=4)r[t>>2]=e.charCodeAt(t)+(e.charCodeAt(t+1)<<8)+(e.charCodeAt(t+2)<<16)+(e.charCodeAt(t+3)<<24);return r}function h(e,t){return e+t&4294967295}i.prototype.end=function(e){this.data=e},i.prototype.read=function(){return function(e){var t,r=function(e){var t,r=e.length,n=[1732584193,-271733879,-1732584194,271733878];for(t=64;t<=e.length;t+=64)o(n,l(e.substring(t-64,t)));e=e.substring(t-64);var i=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(t=0;t>2]|=e.charCodeAt(t)<<(t%4<<3);if(i[t>>2]|=128<<(t%4<<3),t>55)for(o(n,i),t=0;t<16;t++)i[t]=0;return i[14]=8*r,o(n,i),n}(e),i=n.alloc?n.alloc(16):new n(16);for(t=0;t<4;t++)i.writeIntLE(r[t],4*t,4);return i}(this.data)},e.exports={createHash:function(e){if("md5"!==e)throw new Error("only md5 is supported in the browser");return new i}}},36161:e=>{"use strict";function t(){return new Error("unsupported in the browser")}e.exports={createImportHook:function(){return function(e,r,n){n(t())}},createSyncImportHook:function(){return function(){throw t()}},existsSync:function(){return!1},readFileSync:function(){throw t()}}},21946:(e,t,r)=>{"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(88310),u=r(40537),c=r(78559),f=s.Buffer,l={namespace:"org.apache.avro.file"},h=i.Type.forSchema("long",l),p=i.Type.forSchema({type:"map",values:"bytes"},l),d=i.Type.forSchema({name:"Header",type:"record",fields:[{name:"magic",type:{type:"fixed",name:"Magic",size:4}},{name:"meta",type:p},{name:"sync",type:{type:"fixed",name:"Sync",size:16}}]},l),y=i.Type.forSchema({name:"Block",type:"record",fields:[{name:"count",type:"long"},{name:"data",type:"bytes"},{name:"sync",type:"Sync"}]},l),g=o.bufferFrom("Obj"),m=u.format,v=o.Tap;function b(e,t){var r=!!(t=t||{}).noDecode;a.Duplex.call(this,{readableObjectMode:!r,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._tap=new v(o.newBuffer(0)),this._writeCb=null,this._needPush=!1,this._readValue=S(r,this._type),this._finished=!1,this.on("finish",(function(){this._finished=!0,this._read()}))}function _(e){var t=!!(e=e||{}).noDecode;a.Duplex.call(this,{allowHalfOpen:!0,readableObjectMode:!t}),this._rType=void 0!==e.readerSchema?i.Type.forSchema(e.readerSchema):void 0,this._wType=null,this._codecs=e.codecs,this._codec=void 0,this._parseHook=e.parseHook,this._tap=new v(o.newBuffer(0)),this._blockTap=new v(o.newBuffer(0)),this._syncMarker=null,this._readValue=null,this._noDecode=t,this._queue=new o.OrderedQueue,this._decompress=null,this._index=0,this._remaining=void 0,this._needPush=!1,this._finished=!1,this.on("finish",(function(){this._finished=!0,this._needPush&&this._read()}))}function w(e,t){t=t||{},a.Transform.call(this,{writableObjectMode:!0,allowHalfOpen:!1}),this._type=i.Type.forSchema(e),this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){this.emit("typeError",e,t,this._type)}},this._tap=new v(o.newBuffer(t.batchSize||65536)),this.on("typeError",(function(e){this.emit("error",e)}))}function E(e,t){var r;if(t=t||{},a.Duplex.call(this,{allowHalfOpen:!0,writableObjectMode:!0}),i.Type.isType(e)?(r=e,e=void 0):r=i.Type.forSchema(e),this._schema=e,this._type=r,this._writeValue=function(e,t){try{this._type._write(e,t)}catch(e){return this.emit("typeError",e,t,this._type),!1}return!0},this._blockSize=t.blockSize||65536,this._tap=new v(o.newBuffer(this._blockSize)),this._codecs=t.codecs,this._codec=t.codec||"null",this._blockCount=0,this._syncMarker=t.syncMarker||(new o.Lcg).nextBuffer(16),this._queue=new o.OrderedQueue,this._pending=0,this._finished=!1,this._needHeader=!1,this._needPush=!1,this._metadata=t.metadata||{},!p.isValid(this._metadata))throw new Error("invalid metadata");var n=this._codec;if(this._compress=(this._codecs||E.getDefaultCodecs())[n],!this._compress)throw new Error(m("unsupported codec: %s",n));switch(void 0!==t.omitHeader&&(t.writeHeader=t.omitHeader?"never":"auto"),t.writeHeader){case!1:case"never":break;case void 0:case"auto":this._needHeader=!0;break;default:this._writeHeader()}this.on("finish",(function(){this._finished=!0,this._blockCount?this._flushChunk():this._finished&&this._needPush&&this.push(null)})),this.on("typeError",(function(e){this.emit("error",e)}))}function x(e,t,r){this.valueCount=e,this.rawDataLength=t,this.compressedDataLength=r}function B(e,t,r,n){this.index=e,this.buf=t,this.cb=r,this.count=0|n}function A(e){var t=e.pos,r=y._read(e);return e.isValid()?r:(e.pos=t,null)}function S(e,t,r){if(e)return i=t._skip,function(e){var t=e.pos;return i(e),e.buf.slice(t,e.pos)};if(r){var n=r.createResolver(t);return function(e){return n._read(e)}}return function(e){return t._read(e)};var i}u.inherits(b,a.Duplex),b.prototype._write=function(e,t,r){this._writeCb=r;var n=this._tap;n.buf=f.concat([n.buf.slice(n.pos),e]),n.pos=0,this._needPush&&(this._needPush=!1,this._read())},b.prototype._read=function(){this._needPush=!1;var e=this._tap,t=e.pos,r=this._readValue(e);e.isValid()?this.push(r):this._finished?this.push(null):(e.pos=t,this._needPush=!0,this._writeCb&&this._writeCb())},u.inherits(_,a.Duplex),_.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.inflateRaw}},_.getDefaultCodecs=_.defaultCodecs,_.prototype._decodeHeader=function(){var e=this._tap;if(e.buf.lengthi.length&&(n.buf=o.newBuffer(2*a)),n.pos=0,this._writeValue(n,e)}r()},w.prototype._flush=function(e){var t=this._tap,r=t.pos;r&&this.push(t.buf.slice(0,r)),e()},u.inherits(E,a.Duplex),E.defaultCodecs=function(){return{null:function(e,t){t(null,e)},deflate:c.deflateRaw}},E.getDefaultCodecs=E.defaultCodecs,E.prototype._writeHeader=function(){var e=JSON.stringify(this._schema?this._schema:this._type.getSchema({exportAttrs:!0})),t=o.copyOwnProperties(this._metadata,{"avro.schema":o.bufferFrom(e),"avro.codec":o.bufferFrom(this._codec)},!0),r=new(d.getRecordConstructor())(g,t,this._syncMarker);this.push(r.toBuffer())},E.prototype._write=function(e,t,r){this._needHeader&&(this._writeHeader(),this._needHeader=!1);var n=this._tap,i=n.pos,s=!1;if(this._writeValue(n,e)){if(!n.isValid()){i&&(this._flushChunk(i,r),s=!0);var a=n.pos-i;a>this._blockSize&&(this._blockSize=2*a),n.buf=o.newBuffer(this._blockSize),n.pos=0,this._writeValue(n,e)}this._blockCount++}else n.pos=i;s||r()},E.prototype._flushChunk=function(e,t){var r=this._tap;e=e||r.pos,this._compress(r.buf.slice(0,e),this._createBlockCallback(e,t)),this._blockCount=0},E.prototype._read=function(){var e=this,t=this._queue.pop();t?(this.push(h.toBuffer(t.count,!0)),this.push(h.toBuffer(t.buf.length,!0)),this.push(t.buf),this.push(this._syncMarker),this._finished||t.cb()):this._finished&&!this._pending?n.nextTick((function(){e.push(null)})):this._needPush=!0},E.prototype._createBlockCallback=function(e,t){var r=this,n=this._index++,i=this._blockCount;return this._pending++,function(o,s){if(o){var a=new Error(m("%s codec compression error",r._codec));return a.cause=o,void r.emit("error",a)}r._pending--,r.emit("block",new x(i,e,s.length)),r._queue.push(new B(n,s,t,i)),r._needPush&&(r._needPush=!1,r._read())}},e.exports={BLOCK_TYPE:y,HEADER_TYPE:d,MAGIC_BYTES:g,streams:{BlockDecoder:_,BlockEncoder:E,RawDecoder:b,RawEncoder:w}}},75942:(e,t,r)=>{"use strict";var n=r(65606),i=r(77725),o=r(22561),s=r(48287),a=r(37007),u=r(88310),c=r(40537),f=s.Buffer,l=o.Tap,h=i.Type,p=c.debuglog("avsc:services"),d=c.format,y={namespace:"org.apache.avro.ipc"},g=h.forSchema("boolean",y),m=h.forSchema({type:"map",values:"bytes"},y),v=h.forSchema("string",y),b=h.forSchema({name:"HandshakeRequest",type:"record",fields:[{name:"clientHash",type:{name:"MD5",type:"fixed",size:16}},{name:"clientProtocol",type:["null","string"],default:null},{name:"serverHash",type:"MD5"},{name:"meta",type:["null",m],default:null}]},y),_=h.forSchema({name:"HandshakeResponse",type:"record",fields:[{name:"match",type:{name:"HandshakeMatch",type:"enum",symbols:["BOTH","CLIENT","NONE"]}},{name:"serverProtocol",type:["null","string"],default:null},{name:"serverHash",type:["null","MD5"],default:null},{name:"meta",type:["null",m],default:null}]},y),w=16,E=new x("",h.forSchema({name:"PingRequest",type:"record",fields:[]},y),h.forSchema(["string"],y),h.forSchema("null",y));function x(e,t,r,n,i,o){if(this.name=e,!h.isType(t,"record"))throw new Error("invalid request type");if(this.requestType=t,!h.isType(r,"union")||!h.isType(r.getTypes()[0],"string"))throw new Error("invalid error type");if(this.errorType=r,i&&(!h.isType(n,"null")||r.getTypes().length>1))throw new Error("inapplicable one-way parameter");this.responseType=n,this.oneWay=!!i,this.doc=void 0!==o?""+o:void 0,Object.freeze(this)}function B(e,t,r,n,i){if("string"!=typeof e)return B.forProtocol(e,t);this.name=e,this._messagesByName=t||{},this.messages=Object.freeze(o.objectValues(this._messagesByName)),this._typesByName=r||{},this.types=Object.freeze(o.objectValues(this._typesByName)),this.protocol=n,this._hashStr=o.getHash(JSON.stringify(n)).toString("binary"),this.doc=n.doc?""+n.doc:void 0,this._server=i||this.createServer({silent:!0}),Object.freeze(this)}function A(e,t){t=t||{},a.EventEmitter.call(this),this._svc$=e,this._channels$=[],this._fns$=[],this._buffering$=!!t.buffering,this._cache$=t.cache||{},this._policy$=t.channelPolicy,this._strict$=!!t.strictTypes,this._timeout$=o.getOption(t,"timeout",1e4),t.remoteProtocols&&q(this._cache$,t.remoteProtocols,e,!0),this._svc$.messages.forEach((function(e){this[e.name]=this._createMessageHandler$(e)}),this)}function S(e,t){t=t||{},a.EventEmitter.call(this),this.service=e,this._handlers={},this._fns=[],this._channels={},this._nextChannelId=1,this._cache=t.cache||{},this._defaultHandler=t.defaultHandler,this._sysErrFormatter=t.systemErrorFormatter,this._silent=!!t.silent,this._strict=!!t.strictTypes,t.remoteProtocols&&q(this._cache,t.remoteProtocols,e,!1),e.messages.forEach((function(e){var r=e.name;t.noCapitalize||(r=o.capitalize(r)),this["on"+r]=this._createMessageHandler(e)}),this)}function k(e,t){t=t||{},a.EventEmitter.call(this),this.client=e,this.timeout=o.getOption(t,"timeout",e._timeout$),this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=X(t.scope);var r=e._cache$,n=e._svc$,i=t.serverHash;i||(i=n.hash);var s=r[i];s||(s=r[i=n.hash]=new j(n,n,i)),this._adapter=s,this._registry=new C(this,w),this.pending=0,this.destroyed=!1,this.draining=!1,this.once("_eot",(function(e,t){p("client channel EOT"),this.destroyed=!0,this.emit("eot",e,t)}))}function T(e,t,r){k.call(this,e,r),this._writableFactory=t,r&&r.noPing||(p("emitting ping request"),this.ping())}function O(e,t,r,i){k.call(this,e,i),this._readable=t,this._writable=r,this._connected=!(!i||!i.noPing),this._readable.on("end",d),this._writable.on("finish",y);var s,a=this,u=null;function c(e){if(!a.destroyed){s=a._createHandshakeRequest(a._adapter,!e);var t=[b.toBuffer(s),o.bufferFrom([0,0])];a._writable.write({id:a._prefix,payload:t})}}function l(e){if(a._matchesPrefix(e.id)){var t=f.concat(e.payload);try{var r=H(_,t).head;r.serverHash&&(a._adapter=a._getAdapter(r))}catch(e){return void a.destroy(e)}var i=r.match;p("handshake match: %s",i),a.emit("handshake",s,r),"NONE"===i?n.nextTick((function(){c(!0)})):(p("successfully connected"),u&&(clearTimeout(u),u=null),a._readable.removeListener("data",l).on("data",h),a._connected=!0,a.emit("_ready"),s=null)}else p("discarding unscoped response %s (still connecting)",e.id)}function h(e){var t=e.id;if(a._matchesPrefix(t)){var r=a._registry.get(t);r&&n.nextTick((function(){p("received message %s",t),r(null,f.concat(e.payload),a._adapter)}))}else p("discarding unscoped message %s",t)}function d(){a.destroy(!0)}function y(){a.destroy()}this.once("eot",(function(){u&&(clearTimeout(u),u=null),a._connected||a.emit("_ready"),this._writable.removeListener("finish",y),this._endWritable&&(p("ending transport"),this._writable.end()),this._readable.removeListener("data",l).removeListener("data",h).removeListener("end",d)})),this._connected?this._readable.on("data",h):(this._readable.on("data",l),n.nextTick(c),a.timeout&&(u=setTimeout((function(){a.destroy(new Error("timeout"))}),a.timeout)))}function I(e,t){t=t||{},a.EventEmitter.call(this),this.server=e,this._endWritable=!!o.getOption(t,"endWritable",!0),this._prefix=X(t.scope);var r=e._cache,n=e.service,i=n.hash;r[i]||(r[i]=new j(n,n,i)),this._adapter=null,this.destroyed=!1,this.draining=!1,this.pending=0,this.once("_eot",(function(e,t){p("server channel EOT"),this.emit("eot",e,t)}))}function N(e,t,r){I.call(this,e,r),this._writable=void 0;var i,o=this;function s(e){var t,r=e.id,n=f.concat(e.payload);try{var i=H(b,n),s=i.head,a=o._getAdapter(s)}catch(e){t=Y("INVALID_HANDSHAKE_REQUEST",e)}var u=o._createHandshakeResponse(t,s);function c(e){if(!o.destroyed){if(!o._writable)return void o.once("_writable",(function(){c(e)}));o._writable.write({id:r,payload:[_.toBuffer(u),e]})}o._writable&&o._endWritable&&o._writable.end()}o.emit("handshake",s,u),t?c(o._encodeSystemError(t)):o._receive(i.tail,a,c)}function a(){o.destroy()}function u(e){i.removeListener("data",s).removeListener("end",a),o.destroy(e||!0)}n.nextTick((function(){i=t.call(o,(function(e,t){n.nextTick((function(){e?u(e):(o._writable=t.on("finish",u),o.emit("_writable"))}))})).on("data",s).on("end",a)}))}function F(e,t,r,n){I.call(this,e,n),this._adapter=void 0,this._writable=r.on("finish",u),this._readable=t.on("data",o).on("end",a),this.once("_drain",(function(){this._readable.removeListener("data",o).removeListener("data",s).removeListener("end",a)})).once("eot",(function(){this._writable.removeListener("finish",u),this._endWritable&&this._writable.end()}));var i=this;function o(e){var t=e.id;if(i._matchesPrefix(t)){var r,n=f.concat(e.payload);try{var a=H(b,n),u=a.head;i._adapter=i._getAdapter(u)}catch(e){r=Y("INVALID_HANDSHAKE_REQUEST",e)}var c=i._createHandshakeResponse(r,u);i.emit("handshake",u,c),r?l(i._encodeSystemError(r)):(i._readable.removeListener("data",o).on("data",s),i._receive(a.tail,i._adapter,l))}function l(e){i.destroyed||i._writable.write({id:t,payload:[_.toBuffer(c),e]})}}function s(e){var t=e.id;if(i._matchesPrefix(t)){var r=f.concat(e.payload);i._receive(r,i._adapter,(function(e,r){i.destroyed||r||i._writable.write({id:t,payload:[e]})}))}}function a(){i.destroy()}function u(){i.destroy(!0)}}function R(e,t,r){this._msg=e,this.headers=t||{},this.request=r||{}}function L(e,t,r,n){this._msg=e,this.headers=t,this.error=r,this.response=n}function U(e,t){this.channel=t,this.locals={},this.message=e,Object.freeze(this)}function C(e,t){this._ctx=e,this._mask=-1>>>(0|t),this._id=0,this._n=0,this._cbs={}}function j(e,t,r,n){this._clientSvc=e,this._serverSvc=t,this._hash=r,this._isRemote=!!n,this._readers=Z(e,t)}function D(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",(function(){this.push(null)}))}function M(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",(function(){this.push(null)}))}function P(){u.Transform.call(this,{readableObjectMode:!0}),this._id=void 0,this._frameCount=0,this._buf=o.newBuffer(0),this._bufs=[],this.on("finish",(function(){this.push(null)}))}function z(){u.Transform.call(this,{writableObjectMode:!0}),this.on("finish",(function(){this.push(null)}))}function $(e){var t=o.newBuffer(4);return t.writeInt32BE(e),t}function H(e,t){var r=new l(t),n=e._read(r);if(!r.isValid())throw new Error(d("truncated %j",e.schema()));return{head:n,tail:r.buf.slice(r.pos)}}function V(e,t){return e.equals(t)?e:e.createResolver(t)}function Z(e,t){var r={};return e.messages.forEach((function(e){var n=e.name,i=t.message(n);try{if(!i)throw new Error(d("missing server message: %s",n));if(i.oneWay!==e.oneWay)throw new Error(d("inconsistent one-way message: %s",n));r[n+"?"]=V(i.requestType,e.requestType),r[n+"*"]=V(e.errorType,i.errorType),r[n+"!"]=V(e.responseType,i.responseType)}catch(e){throw Y("INCOMPATIBLE_PROTOCOL",e)}})),r}function q(e,t,r,n){Object.keys(t).forEach((function(i){var o,s,a=t[i];n?(o=r,s=B.forProtocol(a)):(o=B.forProtocol(a),s=r),e[i]=new j(o,s,i,!0)}))}function G(e,t){var r={};return Object.keys(e).forEach((function(n){var i=e[n];if(i._isRemote){var o=t?i._serverSvc:i._clientSvc;r[n]=o.protocol}})),r}function J(e){return!!e&&"[object Error]"===Object.prototype.toString.call(e)}function W(e,t){var r=new Error(e);return r.cause=t,r}function Y(e,t){var r=W(e.toLowerCase().replace(/_/g," "),t);return r.rpcCode=t&&t.rpcCode?t.rpcCode:e,r}function K(e,t,r){var n,i,o,s=[];for(n=0,i=r.length;n>32-w)}function ee(e){return!(!e||!e.pipe)}function te(e,t){var r=e.message(t);if(!r)throw new Error(d("unknown message: %s",t));return r}function re(e){var t,r=[e.wreq,e.wres],i=[];function o(){var r=i.pop();if(r){var n=!1;r.call(e.ctx,t,(function(r){n?e.onError(W("duplicate backward middleware call",r)):(t=r,n=!0,o())}))}else e.onCompletion.call(e.ctx,t)}!function s(a){var u=!1;a1&&(t.errors=n.slice(1)),this.oneWay&&(t["one-way"]=!0),t},o.addDeprecatedGetters(x,["name","errorType","requestType","responseType"]),x.prototype.isOneWay=c.deprecate((function(){return this.oneWay}),"use `.oneWay` directly instead of `.isOneWay()`"),B.Client=A,B.Server=S,B.compatible=function(e,t){try{Z(e,t)}catch(e){return!1}return!0},B.forProtocol=function(e,t){t=t||{};var r,n=e.protocol;if(!n)throw new Error("missing protocol name");if(void 0!==e.namespace)t.namespace=e.namespace;else{var i=/^(.*)\.[^.]+$/.exec(n);i&&(t.namespace=i[1])}return n=o.qualify(n,t.namespace),e.types&&e.types.forEach((function(e){h.forSchema(e,t)})),e.messages&&(r={},Object.keys(e.messages).forEach((function(n){r[n]=x.forSchema(n,e.messages[n],t)}))),new B(n,r,t.registry,e)},B.isService=function(e){return!!e&&e.hasOwnProperty("_hashStr")},B.prototype.createClient=function(e){var t=new A(this,e);return n.nextTick((function(){if(e&&e.server){var r={objectMode:!0},n=[new u.PassThrough(r),new u.PassThrough(r)];e.server.createChannel({readable:n[0],writable:n[1]},r),t.createChannel({readable:n[1],writable:n[0]},r)}else e&&e.transport&&t.createChannel(e.transport)})),t},B.prototype.createServer=function(e){return new S(this,e)},Object.defineProperty(B.prototype,"hash",{enumerable:!0,get:function(){return o.bufferFrom(this._hashStr,"binary")}}),B.prototype.message=function(e){return this._messagesByName[e]},B.prototype.type=function(e){return this._typesByName[e]},B.prototype.inspect=function(){return d("",this.name)},o.addDeprecatedGetters(B,["message","messages","name","type","types"]),B.prototype.createEmitter=c.deprecate((function(e,t){t=t||{};var r,n,i=this.createClient({cache:t.cache,buffering:!1,strictTypes:t.strictErrors,timeout:t.timeout}),o=i.createChannel(e,t);return n=o,(r=i).on("error",(function(e){n.emit("error",e,r)})),o}),"use `.createClient()` instead of `.createEmitter()`"),B.prototype.createListener=c.deprecate((function(e,t){if(t&&t.strictErrors)throw new Error("use `.createServer()` to support strict errors");return this._server.createChannel(e,t)}),"use `.createServer().createChannel()` instead of `.createListener()`"),B.prototype.emit=c.deprecate((function(e,t,r,n){if(!r||!this.equals(r.client._svc$))throw new Error("invalid emitter");var i=r.client;return A.prototype.emitMessage.call(i,e,t,n&&n.bind(this)),r.getPending()}),"create a client via `.createClient()` to emit messages instead of `.emit()`"),B.prototype.equals=c.deprecate((function(e){return B.isService(e)&&this.getFingerprint().equals(e.getFingerprint())}),"equality testing is deprecated, compare the `.protocol`s instead"),B.prototype.getFingerprint=c.deprecate((function(e){return o.getHash(JSON.stringify(this.protocol),e)}),"use `.hash` instead of `.getFingerprint()`"),B.prototype.getSchema=c.deprecate(h.prototype.getSchema,"use `.protocol` instead of `.getSchema()`"),B.prototype.on=c.deprecate((function(e,t){var r=this;return this._server.onMessage(e,(function(e,n){return t.call(r,e,this.channel,n)})),this}),"use `.createServer().onMessage()` instead of `.on()`"),B.prototype.subprotocol=c.deprecate((function(){var e=this._server,t={strictTypes:e._strict,cache:e._cache},r=new S(e.service,t);return r._handlers=Object.create(e._handlers),new B(this.name,this._messagesByName,this._typesByName,this.protocol,r)}),"`.subprotocol()` will be removed in 5.1"),B.prototype._attrs=function(e){var t={protocol:this.name},r=[];this.types.forEach((function(t){if(void 0!==t.getName()){var n=t._attrs(e);"string"!=typeof n&&r.push(n)}})),r.length&&(t.types=r);var n=Object.keys(this._messagesByName);return n.length&&(t.messages={},n.forEach((function(r){t.messages[r]=this._messagesByName[r]._attrs(e)}),this)),e&&e.exportAttrs&&void 0!==this.doc&&(t.doc=this.doc),t},c.inherits(A,a.EventEmitter),A.prototype.activeChannels=function(){return this._channels$.slice()},A.prototype.createChannel=function(e,t){var r,n=t&&t.objectMode;if("function"==typeof e){var i;i=n?e:function(t){var n=new M,i=e((function(e,n){if(e)t(e);else{var i=(new D).once("error",(function(e){r.destroy(e)}));t(null,n.pipe(i))}}));if(i)return n.pipe(i),n},r=new T(this,i,t)}else{var o,s;if(ee(e)?o=s=e:(o=e.readable,s=e.writable),!n){var a=new P;o=o.pipe(a);var u=new z;u.pipe(s),s=u}r=new O(this,o,s,t),n||(r.once("eot",(function(){o.unpipe(a),u.unpipe(s)})),a.once("error",(function(e){r.destroy(e)})))}var c=this._channels$;return c.push(r),r.once("_drain",(function(){c.splice(c.indexOf(this),1)})),this._buffering$=!1,this.emit("channel",r),r},A.prototype.destroyChannels=function(e){this._channels$.forEach((function(t){t.destroy(e&&e.noWait)}))},A.prototype.emitMessage=function(e,t,r,n){var i=new R(te(this._svc$,e),{},t);this._emitMessage$(i,r,n)},A.prototype.remoteProtocols=function(){return G(this._cache$,!0)},Object.defineProperty(A.prototype,"service",{enumerable:!0,get:function(){return this._svc$}}),A.prototype.use=function(){var e,t,r;for(e=0,t=arguments.length;e0&&(r=setTimeout((function(){o(new Error("timeout"))}),e)),this._cbs[i]=o,this._n++,i;function o(){n._cbs[i]&&(delete n._cbs[i],n._n--,r&&clearTimeout(r),t.apply(n._ctx,arguments))}},C.prototype.clear=function(){Object.keys(this._cbs).forEach((function(e){this._cbs[e](new Error("interrupted"))}),this)},j.prototype._decodeRequest=function(e){var t,r,n=new l(e),i=m._read(n),o=v._read(n);if(o?(t=this._serverSvc.message(o),r=this._readers[o+"?"]._read(n)):t=E,!n.isValid())throw new Error(d("truncated %s request",o||"ping$"));return new R(t,i,r)},j.prototype._decodeResponse=function(e,t,r){var n=new l(e);o.copyOwnProperties(m._read(n),t.headers,!0);var i=g._read(n),s=r.name;if(s){var a=this._readers[s+(i?"*":"!")];if(r=this._clientSvc.message(s),i?t.error=a._read(n):t.response=a._read(n),!n.isValid())throw new Error(d("truncated %s response",s))}else r=E},c.inherits(D,u.Transform),D.prototype._transform=function(e,t,r){var n;for(e=f.concat([this._buf,e]);e.length>=4&&e.length>=(n=e.readInt32BE(0))+4;){if(n)this._bufs.push(e.slice(4,n+4));else{var i=this._bufs;this._bufs=[],this.push({id:null,payload:i})}e=e.slice(n+4)}this._buf=e,r()},D.prototype._flush=function(e){if(this._buf.length||this._bufs.length){var t=this._bufs.slice();t.unshift(this._buf);var r=Y("TRAILING_DATA");r.trailingData=f.concat(t).toString(),this.emit("error",r)}e()},c.inherits(M,u.Transform),M.prototype._transform=function(e,t,r){var n,i,o,s=e.payload;for(n=0,i=s.length;n=4&&e.length>=(n=e.readInt32BE(0))+4;)this._frameCount--,this._bufs.push(e.slice(4,n+4)),e=e.slice(n+4);if(this._frameCount)return this._buf=e,void r();var i={id:this._id,payload:this._bufs};this._bufs=[],this._id=void 0,this.push(i)}},P.prototype._flush=D.prototype._flush,c.inherits(z,u.Transform),z.prototype._transform=function(e,t,r){var n,i,s=e.payload,a=s.length;for((n=o.newBuffer(8)).writeInt32BE(e.id,0),n.writeInt32BE(a,4),this.push(n),i=0;i{"use strict";var n=r(36161),i=r(22561),o=r(43627),s=r(40537).format,a={date:{type:"int",logicalType:"date"},decimal:{type:"bytes",logicalType:"decimal"},time_ms:{type:"long",logicalType:"time-millis"},timestamp_ms:{type:"long",logicalType:"timestamp-millis"}};function u(e,t,r){r||"function"!=typeof t||(r=t,t=void 0),(t=t||{}).importHook||(t.importHook=n.createImportHook()),function e(r,n){t.importHook(r,"idl",(function(i,a){if(i)n(i);else if(void 0!==a){try{var u=new c(a,t)._readProtocol(a,t)}catch(i){return i.path=r,void n(i)}!function(r,n,i,a){var u=[];!function c(){var f=n.shift();if(f){var l=o.join(i,f.name);"idl"===f.kind?e(l,(function(e,t){e?a(e):(t&&u.push(t),c())})):t.importHook(l,f.kind,(function(e,t){if(e)a(e);else switch(f.kind){case"protocol":case"schema":if(void 0===t)return void c();try{var r=JSON.parse(t)}catch(e){return e.path=l,void a(e)}var n="schema"===f.kind?{types:[r]}:r;return u.push(n),void c();default:a(new Error(s("invalid import kind: %s",f.kind)))}}))}else{u.reverse();try{u.forEach((function(e){!function(e,t){var r=t.types||[];r.reverse(),r.forEach((function(r){e.types||(e.types=[]),void 0===r.namespace&&(r.namespace=h(t)||""),e.types.unshift(r)})),Object.keys(t.messages||{}).forEach((function(r){if(e.messages||(e.messages={}),e.messages[r])throw new Error(s("duplicate message: %s",r));e.messages[r]=t.messages[r]}))}(r,e)}))}catch(e){return void a(e)}a(null,r)}}()}(u.protocol,u.imports,o.dirname(r),n)}else n()}))}(e,(function(e,t){if(e)r(e);else if(t){var n=t.types;if(n){var i=h(t)||"";n.forEach((function(e){e.namespace===i&&delete e.namespace}))}r(null,t)}else r(new Error("empty root import"))}))}function c(e,t){t=t||{},this._tk=new f(e),this._ackVoidMessages=!!t.ackVoidMessages,this._implicitTags=!t.delimitedCollections,this._typeRefs=t.typeRefs||a}function f(e){this._str=e,this.pos=0}function l(e){for(var t=e.replace(/^[ \t]+|[ \t]+$/g,"").split("\n").map((function(e,t){return t?e.replace(/^\s*\*\s?/,""):e}));t.length&&!t[0];)t.shift();for(;t.length&&!t[t.length-1];)t.pop();return t.join("\n")}function h(e){if(e.namespace)return e.namespace;var t=/^(.*)\.[^.]+$/.exec(e.protocol);return t?t[1]:void 0}c.readProtocol=function(e,t){var r=new c(e,t)._readProtocol();if(r.imports.length)throw new Error("unresolvable import");return r.protocol},c.readSchema=function(e,t){var r=new c(e,t),n=r._readJavadoc(),i=r._readType(void 0===n?{}:{doc:n},!0);return r._tk.next({id:"(eof)"}),i},c.prototype._readProtocol=function(){var e,t=this._tk,r=[],n=[],i={};this._readImports(r);var o={},a=this._readJavadoc();for(void 0!==a&&(o.doc=a),this._readAnnotations(o),t.next({val:"protocol"}),t.next({val:"{",silent:!0})||(o.protocol=t.next({id:"name"}).val,t.next({val:"{"}));!t.next({val:"}",silent:!0});)if(!this._readImports(r)){var u=this._readJavadoc(),c=this._readType({},!0),f=this._readImports(r,!0),l=void 0;if(e=t.pos,!f&&(l=this._readMessage(c))){void 0!==u&&void 0===l.schema.doc&&(l.schema.doc=u);var h=!1;if("void"!==l.schema.response&&"void"!==l.schema.response.type||(h=!this._ackVoidMessages&&!l.schema.errors,"void"===l.schema.response?l.schema.response="null":l.schema.response.type="null"),h&&(l.schema["one-way"]=!0),i[l.name])throw new Error(s("duplicate message: %s",l.name));i[l.name]=l.schema}else u&&("string"==typeof c?c={doc:u,type:c}:void 0===c.doc&&(c.doc=u)),n.push(c),t.pos=e,t.next({val:";",silent:!0});u=void 0}return t.next({id:"(eof)"}),n.length&&(o.types=n),Object.keys(i).length&&(o.messages=i),{protocol:o,imports:r}},c.prototype._readAnnotations=function(e){for(var t=this._tk;t.next({val:"@",silent:!0});){for(var r=[];!t.next({val:"(",silent:!0});)r.push(t.next().val);e[r.join("")]=t.next({id:"json"}).val,t.next({val:")"})}},c.prototype._readMessage=function(e){var t=this._tk,r={request:[],response:e};this._readAnnotations(r);var n=t.next().val;if("("===t.next().val){if(!t.next({val:")",silent:!0}))do{r.request.push(this._readField())}while(!t.next({val:")",silent:!0})&&t.next({val:","}));var i=t.next();switch(i.val){case"throws":r.errors=[];do{r.errors.push(this._readType())}while(!t.next({val:";",silent:!0})&&t.next({val:","}));break;case"oneway":r["one-way"]=!0,t.next({val:";"});break;case";":break;default:throw t.error("invalid message suffix",i)}return{name:n,schema:r}}},c.prototype._readJavadoc=function(){var e=this._tk.next({id:"javadoc",emitJavadoc:!0,silent:!0});if(e)return e.val},c.prototype._readField=function(){var e=this._tk,t=this._readJavadoc(),r={type:this._readType()};return void 0!==t&&void 0===r.doc&&(r.doc=t),this._readAnnotations(r),r.name=e.next({id:"name"}).val,e.next({val:"=",silent:!0})&&(r.default=e.next({id:"json"}).val),r},c.prototype._readType=function(e,t){switch(e=e||{},this._readAnnotations(e),e.type=this._tk.next({id:"name"}).val,e.type){case"record":case"error":return this._readRecord(e);case"fixed":return this._readFixed(e);case"enum":return this._readEnum(e,t);case"map":return this._readMap(e);case"array":return this._readArray(e);case"union":if(Object.keys(e).length>1)throw new Error("union annotations are not supported");return this._readUnion();default:var r=this._typeRefs[e.type];return r&&(delete e.type,i.copyOwnProperties(r,e)),Object.keys(e).length>1?e:e.type}},c.prototype._readFixed=function(e){var t=this._tk;return t.next({val:"(",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"("})),e.size=parseInt(t.next({id:"number"}).val),t.next({val:")"}),e},c.prototype._readMap=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.values=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readArray=function(e){var t=this._tk,r=this._implicitTags,n=void 0===t.next({val:"<",silent:r});return e.items=this._readType(),t.next({val:">",silent:n}),e},c.prototype._readEnum=function(e,t){var r=this._tk;r.next({val:"{",silent:!0})||(e.name=r.next({id:"name"}).val,r.next({val:"{"})),e.symbols=[];do{e.symbols.push(r.next().val)}while(!r.next({val:"}",silent:!0})&&r.next({val:","}));return t&&r.next({val:"=",silent:!0})&&(e.default=r.next().val,r.next({val:";"})),e},c.prototype._readUnion=function(){var e=this._tk,t=[];e.next({val:"{"});do{t.push(this._readType())}while(!e.next({val:"}",silent:!0})&&e.next({val:","}));return t},c.prototype._readRecord=function(e){var t=this._tk;for(t.next({val:"{",silent:!0})||(e.name=t.next({id:"name"}).val,t.next({val:"{"})),e.fields=[];!t.next({val:"}",silent:!0});)e.fields.push(this._readField()),t.next({val:";"});return e},c.prototype._readImports=function(e,t){for(var r=this._tk,n=0,i=r.pos;r.next({val:"import",silent:!0});){if(!n&&t&&r.next({val:"(",silent:!0}))return void(r.pos=i);var o=r.next({id:"name"}).val,s=JSON.parse(r.next({id:"string"}).val);r.next({val:";"}),e.push({kind:o,name:s}),n++}return n},f.prototype.next=function(e){var t,r={pos:this.pos,id:void 0,val:void 0},n=this._skip(e&&e.emitJavadoc);if("string"==typeof n)r.id="javadoc",r.val=n;else{var i=this.pos,o=this._str,a=o.charAt(i);if(a)if(e&&"json"===e.id?(r.id="json",this.pos=this._endOfJson()):'"'===a?(r.id="string",this.pos=this._endOfString()):/[0-9]/.test(a)?(r.id="number",this.pos=this._endOf(/[0-9]/)):/[`A-Za-z_.]/.test(a)?(r.id="name",this.pos=this._endOf(/[`A-Za-z0-9_.]/)):(r.id="operator",this.pos=i+1),r.val=o.slice(i,this.pos),"json"===r.id)try{r.val=JSON.parse(r.val)}catch(t){throw this.error("invalid JSON",r)}else"name"===r.id&&(r.val=r.val.replace(/`/g,""));else r.id="(eof)"}if(e&&e.id&&e.id!==r.id?t=this.error(s("expected ID %s",e.id),r):e&&e.val&&e.val!==r.val&&(t=this.error(s("expected value %s",e.val),r)),t){if(e&&e.silent)return void(this.pos=r.pos);throw t}return r},f.prototype.error=function(e,t){var r,n="number"!=typeof t,i=n?t.pos:t,o=this._str,a=1,u=0;for(r=0;r{"use strict";var n=r(22561),i=r(48287),o=r(40537),s=i.Buffer,a=i.SlowBuffer,u=n.Tap,c=o.debuglog("avsc:types"),f=o.format,l={array:F,boolean:b,bytes:A,double:x,enum:O,error:R,fixed:I,float:E,int:_,long:w,map:N,null:v,record:R,string:B},h=new n.Lcg,p=new u(new a(1024)),d=null,y=[];function g(e,t){var r;if(d?(r=d,y.push([d,this]),d=null):r=this,this._hash=new D,this.name=void 0,this.aliases=void 0,this.doc=e&&e.doc?""+e.doc:void 0,e){var n=e.name,i=void 0===e.namespace?t&&t.namespace:e.namespace;if(void 0!==n){if($(n=J(n,i)))throw new Error(f("cannot rename primitive type: %j",n));var o=t&&t.registry;if(o){if(void 0!==o[n])throw new Error(f("duplicate type name: %s",n));o[n]=r}}else if(t&&t.noAnonymousTypes)throw new Error(f("missing name property in schema: %j",e));this.name=n,this.aliases=e.aliases?e.aliases.map((function(e){return J(e,i)})):[]}}function m(e){g.call(this),this._branchConstructor=this._createBranchConstructor(),e||Object.freeze(this)}function v(){m.call(this)}function b(){m.call(this)}function _(){m.call(this)}function w(){m.call(this)}function E(){m.call(this)}function x(){m.call(this)}function B(){m.call(this)}function A(){m.call(this)}function S(e,t){if(g.call(this),!Array.isArray(e))throw new Error(f("non-array union schema: %j",e));if(!e.length)throw new Error("empty union");this.types=Object.freeze(e.map((function(e){return g.forSchema(e,t)}))),this._branchIndices={},this.types.forEach((function(e,t){if(g.isType(e,"union"))throw new Error("unions cannot be directly nested");var r=e.branchName;if(void 0!==this._branchIndices[r])throw new Error(f("duplicate union branch name: %j",r));this._branchIndices[r]=t}),this)}function k(e,t){S.call(this,e,t),this._dynamicBranches=null,this._bucketIndices={},this.types.forEach((function(e,t){if(g.isType(e,"abstract","logical"))this._dynamicBranches||(this._dynamicBranches=[]),this._dynamicBranches.push({index:t,type:e});else{var r=W(e);if(void 0!==this._bucketIndices[r])throw new Error(f("ambiguous unwrapped union: %j",this));this._bucketIndices[r]=t}}),this),Object.freeze(this)}function T(e,t){S.call(this,e,t),Object.freeze(this)}function O(e,t){if(g.call(this,e,t),!Array.isArray(e.symbols)||!e.symbols.length)throw new Error(f("invalid enum symbols: %j",e.symbols));if(this.symbols=Object.freeze(e.symbols.slice()),this._indices={},this.symbols.forEach((function(e,t){if(!n.isValidName(e))throw new Error(f("invalid %s symbol: %j",this,e));if(void 0!==this._indices[e])throw new Error(f("duplicate %s symbol: %j",this,e));this._indices[e]=t}),this),this.default=e.default,void 0!==this.default&&void 0===this._indices[this.default])throw new Error(f("invalid %s default: %j",this,this.default));this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function I(e,t){if(g.call(this,e,t),e.size!==(0|e.size)||e.size<0)throw new Error(f("invalid %s size",this.branchName));this.size=0|e.size,this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function N(e,t){if(g.call(this),!e.values)throw new Error(f("missing map values: %j",e));this.valuesType=g.forSchema(e.values,t),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function F(e,t){if(g.call(this),!e.items)throw new Error(f("missing array items: %j",e));this.itemsType=g.forSchema(e.items,t),this._branchConstructor=this._createBranchConstructor(),Object.freeze(this)}function R(e,t){var r=(t=t||{}).namespace;if(void 0!==e.namespace)t.namespace=e.namespace;else if(e.name){var i=n.impliedNamespace(e.name);void 0!==i&&(t.namespace=i)}if(g.call(this,e,t),!Array.isArray(e.fields))throw new Error(f("non-array record fields: %j",e.fields));if(n.hasDuplicates(e.fields,(function(e){return e.name})))throw new Error(f("duplicate field name: %j",e.fields));this._fieldsByName={},this.fields=Object.freeze(e.fields.map((function(e){var r=new C(e,t);return this._fieldsByName[r.name]=r,r}),this)),this._branchConstructor=this._createBranchConstructor(),this._isError="error"===e.type,this.recordConstructor=this._createConstructor(t.errorStackTraces,t.omitRecordMethods),this._read=this._createReader(),this._skip=this._createSkipper(),this._write=this._createWriter(),this._check=this._createChecker(),t.namespace=r,Object.freeze(this)}function L(e,t){this._logicalTypeName=e.logicalType,g.call(this),d=this;try{this._underlyingType=g.forSchema(e,t)}finally{d=null;var r=y.length;r&&y[r-1][0]===this&&y.pop()}g.isType(this.underlyingType,"union")?this._branchConstructor=this.underlyingType._branchConstructor:this._branchConstructor=this.underlyingType._createBranchConstructor()}function U(e){this._concreteTypeName="long",m.call(this,!0),this._noUnpack=!!e}function C(e,t){var r=e.name;if("string"!=typeof r||!n.isValidName(r))throw new Error(f("invalid field name: %s",r));this.name=r,this.type=g.forSchema(e.type,t),this.aliases=e.aliases||[],this.doc=void 0!==e.doc?""+e.doc:void 0,this._order=function(e){switch(e){case"ascending":return 1;case"descending":return-1;case"ignore":return 0;default:throw new Error(f("invalid order: %j",e))}}(void 0===e.order?"ascending":e.order);var i=e.default;if(void 0!==i){var o,s=this.type;try{o=s._copy(i,{coerce:2,wrap:2})}catch(e){var a=f("incompatible field default %j (%s)",i,e.message);throw g.isType(s,"union")&&(a+=f(", union defaults must match the first branch's type (%j)",s.types[0])),new Error(a)}$(s.typeName)&&"bytes"!==s.typeName?this.defaultValue=function(){return o}:this.defaultValue=function(){return s._copy(o)}}Object.freeze(this)}function j(e){this._readerType=e,this._read=null,this.itemsType=null,this.size=0,this.symbols=null,this.valuesType=null}function D(){this.str=void 0}function M(e,t,r,n){if(r){if(r._readerType!==e)throw new Error("invalid resolver");return r._read(t,n)}return e._read(t)}function P(e){var t={};e.name&&(t[e.name]=!0);var r,n,i=e.aliases;for(r=0,n=i.length;r=-9007199254740990&&e<=9007199254740990}function q(e){return e&&"Buffer"===e.type&&Array.isArray(e.data)}function G(e,t){throw new Error(f("invalid %j: %j",t.schema(),e))}function J(e,t){var r=n.unqualify(e);return $(r)?r:n.qualify(e,t)}function W(e){var t=e.typeName;switch(t){case"double":case"float":case"int":case"long":return"number";case"bytes":case"fixed":return"buffer";case"enum":return"string";case"map":case"error":case"record":return"object";default:return t}}function Y(e){if(null===e)return"null";var t=typeof e;if("object"===t){if(Array.isArray(e))return"array";if(s.isBuffer(e))return"buffer"}return t}g.forSchema=function(e,t){(t=t||{}).registry=t.registry||{};var r,n=function(e){switch(!0===e?e="always":!1===e?e="never":void 0===e?e="auto":"string"==typeof e&&(e=e.toLowerCase()),e){case"always":return T;case"never":return k;case"auto":return;default:throw new Error(f("invalid wrap unions option: %j",e))}}(t.wrapUnions);if(null===e)throw new Error('invalid type: null (did you mean "null"?)');if(g.isType(e))return e;if(t.typeHook&&(r=t.typeHook(e,t))){if(!g.isType(r))throw new Error(f("invalid typehook return value: %j",r));return r}if("string"==typeof e){if(e=J(e,t.namespace),r=t.registry[e])return r;if($(e))return t.registry[e]=g.forSchema({type:e},t);throw new Error(f("undefined type name: %s",e))}if(e.logicalType&&t.logicalTypes&&!d){var i=t.logicalTypes[e.logicalType];if(i){var o=t.namespace,s={};Object.keys(t.registry).forEach((function(e){s[e]=t.registry[e]}));try{return c("instantiating logical type for %s",e.logicalType),new i(e,t)}catch(r){if(c("failed to instantiate logical type for %s",e.logicalType),t.assertLogicalTypes)throw r;d=null,t.namespace=o,t.registry=s}}}if(Array.isArray(e)){var a=d;d=null;var u=e.map((function(e){return g.forSchema(e,t)}));n||(n=function(e){var t,r,n,i,o={};for(t=0,r=e.length;ts&&(s=i,a=n);return a}(r);case"string":return function(e,t){var r,n,i,o,s={};for(r=0,n=e.length;r0){var a=s[0];s[0]=s[i],s[i]=a,r=g.forSchema(s,t)}}return{name:e,type:r,default:c[e]}}))}:{type:"map",values:g.forTypes(a,t)},g.forSchema(s,t)}(r,t)}}));return 1===c.length?c[0]:g.forSchema(c,t)},g.isType=function(){var e=arguments.length;if(!e)return!1;var t=arguments[0];if(!t||"function"!=typeof t._update||"function"!=typeof t.fingerprint)return!1;if(1===e)return!0;var r,n=t.typeName;for(r=1;r",t);var r=this.schema({exportAttrs:!0,noDeref:!0});return"object"!=typeof r||g.isType(this,"logical")||(r.type=void 0),f("<%s %j>",t,r)},g.prototype.isValid=function(e,t){var r,n,i=0|(t&&t.noUndeclaredFields),o=t&&t.errorHook;return o&&(n=[],r=function(t,r){o.call(this,n.slice(),t,r,e)}),this._check(e,i,r,n)},g.prototype.random=n.abstractFunction,g.prototype.schema=function(e){return this._attrs({exportAttrs:!(!e||!e.exportAttrs),noDeref:!(!e||!e.noDeref)})},g.prototype.toBuffer=function(e){p.pos=0,this._write(p,e);var t=n.newBuffer(p.pos);return p.isValid()?p.buf.copy(t,0,0,p.pos):this._write(new u(t),e),t},g.prototype.toJSON=function(){return this.schema({exportAttrs:!0})},g.prototype.toString=function(e){return void 0===e?JSON.stringify(this.schema({noDeref:!0})):JSON.stringify(this._copy(e,{coerce:3}))},g.prototype.wrap=function(e){var t=this._branchConstructor;return null===t?null:new t(e)},g.prototype._attrs=function(e){e.derefed=e.derefed||{};var t=this.name;if(void 0!==t){if(e.noDeref||e.derefed[t])return t;e.derefed[t]=!0}var r={};void 0!==this.name&&(r.name=t),r.type=this.typeName;var n=this._deref(r,e);return void 0!==n&&(r=n),e.exportAttrs&&(this.aliases&&this.aliases.length&&(r.aliases=this.aliases),void 0!==this.doc&&(r.doc=this.doc)),r},g.prototype._createBranchConstructor=function(){var e=this.branchName;if("null"===e)return null;var t=~e.indexOf(".")?"this['"+e+"']":"this."+e,r=new Function("return function Branch$(val) { "+t+" = val; };")();return r.type=this,r.prototype.unwrap=new Function("return "+t+";"),r.prototype.unwrapped=r.prototype.unwrap,r},g.prototype._peek=function(e){var t=e.pos,r=this._read(e);return e.pos=t,r},g.prototype._check=n.abstractFunction,g.prototype._copy=n.abstractFunction,g.prototype._deref=n.abstractFunction,g.prototype._match=n.abstractFunction,g.prototype._read=n.abstractFunction,g.prototype._skip=n.abstractFunction,g.prototype._update=n.abstractFunction,g.prototype._write=n.abstractFunction,g.prototype.getAliases=function(){return this.aliases},g.prototype.getFingerprint=g.prototype.fingerprint,g.prototype.getName=function(e){return this.name||!e?this.name:this.branchName},g.prototype.getSchema=g.prototype.schema,g.prototype.getTypeName=function(){return this.typeName},o.inherits(m,g),m.prototype._update=function(e,t){t.typeName===this.typeName&&(e._read=this._read)},m.prototype._copy=function(e){return this._check(e,void 0,G),e},m.prototype._deref=function(){return this.typeName},m.prototype.compare=n.compare,o.inherits(v,m),v.prototype._check=function(e,t,r){var n=null===e;return!n&&r&&r(e,this),n},v.prototype._read=function(){return null},v.prototype._skip=function(){},v.prototype._write=function(e,t){null!==t&&G(t,this)},v.prototype._match=function(){return 0},v.prototype.compare=v.prototype._match,v.prototype.typeName="null",v.prototype.random=v.prototype._read,o.inherits(b,m),b.prototype._check=function(e,t,r){var n="boolean"==typeof e;return!n&&r&&r(e,this),n},b.prototype._read=function(e){return e.readBoolean()},b.prototype._skip=function(e){e.skipBoolean()},b.prototype._write=function(e,t){"boolean"!=typeof t&&G(t,this),e.writeBoolean(t)},b.prototype._match=function(e,t){return e.matchBoolean(t)},b.prototype.typeName="boolean",b.prototype.random=function(){return h.nextBoolean()},o.inherits(_,m),_.prototype._check=function(e,t,r){var n=e===(0|e);return!n&&r&&r(e,this),n},_.prototype._read=function(e){return e.readInt()},_.prototype._skip=function(e){e.skipInt()},_.prototype._write=function(e,t){t!==(0|t)&&G(t,this),e.writeInt(t)},_.prototype._match=function(e,t){return e.matchInt(t)},_.prototype.typeName="int",_.prototype.random=function(){return 0|h.nextInt(1e3)},o.inherits(w,m),w.prototype._check=function(e,t,r){var n="number"==typeof e&&e%1==0&&Z(e);return!n&&r&&r(e,this),n},w.prototype._read=function(e){var t=e.readLong();if(!Z(t))throw new Error("potential precision loss");return t},w.prototype._skip=function(e){e.skipLong()},w.prototype._write=function(e,t){("number"!=typeof t||t%1||!Z(t))&&G(t,this),e.writeLong(t)},w.prototype._match=function(e,t){return e.matchLong(t)},w.prototype._update=function(e,t){switch(t.typeName){case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=this._read}},w.prototype.typeName="long",w.prototype.random=function(){return h.nextInt()},w.__with=function(e,t){e=e||{};var r={toBuffer:"_toBuffer",fromBuffer:"_fromBuffer",fromJSON:"_fromJSON",toJSON:"_toJSON",isValid:"_isValid",compare:"compare"},n=new U(t);return Object.keys(r).forEach((function(t){if(void 0===e[t])throw new Error(f("missing method implementation: %s",t));n[r[t]]=e[t]})),Object.freeze(n)},o.inherits(E,m),E.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},E.prototype._read=function(e){return e.readFloat()},E.prototype._skip=function(e){e.skipFloat()},E.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeFloat(t)},E.prototype._match=function(e,t){return e.matchFloat(t)},E.prototype._update=function(e,t){switch(t.typeName){case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},E.prototype.typeName="float",E.prototype.random=function(){return h.nextFloat(1e3)},o.inherits(x,m),x.prototype._check=function(e,t,r){var n="number"==typeof e;return!n&&r&&r(e,this),n},x.prototype._read=function(e){return e.readDouble()},x.prototype._skip=function(e){e.skipDouble()},x.prototype._write=function(e,t){"number"!=typeof t&&G(t,this),e.writeDouble(t)},x.prototype._match=function(e,t){return e.matchDouble(t)},x.prototype._update=function(e,t){switch(t.typeName){case"double":case"float":case"int":e._read=t._read;break;case"abstract:long":case"long":e._read=function(e){return e.readLong()}}},x.prototype.typeName="double",x.prototype.random=function(){return h.nextFloat()},o.inherits(B,m),B.prototype._check=function(e,t,r){var n="string"==typeof e;return!n&&r&&r(e,this),n},B.prototype._read=function(e){return e.readString()},B.prototype._skip=function(e){e.skipString()},B.prototype._write=function(e,t){"string"!=typeof t&&G(t,this),e.writeString(t)},B.prototype._match=function(e,t){return e.matchString(t)},B.prototype._update=function(e,t){switch(t.typeName){case"bytes":case"string":e._read=this._read}},B.prototype.typeName="string",B.prototype.random=function(){return h.nextString(h.nextInt(32))},o.inherits(A,m),A.prototype._check=function(e,t,r){var n=s.isBuffer(e);return!n&&r&&r(e,this),n},A.prototype._read=function(e){return e.readBytes()},A.prototype._skip=function(e){e.skipBytes()},A.prototype._write=function(e,t){s.isBuffer(t)||G(t,this),e.writeBytes(t)},A.prototype._match=function(e,t){return e.matchBytes(t)},A.prototype._update=B.prototype._update,A.prototype._copy=function(e,t){var r;switch(0|(t&&t.coerce)){case 3:return this._check(e,void 0,G),e.toString("binary");case 2:if("string"!=typeof e)throw new Error(f("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e,"binary"),this._check(r,void 0,G),r;case 1:if(!q(e))throw new Error(f("cannot coerce to buffer: %j",e));return r=n.bufferFrom(e.data),this._check(r,void 0,G),r;default:return this._check(e,void 0,G),n.bufferFrom(e)}},A.prototype.compare=s.compare,A.prototype.typeName="bytes",A.prototype.random=function(){return h.nextBuffer(h.nextInt(32))},o.inherits(S,g),S.prototype._branchConstructor=function(){throw new Error("unions cannot be directly wrapped")},S.prototype._skip=function(e){this.types[e.readLong()]._skip(e)},S.prototype._match=function(e,t){var r=e.readLong(),n=t.readLong();return r===n?this.types[r]._match(e,t):r1)throw new Error(f("ambiguous aliasing for %s.%s (%s)",t.name,s.name,c));if(c.length)a=c[0],l={resolver:s.type.createResolver(d[a].type,r),name:"_"+s.name},g[a]?g[a].push(l):g[a]=[l],y.push(l.name);else{if(void 0===s.defaultValue())throw new Error(f("no matching field for default-less %s.%s",t.name,s.name));y.push("undefined")}}var m=-1;for(i=p.length;i&&void 0===g[p[--i].name];)m=i;var v=this._getConstructorName(),b=[v],_=[this.recordConstructor],w=" return function read"+v+"(t, b) {\n";for(i=0;i=m?" ":" ",b.push("r"+i),_.push(s.type),w+="r"+i+"._skip(t);\n";else for(o=g[a].length;o--;)w+=~m&&i>=m?" ":" ",b.push("r"+i+"f"+o),l=g[a][o],_.push(l.resolver),w+="var "+l.name+" = ",w+="r"+i+"f"+o+"._"+(o?"peek":"read")+"(t);\n";~m&&(w+=" }\n"),w+=" return new "+v+"("+y.join()+");\n};",e._read=new Function(b.join(),w).apply(void 0,_)},R.prototype._match=function(e,t){var r,n,i,o,s,a=this.fields;for(r=0,n=a.length;r"},e.exports={Type:g,getTypeBucket:W,getValueBucket:Y,isPrimitive:$,builtins:function(){var e,t,r,n={LogicalType:L,UnwrappedUnionType:k,WrappedUnionType:T},i=Object.keys(l);for(e=0,t=i.length;e{"use strict";var n=r(48287),i=r(78505),o=r(40537),s=n.Buffer,a=new d(4096),u=/^[A-Za-z_][A-Za-z0-9_]*$/,c=o.format;function f(e){return"function"==typeof s.alloc?s.alloc(e):new s(e)}function l(e,t){return"function"==typeof s.from?s.from(e,t):new s(e,t)}function h(e){return e.charAt(0).toUpperCase()+e.slice(1)}function p(e){return u.test(e)}function d(e){this._len=0|e,this._pos=0,this._slab=f(this._len)}function y(e){var t=Math.pow(2,31),r=Math.floor(e||Math.random()*(t-1));this._max=t,this._nextInt=function(){return r=(1103515245*r+12345)%t}}function g(){this._index=0,this._items=[]}function m(e,t){if(this.buf=e,this.pos=0|t,this.pos<0)throw new Error("negative offset")}function v(e,t){for(;t--;)e[t]=~e[t]}d.prototype.alloc=function(e){if(e<0)throw new Error("negative length");var t=this._len;return e>t?f(e):(this._pos+e>t&&(this._slab=f(t),this._pos=0),this._slab.slice(this._pos,this._pos+=e))},y.prototype.nextBoolean=function(){return!!(this._nextInt()%2)},y.prototype.nextInt=function(e,t){return void 0===t&&(t=e,e=0),t=void 0===t?this._max:t,e+Math.floor(this.nextFloat()*(t-e))},y.prototype.nextFloat=function(e,t){return void 0===t&&(t=e,e=0),e+((t=void 0===t?1:t)-e)*this._nextInt()/this._max},y.prototype.nextString=function(e,t){e|=0;var r="";(t=t||"aA").indexOf("a")>-1&&(r+="abcdefghijklmnopqrstuvwxyz"),t.indexOf("A")>-1&&(r+="ABCDEFGHIJKLMNOPQRSTUVWXYZ"),t.indexOf("#")>-1&&(r+="0123456789"),t.indexOf("!")>-1&&(r+="~`!@#$%^&*()_+-={}[]:\";'<>?,./|\\");for(var n=[],i=0;i0&&r[n].index>1].index;)e=r[n],r[n]=r[t],r[t]=e,n=t},g.prototype.pop=function(){var e=this._items,t=e.length-1|0,r=e[0];if(!r||r.index>this._index)return null;if(this._index++,!t)return e.pop(),r;e[0]=e.pop();for(var n,i,o,s,a,u,c,f=t>>1,l=0;l=s.index));)e[o]=s,e[l]=a,l=o;return r},m.prototype.isValid=function(){return this.pos<=this.buf.length},m.prototype._invalidate=function(){this.pos=this.buf.length+1},m.prototype.readBoolean=function(){return!!this.buf[this.pos++]},m.prototype.skipBoolean=function(){this.pos++},m.prototype.writeBoolean=function(e){this.buf[this.pos++]=!!e},m.prototype.readInt=m.prototype.readLong=function(){var e,t,r,n,i=0,o=0,s=this.buf;do{t=128&(e=s[this.pos++]),i|=(127&e)<>1^-(1&i)},m.prototype.skipInt=m.prototype.skipLong=function(){for(var e=this.buf;128&e[this.pos++];);},m.prototype.writeInt=m.prototype.writeLong=function(e){var t,r,n=this.buf;if(e>=-1073741824&&e<1073741824){r=e>=0?e<<1:~e<<1|1;do{n[this.pos]=127&r,r>>=7}while(r&&(n[this.pos++]|=128))}else{t=e>=0?2*e:2*-e-1;do{n[this.pos]=127&t,t/=128}while(t>=1&&(n[this.pos++]|=128))}this.pos++},m.prototype.readFloat=function(){var e=this.buf,t=this.pos;return this.pos+=4,this.pos>e.length?0:this.buf.readFloatLE(t)},m.prototype.skipFloat=function(){this.pos+=4},m.prototype.writeFloat=function(e){var t=this.buf,r=this.pos;if(this.pos+=4,!(this.pos>t.length))return this.buf.writeFloatLE(e,r)},m.prototype.readDouble=function(){var e=this.buf,t=this.pos;return this.pos+=8,this.pos>e.length?0:this.buf.readDoubleLE(t)},m.prototype.skipDouble=function(){this.pos+=8},m.prototype.writeDouble=function(e){var t=this.buf,r=this.pos;if(this.pos+=8,!(this.pos>t.length))return this.buf.writeDoubleLE(e,r)},m.prototype.readFixed=function(e){var t=this.pos;if(this.pos+=e,!(this.pos>this.buf.length)){var r=a.alloc(e);return this.buf.copy(r,0,t,t+e),r}},m.prototype.skipFixed=function(e){this.pos+=e},m.prototype.writeFixed=function(e,t){t=t||e.length;var r=this.pos;this.pos+=t,this.pos>this.buf.length||e.copy(this.buf,r,0,t)},m.prototype.readBytes=function(){var e=this.readLong();if(!(e<0))return this.readFixed(e);this._invalidate()},m.prototype.skipBytes=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeBytes=function(e){var t=e.length;this.writeLong(t),this.writeFixed(e,t)},"function"==typeof s.prototype.utf8Slice?m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.utf8Slice(t,t+e)}:m.prototype.readString=function(){var e=this.readLong();if(e<0)return this._invalidate(),"";var t=this.pos,r=this.buf;return this.pos+=e,this.pos>r.length?void 0:this.buf.slice(t,t+e).toString()},m.prototype.skipString=function(){var e=this.readLong();e<0?this._invalidate():this.pos+=e},m.prototype.writeString=function(e){var t=s.byteLength(e),r=this.buf;this.writeLong(t);var n,i,o,a,u=this.pos;if(this.pos+=t,!(this.pos>r.length))if(t>64&&"function"==typeof s.prototype.utf8Write)r.utf8Write(e,u,t);else for(n=0,i=t;n>6|192,r[u++]=63&o|128):55296==(64512&o)&&56320==(64512&(a=e.charCodeAt(n+1)))?(o=65536+((1023&o)<<10)+(1023&a),n++,r[u++]=o>>18|240,r[u++]=o>>12&63|128,r[u++]=o>>6&63|128,r[u++]=63&o|128):(r[u++]=o>>12|224,r[u++]=o>>6&63|128,r[u++]=63&o|128)},"function"==typeof s.prototype.latin1Write?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.latin1Write(e,r,t)}:"function"==typeof s.prototype.binaryWrite?m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.binaryWrite(e,r,t)}:m.prototype.writeBinary=function(e,t){var r=this.pos;this.pos+=t,this.pos>this.buf.length||this.buf.write(e,r,t,"binary")},m.prototype.matchBoolean=function(e){return this.buf[this.pos++]-e.buf[e.pos++]},m.prototype.matchInt=m.prototype.matchLong=function(e){var t=this.readLong(),r=e.readLong();return t===r?0:t>1;128&e;)n|=(127&(e=s[this.pos++]))<=8&&(o-=8,r[i++]=n,n>>=8);return r[i]=n,t&&v(r,8),r},m.prototype.packLongBytes=function(e){var t,r=(128&e[7])>>7,n=this.buf,i=1,o=0,s=3;r?(v(e,8),t=1):t=0;for(var a=[e.readUIntLE(0,3),e.readUIntLE(3,3),e.readUIntLE(6,2)];s&&!a[--s];);for(;o7;)n[this.pos++]=127&t|128,t>>=7,i-=7;t|=a[s]<>=7}while(t&&(n[this.pos++]|=128));this.pos++,r&&v(e,8)},e.exports={abstractFunction:function(){throw new Error("abstract")},addDeprecatedGetters:function(e,t){var r,n,i,s,a=e.prototype;for(r=0,n=t.length;r=0)return-2;i=r}return i},hasDuplicates:function(e,t){var r,n,i,o=Object.create(null);for(r=0,n=e.length;r{"use strict";t.byteLength=function(e){var t=a(e),r=t[0],n=t[1];return 3*(r+n)/4-n},t.toByteArray=function(e){var t,r,o=a(e),s=o[0],u=o[1],c=new i(function(e,t,r){return 3*(t+r)/4-r}(0,s,u)),f=0,l=u>0?s-4:s;for(r=0;r>16&255,c[f++]=t>>8&255,c[f++]=255&t;return 2===u&&(t=n[e.charCodeAt(r)]<<2|n[e.charCodeAt(r+1)]>>4,c[f++]=255&t),1===u&&(t=n[e.charCodeAt(r)]<<10|n[e.charCodeAt(r+1)]<<4|n[e.charCodeAt(r+2)]>>2,c[f++]=t>>8&255,c[f++]=255&t),c},t.fromByteArray=function(e){for(var t,n=e.length,i=n%3,o=[],s=16383,a=0,c=n-i;ac?c:a+s));return 1===i?(t=e[n-1],o.push(r[t>>2]+r[t<<4&63]+"==")):2===i&&(t=(e[n-2]<<8)+e[n-1],o.push(r[t>>10]+r[t>>4&63]+r[t<<2&63]+"=")),o.join("")};for(var r=[],n=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0;s<64;++s)r[s]=o[s],n[o.charCodeAt(s)]=s;function a(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function u(e,t,n){for(var i,o,s=[],a=t;a>18&63]+r[o>>12&63]+r[o>>6&63]+r[63&o]);return s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},5974:(e,t,r)=>{"use strict";var n=r(48287).Buffer,i=r(65606),o=r(34529),s=r(44442),a=r(58411),u=r(71447),c=r(19681);for(var f in c)t[f]=c[f];function l(e){if("number"!=typeof e||et.UNZIP)throw new TypeError("Bad argument");this.dictionary=null,this.err=0,this.flush=0,this.init_done=!1,this.level=0,this.memLevel=0,this.mode=e,this.strategy=0,this.windowBits=0,this.write_in_progress=!1,this.pending_close=!1,this.gzip_id_bytes_read=0}t.NONE=0,t.DEFLATE=1,t.INFLATE=2,t.GZIP=3,t.GUNZIP=4,t.DEFLATERAW=5,t.INFLATERAW=6,t.UNZIP=7,l.prototype.close=function(){this.write_in_progress?this.pending_close=!0:(this.pending_close=!1,o(this.init_done,"close before init"),o(this.mode<=t.UNZIP),this.mode===t.DEFLATE||this.mode===t.GZIP||this.mode===t.DEFLATERAW?a.deflateEnd(this.strm):this.mode!==t.INFLATE&&this.mode!==t.GUNZIP&&this.mode!==t.INFLATERAW&&this.mode!==t.UNZIP||u.inflateEnd(this.strm),this.mode=t.NONE,this.dictionary=null)},l.prototype.write=function(e,t,r,n,i,o,s){return this._write(!0,e,t,r,n,i,o,s)},l.prototype.writeSync=function(e,t,r,n,i,o,s){return this._write(!1,e,t,r,n,i,o,s)},l.prototype._write=function(e,r,s,a,u,c,f,l){if(o.equal(arguments.length,8),o(this.init_done,"write before init"),o(this.mode!==t.NONE,"already finalized"),o.equal(!1,this.write_in_progress,"write already in progress"),o.equal(!1,this.pending_close,"close is pending"),this.write_in_progress=!0,o.equal(!1,void 0===r,"must provide flush value"),this.write_in_progress=!0,r!==t.Z_NO_FLUSH&&r!==t.Z_PARTIAL_FLUSH&&r!==t.Z_SYNC_FLUSH&&r!==t.Z_FULL_FLUSH&&r!==t.Z_FINISH&&r!==t.Z_BLOCK)throw new Error("Invalid flush value");if(null==s&&(s=n.alloc(0),u=0,a=0),this.strm.avail_in=u,this.strm.input=s,this.strm.next_in=a,this.strm.avail_out=l,this.strm.output=c,this.strm.next_out=f,this.flush=r,!e)return this._process(),this._checkError()?this._afterSync():void 0;var h=this;return i.nextTick((function(){h._process(),h._after()})),this},l.prototype._afterSync=function(){var e=this.strm.avail_out,t=this.strm.avail_in;return this.write_in_progress=!1,[t,e]},l.prototype._process=function(){var e=null;switch(this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflate(this.strm,this.flush);break;case t.UNZIP:switch(this.strm.avail_in>0&&(e=this.strm.next_in),this.gzip_id_bytes_read){case 0:if(null===e)break;if(31!==this.strm.input[e]){this.mode=t.INFLATE;break}if(this.gzip_id_bytes_read=1,e++,1===this.strm.avail_in)break;case 1:if(null===e)break;139===this.strm.input[e]?(this.gzip_id_bytes_read=2,this.mode=t.GUNZIP):this.mode=t.INFLATE;break;default:throw new Error("invalid number of gzip magic number bytes read")}case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:for(this.err=u.inflate(this.strm,this.flush),this.err===t.Z_NEED_DICT&&this.dictionary&&(this.err=u.inflateSetDictionary(this.strm,this.dictionary),this.err===t.Z_OK?this.err=u.inflate(this.strm,this.flush):this.err===t.Z_DATA_ERROR&&(this.err=t.Z_NEED_DICT));this.strm.avail_in>0&&this.mode===t.GUNZIP&&this.err===t.Z_STREAM_END&&0!==this.strm.next_in[0];)this.reset(),this.err=u.inflate(this.strm,this.flush);break;default:throw new Error("Unknown mode "+this.mode)}},l.prototype._checkError=function(){switch(this.err){case t.Z_OK:case t.Z_BUF_ERROR:if(0!==this.strm.avail_out&&this.flush===t.Z_FINISH)return this._error("unexpected end of file"),!1;break;case t.Z_STREAM_END:break;case t.Z_NEED_DICT:return null==this.dictionary?this._error("Missing dictionary"):this._error("Bad dictionary"),!1;default:return this._error("Zlib error"),!1}return!0},l.prototype._after=function(){if(this._checkError()){var e=this.strm.avail_out,t=this.strm.avail_in;this.write_in_progress=!1,this.callback(t,e),this.pending_close&&this.close()}},l.prototype._error=function(e){this.strm.msg&&(e=this.strm.msg),this.onerror(e,this.err),this.write_in_progress=!1,this.pending_close&&this.close()},l.prototype.init=function(e,r,n,i,s){o(4===arguments.length||5===arguments.length,"init(windowBits, level, memLevel, strategy, [dictionary])"),o(e>=8&&e<=15,"invalid windowBits"),o(r>=-1&&r<=9,"invalid compression level"),o(n>=1&&n<=9,"invalid memlevel"),o(i===t.Z_FILTERED||i===t.Z_HUFFMAN_ONLY||i===t.Z_RLE||i===t.Z_FIXED||i===t.Z_DEFAULT_STRATEGY,"invalid strategy"),this._init(r,e,n,i,s),this._setDictionary()},l.prototype.params=function(){throw new Error("deflateParams Not supported")},l.prototype.reset=function(){this._reset(),this._setDictionary()},l.prototype._init=function(e,r,n,i,o){switch(this.level=e,this.windowBits=r,this.memLevel=n,this.strategy=i,this.flush=t.Z_NO_FLUSH,this.err=t.Z_OK,this.mode!==t.GZIP&&this.mode!==t.GUNZIP||(this.windowBits+=16),this.mode===t.UNZIP&&(this.windowBits+=32),this.mode!==t.DEFLATERAW&&this.mode!==t.INFLATERAW||(this.windowBits=-1*this.windowBits),this.strm=new s,this.mode){case t.DEFLATE:case t.GZIP:case t.DEFLATERAW:this.err=a.deflateInit2(this.strm,this.level,t.Z_DEFLATED,this.windowBits,this.memLevel,this.strategy);break;case t.INFLATE:case t.GUNZIP:case t.INFLATERAW:case t.UNZIP:this.err=u.inflateInit2(this.strm,this.windowBits);break;default:throw new Error("Unknown mode "+this.mode)}this.err!==t.Z_OK&&this._error("Init error"),this.dictionary=o,this.write_in_progress=!1,this.init_done=!0},l.prototype._setDictionary=function(){if(null!=this.dictionary){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:this.err=a.deflateSetDictionary(this.strm,this.dictionary)}this.err!==t.Z_OK&&this._error("Failed to set dictionary")}},l.prototype._reset=function(){switch(this.err=t.Z_OK,this.mode){case t.DEFLATE:case t.DEFLATERAW:case t.GZIP:this.err=a.deflateReset(this.strm);break;case t.INFLATE:case t.INFLATERAW:case t.GUNZIP:this.err=u.inflateReset(this.strm)}this.err!==t.Z_OK&&this._error("Failed to reset stream")},t.Zlib=l},78559:(e,t,r)=>{"use strict";var n=r(65606),i=r(48287).Buffer,o=r(88310).Transform,s=r(5974),a=r(40537),u=r(34529).ok,c=r(48287).kMaxLength,f="Cannot create final Buffer. It would be larger than 0x"+c.toString(16)+" bytes";s.Z_MIN_WINDOWBITS=8,s.Z_MAX_WINDOWBITS=15,s.Z_DEFAULT_WINDOWBITS=15,s.Z_MIN_CHUNK=64,s.Z_MAX_CHUNK=1/0,s.Z_DEFAULT_CHUNK=16384,s.Z_MIN_MEMLEVEL=1,s.Z_MAX_MEMLEVEL=9,s.Z_DEFAULT_MEMLEVEL=8,s.Z_MIN_LEVEL=-1,s.Z_MAX_LEVEL=9,s.Z_DEFAULT_LEVEL=s.Z_DEFAULT_COMPRESSION;for(var l=Object.keys(s),h=0;h=c?s=new RangeError(f):t=i.concat(n,o),n=[],e.close(),r(s,t)}e.on("error",(function(t){e.removeListener("end",a),e.removeListener("readable",s),r(t)})),e.on("end",a),e.end(t),s()}function b(e,t){if("string"==typeof t&&(t=i.from(t)),!i.isBuffer(t))throw new TypeError("Not a string or buffer");var r=e._finishFlushFlag;return e._processChunk(t,r)}function _(e){if(!(this instanceof _))return new _(e);T.call(this,e,s.DEFLATE)}function w(e){if(!(this instanceof w))return new w(e);T.call(this,e,s.INFLATE)}function E(e){if(!(this instanceof E))return new E(e);T.call(this,e,s.GZIP)}function x(e){if(!(this instanceof x))return new x(e);T.call(this,e,s.GUNZIP)}function B(e){if(!(this instanceof B))return new B(e);T.call(this,e,s.DEFLATERAW)}function A(e){if(!(this instanceof A))return new A(e);T.call(this,e,s.INFLATERAW)}function S(e){if(!(this instanceof S))return new S(e);T.call(this,e,s.UNZIP)}function k(e){return e===s.Z_NO_FLUSH||e===s.Z_PARTIAL_FLUSH||e===s.Z_SYNC_FLUSH||e===s.Z_FULL_FLUSH||e===s.Z_FINISH||e===s.Z_BLOCK}function T(e,r){var n=this;if(this._opts=e=e||{},this._chunkSize=e.chunkSize||t.Z_DEFAULT_CHUNK,o.call(this,e),e.flush&&!k(e.flush))throw new Error("Invalid flush flag: "+e.flush);if(e.finishFlush&&!k(e.finishFlush))throw new Error("Invalid flush flag: "+e.finishFlush);if(this._flushFlag=e.flush||s.Z_NO_FLUSH,this._finishFlushFlag=void 0!==e.finishFlush?e.finishFlush:s.Z_FINISH,e.chunkSize&&(e.chunkSizet.Z_MAX_CHUNK))throw new Error("Invalid chunk size: "+e.chunkSize);if(e.windowBits&&(e.windowBitst.Z_MAX_WINDOWBITS))throw new Error("Invalid windowBits: "+e.windowBits);if(e.level&&(e.levelt.Z_MAX_LEVEL))throw new Error("Invalid compression level: "+e.level);if(e.memLevel&&(e.memLevelt.Z_MAX_MEMLEVEL))throw new Error("Invalid memLevel: "+e.memLevel);if(e.strategy&&e.strategy!=t.Z_FILTERED&&e.strategy!=t.Z_HUFFMAN_ONLY&&e.strategy!=t.Z_RLE&&e.strategy!=t.Z_FIXED&&e.strategy!=t.Z_DEFAULT_STRATEGY)throw new Error("Invalid strategy: "+e.strategy);if(e.dictionary&&!i.isBuffer(e.dictionary))throw new Error("Invalid dictionary: it should be a Buffer instance");this._handle=new s.Zlib(r);var a=this;this._hadError=!1,this._handle.onerror=function(e,r){O(a),a._hadError=!0;var n=new Error(e);n.errno=r,n.code=t.codes[r],a.emit("error",n)};var u=t.Z_DEFAULT_COMPRESSION;"number"==typeof e.level&&(u=e.level);var c=t.Z_DEFAULT_STRATEGY;"number"==typeof e.strategy&&(c=e.strategy),this._handle.init(e.windowBits||t.Z_DEFAULT_WINDOWBITS,u,e.memLevel||t.Z_DEFAULT_MEMLEVEL,c,e.dictionary),this._buffer=i.allocUnsafe(this._chunkSize),this._offset=0,this._level=u,this._strategy=c,this.once("end",this.close),Object.defineProperty(this,"_closed",{get:function(){return!n._handle},configurable:!0,enumerable:!0})}function O(e,t){t&&n.nextTick(t),e._handle&&(e._handle.close(),e._handle=null)}function I(e){e.emit("close")}Object.defineProperty(t,"codes",{enumerable:!0,value:Object.freeze(d),writable:!1}),t.Deflate=_,t.Inflate=w,t.Gzip=E,t.Gunzip=x,t.DeflateRaw=B,t.InflateRaw=A,t.Unzip=S,t.createDeflate=function(e){return new _(e)},t.createInflate=function(e){return new w(e)},t.createDeflateRaw=function(e){return new B(e)},t.createInflateRaw=function(e){return new A(e)},t.createGzip=function(e){return new E(e)},t.createGunzip=function(e){return new x(e)},t.createUnzip=function(e){return new S(e)},t.deflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new _(t),e,r)},t.deflateSync=function(e,t){return b(new _(t),e)},t.gzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new E(t),e,r)},t.gzipSync=function(e,t){return b(new E(t),e)},t.deflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new B(t),e,r)},t.deflateRawSync=function(e,t){return b(new B(t),e)},t.unzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new S(t),e,r)},t.unzipSync=function(e,t){return b(new S(t),e)},t.inflate=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new w(t),e,r)},t.inflateSync=function(e,t){return b(new w(t),e)},t.gunzip=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new x(t),e,r)},t.gunzipSync=function(e,t){return b(new x(t),e)},t.inflateRaw=function(e,t,r){return"function"==typeof t&&(r=t,t={}),v(new A(t),e,r)},t.inflateRawSync=function(e,t){return b(new A(t),e)},a.inherits(T,o),T.prototype.params=function(e,r,i){if(et.Z_MAX_LEVEL)throw new RangeError("Invalid compression level: "+e);if(r!=t.Z_FILTERED&&r!=t.Z_HUFFMAN_ONLY&&r!=t.Z_RLE&&r!=t.Z_FIXED&&r!=t.Z_DEFAULT_STRATEGY)throw new TypeError("Invalid strategy: "+r);if(this._level!==e||this._strategy!==r){var o=this;this.flush(s.Z_SYNC_FLUSH,(function(){u(o._handle,"zlib binding closed"),o._handle.params(e,r),o._hadError||(o._level=e,o._strategy=r,i&&i())}))}else n.nextTick(i)},T.prototype.reset=function(){return u(this._handle,"zlib binding closed"),this._handle.reset()},T.prototype._flush=function(e){this._transform(i.alloc(0),"",e)},T.prototype.flush=function(e,t){var r=this,o=this._writableState;("function"==typeof e||void 0===e&&!t)&&(t=e,e=s.Z_FULL_FLUSH),o.ended?t&&n.nextTick(t):o.ending?t&&this.once("end",t):o.needDrain?t&&this.once("drain",(function(){return r.flush(e,t)})):(this._flushFlag=e,this.write(i.alloc(0),"",t))},T.prototype.close=function(e){O(this,e),n.nextTick(I,this)},T.prototype._transform=function(e,t,r){var n,o=this._writableState,a=(o.ending||o.ended)&&(!e||o.length===e.length);return null===e||i.isBuffer(e)?this._handle?(a?n=this._finishFlushFlag:(n=this._flushFlag,e.length>=o.length&&(this._flushFlag=this._opts.flush||s.Z_NO_FLUSH)),void this._processChunk(e,n,r)):r(new Error("zlib binding closed")):r(new Error("invalid input"))},T.prototype._processChunk=function(e,t,r){var n=e&&e.length,o=this._chunkSize-this._offset,s=0,a=this,l="function"==typeof r;if(!l){var h,p=[],d=0;this.on("error",(function(e){h=e})),u(this._handle,"zlib binding closed");do{var y=this._handle.writeSync(t,e,s,n,this._buffer,this._offset,o)}while(!this._hadError&&v(y[0],y[1]));if(this._hadError)throw h;if(d>=c)throw O(this),new RangeError(f);var g=i.concat(p,d);return O(this),g}u(this._handle,"zlib binding closed");var m=this._handle.write(t,e,s,n,this._buffer,this._offset,o);function v(c,f){if(this&&(this.buffer=null,this.callback=null),!a._hadError){var h=o-f;if(u(h>=0,"have should not go down"),h>0){var y=a._buffer.slice(a._offset,a._offset+h);a._offset+=h,l?a.push(y):(p.push(y),d+=y.length)}if((0===f||a._offset>=a._chunkSize)&&(o=a._chunkSize,a._offset=0,a._buffer=i.allocUnsafe(a._chunkSize)),0===f){if(s+=n-c,n=c,!l)return!0;var g=a._handle.write(t,e,s,n,a._buffer,a._offset,a._chunkSize);return g.callback=v,void(g.buffer=e)}if(!l)return!1;r()}}m.buffer=e,m.callback=v},a.inherits(_,T),a.inherits(w,T),a.inherits(E,T),a.inherits(x,T),a.inherits(B,T),a.inherits(A,T),a.inherits(S,T)},48287:(e,t,r)=>{"use strict";const n=r(67526),i=r(251),o="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=u,t.SlowBuffer=function(e){return+e!=e&&(e=0),u.alloc(+e)},t.INSPECT_MAX_BYTES=50;const s=2147483647;function a(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');const t=new Uint8Array(e);return Object.setPrototypeOf(t,u.prototype),t}function u(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return l(e)}return c(e,t,r)}function c(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!u.isEncoding(t))throw new TypeError("Unknown encoding: "+t);const r=0|y(e,t);let n=a(r);const i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(W(e,Uint8Array)){const t=new Uint8Array(e);return p(t.buffer,t.byteOffset,t.byteLength)}return h(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if(W(e,ArrayBuffer)||e&&W(e.buffer,ArrayBuffer))return p(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(W(e,SharedArrayBuffer)||e&&W(e.buffer,SharedArrayBuffer)))return p(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return u.from(n,t,r);const i=function(e){if(u.isBuffer(e)){const t=0|d(e.length),r=a(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||Y(e.length)?a(0):h(e):"Buffer"===e.type&&Array.isArray(e.data)?h(e.data):void 0}(e);if(i)return i;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return u.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function f(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function l(e){return f(e),a(e<0?0:0|d(e))}function h(e){const t=e.length<0?0:0|d(e.length),r=a(t);for(let n=0;n=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function y(e,t){if(u.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||W(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);const r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let i=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(e).length;default:if(i)return n?-1:q(e).length;t=(""+t).toLowerCase(),i=!0}}function g(e,t,r){let n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return I(this,t,r);case"utf8":case"utf-8":return S(this,t,r);case"ascii":return T(this,t,r);case"latin1":case"binary":return O(this,t,r);case"base64":return A(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function m(e,t,r){const n=e[t];e[t]=e[r],e[r]=n}function v(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),Y(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=u.from(t,n)),u.isBuffer(t))return 0===t.length?-1:b(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):b(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function b(e,t,r,n,i){let o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){let n=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){let r=!0;for(let n=0;ni&&(n=i):n=i;const o=t.length;let s;for(n>o/2&&(n=o/2),s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function A(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function S(e,t,r){r=Math.min(e.length,r);const n=[];let i=t;for(;i239?4:t>223?3:t>191?2:1;if(i+s<=r){let r,n,a,u;switch(s){case 1:t<128&&(o=t);break;case 2:r=e[i+1],128==(192&r)&&(u=(31&t)<<6|63&r,u>127&&(o=u));break;case 3:r=e[i+1],n=e[i+2],128==(192&r)&&128==(192&n)&&(u=(15&t)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(o=u));break;case 4:r=e[i+1],n=e[i+2],a=e[i+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&t)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(o=u))}}null===o?(o=65533,s=1):o>65535&&(o-=65536,n.push(o>>>10&1023|55296),o=56320|1023&o),n.push(o),i+=s}return function(e){const t=e.length;if(t<=k)return String.fromCharCode.apply(String,e);let r="",n=0;for(;nn.length?(u.isBuffer(t)||(t=u.from(t)),t.copy(n,i)):Uint8Array.prototype.set.call(n,t,i);else{if(!u.isBuffer(t))throw new TypeError('"list" argument must be an Array of Buffers');t.copy(n,i)}i+=t.length}return n},u.byteLength=y,u.prototype._isBuffer=!0,u.prototype.swap16=function(){const e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let t=0;tr&&(e+=" ... "),""},o&&(u.prototype[o]=u.prototype.inspect),u.prototype.compare=function(e,t,r,n,i){if(W(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 '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;let o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0);const a=Math.min(o,s),c=this.slice(n,i),f=e.slice(t,r);for(let e=0;e>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let o=!1;for(;;)switch(n){case"hex":return _(this,e,t,r);case"utf8":case"utf-8":return w(this,e,t,r);case"ascii":case"latin1":case"binary":return E(this,e,t,r);case"base64":return x(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},u.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const k=4096;function T(e,t,r){let n="";r=Math.min(e.length,r);for(let i=t;in)&&(r=n);let i="";for(let n=t;nr)throw new RangeError("Trying to access beyond buffer length")}function R(e,t,r,n,i,o){if(!u.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function L(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o,o>>=8,e[r++]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,s>>=8,e[r++]=s,r}function U(e,t,r,n,i){$(t,n,i,e,r,7);let o=Number(t&BigInt(4294967295));e[r+7]=o,o>>=8,e[r+6]=o,o>>=8,e[r+5]=o,o>>=8,e[r+4]=o;let s=Number(t>>BigInt(32)&BigInt(4294967295));return e[r+3]=s,s>>=8,e[r+2]=s,s>>=8,e[r+1]=s,s>>=8,e[r]=s,r+8}function C(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function j(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,4),i.write(e,t,r,n,23,4),r+4}function D(e,t,r,n,o){return t=+t,r>>>=0,o||C(e,0,r,8),i.write(e,t,r,n,52,8),r+8}u.prototype.slice=function(e,t){const r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e+--t],i=1;for(;t>0&&(i*=256);)n+=this[e+--t]*i;return n},u.prototype.readUint8=u.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},u.prototype.readUint16LE=u.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},u.prototype.readUint16BE=u.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},u.prototype.readUint32LE=u.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},u.prototype.readUint32BE=u.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},u.prototype.readBigUInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t+256*this[++e]+65536*this[++e]+this[++e]*2**24,i=this[++e]+256*this[++e]+65536*this[++e]+r*2**24;return BigInt(n)+(BigInt(i)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=t*2**24+65536*this[++e]+256*this[++e]+this[++e],i=this[++e]*2**24+65536*this[++e]+256*this[++e]+r;return(BigInt(n)<>>=0,t>>>=0,r||F(e,t,this.length);let n=this[e],i=1,o=0;for(;++o=i&&(n-=Math.pow(2,8*t)),n},u.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);let n=t,i=1,o=this[e+--n];for(;n>0&&(i*=256);)o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},u.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},u.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);const r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},u.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},u.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},u.prototype.readBigInt64LE=X((function(e){H(e>>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=this[e+4]+256*this[e+5]+65536*this[e+6]+(r<<24);return(BigInt(n)<>>=0,"offset");const t=this[e],r=this[e+7];void 0!==t&&void 0!==r||V(e,this.length-8);const n=(t<<24)+65536*this[++e]+256*this[++e]+this[++e];return(BigInt(n)<>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},u.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},u.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},u.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},u.prototype.writeUintLE=u.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||R(this,e,t,r,Math.pow(2,8*r)-1,0);let i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},u.prototype.writeUint8=u.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,255,0),this[t]=255&e,t+1},u.prototype.writeUint16LE=u.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeUint16BE=u.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeUint32LE=u.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},u.prototype.writeUint32BE=u.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigUInt64LE=X((function(e,t=0){return L(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeBigUInt64BE=X((function(e,t=0){return U(this,e,t,BigInt(0),BigInt("0xffffffffffffffff"))})),u.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=0,o=1,s=0;for(this[t]=255&e;++i>>=0,!n){const n=Math.pow(2,8*r-1);R(this,e,t,r,n-1,-n)}let i=r-1,o=1,s=0;for(this[t+i]=255&e;--i>=0&&(o*=256);)e<0&&0===s&&0!==this[t+i+1]&&(s=1),this[t+i]=(e/o|0)-s&255;return t+r},u.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},u.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},u.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},u.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},u.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||R(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},u.prototype.writeBigInt64LE=X((function(e,t=0){return L(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeBigInt64BE=X((function(e,t=0){return U(this,e,t,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))})),u.prototype.writeFloatLE=function(e,t,r){return j(this,e,t,!0,r)},u.prototype.writeFloatBE=function(e,t,r){return j(this,e,t,!1,r)},u.prototype.writeDoubleLE=function(e,t,r){return D(this,e,t,!0,r)},u.prototype.writeDoubleBE=function(e,t,r){return D(this,e,t,!1,r)},u.prototype.copy=function(e,t,r,n){if(!u.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(i=t;i=n+4;r-=3)t=`_${e.slice(r-3,r)}${t}`;return`${e.slice(0,r)}${t}`}function $(e,t,r,n,i,o){if(e>r||e3?0===t||t===BigInt(0)?`>= 0${n} and < 2${n} ** ${8*(o+1)}${n}`:`>= -(2${n} ** ${8*(o+1)-1}${n}) and < 2 ** ${8*(o+1)-1}${n}`:`>= ${t}${n} and <= ${r}${n}`,new M.ERR_OUT_OF_RANGE("value",i,e)}!function(e,t,r){H(t,"offset"),void 0!==e[t]&&void 0!==e[t+r]||V(t,e.length-(r+1))}(n,i,o)}function H(e,t){if("number"!=typeof e)throw new M.ERR_INVALID_ARG_TYPE(t,"number",e)}function V(e,t,r){if(Math.floor(e)!==e)throw H(e,r),new M.ERR_OUT_OF_RANGE(r||"offset","an integer",e);if(t<0)throw new M.ERR_BUFFER_OUT_OF_BOUNDS;throw new M.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${t}`,e)}P("ERR_BUFFER_OUT_OF_BOUNDS",(function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"}),RangeError),P("ERR_INVALID_ARG_TYPE",(function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`}),TypeError),P("ERR_OUT_OF_RANGE",(function(e,t,r){let n=`The value of "${e}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>2**32?i=z(String(r)):"bigint"==typeof r&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=z(i)),i+="n"),n+=` It must be ${t}. Received ${i}`,n}),RangeError);const Z=/[^+/0-9A-Za-z-_]/g;function q(e,t){let r;t=t||1/0;const n=e.length;let i=null;const o=[];for(let s=0;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function G(e){return n.toByteArray(function(e){if((e=(e=e.split("=")[0]).trim().replace(Z,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function J(e,t,r,n){let i;for(i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function W(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function Y(e){return e!=e}const K=function(){const e="0123456789abcdef",t=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let i=0;i<16;++i)t[n+i]=e[r]+e[i]}return t}();function X(e){return"undefined"==typeof BigInt?Q:e}function Q(){throw new Error("BigInt not supported")}},49881:(e,t,r)=>{"use strict";const n=r(20893),i=r(79777),o=r(93737),s=r(72893),a=r(15059),u=r(53557),c=r(82903),f=r(207);e.exports={Commented:n,Diagnose:i,Decoder:o,Encoder:s,Simple:a,Tagged:u,Map:c,SharedValueEncoder:f,comment:n.comment,decodeAll:o.decodeAll,decodeFirst:o.decodeFirst,decodeAllSync:o.decodeAllSync,decodeFirstSync:o.decodeFirstSync,diagnose:i.diagnose,encode:s.encode,encodeCanonical:s.encodeCanonical,encodeOne:s.encodeOne,encodeAsync:s.encodeAsync,decode:o.decodeFirstSync,leveldb:{decode:o.decodeFirstSync,encode:s.encode,buffer:!0,name:"cbor"},reset(){s.reset(),u.reset()}}},20893:(e,t,r)=>{"use strict";const n=r(88310),i=r(27328),o=r(93737),s=r(5256),{MT:a,NUMBYTES:u,SYMS:c}=r(79452),{Buffer:f}=r(48287);function l(e){return e>1?"s":""}class h extends n.Transform{constructor(e={}){const{depth:t=1,max_depth:r=10,no_summary:n=!1,tags:i={},preferWeb:a,encoding:u,...c}=e;super({...c,readableObjectMode:!1,writableObjectMode:!1}),this.depth=t,this.max_depth=r,this.all=new s,i[24]||(i[24]=this._tag_24.bind(this)),this.parser=new o({tags:i,max_depth:r,preferWeb:a,encoding:u}),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("start-string",this._on_start_string.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("error",this._on_error.bind(this)),n||this.parser.on("data",this._on_data.bind(this)),this.parser.bs.on("read",this._on_read.bind(this))}_tag_24(e){const t=new h({depth:this.depth+1,no_summary:!0});t.on("data",(e=>this.push(e))),t.on("error",(e=>this.emit("error",e))),t.end(e)}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){return this.parser._flush(e)}static comment(e,t={},r=null){if(null==e)throw new Error("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"number":return{options:{max_depth:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const n=new s,{encoding:o="hex",...a}=t,u=new h(a);let c=null;return"function"==typeof r?(u.on("end",(()=>{r(null,n.toString("utf8"))})),u.on("error",r)):c=new Promise(((e,t)=>{u.on("end",(()=>{e(n.toString("utf8"))})),u.on("error",t)})),u.pipe(n),i.guessEncoding(e,o).pipe(u),c}_on_error(e){this.push("ERROR: "),this.push(e.toString()),this.push("\n")}_on_read(e){this.all.write(e);const t=e.toString("hex");this.push(new Array(this.depth+1).join(" ")),this.push(t);let r=2*(this.max_depth-this.depth)-t.length;r<1&&(r=1),this.push(new Array(r+1).join(" ")),this.push("-- ")}_on_more(e,t,r,n){let i="";switch(this.depth++,e){case a.POS_INT:i="Positive number,";break;case a.NEG_INT:i="Negative number,";break;case a.ARRAY:i="Array, length";break;case a.MAP:i="Map, count";break;case a.BYTE_STRING:i="Bytes, length";break;case a.UTF8_STRING:i="String, length";break;case a.SIMPLE_FLOAT:i=1===t?"Simple value,":"Float,"}this.push(`${i} next ${t} byte${l(t)}\n`)}_on_start_string(e,t,r,n){let i="";switch(this.depth++,e){case a.BYTE_STRING:i=`Bytes, length: ${t}`;break;case a.UTF8_STRING:i=`String, length: ${t.toString()}`}this.push(`${i}\n`)}_on_start(e,t,r,n){switch(this.depth++,r){case a.ARRAY:this.push(`[${n}], `);break;case a.MAP:n%2?this.push(`{Val:${Math.floor(n/2)}}, `):this.push(`{Key:${Math.floor(n/2)}}, `)}switch(e){case a.TAG:this.push(`Tag #${t}`),24===t&&this.push(" Encoded CBOR data item");break;case a.ARRAY:t===c.STREAM?this.push("Array (streaming)"):this.push(`Array, ${t} item${l(t)}`);break;case a.MAP:t===c.STREAM?this.push("Map (streaming)"):this.push(`Map, ${t} pair${l(t)}`);break;case a.BYTE_STRING:this.push("Bytes (streaming)");break;case a.UTF8_STRING:this.push("String (streaming)")}this.push("\n")}_on_stop(e){this.depth--}_on_value(e,t,r,n){if(e!==c.BREAK)switch(t){case a.ARRAY:this.push(`[${r}], `);break;case a.MAP:r%2?this.push(`{Val:${Math.floor(r/2)}}, `):this.push(`{Key:${Math.floor(r/2)}}, `)}const o=i.cborValueToString(e,-1/0);switch("string"==typeof e||f.isBuffer(e)?(e.length>0&&(this.push(o),this.push("\n")),this.depth--):(this.push(o),this.push("\n")),n){case u.ONE:case u.TWO:case u.FOUR:case u.EIGHT:this.depth--}}_on_data(){this.push("0x"),this.push(this.all.read().toString("hex")),this.push("\n")}}e.exports=h},79452:(e,t)=>{"use strict";t.MT={POS_INT:0,NEG_INT:1,BYTE_STRING:2,UTF8_STRING:3,ARRAY:4,MAP:5,TAG:6,SIMPLE_FLOAT:7},t.TAG={DATE_STRING:0,DATE_EPOCH:1,POS_BIGINT:2,NEG_BIGINT:3,DECIMAL_FRAC:4,BIGFLOAT:5,BASE64URL_EXPECTED:21,BASE64_EXPECTED:22,BASE16_EXPECTED:23,CBOR:24,URI:32,BASE64URL:33,BASE64:34,REGEXP:35,MIME:36,SET:258},t.NUMBYTES={ZERO:0,ONE:24,TWO:25,FOUR:26,EIGHT:27,INDEFINITE:31},t.SIMPLE={FALSE:20,TRUE:21,NULL:22,UNDEFINED:23},t.SYMS={NULL:Symbol.for("github.com/hildjj/node-cbor/null"),UNDEFINED:Symbol.for("github.com/hildjj/node-cbor/undef"),PARENT:Symbol.for("github.com/hildjj/node-cbor/parent"),BREAK:Symbol.for("github.com/hildjj/node-cbor/break"),STREAM:Symbol.for("github.com/hildjj/node-cbor/stream")},t.SHIFT32=4294967296,t.BI={MINUS_ONE:BigInt(-1),NEG_MAX:BigInt(-1)-BigInt(Number.MAX_SAFE_INTEGER),MAXINT32:BigInt("0xffffffff"),MAXINT64:BigInt("0xffffffffffffffff"),SHIFT32:BigInt(t.SHIFT32)}},93737:(e,t,r)=>{"use strict";const n=r(54957),i=r(53557),o=r(15059),s=r(27328),a=r(5256),u=(r(88310),r(79452)),{MT:c,NUMBYTES:f,SYMS:l,BI:h}=u,{Buffer:p}=r(48287),d=Symbol("count"),y=Symbol("major type"),g=Symbol("error"),m=Symbol("not found");function v(e,t,r){const n=[];return n[d]=r,n[l.PARENT]=e,n[y]=t,n}function b(e,t){const r=new a;return r[d]=-1,r[l.PARENT]=e,r[y]=t,r}class _ extends Error{constructor(e,t){super(`Unexpected data: 0x${e.toString(16)}`),this.name="UnexpectedDataError",this.byte=e,this.value=t}}function w(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}class E extends n{constructor(e={}){const{tags:t={},max_depth:r=-1,preferMap:n=!1,preferWeb:i=!1,required:o=!1,encoding:s="hex",extendedResults:u=!1,preventDuplicateKeys:c=!1,...f}=e;super({defaultEncoding:s,...f}),this.running=!0,this.max_depth=r,this.tags=t,this.preferMap=n,this.preferWeb=i,this.extendedResults=u,this.required=o,this.preventDuplicateKeys=c,u&&(this.bs.on("read",this._onRead.bind(this)),this.valueBytes=new a)}static nullcheck(e){switch(e){case l.NULL:return null;case l.UNDEFINED:return;case m:throw new Error("Value not found");default:return e}}static decodeFirstSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=i._parse();let u=a.next();for(;!u.done;){const e=o.read(u.value);if(null==e||e.length!==u.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(e),u=a.next(e)}let c=null;if(i.extendedResults)c=u.value,c.unused=o.read();else if(c=E.nullcheck(u.value),o.length>0){const e=o.read(1);throw o.unshift(e),new _(e[0],c)}return c}static decodeAllSync(e,t={}){if(null==e)throw new TypeError("input required");({options:t}=w(t));const{encoding:r="hex",...n}=t,i=new E(n),o=s.guessEncoding(e,r),a=[];for(;o.length>0;){const e=i._parse();let t=e.next();for(;!t.done;){const r=o.read(t.value);if(null==r||r.length!==t.value)throw new Error("Insufficient data");i.extendedResults&&i.valueBytes.write(r),t=e.next(r)}a.push(E.nullcheck(t.value))}return a}static decodeFirst(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:n="hex",required:i=!1,...o}=t,a=new E(o);let u=m;const c=s.guessEncoding(e,n),f=new Promise(((e,t)=>{a.on("data",(e=>{u=E.nullcheck(e),a.close()})),a.once("error",(r=>a.extendedResults&&r instanceof _?(u.unused=a.bs.slice(),e(u)):(u!==m&&(r.value=u),u=g,a.close(),t(r)))),a.once("end",(()=>{switch(u){case m:return i?t(new Error("No CBOR found")):e(u);case g:return;default:return e(u)}}))}));return"function"==typeof r&&f.then((e=>r(null,e)),r),c.pipe(a),f}static decodeAll(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=w(t,r));const{encoding:n="hex",...i}=t,o=new E(i),a=[];o.on("data",(e=>a.push(E.nullcheck(e))));const u=new Promise(((e,t)=>{o.on("error",t),o.on("end",(()=>e(a)))}));return"function"==typeof r&&u.then((e=>r(void 0,e)),(e=>r(e,void 0))),s.guessEncoding(e,n).pipe(o),u}close(){this.running=!1,this.__fresh=!0}_onRead(e){this.valueBytes.write(e)}*_parse(){let e=null,t=0,r=null;for(;;){if(this.max_depth>=0&&t>this.max_depth)throw new Error(`Maximum depth ${this.max_depth} exceeded`);const[n]=yield 1;if(!this.running)throw this.bs.unshift(p.from([n])),new _(n);const u=n>>5,g=31&n,m=null==e?void 0:e[y],w=null==e?void 0:e.length;switch(g){case f.ONE:this.emit("more-bytes",u,1,m,w),[r]=yield 1;break;case f.TWO:case f.FOUR:case f.EIGHT:{const e=1<{"use strict";const n=r(88310),i=r(93737),o=r(27328),s=r(5256),{MT:a,SYMS:u}=r(79452);class c extends n.Transform{constructor(e={}){const{separator:t="\n",stream_errors:r=!1,tags:n,max_depth:o,preferWeb:s,encoding:a,...u}=e;super({...u,readableObjectMode:!1,writableObjectMode:!1}),this.float_bytes=-1,this.separator=t,this.stream_errors=r,this.parser=new i({tags:n,max_depth:o,preferWeb:s,encoding:a}),this.parser.on("more-bytes",this._on_more.bind(this)),this.parser.on("value",this._on_value.bind(this)),this.parser.on("start",this._on_start.bind(this)),this.parser.on("stop",this._on_stop.bind(this)),this.parser.on("data",this._on_data.bind(this)),this.parser.on("error",this._on_error.bind(this))}_transform(e,t,r){this.parser.write(e,t,r)}_flush(e){this.parser._flush((t=>this.stream_errors?(t&&this._on_error(t),e()):e(t)))}static diagnose(e,t={},r=null){if(null==e)throw new TypeError("input required");({options:t,cb:r}=function(e,t){switch(typeof e){case"function":return{options:{},cb:e};case"string":return{options:{encoding:e},cb:t};case"object":return{options:e||{},cb:t};default:throw new TypeError("Unknown option type")}}(t,r));const{encoding:n="hex",...i}=t,a=new s,u=new c(i);let f=null;return"function"==typeof r?(u.on("end",(()=>r(null,a.toString("utf8")))),u.on("error",r)):f=new Promise(((e,t)=>{u.on("end",(()=>e(a.toString("utf8")))),u.on("error",t)})),u.pipe(a),o.guessEncoding(e,n).pipe(u),f}_on_error(e){this.stream_errors?this.push(e.toString()):this.emit("error",e)}_on_more(e,t,r,n){e===a.SIMPLE_FLOAT&&(this.float_bytes={2:1,4:2,8:3}[t])}_fore(e,t){switch(e){case a.BYTE_STRING:case a.UTF8_STRING:case a.ARRAY:t>0&&this.push(", ");break;case a.MAP:t>0&&(t%2?this.push(": "):this.push(", "))}}_on_value(e,t,r){if(e===u.BREAK)return;this._fore(t,r);const n=this.float_bytes;this.float_bytes=-1,this.push(o.cborValueToString(e,n))}_on_start(e,t,r,n){switch(this._fore(r,n),e){case a.TAG:this.push(`${t}(`);break;case a.ARRAY:this.push("[");break;case a.MAP:this.push("{");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push("(")}t===u.STREAM&&this.push("_ ")}_on_stop(e){switch(e){case a.TAG:this.push(")");break;case a.ARRAY:this.push("]");break;case a.MAP:this.push("}");break;case a.BYTE_STRING:case a.UTF8_STRING:this.push(")")}}_on_data(){this.push(this.separator)}}e.exports=c},72893:(e,t,r)=>{"use strict";const n=r(88310),i=r(5256),o=r(27328),s=r(79452),{MT:a,NUMBYTES:u,SHIFT32:c,SIMPLE:f,SYMS:l,TAG:h,BI:p}=s,{Buffer:d}=r(48287),y=a.SIMPLE_FLOAT<<5|u.TWO,g=a.SIMPLE_FLOAT<<5|u.FOUR,m=a.SIMPLE_FLOAT<<5|u.EIGHT,v=a.SIMPLE_FLOAT<<5|f.TRUE,b=a.SIMPLE_FLOAT<<5|f.FALSE,_=a.SIMPLE_FLOAT<<5|f.UNDEFINED,w=a.SIMPLE_FLOAT<<5|f.NULL,E=d.from([255]),x=d.from("f97e00","hex"),B=d.from("f9fc00","hex"),A=d.from("f97c00","hex"),S=d.from("f98000","hex"),k={};let T={};class O extends n.Transform{constructor(e={}){const{canonical:t=!1,encodeUndefined:r,disallowUndefinedKeys:n=!1,dateType:i="number",collapseBigIntegers:o=!1,detectLoops:s=!1,omitUndefinedProperties:a=!1,genTypes:u=[],...c}=e;if(super({...c,readableObjectMode:!1,writableObjectMode:!0}),this.canonical=t,this.encodeUndefined=r,this.disallowUndefinedKeys=n,this.dateType=function(e){if(!e)return"number";switch(e.toLowerCase()){case"number":return"number";case"float":return"float";case"int":case"integer":return"int";case"string":return"string"}throw new TypeError(`dateType invalid, got "${e}"`)}(i),this.collapseBigIntegers=!!this.canonical||o,this.detectLoops=void 0,"boolean"==typeof s)s&&(this.detectLoops=new WeakSet);else{if(!(s instanceof WeakSet))throw new TypeError("detectLoops must be boolean or WeakSet");this.detectLoops=s}if(this.omitUndefinedProperties=a,this.semanticTypes={...O.SEMANTIC_TYPES},Array.isArray(u))for(let e=0,t=u.length;e{const r=typeof e[t];return"function"!==r&&(!this.omitUndefinedProperties||"undefined"!==r)})),n={};if(this.canonical&&r.sort(((e,t)=>{const r=n[e]||(n[e]=O.encode(e)),i=n[t]||(n[t]=O.encode(t));return r.compare(i)})),t.indefinite){if(!this._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!this._pushInt(r.length,a.MAP))return!1;let i=null;for(let t=0,o=r.length;tvoid 0!==t))),r.indefinite){if(!e._pushUInt8(a.MAP<<5|u.INDEFINITE))return!1}else if(!e._pushInt(n.length,a.MAP))return!1;if(e.canonical){const t=new O({genTypes:e.semanticTypes,canonical:e.canonical,detectLoops:Boolean(e.detectLoops),dateType:e.dateType,disallowUndefinedKeys:e.disallowUndefinedKeys,collapseBigIntegers:e.collapseBigIntegers}),r=new i({highWaterMark:e.readableHighWaterMark});t.pipe(r),n.sort((([e],[n])=>{t.pushAny(e);const i=r.read();t.pushAny(n);const o=r.read();return i.compare(o)}));for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}}else for(const[t,r]of n){if(e.disallowUndefinedKeys&&void 0===t)throw new Error("Invalid Map key: undefined");if(!e.pushAny(t)||!e.pushAny(r))return!1}return!(r.indefinite&&!e.push(E))}static _pushTypedArray(e,t){let r=64,n=t.BYTES_PER_ELEMENT;const{name:i}=t.constructor;return i.startsWith("Float")?(r|=16,n/=2):i.includes("U")||(r|=8),(i.includes("Clamped")||1!==n&&!o.isBigEndian())&&(r|=4),r|={1:0,2:1,4:2,8:3}[n],!!e._pushTag(r)&&O._pushBuffer(e,d.from(t.buffer,t.byteOffset,t.byteLength))}static _pushArrayBuffer(e,t){return O._pushBuffer(e,d.from(t))}static encodeIndefinite(e,t,r={}){if(null==t){if(null==this)throw new Error("No object to encode");t=this}const{chunkSize:n=4096}=r;let i=!0;const s=typeof t;let c=null;if("string"===s){i=i&&e._pushUInt8(a.UTF8_STRING<<5|u.INDEFINITE);let r=0;for(;r{const i=[],o=new O(t);o.on("data",(e=>i.push(e))),o.on("error",n),o.on("finish",(()=>r(d.concat(i)))),o.pushAny(e),o.end()}))}static get SEMANTIC_TYPES(){return T}static set SEMANTIC_TYPES(e){T=e}static reset(){O.SEMANTIC_TYPES={...k}}}Object.assign(k,{Array:O.pushArray,Date:O._pushDate,Buffer:O._pushBuffer,[d.name]:O._pushBuffer,Map:O._pushMap,NoFilter:O._pushNoFilter,[i.name]:O._pushNoFilter,RegExp:O._pushRegexp,Set:O._pushSet,ArrayBuffer:O._pushArrayBuffer,Uint8ClampedArray:O._pushTypedArray,Uint8Array:O._pushTypedArray,Uint16Array:O._pushTypedArray,Uint32Array:O._pushTypedArray,Int8Array:O._pushTypedArray,Int16Array:O._pushTypedArray,Int32Array:O._pushTypedArray,Float32Array:O._pushTypedArray,Float64Array:O._pushTypedArray,URL:O._pushURL,Boolean:O._pushBoxed,Number:O._pushBoxed,String:O._pushBoxed}),"undefined"!=typeof BigUint64Array&&(k[BigUint64Array.name]=O._pushTypedArray),"undefined"!=typeof BigInt64Array&&(k[BigInt64Array.name]=O._pushTypedArray),O.reset(),e.exports=O},82903:(e,t,r)=>{"use strict";const{Buffer:n}=r(48287),i=r(72893),o=r(93737),{MT:s}=r(79452);class a extends Map{constructor(e){super(e)}static _encode(e){return i.encodeCanonical(e).toString("base64")}static _decode(e){return o.decodeFirstSync(e,"base64")}get(e){return super.get(a._encode(e))}set(e,t){return super.set(a._encode(e),t)}delete(e){return super.delete(a._encode(e))}has(e){return super.has(a._encode(e))}*keys(){for(const e of super.keys())yield a._decode(e)}*entries(){for(const e of super.entries())yield[a._decode(e[0]),e[1]]}[Symbol.iterator](){return this.entries()}forEach(e,t){if("function"!=typeof e)throw new TypeError("Must be function");for(const t of super.entries())e.call(this,t[1],a._decode(t[0]),this)}encodeCBOR(e){if(!e._pushInt(this.size,s.MAP))return!1;if(e.canonical){const t=Array.from(super.entries()).map((e=>[n.from(e[0],"base64"),e[1]]));t.sort(((e,t)=>e[0].compare(t[0])));for(const r of t)if(!e.push(r[0])||!e.pushAny(r[1]))return!1}else for(const t of super.entries())if(!e.push(n.from(t[0],"base64"))||!e.pushAny(t[1]))return!1;return!0}}e.exports=a},69744:e=>{"use strict";class t{constructor(){this.clear()}clear(){this.map=new WeakMap,this.count=0,this.recording=!0}stop(){this.recording=!1}check(e){const r=this.map.get(e);if(r)return r.length>1?r[0]||this.recording?r[1]:(r[0]=!0,t.FIRST):this.recording?(r.push(this.count++),r[1]):t.NEVER;if(!this.recording)throw new Error("New object detected when not recording");return this.map.set(e,[!1]),t.NEVER}}t.NEVER=-1,t.FIRST=-2,e.exports=t},207:(e,t,r)=>{"use strict";const n=r(72893),i=r(69744),{Buffer:o}=r(48287);class s extends n{constructor(e){super(e),this.valueSharing=new i}_pushObject(e,t){if(null!==e){const t=this.valueSharing.check(e);switch(t){case i.FIRST:this._pushTag(28);break;case i.NEVER:break;default:return this._pushTag(29)&&this._pushIntNum(t)}}return super._pushObject(e,t)}stopRecording(){this.valueSharing.stop()}clearRecording(){this.valueSharing.clear()}static encode(...e){const t=new s;t.on("data",(()=>{}));for(const r of e)t.pushAny(r);return t.stopRecording(),t.removeAllListeners("data"),t._encodeAll(e)}static encodeCanonical(...e){throw new Error("Cannot encode canonically in a SharedValueEncoder, which serializes objects multiple times.")}static encodeOne(e,t){const r=new s(t);return r.on("data",(()=>{})),r.pushAny(e),r.stopRecording(),r.removeAllListeners("data"),r._encodeAll([e])}static encodeAsync(e,t){return new Promise(((r,n)=>{const i=[],a=new s(t);a.on("data",(()=>{})),a.on("error",n),a.on("finish",(()=>r(o.concat(i)))),a.pushAny(e),a.stopRecording(),a.removeAllListeners("data"),a.on("data",(e=>i.push(e))),a.pushAny(e),a.end()}))}}e.exports=s},15059:(e,t,r)=>{"use strict";const{MT:n,SIMPLE:i,SYMS:o}=r(79452);class s{constructor(e){if("number"!=typeof e)throw new Error("Invalid Simple type: "+typeof e);if(e<0||e>255||(0|e)!==e)throw new Error(`value must be a small positive integer: ${e}`);this.value=e}toString(){return`simple(${this.value})`}[Symbol.for("nodejs.util.inspect.custom")](e,t){return`simple(${this.value})`}encodeCBOR(e){return e._pushInt(this.value,n.SIMPLE_FLOAT)}static isSimple(e){return e instanceof s}static decode(e,t=!0,r=!1){switch(e){case i.FALSE:return!1;case i.TRUE:return!0;case i.NULL:return t?null:o.NULL;case i.UNDEFINED:if(t)return;return o.UNDEFINED;case-1:if(!t||!r)throw new Error("Invalid BREAK");return o.BREAK;default:return new s(e)}}}e.exports=s},53557:(e,t,r)=>{"use strict";const n=r(79452),i=r(27328),o=Symbol("INTERNAL_JSON");function s(e,t){if(i.isBufferish(e))e.toJSON=t;else if(Array.isArray(e))for(const r of e)s(r,t);else if(e&&"object"==typeof e&&(!(e instanceof d)||e.tag<21||e.tag>23))for(const r of Object.values(e))s(r,t)}function a(){return i.base64(this)}function u(){return i.base64url(this)}function c(){return this.toString("hex")}const f={0:e=>new Date(e),1:e=>new Date(1e3*e),2:e=>i.bufferToBigInt(e),3:e=>n.BI.MINUS_ONE-i.bufferToBigInt(e),21:(e,t)=>(i.isBufferish(e)?t[o]=u:s(e,u),t),22:(e,t)=>(i.isBufferish(e)?t[o]=a:s(e,a),t),23:(e,t)=>(i.isBufferish(e)?t[o]=c:s(e,c),t),32:e=>new URL(e),33:(e,t)=>{if(!e.match(/^[a-zA-Z0-9_-]+$/))throw new Error("Invalid base64url characters");const r=e.length%4;if(1===r)throw new Error("Invalid base64url length");if(2===r){if(-1==="AQgw".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding")}else if(3===r&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-1]))throw new Error("Invalid base64 padding");return t},34:(e,t)=>{const r=e.match(/^[a-zA-Z0-9+/]+(?={0,2})$/);if(!r)throw new Error("Invalid base64 characters");if(e.length%4!=0)throw new Error("Invalid base64 length");if("="===r.groups.padding){if(-1==="AQgw".indexOf(e[e.length-2]))throw new Error("Invalid base64 padding")}else if("=="===r.groups.padding&&-1==="AEIMQUYcgkosw048".indexOf(e[e.length-3]))throw new Error("Invalid base64 padding");return t},35:e=>new RegExp(e),258:e=>new Set(e)},l={64:Uint8Array,65:Uint16Array,66:Uint32Array,68:Uint8ClampedArray,69:Uint16Array,70:Uint32Array,72:Int8Array,73:Int16Array,74:Int32Array,77:Int16Array,78:Int32Array,81:Float32Array,82:Float64Array,85:Float32Array,86:Float64Array};function h(e,t){if(!i.isBufferish(e))throw new TypeError("val not a buffer");const{tag:r}=t,n=l[r];if(!n)throw new Error(`Invalid typed array tag: ${r}`);const o=2**(((16&r)>>4)+(3&r));return!(4&r)!==i.isBigEndian()&&o>1&&function(e,t,r,n){const i=new DataView(e),[o,s]={2:[i.getUint16,i.setUint16],4:[i.getUint32,i.setUint32],8:[i.getBigUint64,i.setBigUint64]}[t],a=r+n;for(let e=r;e0?this.err=e.message:this.err=e,this}}static get TAGS(){return p}static set TAGS(e){p=e}static reset(){d.TAGS={...f}}}d.INTERNAL_JSON=o,d.reset(),e.exports=d},27328:(e,t,r)=>{"use strict";const{Buffer:n}=r(48287),i=r(5256),o=r(88310),s=r(79452),{NUMBYTES:a,SHIFT32:u,BI:c,SYMS:f}=s,l=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});t.utf8=e=>l.decode(e),t.utf8.checksUTF8=!0,t.isBufferish=function(e){return e&&"object"==typeof e&&(n.isBuffer(e)||e instanceof Uint8Array||e instanceof Uint8ClampedArray||e instanceof ArrayBuffer||e instanceof DataView)},t.bufferishToBuffer=function(e){return n.isBuffer(e)?e:ArrayBuffer.isView(e)?n.from(e.buffer,e.byteOffset,e.byteLength):e instanceof ArrayBuffer?n.from(e):null},t.parseCBORint=function(e,t){switch(e){case a.ONE:return t.readUInt8(0);case a.TWO:return t.readUInt16BE(0);case a.FOUR:return t.readUInt32BE(0);case a.EIGHT:{const e=t.readUInt32BE(0),r=t.readUInt32BE(4);return e>2097151?BigInt(e)*c.SHIFT32+BigInt(r):e*u+r}default:throw new Error(`Invalid additional info for int: ${e}`)}},t.writeHalf=function(e,t){const r=n.allocUnsafe(4);r.writeFloatBE(t,0);const i=r.readUInt32BE(0);if(8191&i)return!1;let o=i>>16&32768;const s=i>>23&255,a=8388607&i;if(s>=113&&s<=142)o+=(s-112<<10)+(a>>13);else{if(!(s>=103&&s<113))return!1;if(a&(1<<126-s)-1)return!1;o+=a+8388608>>126-s}return e.writeUInt16BE(o),!0},t.parseHalf=function(e){const t=128&e[0]?-1:1,r=(124&e[0])>>2,n=(3&e[0])<<8|e[1];return r?31===r?t*(n?NaN:1/0):t*2**(r-25)*(1024+n):5.960464477539063e-8*t*n},t.parseCBORfloat=function(e){switch(e.length){case 2:return t.parseHalf(e);case 4:return e.readFloatBE(0);case 8:return e.readDoubleBE(0);default:throw new Error(`Invalid float size: ${e.length}`)}},t.hex=function(e){return n.from(e.replace(/^0x/,""),"hex")},t.bin=function(e){let t=0,r=(e=e.replace(/\s/g,"")).length%8||8;const i=[];for(;r<=e.length;)i.push(parseInt(e.slice(t,r),2)),t=r,r+=8;return n.from(i)},t.arrayEqual=function(e,t){return null==e&&null==t||null!=e&&null!=t&&e.length===t.length&&e.every(((e,r)=>e===t[r]))},t.bufferToBigInt=function(e){return BigInt(`0x${e.toString("hex")}`)},t.cborValueToString=function(e,r=-1){switch(typeof e){case"symbol":{switch(e){case f.NULL:return"null";case f.UNDEFINED:return"undefined";case f.BREAK:return"BREAK"}if(e.description)return e.description;const t=e.toString().match(/^Symbol\((?.*)\)/);return t&&t.groups.name?t.groups.name:"Symbol"}case"string":return JSON.stringify(e);case"bigint":return e.toString();case"number":{const t=Object.is(e,-0)?"-0":String(e);return r>0?`${t}_${r}`:t}case"object":{if(!e)return"null";const n=t.bufferishToBuffer(e);if(n){const e=n.toString("hex");return r===-1/0?e:`h'${e}'`}return e&&"function"==typeof e[Symbol.for("nodejs.util.inspect.custom")]?e[Symbol.for("nodejs.util.inspect.custom")]():Array.isArray(e)?"[]":"{}"}}return String(e)},t.guessEncoding=function(e,r){if("string"==typeof e)return new i(e,null==r?"hex":r);const n=t.bufferishToBuffer(e);if(n)return new i(n);if((s=e)instanceof o.Readable||["read","on","pipe"].every((e=>"function"==typeof s[e])))return e;var s;throw new Error("Unknown input type")};const h={"=":"","+":"-","/":"_"};t.base64url=function(e){return t.bufferishToBuffer(e).toString("base64").replace(/[=+/]/g,(e=>h[e]))},t.base64=function(e){return t.bufferishToBuffer(e).toString("base64")},t.isBigEndian=function(){const e=new Uint8Array(4);return!((new Uint32Array(e.buffer)[0]=1)&e[0])}},54957:(e,t,r)=>{"use strict";const n=r(88310),i=r(5256);class o extends n.Transform{constructor(e){super(e),this._writableState.objectMode=!1,this._readableState.objectMode=!0,this.bs=new i,this.__restart()}_transform(e,t,r){for(this.bs.write(e);this.bs.length>=this.__needed;){let e=null;const t=null===this.__needed?void 0:this.bs.read(this.__needed);try{e=this.__parser.next(t)}catch(e){return r(e)}this.__needed&&(this.__fresh=!1),e.done?(this.push(e.value),this.__restart()):this.__needed=e.value||1/0}return r()}*_parse(){throw new Error("Must be implemented in subclass")}__restart(){this.__needed=null,this.__parser=this._parse(),this.__fresh=!0}_flush(e){e(this.__fresh?null:new Error("unexpected end of input"))}}e.exports=o},37007:e=>{function t(){this._events=this._events||{},this._maxListeners=this._maxListeners||void 0}function r(e){return"function"==typeof e}function n(e){return"object"==typeof e&&null!==e}function i(e){return void 0===e}e.exports=t,t.EventEmitter=t,t.prototype._events=void 0,t.prototype._maxListeners=void 0,t.defaultMaxListeners=10,t.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||isNaN(e))throw TypeError("n must be a positive number");return this._maxListeners=e,this},t.prototype.emit=function(e){var t,o,s,a,u,c;if(this._events||(this._events={}),"error"===e&&(!this._events.error||n(this._events.error)&&!this._events.error.length)){if((t=arguments[1])instanceof Error)throw t;var f=new Error('Uncaught, unspecified "error" event. ('+t+")");throw f.context=t,f}if(i(o=this._events[e]))return!1;if(r(o))switch(arguments.length){case 1:o.call(this);break;case 2:o.call(this,arguments[1]);break;case 3:o.call(this,arguments[1],arguments[2]);break;default:a=Array.prototype.slice.call(arguments,1),o.apply(this,a)}else if(n(o))for(a=Array.prototype.slice.call(arguments,1),s=(c=o.slice()).length,u=0;u0&&this._events[e].length>s&&(this._events[e].warned=!0,console.error("(node) warning: possible EventEmitter memory leak detected. %d listeners added. Use emitter.setMaxListeners() to increase limit.",this._events[e].length),"function"==typeof console.trace&&console.trace()),this},t.prototype.on=t.prototype.addListener,t.prototype.once=function(e,t){if(!r(t))throw TypeError("listener must be a function");var n=!1;function i(){this.removeListener(e,i),n||(n=!0,t.apply(this,arguments))}return i.listener=t,this.on(e,i),this},t.prototype.removeListener=function(e,t){var i,o,s,a;if(!r(t))throw TypeError("listener must be a function");if(!this._events||!this._events[e])return this;if(s=(i=this._events[e]).length,o=-1,i===t||r(i.listener)&&i.listener===t)delete this._events[e],this._events.removeListener&&this.emit("removeListener",e,t);else if(n(i)){for(a=s;a-- >0;)if(i[a]===t||i[a].listener&&i[a].listener===t){o=a;break}if(o<0)return this;1===i.length?(i.length=0,delete this._events[e]):i.splice(o,1),this._events.removeListener&&this.emit("removeListener",e,t)}return this},t.prototype.removeAllListeners=function(e){var t,n;if(!this._events)return this;if(!this._events.removeListener)return 0===arguments.length?this._events={}:this._events[e]&&delete this._events[e],this;if(0===arguments.length){for(t in this._events)"removeListener"!==t&&this.removeAllListeners(t);return this.removeAllListeners("removeListener"),this._events={},this}if(r(n=this._events[e]))this.removeListener(e,n);else if(n)for(;n.length;)this.removeListener(e,n[n.length-1]);return delete this._events[e],this},t.prototype.listeners=function(e){return this._events&&this._events[e]?r(this._events[e])?[this._events[e]]:this._events[e].slice():[]},t.prototype.listenerCount=function(e){if(this._events){var t=this._events[e];if(r(t))return 1;if(t)return t.length}return 0},t.listenerCount=function(e,t){return e.listenerCount(t)}},251:(e,t)=>{t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y}},56698:e=>{"function"==typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},73065:function(e,t,r){var n,i;!function(o,s){"use strict";n=function(){var e=function(){},t="undefined",r=typeof window!==t&&typeof window.navigator!==t&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"],i={},o=null;function s(e,t){var r=e[t];if("function"==typeof r.bind)return r.bind(e);try{return Function.prototype.bind.call(r,e)}catch(t){return function(){return Function.prototype.apply.apply(r,[e,arguments])}}}function a(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function u(){for(var r=this.getLevel(),i=0;i=0&&t<=l.levels.SILENT)return t;throw new TypeError("log.setLevel() called with invalid level: "+e)}"string"==typeof e?h+=":"+e:"symbol"==typeof e&&(h=void 0),l.name=e,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=r||f,l.getLevel=function(){return null!=c?c:null!=a?a:s},l.setLevel=function(e,r){return c=d(e),!1!==r&&function(e){var r=(n[e]||"silent").toUpperCase();if(typeof window!==t&&h){try{return void(window.localStorage[h]=r)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"="+r+";"}catch(e){}}}(c),u.call(l)},l.setDefaultLevel=function(e){a=d(e),p()||l.setLevel(e,!1)},l.resetLevel=function(){c=null,function(){if(typeof window!==t&&h){try{window.localStorage.removeItem(h)}catch(e){}try{window.document.cookie=encodeURIComponent(h)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch(e){}}}(),u.call(l)},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)},l.rebuild=function(){if(o!==l&&(s=d(o.getLevel())),u.call(l),o===l)for(var e in i)i[e].rebuild()},s=d(o?o.getLevel():"WARN");var y=p();null!=y&&(c=d(y)),u.call(l)}(o=new l).getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var t=i[e];return t||(t=i[e]=new l(e,o.methodFactory)),t};var h=typeof window!==t?window.log:void 0;return o.noConflict=function(){return typeof window!==t&&window.log===o&&(window.log=h),o},o.getLoggers=function(){return i},o.default=o,o},void 0===(i=n.call(t,r,t,e))||(e.exports=i)}()},5256:(e,t,r)=>{"use strict";const n=r(88310),{Buffer:i}=r(48287),o=new TextDecoder("utf8",{fatal:!0,ignoreBOM:!0});class s extends n.Transform{constructor(e,t,r={}){let n=null,o=null;switch(typeof e){case"object":i.isBuffer(e)?n=e:e&&(r=e);break;case"string":n=e;break;case"undefined":break;default:throw new TypeError("Invalid input")}switch(typeof t){case"object":t&&(r=t);break;case"string":o=t;break;case"undefined":break;default:throw new TypeError("Invalid inputEncoding")}if(!r||"object"!=typeof r)throw new TypeError("Invalid options");null==n&&(n=r.input),null==o&&(o=r.inputEncoding),delete r.input,delete r.inputEncoding;const s=null==r.watchPipe||r.watchPipe;delete r.watchPipe;const a=Boolean(r.readError);delete r.readError,super(r),this.readError=a,s&&this.on("pipe",(e=>{const t=e._readableState.objectMode;if(this.length>0&&t!==this._readableState.objectMode)throw new Error("Do not switch objectMode in the middle of the stream");this._readableState.objectMode=t,this._writableState.objectMode=t})),null!=n&&this.end(n,o)}static isNoFilter(e){return e instanceof this}static compare(e,t){if(!(e instanceof this))throw new TypeError("Arguments must be NoFilters");return e===t?0:e.compare(t)}static concat(e,t){if(!Array.isArray(e))throw new TypeError("list argument must be an Array of NoFilters");if(0===e.length||0===t)return i.alloc(0);null==t&&(t=e.reduce(((e,t)=>{if(!(t instanceof s))throw new TypeError("list argument must be an Array of NoFilters");return e+t.length}),0));let r=!0,n=!0;const o=e.map((e=>{if(!(e instanceof s))throw new TypeError("list argument must be an Array of NoFilters");const t=e.slice();return i.isBuffer(t)?n=!1:r=!1,t}));if(r)return i.concat(o,t);if(n)return[].concat(...o).slice(0,t);throw new Error("Concatenating mixed object and byte streams not supported")}_transform(e,t,r){this._readableState.objectMode||i.isBuffer(e)||(e=i.from(e,t)),this.push(e),r()}_bufArray(){let e=this._readableState.buffer;if(!Array.isArray(e)){let t=e.head;for(e=[];null!=t;)e.push(t.data),t=t.next}return e}read(e){const t=super.read(e);if(null!=t){if(this.emit("read",t),this.readError&&t.length{this.length>=e?i(this.read(e)):this.writableFinished?o(new Error(`Stream finished before ${e} bytes were available`)):(t=t=>{this.length>=e&&i(this.read(e))},r=()=>{o(new Error(`Stream finished before ${e} bytes were available`))},n=o,this.on("readable",t),this.on("error",n),this.on("finish",r))})).finally((()=>{t&&(this.removeListener("readable",t),this.removeListener("error",n),this.removeListener("finish",r))}))}promise(e){let t=!1;return new Promise(((r,n)=>{this.on("finish",(()=>{const n=this.read();null==e||t||(t=!0,e(null,n)),r(n)})),this.on("error",(r=>{null==e||t||(t=!0,e(r)),n(r)}))}))}compare(e){if(!(e instanceof s))throw new TypeError("Arguments must be NoFilters");if(this===e)return 0;const t=this.slice(),r=e.slice();if(i.isBuffer(t)&&i.isBuffer(r))return t.compare(r);throw new Error("Cannot compare streams in object mode")}equals(e){return 0===this.compare(e)}slice(e,t){if(this._readableState.objectMode)return this._bufArray().slice(e,t);const r=this._bufArray();switch(r.length){case 0:return i.alloc(0);case 1:return r[0].slice(e,t);default:return i.concat(r).slice(e,t)}}get(e){return this.slice()[e]}toJSON(){const e=this.slice();return i.isBuffer(e)?e.toJSON():e}toString(e,t,r){const n=this.slice(t,r);return i.isBuffer(n)?e&&"utf8"!==e?n.toString(e):o.decode(n):JSON.stringify(n)}[Symbol.for("nodejs.util.inspect.custom")](e,t){const r=this._bufArray().map((e=>i.isBuffer(e)?t.stylize(e.toString("hex"),"string"):JSON.stringify(e))).join(", ");return`${this.constructor.name} [${r}]`}get length(){return this._readableState.length}writeBigInt(e){let t=e.toString(16);if(e<0){const r=BigInt(Math.floor(t.length/2));t=(e=(BigInt(1)<{"use strict";var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function n(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(var i in r)n(r,i)&&(e[i]=r[i])}}return e},t.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,r,n,i){if(t.subarray&&e.subarray)e.set(t.subarray(r,r+n),i);else for(var o=0;o{"use strict";e.exports=function(e,t,r,n){for(var i=65535&e,o=e>>>16&65535,s=0;0!==r;){r-=s=r>2e3?2e3:r;do{o=o+(i=i+t[n++]|0)|0}while(--s);i%=65521,o%=65521}return i|o<<16}},19681:e=>{"use strict";e.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},14823:e=>{"use strict";var t=function(){for(var e,t=[],r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t}();e.exports=function(e,r,n,i){var o=t,s=i+n;e^=-1;for(var a=i;a>>8^o[255&(e^r[a])];return~e}},58411:(e,t,r)=>{"use strict";var n,i=r(9805),o=r(23665),s=r(53269),a=r(14823),u=r(54674),c=0,f=0,l=-2,h=2,p=8,d=286,y=30,g=19,m=2*d+1,v=15,b=3,_=258,w=_+b+1,E=42,x=103,B=113,A=666;function S(e,t){return e.msg=u[t],t}function k(e){return(e<<1)-(e>4?9:0)}function T(e){for(var t=e.length;--t>=0;)e[t]=0}function O(e){var t=e.state,r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(i.arraySet(e.output,t.pending_buf,t.pending_out,r,e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))}function I(e,t){o._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,O(e.strm)}function N(e,t){e.pending_buf[e.pending++]=t}function F(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function R(e,t){var r,n,i=e.max_chain_length,o=e.strstart,s=e.prev_length,a=e.nice_match,u=e.strstart>e.w_size-w?e.strstart-(e.w_size-w):0,c=e.window,f=e.w_mask,l=e.prev,h=e.strstart+_,p=c[o+s-1],d=c[o+s];e.prev_length>=e.good_match&&(i>>=2),a>e.lookahead&&(a=e.lookahead);do{if(c[(r=t)+s]===d&&c[r+s-1]===p&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&os){if(e.match_start=t,s=n,n>=a)break;p=c[o+s-1],d=c[o+s]}}}while((t=l[t&f])>u&&0!=--i);return s<=e.lookahead?s:e.lookahead}function L(e){var t,r,n,o,u,c,f,l,h,p,d=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=d+(d-w)){i.arraySet(e.window,e.window,d,d,0),e.match_start-=d,e.strstart-=d,e.block_start-=d,t=r=e.hash_size;do{n=e.head[--t],e.head[t]=n>=d?n-d:0}while(--r);t=r=d;do{n=e.prev[--t],e.prev[t]=n>=d?n-d:0}while(--r);o+=d}if(0===e.strm.avail_in)break;if(c=e.strm,f=e.window,l=e.strstart+e.lookahead,h=o,p=void 0,(p=c.avail_in)>h&&(p=h),r=0===p?0:(c.avail_in-=p,i.arraySet(f,c.input,c.next_in,p,l),1===c.state.wrap?c.adler=s(c.adler,f,p,l):2===c.state.wrap&&(c.adler=a(c.adler,f,p,l)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=r,e.lookahead+e.insert>=b)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<=b&&(e.ins_h=(e.ins_h<=b)if(n=o._tr_tally(e,e.strstart-e.match_start,e.match_length-b),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=b){e.match_length--;do{e.strstart++,e.ins_h=(e.ins_h<=b&&(e.ins_h=(e.ins_h<4096)&&(e.match_length=b-1)),e.prev_length>=b&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-b,n=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-b),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=(e.ins_h<15&&(a=2,n-=16),o<1||o>9||r!==p||n<8||n>15||t<0||t>9||s<0||s>4)return S(e,l);8===n&&(n=9);var u=new D;return e.state=u,u.strm=e,u.wrap=a,u.gzhead=null,u.w_bits=n,u.w_size=1<e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(L(e),0===e.lookahead&&t===c)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,I(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-w&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(I(e,!1),e.strm.avail_out),1)})),new j(4,4,8,4,U),new j(4,5,16,8,U),new j(4,6,32,32,U),new j(4,4,16,16,C),new j(8,16,32,32,C),new j(8,16,128,128,C),new j(8,32,128,256,C),new j(32,128,258,1024,C),new j(32,258,258,4096,C)],t.deflateInit=function(e,t){return z(e,t,p,15,8,0)},t.deflateInit2=z,t.deflateReset=P,t.deflateResetKeep=M,t.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?l:(e.state.gzhead=t,f):l},t.deflate=function(e,t){var r,i,s,u;if(!e||!e.state||t>5||t<0)return e?S(e,l):l;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||i.status===A&&4!==t)return S(e,0===e.avail_out?-5:l);if(i.strm=e,r=i.last_flush,i.last_flush=t,i.status===E)if(2===i.wrap)e.adler=0,N(i,31),N(i,139),N(i,8),i.gzhead?(N(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),N(i,255&i.gzhead.time),N(i,i.gzhead.time>>8&255),N(i,i.gzhead.time>>16&255),N(i,i.gzhead.time>>24&255),N(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),N(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(N(i,255&i.gzhead.extra.length),N(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=a(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(N(i,0),N(i,0),N(i,0),N(i,0),N(i,0),N(i,9===i.level?2:i.strategy>=2||i.level<2?4:0),N(i,3),i.status=B);else{var h=p+(i.w_bits-8<<4)<<8;h|=(i.strategy>=2||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=B,F(i,h),0!==i.strstart&&(F(i,e.adler>>>16),F(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(s=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending!==i.pending_buf_size));)N(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){s=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>s&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),O(e),s=i.pending,i.pending===i.pending_buf_size)){u=1;break}u=i.gzindexs&&(e.adler=a(e.adler,i.pending_buf,i.pending-s,s)),0===u&&(i.status=x)}else i.status=x;if(i.status===x&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&O(e),i.pending+2<=i.pending_buf_size&&(N(i,255&e.adler),N(i,e.adler>>8&255),e.adler=0,i.status=B)):i.status=B),0!==i.pending){if(O(e),0===e.avail_out)return i.last_flush=-1,f}else if(0===e.avail_in&&k(t)<=k(r)&&4!==t)return S(e,-5);if(i.status===A&&0!==e.avail_in)return S(e,-5);if(0!==e.avail_in||0!==i.lookahead||t!==c&&i.status!==A){var d=2===i.strategy?function(e,t){for(var r;;){if(0===e.lookahead&&(L(e),0===e.lookahead)){if(t===c)return 1;break}if(e.match_length=0,r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var r,n,i,s,a=e.window;;){if(e.lookahead<=_){if(L(e),e.lookahead<=_&&t===c)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=b&&e.strstart>0&&(n=a[i=e.strstart-1])===a[++i]&&n===a[++i]&&n===a[++i]){s=e.strstart+_;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&ie.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=b?(r=o._tr_tally(e,1,e.match_length-b),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(I(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(I(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(I(e,!1),0===e.strm.avail_out)?1:2}(i,t):n[i.level].func(i,t);if(3!==d&&4!==d||(i.status=A),1===d||3===d)return 0===e.avail_out&&(i.last_flush=-1),f;if(2===d&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(T(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),O(e),0===e.avail_out))return i.last_flush=-1,f}return 4!==t?f:i.wrap<=0?1:(2===i.wrap?(N(i,255&e.adler),N(i,e.adler>>8&255),N(i,e.adler>>16&255),N(i,e.adler>>24&255),N(i,255&e.total_in),N(i,e.total_in>>8&255),N(i,e.total_in>>16&255),N(i,e.total_in>>24&255)):(F(i,e.adler>>>16),F(i,65535&e.adler)),O(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?f:1)},t.deflateEnd=function(e){var t;return e&&e.state?(t=e.state.status)!==E&&69!==t&&73!==t&&91!==t&&t!==x&&t!==B&&t!==A?S(e,l):(e.state=null,t===B?S(e,-3):f):l},t.deflateSetDictionary=function(e,t){var r,n,o,a,u,c,h,p,d=t.length;if(!e||!e.state)return l;if(2===(a=(r=e.state).wrap)||1===a&&r.status!==E||r.lookahead)return l;for(1===a&&(e.adler=s(e.adler,t,d,0)),r.wrap=0,d>=r.w_size&&(0===a&&(T(r.head),r.strstart=0,r.block_start=0,r.insert=0),p=new i.Buf8(r.w_size),i.arraySet(p,t,d-r.w_size,r.w_size,0),t=p,d=r.w_size),u=e.avail_in,c=e.next_in,h=e.input,e.avail_in=d,e.next_in=0,e.input=t,L(r);r.lookahead>=b;){n=r.strstart,o=r.lookahead-(b-1);do{r.ins_h=(r.ins_h<{"use strict";e.exports=function(e,t){var r,n,i,o,s,a,u,c,f,l,h,p,d,y,g,m,v,b,_,w,E,x,B,A,S;r=e.state,n=e.next_in,A=e.input,i=n+(e.avail_in-5),o=e.next_out,S=e.output,s=o-(t-e.avail_out),a=o+(e.avail_out-257),u=r.dmax,c=r.wsize,f=r.whave,l=r.wnext,h=r.window,p=r.hold,d=r.bits,y=r.lencode,g=r.distcode,m=(1<>>=_=b>>>24,d-=_,0==(_=b>>>16&255))S[o++]=65535&b;else{if(!(16&_)){if(64&_){if(32&_){r.mode=12;break e}e.msg="invalid literal/length code",r.mode=30;break e}b=y[(65535&b)+(p&(1<<_)-1)];continue t}for(w=65535&b,(_&=15)&&(d<_&&(p+=A[n++]<>>=_,d-=_),d<15&&(p+=A[n++]<>>=_=b>>>24,d-=_,16&(_=b>>>16&255)){if(E=65535&b,d<(_&=15)&&(p+=A[n++]<u){e.msg="invalid distance too far back",r.mode=30;break e}if(p>>>=_,d-=_,E>(_=o-s)){if((_=E-_)>f&&r.sane){e.msg="invalid distance too far back",r.mode=30;break e}if(x=0,B=h,0===l){if(x+=c-_,_2;)S[o++]=B[x++],S[o++]=B[x++],S[o++]=B[x++],w-=3;w&&(S[o++]=B[x++],w>1&&(S[o++]=B[x++]))}else{x=o-E;do{S[o++]=S[x++],S[o++]=S[x++],S[o++]=S[x++],w-=3}while(w>2);w&&(S[o++]=S[x++],w>1&&(S[o++]=S[x++]))}break}if(64&_){e.msg="invalid distance code",r.mode=30;break e}b=g[(65535&b)+(p&(1<<_)-1)]}}break}}while(n>3,p&=(1<<(d-=w<<3))-1,e.next_in=n,e.next_out=o,e.avail_in=n{"use strict";var n=r(9805),i=r(53269),o=r(14823),s=r(47293),a=r(21998),u=0,c=-2,f=1,l=12,h=30,p=852,d=592;function y(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function g(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new n.Buf16(320),this.work=new n.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function m(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=f,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new n.Buf32(p),t.distcode=t.distdyn=new n.Buf32(d),t.sane=1,t.back=-1,u):c}function v(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,m(e)):c}function b(e,t){var r,n;return e&&e.state?(n=e.state,t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?c:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,v(e))):c}function _(e,t){var r,n;return e?(n=new g,e.state=n,n.window=null,(r=b(e,t))!==u&&(e.state=null),r):c}var w,E,x=!0;function B(e){if(x){var t;for(w=new n.Buf32(512),E=new n.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(a(1,e.lens,0,288,w,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;a(2,e.lens,0,32,E,0,e.work,{bits:5}),x=!1}e.lencode=w,e.lenbits=9,e.distcode=E,e.distbits=5}function A(e,t,r,i){var o,s=e.state;return null===s.window&&(s.wsize=1<=s.wsize?(n.arraySet(s.window,t,r-s.wsize,s.wsize,0),s.wnext=0,s.whave=s.wsize):((o=s.wsize-s.wnext)>i&&(o=i),n.arraySet(s.window,t,r-i,o,s.wnext),(i-=o)?(n.arraySet(s.window,t,r-i,i,0),s.wnext=i,s.whave=s.wsize):(s.wnext+=o,s.wnext===s.wsize&&(s.wnext=0),s.whave>>8&255,r.check=o(r.check,P,2,0),_=0,w=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&_)<<8)+(_>>8))%31){e.msg="incorrect header check",r.mode=h;break}if(8!=(15&_)){e.msg="unknown compression method",r.mode=h;break}if(w-=4,U=8+(15&(_>>>=4)),0===r.wbits)r.wbits=U;else if(U>r.wbits){e.msg="invalid window size",r.mode=h;break}r.dmax=1<>8&1),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0,r.mode=3;case 3:for(;w<32;){if(0===v)break e;v--,_+=p[g++]<>>8&255,P[2]=_>>>16&255,P[3]=_>>>24&255,r.check=o(r.check,P,4,0)),_=0,w=0,r.mode=4;case 4:for(;w<16;){if(0===v)break e;v--,_+=p[g++]<>8),512&r.flags&&(P[0]=255&_,P[1]=_>>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0,r.mode=5;case 5:if(1024&r.flags){for(;w<16;){if(0===v)break e;v--,_+=p[g++]<>>8&255,r.check=o(r.check,P,2,0)),_=0,w=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&((S=r.length)>v&&(S=v),S&&(r.head&&(U=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),n.arraySet(r.head.extra,p,g,S,U)),512&r.flags&&(r.check=o(r.check,p,S,g)),v-=S,g+=S,r.length-=S),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===v)break e;S=0;do{U=p[g+S++],r.head&&U&&r.length<65536&&(r.head.name+=String.fromCharCode(U))}while(U&&S>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=l;break;case 10:for(;w<32;){if(0===v)break e;v--,_+=p[g++]<>>=7&w,w-=7&w,r.mode=27;break}for(;w<3;){if(0===v)break e;v--,_+=p[g++]<>>=1)){case 0:r.mode=14;break;case 1:if(B(r),r.mode=20,6===t){_>>>=2,w-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=h}_>>>=2,w-=2;break;case 14:for(_>>>=7&w,w-=7&w;w<32;){if(0===v)break e;v--,_+=p[g++]<>>16^65535)){e.msg="invalid stored block lengths",r.mode=h;break}if(r.length=65535&_,_=0,w=0,r.mode=15,6===t)break e;case 15:r.mode=16;case 16:if(S=r.length){if(S>v&&(S=v),S>b&&(S=b),0===S)break e;n.arraySet(d,p,g,S,m),v-=S,g+=S,b-=S,m+=S,r.length-=S;break}r.mode=l;break;case 17:for(;w<14;){if(0===v)break e;v--,_+=p[g++]<>>=5,w-=5,r.ndist=1+(31&_),_>>>=5,w-=5,r.ncode=4+(15&_),_>>>=4,w-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=h;break}r.have=0,r.mode=18;case 18:for(;r.have>>=3,w-=3}for(;r.have<19;)r.lens[z[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,j={bits:r.lenbits},C=a(0,r.lens,0,19,r.lencode,0,r.work,j),r.lenbits=j.bits,C){e.msg="invalid code lengths set",r.mode=h;break}r.have=0,r.mode=19;case 19:for(;r.have>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<>>=O,w-=O,r.lens[r.have++]=N;else{if(16===N){for(D=O+2;w>>=O,w-=O,0===r.have){e.msg="invalid bit length repeat",r.mode=h;break}U=r.lens[r.have-1],S=3+(3&_),_>>>=2,w-=2}else if(17===N){for(D=O+3;w>>=O)),_>>>=3,w-=3}else{for(D=O+7;w>>=O)),_>>>=7,w-=7}if(r.have+S>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=h;break}for(;S--;)r.lens[r.have++]=U}}if(r.mode===h)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=h;break}if(r.lenbits=9,j={bits:r.lenbits},C=a(1,r.lens,0,r.nlen,r.lencode,0,r.work,j),r.lenbits=j.bits,C){e.msg="invalid literal/lengths set",r.mode=h;break}if(r.distbits=6,r.distcode=r.distdyn,j={bits:r.distbits},C=a(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,j),r.distbits=j.bits,C){e.msg="invalid distances set",r.mode=h;break}if(r.mode=20,6===t)break e;case 20:r.mode=21;case 21:if(v>=6&&b>=258){e.next_out=m,e.avail_out=b,e.next_in=g,e.avail_in=v,r.hold=_,r.bits=w,s(e,x),m=e.next_out,d=e.output,b=e.avail_out,g=e.next_in,p=e.input,v=e.avail_in,_=r.hold,w=r.bits,r.mode===l&&(r.back=-1);break}for(r.back=0;I=(M=r.lencode[_&(1<>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<>F)])>>>16&255,N=65535&M,!(F+(O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<>>=F,w-=F,r.back+=F}if(_>>>=O,w-=O,r.back+=O,r.length=N,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=l;break}if(64&I){e.msg="invalid literal/length code",r.mode=h;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(D=r.extra;w>>=r.extra,w-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;I=(M=r.distcode[_&(1<>>16&255,N=65535&M,!((O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<>F)])>>>16&255,N=65535&M,!(F+(O=M>>>24)<=w);){if(0===v)break e;v--,_+=p[g++]<>>=F,w-=F,r.back+=F}if(_>>>=O,w-=O,r.back+=O,64&I){e.msg="invalid distance code",r.mode=h;break}r.offset=N,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(D=r.extra;w>>=r.extra,w-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=h;break}r.mode=25;case 25:if(0===b)break e;if(S=x-b,r.offset>S){if((S=r.offset-S)>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=h;break}S>r.wnext?(S-=r.wnext,k=r.wsize-S):k=r.wnext-S,S>r.length&&(S=r.length),T=r.window}else T=d,k=m-r.offset,S=r.length;S>b&&(S=b),b-=S,r.length-=S;do{d[m++]=T[k++]}while(--S);0===r.length&&(r.mode=21);break;case 26:if(0===b)break e;d[m++]=r.length,b--,r.mode=21;break;case 27:if(r.wrap){for(;w<32;){if(0===v)break e;v--,_|=p[g++]<{"use strict";var n=r(9805),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],s=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],a=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];e.exports=function(e,t,r,u,c,f,l,h){var p,d,y,g,m,v,b,_,w,E=h.bits,x=0,B=0,A=0,S=0,k=0,T=0,O=0,I=0,N=0,F=0,R=null,L=0,U=new n.Buf16(16),C=new n.Buf16(16),j=null,D=0;for(x=0;x<=15;x++)U[x]=0;for(B=0;B=1&&0===U[S];S--);if(k>S&&(k=S),0===S)return c[f++]=20971520,c[f++]=20971520,h.bits=1,0;for(A=1;A0&&(0===e||1!==S))return-1;for(C[1]=0,x=1;x<15;x++)C[x+1]=C[x]+U[x];for(B=0;B852||2===e&&N>592)return 1;for(;;){b=x-O,l[B]v?(_=j[D+l[B]],w=R[L+l[B]]):(_=96,w=0),p=1<>O)+(d-=p)]=b<<24|_<<16|w}while(0!==d);for(p=1<>=1;if(0!==p?(F&=p-1,F+=p):F=0,B++,0==--U[x]){if(x===S)break;x=t[r+l[B]]}if(x>k&&(F&g)!==y){for(0===O&&(O=k),m+=A,I=1<<(T=x-O);T+O852||2===e&&N>592)return 1;c[y=F&g]=k<<24|T<<16|m-f}}return 0!==F&&(c[m+F]=x-O<<24|64<<16),h.bits=k,0}},54674:e=>{"use strict";e.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},23665:(e,t,r)=>{"use strict";var n=r(9805);function i(e){for(var t=e.length;--t>=0;)e[t]=0}var o=256,s=286,a=30,u=15,c=16,f=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],p=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],d=new Array(576);i(d);var y=new Array(60);i(y);var g=new Array(512);i(g);var m=new Array(256);i(m);var v=new Array(29);i(v);var b,_,w,E=new Array(a);function x(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}function B(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function A(e){return e<256?g[e]:g[256+(e>>>7)]}function S(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function k(e,t,r){e.bi_valid>c-r?(e.bi_buf|=t<>c-e.bi_valid,e.bi_valid+=r-c):(e.bi_buf|=t<>>=1,r<<=1}while(--t>0);return r>>>1}function I(e,t,r){var n,i,o=new Array(u+1),s=0;for(n=1;n<=u;n++)o[n]=s=s+r[n-1]<<1;for(i=0;i<=t;i++){var a=e[2*i+1];0!==a&&(e[2*i]=O(o[a]++,a))}}function N(e){var t;for(t=0;t8?S(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function R(e,t,r,n){var i=2*t,o=2*r;return e[i]>1;r>=1;r--)L(e,o,r);i=c;do{r=e.heap[1],e.heap[1]=e.heap[e.heap_len--],L(e,o,1),n=e.heap[1],e.heap[--e.heap_max]=r,e.heap[--e.heap_max]=n,o[2*i]=o[2*r]+o[2*n],e.depth[i]=(e.depth[r]>=e.depth[n]?e.depth[r]:e.depth[n])+1,o[2*r+1]=o[2*n+1]=i,e.heap[1]=i++,L(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var r,n,i,o,s,a,c=t.dyn_tree,f=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,p=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,y=t.stat_desc.max_length,g=0;for(o=0;o<=u;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,r=e.heap_max+1;r<573;r++)(o=c[2*c[2*(n=e.heap[r])+1]+1]+1)>y&&(o=y,g++),c[2*n+1]=o,n>f||(e.bl_count[o]++,s=0,n>=d&&(s=p[n-d]),a=c[2*n],e.opt_len+=a*(o+s),h&&(e.static_len+=a*(l[2*n+1]+s)));if(0!==g){do{for(o=y-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[y]--,g-=2}while(g>0);for(o=y;0!==o;o--)for(n=e.bl_count[o];0!==n;)(i=e.heap[--r])>f||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),n--)}}(e,t),I(o,f,e.bl_count)}function j(e,t,r){var n,i,o=-1,s=t[1],a=0,u=7,c=4;for(0===s&&(u=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=s,s=t[2*(n+1)+1],++a>=7;n0?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t=3&&0===e.bl_tree[2*p[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(s=e.static_len+3+7>>>3)<=i&&(i=s)):i=s=r+5,r+4<=i&&-1!==t?P(e,t,r,n):4===e.strategy||s===i?(k(e,2+(n?1:0),3),U(e,d,y)):(k(e,4+(n?1:0),3),function(e,t,r,n){var i;for(k(e,t-257,5),k(e,r-1,5),k(e,n-4,4),i=0;i>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(m[r]+o+1)]++,e.dyn_dtree[2*A(t)]++),e.last_lit===e.lit_bufsize-1},t._tr_align=function(e){k(e,2,3),T(e,256,d),function(e){16===e.bi_valid?(S(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},44442:e=>{"use strict";e.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},43627:(e,t,r)=>{"use strict";var n=r(65606),i="win32"===n.platform,o=r(40537);function s(e,t){for(var r=[],n=0;n=0&&!e[n];n--);return 0===r&&n===t?e:r>n?[]:e.slice(r,n+1)}var u=/^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/,c=/^([\s\S]*?)((?:\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))(?:[\\\/]*)$/,f={};function l(e){var t=u.exec(e),r=(t[1]||"")+(t[2]||""),n=t[3]||"",i=c.exec(n);return[r,i[1],i[2],i[3]]}function h(e){var t=u.exec(e),r=t[1]||"",n=!!r&&":"!==r[1];return{device:r,isUnc:n,isAbsolute:n||!!t[2],tail:t[3]}}function p(e){return"\\\\"+e.replace(/^[\\\/]+/,"").replace(/[\\\/]+/g,"\\")}f.resolve=function(){for(var e="",t="",r=!1,i=arguments.length-1;i>=-1;i--){var a;if(i>=0?a=arguments[i]:e?(a=n.env["="+e])&&a.substr(0,3).toLowerCase()===e.toLowerCase()+"\\"||(a=e+"\\"):a=n.cwd(),!o.isString(a))throw new TypeError("Arguments to path.resolve must be strings");if(a){var u=h(a),c=u.device,f=u.isUnc,l=u.isAbsolute,d=u.tail;if((!c||!e||c.toLowerCase()===e.toLowerCase())&&(e||(e=c),r||(t=d+"\\"+t,r=l),e&&r))break}}return f&&(e=p(e)),e+(r?"\\":"")+(t=s(t.split(/[\\\/]+/),!r).join("\\"))||"."},f.normalize=function(e){var t=h(e),r=t.device,n=t.isUnc,i=t.isAbsolute,o=t.tail,a=/[\\\/]$/.test(o);return(o=s(o.split(/[\\\/]+/),!i).join("\\"))||i||(o="."),o&&a&&(o+="\\"),n&&(r=p(r)),r+(i?"\\":"")+o},f.isAbsolute=function(e){return h(e).isAbsolute},f.join=function(){for(var e=[],t=0;t=-1&&!t;r--){var i=r>=0?arguments[r]:n.cwd();if(!o.isString(i))throw new TypeError("Arguments to path.resolve must be strings");i&&(e=i+"/"+e,t="/"===i[0])}return(t?"/":"")+(e=s(e.split("/"),!t).join("/"))||"."},y.normalize=function(e){var t=y.isAbsolute(e),r=e&&"/"===e[e.length-1];return(e=s(e.split("/"),!t).join("/"))||t||(e="."),e&&r&&(e+="/"),(t?"/":"")+e},y.isAbsolute=function(e){return"/"===e.charAt(0)},y.join=function(){for(var e="",t=0;t{var t,r,n=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function o(){throw new Error("clearTimeout has not been defined")}function s(e){if(t===setTimeout)return setTimeout(e,0);if((t===i||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:i}catch(e){t=i}try{r="function"==typeof clearTimeout?clearTimeout:o}catch(e){r=o}}();var a,u=[],c=!1,f=-1;function l(){c&&a&&(c=!1,a.length?u=a.concat(u):f=-1,u.length&&h())}function h(){if(!c){var e=s(l);c=!0;for(var t=u.length;t;){for(a=u,u=[];++f1)for(var r=1;r{"use strict";var t={};function r(e,r,n){n||(n=Error);var i=function(e){var t,n;function i(t,n,i){return e.call(this,function(e,t,n){return"string"==typeof r?r:r(e,t,n)}(t,n,i))||this}return n=e,(t=i).prototype=Object.create(n.prototype),t.prototype.constructor=t,t.__proto__=n,i}(n);i.prototype.name=n.name,i.prototype.code=e,t[e]=i}function n(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}r("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),r("ERR_INVALID_ARG_TYPE",(function(e,t,r){var i,o,s,a,u;if("string"==typeof t&&(o="not ",t.substr(0,4)===o)?(i="must not be",t=t.replace(/^not /,"")):i="must be",function(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-9,r)===t}(e," argument"))s="The ".concat(e," ").concat(i," ").concat(n(t,"type"));else{var c=("number"!=typeof u&&(u=0),u+1>(a=e).length||-1===a.indexOf(".",u)?"argument":"property");s='The "'.concat(e,'" ').concat(c," ").concat(i," ").concat(n(t,"type"))}return s+". Received type ".concat(typeof r)}),TypeError),r("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),r("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),r("ERR_STREAM_PREMATURE_CLOSE","Premature close"),r("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),r("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),r("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),r("ERR_STREAM_WRITE_AFTER_END","write after end"),r("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),r("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=t},25382:(e,t,r)=>{"use strict";var n=r(65606),i=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=f;var o=r(45412),s=r(16708);r(56698)(f,o);for(var a=i(s.prototype),u=0;u{"use strict";e.exports=i;var n=r(74610);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(56698)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},45412:(e,t,r)=>{"use strict";var n,i=r(65606);e.exports=A,A.ReadableState=B,r(37007).EventEmitter;var o,s=function(e,t){return e.listeners(t).length},a=r(40345),u=r(48287).Buffer,c=r.g.Uint8Array||function(){},f=r(79838);o=f&&f.debuglog?f.debuglog("stream"):function(){};var l,h,p,d=r(80345),y=r(75896),g=r(65291).getHighWaterMark,m=r(86048).F,v=m.ERR_INVALID_ARG_TYPE,b=m.ERR_STREAM_PUSH_AFTER_EOF,_=m.ERR_METHOD_NOT_IMPLEMENTED,w=m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(56698)(A,a);var E=y.errorOrDestroy,x=["error","close","destroy","pause","resume"];function B(e,t,i){n=n||r(25382),e=e||{},"boolean"!=typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(l||(l=r(83141).I),this.decoder=new l(e.encoding),this.encoding=e.encoding)}function A(e){if(n=n||r(25382),!(this instanceof A))return new A(e);var t=this instanceof n;this._readableState=new B(e,this,t),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),a.call(this)}function S(e,t,r,n,i){o("readableAddChunk",t);var s,a=e._readableState;if(null===t)a.reading=!1,function(e,t){if(o("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?I(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,N(e)))}}(e,a);else if(i||(s=function(e,t){var r,n;return n=t,u.isBuffer(n)||n instanceof c||"string"==typeof t||void 0===t||e.objectMode||(r=new v("chunk",["string","Buffer","Uint8Array"],t)),r}(a,t)),s)E(e,s);else if(a.objectMode||t&&t.length>0)if("string"==typeof t||a.objectMode||Object.getPrototypeOf(t)===u.prototype||(t=function(e){return u.from(e)}(t)),n)a.endEmitted?E(e,new w):k(e,a,t,!0);else if(a.ended)E(e,new b);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?k(e,a,t,!1):F(e,a)):k(e,a,t,!1)}else n||(a.reading=!1,F(e,a));return!a.ended&&(a.lengtht.highWaterMark&&(t.highWaterMark=function(e){return e>=T?e=T:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function I(e){var t=e._readableState;o("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(o("emitReadable",t.flowing),t.emittedReadable=!0,i.nextTick(N,e))}function N(e){var t=e._readableState;o("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function F(e,t){t.readingMore||(t.readingMore=!0,i.nextTick(R,e,t))}function R(e,t){for(;!t.reading&&!t.ended&&(t.length0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function U(e){o("readable nexttick read 0"),e.read(0)}function C(e,t){o("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;for(o("flow",t.flowing);t.flowing&&null!==e.read(););}function D(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function M(e){var t=e._readableState;o("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,i.nextTick(P,t,e))}function P(e,t){if(o("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function z(e,t){for(var r=0,n=e.length;r=t.highWaterMark:t.length>0)||t.ended))return o("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?M(this):I(this),null;if(0===(e=O(e,t))&&t.ended)return 0===t.length&&M(this),null;var n,i=t.needReadable;return o("need readable",i),(0===t.length||t.length-e0?D(e,t):null)?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&M(this)),null!==n&&this.emit("data",n),n},A.prototype._read=function(e){E(this,new _("_read()"))},A.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e)}n.pipesCount+=1,o("pipe count=%d opts=%j",n.pipesCount,t);var a=t&&!1===t.end||e===i.stdout||e===i.stderr?y:u;function u(){o("onend"),e.end()}n.endEmitted?i.nextTick(a):r.once("end",a),e.on("unpipe",(function t(i,s){o("onunpipe"),i===r&&s&&!1===s.hasUnpiped&&(s.hasUnpiped=!0,o("cleanup"),e.removeListener("close",p),e.removeListener("finish",d),e.removeListener("drain",c),e.removeListener("error",h),e.removeListener("unpipe",t),r.removeListener("end",u),r.removeListener("end",y),r.removeListener("data",l),f=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||c())}));var c=function(e){return function(){var t=e._readableState;o("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&s(e,"data")&&(t.flowing=!0,j(e))}}(r);e.on("drain",c);var f=!1;function l(t){o("ondata");var i=e.write(t);o("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==z(n.pipes,e))&&!f&&(o("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function h(t){o("onerror",t),y(),e.removeListener("error",h),0===s(e,"error")&&E(e,t)}function p(){e.removeListener("finish",d),y()}function d(){o("onfinish"),e.removeListener("close",p),y()}function y(){o("unpipe"),r.unpipe(e)}return r.on("data",l),function(e,t,r){if("function"==typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}(e,"error",h),e.once("close",p),e.once("finish",d),e.emit("pipe",r),n.flowing||(o("pipe resume"),r.resume()),e},A.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,o("on readable",n.length,n.reading),n.length?I(this):n.reading||i.nextTick(U,this))),r},A.prototype.addListener=A.prototype.on,A.prototype.removeListener=function(e,t){var r=a.prototype.removeListener.call(this,e,t);return"readable"===e&&i.nextTick(L,this),r},A.prototype.removeAllListeners=function(e){var t=a.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||i.nextTick(L,this),t},A.prototype.resume=function(){var e=this._readableState;return e.flowing||(o("resume"),e.flowing=!e.readableListening,function(e,t){t.resumeScheduled||(t.resumeScheduled=!0,i.nextTick(C,e,t))}(this,e)),e.paused=!1,this},A.prototype.pause=function(){return o("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(o("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},A.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(o("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){o("wrapped data"),r.decoder&&(i=r.decoder.write(i)),r.objectMode&&null==i||(r.objectMode||i&&i.length)&&(t.push(i)||(n=!0,e.pause()))})),e)void 0===this[i]&&"function"==typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var s=0;s{"use strict";e.exports=f;var n=r(86048).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(25382);function c(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{"use strict";var n,i=r(65606);function o(e){var t=this;this.next=null,this.entry=null,this.finish=function(){!function(e,t,r){var n=e.entry;for(e.entry=null;n;){var i=n.callback;t.pendingcb--,i(undefined),n=n.next}t.corkedRequestsFree.next=e}(t,e)}}e.exports=A,A.WritableState=B;var s,a={deprecate:r(94643)},u=r(40345),c=r(48287).Buffer,f=r.g.Uint8Array||function(){},l=r(75896),h=r(65291).getHighWaterMark,p=r(86048).F,d=p.ERR_INVALID_ARG_TYPE,y=p.ERR_METHOD_NOT_IMPLEMENTED,g=p.ERR_MULTIPLE_CALLBACK,m=p.ERR_STREAM_CANNOT_PIPE,v=p.ERR_STREAM_DESTROYED,b=p.ERR_STREAM_NULL_VALUES,_=p.ERR_STREAM_WRITE_AFTER_END,w=p.ERR_UNKNOWN_ENCODING,E=l.errorOrDestroy;function x(){}function B(e,t,s){n=n||r(25382),e=e||{},"boolean"!=typeof s&&(s=t instanceof n),this.objectMode=!!e.objectMode,s&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=h(this,e,"writableHighWaterMark",s),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var a=!1===e.decodeStrings;this.decodeStrings=!a,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){!function(e,t){var r=e._writableState,n=r.sync,o=r.writecb;if("function"!=typeof o)throw new g;if(function(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}(r),t)!function(e,t,r,n,o){--t.pendingcb,r?(i.nextTick(o,n),i.nextTick(N,e,t),e._writableState.errorEmitted=!0,E(e,n)):(o(n),e._writableState.errorEmitted=!0,E(e,n),N(e,t))}(e,r,n,t,o);else{var s=O(r)||e.destroyed;s||r.corked||r.bufferProcessing||!r.bufferedRequest||T(e,r),n?i.nextTick(k,e,r,s,o):k(e,r,s,o)}}(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function A(e){var t=this instanceof(n=n||r(25382));if(!t&&!s.call(A,this))return new A(e);this._writableState=new B(e,this,t),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),u.call(this)}function S(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new v("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function k(e,t,r,n){r||function(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}(e,t),t.pendingcb--,n(),N(e,t)}function T(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var n=t.bufferedRequestCount,i=new Array(n),s=t.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,S(e,t,!0,t.length,i,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new o(t),t.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(S(e,t,!1,t.objectMode?1:c.length,c,f,l),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function O(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function I(e,t){e._final((function(r){t.pendingcb--,r&&E(e,r),t.prefinished=!0,e.emit("prefinish"),N(e,t)}))}function N(e,t){var r=O(t);if(r&&(function(e,t){t.prefinished||t.finalCalled||("function"!=typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,i.nextTick(I,e,t)))}(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}r(56698)(A,u),B.prototype.getBuffer=function(){for(var e=this.bufferedRequest,t=[];e;)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(B.prototype,"buffer",{get:a.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(s=Function.prototype[Symbol.hasInstance],Object.defineProperty(A,Symbol.hasInstance,{value:function(e){return!!s.call(this,e)||this===A&&e&&e._writableState instanceof B}})):s=function(e){return e instanceof this},A.prototype.pipe=function(){E(this,new m)},A.prototype.write=function(e,t,r){var n,o=this._writableState,s=!1,a=!o.objectMode&&(n=e,c.isBuffer(n)||n instanceof f);return a&&!c.isBuffer(e)&&(e=function(e){return c.from(e)}(e)),"function"==typeof t&&(r=t,t=null),a?t="buffer":t||(t=o.defaultEncoding),"function"!=typeof r&&(r=x),o.ending?function(e,t){var r=new _;E(e,r),i.nextTick(t,r)}(this,r):(a||function(e,t,r,n){var o;return null===r?o=new b:"string"==typeof r||t.objectMode||(o=new d("chunk",["string","Buffer"],r)),!o||(E(e,o),i.nextTick(n,o),!1)}(this,o,e,r))&&(o.pendingcb++,s=function(e,t,r,n,i,o){if(!r){var s=function(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!=typeof t||(t=c.from(t,r)),t}(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length-1))throw new w(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(A.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(A.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),A.prototype._write=function(e,t,r){r(new y("_write()"))},A.prototype._writev=null,A.prototype.end=function(e,t,r){var n=this._writableState;return"function"==typeof e?(r=e,e=null,t=null):"function"==typeof t&&(r=t,t=null),null!=e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||function(e,t,r){t.ending=!0,N(e,t),r&&(t.finished?i.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}(this,n,r),this},Object.defineProperty(A.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(A.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),A.prototype.destroy=l.destroy,A.prototype._undestroy=l.undestroy,A.prototype._destroy=function(e,t){t(e)}},2955:(e,t,r)=>{"use strict";var n,i=r(65606);function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var s=r(86238),a=Symbol("lastResolve"),u=Symbol("lastReject"),c=Symbol("error"),f=Symbol("ended"),l=Symbol("lastPromise"),h=Symbol("handlePromise"),p=Symbol("stream");function d(e,t){return{value:e,done:t}}function y(e){var t=e[a];if(null!==t){var r=e[p].read();null!==r&&(e[l]=null,e[a]=null,e[u]=null,t(d(r,!1)))}}function g(e){i.nextTick(y,e)}var m=Object.getPrototypeOf((function(){})),v=Object.setPrototypeOf((o(n={get stream(){return this[p]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[f])return Promise.resolve(d(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){i.nextTick((function(){e[c]?r(e[c]):t(d(void 0,!0))}))}));var r,n=this[l];if(n)r=new Promise(function(e,t){return function(r,n){e.then((function(){t[f]?r(d(void 0,!0)):t[h](r,n)}),n)}}(n,this));else{var o=this[p].read();if(null!==o)return Promise.resolve(d(o,!1));r=new Promise(this[h])}return this[l]=r,r}},Symbol.asyncIterator,(function(){return this})),o(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(d(void 0,!0))}))}))})),n),m);e.exports=function(e){var t,r=Object.create(v,(o(t={},p,{value:e,writable:!0}),o(t,a,{value:null,writable:!0}),o(t,u,{value:null,writable:!0}),o(t,c,{value:null,writable:!0}),o(t,f,{value:e._readableState.endEmitted,writable:!0}),o(t,h,{value:function(e,t){var n=r[p].read();n?(r[l]=null,r[a]=null,r[u]=null,e(d(n,!1))):(r[a]=e,r[u]=t)},writable:!0}),t));return r[l]=null,s(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[u];return null!==t&&(r[l]=null,r[a]=null,r[u]=null,t(e)),void(r[c]=e)}var n=r[a];null!==n&&(r[l]=null,r[a]=null,r[u]=null,n(d(void 0,!0))),r[f]=!0})),e.on("readable",g.bind(null,r)),r}},80345:(e,t,r)=>{"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return s.alloc(0);for(var t,r,n,i=s.allocUnsafe(e>>>0),o=this.head,a=0;o;)t=o.data,r=i,n=a,s.prototype.copy.call(t,r,n),a+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return ei.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=s.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:u,value:function(e,t){return a(this,function(e){for(var t=1;t{"use strict";var n=r(65606);function i(e,t){s(e,t),o(e)}function o(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function s(e,t){e.emit("error",t)}e.exports={destroy:function(e,t){var r=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,n.nextTick(s,this,e)):n.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?r._writableState?r._writableState.errorEmitted?n.nextTick(o,r):(r._writableState.errorEmitted=!0,n.nextTick(i,r,e)):n.nextTick(i,r,e):t?(n.nextTick(o,r),t(e)):n.nextTick(o,r)})),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}}},86238:(e,t,r)=>{"use strict";var n=r(86048).F.ERR_STREAM_PREMATURE_CLOSE;function i(){}e.exports=function e(t,r,o){if("function"==typeof r)return e(t,null,r);r||(r={}),o=function(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i{e.exports=function(){throw new Error("Readable.from is not available in the browser")}},57758:(e,t,r)=>{"use strict";var n,i=r(86048).F,o=i.ERR_MISSING_ARGS,s=i.ERR_STREAM_DESTROYED;function a(e){if(e)throw e}function u(e){e()}function c(e,t){return e.pipe(t)}e.exports=function(){for(var e=arguments.length,t=new Array(e),i=0;i0,(function(e){f||(f=e),e&&h.forEach(u),o||(h.forEach(u),l(f))}))}));return t.reduce(c)}},65291:(e,t,r)=>{"use strict";var n=r(86048).F.ERR_INVALID_OPT_VALUE;e.exports={getHighWaterMark:function(e,t,r,i){var o=function(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}(t,i,r);if(null!=o){if(!isFinite(o)||Math.floor(o)!==o||o<0)throw new n(i?r:"highWaterMark",o);return Math.floor(o)}return e.objectMode?16:16384}}},40345:(e,t,r)=>{e.exports=r(37007).EventEmitter},88310:(e,t,r)=>{e.exports=i;var n=r(37007).EventEmitter;function i(){n.call(this)}r(56698)(i,n),i.Readable=r(45412),i.Writable=r(16708),i.Duplex=r(25382),i.Transform=r(74610),i.PassThrough=r(63600),i.finished=r(86238),i.pipeline=r(57758),i.Stream=i,i.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"==typeof e.destroy&&e.destroy())}function c(e){if(f(),0===n.listenerCount(this,"error"))throw e}function f(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),e.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),e.removeListener("close",f)}return r.on("error",c),e.on("error",c),r.on("end",f),r.on("close",f),e.on("close",f),e.emit("pipe",r),e}},83141:(e,t,r)=>{"use strict";var n=r(15003).Buffer,i=n.isEncoding||function(e){switch((e=""+e)&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){var t;switch(this.encoding=function(e){var t=function(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}(e);if("string"!=typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}(e),this.encoding){case"utf16le":this.text=u,this.end=c,t=4;break;case"utf8":this.fillLast=a,t=4;break;case"base64":this.text=f,this.end=l,t=3;break;default:return this.write=h,void(this.end=p)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function s(e){return e<=127?0:e>>5==6?2:e>>4==14?3:e>>3==30?4:e>>6==2?-1:-2}function a(e){var t=this.lastTotal-this.lastNeed,r=function(e,t,r){if(128!=(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!=(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!=(192&t[2]))return e.lastNeed=2,"�"}}(this,e);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function u(e,t){if((e.length-t)%2==0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function c(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function f(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function l(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function h(e){return e.toString(this.encoding)}function p(e){return e&&e.length?this.write(e):""}t.I=o,o.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(void 0===(t=this.fillLast(e)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r=0?(i>0&&(e.lastNeed=i-1),i):--n=0?(i>0&&(e.lastNeed=i-2),i):--n=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0}(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)},o.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},15003:(e,t,r)=>{var n=r(48287),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"==typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!=typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"==typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!=typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},90031:(e,t)=>{!function(e){var t,r,n,i=String.fromCharCode;function o(e){for(var t,r,n=[],i=0,o=e.length;i=55296&&t<=56319&&i=55296&&e<=57343)throw Error("Lone surrogate U+"+e.toString(16).toUpperCase()+" is not a scalar value")}function a(e,t){return i(e>>t&63|128)}function u(e){if(!(4294967168&e))return i(e);var t="";return 4294965248&e?4294901760&e?4292870144&e||(t=i(e>>18&7|240),t+=a(e,12),t+=a(e,6)):(s(e),t=i(e>>12&15|224),t+=a(e,6)):t=i(e>>6&31|192),t+i(63&e|128)}function c(){if(n>=r)throw Error("Invalid byte index");var e=255&t[n];if(n++,128==(192&e))return 63&e;throw Error("Invalid continuation byte")}function f(){var e,i;if(n>r)throw Error("Invalid byte index");if(n==r)return!1;if(e=255&t[n],n++,!(128&e))return e;if(192==(224&e)){if((i=(31&e)<<6|c())>=128)return i;throw Error("Invalid continuation byte")}if(224==(240&e)){if((i=(15&e)<<12|c()<<6|c())>=2048)return s(i),i;throw Error("Invalid continuation byte")}if(240==(248&e)&&(i=(7&e)<<18|c()<<12|c()<<6|c())>=65536&&i<=1114111)return i;throw Error("Invalid UTF-8 detected")}e.version="3.0.0",e.encode=function(e){for(var t=o(e),r=t.length,n=-1,i="";++n65535&&(o+=i((t-=65536)>>>10&1023|55296),t=56320|1023&t),o+=i(t);return o}(a)}}(t)},94643:(e,t,r)=>{function n(e){try{if(!r.g.localStorage)return!1}catch(e){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=function(e,t){if(n("noDeprecation"))return e;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(t);n("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}}},36622:e=>{"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}},81135:e=>{e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},40537:(e,t,r)=>{var n=r(65606),i=/%[sdj%]/g;t.format=function(e){if(!m(e)){for(var t=[],r=0;r=o)return e;switch(e){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(e){return"[Circular]"}default:return e}})),u=n[r];r=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),d(r)?n.showHidden=r:r&&t._extend(n,r),v(n.showHidden)&&(n.showHidden=!1),v(n.depth)&&(n.depth=2),v(n.colors)&&(n.colors=!1),v(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=u),f(n,e,n.depth)}function u(e,t){var r=a.styles[t];return r?"["+a.colors[r][0]+"m"+e+"["+a.colors[r][1]+"m":e}function c(e,t){return e}function f(e,r,n){if(e.customInspect&&r&&x(r.inspect)&&r.inspect!==t.inspect&&(!r.constructor||r.constructor.prototype!==r)){var i=r.inspect(n,e);return m(i)||(i=f(e,i,n)),i}var o=function(e,t){if(v(t))return e.stylize("undefined","undefined");if(m(t)){var r="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(r,"string")}return g(t)?e.stylize(""+t,"number"):d(t)?e.stylize(""+t,"boolean"):y(t)?e.stylize("null","null"):void 0}(e,r);if(o)return o;var s=Object.keys(r),a=function(e){var t={};return e.forEach((function(e,r){t[e]=!0})),t}(s);if(e.showHidden&&(s=Object.getOwnPropertyNames(r)),E(r)&&(s.indexOf("message")>=0||s.indexOf("description")>=0))return l(r);if(0===s.length){if(x(r)){var u=r.name?": "+r.name:"";return e.stylize("[Function"+u+"]","special")}if(b(r))return e.stylize(RegExp.prototype.toString.call(r),"regexp");if(w(r))return e.stylize(Date.prototype.toString.call(r),"date");if(E(r))return l(r)}var c,_="",B=!1,A=["{","}"];return p(r)&&(B=!0,A=["[","]"]),x(r)&&(_=" [Function"+(r.name?": "+r.name:"")+"]"),b(r)&&(_=" "+RegExp.prototype.toString.call(r)),w(r)&&(_=" "+Date.prototype.toUTCString.call(r)),E(r)&&(_=" "+l(r)),0!==s.length||B&&0!=r.length?n<0?b(r)?e.stylize(RegExp.prototype.toString.call(r),"regexp"):e.stylize("[Object]","special"):(e.seen.push(r),c=B?function(e,t,r,n,i){for(var o=[],s=0,a=t.length;s60?r[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+r[1]:r[0]+t+" "+e.join(", ")+" "+r[1]}(c,_,A)):A[0]+_+A[1]}function l(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,r,n,i,o){var s,a,u;if((u=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?a=u.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):u.set&&(a=e.stylize("[Setter]","special")),k(n,i)||(s="["+i+"]"),a||(e.seen.indexOf(u.value)<0?(a=y(r)?f(e,u.value,null):f(e,u.value,r-1)).indexOf("\n")>-1&&(a=o?a.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+a.split("\n").map((function(e){return" "+e})).join("\n")):a=e.stylize("[Circular]","special")),v(s)){if(o&&i.match(/^\d+$/))return a;(s=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(s=s.substr(1,s.length-2),s=e.stylize(s,"name")):(s=s.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),s=e.stylize(s,"string"))}return s+": "+a}function p(e){return Array.isArray(e)}function d(e){return"boolean"==typeof e}function y(e){return null===e}function g(e){return"number"==typeof e}function m(e){return"string"==typeof e}function v(e){return void 0===e}function b(e){return _(e)&&"[object RegExp]"===B(e)}function _(e){return"object"==typeof e&&null!==e}function w(e){return _(e)&&"[object Date]"===B(e)}function E(e){return _(e)&&("[object Error]"===B(e)||e instanceof Error)}function x(e){return"function"==typeof e}function B(e){return Object.prototype.toString.call(e)}function A(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(e){if(v(o)&&(o=n.env.NODE_DEBUG||""),e=e.toUpperCase(),!s[e])if(new RegExp("\\b"+e+"\\b","i").test(o)){var r=n.pid;s[e]=function(){var n=t.format.apply(t,arguments);console.error("%s %d: %s",e,r,n)}}else s[e]=function(){};return s[e]},t.inspect=a,a.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]},a.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=p,t.isBoolean=d,t.isNull=y,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=m,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=v,t.isRegExp=b,t.isObject=_,t.isDate=w,t.isError=E,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=r(81135);var S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function k(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){var e,r;console.log("%s - %s",(r=[A((e=new Date).getHours()),A(e.getMinutes()),A(e.getSeconds())].join(":"),[e.getDate(),S[e.getMonth()],r].join(" ")),t.format.apply(t,arguments))},t.inherits=r(36622),t._extend=function(e,t){if(!t||!_(t))return e;for(var r=Object.keys(t),n=r.length;n--;)e[r[n]]=t[r[n]];return e}},15340:()=>{},79838:()=>{},4633:(e,t,r)=>{var n=r(73738).default;function i(){"use strict";e.exports=i=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exports;var t,r={},o=Object.prototype,s=o.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(t){h=function(e,t,r){return e[t]=r}}function p(e,t,r,n){var i=t&&t.prototype instanceof _?t:_,o=Object.create(i.prototype),s=new R(n||[]);return a(o,"_invoke",{value:O(e,r,s)}),o}function d(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}r.wrap=p;var y="suspendedStart",g="suspendedYield",m="executing",v="completed",b={};function _(){}function w(){}function E(){}var x={};h(x,c,(function(){return this}));var B=Object.getPrototypeOf,A=B&&B(B(L([])));A&&A!==o&&s.call(A,c)&&(x=A);var S=E.prototype=_.prototype=Object.create(x);function k(e){["next","throw","return"].forEach((function(t){h(e,t,(function(e){return this._invoke(t,e)}))}))}function T(e,t){function r(i,o,a,u){var c=d(e[i],e,o);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==n(l)&&s.call(l,"__await")?t.resolve(l.__await).then((function(e){r("next",e,a,u)}),(function(e){r("throw",e,a,u)})):t.resolve(l).then((function(e){f.value=e,a(f)}),(function(e){return r("throw",e,a,u)}))}u(c.arg)}var i;a(this,"_invoke",{value:function(e,n){function o(){return new t((function(t,i){r(e,n,t,i)}))}return i=i?i.then(o,o):o()}})}function O(e,r,n){var i=y;return function(o,s){if(i===m)throw Error("Generator is already running");if(i===v){if("throw"===o)throw s;return{value:t,done:!0}}for(n.method=o,n.arg=s;;){var a=n.delegate;if(a){var u=I(a,n);if(u){if(u===b)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(i===y)throw i=v,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);i=m;var c=d(e,r,n);if("normal"===c.type){if(i=n.done?v:g,c.arg===b)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(i=v,n.method="throw",n.arg=c.arg)}}}function I(e,r){var n=r.method,i=e.iterator[n];if(i===t)return r.delegate=null,"throw"===n&&e.iterator.return&&(r.method="return",r.arg=t,I(e,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+n+"' method")),b;var o=d(i,e.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,b;var s=o.arg;return s?s.done?(r[e.resultName]=s.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,b):s:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,b)}function N(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function F(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function R(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(N,this),this.reset(!0)}function L(e){if(e||""===e){var r=e[c];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var i=-1,o=function r(){for(;++i=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var u=s.call(o,"catchLoc"),c=s.call(o,"finallyLoc");if(u&&c){if(this.prev=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),F(r),b}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;F(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,r,n){return this.delegate={iterator:L(e),resultName:r,nextLoc:n},"next"===this.method&&(this.arg=t),b}},r}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},73738:e=>{function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},54756:(e,t,r)=>{var n=r(4633)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},t={};function r(n){var i=t[n];if(void 0!==i)return i.exports;var o=t[n]={exports:{}};return e[n].call(o.exports,o,o.exports,r),o.exports}r.n=e=>{var t=e&&e.__esModule?()=>e.default:()=>e;return r.d(t,{a:t}),t},r.d=(e,t)=>{for(var n in t)r.o(t,n)&&!r.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},r.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),r.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),(()=>{"use strict";function e(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t(e)}function n(e){var r=function(e,r){if("object"!=t(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var i=n.call(e,"string");if("object"!=t(i))return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==t(r)?r:r+""}function i(e,t){for(var r=0;re.length)&&(t=e.length);for(var r=0,n=Array(t);r1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=";if(!e)return"";if("string"==typeof e&&(e=U.strToArrayBuffer(e)),e instanceof ArrayBuffer&&(e=new Uint8Array(e)),64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new x(`Invalid Base64 alphabet length (${t.length}): ${t}`);for(var r,n,i,o,s,a,u,c="",f=0;f>2,s=(3&r)<<4|(n=e[f++])>>4,a=(15&n)<<2|(i=e[f++])>>6,u=63&i,isNaN(n)?a=u=64:isNaN(i)&&(u=64),c+=t.charAt(o)+t.charAt(s)+t.charAt(a)+t.charAt(u);return c}function A(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"A-Za-z0-9+/=",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"string",n=!(arguments.length>3&&void 0!==arguments[3])||arguments[3],i=arguments.length>4&&void 0!==arguments[4]&&arguments[4];if(!e)return"string"===r?"":[];if(t=t||"A-Za-z0-9+/=",64!==(t=U.expandAlphRange(t).join("")).length&&65!==t.length)throw new x(`Error: Base64 alphabet should be 64 characters long, or 65 with a padding character. Found ${t.length}: ${t}`);if(n){var o=new RegExp("[^"+t.replace(/[[\]\\\-^$]/g,"\\$&")+"]","g");e=e.replace(o,"")}if(i){if(e.length%4==1)throw new x(`Error: Invalid Base64 input length (${e.length}). Cannot be 4n+1, even without padding chars.`);if(65===t.length){var s=t.charAt(64),a=e.indexOf(s);if(a>=0){if(a>2,f=(3&p)<<6|d,(u=l<<2|h>>4)>=0&&u<256&&y.push(u),c>=0&&c<256&&64!==p&&y.push(c),f>=0&&f<256&&64!==d&&y.push(f)}return"string"===r?U.byteArrayToUtf8(y):y}function S(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Auto",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:2;if(r<1||Math.round(r)!==r)throw new x("Byte length must be a positive integer");if("None"!==t){var n="Auto"===t?/[^a-f\d]|0x/gi:U.regexRep(t);e=e.split(n)}else e=[e];for(var i=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"Auto";t=U.charRep(t);var r=[],n=e.split(t);""===n[n.length-1]&&(n=n.slice(0,n.length-1));for(var i=0;i1&&void 0!==arguments[1]?arguments[1]:"Space",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:8;if(r<1||Math.round(r)!==r)throw new x("Byte length must be a positive integer");var n=U.regexRep(t);e=e.replace(n,"");for(var i=[],o=0;o65535){e-=65536;var t=String.fromCharCode(e>>>10&1023|55296);return e=56320|1023&e,t+String.fromCharCode(e)}return String.fromCharCode(e)}},{key:"ord",value:function(e){if(2===e.length){var t=e.charCodeAt(0),r=e.charCodeAt(1);if(t>=55296&&t<56320&&r>=56320&&r<57344)return 1024*(t-55296)+r-56320+65536}return e.charCodeAt(0)}},{key:"padBytesRight",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,n=new Array(t);return n.fill(r),g(e).forEach((function(e,t){n[t]=e})),n}},{key:"truncate",value:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"...";return e.length>t&&(e=e.slice(0,t-r.length)+r),e}},{key:"hex",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2;return(e="string"==typeof e?t.ord(e):e).toString(16).padStart(r,"0")}},{key:"bin",value:function(e){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:8;return(e="string"==typeof e?t.ord(e):e).toString(2).padStart(r,"0")}},{key:"printable",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return arguments.length>2&&void 0!==arguments[2]&&arguments[2]?e.replace(/[^\x20-\x7f]/g,"."):(e=e.replace(/[\0-\x08\x0B-\x0C\x0E-\x1F\x7F-\x9F\xAD\u0378\u0379\u037F-\u0383\u038B\u038D\u03A2\u0528-\u0530\u0557\u0558\u0560\u0588\u058B-\u058E\u0590\u05C8-\u05CF\u05EB-\u05EF\u05F5-\u0605\u061C\u061D\u06DD\u070E\u070F\u074B\u074C\u07B2-\u07BF\u07FB-\u07FF\u082E\u082F\u083F\u085C\u085D\u085F-\u089F\u08A1\u08AD-\u08E3\u08FF\u0978\u0980\u0984\u098D\u098E\u0991\u0992\u09A9\u09B1\u09B3-\u09B5\u09BA\u09BB\u09C5\u09C6\u09C9\u09CA\u09CF-\u09D6\u09D8-\u09DB\u09DE\u09E4\u09E5\u09FC-\u0A00\u0A04\u0A0B-\u0A0E\u0A11\u0A12\u0A29\u0A31\u0A34\u0A37\u0A3A\u0A3B\u0A3D\u0A43-\u0A46\u0A49\u0A4A\u0A4E-\u0A50\u0A52-\u0A58\u0A5D\u0A5F-\u0A65\u0A76-\u0A80\u0A84\u0A8E\u0A92\u0AA9\u0AB1\u0AB4\u0ABA\u0ABB\u0AC6\u0ACA\u0ACE\u0ACF\u0AD1-\u0ADF\u0AE4\u0AE5\u0AF2-\u0B00\u0B04\u0B0D\u0B0E\u0B11\u0B12\u0B29\u0B31\u0B34\u0B3A\u0B3B\u0B45\u0B46\u0B49\u0B4A\u0B4E-\u0B55\u0B58-\u0B5B\u0B5E\u0B64\u0B65\u0B78-\u0B81\u0B84\u0B8B-\u0B8D\u0B91\u0B96-\u0B98\u0B9B\u0B9D\u0BA0-\u0BA2\u0BA5-\u0BA7\u0BAB-\u0BAD\u0BBA-\u0BBD\u0BC3-\u0BC5\u0BC9\u0BCE\u0BCF\u0BD1-\u0BD6\u0BD8-\u0BE5\u0BFB-\u0C00\u0C04\u0C0D\u0C11\u0C29\u0C34\u0C3A-\u0C3C\u0C45\u0C49\u0C4E-\u0C54\u0C57\u0C5A-\u0C5F\u0C64\u0C65\u0C70-\u0C77\u0C80\u0C81\u0C84\u0C8D\u0C91\u0CA9\u0CB4\u0CBA\u0CBB\u0CC5\u0CC9\u0CCE-\u0CD4\u0CD7-\u0CDD\u0CDF\u0CE4\u0CE5\u0CF0\u0CF3-\u0D01\u0D04\u0D0D\u0D11\u0D3B\u0D3C\u0D45\u0D49\u0D4F-\u0D56\u0D58-\u0D5F\u0D64\u0D65\u0D76-\u0D78\u0D80\u0D81\u0D84\u0D97-\u0D99\u0DB2\u0DBC\u0DBE\u0DBF\u0DC7-\u0DC9\u0DCB-\u0DCE\u0DD5\u0DD7\u0DE0-\u0DF1\u0DF5-\u0E00\u0E3B-\u0E3E\u0E5C-\u0E80\u0E83\u0E85\u0E86\u0E89\u0E8B\u0E8C\u0E8E-\u0E93\u0E98\u0EA0\u0EA4\u0EA6\u0EA8\u0EA9\u0EAC\u0EBA\u0EBE\u0EBF\u0EC5\u0EC7\u0ECE\u0ECF\u0EDA\u0EDB\u0EE0-\u0EFF\u0F48\u0F6D-\u0F70\u0F98\u0FBD\u0FCD\u0FDB-\u0FFF\u10C6\u10C8-\u10CC\u10CE\u10CF\u1249\u124E\u124F\u1257\u1259\u125E\u125F\u1289\u128E\u128F\u12B1\u12B6\u12B7\u12BF\u12C1\u12C6\u12C7\u12D7\u1311\u1316\u1317\u135B\u135C\u137D-\u137F\u139A-\u139F\u13F5-\u13FF\u169D-\u169F\u16F1-\u16FF\u170D\u1715-\u171F\u1737-\u173F\u1754-\u175F\u176D\u1771\u1774-\u177F\u17DE\u17DF\u17EA-\u17EF\u17FA-\u17FF\u180F\u181A-\u181F\u1878-\u187F\u18AB-\u18AF\u18F6-\u18FF\u191D-\u191F\u192C-\u192F\u193C-\u193F\u1941-\u1943\u196E\u196F\u1975-\u197F\u19AC-\u19AF\u19CA-\u19CF\u19DB-\u19DD\u1A1C\u1A1D\u1A5F\u1A7D\u1A7E\u1A8A-\u1A8F\u1A9A-\u1A9F\u1AAE-\u1AFF\u1B4C-\u1B4F\u1B7D-\u1B7F\u1BF4-\u1BFB\u1C38-\u1C3A\u1C4A-\u1C4C\u1C80-\u1CBF\u1CC8-\u1CCF\u1CF7-\u1CFF\u1DE7-\u1DFB\u1F16\u1F17\u1F1E\u1F1F\u1F46\u1F47\u1F4E\u1F4F\u1F58\u1F5A\u1F5C\u1F5E\u1F7E\u1F7F\u1FB5\u1FC5\u1FD4\u1FD5\u1FDC\u1FF0\u1FF1\u1FF5\u1FFF\u200B-\u200F\u202A-\u202E\u2060-\u206F\u2072\u2073\u208F\u209D-\u209F\u20BB-\u20CF\u20F1-\u20FF\u218A-\u218F\u23F4-\u23FF\u2427-\u243F\u244B-\u245F\u2700\u2B4D-\u2B4F\u2B5A-\u2BFF\u2C2F\u2C5F\u2CF4-\u2CF8\u2D26\u2D28-\u2D2C\u2D2E\u2D2F\u2D68-\u2D6E\u2D71-\u2D7E\u2D97-\u2D9F\u2DA7\u2DAF\u2DB7\u2DBF\u2DC7\u2DCF\u2DD7\u2DDF\u2E3C-\u2E7F\u2E9A\u2EF4-\u2EFF\u2FD6-\u2FEF\u2FFC-\u2FFF\u3040\u3097\u3098\u3100-\u3104\u312E-\u3130\u318F\u31BB-\u31BF\u31E4-\u31EF\u321F\u32FF\u4DB6-\u4DBF\u9FCD-\u9FFF\uA48D-\uA48F\uA4C7-\uA4CF\uA62C-\uA63F\uA698-\uA69E\uA6F8-\uA6FF\uA78F\uA794-\uA79F\uA7AB-\uA7F7\uA82C-\uA82F\uA83A-\uA83F\uA878-\uA87F\uA8C5-\uA8CD\uA8DA-\uA8DF\uA8FC-\uA8FF\uA954-\uA95E\uA97D-\uA97F\uA9CE\uA9DA-\uA9DD\uA9E0-\uA9FF\uAA37-\uAA3F\uAA4E\uAA4F\uAA5A\uAA5B\uAA7C-\uAA7F\uAAC3-\uAADA\uAAF7-\uAB00\uAB07\uAB08\uAB0F\uAB10\uAB17-\uAB1F\uAB27\uAB2F-\uABBF\uABEE\uABEF\uABFA-\uABFF\uD7A4-\uD7AF\uD7C7-\uD7CA\uD7FC-\uD7FF\uE000-\uF8FF\uFA6E\uFA6F\uFADA-\uFAFF\uFB07-\uFB12\uFB18-\uFB1C\uFB37\uFB3D\uFB3F\uFB42\uFB45\uFBC2-\uFBD2\uFD40-\uFD4F\uFD90\uFD91\uFDC8-\uFDEF\uFDFE\uFDFF\uFE1A-\uFE1F\uFE27-\uFE2F\uFE53\uFE67\uFE6C-\uFE6F\uFE75\uFEFD-\uFF00\uFFBF-\uFFC1\uFFC8\uFFC9\uFFD0\uFFD1\uFFD8\uFFD9\uFFDD-\uFFDF\uFFE7\uFFEF-\uFFFB\uFFFE\uFFFF]/g,"."),t||(e=e.replace(/[\x09-\x10\u2028\u2029]/g,".")),e)}},{key:"escapeWhitespace",value:function(e){return e.replace(/[\x09-\x10]/g,(function(e){return String.fromCharCode(57344+e.charCodeAt(0))}))}},{key:"parseEscapedChars",value:function(e){return e.replace(/\\([abfnrtv'"]|[0-3][0-7]{2}|[0-7]{1,2}|x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]{1,6}\}|\\)/g,(function(e,t){switch(t[0]){case"\\":return"\\";case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":return String.fromCharCode(parseInt(t,8));case"a":return String.fromCharCode(7);case"b":return"\b";case"t":return"\t";case"n":return"\n";case"v":return"\v";case"f":return"\f";case"r":return"\r";case'"':return'"';case"'":return"'";case"x":return String.fromCharCode(parseInt(t.substr(1),16));case"u":return"{"===t[1]?String.fromCodePoint(parseInt(t.slice(2,-1),16)):String.fromCharCode(parseInt(t.substr(1),16))}}))}},{key:"escapeRegex",value:function(e){return e.replace(/([.*+?^=!:${}()|[\]/\\])/g,"\\$1")}},{key:"expandAlphRange",value:function(e){for(var r=[],n=0;n=0;i--)r=256*r+e[i];return r}},{key:"intToByteArray",value:function(e,t,r){var n=new Array(t);if("little"===r)for(var i=0;i>>=8;else for(var o=t-1;o>=0;o--)n[o]=255&e,e>>>=8;return n}},{key:"strToArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to array buffer`),!e)return new ArrayBuffer;for(var r,n=new Uint8Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ArrayBuffer(e);return n.buffer}},{key:"strToUtf8ArrayBuffer",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 array buffer`),!e)return new ArrayBuffer;var t=new TextEncoder("utf-8").encode(e);return e.length!==t.length&&(L()&&self&&"function"==typeof self.setOption?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),t.buffer}},{key:"strToByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to byte array`),!e)return[];for(var r,n=new Array(e.length),i=e.length;i--;)if(r=e.charCodeAt(i),n[i]=r,r>255)return t.strToUtf8ByteArray(e);return n}},{key:"strToUtf8ByteArray",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to UTF8 byte array`),!e)return[];var r=_().encode(e);return e.length!==r.length&&(L()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),t.strToByteArray(r)}},{key:"strToCharcode",value:function(e){if(v().debug(`Converting string[${null==e?void 0:e.length}] to charcode`),!e)return[];for(var r=[],n=0;n=55296&&i<56320){var o=e[n+1].charCodeAt(0);o>=56320&&o<57344&&(i=t.ord(e[n]+e[++n]))}r.push(i)}return r}},{key:"byteArrayToUtf8",value:function(e){var r;if(v().debug(`Converting byte array[${null===(r=e)||void 0===r?void 0:r.length}] to UTF8`),!e||!e.length)return"";e instanceof Uint8Array||(e=new Uint8Array(e));try{var n=new TextDecoder("utf-8",{fatal:!0}).decode(e);return n.length!==e.length&&(L()?self.setOption("attemptHighlight",!1):R()&&(window.app.options.attemptHighlight=!1)),n}catch(r){return t.byteArrayToChars(e)}}},{key:"byteArrayToChars",value:function(e){if(v().debug(`Converting byte array[${null==e?void 0:e.length}] to chars`),!e||!e.length)return"";for(var t="",r=0;r1&&void 0!==arguments[1])||arguments[1];if(v().debug(`Converting array buffer[${null==e?void 0:e.byteLength}] to str`),!e||!e.byteLength)return"";var n=new Uint8Array(e);return r?t.byteArrayToUtf8(n):t.byteArrayToChars(n)}},{key:"calculateShannonEntropy",value:function(e){e instanceof ArrayBuffer&&(e=new Uint8Array(e));var t,r=[],n=new Array(256).fill(0);for(t=0;t0&&r.push(n[t]/e.length);var i,o=0;for(t=0;t1&&void 0!==arguments[1]?arguments[1]:[","],i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:["\n","\r"],o=!1,s=!1,a="",u=[],c=[];e.length&&"\ufeff"===e[0]&&(e=e.substr(1));for(var f=0;f=0?(u.push(a),a=""):!s&&i.indexOf(t)>=0?(u.push(a),a="",c.push(u),u=[],i.indexOf(r)>=0&&r!==t&&f++):a+=t:s=!0;return u.length&&(u.push(a),c.push(u)),c}},{key:"stripHtmlTags",value:function(e){function t(e,r){var n=r.replace(e,"");return n.length===r.length?n:t(e,n)}return arguments.length>1&&void 0!==arguments[1]&&arguments[1]&&(e=t(/]*>(\s|\S)*?<\/script[^>]*>/gi,e),e=t(/]*>(\s|\S)*?<\/style[^>]*>/gi,e)),t(/<[^>]+>/g,e)}},{key:"escapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`","\0":""};return e?e.replace(/[&<>"'`\u0000]/g,(function(e){return t[e]})):e}},{key:"unescapeHtml",value:function(e){var t={"&":"&","<":"<",">":">",""":'"',"'":"'","/":"/","`":"`","":"\0"};return e.replace(/(&#?x?[a-z0-9]{2,4};|\ue000)/gi,(function(e){return t[e]||e}))}},{key:"toTitleCase",value:function(e){return e.replace(/\w\S*/g,(function(e){return e.charAt(0).toUpperCase()+e.substr(1).toLowerCase()}))}},{key:"encodeURIFragment",value:function(e){var t={"%2D":"-","%2E":".","%5F":"_","%7E":"~","%21":"!","%24":"$","%27":"'","%28":"(","%29":")","%2A":"*","%2C":",","%3B":";","%3A":":","%40":"@","%2F":"/","%3F":"?"};return(e=encodeURIComponent(e)).replace(/%[0-9A-F]{2}/g,(function(e){return t[e]||e}))}},{key:"generatePrettyRecipe",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="",n="",i="",o="",s="";return e.forEach((function(e){n=e.op.replace(/ /g,"_"),i=JSON.stringify(e.args).slice(1,-1).replace(/'/g,"\\'").replace(/"((?:[^"\\]|\\.)*)"/g,"'$1'").replace(/\\"/g,'"'),o=e.disabled?"/disabled":"",s=e.breakpoint?"/breakpoint":"",r+=`${n}(${i}${o}${s})`,t&&(r+="\n")})),r}},{key:"parseRecipeConfig",value:function(e){if(0===(e=e.trim()).length)return[];if("["===e[0])return JSON.parse(e);var t,r;e=e.replace(/\n/g,"");for(var n=/([^(]+)\(((?:'[^'\\]*(?:\\.[^'\\]*)*'|[^)/'])*)(\/[^)]+)?\)/g,i=[];t=n.exec(e);){r="["+(r=t[2].replace(/"/g,'\\"').replace(/(^|,|{|:)'/g,'$1"').replace(/([^\\]|(?:\\\\)+)'(,|:|}|$)/g,'$1"$2').replace(/\\'/g,"'"))+"]";var o={op:t[1].replace(/_/g," "),args:JSON.parse(r)};t[3]&&t[3].indexOf("disabled")>0&&(o.disabled=!0),t[3]&&t[3].indexOf("breakpoint")>0&&(o.breakpoint=!0),i.push(o)}return i}},{key:"displayFilesAsHTML",value:(r=l(p().mark((function e(r){var n,i,o,s,a;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=function(e){return`
\n
\n
\n ${t.escapeHtml(e.name)}\n
\n
\n
`},i=function(e,r){if(r.startsWith("image")){var n="data:";return n+=r+";",""}return`
${t.escapeHtml(t.arrayBufferToStr(e.buffer))}
`},o=function(){var e=l(p().mark((function e(r,n){var o,s,a,u;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.readFile(r);case 2:return o=e.sent,s=new Blob([o],{type:r.type||"octet/stream"}),a=URL.createObjectURL(s),u=`
\n
\n
\n \n \n ${r.size.toLocaleString()} bytes\n \n save\n \n \n open_in_browser\n \n \n
\n
\n
\n
\n ${i(o,r.type)}\n
\n
\n
`,e.abrupt("return",u);case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),s=`
\n ${r.length} file(s) found\n
`,a=0;case 5:if(!(a=e.size)t(i);else{var r=e.slice(o,o+s);n.readAsArrayBuffer(r)}};n.onload=function(e){i.set(new Uint8Array(n.result),o),o+=s,a()},n.onerror=function(e){r(n.error.message)},a()}))}},{key:"readFileSync",value:function(e){if(!F())throw new TypeError("Browser environment cannot support readFileSync");return Uint8Array.from(e.data).buffer}},{key:"mod",value:function(e,t){return(e%t+t)%t}},{key:"gcd",value:function(e,r){return r?t.gcd(r,e%r):e}},{key:"modInv",value:function(e,t){e%=t;for(var r=1;re?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),t.slice(0,e)+String(this))}),String.prototype.padEnd||(String.prototype.padEnd=function(e,t){return e|=0,t=String(void 0!==t?t:" "),this.length>e?String(this):((e-=this.length)>t.length&&(t+=t.repeat(e/t.length)),String(this)+t.slice(0,e))});const D=function(t){function r(){var t;e(this,r);for(var n=arguments.length,i=new Array(n),o=0;o0||e===t?t:t-1}function K(e){for(var t,r,n=1,i=e.length,o=e[0]+"";nc^r?1:-1;for(a=(u=i.length)<(c=o.length)?u:c,s=0;so[s]^r?1:-1;return u==c?0:u>c^r?1:-1}function Q(e,t,r,n){if(er||e!==z(e))throw Error($+(n||"Argument")+("number"==typeof e?er?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function ee(e){var t=e.c.length-1;return Y(e.e/Z)==t&&e.c[t]%2!=0}function te(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function re(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else tb?h.c=h.e=null:e.e=10;u/=10,a++);return void(a>b?h.c=h.e=null:(h.e=a,h.c=[e]))}l=String(e)}else{if(!M.test(l=String(e)))return i(h,l,c);h.s=45==l.charCodeAt(0)?(l=l.slice(1),-1):1}(a=l.indexOf("."))>-1&&(l=l.replace(".","")),(u=l.search(/e/i))>0?(a<0&&(a=u),a+=+l.slice(u+1),l=l.substring(0,u)):a<0&&(a=l.length)}else{if(Q(t,2,B.length,"Base"),10==t&&A)return I(h=new S(e),d+h.e+1,y);if(l=String(e),c="number"==typeof e){if(0*e!=0)return i(h,l,c,t);if(h.s=1/e<0?(l=l.slice(1),-1):1,S.DEBUG&&l.replace(/^0\.0*|\./,"").length>15)throw Error(H+e)}else h.s=45===l.charCodeAt(0)?(l=l.slice(1),-1):1;for(r=B.slice(0,t),a=u=0,f=l.length;ua){a=f;continue}}else if(!s&&(l==l.toUpperCase()&&(l=l.toLowerCase())||l==l.toLowerCase()&&(l=l.toUpperCase()))){s=!0,u=-1,a=0;continue}return i(h,String(e),c,t)}c=!1,(a=(l=n(l,t,10,h.s)).indexOf("."))>-1?l=l.replace(".",""):a=l.length}for(u=0;48===l.charCodeAt(u);u++);for(f=l.length;48===l.charCodeAt(--f););if(l=l.slice(u,++f)){if(f-=u,c&&S.DEBUG&&f>15&&(e>q||e!==z(e)))throw Error(H+h.s*e);if((a=a-u-1)>b)h.c=h.e=null;else if(a=m)?te(u,s):re(u,s,"0");else if(o=(e=I(new S(e),t,r)).e,a=(u=K(e.c)).length,1==n||2==n&&(t<=o||o<=g)){for(;aa){if(--t>0)for(u+=".";t--;u+="0");}else if((t+=o-a)>0)for(o+1==a&&(u+=".");t--;u+="0");return e.s<0&&i?"-"+u:u}function T(e,t){for(var r,n,i=1,o=new S(e[0]);i=10;i/=10,n++);return(r=n+r*Z-1)>b?e.c=e.e=null:r=10;a/=10,i++);if((o=t-i)<0)o+=Z,s=t,u=l[c=0],f=z(u/h[i-s-1]%10);else if((c=P((o+1)/Z))>=l.length){if(!n)break e;for(;l.length<=c;l.push(0));u=f=0,i=1,s=(o%=Z)-Z+1}else{for(u=a=l[c],i=1;a>=10;a/=10,i++);f=(s=(o%=Z)-Z+i)<0?0:z(u/h[i-s-1]%10)}if(n=n||t<0||null!=l[c+1]||(s<0?u:u%h[i-s-1]),n=r<4?(f||n)&&(0==r||r==(e.s<0?3:2)):f>5||5==f&&(4==r||n||6==r&&(o>0?s>0?u/h[i-s]:0:l[c-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,n?(t-=e.e+1,l[0]=h[(Z-t%Z)%Z],e.e=-t||0):l[0]=e.e=0,e;if(0==o?(l.length=c,a=1,c--):(l.length=c+1,a=h[Z-o],l[c]=s>0?z(u/h[i-s]%h[s])*a:0),n)for(;;){if(0==c){for(o=1,s=l[0];s>=10;s/=10,o++);for(s=l[0]+=a,a=1;s>=10;s/=10,a++);o!=a&&(e.e++,l[0]==V&&(l[0]=1));break}if(l[c]+=a,l[c]!=V)break;l[c--]=0,a=1}for(o=l.length;0===l[--o];l.pop());}e.e>b?e.c=e.e=null:e.e=m?te(t,r):re(t,r,"0"),e.s<0?"-"+t:t)}return S.clone=e,S.ROUND_UP=0,S.ROUND_DOWN=1,S.ROUND_CEIL=2,S.ROUND_FLOOR=3,S.ROUND_HALF_UP=4,S.ROUND_HALF_DOWN=5,S.ROUND_HALF_EVEN=6,S.ROUND_HALF_CEIL=7,S.ROUND_HALF_FLOOR=8,S.EUCLID=9,S.config=S.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error($+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(Q(r=e[t],0,W,t),d=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(Q(r=e[t],0,8,t),y=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(Q(r[0],-W,0,t),Q(r[1],0,W,t),g=r[0],m=r[1]):(Q(r,-W,W,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)Q(r[0],-W,-1,t),Q(r[1],1,W,t),v=r[0],b=r[1];else{if(Q(r,-W,W,t),!r)throw Error($+t+" cannot be zero: "+r);v=-(b=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error($+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw _=!r,Error($+"crypto unavailable");_=r}else _=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(Q(r=e[t],0,9,t),w=r),e.hasOwnProperty(t="POW_PRECISION")&&(Q(r=e[t],0,W,t),E=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error($+t+" not an object: "+r);x=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error($+t+" invalid: "+r);A="0123456789"==r.slice(0,10),B=r}}return{DECIMAL_PLACES:d,ROUNDING_MODE:y,EXPONENTIAL_AT:[g,m],RANGE:[v,b],CRYPTO:_,MODULO_MODE:w,POW_PRECISION:E,FORMAT:x,ALPHABET:B}},S.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!S.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-W&&i<=W&&i===z(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%Z)<1&&(t+=Z),String(n[0]).length==t){for(t=0;t=V||r!==z(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error($+"Invalid BigNumber: "+e)},S.maximum=S.max=function(){return T(arguments,-1)},S.minimum=S.min=function(){return T(arguments,1)},S.random=(o=9007199254740992,s=Math.random()*o&2097151?function(){return z(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,a=0,u=[],c=new S(p);if(null==e?e=d:Q(e,0,W),i=P(e/Z),_)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));a>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[a]=r[0],t[a+1]=r[1]):(u.push(o%1e14),a+=2);a=i/2}else{if(!crypto.randomBytes)throw _=!1,Error($+"crypto unavailable");for(t=crypto.randomBytes(i*=7);a=9e15?crypto.randomBytes(7).copy(t,a):(u.push(o%1e14),a+=7);a=i/7}if(!_)for(;a=10;o/=10,a++);ar-1&&(null==s[i+1]&&(s[i+1]=0),s[i+1]+=s[i]/r|0,s[i]%=r)}return s.reverse()}return function(n,i,o,s,a){var u,c,f,l,h,p,g,m,v=n.indexOf("."),b=d,_=y;for(v>=0&&(l=E,E=0,n=n.replace(".",""),p=(m=new S(i)).pow(n.length-v),E=l,m.c=t(re(K(p.c),p.e,"0"),10,o,e),m.e=m.c.length),f=l=(g=t(n,i,o,a?(u=B,e):(u=e,B))).length;0==g[--l];g.pop());if(!g[0])return u.charAt(0);if(v<0?--f:(p.c=g,p.e=f,p.s=s,g=(p=r(p,m,b,_,o)).c,h=p.r,f=p.e),v=g[c=f+b+1],l=o/2,h=h||c<0||null!=g[c+1],h=_<4?(null!=v||h)&&(0==_||_==(p.s<0?3:2)):v>l||v==l&&(4==_||h||6==_&&1&g[c-1]||_==(p.s<0?8:7)),c<1||!g[0])n=h?re(u.charAt(1),-b,u.charAt(0)):u.charAt(0);else{if(g.length=c,h)for(--o;++g[--c]>o;)g[c]=0,c||(++f,g=[1].concat(g));for(l=g.length;!g[--l];);for(v=0,n="";v<=l;n+=u.charAt(g[v++]));n=re(n,f,u.charAt(0))}return n}}(),r=function(){function e(e,t,r){var n,i,o,s,a=0,u=e.length,c=t%J,f=t/J|0;for(e=e.slice();u--;)a=((i=c*(o=e[u]%J)+(n=f*o+(s=e[u]/J|0)*c)%J*J+a)/r|0)+(n/J|0)+f*s,e[u]=i%r;return a&&(e=[a].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;it[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]1;e.splice(0,1));}return function(n,i,o,s,a){var u,c,f,l,h,p,d,y,g,m,v,b,_,w,E,x,B,A=n.s==i.s?1:-1,k=n.c,T=i.c;if(!(k&&k[0]&&T&&T[0]))return new S(n.s&&i.s&&(k?!T||k[0]!=T[0]:T)?k&&0==k[0]||!T?0*A:A/0:NaN);for(g=(y=new S(A)).c=[],A=o+(c=n.e-i.e)+1,a||(a=V,c=Y(n.e/Z)-Y(i.e/Z),A=A/Z|0),f=0;T[f]==(k[f]||0);f++);if(T[f]>(k[f]||0)&&c--,A<0)g.push(1),l=!0;else{for(w=k.length,x=T.length,f=0,A+=2,(h=z(a/(T[0]+1)))>1&&(T=e(T,h,a),k=e(k,h,a),x=T.length,w=k.length),_=x,v=(m=k.slice(0,x)).length;v=a/2&&E++;do{if(h=0,(u=t(T,m,x,v))<0){if(b=m[0],x!=v&&(b=b*a+(m[1]||0)),(h=z(b/E))>1)for(h>=a&&(h=a-1),d=(p=e(T,h,a)).length,v=m.length;1==t(p,m,d,v);)h--,r(p,x=10;A/=10,f++);I(y,o+(y.e=f+c*Z-1)+1,s,l)}else y.e=c,y.r=+l;return y}}(),a=/^(-?)0([xbo])(?=\w[\w.]*$)/i,u=/^([^.]+)\.$/,c=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g,i=function(e,t,r,n){var i,o=r?t:t.replace(l,"");if(f.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(a,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(u,"$1").replace(c,"0.$1")),t!=o))return new S(o,i);if(S.DEBUG)throw Error($+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},h.absoluteValue=h.abs=function(){var e=new S(this);return e.s<0&&(e.s=1),e},h.comparedTo=function(e,t){return X(this,new S(e,t))},h.decimalPlaces=h.dp=function(e,t){var r,n,i,o=this;if(null!=e)return Q(e,0,W),null==t?t=y:Q(t,0,8),I(new S(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=((i=r.length-1)-Y(this.e/Z))*Z,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},h.dividedBy=h.div=function(e,t){return r(this,new S(e,t),d,y)},h.dividedToIntegerBy=h.idiv=function(e,t){return r(this,new S(e,t),0,1)},h.exponentiatedBy=h.pow=function(e,t){var r,n,i,o,s,a,u,c,f=this;if((e=new S(e)).c&&!e.isInteger())throw Error($+"Exponent not an integer: "+N(e));if(null!=t&&(t=new S(t)),s=e.e>14,!f.c||!f.c[0]||1==f.c[0]&&!f.e&&1==f.c.length||!e.c||!e.c[0])return c=new S(Math.pow(+N(f),s?e.s*(2-ee(e)):+N(e))),t?c.mod(t):c;if(a=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new S(NaN);(n=!a&&f.isInteger()&&t.isInteger())&&(f=f.mod(t))}else{if(e.e>9&&(f.e>0||f.e<-1||(0==f.e?f.c[0]>1||s&&f.c[1]>=24e7:f.c[0]<8e13||s&&f.c[0]<=9999975e7)))return o=f.s<0&&ee(e)?-0:0,f.e>-1&&(o=1/o),new S(a?1/o:o);E&&(o=P(E/Z+2))}for(s?(r=new S(.5),a&&(e.s=1),u=ee(e)):u=(i=Math.abs(+N(e)))%2,c=new S(p);;){if(u){if(!(c=c.times(f)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=z(i/2)))break;u=i%2}else if(I(e=e.times(r),e.e+1,1),e.e>14)u=ee(e);else{if(0==(i=+N(e)))break;u=i%2}f=f.times(f),o?f.c&&f.c.length>o&&(f.c.length=o):n&&(f=f.mod(t))}return n?c:(a&&(c=p.div(c)),t?c.mod(t):o?I(c,E,y,void 0):c)},h.integerValue=function(e){var t=new S(this);return null==e?e=y:Q(e,0,8),I(t,t.e+1,e)},h.isEqualTo=h.eq=function(e,t){return 0===X(this,new S(e,t))},h.isFinite=function(){return!!this.c},h.isGreaterThan=h.gt=function(e,t){return X(this,new S(e,t))>0},h.isGreaterThanOrEqualTo=h.gte=function(e,t){return 1===(t=X(this,new S(e,t)))||0===t},h.isInteger=function(){return!!this.c&&Y(this.e/Z)>this.c.length-2},h.isLessThan=h.lt=function(e,t){return X(this,new S(e,t))<0},h.isLessThanOrEqualTo=h.lte=function(e,t){return-1===(t=X(this,new S(e,t)))||0===t},h.isNaN=function(){return!this.s},h.isNegative=function(){return this.s<0},h.isPositive=function(){return this.s>0},h.isZero=function(){return!!this.c&&0==this.c[0]},h.minus=function(e,t){var r,n,i,o,s=this,a=s.s;if(t=(e=new S(e,t)).s,!a||!t)return new S(NaN);if(a!=t)return e.s=-t,s.plus(e);var u=s.e/Z,c=e.e/Z,f=s.c,l=e.c;if(!u||!c){if(!f||!l)return f?(e.s=-t,e):new S(l?s:NaN);if(!f[0]||!l[0])return l[0]?(e.s=-t,e):new S(f[0]?s:3==y?-0:0)}if(u=Y(u),c=Y(c),f=f.slice(),a=u-c){for((o=a<0)?(a=-a,i=f):(c=u,i=l),i.reverse(),t=a;t--;i.push(0));i.reverse()}else for(n=(o=(a=f.length)<(t=l.length))?a:t,a=t=0;t0)for(;t--;f[r++]=0);for(t=V-1;n>a;){if(f[--n]=0;){for(r=0,h=b[i]%g,p=b[i]/g|0,o=i+(s=u);o>i;)r=((c=h*(c=v[--s]%g)+(a=p*c+(f=v[s]/g|0)*h)%g*g+d[o]+r)/y|0)+(a/g|0)+p*f,d[o--]=c%y;d[o]=r}return r?++n:d.splice(0,1),O(e,d,n)},h.negated=function(){var e=new S(this);return e.s=-e.s||null,e},h.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new S(e,t)).s,!i||!t)return new S(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/Z,s=e.e/Z,a=n.c,u=e.c;if(!o||!s){if(!a||!u)return new S(i/0);if(!a[0]||!u[0])return u[0]?e:new S(a[0]?n:0*i)}if(o=Y(o),s=Y(s),a=a.slice(),i=o-s){for(i>0?(s=o,r=u):(i=-i,r=a),r.reverse();i--;r.push(0));r.reverse()}for((i=a.length)-(t=u.length)<0&&(r=u,u=a,a=r,t=i),i=0;t;)i=(a[--t]=a[t]+u[t]+i)/V|0,a[t]=V===a[t]?0:a[t]%V;return i&&(a=[i].concat(a),++s),O(e,a,s)},h.precision=h.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return Q(e,1,W),null==t?t=y:Q(t,0,8),I(new S(o),e,t);if(!(r=o.c))return null;if(n=(i=r.length-1)*Z+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},h.shiftedBy=function(e){return Q(e,-9007199254740991,q),this.times("1e"+e)},h.squareRoot=h.sqrt=function(){var e,t,n,i,o,s=this,a=s.c,u=s.s,c=s.e,f=d+4,l=new S("0.5");if(1!==u||!a||!a[0])return new S(!u||u<0&&(!a||a[0])?NaN:a?s:1/0);if(0==(u=Math.sqrt(+N(s)))||u==1/0?(((t=K(a)).length+c)%2==0&&(t+="0"),u=Math.sqrt(+t),c=Y((c+1)/2)-(c<0||c%2),n=new S(t=u==1/0?"5e"+c:(t=u.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new S(u+""),n.c[0])for((u=(c=n.e)+f)<3&&(u=0);;)if(o=n,n=l.times(o.plus(r(s,o,f,1))),K(o.c).slice(0,u)===(t=K(n.c)).slice(0,u)){if(n.e0&&d>0){for(o=d%a||a,f=p.substr(0,o);o0&&(f+=c+p.slice(o)),h&&(f="-"+f)}n=l?f+(r.decimalSeparator||"")+((u=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+u+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):f}return(r.prefix||"")+n+(r.suffix||"")},h.toFraction=function(e){var t,n,i,o,s,a,u,c,f,l,h,d,g=this,m=g.c;if(null!=e&&(!(u=new S(e)).isInteger()&&(u.c||1!==u.s)||u.lt(p)))throw Error($+"Argument "+(u.isInteger()?"out of range: ":"not an integer: ")+N(u));if(!m)return new S(g);for(t=new S(p),f=n=new S(p),i=c=new S(p),d=K(m),s=t.e=d.length-g.e-1,t.c[0]=G[(a=s%Z)<0?Z+a:a],e=!e||u.comparedTo(t)>0?s>0?t:f:u,a=b,b=1/0,u=new S(d),c.c[0]=0;l=r(u,t,0,1),1!=(o=n.plus(l.times(i))).comparedTo(e);)n=i,i=o,f=c.plus(l.times(o=f)),c=o,t=u.minus(l.times(o=t)),u=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(f)),n=n.plus(o.times(i)),c.s=f.s=g.s,h=r(f,i,s*=2,y).minus(g).abs().comparedTo(r(c,n,s,y).minus(g).abs())<1?[f,i]:[c,n],b=a,h},h.toNumber=function(){return+N(this)},h.toPrecision=function(e,t){return null!=e&&Q(e,1,W),k(this,e,t,2)},h.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=m?te(K(r.c),o):re(K(r.c),o,"0"):10===e&&A?t=re(K((r=I(new S(r),d+o+1,y)).c),r.e,"0"):(Q(e,2,B.length,"Base"),t=n(re(K(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},h.valueOf=h.toJSON=function(){return N(this)},h._isBigNumber=!0,h[Symbol.toStringTag]="BigNumber",h[Symbol.for("nodejs.util.inspect.custom")]=h.valueOf,null!=t&&S.set(t),S}();const ie=ne;var oe=function(){function t(r){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;e(this,t),this.bytes=r,this.length=this.bytes.length,this.position=n,this.bitPos=i}return o(t,[{key:"clone",value:function(){return new t(this.bytes,this.position,this.bitPos)}},{key:"getBytes",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;if(!(this.position>this.length)){var t=null!==e?this.position+e:this.length,r=this.bytes.slice(this.position,t);return this.position=t,this.bitPos=0,r}}},{key:"readString",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:-1;if(!(this.position>this.length)){-1===e&&(e=this.length-this.position);for(var t="",r=this.position;r1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r=0;if("be"===t)for(var n=this.position;n=this.position;i--)r<<=8,r|=this.bytes[i];return this.position+=e,this.bitPos=0,r}}},{key:"readBits",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"be";if(!(this.position>this.length)){var r,n=0,i=0;for(n=this.bytes[this.position++]&(r=this.bitPos,"be"===t?(1<<8-r)-1:256-(1<>>=this.bitPos),i=8-this.bitPos,this.bitPos=0;ie){var o=i-e;"be"===t?n>>>=o:n&=(1<this.length))if(this.bitPos=0,"number"!=typeof e){var t=e.length,r=e[t-1];this.position=t;for(var n,i=function(e,t){var r=new Array;return e.forEach((function(e,n){r[e]=t-n})),r}(e,t);this.position=0;o--)if(this.bytes[this.position-t+o]!==e[o]){n=!1,this.position+=i[e[o]];break}if(n){this.position-=t;break}}}else for(;++this.positionthis.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsBy",value:function(e){var t=this.position-e;if(t<0||t>this.length)throw new Error("Cannot move to position "+t+" in stream. Out of bounds.");this.position=t,this.bitPos=0}},{key:"moveBackwardsByBits",value:function(e){if(e<=this.bitPos)this.bitPos-=e;else for(this.bitPos>0&&(e-=this.bitPos,this.bitPos=0);e>0;)this.moveBackwardsBy(1),this.bitPos=8,this.moveBackwardsByBits(e),e-=8}},{key:"moveTo",value:function(e){if(e<0||e>this.length)throw new Error("Cannot move to position "+e+" in stream. Out of bounds.");this.position=e,this.bitPos=0}},{key:"hasMore",value:function(){return this.position0&&void 0!==arguments[0]?arguments[0]:0,t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.position;return this.bitPos>0&&t++,this.bytes.slice(e,t)}}])}();function se(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return ae(e,t);var r={}.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?ae(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}function ae(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r>4],u=i[(15&s)>>2],c=(2&s)>>1;if("free"===a||"bad"===a||"reserved"===u){r.moveBackwardsBy(1);break}var f=Math.floor(144*a/u+c);if(r.position+f>r.length){r.moveTo(r.length);break}r.moveForwardsBy(f-3)}return r.carve()}},{name:"MPEG-4 Part 14 audio",extension:"m4a",mime:"audio/m4a",description:"",signature:[{4:102,5:116,6:121,7:112,8:77,9:52,10:65},{0:77,1:52,2:65,3:32}],extractor:null},{name:"Free Lossless Audio Codec",extension:"flac",mime:"audio/x-flac",description:"",signature:{0:102,1:76,2:97,3:67},extractor:null},{name:"Adaptive Multi-Rate audio codec",extension:"amr",mime:"audio/amr",description:"",signature:{0:35,1:33,2:65,3:77,4:82,5:10},extractor:null},{name:"Audacity",extension:"au",mime:"audio/x-au",description:"",signature:{0:100,1:110,2:115,3:46,24:65,25:117,26:100,27:97,28:99,29:105,30:116,31:121,32:66,33:108,34:111,35:99,36:107,37:70,38:105,39:108,40:101},extractor:null},{name:"Audacity Block",extension:"auf",mime:"application/octet-stream",description:"",signature:{0:65,1:117,2:100,3:97,4:99,5:105,6:116,7:121,8:66,9:108,10:111,11:99,12:107,13:70,14:105,15:108,16:101},extractor:null},{name:"Audio Interchange File",extension:"aif",mime:"audio/x-aiff",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:70},extractor:null},{name:"Audio Interchange File (compressed)",extension:"aifc",mime:"audio/x-aifc",description:"",signature:{0:70,1:79,2:82,3:77,8:65,9:73,10:70,11:67},extractor:null}],Documents:[{name:"Portable Document Format",extension:"pdf",mime:"application/pdf",description:"",signature:{0:37,1:80,2:68,3:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.continueUntil([37,37,69,79,70]),r.moveForwardsBy(5),r.consumeIf(13),r.consumeIf(10),r.carve()}},{name:"Portable Document Format (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:65,1:74,2:86,3:66,4:69,5:82,6:105},extractor:null},{name:"Adobe PostScript",extension:"ps,eps,ai,pfa",mime:"application/postscript",description:"",signature:{0:37,1:33,2:80,3:83,4:45,5:65,6:100,7:111,8:98,9:101},extractor:null},{name:"PostScript",extension:"ps",mime:"application/postscript",description:"",signature:{0:37,1:33},extractor:null},{name:"Encapsulated PostScript",extension:"eps,ai",mime:"application/eps",description:"",signature:{0:197,1:208,2:211,3:198},extractor:null},{name:"Rich Text Format",extension:"rtf",mime:"application/rtf",description:"",signature:{0:123,1:92,2:114,3:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;if(123!==r.readInt(1))throw new Error("Not a valid RTF file");for(n++;n>0&&r.hasMore();)switch(r.readInt(1)){case 123:n++;break;case 125:n--;break;case 92:r.consumeIf(92),r.position++}return r.carve()}},{name:"Microsoft Office document/OLE2",extension:"ole2,doc,xls,dot,ppt,xla,ppa,pps,pot,msi,sdw,db,vsd,msg",mime:"application/msword,application/vnd.ms-excel,application/vnd.ms-powerpoint",description:"Microsoft Office documents",signature:{0:208,1:207,2:17,3:224,4:161,5:177,6:26,7:225},extractor:null},{name:"Microsoft Office document/OLE2 (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:48,1:77,2:56,3:82,4:52,5:75,6:71,7:120},extractor:null},{name:"Microsoft Office 2007+ document",extension:"docx,xlsx,pptx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/vnd.openxmlformats-officedocument.presentationml.presentation",description:"",signature:{38:95,39:84,40:121,41:112,42:101,43:115,44:93,45:46,46:120,47:109,48:108},extractor:ce},{name:"Microsoft Access database",extension:"mdb,mda,mde,mdt,fdb,psa",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:74,14:101,15:116},extractor:null},{name:"Microsoft Access 2007+ database",extension:"accdb,accde,accda,accdu",mime:"application/msaccess",description:"",signature:{0:0,1:1,2:0,3:0,4:83,5:116,6:97,7:110,8:100,9:97,10:114,11:100,12:32,13:65,14:67,15:69,16:32},extractor:null},{name:"Microsoft OneNote document",extension:"one",mime:"application/onenote",description:"",signature:{0:228,1:82,2:92,3:123,4:140,5:216,6:167,7:77,8:174,9:177,10:83,11:120,12:208,13:41,14:150,15:211},extractor:null},{name:"Outlook Express database",extension:"dbx",mime:"application/octet-stream",description:"",signature:{0:207,1:173,2:18,3:254,4:[48,197,198,199],11:17},extractor:null},{name:"Personal Storage Table (Outlook)",extension:"pst,ost,fdb,pab",mime:"application/octet-stream",description:"",signature:{0:33,1:66,2:68,3:78},extractor:null},{name:"Microsoft Exchange Database",extension:"edb",mime:"application/octet-stream",description:"",signature:{4:239,5:205,6:171,7:137,8:[32,35],9:6,10:0,11:0,12:[0,1],13:0,14:0,15:0},extractor:null},{name:"WordPerfect document",extension:"wpd,wp,wp5,wp6,wpp,bk!,wcm",mime:"application/wordperfect",description:"",signature:{0:255,1:87,2:80,3:67,7:[0,1,2],8:1,9:10},extractor:null},{name:"EPUB e-book",extension:"epub",mime:"application/epub+zip",description:"",signature:{0:80,1:75,2:3,3:4,30:109,31:105,32:109,33:101,34:116,35:121,36:112,37:101,38:97,39:112,40:112,41:108,42:105,43:99,44:97,45:116,46:105,47:111,48:110,49:47,50:101,51:112,52:117,53:98,54:43,55:122,56:105,57:112},extractor:ce}],Applications:[{name:"Windows Portable Executable",extension:"exe,dll,drv,vxd,sys,ocx,vbx,com,fon,scr",mime:"application/vnd.microsoft.portable-executable",description:"",signature:{0:77,1:90,3:[0,1,2],5:[0,1,2]},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(60);var n=r.readInt(4,"le");r.moveTo(n),r.moveForwardsBy(6);var i=r.readInt(2,"le");r.moveForwardsBy(16);var o=523===r.readInt(2,"le")?112:96;r.moveForwardsBy(o-2),r.moveForwardsBy(32);var s=r.readInt(4,"le"),a=r.readInt(4,"le");if(s>0)return r.moveTo(s+a),r.carve();r.moveForwardsBy(88),r.moveForwardsBy(40*(i-1)),r.moveForwardsBy(16);var u=r.readInt(4,"le"),c=r.readInt(4,"le");return r.moveTo(c+u),r.carve()}},{name:"Executable and Linkable Format",extension:"elf,bin,axf,o,prx,so",mime:"application/x-executable",description:"Executable and Linkable Format file. No standard file extension.",signature:{0:127,1:69,2:76,3:70},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(4);var n=1===r.readInt(1),i=1===r.readInt(1)?"le":"be";r.moveForwardsBy(n?26:34);var o=n?r.readInt(4,i):r.readInt(8,i);r.moveForwardsBy(10);var s=r.readInt(2,i),a=r.readInt(2,i);return r.moveTo(o),r.moveForwardsBy(s*a),r.carve()}},{name:"MacOS Mach-O object",extension:"dylib",mime:"application/octet-stream",description:"",signature:[{0:202,1:254,2:186,3:190,4:0,5:0,6:0,7:[1,2,3]},{0:206,1:250,2:237,3:254,4:7,5:0,6:0,7:0,8:[1,2,3]}],extractor:fe},{name:"MacOS Mach-O 64-bit object",extension:"dylib",mime:"application/octet-stream",description:"",signature:{0:207,1:250,2:237,3:254},extractor:fe},{name:"Adobe Flash",extension:"swf",mime:"application/x-shockwave-flash",description:"",signature:{0:[67,70],1:87,2:83},extractor:null},{name:"Java Class",extension:"class",mime:"application/java-vm",description:"",signature:{0:202,1:254,2:186,3:190},extractor:null},{name:"Dalvik Executable",extension:"dex",mime:"application/octet-stream",description:"Dalvik Executable as used by Android",signature:{0:100,1:101,2:120,3:10,4:48,5:51,6:53,7:0},extractor:null},{name:"Google Chrome Extension",extension:"crx",mime:"application/crx",description:"Google Chrome extension or packaged app",signature:{0:67,1:114,2:50,3:52},extractor:null}],Archives:[{name:"PKZIP archive",extension:"zip",mime:"application/zip",description:"",signature:{0:80,1:75,2:[3,5,7],3:[4,6,8]},extractor:ce},{name:"PKZIP archive (under Base64)",extension:"B64",mime:"application/octet-stream",description:"",signature:{0:85,1:69,2:115,3:68,4:66,5:66},extractor:null},{name:"TAR archive",extension:"tar",mime:"application/x-tar",description:"",signature:{257:117,258:115,259:116,260:97,261:114},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=function(){if(r.moveForwardsBy(257),r.getBytes(5).join("")!==[117,115,116,97,114].join(""))return r.moveBackwardsBy(262),1;r.moveBackwardsBy(138);var e=0;r.getBytes(11).forEach((function(t,r){e+=(t-48).toString()})),e=512*Math.ceil(parseInt(e,8)/512),r.moveForwardsBy(e+377)};r.hasMore()&&!n(););return r.consumeWhile(0),r.carve()}},{name:"Roshal Archive",extension:"rar",mime:"application/x-rar-compressed",description:"",signature:{0:82,1:97,2:114,3:33,4:26,5:7,6:[0,1]},extractor:null},{name:"Gzip",extension:"gz",mime:"application/gzip",description:"",signature:{0:31,1:139,2:8},extractor:function(e,t){var r=new oe(e.slice(t));r.moveForwardsBy(3);var n=r.readInt(1);if(r.moveForwardsBy(4),r.readInt(1),r.moveForwardsBy(1),4&n){var i=r.readInt(2,"le");r.moveForwardsby(i)}return 8&n&&(r.continueUntil(0),r.moveForwardsBy(1)),16&n&&(r.continueUntil(0),r.moveForwardsBy(1)),2&n&&r.moveForwardsBy(2),ge(r),r.moveForwardsBy(8),r.carve()}},{name:"Bzip2",extension:"bz2",mime:"application/x-bzip2",description:"",signature:{0:66,1:90,2:104},extractor:function(e,t){for(var r=new oe(e.slice(t)),n=[[119,36,83,133,9],[238,72,167,10,18],[220,145,78,20,36],[185,34,156,40,72],[114,69,56,80,144],[187,146,41,194,132],[93,201,20,225,66],[46,228,138,112,161],[23,114,69,56,80]],i=0;i=2368&&r.moveForwardsBy(4);var a=r.readInt(1,"be");if(r.moveForwardsBy(a),64&s){var u=r.readInt(4,"be");r.moveForwardsBy(u)}for(r.moveForwardsBy(4);r.hasMore();){var c=r.readInt(4,"be");if(0===c)break;var f=r.readInt(4,"be"),l=c===f?i:i+n;r.moveForwardsBy(f+4*l)}return r.carve()}},{name:"Linux deb package",extension:"deb",mime:"application/vnd.debian.binary-package",description:"",signature:{0:33,1:60,2:97,3:114,4:99,5:104,6:62},extractor:function(e,t){var r=new oe(e.slice(t));for(r.moveForwardsBy(8);r.hasMore();){r.moveForwardsBy(48);var n,i="",o=se(r.getBytes(10));try{for(o.s();!(n=o.n()).done;){var s=n.value;i+=String.fromCharCode(s)}}catch(e){o.e(e)}finally{o.f()}i=parseInt(i.trim(),10),r.moveForwardsBy(2),r.moveForwardsBy(i)}return r.carve()}},{name:"Apple Disk Image",extension:"dmg",mime:"application/x-apple-diskimage",description:"",signature:{0:120,1:1,2:115,3:13,4:98,5:98,6:96},extractor:null}],Miscellaneous:[{name:"UTF-8 text",extension:"txt",mime:"text/plain",description:"UTF-8 encoded Unicode byte order mark, commonly but not exclusively seen in text files.",signature:{0:239,1:187,2:191},extractor:null},{name:"UTF-32 LE text",extension:"utf32le",mime:"charset/utf32le",description:"Little-endian UTF-32 encoded Unicode byte order mark.",signature:{0:255,1:254,2:0,3:0},extractor:null},{name:"UTF-16 LE text",extension:"utf16le",mime:"charset/utf16le",description:"Little-endian UTF-16 encoded Unicode byte order mark.",signature:{0:255,1:254},extractor:null},{name:"Web Open Font Format",extension:"woff",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:70,4:0,5:1,6:0,7:0},extractor:null},{name:"Web Open Font Format 2",extension:"woff2",mime:"application/font-woff",description:"",signature:{0:119,1:79,2:70,3:50,4:0,5:1,6:0,7:0},extractor:null},{name:"Embedded OpenType font",extension:"eot",mime:"application/octet-stream",description:"",signature:[{8:2,9:0,10:1,34:76,35:80},{8:1,9:0,10:0,34:76,35:80},{8:2,9:0,10:2,34:76,35:80}],extractor:null},{name:"TrueType Font",extension:"ttf",mime:"application/font-sfnt",description:"",signature:{0:0,1:1,2:0,3:0,4:0},extractor:null},{name:"OpenType Font",extension:"otf",mime:"application/font-sfnt",description:"",signature:{0:79,1:84,2:84,3:79,4:0},extractor:null},{name:"SQLite",extension:"sqlite",mime:"application/x-sqlite3",description:"",signature:{0:83,1:81,2:76,3:105},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(16);var n=r.readInt(2);r.moveTo(28);var i=r.readInt(4);return r.moveTo(n*i),r.carve()}},{name:"BitTorrent link",extension:"torrent",mime:"application/x-bittorrent",description:"",signature:[{0:100,1:56,2:58,3:97,4:110,5:110,6:111,7:117,8:110,9:99,10:101,11:35,12:35,13:58},{0:100,1:52,2:58,3:105,4:110,5:102,6:111,7:100,8:[52,53,54],9:58}],extractor:null},{name:"Cryptocurrency wallet",extension:"wallet",mime:"application/octet-stream",description:"",signature:{0:0,1:0,2:0,3:0,4:1,5:0,6:0,7:0,8:0,9:0,10:0,11:0,12:98,13:49,14:5,15:0},extractor:null},{name:"Registry fragment",extension:"hbin",mime:"application/octet-stream",description:"",signature:{0:104,1:98,2:105,3:110,4:0},extractor:null},{name:"Registry script",extension:"rgs",mime:"application/octet-stream",description:"",signature:{0:72,1:75,2:67,3:82,4:13,5:10,6:92,7:123},extractor:null},{name:"WinNT Registry Hive",extension:"registry",mime:"application/octet-stream",description:"",signature:{0:114,1:101,2:103,3:102},extractor:null},{name:"Windows Event Log",extension:"evt",mime:"application/octet-stream",description:"",signature:{0:48,1:0,2:0,3:0,4:76,5:102,6:76,7:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(20);var n=r.readInt(4,"le");r.moveTo(n);var i=r.readInt(4,"le");return r.moveForwardsBy(i-4),r.carve()}},{name:"Windows Event Log",extension:"evtx",mime:"application/octet-stream",description:"",signature:{0:69,1:108,2:102,3:70,4:105,5:108,6:101},extractor:function(e,t){var r=new oe(e.slice(t));r.moveTo(40);var n=r.readInt(4,"le")-44;for(r.moveForwardsBy(n);r.hasMore()&&r.getBytes(7).join("")===[69,108,102,67,104,110,107].join("");)r.moveForwardsBy(65529);return r.consumeWhile(0),r.carve()}},{name:"Windows Pagedump",extension:"dmp",mime:"application/octet-stream",description:"",signature:{0:80,1:65,2:71,3:69,4:68,5:85,6:[77,54],7:[80,52]},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(112),r.moveTo(4096*(r.readInt(4,"le")+1)),r.carve()}},{name:"Windows Prefetch",extension:"pf",mime:"application/x-pf",description:"",signature:{0:[17,23,26],1:0,2:0,3:0,4:83,5:67,6:67,7:65},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(12),r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"Windows Prefetch (Win 10)",extension:"pf",mime:"application/x-pf",description:"",signature:{0:77,1:65,2:77,3:4,7:0},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(r.readInt(4,"be")),r.carve()}},{name:"PList (XML)",extension:"plist",mime:"application/xml",description:"",signature:{39:60,40:33,41:68,42:79,43:67,44:84,45:89,46:80,47:69,48:32,49:112,50:108,51:105,52:115,53:116},extractor:function(e,t){var r=new oe(e.slice(t)),n=0;for(r.continueUntil([60,112,108,105,115,116]),r.moveForwardsBy(6),n++;n>0&&r.hasMore();)60===r.readInt(1)&&(r.getBytes(5).join("")===[112,108,105,115,116].join("")?n++:r.moveBackwardsBy(5),r.getBytes(7).join("")===[47,112,108,105,115,116,62].join("")?n--:r.moveBackwardsBy(7));return r.consumeIf(10),r.carve()}},{name:"PList (binary)",extension:"bplist,plist,ipmeta,abcdp,mdbackup,mdinfo,strings,nib,ichat,qtz,webbookmark,webhistory",mime:"application/x-plist",description:"",signature:{0:98,1:112,2:108,3:105,4:115,5:116,6:48,7:48},extractor:null},{name:"MacOS X Keychain",extension:"keychain",mime:"application/octet-stream",description:"",signature:{0:107,1:121,2:99,3:104,4:0,5:1},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(20),r.moveForwardsBy(r.readInt(4)),r.carve()}},{name:"TCP Packet",extension:"tcp",mime:"application/tcp",description:"",signature:{12:8,13:0,14:69,15:0,21:0,22:function(e){return e>=1&&e<=128},23:6},extractor:null},{name:"UDP Packet",extension:"udp",mime:"application/udp",description:"",signature:{12:8,13:0,14:69,15:0,16:[0,1,2,3,4,5],22:function(e){return e>=1&&e<=128},23:17},extractor:null},{name:"Compiled HTML",extension:"chm,chw,chi",mime:"application/vnd.ms-htmlhelp",description:"",signature:{0:73,1:84,2:83,3:70,4:3,5:0,6:0,7:0},extractor:null},{name:"Windows Password",extension:"pwl",mime:"application/octet-stream",description:"",signature:{0:227,1:130,2:133,3:150},extractor:null},{name:"Bitlocker recovery key",extension:"bitlocker",mime:"application/octet-stream",description:"",signature:{0:255,1:254,2:66,3:0,4:105,5:0,6:116,7:0,8:76,9:0,10:111,11:0,12:99,13:0,14:107,15:0,16:101,17:0,18:114,19:0,20:32,21:0},extractor:null},{name:"Certificate",extension:"cer,cat,p7b,p7c,p7m,p7s,swz,rsa,crl,crt,der",mime:"application/pkix-cert",description:"",signature:{0:48,1:130,4:[6,10,48]},extractor:null},{name:"Certificate",extension:"cat,swz,p7m",mime:"application/vnd.ms-pki.seccat",description:"",signature:{0:48,1:131,2:function(e){return 0!==e},5:6,6:9},extractor:null},{name:"PGP pubring",extension:"pkr,gpg",mime:"application/pgp-keys",description:"",signature:{0:153,1:1,2:[13,162],3:4},extractor:null},{name:"PGP secring",extension:"skr",mime:"application/pgp-keys",description:"",signature:[{0:149,1:1,2:207,3:4},{0:149,1:3,2:198,3:4},{0:149,1:5,2:134,3:4}],extractor:null},{name:"PGP Safe",extension:"pgd",mime:"application/pgp-keys",description:"",signature:{0:80,1:71,2:80,3:100,4:77,5:65,6:73,7:78,8:96,9:1,10:0},extractor:null},{name:"Task Scheduler",extension:"job",mime:"application/octet-stream",description:"",signature:{0:[0,1,2,3],1:[5,6],2:1,3:0,20:70,21:0},extractor:null},{name:"Windows Shortcut",extension:"lnk",mime:"application/x-ms-shortcut",description:"",signature:{0:76,1:0,2:0,3:0,4:1,5:20,6:2,7:0,8:0,9:0,10:0,11:0,12:192,13:0,14:0,15:0,16:0,17:0,18:0,19:70},extractor:function(e,t){var r=new oe(e.slice(t));return r.moveTo(52),r.moveTo(r.readInt(4,"le")),r.carve()}},{name:"Bash",extension:"bash",mime:"application/bash",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:98,8:97,9:115,10:104},extractor:null},{name:"Shell",extension:"sh",mime:"application/sh",description:"",signature:{0:35,1:33,2:47,3:98,4:105,5:110,6:47,7:115,8:104},extractor:null},{name:"Python",extension:"py,pyc,pyd,pyo,pyw,pyz",mime:"application/python",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:121,13:116,14:104,15:111,16:110,17:[50,51,10,13]},extractor:null},{name:"Ruby",extension:"rb",mime:"application/ruby",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:114,12:117,13:98,14:121},extractor:null},{name:"perl",extension:"pl,pm,t,pod",mime:"application/perl",description:"",signature:{0:35,1:33,2:47,3:117,4:115,5:114,6:47,7:98,8:105,9:110,10:47,11:112,12:101,13:114,14:108},extractor:null},{name:"php",extension:"php,phtml,php3,php4,php5,php7,phps,php-s,pht,phar",mime:"application/php",description:"",signature:{0:60,1:63,2:112,3:104,4:112},extractor:null},{name:"Smile",extension:"sml",mime:"\tapplication/x-jackson-smile",description:"",signature:{0:58,1:41,2:10},extractor:null},{name:"Lua Bytecode",extension:"luac",mime:"application/x-lua",description:"",signature:{0:27,1:76,2:117,3:97},extractor:null},{name:"WebAssembly binary",extension:"wasm",mime:"application/octet-stream",description:"",signature:{0:0,1:97,2:115,3:109},extractor:null}]};function ce(e,t){var r=new oe(e.slice(t));r.continueUntil([80,75,5,6]),r.moveForwardsBy(20);var n=r.readInt(2,"le");return r.moveForwardsBy(n),r.carve()}function fe(e,t){var r="207250237254",n=new oe(e.slice(t)),i=n.getBytes(4).join("");return n.moveTo(function(e,t,r){var n=28;t&&(n+=4),e.moveTo(16);var i=e.readInt(4,r);return function(e,t,r,n){for(var i=0,o=0;o0&&e.moveForwardsBy(1)}var me=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0],ve=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13];function be(e,t,r){for(var n,i=0;(n=we(e,t))&&256!==n;){if(++i>1e4)throw new Error("Caught in probable infinite loop while parsing Huffman Block");n<256||(e.readBits(me[n-257],"le"),n=we(e,r),e.readBits(ve[n],"le"))}}function _e(e){for(var t=Math.max.apply(Math,e),r=Math.min.apply(Math,e),n=1<>=1;for(var h=o<<16|u,p=c;p>>16;if(u>s)throw new Error(`Invalid Huffman Code length while parsing DEFLATE block at pos ${e.position}: ${u}`);return e.moveBackwardsByBits(s-u),65535&a}function Ee(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0;if(e.length){for(var n=0;n2&&void 0!==arguments[2]?arguments[2]:0;for(var n in e){var i=parseInt(n,10)+r;switch(typeof e[n]){case"number":if(t[i]!==e[n])return!1;break;case"object":if(e[n].indexOf(t[i])<0)return!1;break;case"function":if(!e[n](t[i]))return!1;break;default:throw new Error(`Unrecognised signature type at offset ${n}`)}}return!0}const Be=function(){return o((function t(){e(this,t)}),null,[{key:"checkForValue",value:function(e){if(void 0===e)throw new Error("only use translation methods with .bind")}},{key:"toArrayBuffer",value:function(){throw new Error("toArrayBuffer has not been implemented")}},{key:"fromArrayBuffer",value:function(){throw new Error("fromArrayBuffer has not been implemented")}}])}();function Ae(e,t,r){return t=a(t),s(e,Se()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Se(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Se=function(){return!!e})()}const ke=function(t){function r(){return e(this,r),Ae(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new Uint8Array(this.value).buffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=Array.prototype.slice.call(new Uint8Array(this.value))}}])}(Be);function Te(e,t,r){return t=a(t),s(e,Oe()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Oe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Oe=function(){return!!e})()}const Ie=function(t){function r(){return e(this,r),Te(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=ie.isBigNumber(this.value)?U.strToArrayBuffer(this.value.toFixed()):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value);try{this.value=new ie(U.arrayBufferToStr(this.value))}catch(e){this.value=new ie(NaN)}}}])}(Be);function Ne(e,t,r){return t=a(t),s(e,Fe()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Fe(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Fe=function(){return!!e})()}const Re=function(t){function r(){return e(this,r),Ne(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){var e=this;if(r.checkForValue(this.value),!F())return new Promise((function(t,r){U.readFile(e.value).then((function(t){return e.value=t.buffer})).then(t).catch(r)}));this.value=U.readFileSync(this.value)}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=new File(this.value,"unknown")}}])}(Be);function Le(e,t,r){return t=a(t),s(e,Ue()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Ue(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ue=function(){return!!e})()}const Ce=function(t){function r(){return e(this,r),Le(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(this.value):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.arrayBufferToStr(this.value):""}}])}(Be);function je(e,t,r){return t=a(t),s(e,De()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function De(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(De=function(){return!!e})()}const Me=function(t){function r(){return e(this,r),je(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=this.value?U.strToArrayBuffer(U.unescapeHtml(U.stripHtmlTags(this.value,!0))):new ArrayBuffer}}])}(Ce);function Pe(e,t,r){return t=a(t),s(e,ze()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function ze(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(ze=function(){return!!e})()}const $e=function(t){function r(){return e(this,r),Pe(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:function(){r.checkForValue(this.value),this.value=void 0!==this.value?U.strToArrayBuffer(JSON.stringify(this.value,null,4)):new ArrayBuffer}},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=JSON.parse(U.arrayBufferToStr(this.value))}}])}(Be);function He(e,t,r){return t=a(t),s(e,Ve()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function Ve(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(Ve=function(){return!!e})()}const Ze=function(t){function r(){return e(this,r),He(this,r,arguments)}return c(r,t),o(r,null,[{key:"toArrayBuffer",value:(i=l(p().mark((function e(){return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r.checkForValue(this.value),!F()){e.next=5;break}this.value=this.value.map((function(e){return Uint8Array.from(e.data)})),e.next=8;break;case 5:return e.next=7,r.concatenateTypedArraysWithTypedElements.apply(r,g(this.value));case 7:this.value=e.sent;case 8:case"end":return e.stop()}}),e,this)}))),function(){return i.apply(this,arguments)})},{key:"fromArrayBuffer",value:function(){r.checkForValue(this.value),this.value=[new File(this.value,"unknown")]}},{key:"concatenateTypedArraysWithTypedElements",value:(n=l(p().mark((function e(){var t,r,n,i,o,s,a,u,c,f,l,h,d,y=arguments;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:for(t=0,r=y.length,n=new Array(r),i=0;i0&&void 0!==arguments[0]?arguments[0]:null,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:null;if(e(this,t),this.value=new ArrayBuffer(0),this.type=t.ARRAY_BUFFER,r&&Object.prototype.hasOwnProperty.call(r,"value")&&Object.prototype.hasOwnProperty.call(r,"type"))this.set(r.value,r.type);else if(r&&null!==n)this.set(r,n);else if(r){var i=t.typeEnum(r.constructor.name);this.set(r,i)}}return o(t,[{key:"get",value:function(e){var r=this;return"string"==typeof e&&(e=t.typeEnum(e)),this.type!==e?F()?(this._translate(e),this.value):new Promise((function(t,n){r._translate(e).then((function(){t(r.value)})).catch(n)})):this.value}},{key:"set",value:function(e,r){if("string"==typeof r&&(r=t.typeEnum(r)),v().debug("Dish type: "+t.enumLookup(r)),this.value=e,this.type=r,!this.valid()){var n=U.truncate(JSON.stringify(this.value),25);throw new D(`Data is not a valid ${t.enumLookup(r)}: ${n}`)}}},{key:"presentAs",value:function(e){return this.clone().get(e)}},{key:"detectDishType",value:function(){var e=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Object.keys(ue);if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),!(e&&e.length>1))return[];var r=[],n={};for(var i in ue)t.includes(i)&&(n[i]=ue[i]);for(var o in n)n[o].forEach((function(t){Ee(t.signature,e)&&r.push(t)}));return r}(new Uint8Array(this.value.slice(0,2048)));return e.length&&e[0].mime&&"text/plain"===e[0].mime?e[0].mime:null}},{key:"getTitle",value:(r=l(p().mark((function e(r){var n,i;return p().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n="",e.t0=this.type,e.next=e.t0===t.FILE?4:e.t0===t.LIST_FILE?6:e.t0===t.JSON?8:e.t0===t.NUMBER||e.t0===t.BIG_NUMBER?10:e.t0===t.ARRAY_BUFFER||e.t0===t.BYTE_ARRAY?12:15;break;case 4:return n=this.value.name,e.abrupt("break",26);case 6:return n=`${this.value.length} file(s)`,e.abrupt("break",26);case 8:return n="application/json",e.abrupt("break",26);case 10:return n=this.value.toString(),e.abrupt("break",26);case 12:if(null===(n=this.detectDishType())){e.next=15;break}return e.abrupt("break",26);case 15:return e.prev=15,(i=this.clone()).value=i.value.slice(0,256),e.next=20,i.get(t.STRING);case 20:n=e.sent,e.next=26;break;case 23:e.prev=23,e.t1=e.catch(15),v().error(`${t.enumLookup(this.type)} cannot be sliced. ${e.t1}`);case 26:return e.abrupt("return",n.slice(0,r));case 27:case"end":return e.stop()}}),e,this,[[15,23]])}))),function(e){return r.apply(this,arguments)})},{key:"valid",value:function(){switch(this.type){case t.BYTE_ARRAY:if(!(this.value instanceof Uint8Array||this.value instanceof Array))return!1;for(var e=0;e255)return!1;return!0;case t.STRING:case t.HTML:return"string"==typeof this.value;case t.NUMBER:return"number"==typeof this.value;case t.ARRAY_BUFFER:return this.value instanceof ArrayBuffer;case t.BIG_NUMBER:if(ie.isBigNumber(this.value))return!0;if(Object.keys(this.value).sort().equals(["c","e","s"])){var r=new ie;return r.c=this.value.c,r.e=this.value.e,r.s=this.value.s,this.value=r,!0}return!1;case t.JSON:return!0;case t.FILE:return this.value instanceof File;case t.LIST_FILE:return this.value instanceof Array&&this.value.reduce((function(e,t){return e&&t instanceof File}),!0);default:return!1}}},{key:"size",get:function(){switch(this.type){case t.BYTE_ARRAY:case t.STRING:case t.HTML:return this.value.length;case t.NUMBER:case t.BIG_NUMBER:return this.value.toString().length;case t.ARRAY_BUFFER:return this.value.byteLength;case t.JSON:return JSON.stringify(this.value).length;case t.FILE:return this.value.size;case t.LIST_FILE:return this.value.reduce((function(e,t){return e+t.size}),0);default:return-1}}},{key:"clone",value:function(){var e=new t;switch(this.type){case t.STRING:case t.HTML:case t.NUMBER:case t.BIG_NUMBER:e.set(this.value,this.type);break;case t.BYTE_ARRAY:case t.JSON:e.set(JSON.parse(JSON.stringify(this.value)),this.type);break;case t.ARRAY_BUFFER:e.set(this.value.slice(0),this.type);break;case t.FILE:e.set(new File([this.value],this.value.name,{type:this.value.type,lastModified:this.value.lastModified}),this.type);break;case t.LIST_FILE:e.set(this.value.map((function(e){return new File([e],e.name,{type:e.type,lastModified:e.lastModified})})),this.type);break;default:throw new D("Cannot clone Dish, unknown type")}return e}},{key:"_translate",value:function(e){var r=this;if(v().debug(`Translating Dish from ${t.enumLookup(this.type)} to ${t.enumLookup(e)}`),!F())return new Promise((function(n,i){r._toArrayBuffer().then((function(){return r.type=t.ARRAY_BUFFER})).then((function(){r._fromArrayBuffer(e),n()})).catch(i)}));this._toArrayBuffer(),this.type=t.ARRAY_BUFFER,this._fromArrayBuffer(e)}},{key:"_toArrayBuffer",value:function(){var e=this,r={browser:{[t.STRING]:function(){return Promise.resolve(Ce.toArrayBuffer.bind(e)())},[t.NUMBER]:function(){return Promise.resolve(Je.toArrayBuffer.bind(e)())},[t.HTML]:function(){return Promise.resolve(Me.toArrayBuffer.bind(e)())},[t.ARRAY_BUFFER]:function(){return Promise.resolve()},[t.BIG_NUMBER]:function(){return Promise.resolve(Ie.toArrayBuffer.bind(e)())},[t.JSON]:function(){return Promise.resolve($e.toArrayBuffer.bind(e)())},[t.FILE]:function(){return Re.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Promise.resolve(Ze.toArrayBuffer.bind(e)())},[t.BYTE_ARRAY]:function(){return Promise.resolve(ke.toArrayBuffer.bind(e)())}},node:{[t.STRING]:function(){return Ce.toArrayBuffer.bind(e)()},[t.NUMBER]:function(){return Je.toArrayBuffer.bind(e)()},[t.HTML]:function(){return Me.toArrayBuffer.bind(e)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return Ie.toArrayBuffer.bind(e)()},[t.JSON]:function(){return $e.toArrayBuffer.bind(e)()},[t.FILE]:function(){return Re.toArrayBuffer.bind(e)()},[t.LIST_FILE]:function(){return Ze.toArrayBuffer.bind(e)()},[t.BYTE_ARRAY]:function(){return ke.toArrayBuffer.bind(e)()}}};try{return r[F()?"node":"browser"][this.type]()}catch(e){throw new D(`Error translating from ${t.enumLookup(this.type)} to ArrayBuffer: ${e}`)}}},{key:"_fromArrayBuffer",value:function(e){var r=this,n={[t.STRING]:function(){return Ce.fromArrayBuffer.bind(r)()},[t.NUMBER]:function(){return Je.fromArrayBuffer.bind(r)()},[t.HTML]:function(){return Me.fromArrayBuffer.bind(r)()},[t.ARRAY_BUFFER]:function(){},[t.BIG_NUMBER]:function(){return Ie.fromArrayBuffer.bind(r)()},[t.JSON]:function(){return $e.fromArrayBuffer.bind(r)()},[t.FILE]:function(){return Re.fromArrayBuffer.bind(r)()},[t.LIST_FILE]:function(){return Ze.fromArrayBuffer.bind(r)()},[t.BYTE_ARRAY]:function(){return ke.fromArrayBuffer.bind(r)()}};try{n[e](),this.type=e}catch(r){throw new D(`Error translating from ArrayBuffer to ${t.enumLookup(e)}: ${r}`)}}}],[{key:"typeEnum",value:function(e){switch(e.toLowerCase()){case"bytearray":case"byte array":return t.BYTE_ARRAY;case"string":return t.STRING;case"number":return t.NUMBER;case"html":return t.HTML;case"arraybuffer":case"array buffer":return t.ARRAY_BUFFER;case"bignumber":case"big number":return t.BIG_NUMBER;case"json":case"object":return t.JSON;case"file":return t.FILE;case"list":return t.LIST_FILE;default:throw new D("Invalid data type string. No matching enum.")}}},{key:"enumLookup",value:function(e){switch(e){case t.BYTE_ARRAY:return"byteArray";case t.STRING:return"string";case t.NUMBER:return"number";case t.HTML:return"html";case t.ARRAY_BUFFER:return"ArrayBuffer";case t.BIG_NUMBER:return"BigNumber";case t.JSON:return"JSON";case t.FILE:return"File";case t.LIST_FILE:return"List";default:throw new D("Invalid data type enum. No matching type.")}}}]);var r}();We.BYTE_ARRAY=0,We.STRING=1,We.NUMBER=2,We.HTML=3,We.ARRAY_BUFFER=4,We.BIG_NUMBER=5,We.JSON=6,We.FILE=7,We.LIST_FILE=8;const Ye=We,Ke=function(){function t(r){e(this,t),this.name="",this.type="",this._value=null,this.disabled=!1,this.hint="",this.rows=0,this.toggleValues=[],this.target=null,this.defaultIndex=0,this.maxLength=null,this.min=null,this.max=null,this.step=1,r&&this._parseConfig(r)}return o(t,[{key:"_parseConfig",value:function(e){this.name=e.name,this.type=e.type,this.defaultValue=e.value,this.disabled=!!e.disabled,this.hint=e.hint||!1,this.rows=e.rows||!1,this.toggleValues=e.toggleValues,this.target=void 0!==e.target?e.target:null,this.defaultIndex=void 0!==e.defaultIndex?e.defaultIndex:0,this.maxLength=e.maxLength||null,this.min=e.min,this.max=e.max,this.step=e.step}},{key:"config",get:function(){return this._value}},{key:"value",get:function(){return this._value},set:function(e){this._value=t.prepare(e,this.type)}}],[{key:"prepare",value:function(e,t){var r;switch(t){case"binaryString":case"binaryShortString":case"editableOption":case"editableOptionShort":return U.parseEscapedChars(e);case"byteArray":return"string"==typeof e?S(e=e.replace(/\s+/g,"")):e;case"number":if(null===e)return e;if(r=parseFloat(e),isNaN(r))throw"Invalid ingredient value. Not a number: "+U.truncate(e.toString(),10);return r;default:return e}}}])}();var Xe=function(){return o((function t(){e(this,t),this._inputType=-1,this._outputType=-1,this._presentType=-1,this._breakpoint=!1,this._disabled=!1,this._flowControl=!1,this._manualBake=!1,this._ingList=[],this.name="",this.module="",this.description="",this.infoURL=null}),[{key:"run",value:function(e,t){return e}},{key:"highlight",value:function(e,t){return!1}},{key:"highlightReverse",value:function(e,t){return!1}},{key:"present",value:function(e,t){return e}},{key:"inputType",get:function(){return Ye.enumLookup(this._inputType)},set:function(e){this._inputType=Ye.typeEnum(e)}},{key:"outputType",get:function(){return Ye.enumLookup(this._outputType)},set:function(e){this._outputType=Ye.typeEnum(e),this._presentType<0&&(this._presentType=this._outputType)}},{key:"presentType",get:function(){return Ye.enumLookup(this._presentType)},set:function(e){this._presentType=Ye.typeEnum(e)}},{key:"args",get:function(){return this._ingList.map((function(e){var t={name:e.name,type:e.type,value:e.defaultValue};return e.toggleValues&&(t.toggleValues=e.toggleValues),e.hint&&(t.hint=e.hint),e.rows&&(t.rows=e.rows),e.disabled&&(t.disabled=e.disabled),e.target&&(t.target=e.target),e.defaultIndex&&(t.defaultIndex=e.defaultIndex),e.maxLength&&(t.maxLength=e.maxLength),"number"==typeof e.min&&(t.min=e.min),"number"==typeof e.max&&(t.max=e.max),e.step&&(t.step=e.step),t}))},set:function(e){var t=this;e.forEach((function(e){var r=new Ke(e);t.addIngredient(r)}))}},{key:"config",get:function(){return{op:this.name,args:this._ingList.map((function(e){return e.config}))}}},{key:"addIngredient",value:function(e){this._ingList.push(e)}},{key:"ingValues",get:function(){return this._ingList.map((function(e){return e.value}))},set:function(e){var t=this;e.forEach((function(e,r){t._ingList[r].value=e}))}},{key:"breakpoint",get:function(){return this._breakpoint},set:function(e){this._breakpoint=!!e}},{key:"disabled",get:function(){return this._disabled},set:function(e){this._disabled=!!e}},{key:"flowControl",get:function(){return this._flowControl},set:function(e){this._flowControl=!!e}},{key:"manualBake",get:function(){return this._manualBake},set:function(e){this._manualBake=!!e}}])}();const Qe=Xe;var et=r(23809),tt=r.n(et);function rt(e,t,r){return t=a(t),s(e,nt()?Reflect.construct(t,r||[],a(e).constructor):t.apply(e,r))}function nt(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){})))}catch(e){}return(nt=function(){return!!e})()}const it=function(t){function r(){var t;return e(this,r),(t=rt(this,r)).name="Avro to JSON",t.module="Serialise",t.description="Converts Avro encoded data into JSON.",t.infoURL="https://wikipedia.org/wiki/Apache_Avro",t.inputType="ArrayBuffer",t.outputType="string",t.args=[{name:"Force Valid JSON",type:"boolean",value:!0}],t}return c(r,t),o(r,[{key:"run",value:function(e,t){if(e.byteLength<=0)throw new x("Please provide an input.");var r=t[0];return new Promise((function(t,n){var i=[],o=new Uint8Array(e),s=new(tt().streams.BlockDecoder);s.on("data",(function(e){i.push(e)})).on("error",(function(){n(new x("Error parsing Avro file."))})).on("end",(function(){if(r)t(1===i.length?JSON.stringify(i[0],null,4):JSON.stringify(i,null,4));else{var e=i.reduce((function(e,t){return e+JSON.stringify(t)+"\n"}),"");t(e)}})),s.write(o),s.end()}))}}])}(Qe);for(var ot=[],st=[],at="undefined"!=typeof Uint8Array?Uint8Array:Array,ut="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",ct=0;ct<64;++ct)ot[ct]=ut[ct],st[ut.charCodeAt(ct)]=ct;function ft(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");return-1===r&&(r=t),[r,r===t?0:4-r%4]}function lt(e,t,r){for(var n,i,o=[],s=t;s>18&63]+ot[i>>12&63]+ot[i>>6&63]+ot[63&i]);return o.join("")}st["-".charCodeAt(0)]=62,st["_".charCodeAt(0)]=63;var ht,pt,dt=function(e){var t,r,n=ft(e),i=n[0],o=n[1],s=new at(function(e,t,r){return 3*(t+r)/4-r}(0,i,o)),a=0,u=o>0?i-4:i;for(r=0;r>16&255,s[a++]=t>>8&255,s[a++]=255&t;return 2===o&&(t=st[e.charCodeAt(r)]<<2|st[e.charCodeAt(r+1)]>>4,s[a++]=255&t),1===o&&(t=st[e.charCodeAt(r)]<<10|st[e.charCodeAt(r+1)]<<4|st[e.charCodeAt(r+2)]>>2,s[a++]=t>>8&255,s[a++]=255&t),s},yt=function(e){for(var t,r=e.length,n=r%3,i=[],o=16383,s=0,a=r-n;sa?a:s+o));return 1===n?(t=e[r-1],i.push(ot[t>>2]+ot[t<<4&63]+"==")):2===n&&(t=(e[r-2]<<8)+e[r-1],i.push(ot[t>>10]+ot[t>>4&63]+ot[t<<2&63]+"=")),i.join("")},gt=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},mt=function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*y},vt=(ht=function(e,t){var r="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=o,t.SlowBuffer=function(e){return+e!=e&&(e=0),o.alloc(+e)},t.INSPECT_MAX_BYTES=50;var n=2147483647;function i(e){if(e>n)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,o.prototype),t}function o(e,t,r){if("number"==typeof e){if("string"==typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return u(e)}return s(e,t,r)}function s(e,t,r){if("string"==typeof e)return function(e,t){if("string"==typeof t&&""!==t||(t="utf8"),!o.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|h(e,t),n=i(r),s=n.write(e,t);return s!==r&&(n=n.slice(0,s)),n}(e,t);if(ArrayBuffer.isView(e))return function(e){if(D(e,Uint8Array)){var t=new Uint8Array(e);return f(t.buffer,t.byteOffset,t.byteLength)}return c(e)}(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(e));if(D(e,ArrayBuffer)||e&&D(e.buffer,ArrayBuffer))return f(e,t,r);if("undefined"!=typeof SharedArrayBuffer&&(D(e,SharedArrayBuffer)||e&&D(e.buffer,SharedArrayBuffer)))return f(e,t,r);if("number"==typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return o.from(n,t,r);var s=function(e){if(o.isBuffer(e)){var t=0|l(e.length),r=i(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!=typeof e.length||M(e.length)?i(0):c(e):"Buffer"===e.type&&Array.isArray(e.data)?c(e.data):void 0}(e);if(s)return s;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof e[Symbol.toPrimitive])return o.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+babelHelpers.typeof(e))}function a(e){if("number"!=typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function u(e){return a(e),i(e<0?0:0|l(e))}function c(e){for(var t=e.length<0?0:0|l(e.length),r=i(t),n=0;n=n)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|e}function h(e,t){if(o.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||D(e,ArrayBuffer))return e.byteLength;if("string"!=typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+babelHelpers.typeof(e));var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return C(e).length;default:if(i)return n?-1:U(e).length;t=(""+t).toLowerCase(),i=!0}}function p(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return k(this,t,r);case"utf8":case"utf-8":return x(this,t,r);case"ascii":return A(this,t,r);case"latin1":case"binary":return S(this,t,r);case"base64":return E(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return T(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function d(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function y(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=o.from(t,n)),o.isBuffer(t))return 0===t.length?-1:g(e,t,r,n,i);if("number"==typeof t)return t&=255,"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):g(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function g(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(o=r;oa&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;hi&&(n=i):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function E(e,t,r){return 0===t&&r===e.length?yt(e):yt(e.slice(t,r))}function x(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=B)return String.fromCharCode.apply(String,e);for(var r="",n=0;nn.length?o.from(s).copy(n,i):Uint8Array.prototype.set.call(n,s,i);else{if(!o.isBuffer(s))throw new TypeError('"list" argument must be an Array of Buffers');s.copy(n,i)}i+=s.length}return n},o.byteLength=h,o.prototype._isBuffer=!0,o.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 t=0;tr&&(e+=" ... "),""},r&&(o.prototype[r]=o.prototype.inspect),o.prototype.compare=function(e,t,r,n,i){if(D(e,Uint8Array)&&(e=o.from(e,e.offset,e.byteLength)),!o.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+babelHelpers.typeof(e));if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var s=(i>>>=0)-(n>>>=0),a=(r>>>=0)-(t>>>=0),u=Math.min(s,a),c=this.slice(n,i),f=e.slice(t,r),l=0;l>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return m(this,e,t,r);case"utf8":case"utf-8":return v(this,e,t,r);case"ascii":case"latin1":case"binary":return b(this,e,t,r);case"base64":return _(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return w(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},o.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var B=4096;function A(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;in)&&(r=n);for(var i="",o=t;or)throw new RangeError("Trying to access beyond buffer length")}function I(e,t,r,n,i,s){if(!o.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||te.length)throw new RangeError("Index out of range")}function N(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function F(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,4),mt(e,t,r,n,23,4),r+4}function R(e,t,r,n,i){return t=+t,r>>>=0,i||N(e,0,r,8),mt(e,t,r,n,52,8),r+8}o.prototype.slice=function(e,t){var r=this.length;(e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},o.prototype.readUint8=o.prototype.readUInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),this[e]},o.prototype.readUint16LE=o.prototype.readUInt16LE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]|this[e+1]<<8},o.prototype.readUint16BE=o.prototype.readUInt16BE=function(e,t){return e>>>=0,t||O(e,2,this.length),this[e]<<8|this[e+1]},o.prototype.readUint32LE=o.prototype.readUInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},o.prototype.readUint32BE=o.prototype.readUInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},o.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=this[e],i=1,o=0;++o=(i*=128)&&(n-=Math.pow(2,8*t)),n},o.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||O(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},o.prototype.readInt8=function(e,t){return e>>>=0,t||O(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},o.prototype.readInt16LE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt16BE=function(e,t){e>>>=0,t||O(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},o.prototype.readInt32LE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},o.prototype.readInt32BE=function(e,t){return e>>>=0,t||O(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},o.prototype.readFloatLE=function(e,t){return e>>>=0,t||O(e,4,this.length),gt(this,e,!0,23,4)},o.prototype.readFloatBE=function(e,t){return e>>>=0,t||O(e,4,this.length),gt(this,e,!1,23,4)},o.prototype.readDoubleLE=function(e,t){return e>>>=0,t||O(e,8,this.length),gt(this,e,!0,52,8)},o.prototype.readDoubleBE=function(e,t){return e>>>=0,t||O(e,8,this.length),gt(this,e,!1,52,8)},o.prototype.writeUintLE=o.prototype.writeUIntLE=function(e,t,r,n){e=+e,t>>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o>>=0,r>>>=0,n||I(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},o.prototype.writeUint8=o.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,255,0),this[t]=255&e,t+1},o.prototype.writeUint16LE=o.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeUint16BE=o.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeUint32LE=o.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},o.prototype.writeUint32BE=o.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o>>=0,!n){var i=Math.pow(2,8*r-1);I(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},o.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},o.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},o.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},o.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},o.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||I(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},o.prototype.writeFloatLE=function(e,t,r){return F(this,e,t,!0,r)},o.prototype.writeFloatBE=function(e,t,r){return F(this,e,t,!1,r)},o.prototype.writeDoubleLE=function(e,t,r){return R(this,e,t,!0,r)},o.prototype.writeDoubleBE=function(e,t,r){return R(this,e,t,!1,r)},o.prototype.copy=function(e,t,r,n){if(!o.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(s=t;s55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function C(e){return dt(function(e){if((e=(e=e.split("=")[0]).trim().replace(L,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function j(e,t,r,n){for(var i=0;i=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function D(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function M(e){return e!=e}var P=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},ht(pt={exports:{}},pt.exports),pt.exports),bt=vt.Buffer;vt.SlowBuffer,vt.INSPECT_MAX_BYTES,vt.kMaxLength;var _t=function(e,t){return _t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])},_t(e,t)};function wt(e,t){function r(){this.constructor=e}_t(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var Et=function(){return Et=Object.assign||function(e){for(var t,r=1,n=arguments.length;r");this.sub_type=null!=r?r:e.BSON_BINARY_SUBTYPE_DEFAULT,null==t?(this.buffer=bt.alloc(e.BUFFER_SIZE),this.position=0):("string"==typeof t?this.buffer=bt.from(t,"binary"):Array.isArray(t)?this.buffer=bt.from(t):this.buffer=Dt(t),this.position=this.buffer.byteLength)}return e.prototype.put=function(t){if("string"==typeof t&&1!==t.length)throw new Bt("only accepts single character String");if("number"!=typeof t&&1!==t.length)throw new Bt("only accepts single character Uint8Array or Array");var r;if((r="string"==typeof t?t.charCodeAt(0):"number"==typeof t?t:t[0])<0||r>255)throw new Bt("only accepts number in a valid unsigned byte range 0-255");if(this.buffer.length>this.position)this.buffer[this.position++]=r;else{var n=bt.alloc(e.BUFFER_SIZE+this.buffer.length);this.buffer.copy(n,0,0,this.buffer.length),this.buffer=n,this.buffer[this.position++]=r}},e.prototype.write=function(e,t){if(t="number"==typeof t?t:this.position,this.buffer.lengththis.position?t+e.length:this.position):"string"==typeof e&&(this.buffer.write(e,t,e.length,"binary"),this.position=t+e.length>this.position?t+e.length:this.position)},e.prototype.read=function(e,t){return t=t&&t>0?t:this.position,this.buffer.slice(e,e+t)},e.prototype.value=function(e){return(e=!!e)&&this.buffer.length===this.position?this.buffer:e?this.buffer.slice(0,this.position):this.buffer.toString("binary",0,this.position)},e.prototype.length=function(){return this.position},e.prototype.toJSON=function(){return this.buffer.toString("base64")},e.prototype.toString=function(e){return this.buffer.toString(e)},e.prototype.toExtendedJSON=function(e){e=e||{};var t=this.buffer.toString("base64"),r=Number(this.sub_type).toString(16);return e.legacy?{$binary:t,$type:1===r.length?"0"+r:r}:{$binary:{base64:t,subType:1===r.length?"0"+r:r}}},e.prototype.toUUID=function(){if(this.sub_type===e.SUBTYPE_UUID)return new mr(this.buffer.slice(0,this.position));throw new xt('Binary sub_type "'.concat(this.sub_type,'" is not supported for converting to UUID. Only "').concat(e.SUBTYPE_UUID,'" is currently supported.'))},e.fromExtendedJSON=function(t,r){var n,i;if(r=r||{},"$binary"in t?r.legacy&&"string"==typeof t.$binary&&"$type"in t?(i=t.$type?parseInt(t.$type,16):0,n=bt.from(t.$binary,"base64")):"string"!=typeof t.$binary&&(i=t.$binary.subType?parseInt(t.$binary.subType,16):0,n=bt.from(t.$binary.base64,"base64")):"$uuid"in t&&(i=4,n=zt(t.$uuid)),!n)throw new Bt("Unexpected Binary Extended JSON format ".concat(JSON.stringify(t)));return i===yr?new mr(n):new e(n,i)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.value(!0);return'new Binary(Buffer.from("'.concat(e.toString("hex"),'", "hex"), ').concat(this.sub_type,")")},e.BSON_BINARY_SUBTYPE_DEFAULT=0,e.BUFFER_SIZE=256,e.SUBTYPE_DEFAULT=0,e.SUBTYPE_FUNCTION=1,e.SUBTYPE_BYTE_ARRAY=2,e.SUBTYPE_UUID_OLD=3,e.SUBTYPE_UUID=4,e.SUBTYPE_MD5=5,e.SUBTYPE_ENCRYPTED=6,e.SUBTYPE_COLUMN=7,e.SUBTYPE_USER_DEFINED=128,e}();Object.defineProperty(gr.prototype,"_bsontype",{value:"Binary"});var mr=function(e){function t(r){var n,i,o=this;if(null==r)n=t.generate();else if(r instanceof t)n=bt.from(r.buffer),i=r.__id;else if(ArrayBuffer.isView(r)&&16===r.byteLength)n=Dt(r);else{if("string"!=typeof r)throw new Bt("Argument passed in UUID constructor must be a UUID, a 16 byte Buffer or a 32/36 character hex string (dashes excluded/included, format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).");n=zt(r)}return(o=e.call(this,n,yr)||this).__id=i,o}return wt(t,e),Object.defineProperty(t.prototype,"id",{get:function(){return this.buffer},set:function(e){this.buffer=e,t.cacheHexString&&(this.__id=$t(e))},enumerable:!1,configurable:!0}),t.prototype.toHexString=function(e){if(void 0===e&&(e=!0),t.cacheHexString&&this.__id)return this.__id;var r=$t(this.id,e);return t.cacheHexString&&(this.__id=r),r},t.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},t.prototype.toJSON=function(){return this.toHexString()},t.prototype.equals=function(e){if(!e)return!1;if(e instanceof t)return e.id.equals(this.id);try{return new t(e).id.equals(this.id)}catch(e){return!1}},t.prototype.toBinary=function(){return new gr(this.id,gr.SUBTYPE_UUID)},t.generate=function(){var e=Ot(16);return e[6]=15&e[6]|64,e[8]=63&e[8]|128,bt.from(e)},t.isValid=function(e){return!!e&&(e instanceof t||("string"==typeof e?Pt(e):!(!Nt(e)||16!==e.length||64!=(240&e[6])||128&~e[8])))},t.createFromHexString=function(e){return new t(zt(e))},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return'new UUID("'.concat(this.toHexString(),'")')},t}(gr),vr=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);this.code=t,this.scope=r}return e.prototype.toJSON=function(){return{code:this.code,scope:this.scope}},e.prototype.toExtendedJSON=function(){return this.scope?{$code:this.code,$scope:this.scope}:{$code:this.code}},e.fromExtendedJSON=function(t){return new e(t.$code,t.$scope)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=this.toJSON();return'new Code("'.concat(String(e.code),'"').concat(e.scope?", ".concat(JSON.stringify(e.scope)):"",")")},e}();function br(e){return Ct(e)&&null!=e.$id&&"string"==typeof e.$ref&&(null==e.$db||"string"==typeof e.$db)}Object.defineProperty(vr.prototype,"_bsontype",{value:"Code"});var _r=function(){function e(t,r,n,i){if(!(this instanceof e))return new e(t,r,n,i);var o=t.split(".");2===o.length&&(n=o.shift(),t=o.shift()),this.collection=t,this.oid=r,this.db=n,this.fields=i||{}}return Object.defineProperty(e.prototype,"namespace",{get:function(){return this.collection},set:function(e){this.collection=e},enumerable:!1,configurable:!0}),e.prototype.toJSON=function(){var e=Object.assign({$ref:this.collection,$id:this.oid},this.fields);return null!=this.db&&(e.$db=this.db),e},e.prototype.toExtendedJSON=function(e){e=e||{};var t={$ref:this.collection,$id:this.oid};return e.legacy?t:(this.db&&(t.$db=this.db),t=Object.assign(t,this.fields))},e.fromExtendedJSON=function(t){var r=Object.assign({},t);return delete r.$ref,delete r.$id,delete r.$db,new e(t.$ref,t.$id,t.$db,r)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){var e=void 0===this.oid||void 0===this.oid.toString?this.oid:this.oid.toString();return'new DBRef("'.concat(this.namespace,'", new ObjectId("').concat(String(e),'")').concat(this.db?', "'.concat(this.db,'"'):"",")")},e}();Object.defineProperty(_r.prototype,"_bsontype",{value:"DBRef"});var wr=void 0;try{wr=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(e){}var Er=4294967296,xr=0x10000000000000000,Br=xr/2,Ar={},Sr={},kr=function(){function e(t,r,n){if(void 0===t&&(t=0),!(this instanceof e))return new e(t,r,n);"bigint"==typeof t?Object.assign(this,e.fromBigInt(t,!!r)):"string"==typeof t?Object.assign(this,e.fromString(t,!!r)):(this.low=0|t,this.high=0|r,this.unsigned=!!n),Object.defineProperty(this,"__isLong__",{value:!0,configurable:!1,writable:!1,enumerable:!1})}return e.fromBits=function(t,r,n){return new e(t,r,n)},e.fromInt=function(t,r){var n,i,o;return r?(o=0<=(t>>>=0)&&t<256)&&(i=Sr[t])?i:(n=e.fromBits(t,(0|t)<0?-1:0,!0),o&&(Sr[t]=n),n):(o=-128<=(t|=0)&&t<128)&&(i=Ar[t])?i:(n=e.fromBits(t,t<0?-1:0,!1),o&&(Ar[t]=n),n)},e.fromNumber=function(t,r){if(isNaN(t))return r?e.UZERO:e.ZERO;if(r){if(t<0)return e.UZERO;if(t>=xr)return e.MAX_UNSIGNED_VALUE}else{if(t<=-Br)return e.MIN_VALUE;if(t+1>=Br)return e.MAX_VALUE}return t<0?e.fromNumber(-t,r).neg():e.fromBits(t%Er|0,t/Er|0,r)},e.fromBigInt=function(t,r){return e.fromString(t.toString(),r)},e.fromString=function(t,r,n){if(0===t.length)throw Error("empty string");if("NaN"===t||"Infinity"===t||"+Infinity"===t||"-Infinity"===t)return e.ZERO;if("number"==typeof r?(n=r,r=!1):r=!!r,(n=n||10)<2||360)throw Error("interior hyphen");if(0===i)return e.fromString(t.substring(1),r,n).neg();for(var o=e.fromNumber(Math.pow(n,8)),s=e.ZERO,a=0;a>>16,n=65535&this.high,i=this.low>>>16,o=65535&this.low,s=t.high>>>16,a=65535&t.high,u=t.low>>>16,c=0,f=0,l=0,h=0;return l+=(h+=o+(65535&t.low))>>>16,h&=65535,f+=(l+=i+u)>>>16,l&=65535,c+=(f+=n+a)>>>16,f&=65535,c+=r+s,c&=65535,e.fromBits(l<<16|h,c<<16|f,this.unsigned)},e.prototype.and=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low&t.low,this.high&t.high,this.unsigned)},e.prototype.compare=function(t){if(e.isLong(t)||(t=e.fromValue(t)),this.eq(t))return 0;var r=this.isNegative(),n=t.isNegative();return r&&!n?-1:!r&&n?1:this.unsigned?t.high>>>0>this.high>>>0||t.high===this.high&&t.low>>>0>this.low>>>0?-1:1:this.sub(t).isNegative()?-1:1},e.prototype.comp=function(e){return this.compare(e)},e.prototype.divide=function(t){if(e.isLong(t)||(t=e.fromValue(t)),t.isZero())throw Error("division by zero");if(wr){if(!this.unsigned&&-2147483648===this.high&&-1===t.low&&-1===t.high)return this;var r=(this.unsigned?wr.div_u:wr.div_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}if(this.isZero())return this.unsigned?e.UZERO:e.ZERO;var n,i,o;if(this.unsigned){if(t.unsigned||(t=t.toUnsigned()),t.gt(this))return e.UZERO;if(t.gt(this.shru(1)))return e.UONE;o=e.UZERO}else{if(this.eq(e.MIN_VALUE))return t.eq(e.ONE)||t.eq(e.NEG_ONE)?e.MIN_VALUE:t.eq(e.MIN_VALUE)?e.ONE:(n=this.shr(1).div(t).shl(1)).eq(e.ZERO)?t.isNegative()?e.ONE:e.NEG_ONE:(i=this.sub(t.mul(n)),o=n.add(i.div(t)));if(t.eq(e.MIN_VALUE))return this.unsigned?e.UZERO:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().div(t.neg()):this.neg().div(t).neg();if(t.isNegative())return this.div(t.neg()).neg();o=e.ZERO}for(i=this;i.gte(t);){n=Math.max(1,Math.floor(i.toNumber()/t.toNumber()));for(var s=Math.ceil(Math.log(n)/Math.LN2),a=s<=48?1:Math.pow(2,s-48),u=e.fromNumber(n),c=u.mul(t);c.isNegative()||c.gt(i);)n-=a,c=(u=e.fromNumber(n,this.unsigned)).mul(t);u.isZero()&&(u=e.ONE),o=o.add(u),i=i.sub(c)}return o},e.prototype.div=function(e){return this.divide(e)},e.prototype.equals=function(t){return e.isLong(t)||(t=e.fromValue(t)),(this.unsigned===t.unsigned||this.high>>>31!=1||t.high>>>31!=1)&&this.high===t.high&&this.low===t.low},e.prototype.eq=function(e){return this.equals(e)},e.prototype.getHighBits=function(){return this.high},e.prototype.getHighBitsUnsigned=function(){return this.high>>>0},e.prototype.getLowBits=function(){return this.low},e.prototype.getLowBitsUnsigned=function(){return this.low>>>0},e.prototype.getNumBitsAbs=function(){if(this.isNegative())return this.eq(e.MIN_VALUE)?64:this.neg().getNumBitsAbs();var t,r=0!==this.high?this.high:this.low;for(t=31;t>0&&!(r&1<0},e.prototype.gt=function(e){return this.greaterThan(e)},e.prototype.greaterThanOrEqual=function(e){return this.comp(e)>=0},e.prototype.gte=function(e){return this.greaterThanOrEqual(e)},e.prototype.ge=function(e){return this.greaterThanOrEqual(e)},e.prototype.isEven=function(){return!(1&this.low)},e.prototype.isNegative=function(){return!this.unsigned&&this.high<0},e.prototype.isOdd=function(){return!(1&~this.low)},e.prototype.isPositive=function(){return this.unsigned||this.high>=0},e.prototype.isZero=function(){return 0===this.high&&0===this.low},e.prototype.lessThan=function(e){return this.comp(e)<0},e.prototype.lt=function(e){return this.lessThan(e)},e.prototype.lessThanOrEqual=function(e){return this.comp(e)<=0},e.prototype.lte=function(e){return this.lessThanOrEqual(e)},e.prototype.modulo=function(t){if(e.isLong(t)||(t=e.fromValue(t)),wr){var r=(this.unsigned?wr.rem_u:wr.rem_s)(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}return this.sub(this.div(t).mul(t))},e.prototype.mod=function(e){return this.modulo(e)},e.prototype.rem=function(e){return this.modulo(e)},e.prototype.multiply=function(t){if(this.isZero())return e.ZERO;if(e.isLong(t)||(t=e.fromValue(t)),wr){var r=wr.mul(this.low,this.high,t.low,t.high);return e.fromBits(r,wr.get_high(),this.unsigned)}if(t.isZero())return e.ZERO;if(this.eq(e.MIN_VALUE))return t.isOdd()?e.MIN_VALUE:e.ZERO;if(t.eq(e.MIN_VALUE))return this.isOdd()?e.MIN_VALUE:e.ZERO;if(this.isNegative())return t.isNegative()?this.neg().mul(t.neg()):this.neg().mul(t).neg();if(t.isNegative())return this.mul(t.neg()).neg();if(this.lt(e.TWO_PWR_24)&&t.lt(e.TWO_PWR_24))return e.fromNumber(this.toNumber()*t.toNumber(),this.unsigned);var n=this.high>>>16,i=65535&this.high,o=this.low>>>16,s=65535&this.low,a=t.high>>>16,u=65535&t.high,c=t.low>>>16,f=65535&t.low,l=0,h=0,p=0,d=0;return p+=(d+=s*f)>>>16,d&=65535,h+=(p+=o*f)>>>16,p&=65535,h+=(p+=s*c)>>>16,p&=65535,l+=(h+=i*f)>>>16,h&=65535,l+=(h+=o*c)>>>16,h&=65535,l+=(h+=s*u)>>>16,h&=65535,l+=n*f+i*c+o*u+s*a,l&=65535,e.fromBits(p<<16|d,l<<16|h,this.unsigned)},e.prototype.mul=function(e){return this.multiply(e)},e.prototype.negate=function(){return!this.unsigned&&this.eq(e.MIN_VALUE)?e.MIN_VALUE:this.not().add(e.ONE)},e.prototype.neg=function(){return this.negate()},e.prototype.not=function(){return e.fromBits(~this.low,~this.high,this.unsigned)},e.prototype.notEquals=function(e){return!this.equals(e)},e.prototype.neq=function(e){return this.notEquals(e)},e.prototype.ne=function(e){return this.notEquals(e)},e.prototype.or=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low|t.low,this.high|t.high,this.unsigned)},e.prototype.shiftLeft=function(t){return e.isLong(t)&&(t=t.toInt()),0==(t&=63)?this:t<32?e.fromBits(this.low<>>32-t,this.unsigned):e.fromBits(0,this.low<>>t|this.high<<32-t,this.high>>t,this.unsigned):e.fromBits(this.high>>t-32,this.high>=0?0:-1,this.unsigned)},e.prototype.shr=function(e){return this.shiftRight(e)},e.prototype.shiftRightUnsigned=function(t){if(e.isLong(t)&&(t=t.toInt()),0==(t&=63))return this;var r=this.high;if(t<32){var n=this.low;return e.fromBits(n>>>t|r<<32-t,r>>>t,this.unsigned)}return 32===t?e.fromBits(r,0,this.unsigned):e.fromBits(r>>>t-32,0,this.unsigned)},e.prototype.shr_u=function(e){return this.shiftRightUnsigned(e)},e.prototype.shru=function(e){return this.shiftRightUnsigned(e)},e.prototype.subtract=function(t){return e.isLong(t)||(t=e.fromValue(t)),this.add(t.neg())},e.prototype.sub=function(e){return this.subtract(e)},e.prototype.toInt=function(){return this.unsigned?this.low>>>0:this.low},e.prototype.toNumber=function(){return this.unsigned?(this.high>>>0)*Er+(this.low>>>0):this.high*Er+(this.low>>>0)},e.prototype.toBigInt=function(){return BigInt(this.toString())},e.prototype.toBytes=function(e){return e?this.toBytesLE():this.toBytesBE()},e.prototype.toBytesLE=function(){var e=this.high,t=this.low;return[255&t,t>>>8&255,t>>>16&255,t>>>24,255&e,e>>>8&255,e>>>16&255,e>>>24]},e.prototype.toBytesBE=function(){var e=this.high,t=this.low;return[e>>>24,e>>>16&255,e>>>8&255,255&e,t>>>24,t>>>16&255,t>>>8&255,255&t]},e.prototype.toSigned=function(){return this.unsigned?e.fromBits(this.low,this.high,!1):this},e.prototype.toString=function(t){if((t=t||10)<2||36>>0).toString(t);if((s=u).isZero())return c+a;for(;c.length<6;)c="0"+c;a=""+c+a}},e.prototype.toUnsigned=function(){return this.unsigned?this:e.fromBits(this.low,this.high,!0)},e.prototype.xor=function(t){return e.isLong(t)||(t=e.fromValue(t)),e.fromBits(this.low^t.low,this.high^t.high,this.unsigned)},e.prototype.eqz=function(){return this.isZero()},e.prototype.le=function(e){return this.lessThanOrEqual(e)},e.prototype.toExtendedJSON=function(e){return e&&e.relaxed?this.toNumber():{$numberLong:this.toString()}},e.fromExtendedJSON=function(t,r){var n=e.fromString(t.$numberLong);return r&&r.relaxed?n.toNumber():n},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new Long("'.concat(this.toString(),'"').concat(this.unsigned?", true":"",")")},e.TWO_PWR_24=e.fromInt(16777216),e.MAX_UNSIGNED_VALUE=e.fromBits(-1,-1,!0),e.ZERO=e.fromInt(0),e.UZERO=e.fromInt(0,!0),e.ONE=e.fromInt(1),e.UONE=e.fromInt(1,!0),e.NEG_ONE=e.fromInt(-1),e.MAX_VALUE=e.fromBits(-1,2147483647,!1),e.MIN_VALUE=e.fromBits(0,-2147483648,!1),e}();Object.defineProperty(kr.prototype,"__isLong__",{value:!0}),Object.defineProperty(kr.prototype,"_bsontype",{value:"Long"});var Tr=/^(\+|-)?(\d+|(\d*\.\d*))?(E|e)?([-+])?(\d+)?$/,Or=/^(\+|-)?(Infinity|inf)$/i,Ir=/^(\+|-)?NaN$/i,Nr=6111,Fr=-6176,Rr=[124,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Lr=[248,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Ur=[120,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0].reverse(),Cr=/^([-+])?(\d+)?$/;function jr(e){return!isNaN(parseInt(e,10))}function Dr(e){var t=kr.fromNumber(1e9),r=kr.fromNumber(0);if(!(e.parts[0]||e.parts[1]||e.parts[2]||e.parts[3]))return{quotient:e,rem:r};for(var n=0;n<=3;n++)r=(r=r.shiftLeft(32)).add(new kr(e.parts[n],0)),e.parts[n]=r.div(t).low,r=r.modulo(t);return{quotient:e,rem:r}}function Mr(e,t){throw new Bt('"'.concat(e,'" is not a valid Decimal128 string - ').concat(t))}var Pr=function(){function e(t){if(!(this instanceof e))return new e(t);if("string"==typeof t)this.bytes=e.fromString(t).bytes;else{if(!Nt(t))throw new Bt("Decimal128 must take a Buffer or string");if(16!==t.byteLength)throw new Bt("Decimal128 must take a Buffer of 16 bytes");this.bytes=t}}return e.fromString=function(t){var r,n=!1,i=!1,o=!1,s=0,a=0,u=0,c=0,f=0,l=[0],h=0,p=0,d=0,y=0,g=0,m=0,v=new kr(0,0),b=new kr(0,0),_=0;if(t.length>=7e3)throw new Bt(t+" not a valid Decimal128 string");var w=t.match(Tr),E=t.match(Or),x=t.match(Ir);if(!w&&!E&&!x||0===t.length)throw new Bt(t+" not a valid Decimal128 string");if(w){var B=w[2],A=w[4],S=w[5],k=w[6];A&&void 0===k&&Mr(t,"missing exponent power"),A&&void 0===B&&Mr(t,"missing exponent base"),void 0===A&&(S||k)&&Mr(t,"missing e before exponent")}if("+"!==t[_]&&"-"!==t[_]||(n="-"===t[_++]),!jr(t[_])&&"."!==t[_]){if("i"===t[_]||"I"===t[_])return new e(bt.from(n?Lr:Ur));if("N"===t[_])return new e(bt.from(Rr))}for(;jr(t[_])||"."===t[_];)"."!==t[_]?(h<34&&("0"!==t[_]||o)&&(o||(f=a),o=!0,l[p++]=parseInt(t[_],10),h+=1),o&&(u+=1),i&&(c+=1),a+=1,_+=1):(i&&Mr(t,"contains multiple periods"),i=!0,_+=1);if(i&&!a)throw new Bt(t+" not a valid Decimal128 string");if("e"===t[_]||"E"===t[_]){var T=t.substr(++_).match(Cr);if(!T||!T[2])return new e(bt.from(Rr));g=parseInt(T[0],10),_+=T[0].length}if(t[_])return new e(bt.from(Rr));if(d=0,h){if(y=h-1,1!==(s=u))for(;0===l[f+s-1];)s-=1}else d=0,y=0,l[0]=0,u=1,h=1,s=0;for(g<=c&&c-g>16384?g=Fr:g-=c;g>Nr;){if((y+=1)-d>34){if(l.join("").match(/^0+$/)){g=Nr;break}Mr(t,"overflow")}g-=1}for(;g=5&&(N=1,5===I))for(N=l[y]%2==1?1:0,m=f+y+2;m=0;F--)if(++l[F]>9&&(l[F]=0,0===F)){if(!(g>>0)<(C=L.high>>>0)||U===C&&R.low>>>0>>0)&&(j.high=j.high.add(kr.fromNumber(1))),r=g+6176;var D={low:kr.fromNumber(0),high:kr.fromNumber(0)};j.high.shiftRightUnsigned(49).and(kr.fromNumber(1)).equals(kr.fromNumber(1))?(D.high=D.high.or(kr.fromNumber(3).shiftLeft(61)),D.high=D.high.or(kr.fromNumber(r).and(kr.fromNumber(16383).shiftLeft(47))),D.high=D.high.or(j.high.and(kr.fromNumber(0x7fffffffffff)))):(D.high=D.high.or(kr.fromNumber(16383&r).shiftLeft(49)),D.high=D.high.or(j.high.and(kr.fromNumber(562949953421311)))),D.low=j.low,n&&(D.high=D.high.or(kr.fromString("9223372036854775808")));var M=bt.alloc(16);return _=0,M[_++]=255&D.low.low,M[_++]=D.low.low>>8&255,M[_++]=D.low.low>>16&255,M[_++]=D.low.low>>24&255,M[_++]=255&D.low.high,M[_++]=D.low.high>>8&255,M[_++]=D.low.high>>16&255,M[_++]=D.low.high>>24&255,M[_++]=255&D.high.low,M[_++]=D.high.low>>8&255,M[_++]=D.high.low>>16&255,M[_++]=D.high.low>>24&255,M[_++]=255&D.high.high,M[_++]=D.high.high>>8&255,M[_++]=D.high.high>>16&255,M[_++]=D.high.high>>24&255,new e(M)},e.prototype.toString=function(){for(var e,t=0,r=new Array(36),n=0;n>26&31;if(g>>3==3){if(30===g)return f.join("")+"Infinity";if(31===g)return"NaN";e=y>>15&16383,i=8+(y>>14&1)}else i=y>>14&7,e=y>>17&16383;var m=e-6176;if(c.parts[0]=(16383&y)+((15&i)<<14),c.parts[1]=d,c.parts[2]=p,c.parts[3]=h,0===c.parts[0]&&0===c.parts[1]&&0===c.parts[2]&&0===c.parts[3])u=!0;else for(s=3;s>=0;s--){var v=0,b=Dr(c);if(c=b.quotient,v=b.rem.low)for(o=8;o>=0;o--)r[9*s+o]=v%10,v=Math.floor(v/10)}if(u)t=1,r[a]=0;else for(t=36;!r[a];)t-=1,a+=1;var _=t-1+m;if(_>=34||_<=-7||m>0){if(t>34)return f.push("".concat(0)),m>0?f.push("E+".concat(m)):m<0&&f.push("E".concat(m)),f.join("");for(f.push("".concat(r[a++])),(t-=1)&&f.push("."),n=0;n0?f.push("+".concat(_)):f.push("".concat(_))}else if(m>=0)for(n=0;n0)for(n=0;n>8&255,n[9]=r>>16&255,n},e.prototype.toString=function(e){return e?this.id.toString(e):this.toHexString()},e.prototype.toJSON=function(){return this.toHexString()},e.prototype.equals=function(t){if(null==t)return!1;if(t instanceof e)return this[Gr][11]===t[Gr][11]&&this[Gr].equals(t[Gr]);if("string"==typeof t&&e.isValid(t)&&12===t.length&&Nt(this.id))return t===bt.prototype.toString.call(this.id,"latin1");if("string"==typeof t&&e.isValid(t)&&24===t.length)return t.toLowerCase()===this.toHexString();if("string"==typeof t&&e.isValid(t)&&12===t.length)return bt.from(t).equals(this.id);if("object"==typeof t&&"toHexString"in t&&"function"==typeof t.toHexString){var r=t.toHexString(),n=this.toHexString().toLowerCase();return"string"==typeof r&&r.toLowerCase()===n}return!1},e.prototype.getTimestamp=function(){var e=new Date,t=this.id.readUInt32BE(0);return e.setTime(1e3*Math.floor(t)),e},e.createPk=function(){return new e},e.createFromTime=function(t){var r=bt.from([0,0,0,0,0,0,0,0,0,0,0,0]);return r.writeUInt32BE(t,0),new e(r)},e.createFromHexString=function(t){if(void 0===t||null!=t&&24!==t.length)throw new Bt("Argument passed in must be a single String of 12 bytes or a string of 24 hex characters");return new e(bt.from(t,"hex"))},e.isValid=function(t){if(null==t)return!1;try{return new e(t),!0}catch(e){return!1}},e.prototype.toExtendedJSON=function(){return this.toHexString?{$oid:this.toHexString()}:{$oid:this.toString("hex")}},e.fromExtendedJSON=function(t){return new e(t.$oid)},e.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},e.prototype.inspect=function(){return'new ObjectId("'.concat(this.toHexString(),'")')},e.index=Math.floor(16777215*Math.random()),e}();Object.defineProperty(Jr.prototype,"generate",{value:jt((function(e){return Jr.generate(e)}),"Please use the static `ObjectId.generate(time)` instead")}),Object.defineProperty(Jr.prototype,"getInc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr.prototype,"get_inc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr,"get_inc",{value:jt((function(){return Jr.getInc()}),"Please use the static `ObjectId.getInc()` instead")}),Object.defineProperty(Jr.prototype,"_bsontype",{value:"ObjectID"});var Wr=function(){function e(t,r){if(!(this instanceof e))return new e(t,r);if(this.pattern=t,this.options=(null!=r?r:"").split("").sort().join(""),-1!==this.pattern.indexOf("\0"))throw new xt("BSON Regex patterns cannot contain null bytes, found: ".concat(JSON.stringify(this.pattern)));if(-1!==this.options.indexOf("\0"))throw new xt("BSON Regex options cannot contain null bytes, found: ".concat(JSON.stringify(this.options)));for(var n=0;n>>0,i:this.low>>>0}}},t.fromExtendedJSON=function(e){return new t(e.$timestamp)},t.prototype[Symbol.for("nodejs.util.inspect.custom")]=function(){return this.inspect()},t.prototype.inspect=function(){return"new Timestamp({ t: ".concat(this.getHighBits(),", i: ").concat(this.getLowBits()," })")},t.MAX_VALUE=kr.MAX_UNSIGNED_VALUE,t}(kr);function Xr(e){return Ct(e)&&Reflect.has(e,"_bsontype")&&"string"==typeof e._bsontype}var Qr=2147483647,en=-2147483648,tn=0x8000000000000000,rn=-0x8000000000000000,nn={$oid:Jr,$binary:gr,$uuid:gr,$symbol:Yr,$numberInt:$r,$numberDecimal:Pr,$numberDouble:zr,$numberLong:kr,$minKey:Vr,$maxKey:Hr,$regex:Wr,$regularExpression:Wr,$timestamp:Kr};function on(e,t){if(void 0===t&&(t={}),"number"==typeof e){if(t.relaxed||t.legacy)return e;if(Math.floor(e)===e){if(e>=en&&e<=Qr)return new $r(e);if(e>=rn&&e<=tn)return kr.fromNumber(e)}return new zr(e)}if(null==e||"object"!=typeof e)return e;if(e.$undefined)return null;for(var r=Object.keys(e).filter((function(t){return t.startsWith("$")&&null!=e[t]})),n=0;n ")})).join(""),o=n[r],s=" -> "+n.slice(r+1,n.length-1).map((function(e){return"".concat(e," -> ")})).join(""),a=n[n.length-1],u=" ".repeat(i.length+o.length/2),c="-".repeat(s.length+(o.length+a.length)/2-1);throw new Bt("Converting circular structure to EJSON:\n"+" ".concat(i).concat(o).concat(s).concat(a,"\n")+" ".concat(u,"\\").concat(c,"/"))}t.seenObjects[t.seenObjects.length-1].obj=e}if(Array.isArray(e))return function(e,t){return e.map((function(e,r){t.seenObjects.push({propertyName:"index ".concat(r),obj:null});try{return an(e,t)}finally{t.seenObjects.pop()}}))}(e,t);if(void 0===e)return null;if(e instanceof Date||Ut(e)){var f=e.getTime(),l=f>-1&&f<2534023188e5;return t.legacy?t.relaxed&&l?{$date:e.getTime()}:{$date:sn(e)}:t.relaxed&&l?{$date:sn(e)}:{$date:{$numberLong:e.getTime().toString()}}}if(!("number"!=typeof e||t.relaxed&&isFinite(e))){if(Math.floor(e)===e){var h=e>=rn&&e<=tn;if(e>=en&&e<=Qr)return{$numberInt:e.toString()};if(h)return{$numberLong:e.toString()}}return{$numberDouble:e.toString()}}if(e instanceof RegExp||Lt(e)){var p=e.flags;if(void 0===p){var d=e.toString().match(/[gimuy]*$/);d&&(p=d[0])}return new Wr(e.source,p).toExtendedJSON(t)}return null!=e&&"object"==typeof e?function(e,t){if(null==e||"object"!=typeof e)throw new xt("not an object instance");var r=e._bsontype;if(void 0===r){var n={};for(var i in e){t.seenObjects.push({propertyName:i,obj:null});try{var o=an(e[i],t);"__proto__"===i?Object.defineProperty(n,i,{value:o,writable:!0,enumerable:!0,configurable:!0}):n[i]=o}finally{t.seenObjects.pop()}}return n}if(Xr(e)){var s=e;if("function"!=typeof s.toExtendedJSON){var a=fn[e._bsontype];if(!a)throw new Bt("Unrecognized or invalid _bsontype: "+e._bsontype);s=a(s)}return"Code"===r&&s.scope?s=new vr(s.code,an(s.scope,t)):"DBRef"===r&&s.oid&&(s=new _r(an(s.collection,t),an(s.oid,t),an(s.db,t),an(s.fields,t))),s.toExtendedJSON(t)}throw new xt("_bsontype must be a string, but was: "+typeof r)}(e,t):e}var un,cn,fn={Binary:function(e){return new gr(e.value(),e.sub_type)},Code:function(e){return new vr(e.code,e.scope)},DBRef:function(e){return new _r(e.collection||e.namespace,e.oid,e.db,e.fields)},Decimal128:function(e){return new Pr(e.bytes)},Double:function(e){return new zr(e.value)},Int32:function(e){return new $r(e.value)},Long:function(e){return kr.fromBits(null!=e.low?e.low:e.low_,null!=e.low?e.high:e.high_,null!=e.low?e.unsigned:e.unsigned_)},MaxKey:function(){return new Hr},MinKey:function(){return new Vr},ObjectID:function(e){return new Jr(e)},ObjectId:function(e){return new Jr(e)},BSONRegExp:function(e){return new Wr(e.pattern,e.options)},Symbol:function(e){return new Yr(e.value)},Timestamp:function(e){return Kr.fromBits(e.low,e.high)}};!function(e){function t(e,t){var r=Object.assign({},{relaxed:!0,legacy:!1},t);return"boolean"==typeof r.relaxed&&(r.strict=!r.relaxed),"boolean"==typeof r.strict&&(r.relaxed=!r.strict),JSON.parse(e,(function(e,t){if(-1!==e.indexOf("\0"))throw new xt("BSON Document field names cannot contain null bytes, found: ".concat(JSON.stringify(e)));return on(t,r)}))}function r(e,t,r,n){null!=r&&"object"==typeof r&&(n=r,r=0),null==t||"object"!=typeof t||Array.isArray(t)||(n=t,t=void 0,r=0);var i=an(e,Object.assign({relaxed:!0,legacy:!1},n,{seenObjects:[{propertyName:"(root)",obj:null}]}));return JSON.stringify(i,t,r)}e.parse=t,e.stringify=r,e.serialize=function(e,t){return t=t||{},JSON.parse(r(e,t))},e.deserialize=function(e,r){return r=r||{},t(JSON.stringify(e),r)}}(un||(un={}));var ln=St();function hn(e,t,r){var n=5;if(Array.isArray(e))for(var i=0;i=qt&&t<=Zt&&t>=Vt&&t<=Ht?(null!=e?bt.byteLength(e,"utf8")+1:0)+5:(null!=e?bt.byteLength(e,"utf8")+1:0)+9;case"undefined":return n||!i?(null!=e?bt.byteLength(e,"utf8")+1:0)+1:0;case"boolean":return(null!=e?bt.byteLength(e,"utf8")+1:0)+2;case"object":if(null==t||"MinKey"===t._bsontype||"MaxKey"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1;if("ObjectId"===t._bsontype||"ObjectID"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+13;if(t instanceof Date||Ut(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+9;if(ArrayBuffer.isView(t)||t instanceof ArrayBuffer||It(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+6+t.byteLength;if("Long"===t._bsontype||"Double"===t._bsontype||"Timestamp"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+9;if("Decimal128"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+17;if("Code"===t._bsontype)return null!=t.scope&&Object.keys(t.scope).length>0?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+4+bt.byteLength(t.code.toString(),"utf8")+1+hn(t.scope,r,i):(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+bt.byteLength(t.code.toString(),"utf8")+1;if("Binary"===t._bsontype){var o=t;return o.sub_type===gr.SUBTYPE_BYTE_ARRAY?(null!=e?bt.byteLength(e,"utf8")+1:0)+(o.position+1+4+1+4):(null!=e?bt.byteLength(e,"utf8")+1:0)+(o.position+1+4+1)}if("Symbol"===t._bsontype)return(null!=e?bt.byteLength(e,"utf8")+1:0)+bt.byteLength(t.value,"utf8")+4+1+1;if("DBRef"===t._bsontype){var s=Object.assign({$ref:t.collection,$id:t.oid},t.fields);return null!=t.db&&(s.$db=t.db),(null!=e?bt.byteLength(e,"utf8")+1:0)+1+hn(s,r,i)}return t instanceof RegExp||Lt(t)?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1:"BSONRegExp"===t._bsontype?(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.pattern,"utf8")+1+bt.byteLength(t.options,"utf8")+1:(null!=e?bt.byteLength(e,"utf8")+1:0)+hn(t,r,i)+1;case"function":if(t instanceof RegExp||Lt(t)||"[object RegExp]"===String.call(t))return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+bt.byteLength(t.source,"utf8")+1+(t.global?1:0)+(t.ignoreCase?1:0)+(t.multiline?1:0)+1;if(r&&null!=t.scope&&Object.keys(t.scope).length>0)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+4+bt.byteLength(kt(t),"utf8")+1+hn(t.scope,r,i);if(r)return(null!=e?bt.byteLength(e,"utf8")+1:0)+1+4+bt.byteLength(kt(t),"utf8")+1}return 0}cn=ln.Map?ln.Map:function(){function e(e){void 0===e&&(e=[]),this._keys=[],this._values={};for(var t=0;t= 5, is ".concat(i));if(t.allowObjectSmallerThanBufferSize&&e.length= bson size ").concat(i));if(!t.allowObjectSmallerThanBufferSize&&e.length!==i)throw new xt("buffer length ".concat(e.length," must === bson size ").concat(i));if(i+n>e.byteLength)throw new xt("(bson size ".concat(i," + options.index ").concat(n," must be <= buffer length ").concat(e.byteLength,")"));if(0!==e[n+i-1])throw new xt("One object, sized correctly, with a spot for an EOO, but the EOO isn't 0x00");return On(e,n,t,r)}var Tn=/^\$ref$|^\$id$|^\$db$/;function On(e,t,r,n){void 0===n&&(n=!1);var i,o=null!=r.evalFunctions&&r.evalFunctions,s=null!=r.cacheFunctions&&r.cacheFunctions,a=null==r.fieldsAsRaw?null:r.fieldsAsRaw,u=null!=r.raw&&r.raw,c="boolean"==typeof r.bsonRegExp&&r.bsonRegExp,f=null!=r.promoteBuffers&&r.promoteBuffers,l=null==r.promoteLongs||r.promoteLongs,h=null==r.promoteValues||r.promoteValues,p=null==r.validation?{utf8:!0}:r.validation,d=!0,y=new Set,g=p.utf8;if("boolean"==typeof g)i=g;else{d=!1;var m=Object.keys(g).map((function(e){return g[e]}));if(0===m.length)throw new xt("UTF-8 validation setting cannot be empty");if("boolean"!=typeof m[0])throw new xt("Invalid UTF-8 validation option, must specify boolean values");if(i=m[0],!m.every((function(e){return e===i})))throw new xt("Invalid UTF-8 validation option - keys must be all true or all false")}if(!d)for(var v=0,b=Object.keys(g);ve.length)throw new xt("corrupt bson message");for(var x=n?[]:{},B=0,A=!n&&null,S=new DataView(e.buffer,e.byteOffset,e.byteLength);;){var k=e[t++];if(0===k)break;for(var T=t;0!==e[T]&&T=e.byteLength)throw new xt("Bad BSON Document: illegal CString");var O,I=n?B++:e.toString("utf8",t,T);O=d||y.has(I)?i:!i,!1!==A&&"$"===I[0]&&(A=Tn.test(I));var N=void 0;if(t=T+1,k===Jt){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");N=Nn(e,t,t+te-1,O),t+=te}else if(k===Qt){var F=bt.alloc(12);e.copy(F,0,t,t+12),N=new Jr(F),t+=12}else if(k===ur&&!1===h)N=new $r(e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24);else if(k===ur)N=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;else if(k===Gt&&!1===h)N=new zr(S.getFloat64(t,!0)),t+=8;else if(k===Gt)N=S.getFloat64(t,!0),t+=8;else if(k===tr){var R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;N=new Date(new kr(R,L).toNumber())}else if(k===er){if(0!==e[t]&&1!==e[t])throw new xt("illegal boolean type value");N=1===e[t++]}else if(k===Wt){var U=t;if((Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24)<=0||Q>e.length-t)throw new xt("bad embedded document length in bson");if(u)N=e.slice(t,t+Q);else{var C=r;d||(C=Et(Et({},r),{validation:{utf8:O}})),N=On(e,U,C,!1)}t+=Q}else if(k===Yt){U=t;var j=r,D=t+(Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24);if(a&&a[I]){for(var M in j={},r)j[M]=r[M];j.raw=!0}if(d||(j=Et(Et({},j),{validation:{utf8:O}})),N=On(e,U,j,!0),0!==e[(t+=Q)-1])throw new xt("invalid array terminator byte");if(t!==D)throw new xt("corrupted array bson")}else if(k===Xt)N=void 0;else if(k===rr)N=null;else if(k===fr){R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;var P=new kr(R,L);N=l&&!0===h&&P.lessThanOrEqual(Bn)&&P.greaterThanOrEqual(An)?P.toNumber():P}else if(k===lr){var z=bt.alloc(16);e.copy(z,0,t,t+16),t+=16;var $=new Pr(z);N="toObject"in $&&"function"==typeof $.toObject?$.toObject():$}else if(k===Kt){var H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,V=H,Z=e[t++];if(H<0)throw new xt("Negative binary type element size found");if(H>e.byteLength)throw new xt("Binary type size larger than document size");if(null!=e.slice){if(Z===gr.SUBTYPE_BYTE_ARRAY){if((H=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<0)throw new xt("Negative binary type element size found for subtype 0x02");if(H>V-4)throw new xt("Binary type with subtype 0x02 contains too long binary size");if(HV-4)throw new xt("Binary type with subtype 0x02 contains too long binary size");if(H=e.length)throw new xt("Bad BSON Document: illegal CString");var G=e.toString("utf8",t,T);for(T=t=T+1;0!==e[T]&&T=e.length)throw new xt("Bad BSON Document: illegal CString");var J=e.toString("utf8",t,T);t=T+1;var W=new Array(J.length);for(T=0;T=e.length)throw new xt("Bad BSON Document: illegal CString");for(G=e.toString("utf8",t,T),T=t=T+1;0!==e[T]&&T=e.length)throw new xt("Bad BSON Document: illegal CString");J=e.toString("utf8",t,T),t=T+1,N=new Wr(G,J)}else if(k===sr){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");var Y=Nn(e,t,t+te-1,O);N=h?Y:new Yr(Y),t+=te}else if(k===cr)R=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,L=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24,N=new Kr(R,L);else if(k===hr)N=new Vr;else if(k===pr)N=new Hr;else if(k===or){if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");var K=Nn(e,t,t+te-1,O);N=o?s?In(K,Sn,x):In(K):new vr(K),t+=te}else if(k===ar){var X=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24;if(X<13)throw new xt("code_w_scope total size shorter minimum expected length");if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");K=Nn(e,t,t+te-1,O),U=t+=te;var Q=e[t]|e[t+1]<<8|e[t+2]<<16|e[t+3]<<24,ee=On(e,U,r,!1);if(t+=Q,X<8+Q+te)throw new xt("code_w_scope total size is too short, truncating scope");if(X>8+Q+te)throw new xt("code_w_scope total size is too long, clips outer document");o?(N=s?In(K,Sn,x):In(K)).scope=ee:N=new vr(K,ee)}else{if(k!==ir)throw new xt("Detected unknown BSON type ".concat(k.toString(16),' for fieldname "').concat(I,'"'));var te;if((te=e[t++]|e[t++]<<8|e[t++]<<16|e[t++]<<24)<=0||te>e.length-t||0!==e[t+te-1])throw new xt("bad string length in bson");if(null!=p&&p.utf8&&!xn(e,t,t+te-1))throw new xt("Invalid UTF-8 string in BSON document");var re=e.toString("utf8",t,t+te-1);t+=te;var ne=bt.alloc(12);e.copy(ne,0,t,t+12),F=new Jr(ne),t+=12,N=new _r(re,F)}"__proto__"===I?Object.defineProperty(x,I,{value:N,writable:!0,enumerable:!0,configurable:!0}):x[I]=N}if(E!==t-w){if(n)throw new xt("corrupt array bson");throw new xt("corrupt object bson")}if(!A)return x;if(br(x)){var ie=Object.assign({},x);return delete ie.$ref,delete ie.$id,delete ie.$db,new _r(x.$ref,x.$id,x.$db,ie)}return x}function In(e,t,r){return t?(null==t[e]&&(t[e]=new Function(e)),t[e].bind(r)):new Function(e)}function Nn(e,t,r,n){var i=e.toString("utf8",t,r);if(n)for(var o=0;o>24&255,e[n+2]=s+1>>16&255,e[n+1]=s+1>>8&255,e[n]=s+1&255,n=n+4+s,e[n++]=0,n}var Un=new Uint8Array(8),Cn=new DataView(Un.buffer,Un.byteOffset,Un.byteLength);function jn(e,t,r,n,i){return Number.isInteger(r)&&r>=Vt&&r<=Ht?(e[n++]=ur,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255):(e[n++]=Gt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,Cn.setFloat64(0,r,!0),e.set(Un,n),n+=8),n}function Dn(e,t,r,n,i){return e[n++]=rr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,n}function Mn(e,t,r,n,i){return e[n++]=er,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=r?1:0,n}function Pn(e,t,r,n,i){e[n++]=tr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=kr.fromNumber(r.getTime()),s=o.getLowBits(),a=o.getHighBits();return e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=255&a,e[n++]=a>>8&255,e[n++]=a>>16&255,e[n++]=a>>24&255,n}function zn(e,t,r,n,i){if(e[n++]=nr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,r.source&&null!=r.source.match(Fn))throw Error("value "+r.source+" must not contain null bytes");return n+=e.write(r.source,n,void 0,"utf8"),e[n++]=0,r.ignoreCase&&(e[n++]=105),r.global&&(e[n++]=115),r.multiline&&(e[n++]=109),e[n++]=0,n}function $n(e,t,r,n,i){if(e[n++]=nr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,null!=r.pattern.match(Fn))throw Error("pattern "+r.pattern+" must not contain null bytes");return n+=e.write(r.pattern,n,void 0,"utf8"),e[n++]=0,n+=e.write(r.options.split("").sort().join(""),n,void 0,"utf8"),e[n++]=0,n}function Hn(e,t,r,n,i){return null===r?e[n++]=rr:"MinKey"===r._bsontype?e[n++]=hr:e[n++]=pr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,n}function Vn(e,t,r,n,i){if(e[n++]=Qt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,"string"==typeof r.id)e.write(r.id,n,void 0,"binary");else{if(!Nt(r.id))throw new Bt("object ["+JSON.stringify(r)+"] is not a valid ObjectId");e.set(r.id.subarray(0,12),n)}return n+12}function Zn(e,t,r,n,i){e[n++]=Kt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=r.length;return e[n++]=255&o,e[n++]=o>>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=dr,e.set(Dt(r),n),n+o}function qn(e,t,r,n,i,o,s,a,u,c){void 0===i&&(i=!1),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=!1),void 0===c&&(c=[]);for(var f=0;f>8&255,e[n++]=o>>16&255,e[n++]=o>>24&255,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,n}function Wn(e,t,r,n,i){return r=r.valueOf(),e[n++]=ur,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,e[n++]=255&r,e[n++]=r>>8&255,e[n++]=r>>16&255,e[n++]=r>>24&255,n}function Yn(e,t,r,n,i){return e[n++]=Gt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,Cn.setFloat64(0,r.value,!0),e.set(Un,n),n+8}function Kn(e,t,r,n,i,o,s){e[n++]=or,n+=s?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var a=kt(r),u=e.write(a,n+4,void 0,"utf8")+1;return e[n]=255&u,e[n+1]=u>>8&255,e[n+2]=u>>16&255,e[n+3]=u>>24&255,n=n+4+u-1,e[n++]=0,n}function Xn(e,t,r,n,i,o,s,a,u){if(void 0===i&&(i=!1),void 0===o&&(o=0),void 0===s&&(s=!1),void 0===a&&(a=!0),void 0===u&&(u=!1),r.scope&&"object"==typeof r.scope){e[n++]=ar,n+=u?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var c=n,f="string"==typeof r.code?r.code:r.code.toString();n+=4;var l=e.write(f,n+4,void 0,"utf8")+1;e[n]=255&l,e[n+1]=l>>8&255,e[n+2]=l>>16&255,e[n+3]=l>>24&255,e[n+4+l-1]=0,n=n+l+4;var h=ri(e,r.scope,i,n,o+1,s,a);n=h-1;var p=h-c;e[c++]=255&p,e[c++]=p>>8&255,e[c++]=p>>16&255,e[c++]=p>>24&255,e[n++]=0}else{e[n++]=or,n+=u?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0,f=r.code.toString();var d=e.write(f,n+4,void 0,"utf8")+1;e[n]=255&d,e[n+1]=d>>8&255,e[n+2]=d>>16&255,e[n+3]=d>>24&255,n=n+4+d-1,e[n++]=0}return n}function Qn(e,t,r,n,i){e[n++]=Kt,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=r.value(!0),s=r.position;return r.sub_type===gr.SUBTYPE_BYTE_ARRAY&&(s+=4),e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255,e[n++]=r.sub_type,r.sub_type===gr.SUBTYPE_BYTE_ARRAY&&(s-=4,e[n++]=255&s,e[n++]=s>>8&255,e[n++]=s>>16&255,e[n++]=s>>24&255),e.set(o,n),n+r.position}function ei(e,t,r,n,i){e[n++]=sr,n+=i?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var o=e.write(r.value,n+4,void 0,"utf8")+1;return e[n]=255&o,e[n+1]=o>>8&255,e[n+2]=o>>16&255,e[n+3]=o>>24&255,n=n+4+o-1,e[n++]=0,n}function ti(e,t,r,n,i,o,s){e[n++]=Wt,n+=s?e.write(t,n,void 0,"ascii"):e.write(t,n,void 0,"utf8"),e[n++]=0;var a=n,u={$ref:r.collection||r.namespace,$id:r.oid};null!=r.db&&(u.$db=r.db);var c=ri(e,u=Object.assign(u,r.fields),!1,n,i+1,o),f=c-a;return e[a++]=255&f,e[a++]=f>>8&255,e[a++]=f>>16&255,e[a++]=f>>24&255,c}function ri(e,t,r,n,i,o,s,a){void 0===r&&(r=!1),void 0===n&&(n=0),void 0===i&&(i=0),void 0===o&&(o=!1),void 0===s&&(s=!0),void 0===a&&(a=[]),n=n||0,(a=a||[]).push(t);var u,c=n+4;if(Array.isArray(t))for(var f=0;f>8&255,e[n++]=m>>16&255,e[n++]=m>>24&255,c}var ni=17825792,ii=bt.alloc(ni),oi={Binary:gr,Code:vr,DBRef:_r,Decimal128:Pr,Double:zr,Int32:$r,Long:kr,UUID:mr,Map:cn,MaxKey:Hr,MinKey:Vr,ObjectId:Jr,ObjectID:Jr,BSONRegExp:Wr,BSONSymbol:Yr,Timestamp:Kr,EJSON:un,setInternalBufferSize:function(e){ii.length