UNPKG

megajs-backend

Version:

Unofficial JavaScript SDK for MEGA

28 lines 235 kB
var mega=(()=>{var Hp=Object.create;var rn=Object.defineProperty;var Gp=Object.getOwnPropertyDescriptor;var Vp=Object.getOwnPropertyNames;var Kp=Object.getPrototypeOf,zp=Object.prototype.hasOwnProperty;var he=(t,e)=>()=>(t&&(e=t(t=0)),e);var _=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Yp=(t,e)=>{for(var r in e)rn(t,r,{get:e[r],enumerable:!0})},Ds=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Vp(e))!zp.call(t,i)&&i!==r&&rn(t,i,{get:()=>e[i],enumerable:!(n=Gp(e,i))||n.enumerable});return t};var ve=(t,e,r)=>(r=t!=null?Hp(Kp(t)):{},Ds(e||!t||!t.__esModule?rn(r,"default",{value:t,enumerable:!0}):r,t)),wr=t=>Ds(rn({},"__esModule",{value:!0}),t);var Us=_(nn=>{"use strict";d();nn.byteLength=Xp;nn.toByteArray=Zp;nn.fromByteArray=ry;var Re=[],pe=[],Jp=typeof Uint8Array<"u"?Uint8Array:Array,ji="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ct=0,Fs=ji.length;ct<Fs;++ct)Re[ct]=ji[ct],pe[ji.charCodeAt(ct)]=ct;var ct,Fs;pe[45]=62;pe[95]=63;function qs(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 Xp(t){var e=qs(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Qp(t,e,r){return(e+r)*3/4-r}function Zp(t){var e,r=qs(t),n=r[0],i=r[1],o=new Jp(Qp(t,n,i)),a=0,s=i>0?n-4:n,l;for(l=0;l<s;l+=4)e=pe[t.charCodeAt(l)]<<18|pe[t.charCodeAt(l+1)]<<12|pe[t.charCodeAt(l+2)]<<6|pe[t.charCodeAt(l+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return i===2&&(e=pe[t.charCodeAt(l)]<<2|pe[t.charCodeAt(l+1)]>>4,o[a++]=e&255),i===1&&(e=pe[t.charCodeAt(l)]<<10|pe[t.charCodeAt(l+1)]<<4|pe[t.charCodeAt(l+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}function ey(t){return Re[t>>18&63]+Re[t>>12&63]+Re[t>>6&63]+Re[t&63]}function ty(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(ey(n));return i.join("")}function ry(t){for(var e,r=t.length,n=r%3,i=[],o=16383,a=0,s=r-n;a<s;a+=o)i.push(ty(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 js=_(Wi=>{d();Wi.read=function(t,e,r,n,i){var o,a,s=i*8-n-1,l=(1<<s)-1,f=l>>1,c=-7,u=r?i-1:0,p=r?-1:1,h=t[e+u];for(u+=p,o=h&(1<<-c)-1,h>>=-c,c+=s;c>0;o=o*256+t[e+u],u+=p,c-=8);for(a=o&(1<<-c)-1,o>>=-c,c+=n;c>0;a=a*256+t[e+u],u+=p,c-=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)};Wi.write=function(t,e,r,n,i,o){var a,s,l,f=o*8-i-1,c=(1<<f)-1,u=c>>1,p=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=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+u>=1?e+=p/l:e+=p*Math.pow(2,1-u),e*l>=2&&(a++,l/=2),a+u>=c?(s=0,a=c):a+u>=1?(s=(e*l-1)*Math.pow(2,i),a=a+u):(s=e*Math.pow(2,u-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=_(qt=>{"use strict";d();var $i=Us(),Dt=js(),Ws=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;qt.Buffer=b;qt.SlowBuffer=ly;qt.INSPECT_MAX_BYTES=50;var on=2147483647;qt.kMaxLength=on;b.TYPED_ARRAY_SUPPORT=ny();!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 ny(){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>on)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 Ki(t)}return Vs(t,e,r)}b.poolSize=8192;function Vs(t,e,r){if(typeof t=="string")return oy(t,e);if(ArrayBuffer.isView(t))return ay(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 Gi(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=sy(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 Vs(t,e,r)};Object.setPrototypeOf(b.prototype,Uint8Array.prototype);Object.setPrototypeOf(b,Uint8Array);function Ks(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 iy(t,e,r){return Ks(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 iy(t,e,r)};function Ki(t){return Ks(t),Ue(t<0?0:zi(t)|0)}b.allocUnsafe=function(t){return Ki(t)};b.allocUnsafeSlow=function(t){return Ki(t)};function oy(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!b.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=zs(t,e)|0,n=Ue(r),i=n.write(t,e);return i!==r&&(n=n.slice(0,i)),n}function Hi(t){let e=t.length<0?0:zi(t.length)|0,r=Ue(e);for(let n=0;n<e;n+=1)r[n]=t[n]&255;return r}function ay(t){if(xe(t,Uint8Array)){let e=new Uint8Array(t);return Gi(e.buffer,e.byteOffset,e.byteLength)}return Hi(t)}function Gi(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 sy(t){if(b.isBuffer(t)){let e=zi(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"||Ji(t.length)?Ue(0):Hi(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Hi(t.data)}function zi(t){if(t>=on)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+on.toString(16)+" bytes");return t|0}function ly(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 zs(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 Vi(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return nl(t).length;default:if(i)return n?-1:Vi(t).length;e=(""+e).toLowerCase(),i=!0}}b.byteLength=zs;function fy(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 my(this,e,r);case"utf8":case"utf-8":return Js(this,e,r);case"ascii":return by(this,e,r);case"latin1":case"binary":return wy(this,e,r);case"base64":return yy(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _y(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}b.prototype._isBuffer=!0;function dt(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)dt(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)dt(this,r,r+3),dt(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)dt(this,r,r+7),dt(this,r+1,r+6),dt(this,r+2,r+5),dt(this,r+3,r+4);return this};b.prototype.toString=function(){let e=this.length;return e===0?"":arguments.length===0?Js(this,0,e):fy.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=qt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"};Ws&&(b.prototype[Ws]=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),c=e.slice(r,n);for(let u=0;u<l;++u)if(f[u]!==c[u]){a=f[u],s=c[u];break}return a<s?-1:s<a?1:0};function Ys(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,Ji(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:$s(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):$s(t,[e],r,n,i);throw new TypeError("val must be string, number or Buffer")}function $s(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(c,u){return o===1?c[u]:c.readUInt16BE(u*o)}let f;if(i){let c=-1;for(f=r;f<a;f++)if(l(t,f)===l(e,c===-1?0:f-c)){if(c===-1&&(c=f),f-c+1===s)return c*o}else c!==-1&&(f-=f-c),c=-1}else for(r+s>a&&(r=a-s),f=r;f>=0;f--){let c=!0;for(let u=0;u<s;u++)if(l(t,f+u)!==l(e,u)){c=!1;break}if(c)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 Ys(this,e,r,n,!0)};b.prototype.lastIndexOf=function(e,r,n){return Ys(this,e,r,n,!1)};function uy(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(Ji(s))return a;t[r+a]=s}return a}function cy(t,e,r,n){return an(Vi(e,t.length-r),t,r,n)}function dy(t,e,r,n){return an(vy(e),t,r,n)}function hy(t,e,r,n){return an(nl(e),t,r,n)}function py(t,e,r,n){return an(Ry(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 uy(this,e,r,n);case"utf8":case"utf-8":return cy(this,e,r,n);case"ascii":case"latin1":case"binary":return dy(this,e,r,n);case"base64":return hy(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return py(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 yy(t,e,r){return e===0&&r===t.length?$i.fromByteArray(t):$i.fromByteArray(t.slice(e,r))}function Js(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,c,u;switch(s){case 1:o<128&&(a=o);break;case 2:l=t[i+1],(l&192)===128&&(u=(o&31)<<6|l&63,u>127&&(a=u));break;case 3:l=t[i+1],f=t[i+2],(l&192)===128&&(f&192)===128&&(u=(o&15)<<12|(l&63)<<6|f&63,u>2047&&(u<55296||u>57343)&&(a=u));break;case 4:l=t[i+1],f=t[i+2],c=t[i+3],(l&192)===128&&(f&192)===128&&(c&192)===128&&(u=(o&15)<<18|(l&63)<<12|(f&63)<<6|c&63,u>65535&&u<1114112&&(a=u))}}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 gy(n)}var Hs=4096;function gy(t){let e=t.length;if(e<=Hs)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=Hs));return r}function by(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 wy(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 my(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+=xy[t[o]];return i}function _y(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=et(function(e){e=e>>>0,Ft(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=et(function(e){e=e>>>0,Ft(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=et(function(e){e=e>>>0,Ft(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=et(function(e){e=e>>>0,Ft(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),Dt.read(this,e,!0,23,4)};b.prototype.readFloatBE=function(e,r){return e=e>>>0,r||Q(e,4,this.length),Dt.read(this,e,!1,23,4)};b.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Dt.read(this,e,!0,52,8)};b.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||Q(e,8,this.length),Dt.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 Xs(t,e,r,n,i){rl(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 Qs(t,e,r,n,i){rl(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=et(function(e,r=0){return Xs(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});b.prototype.writeBigUInt64BE=et(function(e,r=0){return Qs(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=et(function(e,r=0){return Xs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});b.prototype.writeBigInt64BE=et(function(e,r=0){return Qs(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Zs(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 el(t,e,r,n,i){return e=+e,r=r>>>0,i||Zs(t,e,r,4,34028234663852886e22,-34028234663852886e22),Dt.write(t,e,r,n,23,4),r+4}b.prototype.writeFloatLE=function(e,r,n){return el(this,e,r,!0,n)};b.prototype.writeFloatBE=function(e,r,n){return el(this,e,r,!1,n)};function tl(t,e,r,n,i){return e=+e,r=r>>>0,i||Zs(t,e,r,8,17976931348623157e292,-17976931348623157e292),Dt.write(t,e,r,n,52,8),r+8}b.prototype.writeDoubleLE=function(e,r,n){return tl(this,e,r,!0,n)};b.prototype.writeDoubleBE=function(e,r,n){return tl(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 Nt={};function Yi(t,e,r){Nt[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}`}}}Yi("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Yi("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Yi("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=Gs(String(r)):typeof r=="bigint"&&(i=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(i=Gs(i)),i+="n"),n+=` It must be ${e}. Received ${i}`,n},RangeError);function Gs(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 Ey(t,e,r){Ft(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&mr(e,t.length-(r+1))}function rl(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 Nt.ERR_OUT_OF_RANGE("value",s,t)}Ey(n,i,o)}function Ft(t,e){if(typeof t!="number")throw new Nt.ERR_INVALID_ARG_TYPE(e,"number",t)}function mr(t,e,r){throw Math.floor(t)!==t?(Ft(t,r),new Nt.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Nt.ERR_BUFFER_OUT_OF_BOUNDS:new Nt.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Sy=/[^+/0-9A-Za-z-_]/g;function Ay(t){if(t=t.split("=")[0],t=t.trim().replace(Sy,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function Vi(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 vy(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}function Ry(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 nl(t){return $i.toByteArray(Ay(t))}function an(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 Ji(t){return t!==t}var xy=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 et(t){return typeof BigInt>"u"?Ty:t}function Ty(){throw new Error("BigInt not supported")}});var y,g,m,d=he(()=>{y=ve(de(),1),g={env:{},nextTick:(t,...e)=>{globalThis.setTimeout(t,0,...e)}},m=globalThis});var $=_((Cv,il)=>{"use strict";d();il.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 Ut={};Yp(Ut,{Agent:()=>Iy,default:()=>Xi});var Iy,Xi,je=he(()=>{d();Iy=null,Xi=null});var Te=_((Fv,Qi)=>{"use strict";d();var jt=typeof Reflect=="object"?Reflect:null,ol=jt&&typeof jt.apply=="function"?jt.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},sn;jt&&typeof jt.ownKeys=="function"?sn=jt.ownKeys:Object.getOwnPropertySymbols?sn=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:sn=function(e){return Object.getOwnPropertyNames(e)};function Oy(t){console&&console.warn&&console.warn(t)}var sl=Number.isNaN||function(e){return e!==e};function D(){D.init.call(this)}Qi.exports=D;Qi.exports.once=ky;D.EventEmitter=D;D.prototype._events=void 0;D.prototype._eventsCount=0;D.prototype._maxListeners=void 0;var al=10;function ln(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 al},set:function(t){if(typeof t!="number"||t<0||sl(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");al=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||sl(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 ll(t){return t._maxListeners===void 0?D.defaultMaxListeners:t._maxListeners}D.prototype.getMaxListeners=function(){return ll(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")ol(l,this,r);else for(var f=l.length,c=hl(l,f),n=0;n<f;++n)ol(c[n],this,r);return!0};function fl(t,e,r,n){var i,o,a;if(ln(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=ll(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,Oy(s)}return t}D.prototype.addListener=function(e,r){return fl(this,e,r,!1)};D.prototype.on=D.prototype.addListener;D.prototype.prependListener=function(e,r){return fl(this,e,r,!0)};function By(){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 ul(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},i=By.bind(n);return i.listener=r,n.wrapFn=i,i}D.prototype.once=function(e,r){return ln(r),this.on(e,ul(this,e,r)),this};D.prototype.prependOnceListener=function(e,r){return ln(r),this.prependListener(e,ul(this,e,r)),this};D.prototype.removeListener=function(e,r){var n,i,o,a,s;if(ln(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():Py(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 cl(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?My(i):hl(i,i.length)}D.prototype.listeners=function(e){return cl(this,e,!0)};D.prototype.rawListeners=function(e){return cl(this,e,!1)};D.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):dl.call(t,e)};D.prototype.listenerCount=dl;function dl(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?sn(this._events):[]};function hl(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function Py(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function My(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function ky(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))}pl(t,e,o,{once:!0}),e!=="error"&&Ly(t,i,{once:!0})})}function Ly(t,e,r){typeof t.on=="function"&&pl(t,"error",e,r)}function pl(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 ie=_((Uv,eo)=>{"use strict";d();var Cy=de(),{kResistStopPropagation:Ny,SymbolDispose:Dy}=$(),Fy=globalThis.AbortSignal||(je(),wr(Ut)).AbortSignal,qy=globalThis.AbortController||(je(),wr(Ut)).AbortController,Uy=Object.getPrototypeOf(async function(){}).constructor,yl=globalThis.Blob||Cy.Blob,jy=typeof yl<"u"?function(e){return e instanceof yl}:function(e){return!1},gl=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},Wy=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},Zi=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}};eo.exports={AggregateError:Zi,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 Uy},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:jy,deprecate(t,e){return t},addAbortListener:Te().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);gl(e,"signal"),Wy(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[Ny]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[Dy](){var i;(i=n)===null||i===void 0||i()}}},AbortSignalAny:Fy.any||function(e){if(e.length===1)return e[0];let r=new qy,n=()=>r.abort();return e.forEach(i=>{gl(i,"signals"),i.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(i=>i.removeEventListener("abort",n))},{once:!0}),r.signal}};eo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=_((Wv,ml)=>{"use strict";d();var{format:$y,inspect:fn,AggregateError:Hy}=ie(),Gy=globalThis.AggregateError||Hy,Vy=Symbol("kIsNodeError"),Ky=["string","function","number","object","Function","Object","boolean","bigint","symbol"],zy=/^([A-Z][a-z0-9]*)+$/,Yy="__node_internal_",un={};function ht(t,e){if(!t)throw new un.ERR_INTERNAL_ASSERTION(e)}function bl(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 Jy(t,e,r){if(typeof e=="function")return ht(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 ht(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:$y(e,...r)}function te(t,e,r){r||(r=Error);class n extends r{constructor(...o){super(Jy(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[Vy]=!0,un[t]=n}function wl(t){let e=Yy+t.name;return Object.defineProperty(t,"name",{value:e}),t}function Xy(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new Gy([e,t],e.message);return r.code=e.code,r}return t||e}var to=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new un.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)=>{ht(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)ht(typeof l=="string","All expected entries have to be of type string"),Ky.includes(l)?i.push(l.toLowerCase()):zy.test(l)?o.push(l):(ht(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=fn(r,{depth:-1});n+=`. Received ${l}`}}else{let l=fn(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=fn(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)=>{ht(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)=>{ht(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=bl(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=bl(n)),n+="n"):n=fn(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);ml.exports={AbortError:to,aggregateTwoErrors:wl(Xy),hideStackFrames:wl,codes:un}});var $t=_((Hv,Ol)=>{"use strict";d();var{ArrayIsArray:no,ArrayPrototypeIncludes:Al,ArrayPrototypeJoin:vl,ArrayPrototypeMap:Qy,NumberIsInteger:io,NumberIsNaN:Zy,NumberMAX_SAFE_INTEGER:eg,NumberMIN_SAFE_INTEGER:tg,NumberParseInt:rg,ObjectPrototypeHasOwnProperty:ng,RegExpPrototypeExec:Rl,String:ig,StringPrototypeToUpperCase:og,StringPrototypeTrim:ag}=$(),{hideStackFrames:ye,codes:{ERR_SOCKET_BAD_PORT:sg,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:Wt,ERR_OUT_OF_RANGE:pt,ERR_UNKNOWN_SIGNAL:_l}}=ae(),{normalizeEncoding:lg}=ie(),{isAsyncFunction:fg,isArrayBufferView:ug}=ie().types,El={};function cg(t){return t===(t|0)}function dg(t){return t===t>>>0}var hg=/^[0-7]+$/,pg="must be a 32-bit unsigned integer or an octal string";function yg(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(Rl(hg,t)===null)throw new Wt(e,t,pg);t=rg(t,8)}return xl(t,e),t}var gg=ye((t,e,r=tg,n=eg)=>{if(typeof t!="number")throw new oe(e,"number",t);if(!io(t))throw new pt(e,"an integer",t);if(t<r||t>n)throw new pt(e,`>= ${r} && <= ${n}`,t)}),bg=ye((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new oe(e,"number",t);if(!io(t))throw new pt(e,"an integer",t);if(t<r||t>n)throw new pt(e,`>= ${r} && <= ${n}`,t)}),xl=ye((t,e,r=!1)=>{if(typeof t!="number")throw new oe(e,"number",t);if(!io(t))throw new pt(e,"an integer",t);let n=r?1:0,i=4294967295;if(t<n||t>i)throw new pt(e,`>= ${n} && <= ${i}`,t)});function oo(t,e){if(typeof t!="string")throw new oe(e,"string",t)}function wg(t,e,r=void 0,n){if(typeof t!="number")throw new oe(e,"number",t);if(r!=null&&t<r||n!=null&&t>n||(r!=null||n!=null)&&Zy(t))throw new pt(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var mg=ye((t,e,r)=>{if(!Al(r,t)){let i="must be one of: "+vl(Qy(r,o=>typeof o=="string"?`'${o}'`:ig(o)),", ");throw new Wt(e,t,i)}});function Tl(t,e){if(typeof t!="boolean")throw new oe(e,"boolean",t)}function ro(t,e,r){return t==null||!ng(t,e)?r:t[e]}var _g=ye((t,e,r=null)=>{let n=ro(r,"allowArray",!1),i=ro(r,"allowFunction",!1);if(!ro(r,"nullable",!1)&&t===null||!n&&no(t)||typeof t!="object"&&(!i||typeof t!="function"))throw new oe(e,"Object",t)}),Eg=ye((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new oe(e,"a dictionary",t)}),cn=ye((t,e,r=0)=>{if(!no(t))throw new oe(e,"Array",t);if(t.length<r){let n=`must be longer than ${r}`;throw new Wt(e,t,n)}});function Sg(t,e){cn(t,e);for(let r=0;r<t.length;r++)oo(t[r],`${e}[${r}]`)}function Ag(t,e){cn(t,e);for(let r=0;r<t.length;r++)Tl(t[r],`${e}[${r}]`)}function vg(t,e){cn(t,e);for(let r=0;r<t.length;r++){let n=t[r],i=`${e}[${r}]`;if(n==null)throw new oe(i,"AbortSignal",n);Il(n,i)}}function Rg(t,e="signal"){if(oo(t,e),El[t]===void 0)throw El[og(t)]!==void 0?new _l(t+" (signals must use all capital letters)"):new _l(t)}var xg=ye((t,e="buffer")=>{if(!ug(t))throw new oe(e,["Buffer","TypedArray","DataView"],t)});function Tg(t,e){let r=lg(e),n=t.length;if(r==="hex"&&n%2!==0)throw new Wt("encoding",e,`is invalid for data of length ${n}`)}function Ig(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&ag(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new sg(e,t,r);return t|0}var Il=ye((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new oe(e,"AbortSignal",t)}),Og=ye((t,e)=>{if(typeof t!="function")throw new oe(e,"Function",t)}),Bg=ye((t,e)=>{if(typeof t!="function"||fg(t))throw new oe(e,"Function",t)}),Pg=ye((t,e)=>{if(t!==void 0)throw new oe(e,"undefined",t)});function Mg(t,e,r){if(!Al(r,t))throw new oe(e,`('${vl(r,"|")}')`,t)}var kg=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Sl(t,e){if(typeof t>"u"||!Rl(kg,t))throw new Wt(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}function Lg(t){if(typeof t=="string")return Sl(t,"hints"),t;if(no(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n<e;n++){let i=t[n];Sl(i,"hints"),r+=i,n!==e-1&&(r+=", ")}return r}throw new Wt("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}Ol.exports={isInt32:cg,isUint32:dg,parseFileMode:yg,validateArray:cn,validateStringArray:Sg,validateBooleanArray:Ag,validateAbortSignalArray:vg,validateBoolean:Tl,validateBuffer:xg,validateDictionary:Eg,validateEncoding:Tg,validateFunction:Og,validateInt32:bg,validateInteger:gg,validateNumber:wg,validateObject:_g,validateOneOf:mg,validatePlainFunction:Bg,validatePort:Ig,validateSignalName:Rg,validateString:oo,validateUint32:xl,validateUndefined:Pg,validateUnion:Mg,validateAbortSignal:Il,validateLinkHeaderValue:Lg}});var tt=_((Vv,kl)=>{d();var K=kl.exports={},Ie,Oe;function ao(){throw new Error("setTimeout has not been defined")}function so(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?Ie=setTimeout:Ie=ao}catch{Ie=ao}try{typeof clearTimeout=="function"?Oe=clearTimeout:Oe=so}catch{Oe=so}})();function Bl(t){if(Ie===setTimeout)return setTimeout(t,0);if((Ie===ao||!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 Cg(t){if(Oe===clearTimeout)return clearTimeout(t);if((Oe===so||!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 We=[],Ht=!1,yt,dn=-1;function Ng(){!Ht||!yt||(Ht=!1,yt.length?We=yt.concat(We):dn=-1,We.length&&Pl())}function Pl(){if(!Ht){var t=Bl(Ng);Ht=!0;for(var e=We.length;e;){for(yt=We,We=[];++dn<e;)yt&&yt[dn].run();dn=-1,e=We.length}yt=null,Ht=!1,Cg(t)}}K.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];We.push(new Ml(t,e)),We.length===1&&!Ht&&Bl(Pl)};function Ml(t,e){this.fun=t,this.array=e}Ml.prototype.run=function(){this.fun.apply(null,this.array)};K.title="browser";K.browser=!0;K.env={};K.argv=[];K.version="";K.versions={};function $e(){}K.on=$e;K.addListener=$e;K.once=$e;K.off=$e;K.removeListener=$e;K.removeAllListeners=$e;K.emit=$e;K.prependListener=$e;K.prependOnceListener=$e;K.listeners=function(t){return[]};K.binding=function(t){throw new Error("process.binding is not supported")};K.cwd=function(){return"/"};K.chdir=function(t){throw new Error("process.chdir is not supported")};K.umask=function(){return 0}});var Pe=_((zv,zl)=>{"use strict";d();var{SymbolAsyncIterator:Ll,SymbolIterator:Cl,SymbolFor:gt}=$(),Nl=gt("nodejs.stream.destroyed"),Dl=gt("nodejs.stream.errored"),lo=gt("nodejs.stream.readable"),fo=gt("nodejs.stream.writable"),Fl=gt("nodejs.stream.disturbed"),Dg=gt("nodejs.webstream.isClosedPromise"),Fg=gt("nodejs.webstream.controllerErrorFunction");function hn(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function pn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function qg(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function Be(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function ql(t){return!!(t&&!Be(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function Ul(t){return!!(t&&!Be(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function jl(t){return!!(t&&!Be(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function Ug(t){return ql(t)||Ul(t)||jl(t)}function jg(t,e){return t==null?!1:e===!0?typeof t[Ll]=="function":e===!1?typeof t[Cl]=="function":typeof t[Ll]=="function"||typeof t[Cl]=="function"}function yn(t){if(!Be(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[Nl]||n!=null&&n.destroyed)}function Wl(t){if(!pn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function Wg(t,e){if(!pn(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function $g(t){if(!hn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function $l(t,e){if(!hn(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function Hl(t){return t&&t[lo]!=null?t[lo]:typeof t?.readable!="boolean"?null:yn(t)?!1:hn(t)&&t.readable&&!$l(t)}function Gl(t){return t&&t[fo]!=null?t[fo]:typeof t?.writable!="boolean"?null:yn(t)?!1:pn(t)&&t.writable&&!Wl(t)}function Hg(t,e){return Be(t)?yn(t)?!0:!(e?.readable!==!1&&Hl(t)||e?.writable!==!1&&Gl(t)):null}function Gg(t){var e,r;return Be(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Vg(t){var e,r;return Be(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function Kg(t){if(!Be(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&Vl(t)?t._closed:null}function Vl(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function Kl(t){return typeof t._sent100=="boolean"&&Vl(t)}function zg(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function Yg(t){if(!Be(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&Kl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function Jg(t){var e;return!!(t&&((e=t[Fl])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function Xg(t){var e,r,n,i,o,a,s,l,f,c;return!!(t&&((e=(r=(n=(i=(o=(a=t[Dl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&i!==void 0?i:(s=t._readableState)===null||s===void 0?void 0:s.errorEmitted)!==null&&n!==void 0?n:(l=t._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&r!==void 0?r:(f=t._readableState)===null||f===void 0?void 0:f.errored)!==null&&e!==void 0?e:!((c=t._writableState)===null||c===void 0)&&c.errored))}zl.exports={isDestroyed:yn,kIsDestroyed:Nl,isDisturbed:Jg,kIsDisturbed:Fl,isErrored:Xg,kIsErrored:Dl,isReadable:Hl,kIsReadable:lo,kIsClosedPromise:Dg,kControllerErrorFunction:Fg,kIsWritable:fo,isClosed:Kg,isDuplexNodeStream:qg,isFinished:Hg,isIterable:jg,isReadableNodeStream:hn,isReadableStream:ql,isReadableEnded:$g,isReadableFinished:$l,isReadableErrored:Vg,isNodeStream:Be,isWebStream:Ug,isWritable:Gl,isWritableNodeStream:pn,isWritableStream:Ul,isWritableEnded:Wl,isWritableFinished:Wg,isWritableErrored:Gg,isServerRequest:zg,isServerResponse:Kl,willEmitClose:Yg,isTransformStream:jl}});var He=_((Jv,yo)=>{d();var rt=tt(),{AbortError:nf,codes:Qg}=ae(),{ERR_INVALID_ARG_TYPE:Zg,ERR_STREAM_PREMATURE_CLOSE:Yl}=Qg,{kEmptyObject:co,once:ho}=ie(),{validateAbortSignal:eb,validateFunction:tb,validateObject:rb,validateBoolean:nb}=$t(),{Promise:ib,PromisePrototypeThen:ob,SymbolDispose:of}=$(),{isClosed:ab,isReadable:Jl,isReadableNodeStream:uo,isReadableStream:sb,isReadableFinished:Xl,isReadableErrored:Ql,isWritable:Zl,isWritableNodeStream:ef,isWritableStream:lb,isWritableFinished:tf,isWritableErrored:rf,isNodeStream:fb,willEmitClose:ub,kIsClosedPromise:cb}=Pe(),Gt;function db(t){return t.setHeader&&typeof t.abort=="function"}var po=()=>{};function af(t,e,r){var n,i;if(arguments.length===2?(r=e,e=co):e==null?e=co:rb(e,"options"),tb(r,"callback"),eb(e.signal,"options.signal"),r=ho(r),sb(t)||lb(t))return hb(t,e,r);if(!fb(t))throw new Zg("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:uo(t),a=(i=e.writable)!==null&&i!==void 0?i:ef(t),s=t._writableState,l=t._readableState,f=()=>{t.writable||p()},c=ub(t)&&uo(t)===o&&ef(t)===a,u=tf(t,!1),p=()=>{u=!0,t.destroyed&&(c=!1),!(c&&(!t.readable||o))&&(!o||h)&&r.call(t)},h=Xl(t,!1),E=()=>{h=!0,t.destroyed&&(c=!1),!(c&&(!t.writable||a))&&(!a||u)&&r.call(t)},w=I=>{r.call(t,I)},A=ab(t),S=()=>{A=!0;let I=rf(t)||Ql(t);if(I&&typeof I!="boolean")return r.call(t,I);if(o&&!h&&uo(t,!0)&&!Xl(t,!1))return r.call(t,new Yl);if(a&&!u&&!tf(t,!1))return r.call(t,new Yl);r.call(t)},R=()=>{A=!0;let I=rf(t)||Ql(t);if(I&&typeof I!="boolean")return r.call(t,I);r.call(t)},M=()=>{t.req.on("finish",p)};db(t)?(t.on("complete",p),c||t.on("abort",S),t.req?M():t.on("request",M)):a&&!s&&(t.on("end",f),t.on("close",f)),!c&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",E),t.on("finish",p),e.error!==!1&&t.on("error",w),t.on("close",S),A?rt.nextTick(S):s!=null&&s.errorEmitted||l!=null&&l.errorEmitted?c||rt.nextTick(R):(!o&&(!c||Jl(t))&&(u||Zl(t)===!1)||!a&&(!c||Zl(t))&&(h||Jl(t)===!1)||l&&t.req&&t.aborted)&&rt.nextTick(R);let v=()=>{r=po,t.removeListener("aborted",S),t.removeListener("complete",p),t.removeListener("abort",S),t.removeListener("request",M),t.req&&t.req.removeListener("finish",p),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",p),t.removeListener("end",E),t.removeListener("error",w),t.removeListener("close",S)};if(e.signal&&!A){let I=()=>{let j=r;v(),j.call(t,new nf(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)rt.nextTick(I);else{Gt=Gt||ie().addAbortListener;let j=Gt(e.signal,I),F=r;r=ho((...X)=>{j[of](),F.apply(t,X)})}}return v}function hb(t,e,r){let n=!1,i=po;if(e.signal)if(i=()=>{n=!0,r.call(t,new nf(void 0,{cause:e.signal.reason}))},e.signal.aborted)rt.nextTick(i);else{Gt=Gt||ie().addAbortListener;let a=Gt(e.signal,i),s=r;r=ho((...l)=>{a[of](),s.apply(t,l)})}let o=(...a)=>{n||rt.nextTick(()=>r.apply(t,a))};return ob(t[cb].promise,o,o),po}function pb(t,e){var r;let n=!1;return e===null&&(e=co),(r=e)!==null&&r!==void 0&&r.cleanup&&(nb(e.cleanup,"cleanup"),n=e.cleanup),new ib((i,o)=>{let a=af(t,e,s=>{n&&a(),s?o(s):i()})})}yo.exports=af;yo.exports.finished=pb});var bt=_((Qv,pf)=>{"use strict";d();var Me=tt(),{aggregateTwoErrors:yb,codes:{ERR_MULTIPLE_CALLBACK:gb},AbortError:bb}=ae(),{Symbol:ff}=$(),{kIsDestroyed:wb,isDestroyed:mb,isFinished:_b,isServerRequest:Eb}=Pe(),uf=ff("kDestroy"),go=ff("kConstruct");function cf(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function Sb(t,e){let r=this._readableState,n=this._writableState,i=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(cf(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),i.constructed?sf(this,t,e):this.once(uf,function(o){sf(this,yb(o,t),e)}),this)}function sf(t,e,r){let n=!1;function i(o){if(n)return;n=!0;let a=t._readableState,s=t._writableState;cf(o,s,a),s&&(s.closed=!0),a&&(a.closed=!0),typeof r=="function"&&r(o),o?Me.nextTick(Ab,t,o):Me.nextTick(df,t)}try{t._destroy(e||null,i)}catch(o){i(o)}}function Ab(t,e){bo(t,e),df(t)}function df(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function bo(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function vb(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function wo(t,e,r){let n=t._readableState,i=t._writableState;if(i!=null&&i.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||i!=null&&i.autoDestroy?t.destroy(e):e&&(e.stack,i&&!i.errored&&(i.errored=e),n&&!n.errored&&(n.errored=e),r?Me.nextTick(bo,t,e):bo(t,e))}function Rb(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(go,e),!(t.listenerCount(go)>1)&&Me.nextTick(xb,t)}function xb(t){let e=!1;function r(n){if(e){wo(t,n??new gb);return}e=!0;let i=t._readableState,o=t._writableState,a=o||i;i&&(i.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(uf,n):n?wo(t,n,!0):Me.nextTick(Tb,t)}try{t._construct(n=>{Me.nextTick(r,n)})}catch(n){Me.nextTick(r,n)}}function Tb(t){t.emit(go)}function lf(t){return t?.setHeader&&typeof t.abort=="function"}function hf(t){t.emit("close")}function Ib(t,e){t.emit("error",e),Me.nextTick(hf,t)}function Ob(t,e){!t||mb(t)||(!e&&!_b(t)&&(e=new bb),Eb(t)?(t.socket=null,t.destroy(e)):lf(t)?t.abort():lf(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Me.nextTick(Ib,t,e):Me.nextTick(hf,t),t.destroyed||(t[wb]=!0))}pf.exports={construct:Rb,destroyer:Ob,destroy:Sb,undestroy:vb,errorOrDestroy:wo}});var wn=_((eR,gf)=>{"use strict";d();var{ArrayIsArray:Bb,ObjectSetPrototypeOf:yf}=$(),{EventEmitter:gn}=Te();function bn(t){gn.call(this,t)}yf(bn.prototype,gn.prototype);yf(bn,gn);bn.prototype.pipe=function(t,e){let r=this;function n(c){t.writable&&t.write(c)===!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",s));let o=!1;function a(){o||(o=!0,t.end())}function s(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}function l(c){f(),gn.listenerCount(this,"error")===0&&this.emit("error",c)}mo(r,"error",l),mo(t,"error",l);function f(){r.removeListener("data",n),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",l),t.removeListener("error",l),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t};function mo(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Bb(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}gf.exports={Stream:bn,prependListener:mo}});var _r=_((rR,mn)=>{"use strict";d();var{SymbolDispose:Pb}=$(),{AbortError:bf,codes:Mb}=ae(),{isNodeStream:wf,isWebStream:kb,kControllerErrorFunction:Lb}=Pe(),Cb=He(),{ERR_INVALID_ARG_TYPE:mf}=Mb,_o,Nb=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new mf(e,"AbortSignal",t)};mn.exports.addAbortSignal=function(e,r){if(Nb(e,"signal"),!wf(r)&&!kb(r))throw new mf("stream",["ReadableStream","WritableStream","Stream"],r);return mn.exports.addAbortSignalNoValidate(e,r)};mn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=wf(e)?()=>{e.destroy(new bf(void 0,{cause:t.reason}))}:()=>{e[Lb](new bf(void 0,{cause:t.reason}))};if(t.aborted)r();else{_o=_o||ie().addAbortListener;let n=_o(t,r);Cb(e,n[Pb])}return e}});var Sf=_((oR,Ef)=>{"use strict";d();var{StringPrototypeSlice:_f,SymbolIterator:Db,TypedArrayPrototypeSet:_n,Uint8Array:Fb}=$(),{Buffer:Eo}=de(),{inspect:qb}=ie();Ef.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return Eo.alloc(0);let r=Eo.allocUnsafe(e>>>0),n=this.head,i=0;for(;n;)_n(r,n.data,i),i+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(e<n.length){let i=n.slice(0,e);return this.head.data=n.slice(e),i}return e===n.length?this.shift():r?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[Db](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let r="",n=this.head,i=0;do{let o=n.data;if(e>o.length)r+=o,e-=o.length;else{e===o.length?(r+=o,++i,n.next?this.head=n.next:this.head=this.tail=null):(r+=_f(o,0,e),this.head=n,n.data=_f(o,e));break}++i}while((n=n.next)!==null);return this.length-=i,r}_getBuffer(e){let r=Eo.allocUnsafe(e),n=e,i=this.head,o=0;do{let a=i.data;if(e>a.length)_n(r,a,n-e),e-=a.length;else{e===a.length?(_n(r,a,n-e),++o,i.next?this.head=i.next:this.head=this.tail=null):(_n(r,new Fb(a.buffer,a.byteOffset,e),n-e),this.head=i,i.data=a.slice(e));break}++o}while((i=i.next)!==null);return this.length-=o,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return qb(this,{...r,depth:0,customInspect:!1})}}});var Er=_((sR,xf)=>{"use strict";d();var{MathFloor:Ub,NumberIsInteger:jb}=$(),{validateInteger:Wb}=$t(),{ERR_INVALID_ARG_VALUE:$b}=ae().codes,Af=16*1024,vf=16;function Hb(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function Rf(t){return t?vf:Af}function Gb(t,e){Wb(e,"value",0),t?vf=e:Af=e}function Vb(t,e,r,n){let i=Hb(e,n,r);if(i!=null){if(!jb(i)||i<0){let o=n?`options.${r}`:"options.highWaterMark";throw new $b(o,i)}return Ub(i)}return Rf(t.objectMode)}xf.exports={getHighWaterMark:Vb,getDefaultHighWaterMark:Rf,setDefaultHighWaterMark:Gb}});var Of=_((So,If)=>{d();var En=de(),ke=En.Buffer;function Tf(t,e){for(var r in t)e[r]=t[r]}ke.from&&ke.alloc&&ke.allocUnsafe&&ke.allocUnsafeSlow?If.exports=En:(Tf(En,So),So.Buffer=wt);function wt(t,e,r){return ke(t,e,r)}wt.prototype=Object.create(ke.prototype);Tf(ke,wt);wt.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ke(t,e,r)};wt.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ke(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};wt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ke(t)};wt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return En.SlowBuffer(t)}});var Sn=_(Pf=>{"use strict";d();var vo=Of().Buffer,Bf=vo.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 Kb(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 zb(t){var e=Kb(t);if(typeof e!="string"&&(vo.isEncoding===Bf||!Bf(t)))throw new Error("Unknown encoding: "+t);return e||t}Pf.StringDecoder=Sr;function Sr(t){this.encoding=zb(t);var e;switch(this.encoding){case"utf16le":this.text=ew,this.end=tw,e=4;break;case"utf8":this.fillLast=Xb,e=4;break;case"base64":this.text=rw,this.end=nw,e=3;break;default:this.write=iw,this.end=ow;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=vo.allocUnsafe(e)}Sr.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<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Sr.prototype.end=Zb;Sr.prototype.text=Qb;Sr.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Ao(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function Yb(t,e,r){var n=e.length-1;if(n<r)return 0;var i=Ao(e[n]);return i>=0?(i>0&&(t.lastNeed=i-1),i):--n<r||i===-2?0:(i=Ao(e[n]),i>=0?(i>0&&(t.lastNeed=i-2),i):--n<r||i===-2?0:(i=Ao(e[n]),i>=0?(i>0&&(i===2?i=0:t.lastNeed=i-3),i):0))}function Jb(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 Xb(t){var e=this.lastTotal-this.lastNeed,r=Jb(this,t,e);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 Qb(t,e){var r=Yb(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 Zb(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function ew(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 tw(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 rw(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 nw(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function iw(t){return t.toString(this.encoding)}function ow(t){return t&&t.length?this.write(t):""}});var Ro=_((dR,Cf)=>{"use strict";d();var Mf=tt(),{PromisePrototypeThen:aw,SymbolAsyncIterator:kf,SymbolIterator:Lf}=$(),{Buffer:sw}=de(),{ERR_INVALID_ARG_TYPE:lw,ERR_STREAM_NULL_VALUES:fw}=ae().codes;function uw(t,e,r){let n;if(typeof e=="string"||e instanceof sw)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let i;if(e&&e[kf])i=!0,n=e[kf]();else if(e&&e[Lf])i=!1,n=e[Lf]();else throw new lw("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...r}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,c){aw(s(f),()=>Mf.nextTick(c,f),u=>Mf.nextTick(c,u||f))};async function s(f){let c=f!=null,u=typeof n.throw=="function";if(c&&u){let{value:p,done:h}=await n.throw(f);if(await p,h)return}if(typeof n.return=="function"){let{value:p}=await n.return();await p}}async function l(){for(;;){try{let{value:f,done:c}=i?await n.next():n.next();if(c)o.push(null);else{let u=f&&typeof f.then=="function"?await f:f;if(u===null)throw a=!1,new fw;if(o.push(u))continue;a=!1}}catch(f){o.destroy(f)}break}}return o}Cf.exports=uw});var vr=_((pR,Zf)=>{d();var Ee=tt(),{ArrayPrototypeIndexOf:cw,NumberIsInteger:dw,NumberIsNaN:hw,NumberParseInt:pw,ObjectDefineProperties:ko,ObjectKeys:yw,ObjectSetPrototypeOf:Ff,Promise:qf,SafeSet:gw,SymbolAsyncDispose:bw,SymbolAsyncIterator:ww,Symbol:mw}=$();Zf.exports=x;x.ReadableState=xn;var{EventEmitter:_w}=Te(),{Stream:nt,prependListener:Ew}=wn(),{Buffer:xo}=de(),{addAbortSignal:Sw}=_r(),Uf=He(),k=ie().debuglog("stream",t=>{k=t}),Aw=Sf(),zt=bt(),{getHighWaterMark:vw,getDefaultHighWaterMark:Rw}=Er(),{aggregateTwoErrors:Nf,codes:{ERR_INVALID_ARG_TYPE:xw,ERR_METHOD_NOT_IMPLEMENTED:Tw,ERR_OUT_OF_RANGE:Iw,ERR_STREAM_PUSH_AFTER_EOF:Ow,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Bw},AbortError:Pw}=ae(),{validateObject:Mw}=$t(),mt=mw("kPaused"),{StringDecoder:jf}=Sn(),kw=Ro();Ff(x.prototype,nt.prototype);Ff(x,nt);var To=()=>{},{errorOrDestroy:Vt}=zt,Kt=1,Lw=2,Wf=4,Ar=8,$f=16,An=32,vn=64,Hf=128,Cw=256,Nw=512,Dw=1024,Po=2048,Mo=4096,Fw=8192,qw=16384,Uw=32768,Gf=65536,jw=1<<17,Ww=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}ko(xn.prototype,{objectMode:z(Kt),ended:z(Lw),endEmitted:z(Wf),reading:z(Ar),constructed:z($f),sync:z(An),needReadable:z(vn),emittedReadable:z(Hf),readableListening:z(Cw),resumeScheduled:z(Nw),errorEmitted:z(Dw),emitClose:z(Po),autoDestroy:z(Mo),destroyed:z(Fw),closed:z(qw),closeEmitted:z(Uw),multiAwaitDrain:z(Gf),readingMore:z(jw),dataEmitted:z(Ww)});function xn(t,e,r){typeof r!="boolean"&&(r=e instanceof Le()),this.state=Po|Mo|$f|An,t&&t.objectMode&&(this.state|=Kt),r&&t&&t.readableObjectMode&&(this.state|=Kt),this.highWaterMark=t?vw(this,t,"readableHighWaterMark",r):Rw(!1),this.buffer=new Aw,this.length=0,this.pipes=[],this.flowing=null,this[mt]=null,t&&t.emitClose===!1&&(this.state&=~Po),t&&t.autoDestroy===!1&&(this.state&=~Mo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new jf(t.encoding),this.encoding=t.encoding)}function x(t){if(!(this instanceof x))return new x(t);let e=this instanceof Le();this._readableState=new xn(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Sw(t.signal,this)),nt.call(this,t),zt.construct(this,()=>{this._readableState.needReadable&&Rn(this,this._readableState)})}x.prototype.destroy=zt.destroy;x.prototype._undestroy=zt.undestroy;x.prototype._destroy=function(t,e){e(t)};x.prototype[_w.captureRejectionSymbol]=function(t){this.destroy(t)};x.prototype[bw]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new Pw,this.destroy(t)),new qf((e,r)=>Uf(this,n=>n&&n!==t?r(n):e(null)))};x.prototype.push=function(t,e){return Vf(this,t,e,!1)};x.prototype.unshift=function(t,e){return Vf(this,t,e,!0)};function Vf(t,e,r,n){k("readableAddChunk",e);let i=t._readableState,o;if(i.state&Kt||(typeof e=="string"?(r=r||i.defaultEncoding,i.encoding!==r&&(n&&i.encoding?e=xo.from(e,r).toString(i.encoding):(e=xo.from(e,r),r=""))):e instanceof xo?r="":nt._isUint8Array(e)?(e=nt._uint8ArrayToBuffer(e),r=""):e!=null&&(o=new xw("chunk",["string","Buffer","Uint8Array"],e))),o)Vt(t,o);else if(e===null)i.state&=~Ar,Gw(t,i);else if(i.state&Kt||e&&e.length>0)if(n)if(i.state&Wf)Vt(t,new Bw);else{if(i.destroyed||i.errored)return!1;Io(t,i,e,!0)}else if(i.ended)Vt(t,new Ow);else{if(i.destroyed||i.errored)return!1;i.state&=~Ar,i.decoder&&!r?(e=i.decoder.write(e),i.objectMode||e.length!==0?Io(t,i,e,!1):Rn(t,i)):Io(t,i,e,!1)}else n||(i.state&=~Ar,Rn(t,i));return!i.ended&&(i.length<i.highWaterMark||i.length===0)}function Io(t,e,r,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Gf?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.state&vn&&Tn(t)),Rn(t,e)}x.prototype.isPaused=function(){let t=this._readableState;return t[mt]===!0||t.flowing===!1};x.prototype.setEncoding=function(t){let e=new jf(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let i of r)n+=e.write(i);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var $w=1073741824;function Hw(t){if(t>$w)throw new Iw("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function Df(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Kt?1:hw(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}x.prototype.read=function(t){k("read",t),t===void 0?t=NaN:dw(t)||(t=pw(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=Hw(t)),t!==0&&(e.state&=~Hf),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Oo(this):Tn(this),null;if(t=Df(t,e),t===0&&e.ended)return e.length===0&&Oo(this),null;let n=(e.state&vn)!==0;if(k("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,k("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,k("reading, ended or constructing",n);else if(n){k("do read"),e.state|=Ar|An,e.length===0&&(e.state|=vn);try{this._read(e.highWaterMark)}catch(o){Vt(this,o)}e.state&=~An,e.reading||(t=Df(r,e))}let i;return t>0?i=Xf(t,e):i=null,i===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&Oo(this)),i!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",i)),i};function Gw(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?Tn(t):(e.needReadable=!1,e.emittedReadable=!0,Kf(t))}}function Tn(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,Ee.nextTick(Kf,t))}function Kf(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Yf(t)}function Rn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ee.nextTick(Vw,t,e))}function Vw(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let r=e.length;if(k("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}x.prototype._read=function(t){throw new Tw("_read()")};x.prototype.pipe=function(t,e){let r=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new gw(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),k("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ee.stdout&&t!==Ee.stderr?s:A;n.endEmitted?Ee.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(S,R){k("onunpipe"),S===r&&R&&R.hasUnpiped===!1&&(R.hasUnpiped=!0,c())}function s(){k("onend"),t.end()}let l,f=!1;function c(){k("cleanup"),t.removeListener("close",E),t.removeListener("finish",w),l&&t.removeListener("drain",l),t.removeListener("error",h),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",A),r.removeListener("data",p),f=!0,l&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&l()}function u(){f||(n.pipes.length===1&&n.pipes[0]===t?(k("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(k("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),l||(l=Kw(r,t),t.on("drain",l))}r.on("data",p);function p(S){k("ondata");let R=t.write(S);k("dest.write",R),R===!1&&u()}function h(S){if(k("onerror",S),A(),t.removeListener("error",h),t.listenerCount("error")===0){let R=t._writableState||t._readableState;R&&!R.errorEmitted?Vt(t,S):t.emit("error",S)}}Ew(t,"error",h);function E(){t.removeListener("finish",w),A()}t.once("close",E);function w(){k("onfinish"),t.removeListener("close",E),A()}t.once("finish",w);function A(){k("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?u():n.flowing||(k("pipe resume"),r.resume()),t};function Kw(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(k("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(k("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}x.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let i=e.pipes;e.pipes=[],this.pause();for(let o=0;o<i.length;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=cw(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,r),this)};x.prototype.on=function(t,e){let r=nt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,k("on readable",n.length,n.reading),n.length?Tn(this):n.reading||Ee.nextTick(zw,this)),r};x.prototype.addListener=x.prototype.on;x.prototype.removeListener=function(t,e){let r=nt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ee.nextTick(zf,this),r};x.prototype.off=x.prototype.removeListener;x.prototype.removeAllListeners=function(t){let e=nt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ee.nextTick(zf,this),e};function zf(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[mt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function zw(t){k("readable nexttick read 0"),t.read(0)}x.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,Yw(this,t)),t[mt]=!1,this};function Yw(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ee.nextTick(Jw,t,e))}function Jw(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Yf(t),e.flowing&&!e.reading&&t.read(0)}x.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[mt]=!0,this};function Yf(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}x.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{Vt(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=yw(t);for(let n=1;n<r.length;n++){let i=r[n];this[i]===void 0&&typeof t[i]=="function"&&(this[i]=t[i].bind(t))}return this};x.prototype[ww]=function(){return Jf(this)};x.prototype.iterator=function(t){return t!==void 0&&Mw(t,"options"),Jf(this,t)};function Jf(t,e){typeof t.read!="function"&&(t=x.wrap(t,{objectMode:!0}));let r=Xw(t,e);return r.stream=t,r}async function*Xw(t,e){let r=To;function n(a){this===t?(r(),r=To):r=a}t.on("readable",n);let i,o=Uf(t,{writable:!1},a=>{i=a?Nf(i,a):null,r(),r=To});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(i)throw i;if(i===null)return;await new qf(n)}}}catch(a){throw i=Nf(i,a),i}finally{(i||e?.destroyOnReturn!==!1)&&(i===void 0||t._readableState.autoDestroy)?zt.destroyer(t,null):(t.off("readable",n),o())}}ko(x.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});ko(xn.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[mt]!==!1},set(t){this[mt]=!!t}}});x._fromList=Xf;function Xf(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=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 Oo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ee.nextTick(Qw,e,t))}function Qw(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ee.nextTick(Zw,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function Zw(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}x.from=function(t,e){return kw(x,t,e)};var Bo;function Qf(){return Bo===void 0&&(Bo={}),Bo}x.fromWeb=function(t,e){return Qf().newStreamReadableFromReadableStream(t,e)};x.toWeb=function(t,e){return Qf().newReadableStreamFromStreamReadable(t,e)};x.wrap=function(t,e){var r,n;return new x({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(i,o){zt.destroyer(t,i),o(i)}}).wrap(t)}});var Mn=_((gR,cu)=>{d();var _t=tt(),{ArrayPrototypeSlice:ru,Error:em,FunctionPrototypeSymbolHasInstance:nu,ObjectDefineProperty:iu,ObjectDefineProperties:tm,ObjectSetPrototypeOf:ou,StringPrototypeToLowerCase:rm,Symbol:nm,SymbolHasInstance:im}=$();cu.exports=H;H.WritableState=Tr;var{EventEmitter:om}=Te(),Rr=wn().Stream,{Buffer:In}=de(),Pn=bt(),{addAbortSignal:am}=_r(),{getHighWaterMark:sm,getDefaultHighWaterMark:lm}=Er(),{ERR_INVALID_ARG_TYPE:fm,ERR_METHOD_NOT_IMPLEMENTED:um,ERR_MULTIPLE_CALLBACK:au,ERR_STREAM_CANNOT_PIPE:cm,ERR_STREAM_DESTROYED:xr,ERR_STREAM_ALREADY_FINISHED:dm,ERR_STREAM_NULL_VALUES:hm,ERR_STREAM_WRITE_AFTER_END:pm,ERR_UNKNOWN_ENCODING:su}=ae().codes,{errorOrDestroy:Yt}=Pn;ou(H.prototype,Rr.prototype);ou(H,Rr);function No(){}var Jt=nm("kOnFinished");function Tr(t,e,r){typeof r!="boolean"&&(r=e instanceof Le()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?sm(this,t,"writableHighWaterMark",r):lm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=gm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Bn(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Jt]=[]}function Bn(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}Tr.prototype.getBuffer=function(){return ru(this.buffered,this.bufferedIndex)};iu(Tr.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function H(t){let e=this instanceof Le();if(!e&&!nu(H,this))return new H(t);this._writableState=new Tr(t,this,e),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),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&am(t.signal,this)),Rr.call(this,t),Pn.construct(this,()=>{let r=this._writableState;r.writing||Fo(this,r),qo(this,r)})}iu(H,im,{__proto__:null,value:function(t){return nu(this,t)?!0:this!==H?!1:t&&t._writableState instanceof Tr}});H.prototype.pipe=function(){Yt(this,new cm)};function lu(t,e,r,n){let i=t._writableState;if(typeof r=="function")n=r,r=i.defaultEncoding;else{if(!r)r=i.defaultEncoding;else if(r!=="buffer"&&!In.isEncoding(r))throw new su(r);typeof n!="function"&&(n=No)}if(e===null)throw new hm;if(!i.objectMode)if(typeof e=="string")i.decodeStrings!==!1&&(e=In.from(e,r),r="buffer");else if(e instanceof In)r="buffer";else if(Rr._isUint8Array(e))e=Rr._uint8ArrayToBuffer(e),r="buffer";else throw new fm("chunk",["string","Buffer","Uint8Array"],e);let o;return i.ending?o=new pm:i.destroyed&&(o=new xr("write")),o?(_t.nextTick(n,o),Yt(t,o,!0),o):(i.pendingcb++,ym(t,i,e,r,n))}H.prototype.write=function(t,e,r){return lu(this,t,e,r)===!0};H.prototype.cork=function(){this._writableState.corked++};H.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Fo(this,t))};H.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=rm(e)),!In.isEncoding(e))throw new su(e);return this._writableState.defaultEncoding=e,this};function ym(t,e,r,n,i){let o=e.objectMode?1:r.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:r,encoding:n,callback:i}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&i!==No&&(e.allNoop=!1)):(e.writelen=o,e.writecb=i,e.writing=!0,e.sync=!0,t._write(r,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}function eu(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new xr("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function tu(t,e,r,n){--e.pendingcb,n(r),Do(e),Yt(t,r)}function gm(t,e){let r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function"){Yt(t,new au);return}r.writing=!1,r.writecb=null,r.length-=r.writelen,r.writelen=0,e?(e.stack,r.errored||(r.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?_t.nextTick(tu,t,r,e,i):tu(t,r,e,i)):(r.buffered.length>r.bufferedIndex&&Fo(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===i?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:i,stream:t,state:r},_t.nextTick(bm,r.afterWriteTickInfo)):fu(t,r,1,i))}function bm({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,fu(t,e,r,n)}function fu(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&Do(e),qo(t,e)}function Do(t){if(t.writing)return;for(let i=t.bufferedIndex;i<t.buffered.length;++i){var e;let{chunk:o,callback:a}=t.buffered[i],s=t.objectMode?1:o.length;t.length-=s,a((e=t.errored)!==null&&e!==void 0?e:new xr("write"))}let r=t[Jt].splice(0);for(let i=0;i<r.length;i++){var n;r[i]((n=t.errored)!==null&&n!==void 0?n:new xr("end"))}Bn(t)}function Fo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:r,bufferedIndex:n,objectMode:i}=e,o=r.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let s=e.allNoop?No:f=>{for(let c=a;c<r.length;++c)r[c].callback(f)},l=e.allNoop&&a===0?r:ru(r,a);l.allBuffers=e.allBuffers,eu(t,e,!0,e.length,l,"",s),Bn(e)}else{do{let{chunk:s,encoding:l,callback:f}=r[a];r[a++]=null;let c=i?1:s.length;eu(t,e,!1,c,s,l,f)}while(a<r.length&&!e.writing);a===r.length?Bn(e):a>256?(r.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}H.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new um("_write()")};H.prototype._writev=null;H.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let i;if(t!=null){let o=lu(this,t,e);o instanceof em&&(i=o)}return n.corked&&(n.corked=1,this.uncork()),i||(!n.errored&&!n.ending?(n.ending=!0,qo(this,n,!0),n.ended=!0):n.finished?i=new dm("end"):n.destroyed&&(i=new xr("end"))),typeof r=="function"&&(i||n.finished?_t.nextTick(r,i):n[Jt].push(r)),this};function On(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function wm(t,e){let r=!1;function n(i){if(r){Yt(t,i??au());return}if(r=!0,e.pendingcb--,i){let o=e[Jt].splice(0);for(let a=0;a<o.length;a++)o[a](i);Yt(t,i,e.sync)}else On(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,_t.nextTick(Co,t,e))}e.sync=!0,e.pendingcb++;try{t._final(n)}catch(i){n(i)}e.sync=!1}function mm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,wm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}function qo(t,e,r){On(e)&&(mm(t,e),e.pendingcb===0&&(r?(e.pendingcb++,_t.nextTick((n,i)=>{On(i)?Co(n,i):i.pendingcb--},t,e)):On(e)&&(e.pendingcb++,Co(t,e))))}function Co(t,e){e.pendingcb--,e.finished=!0;let r=e[Jt].splice(0);for(let n=0;n<r.length;n++)r[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}tm(H.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var _m=Pn.destroy;H.prototype.destroy=function(t,e){let r=this._writableState;return!r.destroyed&&(r.bufferedIndex<r.buffered.length||r[Jt].length)&&_t.nextTick(Do,r),_m.call(this,t,e),this};H.prototype._undestroy=Pn.undestroy;H.prototype._destroy=function(t,e){e(t)};H.prototype[om.captureRejectionSymbol]=function(t){this.destroy(t)};var Lo;function uu(){return Lo===void 0&&(Lo={}),Lo}H.fromWeb=function(t,e){return uu().newStreamWritableFromWritableStream(t,e)};H.toWeb=function(t){return uu().newWritableStreamFromStreamWritable(t)}});var xu=_((wR,Ru)=>{d();var Uo=tt(),Em=de(),{isReadable:Sm,isWritable:Am,isIterable:du,isNodeStream:vm,isReadableNodeStream:hu,isWritableNodeStream:pu,isDuplexNodeStream:Rm,isReadableStream:yu,isWritableStream:gu}=Pe(),bu=He(),{AbortError:Au,codes:{ERR_INVALID_ARG_TYPE:xm,ERR_INVALID_RETURN_VALUE:wu}}=ae(),{destroyer:Qt}=bt(),Tm=Le(),vu=vr(),Im=Mn(),{createDeferredPromise:mu}=ie(),_u=Ro(),Eu=globalThis.Blob||Em.Blob,Om=typeof Eu<"u"?function(e){return e instanceof Eu}:function(e){return!1},Bm=globalThis.AbortController||(je(),wr(Ut)).AbortController,{FunctionPrototypeCall:Su}=$(),it=class extends Tm{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};Ru.exports=function t(e,r){if(Rm(e))return e;if(hu(e))return Xt({readable:e});if(pu(e))return Xt({writable:e});if(vm(e))return Xt({writable:!1,readable:!1});if(yu(e))return Xt({readable:vu.fromWeb(e)});if(gu(e))return Xt({writable:Im.fromWeb(e)});if(typeof e=="function"){let{value:i,write:o,final:a,destroy:s}=Pm(e);if(du(i))return _u(it,i,{objectMode:!0,write:o,final:a,destroy:s});let l=i?.then;if(typeof l=="function"){let f,c=Su(l,i,u=>{if(u!=null)throw new wu("nully","body",u)},u=>{Qt(f,u)});return f=new it({objectMode:!0,readable:!1,write:o,final(u){a(async()=>{try{await c,Uo.nextTick(u,null)}catch(p){Uo.nextTick(u,p)}})},destroy:s})}throw new wu("Iterable, AsyncIterable or AsyncFunction",r,i)}if(Om(e))return t(e.arrayBuffer());if(du(e))return _u(it,e,{objectMode:!0,writable:!1});if(yu(e?.readable)&&gu(e?.writable))return it.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let i=e!=null&&e.readable?hu(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?pu(e?.writable)?e?.writable:t(e.writable):void 0;return Xt({readable:i,writable:o})}let n=e?.then;if(typeof n=="function"){let i;return Su(n,e,o=>{o!=null&&i.push(o),i.push(null)},o=>{Qt(i,o)}),i=new it({objectMode:!0,writable:!1,read(){}})}throw new xm(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function Pm(t){let{promise:e,resolve:r}=mu(),n=new Bm,i=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:s,done:l,cb:f}=await a;if(Uo.nextTick(f),l)return;if(i.aborted)throw new Au(void 0,{cause:i.reason});({promise:e,resolve:r}=mu()),yield s}}(),{signal:i}),write(a,s,l){let f=r;r=null,f({chunk:a,done:!1,cb:l})},final(a){let s=r;r=null,s({done:!0,cb:a})},destroy(a,s){n.abort(),s(a)}}}function Xt(t){let e=t.readable&&typeof t.readable.read!="function"?vu.wrap(t.readable):t.readable,r=t.writable,n=!!Sm(e),i=!!Am(r),o,a,s,l,f;function c(u){let p=l;l=null,p?p(u):u&&f.destroy(u)}return f=new it({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:i}),i&&(bu(r,u=>{i=!1,u&&Qt(e,u),c(u)}),f._write=function(u,p,h){r.write(u,p)?h():o=h},f._final=function(u){r.end(),a=u},r.on("drain",function(){if(o){let u=o;o=null,u()}}),r.on("finish",function(){if(a){let u=a;a=null,u()}})),n&&(bu(e,u=>{n=!1,u&&Qt(e,u),c(u)}),e.on("readable",function(){if(s){let u=s;s=null,u()}}),e.on("end",function(){f.push(null)}),f._read=function(){for(;;){let u=e.read();if(u===null){s=f._read;return}if(!f.push(u))return}}),f._destroy=function(u,p){!u&&l!==null&&(u=new Au),s=null,o=null,a=null,l===null?p(u):(l=p,Qt(r,u),Qt(e,u))},f}});var Le=_((_R,Ou)=>{"use strict";d();var{ObjectDefineProperties:Mm,ObjectGetOwnPropertyDescriptor:Ge,ObjectKeys:km,ObjectSetPrototypeOf:Tu}=$();Ou.exports=Se;var $o=vr(),ge=Mn();Tu(Se.prototype,$o.prototype);Tu(Se,$o);{let t=km(ge.prototype);for(let e=0;e<t.length;e++){let r=t[e];Se.prototype[r]||(Se.prototype[r]=ge.prototype[r])}}function Se(t){if(!(this instanceof Se))return new Se(t);$o.call(this,t),ge.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}Mm(Se.prototype,{writable:{__proto__:null,...Ge(ge.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ge(ge.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ge(ge.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ge(ge.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ge(ge.prototype,"writableLength")},writableFinished:{__proto__:null,...Ge(ge.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ge(ge.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ge(ge.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ge(ge.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var jo;function Iu(){return jo===void 0&&(jo={}),jo}Se.fromWeb=function(t,e){return Iu().newStreamDuplexFromReadableWritablePair(t,e)};Se.toWeb=function(t){return Iu().newReadableWritablePairFromDuplex(t)};var Wo;Se.from=function(t){return Wo||(Wo=xu()),Wo(t,"body")}});var Vo=_((SR,Pu)=>{"use strict";d();var{ObjectSetPrototypeOf:Bu,Symbol:Lm}=$();Pu.exports=Ve;var{ERR_METHOD_NOT_IMPLEMENTED:Cm}=ae().codes,Go=Le(),{getHighWaterMark:Nm}=Er();Bu(Ve.prototype,Go.prototype);Bu(Ve,Go);var Ir=Lm("kCallback");function Ve(t){if(!(this instanceof Ve))return new Ve(t);let e=t?Nm(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),Go.call(this,t),this._readableState.sync=!1,this[Ir]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",Dm)}function Ho(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function Dm(){this._final!==Ho&&Ho.call(this)}Ve.prototype._final=Ho;Ve.prototype._transform=function(t,e,r){throw new Cm("_transform()")};Ve.prototype._write=function(t,e,r){let n=this._readableState,i=this._writableState,o=n.length;this._transform(t,e,(a,s)=>{if(a){r(a);return}s!=null&&this.push(s),i.ended||o===n.length||n.length<n.highWaterMark?r():this[Ir]=r})};Ve.prototype._read=function(){if(this[Ir]){let t=this[Ir];this[Ir]=null,t()}}});var zo=_((vR,ku)=>{"use strict";d();var{ObjectSetPrototypeOf:Mu}=$();ku.exports=Zt;var Ko=Vo();Mu(Zt.prototype,Ko.prototype);Mu(Zt,Ko);function Zt(t){if(!(this instanceof Zt))return new Zt(t);Ko.call(this,t)}Zt.prototype._transform=function(t,e,r){r(null,t)}});var Nn=_((xR,Fu)=>{d();var Or=tt(),{ArrayIsArray:Fm,Promise:qm,SymbolAsyncIterator:Um,SymbolDispose:jm}=$(),Cn=He(),{once:Wm}=ie(),$m=bt(),Lu=Le(),{aggregateTwoErrors:Hm,codes:{ERR_INVALID_ARG_TYPE:na,ERR_INVALID_RETURN_VALUE:Yo,ERR_MISSING_ARGS:Gm,ERR_STREAM_DESTROYED:Vm,ERR_STREAM_PREMATURE_CLOSE:Km},AbortError:zm}=ae(),{validateFunction:Ym,validateAbortSignal:Jm}=$t(),{isIterable:Et,isReadable:Jo,isReadableNodeStream:Ln,isNodeStream:Cu,isTransformStream:er,isWebStream:Xm,isReadableStream:Xo,isReadableFinished:Qm}=Pe(),Zm=globalThis.AbortController||(je(),wr(Ut)).AbortController,Qo,Zo,ea;function Nu(t,e,r){let n=!1;t.on("close",()=>{n=!0});let i=Cn(t,{readable:e,writable:r},o=>{n=!o});return{destroy:o=>{n||(n=!0,$m.destroyer(t,o||new Vm("pipe")))},cleanup:i}}function e0(t){return Ym(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function ta(t){if(Et(t))return t;if(Ln(t))return t0(t);throw new na("val",["Readable","Iterable","AsyncIterable"],t)}async function*t0(t){Zo||(Zo=vr()),yield*Zo.prototype[Um].call(t)}async function kn(t,e,r,{end:n}){let i,o=null,a=f=>{if(f&&(i=f),o){let c=o;o=null,c()}},s=()=>new qm((f,c)=>{i?c(i):o=()=>{i?c(i):f()}});e.on("drain",a);let l=Cn(e,{readable:!1},a);try{e.writableNeedDrain&&await s();for await(let f of t)e.write(f)||await s();n&&(e.end(),await s()),r()}catch(f){r(i!==f?Hm(i,f):f)}finally{l(),e.off("drain",a)}}async function ra(t,e,r,{end:n}){er(e)&&(e=e.writable);let i=e.getWriter();try{for await(let o of t)await i.ready,i.write(o).catch(()=>{});await i.ready,n&&await i.close(),r()}catch(o){try{await i.abort(o),r(o)}catch(a){r(a)}}}function r0(...t){return Du(t,Wm(e0(t)))}function Du(t,e,r){if(t.length===1&&Fm(t[0])&&(t=t[0]),t.length<2)throw new Gm("streams");let n=new Zm,i=n.signal,o=r?.signal,a=[];Jm(o,"options.signal");function s(){E(new zm)}ea=ea||ie().addAbortListener;let l;o&&(l=ea(o,s));let f,c,u=[],p=0;function h(M){E(M,--p===0)}function E(M,v){var I;if(M&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=M),!(!f&&!v)){for(;u.length;)u.shift()(f);(I=l)===null||I===void 0||I[jm](),n.abort(),v&&(f||a.forEach(j=>j()),Or.nextTick(e,f,c))}}let w;for(let M=0;M<t.length;M++){let v=t[M],I=M<t.length-1,j=M>0,F=I||r?.end!==!1,X=M===t.length-1;if(Cu(v)){let U=function(ee){ee&&ee.name!=="AbortError"&&ee.code!=="ERR_STREAM_PREMATURE_CLOSE"&&h(ee)};var R=U;if(F){let{destroy:ee,cleanup:qe}=Nu(v,I,j);u.push(ee),Jo(v)&&X&&a.push(qe)}v.on("error",U),Jo(v)&&X&&a.push(()=>{v.removeListener("error",U)})}if(M===0)if(typeof v=="function"){if(w=v({signal:i}),!Et(w))throw new Yo("Iterable, AsyncIterable or Stream","source",w)}else Et(v)||Ln(v)||er(v)?w=v:w=Lu.from(v);else if(typeof v=="function"){if(er(w)){var A;w=ta((A=w)===null||A===void 0?void 0:A.readable)}else w=ta(w);if(w=v(w,{signal:i}),I){if(!Et(w,!0))throw new Yo("AsyncIterable",`transform[${M-1}]`,w)}else{var S;Qo||(Qo=zo());let U=new Qo({objectMode:!0}),ee=(S=w)===null||S===void 0?void 0:S.then;if(typeof ee=="function")p++,ee.call(w,q=>{c=q,q!=null&&U.write(q),F&&U.end(),Or.nextTick(h)},q=>{U.destroy(q),Or.nextTick(h,q)});else if(Et(w,!0))p++,kn(w,U,h,{end:F});else if(Xo(w)||er(w)){let q=w.readable||w;p++,kn(q,U,h,{end:F})}else throw new Yo("AsyncIterable or Promise","destination",w);w=U;let{destroy:qe,cleanup:C}=Nu(w,!1,!0);u.push(qe),X&&a.push(C)}}else if(Cu(v)){if(Ln(w)){p+=2;let U=n0(w,v,h,{end:F});Jo(v)&&X&&a.push(U)}else if(er(w)||Xo(w)){let U=w.readable||w;p++,kn(U,v,h,{end:F})}else if(Et(w))p++,kn(w,v,h,{end:F});else throw new na("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],w);w=v}else if(Xm(v)){if(Ln(w))p++,ra(ta(w),v,h,{end:F});else if(Xo(w)||Et(w))p++,ra(w,v,h,{end:F});else if(er(w))p++,ra(w.readable,v,h,{end:F});else throw new na("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],w);w=v}else w=Lu.from(v)}return(i!=null&&i.aborted||o!=null&&o.aborted)&&Or.nextTick(s),w}function n0(t,e,r,{end:n}){let i=!1;if(e.on("close",()=>{i||r(new Km)}),t.pipe(e,{end:!1}),n){let a=function(){i=!0,e.end()};var o=a;Qm(t)?Or.nextTick(a):t.once("end",a)}else r();return Cn(t,{readable:!0,writable:!1},a=>{let s=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?t.once("end",r).once("error",r):r(a)}),Cn(e,{readable:!1,writable:!0},r)}Fu.exports={pipelineImpl:Du,pipeline:r0}});var oa=_((IR,Hu)=>{"use strict";d();var{pipeline:i0}=Nn(),Dn=Le(),{destroyer:o0}=bt(),{isNodeStream:Fn,isReadable:qu,isWritable:Uu,isWebStream:ia,isTransformStream:St,isWritableStream:ju,isReadableStream:Wu}=Pe(),{AbortError:a0,codes:{ERR_INVALID_ARG_VALUE:$u,ERR_MISSING_ARGS:s0}}=ae(),l0=He();Hu.exports=function(...e){if(e.length===0)throw new s0("streams");if(e.length===1)return Dn.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Dn.from(e[0])),typeof e[e.length-1]=="function"){let h=e.length-1;e[h]=Dn.from(e[h])}for(let h=0;h<e.length;++h)if(!(!Fn(e[h])&&!ia(e[h]))){if(h<e.length-1&&!(qu(e[h])||Wu(e[h])||St(e[h])))throw new $u(`streams[${h}]`,r[h],"must be readable");if(h>0&&!(Uu(e[h])||ju(e[h])||St(e[h])))throw new $u(`streams[${h}]`,r[h],"must be writable")}let n,i,o,a,s;function l(h){let E=a;a=null,E?E(h):h?s.destroy(h):!p&&!u&&s.destroy()}let f=e[0],c=i0(e,l),u=!!(Uu(f)||ju(f)||St(f)),p=!!(qu(c)||Wu(c)||St(c));if(s=new Dn({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(c!=null&&c.readableObjectMode),writable:u,readable:p}),u){if(Fn(f))s._write=function(E,w,A){f.write(E,w)?A():n=A},s._final=function(E){f.end(),i=E},f.on("drain",function(){if(n){let E=n;n=null,E()}});else if(ia(f)){let w=(St(f)?f.writable:f).getWriter();s._write=async function(A,S,R){try{await w.ready,w.write(A).catch(()=>{}),R()}catch(M){R(M)}},s._final=async function(A){try{await w.ready,w.close().catch(()=>{}),i=A}catch(S){A(S)}}}let h=St(c)?c.readable:c;l0(h,()=>{if(i){let E=i;i=null,E()}})}if(p){if(Fn(c))c.on("readable",function(){if(o){let h=o;o=null,h()}}),c.on("end",function(){s.push(null)}),s._read=function(){for(;;){let h=c.read();if(h===null){o=s._read;return}if(!s.push(h))return}};else if(ia(c)){let E=(St(c)?c.readable:c).getReader();s._read=async function(){for(;;)try{let{value:w,done:A}=await E.read();if(!s.push(w))return;if(A){s.push(null);return}}catch{return}}}}return s._destroy=function(h,E){!h&&a!==null&&(h=new a0),o=null,n=null,i=null,a===null?E(h):(a=E,Fn(c)&&o0(c,h))},s}});var ec=_((BR,la)=>{"use strict";d();var f0=globalThis.AbortController||(je(),wr(Ut)).AbortController,{codes:{ERR_INVALID_ARG_VALUE:u0,ERR_INVALID_ARG_TYPE:Br,ERR_MISSING_ARGS:c0,ERR_OUT_OF_RANGE:d0},AbortError:Ce}=ae(),{validateAbortSignal:At,validateInteger:Gu,validateObject:vt}=$t(),h0=$().Symbol("kWeak"),p0=$().Symbol("kResistStopPropagation"),{finished:y0}=He(),g0=oa(),{addAbortSignalNoValidate:b0}=_r(),{isWritable:w0,isNodeStream:m0}=Pe(),{deprecate:_0}=ie(),{ArrayPrototypePush:E0,Boolean:S0,MathFloor:Vu,Number:A0,NumberIsNaN:v0,Promise:Ku,PromiseReject:zu,PromiseResolve:R0,PromisePrototypeThen:Yu,Symbol:Xu}=$(),qn=Xu("kEmpty"),Ju=Xu("kEof");function x0(t,e){if(e!=null&&vt(e,"options"),e?.signal!=null&&At(e.signal,"options.signal"),m0(t)&&!w0(t))throw new u0("stream",t,"must be writable");let r=g0(this,t);return e!=null&&e.signal&&b0(e.signal,r),r}function Un(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);e!=null&&vt(e,"options"),e?.signal!=null&&At(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=Vu(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=Vu(e.highWaterMark)),Gu(r,"options.concurrency",1),Gu(n,"options.highWaterMark",0),n+=r,async function*(){let o=ie().AbortSignalAny([e?.signal].filter(S0)),a=this,s=[],l={signal:o},f,c,u=!1,p=0;function h(){u=!0,E()}function E(){p-=1,w()}function w(){c&&!u&&p<r&&s.length<n&&(c(),c=null)}async function A(){try{for await(let S of a){if(u)return;if(o.aborted)throw new Ce;try{if(S=t(S,l),S===qn)continue;S=R0(S)}catch(R){S=zu(R)}p+=1,Yu(S,E,h),s.push(S),f&&(f(),f=null),!u&&(s.length>=n||p>=r)&&await new Ku(R=>{c=R})}s.push(Ju)}catch(S){let R=zu(S);Yu(R,E,h),s.push(R)}finally{u=!0,f&&(f(),f=null)}}A();try{for(;;){for(;s.length>0;){let S=await s[0];if(S===Ju)return;if(o.aborted)throw new Ce;S!==qn&&(yield S),s.shift(),w()}await new Ku(S=>{f=S})}}finally{u=!0,c&&(c(),c=null)}}.call(this)}function T0(t=void 0){return t!=null&&vt(t,"options"),t?.signal!=null&&At(t.signal,"options.signal"),async function*(){let r=0;for await(let i of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ce({cause:t.signal.reason});yield[r++,i]}}.call(this)}async function Qu(t,e=void 0){for await(let r of sa.call(this,t,e))return!0;return!1}async function I0(t,e=void 0){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);return!await Qu.call(this,async(...r)=>!await t(...r),e)}async function O0(t,e){for await(let r of sa.call(this,t,e))return r}async function B0(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i),qn}for await(let n of Un.call(this,r,e));}function sa(t,e){if(typeof t!="function")throw new Br("fn",["Function","AsyncFunction"],t);async function r(n,i){return await t(n,i)?n:qn}return Un.call(this,r,e)}var aa=class extends c0{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function P0(t,e,r){var n;if(typeof t!="function")throw new Br("reducer",["Function","AsyncFunction"],t);r!=null&&vt(r,"options"),r?.signal!=null&&At(r.signal,"options.signal");let i=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let f=new Ce(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await y0(this.destroy(f)),f}let o=new f0,a=o.signal;if(r!=null&&r.signal){let f={once:!0,[h0]:this,[p0]:!0};r.signal.addEventListener("abort",()=>o.abort(),f)}let s=!1;try{for await(let f of this){var l;if(s=!0,r!=null&&(l=r.signal)!==null&&l!==void 0&&l.aborted)throw new Ce;i?e=await t(e,f,{signal:a}):(e=f,i=!0)}if(!s&&!i)throw new aa}finally{o.abort()}return e}async function M0(t){t!=null&&vt(t,"options"),t?.signal!=null&&At(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new Ce(void 0,{cause:t.signal.reason});E0(e,n)}return e}function k0(t,e){let r=Un.call(this,t,e);return async function*(){for await(let i of r)yield*i}.call(this)}function Zu(t){if(t=A0(t),v0(t))return 0;if(t<0)throw new d0("number",">= 0",t);return t}function L0(t,e=void 0){return e!=null&&vt(e,"options"),e?.signal!=null&&At(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ce;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ce;t--<=0&&(yield o)}}.call(this)}function C0(t,e=void 0){return e!=null&&vt(e,"options"),e?.signal!=null&&At(e.signal,"options.signal"),t=Zu(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ce;for await(let o of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new Ce;if(t-- >0&&(yield o),t<=0)return}}.call(this)}la.exports.streamReturningOperators={asIndexedPairs:_0(T0,"readable.asIndexedPairs will be removed in a future version."),drop:L0,filter:sa,flatMap:k0,map:Un,take:C0,compose:x0};la.exports.promiseReturningOperators={every:I0,forEach:B0,reduce:P0,toArray:M0,some:Qu,find:O0}});var fa=_((MR,tc)=>{"use strict";d();var{ArrayPrototypePop:N0,Promise:D0}=$(),{isIterable:F0,isNodeStream:q0,isWebStream:U0}=Pe(),{pipelineImpl:j0}=Nn(),{finished:W0}=He();ua();function $0(...t){return new D0((e,r)=>{let n,i,o=t[t.length-1];if(o&&typeof o=="object"&&!q0(o)&&!F0(o)&&!U0(o)){let a=N0(t);n=a.signal,i=a.end}j0(t,(a,s)=>{a?r(a):e(s)},{signal:n,end:i})})}tc.exports={finished:W0,pipeline:$0}});var ua=_((LR,uc)=>{d();var{Buffer:H0}=de(),{ObjectDefineProperty:Ke,ObjectKeys:ic,ReflectApply:oc}=$(),{promisify:{custom:ac}}=ie(),{streamReturningOperators:rc,promiseReturningOperators:nc}=ec(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:sc}}=ae(),G0=oa(),{setDefaultHighWaterMark:V0,getDefaultHighWaterMark:K0}=Er(),{pipeline:lc}=Nn(),{destroyer:z0}=bt(),fc=He(),ca=fa(),Pr=Pe(),W=uc.exports=wn().Stream;W.isDestroyed=Pr.isDestroyed;W.isDisturbed=Pr.isDisturbed;W.isErrored=Pr.isErrored;W.isReadable=Pr.isReadable;W.isWritable=Pr.isWritable;W.Readable=vr();for(let t of ic(rc)){let r=function(...n){if(new.target)throw sc();return W.Readable.from(oc(e,this,n))};da=r;let e=rc[t];Ke(r,"name",{__proto__:null,value:e.name}),Ke(r,"length",{__proto__:null,value:e.length}),Ke(W.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var da;for(let t of ic(nc)){let r=function(...i){if(new.target)throw sc();return oc(e,this,i)};da=r;let e=nc[t];Ke(r,"name",{__proto__:null,value:e.name}),Ke(r,"length",{__proto__:null,value:e.length}),Ke(W.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var da;W.Writable=Mn();W.Duplex=Le();W.Transform=Vo();W.PassThrough=zo();W.pipeline=lc;var{addAbortSignal:Y0}=_r();W.addAbortSignal=Y0;W.finished=fc;W.destroy=z0;W.compose=G0;W.setDefaultHighWaterMark=V0;W.getDefaultHighWaterMark=K0;Ke(W,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ca}});Ke(lc,ac,{__proto__:null,enumerable:!0,get(){return ca.pipeline}});Ke(fc,ac,{__proto__:null,enumerable:!0,get(){return ca.finished}});W.Stream=W;W._isUint8Array=function(e){return e instanceof Uint8Array};W._uint8ArrayToBuffer=function(e){return H0.from(e.buffer,e.byteOffset,e.byteLength)}});var Rt=_((NR,O)=>{"use strict";d();var Y=Rt();if(Y&&g.env.READABLE_STREAM==="disable"){let t=Y.promises;O.exports._uint8ArrayToBuffer=Y._uint8ArrayToBuffer,O.exports._isUint8Array=Y._isUint8Array,O.exports.isDisturbed=Y.isDisturbed,O.exports.isErrored=Y.isErrored,O.exports.isReadable=Y.isReadable,O.exports.Readable=Y.Readable,O.exports.Writable=Y.Writable,O.exports.Duplex=Y.Duplex,O.exports.Transform=Y.Transform,O.exports.PassThrough=Y.PassThrough,O.exports.addAbortSignal=Y.addAbortSignal,O.exports.finished=Y.finished,O.exports.destroy=Y.destroy,O.exports.pipeline=Y.pipeline,O.exports.compose=Y.compose,Object.defineProperty(Y,"promises",{configurable:!0,enumerable:!0,get(){return t}}),O.exports.Stream=Y.Stream}else{let t=ua(),e=fa(),r=t.Readable.destroy;O.exports=t.Readable,O.exports._uint8ArrayToBuffer=t._uint8ArrayToBuffer,O.exports._isUint8Array=t._isUint8Array,O.exports.isDisturbed=t.isDisturbed,O.exports.isErrored=t.isErrored,O.exports.isReadable=t.isReadable,O.exports.Readable=t.Readable,O.exports.Writable=t.Writable,O.exports.Duplex=t.Duplex,O.exports.Transform=t.Transform,O.exports.PassThrough=t.PassThrough,O.exports.addAbortSignal=t.addAbortSignal,O.exports.finished=t.finished,O.exports.destroy=t.destroy,O.exports.destroy=r,O.exports.pipeline=t.pipeline,O.exports.compose=t.compose,Object.defineProperty(t,"promises",{configurable:!0,enumerable:!0,get(){return e}}),O.exports.Stream=t.Stream}O.exports.default=O.exports});var hc=_((FR,dc)=>{d();dc.exports=cc;function cc(t,e){if(t&&e)return cc(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(n){r[n]=t[n]}),r;function r(){for(var n=new Array(arguments.length),i=0;i<n.length;i++)n[i]=arguments[i];var o=t.apply(this,n),a=n[n.length-1];return typeof o=="function"&&o!==a&&Object.keys(a).forEach(function(s){o[s]=a[s]}),o}}});var pa=_((UR,ha)=>{d();var pc=hc();ha.exports=pc(jn);ha.exports.strict=pc(yc);jn.proto=jn(function(){Object.defineProperty(Function.prototype,"once",{value:function(){return jn(this)},configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:function(){return yc(this)},configurable:!0})});function jn(t){var e=function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))};return e.called=!1,e}function yc(t){var e=function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}});var ya=_((WR,bc)=>{d();var J0=pa(),X0=function(){},Q0=function(t){return t.setHeader&&typeof t.abort=="function"},Z0=function(t){return t.stdio&&Array.isArray(t.stdio)&&t.stdio.length===3},gc=function(t,e,r){if(typeof e=="function")return gc(t,null,e);e||(e={}),r=J0(r||X0);var n=t._writableState,i=t._readableState,o=e.readable||e.readable!==!1&&t.readable,a=e.writable||e.writable!==!1&&t.writable,s=!1,l=function(){t.writable||f()},f=function(){a=!1,o||r.call(t)},c=function(){o=!1,a||r.call(t)},u=function(A){r.call(t,A?new Error("exited with error code: "+A):null)},p=function(A){r.call(t,A)},h=function(){g.nextTick(E)},E=function(){if(!s){if(o&&!(i&&i.ended&&!i.destroyed))return r.call(t,new Error("premature close"));if(a&&!(n&&n.ended&&!n.destroyed))return r.call(t,new Error("premature close"))}},w=function(){t.req.on("finish",f)};return Q0(t)?(t.on("complete",f),t.on("abort",h),t.req?w():t.on("request",w)):a&&!n&&(t.on("end",l),t.on("close",l)),Z0(t)&&t.on("exit",u),t.on("end",c),t.on("finish",f),e.error!==!1&&t.on("error",p),t.on("close",h),function(){s=!0,t.removeListener("complete",f),t.removeListener("abort",h),t.removeListener("request",w),t.req&&t.req.removeListener("finish",f),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",f),t.removeListener("exit",u),t.removeListener("end",c),t.removeListener("error",p),t.removeListener("close",h)}};bc.exports=gc});var wc=_(()=>{d()});var Ec=_((KR,_c)=>{d();var e_=pa(),t_=ya(),ga=wc(),Mr=function(){},r_=/^v?\.0/.test(g.version),Wn=function(t){return typeof t=="function"},n_=function(t){return!r_||!ga?!1:(t instanceof(ga.ReadStream||Mr)||t instanceof(ga.WriteStream||Mr))&&Wn(t.close)},i_=function(t){return t.setHeader&&Wn(t.abort)},o_=function(t,e,r,n){n=e_(n);var i=!1;t.on("close",function(){i=!0}),t_(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,n_(t))return t.close(Mr);if(i_(t))return t.abort();if(Wn(t.destroy))return t.destroy();n(a||new Error("stream was destroyed"))}}},mc=function(t){t()},a_=function(t,e){return t.pipe(e)},s_=function(){var t=Array.prototype.slice.call(arguments),e=Wn(t[t.length-1]||Mr)&&t.pop()||Mr;if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Error("pump requires two streams per minimum");var r,n=t.map(function(i,o){var a=o<t.length-1,s=o>0;return o_(i,a,s,function(l){r||(r=l),l&&n.forEach(mc),!a&&(n.forEach(mc),e(r))})});return t.reduce(a_)};_c.exports=s_});var ze=_((YR,ba)=>{d();typeof Object.create=="function"?ba.exports=function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:ba.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 wa=_((XR,Sc)=>{d();Sc.exports=Te().EventEmitter});var ma=_(()=>{d()});var Ic=_((r1,Tc)=>{"use strict";d();function Ac(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 vc(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?Ac(Object(r),!0).forEach(function(n){l_(t,n,r[n])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):Ac(Object(r)).forEach(function(n){Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(r,n))})}return t}function l_(t,e,r){return e=xc(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function f_(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Rc(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,xc(n.key),n)}}function u_(t,e,r){return e&&Rc(t.prototype,e),r&&Rc(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function xc(t){var e=c_(t,"string");return typeof e=="symbol"?e:String(e)}function c_(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var d_=de(),$n=d_.Buffer,h_=ma(),_a=h_.inspect,p_=_a&&_a.custom||"inspect";function y_(t,e,r){$n.prototype.copy.call(t,e,r)}Tc.exports=function(){function t(){f_(this,t),this.head=null,this.tail=null,this.length=0}return u_(t,[{key:"push",value:function(r){var n={data:r,next:null};this.length>0?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 $n.alloc(0);for(var n=$n.allocUnsafe(r>>>0),i=this.head,o=0;i;)y_(i.data,n,o),o+=i.data.length,i=i.next;return n}},{key:"consume",value:function(r,n){var i;return r<this.head.data.length?(i=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?i=this.shift():i=n?this._getString(r):this._getBuffer(r),i}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(r){var n=this.head,i=1,o=n.data;for(r-=o.length;n=n.next;){var a=n.data,s=r>a.length?a.length:r;if(s===a.length?o+=a:o+=a.slice(0,r),r-=s,r===0){s===a.length?(++i,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=a.slice(s));break}++i}return this.length-=i,o}},{key:"_getBuffer",value:function(r){var n=$n.allocUnsafe(r),i=this.head,o=1;for(i.data.copy(n),r-=i.data.length;i=i.next;){var a=i.data,s=r>a.length?a.length:r;if(a.copy(n,n.length-r,0,s),r-=s,r===0){s===a.length?(++o,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=a.slice(s));break}++o}return this.length-=o,n}},{key:p_,value:function(r,n){return _a(this,vc(vc({},n),{},{depth:0,customInspect:!1}))}}]),t}()});var Sa=_((i1,Bc)=>{"use strict";d();function g_(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,g.nextTick(Ea,this,t)):g.nextTick(Ea,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?g.nextTick(Hn,r):(r._writableState.errorEmitted=!0,g.nextTick(Oc,r,o)):g.nextTick(Oc,r,o):e?(g.nextTick(Hn,r),e(o)):g.nextTick(Hn,r)}),this)}function Oc(t,e){Ea(t,e),Hn(t)}function Hn(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function b_(){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 Ea(t,e){t.emit("error",e)}function w_(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}Bc.exports={destroy:g_,undestroy:b_,errorOrDestroy:w_}});var xt=_((a1,kc)=>{"use strict";d();function m_(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var Mc={};function be(t,e,r){r||(r=Error);function n(o,a,s){return typeof e=="string"?e:e(o,a,s)}var i=function(o){m_(a,o);function a(s,l,f){return o.call(this,n(s,l,f))||this}return a}(r);i.prototype.name=r.name,i.prototype.code=t,Mc[t]=i}function Pc(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 __(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}function E_(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function S_(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}be("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);be("ERR_INVALID_ARG_TYPE",function(t,e,r){var n;typeof e=="string"&&__(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be";var i;if(E_(t," argument"))i="The ".concat(t," ").concat(n," ").concat(Pc(e,"type"));else{var o=S_(t,".")?"property":"argument";i='The "'.concat(t,'" ').concat(o," ").concat(n," ").concat(Pc(e,"type"))}return i+=". Received type ".concat(typeof r),i},TypeError);be("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");be("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});be("ERR_STREAM_PREMATURE_CLOSE","Premature close");be("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});be("ERR_MULTIPLE_CALLBACK","Callback called multiple times");be("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");be("ERR_STREAM_WRITE_AFTER_END","write after end");be("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);be("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);be("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");kc.exports.codes=Mc});var Aa=_((l1,Lc)=>{"use strict";d();var A_=xt().codes.ERR_INVALID_OPT_VALUE;function v_(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function R_(t,e,r,n){var i=v_(e,n,r);if(i!=null){if(!(isFinite(i)&&Math.floor(i)===i)||i<0){var o=n?r:"highWaterMark";throw new A_(o,i)}return Math.floor(i)}return t.objectMode?16:16*1024}Lc.exports={getHighWaterMark:R_}});var Nc=_((u1,Cc)=>{d();Cc.exports=x_;function x_(t,e){if(va("noDeprecation"))return t;var r=!1;function n(){if(!r){if(va("throwDeprecation"))throw new Error(e);va("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return n}function va(t){try{if(!m.localStorage)return!1}catch{return!1}var e=m.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}});var Ta=_((d1,Wc)=>{"use strict";d();Wc.exports=V;function Fc(t){var e=this;this.next=null,this.entry=null,this.finish=function(){Z_(e,t)}}var tr;V.WritableState=Lr;var T_={deprecate:Nc()},qc=wa(),Vn=de().Buffer,I_=(typeof m<"u"?m:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function O_(t){return Vn.from(t)}function B_(t){return Vn.isBuffer(t)||t instanceof I_}var xa=Sa(),P_=Aa(),M_=P_.getHighWaterMark,ot=xt().codes,k_=ot.ERR_INVALID_ARG_TYPE,L_=ot.ERR_METHOD_NOT_IMPLEMENTED,C_=ot.ERR_MULTIPLE_CALLBACK,N_=ot.ERR_STREAM_CANNOT_PIPE,D_=ot.ERR_STREAM_DESTROYED,F_=ot.ERR_STREAM_NULL_VALUES,q_=ot.ERR_STREAM_WRITE_AFTER_END,U_=ot.ERR_UNKNOWN_ENCODING,rr=xa.errorOrDestroy;ze()(V,qc);function j_(){}function Lr(t,e,r){tr=tr||Tt(),t=t||{},typeof r!="boolean"&&(r=e instanceof tr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=M_(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){z_(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 Fc(this)}Lr.prototype.getBuffer=function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r};(function(){try{Object.defineProperty(Lr.prototype,"buffer",{get:T_.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var Gn;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(Gn=Function.prototype[Symbol.hasInstance],Object.defineProperty(V,Symbol.hasInstance,{value:function(e){return Gn.call(this,e)?!0:this!==V?!1:e&&e._writableState instanceof Lr}})):Gn=function(e){return e instanceof this};function V(t){tr=tr||Tt();var e=this instanceof tr;if(!e&&!Gn.call(V,this))return new V(t);this._writableState=new Lr(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)),qc.call(this)}V.prototype.pipe=function(){rr(this,new N_)};function W_(t,e){var r=new q_;rr(t,r),g.nextTick(e,r)}function $_(t,e,r,n){var i;return r===null?i=new F_:typeof r!="string"&&!e.objectMode&&(i=new k_("chunk",["string","Buffer"],r)),i?(rr(t,i),g.nextTick(n,i),!1):!0}V.prototype.write=function(t,e,r){var n=this._writableState,i=!1,o=!n.objectMode&&B_(t);return o&&!Vn.isBuffer(t)&&(t=O_(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=n.defaultEncoding),typeof r!="function"&&(r=j_),n.ending?W_(this,r):(o||$_(this,n,t,r))&&(n.pendingcb++,i=G_(this,n,o,t,e,r)),i};V.prototype.cork=function(){this._writableState.corked++};V.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Uc(this,t))};V.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 U_(e);return this._writableState.defaultEncoding=e,this};Object.defineProperty(V.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function H_(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=Vn.from(e,r)),e}Object.defineProperty(V.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function G_(t,e,r,n,i,o){if(!r){var a=H_(e,n,i);n!==a&&(r=!0,i="buffer",n=a)}var s=e.objectMode?1:n.length;e.length+=s;var l=e.length<e.highWaterMark;if(l||(e.needDrain=!0),e.writing||e.corked){var f=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},f?f.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else Ra(t,e,!1,s,n,i,o);return l}function Ra(t,e,r,n,i,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new D_("write")):r?t._writev(i,e.onwrite):t._write(i,o,e.onwrite),e.sync=!1}function V_(t,e,r,n,i){--e.pendingcb,r?(g.nextTick(i,n),g.nextTick(kr,t,e),t._writableState.errorEmitted=!0,rr(t,n)):(i(n),t._writableState.errorEmitted=!0,rr(t,n),kr(t,e))}function K_(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function z_(t,e){var r=t._writableState,n=r.sync,i=r.writecb;if(typeof i!="function")throw new C_;if(K_(r),e)V_(t,r,n,e,i);else{var o=jc(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Uc(t,r),n?g.nextTick(Dc,t,r,o,i):Dc(t,r,o,i)}}function Dc(t,e,r,n){r||Y_(t,e),e.pendingcb--,n(),kr(t,e)}function Y_(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function Uc(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),o=e.corkedRequestsFree;o.entry=r;for(var a=0,s=!0;r;)i[a]=r,r.isBuf||(s=!1),r=r.next,a+=1;i.allBuffers=s,Ra(t,e,!0,e.length,i,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Fc(e),e.bufferedRequestCount=0}else{for(;r;){var l=r.chunk,f=r.encoding,c=r.callback,u=e.objectMode?1:l.length;if(Ra(t,e,!1,u,l,f,c),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}V.prototype._write=function(t,e,r){r(new L_("_write()"))};V.prototype._writev=null;V.prototype.end=function(t,e,r){var n=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||Q_(this,n,r),this};Object.defineProperty(V.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function jc(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}function J_(t,e){t._final(function(r){e.pendingcb--,r&&rr(t,r),e.prefinished=!0,t.emit("prefinish"),kr(t,e)})}function X_(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,g.nextTick(J_,t,e)):(e.prefinished=!0,t.emit("prefinish")))}function kr(t,e){var r=jc(e);if(r&&(X_(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function Q_(t,e,r){e.ending=!0,kr(t,e),r&&(e.finished?g.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}function Z_(t,e,r){var n=t.entry;for(t.entry=null;n;){var i=n.callback;e.pendingcb--,i(r),n=n.next}e.corkedRequestsFree.next=t}Object.defineProperty(V.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}});V.prototype.destroy=xa.destroy;V.prototype._undestroy=xa.undestroy;V.prototype._destroy=function(t,e){e(t)}});var Tt=_((p1,Hc)=>{"use strict";d();var eE=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Hc.exports=Ne;var $c=Ba(),Oa=Ta();ze()(Ne,$c);for(Ia=eE(Oa.prototype),Kn=0;Kn<Ia.length;Kn++)zn=Ia[Kn],Ne.prototype[zn]||(Ne.prototype[zn]=Oa.prototype[zn]);var Ia,zn,Kn;function Ne(t){if(!(this instanceof Ne))return new Ne(t);$c.call(this,t),Oa.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",tE)))}Object.defineProperty(Ne.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});Object.defineProperty(Ne.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});Object.defineProperty(Ne.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function tE(){this._writableState.ended||g.nextTick(rE,this)}function rE(t){t.end()}Object.defineProperty(Ne.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)}})});var Yn=_((g1,Kc)=>{"use strict";d();var Gc=xt().codes.ERR_STREAM_PREMATURE_CLOSE;function nE(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];t.apply(this,n)}}}function iE(){}function oE(t){return t.setHeader&&typeof t.abort=="function"}function Vc(t,e,r){if(typeof e=="function")return Vc(t,null,e);e||(e={}),r=nE(r||iE);var n=e.readable||e.readable!==!1&&t.readable,i=e.writable||e.writable!==!1&&t.writable,o=function(){t.writable||s()},a=t._writableState&&t._writableState.finished,s=function(){i=!1,a=!0,n||r.call(t)},l=t._readableState&&t._readableState.endEmitted,f=function(){n=!1,l=!0,i||r.call(t)},c=function(E){r.call(t,E)},u=function(){var E;if(n&&!l)return(!t._readableState||!t._readableState.ended)&&(E=new Gc),r.call(t,E);if(i&&!a)return(!t._writableState||!t._writableState.ended)&&(E=new Gc),r.call(t,E)},p=function(){t.req.on("finish",s)};return oE(t)?(t.on("complete",s),t.on("abort",u),t.req?p():t.on("request",p)):i&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",f),t.on("finish",s),e.error!==!1&&t.on("error",c),t.on("close",u),function(){t.removeListener("complete",s),t.removeListener("abort",u),t.removeListener("request",p),t.req&&t.req.removeListener("finish",s),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",s),t.removeListener("end",f),t.removeListener("error",c),t.removeListener("close",u)}}Kc.exports=Vc});var Yc=_((w1,zc)=>{"use strict";d();var Jn;function at(t,e,r){return e=aE(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function aE(t){var e=sE(t,"string");return typeof e=="symbol"?e:String(e)}function sE(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var n=r.call(t,e||"default");if(typeof n!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}var lE=Yn(),st=Symbol("lastResolve"),It=Symbol("lastReject"),Cr=Symbol("error"),Xn=Symbol("ended"),Ot=Symbol("lastPromise"),Pa=Symbol("handlePromise"),Bt=Symbol("stream");function lt(t,e){return{value:t,done:e}}function fE(t){var e=t[st];if(e!==null){var r=t[Bt].read();r!==null&&(t[Ot]=null,t[st]=null,t[It]=null,e(lt(r,!1)))}}function uE(t){g.nextTick(fE,t)}function cE(t,e){return function(r,n){t.then(function(){if(e[Xn]){r(lt(void 0,!0));return}e[Pa](r,n)},n)}}var dE=Object.getPrototypeOf(function(){}),hE=Object.setPrototypeOf((Jn={get stream(){return this[Bt]},next:function(){var e=this,r=this[Cr];if(r!==null)return Promise.reject(r);if(this[Xn])return Promise.resolve(lt(void 0,!0));if(this[Bt].destroyed)return new Promise(function(a,s){g.nextTick(function(){e[Cr]?s(e[Cr]):a(lt(void 0,!0))})});var n=this[Ot],i;if(n)i=new Promise(cE(n,this));else{var o=this[Bt].read();if(o!==null)return Promise.resolve(lt(o,!1));i=new Promise(this[Pa])}return this[Ot]=i,i}},at(Jn,Symbol.asyncIterator,function(){return this}),at(Jn,"return",function(){var e=this;return new Promise(function(r,n){e[Bt].destroy(null,function(i){if(i){n(i);return}r(lt(void 0,!0))})})}),Jn),dE),pE=function(e){var r,n=Object.create(hE,(r={},at(r,Bt,{value:e,writable:!0}),at(r,st,{value:null,writable:!0}),at(r,It,{value:null,writable:!0}),at(r,Cr,{value:null,writable:!0}),at(r,Xn,{value:e._readableState.endEmitted,writable:!0}),at(r,Pa,{value:function(o,a){var s=n[Bt].read();s?(n[Ot]=null,n[st]=null,n[It]=null,o(lt(s,!1))):(n[st]=o,n[It]=a)},writable:!0}),r));return n[Ot]=null,lE(e,function(i){if(i&&i.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=n[It];o!==null&&(n[Ot]=null,n[st]=null,n[It]=null,o(i)),n[Cr]=i;return}var a=n[st];a!==null&&(n[Ot]=null,n[st]=null,n[It]=null,a(lt(void 0,!0))),n[Xn]=!0}),e.on("readable",uE.bind(null,n)),n};zc.exports=pE});var Xc=_((_1,Jc)=>{d();Jc.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ba=_((A1,sd)=>{"use strict";d();sd.exports=N;var nr;N.ReadableState=td;var S1=Te().EventEmitter,ed=function(e,r){return e.listeners(r).length},Dr=wa(),Qn=de().Buffer,yE=(typeof m<"u"?m:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function gE(t){return Qn.from(t)}function bE(t){return Qn.isBuffer(t)||t instanceof yE}var Ma=ma(),T;Ma&&Ma.debuglog?T=Ma.debuglog("stream"):T=function(){};var wE=Ic(),qa=Sa(),mE=Aa(),_E=mE.getHighWaterMark,Zn=xt().codes,EE=Zn.ERR_INVALID_ARG_TYPE,SE=Zn.ERR_STREAM_PUSH_AFTER_EOF,AE=Zn.ERR_METHOD_NOT_IMPLEMENTED,vE=Zn.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,ir,ka,La;ze()(N,Dr);var Nr=qa.errorOrDestroy,Ca=["error","close","destroy","pause","resume"];function RE(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 td(t,e,r){nr=nr||Tt(),t=t||{},typeof r!="boolean"&&(r=e instanceof nr),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=_E(this,t,"readableHighWaterMark",r),this.buffer=new wE,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&&(ir||(ir=Sn().StringDecoder),this.decoder=new ir(t.encoding),this.encoding=t.encoding)}function N(t){if(nr=nr||Tt(),!(this instanceof N))return new N(t);var e=this instanceof nr;this._readableState=new td(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Dr.call(this)}Object.defineProperty(N.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}});N.prototype.destroy=qa.destroy;N.prototype._undestroy=qa.undestroy;N.prototype._destroy=function(t,e){e(t)};N.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=Qn.from(t,e),e=""),n=!0),rd(this,t,e,!1,n)};N.prototype.unshift=function(t){return rd(this,t,null,!0,!1)};function rd(t,e,r,n,i){T("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,IE(t,o);else{var a;if(i||(a=xE(o,e)),a)Nr(t,a);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Qn.prototype&&(e=gE(e)),n)o.endEmitted?Nr(t,new vE):Na(t,o,e,!0);else if(o.ended)Nr(t,new SE);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?Na(t,o,e,!1):Fa(t,o)):Na(t,o,e,!1)}else n||(o.reading=!1,Fa(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}function Na(t,e,r,n){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&ei(t)),Fa(t,e)}function xE(t,e){var r;return!bE(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new EE("chunk",["string","Buffer","Uint8Array"],e)),r}N.prototype.isPaused=function(){return this._readableState.flowing===!1};N.prototype.setEncoding=function(t){ir||(ir=Sn().StringDecoder);var e=new ir(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,n="";r!==null;)n+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),n!==""&&this._readableState.buffer.push(n),this._readableState.length=n.length,this};var Qc=1073741824;function TE(t){return t>=Qc?t=Qc:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function Zc(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=TE(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}N.prototype.read=function(t){T("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 T("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Da(this):ei(this),null;if(t=Zc(t,e),t===0&&e.ended)return e.length===0&&Da(this),null;var n=e.needReadable;T("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,T("length less than watermark",n)),e.ended||e.reading?(n=!1,T("reading or ended",n)):n&&(T("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Zc(r,e)));var i;return t>0?i=od(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&&Da(this)),i!==null&&this.emit("data",i),i};function IE(t,e){if(T("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?ei(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,nd(t)))}}function ei(t){var e=t._readableState;T("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(T("emitReadable",e.flowing),e.emittedReadable=!0,g.nextTick(nd,t))}function nd(t){var e=t._readableState;T("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,Ua(t)}function Fa(t,e){e.readingMore||(e.readingMore=!0,g.nextTick(OE,t,e))}function OE(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(T("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}N.prototype._read=function(t){Nr(this,new AE("_read()"))};N.prototype.pipe=function(t,e){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=t;break;case 1:n.pipes=[n.pipes,t];break;default:n.pipes.push(t);break}n.pipesCount+=1,T("pipe count=%d opts=%j",n.pipesCount,e);var i=(!e||e.end!==!1)&&t!==g.stdout&&t!==g.stderr,o=i?s:w;n.endEmitted?g.nextTick(o):r.once("end",o),t.on("unpipe",a);function a(A,S){T("onunpipe"),A===r&&S&&S.hasUnpiped===!1&&(S.hasUnpiped=!0,c())}function s(){T("onend"),t.end()}var l=BE(r);t.on("drain",l);var f=!1;function c(){T("cleanup"),t.removeListener("close",h),t.removeListener("finish",E),t.removeListener("drain",l),t.removeListener("error",p),t.removeListener("unpipe",a),r.removeListener("end",s),r.removeListener("end",w),r.removeListener("data",u),f=!0,n.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&l()}r.on("data",u);function u(A){T("ondata");var S=t.write(A);T("dest.write",S),S===!1&&((n.pipesCount===1&&n.pipes===t||n.pipesCount>1&&ad(n.pipes,t)!==-1)&&!f&&(T("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(A){T("onerror",A),w(),t.removeListener("error",p),ed(t,"error")===0&&Nr(t,A)}RE(t,"error",p);function h(){t.removeListener("finish",E),w()}t.once("close",h);function E(){T("onfinish"),t.removeListener("close",h),w()}t.once("finish",E);function w(){T("unpipe"),r.unpipe(t)}return t.emit("pipe",r),n.flowing||(T("pipe resume"),r.resume()),t};function BE(t){return function(){var r=t._readableState;T("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&ed(t,"data")&&(r.flowing=!0,Ua(t))}}N.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;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var a=ad(e.pipes,t);return a===-1?this:(e.pipes.splice(a,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};N.prototype.on=function(t,e){var r=Dr.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,T("on readable",n.length,n.reading),n.length?ei(this):n.reading||g.nextTick(PE,this)),r};N.prototype.addListener=N.prototype.on;N.prototype.removeListener=function(t,e){var r=Dr.prototype.removeListener.call(this,t,e);return t==="readable"&&g.nextTick(id,this),r};N.prototype.removeAllListeners=function(t){var e=Dr.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&g.nextTick(id,this),e};function id(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 PE(t){T("readable nexttick read 0"),t.read(0)}N.prototype.resume=function(){var t=this._readableState;return t.flowing||(T("resume"),t.flowing=!t.readableListening,ME(this,t)),t.paused=!1,this};function ME(t,e){e.resumeScheduled||(e.resumeScheduled=!0,g.nextTick(kE,t,e))}function kE(t,e){T("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Ua(t),e.flowing&&!e.reading&&t.read(0)}N.prototype.pause=function(){return T("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(T("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function Ua(t){var e=t._readableState;for(T("flow",e.flowing);e.flowing&&t.read()!==null;);}N.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;t.on("end",function(){if(T("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(T("wrapped data"),r.decoder&&(a=r.decoder.write(a)),!(r.objectMode&&a==null)&&!(!r.objectMode&&(!a||!a.length))){var s=e.push(a);s||(n=!0,t.pause())}});for(var i in t)this[i]===void 0&&typeof t[i]=="function"&&(this[i]=function(s){return function(){return t[s].apply(t,arguments)}}(i));for(var o=0;o<Ca.length;o++)t.on(Ca[o],this.emit.bind(this,Ca[o]));return this._read=function(a){T("wrapped _read",a),n&&(n=!1,t.resume())},this};typeof Symbol=="function"&&(N.prototype[Symbol.asyncIterator]=function(){return ka===void 0&&(ka=Yc()),ka(this)});Object.defineProperty(N.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}});Object.defineProperty(N.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}});Object.defineProperty(N.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}});N._fromList=od;Object.defineProperty(N.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function od(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=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 Da(t){var e=t._readableState;T("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,g.nextTick(LE,e,t))}function LE(t,e){if(T("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"&&(N.from=function(t,e){return La===void 0&&(La=Xc()),La(N,t,e)});function ad(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}});var ja=_((R1,fd)=>{"use strict";d();fd.exports=Ye;var ti=xt().codes,CE=ti.ERR_METHOD_NOT_IMPLEMENTED,NE=ti.ERR_MULTIPLE_CALLBACK,DE=ti.ERR_TRANSFORM_ALREADY_TRANSFORMING,FE=ti.ERR_TRANSFORM_WITH_LENGTH_0,ri=Tt();ze()(Ye,ri);function qE(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new NE);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),n(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function Ye(t){if(!(this instanceof Ye))return new Ye(t);ri.call(this,t),this._transformState={afterTransform:qE.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",UE)}function UE(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){ld(t,e,r)}):ld(this,null,null)}Ye.prototype.push=function(t,e){return this._transformState.needTransform=!1,ri.prototype.push.call(this,t,e)};Ye.prototype._transform=function(t,e,r){r(new CE("_transform()"))};Ye.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}};Ye.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};Ye.prototype._destroy=function(t,e){ri.prototype._destroy.call(this,t,function(r){e(r)})};function ld(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new FE;if(t._transformState.transforming)throw new DE;return t.push(null)}});var dd=_((T1,cd)=>{"use strict";d();cd.exports=Fr;var ud=ja();ze()(Fr,ud);function Fr(t){if(!(this instanceof Fr))return new Fr(t);ud.call(this,t)}Fr.prototype._transform=function(t,e,r){r(null,t)}});var bd=_((O1,gd)=>{"use strict";d();var Wa;function jE(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var yd=xt().codes,WE=yd.ERR_MISSING_ARGS,$E=yd.ERR_STREAM_DESTROYED;function hd(t){if(t)throw t}function HE(t){return t.setHeader&&typeof t.abort=="function"}function GE(t,e,r,n){n=jE(n);var i=!1;t.on("close",function(){i=!0}),Wa===void 0&&(Wa=Yn()),Wa(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,HE(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();n(a||new $E("pipe"))}}}function pd(t){t()}function VE(t,e){return t.pipe(e)}function KE(t){return!t.length||typeof t[t.length-1]!="function"?hd:t.pop()}function zE(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n=KE(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new WE("streams");var i,o=e.map(function(a,s){var l=s<e.length-1,f=s>0;return GE(a,l,f,function(c){i||(i=c),c&&o.forEach(pd),!l&&(o.forEach(pd),n(i))})});return e.reduce(VE)}gd.exports=zE});var md=_((we,wd)=>{d();we=wd.exports=Ba();we.Stream=we;we.Readable=we;we.Writable=Ta();we.Duplex=Tt();we.Transform=ja();we.PassThrough=dd();we.finished=Yn();we.pipeline=bd()});var Ed=_((M1,_d)=>{d();_d.exports=YE;function YE(t){var e=t._readableState;return e?e.objectMode||typeof t._duplexState=="number"?t.read():t.read(JE(e)):null}function JE(t){if(t.buffer.length){var e=t.bufferIndex||0;if(t.buffer.head)return t.buffer.head.data.length;if(t.buffer.length-e>0&&t.buffer[e])return t.buffer[e].length}return t.length}});var xd=_((L1,Rd)=>{d();var ni=md(),Sd=ya(),XE=ze(),QE=Ed(),Ad=y.Buffer.from&&y.Buffer.from!==Uint8Array.from?y.Buffer.from([0]):new y.Buffer([0]),$a=function(t,e){t._corked?t.once("uncork",e):e()},ZE=function(t,e){t._autoDestroy&&t.destroy(e)},vd=function(t,e){return function(r){r?ZE(t,r.message==="premature close"?null:r):e&&!t._ended&&t.end()}},eS=function(t,e){if(!t||t._writableState&&t._writableState.finished)return e();if(t._writableState)return t.end(e);t.end(),e()},tS=function(){},rS=function(t){return new ni.Readable({objectMode:!0,highWaterMark:16}).wrap(t)},re=function(t,e,r){if(!(this instanceof re))return new re(t,e,r);ni.Duplex.call(this,r),this._writable=null,this._readable=null,this._readable2=null,this._autoDestroy=!r||r.autoDestroy!==!1,this._forwardDestroy=!r||r.destroy!==!1,this._forwardEnd=!r||r.end!==!1,this._corked=1,this._ondrain=null,this._drained=!1,this._forwarding=!1,this._unwrite=null,this._unread=null,this._ended=!1,this.destroyed=!1,t&&this.setWritable(t),e&&this.setReadable(e)};XE(re,ni.Duplex);re.obj=function(t,e,r){return r||(r={}),r.objectMode=!0,r.highWaterMark=16,new re(t,e,r)};re.prototype.cork=function(){++this._corked===1&&this.emit("cork")};re.prototype.uncork=function(){this._corked&&--this._corked===0&&this.emit("uncork")};re.prototype.setWritable=function(t){if(this._unwrite&&this._unwrite(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.end();return}var e=this,r=Sd(t,{writable:!0,readable:!1},vd(this,this._forwardEnd)),n=function(){var o=e._ondrain;e._ondrain=null,o&&o()},i=function(){e._writable.removeListener("drain",n),r()};this._unwrite&&g.nextTick(n),this._writable=t,this._writable.on("drain",n),this._unwrite=i,this.uncork()};re.prototype.setReadable=function(t){if(this._unread&&this._unread(),this.destroyed){t&&t.destroy&&t.destroy();return}if(t===null||t===!1){this.push(null),this.resume();return}var e=this,r=Sd(t,{writable:!1,readable:!0},vd(this)),n=function(){e._forward()},i=function(){e.push(null)},o=function(){e._readable2.removeListener("readable",n),e._readable2.removeListener("end",i),r()};this._drained=!0,this._readable=t,this._readable2=t._readableState?t:rS(t),this._readable2.on("readable",n),this._readable2.on("end",i),this._unread=o,this._forward()};re.prototype._read=function(){this._drained=!0,this._forward()};re.prototype._forward=function(){if(!(this._forwarding||!this._readable2||!this._drained)){this._forwarding=!0;for(var t;this._drained&&(t=QE(this._readable2))!==null;)this.destroyed||(this._drained=this.push(t));this._forwarding=!1}};re.prototype.destroy=function(t,e){if(e||(e=tS),this.destroyed)return e(null);this.destroyed=!0;var r=this;g.nextTick(function(){r._destroy(t),e(null)})};re.prototype._destroy=function(t){if(t){var e=this._ondrain;this._ondrain=null,e?e(t):this.emit("error",t)}this._forwardDestroy&&(this._readable&&this._readable.destroy&&this._readable.destroy(),this._writable&&this._writable.destroy&&this._writable.destroy()),this.emit("close")};re.prototype._write=function(t,e,r){if(!this.destroyed){if(this._corked)return $a(this,this._write.bind(this,t,e,r));if(t===Ad)return this._finish(r);if(!this._writable)return r();this._writable.write(t)===!1?this._ondrain=r:this.destroyed||r()}};re.prototype._finish=function(t){var e=this;this.emit("preend"),$a(this,function(){eS(e._forwardEnd&&e._writable,function(){e._writableState.prefinished===!1&&(e._writableState.prefinished=!0),e.emit("prefinish"),$a(e,t)})})};re.prototype.end=function(t,e,r){return typeof t=="function"?this.end(null,null,t):typeof e=="function"?this.end(t,null,e):(this._ended=!0,t&&this.write(t),!this._writableState.ending&&!this._writableState.destroyed&&this.write(Ad),ni.Writable.prototype.end.call(this,r))};Rd.exports=re});var Od=_((N1,ii)=>{d();var nS=Ec(),iS=ze(),Td=xd(),Id=function(t){return t.length?Array.isArray(t[0])?t[0]:Array.prototype.slice.call(t):[]},Ha=function(t){var e=function(){var r=Id(arguments);if(!(this instanceof e))return new e(r);Td.call(this,null,null,t),r.length&&this.setPipeline(r)};return iS(e,Td),e.prototype.setPipeline=function(){var r=Id(arguments),n=this,i=!1,o=r[0],a=r[r.length-1];a=a.readable?a:null,o=o.writable?o:null;var s=function(){r[0].emit("error",new Error("stream was destroyed"))};if(this.on("close",s),this.on("prefinish",function(){i||n.cork()}),nS(r,function(l){if(n.removeListener("close",s),l)return n.destroy(l.message==="premature close"?null:l);i=!0,n._autoDestroy===!1&&(n._autoDestroy=!0),n.uncork()}),this.destroyed)return s();this.setWritable(o),this.setReadable(a)},e};ii.exports=Ha({autoDestroy:!1,destroy:!1});ii.exports.obj=Ha({autoDestroy:!1,destroy:!1,objectMode:!0,highWaterMark:16});ii.exports.ctor=Ha});function oi(t,e){let r=[],n;t.on("data",i=>r.push(i)),t.on("end",()=>{n||(n=!0,e(null,y.Buffer.concat(r)))}),t.on("error",i=>{n||(n=!0,e(i))})}function ai(t){let e;return new Ga.Transform({transform(r,n,i){e&&(r=y.Buffer.concat([e,r]));let o=Math.floor(r.length/t)*t;o?r.length>o?(e=r.slice(o),this.push(r.slice(0,o))):(e=void 0,this.push(r)):e=e?y.Buffer.concat([e,r]):r,i()},flush(r){e&&this.push(e),r()}})}function Bd(t,e){let r=[],n=0;return new Ga.Transform({transform(i,o,a){r.push(i),n+=i.length,a()},flush(i){e(n);function o(){for(;r.length;)if(!t.write(r.shift()))return t.once("drain",o);t.end(),i()}o()}})}function J(t){let e,r=new Promise((n,i)=>{e=(o,a)=>{o?i(o):n(a)}});return t&&r.then(n=>t(null,n),t),[e,r]}var Ga,or=he(()=>{d();Ga=ve(Rt(),1)});var ar,Pd=he(()=>{d();ar=class{constructor(e){this._tables[0][0][0]||this._precompute();let r,n,i,o,a,s=this._tables[0][4],l=this._tables[1],f=e.length,c=1;if(f!==4&&f!==6&&f!==8)throw new Error("invalid aes key size");for(this._key=[o=e.slice(0),a=[]],r=f;r<4*f+28;r++)i=o[r-1],(r%f===0||f===8&&r%f===4)&&(i=s[i>>>24]<<24^s[i>>16&255]<<16^s[i>>8&255]<<8^s[i&255],r%f===0&&(i=i<<8^i>>>24^c<<24,c=c<<1^(c>>7)*283)),o[r]=o[r-f]^i;for(n=0;r;n++,r--)i=o[n&3?r:r-4],r<=4||n<4?a[n]=i:a[n]=l[0][s[i>>>24]]^l[1][s[i>>16&255]]^l[2][s[i>>8&255]]^l[3][s[i&255]]}encrypt(e){return this._crypt(e,0)}decrypt(e){return this._crypt(e,1)}_precompute(){let e=this._tables[0],r=this._tables[1],n=e[4],i=r[4],o,a,s,l=[],f=[],c,u,p,h,E,w;for(o=0;o<256;o++)f[(l[o]=o<<1^(o>>7)*283)^o]=o;for(a=s=0;!n[a];a^=c||1,s=f[s]||1)for(h=s^s<<1^s<<2^s<<3^s<<4,h=h>>8^h&255^99,n[a]=h,i[h]=a,p=l[u=l[c=l[a]]],w=p*16843009^u*65537^c*257^a*16843008,E=l[h]*257^h*16843008,o=0;o<4;o++)e[o][a]=E=E<<24^E>>>8,r[o][h]=w=w<<24^w>>>8;for(o=0;o<5;o++)e[o]=e[o].slice(0),r[o]=r[o].slice(0)}_crypt(e,r){if(e.length!==4)throw new Error("invalid aes block size");let n=this._key[r],i=e[0]^n[0],o=e[r?3:1]^n[1],a=e[2]^n[2],s=e[r?1:3]^n[3],l,f,c,u=n.length/4-2,p,h=4,E=[0,0,0,0],w=this._tables[r],A=w[0],S=w[1],R=w[2],M=w[3],v=w[4];for(p=0;p<u;p++)l=A[i>>>24]^S[o>>16&255]^R[a>>8&255]^M[s&255]^n[h],f=A[o>>>24]^S[a>>16&255]^R[s>>8&255]^M[i&255]^n[h+1],c=A[a>>>24]^S[s>>16&255]^R[i>>8&255]^M[o&255]^n[h+2],s=A[s>>>24]^S[i>>16&255]^R[o>>8&255]^M[a&255]^n[h+3],h+=4,i=l,o=f,a=c;for(p=0;p<4;p++)E[r?3&-p:p]=v[i>>>24]<<24^v[o>>16&255]<<16^v[a>>8&255]<<8^v[s&255]^n[h++],l=i,i=o,o=a,a=s,s=l;return E}};ar.prototype._tables=[[[],[],[],[],[]],[[],[],[],[],[]]]});function Va(t){let e,r,n,i=[2479122403,2108737444,3518906241,22203222],o=y.Buffer.alloc(Math.ceil(t.length/4)*4);for(o.set(t,0),n=65536;n--;)for(r=0;r<t.length;r+=16){let s=[0,0,0,0];for(e=0;e<16;e+=4)e+r<t.length&&(s[e/4]=o.readInt32BE(e+r));i=new ar(s).encrypt(i)}let a=y.Buffer.allocUnsafe(16);for(e=0;e<4;e++)a.writeInt32BE(i[e],e*4);return a}function Ka(t,e,r){let n=y.Buffer.from(e.s,"base64"),i=1e5,o="SHA-512";Promise.resolve().then(()=>globalThis.crypto.subtle.importKey("raw",t,"PBKDF2",!1,["deriveKey","deriveBits"])).then(a=>globalThis.crypto.subtle.deriveBits({name:"PBKDF2",salt:n,iterations:i,hash:{name:o}},a,256)).then(a=>{r(null,y.Buffer.from(a))}).catch(r)}var ne,qr,sr,Md=he(()=>{d();Pd();ne=class{constructor(e){if(e.length!==16)throw Error("Wrong key length. Key must be 128bit.");let r=[];for(let n=0;n<4;n++)r[n]=e.readInt32BE(n*4);this.aes=new ar(r)}encryptCBC(e){let r=[0,0,0,0],n=Array(4),i,o;for(i=0;i<e.length;i+=16){for(o=0;o<4;o++)n[o]=e.readUInt32BE(i+o*4)^r[o];for(r=this.aes.encrypt(n),o=0;o<4;o++)e.writeInt32BE(r[o],i+o*4)}}decryptCBC(e){let r=[0,0,0,0],n=Array(4),i=Array(4),o,a;for(o=0;o<e.length;o+=16){for(a=0;a<4;a++)n[a]=e.readUInt32BE(o+a*4);for(i=n,n=this.aes.decrypt(n),a=0;a<4;a++)e.writeInt32BE(n[a]^r[a],o+a*4);r=i}}stringhash(e){let r=[0,0,0,0];for(let i=0;i<e.length;i+=4)if(e.length-i<4){let o=e.length-i;r[i/4&3]^=e.readIntBE(i,o)<<(4-o)*8}else r[i/4&3]^=e.readInt32BE(i);for(let i=16384;i--;)r=this.aes.encrypt(r);let n=y.Buffer.allocUnsafe(8);return n.writeInt32BE(r[0],0),n.writeInt32BE(r[2],4),n}encryptECB(e){let r=[];for(let n=0;n<e.length;n+=16)r[0]=e.readInt32BE(n),r[1]=e.readInt32BE(n+4),r[2]=e.readInt32BE(n+8),r[3]=e.readInt32BE(n+12),r=this.aes.encrypt(r),e.writeInt32BE(r[0],n),e.writeInt32BE(r[1],n+4),e.writeInt32BE(r[2],n+8),e.writeInt32BE(r[3],n+12);return e}decryptECB(e){let r=[];for(let n=0;n<e.length;n+=16)r[0]=e.readInt32BE(n),r[1]=e.readInt32BE(n+4),r[2]=e.readInt32BE(n+8),r[3]=e.readInt32BE(n+12),r=this.aes.decrypt(r),e.writeInt32BE(r[0],n),e.writeInt32BE(r[1],n+4),e.writeInt32BE(r[2],n+8),e.writeInt32BE(r[3],n+12);return e}},qr=class{constructor(e,r,n=0){this.aes=e,this.nonce=r.slice(0,8),this.increment=131072,this.posNext=this.increment,this.pos=0,this.ctr=y.Buffer.alloc(16),this.nonce.copy(this.ctr,0),this.incrementCTR(n/16)}encrypt(e){for(let r=0;r<e.length;r+=16){let n=this.aes.encryptECB(y.Buffer.from(this.ctr));for(let i=0;i<16;i++)e[r+i]^=n[i];this.incrementCTR()}return e}decrypt(e){for(let r=0;r<e.length;r+=16){let n=this.aes.encryptECB(y.Buffer.from(this.ctr));for(let i=0;i<16;i++)e[r+i]^=n[i];this.incrementCTR()}return e}incrementCTR(e=1){let r=this.ctr,n=15,i;for(;e!==0;)i=(e+r[n])%256,e=Math.floor((e+r[n])/256),r[n]=i,n-=1,n<0&&(n=15)}},sr=class{constructor(e,r,n=0){this.aes=e,this.nonce=r.slice(0,8),this.increment=131072,this.posNext=this.increment,this.pos=0,this.mac=y.Buffer.alloc(16),this.nonce.copy(this.mac,0),this.nonce.copy(this.mac,8),this.macs=[]}condense(){this.mac&&(this.macs.push(this.mac),this.mac=void 0);let e=y.Buffer.alloc(16);for(let n=0;n<this.macs.length;n++){for(let i=0;i<16;i++)e[i]^=this.macs[n][i];this.aes.encryptECB(e)}let r=y.Buffer.allocUnsafe(8);return r.writeInt32BE(e.readInt32BE(0)^e.readInt32BE(4),0),r.writeInt32BE(e.readInt32BE(8)^e.readInt32BE(12),4),r}update(e){for(let r=0;r<e.length;r+=16){for(let n=0;n<16;n++)this.mac[n]^=e[r+n];this.aes.encryptECB(this.mac),this.checkBounding()}}checkBounding(){this.pos+=16,this.pos>=this.posNext&&(this.macs.push(y.Buffer.from(this.mac)),this.nonce.copy(this.mac,0),this.nonce.copy(this.mac,8),this.increment<1048576&&(this.increment+=131072),this.posNext+=this.increment)}}});function se(t){return typeof t=="string"?Ur(t):t}function G(t){return t.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function Ur(t){return y.Buffer.from(t,"base64")}function De(t){return new ne(za(t).slice(0,16))}function fi(t,e={}){let r=e.start||0;if(r!==0)throw Error("Encryption cannot start midstream otherwise MAC verification will fail.");t=se(t),t||(t=globalThis.crypto.getRandomValues(new Uint8Array(24))),t instanceof y.Buffer||(t=y.Buffer.from(t));let n=new si.Transform({transform(s,l,f){a.update(s);let c=o.encrypt(s);f(null,y.Buffer.from(c))},flush(s){n.mac=a.condense(),n.key=oS(t,n.mac),s()}});if(t.length!==24)throw Error("Wrong key length. Key must be 192bit.");let i=new ne(t.slice(0,16)),o=new qr(i,t.slice(16),r),a=new sr(i,t.slice(16));return n=(0,li.default)(ai(16),n),n}function ui(t,e={}){let r=e.start||0;if(r!==0&&(e.disableVerification=!0),r%16!==0)throw Error("start argument of megaDecrypt must be a multiple of 16");t=se(t),t instanceof y.Buffer||(t=y.Buffer.from(t));let n=De(t),i=new qr(n,t.slice(16),r),o=!e.disableVerification&&new sr(n,t.slice(16)),a=new si.Transform({transform(s,l,f){let c=i.decrypt(s);o&&o.update(c),f(null,y.Buffer.from(c))},flush(s){if(o&&(a.mac=o.condense()),!e.disableVerification&&!a.mac.equals(t.slice(24))){s(Error("MAC verification failed"));return}s()}});return a=(0,li.default)(ai(16),a),a}function kd(t){t=se(t),t instanceof y.Buffer||(t=y.Buffer.from(t));let e=new si.Transform({transform(i,o,a){n.update(i),a(null)},flush(i){if(e.mac=n.condense(),!e.mac.equals(t.slice(24))){i(Error("MAC verification failed"));return}i()}});if(t.length!==32)throw Error("Wrong key length. Key must be 256bit.");let r=De(t),n=new sr(r,t.slice(16));return e=(0,li.default)(ai(16),e),e}function za(t){let e=y.Buffer.alloc(32);t.copy(e);for(let r=0;r<16;r++)e.writeUInt8(e.readUInt8(r)^e.readUInt8(16+r,!0),r);return e}function oS(t,e){let r=y.Buffer.alloc(32);t.copy(r),e.copy(r,24);for(let n=0;n<16;n++)r.writeUInt8(r.readUInt8(n)^r.readUInt8(16+n),n);return r}function Ld(t,e){if(t.length!==e.length)return!1;let r=t.length,n=0;for(let i=0;i<r;i++)n|=t[i]^e[i];return n===0}var si,li,jr=he(()=>{d();si=ve(Rt(),1),li=ve(Od(),1);or();Md()});function Hr(t){let e=[];for(;t-- >0;)e[t]=0;return e}function Gr(t){let e=t.length;if(t[e-1])return t;for(;e>1&&t[e-1]===0;)e--;return t.slice(0,e)}function sS(t){let e=1,r;return(r=t>>>16)!==0&&(t=r,e+=16),(r=t>>8)!==0&&(t=r,e+=8),(r=t>>4)!==0&&(t=r,e+=4),(r=t>>2)!==0&&(t=r,e+=2),(r=t>>1)!==0&&(t=r,e+=1),e}function Nd(t,e){let r=t.length,n=e.length;if(r<n)return Nd(e,t);let i=[],o=0,a=0;for(;a<n;a++)o+=t[a]+e[a],i[a]=o&268435455,o>>>=28;for(;a<r;a++)o+=t[a],i[a]=o&268435455,o>>>=28;return o&&(i[a]=o),i}function me(t,e){let r=t.length,n=e.length;if(n>r)return[];if(n===r){if(e[n-1]>t[n-1])return[];if(n===1)return[t[0]-e[0]]}let i=[],o=0,a;for(a=0;a<n;a++)o+=t[a]-e[a],i[a]=o&268435455,o>>=28;for(;a<r;a++)o+=t[a],i[a]=o&268435455,o>>=28;return o?[]:Gr(i)}function Ya(t,e,r,n,i){let o=r&16383,a=r>>14,s=n&16383,l=n>>14,f=a*s+l*o,c=o*s+((f&16383)<<14)+t[e]+i;return t[e]=c&268435455,i=a*l+(f>>14)+(c>>28),i}function lS(t){let e=t.length,r=2*e,n=Hr(r),i=0,o,a;for(o=0;o<e;o++){for(i=Ya(n,2*o,t[o],t[o],0),a=o+1;a<e;a++)i=Ya(n,o+a,2*t[a],t[o],i);n[o+e]=i}return Gr(n)}function ft(t,e){let r=t.length,n=e.length,i=Hr(r+n-1),o,a,s;for(a=0;a<n;a++){for(o=0,s=0;s<r;s++)o=Ya(i,a+s,t[s],e[a],o);i[a+r]=o}return Gr(i)}function Wr(t,e,r){let n=0;for(;e>=0&&r-- >0;)n=n*268435456+t[e--];return n}function Dd(t,e){let r=t.length-1,n=e.length-1,i=r-n,o,a,s,l;if(r<n||r===n&&(t[r]<e[r]||r>0&&t[r]===e[r]&&t[r-1]<e[r-1]))return Je.q=[0],Je.mod=t,Je;if(r===n&&Wr(t,n,2)/Wr(e,n,2)<4){for(o=t.concat(),a=0;s=me(o,e),s.length!==0;)o=s,a++;return Je.q=[a],Je.mod=o,Je}let f=Math.floor(Math.log(e[n])/aS)+1,c=28-f;o=t.concat();let u=e.concat();if(c){for(l=n;l>0;l--)u[l]=u[l]<<c&268435455|u[l-1]>>f;for(u[0]=u[0]<<c&268435455,o[r]&(268435455<<f&268435455)&&(o[++r]=0,i++),l=r;l>0;l--)o[l]=o[l]<<c&268435455|o[l-1]>>f;o[0]=o[0]<<c&268435455}let p,h=Hr(i+1),E=Hr(i).concat(u);for(;p=me(o,E),p.length!==0;)h[i]++,o=p;let w=u[n],A=Wr(u,n,2),S;for(l=r;l>n;l--){S=l-n-1,l>=o.length?h[S]=1:o[l]===w?h[S]=268435455:h[S]=Math.floor(Wr(o,l,2)/w);let R=Wr(o,l,3);for(;h[S]*A>R;)h[S]--;E=E.slice(1),p=me(o,ft([h[S]],E)),p.length===0&&(h[S]--,p=me(o,ft([h[S]],E))),o=p}if(c){for(l=0;l<o.length-1;l++)o[l]=o[l]>>c|o[l+1]<<f&268435455;o[o.length-1]>>=c}return Je.q=Gr(h),Je.mod=Gr(o),Je}function fS(t,e){let r=0,n;for(let i=t.length-1;i>=0;i--)n=t[i],r=((n>>14)+(r<<14))%e,r=((n&16383)+(r<<14))%e;return r}function lr(t,e){if(e.length===1){if(t.length===1)return[t[0]%e[0]];if(e[0]<16383)return[fS(t,e[0])]}return Dd(t,e).mod}function $r(t,e,r){let n=t.length-(e.length<<1);if(n>0)return $r(t.slice(0,n).concat($r(t.slice(n),e,r)),e,r);let i=e.length+1,o=e.length-1,a,s=ft(t.slice(o),r).slice(i),l=t.slice(0,i),f=ft(s,e).slice(0,i),c=me(l,f);c.length===0&&(l[i]=1,c=me(l,f));for(let u=0;a=me(c,e),a.length!==0;u++)if(c=a,u>=3)return $r(c,e,r);return c}function Cd(t,e,r){let n=t.concat(),i=e.length-1,o=r.length*2,a=Hr(o+1);for(a[o]=1,a=Dd(a,r).q,o=sS(e[i])-2;i>=0;i--){for(;o>=0;o-=1)n=$r(lS(n),r,a),e[i]&1<<o&&(n=$r(ft(n,t),r,a));o=27}return n}function uS(t,e,r,n,i){let o=Cd(lr(t,r),lr(e,me(r,[1])),r),a=Cd(lr(t,n),lr(e,me(n,[1])),n),s=me(a,o);return s.length===0?(s=me(o,a),s=lr(ft(s,i),n),s=me(n,s)):s=lr(ft(s,i),n),Nd(ft(s,r),o)}function Fd(t){let e=1,r=[0],n=0,i=256,o=t.length,a;if(o<2)return 0;let s=(o-2)*8,l=t.charCodeAt(0)*256+t.charCodeAt(1);if(l>s||l<s-8)return 0;for(let f=0;f<s;f++)(i<<=1)>255&&(i=1,a=t.charCodeAt(--o)),e>268435455&&(e=1,r[++n]=0),a&i&&(r[n]|=e),e<<=1;return r}function cS(t){let e=1,r=0,n=[0],i=1,o=0,a=t.length*28,s="",l;for(l=0;l<a;l++)t[r]&e&&(n[o]|=i),(i<<=1)>255&&(i=1,n[++o]=0),(e<<=1)>268435455&&(e=1,r++);for(;o>=0&&n[o]===0;)o--;for(l=0;l<=o;l++)s=String.fromCharCode(n[l])+s;return s}function qd(t){let e=[];for(let r=0;r<4;r++){let n=(t[0]*256+t[1]+7>>3)+2;if(e[r]=Fd(t.toString("binary").substr(0,n)),typeof e[r]=="number"){if(r!==4||t.length>=16)return!1;break}t=t.slice(n)}return e}function Ja(t,e){let r=Fd(t.toString("binary")),n=cS(uS(r,e[2],e[0],e[1],e[3]));return y.Buffer.from(n,"binary")}var Je,aS,Ud=he(()=>{d();Je={},aS=Math.log(2)});var dS,Vr,Xa=he(()=>{d();je();dS=globalThis.AbortController||Xi,Vr=dS});function Wd(t){if(t.statusText==="Server Too Busy")return-3;if(!t.ok)throw Error(`Server returned error: ${t.statusText}`);return t.json()}function gS(t){if(t.name!=="AbortError")throw t}var $d,Qa,jd,hS,pS,yS,Za,Fe,Kr=he(()=>{d();$d=ve(Te(),1);je();je();Xa();or();Qa=4,jd={1:"EINTERNAL (-1): An internal error has occurred. Please submit a bug report, detailing the exact circumstances in which this error occurred.",2:"EARGS (-2): You have passed invalid arguments to this command.",3:"EAGAIN (-3): A temporary congestion or server malfunction prevented your request from being processed. No data was altered. Retried "+Qa+" times.",4:"ERATELIMIT (-4): You have exceeded your command weight per time quota. Please wait a few seconds, then try again (this should never happen in sane real-life applications).",5:"EFAILED (-5): The upload failed. Please restart it from scratch.",6:"ETOOMANY (-6): Too many concurrent IP addresses are accessing this upload target URL.",7:"ERANGE (-7): The upload file packet is out of range or not starting and ending on a chunk boundary.",8:"EEXPIRED (-8): The upload target URL you are trying to access has expired. Please request a fresh one.",9:"ENOENT (-9): Object (typically, node or user) not found. Wrong password?",10:"ECIRCULAR (-10): Circular linkage attempted",11:"EACCESS (-11): Access violation (e.g., trying to write to a read-only share)",12:"EEXIST (-12): Trying to create an object that already exists",13:"EINCOMPLETE (-13): Trying to access an incomplete resource",14:"EKEY (-14): A decryption operation failed (never returned by the API)",15:"ESID (-15): Invalid or expired user session, please relogin",16:"EBLOCKED (-16): User blocked",17:"EOVERQUOTA (-17): Request over quota",18:"ETEMPUNAVAIL (-18): Resource temporarily not available, please try again later",19:"ETOOMANYCONNECTIONS (-19)",24:"EGOINGOVERQUOTA (-24)",25:"EROLLEDBACK (-25)",26:"EMFAREQUIRED (-26): Multi-Factor Authentication Required",27:"EMASTERONLY (-27)",28:"EBUSINESSPASTDUE (-28)",29:"EPAYWALL (-29): ODQ paywall state",400:"ETOOERR (-400)",401:"ESHAREROVERQUOTA (-401)"},hS="https://g.api.mega.co.nz/",pS=null,yS=null,Za=class t extends $d.EventEmitter{constructor(e,r={}){super(),this.keepalive=e,this.counterId=Math.random().toString().substr(2,10),this.gateway=r.gateway||hS;let n="1.0.39",i=t.getShouldAvoidUA();this.userAgent=r.userAgent===null||i?null:`${r.userAgent||""} megajs/${n}`.trim(),this.httpAgent=r.httpAgent||pS,this.httpsAgent=r.httpsAgent||yS,this.fetch=r.fetch||this.defaultFetch.bind(this),this.closed=!1}async defaultFetch(e,r){if(r||(r={}),r.agent||(r.agent=n=>n.protocol==="http:"?this.httpAgent:this.httpsAgent),this.userAgent&&(r.headers||(r.headers={}),r.headers["user-agent"]||(r.headers["user-agent"]=this.userAgent)),!t.fetchModule)if(typeof globalThis.fetch=="function")t.fetchModule=globalThis.fetch.bind(globalThis);else throw Error("globalThis.fetch not found!");return t.fetchModule(e,r)}request(e,r,n=0){let i=e.a==="sml";if(this.closed&&!i)throw Error("API is closed");let[o,a]=J(r),s={id:(this.counterId++).toString()};return this.sid&&(s.sid=this.sid),typeof e._querystring=="object"&&(Object.assign(s,e._querystring),delete e._querystring),this.fetch(`${this.gateway}cs?${new URLSearchParams(s)}`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify([e])}).then(Wd).then(l=>{if(this.closed&&!i)return;if(!l)return o(Error("Empty response"));l.length&&(l=l[0]);let f;if(typeof l=="number"&&l<0){if(l===-3&&n<Qa)return setTimeout(()=>{this.request(e,o,n+1)},Math.pow(2,n+1)*1e3);f=Error(jd[-l])}else this.keepalive&&l&&l.sn&&this.pull(l.sn);o(f,l)}).catch(l=>{o(l)}),a}pull(e,r=0){let n=new Vr,i=t.handleForceHttps()?1:0;this.sn=n,this.fetch(`${this.gateway}sc?${new URLSearchParams({sn:e,ssl:i,sid:this.sid})}`,{method:"POST",signal:n.signal}).then(Wd).then(o=>{if(this.sn=void 0,!this.closed){if(typeof o=="number"&&o<0){if(o===-3&&r<Qa)return setTimeout(()=>{this.pull(e,r+1)},Math.pow(2,r+1)*1e3);this.emit("error",Error(jd[-o]))}o.w?this.wait(o.w,e):o.sn&&(o.a&&this.emit("sc",o.a),this.pull(o.sn))}}).catch(gS).catch(o=>{this.emit("error",o)})}wait(e,r){let n=new Vr;this.sn=n,this.fetch(e,{method:"POST",signal:n.signal}).catch(()=>{}).then(()=>{this.sn=void 0,this.pull(r)})}close(){this.sn&&this.sn.abort(),this.closed=!0}static getGlobalApi(){return t.globalApi||(t.globalApi=new t),t.globalApi}static handleForceHttps(e){return e??!!globalThis.isSecureContext}static getShouldAvoidUA(){let e;try{globalThis.Headers()}catch(r){e=r.message}return!((globalThis.fetch+"").length===38&&e.includes("Headers"))}};Fe=Za});var es=_((lx,Hd)=>{"use strict";d();Hd.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var i=42;e[r]=i;for(r in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var o=Object.getOwnPropertySymbols(e);if(o.length!==1||o[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var a=Object.getOwnPropertyDescriptor(e,r);if(a.value!==i||a.enumerable!==!0)return!1}return!0}});var ci=_((ux,Gd)=>{"use strict";d();var bS=es();Gd.exports=function(){return bS()&&!!Symbol.toStringTag}});var Kd=_((dx,Vd)=>{"use strict";d();Vd.exports=Error});var Yd=_((px,zd)=>{"use strict";d();zd.exports=EvalError});var Xd=_((gx,Jd)=>{"use strict";d();Jd.exports=RangeError});var Zd=_((wx,Qd)=>{"use strict";d();Qd.exports=ReferenceError});var ts=_((_x,eh)=>{"use strict";d();eh.exports=SyntaxError});var zr=_((Sx,th)=>{"use strict";d();th.exports=TypeError});var nh=_((vx,rh)=>{"use strict";d();rh.exports=URIError});var ah=_((xx,oh)=>{"use strict";d();var ih=typeof Symbol<"u"&&Symbol,wS=es();oh.exports=function(){return typeof ih!="function"||typeof Symbol!="function"||typeof ih("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:wS()}});var lh=_((Ix,sh)=>{"use strict";d();var rs={__proto__:null,foo:{}},mS=Object;sh.exports=function(){return{__proto__:rs}.foo===rs.foo&&!(rs instanceof mS)}});var ch=_((Bx,uh)=>{"use strict";d();var _S="Function.prototype.bind called on incompatible ",ES=Object.prototype.toString,SS=Math.max,AS="[object Function]",fh=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},vS=function(e,r){for(var n=[],i=r||0,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},RS=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};uh.exports=function(e){var r=this;if(typeof r!="function"||ES.apply(r)!==AS)throw new TypeError(_S+r);for(var n=vS(arguments,1),i,o=function(){if(this instanceof i){var c=r.apply(this,fh(n,arguments));return Object(c)===c?c:this}return r.apply(e,fh(n,arguments))},a=SS(0,r.length-n.length),s=[],l=0;l<a;l++)s[l]="$"+l;if(i=Function("binder","return function ("+RS(s,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var f=function(){};f.prototype=r.prototype,i.prototype=new f,f.prototype=null}return i}});var di=_((Mx,dh)=>{"use strict";d();var xS=ch();dh.exports=Function.prototype.bind||xS});var ph=_((Lx,hh)=>{"use strict";d();var TS=Function.prototype.call,IS=Object.prototype.hasOwnProperty,OS=di();hh.exports=OS.call(TS,IS)});var hr=_((Nx,mh)=>{"use strict";d();var L,BS=Kd(),PS=Yd(),MS=Xd(),kS=Zd(),dr=ts(),cr=zr(),LS=nh(),wh=Function,ns=function(t){try{return wh('"use strict"; return ('+t+").constructor;")()}catch{}},Pt=Object.getOwnPropertyDescriptor;if(Pt)try{Pt({},"")}catch{Pt=null}var is=function(){throw new cr},CS=Pt?function(){try{return arguments.callee,is}catch{try{return Pt(arguments,"callee").get}catch{return is}}}():is,fr=ah()(),NS=lh()(),Z=Object.getPrototypeOf||(NS?function(t){return t.__proto__}:null),ur={},DS=typeof Uint8Array>"u"||!Z?L:Z(Uint8Array),Mt={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?L:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?L:ArrayBuffer,"%ArrayIteratorPrototype%":fr&&Z?Z([][Symbol.iterator]()):L,"%AsyncFromSyncIteratorPrototype%":L,"%AsyncFunction%":ur,"%AsyncGenerator%":ur,"%AsyncGeneratorFunction%":ur,"%AsyncIteratorPrototype%":ur,"%Atomics%":typeof Atomics>"u"?L:Atomics,"%BigInt%":typeof BigInt>"u"?L:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?L:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?L:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?L:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":BS,"%eval%":eval,"%EvalError%":PS,"%Float32Array%":typeof Float32Array>"u"?L:Float32Array,"%Float64Array%":typeof Float64Array>"u"?L:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?L:FinalizationRegistry,"%Function%":wh,"%GeneratorFunction%":ur,"%Int8Array%":typeof Int8Array>"u"?L:Int8Array,"%Int16Array%":typeof Int16Array>"u"?L:Int16Array,"%Int32Array%":typeof Int32Array>"u"?L:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":fr&&Z?Z(Z([][Symbol.iterator]())):L,"%JSON%":typeof JSON=="object"?JSON:L,"%Map%":typeof Map>"u"?L:Map,"%MapIteratorPrototype%":typeof Map>"u"||!fr||!Z?L:Z(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":Object,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?L:Promise,"%Proxy%":typeof Proxy>"u"?L:Proxy,"%RangeError%":MS,"%ReferenceError%":kS,"%Reflect%":typeof Reflect>"u"?L:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?L:Set,"%SetIteratorPrototype%":typeof Set>"u"||!fr||!Z?L:Z(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?L:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":fr&&Z?Z(""[Symbol.iterator]()):L,"%Symbol%":fr?Symbol:L,"%SyntaxError%":dr,"%ThrowTypeError%":CS,"%TypedArray%":DS,"%TypeError%":cr,"%Uint8Array%":typeof Uint8Array>"u"?L:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?L:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?L:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?L:Uint32Array,"%URIError%":LS,"%WeakMap%":typeof WeakMap>"u"?L:WeakMap,"%WeakRef%":typeof WeakRef>"u"?L:WeakRef,"%WeakSet%":typeof WeakSet>"u"?L:WeakSet};if(Z)try{null.error}catch(t){yh=Z(Z(t)),Mt["%Error.prototype%"]=yh}var yh,FS=function t(e){var r;if(e==="%AsyncFunction%")r=ns("async function () {}");else if(e==="%GeneratorFunction%")r=ns("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ns("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var i=t("%AsyncGenerator%");i&&Z&&(r=Z(i.prototype))}return Mt[e]=r,r},gh={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Yr=di(),hi=ph(),qS=Yr.call(Function.call,Array.prototype.concat),US=Yr.call(Function.apply,Array.prototype.splice),bh=Yr.call(Function.call,String.prototype.replace),pi=Yr.call(Function.call,String.prototype.slice),jS=Yr.call(Function.call,RegExp.prototype.exec),WS=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,$S=/\\(\\)?/g,HS=function(e){var r=pi(e,0,1),n=pi(e,-1);if(r==="%"&&n!=="%")throw new dr("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new dr("invalid intrinsic syntax, expected opening `%`");var i=[];return bh(e,WS,function(o,a,s,l){i[i.length]=s?bh(l,$S,"$1"):a||o}),i},GS=function(e,r){var n=e,i;if(hi(gh,n)&&(i=gh[n],n="%"+i[0]+"%"),hi(Mt,n)){var o=Mt[n];if(o===ur&&(o=FS(n)),typeof o>"u"&&!r)throw new cr("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:i,name:n,value:o}}throw new dr("intrinsic "+e+" does not exist!")};mh.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new cr("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new cr('"allowMissing" argument must be a boolean');if(jS(/^%?[^%]*%?$/,e)===null)throw new dr("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=HS(e),i=n.length>0?n[0]:"",o=GS("%"+i+"%",r),a=o.name,s=o.value,l=!1,f=o.alias;f&&(i=f[0],US(n,qS([0,1],f)));for(var c=1,u=!0;c<n.length;c+=1){var p=n[c],h=pi(p,0,1),E=pi(p,-1);if((h==='"'||h==="'"||h==="`"||E==='"'||E==="'"||E==="`")&&h!==E)throw new dr("property names with quotes must have matching quotes");if((p==="constructor"||!u)&&(l=!0),i+="."+p,a="%"+i+"%",hi(Mt,a))s=Mt[a];else if(s!=null){if(!(p in s)){if(!r)throw new cr("base intrinsic for "+e+" exists, but the property is not available.");return}if(Pt&&c+1>=n.length){var w=Pt(s,p);u=!!w,u&&"get"in w&&!("originalValue"in w.get)?s=w.get:s=s[p]}else u=hi(s,p),s=s[p];u&&!l&&(Mt[a]=s)}}return s}});var gi=_((Fx,_h)=>{"use strict";d();var VS=hr(),yi=VS("%Object.defineProperty%",!0)||!1;if(yi)try{yi({},"a",{value:1})}catch{yi=!1}_h.exports=yi});var wi=_((Ux,Eh)=>{"use strict";d();var KS=hr(),bi=KS("%Object.getOwnPropertyDescriptor%",!0);if(bi)try{bi([],"length")}catch{bi=null}Eh.exports=bi});var Rh=_((Wx,vh)=>{"use strict";d();var Sh=gi(),zS=ts(),pr=zr(),Ah=wi();vh.exports=function(e,r,n){if(!e||typeof e!="object"&&typeof e!="function")throw new pr("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new pr("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new pr("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new pr("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new pr("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new pr("`loose`, if provided, must be a boolean");var i=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,a=arguments.length>5?arguments[5]:null,s=arguments.length>6?arguments[6]:!1,l=!!Ah&&Ah(e,r);if(Sh)Sh(e,r,{configurable:a===null&&l?l.configurable:!a,enumerable:i===null&&l?l.enumerable:!i,value:n,writable:o===null&&l?l.writable:!o});else if(s||!i&&!o&&!a)e[r]=n;else throw new zS("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")}});var Ih=_((Hx,Th)=>{"use strict";d();var os=gi(),xh=function(){return!!os};xh.hasArrayLengthDefineBug=function(){if(!os)return null;try{return os([],"length",{value:1}).length!==1}catch{return!0}};Th.exports=xh});var kh=_((Vx,Mh)=>{"use strict";d();var YS=hr(),Oh=Rh(),JS=Ih()(),Bh=wi(),Ph=zr(),XS=YS("%Math.floor%");Mh.exports=function(e,r){if(typeof e!="function")throw new Ph("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||XS(r)!==r)throw new Ph("`length` must be a positive 32-bit integer");var n=arguments.length>2&&!!arguments[2],i=!0,o=!0;if("length"in e&&Bh){var a=Bh(e,"length");a&&!a.configurable&&(i=!1),a&&!a.writable&&(o=!1)}return(i||o||!n)&&(JS?Oh(e,"length",r,!0,!0):Oh(e,"length",r)),e}});var ss=_((zx,mi)=>{"use strict";d();var as=di(),_i=hr(),QS=kh(),ZS=zr(),Nh=_i("%Function.prototype.apply%"),Dh=_i("%Function.prototype.call%"),Fh=_i("%Reflect.apply%",!0)||as.call(Dh,Nh),Lh=gi(),eA=_i("%Math.max%");mi.exports=function(e){if(typeof e!="function")throw new ZS("a function is required");var r=Fh(as,Dh,arguments);return QS(r,1+eA(0,e.length-(arguments.length-1)),!0)};var Ch=function(){return Fh(as,Nh,arguments)};Lh?Lh(mi.exports,"apply",{value:Ch}):mi.exports.apply=Ch});var ls=_((Jx,jh)=>{"use strict";d();var qh=hr(),Uh=ss(),tA=Uh(qh("String.prototype.indexOf"));jh.exports=function(e,r){var n=qh(e,!!r);return typeof n=="function"&&tA(e,".prototype.")>-1?Uh(n):n}});var Hh=_((Qx,$h)=>{"use strict";d();var rA=ci()(),nA=ls(),fs=nA("Object.prototype.toString"),Ei=function(e){return rA&&e&&typeof e=="object"&&Symbol.toStringTag in e?!1:fs(e)==="[object Arguments]"},Wh=function(e){return Ei(e)?!0:e!==null&&typeof e=="object"&&typeof e.length=="number"&&e.length>=0&&fs(e)!=="[object Array]"&&fs(e.callee)==="[object Function]"},iA=function(){return Ei(arguments)}();Ei.isLegacyArguments=Wh;$h.exports=iA?Ei:Wh});var Kh=_((eT,Vh)=>{"use strict";d();var oA=Object.prototype.toString,aA=Function.prototype.toString,sA=/^\s*(?:function)?\*/,Gh=ci()(),us=Object.getPrototypeOf,lA=function(){if(!Gh)return!1;try{return Function("return function*() {}")()}catch{}},cs;Vh.exports=function(e){if(typeof e!="function")return!1;if(sA.test(aA.call(e)))return!0;if(!Gh){var r=oA.call(e);return r==="[object GeneratorFunction]"}if(!us)return!1;if(typeof cs>"u"){var n=lA();cs=n?us(n):!1}return us(e)===cs}});var Xh=_((rT,Jh)=>{"use strict";d();var Yh=Function.prototype.toString,yr=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,hs,Si;if(typeof yr=="function"&&typeof Object.defineProperty=="function")try{hs=Object.defineProperty({},"length",{get:function(){throw Si}}),Si={},yr(function(){throw 42},null,hs)}catch(t){t!==Si&&(yr=null)}else yr=null;var fA=/^\s*class\b/,ps=function(e){try{var r=Yh.call(e);return fA.test(r)}catch{return!1}},ds=function(e){try{return ps(e)?!1:(Yh.call(e),!0)}catch{return!1}},Ai=Object.prototype.toString,uA="[object Object]",cA="[object Function]",dA="[object GeneratorFunction]",hA="[object HTMLAllCollection]",pA="[object HTML document.all class]",yA="[object HTMLCollection]",gA=typeof Symbol=="function"&&!!Symbol.toStringTag,bA=!(0 in[,]),ys=function(){return!1};typeof document=="object"&&(zh=document.all,Ai.call(zh)===Ai.call(document.all)&&(ys=function(e){if((bA||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Ai.call(e);return(r===hA||r===pA||r===yA||r===uA)&&e("")==null}catch{}return!1}));var zh;Jh.exports=yr?function(e){if(ys(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{yr(e,null,hs)}catch(r){if(r!==Si)return!1}return!ps(e)&&ds(e)}:function(e){if(ys(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(gA)return ds(e);if(ps(e))return!1;var r=Ai.call(e);return r!==cA&&r!==dA&&!/^\[object HTML/.test(r)?!1:ds(e)}});var ep=_((iT,Zh)=>{"use strict";d();var wA=Xh(),mA=Object.prototype.toString,Qh=Object.prototype.hasOwnProperty,_A=function(e,r,n){for(var i=0,o=e.length;i<o;i++)Qh.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},EA=function(e,r,n){for(var i=0,o=e.length;i<o;i++)n==null?r(e.charAt(i),i,e):r.call(n,e.charAt(i),i,e)},SA=function(e,r,n){for(var i in e)Qh.call(e,i)&&(n==null?r(e[i],i,e):r.call(n,e[i],i,e))},AA=function(e,r,n){if(!wA(r))throw new TypeError("iterator must be a function");var i;arguments.length>=3&&(i=n),mA.call(e)==="[object Array]"?_A(e,r,i):typeof e=="string"?EA(e,r,i):SA(e,r,i)};Zh.exports=AA});var rp=_((aT,tp)=>{"use strict";d();tp.exports=["Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var ip=_((lT,np)=>{"use strict";d();var gs=rp(),vA=typeof globalThis>"u"?m:globalThis;np.exports=function(){for(var e=[],r=0;r<gs.length;r++)typeof vA[gs[r]]=="function"&&(e[e.length]=gs[r]);return e}});var Es=_((uT,lp)=>{"use strict";d();var Ri=ep(),RA=ip(),op=ss(),ms=ls(),vi=wi(),xA=ms("Object.prototype.toString"),sp=ci()(),ap=typeof globalThis>"u"?m:globalThis,ws=RA(),_s=ms("String.prototype.slice"),bs=Object.getPrototypeOf,TA=ms("Array.prototype.indexOf",!0)||function(e,r){for(var n=0;n<e.length;n+=1)if(e[n]===r)return n;return-1},xi={__proto__:null};sp&&vi&&bs?Ri(ws,function(t){var e=new ap[t];if(Symbol.toStringTag in e){var r=bs(e),n=vi(r,Symbol.toStringTag);if(!n){var i=bs(r);n=vi(i,Symbol.toStringTag)}xi["$"+t]=op(n.get)}}):Ri(ws,function(t){var e=new ap[t],r=e.slice||e.set;r&&(xi["$"+t]=op(r))});var IA=function(e){var r=!1;return Ri(xi,function(n,i){if(!r)try{"$"+n(e)===i&&(r=_s(i,1))}catch{}}),r},OA=function(e){var r=!1;return Ri(xi,function(n,i){if(!r)try{n(e),r=_s(i,1)}catch{}}),r};lp.exports=function(e){if(!e||typeof e!="object")return!1;if(!sp){var r=_s(xA(e),8,-1);return TA(ws,r)>-1?r:r!=="Object"?!1:OA(e)}return vi?IA(e):null}});var up=_((dT,fp)=>{"use strict";d();var BA=Es();fp.exports=function(e){return!!BA(e)}});var vp=_(B=>{"use strict";d();var PA=Hh(),MA=Kh(),Ae=Es(),cp=up();function gr(t){return t.call.bind(t)}var dp=typeof BigInt<"u",hp=typeof Symbol<"u",_e=gr(Object.prototype.toString),kA=gr(Number.prototype.valueOf),LA=gr(String.prototype.valueOf),CA=gr(Boolean.prototype.valueOf);dp&&(pp=gr(BigInt.prototype.valueOf));var pp;hp&&(yp=gr(Symbol.prototype.valueOf));var yp;function Xr(t,e){if(typeof t!="object")return!1;try{return e(t),!0}catch{return!1}}B.isArgumentsObject=PA;B.isGeneratorFunction=MA;B.isTypedArray=cp;function NA(t){return typeof Promise<"u"&&t instanceof Promise||t!==null&&typeof t=="object"&&typeof t.then=="function"&&typeof t.catch=="function"}B.isPromise=NA;function DA(t){return typeof ArrayBuffer<"u"&&ArrayBuffer.isView?ArrayBuffer.isView(t):cp(t)||bp(t)}B.isArrayBufferView=DA;function FA(t){return Ae(t)==="Uint8Array"}B.isUint8Array=FA;function qA(t){return Ae(t)==="Uint8ClampedArray"}B.isUint8ClampedArray=qA;function UA(t){return Ae(t)==="Uint16Array"}B.isUint16Array=UA;function jA(t){return Ae(t)==="Uint32Array"}B.isUint32Array=jA;function WA(t){return Ae(t)==="Int8Array"}B.isInt8Array=WA;function $A(t){return Ae(t)==="Int16Array"}B.isInt16Array=$A;function HA(t){return Ae(t)==="Int32Array"}B.isInt32Array=HA;function GA(t){return Ae(t)==="Float32Array"}B.isFloat32Array=GA;function VA(t){return Ae(t)==="Float64Array"}B.isFloat64Array=VA;function KA(t){return Ae(t)==="BigInt64Array"}B.isBigInt64Array=KA;function zA(t){return Ae(t)==="BigUint64Array"}B.isBigUint64Array=zA;function Ti(t){return _e(t)==="[object Map]"}Ti.working=typeof Map<"u"&&Ti(new Map);function YA(t){return typeof Map>"u"?!1:Ti.working?Ti(t):t instanceof Map}B.isMap=YA;function Ii(t){return _e(t)==="[object Set]"}Ii.working=typeof Set<"u"&&Ii(new Set);function JA(t){return typeof Set>"u"?!1:Ii.working?Ii(t):t instanceof Set}B.isSet=JA;function Oi(t){return _e(t)==="[object WeakMap]"}Oi.working=typeof WeakMap<"u"&&Oi(new WeakMap);function XA(t){return typeof WeakMap>"u"?!1:Oi.working?Oi(t):t instanceof WeakMap}B.isWeakMap=XA;function As(t){return _e(t)==="[object WeakSet]"}As.working=typeof WeakSet<"u"&&As(new WeakSet);function QA(t){return As(t)}B.isWeakSet=QA;function Bi(t){return _e(t)==="[object ArrayBuffer]"}Bi.working=typeof ArrayBuffer<"u"&&Bi(new ArrayBuffer);function gp(t){return typeof ArrayBuffer>"u"?!1:Bi.working?Bi(t):t instanceof ArrayBuffer}B.isArrayBuffer=gp;function Pi(t){return _e(t)==="[object DataView]"}Pi.working=typeof ArrayBuffer<"u"&&typeof DataView<"u"&&Pi(new DataView(new ArrayBuffer(1),0,1));function bp(t){return typeof DataView>"u"?!1:Pi.working?Pi(t):t instanceof DataView}B.isDataView=bp;var Ss=typeof SharedArrayBuffer<"u"?SharedArrayBuffer:void 0;function Jr(t){return _e(t)==="[object SharedArrayBuffer]"}function wp(t){return typeof Ss>"u"?!1:(typeof Jr.working>"u"&&(Jr.working=Jr(new Ss)),Jr.working?Jr(t):t instanceof Ss)}B.isSharedArrayBuffer=wp;function ZA(t){return _e(t)==="[object AsyncFunction]"}B.isAsyncFunction=ZA;function ev(t){return _e(t)==="[object Map Iterator]"}B.isMapIterator=ev;function tv(t){return _e(t)==="[object Set Iterator]"}B.isSetIterator=tv;function rv(t){return _e(t)==="[object Generator]"}B.isGeneratorObject=rv;function nv(t){return _e(t)==="[object WebAssembly.Module]"}B.isWebAssemblyCompiledModule=nv;function mp(t){return Xr(t,kA)}B.isNumberObject=mp;function _p(t){return Xr(t,LA)}B.isStringObject=_p;function Ep(t){return Xr(t,CA)}B.isBooleanObject=Ep;function Sp(t){return dp&&Xr(t,pp)}B.isBigIntObject=Sp;function Ap(t){return hp&&Xr(t,yp)}B.isSymbolObject=Ap;function iv(t){return mp(t)||_p(t)||Ep(t)||Sp(t)||Ap(t)}B.isBoxedPrimitive=iv;function ov(t){return typeof Uint8Array<"u"&&(gp(t)||wp(t))}B.isAnyArrayBuffer=ov;["isProxy","isExternal","isModuleNamespaceObject"].forEach(function(t){Object.defineProperty(B,t,{enumerable:!1,value:function(){throw new Error(t+" is not supported in userland")}})})});var xp=_((gT,Rp)=>{d();Rp.exports=function(e){return e&&typeof e=="object"&&typeof e.copy=="function"&&typeof e.fill=="function"&&typeof e.readUInt8=="function"}});var Mp=_(P=>{d();var Tp=Object.getOwnPropertyDescriptors||function(e){for(var r=Object.keys(e),n={},i=0;i<r.length;i++)n[r[i]]=Object.getOwnPropertyDescriptor(e,r[i]);return n},av=/%[sdj%]/g;P.format=function(t){if(!Fi(t)){for(var e=[],r=0;r<arguments.length;r++)e.push(ut(arguments[r]));return e.join(" ")}for(var r=1,n=arguments,i=n.length,o=String(t).replace(av,function(s){if(s==="%%")return"%";if(r>=i)return s;switch(s){case"%s":return String(n[r++]);case"%d":return Number(n[r++]);case"%j":try{return JSON.stringify(n[r++])}catch{return"[Circular]"}default:return s}}),a=n[r];r<i;a=n[++r])Di(a)||!br(a)?o+=" "+a:o+=" "+ut(a);return o};P.deprecate=function(t,e){if(typeof g<"u"&&g.noDeprecation===!0)return t;if(typeof g>"u")return function(){return P.deprecate(t,e).apply(this,arguments)};var r=!1;function n(){if(!r){if(g.throwDeprecation)throw new Error(e);g.traceDeprecation?console.trace(e):console.error(e),r=!0}return t.apply(this,arguments)}return n};var Mi={},Ip=/^$/;g.env.NODE_DEBUG&&(ki=g.env.NODE_DEBUG,ki=ki.replace(/[|\\{}()[\]^$+?.]/g,"\\$&").replace(/\*/g,".*").replace(/,/g,"$|^").toUpperCase(),Ip=new RegExp("^"+ki+"$","i"));var ki;P.debuglog=function(t){if(t=t.toUpperCase(),!Mi[t])if(Ip.test(t)){var e=g.pid;Mi[t]=function(){var r=P.format.apply(P,arguments);console.error("%s %d: %s",t,e,r)}}else Mi[t]=function(){};return Mi[t]};function ut(t,e){var r={seen:[],stylize:lv};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),Ts(e)?r.showHidden=e:e&&P._extend(r,e),Lt(r.showHidden)&&(r.showHidden=!1),Lt(r.depth)&&(r.depth=2),Lt(r.colors)&&(r.colors=!1),Lt(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=sv),Ci(r,t,r.depth)}P.inspect=ut;ut.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]};ut.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};function sv(t,e){var r=ut.styles[e];return r?"\x1B["+ut.colors[r][0]+"m"+t+"\x1B["+ut.colors[r][1]+"m":t}function lv(t,e){return t}function fv(t){var e={};return t.forEach(function(r,n){e[r]=!0}),e}function Ci(t,e,r){if(t.customInspect&&e&&Li(e.inspect)&&e.inspect!==P.inspect&&!(e.constructor&&e.constructor.prototype===e)){var n=e.inspect(r,t);return Fi(n)||(n=Ci(t,n,r)),n}var i=uv(t,e);if(i)return i;var o=Object.keys(e),a=fv(o);if(t.showHidden&&(o=Object.getOwnPropertyNames(e)),Zr(e)&&(o.indexOf("message")>=0||o.indexOf("description")>=0))return vs(e);if(o.length===0){if(Li(e)){var s=e.name?": "+e.name:"";return t.stylize("[Function"+s+"]","special")}if(Qr(e))return t.stylize(RegExp.prototype.toString.call(e),"regexp");if(Ni(e))return t.stylize(Date.prototype.toString.call(e),"date");if(Zr(e))return vs(e)}var l="",f=!1,c=["{","}"];if(Op(e)&&(f=!0,c=["[","]"]),Li(e)){var u=e.name?": "+e.name:"";l=" [Function"+u+"]"}if(Qr(e)&&(l=" "+RegExp.prototype.toString.call(e)),Ni(e)&&(l=" "+Date.prototype.toUTCString.call(e)),Zr(e)&&(l=" "+vs(e)),o.length===0&&(!f||e.length==0))return c[0]+l+c[1];if(r<0)return Qr(e)?t.stylize(RegExp.prototype.toString.call(e),"regexp"):t.stylize("[Object]","special");t.seen.push(e);var p;return f?p=cv(t,e,r,a,o):p=o.map(function(h){return xs(t,e,r,a,h,f)}),t.seen.pop(),dv(p,l,c)}function uv(t,e){if(Lt(e))return t.stylize("undefined","undefined");if(Fi(e)){var r="'"+JSON.stringify(e).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return t.stylize(r,"string")}if(Bp(e))return t.stylize(""+e,"number");if(Ts(e))return t.stylize(""+e,"boolean");if(Di(e))return t.stylize("null","null")}function vs(t){return"["+Error.prototype.toString.call(t)+"]"}function cv(t,e,r,n,i){for(var o=[],a=0,s=e.length;a<s;++a)Pp(e,String(a))?o.push(xs(t,e,r,n,String(a),!0)):o.push("");return i.forEach(function(l){l.match(/^\d+$/)||o.push(xs(t,e,r,n,l,!0))}),o}function xs(t,e,r,n,i,o){var a,s,l;if(l=Object.getOwnPropertyDescriptor(e,i)||{value:e[i]},l.get?l.set?s=t.stylize("[Getter/Setter]","special"):s=t.stylize("[Getter]","special"):l.set&&(s=t.stylize("[Setter]","special")),Pp(n,i)||(a="["+i+"]"),s||(t.seen.indexOf(l.value)<0?(Di(r)?s=Ci(t,l.value,null):s=Ci(t,l.value,r-1),s.indexOf(`
`)>-1&&(o?s=s.split(`
`).map(function(f){return"  "+f}).join(`
`).slice(2):s=`
`+s.split(`
`).map(function(f){return"   "+f}).join(`
`))):s=t.stylize("[Circular]","special")),Lt(a)){if(o&&i.match(/^\d+$/))return s;a=JSON.stringify(""+i),a.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(a=a.slice(1,-1),a=t.stylize(a,"name")):(a=a.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),a=t.stylize(a,"string"))}return a+": "+s}function dv(t,e,r){var n=0,i=t.reduce(function(o,a){return n++,a.indexOf(`
`)>=0&&n++,o+a.replace(/\u001b\[\d\d?m/g,"").length+1},0);return i>60?r[0]+(e===""?"":e+`
 `)+" "+t.join(`,
  `)+" "+r[1]:r[0]+e+" "+t.join(", ")+" "+r[1]}P.types=vp();function Op(t){return Array.isArray(t)}P.isArray=Op;function Ts(t){return typeof t=="boolean"}P.isBoolean=Ts;function Di(t){return t===null}P.isNull=Di;function hv(t){return t==null}P.isNullOrUndefined=hv;function Bp(t){return typeof t=="number"}P.isNumber=Bp;function Fi(t){return typeof t=="string"}P.isString=Fi;function pv(t){return typeof t=="symbol"}P.isSymbol=pv;function Lt(t){return t===void 0}P.isUndefined=Lt;function Qr(t){return br(t)&&Is(t)==="[object RegExp]"}P.isRegExp=Qr;P.types.isRegExp=Qr;function br(t){return typeof t=="object"&&t!==null}P.isObject=br;function Ni(t){return br(t)&&Is(t)==="[object Date]"}P.isDate=Ni;P.types.isDate=Ni;function Zr(t){return br(t)&&(Is(t)==="[object Error]"||t instanceof Error)}P.isError=Zr;P.types.isNativeError=Zr;function Li(t){return typeof t=="function"}P.isFunction=Li;function yv(t){return t===null||typeof t=="boolean"||typeof t=="number"||typeof t=="string"||typeof t=="symbol"||typeof t>"u"}P.isPrimitive=yv;P.isBuffer=xp();function Is(t){return Object.prototype.toString.call(t)}function Rs(t){return t<10?"0"+t.toString(10):t.toString(10)}var gv=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function bv(){var t=new Date,e=[Rs(t.getHours()),Rs(t.getMinutes()),Rs(t.getSeconds())].join(":");return[t.getDate(),gv[t.getMonth()],e].join(" ")}P.log=function(){console.log("%s - %s",bv(),P.format.apply(P,arguments))};P.inherits=ze();P._extend=function(t,e){if(!e||!br(e))return t;for(var r=Object.keys(e),n=r.length;n--;)t[r[n]]=e[r[n]];return t};function Pp(t,e){return Object.prototype.hasOwnProperty.call(t,e)}var kt=typeof Symbol<"u"?Symbol("util.promisify.custom"):void 0;P.promisify=function(e){if(typeof e!="function")throw new TypeError('The "original" argument must be of type Function');if(kt&&e[kt]){var r=e[kt];if(typeof r!="function")throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(r,kt,{value:r,enumerable:!1,writable:!1,configurable:!0}),r}function r(){for(var n,i,o=new Promise(function(l,f){n=l,i=f}),a=[],s=0;s<arguments.length;s++)a.push(arguments[s]);a.push(function(l,f){l?i(l):n(f)});try{e.apply(this,a)}catch(l){i(l)}return o}return Object.setPrototypeOf(r,Object.getPrototypeOf(e)),kt&&Object.defineProperty(r,kt,{value:r,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(r,Tp(e))};P.promisify.custom=kt;function wv(t,e){if(!t){var r=new Error("Promise was rejected with a falsy value");r.reason=t,t=r}return e(t)}function mv(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type Function');function e(){for(var r=[],n=0;n<arguments.length;n++)r.push(arguments[n]);var i=r.pop();if(typeof i!="function")throw new TypeError("The last argument must be of type Function");var o=this,a=function(){return i.apply(o,arguments)};t.apply(this,r).then(function(s){g.nextTick(a.bind(null,null,s))},function(s){g.nextTick(wv.bind(null,s,a))})}return Object.setPrototypeOf(e,Object.getPrototypeOf(t)),Object.defineProperties(e,Tp(t)),e}P.callbackify=mv});var Cp=_((_T,Lp)=>{d();var _v=Rt(),Ev=Mp(),kp=_v.Transform;function en(t){if(!(this instanceof en))return new en(t);this._toSkip=t.skip,kp.call(this,t)}Ev.inherits(en,kp);en.prototype._transform=function(t,e,r){this._toSkip==0?this.push(t):this._toSkip>t.length?this._toSkip-=t.length:(this._toSkip!==t.length&&this.push(t.slice(this._toSkip)),this._toSkip=0),r()};Lp.exports=en});var Np,Dp,Fp,Os,Bs,Xe,Ps=he(()=>{d();jr();Kr();Np=ve(Te(),1);or();Dp=ve(Rt(),1),Fp=ve(Cp(),1);Xa();Os=class t extends Np.EventEmitter{constructor(e){if(super(),this.checkConstructorArgument(e.downloadId),this.checkConstructorArgument(e.key),this.checkConstructorArgument(e.loadedFile),this.downloadId=e.downloadId,this.key=e.key?se(e.key):null,this.type=e.directory?1:0,this.directory=!!e.directory,this.directory&&!this.children&&(this.children=[]),this.api=e.api||Fe.getGlobalApi(),!(this.api instanceof Fe))throw Error("api must be a instance of API");this.loadedFile=e.loadedFile}get createdAt(){if(typeof this.timestamp<"u")return this.timestamp*1e3}checkConstructorArgument(e){if(typeof e=="string"&&!/^[\w-]+$/.test(e))throw Error(`Invalid argument: "${e}"`)}loadMetadata(e,r){if(this.size=r.s||0,this.timestamp=r.ts||0,this.type=r.t,this.directory=!!r.t,this.owner=r.u,this.name=null,this.directory&&!this.children&&(this.children=[]),!e||!r.k)return;let n=r.k.split(":");this.key=se(n[n.length-1]),this.key.length<=32?e.decryptECB(this.key):this.storage?this.key=this.storage.decryptRsaKey(this.key).slice(0,this.directory?16:32):this.key=null,r.a&&this.decryptAttributes(r.a)}decryptAttributes(e){if(!this.key)return this;e=Ur(e),De(this.key).decryptCBC(e);let r=t.unpackAttributes(e);r&&this.parseAttributes(r)}parseAttributes(e){this.attributes=e,this.name=e.n,this.label=Bs[e.lbl||0],this.favorited=!!e.fav}loadAttributes(e){let[r,n]=J(e),i=this.directory?{a:"f",c:1,ca:1,r:1,_querystring:{n:this.downloadId}}:{a:"g",p:this.downloadId};return this.api.request(i,(o,a)=>{if(o)return r(o);if(this.directory){let s=Object.create(null),l=a.f,f=l.find(u=>u.k&&u.h===u.k.split(":")[0]),c=this.key?new ne(this.key):null;this.nodeId=f.h,this.timestamp=f.ts,s[f.h]=this;for(let u of l){if(u===f)continue;let p=new t(u,this.storage);p.loadMetadata(c,u),p.downloadId=[this.downloadId,u.h],s[u.h]=p}for(let u of l){let p=s[u.p];if(p){let h=s[u.h];p.children.push(h),h.parent=p}}if(this.loadMetadata(c,f),this.key&&!this.attributes)return r(Error("Attributes could not be decrypted with provided key."));if(this.loadedFile){let u=s[this.loadedFile];typeof u>"u"?r(Error("Node (file or folder) not found in folder")):r(null,u)}else r(null,this)}else{if(this.size=a.s,this.decryptAttributes(a.at),this.key&&!this.attributes)return r(Error("Attributes could not be decrypted with provided key."));r(null,this)}}),n}download(e,r){typeof e=="function"&&(r=e,e={}),e||(e={});let n=e.start||0,i=e.returnCiphertext?n:n-n%16,o=e.end||null,a=e.maxConnections||4,s=e.initialChunkSize||128*1024,l=e.chunkSizeIncrement||128*1024,f=e.maxChunkSize||1024*1024,u={a:"g",g:1,ssl:Fe.handleForceHttps(e.forceHttps)?2:0};if(this.nodeId?u.n=this.nodeId:Array.isArray(this.downloadId)?(u._querystring={n:this.downloadId[0]},u.n=this.downloadId[1]):u.p=this.downloadId,this.directory)throw Error("Can't download: folder download isn't supported");if(!this.key&&!e.returnCiphertext)throw Error("Can't download: key isn't defined");let p=this.key&&!e.returnCiphertext?ui(this.key,{start:i,disableVerification:i!==0||o!==null}):new Dp.PassThrough,h=i===n?p:p.pipe(new Fp.default({skip:n-i})),E=e.handleRetries||t.defaultHandleRetries;return this.api.request(u,(w,A)=>{if(w)return h.emit("error",w);if(typeof A.g!="string"||A.g.substr(0,4)!=="http")return h.emit("error",Error("MEGA servers returned an invalid response, maybe caused by rate limit"));if(A.s===0)return h.end();if(o||(o=A.s-1),n>o)return h.emit("error",Error("You can't download past the end of the file."));function S(C){if(C.status!==200){if(C.status===509){let q=C.headers.get("x-mega-time-left"),ue=Error("Bandwidth limit reached: "+q+" seconds until it resets");ue.timeLimit=q,h.emit("error",ue);return}h.emit("error",Error("MEGA returned a "+C.status+" status code"))}}function R(C){h.emit("error",C)}let M=0;if(h.on("data",C=>{M+=C.length,h.emit("progress",{bytesLoaded:M,bytesTotal:A.s})}),a===1){let C=new Vr;h.on("close",()=>{C.abort()}),this.api.fetch(A.g+"/"+i+"-"+o,{signal:C.signal}).then(q=>{S(q);let ue=q.body;if(ue)if(ue.pipe)q.body.pipe(p);else if(ue.getReader){let Ze=ue.getReader(),ce=({done:le,value:Ct})=>{if(le)p.end();else return p.write(Ct),Ze.read().then(ce)};Ze.read().then(ce)}else throw Error("Single connection streaming not supported by fetch");else throw Error("Missing response body")}).catch(R);return}let v={},I=0,j=0,F=!1,X=i,U=s;h.on("error",()=>{F=!0}),h.on("close",()=>{F=!0});let ee=()=>{if(X>o){F=!0,I===j&&p.end();return}let C=X,q=Math.min(o,C+U-1),ue=I++,Ze=0,ce=()=>{Ze++,this.api.fetch(A.g+"/"+C+"-"+q).then(le=>(S(le),le.arrayBuffer())).then(le=>{let Ct=y.Buffer.from(le);v[ue]=Ct,j===ue&&qe()},le=>{E(Ze,le,Ct=>{Ct?R(Ct):ce()})})};ce(),X=q+1,U<f&&(U=U+l)},qe=()=>{let C;for(;;){let q=v[j];if(!q||(C=!p.write(q),delete v[j],j++,C))break}F&&I===j&&p.end(),C?p.once("drain",qe):ee()};for(let C=0;C<a;C++)ee()}),r&&oi(h,r),h}downloadBuffer(e,r){let[n,i]=J(r);return this.download(e,n),i}link(e,r){arguments.length===1&&typeof e=="function"&&(r=e,e={noKey:!1});let[n,i]=J(r);typeof e=="boolean"&&(e={noKey:e});let o=`https://mega.nz/${this.directory?"folder":"file"}/${this.downloadId}`;return!e.noKey&&this.key&&(o+=`#${G(this.key)}`),!e.noKey&&this.loadedFile&&(o+=`/file/${this.loadedFile}`),n(null,o),i}find(e,r){if(!this.children)throw Error("You can only call .find on directories");if(typeof e=="string"){let n=e;e=i=>i.name===n}else if(Array.isArray(e)){let n=e;e=i=>n.includes(i.name)}if(typeof e!="function")throw Error("Query must be a file matching function, an array of valid file names or a string with a file name");return this.children.reduce((n,i)=>n||(e(i)?i:i.children&&r?i.find(e,r):null),null)}filter(e,r){if(!this.children)throw Error("You can only call .filter on directories");if(typeof e=="string"){let n=e;e=i=>i.name===n}else if(Array.isArray(e)){let n=e;e=i=>n.includes(i.name)}if(typeof e!="function")throw Error("Query must be a file matching function, an array of valid file names or a string with a file name");return this.children.reduce((n,i)=>(e(i)&&n.push(i),i.children&&r?n.concat(i.filter(e,r)):n),[])}navigate(e){if(!this.children)throw Error("You can only call .navigate on directories");if(typeof e=="string")e=e.split("/");else if(!Array.isArray(e))throw Error("Query must be an array or a string");return e.reduce((r,n)=>r&&r.children&&r.children.find(i=>i.name===n),this)}static fromURL(e,r={}){if(typeof e=="object")return new t(e);let n=new URL(e);if(n.hostname!=="mega.nz"&&n.hostname!=="mega.co.nz")throw Error("Invalid URL: wrong hostname");if(!n.hash)throw Error("Invalid URL: no hash");if(n.pathname.match(/\/(file|folder)\//)!==null){let i=n.hash.substr(1).split("/file/"),o=n.pathname.substring(n.pathname.lastIndexOf("/")+1,n.pathname.length+1),a=i[0];if(o&&!a||!o&&a)throw Error("Invalid URL: too few arguments");return new t({downloadId:o,key:a,directory:n.pathname.indexOf("/folder/")>=0,loadedFile:i[1],...r})}else{let i=n.hash.split("!");if(i[0]!=="#"&&i[0]!=="#F")throw Error("Invalid URL: format not recognized");if(i.length<=1)throw Error("Invalid URL: too few arguments");if(i.length>=(i[0]==="#"?4:5))throw Error("Invalid URL: too many arguments");return new t({downloadId:i[1],key:i[2],directory:i[0]==="#F",loadedFile:i[3],...r})}}static unpackAttributes(e){let r=0;for(;r<e.length&&e.readUInt8(r);)r++;if(e=e.slice(0,r).toString(),e.substr(0,6)==='MEGA{"')try{return JSON.parse(e.substr(4))}catch{}}static defaultHandleRetries(e,r,n){e>8?n(r):setTimeout(n,1e3*Math.pow(2,e))}},Bs=["","red","orange","yellow","green","blue","purple","grey"],Xe=Os});function qi(t,e,r){let n=t.shareKeys;Array.isArray(e)||(e=Up(e)),r||(r=e.map(o=>tn(n,o)).reduce((o,a)=>o.concat(a)).filter((o,a,s)=>a===s.indexOf(o)));let i=[r,e.map(o=>o.nodeId),[]];for(let o=r.length;o--;){let a=new ne(n[r[o]]);for(let s=e.length;s--;){let l=y.Buffer.from(e[s].key);l&&(l.length===32||l.length===16)&&i[2].push(o,s,G(a.encryptECB(l)))}}return i}function Up(t){return[t].concat((t.children||[]).map(Up).reduce((e,r)=>e.concat(r),[]))}function tn(t,e){let r=e.nodeId,n=e.parent,i=[];return t[r]&&i.push(r),n?i.concat(tn(t,n)):i}var Ms,qp,ks,Ui,Ls=he(()=>{d();Ps();Ms=ve(Rt(),1);jr();or();Kr();qp={},ks=class t extends Xe{constructor(e,r){if(super(e),this.storage=r,this.api=r.api,this.nodeId=e.h,this.timestamp=e.ts,this.type=e.t,this.directory=!!this.type,this.directory&&!this.children&&(this.children=[]),e.k){let n=e.k.split("/"),i=r.aes;for(let o of n){let a=o.split(":")[0];if(a===r.user){e.k=o;break}let s=r.shareKeys[a];if(s){e.k=o,i=qp[a],i||(i=qp[a]=new ne(s));break}}this.loadMetadata(i,e)}}loadAttributes(){throw Error("This is not needed for files loaded from logged in sessions")}mkdir(e,r){if(!this.directory)throw Error("node isn't a directory");let[n,i]=J(r);if(typeof e=="string"&&(e={name:e}),e.attributes||(e.attributes={}),e.name&&(e.attributes.n=e.name),!e.attributes.n)throw Error("file name is required");if(e.target||(e.target=this),e.key||(e.key=y.Buffer.from(globalThis.crypto.getRandomValues(new Uint8Array(16)))),e.key.length!==16)throw Error("wrong key length, must be 128bit");let o=e.key,a=t.packAttributes(e.attributes);De(o).encryptCBC(a);let s=y.Buffer.from(o);this.storage.aes.encryptECB(s);let l={a:"p",t:e.target.nodeId?e.target.nodeId:e.target,n:[{h:"xxxxxxxx",t:1,a:G(a),k:G(s)}]},f=tn(this.storage.shareKeys,this);return f.length>0&&(l.cr=qi(this.storage,[{nodeId:"xxxxxxxx",key:o}],f)),this.api.request(l,(c,u)=>{if(c)return n(c);let p=this.storage._importFile(u.f[0]);this.storage.emit("add",p),n(null,p)}),i}upload(e,r,n){if(!this.directory)throw Error("node is not a directory");arguments.length===2&&typeof r=="function"&&([n,r]=[r,null]);let[i,o]=J(n);if(typeof e=="string"&&(e={name:e}),e.attributes||(e.attributes={}),e.name&&(e.attributes.n=e.name),!e.attributes.n)throw Error("File name is required.");if(!(typeof e.size=="number"&&e.size>=0)&&!(r&&typeof r.pipe!="function"&&typeof r.length=="number")&&!e.allowUploadBuffering)throw Error("Specify a file size or set allowUploadBuffering to true");e.target||(e.target=this);let a,s=se(e.key);s||(s=globalThis.crypto.getRandomValues(new Uint8Array(24))),s instanceof y.Buffer||(s=y.Buffer.from(s));let l=e.uploadCiphertext?32:24;if(s.length!==l)throw Error("Wrong key length. Key must be 192bit");e.uploadCiphertext&&(a=s,s=za(s).slice(0,24)),e.key=s;let f=[],c=(h,E,w,A)=>{if(h)return p(h);if(!w||w.length===0){p(Error("Server returned a invalid response while uploading"));return}let S=Number(w.toString());if(S<0){p(Error("Server returned error "+S+" while uploading"));return}if(f[E]=w,E===0&&!a&&(a=A.key),e.thumbnailImage&&!f[1]||e.previewImage&&!f[2]||!f[0])return;let R=t.packAttributes(e.attributes);De(a).encryptCBC(R);let M=y.Buffer.from(a);this.storage.aes.encryptECB(M);let v={h:G(f[0]),t:0,a:G(R),k:G(M)};f.length!==1&&(v.fa=f.slice(1).map((F,X)=>X+"*"+G(F)).filter(F=>F).join("/"));let I={a:"p",t:e.target.nodeId?e.target.nodeId:e.target,n:[v]},j=tn(this.storage.shareKeys,this);j.length>0&&(I.cr=qi(this.storage,[{nodeId:v.h,key:a}],j)),this.api.request(I,(F,X)=>{if(F)return p(F);let U=this.storage._importFile(X.f[0]);this.storage.emit("add",U),u.emit("complete",U),i&&i(null,U)})};e.thumbnailImage&&this._uploadAttribute(e,e.thumbnailImage,1,c),e.previewImage&&this._uploadAttribute(e,e.previewImage,2,c);let u=this._upload(e,r,0,c);function p(h){u.listenerCount("error")?u.emit("error",h):i(h)}return u.complete=o,u}_upload(e,r,n,i){let o=e.uploadCiphertext?new Ms.PassThrough:fi(e.key),a=o,s=e.size;return r&&typeof r.pipe!="function"&&(s=r.length,a.end(r)),s!=null?(s===0&&o.end(),this._uploadWithSize(a,s,o,n,e,i)):a=Bd(a,l=>{this._uploadWithSize(a,l,o,n,e,i)}),r&&typeof r.pipe=="function"&&r.pipe(a),a}_uploadAttribute(e,r,n,i){let o=(a,s)=>{if(a)return i(a);let l=s.length,f=Math.ceil(l/16)*16-l;f!==0&&(s=y.Buffer.concat([s,y.Buffer.alloc(f)])),(e.handle?De(e.key):new ne(e.key.slice(0,16))).encryptCBC(s);let u=new Ms.PassThrough;u.end(s),this._uploadWithSize(u,s.length,u,n,e,i)};if(r instanceof y.Buffer){o(null,r);return}oi(r,o)}_uploadWithSize(e,r,n,i,o,a){let s=Fe.handleForceHttps(o.forceHttps)?2:0,l=i===0?{a:"u",ssl:s,s:r,ms:0,r:0,e:0,v:2}:{a:"ufa",ssl:s,s:r};o.handle&&(l.h=o.handle);let f=i===0?o.initialChunkSize||128*1024:r,c=o.chunkSizeIncrement||128*1024,u=o.maxChunkSize||1024*1024,p=o.maxConnections||4,h=o.handleRetries||Xe.defaultHandleRetries,E=f,w=0,A=!1,S=0,R,M,v,I,j,F=0,X=()=>{I=Math.min(E,r-S),M=y.Buffer.alloc(I),w++,E<u&&(E+=c),j=0,R&&(R.copy(M),j=Math.min(R.length,I),R=R.length>I?R.slice(I):null),j===I?U():(A=!0,qe())},U=()=>{let C=S,q=M,ue=0,Ze=()=>{ue++,this.api.fetch(v+"/"+(i===0?C:i-1),{method:"POST",body:q,headers:{"content-length":q.length}}).then(ce=>{if(ce.status!==200)throw Error("MEGA returned a "+ce.status+" status code");return ce.arrayBuffer()}).then(ce=>{F+=q.length,e.emit("progress",{bytesLoaded:ee,bytesUploaded:F,bytesTotal:r});let le=y.Buffer.from(ce);le.length>0?(n.end(),g.nextTick(()=>{a(null,i,le,n)})):S<r&&!A&&X()},ce=>{h(ue,ce,le=>{le?e.emit("error",le):Ze()})})};Ze(),M=null,S+=I,S<r&&!A&&w<p&&X()},ee=0,qe=()=>{for(;;){let C=n.read();if(C===null){n.once("readable",qe);break}if(ee+=C.length,C.copy(M,j),j+=C.length,j>=I){A=!1,R=C.slice(C.length-(j-I)),U();break}}};n.on("end",()=>{r&&ee!==r&&e.emit("error",Error("Specified data size does not match: "+r+" !== "+ee))}),this.api.request(l,(C,q)=>{if(C)return a(C);v=q.p,X()})}uploadAttribute(e,r,n){let[i,o]=J(n);if(typeof e=="string"&&(e=["thumbnail","preview"].indexOf(e)),e!==0&&e!==1)throw Error("Invalid attribute type");return this._uploadAttribute({key:this.key,handle:this.nodeId},r,e+1,(a,s,l,f)=>{if(a)return i(a);let c={a:"pfa",n:this.nodeId,fa:e+"*"+G(l)};this.api.request(c,(u,p)=>{if(u)return i(u);i(null,this)})}),o}delete(e,r){return typeof e=="function"&&(r=e,e=void 0),typeof e>"u"&&(e=this.parent===this.storage.trash),e?this.api.request({a:"d",n:this.nodeId},r):this.moveTo(this.storage.trash,r)}moveTo(e,r){if(typeof e=="string"&&(e=this.storage.files[e]),!(e instanceof Xe))throw Error("target must be a folder or a nodeId");let n={a:"m",n:this.nodeId,t:e.nodeId},i=tn(this.storage.shareKeys,e);return i.length>0&&(n.cr=qi(this.storage,[this],i)),this.api.request(n,r)}setAttributes(e,r){let[n,i]=J(r);Object.assign(this.attributes,e);let o=t.packAttributes(this.attributes);return De(this.key).encryptCBC(o),this.api.request({a:"a",n:this.nodeId,at:G(o)},a=>{this.parseAttributes(this.attributes),n(a)}),i}rename(e,r){return this.setAttributes({n:e},r)}setLabel(e,r){if(typeof e=="string"&&(e=Bs.indexOf(e)),typeof e!="number"||Math.floor(e)!==e||e<0||e>7)throw Error("label must be a integer between 0 and 7 or a valid label name");return this.setAttributes({lbl:e},r)}setFavorite(e,r){return this.setAttributes({fav:e?1:0},r)}link(e,r){arguments.length===1&&typeof e=="function"&&(r=e,e={noKey:!1}),typeof e=="boolean"&&(e={noKey:e}),e||(e={});let n=e.__folderKey;if(this.directory&&!n)return this.shareFolder(e,r);let[i,o]=J(r);return this.api.request({a:"l",n:this.nodeId},(a,s)=>{if(a)return i(a);let l=`https://mega.nz/${n?"folder":"file"}/${s}`;!e.noKey&&this.key&&(l+=`#${G(n||this.key)}`),i(null,l)}),o}shareFolder(e,r){if(!this.directory)throw Error("node isn't a folder");let n=this.nodeId,i=this.storage.shareKeys[n];if(i)return this.link(Object.assign({__folderKey:i},e),r);let o=se(e.key);o||(o=globalThis.crypto.getRandomValues(new Uint8Array(16))),o instanceof y.Buffer||(o=y.Buffer.from(o));let[a,s]=J(r);if(o.length!==16)return a(Error("share key must be 16 byte / 22 characters")),s;this.storage.shareKeys[n]=o;let l=y.Buffer.from(n+n);this.storage.aes.encryptECB(l);let f={a:"s2",n,s:[{u:"EXP",r:0}],ok:G(this.storage.aes.encryptECB(y.Buffer.from(o))),ha:G(l),cr:qi(this.storage,this)};return this.api.request(f,c=>{if(c)return a(c);this.link(Object.assign({__folderKey:o},e),a)}),s}unshare(e){return this.directory?this.unshareFolder(e):this.api.request({a:"l",n:this.nodeId,d:1},e)}unshareFolder(e){if(!this.directory)throw Error("node isn't a folder");return delete this.storage.shareKeys[this.nodeId],this.api.request({a:"s2",n:this.nodeId,s:[{u:"EXP",r:""}]},e)}importFile(e,r){let[n,i]=J(r);if(!this.directory)throw Error("importFile can only be called on directories");if(typeof e=="string"&&(e=Xe.fromURL(e)),!(e instanceof Xe))throw Error("First argument of importFile should be a File or a URL string");if(!e.key)return n(Error("Can't import files without encryption keys")),i;let o=(a,s)=>{if(a)return n(a);let l=t.packAttributes(s.attributes);De(s.key).encryptCBC(l);let f=Array.isArray(s.downloadId)?s.downloadId[1]:s.downloadId,c={a:"p",t:this.nodeId,n:[{ph:f,t:0,a:G(l),k:G(this.storage.aes.encryptECB(s.key))}]};this.api.request(c,(u,p)=>{if(u)return n(u);let h=this.storage._importFile(p.f[0]);this.storage.emit("add",h),n(null,h)})};return e.attributes?o(null,e):e.loadAttributes(o),i}static packAttributes(e){let r=JSON.stringify(e);r=y.Buffer.from(`MEGA${r}`);let n=y.Buffer.alloc(Math.ceil(r.length/16)*16);return r.copy(n),n}};Ui=ks});var jp,Cs,Sv,Av,vv,Ns,Wp=he(()=>{d();jr();Ud();Kr();jp=ve(Te(),1);Ls();or();Cs=class t extends jp.EventEmitter{constructor(e,r){super(),arguments.length===1&&typeof e=="function"&&(r=e,e={});let[n,i]=J(r);this.ready=i,e.keepalive=e.keepalive===void 0?!0:!!e.keepalive,e.autoload=e.autoload===void 0?!0:!!e.autoload,e.autologin=e.autologin===void 0?!0:!!e.autologin,this.api=new Fe(e.keepalive,e),this.files={},this.options=e,this.status="closed",e.autologin?this.login(n):g.nextTick(()=>{n(null,this)})}login(e){let[r,n]=J(e);if(typeof this.options.email!="string")return g.nextTick(()=>{r(Error("starting a session without credentials isn't supported"))}),n;let i=()=>{this.status="ready",r(null,this),this.emit("ready",this)},o=u=>{this.api.request({a:"ug"},(p,h)=>{if(p)return u(p);this.name=h.name,this.user=h.u,this.options.autoload?this.reload(!0,E=>{if(E)return u(E);i()}):i()})};this.email=this.options.email.toLowerCase();let a=()=>{let u=Va(y.Buffer.from(this.options.password)),p=new ne(u),h=G(p.stringhash(y.Buffer.from(this.email))),E={a:"us",user:this.email,uh:h};c(E,p)},s=u=>{Ka(y.Buffer.from(this.options.password),u,(p,h)=>{if(p)return r(p);let E=new ne(h.slice(0,16)),w=G(h.slice(16)),A={a:"us",user:this.email,uh:w};c(A,E)})},l=u=>{let p=atob(u),h=p.length,E=new Uint8Array(h);for(let w=0;w<h;w++)E[w]=p.charCodeAt(w);return E},f=(u,p)=>{this.key=se(u.k),p.decryptECB(this.key),this.aes=new ne(this.key);let h=se(u.csid),E=this.aes.decryptECB(se(u.privk)),w=qd(E);if(!w)throw Error("invalid credentials");let A=G(Ja(h,w).slice(0,43));this.api.sid=this.sid=A,this.RSAPrivateKey=w,o(r)},c=(u,p)=>{delete this.options.password,this.options.secondFactorCode&&(u.mfa=this.options.secondFactorCode.toString()),this.api.request(u,(h,E)=>{if(h)return r(h);f(E,p)})};return this.options.backendLogin!=null?(console.log("Login To Mega Using Back End"),this.options.backendLogin(this.api.counterId).then(u=>{console.log("Login To Mega Using Back End, Response Recevied");let p=u.response;for(;typeof p=="string";)try{p=JSON.parse(p)}catch{break}p=Array.isArray(p)?p[0]:p;let h=l(u.aesBase64);f(p,new ne(y.Buffer.from(h)))})):this.api.request({a:"us0",user:this.email},(u,p)=>{if(u)return r(u);if(p.v===1)return a();if(p.v===2)return s(p);r(Error("Account version not supported"))}),this.status="connecting",n}reload(e,r){typeof e=="function"&&([e,r]=[r,e]);let[n,i]=J(r);return this.status==="connecting"&&!e?(this.once("ready",()=>{this.reload(e,n)}),i):(this.mounts=[],this.api.request({a:"f",c:1},(o,a)=>{if(o)return n(o);this.shareKeys=a.ok.reduce((s,l)=>{let f=l.h,c=this.aes.encryptECB(y.Buffer.from(f+f));return Ld(se(l.ha),c)&&(s[f]=this.aes.decryptECB(se(l.k))),s},{});for(let s of a.f)if(s=this._importFile(s),a.ph!==void 0&&(s.shareId=a.ph.find(l=>l.h===s.nodeId)?.ph,s.shared=!!s.shareId,s.shared)){s.shareURL=`https://mega.nz/${s.directory?"folder":"file"}/${s.shareId}`;let l=s.directory?this.shareKeys[s.nodeId]:s.key;l&&(s.shareURL+="#"+G(l))}n(null,this.mounts)}),this.api.on("sc",o=>{let a={};o.forEach(s=>{if(s.a==="u"){let l=this.files[s.n];l&&(l.timestamp=s.ts,l.decryptAttributes(s.at),l.emit("update"),this.emit("update",l))}else s.a==="d"?a[s.n]=!0:s.a==="t"&&s.t.f.forEach(l=>{let f=this.files[l.h];if(f){delete a[l.h];let c=f.parent;if(c.nodeId===l.p)return;c.children.splice(c.children.indexOf(f),1),f.parent=this.files[l.p],f.parent.children.push(f),f.emit("move",c),this.emit("move",f,c)}else this.emit("add",this._importFile(l))})}),Object.keys(a).forEach(s=>{let l=this.files[s],f=l.parent;f.children.splice(f.children.indexOf(l),1),this.emit("delete",l),l.emit("delete")})}),i)}_importFile(e){if(!this.files[e.h]){let r=this.files[e.h]=new Ui(e,this);if(e.t===Sv&&(this.root=r,r.name="Cloud Drive"),e.t===vv&&(this.trash=r,r.name="Rubbish Bin"),e.t===Av&&(this.inbox=r,r.name="Inbox"),e.t>1&&this.mounts.push(r),e.p){let n=this.files[e.p];n&&(n.children.push(r),r.parent=n)}}return this.files[e.h]}mkdir(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.mkdir(e,r)}upload(e,r,n){if(this.status!=="ready")throw Error("storage is not ready");return this.root.upload(e,r,n)}find(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.find(e,r)}filter(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.filter(e,r)}navigate(e,r){if(this.status!=="ready")throw Error("storage is not ready");return this.root.navigate(e,r)}close(e){return this.status="closed",this.api.close(),this.api.request({a:"sml"},e)}getAccountInfo(e){let[r,n]=J(e);return this.api.request({a:"uq",strg:1,xfer:1,pro:1},(i,o)=>{i&&r(i);let a={};a.type=o.utype,a.spaceUsed=o.cstrg,a.spaceTotal=o.mstrg,a.downloadBandwidthTotal=o.mxfer||Math.pow(1024,5)*10,a.downloadBandwidthUsed=o.caxfer||0,a.sharedBandwidthUsed=o.csxfer||0,a.sharedBandwidthLimit=o.srvratio,r(null,a)}),n}toJSON(){return{key:G(this.key),sid:this.sid,name:this.name,user:this.user,options:this.options}}static fromJSON(e){let r=new t(Object.assign(e.options,{autoload:!1,autologin:!1}));return r.key=Ur(e.key),r.aes=new ne(r.key),r.api.sid=r.sid=e.sid,r.name=e.name,r.user=e.user,r}decryptRsaKey(e){return Ja(e,this.RSAPrivateKey)}},Sv=2,Av=3,vv=4,Ns=Cs});var Rv=_((VT,$p)=>{d();jr();Wp();Ls();Ps();Kr();function Qe(t,e){return new Ns(t,e)}Qe.Storage=Ns;Qe.File=Xe;Qe.MutableFile=Ui;Qe.API=Fe;Qe.file=Xe.fromURL;Qe.encrypt=fi;Qe.decrypt=ui;Qe.verify=kd;$p.exports=Qe});return Rv();})();
/*! Bundled license information:

ieee754/index.js:
  (*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> *)

buffer/index.js:
  (*!
   * The buffer module from node.js, for the browser.
   *
   * @author   Feross Aboukhadijeh <https://feross.org>
   * @license  MIT
   *)

safe-buffer/index.js:
  (*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> *)
*/