botframework-streaming
Version:
Streaming library for the Microsoft Bot Framework
12 lines (11 loc) • 116 kB
JavaScript
'use strict';
var ta=Object.create;var gt=Object.defineProperty;var ra=Object.getOwnPropertyDescriptor;var na=Object.getOwnPropertyNames;var ia=Object.getPrototypeOf,oa=Object.prototype.hasOwnProperty;var B=Math.pow;var Z=(t,e)=>()=>(t&&(e=t(t=0)),e);var L=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Bn=(t,e)=>{for(var r in e)gt(t,r,{get:e[r],enumerable:!0});},Ln=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of na(e))!oa.call(t,i)&&i!==r&>(t,i,{get:()=>e[i],enumerable:!(n=ra(e,i))||n.enumerable});return t};var bt=(t,e,r)=>(r=t!=null?ta(ia(t)):{},Ln(e||!t||!t.__esModule?gt(r,"default",{value:t,enumerable:!0}):r,t)),et=t=>Ln(gt({},"__esModule",{value:!0}),t);var S=(t,e,r)=>new Promise((n,i)=>{var o=h=>{try{c(r.next(h));}catch(v){i(v);}},a=h=>{try{c(r.throw(h));}catch(v){i(v);}},c=h=>h.done?n(h.value):Promise.resolve(h.value).then(o,a);c((r=r.apply(t,e)).next());});var s=Z(()=>{});var u=Z(()=>{bt(Se(),1);});var Nn=L((Qf,Cn)=>{l();s();u();f();var C=Cn.exports={},Q,ee;function vr(){throw new Error("setTimeout has not been defined")}function wr(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Q=setTimeout:Q=vr;}catch(t){Q=vr;}try{typeof clearTimeout=="function"?ee=clearTimeout:ee=wr;}catch(t){ee=wr;}})();function Pn(t){if(Q===setTimeout)return setTimeout(t,0);if((Q===vr||!Q)&&setTimeout)return Q=setTimeout,setTimeout(t,0);try{return Q(t,0)}catch(e){try{return Q.call(null,t,0)}catch(r){return Q.call(this,t,0)}}}function sa(t){if(ee===clearTimeout)return clearTimeout(t);if((ee===wr||!ee)&&clearTimeout)return ee=clearTimeout,clearTimeout(t);try{return ee(t)}catch(e){try{return ee.call(null,t)}catch(r){return ee.call(this,t)}}}var se=[],Fe=!1,Ee,vt=-1;function ua(){!Fe||!Ee||(Fe=!1,Ee.length?se=Ee.concat(se):vt=-1,se.length&&On());}function On(){if(!Fe){var t=Pn(ua);Fe=!0;for(var e=se.length;e;){for(Ee=se,se=[];++vt<e;)Ee&&Ee[vt].run();vt=-1,e=se.length;}Ee=null,Fe=!1,sa(t);}}C.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];se.push(new Mn(t,e)),se.length===1&&!Fe&&Pn(On);};function Mn(t,e){this.fun=t,this.array=e;}Mn.prototype.run=function(){this.fun.apply(null,this.array);};C.title="browser";C.browser=!0;C.env={};C.argv=[];C.version="";C.versions={};function ue(){}C.on=ue;C.addListener=ue;C.once=ue;C.off=ue;C.removeListener=ue;C.removeAllListeners=ue;C.emit=ue;C.prependListener=ue;C.prependOnceListener=ue;C.listeners=function(t){return []};C.binding=function(t){throw new Error("process.binding is not supported")};C.cwd=function(){return "/"};C.chdir=function(t){throw new Error("process.chdir is not supported")};C.umask=function(){return 0};});var p,f=Z(()=>{p=bt(Nn(),1);});var Fn=L(wt=>{l();s();u();f();wt.byteLength=la;wt.toByteArray=da;wt.fromByteArray=ma;var te=[],G=[],fa=typeof Uint8Array!="undefined"?Uint8Array:Array,Sr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Re=0,Dn=Sr.length;Re<Dn;++Re)te[Re]=Sr[Re],G[Sr.charCodeAt(Re)]=Re;var Re,Dn;G[45]=62;G[95]=63;function Un(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return [r,n]}function la(t){var e=Un(t),r=e[0],n=e[1];return (r+n)*3/4-n}function ca(t,e,r){return (e+r)*3/4-r}function da(t){var e,r=Un(t),n=r[0],i=r[1],o=new fa(ca(t,n,i)),a=0,c=i>0?n-4:n,h;for(h=0;h<c;h+=4)e=G[t.charCodeAt(h)]<<18|G[t.charCodeAt(h+1)]<<12|G[t.charCodeAt(h+2)]<<6|G[t.charCodeAt(h+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=G[t.charCodeAt(h)]<<2|G[t.charCodeAt(h+1)]>>4,o[a++]=e&255),i===1&&(e=G[t.charCodeAt(h)]<<10|G[t.charCodeAt(h+1)]<<4|G[t.charCodeAt(h+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ha(t){return te[t>>18&63]+te[t>>12&63]+te[t>>6&63]+te[t&63]}function pa(t,e,r){for(var n,i=[],o=e;o<r;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),i.push(ha(n));return i.join("")}function ma(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,c=r-n;a<c;a+=o)i.push(pa(t,a,a+o>c?c:a+o));return n===1?(e=t[r-1],i.push(te[e>>2]+te[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(te[e>>10]+te[e>>4&63]+te[e<<2&63]+"=")),i.join("")}});var qn=L(Er=>{l();s();u();f();Er.read=function(t,e,r,n,i){var o,a,c=i*8-n-1,h=(1<<c)-1,v=h>>1,b=-7,w=r?i-1:0,x=r?-1:1,E=t[e+w];for(w+=x,o=E&(1<<-b)-1,E>>=-b,b+=c;b>0;o=o*256+t[e+w],w+=x,b-=8);for(a=o&(1<<-b)-1,o>>=-b,b+=n;b>0;a=a*256+t[e+w],w+=x,b-=8);if(o===0)o=1-v;else {if(o===h)return a?NaN:(E?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-v;}return (E?-1:1)*a*Math.pow(2,o-n)};Er.write=function(t,e,r,n,i,o){var a,c,h,v=o*8-i-1,b=(1<<v)-1,w=b>>1,x=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,E=n?0:o-1,T=n?1:-1,q=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(c=isNaN(e)?1:0,a=b):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),a+w>=1?e+=x/h:e+=x*Math.pow(2,1-w),e*h>=2&&(a++,h/=2),a+w>=b?(c=0,a=b):a+w>=1?(c=(e*h-1)*Math.pow(2,i),a=a+w):(c=e*Math.pow(2,w-1)*Math.pow(2,i),a=0));i>=8;t[r+E]=c&255,E+=T,c/=256,i-=8);for(a=a<<i|c,v+=i;v>0;t[r+E]=a&255,E+=T,a/=256,v-=8);t[r+E-T]|=q*128;};});var Se=L(He=>{l();s();u();f();var Rr=Fn(),ke=qn(),kn=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;He.Buffer=d;He.SlowBuffer=Sa;He.INSPECT_MAX_BYTES=50;var St=2147483647;He.kMaxLength=St;d.TYPED_ARRAY_SUPPORT=ya();!d.TYPED_ARRAY_SUPPORT&&typeof console!="undefined"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ya(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch(t){return !1}}Object.defineProperty(d.prototype,"parent",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.buffer}});Object.defineProperty(d.prototype,"offset",{enumerable:!0,get:function(){if(d.isBuffer(this))return this.byteOffset}});function fe(t){if(t>St)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,d.prototype),e}function d(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Ar(t)}return $n(t,e,r)}d.poolSize=8192;function $n(t,e,r){if(typeof t=="string")return ba(t,e);if(ArrayBuffer.isView(t))return va(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(re(t,ArrayBuffer)||t&&re(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer!="undefined"&&(re(t,SharedArrayBuffer)||t&&re(t.buffer,SharedArrayBuffer)))return xr(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return d.from(n,e,r);let i=wa(t);if(i)return i;if(typeof Symbol!="undefined"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return d.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}d.from=function(t,e,r){return $n(t,e,r)};Object.setPrototypeOf(d.prototype,Uint8Array.prototype);Object.setPrototypeOf(d,Uint8Array);function Vn(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function ga(t,e,r){return Vn(t),t<=0?fe(t):e!==void 0?typeof r=="string"?fe(t).fill(e,r):fe(t).fill(e):fe(t)}d.alloc=function(t,e,r){return ga(t,e,r)};function Ar(t){return Vn(t),fe(t<0?0:Tr(t)|0)}d.allocUnsafe=function(t){return Ar(t)};d.allocUnsafeSlow=function(t){return Ar(t)};function ba(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!d.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Gn(t,e)|0,n=fe(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function _r(t){let e=t.length<0?0:Tr(t.length)|0,r=fe(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function va(t){if(re(t,Uint8Array)){let e=new Uint8Array(t);return xr(e.buffer,e.byteOffset,e.byteLength)}return _r(t)}function xr(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&r===void 0?n=new Uint8Array(t):r===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,r),Object.setPrototypeOf(n,d.prototype),n}function wa(t){if(d.isBuffer(t)){let e=Tr(t.length)|0,r=fe(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Lr(t.length)?fe(0):_r(t);if(t.type==="Buffer"&&Array.isArray(t.data))return _r(t.data)}function Tr(t){if(t>=St)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+St.toString(16)+" bytes");return t|0}function Sa(t){return +t!=t&&(t=0),d.alloc(+t)}d.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==d.prototype};d.compare=function(e,r){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),re(r,Uint8Array)&&(r=d.from(r,r.offset,r.byteLength)),!d.isBuffer(e)||!d.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,i=r.length;for(let o=0,a=Math.min(n,i);o<a;++o)if(e[o]!==r[o]){n=e[o],i=r[o];break}return n<i?-1:i<n?1:0};d.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return !0;default:return !1}};d.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return d.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=d.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let a=e[n];if(re(a,Uint8Array))o+a.length>i.length?(d.isBuffer(a)||(a=d.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(d.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length;}return i};function Gn(t,e){if(d.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||re(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let i=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Ir(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return ti(t).length;default:if(i)return n?-1:Ir(t).length;e=(""+e).toLowerCase(),i=!0;}}d.byteLength=Gn;function Ea(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return "";for(t||(t="utf8");;)switch(t){case"hex":return Oa(this,e,r);case"utf8":case"utf-8":return Jn(this,e,r);case"ascii":return La(this,e,r);case"latin1":case"binary":return Pa(this,e,r);case"base64":return Ta(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ma(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0;}}d.prototype._isBuffer=!0;function _e(t,e,r){let n=t[e];t[e]=t[r],t[r]=n;}d.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)_e(this,r,r+1);return this};d.prototype.swap32=function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)_e(this,r,r+3),_e(this,r+1,r+2);return this};d.prototype.swap64=function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)_e(this,r,r+7),_e(this,r+1,r+6),_e(this,r+2,r+5),_e(this,r+3,r+4);return this};d.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Jn(this,0,e):Ea.apply(this,arguments)};d.prototype.toLocaleString=d.prototype.toString;d.prototype.equals=function(e){if(!d.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:d.compare(this,e)===0};d.prototype.inspect=function(){let e="",r=He.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};kn&&(d.prototype[kn]=d.prototype.inspect);d.prototype.compare=function(e,r,n,i,o){if(re(e,Uint8Array)&&(e=d.from(e,e.offset,e.byteLength)),!d.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),i===void 0&&(i=0),o===void 0&&(o=this.length),r<0||n>e.length||i<0||o>this.length)throw new RangeError("out of range index");if(i>=o&&r>=n)return 0;if(i>=o)return -1;if(r>=n)return 1;if(r>>>=0,n>>>=0,i>>>=0,o>>>=0,this===e)return 0;let a=o-i,c=n-r,h=Math.min(a,c),v=this.slice(i,o),b=e.slice(r,n);for(let w=0;w<h;++w)if(v[w]!==b[w]){a=v[w],c=b[w];break}return a<c?-1:c<a?1:0};function Yn(t,e,r,n,i){if(t.length===0)return -1;if(typeof r=="string"?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Lr(r)&&(r=i?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(i)return -1;r=t.length-1;}else if(r<0)if(i)r=0;else return -1;if(typeof e=="string"&&(e=d.from(e,n)),d.isBuffer(e))return e.length===0?-1:jn(t,e,r,n,i);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?i?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):jn(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function jn(t,e,r,n,i){let o=1,a=t.length,c=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return -1;o=2,a/=2,c/=2,r/=2;}function h(b,w){return o===1?b[w]:b.readUInt16BE(w*o)}let v;if(i){let b=-1;for(v=r;v<a;v++)if(h(t,v)===h(e,b===-1?0:v-b)){if(b===-1&&(b=v),v-b+1===c)return b*o}else b!==-1&&(v-=v-b),b=-1;}else for(r+c>a&&(r=a-c),v=r;v>=0;v--){let b=!0;for(let w=0;w<c;w++)if(h(t,v+w)!==h(e,w)){b=!1;break}if(b)return v}return -1}d.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};d.prototype.indexOf=function(e,r,n){return Yn(this,e,r,n,!0)};d.prototype.lastIndexOf=function(e,r,n){return Yn(this,e,r,n,!1)};function Ra(t,e,r,n){r=Number(r)||0;let i=t.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(e.substr(a*2,2),16);if(Lr(c))return a;t[r+a]=c;}return a}function _a(t,e,r,n){return Et(Ir(e,t.length-r),t,r,n)}function xa(t,e,r,n){return Et(Ua(e),t,r,n)}function Ia(t,e,r,n){return Et(ti(e),t,r,n)}function Aa(t,e,r,n){return Et(Fa(e,t.length-r),t,r,n)}d.prototype.write=function(e,r,n,i){if(r===void 0)i="utf8",n=this.length,r=0;else if(n===void 0&&typeof r=="string")i=r,n=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(n)?(n=n>>>0,i===void 0&&(i="utf8")):(i=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");i||(i="utf8");let a=!1;for(;;)switch(i){case"hex":return Ra(this,e,r,n);case"utf8":case"utf-8":return _a(this,e,r,n);case"ascii":case"latin1":case"binary":return xa(this,e,r,n);case"base64":return Ia(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Aa(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0;}};d.prototype.toJSON=function(){return {type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Ta(t,e,r){return e===0&&r===t.length?Rr.fromByteArray(t):Rr.fromByteArray(t.slice(e,r))}function Jn(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],a=null,c=o>239?4:o>223?3:o>191?2:1;if(i+c<=r){let h,v,b,w;switch(c){case 1:o<128&&(a=o);break;case 2:h=t[i+1],(h&192)===128&&(w=(o&31)<<6|h&63,w>127&&(a=w));break;case 3:h=t[i+1],v=t[i+2],(h&192)===128&&(v&192)===128&&(w=(o&15)<<12|(h&63)<<6|v&63,w>2047&&(w<55296||w>57343)&&(a=w));break;case 4:h=t[i+1],v=t[i+2],b=t[i+3],(h&192)===128&&(v&192)===128&&(b&192)===128&&(w=(o&15)<<18|(h&63)<<12|(v&63)<<6|b&63,w>65535&&w<1114112&&(a=w));}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=c;}return Ba(n)}var Hn=4096;function Ba(t){let e=t.length;if(e<=Hn)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Hn));return r}function La(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]&127);return n}function Pa(t,e,r){let n="";r=Math.min(t.length,r);for(let i=e;i<r;++i)n+=String.fromCharCode(t[i]);return n}function Oa(t,e,r){let n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let i="";for(let o=e;o<r;++o)i+=qa[t[o]];return i}function Ma(t,e,r){let n=t.slice(e,r),i="";for(let o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+n[o+1]*256);return i}d.prototype.slice=function(e,r){let n=this.length;e=~~e,r=r===void 0?n:~~r,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),r<e&&(r=e);let i=this.subarray(e,r);return Object.setPrototypeOf(i,d.prototype),i};function U(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}d.prototype.readUintLE=d.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||U(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return i};d.prototype.readUintBE=d.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||U(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};d.prototype.readUint8=d.prototype.readUInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]};d.prototype.readUint16LE=d.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]|this[e+1]<<8};d.prototype.readUint16BE=d.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||U(e,2,this.length),this[e]<<8|this[e+1]};d.prototype.readUint32LE=d.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};d.prototype.readUint32BE=d.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};d.prototype.readBigUInt64LE=me(function(e){e=e>>>0,je(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&tt(e,this.length-8);let i=r+this[++e]*B(2,8)+this[++e]*B(2,16)+this[++e]*B(2,24),o=this[++e]+this[++e]*B(2,8)+this[++e]*B(2,16)+n*B(2,24);return BigInt(i)+(BigInt(o)<<BigInt(32))});d.prototype.readBigUInt64BE=me(function(e){e=e>>>0,je(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&tt(e,this.length-8);let i=r*B(2,24)+this[++e]*B(2,16)+this[++e]*B(2,8)+this[++e],o=this[++e]*B(2,24)+this[++e]*B(2,16)+this[++e]*B(2,8)+n;return (BigInt(i)<<BigInt(32))+BigInt(o)});d.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||U(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*r)),i};d.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||U(e,r,this.length);let i=r,o=1,a=this[e+--i];for(;i>0&&(o*=256);)a+=this[e+--i]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*r)),a};d.prototype.readInt8=function(e,r){return e=e>>>0,r||U(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};d.prototype.readInt16LE=function(e,r){e=e>>>0,r||U(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};d.prototype.readInt16BE=function(e,r){e=e>>>0,r||U(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};d.prototype.readInt32LE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};d.prototype.readInt32BE=function(e,r){return e=e>>>0,r||U(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};d.prototype.readBigInt64LE=me(function(e){e=e>>>0,je(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&tt(e,this.length-8);let i=this[e+4]+this[e+5]*B(2,8)+this[e+6]*B(2,16)+(n<<24);return (BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*B(2,8)+this[++e]*B(2,16)+this[++e]*B(2,24))});d.prototype.readBigInt64BE=me(function(e){e=e>>>0,je(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&tt(e,this.length-8);let i=(r<<24)+this[++e]*B(2,16)+this[++e]*B(2,8)+this[++e];return (BigInt(i)<<BigInt(32))+BigInt(this[++e]*B(2,24)+this[++e]*B(2,16)+this[++e]*B(2,8)+n)});d.prototype.readFloatLE=function(e,r){return e=e>>>0,r||U(e,4,this.length),ke.read(this,e,!0,23,4)};d.prototype.readFloatBE=function(e,r){return e=e>>>0,r||U(e,4,this.length),ke.read(this,e,!1,23,4)};d.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||U(e,8,this.length),ke.read(this,e,!0,52,8)};d.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||U(e,8,this.length),ke.read(this,e,!1,52,8)};function j(t,e,r,n,i,o){if(!d.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>i||e<o)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}d.prototype.writeUintLE=d.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;j(this,e,r,n,c,0);}let o=1,a=0;for(this[r]=e&255;++a<n&&(o*=256);)this[r+a]=e/o&255;return r+n};d.prototype.writeUintBE=d.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let c=Math.pow(2,8*n)-1;j(this,e,r,n,c,0);}let o=n-1,a=1;for(this[r+o]=e&255;--o>=0&&(a*=256);)this[r+o]=e/a&255;return r+n};d.prototype.writeUint8=d.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,1,255,0),this[r]=e&255,r+1};d.prototype.writeUint16LE=d.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};d.prototype.writeUint16BE=d.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};d.prototype.writeUint32LE=d.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};d.prototype.writeUint32BE=d.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function zn(t,e,r,n,i){ei(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function Kn(t,e,r,n,i){ei(e,n,i,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}d.prototype.writeBigUInt64LE=me(function(e,r=0){return zn(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeBigUInt64BE=me(function(e,r=0){return Kn(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});d.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let h=Math.pow(2,8*n-1);j(this,e,r,n,h-1,-h);}let o=0,a=1,c=0;for(this[r]=e&255;++o<n&&(a*=256);)e<0&&c===0&&this[r+o-1]!==0&&(c=1),this[r+o]=(e/a>>0)-c&255;return r+n};d.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let h=Math.pow(2,8*n-1);j(this,e,r,n,h-1,-h);}let o=n-1,a=1,c=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&c===0&&this[r+o+1]!==0&&(c=1),this[r+o]=(e/a>>0)-c&255;return r+n};d.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};d.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};d.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};d.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};d.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||j(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};d.prototype.writeBigInt64LE=me(function(e,r=0){return zn(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});d.prototype.writeBigInt64BE=me(function(e,r=0){return Kn(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Xn(t,e,r,n,i,o){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function Zn(t,e,r,n,i){return e=+e,r=r>>>0,i||Xn(t,e,r,4),ke.write(t,e,r,n,23,4),r+4}d.prototype.writeFloatLE=function(e,r,n){return Zn(this,e,r,!0,n)};d.prototype.writeFloatBE=function(e,r,n){return Zn(this,e,r,!1,n)};function Qn(t,e,r,n,i){return e=+e,r=r>>>0,i||Xn(t,e,r,8),ke.write(t,e,r,n,52,8),r+8}d.prototype.writeDoubleLE=function(e,r,n){return Qn(this,e,r,!0,n)};d.prototype.writeDoubleBE=function(e,r,n){return Qn(this,e,r,!1,n)};d.prototype.copy=function(e,r,n,i){if(!d.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!i&&i!==0&&(i=this.length),r>=e.length&&(r=e.length),r||(r=0),i>0&&i<n&&(i=n),i===n||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("sourceEnd out of bounds");i>this.length&&(i=this.length),e.length-r<i-n&&(i=e.length-r+n);let o=i-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,n,i):Uint8Array.prototype.set.call(e,this.subarray(n,i),r),o};d.prototype.fill=function(e,r,n,i){if(typeof e=="string"){if(typeof r=="string"?(i=r,r=0,n=this.length):typeof n=="string"&&(i=n,n=this.length),i!==void 0&&typeof i!="string")throw new TypeError("encoding must be a string");if(typeof i=="string"&&!d.isEncoding(i))throw new TypeError("Unknown encoding: "+i);if(e.length===1){let a=e.charCodeAt(0);(i==="utf8"&&a<128||i==="latin1")&&(e=a);}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<n)throw new RangeError("Out of range index");if(n<=r)return this;r=r>>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<n;++o)this[o]=e;else {let a=d.isBuffer(e)?e:d.from(e,i),c=a.length;if(c===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=a[o%c];}return this};var qe={};function Br(t,e,r){qe[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name;}get code(){return t}set code(i){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:i,writable:!0});}toString(){return `${this.name} [${t}]: ${this.message}`}};}Br("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Br("ERR_INVALID_ARG_TYPE",function(t,e){return `The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Br("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,i=r;return Number.isInteger(r)&&Math.abs(r)>B(2,32)?i=Wn(String(r)):typeof r=="bigint"&&(i=String(r),(r>B(BigInt(2),BigInt(32))||r<-B(BigInt(2),BigInt(32)))&&(i=Wn(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Wn(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return `${t.slice(0,r)}${e}`}function Ca(t,e,r){je(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&tt(e,t.length-(r+1));}function ei(t,e,r,n,i,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",c;throw e===0||e===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`,new qe.ERR_OUT_OF_RANGE("value",c,t)}Ca(n,i,o);}function je(t,e){if(typeof t!="number")throw new qe.ERR_INVALID_ARG_TYPE(e,"number",t)}function tt(t,e,r){throw Math.floor(t)!==t?(je(t,r),new qe.ERR_OUT_OF_RANGE("offset","an integer",t)):e<0?new qe.ERR_BUFFER_OUT_OF_BOUNDS:new qe.ERR_OUT_OF_RANGE("offset",`>= ${0} and <= ${e}`,t)}var Na=/[^+/0-9A-Za-z-_]/g;function Da(t){if(t=t.split("=")[0],t=t.trim().replace(Na,""),t.length<2)return "";for(;t.length%4!==0;)t=t+"=";return t}function Ir(t,e){e=e||1/0;let r,n=t.length,i=null,o=[];for(let a=0;a<n;++a){if(r=t.charCodeAt(a),r>55295&&r<57344){if(!i){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),i=r;continue}r=(i-55296<<10|r-56320)+65536;}else i&&(e-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((e-=1)<0)break;o.push(r);}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128);}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128);}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128);}else throw new Error("Invalid code point")}return o}function Ua(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Fa(t,e){let r,n,i,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)r=t.charCodeAt(a),n=r>>8,i=r%256,o.push(i),o.push(n);return o}function ti(t){return Rr.toByteArray(Da(t))}function Et(t,e,r,n){let i;for(i=0;i<n&&!(i+r>=e.length||i>=t.length);++i)e[i+r]=t[i];return i}function re(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Lr(t){return t!==t}var qa=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let i=0;i<16;++i)e[n+i]=t[r]+t[i];}return e}();function me(t){return typeof BigInt=="undefined"?ka:t}function ka(){throw new Error("BigInt not supported")}});var g,l=Z(()=>{g=bt(Se());});function A(){A.init.call(this);}function It(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function di(t){return t._maxListeners===void 0?A.defaultMaxListeners:t._maxListeners}function ai(t,e,r,n){var i,o,a,c;if(It(r),(o=t._events)===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),a=o[e]),a===void 0)a=o[e]=r,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(i=di(t))>0&&a.length>i&&!a.warned){a.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=a.length,c=h,console&&console.warn&&console.warn(c);}return t}function $a(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function si(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=$a.bind(n);return i.listener=r,n.wrapFn=i,i}function ui(t,e,r){var n=t._events;if(n===void 0)return [];var i=n[e];return i===void 0?[]:typeof i=="function"?r?[i.listener||i]:[i]:r?function(o){for(var a=new Array(o.length),c=0;c<a.length;++c)a[c]=o[c].listener||o[c];return a}(i):hi(i,i.length)}function fi(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}function hi(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}var li,ci,$e,ni,ii,oi,H,Nr=Z(()=>{l();s();u();f();$e=typeof Reflect=="object"?Reflect:null,ni=$e&&typeof $e.apply=="function"?$e.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};ci=$e&&typeof $e.ownKeys=="function"?$e.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};ii=Number.isNaN||function(t){return t!=t};li=A,A.EventEmitter=A,A.prototype._events=void 0,A.prototype._eventsCount=0,A.prototype._maxListeners=void 0;oi=10;Object.defineProperty(A,"defaultMaxListeners",{enumerable:!0,get:function(){return oi},set:function(t){if(typeof t!="number"||t<0||ii(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");oi=t;}}),A.init=function(){this._events!==void 0&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0;},A.prototype.setMaxListeners=function(t){if(typeof t!="number"||t<0||ii(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},A.prototype.getMaxListeners=function(){return di(this)},A.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n=t==="error",i=this._events;if(i!==void 0)n=n&&i.error===void 0;else if(!n)return !1;if(n){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var a=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw a.context=o,a}var c=i[t];if(c===void 0)return !1;if(typeof c=="function")ni(c,this,e);else {var h=c.length,v=hi(c,h);for(r=0;r<h;++r)ni(v[r],this,e);}return !0},A.prototype.addListener=function(t,e){return ai(this,t,e,!1)},A.prototype.on=A.prototype.addListener,A.prototype.prependListener=function(t,e){return ai(this,t,e,!0)},A.prototype.once=function(t,e){return It(e),this.on(t,si(this,t,e)),this},A.prototype.prependOnceListener=function(t,e){return It(e),this.prependListener(t,si(this,t,e)),this},A.prototype.removeListener=function(t,e){var r,n,i,o,a;if(It(e),(n=this._events)===void 0)return this;if((r=n[t])===void 0)return this;if(r===e||r.listener===e)--this._eventsCount==0?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if(typeof r!="function"){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===e||r[o].listener===e){a=r[o].listener,i=o;break}if(i<0)return this;i===0?r.shift():function(c,h){for(;h+1<c.length;h++)c[h]=c[h+1];c.pop();}(r,i),r.length===1&&(n[t]=r[0]),n.removeListener!==void 0&&this.emit("removeListener",t,a||e);}return this},A.prototype.off=A.prototype.removeListener,A.prototype.removeAllListeners=function(t){var e,r,n;if((r=this._events)===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[t]!==void 0&&(--this._eventsCount==0?this._events=Object.create(null):delete r[t]),this;if(arguments.length===0){var i,o=Object.keys(r);for(n=0;n<o.length;++n)(i=o[n])!=="removeListener"&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(typeof(e=r[t])=="function")this.removeListener(t,e);else if(e!==void 0)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},A.prototype.listeners=function(t){return ui(this,t,!0)},A.prototype.rawListeners=function(t){return ui(this,t,!1)},A.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):fi.call(t,e)},A.prototype.listenerCount=fi,A.prototype.eventNames=function(){return this._eventsCount>0?ci(this._events):[]};H=li;H.EventEmitter;H.defaultMaxListeners;H.init;H.listenerCount;H.EventEmitter;H.defaultMaxListeners;H.init;H.listenerCount;});var At={};Bn(At,{EventEmitter:()=>Va,default:()=>H,defaultMaxListeners:()=>Ga,init:()=>Ya,listenerCount:()=>Ja,on:()=>za,once:()=>Ka});var Va,Ga,Ya,Ja,za,Ka,Tt=Z(()=>{l();s();u();f();Nr();Nr();H.once=function(t,e){return new Promise((r,n)=>{function i(...a){o!==void 0&&t.removeListener("error",o),r(a);}let o;e!=="error"&&(o=a=>{t.removeListener(name,i),n(a);},t.once("error",o)),t.once(e,i);})};H.on=function(t,e){let r=[],n=[],i=null,o=!1,a={next(){return S(this,null,function*(){let b=r.shift();if(b)return createIterResult(b,!1);if(i){let w=Promise.reject(i);return i=null,w}return o?createIterResult(void 0,!0):new Promise((w,x)=>n.push({resolve:w,reject:x}))})},return(){return S(this,null,function*(){t.removeListener(e,c),t.removeListener("error",h),o=!0;for(let b of n)b.resolve(createIterResult(void 0,!0));return createIterResult(void 0,!0)})},throw(b){i=b,t.removeListener(e,c),t.removeListener("error",h);},[Symbol.asyncIterator](){return this}};return t.on(e,c),t.on("error",h),a;function c(...b){let w=n.shift();w?w.resolve(createIterResult(b,!1)):r.push(b);}function h(b){o=!0;let w=n.shift();w?w.reject(b):i=b,a.return();}};({EventEmitter:Va,defaultMaxListeners:Ga,init:Ya,listenerCount:Ja,on:za,once:Ka}=H);});var Ie=L(($h,Dr)=>{l();s();u();f();typeof Object.create=="function"?Dr.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}));}:Dr.exports=function(e,r){if(r){e.super_=r;var n=function(){};n.prototype=r.prototype,e.prototype=new n,e.prototype.constructor=e;}};});var Ur=L((zh,pi)=>{l();s();u();f();pi.exports=(Tt(),et(At)).EventEmitter;});function Fr(){throw new Error("setTimeout has not been defined")}function qr(){throw new Error("clearTimeout has not been defined")}function gi(t){if(ce===setTimeout)return setTimeout(t,0);if((ce===Fr||!ce)&&setTimeout)return ce=setTimeout,setTimeout(t,0);try{return ce(t,0)}catch(e){try{return ce.call(null,t,0)}catch(r){return ce.call(this||Ge,t,0)}}}function Xa(){Ve&&Ae&&(Ve=!1,Ae.length?he=Ae.concat(he):Bt=-1,he.length&&bi());}function bi(){if(!Ve){var t=gi(Xa);Ve=!0;for(var e=he.length;e;){for(Ae=he,he=[];++Bt<e;)Ae&&Ae[Bt].run();Bt=-1,e=he.length;}Ae=null,Ve=!1,function(r){if(de===clearTimeout)return clearTimeout(r);if((de===qr||!de)&&clearTimeout)return de=clearTimeout,clearTimeout(r);try{de(r);}catch(n){try{return de.call(null,r)}catch(i){return de.call(this||Ge,r)}}}(t);}}function mi(t,e){(this||Ge).fun=t,(this||Ge).array=e;}function le(){}var yi,ce,de,Ge,N,Ae,he,Ve,Bt,P,Lt=Z(()=>{l();s();u();f();Ge=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:globalThis,N=yi={};(function(){try{ce=typeof setTimeout=="function"?setTimeout:Fr;}catch(t){ce=Fr;}try{de=typeof clearTimeout=="function"?clearTimeout:qr;}catch(t){de=qr;}})();he=[],Ve=!1,Bt=-1;N.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];he.push(new mi(t,e)),he.length!==1||Ve||gi(bi);},mi.prototype.run=function(){(this||Ge).fun.apply(null,(this||Ge).array);},N.title="browser",N.browser=!0,N.env={},N.argv=[],N.version="",N.versions={},N.on=le,N.addListener=le,N.once=le,N.off=le,N.removeListener=le,N.removeAllListeners=le,N.emit=le,N.prependListener=le,N.prependOnceListener=le,N.listeners=function(t){return []},N.binding=function(t){throw new Error("process.binding is not supported")},N.cwd=function(){return "/"},N.chdir=function(t){throw new Error("process.chdir is not supported")},N.umask=function(){return 0};P=yi;P.addListener;P.argv;P.binding;P.browser;P.chdir;P.cwd;P.emit;P.env;P.listeners;P.nextTick;P.off;P.on;P.once;P.prependListener;P.prependOnceListener;P.removeAllListeners;P.removeListener;P.title;P.umask;P.version;P.versions;});function Le(t){return t.call.bind(t)}function at(t,e){if(typeof t!="object")return !1;try{return e(t),!0}catch(r){return !1}}function wi(t){return W&&$?Y(t)!==void 0:Ni(t)||Di(t)||Ui(t)||Fi(t)||qi(t)||ki(t)||ji(t)||Hi(t)||Wi(t)||$i(t)||Vi(t)}function Ni(t){return W&&$?Y(t)==="Uint8Array":O(t)==="[object Uint8Array]"||ss(t)&&t.buffer!==void 0}function Di(t){return W&&$?Y(t)==="Uint8ClampedArray":O(t)==="[object Uint8ClampedArray]"}function Ui(t){return W&&$?Y(t)==="Uint16Array":O(t)==="[object Uint16Array]"}function Fi(t){return W&&$?Y(t)==="Uint32Array":O(t)==="[object Uint32Array]"}function qi(t){return W&&$?Y(t)==="Int8Array":O(t)==="[object Int8Array]"}function ki(t){return W&&$?Y(t)==="Int16Array":O(t)==="[object Int16Array]"}function ji(t){return W&&$?Y(t)==="Int32Array":O(t)==="[object Int32Array]"}function Hi(t){return W&&$?Y(t)==="Float32Array":O(t)==="[object Float32Array]"}function Wi(t){return W&&$?Y(t)==="Float64Array":O(t)==="[object Float64Array]"}function $i(t){return W&&$?Y(t)==="BigInt64Array":O(t)==="[object BigInt64Array]"}function Vi(t){return W&&$?Y(t)==="BigUint64Array":O(t)==="[object BigUint64Array]"}function Pt(t){return O(t)==="[object Map]"}function Ot(t){return O(t)==="[object Set]"}function Mt(t){return O(t)==="[object WeakMap]"}function kr(t){return O(t)==="[object WeakSet]"}function Ut(t){return O(t)==="[object ArrayBuffer]"}function Si(t){return typeof ArrayBuffer!="undefined"&&(Ut.working?Ut(t):t instanceof ArrayBuffer)}function Ft(t){return O(t)==="[object DataView]"}function Ei(t){return typeof DataView!="undefined"&&(Ft.working?Ft(t):t instanceof DataView)}function qt(t){return O(t)==="[object SharedArrayBuffer]"}function Ri(t){return typeof SharedArrayBuffer!="undefined"&&(qt.working?qt(t):t instanceof SharedArrayBuffer)}function _i(t){return at(t,ds)}function xi(t){return at(t,hs)}function Ii(t){return at(t,ps)}function Ai(t){return Ci&&at(t,ms)}function Ti(t){return Vr&&at(t,ys)}function ye(t,e){var r={seen:[],stylize:vs};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Gr(e)?r.showHidden=e:e&&m._extend(r,e),Be(r.showHidden)&&(r.showHidden=!1),Be(r.depth)&&(r.depth=2),Be(r.colors)&&(r.colors=!1),Be(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=bs),kt(r,t,r.depth)}function bs(t,e){var r=ye.styles[e];return r?"\x1B["+ye.colors[r][0]+"m"+t+"\x1B["+ye.colors[r][1]+"m":t}function vs(t,e){return t}function kt(t,e,r){if(t.customInspect&&e&&Dt(e.inspect)&&e.inspect!==m.inspect&&(!e.constructor||e.constructor.prototype!==e)){var n=e.inspect(r,t);return jt(n)||(n=kt(t,n,r)),n}var i=function(x,E){if(Be(E))return x.stylize("undefined","undefined");if(jt(E)){var T="'"+JSON.stringify(E).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return x.stylize(T,"string")}if(Ji(E))return x.stylize(""+E,"number");if(Gr(E))return x.stylize(""+E,"boolean");if($t(E))return x.stylize("null","null")}(t,e);if(i)return i;var o=Object.keys(e),a=function(x){var E={};return x.forEach(function(T,q){E[T]=!0;}),E}(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),ot(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return jr(e);if(o.length===0){if(Dt(e)){var c=e.name?": "+e.name:"";return t.stylize("[Function"+c+"]","special")}if(it(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ht(e))return t.stylize(Date.prototype.toString.call(e),"date");if(ot(e))return jr(e)}var h,v="",b=!1,w=["{","}"];return Yi(e)&&(b=!0,w=["[","]"]),Dt(e)&&(v=" [Function"+(e.name?": "+e.name:"")+"]"),it(e)&&(v=" "+RegExp.prototype.toString.call(e)),Ht(e)&&(v=" "+Date.prototype.toUTCString.call(e)),ot(e)&&(v=" "+jr(e)),o.length!==0||b&&e.length!=0?r<0?it(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special"):(t.seen.push(e),h=b?function(x,E,T,q,X){for(var k=[],yt=0,ea=E.length;yt<ea;++yt)zi(E,String(yt))?k.push(Hr(x,E,T,q,String(yt),!0)):k.push("");return X.forEach(function(Tn){Tn.match(/^\d+$/)||k.push(Hr(x,E,T,q,Tn,!0));}),k}(t,e,r,a,o):o.map(function(x){return Hr(t,e,r,a,x,b)}),t.seen.pop(),function(x,E,T){var q=0;return x.reduce(function(X,k){return q++,k.indexOf(`
`)>=0&&q++,X+k.replace(/\u001b\[\d\d?m/g,"").length+1},0)>60?T[0]+(E===""?"":E+`
`)+" "+x.join(`,
`)+" "+T[1]:T[0]+E+" "+x.join(", ")+" "+T[1]}(h,v,w)):w[0]+v+w[1]}function jr(t){return "["+Error.prototype.toString.call(t)+"]"}function Hr(t,e,r,n,i,o){var a,c,h;if((h=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]}).get?c=h.set?t.stylize("[Getter/Setter]","special"):t.stylize("[Getter]","special"):h.set&&(c=t.stylize("[Setter]","special")),zi(n,i)||(a="["+i+"]"),c||(t.seen.indexOf(h.value)<0?(c=$t(r)?kt(t,h.value,null):kt(t,h.value,r-1)).indexOf(`
`)>-1&&(c=o?c.split(`
`).map(function(v){return " "+v}).join(`
`).substr(2):`
`+c.split(`
`).map(function(v){return " "+v}).join(`
`)):c=t.stylize("[Circular]","special")),Be(a)){if(o&&i.match(/^\d+$/))return c;(a=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.substr(1,a.length-2),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"));}return a+": "+c}function Yi(t){return Array.isArray(t)}function Gr(t){return typeof t=="boolean"}function $t(t){return t===null}function Ji(t){return typeof t=="number"}function jt(t){return typeof t=="string"}function Be(t){return t===void 0}function it(t){return Ye(t)&&Yr(t)==="[object RegExp]"}function Ye(t){return typeof t=="object"&&t!==null}function Ht(t){return Ye(t)&&Yr(t)==="[object Date]"}function ot(t){return Ye(t)&&(Yr(t)==="[object Error]"||t instanceof Error)}function Dt(t){return typeof t=="function"}function Yr(t){return Object.prototype.toString.call(t)}function Wr(t){return t<10?"0"+t.toString(10):t.toString(10)}function Ss(){var t=new Date,e=[Wr(t.getHours()),Wr(t.getMinutes()),Wr(t.getSeconds())].join(":");return [t.getDate(),ws[t.getMonth()],e].join(" ")}function zi(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function Es(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r;}return e(t)}var Za,$r,Wt,Li,Qa,es,ts,rs,ns,Pi,Oi,vi,is,os,as,Mi,_,ss,us,fs,Ci,Vr,$,W,ls,O,ds,hs,ps,nt,m,ne,Bi,gs,Ct,Gi,Nt,ws,Te,Vt=Z(()=>{l();s();u();f();Lt();Za=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",$r=Object.prototype.toString,Wt=function(t){return !(Za&&t&&typeof t=="object"&&Symbol.toStringTag in t)&&$r.call(t)==="[object Arguments]"},Li=function(t){return !!Wt(t)||t!==null&&typeof t=="object"&&typeof t.length=="number"&&t.length>=0&&$r.call(t)!=="[object Array]"&&$r.call(t.callee)==="[object Function]"},Qa=function(){return Wt(arguments)}();Wt.isLegacyArguments=Li;es=Qa?Wt:Li,ts=Object.prototype.toString,rs=Function.prototype.toString,ns=/^\s*(?:function)?\*/,Pi=typeof Symbol=="function"&&typeof Symbol.toStringTag=="symbol",Oi=Object.getPrototypeOf,vi=function(){if(!Pi)return !1;try{return Function("return function*() {}")()}catch(t){}}(),is=vi?Oi(vi):{},os=function(t){return typeof t=="function"&&(!!ns.test(rs.call(t))||(Pi?Oi(t)===is:ts.call(t)==="[object GeneratorFunction]"))},as=typeof Object.create=="function"?function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}));}:function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t;}},Mi=function(t){return t&&typeof t=="object"&&typeof t.copy=="function"&&typeof t.fill=="function"&&typeof t.readUInt8=="function"},_={},ss=Mi,us=es,fs=os;Ci=typeof BigInt!="undefined",Vr=typeof Symbol!="undefined",$=Vr&&Symbol.toStringTag!==void 0,W=typeof Uint8Array!="undefined",ls=typeof ArrayBuffer!="undefined";if(W&&$)var cs=Object.getPrototypeOf(Uint8Array.prototype),Y=Le(Object.getOwnPropertyDescriptor(cs,Symbol.toStringTag).get);O=Le(Object.prototype.toString),ds=Le(Number.prototype.valueOf),hs=Le(String.prototype.valueOf),ps=Le(Boolean.prototype.valueOf);if(Ci)var ms=Le(BigInt.prototype.valueOf);if(Vr)var ys=Le(Symbol.prototype.valueOf);_.isArgumentsObject=us,_.isGeneratorFunction=fs,_.isPromise=function(t){return typeof Promise!="undefined"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"},_.isArrayBufferView=function(t){return ls&&ArrayBuffer.isView?ArrayBuffer.isView(t):wi(t)||Ei(t)},_.isTypedArray=wi,_.isUint8Array=Ni,_.isUint8ClampedArray=Di,_.isUint16Array=Ui,_.isUint32Array=Fi,_.isInt8Array=qi,_.isInt16Array=ki,_.isInt32Array=ji,_.isFloat32Array=Hi,_.isFloat64Array=Wi,_.isBigInt64Array=$i,_.isBigUint64Array=Vi,Pt.working=typeof Map!="undefined"&&Pt(new Map),_.isMap=function(t){return typeof Map!="undefined"&&(Pt.working?Pt(t):t instanceof Map)},Ot.working=typeof Set!="undefined"&&Ot(new Set),_.isSet=function(t){return typeof Set!="undefined"&&(Ot.working?Ot(t):t instanceof Set)},Mt.working=typeof WeakMap!="undefined"&&Mt(new WeakMap),_.isWeakMap=function(t){return typeof WeakMap!="undefined"&&(Mt.working?Mt(t):t instanceof WeakMap)},kr.working=typeof WeakSet!="undefined"&&kr(new WeakSet),_.isWeakSet=function(t){return kr(t)},Ut.working=typeof ArrayBuffer!="undefined"&&Ut(new ArrayBuffer),_.isArrayBuffer=Si,Ft.working=typeof ArrayBuffer!="undefined"&&typeof DataView!="undefined"&&Ft(new DataView(new ArrayBuffer(1),0,1)),_.isDataView=Ei,qt.working=typeof SharedArrayBuffer!="undefined"&&qt(new SharedArrayBuffer),_.isSharedArrayBuffer=Ri,_.isAsyncFunction=function(t){return O(t)==="[object AsyncFunction]"},_.isMapIterator=function(t){return O(t)==="[object Map Iterator]"},_.isSetIterator=function(t){return O(t)==="[object Set Iterator]"},_.isGeneratorObject=function(t){return O(t)==="[object Generator]"},_.isWebAssemblyCompiledModule=function(t){return O(t)==="[object WebAssembly.Module]"},_.isNumberObject=_i,_.isStringObject=xi,_.isBooleanObject=Ii,_.isBigIntObject=Ai,_.isSymbolObject=Ti,_.isBoxedPrimitive=function(t){return _i(t)||xi(t)||Ii(t)||Ai(t)||Ti(t)},_.isAnyArrayBuffer=function(t){return W&&(Si(t)||Ri(t))},["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(_,t,{enumerable:!1