megajs
Version:
Unofficial JavaScript SDK for MEGA
2 lines • 235 kB
JavaScript
var mega=(()=>{var Wp=Object.create;var ks=Object.defineProperty;var $p=Object.getOwnPropertyDescriptor;var Hp=Object.getOwnPropertyNames;var Gp=Object.getPrototypeOf,Vp=Object.prototype.hasOwnProperty;var _e=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var Kp=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Hp(e))!Vp.call(t,i)&&i!==r&&ks(t,i,{get:()=>e[i],enumerable:!(n=$p(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?Wp(Gp(t)):{},Kp(e||!t||!t.__esModule?ks(r,"default",{value:t,enumerable:!0}):r,t));var Ns=_(Zr=>{"use strict";d();Zr.byteLength=Yp;Zr.toByteArray=Xp;Zr.fromByteArray=ey;var Re=[],he=[],zp=typeof Uint8Array<"u"?Uint8Array:Array,Fi="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ut=0,Ls=Fi.length;ut<Ls;++ut)Re[ut]=Fi[ut],he[Fi.charCodeAt(ut)]=ut;var ut,Ls;he[45]=62;he[95]=63;function Cs(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 Yp(t){var e=Cs(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Jp(t,e,r){return(e+r)*3/4-r}function Xp(t){var e,r=Cs(t),n=r[0],i=r[1],o=new zp(Jp(t,n,i)),a=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)e=he[t.charCodeAt(l)]<<18|he[t.charCodeAt(l+1)]<<12|he[t.charCodeAt(l+2)]<<6|he[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=he[t.charCodeAt(l)]<<2|he[t.charCodeAt(l+1)]>>4,o[a++]=e&255),i===1&&(e=he[t.charCodeAt(l)]<<10|he[t.charCodeAt(l+1)]<<4|he[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function Qp(t){return Re[t>>18&63]+Re[t>>12&63]+Re[t>>6&63]+Re[t&63]}function Zp(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(Qp(n));return i.join("")}function ey(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,s=r-n;a<s;a+=o)i.push(Zp(t,a,a+o>s?s:a+o));return n===1?(e=t[r-1],i.push(Re[e>>2]+Re[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],i.push(Re[e>>10]+Re[e>>4&63]+Re[e<<2&63]+"=")),i.join("")}});var Ds=_(qi=>{d();qi.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,u=-7,c=r?i-1:0,y=r?-1:1,h=t[e+c];for(c+=y,o=h&(1<<-u)-1,h>>=-u,u+=s;u>0;o=o*256+t[e+c],c+=y,u-=8);for(a=o&(1<<-u)-1,o>>=-u,u+=n;u>0;a=a*256+t[e+c],c+=y,u-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(h?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(h?-1:1)*a*Math.pow(2,o-n)};qi.write=function(t,e,r,n,i,o){var a,s,l,f=o*8-i-1,u=(1<<f)-1,c=u>>1,y=i===23?Math.pow(2,-24)-Math.pow(2,-77):0,h=n?0:o-1,E=n?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+c>=1?e+=y/l:e+=y*Math.pow(2,1-c),e*l>=2&&(a++,l/=2),a+c>=u?(s=0,a=u):a+c>=1?(s=(e*l-1)*Math.pow(2,i),a=a+c):(s=e*Math.pow(2,c-1)*Math.pow(2,i),a=0));i>=8;t[r+h]=s&255,h+=E,s/=256,i-=8);for(a=a<<i|s,f+=i;f>0;t[r+h]=a&255,h+=E,a/=256,f-=8);t[r+h-E]|=w*128}});var de=_(Ft=>{"use strict";d();var Ui=Ns(),Nt=Ds(),Fs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Ft.Buffer=b;Ft.SlowBuffer=ay;Ft.INSPECT_MAX_BYTES=50;var en=2147483647;Ft.kMaxLength=en;b.TYPED_ARRAY_SUPPORT=ty();!b.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function ty(){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{return!1}}Object.defineProperty(b.prototype,"parent",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.buffer}});Object.defineProperty(b.prototype,"offset",{enumerable:!0,get:function(){if(b.isBuffer(this))return this.byteOffset}});function Ue(t){if(t>en)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,b.prototype),e}function b(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 Hi(t)}return Ws(t,e,r)}b.poolSize=8192;function Ws(t,e,r){if(typeof t=="string")return ny(t,e);if(ArrayBuffer.isView(t))return iy(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(xe(t,ArrayBuffer)||t&&xe(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(xe(t,SharedArrayBuffer)||t&&xe(t.buffer,SharedArrayBuffer)))return Wi(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 b.from(n,e,r);let i=oy(t);if(i)return i;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return b.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)}b.from=function(t,e,r){return Ws(t,e,r)};Object.setPrototypeOf(b.prototype,Uint8Array.prototype);Object.setPrototypeOf(b,Uint8Array);function $s(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 ry(t,e,r){return $s(t),t<=0?Ue(t):e!==void 0?typeof r=="string"?Ue(t).fill(e,r):Ue(t).fill(e):Ue(t)}b.alloc=function(t,e,r){return ry(t,e,r)};function Hi(t){return $s(t),Ue(t<0?0:Gi(t)|0)}b.allocUnsafe=function(t){return Hi(t)};b.allocUnsafeSlow=function(t){return Hi(t)};function ny(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!b.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Hs(t,e)|0,n=Ue(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function ji(t){let e=t.length<0?0:Gi(t.length)|0,r=Ue(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function iy(t){if(xe(t,Uint8Array)){let e=new Uint8Array(t);return Wi(e.buffer,e.byteOffset,e.byteLength)}return ji(t)}function Wi(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,b.prototype),n}function oy(t){if(b.isBuffer(t)){let e=Gi(t.length)|0,r=Ue(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Ki(t.length)?Ue(0):ji(t);if(t.type==="Buffer"&&Array.isArray(t.data))return ji(t.data)}function Gi(t){if(t>=en)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+en.toString(16)+" bytes");return t|0}function ay(t){return+t!=t&&(t=0),b.alloc(+t)}b.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==b.prototype};b.compare=function(e,r){if(xe(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),xe(r,Uint8Array)&&(r=b.from(r,r.offset,r.byteLength)),!b.isBuffer(e)||!b.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};b.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}};b.concat=function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return b.alloc(0);let n;if(r===void 0)for(r=0,n=0;n<e.length;++n)r+=e[n].length;let i=b.allocUnsafe(r),o=0;for(n=0;n<e.length;++n){let a=e[n];if(xe(a,Uint8Array))o+a.length>i.length?(b.isBuffer(a)||(a=b.from(a)),a.copy(i,o)):Uint8Array.prototype.set.call(i,a,o);else if(b.isBuffer(a))a.copy(i,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return i};function Hs(t,e){if(b.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||xe(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 $i(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Zs(t).length;default:if(i)return n?-1:$i(t).length;e=(""+e).toLowerCase(),i=!0}}b.byteLength=Hs;function sy(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 by(this,e,r);case"utf8":case"utf-8":return Vs(this,e,r);case"ascii":return yy(this,e,r);case"latin1":case"binary":return gy(this,e,r);case"base64":return hy(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return wy(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}b.prototype._isBuffer=!0;function ct(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}b.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)ct(this,r,r+1);return this};b.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)ct(this,r,r+3),ct(this,r+1,r+2);return this};b.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)ct(this,r,r+7),ct(this,r+1,r+6),ct(this,r+2,r+5),ct(this,r+3,r+4);return this};b.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Vs(this,0,e):sy.apply(this,arguments)};b.prototype.toLocaleString=b.prototype.toString;b.prototype.equals=function(e){if(!b.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:b.compare(this,e)===0};b.prototype.inspect=function(){let e="",r=Ft.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Fs&&(b.prototype[Fs]=b.prototype.inspect);b.prototype.compare=function(e,r,n,i,o){if(xe(e,Uint8Array)&&(e=b.from(e,e.offset,e.byteLength)),!b.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,s=n-r,l=Math.min(a,s),f=this.slice(i,o),u=e.slice(r,n);for(let c=0;c<l;++c)if(f[c]!==u[c]){a=f[c],s=u[c];break}return a<s?-1:s<a?1:0};function Gs(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,Ki(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=b.from(e,n)),b.isBuffer(e))return e.length===0?-1:qs(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):qs(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function qs(t,e,r,n,i){let o=1,a=t.length,s=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,s/=2,r/=2}function l(u,c){return o===1?u[c]:u.readUInt16BE(c*o)}let f;if(i){let u=-1;for(f=r;f<a;f++)if(l(t,f)===l(e,u===-1?0:f-u)){if(u===-1&&(u=f),f-u+1===s)return u*o}else u!==-1&&(f-=f-u),u=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){let u=!0;for(let c=0;c<s;c++)if(l(t,f+c)!==l(e,c)){u=!1;break}if(u)return f}return-1}b.prototype.includes=function(e,r,n){return this.indexOf(e,r,n)!==-1};b.prototype.indexOf=function(e,r,n){return Gs(this,e,r,n,!0)};b.prototype.lastIndexOf=function(e,r,n){return Gs(this,e,r,n,!1)};function ly(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 s=parseInt(e.substr(a*2,2),16);if(Ki(s))return a;t[r+a]=s}return a}function fy(t,e,r,n){return tn($i(e,t.length-r),t,r,n)}function uy(t,e,r,n){return tn(Sy(e),t,r,n)}function cy(t,e,r,n){return tn(Zs(e),t,r,n)}function dy(t,e,r,n){return tn(Ay(e,t.length-r),t,r,n)}b.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 ly(this,e,r,n);case"utf8":case"utf-8":return fy(this,e,r,n);case"ascii":case"latin1":case"binary":return uy(this,e,r,n);case"base64":return cy(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return dy(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+i);i=(""+i).toLowerCase(),a=!0}};b.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function hy(t,e,r){return e===0&&r===t.length?Ui.fromByteArray(t):Ui.fromByteArray(t.slice(e,r))}function Vs(t,e,r){r=Math.min(t.length,r);let n=[],i=e;for(;i<r;){let o=t[i],a=null,s=o>239?4:o>223?3:o>191?2:1;if(i+s<=r){let l,f,u,c;switch(s){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(c=(o&31)<<6|l&63,c>127&&(a=c));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(c=(o&15)<<12|(l&63)<<6|f&63,c>2047&&(c<55296||c>57343)&&(a=c));break;case 4:l=t[i+1],f=t[i+2],u=t[i+3],(l&192)===128&&(f&192)===128&&(u&192)===128&&(c=(o&15)<<18|(l&63)<<12|(f&63)<<6|u&63,c>65535&&c<1114112&&(a=c))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),i+=s}return py(n)}var Us=4096;function py(t){let e=t.length;if(e<=Us)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Us));return r}function yy(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 gy(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 by(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+=vy[t[o]];return i}function wy(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}b.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,b.prototype),i};function Q(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")}b.prototype.readUintLE=b.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e],o=1,a=0;for(;++a<r&&(o*=256);)i+=this[e+a]*o;return i};b.prototype.readUintBE=b.prototype.readUIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(e,r,this.length);let i=this[e+--r],o=1;for(;r>0&&(o*=256);)i+=this[e+--r]*o;return i};b.prototype.readUint8=b.prototype.readUInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]};b.prototype.readUint16LE=b.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]|this[e+1]<<8};b.prototype.readUint16BE=b.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||Q(e,2,this.length),this[e]<<8|this[e+1]};b.prototype.readUint32LE=b.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};b.prototype.readUint32BE=b.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};b.prototype.readBigUInt64LE=Ze(function(e){e=e>>>0,Dt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&mr(e,this.length-8);let i=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(i)+(BigInt(o)<<BigInt(32))});b.prototype.readBigUInt64BE=Ze(function(e){e=e>>>0,Dt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&mr(e,this.length-8);let i=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(i)<<BigInt(32))+BigInt(o)});b.prototype.readIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(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};b.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||Q(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};b.prototype.readInt8=function(e,r){return e=e>>>0,r||Q(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};b.prototype.readInt16LE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};b.prototype.readInt16BE=function(e,r){e=e>>>0,r||Q(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};b.prototype.readInt32LE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};b.prototype.readInt32BE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};b.prototype.readBigInt64LE=Ze(function(e){e=e>>>0,Dt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&mr(e,this.length-8);let i=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(i)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)});b.prototype.readBigInt64BE=Ze(function(e){e=e>>>0,Dt(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&mr(e,this.length-8);let i=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(i)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)});b.prototype.readFloatLE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Nt.read(this,e,!0,23,4)};b.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Nt.read(this,e,!1,23,4)};b.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Nt.read(this,e,!0,52,8)};b.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Nt.read(this,e,!1,52,8)};function fe(t,e,r,n,i,o){if(!b.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")}b.prototype.writeUintLE=b.prototype.writeUIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,0)}let o=1,a=0;for(this[r]=e&255;++a<n&&(o*=256);)this[r+a]=e/o&255;return r+n};b.prototype.writeUintBE=b.prototype.writeUIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,n=n>>>0,!i){let s=Math.pow(2,8*n)-1;fe(this,e,r,n,s,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};b.prototype.writeUint8=b.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,255,0),this[r]=e&255,r+1};b.prototype.writeUint16LE=b.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};b.prototype.writeUint16BE=b.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};b.prototype.writeUint32LE=b.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(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};b.prototype.writeUint32BE=b.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(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 Ks(t,e,r,n,i){Qs(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 zs(t,e,r,n,i){Qs(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}b.prototype.writeBigUInt64LE=Ze(function(e,r=0){return Ks(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});b.prototype.writeBigUInt64BE=Ze(function(e,r=0){return zs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});b.prototype.writeIntLE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=0,a=1,s=0;for(this[r]=e&255;++o<n&&(a*=256);)e<0&&s===0&&this[r+o-1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};b.prototype.writeIntBE=function(e,r,n,i){if(e=+e,r=r>>>0,!i){let l=Math.pow(2,8*n-1);fe(this,e,r,n,l-1,-l)}let o=n-1,a=1,s=0;for(this[r+o]=e&255;--o>=0&&(a*=256);)e<0&&s===0&&this[r+o+1]!==0&&(s=1),this[r+o]=(e/a>>0)-s&255;return r+n};b.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};b.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};b.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};b.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||fe(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};b.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||fe(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};b.prototype.writeBigInt64LE=Ze(function(e,r=0){return Ks(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});b.prototype.writeBigInt64BE=Ze(function(e,r=0){return zs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ys(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 Js(t,e,r,n,i){return e=+e,r=r>>>0,i||Ys(t,e,r,4,34028234663852886e22,-34028234663852886e22),Nt.write(t,e,r,n,23,4),r+4}b.prototype.writeFloatLE=function(e,r,n){return Js(this,e,r,!0,n)};b.prototype.writeFloatBE=function(e,r,n){return Js(this,e,r,!1,n)};function Xs(t,e,r,n,i){return e=+e,r=r>>>0,i||Ys(t,e,r,8,17976931348623157e292,-17976931348623157e292),Nt.write(t,e,r,n,52,8),r+8}b.prototype.writeDoubleLE=function(e,r,n){return Xs(this,e,r,!0,n)};b.prototype.writeDoubleBE=function(e,r,n){return Xs(this,e,r,!1,n)};b.prototype.copy=function(e,r,n,i){if(!b.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};b.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"&&!b.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=b.isBuffer(e)?e:b.from(e,i),s=a.length;if(s===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-r;++o)this[o+r]=a[o%s]}return this};var Ct={};function Vi(t,e,r){Ct[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}`}}}Vi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Vi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Vi("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)>2**32?i=js(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=js(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function js(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 my(t,e,r){Dt(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&mr(e,t.length-(r+1))}function Qs(t,e,r,n,i,o){if(t>r||t<e){let a=typeof e=="bigint"?"n":"",s;throw o>3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:s=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Ct.ERR_OUT_OF_RANGE("value",s,t)}my(n,i,o)}function Dt(t,e){if(typeof t!="number")throw new Ct.ERR_INVALID_ARG_TYPE(e,"number",t)}function mr(t,e,r){throw Math.floor(t)!==t?(Dt(t,r),new Ct.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Ct.ERR_BUFFER_OUT_OF_BOUNDS:new Ct.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var _y=/[^+/0-9A-Za-z-_]/g;function Ey(t){if(t=t.split("=")[0],t=t.trim().replace(_y,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function $i(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 Sy(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ay(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 Zs(t){return Ui.toByteArray(Ey(t))}function tn(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 xe(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function Ki(t){return t!==t}var vy=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 Ze(t){return typeof BigInt>"u"?Ry:t}function Ry(){throw new Error("BigInt not supported")}});var p,g,m,d=_e(()=>{p=ve(de(),1),g={env:{},nextTick:(t,...e)=>{globalThis.setTimeout(t,0,...e)}},m=globalThis});var H=_((Mv,el)=>{"use strict";d();el.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var qt=_((Lv,rn)=>{"use strict";d();var{AbortController:tl,AbortSignal:xy}=typeof self<"u"?self:typeof window<"u"?window:void 0;rn.exports=tl;rn.exports.AbortSignal=xy;rn.exports.default=tl});var Te=_((Nv,zi)=>{"use strict";d();var Ut=typeof Reflect=="object"?Reflect:null,rl=Ut&&typeof Ut.apply=="function"?Ut.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},nn;Ut&&typeof Ut.ownKeys=="function"?nn=Ut.ownKeys:Object.getOwnPropertySymbols?nn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:nn=function(e){return Object.getOwnPropertyNames(e)};function Ty(t){console&&console.warn&&console.warn(t)}var il=Number.isNaN||function(e){return e!==e};function D(){D.init.call(this)}zi.exports=D;zi.exports.once=Py;D.EventEmitter=D;D.prototype._events=void 0;D.prototype._eventsCount=0;D.prototype._maxListeners=void 0;var nl=10;function on(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(D,"defaultMaxListeners",{enumerable:!0,get:function(){return nl},set:function(t){if(typeof t!="number"||t<0||il(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");nl=t}});D.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};D.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||il(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function ol(t){return t._maxListeners===void 0?D.defaultMaxListeners:t._maxListeners}D.prototype.getMaxListeners=function(){return ol(this)};D.prototype.emit=function(e){for(var r=[],n=1;n<arguments.length;n++)r.push(arguments[n]);var i=e==="error",o=this._events;if(o!==void 0)i=i&&o.error===void 0;else if(!i)return!1;if(i){var a;if(r.length>0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var l=o[e];if(l===void 0)return!1;if(typeof l=="function")rl(l,this,r);else for(var f=l.length,u=ul(l,f),n=0;n<f;++n)rl(u[n],this,r);return!0};function al(t,e,r,n){var i,o,a;if(on(r),o=t._events,o===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=ol(t),i>0&&a.length>i&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,Ty(s)}return t}D.prototype.addListener=function(e,r){return al(this,e,r,!1)};D.prototype.on=D.prototype.addListener;D.prototype.prependListener=function(e,r){return al(this,e,r,!0)};function Iy(){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 sl(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=Iy.bind(n);return i.listener=r,n.wrapFn=i,i}D.prototype.once=function(e,r){return on(r),this.on(e,sl(this,e,r)),this};D.prototype.prependOnceListener=function(e,r){return on(r),this.prependListener(e,sl(this,e,r)),this};D.prototype.removeListener=function(e,r){var n,i,o,a,s;if(on(r),i=this._events,i===void 0)return this;if(n=i[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete i[e],i.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():Oy(n,o),n.length===1&&(i[e]=n[0]),i.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};D.prototype.off=D.prototype.removeListener;D.prototype.removeAllListeners=function(e){var r,n,i;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(i=0;i<o.length;++i)a=o[i],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=n[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(i=r.length-1;i>=0;i--)this.removeListener(e,r[i]);return this};function ll(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?By(i):ul(i,i.length)}D.prototype.listeners=function(e){return ll(this,e,!0)};D.prototype.rawListeners=function(e){return ll(this,e,!1)};D.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):fl.call(t,e)};D.prototype.listenerCount=fl;function fl(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}D.prototype.eventNames=function(){return this._eventsCount>0?nn(this._events):[]};function ul(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Oy(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function By(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function Py(t,e){return new Promise(function(r,n){function i(a){t.removeListener(e,o),n(a)}function o(){typeof t.removeListener=="function"&&t.removeListener("error",i),r([].slice.call(arguments))}cl(t,e,o,{once:!0}),e!=="error"&&My(t,i,{once:!0})})}function My(t,e,r){typeof t.on=="function"&&cl(t,"error",e,r)}function cl(t,e,r,n){if(typeof t.on=="function")n.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,function i(o){n.once&&t.removeEventListener(e,i),r(o)});else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}});var ne=_((Fv,Ji)=>{"use strict";d();var ky=de(),{kResistStopPropagation:Ly,SymbolDispose:Cy}=H(),Ny=globalThis.AbortSignal||qt().AbortSignal,Dy=globalThis.AbortController||qt().AbortController,Fy=Object.getPrototypeOf(async function(){}).constructor,dl=globalThis.Blob||ky.Blob,qy=typeof dl<"u"?function(e){return e instanceof dl}:function(e){return!1},hl=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Uy=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},Yi=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n<e.length;n++)r+=` ${e[n].stack}
`;super(r),this.name="AggregateError",this.errors=e}};Ji.exports={AggregateError:Yi,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...r){e||(e=!0,t.apply(this,r))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,i)=>{t=n,e=i}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...i)=>n?r(n):e(...i))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let i=e.shift();return n==="f"?i.toFixed(6):n==="j"?JSON.stringify(i):n==="s"&&typeof i=="object"?`${i.constructor!==Object?i.constructor.name:""} {}`.trim():i.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof Fy},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:qy,deprecate(t,e){return t},addAbortListener:Te().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);hl(e,"signal"),Uy(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Ly]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Cy](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Ny.any||function(e){if(e.length===1)return e[0];let r=new Dy,n=()=>r.abort();return e.forEach(i=>{hl(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};Ji.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=_((Uv,gl)=>{"use strict";d();var{format:jy,inspect:an,AggregateError:Wy}=ne(),$y=globalThis.AggregateError||Wy,Hy=Symbol("kIsNodeError"),Gy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Vy=/^([A-Z][a-z0-9]*)+$/,Ky="__node_internal_",sn={};function dt(t,e){if(!t)throw new sn.ERR_INTERNAL_ASSERTION(e)}function pl(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 zy(t,e,r){if(typeof e=="function")return dt(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return dt(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:jy(e,...r)}function te(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(zy(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Hy]=!0,sn[t]=n}function yl(t){let e=Ky+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Yy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new $y([e,t],e.message);return r.code=e.code,r}return t||e}var Xi=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new sn.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};te("ERR_ASSERTION","%s",Error);te("ERR_INVALID_ARG_TYPE",(t,e,r)=>{dt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let i=[],o=[],a=[];for(let l of e)dt(typeof l=="string","All expected entries have to be of type string"),Gy.includes(l)?i.push(l.toLowerCase()):Vy.test(l)?o.push(l):(dt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=i.indexOf("object");l!==-1&&(i.splice(i,l,1),o.push("Object"))}if(i.length>0){switch(i.length){case 1:n+=`of type ${i[0]}`;break;case 2:n+=`one of type ${i[0]} or ${i[1]}`;break;default:{let l=i.pop();n+=`one of type ${i.join(", ")}, or ${l}`}}(o.length>0||a.length>0)&&(n+=" or ")}if(o.length>0){switch(o.length){case 1:n+=`an instance of ${o[0]}`;break;case 2:n+=`an instance of ${o[0]} or ${o[1]}`;break;default:{let l=o.pop();n+=`an instance of ${o.join(", ")}, or ${l}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let l=a.pop();n+=`one of ${a.join(", ")}, or ${l}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var s;if((s=r.constructor)!==null&&s!==void 0&&s.name)n+=`. Received an instance of ${r.constructor.name}`;else{let l=an(r,{depth:-1});n+=`. Received ${l}`}}else{let l=an(r,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof r} (${l})`}return n},TypeError);te("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=an(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);te("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let i=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${i}.`},TypeError);te("ERR_MISSING_ARGS",(...t)=>{dt(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);te("ERR_OUT_OF_RANGE",(t,e,r)=>{dt(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=pl(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=pl(n)),n+="n"):n=an(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);te("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);te("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);te("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);te("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);te("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);te("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);te("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);te("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);te("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);te("ERR_STREAM_WRITE_AFTER_END","write after end",Error);te("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);gl.exports={AbortError:Xi,aggregateTwoErrors:yl(Yy),hideStackFrames:yl,codes:sn}});var Wt=_((Wv,xl)=>{"use strict";d();var{ArrayIsArray:Zi,ArrayPrototypeIncludes:_l,ArrayPrototypeJoin:El,ArrayPrototypeMap:Jy,NumberIsInteger:eo,NumberIsNaN:Xy,NumberMAX_SAFE_INTEGER:Qy,NumberMIN_SAFE_INTEGER:Zy,NumberParseInt:eg,ObjectPrototypeHasOwnProperty:tg,RegExpPrototypeExec:Sl,String:rg,StringPrototypeToUpperCase:ng,StringPrototypeTrim:ig}=H(),{hideStackFrames:pe,codes:{ERR_SOCKET_BAD_PORT:og,ERR_INVALID_ARG_TYPE:ie,ERR_INVALID_ARG_VALUE:jt,ERR_OUT_OF_RANGE:ht,ERR_UNKNOWN_SIGNAL:bl}}=ae(),{normalizeEncoding:ag}=ne(),{isAsyncFunction:sg,isArrayBufferView:lg}=ne().types,wl={};function fg(t){return t===(t|0)}function ug(t){return t===t>>>0}var cg=/^[0-7]+$/,dg="must be a 32-bit unsigned integer or an octal string";function hg(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Sl(cg,t)===null)throw new jt(e,t,dg);t=eg(t,8)}return Al(t,e),t}var pg=pe((t,e,r=Zy,n=Qy)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!eo(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),yg=pe((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!eo(t))throw new ht(e,"an integer",t);if(t<r||t>n)throw new ht(e,`>= ${r} && <= ${n}`,t)}),Al=pe((t,e,r=!1)=>{if(typeof t!="number")throw new ie(e,"number",t);if(!eo(t))throw new ht(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new ht(e,`>= ${n} && <= ${i}`,t)});function to(t,e){if(typeof t!="string")throw new ie(e,"string",t)}function gg(t,e,r=void 0,n){if(typeof t!="number")throw new ie(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Xy(t))throw new ht(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var bg=pe((t,e,r)=>{if(!_l(r,t)){let i="must be one of: "+El(Jy(r,o=>typeof o=="string"?`'${o}'`:rg(o)),", ");throw new jt(e,t,i)}});function vl(t,e){if(typeof t!="boolean")throw new ie(e,"boolean",t)}function Qi(t,e,r){return t==null||!tg(t,e)?r:t[e]}var wg=pe((t,e,r=null)=>{let n=Qi(r,"allowArray",!1),i=Qi(r,"allowFunction",!1);if(!Qi(r,"nullable",!1)&&t===null||!n&&Zi(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new ie(e,"Object",t)}),mg=pe((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ie(e,"a dictionary",t)}),ln=pe((t,e,r=0)=>{if(!Zi(t))throw new ie(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new jt(e,t,n)}});function _g(t,e){ln(t,e);for(let r=0;r<t.length;r++)to(t[r],`${e}[${r}]`)}function Eg(t,e){ln(t,e);for(let r=0;r<t.length;r++)vl(t[r],`${e}[${r}]`)}function Sg(t,e){ln(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new ie(i,"AbortSignal",n);Rl(n,i)}}function Ag(t,e="signal"){if(to(t,e),wl[t]===void 0)throw wl[ng(t)]!==void 0?new bl(t+" (signals must use all capital letters)"):new bl(t)}var vg=pe((t,e="buffer")=>{if(!lg(t))throw new ie(e,["Buffer","TypedArray","DataView"],t)});function Rg(t,e){let r=ag(e),n=t.length;if(r==="hex"&&n%2!==0)throw new jt("encoding",e,`is invalid for data of length ${n}`)}function xg(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&ig(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new og(e,t,r);return t|0}var Rl=pe((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ie(e,"AbortSignal",t)}),Tg=pe((t,e)=>{if(typeof t!="function")throw new ie(e,"Function",t)}),Ig=pe((t,e)=>{if(typeof t!="function"||sg(t))throw new ie(e,"Function",t)}),Og=pe((t,e)=>{if(t!==void 0)throw new ie(e,"undefined",t)});function Bg(t,e,r){if(!_l(r,t))throw new ie(e,`('${El(r,"|")}')`,t)}var Pg=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function ml(t,e){if(typeof t>"u"||!Sl(Pg,t))throw new jt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Mg(t){if(typeof t=="string")return ml(t,"hints"),t;if(Zi(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];ml(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new jt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}xl.exports={isInt32:fg,isUint32:ug,parseFileMode:hg,validateArray:ln,validateStringArray:_g,validateBooleanArray:Eg,validateAbortSignalArray:Sg,validateBoolean:vl,validateBuffer:vg,validateDictionary:mg,validateEncoding:Rg,validateFunction:Tg,validateInt32:yg,validateInteger:pg,validateNumber:gg,validateObject:wg,validateOneOf:bg,validatePlainFunction:Ig,validatePort:xg,validateSignalName:Ag,validateString:to,validateUint32:Al,validateUndefined:Og,validateUnion:Bg,validateAbortSignal:Rl,validateLinkHeaderValue:Mg}});var et=_((Hv,Bl)=>{d();var K=Bl.exports={},Ie,Oe;function ro(){throw new Error("setTimeout has not been defined")}function no(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ie=setTimeout:Ie=ro}catch{Ie=ro}try{typeof clearTimeout=="function"?Oe=clearTimeout:Oe=no}catch{Oe=no}})();function Tl(t){if(Ie===setTimeout)return setTimeout(t,0);if((Ie===ro||!Ie)&&setTimeout)return Ie=setTimeout,setTimeout(t,0);try{return Ie(t,0)}catch{try{return Ie.call(null,t,0)}catch{return Ie.call(this,t,0)}}}function kg(t){if(Oe===clearTimeout)return clearTimeout(t);if((Oe===no||!Oe)&&clearTimeout)return Oe=clearTimeout,clearTimeout(t);try{return Oe(t)}catch{try{return Oe.call(null,t)}catch{return Oe.call(this,t)}}}var je=[],$t=!1,pt,fn=-1;function Lg(){!$t||!pt||($t=!1,pt.length?je=pt.concat(je):fn=-1,je.length&&Il())}function Il(){if(!$t){var t=Tl(Lg);$t=!0;for(var e=je.length;e;){for(pt=je,je=[];++fn