'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=[];++vt1)for(var r=1;r{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;Re0)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>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;oc?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<>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<>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<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=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);oi.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;rr&&(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;w2147483647?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;va&&(r=a-c),v=r;v>=0;v--){let b=!0;for(let w=0;wi&&(n=i)):n=i;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a>>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(;i239?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(;nn)&&(r=n);let i="";for(let o=e;on&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)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>>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)<>>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)<>>0,r=r>>>0,n||U(e,r,this.length);let i=this[e],o=1,a=0;for(;++a=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)<>>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)<>>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||et.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>>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>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=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>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;oB(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= 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;a55295&&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>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=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{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;r0&&(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=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=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{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=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=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,value:function(){throw new Error(t+" is not supported in userland")}});});nt=typeof globalThis!="undefined"?globalThis:typeof self!="undefined"?self:globalThis,m={},ne=P,Bi=Object.getOwnPropertyDescriptors||function(t){for(var e=Object.keys(t),r={},n=0;n=i)return c;switch(c){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch(h){return "[Circular]"}default:return c}}),a=n[r];r{l();s();u();f();Vt();Lt();m._extend;m.callbackify;m.debuglog;m.deprecate;m.format;m.inherits;m.inspect;m.isArray;m.isBoolean;m.isBuffer;m.isDate;m.isError;m.isFunction;m.isNull;m.isNullOrUndefined;m.isNumber;m.isObject;m.isPrimitive;m.isRegExp;m.isString;m.isSymbol;m.isUndefined;m.log;m.promisify;m._extend,m.callbackify,m.debuglog,m.deprecate,m.format,m.inherits,m.inspect,m.isArray,m.isBoolean,m.isBuffer,m.isDate,m.isError,m.isFunction,m.isNull,m.isNullOrUndefined,m.isNumber,m.isObject,m.isPrimitive,m.isRegExp,m.isString,m.isSymbol,m.isUndefined,m.log,m.promisify,m.types;});var Jr={};Bn(Jr,{TextDecoder:()=>zs,TextEncoder:()=>Js,_extend:()=>Rs,callbackify:()=>_s,debuglog:()=>xs,default:()=>m,deprecate:()=>Is,format:()=>As,inherits:()=>Ts,inspect:()=>Bs,isArray:()=>Ls,isBoolean:()=>Ps,isBuffer:()=>Os,isDate:()=>Ms,isError:()=>Cs,isFunction:()=>Ns,isNull:()=>Ds,isNullOrUndefined:()=>Us,isNumber:()=>Fs,isObject:()=>qs,isPrimitive:()=>ks,isRegExp:()=>js,isString:()=>Hs,isSymbol:()=>Ws,isUndefined:()=>$s,log:()=>Vs,promisify:()=>Gs,types:()=>Ys});var Rs,_s,xs,Is,As,Ts,Bs,Ls,Ps,Os,Ms,Cs,Ns,Ds,Us,Fs,qs,ks,js,Hs,Ws,$s,Vs,Gs,Ys,Js,zs,zr=Z(()=>{l();s();u();f();Ki();Vt();Vt();Lt();Rs=m._extend,_s=m.callbackify,xs=m.debuglog,Is=m.deprecate,As=m.format,Ts=m.inherits,Bs=m.inspect,Ls=m.isArray,Ps=m.isBoolean,Os=m.isBuffer,Ms=m.isDate,Cs=m.isError,Ns=m.isFunction,Ds=m.isNull,Us=m.isNullOrUndefined,Fs=m.isNumber,qs=m.isObject,ks=m.isPrimitive,js=m.isRegExp,Hs=m.isString,Ws=m.isSymbol,$s=m.isUndefined,Vs=m.log,Gs=m.promisify,Ys=m.types,Js=m.TextEncoder=globalThis.TextEncoder,zs=m.TextDecoder=globalThis.TextDecoder;});var eo=L((Qp,Qi)=>{l();s();u();f();function Xi(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),r.push.apply(r,n);}return r}function Ks(t){for(var e=1;e0?this.tail.next=n:this.head=n,this.tail=n,++this.length;}},{key:"unshift",value:function(r){var n={data:r,next:this.head};this.length===0&&(this.tail=n),this.head=n,++this.length;}},{key:"shift",value:function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0;}},{key:"join",value:function(r){if(this.length===0)return "";for(var n=this.head,i=""+n.data;n=n.next;)i+=r+n.data;return i}},{key:"concat",value:function(r){if(this.length===0)return Gt.alloc(0);for(var n=Gt.allocUnsafe(r>>>0),i=this.head,o=0;i;)nu(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return ra.length?a.length:r;if(c===a.length?o+=a:o+=a.slice(0,r),r-=c,r===0){c===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(c));break}++i;}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=Gt.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,c=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,c),r-=c,r===0){c===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(c));break}++o;}return this.length-=o,n}},{key:ru,value:function(r,n){return Kr(this,Ks({},n,{depth:0,customInspect:!1}))}}]),t}();});var Zr=L((im,ro)=>{l();s();u();f();function iu(t,e){var r=this,n=this._readableState&&this._readableState.destroyed,i=this._writableState&&this._writableState.destroyed;return n||i?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,p.nextTick(Xr,this,t)):p.nextTick(Xr,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?p.nextTick(Yt,r):(r._writableState.errorEmitted=!0,p.nextTick(to,r,o)):p.nextTick(to,r,o):e?(p.nextTick(Yt,r),e(o)):p.nextTick(Yt,r);}),this)}function to(t,e){Xr(t,e),Yt(t);}function Yt(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close");}function ou(){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);}function Xr(t,e){t.emit("error",e);}function au(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e);}ro.exports={destroy:iu,undestroy:ou,errorOrDestroy:au};});var Pe=L((fm,oo)=>{l();s();u();f();function su(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e;}var io={};function J(t,e,r){r||(r=Error);function n(o,a,c){return typeof e=="string"?e:e(o,a,c)}var i=function(o){su(a,o);function a(c,h,v){return o.call(this,n(c,h,v))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=t,io[t]=i;}function no(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(n){return String(n)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return "of ".concat(e," ").concat(String(t))}function uu(t,e,r){return t.substr(0,e.length)===e}function fu(t,e,r){return (r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function lu(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}J("ERR_INVALID_OPT_VALUE",function(t,e){return 'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);J("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&uu(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(fu(t," argument"))i="The ".concat(t," ").concat(n," ").concat(no(e,"type"));else {var o=lu(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(no(e,"type"));}return i+=". Received type ".concat(typeof r),i},TypeError);J("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");J("ERR_METHOD_NOT_IMPLEMENTED",function(t){return "The "+t+" method is not implemented"});J("ERR_STREAM_PREMATURE_CLOSE","Premature close");J("ERR_STREAM_DESTROYED",function(t){return "Cannot call "+t+" after a stream was destroyed"});J("ERR_MULTIPLE_CALLBACK","Callback called multiple times");J("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");J("ERR_STREAM_WRITE_AFTER_END","write after end");J("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);J("ERR_UNKNOWN_ENCODING",function(t){return "Unknown encoding: "+t},TypeError);J("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");oo.exports.codes=io;});var Qr=L((pm,ao)=>{l();s();u();f();var cu=Pe().codes.ERR_INVALID_OPT_VALUE;function du(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function hu(t,e,r,n){var i=du(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new cu(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}ao.exports={getHighWaterMark:hu};});var uo=L((vm,so)=>{l();s();u();f();so.exports=pu;function pu(t,e){if(en("noDeprecation"))return t;var r=!1;function n(){if(!r){if(en("throwDeprecation"))throw new Error(e);en("traceDeprecation")?console.trace(e):console.warn(e),r=!0;}return t.apply(this,arguments)}return n}function en(t){try{if(!globalThis.localStorage)return !1}catch(r){return !1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var nn=L((_m,mo)=>{l();s();u();f();mo.exports=M;function lo(t){var e=this;this.next=null,this.entry=null,this.finish=function(){ju(e,t);};}var Je;M.WritableState=ut;var mu={deprecate:uo()},co=Ur(),zt=Se().Buffer,yu=globalThis.Uint8Array||function(){};function gu(t){return zt.from(t)}function bu(t){return zt.isBuffer(t)||t instanceof yu}var rn=Zr(),vu=Qr(),wu=vu.getHighWaterMark,ge=Pe().codes,Su=ge.ERR_INVALID_ARG_TYPE,Eu=ge.ERR_METHOD_NOT_IMPLEMENTED,Ru=ge.ERR_MULTIPLE_CALLBACK,_u=ge.ERR_STREAM_CANNOT_PIPE,xu=ge.ERR_STREAM_DESTROYED,Iu=ge.ERR_STREAM_NULL_VALUES,Au=ge.ERR_STREAM_WRITE_AFTER_END,Tu=ge.ERR_UNKNOWN_ENCODING,ze=rn.errorOrDestroy;Ie()(M,co);function Bu(){}function ut(t,e,r){Je=Je||Oe(),t=t||{},typeof r!="boolean"&&(r=e instanceof Je),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=wu(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var n=t.decodeStrings===!1;this.decodeStrings=!n,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(i){Du(e,i);},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new lo(this);}ut.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(ut.prototype,"buffer",{get:mu.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")});}catch(t){}})();var Jt;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Jt=Function.prototype[Symbol.hasInstance],Object.defineProperty(M,Symbol.hasInstance,{value:function(e){return Jt.call(this,e)?!0:this!==M?!1:e&&e._writableState instanceof ut}})):Jt=function(e){return e instanceof this};function M(t){Je=Je||Oe();var e=this instanceof Je;if(!e&&!Jt.call(M,this))return new M(t);this._writableState=new ut(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),co.call(this);}M.prototype.pipe=function(){ze(this,new _u);};function Lu(t,e){var r=new Au;ze(t,r),p.nextTick(e,r);}function Pu(t,e,r,n){var i;return r===null?i=new Iu:typeof r!="string"&&!e.objectMode&&(i=new Su("chunk",["string","Buffer"],r)),i?(ze(t,i),p.nextTick(n,i),!1):!0}M.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&bu(t);return o&&!zt.isBuffer(t)&&(t=gu(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=Bu),n.ending?Lu(this,r):(o||Pu(this,n,t,r))&&(n.pendingcb++,i=Mu(this,n,o,t,e,r)),i};M.prototype.cork=function(){this._writableState.corked++;};M.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&ho(this,t));};M.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new Tu(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(M.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function Ou(t,e,r){return !t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=zt.from(e,r)),e}Object.defineProperty(M.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Mu(t,e,r,n,i,o){if(!r){var a=Ou(e,n,i);n!==a&&(r=!0,i="buffer",n=a);}var c=e.objectMode?1:n.length;e.length+=c;var h=e.length{l();s();u();f();var Hu=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};go.exports=ie;var yo=sn(),an=nn();Ie()(ie,yo);for(on=Hu(an.prototype),Kt=0;Kt{l();s();u();f();var Zt=Se(),oe=Zt.Buffer;function bo(t,e){for(var r in t)e[r]=t[r];}oe.from&&oe.alloc&&oe.allocUnsafe&&oe.allocUnsafeSlow?vo.exports=Zt:(bo(Zt,un),un.Buffer=Me);function Me(t,e,r){return oe(t,e,r)}Me.prototype=Object.create(oe.prototype);bo(oe,Me);Me.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return oe(t,e,r)};Me.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=oe(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};Me.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return oe(t)};Me.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zt.SlowBuffer(t)};});var cn=L(Eo=>{l();s();u();f();var ln=wo().Buffer,So=ln.isEncoding||function(t){switch(t=""+t,t&&t.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 Vu(t){if(!t)return "utf8";for(var e;;)switch(t){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 t;default:if(e)return;t=(""+t).toLowerCase(),e=!0;}}function Gu(t){var e=Vu(t);if(typeof e!="string"&&(ln.isEncoding===So||!So(t)))throw new Error("Unknown encoding: "+t);return e||t}Eo.StringDecoder=ft;function ft(t){this.encoding=Gu(t);var e;switch(this.encoding){case"utf16le":this.text=Zu,this.end=Qu,e=4;break;case"utf8":this.fillLast=zu,e=4;break;case"base64":this.text=ef,this.end=tf,e=3;break;default:this.write=rf,this.end=nf;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ln.allocUnsafe(e);}ft.prototype.write=function(t){if(t.length===0)return "";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return "";r=this.lastNeed,this.lastNeed=0;}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Yu(t,e,r){var n=e.length-1;if(n=0?(i>0&&(t.lastNeed=i-1),i):--n=0?(i>0&&(t.lastNeed=i-2),i):--n=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Ju(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function zu(t){var e=this.lastTotal-this.lastNeed,r=Ju(this,t);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length;}function Ku(t,e){var r=Yu(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function Xu(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function Zu(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function Qu(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function ef(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function tf(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function rf(t){return t.toString(this.encoding)}function nf(t){return t&&t.length?this.write(t):""}});var Qt=L((Wm,xo)=>{l();s();u();f();var Ro=Pe().codes.ERR_STREAM_PREMATURE_CLOSE;function of(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i{l();s();u();f();var er;function be(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var uf=Qt(),ve=Symbol("lastResolve"),Ce=Symbol("lastReject"),lt=Symbol("error"),tr=Symbol("ended"),Ne=Symbol("lastPromise"),dn=Symbol("handlePromise"),De=Symbol("stream");function we(t,e){return {value:t,done:e}}function ff(t){var e=t[ve];if(e!==null){var r=t[De].read();r!==null&&(t[Ne]=null,t[ve]=null,t[Ce]=null,e(we(r,!1)));}}function lf(t){p.nextTick(ff,t);}function cf(t,e){return function(r,n){t.then(function(){if(e[tr]){r(we(void 0,!0));return}e[dn](r,n);},n);}}var df=Object.getPrototypeOf(function(){}),hf=Object.setPrototypeOf((er={get stream(){return this[De]},next:function(){var e=this,r=this[lt];if(r!==null)return Promise.reject(r);if(this[tr])return Promise.resolve(we(void 0,!0));if(this[De].destroyed)return new Promise(function(a,c){p.nextTick(function(){e[lt]?c(e[lt]):a(we(void 0,!0));});});var n=this[Ne],i;if(n)i=new Promise(cf(n,this));else {var o=this[De].read();if(o!==null)return Promise.resolve(we(o,!1));i=new Promise(this[dn]);}return this[Ne]=i,i}},be(er,Symbol.asyncIterator,function(){return this}),be(er,"return",function(){var e=this;return new Promise(function(r,n){e[De].destroy(null,function(i){if(i){n(i);return}r(we(void 0,!0));});})}),er),df),pf=function(e){var r,n=Object.create(hf,(r={},be(r,De,{value:e,writable:!0}),be(r,ve,{value:null,writable:!0}),be(r,Ce,{value:null,writable:!0}),be(r,lt,{value:null,writable:!0}),be(r,tr,{value:e._readableState.endEmitted,writable:!0}),be(r,dn,{value:function(o,a){var c=n[De].read();c?(n[Ne]=null,n[ve]=null,n[Ce]=null,o(we(c,!1))):(n[ve]=o,n[Ce]=a);},writable:!0}),r));return n[Ne]=null,uf(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[Ce];o!==null&&(n[Ne]=null,n[ve]=null,n[Ce]=null,o(i)),n[lt]=i;return}var a=n[ve];a!==null&&(n[Ne]=null,n[ve]=null,n[Ce]=null,a(we(void 0,!0))),n[tr]=!0;}),e.on("readable",lf.bind(null,n)),n};Io.exports=pf;});var Bo=L((Qm,To)=>{l();s();u();f();To.exports=function(){throw new Error("Readable.from is not available in the browser")};});var sn=L((oy,qo)=>{l();s();u();f();qo.exports=I;var Ke;I.ReadableState=Mo;(Tt(),et(At)).EventEmitter;var Oo=function(e,r){return e.listeners(r).length},dt=Ur(),rr=Se().Buffer,mf=globalThis.Uint8Array||function(){};function yf(t){return rr.from(t)}function gf(t){return rr.isBuffer(t)||t instanceof mf}var hn=(zr(),et(Jr)),R;hn&&hn.debuglog?R=hn.debuglog("stream"):R=function(){};var bf=eo(),wn=Zr(),vf=Qr(),wf=vf.getHighWaterMark,nr=Pe().codes,Sf=nr.ERR_INVALID_ARG_TYPE,Ef=nr.ERR_STREAM_PUSH_AFTER_EOF,Rf=nr.ERR_METHOD_NOT_IMPLEMENTED,_f=nr.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,Xe,pn,mn;Ie()(I,dt);var ct=wn.errorOrDestroy,yn=["error","close","destroy","pause","resume"];function xf(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]];}function Mo(t,e,r){Ke=Ke||Oe(),t=t||{},typeof r!="boolean"&&(r=e instanceof Ke),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=wf(this,t,"readableHighWaterMark",r),this.buffer=new bf,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=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(Xe||(Xe=cn().StringDecoder),this.decoder=new Xe(t.encoding),this.encoding=t.encoding);}function I(t){if(Ke=Ke||Oe(),!(this instanceof I))return new I(t);var e=this instanceof Ke;this._readableState=new Mo(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),dt.call(this);}Object.defineProperty(I.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e);}});I.prototype.destroy=wn.destroy;I.prototype._undestroy=wn.undestroy;I.prototype._destroy=function(t,e){e(t);};I.prototype.push=function(t,e){var r=this._readableState,n;return r.objectMode?n=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=rr.from(t,e),e=""),n=!0),Co(this,t,e,!1,n)};I.prototype.unshift=function(t){return Co(this,t,null,!0,!1)};function Co(t,e,r,n,i){R("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,Tf(t,o);else {var a;if(i||(a=If(o,e)),a)ct(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==rr.prototype&&(e=yf(e)),n)o.endEmitted?ct(t,new _f):gn(t,o,e,!0);else if(o.ended)ct(t,new Ef);else {if(o.destroyed)return !1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?gn(t,o,e,!1):vn(t,o)):gn(t,o,e,!1);}else n||(o.reading=!1,vn(t,o));}return !o.ended&&(o.length=Lo?t=Lo:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Po(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=Af(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}I.prototype.read=function(t){R("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return R("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?bn(this):ir(this),null;if(t=Po(t,e),t===0&&e.ended)return e.length===0&&bn(this),null;var n=e.needReadable;R("need readable",n),(e.length===0||e.length-t0?i=Uo(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&bn(this)),i!==null&&this.emit("data",i),i};function Tf(t,e){if(R("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length);}e.ended=!0,e.sync?ir(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,No(t)));}}function ir(t){var e=t._readableState;R("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(R("emitReadable",e.flowing),e.emittedReadable=!0,p.nextTick(No,t));}function No(t){var e=t._readableState;R("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Sn(t);}function vn(t,e){e.readingMore||(e.readingMore=!0,p.nextTick(Bf,t,e));}function Bf(t,e){for(;!e.reading&&!e.ended&&(e.length1&&Fo(n.pipes,t)!==-1)&&!v&&(R("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause());}function x(X){R("onerror",X),q(),t.removeListener("error",x),Oo(t,"error")===0&&ct(t,X);}xf(t,"error",x);function E(){t.removeListener("finish",T),q();}t.once("close",E);function T(){R("onfinish"),t.removeListener("close",E),q();}t.once("finish",T);function q(){R("unpipe"),r.unpipe(t);}return t.emit("pipe",r),n.flowing||(R("pipe resume"),r.resume()),t};function Lf(t){return function(){var r=t._readableState;R("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Oo(t,"data")&&(r.flowing=!0,Sn(t));}}I.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var n=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,R("on readable",n.length,n.reading),n.length?ir(this):n.reading||p.nextTick(Pf,this)),r};I.prototype.addListener=I.prototype.on;I.prototype.removeListener=function(t,e){var r=dt.prototype.removeListener.call(this,t,e);return t==="readable"&&p.nextTick(Do,this),r};I.prototype.removeAllListeners=function(t){var e=dt.prototype.removeAllListeners.apply(this,arguments);return (t==="readable"||t===void 0)&&p.nextTick(Do,this),e};function Do(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume();}function Pf(t){R("readable nexttick read 0"),t.read(0);}I.prototype.resume=function(){var t=this._readableState;return t.flowing||(R("resume"),t.flowing=!t.readableListening,Of(this,t)),t.paused=!1,this};function Of(t,e){e.resumeScheduled||(e.resumeScheduled=!0,p.nextTick(Mf,t,e));}function Mf(t,e){R("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Sn(t),e.flowing&&!e.reading&&t.read(0);}I.prototype.pause=function(){return R("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(R("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Sn(t){var e=t._readableState;for(R("flow",e.flowing);e.flowing&&t.read()!==null;);}I.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(R("wrapped end"),r.decoder&&!r.ended){var a=r.decoder.end();a&&a.length&&e.push(a);}e.push(null);}),t.on("data",function(a){if(R("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var c=e.push(a);c||(n=!0,t.pause());}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(c){return function(){return t[c].apply(t,arguments)}}(i));for(var o=0;o=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function bn(t){var e=t._readableState;R("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,p.nextTick(Cf,e,t));}function Cf(t,e){if(R("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy();}}typeof Symbol=="function"&&(I.from=function(t,e){return mn===void 0&&(mn=Bo()),mn(I,t,e)});function Fo(t,e){for(var r=0,n=t.length;r{l();s();u();f();jo.exports=pe;var or=Pe().codes,Nf=or.ERR_METHOD_NOT_IMPLEMENTED,Df=or.ERR_MULTIPLE_CALLBACK,Uf=or.ERR_TRANSFORM_ALREADY_TRANSFORMING,Ff=or.ERR_TRANSFORM_WITH_LENGTH_0,ar=Oe();Ie()(pe,ar);function qf(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Df);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length{l();s();u();f();Wo.exports=ht;var Ho=En();Ie()(ht,Ho);function ht(t){if(!(this instanceof ht))return new ht(t);Ho.call(this,t);}ht.prototype._transform=function(t,e,r){r(null,t);};});var zo=L((wy,Jo)=>{l();s();u();f();var Rn;function jf(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments));}}var Yo=Pe().codes,Hf=Yo.ERR_MISSING_ARGS,Wf=Yo.ERR_STREAM_DESTROYED;function Vo(t){if(t)throw t}function $f(t){return t.setHeader&&typeof t.abort=="function"}function Vf(t,e,r,n){n=jf(n);var i=!1;t.on("close",function(){i=!0;}),Rn===void 0&&(Rn=Qt()),Rn(t,{readable:e,writable:r},function(a){if(a)return n(a);i=!0,n();});var o=!1;return function(a){if(!i&&!o){if(o=!0,$f(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(a||new Wf("pipe"));}}}function Go(t){t();}function Gf(t,e){return t.pipe(e)}function Yf(t){return !t.length||typeof t[t.length-1]!="function"?Vo:t.pop()}function Jf(){for(var t=arguments.length,e=new Array(t),r=0;r0;return Vf(a,h,v,function(b){i||(i=b),b&&o.forEach(Go),!h&&(o.forEach(Go),n(i));})});return e.reduce(Gf)}Jo.exports=Jf;});var Xo=L((xy,Ko)=>{l();s();u();f();Ko.exports=z;var _n=(Tt(),et(At)).EventEmitter,zf=Ie();zf(z,_n);z.Readable=sn();z.Writable=nn();z.Duplex=Oe();z.Transform=En();z.PassThrough=$o();z.finished=Qt();z.pipeline=zo();z.Stream=z;function z(){_n.call(this);}z.prototype.pipe=function(t,e){var r=this;function n(b){t.writable&&t.write(b)===!1&&r.pause&&r.pause();}r.on("data",n);function i(){r.readable&&r.resume&&r.resume();}t.on("drain",i),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",c));var o=!1;function a(){o||(o=!0,t.end());}function c(){o||(o=!0,typeof t.destroy=="function"&&t.destroy());}function h(b){if(v(),_n.listenerCount(this,"error")===0)throw b}r.on("error",h),t.on("error",h);function v(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",c),r.removeListener("error",h),t.removeListener("error",h),r.removeListener("end",v),r.removeListener("close",v),t.removeListener("close",v);}return r.on("end",v),r.on("close",v),t.on("close",v),t.emit("pipe",r),t};});l();s();u();f();l();s();u();f();var rt=class{constructor(e,r){if(!r)throw Error("Null Argument Exception");this.id=e,this.assembler=r;}get contentType(){return this.assembler.payloadType}get length(){return this.assembler.contentLength}getStream(){return this.stream||(this.stream=this.assembler.getPayloadStream()),this.stream}cancel(){this.assembler.close();}readAsString(){return S(this,null,function*(){let{bufferArray:e}=yield this.readAll();return (e||[]).map(r=>r.toString("utf8")).join("")})}readAsJson(){return S(this,null,function*(){let e=yield this.readAsString();return JSON.parse(e)})}readAll(){return S(this,null,function*(){let e=[],r=0,n=this.getStream();for(;r{let a=c=>h=>{e.push(h),r+=h.length,r===c.length&&o(!0);};n.subscribe(a(this));})),{bufferArray:e,size:r}})}};l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();var F=[];for(Rt=0;Rt<256;++Rt)F.push((Rt+256).toString(16).slice(1));var Rt;function ri(t,e=0){return (F[t[e+0]]+F[t[e+1]]+F[t[e+2]]+F[t[e+3]]+"-"+F[t[e+4]]+F[t[e+5]]+"-"+F[t[e+6]]+F[t[e+7]]+"-"+F[t[e+8]]+F[t[e+9]]+"-"+F[t[e+10]]+F[t[e+11]]+F[t[e+12]]+F[t[e+13]]+F[t[e+14]]+F[t[e+15]]).toLowerCase()}l();s();u();f();var _t,ja=new Uint8Array(16);function Pr(){if(!_t&&(_t=typeof crypto!="undefined"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!_t))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return _t(ja)}l();s();u();f();l();s();u();f();var Ha=typeof crypto!="undefined"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),Or={randomUUID:Ha};function Wa(t,e,r){if(Or.randomUUID&&!e&&!t)return Or.randomUUID();t=t||{};var n=t.random||(t.rng||Pr)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var i=0;i<16;++i)e[r+i]=n[i];return e}return ri(n)}var Mr=Wa;function xt(){return Mr()}var We=class{constructor(e){this.content=e;var r,n,i,o,a,c;this.id=xt(),this.description={id:this.id,type:(i=(n=(r=this.content)==null?void 0:r.headers)==null?void 0:n.type)!=null?i:"unknown",length:(c=(a=(o=this.content)==null?void 0:o.headers)==null?void 0:a.contentLength)!=null?c:0};}},xe=class{constructor(e,r){this.headers=e;this.stream=r;}getStream(){return this.stream}};l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();var Cr=class{};l();s();u();f();l();s();u();f();var Zo=bt(Xo()),K=class extends Zo.Duplex{constructor(r){super(r);this.length=0;this.bufferList=[];}_write(r,n,i){let o=g.Buffer.from(r);this.bufferList.push(o),this.length+=r.length,this._onData&&this._onData(o),i();}_read(r){if(this.bufferList.length===0)this.push(null);else {let n=0;for(;n0;){let i=this.bufferList[0];this.push(i),this.bufferList.splice(0,1),n+=i.length;}}}subscribe(r){this._onData=r;}};var xn=class t{constructor(){this.streams=[];}static create(e,r,n){let i=new t;return i.verb=e,i.path=r,n&&i.setBody(n),i}addStream(e){if(!e)throw new Error("Argument Undefined Exception: content undefined.");this.streams.push(new We(e));}setBody(e){if(typeof e=="string"){let r=new K;r.write(e,"utf8"),this.addStream(new xe({type:"application/json; charset=utf-8",contentLength:r.length},r));}else typeof e=="object"&&this.addStream(e);}};l();s();u();f();var In=class t{constructor(){this.streams=[];}static create(e,r){let n=new t;return n.statusCode=e,r&&n.addStream(r),n}addStream(e){this.streams.push(new We(e));}setBody(e){let r=new K;r.write(JSON.stringify(e),"utf8"),this.addStream(new xe({type:"application/json; charset=utf-8",contentLength:r.length},r));}};l();s();u();f();l();s();u();f();var Ze=class{constructor(e){e&&(this.webSocket=e);}connect(e){return S(this,null,function*(){let r,n;return this.webSocket||(this.webSocket=new WebSocket(e)),this.webSocket.onerror=i=>{n(i);},this.webSocket.onopen=i=>{r(i);},new Promise((i,o)=>{r=i,n=o;})})}get isConnected(){return this.webSocket.readyState===1}write(e){this.webSocket.send(e);}close(){this.webSocket.close();}setOnMessageHandler(e){let r="buffer",n=[];this.webSocket.onmessage=i=>{let o=new FileReader,a={buffer:null};n.push(a),o.onload=c=>{let h=c.target;if(a[r]=h.result,n[0]===a)for(;0{r&&e(r);};}setOnCloseHandler(e){this.webSocket.onclose=e;}};l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();var D=class{static serialize(e,r){r.write(e.payloadType,this.TypeOffset,1,this.Encoding),r.write(this.Delimiter,this.TypeDelimiterOffset,1,this.Encoding),r.write(this.headerLengthPadder(e.payloadLength,this.LengthLength,"0"),this.LengthOffset,this.LengthLength,this.Encoding),r.write(this.Delimiter,this.LengthDelimeterOffset,1,this.Encoding),r.write(e.id,this.IdOffset),r.write(this.Delimiter,this.IdDelimeterOffset,1,this.Encoding),r.write(e.end?this.End:this.NotEnd,this.EndOffset),r.write(this.Terminator,this.TerminatorOffset);}static deserialize(e){let r=e.toString(this.Encoding),n=r.split(this.Delimiter);if(n.length!==4)throw Error(`Cannot parse header, header is malformed. Header: ${r}`);let[i,o,a,c]=n,h=c===`1 `,v=Number(o),b={end:h,payloadLength:v,payloadType:i,id:a};if(!(b.payloadLength<=4096&&b.payloadLength>=0))throw Error(`Header length of ${b.payloadLength} is missing or malformed`);if(b.payloadType.length!==this.TypeDelimiterOffset)throw Error(`Header type '${b.payloadType.length}' is missing or malformed.`);if(!b.id||!b.id.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)||b.id.length!==this.IdLength)throw Error(`Header ID '${b.id}' is missing or malformed.`);if(!(c===`0 `||c===`1 `))throw Error(`Header End is missing or not a valid value. Header end: '${c}'`);return b}static headerLengthPadder(e,r,n){let i=Array(r+1).join(n),o=e.toString();return (i+o).slice(o.length)}};D.Delimiter=".",D.Terminator=` `,D.End="1",D.NotEnd="0",D.TypeOffset=0,D.TypeDelimiterOffset=1,D.LengthOffset=2,D.LengthLength=6,D.LengthDelimeterOffset=8,D.IdOffset=9,D.IdLength=36,D.IdDelimeterOffset=45,D.EndOffset=46,D.TerminatorOffset=47,D.Encoding="utf8";l();s();u();f();var sr=class sr{constructor(e){this.reason=e;}};sr.Empty=new sr;var V=sr;var ur=class{get isConnected(){return this._receiver!=null}connect(e){return this._receiver=e,this.receivePackets()}subscribe(e,r){this._getStream=e,this._receiveAction=r;}disconnect(e=V.Empty){var r,n;if(this.isConnected)try{this._receiver.close(),(r=this.disconnected)==null||r.call(this,this,e);}catch(i){(n=this.disconnected)==null||n.call(this,this,new V(i.message));}finally{this._receiver=null;}}receivePackets(){return S(this,null,function*(){for(;this.isConnected;)try{let e=0;for(;e<48;)this._receiveHeaderBuffer=yield this._receiver.receive(48-e),this._receiveHeaderBuffer&&(e+=this._receiveHeaderBuffer.length);let r=D.deserialize(this._receiveHeaderBuffer),n=r.payloadType==="S";if(r.payloadLength>0){let i=0,o=this._getStream(r);for(;i0&&e.payload){let r=e.header.payloadLength;for(;r>0;){let n=r<=4096?r:4096,i=e.payload.read(n),o=e.header;o.payloadLength=n,o.end=r<=4096;let a=g.Buffer.alloc(48);D.serialize(o,a),this._sender.send(a),this._sender.send(i),r-=i.length;}e.sentCallback&&e.sentCallback();}}catch(r){this.disconnect(new V(r.message));}}};l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();l();s();u();f();var lr=class{constructor(e){this.onCancelStream=e;this.activeAssemblers=[];}getPayloadAssembler(e){if(this.activeAssemblers[e])return this.activeAssemblers[e];{let r=new Ue(this,{id:e});return this.activeAssemblers[e]=r,r}}getPayloadStream(e){return this.getPayloadAssembler(e.id).getPayloadStream()}onReceive(e,r,n){this.activeAssemblers[e.id]&&this.activeAssemblers[e.id].onReceive(e,r,n);}closeStream(e){if(this.activeAssemblers[e]){let r=this.activeAssemblers[e];this.activeAssemblers.splice(this.activeAssemblers.indexOf(e),1);let n=r.getPayloadStream();(r.contentLength&&n.length{r.resolve=i,r.reject=o;});return this._pendingRequests[e]=r,n}rejectAllResponses(e){Object.entries(this._pendingRequests).forEach(([r,{reject:n}])=>{n(e),delete this._pendingRequests[r];});}};l();s();u();f();l();s();u();f();var dr=class{constructor(e,r,n){this.sender=e;this.id=r;this.payloadType=n;}disassemble(){let e={payloadType:this.payloadType,payloadLength:0,id:this.id,end:!0};this.sender.sendPayload(e);}};l();s();u();f();l();s();u();f();var ae=class{constructor(e,r){this.sender=e;this.id=r;}static serialize(e){let r=new K;return r.write(JSON.stringify(e)),r.end(),{stream:r,streamLength:r.length}}disassemble(){return S(this,null,function*(){let{stream:e,streamLength:r}=yield this.getStream();return this.stream=e,this.streamLength=r,this.send()})}send(){return S(this,null,function*(){let e={payloadType:this.payloadType,payloadLength:this.streamLength,id:this.id,end:!0};this.sender.sendPayload(e,this.stream);})}};var pt=class extends ae{constructor(r,n){super(r,n.id);this.payloadType="S";this.contentStream=n;}getStream(){return S(this,null,function*(){let r=this.contentStream.content.getStream();return {stream:r,streamLength:r.length}})}};l();s();u();f();var hr=class extends ae{constructor(r,n,i){super(r,n);this.request=i;this.payloadType="A";}getStream(){return S(this,null,function*(){var n,i,o,a;let r={verb:(n=this.request)==null?void 0:n.verb,path:(i=this.request)==null?void 0:i.path,streams:[]};return (a=(o=this.request)==null?void 0:o.streams)==null||a.forEach(function(c){r.streams.push(c.description);}),ae.serialize(r)})}};l();s();u();f();var pr=class extends ae{constructor(r,n,i){super(r,n);this.payloadType="B";this.response=i;}getStream(){return S(this,null,function*(){var n;let r={statusCode:this.response.statusCode,streams:[]};return (n=this.response.streams)==null||n.forEach(({description:i})=>{r.streams.push({id:i.id,contentType:i.type,length:i.length});}),ae.serialize(r)})}};var mr=class{constructor(e){this.payloadSender=e;}sendRequest(e,r){return S(this,null,function*(){yield new hr(this.payloadSender,e,r).disassemble(),r.streams&&r.streams.forEach(i=>S(this,null,function*(){yield new pt(this.payloadSender,i).disassemble();}));})}sendResponse(e,r){return S(this,null,function*(){yield new pr(this.payloadSender,e,r).disassemble(),r.streams&&r.streams.forEach(i=>S(this,null,function*(){yield new pt(this.payloadSender,i).disassemble();}));})}sendCancelStream(e){return S(this,null,function*(){new dr(this.payloadSender,e,"C").disassemble();})}};var Ue=class{constructor(e,r){this.streamManager=e;this._byteOrderMark=65279;this._utf="utf8";if(r.header?(this.id=r.header.id,this.payloadType=r.header.payloadType,this.contentLength=r.header.payloadLength,this.end=r.header.end):this.id=r.id,!this.id)throw Error("An ID must be supplied when creating an assembler.");this._onCompleted=r.onCompleted;}getPayloadStream(){return this.stream||(this.stream=this.createPayloadStream()),this.stream}onReceive(e,r,n){this.end=e.end,e.payloadType==="B"||e.payloadType==="A"?this.process(r).then().catch():e.end&&r.end();}close(){this.streamManager.closeStream(this.id);}createPayloadStream(){return new K}payloadFromJson(e){return JSON.parse(e.charCodeAt(0)===this._byteOrderMark?e.slice(1):e)}stripBOM(e){return e.charCodeAt(0)===this._byteOrderMark?e.slice(1):e}process(e){return S(this,null,function*(){let r=e.read(e.length);if(!r)return;let n=r.toString(this._utf);this.payloadType==="A"?yield this.processRequest(n):this.payloadType==="B"&&(yield this.processResponse(n));})}processResponse(e){return S(this,null,function*(){let r=this.payloadFromJson(this.stripBOM(e)),n={streams:[],statusCode:r.statusCode};yield this.processStreams(r,n);})}processRequest(e){return S(this,null,function*(){let r=this.payloadFromJson(e),n={streams:[],path:r.path,verb:r.verb};yield this.processStreams(r,n);})}processStreams(e,r){return S(this,null,function*(){var n;(n=e.streams)==null||n.forEach(i=>{var c;let o=(c=i.type)!=null?c:i.contentType,a=this.streamManager.getPayloadAssembler(i.id);a.payloadType=o,a.contentLength=i.length,r.streams.push(new rt(i.id,a));}),yield this._onCompleted(this.id,r);})}};var yr=class{constructor(e,r,n){this.streamManager=e;this.onReceiveResponse=r;this.onReceiveRequest=n;this.activeAssemblers={};}getPayloadStream(e){if(e.payloadType==="S")return this.streamManager.getPayloadStream(e);if(!this.activeAssemblers[e.id]){let r=this.createPayloadAssembler(e);if(r)return this.activeAssemblers[e.id]=r,r.getPayloadStream()}}onReceive(e,r,n){e.payloadType==="S"?this.streamManager.onReceive(e,r,n):(this.activeAssemblers&&this.activeAssemblers[e.id]&&this.activeAssemblers[e.id].onReceive(e,r,n),e.end&&delete this.activeAssemblers[e.id]);}createPayloadAssembler(e){if(e.payloadType==="A")return new Ue(this.streamManager,{header:e,onCompleted:this.onReceiveRequest});if(e.payloadType==="B")return new Ue(this.streamManager,{header:e,onCompleted:this.onReceiveResponse})}};var gr=class{constructor(e,r,n,i){this.requestHandler=e,this.requestManager=r,this.payloadSender=n,this.payloadReceiver=i,this.sendOperations=new mr(this.payloadSender),this.streamManager=new lr(this.onCancelStream),this.assemblerManager=new yr(this.streamManager,(o,a)=>this.onReceiveResponse(o,a),(o,a)=>this.onReceiveRequest(o,a)),this.payloadReceiver.subscribe(o=>this.assemblerManager.getPayloadStream(o),(o,a,c)=>this.assemblerManager.onReceive(o,a,c));}sendRequest(e){return S(this,null,function*(){let r=xt(),n=this.requestManager.getResponse(r);return yield this.sendOperations.sendRequest(r,e),n})}onReceiveRequest(e,r){return S(this,null,function*(){if(this.requestHandler){let n=yield this.requestHandler.processRequest(r);n&&(yield this.sendOperations.sendResponse(e,n));}})}onReceiveResponse(e,r){return S(this,null,function*(){yield this.requestManager.signalResponse(e,r);})}onCancelStream(e){this.sendOperations.sendCancelStream(e.id).catch();}};l();s();u();f();var mt=class{constructor(e){this.ws=e;this._queue=[];this._activeOffset=0;this._activeReceiveCount=0;this.ws.setOnMessageHandler(r=>{this.onReceive(r);}),this.ws.setOnErrorHandler(r=>{this.onError(r);}),this.ws.setOnCloseHandler(()=>{this.onClose();});}send(e){var r;return (r=this.ws)!=null&&r.isConnected?(this.ws.write(e),e.length):0}get isConnected(){var e;return !!((e=this.ws)!=null&&e.isConnected)}close(){var e;(e=this.ws)!=null&&e.isConnected&&this.ws.close();}receive(e){return S(this,null,function*(){if(this._activeReceiveResolve)throw new Error("Cannot call receive more than once before it has returned.");this._activeReceiveCount=e;let r=new Promise((n,i)=>{this._activeReceiveResolve=n,this._activeReceiveReject=i;});return this.trySignalData(),r})}onReceive(e){this._queue&&e&&e.byteLength>0&&(this._queue.push(g.Buffer.from(e)),this.trySignalData());}onClose(){this._activeReceiveReject&&this._activeReceiveReject(new Error("Socket was closed.")),this._active=null,this._activeOffset=0,this._activeReceiveResolve=null,this._activeReceiveReject=null,this._activeReceiveCount=0,this.ws=null;}onError(e){this._activeReceiveReject&&this._activeReceiveReject(e),this.onClose();}trySignalData(){if(this._activeReceiveResolve&&(!this._active&&this._queue.length>0&&(this._active=this._queue.shift(),this._activeOffset=0),this._active)){if(this._activeOffset===0&&this._active.length===this._activeReceiveCount){let e=this._active;this._active=null,this._activeReceiveResolve(e);}else {let e=Math.min(this._activeReceiveCount,this._active.length-this._activeOffset),r=g.Buffer.alloc(e);this._active.copy(r,0,this._activeOffset,this._activeOffset+e),this._activeOffset+=e,this._activeOffset>=this._active.length&&(this._active=null,this._activeOffset=0),this._activeReceiveResolve(r);}this._activeReceiveCount=0,this._activeReceiveReject=null,this._activeReceiveResolve=null;}}};var br=class{constructor({url:e,requestHandler:r,disconnectionHandler:n=null}){this._url=e,this._requestHandler=r,this._disconnectionHandler=n,this._requestManager=new cr,this._sender=new fr,this._sender.disconnected=this.onConnectionDisconnected.bind(this),this._receiver=new ur,this._receiver.disconnected=this.onConnectionDisconnected.bind(this),this._protocolAdapter=new gr(this._requestHandler,this._requestManager,this._sender,this._receiver);}connect(){return S(this,null,function*(){let e=new Ze;yield e.connect(this._url);let r=new mt(e);this._sender.connect(r),this._receiver.connect(r);})}disconnect(){this._sender.disconnect(new V("Disconnect was called.")),this._receiver.disconnect(new V("Disconnect was called."));}send(e){return S(this,null,function*(){return this._protocolAdapter.sendRequest(e)})}onConnectionDisconnected(e,r){if(this._requestManager.rejectAllResponses(new Error("Disconnect was called.")),this._disconnectionHandler!=null){this._disconnectionHandler("Disconnected");return}throw new Error(`Unable to re-connect client to transport for url ${this._url}. Sender: '${JSON.stringify(e)}'. Args:' ${JSON.stringify(r)}`)}};/*! Bundled license information: ieee754/index.js: (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh *) buffer/index.js: (*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT *) safe-buffer/index.js: (*! safe-buffer. MIT License. Feross Aboukhadijeh *) */ exports.BrowserWebSocket = Ze; exports.ContentStream = rt; exports.HttpContent = xe; exports.RequestHandler = Cr; exports.StreamingRequest = xn; exports.StreamingResponse = In; exports.SubscribableStream = K; exports.WebSocketClient = br; //# sourceMappingURL=index-browser.js.map //# sourceMappingURL=index-browser.js.map