@zenfs/core 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser.min.js +5 -5
- package/dist/browser.min.js.map +4 -4
- package/eslint.shared.js +0 -4
- package/package.json +2 -3
- package/scripts/build.js +27 -24
package/dist/browser.min.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
"use strict";var ZenFS=(()=>{var th=Object.create;var si=Object.defineProperty;var _a=Object.getOwnPropertyDescriptor;var ih=Object.getOwnPropertyNames;var nh=Object.getPrototypeOf,rh=Object.prototype.hasOwnProperty;var wa=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var s=(e,t)=>si(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Dn=(e,t)=>{for(var i in t)si(e,i,{get:t[i],enumerable:!0})},xa=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of ih(t))!rh.call(e,r)&&r!==i&&si(e,r,{get:()=>t[r],enumerable:!(n=_a(t,r))||n.enumerable});return e};var qi=(e,t,i)=>(i=e!=null?th(nh(e)):{},xa(t||!e||!e.__esModule?si(i,"default",{value:e,enumerable:!0}):i,e)),oh=e=>xa(si({},"__esModule",{value:!0}),e);var ka=["class","method","getter","setter","accessor","field","value","get","set"],ji=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,sh=(e,t,i,n)=>({kind:ka[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(ji(r||null))}),va=(e,t,i)=>{for(var n=0,r=e[t>>1],o=r&&r.length;n<o;n++)t&1?r[n].call(i):i=(0,r[n])(i);return i},_e=(e,t,i,n,r,o)=>{var a,c,l,f,d,h=t&7,b=!!(t&8),p=!!(t&16),w=h>3?e.length+1:h?b?1:2:0,g=ka[h+5],A=h>3&&(e[w-1]=[]),k=e[w]||(e[w]=[]),v=h&&(!p&&!b&&(r=r.prototype),h<5&&(h>3||!p)&&_a(h<4?r:{get[i](){return Sa(this,o)},set[i](F){return Ea(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var N=n.length-1;N>=0;N--)f=sh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>ah(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?Sa:ch)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>Ea(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[N])(h?h<4?p?o:v[g]:h>4?void 0:{get:v.get,set:v.set}:r,f),l._=1,h^4||c===void 0?ji(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(ji(a=c.get)&&(v.get=a),ji(a=c.set)&&(v.set=a),ji(a=c.init)&&A.unshift(a));return v&&si(r,i,v),p?h^4?o:v:r};var to=(e,t,i)=>t.has(e)||Dt("Cannot "+i),ah=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),Sa=(e,t,i)=>(to(e,t,"read from private field"),i?i.call(e):t.get(e));var Ea=(e,t,i,n)=>(to(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),ch=(e,t,i)=>(to(e,t,"access private method"),i);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Dt("Object expected");var n;i&&(n=t[wa("asyncDispose")]),n===void 0&&(n=t[wa("dispose")]),typeof n!="function"&&Dt("Object not disposable"),e.push([i,n,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},r=a=>t=i?new n(a,t,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=e.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(r(l),o()))}catch(l){r(l)}if(i)throw t};return o()};var Pa=T(jn=>{"use strict";jn.byteLength=yh;jn.toByteArray=bh;jn.fromByteArray=Sh;var qe=[],Fe=[],ph=typeof Uint8Array<"u"?Uint8Array:Array,oo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Wt=0,Aa=oo.length;Wt<Aa;++Wt)qe[Wt]=oo[Wt],Fe[oo.charCodeAt(Wt)]=Wt;var Wt,Aa;Fe[45]=62;Fe[95]=63;function Oa(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var n=i===t?0:4-i%4;return[i,n]}s(Oa,"getLens");function yh(e){var t=Oa(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(yh,"byteLength");function mh(e,t,i){return(t+i)*3/4-i}s(mh,"_byteLength");function bh(e){var t,i=Oa(e),n=i[0],r=i[1],o=new ph(mh(e,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,o[a++]=t&255),r===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(bh,"toByteArray");function gh(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(gh,"tripletToBase64");function wh(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(gh(n));return r.join("")}s(wh,"encodeChunk");function Sh(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(wh(e,a,a+o>c?c:a+o));return n===1?(t=e[i-1],r.push(qe[t>>2]+qe[t<<4&63]+"==")):n===2&&(t=(e[i-2]<<8)+e[i-1],r.push(qe[t>>10]+qe[t>>4&63]+qe[t<<2&63]+"=")),r.join("")}s(Sh,"fromByteArray")});var Ta=T(so=>{so.read=function(e,t,i,n,r){var o,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,p=e[t+h];for(h+=b,o=p&(1<<-d)-1,p>>=-d,d+=c;d>0;o=o*256+e[t+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+e[t+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};so.write=function(e,t,i,n,r,o){var a,c,l,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=b/l:t+=b*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(t*l-1)*Math.pow(2,r),a=a+h):(c=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+p]=c&255,p+=w,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;e[i+p]=a&255,p+=w,a/=256,f-=8);e[i+p-w]|=g*128}});var Ie=T(ui=>{"use strict";var ao=Pa(),li=Ta(),Ra=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=Fh;ui.INSPECT_MAX_BYTES=50;var qn=2147483647;ui.kMaxLength=qn;m.TYPED_ARRAY_SUPPORT=Eh();!m.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 Eh(){try{let e=new Uint8Array(1),t={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}s(Eh,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function ct(e){if(e>qn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}s(ct,"createBuffer");function m(e,t,i){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return uo(e)}return Ba(e,t,i)}s(m,"Buffer");m.poolSize=8192;function Ba(e,t,i){if(typeof e=="string")return xh(e,t);if(ArrayBuffer.isView(e))return kh(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($e(e,ArrayBuffer)||e&&$e(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(e,SharedArrayBuffer)||e&&$e(e.buffer,SharedArrayBuffer)))return lo(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return m.from(n,t,i);let r=vh(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return m.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s(Ba,"from");m.from=function(e,t,i){return Ba(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function Da(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}s(Da,"assertSize");function _h(e,t,i){return Da(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(_h,"alloc");m.alloc=function(e,t,i){return _h(e,t,i)};function uo(e){return Da(e),ct(e<0?0:ho(e)|0)}s(uo,"allocUnsafe");m.allocUnsafe=function(e){return uo(e)};m.allocUnsafeSlow=function(e){return uo(e)};function xh(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=Ma(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(xh,"fromString");function co(e){let t=e.length<0?0:ho(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(co,"fromArrayLike");function kh(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return lo(t.buffer,t.byteOffset,t.byteLength)}return co(e)}s(kh,"fromArrayView");function lo(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),Object.setPrototypeOf(n,m.prototype),n}s(lo,"fromArrayBuffer");function vh(e){if(m.isBuffer(e)){let t=ho(e.length)|0,i=ct(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||yo(e.length)?ct(0):co(e);if(e.type==="Buffer"&&Array.isArray(e.data))return co(e.data)}s(vh,"fromObject");function ho(e){if(e>=qn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+qn.toString(16)+" bytes");return e|0}s(ho,"checked");function Fh(e){return+e!=e&&(e=0),m.alloc(+e)}s(Fh,"SlowBuffer");m.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype},"isBuffer");m.compare=s(function(t,i){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),$e(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(t)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let n=t.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(t[o]!==i[o]){n=t[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=s(function(t){switch(String(t).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}},"isEncoding");m.concat=s(function(t,i){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<t.length;++n)i+=t[n].length;let r=m.allocUnsafe(i),o=0;for(n=0;n<t.length;++n){let a=t[n];if($e(a,Uint8Array))o+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(m.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function Ma(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$e(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return fo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Ka(e).length;default:if(r)return n?-1:fo(e).length;t=(""+t).toLowerCase(),r=!0}}s(Ma,"byteLength");m.byteLength=Ma;function Ih(e,t,i){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,t>>>=0,i<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Dh(this,t,i);case"utf8":case"utf-8":return Ua(this,t,i);case"ascii":return Ch(this,t,i);case"latin1":case"binary":return Bh(this,t,i);case"base64":return Nh(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Mh(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(Ih,"slowToString");m.prototype._isBuffer=!0;function Ut(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(Ut,"swap");m.prototype.swap16=s(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<t;i+=2)Ut(this,i,i+1);return this},"swap16");m.prototype.swap32=s(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<t;i+=4)Ut(this,i,i+3),Ut(this,i+1,i+2);return this},"swap32");m.prototype.swap64=s(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<t;i+=8)Ut(this,i,i+7),Ut(this,i+1,i+6),Ut(this,i+2,i+5),Ut(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ua(this,0,t):Ih.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=s(function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0},"equals");m.prototype.inspect=s(function(){let t="",i=ui.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");Ra&&(m.prototype[Ra]=m.prototype.inspect);m.prototype.compare=s(function(t,i,n,r,o){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(i===void 0&&(i=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let a=o-r,c=n-i,l=Math.min(a,c),f=this.slice(r,o),d=t.slice(i,n);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function Wa(e,t,i,n,r){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,yo(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Na(e,t,i,n,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Na(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Wa,"bidirectionalIndexOf");function Na(e,t,i,n,r){let o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(e,f+h)!==l(t,h)){d=!1;break}if(d)return f}return-1}s(Na,"arrayIndexOf");m.prototype.includes=s(function(t,i,n){return this.indexOf(t,i,n)!==-1},"includes");m.prototype.indexOf=s(function(t,i,n){return Wa(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Wa(this,t,i,n,!1)},"lastIndexOf");function Ah(e,t,i,n){i=Number(i)||0;let r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(t.substr(a*2,2),16);if(yo(c))return a;e[i+a]=c}return a}s(Ah,"hexWrite");function Oh(e,t,i,n){return $n(fo(t,e.length-i),e,i,n)}s(Oh,"utf8Write");function Ph(e,t,i,n){return $n(qh(t),e,i,n)}s(Ph,"asciiWrite");function Th(e,t,i,n){return $n(Ka(t),e,i,n)}s(Th,"base64Write");function Rh(e,t,i,n){return $n($h(t,e.length-i),e,i,n)}s(Rh,"ucs2Write");m.prototype.write=s(function(t,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return Ah(this,t,i,n);case"utf8":case"utf-8":return Oh(this,t,i,n);case"ascii":case"latin1":case"binary":return Ph(this,t,i,n);case"base64":return Th(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Rh(this,t,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function Nh(e,t,i){return t===0&&i===e.length?ao.fromByteArray(e):ao.fromByteArray(e.slice(t,i))}s(Nh,"base64Slice");function Ua(e,t,i){i=Math.min(e.length,i);let n=[],r=t;for(;r<i;){let o=e[r],a=null,c=o>239?4:o>223?3:o>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[r+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=e[r+1],f=e[r+2],d=e[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=c}return Lh(n)}s(Ua,"utf8Slice");var La=4096;function Lh(e){let t=e.length;if(t<=La)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=La));return i}s(Lh,"decodeCodePointsArray");function Ch(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]&127);return n}s(Ch,"asciiSlice");function Bh(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}s(Bh,"latin1Slice");function Dh(e,t,i){let n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=t;o<i;++o)r+=zh[e[o]];return r}s(Dh,"hexSlice");function Mh(e,t,i){let n=e.slice(t,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Mh,"utf16leSlice");m.prototype.slice=s(function(t,i){let n=this.length;t=~~t,i=i===void 0?n:~~i,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<t&&(i=t);let r=this.subarray(t,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function Z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}s(Z,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t+--i],o=1;for(;i>0&&(o*=256);)r+=this[t+--i]*o;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");m.prototype.readBigUInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Vi(t,this.length-8);let r=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Vi(t,this.length-8);let r=i*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));m.prototype.readIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=i,o=1,a=this[t+--r];for(;r>0&&(o*=256);)a+=this[t+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");m.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");m.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");m.prototype.readBigInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Vi(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Vi(t,this.length-8);let r=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!1,52,8)},"readDoubleBE");function fe(e,t,i,n,r,o){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}s(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=1,a=0;for(this[i]=t&255;++a<n&&(o*=256);)this[i+a]=t/o&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=n-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=t&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeUInt32BE");function ja(e,t,i,n,r){Ha(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,i}s(ja,"wrtBigUInt64LE");function qa(e,t,i,n,r){Ha(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o=o>>8,e[i+6]=o,o=o>>8,e[i+5]=o,o=o>>8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a=a>>8,e[i+2]=a,a=a>>8,e[i+1]=a,a=a>>8,e[i]=a,i+8}s(qa,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return ja(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return qa(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<n&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=n-1,a=1,c=0;for(this[i+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");m.prototype.writeInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),this[i]=t&255,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=xt(s(function(t,i=0){return ja(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return qa(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function $a(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s($a,"checkIEEE754");function za(e,t,i,n,r){return t=+t,i=i>>>0,r||$a(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(za,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return za(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return za(this,t,i,!1,n)},"writeFloatBE");function Va(e,t,i,n,r){return t=+t,i=i>>>0,r||$a(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Va,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Va(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Va(this,t,i,!1,n)},"writeDoubleBE");m.prototype.copy=s(function(t,i,n,r){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=t.length&&(i=t.length),i||(i=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-i<r-n&&(r=t.length-i+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),i),o},"copy");m.prototype.fill=s(function(t,i,n,r){if(typeof t=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let a=t.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,r),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%c]}return this},"fill");var ci={};function po(e,t,i){ci[e]=class extends i{static{s(this,"NodeError")}constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}}}s(po,"E");po("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);po("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);po("ERR_OUT_OF_RANGE",function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Ca(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Ca(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function Ca(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(Ca,"addNumericalSeparator");function Wh(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Vi(t,e.length-(i+1))}s(Wh,"checkBounds");function Ha(e,t,i,n,r,o){if(e>i||e<t){let a=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${t}${a} and <= ${i}${a}`,new ci.ERR_OUT_OF_RANGE("value",c,e)}Wh(n,r,o)}s(Ha,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Vi(e,t,i){throw Math.floor(e)!==e?(fi(e,i),new ci.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new ci.ERR_BUFFER_OUT_OF_BOUNDS:new ci.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Vi,"boundsError");var Uh=/[^+/0-9A-Za-z-_]/g;function jh(e){if(e=e.split("=")[0],e=e.trim().replace(Uh,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(jh,"base64clean");function fo(e,t){t=t||1/0;let i,n=e.length,r=null,o=[];for(let a=0;a<n;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(fo,"utf8ToBytes");function qh(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(qh,"asciiToBytes");function $h(e,t){let i,n,r,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s($h,"utf16leToBytes");function Ka(e){return ao.toByteArray(jh(e))}s(Ka,"base64ToBytes");function $n(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}s($n,"blitBuffer");function $e(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s($e,"isInstance");function yo(e){return e!==e}s(yo,"numberIsNaN");var zh=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function xt(e){return typeof BigInt>"u"?Vh:e}s(xt,"defineBigIntMethod");function Vh(){throw new Error("BigInt not supported")}s(Vh,"BufferBigIntNotDefined")});var Ya=T((CS,wo)=>{"use strict";var mp=Object.prototype.hasOwnProperty,se="~";function Gi(){}s(Gi,"Events");Object.create&&(Gi.prototype=Object.create(null),new Gi().__proto__||(se=!1));function bp(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(bp,"EE");function Ga(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new bp(i,n||e,r),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}s(Ga,"addListener");function zn(e,t){--e._eventsCount===0?e._events=new Gi:delete e._events[t]}s(zn,"clearEvent");function ne(){this._events=new Gi,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,n;if(this._eventsCount===0)return t;for(n in i=this._events)mp.call(i,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=se?se+t:t,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=se?se+t:t,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,n,r,o,a){var c=se?se+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,n),!0;case 4:return l.fn.call(l.context,i,n,r),!0;case 5:return l.fn.call(l.context,i,n,r,o),!0;case 6:return l.fn.call(l.context,i,n,r,o,a),!0}for(h=1,d=new Array(f-1);h<f;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var b=l.length,p;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),f){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,i);break;case 3:l[h].fn.call(l[h].context,i,n);break;case 4:l[h].fn.call(l[h].context,i,n,r);break;default:if(!d)for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=s(function(t,i,n){return Ga(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Ga(this,t,i,n,!0)},"once");ne.prototype.removeListener=s(function(t,i,n,r){var o=se?se+t:t;if(!this._events[o])return this;if(!i)return zn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&zn(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:zn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&zn(this,i)):(this._events=new Gi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof wo<"u"&&(wo.exports=ne)});var q=T((P_,$c)=>{"use strict";$c.exports={ArrayIsArray:s(function(e){return Array.isArray(e)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(e,t){return e.includes(t)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(e,t){return e.indexOf(t)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(e,t){return e.join(t)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(e,t){return e.map(t)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(e,t){return e.pop(t)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(e,t){return e.push(t)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(e,t,...i){return e.call(t,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},"FunctionPrototypeSymbolHasInstance"),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:s(function(e,t){return Object.defineProperties(e,t)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(e,t,i){return Object.defineProperty(e,t,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(e,t){return Object.getOwnPropertyDescriptor(e,t)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(e){return Object.keys(e)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(e,t){return Object.setPrototypeOf(e,t)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(e,t){return e.catch(t)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(e,t,i){return e.then(t,i)},"PromisePrototypeThen"),PromiseReject:s(function(e){return Promise.reject(e)},"PromiseReject"),PromiseResolve:s(function(e){return Promise.resolve(e)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(e,t){return e.test(t)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(e){return e.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(e){return e.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(e){return e.trim()},"StringPrototypeTrim"),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:s(function(e,t,i){return e.set(t,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var Ei=T((R_,rr)=>{"use strict";var{AbortController:zc,AbortSignal:Pp}=typeof self<"u"?self:typeof window<"u"?window:void 0;rr.exports=zc;rr.exports.AbortSignal=Pp;rr.exports.default=zc});var yn=T((N_,Bo)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Vc=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),or;_i&&typeof _i.ownKeys=="function"?or=_i.ownKeys:Object.getOwnPropertySymbols?or=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):or=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function Tp(e){console&&console.warn&&console.warn(e)}s(Tp,"ProcessEmitWarning");var Kc=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function L(){L.init.call(this)}s(L,"EventEmitter");Bo.exports=L;Bo.exports.once=Cp;L.EventEmitter=L;L.prototype._events=void 0;L.prototype._eventsCount=0;L.prototype._maxListeners=void 0;var Hc=10;function sr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(sr,"checkListener");Object.defineProperty(L,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Hc},"get"),set:s(function(e){if(typeof e!="number"||e<0||Kc(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Hc=e},"set")});L.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};L.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Kc(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},"setMaxListeners");function Gc(e){return e._maxListeners===void 0?L.defaultMaxListeners:e._maxListeners}s(Gc,"_getMaxListeners");L.prototype.getMaxListeners=s(function(){return Gc(this)},"getMaxListeners");L.prototype.emit=s(function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")Vc(l,this,i);else for(var f=l.length,d=Zc(l,f),n=0;n<f;++n)Vc(d[n],this,i);return!0},"emit");function Yc(e,t,i,n){var r,o,a;if(sr(i),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),a===void 0)a=o[t]=i,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Gc(e),r>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,Tp(c)}return e}s(Yc,"_addListener");L.prototype.addListener=s(function(t,i){return Yc(this,t,i,!1)},"addListener");L.prototype.on=L.prototype.addListener;L.prototype.prependListener=s(function(t,i){return Yc(this,t,i,!0)},"prependListener");function Rp(){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)}s(Rp,"onceWrapper");function Xc(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=Rp.bind(n);return r.listener=i,n.wrapFn=r,r}s(Xc,"_onceWrap");L.prototype.once=s(function(t,i){return sr(i),this.on(t,Xc(this,t,i)),this},"once");L.prototype.prependOnceListener=s(function(t,i){return sr(i),this.prependListener(t,Xc(this,t,i)),this},"prependOnceListener");L.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(sr(i),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():Np(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");L.prototype.off=L.prototype.removeListener;L.prototype.removeAllListeners=s(function(t){var i,n,r;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[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(t,i[r]);return this},"removeAllListeners");function Jc(e,t,i){var n=e._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?Lp(r):Zc(r,r.length)}s(Jc,"_listeners");L.prototype.listeners=s(function(t){return Jc(this,t,!0)},"listeners");L.prototype.rawListeners=s(function(t){return Jc(this,t,!1)},"rawListeners");L.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):Qc.call(e,t)};L.prototype.listenerCount=Qc;function Qc(e){var t=this._events;if(t!==void 0){var i=t[e];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Qc,"listenerCount");L.prototype.eventNames=s(function(){return this._eventsCount>0?or(this._events):[]},"eventNames");function Zc(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(Zc,"arrayClone");function Np(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(Np,"spliceOne");function Lp(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(Lp,"unwrapListeners");function Cp(e,t){return new Promise(function(i,n){function r(a){e.removeListener(t,o),n(a)}s(r,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),el(e,t,o,{once:!0}),t!=="error"&&Bp(e,r,{once:!0})})}s(Cp,"once");function Bp(e,t,i){typeof e.on=="function"&&el(e,"error",t,i)}s(Bp,"addErrorHandlerIfEventEmitter");function el(e,t,i,n){if(typeof e.on=="function")n.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function r(o){n.once&&e.removeEventListener(t,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s(el,"eventTargetAgnosticAddListener")});var re=T((C_,Mo)=>{"use strict";var Dp=Ie(),{kResistStopPropagation:Mp,SymbolDispose:Wp}=q(),Up=globalThis.AbortSignal||Ei().AbortSignal,jp=globalThis.AbortController||Ei().AbortController,qp=Object.getPrototypeOf(async function(){}).constructor,tl=globalThis.Blob||Dp.Blob,$p=s(typeof tl<"u"?function(t){return t instanceof tl}:function(t){return!1},"isBlob"),il=s((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},"validateAbortSignal"),zp=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),Do=class extends Error{static{s(this,"AggregateError")}constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let n=0;n<t.length;n++)i+=` ${t[n].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=t}};Mo.exports={AggregateError:Do,kEmptyObject:Object.freeze({}),once:s(function(e){let t=!1;return function(...i){t||(t=!0,e.apply(this,i))}},"once"),createDeferredPromise:s(function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((n,...r)=>n?i(n):t(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,n]){let r=t.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(e){return e instanceof qp},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:$p,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:yn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);il(t,"signal"),zp(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Mp]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Wp](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Up.any||s(function(t){if(t.length===1)return t[0];let i=new jp,n=s(()=>i.abort(),"abort");return t.forEach(r=>{il(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};Mo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((D_,ol)=>{"use strict";var{format:Vp,inspect:ar,AggregateError:Hp}=re(),Kp=globalThis.AggregateError||Hp,Gp=Symbol("kIsNodeError"),Yp=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Xp=/^([A-Z][a-z0-9]*)+$/,Jp="__node_internal_",cr={};function Ht(e,t){if(!e)throw new cr.ERR_INTERNAL_ASSERTION(t)}s(Ht,"assert");function nl(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(nl,"addNumericalSeparator");function Qp(e,t,i){if(typeof t=="function")return Ht(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Ht(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:Vp(t,...i)}s(Qp,"getMessage");function ie(e,t,i){i||(i=Error);class n extends i{static{s(this,"NodeError")}constructor(...o){super(Qp(e,t,o))}toString(){return`${this.name} [${e}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${e}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[Gp]=!0,cr[e]=n}s(ie,"E");function rl(e){let t=Jp+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(rl,"hideStackFrames");function Zp(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new Kp([t,e],t.message);return i.code=t.code,i}return e||t}s(Zp,"aggregateTwoErrors");var Wo=class extends Error{static{s(this,"AbortError")}constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new cr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Ht(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let l of t)Ht(typeof l=="string","All expected entries have to be of type string"),Yp.includes(l)?r.push(l.toLowerCase()):Xp.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=r.indexOf("object");l!==-1&&(r.splice(r,l,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let l=r.pop();n+=`one of type ${r.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(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${i.constructor.name}`;else{let l=ar(i,{depth:-1});n+=`. Received ${l}`}}else{let l=ar(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof i} (${l})`}return n},TypeError);ie("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=ar(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...e)=>{Ht(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(e,t,i)=>{Ht(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=nl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=nl(n)),n+="n"):n=ar(i),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ie("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ie("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ie("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ie("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ie("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ie("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ie("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ie("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ie("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ie("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ie("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);ol.exports={AbortError:Wo,aggregateTwoErrors:rl(Zp),hideStackFrames:rl,codes:cr}});var ki=T((W_,yl)=>{"use strict";var{ArrayIsArray:jo,ArrayPrototypeIncludes:ll,ArrayPrototypeJoin:fl,ArrayPrototypeMap:ey,NumberIsInteger:qo,NumberIsNaN:ty,NumberMAX_SAFE_INTEGER:iy,NumberMIN_SAFE_INTEGER:ny,NumberParseInt:ry,ObjectPrototypeHasOwnProperty:oy,RegExpPrototypeExec:ul,String:sy,StringPrototypeToUpperCase:ay,StringPrototypeTrim:cy}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:ly,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Kt,ERR_UNKNOWN_SIGNAL:sl}}=ae(),{normalizeEncoding:fy}=re(),{isAsyncFunction:uy,isArrayBufferView:dy}=re().types,al={};function hy(e){return e===(e|0)}s(hy,"isInt32");function py(e){return e===e>>>0}s(py,"isUint32");var yy=/^[0-7]+$/,my="must be a 32-bit unsigned integer or an octal string";function by(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(ul(yy,e)===null)throw new xi(t,e,my);e=ry(e,8)}return dl(e,t),e}s(by,"parseFileMode");var gy=Re((e,t,i=ny,n=iy)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);if(e<i||e>n)throw new Kt(t,`>= ${i} && <= ${n}`,e)}),wy=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);if(e<i||e>n)throw new Kt(t,`>= ${i} && <= ${n}`,e)}),dl=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!qo(e))throw new Kt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Kt(t,`>= ${n} && <= ${r}`,e)});function $o(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s($o,"validateString");function Sy(e,t,i=void 0,n){if(typeof e!="number")throw new oe(t,"number",e);if(i!=null&&e<i||n!=null&&e>n||(i!=null||n!=null)&&ty(e))throw new Kt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(Sy,"validateNumber");var Ey=Re((e,t,i)=>{if(!ll(i,e)){let r="must be one of: "+fl(ey(i,o=>typeof o=="string"?`'${o}'`:sy(o)),", ");throw new xi(t,e,r)}});function hl(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(hl,"validateBoolean");function Uo(e,t,i){return e==null||!oy(e,t)?i:e[t]}s(Uo,"getOwnPropertyValueOrDefault");var _y=Re((e,t,i=null)=>{let n=Uo(i,"allowArray",!1),r=Uo(i,"allowFunction",!1);if(!Uo(i,"nullable",!1)&&e===null||!n&&jo(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),xy=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),lr=Re((e,t,i=0)=>{if(!jo(e))throw new oe(t,"Array",e);if(e.length<i){let n=`must be longer than ${i}`;throw new xi(t,e,n)}});function ky(e,t){lr(e,t);for(let i=0;i<e.length;i++)$o(e[i],`${t}[${i}]`)}s(ky,"validateStringArray");function vy(e,t){lr(e,t);for(let i=0;i<e.length;i++)hl(e[i],`${t}[${i}]`)}s(vy,"validateBooleanArray");function Fy(e,t){lr(e,t);for(let i=0;i<e.length;i++){let n=e[i],r=`${t}[${i}]`;if(n==null)throw new oe(r,"AbortSignal",n);pl(n,r)}}s(Fy,"validateAbortSignalArray");function Iy(e,t="signal"){if($o(e,t),al[e]===void 0)throw al[ay(e)]!==void 0?new sl(e+" (signals must use all capital letters)"):new sl(e)}s(Iy,"validateSignalName");var Ay=Re((e,t="buffer")=>{if(!dy(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function Oy(e,t){let i=fy(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(Oy,"validateEncoding");function Py(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&cy(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new ly(t,e,i);return e|0}s(Py,"validatePort");var pl=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),Ty=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),Ry=Re((e,t)=>{if(typeof e!="function"||uy(e))throw new oe(t,"Function",e)}),Ny=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function Ly(e,t,i){if(!ll(i,e))throw new oe(t,`('${fl(i,"|")}')`,e)}s(Ly,"validateUnion");var Cy=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function cl(e,t){if(typeof e>"u"||!ul(Cy,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(cl,"validateLinkHeaderFormat");function By(e){if(typeof e=="string")return cl(e,"hints"),e;if(jo(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];cl(r,"hints"),i+=r,n!==t-1&&(i+=", ")}return i}throw new xi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(By,"validateLinkHeaderValue");yl.exports={isInt32:hy,isUint32:py,parseFileMode:by,validateArray:lr,validateStringArray:ky,validateBooleanArray:vy,validateAbortSignalArray:Fy,validateBoolean:hl,validateBuffer:Ay,validateDictionary:xy,validateEncoding:Oy,validateFunction:Ty,validateInt32:wy,validateInteger:gy,validateNumber:Sy,validateObject:_y,validateOneOf:Ey,validatePlainFunction:Ry,validatePort:Py,validateSignalName:Iy,validateString:$o,validateUint32:dl,validateUndefined:Ny,validateUnion:Ly,validateAbortSignal:pl,validateLinkHeaderValue:By}});var Pt=T((j_,wl)=>{var V=wl.exports={},Qe,Ze;function zo(){throw new Error("setTimeout has not been defined")}s(zo,"defaultSetTimout");function Vo(){throw new Error("clearTimeout has not been defined")}s(Vo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=zo}catch{Qe=zo}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Vo}catch{Ze=Vo}})();function ml(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===zo||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch{try{return Qe.call(null,e,0)}catch{return Qe.call(this,e,0)}}}s(ml,"runTimeout");function Dy(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Vo||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{return Ze(e)}catch{try{return Ze.call(null,e)}catch{return Ze.call(this,e)}}}s(Dy,"runClearTimeout");var yt=[],vi=!1,Gt,fr=-1;function My(){!vi||!Gt||(vi=!1,Gt.length?yt=Gt.concat(yt):fr=-1,yt.length&&bl())}s(My,"cleanUpNextTick");function bl(){if(!vi){var e=ml(My);vi=!0;for(var t=yt.length;t;){for(Gt=yt,yt=[];++fr<t;)Gt&&Gt[fr].run();fr=-1,t=yt.length}Gt=null,vi=!1,Dy(e)}}s(bl,"drainQueue");V.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];yt.push(new gl(e,t)),yt.length===1&&!vi&&ml(bl)};function gl(e,t){this.fun=e,this.array=t}s(gl,"Item");gl.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function mt(){}s(mt,"noop");V.on=mt;V.addListener=mt;V.once=mt;V.off=mt;V.removeListener=mt;V.removeAllListeners=mt;V.emit=mt;V.prependListener=mt;V.prependOnceListener=mt;V.listeners=function(e){return[]};V.binding=function(e){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(e){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var tt=T(($_,Ll)=>{"use strict";var{SymbolAsyncIterator:Sl,SymbolIterator:El,SymbolFor:Yt}=q(),_l=Yt("nodejs.stream.destroyed"),xl=Yt("nodejs.stream.errored"),Ho=Yt("nodejs.stream.readable"),Ko=Yt("nodejs.stream.writable"),kl=Yt("nodejs.stream.disturbed"),Wy=Yt("nodejs.webstream.isClosedPromise"),Uy=Yt("nodejs.webstream.controllerErrorFunction");function ur(e,t=!1){var i;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((i=e._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!e._writableState||e._readableState))}s(ur,"isReadableNodeStream");function dr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}s(dr,"isWritableNodeStream");function jy(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(jy,"isDuplexNodeStream");function et(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(et,"isNodeStream");function vl(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(vl,"isReadableStream");function Fl(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(Fl,"isWritableStream");function Il(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(Il,"isTransformStream");function qy(e){return vl(e)||Fl(e)||Il(e)}s(qy,"isWebStream");function $y(e,t){return e==null?!1:t===!0?typeof e[Sl]=="function":t===!1?typeof e[El]=="function":typeof e[Sl]=="function"||typeof e[El]=="function"}s($y,"isIterable");function hr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[_l]||n!=null&&n.destroyed)}s(hr,"isDestroyed");function Al(e){if(!dr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Al,"isWritableEnded");function zy(e,t){if(!dr(e))return null;if(e.writableFinished===!0)return!0;let i=e._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||t===!1&&i.ended===!0&&i.length===0)}s(zy,"isWritableFinished");function Vy(e){if(!ur(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Vy,"isReadableEnded");function Ol(e,t){if(!ur(e))return null;let i=e._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||t===!1&&i.ended===!0&&i.length===0)}s(Ol,"isReadableFinished");function Pl(e){return e&&e[Ho]!=null?e[Ho]:typeof e?.readable!="boolean"?null:hr(e)?!1:ur(e)&&e.readable&&!Ol(e)}s(Pl,"isReadable");function Tl(e){return e&&e[Ko]!=null?e[Ko]:typeof e?.writable!="boolean"?null:hr(e)?!1:dr(e)&&e.writable&&!Al(e)}s(Tl,"isWritable");function Hy(e,t){return et(e)?hr(e)?!0:!(t?.readable!==!1&&Pl(e)||t?.writable!==!1&&Tl(e)):null}s(Hy,"isFinished");function Ky(e){var t,i;return et(e)?e.writableErrored?e.writableErrored:(t=(i=e._writableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Ky,"isWritableErrored");function Gy(e){var t,i;return et(e)?e.readableErrored?e.readableErrored:(t=(i=e._readableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Gy,"isReadableErrored");function Yy(e){if(!et(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,i=e._readableState;return typeof t?.closed=="boolean"||typeof i?.closed=="boolean"?t?.closed||i?.closed:typeof e._closed=="boolean"&&Rl(e)?e._closed:null}s(Yy,"isClosed");function Rl(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(Rl,"isOutgoingMessage");function Nl(e){return typeof e._sent100=="boolean"&&Rl(e)}s(Nl,"isServerResponse");function Xy(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}s(Xy,"isServerRequest");function Jy(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&Nl(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Jy,"willEmitClose");function Qy(e){var t;return!!(e&&((t=e[kl])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s(Qy,"isDisturbed");function Zy(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[xl])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=e._readableState)===null||f===void 0?void 0:f.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}s(Zy,"isErrored");Ll.exports={isDestroyed:hr,kIsDestroyed:_l,isDisturbed:Qy,kIsDisturbed:kl,isErrored:Zy,kIsErrored:xl,isReadable:Pl,kIsReadable:Ho,kIsClosedPromise:Wy,kControllerErrorFunction:Uy,kIsWritable:Ko,isClosed:Yy,isDuplexNodeStream:jy,isFinished:Hy,isIterable:$y,isReadableNodeStream:ur,isReadableStream:vl,isReadableEnded:Vy,isReadableFinished:Ol,isReadableErrored:Gy,isNodeStream:et,isWebStream:qy,isWritable:Tl,isWritableNodeStream:dr,isWritableStream:Fl,isWritableEnded:Al,isWritableFinished:zy,isWritableErrored:Ky,isServerRequest:Xy,isServerResponse:Nl,willEmitClose:Jy,isTransformStream:Il}});var bt=T((V_,Qo)=>{var Tt=Pt(),{AbortError:$l,codes:em}=ae(),{ERR_INVALID_ARG_TYPE:tm,ERR_STREAM_PREMATURE_CLOSE:Cl}=em,{kEmptyObject:Yo,once:Xo}=re(),{validateAbortSignal:im,validateFunction:nm,validateObject:rm,validateBoolean:om}=ki(),{Promise:sm,PromisePrototypeThen:am,SymbolDispose:zl}=q(),{isClosed:cm,isReadable:Bl,isReadableNodeStream:Go,isReadableStream:lm,isReadableFinished:Dl,isReadableErrored:Ml,isWritable:Wl,isWritableNodeStream:Ul,isWritableStream:fm,isWritableFinished:jl,isWritableErrored:ql,isNodeStream:um,willEmitClose:dm,kIsClosedPromise:hm}=tt(),Fi;function pm(e){return e.setHeader&&typeof e.abort=="function"}s(pm,"isRequest");var Jo=s(()=>{},"nop");function Vl(e,t,i){var n,r;if(arguments.length===2?(i=t,t=Yo):t==null?t=Yo:rm(t,"options"),nm(i,"callback"),im(t.signal,"options.signal"),i=Xo(i),lm(e)||fm(e))return ym(e,t,i);if(!um(e))throw new tm("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:Go(e),a=(r=t.writable)!==null&&r!==void 0?r:Ul(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=dm(e)&&Go(e)===o&&Ul(e)===a,h=jl(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=Dl(e,!1),w=s(()=>{p=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||a))&&(!a||h)&&i.call(e)},"onend"),g=s(B=>{i.call(e,B)},"onerror"),A=cm(e),k=s(()=>{A=!0;let B=ql(e)||Ml(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&Go(e,!0)&&!Dl(e,!1))return i.call(e,new Cl);if(a&&!h&&!jl(e,!1))return i.call(e,new Cl);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=ql(e)||Ml(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),N=s(()=>{e.req.on("finish",b)},"onrequest");pm(e)?(e.on("complete",b),d||e.on("abort",k),e.req?N():e.on("request",N)):a&&!c&&(e.on("end",f),e.on("close",f)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",k),A?Tt.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||Tt.nextTick(v):(!o&&(!d||Bl(e))&&(h||Wl(e)===!1)||!a&&(!d||Wl(e))&&(p||Bl(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Jo,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",N),e.req&&e.req.removeListener("finish",b),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",b),e.removeListener("end",w),e.removeListener("error",g),e.removeListener("close",k)},"cleanup");if(t.signal&&!A){let B=s(()=>{let Bt=i;F(),Bt.call(e,new $l(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Tt.nextTick(B);else{Fi=Fi||re().addAbortListener;let Bt=Fi(t.signal,B),Ee=i;i=Xo((...oi)=>{Bt[zl](),Ee.apply(e,oi)})}}return F}s(Vl,"eos");function ym(e,t,i){let n=!1,r=Jo;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new $l(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Tt.nextTick(r);else{Fi=Fi||re().addAbortListener;let a=Fi(t.signal,r),c=i;i=Xo((...l)=>{a[zl](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return am(e[hm].promise,o,o),Jo}s(ym,"eosWeb");function mm(e,t){var i;let n=!1;return t===null&&(t=Yo),(i=t)!==null&&i!==void 0&&i.cleanup&&(om(t.cleanup,"cleanup"),n=t.cleanup),new sm((r,o)=>{let a=Vl(e,t,c=>{n&&a(),c?o(c):r()})})}s(mm,"finished");Qo.exports=Vl;Qo.exports.finished=mm});var Xt=T((K_,Zl)=>{"use strict";var it=Pt(),{aggregateTwoErrors:bm,codes:{ERR_MULTIPLE_CALLBACK:gm},AbortError:wm}=ae(),{Symbol:Gl}=q(),{kIsDestroyed:Sm,isDestroyed:Em,isFinished:_m,isServerRequest:xm}=tt(),Yl=Gl("kDestroy"),Zo=Gl("kConstruct");function Xl(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Xl,"checkError");function km(e,t){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(Xl(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Hl(this,e,t):this.once(Yl,function(o){Hl(this,bm(o,e),t)}),this)}s(km,"destroy");function Hl(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Xl(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(vm,e,o):it.nextTick(Jl,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Hl,"_destroy");function vm(e,t){es(e,t),Jl(e)}s(vm,"emitErrorCloseNT");function Jl(e){let t=e._readableState,i=e._writableState;i&&(i.closeEmitted=!0),t&&(t.closeEmitted=!0),(i!=null&&i.emitClose||t!=null&&t.emitClose)&&e.emit("close")}s(Jl,"emitCloseNT");function es(e,t){let i=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(es,"emitErrorNT");function Fm(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}s(Fm,"undestroy");function ts(e,t,i){let n=e._readableState,r=e._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?e.destroy(t):t&&(t.stack,r&&!r.errored&&(r.errored=t),n&&!n.errored&&(n.errored=t),i?it.nextTick(es,e,t):es(e,t))}s(ts,"errorOrDestroy");function Im(e,t){if(typeof e._construct!="function")return;let i=e._readableState,n=e._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(Zo,t),!(e.listenerCount(Zo)>1)&&it.nextTick(Am,e)}s(Im,"construct");function Am(e){let t=!1;function i(n){if(t){ts(e,n??new gm);return}t=!0;let r=e._readableState,o=e._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(Yl,n):n?ts(e,n,!0):it.nextTick(Om,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(Am,"constructNT");function Om(e){e.emit(Zo)}s(Om,"emitConstructNT");function Kl(e){return e?.setHeader&&typeof e.abort=="function"}s(Kl,"isRequest");function Ql(e){e.emit("close")}s(Ql,"emitCloseLegacy");function Pm(e,t){e.emit("error",t),it.nextTick(Ql,e)}s(Pm,"emitErrorCloseLegacy");function Tm(e,t){!e||Em(e)||(!t&&!_m(e)&&(t=new wm),xm(e)?(e.socket=null,e.destroy(t)):Kl(e)?e.abort():Kl(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(Pm,e,t):it.nextTick(Ql,e),e.destroyed||(e[Sm]=!0))}s(Tm,"destroyer");Zl.exports={construct:Im,destroyer:Tm,destroy:km,undestroy:Fm,errorOrDestroy:ts}});var mr=T((Y_,tf)=>{"use strict";var{ArrayIsArray:Rm,ObjectSetPrototypeOf:ef}=q(),{EventEmitter:pr}=yn();function yr(e){pr.call(this,e)}s(yr,"Stream");ef(yr.prototype,pr.prototype);ef(yr,pr);yr.prototype.pipe=function(e,t){let i=this;function n(d){e.writable&&e.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),e.on("drain",r),!e._isStdio&&(!t||t.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,e.end())}s(a,"onend");function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}s(c,"onclose");function l(d){f(),pr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),is(i,"error",l),is(e,"error",l);function f(){i.removeListener("data",n),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),e.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),e.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),e.on("close",f),e.emit("pipe",i),e};function is(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):Rm(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(is,"prependListener");tf.exports={Stream:yr,prependListener:is}});var mn=T((J_,br)=>{"use strict";var{SymbolDispose:Nm}=q(),{AbortError:nf,codes:Lm}=ae(),{isNodeStream:rf,isWebStream:Cm,kControllerErrorFunction:Bm}=tt(),Dm=bt(),{ERR_INVALID_ARG_TYPE:of}=Lm,ns,Mm=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new of(t,"AbortSignal",e)},"validateAbortSignal");br.exports.addAbortSignal=s(function(t,i){if(Mm(t,"signal"),!rf(i)&&!Cm(i))throw new of("stream",["ReadableStream","WritableStream","Stream"],i);return br.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");br.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=rf(t)?()=>{t.destroy(new nf(void 0,{cause:e.reason}))}:()=>{t[Bm](new nf(void 0,{cause:e.reason}))};if(e.aborted)i();else{ns=ns||re().addAbortListener;let n=ns(e,i);Dm(t,n[Nm])}return t}});var cf=T((ex,af)=>{"use strict";var{StringPrototypeSlice:sf,SymbolIterator:Wm,TypedArrayPrototypeSet:gr,Uint8Array:Um}=q(),{Buffer:rs}=Ie(),{inspect:jm}=re();af.exports=class{static{s(this,"BufferList")}constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=t+i.data;return n}concat(t){if(this.length===0)return rs.alloc(0);let i=rs.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)gr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(t,i){let n=this.head.data;if(t<n.length){let r=n.slice(0,t);return this.head.data=n.slice(t),r}return t===n.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Wm](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",n=this.head,r=0;do{let o=n.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=sf(o,0,t),this.head=n,n.data=sf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=rs.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)gr(i,a,n-t),t-=a.length;else{t===a.length?(gr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(gr(i,new Um(a.buffer,a.byteOffset,t),n-t),this.head=r,r.data=a.slice(t));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return jm(this,{...i,depth:0,customInspect:!1})}}});var bn=T((ix,df)=>{"use strict";var{MathFloor:qm,NumberIsInteger:$m}=q(),{validateInteger:zm}=ki(),{ERR_INVALID_ARG_VALUE:Vm}=ae().codes,lf=16*1024,ff=16;function Hm(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Hm,"highWaterMarkFrom");function uf(e){return e?ff:lf}s(uf,"getDefaultHighWaterMark");function Km(e,t){zm(t,"value",0),e?ff=t:lf=t}s(Km,"setDefaultHighWaterMark");function Gm(e,t,i,n){let r=Hm(t,n,i);if(r!=null){if(!$m(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Vm(o,r)}return qm(r)}return uf(e.objectMode)}s(Gm,"getHighWaterMark");df.exports={getHighWaterMark:Gm,getDefaultHighWaterMark:uf,setDefaultHighWaterMark:Km}});var yf=T((os,pf)=>{var wr=Ie(),nt=wr.Buffer;function hf(e,t){for(var i in e)t[i]=e[i]}s(hf,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?pf.exports=wr:(hf(wr,os),os.Buffer=Jt);function Jt(e,t,i){return nt(e,t,i)}s(Jt,"SafeBuffer");Jt.prototype=Object.create(nt.prototype);hf(nt,Jt);Jt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Jt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=nt(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Jt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Jt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return wr.SlowBuffer(e)}});var gf=T(bf=>{"use strict";var as=yf().Buffer,mf=as.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ym(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}s(Ym,"_normalizeEncoding");function Xm(e){var t=Ym(e);if(typeof t!="string"&&(as.isEncoding===mf||!mf(e)))throw new Error("Unknown encoding: "+e);return t||e}s(Xm,"normalizeEncoding");bf.StringDecoder=gn;function gn(e){this.encoding=Xm(e);var t;switch(this.encoding){case"utf16le":this.text=ib,this.end=nb,t=4;break;case"utf8":this.fillLast=Zm,t=4;break;case"base64":this.text=rb,this.end=ob,t=3;break;default:this.write=sb,this.end=ab;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=as.allocUnsafe(t)}s(gn,"StringDecoder");gn.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};gn.prototype.end=tb;gn.prototype.text=eb;gn.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function ss(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(ss,"utf8CheckByte");function Jm(e,t,i){var n=t.length-1;if(n<i)return 0;var r=ss(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=ss(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=ss(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s(Jm,"utf8CheckIncomplete");function Qm(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}s(Qm,"utf8CheckExtraBytes");function Zm(e){var t=this.lastTotal-this.lastNeed,i=Qm(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}s(Zm,"utf8FillLast");function eb(e,t){var i=Jm(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}s(eb,"utf8Text");function tb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(tb,"utf8End");function ib(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}s(ib,"utf16Text");function nb(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}s(nb,"utf16End");function rb(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}s(rb,"base64Text");function ob(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(ob,"base64End");function sb(e){return e.toString(this.encoding)}s(sb,"simpleWrite");function ab(e){return e&&e.length?this.write(e):""}s(ab,"simpleEnd")});var cs=T((ax,_f)=>{"use strict";var wf=Pt(),{PromisePrototypeThen:cb,SymbolAsyncIterator:Sf,SymbolIterator:Ef}=q(),{Buffer:lb}=Ie(),{ERR_INVALID_ARG_TYPE:fb,ERR_STREAM_NULL_VALUES:ub}=ae().codes;function db(e,t,i){let n;if(typeof t=="string"||t instanceof lb)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[Sf])r=!0,n=t[Sf]();else if(t&&t[Ef])r=!1,n=t[Ef]();else throw new fb("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){cb(c(f),()=>wf.nextTick(d,f),h=>wf.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:p}=await n.throw(f);if(await b,p)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new ub;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(db,"from");_f.exports=db});var Sn=T((lx,Uf)=>{var Me=Pt(),{ArrayPrototypeIndexOf:hb,NumberIsInteger:pb,NumberIsNaN:yb,NumberParseInt:mb,ObjectDefineProperties:ms,ObjectKeys:bb,ObjectSetPrototypeOf:vf,Promise:Ff,SafeSet:gb,SymbolAsyncDispose:wb,SymbolAsyncIterator:Sb,Symbol:Eb}=q();Uf.exports=O;O.ReadableState=xr;var{EventEmitter:_b}=yn(),{Stream:Rt,prependListener:xb}=mr(),{Buffer:ls}=Ie(),{addAbortSignal:kb}=mn(),If=bt(),P=re().debuglog("stream",e=>{P=e}),vb=cf(),Oi=Xt(),{getHighWaterMark:Fb,getDefaultHighWaterMark:Ib}=bn(),{aggregateTwoErrors:xf,codes:{ERR_INVALID_ARG_TYPE:Ab,ERR_METHOD_NOT_IMPLEMENTED:Ob,ERR_OUT_OF_RANGE:Pb,ERR_STREAM_PUSH_AFTER_EOF:Tb,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:Rb},AbortError:Nb}=ae(),{validateObject:Lb}=ki(),Qt=Eb("kPaused"),{StringDecoder:Af}=gf(),Cb=cs();vf(O.prototype,Rt.prototype);vf(O,Rt);var fs=s(()=>{},"nop"),{errorOrDestroy:Ii}=Oi,Ai=1,Bb=2,Of=4,wn=8,Pf=16,Sr=32,Er=64,Tf=128,Db=256,Mb=512,Wb=1024,ps=2048,ys=4096,Ub=8192,jb=16384,qb=32768,Rf=65536,$b=1<<17,zb=1<<18;function J(e){return{enumerable:!1,get:s(function(){return(this.state&e)!==0},"get"),set:s(function(t){t?this.state|=e:this.state&=~e},"set")}}s(J,"makeBitMapDescriptor");ms(xr.prototype,{objectMode:J(Ai),ended:J(Bb),endEmitted:J(Of),reading:J(wn),constructed:J(Pf),sync:J(Sr),needReadable:J(Er),emittedReadable:J(Tf),readableListening:J(Db),resumeScheduled:J(Mb),errorEmitted:J(Wb),emitClose:J(ps),autoDestroy:J(ys),destroyed:J(Ub),closed:J(jb),closeEmitted:J(qb),multiAwaitDrain:J(Rf),readingMore:J($b),dataEmitted:J(zb)});function xr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=ps|ys|Pf|Sr,e&&e.objectMode&&(this.state|=Ai),i&&e&&e.readableObjectMode&&(this.state|=Ai),this.highWaterMark=e?Fb(this,e,"readableHighWaterMark",i):Ib(!1),this.buffer=new vb,this.length=0,this.pipes=[],this.flowing=null,this[Qt]=null,e&&e.emitClose===!1&&(this.state&=~ps),e&&e.autoDestroy===!1&&(this.state&=~ys),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new Af(e.encoding),this.encoding=e.encoding)}s(xr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new xr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&kb(e.signal,this)),Rt.call(this,e),Oi.construct(this,()=>{this._readableState.needReadable&&_r(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Oi.destroy;O.prototype._undestroy=Oi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[_b.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[wb]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new Nb,this.destroy(e)),new Ff((t,i)=>If(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return Nf(this,e,t,!1)};O.prototype.unshift=function(e,t){return Nf(this,e,t,!0)};function Nf(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Ai||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=ls.from(t,i).toString(r.encoding):(t=ls.from(t,i),i=""))):t instanceof ls?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new Ab("chunk",["string","Buffer","Uint8Array"],t))),o)Ii(e,o);else if(t===null)r.state&=~wn,Kb(e,r);else if(r.state&Ai||t&&t.length>0)if(n)if(r.state&Of)Ii(e,new Rb);else{if(r.destroyed||r.errored)return!1;us(e,r,t,!0)}else if(r.ended)Ii(e,new Tb);else{if(r.destroyed||r.errored)return!1;r.state&=~wn,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?us(e,r,t,!1):_r(e,r)):us(e,r,t,!1)}else n||(r.state&=~wn,_r(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(Nf,"readableAddChunk");function us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Rf?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.state&Er&&kr(e)),_r(e,t)}s(us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Qt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new Af(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=t.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Vb=1073741824;function Hb(e){if(e>Vb)throw new Pb("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Hb,"computeNewHighWaterMark");function kf(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Ai?1:yb(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(kf,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:pb(e)||(e=mb(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Hb(e)),e!==0&&(t.state&=~Tf),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?ds(this):kr(this),null;if(e=kf(e,t),e===0&&t.ended)return t.length===0&&ds(this),null;let n=(t.state&Er)!==0;if(P("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,P("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),t.state|=wn|Sr,t.length===0&&(t.state|=Er);try{this._read(t.highWaterMark)}catch(o){Ii(this,o)}t.state&=~Sr,t.reading||(e=kf(i,t))}let r;return e>0?r=Mf(e,t):r=null,r===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&ds(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Kb(e,t){if(P("onEofChunk"),!t.ended){if(t.decoder){let i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?kr(e):(t.needReadable=!1,t.emittedReadable=!0,Lf(e))}}s(Kb,"onEofChunk");function kr(e){let t=e._readableState;P("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,Me.nextTick(Lf,e))}s(kr,"emitReadable");function Lf(e){let t=e._readableState;P("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,Bf(e)}s(Lf,"emitReadable_");function _r(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Gb,e,t))}s(_r,"maybeReadMore");function Gb(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(P("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Gb,"maybeReadMore_");O.prototype._read=function(e){throw new Ob("_read()")};O.prototype.pipe=function(e,t){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new gb(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),P("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Me.stdout&&e!==Me.stderr?c:A;n.endEmitted?Me.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(k,v){P("onunpipe"),k===i&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),e.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",b),f=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===e?(P("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),i.pause()),l||(l=Yb(i,e),e.on("drain",l))}s(h,"pause"),i.on("data",b);function b(k){P("ondata");let v=e.write(k);P("dest.write",v),v===!1&&h()}s(b,"ondata");function p(k){if(P("onerror",k),A(),e.removeListener("error",p),e.listenerCount("error")===0){let v=e._writableState||e._readableState;v&&!v.errorEmitted?Ii(e,k):e.emit("error",k)}}s(p,"onerror"),xb(e,"error",p);function w(){e.removeListener("finish",g),A()}s(w,"onclose"),e.once("close",w);function g(){P("onfinish"),e.removeListener("close",w),A()}s(g,"onfinish"),e.once("finish",g);function A(){P("unpipe"),i.unpipe(e)}return s(A,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?h():n.flowing||(P("pipe resume"),i.resume()),e};function Yb(e,t){return s(function(){let n=e._readableState;n.awaitDrainWriters===t?(P("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(Yb,"pipeOnDrain");O.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let r=t.pipes;t.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=hb(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};O.prototype.on=function(e,t){let i=Rt.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length?kr(this):n.reading||Me.nextTick(Xb,this)),i};O.prototype.addListener=O.prototype.on;O.prototype.removeListener=function(e,t){let i=Rt.prototype.removeListener.call(this,e,t);return e==="readable"&&Me.nextTick(Cf,this),i};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){let t=Rt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Me.nextTick(Cf,this),t};function Cf(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Qt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(Cf,"updateReadableListening");function Xb(e){P("readable nexttick read 0"),e.read(0)}s(Xb,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,Jb(this,e)),e[Qt]=!1,this};function Jb(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick(Qb,e,t))}s(Jb,"resume");function Qb(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),Bf(e),t.flowing&&!t.reading&&e.read(0)}s(Qb,"resume_");O.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Qt]=!0,this};function Bf(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(Bf,"flow");O.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Ii(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=bb(e);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof e[r]=="function"&&(this[r]=e[r].bind(e))}return this};O.prototype[Sb]=function(){return Df(this)};O.prototype.iterator=function(e){return e!==void 0&&Lb(e,"options"),Df(this,e)};function Df(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=Zb(e,t);return i.stream=e,i}s(Df,"streamToAsyncIterator");async function*Zb(e,t){let i=fs;function n(a){this===e?(i(),i=fs):i=a}s(n,"next"),e.on("readable",n);let r,o=If(e,{writable:!1},a=>{r=a?xf(r,a):null,i(),i=fs});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new Ff(n)}}}catch(a){throw r=xf(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Oi.destroyer(e,null):(e.off("readable",n),o())}}s(Zb,"createAsyncIterator");ms(O.prototype,{readable:{__proto__:null,get:s(function(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},"get"),set:s(function(e){this._readableState&&(this._readableState.readable=!!e)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});ms(xr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Qt]!==!1},"get"),set:s(function(e){this[Qt]=!!e},"set")}});O._fromList=Mf;function Mf(e,t){if(t.length===0)return null;let i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.first():i=t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i}s(Mf,"fromList");function ds(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(eg,t,e))}s(ds,"endReadable");function eg(e,t){if(P("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Me.nextTick(tg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(eg,"endReadableNT");function tg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(tg,"endWritableNT");O.from=function(e,t){return Cb(O,e,t)};var hs;function Wf(){return hs===void 0&&(hs={}),hs}s(Wf,"lazyWebStreams");O.fromWeb=function(e,t){return Wf().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Wf().newReadableStreamFromStreamReadable(e,t)};O.wrap=function(e,t){var i,n;return new O({objectMode:(i=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(r,o){Oi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Or=T((ux,Qf)=>{var Zt=Pt(),{ArrayPrototypeSlice:$f,Error:ig,FunctionPrototypeSymbolHasInstance:zf,ObjectDefineProperty:Vf,ObjectDefineProperties:ng,ObjectSetPrototypeOf:Hf,StringPrototypeToLowerCase:rg,Symbol:og,SymbolHasInstance:sg}=q();Qf.exports=$;$.WritableState=xn;var{EventEmitter:ag}=yn(),En=mr().Stream,{Buffer:vr}=Ie(),Ar=Xt(),{addAbortSignal:cg}=mn(),{getHighWaterMark:lg,getDefaultHighWaterMark:fg}=bn(),{ERR_INVALID_ARG_TYPE:ug,ERR_METHOD_NOT_IMPLEMENTED:dg,ERR_MULTIPLE_CALLBACK:Kf,ERR_STREAM_CANNOT_PIPE:hg,ERR_STREAM_DESTROYED:_n,ERR_STREAM_ALREADY_FINISHED:pg,ERR_STREAM_NULL_VALUES:yg,ERR_STREAM_WRITE_AFTER_END:mg,ERR_UNKNOWN_ENCODING:Gf}=ae().codes,{errorOrDestroy:Pi}=Ar;Hf($.prototype,En.prototype);Hf($,En);function ws(){}s(ws,"nop");var Ti=og("kOnFinished");function xn(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?lg(this,e,"writableHighWaterMark",i):fg(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=gg.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Ir(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Ti]=[]}s(xn,"WritableState");function Ir(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Ir,"resetBuffer");xn.prototype.getBuffer=s(function(){return $f(this.buffered,this.bufferedIndex)},"getBuffer");Vf(xn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!zf($,this))return new $(e);this._writableState=new xn(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&cg(e.signal,this)),En.call(this,e),Ar.construct(this,()=>{let i=this._writableState;i.writing||Es(this,i),_s(this,i)})}s($,"Writable");Vf($,sg,{__proto__:null,value:s(function(e){return zf(this,e)?!0:this!==$?!1:e&&e._writableState instanceof xn},"value")});$.prototype.pipe=function(){Pi(this,new hg)};function Yf(e,t,i,n){let r=e._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!vr.isEncoding(i))throw new Gf(i);typeof n!="function"&&(n=ws)}if(t===null)throw new yg;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=vr.from(t,i),i="buffer");else if(t instanceof vr)i="buffer";else if(En._isUint8Array(t))t=En._uint8ArrayToBuffer(t),i="buffer";else throw new ug("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new mg:r.destroyed&&(o=new _n("write")),o?(Zt.nextTick(n,o),Pi(e,o,!0),o):(r.pendingcb++,bg(e,r,t,i,n))}s(Yf,"_write");$.prototype.write=function(e,t,i){return Yf(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Es(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=rg(t)),!vr.isEncoding(t))throw new Gf(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function bg(e,t,i,n,r){let o=t.objectMode?1:i.length;t.length+=o;let a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:i,encoding:n,callback:r}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&r!==ws&&(t.allNoop=!1)):(t.writelen=o,t.writecb=r,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(bg,"writeOrBuffer");function jf(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _n("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(jf,"doWrite");function qf(e,t,i,n){--t.pendingcb,n(i),Ss(t),Pi(e,i)}s(qf,"onwriteError");function gg(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Pi(e,new Kf);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t?(t.stack,i.errored||(i.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?Zt.nextTick(qf,e,i,t,r):qf(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Es(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},Zt.nextTick(wg,i.afterWriteTickInfo)):Xf(e,i,1,r))}s(gg,"onwrite");function wg({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Xf(e,t,i,n)}s(wg,"afterWriteTick");function Xf(e,t,i,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,n();t.destroyed&&Ss(t),_s(e,t)}s(Xf,"afterWrite");function Ss(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:o,callback:a}=e.buffered[r],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new _n("write"))}let i=e[Ti].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new _n("end"))}Ir(e)}s(Ss,"errorBuffer");function Es(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=t,o=i.length-n;if(!o)return;let a=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?ws:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:$f(i,a);l.allBuffers=t.allBuffers,jf(e,t,!0,t.length,l,"",c),Ir(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;jf(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Ir(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Es,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new dg("_write()")};$.prototype._writev=null;$.prototype.end=function(e,t,i){let n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let r;if(e!=null){let o=Yf(this,e,t);o instanceof ig&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,_s(this,n,!0),n.ended=!0):n.finished?r=new pg("end"):n.destroyed&&(r=new _n("end"))),typeof i=="function"&&(r||n.finished?Zt.nextTick(i,r):n[Ti].push(i)),this};function Fr(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}s(Fr,"needFinish");function Sg(e,t){let i=!1;function n(r){if(i){Pi(e,r??Kf());return}if(i=!0,t.pendingcb--,r){let o=t[Ti].splice(0);for(let a=0;a<o.length;a++)o[a](r);Pi(e,r,t.sync)}else Fr(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,Zt.nextTick(gs,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(Sg,"callFinal");function Eg(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,Sg(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(Eg,"prefinish");function _s(e,t,i){Fr(t)&&(Eg(e,t),t.pendingcb===0&&(i?(t.pendingcb++,Zt.nextTick((n,r)=>{Fr(r)?gs(n,r):r.pendingcb--},e,t)):Fr(t)&&(t.pendingcb++,gs(e,t))))}s(_s,"finishMaybe");function gs(e,t){t.pendingcb--,t.finished=!0;let i=t[Ti].splice(0);for(let n=0;n<i.length;n++)i[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}s(gs,"finish");ng($.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")},writable:{__proto__:null,get:s(function(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},"get"),set:s(function(e){this._writableState&&(this._writableState.writable=!!e)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var _g=Ar.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ti].length)&&Zt.nextTick(Ss,i),_g.call(this,e,t),this};$.prototype._undestroy=Ar.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[ag.captureRejectionSymbol]=function(e){this.destroy(e)};var bs;function Jf(){return bs===void 0&&(bs={}),bs}s(Jf,"lazyWebStreams");$.fromWeb=function(e,t){return Jf().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Jf().newWritableStreamFromStreamWritable(e)}});var hu=T((hx,du)=>{var xs=Pt(),xg=Ie(),{isReadable:kg,isWritable:vg,isIterable:Zf,isNodeStream:Fg,isReadableNodeStream:eu,isWritableNodeStream:tu,isDuplexNodeStream:Ig,isReadableStream:iu,isWritableStream:nu}=tt(),ru=bt(),{AbortError:fu,codes:{ERR_INVALID_ARG_TYPE:Ag,ERR_INVALID_RETURN_VALUE:ou}}=ae(),{destroyer:Ni}=Xt(),Og=rt(),uu=Sn(),Pg=Or(),{createDeferredPromise:su}=re(),au=cs(),cu=globalThis.Blob||xg.Blob,Tg=s(typeof cu<"u"?function(t){return t instanceof cu}:function(t){return!1},"isBlob"),Rg=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:lu}=q(),Nt=class extends Og{static{s(this,"Duplexify")}constructor(t){super(t),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)}};du.exports=s(function e(t,i){if(Ig(t))return t;if(eu(t))return Ri({readable:t});if(tu(t))return Ri({writable:t});if(Fg(t))return Ri({writable:!1,readable:!1});if(iu(t))return Ri({readable:uu.fromWeb(t)});if(nu(t))return Ri({writable:Pg.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=Ng(t);if(Zf(r))return au(Nt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=lu(l,r,h=>{if(h!=null)throw new ou("nully","body",h)},h=>{Ni(f,h)});return f=new Nt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,xs.nextTick(h,null)}catch(b){xs.nextTick(h,b)}})},"final"),destroy:c})}throw new ou("Iterable, AsyncIterable or AsyncFunction",i,r)}if(Tg(t))return e(t.arrayBuffer());if(Zf(t))return au(Nt,t,{objectMode:!0,writable:!1});if(iu(t?.readable)&&nu(t?.writable))return Nt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?eu(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?tu(t?.writable)?t?.writable:e(t.writable):void 0;return Ri({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return lu(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Nt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new Ag(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function Ng(e){let{promise:t,resolve:i}=su(),n=new Rg,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(xs.nextTick(f),l)return;if(r.aborted)throw new fu(void 0,{cause:r.reason});({promise:t,resolve:i}=su()),yield c}}(),{signal:r}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){n.abort(),c(a)},"destroy")}}s(Ng,"fromAsyncGen");function Ri(e){let t=e.readable&&typeof e.readable.read!="function"?uu.wrap(e.readable):e.readable,i=e.writable,n=!!kg(t),r=!!vg(i),o,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Nt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(ru(i,h=>{r=!1,h&&Ni(t,h),d(h)}),f._write=function(h,b,p){i.write(h,b)?p():o=p},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(ru(t,h=>{n=!1,h&&Ni(t,h),d(h)}),t.on("readable",function(){if(c){let h=c;c=null,h()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=t.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&l!==null&&(h=new fu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Ri,"_duplexify")});var rt=T((yx,mu)=>{"use strict";var{ObjectDefineProperties:Lg,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:Cg,ObjectSetPrototypeOf:pu}=q();mu.exports=We;var Fs=Sn(),Ne=Or();pu(We.prototype,Fs.prototype);pu(We,Fs);{let e=Cg(Ne.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Ne.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);Fs.call(this,e),Ne.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,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)):this.allowHalfOpen=!0}s(We,"Duplex");Lg(We.prototype,{writable:{__proto__:null,...gt(Ne.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Ne.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Ne.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Ne.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Ne.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Ne.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Ne.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Ne.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Ne.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")}});var ks;function yu(){return ks===void 0&&(ks={}),ks}s(yu,"lazyWebStreams");We.fromWeb=function(e,t){return yu().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return yu().newReadableWritablePairFromDuplex(e)};var vs;We.from=function(e){return vs||(vs=hu()),vs(e,"body")}});var Os=T((bx,gu)=>{"use strict";var{ObjectSetPrototypeOf:bu,Symbol:Bg}=q();gu.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Dg}=ae().codes,As=rt(),{getHighWaterMark:Mg}=bn();bu(wt.prototype,As.prototype);bu(wt,As);var kn=Bg("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Mg(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),As.call(this,e),this._readableState.sync=!1,this[kn]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Wg)}s(wt,"Transform");function Is(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(Is,"final");function Wg(){this._final!==Is&&Is.call(this)}s(Wg,"prefinish");wt.prototype._final=Is;wt.prototype._transform=function(e,t,i){throw new Dg("_transform()")};wt.prototype._write=function(e,t,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||o===n.length||n.length<n.highWaterMark?i():this[kn]=i})};wt.prototype._read=function(){if(this[kn]){let e=this[kn];this[kn]=null,e()}}});var Ts=T((wx,Su)=>{"use strict";var{ObjectSetPrototypeOf:wu}=q();Su.exports=Li;var Ps=Os();wu(Li.prototype,Ps.prototype);wu(Li,Ps);function Li(e){if(!(this instanceof Li))return new Li(e);Ps.call(this,e)}s(Li,"PassThrough");Li.prototype._transform=function(e,t,i){i(null,e)}});var Nr=T((Ex,vu)=>{var vn=Pt(),{ArrayIsArray:Ug,Promise:jg,SymbolAsyncIterator:qg,SymbolDispose:$g}=q(),Rr=bt(),{once:zg}=re(),Vg=Xt(),Eu=rt(),{aggregateTwoErrors:Hg,codes:{ERR_INVALID_ARG_TYPE:Us,ERR_INVALID_RETURN_VALUE:Rs,ERR_MISSING_ARGS:Kg,ERR_STREAM_DESTROYED:Gg,ERR_STREAM_PREMATURE_CLOSE:Yg},AbortError:Xg}=ae(),{validateFunction:Jg,validateAbortSignal:Qg}=ki(),{isIterable:ei,isReadable:Ns,isReadableNodeStream:Tr,isNodeStream:_u,isTransformStream:Ci,isWebStream:Zg,isReadableStream:Ls,isReadableFinished:ew}=tt(),tw=globalThis.AbortController||Ei().AbortController,Cs,Bs,Ds;function xu(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Rr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Vg.destroyer(e,o||new Gg("pipe")))},"destroy"),cleanup:r}}s(xu,"destroyer");function iw(e){return Jg(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(iw,"popCallback");function Ms(e){if(ei(e))return e;if(Tr(e))return nw(e);throw new Us("val",["Readable","Iterable","AsyncIterable"],e)}s(Ms,"makeAsyncIterable");async function*nw(e){Bs||(Bs=Sn()),yield*Bs.prototype[qg].call(e)}s(nw,"fromReadable");async function Pr(e,t,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new jg((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Rr(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();n&&(t.end(),await c()),i()}catch(f){i(r!==f?Hg(r,f):f)}finally{l(),t.off("drain",a)}}s(Pr,"pumpToNode");async function Ws(e,t,i,{end:n}){Ci(t)&&(t=t.writable);let r=t.getWriter();try{for await(let o of e)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(Ws,"pumpToWeb");function rw(...e){return ku(e,zg(iw(e)))}s(rw,"pipeline");function ku(e,t,i){if(e.length===1&&Ug(e[0])&&(e=e[0]),e.length<2)throw new Kg("streams");let n=new tw,r=n.signal,o=i?.signal,a=[];Qg(o,"options.signal");function c(){w(new Xg)}s(c,"abort"),Ds=Ds||re().addAbortListener;let l;o&&(l=Ds(o,c));let f,d,h=[],b=0;function p(N){w(N,--b===0)}s(p,"finish");function w(N,F){var B;if(N&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=N),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[$g](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),vn.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let N=0;N<e.length;N++){let F=e[N],B=N<e.length-1,Bt=N>0,Ee=B||i?.end!==!1,oi=N===e.length-1;if(_u(F)){let le=function(at){at&&at.name!=="AbortError"&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(at)};var v=le;if(s(le,"onError"),Ee){let{destroy:at,cleanup:eo}=xu(F,B,Bt);h.push(at),Ns(F)&&oi&&a.push(eo)}F.on("error",le),Ns(F)&&oi&&a.push(()=>{F.removeListener("error",le)})}if(N===0)if(typeof F=="function"){if(g=F({signal:r}),!ei(g))throw new Rs("Iterable, AsyncIterable or Stream","source",g)}else ei(F)||Tr(F)||Ci(F)?g=F:g=Eu.from(F);else if(typeof F=="function"){if(Ci(g)){var A;g=Ms((A=g)===null||A===void 0?void 0:A.readable)}else g=Ms(g);if(g=F(g,{signal:r}),B){if(!ei(g,!0))throw new Rs("AsyncIterable",`transform[${N-1}]`,g)}else{var k;Cs||(Cs=Ts());let le=new Cs({objectMode:!0}),at=(k=g)===null||k===void 0?void 0:k.then;if(typeof at=="function")b++,at.call(g,Et=>{d=Et,Et!=null&&le.write(Et),Ee&&le.end(),vn.nextTick(p)},Et=>{le.destroy(Et),vn.nextTick(p,Et)});else if(ei(g,!0))b++,Pr(g,le,p,{end:Ee});else if(Ls(g)||Ci(g)){let Et=g.readable||g;b++,Pr(Et,le,p,{end:Ee})}else throw new Rs("AsyncIterable or Promise","destination",g);g=le;let{destroy:eo,cleanup:eh}=xu(g,!1,!0);h.push(eo),oi&&a.push(eh)}}else if(_u(F)){if(Tr(g)){b+=2;let le=ow(g,F,p,{end:Ee});Ns(F)&&oi&&a.push(le)}else if(Ci(g)||Ls(g)){let le=g.readable||g;b++,Pr(le,F,p,{end:Ee})}else if(ei(g))b++,Pr(g,F,p,{end:Ee});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(Zg(F)){if(Tr(g))b++,Ws(Ms(g),F,p,{end:Ee});else if(Ls(g)||ei(g))b++,Ws(g,F,p,{end:Ee});else if(Ci(g))b++,Ws(g.readable,F,p,{end:Ee});else throw new Us("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=Eu.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&vn.nextTick(c),g}s(ku,"pipelineImpl");function ow(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new Yg)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),ew(e)?vn.nextTick(a):e.once("end",a)}else i();return Rr(e,{readable:!0,writable:!1},a=>{let c=e._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?e.once("end",i).once("error",i):i(a)}),Rr(t,{readable:!1,writable:!0},i)}s(ow,"pipe");vu.exports={pipelineImpl:ku,pipeline:rw}});var qs=T((xx,Tu)=>{"use strict";var{pipeline:sw}=Nr(),Lr=rt(),{destroyer:aw}=Xt(),{isNodeStream:Cr,isReadable:Fu,isWritable:Iu,isWebStream:js,isTransformStream:ti,isWritableStream:Au,isReadableStream:Ou}=tt(),{AbortError:cw,codes:{ERR_INVALID_ARG_VALUE:Pu,ERR_MISSING_ARGS:lw}}=ae(),fw=bt();Tu.exports=s(function(...t){if(t.length===0)throw new lw("streams");if(t.length===1)return Lr.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Lr.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Lr.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Cr(t[p])&&!js(t[p]))){if(p<t.length-1&&!(Fu(t[p])||Ou(t[p])||ti(t[p])))throw new Pu(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(Iu(t[p])||Au(t[p])||ti(t[p])))throw new Pu(`streams[${p}]`,i[p],"must be writable")}let n,r,o,a,c;function l(p){let w=a;a=null,w?w(p):p?c.destroy(p):!b&&!h&&c.destroy()}s(l,"onfinished");let f=t[0],d=sw(t,l),h=!!(Iu(f)||Au(f)||ti(f)),b=!!(Fu(d)||Ou(d)||ti(d));if(c=new Lr({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Cr(f))c._write=function(w,g,A){f.write(w,g)?A():n=A},c._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(js(f)){let g=(ti(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(N){v(N)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ti(d)?d.readable:d;fw(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Cr(d))d.on("readable",function(){if(o){let p=o;o=null,p()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let p=d.read();if(p===null){o=c._read;return}if(!c.push(p))return}};else if(js(d)){let w=(ti(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(p,w){!p&&a!==null&&(p=new cw),o=null,n=null,r=null,a===null?w(p):(a=w,Cr(d)&&aw(d,p))},c},"compose")});var ju=T((vx,Vs)=>{"use strict";var uw=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:dw,ERR_INVALID_ARG_TYPE:Fn,ERR_MISSING_ARGS:hw,ERR_OUT_OF_RANGE:pw},AbortError:ot}=ae(),{validateAbortSignal:ii,validateInteger:Ru,validateObject:ni}=ki(),yw=q().Symbol("kWeak"),mw=q().Symbol("kResistStopPropagation"),{finished:bw}=bt(),gw=qs(),{addAbortSignalNoValidate:ww}=mn(),{isWritable:Sw,isNodeStream:Ew}=tt(),{deprecate:_w}=re(),{ArrayPrototypePush:xw,Boolean:kw,MathFloor:Nu,Number:vw,NumberIsNaN:Fw,Promise:Lu,PromiseReject:Cu,PromiseResolve:Iw,PromisePrototypeThen:Bu,Symbol:Mu}=q(),Br=Mu("kEmpty"),Du=Mu("kEof");function Aw(e,t){if(t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),Ew(e)&&!Sw(e))throw new dw("stream",e,"must be writable");let i=gw(this,e);return t!=null&&t.signal&&ww(t.signal,i),i}s(Aw,"compose");function Dr(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=Nu(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=Nu(t.highWaterMark)),Ru(i,"options.concurrency",1),Ru(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(kw)),a=this,c=[],l={signal:o},f,d,h=!1,b=0;function p(){h=!0,w()}s(p,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let k of a){if(h)return;if(o.aborted)throw new ot;try{if(k=e(k,l),k===Br)continue;k=Iw(k)}catch(v){k=Cu(v)}b+=1,Bu(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new Lu(v=>{d=v})}c.push(Du)}catch(k){let v=Cu(k);Bu(v,w,p),c.push(v)}finally{h=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let k=await c[0];if(k===Du)return;if(o.aborted)throw new ot;k!==Br&&(yield k),c.shift(),g()}await new Lu(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Dr,"map");function Ow(e=void 0){return e!=null&&ni(e,"options"),e?.signal!=null&&ii(e.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ot({cause:e.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(Ow,"asIndexedPairs");async function Wu(e,t=void 0){for await(let i of zs.call(this,e,t))return!0;return!1}s(Wu,"some");async function Pw(e,t=void 0){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);return!await Wu.call(this,async(...i)=>!await e(...i),t)}s(Pw,"every");async function Tw(e,t){for await(let i of zs.call(this,e,t))return i}s(Tw,"find");async function Rw(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Br}s(i,"forEachFn");for await(let n of Dr.call(this,i,t));}s(Rw,"forEach");function zs(e,t){if(typeof e!="function")throw new Fn("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Br}return s(i,"filterFn"),Dr.call(this,i,t)}s(zs,"filter");var $s=class extends hw{static{s(this,"ReduceAwareErrMissingArgs")}constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function Nw(e,t,i){var n;if(typeof e!="function")throw new Fn("reducer",["Function","AsyncFunction"],e);i!=null&&ni(i,"options"),i?.signal!=null&&ii(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new ot(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await bw(this.destroy(f)),f}let o=new uw,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[yw]:this,[mw]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new ot;r?t=await e(t,f,{signal:a}):(t=f,r=!0)}if(!c&&!r)throw new $s}finally{o.abort()}return t}s(Nw,"reduce");async function Lw(e){e!=null&&ni(e,"options"),e?.signal!=null&&ii(e.signal,"options.signal");let t=[];for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ot(void 0,{cause:e.signal.reason});xw(t,n)}return t}s(Lw,"toArray");function Cw(e,t){let i=Dr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(Cw,"flatMap");function Uu(e){if(e=vw(e),Fw(e))return 0;if(e<0)throw new pw("number",">= 0",e);return e}s(Uu,"toIntegerOrInfinity");function Bw(e,t=void 0){return t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),e=Uu(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;e--<=0&&(yield o)}},"drop").call(this)}s(Bw,"drop");function Dw(e,t=void 0){return t!=null&&ni(t,"options"),t?.signal!=null&&ii(t.signal,"options.signal"),e=Uu(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(Dw,"take");Vs.exports.streamReturningOperators={asIndexedPairs:_w(Ow,"readable.asIndexedPairs will be removed in a future version."),drop:Bw,filter:zs,flatMap:Cw,map:Dr,take:Dw,compose:Aw};Vs.exports.promiseReturningOperators={every:Pw,forEach:Rw,reduce:Nw,toArray:Lw,some:Wu,find:Tw}});var Hs=T((Ix,qu)=>{"use strict";var{ArrayPrototypePop:Mw,Promise:Ww}=q(),{isIterable:Uw,isNodeStream:jw,isWebStream:qw}=tt(),{pipelineImpl:$w}=Nr(),{finished:zw}=bt();Ks();function Vw(...e){return new Ww((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!jw(o)&&!Uw(o)&&!qw(o)){let a=Mw(e);n=a.signal,r=a.end}$w(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(Vw,"pipeline");qu.exports={finished:zw,pipeline:Vw}});var Ks=T((Ox,Ju)=>{var{Buffer:Hw}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Vu,ReflectApply:Hu}=q(),{promisify:{custom:Ku}}=re(),{streamReturningOperators:$u,promiseReturningOperators:zu}=ju(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Gu}}=ae(),Kw=qs(),{setDefaultHighWaterMark:Gw,getDefaultHighWaterMark:Yw}=bn(),{pipeline:Yu}=Nr(),{destroyer:Xw}=Xt(),Xu=bt(),Gs=Hs(),In=tt(),C=Ju.exports=mr().Stream;C.isDestroyed=In.isDestroyed;C.isDisturbed=In.isDisturbed;C.isErrored=In.isErrored;C.isReadable=In.isReadable;C.isWritable=In.isWritable;C.Readable=Sn();for(let e of Vu($u)){let i=function(...n){if(new.target)throw Gu();return C.Readable.from(Hu(t,this,n))};Ys=i,s(i,"fn");let t=$u[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ys;for(let e of Vu(zu)){let i=function(...r){if(new.target)throw Gu();return Hu(t,this,r)};Ys=i,s(i,"fn");let t=zu[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ys;C.Writable=Or();C.Duplex=rt();C.Transform=Os();C.PassThrough=Ts();C.pipeline=Yu;var{addAbortSignal:Jw}=mn();C.addAbortSignal=Jw;C.finished=Xu;C.destroy=Xw;C.compose=Kw;C.setDefaultHighWaterMark=Gw;C.getDefaultHighWaterMark=Yw;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return Gs},"get")});St(Yu,Ku,{__proto__:null,enumerable:!0,get:s(function(){return Gs.pipeline},"get")});St(Xu,Ku,{__proto__:null,enumerable:!0,get:s(function(){return Gs.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return Hw.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var Qu=T((Tx,H)=>{"use strict";var Q=Ks(),Qw=Hs(),Zw=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=Zw;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return Qw},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var pS={};Dn(pS,{Async:()=>ua,AsyncTransaction:()=>Io,BigIntStats:()=>be,BigIntStatsFs:()=>tn,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>lS,FetchFS:()=>Xr,File:()=>jt,FileSystem:()=>pe,InMemory:()=>ln,InMemoryStore:()=>Gn,Index:()=>Yr,IndexFS:()=>Cn,Inode:()=>Ge,MutexLock:()=>Jr,Mutexed:()=>ba,NoSyncFile:()=>mi,Overlay:()=>uS,OverlayFS:()=>Bn,Port:()=>sS,PortFS:()=>Gr,PortFile:()=>Nn,PreloadFile:()=>we,ReadStream:()=>Lt,Readonly:()=>ya,SimpleAsyncStore:()=>Ao,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>Zi,StatsFs:()=>en,StoreFS:()=>sn,Sync:()=>dS,SyncTransaction:()=>cn,Transaction:()=>an,UnmutexedOverlayFS:()=>Zr,WriteStream:()=>Ct,ZenFsType:()=>Fo,_InMemory:()=>gc,_Port:()=>Qd,__MutexedFS:()=>Qr,_toUnixTimestamp:()=>dh,access:()=>Rd,accessSync:()=>Dc,appendFile:()=>cd,appendFileSync:()=>xc,attachFS:()=>Jd,checkOptions:()=>ro,chmod:()=>Id,chmodSync:()=>Lc,chown:()=>vd,chownSync:()=>Rc,close:()=>fd,closeSync:()=>It,configure:()=>iS,configureSingle:()=>tS,constants:()=>kt,copyFile:()=>Ud,copyFileSync:()=>Lo,cp:()=>zd,cpSync:()=>Co,createReadStream:()=>Bd,createWriteStream:()=>Dd,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>Un,default:()=>hS,detachFS:()=>oS,encode:()=>Le,encodeDirListing:()=>xe,errorMessages:()=>io,exists:()=>ed,existsSync:()=>Je,fchmod:()=>bd,fchmodSync:()=>tr,fchown:()=>md,fchownSync:()=>er,fdatasync:()=>hd,fdatasyncSync:()=>Ic,flagToMode:()=>nn,flagToNumber:()=>vp,flagToString:()=>mc,fs:()=>Rn,fstat:()=>ld,fstatSync:()=>kc,fsync:()=>dd,fsyncSync:()=>Fc,ftruncate:()=>ud,ftruncateSync:()=>vc,futimes:()=>gd,futimesSync:()=>ir,handleRequest:()=>Ln,isAppendable:()=>pt,isBackend:()=>$i,isBackendConfig:()=>zi,isExclusive:()=>on,isReadable:()=>vt,isStatsEqual:()=>vo,isSynchronous:()=>Fp,isTruncating:()=>rn,isWriteable:()=>ge,lchmod:()=>Ad,lchmodSync:()=>Cc,lchown:()=>Fd,lchownSync:()=>Nc,levenshtein:()=>no,link:()=>_d,linkSync:()=>Pc,lopenSync:()=>hn,lstat:()=>id,lstatSync:()=>Oo,lutimes:()=>Pd,lutimesSync:()=>Bc,mkdir:()=>Sd,mkdirSync:()=>nr,mkdirpSync:()=>Ia,mkdtemp:()=>Wd,mkdtempSync:()=>Mc,mount:()=>$t,mountObject:()=>un,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Mt,open:()=>od,openAsBlob:()=>Hd,openSync:()=>dn,opendir:()=>$d,opendirSync:()=>jc,parseFlag:()=>M,promises:()=>Tn,randomIno:()=>Qi,read:()=>yd,readFile:()=>sd,readFileSync:()=>Zn,readSync:()=>Oc,readdir:()=>Ed,readdirSync:()=>Si,readlink:()=>kd,readlinkSync:()=>To,readv:()=>jd,readvSync:()=>Wc,realpath:()=>Td,realpathSync:()=>Xe,rename:()=>Zu,renameSync:()=>Sc,resolveMountConfig:()=>Wi,resolveRemoteMount:()=>aS,rm:()=>Md,rmSync:()=>No,rmdir:()=>wd,rmdirSync:()=>Po,rootCredentials:()=>hh,rootIno:()=>Ye,setImmediate:()=>uh,size_max:()=>Oe,stat:()=>td,statSync:()=>Te,statfs:()=>Vd,statfsSync:()=>qc,symlink:()=>xd,symlinkSync:()=>Tc,truncate:()=>nd,truncateSync:()=>Ec,umount:()=>gi,unlink:()=>rd,unlinkSync:()=>Qn,unwatchFile:()=>Ld,utimes:()=>Od,utimesSync:()=>Ro,version:()=>ma,watch:()=>Cd,watchFile:()=>Nd,write:()=>pd,writeFile:()=>ad,writeFileSync:()=>pn,writeSync:()=>Ac,writev:()=>qd,writevSync:()=>Uc});var U=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EINTR=4]="EINTR",y[y.EIO=5]="EIO",y[y.ENXIO=6]="ENXIO",y[y.EBADF=9]="EBADF",y[y.EAGAIN=11]="EAGAIN",y[y.ENOMEM=12]="ENOMEM",y[y.EACCES=13]="EACCES",y[y.EFAULT=14]="EFAULT",y[y.ENOTBLK=15]="ENOTBLK",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.EXDEV=18]="EXDEV",y[y.ENODEV=19]="ENODEV",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.ENFILE=23]="ENFILE",y[y.EMFILE=24]="EMFILE",y[y.ETXTBSY=26]="ETXTBSY",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.ESPIPE=29]="ESPIPE",y[y.EROFS=30]="EROFS",y[y.EMLINK=31]="EMLINK",y[y.EPIPE=32]="EPIPE",y[y.EDOM=33]="EDOM",y[y.ERANGE=34]="ERANGE",y[y.EDEADLK=35]="EDEADLK",y[y.ENAMETOOLONG=36]="ENAMETOOLONG",y[y.ENOLCK=37]="ENOLCK",y[y.ENOSYS=38]="ENOSYS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ELOOP=40]="ELOOP",y[y.ENOMSG=42]="ENOMSG",y[y.EBADE=52]="EBADE",y[y.EBADR=53]="EBADR",y[y.EXFULL=54]="EXFULL",y[y.ENOANO=55]="ENOANO",y[y.EBADRQC=56]="EBADRQC",y[y.ENOSTR=60]="ENOSTR",y[y.ENODATA=61]="ENODATA",y[y.ETIME=62]="ETIME",y[y.ENOSR=63]="ENOSR",y[y.ENONET=64]="ENONET",y[y.EREMOTE=66]="EREMOTE",y[y.ENOLINK=67]="ENOLINK",y[y.ECOMM=70]="ECOMM",y[y.EPROTO=71]="EPROTO",y[y.EBADMSG=74]="EBADMSG",y[y.EOVERFLOW=75]="EOVERFLOW",y[y.EBADFD=77]="EBADFD",y[y.ESTRPIPE=86]="ESTRPIPE",y[y.ENOTSOCK=88]="ENOTSOCK",y[y.EDESTADDRREQ=89]="EDESTADDRREQ",y[y.EMSGSIZE=90]="EMSGSIZE",y[y.EPROTOTYPE=91]="EPROTOTYPE",y[y.ENOPROTOOPT=92]="ENOPROTOOPT",y[y.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",y[y.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",y[y.ENOTSUP=95]="ENOTSUP",y[y.ENETDOWN=100]="ENETDOWN",y[y.ENETUNREACH=101]="ENETUNREACH",y[y.ENETRESET=102]="ENETRESET",y[y.ETIMEDOUT=110]="ETIMEDOUT",y[y.ECONNREFUSED=111]="ECONNREFUSED",y[y.EHOSTDOWN=112]="EHOSTDOWN",y[y.EHOSTUNREACH=113]="EHOSTUNREACH",y[y.EALREADY=114]="EALREADY",y[y.EINPROGRESS=115]="EINPROGRESS",y[y.ESTALE=116]="ESTALE",y[y.EREMOTEIO=121]="EREMOTEIO",y[y.EDQUOT=122]="EDQUOT",y))(U||{}),io={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},u=class e extends Error{constructor(i,n=io[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=U[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static{s(this,"ErrnoError")}static fromJSON(i){let n=new e(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new e(U[i],io[U[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};var lh="/";function Fa(e,t){let i="",n=0,r=-1,o=0,a="\0";for(let c=0;c<=e.length;++c){if(c<e.length)a=e[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",n=0):(i=i.slice(0,l),n=i.length-1-i.lastIndexOf("/")),r=c,o=0;continue}else if(i.length!==0){i="",n=0,r=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+e.slice(r+1,c):i=e.slice(r+1,c),n=c-r-1;r=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Fa,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),lh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=Fa(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function fh(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=Fa(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(fh,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?fh(t):"."}s(z,"join");function _(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,n=!0;for(let r=e.length-1;r>=1;--r)if(e[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(_,"dirname");function D(e,t){let i=0,n=-1,r=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(let c=e.length-1;c>=0;--c)if(e[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(n=c):(o=-1,n=a));return i===n?n=a:n===-1&&(n=e.length),e.slice(i,n)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":e.slice(i,n)}s(D,"basename");function Mn(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let n=t?1:0,r=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=n;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&t?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=e.slice(d,a):(i.name=e.slice(d,r),i.base=e.slice(d,a),i.ext=e.slice(r,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(Mn,"parse");function Ia(e,t,i){i.existsSync(e)||(Ia(_(e),t,i),i.mkdirSync(e,t))}s(Ia,"mkdirpSync");function Wn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(Wn,"_min");function no(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,n=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&e.charCodeAt(r)===t.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(r+b),o[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=t.charCodeAt(r+(c=a)),p=t.charCodeAt(r+(l=a+1)),w=t.charCodeAt(r+(f=a+2)),g=t.charCodeAt(r+(d=a+3)),A=a+=4;for(let k=0;k<i;){let v=o[i+k],N=o[k];c=Wn(N,c,l,b,v),l=Wn(c,l,f,p,v),f=Wn(l,f,d,w,v),A=Wn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=N}}let h=0;for(;a<n;){let b=t.charCodeAt(r+(c=a));h=++a;for(let p=0;p<i;p++){let w=o[p];o[p]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+p]?c:c+1,c=w}}return h}s(no,"levenshtein");var uh=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Le(e){if(typeof e!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Le,"encode");function ai(e){if(!(e instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ai,"decode");function Un(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s(Un,"decodeDirListing");function xe(e){return Le(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function dh(e){if(typeof e=="number")return Math.floor(e);if(e instanceof Date)return Math.floor(e.getTime()/1e3);throw new Error("Cannot parse time")}s(dh,"_toUnixTimestamp");function ke(e,t){if(typeof e=="number")return e;if(typeof e=="string"){let i=parseInt(e,8);if(!isNaN(i))return i}if(typeof t=="number")return t;throw new u(22,"Invalid mode: "+e?.toString())}s(ke,"normalizeMode");function Mt(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);if(typeof e=="string")return new Date(e);throw new u(22,"Invalid time.")}s(Mt,"normalizeTime");function x(e){if(e=e.toString(),e.includes("\0"))throw new u(22,"Path can not contain null character");if(e.length==0)throw new u(22,"Path can not be empty");return _t(e.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function ve(e,t="utf8",i,n=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:n}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:ke("mode"in e?e?.mode:null,n)}}s(ve,"normalizeOptions");function $i(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s($i,"isBackend");async function ro(e,t){if(typeof t!="object"||t===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(e.options)){let r=t?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:no(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(ro,"checkOptions");function zi(e){return e!=null&&typeof e=="object"&&"backend"in e&&$i(e.backend)}s(zi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},hh={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Rn={};Dn(Rn,{BigIntStatsFs:()=>tn,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Lt,Stats:()=>G,StatsFs:()=>en,WriteStream:()=>Ct,access:()=>Rd,accessSync:()=>Dc,appendFile:()=>cd,appendFileSync:()=>xc,chmod:()=>Id,chmodSync:()=>Lc,chown:()=>vd,chownSync:()=>Rc,close:()=>fd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Ud,copyFileSync:()=>Lo,cp:()=>zd,cpSync:()=>Co,createReadStream:()=>Bd,createWriteStream:()=>Dd,exists:()=>ed,existsSync:()=>Je,fchmod:()=>bd,fchmodSync:()=>tr,fchown:()=>md,fchownSync:()=>er,fdatasync:()=>hd,fdatasyncSync:()=>Ic,fstat:()=>ld,fstatSync:()=>kc,fsync:()=>dd,fsyncSync:()=>Fc,ftruncate:()=>ud,ftruncateSync:()=>vc,futimes:()=>gd,futimesSync:()=>ir,lchmod:()=>Ad,lchmodSync:()=>Cc,lchown:()=>Fd,lchownSync:()=>Nc,link:()=>_d,linkSync:()=>Pc,lopenSync:()=>hn,lstat:()=>id,lstatSync:()=>Oo,lutimes:()=>Pd,lutimesSync:()=>Bc,mkdir:()=>Sd,mkdirSync:()=>nr,mkdtemp:()=>Wd,mkdtempSync:()=>Mc,mount:()=>$t,mountObject:()=>un,mounts:()=>Pe,open:()=>od,openAsBlob:()=>Hd,openSync:()=>dn,opendir:()=>$d,opendirSync:()=>jc,promises:()=>Tn,read:()=>yd,readFile:()=>sd,readFileSync:()=>Zn,readSync:()=>Oc,readdir:()=>Ed,readdirSync:()=>Si,readlink:()=>kd,readlinkSync:()=>To,readv:()=>jd,readvSync:()=>Wc,realpath:()=>Td,realpathSync:()=>Xe,rename:()=>Zu,renameSync:()=>Sc,rm:()=>Md,rmSync:()=>No,rmdir:()=>wd,rmdirSync:()=>Po,stat:()=>td,statSync:()=>Te,statfs:()=>Vd,statfsSync:()=>qc,symlink:()=>xd,symlinkSync:()=>Tc,truncate:()=>nd,truncateSync:()=>Ec,umount:()=>gi,unlink:()=>rd,unlinkSync:()=>Qn,unwatchFile:()=>Ld,utimes:()=>Od,utimesSync:()=>Ro,watch:()=>Cd,watchFile:()=>Nd,write:()=>pd,writeFile:()=>ad,writeFileSync:()=>pn,writeSync:()=>Ac,writev:()=>qd,writevSync:()=>Uc});var fa=qi(Ie(),1);var kt={};Dn(kt,{COPYFILE_EXCL:()=>Ki,COPYFILE_FICLONE:()=>Kh,COPYFILE_FICLONE_FORCE:()=>Gh,F_OK:()=>Hi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>tp,O_DIRECTORY:()=>Xh,O_DSYNC:()=>Zh,O_EXCL:()=>Ve,O_NOATIME:()=>Jh,O_NOCTTY:()=>Yh,O_NOFOLLOW:()=>Qh,O_NONBLOCK:()=>ip,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>ep,O_SYNC:()=>hi,O_TRUNC:()=>He,O_WRONLY:()=>ze,R_OK:()=>Ae,S_IFBLK:()=>ft,S_IFCHR:()=>ut,S_IFDIR:()=>he,S_IFIFO:()=>dt,S_IFLNK:()=>Ce,S_IFMT:()=>K,S_IFREG:()=>de,S_IFSOCK:()=>lt,S_IRGRP:()=>lp,S_IROTH:()=>dp,S_IRUSR:()=>sp,S_IRWXG:()=>bo,S_IRWXO:()=>go,S_IRWXU:()=>mo,S_ISGID:()=>rp,S_ISUID:()=>np,S_ISVTX:()=>op,S_IWGRP:()=>fp,S_IWOTH:()=>hp,S_IWUSR:()=>ap,S_IXGRP:()=>up,S_IXOTH:()=>pp,S_IXUSR:()=>cp,UV_FS_O_FILEMAP:()=>yp,W_OK:()=>X,X_OK:()=>Hh});var Hi=0,Ae=4,X=2,Hh=1,Ki=1,Kh=2,Gh=4,di=0,ze=1,ue=2,ee=64,Ve=128,Yh=256,He=512,Ke=1024,Xh=65536,Jh=262144,Qh=131072,hi=1052672,Zh=4096,ep=32768,tp=16384,ip=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,np=2048,rp=1024,op=512,mo=448,sp=256,ap=128,cp=64,bo=56,lp=32,fp=16,up=8,go=7,dp=4,hp=2,pp=1,yp=0;var Vn=qi(Ya(),1);function Xa(e){try{return JSON.parse(e),!0}catch{return!1}}s(Xa,"isJSON");function Yi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Yi,"capitalize");var Ja=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],Qa=[...Ja,...Ja.map(e=>Yi(e)),"char"],Hn=/^(u?int|float)(8|16|32|64)$/i;function So(e){return e=="char"?"uint8":e.toLowerCase()}s(So,"normalize");function Eo(e){return Hn.test(e.toString())}s(Eo,"isType");function Kn(e){return e=="char"||Hn.test(e.toString().toLowerCase())}s(Kn,"isValid");function Za(e){if(!Kn(e))throw new TypeError("Not a valid primitive type: "+e)}s(Za,"checkValid");var Xi=Symbol("struct_init"),yi=Symbol("struct");function wp(e){return e!=null&&typeof e=="object"&&yi in e}s(wp,"isValidMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function Ji(e){return typeof e=="function"&&pi(e)in e&&wp(e[pi(e)])}s(Ji,"isStatic");function ec(e){return e!=null&&typeof e=="object"&&Ji(e.constructor)}s(ec,"isInstance");function _o(e){if(!ec(e))throw new TypeError((typeof e=="function"?e.name:e&&e.constructor.name)+" is not a struct instance")}s(_o,"checkInstance");function Sp(e){return ec(e)||Ji(e)}s(Sp,"isStruct");function tc(e){if(!Sp(e))throw new TypeError((typeof e=="function"?e.name:e&&e.constructor.name)+" is not a struct")}s(tc,"checkStruct");function ht(e){if(typeof e=="string")return Za(e),+So(e).match(Hn)[2]/8;tc(e);let t=Ji(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function _p(e,t){return Math.ceil(e/t)*t}s(_p,"align");function nc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Xi]||=[];let r=0,o=new Map;for(let a of n.metadata[Xi]){let{name:c,type:l,length:f}=a;if(!Kn(l)&&!Ji(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Kn(l)?So(l):l,length:f}),r+=ht(l)*(f||1),r=_p(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(nc,"struct");function ic(e,t){return function(i,n){let r=n.name;if(typeof r=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return n.metadata??={},n.metadata[Xi]||=[],n.metadata[Xi].push({name:r,type:e,length:t}),i}}s(ic,"member");function xo(e){_o(e);let{options:t,members:i}=e.constructor[pi(e.constructor)][yi],n=new Uint8Array(ht(e)),r=new DataView(n.buffer);for(let[o,{type:a,length:c,offset:l}]of i)for(let f=0;f<(c||1);f++){let d=l+ht(a)*f,h=c>0?e[o][f]:e[o];if(typeof h=="string"&&(h=h.charCodeAt(0)),!Eo(a)){n.set(h?xo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Yi(a);if(p=="setInt64"){r.setBigInt64(d,BigInt(h),!t.bigEndian);continue}if(p=="setUint64"){r.setBigUint64(d,BigInt(h),!t.bigEndian);continue}r[p](d,Number(h),!t.bigEndian)}return n}s(xo,"serialize");function ko(e,t){_o(e);let{options:i,members:n}=e.constructor[pi(e.constructor)][yi],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),o=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(let[a,{type:c,offset:l,length:f}]of n)for(let d=0;d<(f||1);d++){let h=f>0?e[a]:e,b=f>0?d:a,p=l+ht(c)*d;if(typeof e[a]=="string"){e[a]=e[a].slice(0,d)+String.fromCharCode(o.getUint8(p))+e[a].slice(d+1);continue}if(!Eo(c)){if(h[b]===null||h[b]===void 0)continue;ko(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Yi(c);if(g=="getInt64"){h[b]=o.getBigInt64(p,!i.bigEndian);continue}if(g=="getUint64"){h[b]=o.getBigUint64(p,!i.bigEndian);continue}h[b]=o[g](p,!i.bigEndian)}}s(ko,"deserialize");function xp(e){function t(i,n){return typeof i=="number"?ic(e,i):ic(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(xp,"_member");var Be=Object.fromEntries(Qa.map(e=>[e,xp(e)]));var Oe=2**32-1,Ye=0n;function rc(){return Math.round(Math.random()*2**32).toString(16)}s(rc,"_random");function Qi(){return BigInt("0x"+rc()+rc())}s(Qi,"randomIno");var oc,sc,ac,cc,lc,fc,uc,dc,hc,pc,yc,me;me=[,,,],yc=[nc()],pc=[Be.uint64],hc=[Be.uint32],dc=[Be.uint16],uc=[Be.uint32],fc=[Be.uint32],lc=[Be.uint32],cc=[Be.float64],ac=[Be.float64],sc=[Be.float64],oc=[Be.float64];var te=class te{get data(){return xo(this)}constructor(t){if(t){if(t.byteLength<ht(te))throw new RangeError(`Can not create an inode from a buffer less than ${ht(te)} bytes`);ko(this,t);return}this.ino=Qi(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}toStats(){return new G(this)}update(t){let i=!1;return this.size!==t.size&&(this.size=t.size,i=!0),this.mode!==t.mode&&(this.mode=t.mode,i=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,i=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,i=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,i=!0),i}};_e(me,5,"ino",pc,te),_e(me,5,"size",hc,te),_e(me,5,"mode",dc,te),_e(me,5,"nlink",uc,te),_e(me,5,"uid",fc,te),_e(me,5,"gid",lc,te),_e(me,5,"atimeMs",cc,te),_e(me,5,"birthtimeMs",ac,te),_e(me,5,"mtimeMs",sc,te),_e(me,5,"ctimeMs",oc,te),te=_e(me,0,"Inode",yc,te),s(te,"Inode"),va(me,1,te);var Ge=te;var Zi=class{constructor({atimeMs:t,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(t??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}static{s(this,"StatsCommon")}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t){if(ye.euid===0||ye.egid===0)return!0;let i=(ye.uid==this.uid?448:0)|(ye.gid==this.gid?56:0)|7;return(t&this.mode&i)==t}cred(t=Number(this.uid),i=Number(this.gid)){return{uid:t,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:t,egid:i}}chmod(t){this.mode=this._convert(this.mode&61440|t)}chown(t,i){t=Number(t),i=Number(i),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}},G=class extends Zi{constructor(){super(...arguments);this._isBigint=!1}static{s(this,"Stats")}},be=class extends Zi{constructor(){super(...arguments);this._isBigint=!0}static{s(this,"BigIntStats")}};function vo(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(vo,"isStatsEqual");var Fo=525687744115,en=class{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}static{s(this,"StatsFs")}},tn=class{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}static{s(this,"BigIntStatsFs")}};var Tn={};Dn(Tn,{FileHandle:()=>ce,access:()=>sa,appendFile:()=>Qs,chmod:()=>na,chown:()=>ta,constants:()=>kt,copyFile:()=>zr,cp:()=>Vr,exists:()=>je,lchmod:()=>ra,lchown:()=>ia,link:()=>Zs,lstat:()=>Wr,lutimes:()=>oa,mkdir:()=>Pn,mkdtemp:()=>aa,open:()=>Se,opendir:()=>ca,readFile:()=>On,readdir:()=>Vt,readlink:()=>jr,realpath:()=>Ue,rename:()=>Xs,rm:()=>$r,rmdir:()=>Ur,stat:()=>st,statfs:()=>la,symlink:()=>ea,truncate:()=>Js,unlink:()=>An,utimes:()=>qr,watch:()=>eS,writeFile:()=>Di});var ri=qi(Ie(),1);Promise.withResolvers??=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var kp=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return mc(e);if(!kp.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function mc(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+e)}}s(mc,"flagToString");function vp(e){switch(e){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+e)}}s(vp,"flagToNumber");function nn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(nn,"flagToMode");function vt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(vt,"isReadable");function ge(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ge,"isWriteable");function rn(e){return e.indexOf("w")!==-1}s(rn,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function Fp(e){return e.indexOf("s")!==-1}s(Fp,"isSynchronous");function on(e){return e.indexOf("x")!==-1}s(on,"isExclusive");var jt=class{constructor(t,i){this.fs=t;this.path=i}static{s(this,"File")}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}},we=class extends jt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Oe}))){super(i,n);this.fs=i;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(vt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}static{s(this,"PreloadFile")}get buffer(){return this._buffer}get position(){return pt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw u.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw u.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw u.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw u.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return Promise.resolve(new G(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new G(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,n=0,r=this.stats.size,o=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Oe}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,n,r,o){let a=this._write(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=this.position){let a=this._write(i,n,r,o);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,o){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!vt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),c}async read(i,n,r,o){let a=this._read(i,n,r,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,o){let a=this._read(i,n,r,o);return this.statSync(),a}async chmod(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),await this.sync()}chownSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,await this.sync()}utimesSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}async _setType(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}},mi=class extends we{static{s(this,"NoSyncFile")}constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};var Ft=qi(Ie(),1);var pe=class{static{s(this,"FileSystem")}metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Fo}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(i){return i.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(i){return i.code!="ENOENT"}}};var bc=5,sn=class extends pe{constructor(i){super();this.store=i;this._initialized=!1}static{s(this,"StoreFS")}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,n){var w=[];try{let r=S(w,this.store.transaction(),!0);let o=_(i),a=D(i),c=_(n),l=D(n),f=await this.findINode(r,o),d=await this.getDirListing(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")===0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=await this.findINode(r,c),p=await this.getDirListing(r,b,c));if(p[l]){let N=await this.getINode(r,p[l],n);if(!N.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(N.ino),await r.remove(p[l])}p[l]=h;await r.set(f.ino,xe(d));await r.set(b.ino,xe(p));await r.commit()}catch(g){var A=g,k=!0}finally{var v=E(w,A,k);v&&await v}}renameSync(i,n){var w=[];try{let r=S(w,this.store.transaction());let o=_(i),a=D(i),c=_(n),l=D(n),f=this.findINodeSync(r,o),d=this.getDirListingSync(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")==0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=this.findINodeSync(r,c),p=this.getDirListingSync(r,b,c));if(p[l]){let v=this.getINodeSync(r,p[l],n);if(!v.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(v.ino),r.removeSync(p[l])}p[l]=h;r.setSync(f.ino,xe(d));r.setSync(b.ino,xe(p));r.commitSync()}catch(g){var A=g,k=!0}finally{E(w,A,k)}}async stat(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);if(!r)throw u.With("ENOENT",i,"stat");return r.toStats()}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}statSync(i){var r=[];try{let n=S(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let o=await this.commitNew(i,32768,r,new Uint8Array(0));return new we(this,i,n,o.toStats(),new Uint8Array(0))}createFileSync(i,n,r){return this.commitNewSync(i,32768,r),this.openFileSync(i,n)}async openFile(i,n){var c=[];try{let r=S(c,this.store.transaction(),!0);let o=await this.findINode(r,i),a=await r.get(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}openFileSync(i,n){var c=[];try{let r=S(c,this.store.transaction());let o=this.findINodeSync(r,i),a=r.getSync(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}async unlink(i){return this.remove(i,!1)}unlinkSync(i){this.removeSync(i,!1)}async rmdir(i){if((await this.readdir(i)).length)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0)}rmdirSync(i){if(this.readdirSync(i).length)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0)}async mkdir(i,n){await this.commitNew(i,16384,n,Le("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Le("{}"))}async readdir(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);return Object.keys(await this.getDirListing(n,r,i))}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}readdirSync(i){var o=[];try{let n=S(o,this.store.transaction());let r=this.findINodeSync(n,i);return Object.keys(this.getDirListingSync(n,r,i))}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async sync(i,n,r){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,_(i),D(i)),c=await this.getINode(o,a,i),l=c.update(r);await o.set(c.ino,n);l&&await o.set(a,c.data);await o.commit()}catch(d){var h=d,b=!0}finally{var p=E(f,h,b);p&&await p}}syncSync(i,n,r){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,_(i),D(i)),c=this.getINodeSync(o,a,i),l=c.update(r);o.setSync(c.ino,n);l&&o.setSync(a,c.data);o.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=S(d,this.store.transaction(),!0);let o=_(n),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o);let l=await this._findINode(r,_(i),D(i));let f=await this.getINode(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{var w=E(d,b,p);w&&await w}}linkSync(i,n){var d=[];try{let r=S(d,this.store.transaction());let o=_(n),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o);let l=this._findINodeSync(r,_(i),D(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{E(d,b,p)}}async checkRoot(){var r=[];try{let i=S(r,this.store.transaction(),!0);if(await i.get(Ye))return;let n=new Ge;n.mode=16895;await i.set(n.ino,Le("{}"));await i.set(Ye,n.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=S(r,this.store.transaction());if(i.getSync(Ye))return;let n=new Ge;n.mode=16895;i.setSync(n.ino,Le("{}"));i.setSync(Ye,n.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?await this.getINode(i,Ye,n):await this.findINode(i,n,o),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?this.getINodeSync(i,Ye,n):this.findINodeSync(i,n,o),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,_(n),D(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,_(n),D(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return Un(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return Un(o)}async addNew(i,n,r){for(let o=0;o<bc;o++){let a=Qi();if(!await i.get(a))return await i.set(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<bc;o++){let a=Qi();if(!i.getSync(a))return i.setSync(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o){var b=[];try{let a=S(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=D(i),d=await this.getDirListing(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw await a.abort(),u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=await this.addNew(a,o,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=o.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,xe(d));await a.commit();return h}catch(p){var w=p,g=!0}finally{var A=E(b,w,g);A&&await A}}commitNewSync(i,n,r,o=new Uint8Array){var b=[];try{let a=S(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=D(i),d=this.getDirListingSync(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=this.addNewSync(a,o,i);h.size=o.length;h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;d[f]=this.addNewSync(a,h.data,i);a.setSync(l.ino,xe(d));a.commitSync();return h}catch(p){var w=p,g=!0}finally{E(b,w,g)}}async remove(i,n){var h=[];try{let r=S(h,this.store.transaction(),!0);let o=_(i),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o),l=D(i);if(!c[l])throw u.With("ENOENT",i,"remove");let f=c[l];let d=await this.getINode(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");await r.set(a.ino,xe(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var p=b,w=!0}finally{var g=E(h,p,w);g&&await g}}removeSync(i,n){var h=[];try{let r=S(h,this.store.transaction());let o=_(i),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o),l=D(i),f=c[l];if(!f)throw u.With("ENOENT",i,"remove");let d=this.getINodeSync(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");r.setSync(a.ino,xe(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var p=b,w=!0}finally{E(h,p,w)}}};var an=class{constructor(t){this.store=t;this.done=!1}static{s(this,"Transaction")}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}},cn=class extends an{static{s(this,"SyncTransaction")}async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}},Io=class extends an{static{s(this,"AsyncTransaction")}getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};var Ao=class{constructor(){this.cache=new Map;this.queue=new Set}static{s(this,"SimpleAsyncStore")}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new bi(this)}},bi=class extends cn{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}static{s(this,"SimpleTransaction")}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}this.done=!0}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};var Gn=class extends Map{constructor(i="tmp"){super();this.name=i}static{s(this,"InMemoryStore")}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}},gc={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:e}){let t=new sn(new Gn(e));return t.checkRootSync(),t},"create")},ln=gc;var qt=new Map,Ip=100;function fn(e){let t=Ip++;return qt.set(t,e),t}s(fn,"file2fd");function j(e){if(!qt.has(e))throw new u(9);return qt.get(e)}s(j,"fd2file");var Pe=new Map;$t("/",ln.create({name:"root"}));function $t(e,t){if(e[0]!=="/"&&(e="/"+e),e=_t(e),Pe.has(e))throw new u(22,"Mount point "+e+" is already in use.");Pe.set(e,t)}s($t,"mount");function gi(e){if(e[0]!=="/"&&(e=`/${e}`),e=_t(e),!Pe.has(e))throw new u(22,"Mount point "+e+" is already unmounted.");Pe.delete(e)}s(gi,"umount");function R(e){e=x(e);let t=[...Pe].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:n,path:e,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function wc(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(wc,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=wc(e.stack,t)),e.message=wc(e.message,t),e}s(Y,"fixError");function un(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))$t(t,i)}s(un,"mountObject");function Yn(e,t){let i=e.metadata(),n=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(n),ffree:(t?BigInt:Number)(i.freeNodes||Oe),files:(t?BigInt:Number)(i.totalNodes||Oe),bavail:(t?BigInt:Number)(i.freeSpace/n),bfree:(t?BigInt:Number)(i.freeSpace/n),blocks:(t?BigInt:Number)(i.totalSpace/n)}}s(Yn,"_statfs");var Xn=class extends Vn.default{constructor(i){super();this.path=i}static{s(this,"Watcher")}off(i,n,r,o){return super.off(i,n,r,o)}removeListener(i,n,r,o){return super.removeListener(i,n,r,o)}setMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw u.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw u.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw u.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}},wi=class extends Xn{constructor(i,n){super(i);this.options=n;Ap(i.toString(),this)}static{s(this,"FSWatcher")}close(){super.emit("close"),Op(this.path.toString(),this)}[Symbol.dispose](){this.close()}},Jn=class extends Xn{constructor(i,n){super(i);this.options=n;this.start()}static{s(this,"StatWatcher")}onInterval(){try{let i=Te(this.path);vo(this.previous,i)||(this.emit("change",i,this.previous),this.previous=i)}catch(i){this.emit("error",i)}}start(){let i=this.options.interval||5e3;try{this.previous=Te(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),i),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}},De=new Map;function Ap(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(Ap,"addWatcher");function Op(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(Op,"removeWatcher");function W(e,t){let i=x(t);if(De.has(i))for(let r of De.get(i))r.emit("change",e,D(t));let n=_(i);for(;n!==i&&n!=="/";){if(De.has(n))for(let r of De.get(n))r.emit("change",e,D(t));i=n,n=_(n)}}s(W,"emitChange");function Sc(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!Te(_(e)).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),W("rename",e.toString());return}pn(t,Zn(e)),Qn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Sc,"renameSync");function Je(e){e=x(e);try{let{fs:t,path:i}=R(Xe(e));return t.existsSync(i)}catch(t){if(t.errno==2)return!1;throw t}}s(Je,"existsSync");function Te(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Te,"statSync");function Oo(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=i.statSync(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Oo,"lstatSync");function Ec(e,t=0){var n=[];try{let i=S(n,zt(e,"r+"));t||=0;if(t<0)throw new u(22);i.truncateSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}s(Ec,"truncateSync");function Qn(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");t.unlinkSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Qn,"unlinkSync");function zt(e,t,i,n=!0){e=x(e);let r=ke(i,420),o=M(t);e=n&&Je(e)?Xe(e):e;let{fs:a,path:c}=R(e);if(!a.existsSync(c)){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return a.createFileSync(c,o,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(nn(o)))throw u.With("EACCES",e,"_open");if(on(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return rn(o)&&(f.truncateSync(0),f.syncSync()),f}s(zt,"_openSync");function dn(e,t,i=0){return fn(zt(e,t,i,!0))}s(dn,"openSync");function hn(e,t,i){return fn(zt(e,t,i,!1))}s(hn,"lopenSync");function _c(e,t,i){var a=[];try{let n=S(a,zt(e,t,420,i));let r=n.statSync();let o=new Uint8Array(r.size);n.readSync(o,0,r.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(_c,"_readFileSync");function Zn(e,t={}){let i=ve(t,null,"r",420),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=Ft.Buffer.from(_c(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Zn,"readFileSync");function pn(e,t,i={}){var c=[];try{let n=ve(i,"utf8","w+",420);let r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new u(22,"Data not specified");let a=S(c,zt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength,0);W("change",e.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(pn,"writeFileSync");function xc(e,t,i={}){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,zt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(xc,"appendFileSync");function kc(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(kc,"fstatSync");function It(e){j(e).closeSync(),qt.delete(e)}s(It,"closeSync");function vc(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(vc,"ftruncateSync");function Fc(e){j(e).syncSync()}s(Fc,"fsyncSync");function Ic(e){j(e).datasyncSync()}s(Ic,"fdatasyncSync");function Ac(e,t,i,n,r){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=Ft.Buffer.from(t,h),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,l=typeof r=="number"?r:null;let f=j(e);l??=f.position;let d=f.writeSync(o,a,c,l);return W("change",f.path),d}s(Ac,"writeSync");function Oc(e,t,i,n,r){let o=j(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(t,a,n,r)}s(Oc,"readSync");function er(e,t,i){j(e).chownSync(t,i)}s(er,"fchownSync");function tr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(tr,"fchmodSync");function ir(e,t,i){j(e).utimesSync(Mt(t),Mt(i))}s(ir,"futimesSync");function Po(e){e=x(e);let{fs:t,path:i}=R(Je(e)?Xe(e):e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");t.rmdirSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Po,"rmdirSync");function nr(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=Je(e)?Xe(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!n.statSync(_(r)).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");return n.mkdirSync(r,i)}let a=[];for(let c=r,l=e;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(nr,"mkdirSync");function Si(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e),r;if(!Te(e).hasAccess(4))throw u.With("EACCES",e,"readdir");try{r=i.readdirSync(n)}catch(o){throw Y(o,{[n]:e})}for(let o of Pe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||r.push(a)}return r.map(o=>typeof t=="object"&&t?.withFileTypes?new At(o,Te(z(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?Ft.Buffer.from(o):o)}s(Si,"readdirSync");function Pc(e,t){if(e=x(e),!Te(_(e)).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!Te(_(t)).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!i.statSync(n).hasAccess(2))throw u.With("EACCES",n,"link");return i.linkSync(n,t)}catch(o){throw Y(o,{[n]:e,[r.path]:t})}}s(Pc,"linkSync");function Tc(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Je(t))throw u.With("EEXIST",t.toString(),"symlink");pn(t,e.toString()),zt(t,"r+",420,!1)._setTypeSync(40960)}s(Tc,"symlinkSync");function To(e,t){let i=Ft.Buffer.from(_c(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(To,"readlinkSync");function Rc(e,t,i){let n=dn(e,"r+");er(n,t,i),It(n)}s(Rc,"chownSync");function Nc(e,t,i){let n=hn(e,"r+");er(n,t,i),It(n)}s(Nc,"lchownSync");function Lc(e,t){let i=dn(e,"r+");tr(i,t),It(i)}s(Lc,"chmodSync");function Cc(e,t){let i=hn(e,"r+");tr(i,t),It(i)}s(Cc,"lchmodSync");function Ro(e,t,i){let n=dn(e,"r+");ir(n,t,i),It(n)}s(Ro,"utimesSync");function Bc(e,t,i){let n=hn(e,"r+");ir(n,t,i),It(n)}s(Bc,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=Mn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+To(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function Dc(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(Dc,"accessSync");function No(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))No(z(e,n),t);Po(e);return;case 32768:case 40960:Qn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(No,"rmSync");function Mc(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return nr(r),i=="buffer"?Ft.Buffer.from(r):r}s(Mc,"mkdtempSync");function Lo(e,t,i){if(e=x(e),t=x(t),i&&i&1&&Je(t))throw new u(17,"Destination file already exists.",t,"copyFile");pn(t,Zn(e)),W("rename",t.toString())}s(Lo,"copyFileSync");function Wc(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Wc,"readvSync");function Uc(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(Uc,"writevSync");function jc(e,t){return e=x(e),new Ot(e)}s(jc,"opendirSync");function Co(e,t,i){e=x(e),t=x(t);let n=Oo(e);if(i?.errorOnExist&&Je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");nr(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||Co(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:Lo(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&Ro(t,n.atime,n.mtime)}s(Co,"cpSync");function qc(e,t){e=x(e);let{fs:i}=R(e);return Yn(i,t?.bigint)}s(qc,"statfsSync");var At=class{constructor(t,i){this.path=t;this.stats=i}static{s(this,"Dirent")}get name(){return D(this.path)}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}},Ot=class{constructor(t){this.path=t;this.closed=!1}static{s(this,"Dir")}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Vt(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this.checkClosed(),this._entries??=Si(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};var Mr=qi(Qu(),1);var Lt=class extends Mr.Readable{static{s(this,"ReadStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}},Ct=class extends Mr.Writable{static{s(this,"WriteStream")}close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};var ce=class{static{s(this,"FileHandle")}constructor(t){let i=typeof t!="number";this.fd=i?fn(t):t,this.file=i?t:j(t)}async chown(t,i){await this.file.chown(t,i),W("change",this.file.path)}async chmod(t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),W("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||=0,t<0)throw new u(22);await this.file.truncate(t),W("change",this.file.path)}async utimes(t,i){await this.file.utimes(Mt(t),Mt(i)),W("change",this.file.path)}async appendFile(t,i={}){let n=ve(i,"utf8","a",420),r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?ri.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length),W("change",this.file.path)}read(t,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(t,i,n,r)}async readFile(t){let i=ve(t,null,"r",292),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=ri.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async r=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){r.close();return}if(r.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){r.error(o)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:t.type})}readLines(t){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return t?.bigint?new be(i):i}async write(t,i,n,r){let o,a,c;if(typeof t=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=ri.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(o,a,c,r);return W("change",this.file.path),{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let n=ve(i,"utf8","w",420),r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?ri.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length,0),W("change",this.file.path)}async close(){await this.file.close(),qt.delete(this.fd)}async writev(t,i){let n=0;for(let r of t)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,i){let n=0;for(let r of t)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){let i=new Lt({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:c}=await this.write(r,null,o);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ct(i);return n.path=this.file.path,n}};async function Xs(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!(await st(_(e))).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),W("rename",e.toString());return}await Di(t,await On(e)),await An(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Xs,"rename");async function je(e){try{let{fs:t,path:i}=R(await Ue(e));return await t.exists(i)}catch(t){if(t instanceof u&&t.code=="ENOENT")return!1;throw t}}s(je,"exists");async function st(e,t){e=x(e);let{fs:i,path:n}=R(await je(e)?await Ue(e):e);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(st,"stat");async function Wr(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=await i.stat(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Wr,"lstat");async function Js(e,t=0){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.truncate(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Js,"truncate");async function An(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await t.unlink(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(An,"unlink");async function Bi(e,t,i=420,n){e=x(e);let r=ke(i,420),o=M(t);e=n&&await je(e)?await Ue(e):e;let{fs:a,path:c}=R(e),l=await a.stat(c).catch(()=>null);if(!l){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return new ce(await a.createFile(c,o,r))}if(!l.hasAccess(nn(o)))throw u.With("EACCES",e,"_open");if(on(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return rn(o)&&(await f.truncate(0),await f.sync()),f}s(Bi,"_open");async function Se(e,t="r",i=420){return await Bi(e,t,i,!0)}s(Se,"open");async function On(e,t){var r=[];try{let i=ve(t,null,"r",420);let n=S(r,typeof e=="object"&&"fd"in e?e:await Se(e,i.flag,i.mode),!0);return await n.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(On,"readFile");async function Di(e,t,i){var a=[];try{let n=ve(i,"utf8","w+",420);let r=S(a,e instanceof ce?e:await Se(e.toString(),n.flag,n.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}s(Di,"writeFile");async function Qs(e,t,i){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?ri.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await Se(e,n.flag,n.mode),!0);await a.appendFile(o,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}s(Qs,"appendFile");async function Ur(e){e=x(e),e=await je(e)?await Ue(e):e;let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await t.rmdir(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Ur,"rmdir");async function Pn(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=await je(e)?await Ue(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),W("rename",e.toString());return}let a=[];for(let c=r,l=e;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!(await n.stat(_(c))).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");await n.mkdir(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(Pn,"mkdir");async function Vt(e,t){if(e=x(e),!(await st(e)).hasAccess(4))throw u.With("EACCES",e,"readdir");e=await je(e)?await Ue(e):e;let{fs:i,path:n}=R(e),r;try{r=await i.readdir(n)}catch(a){throw Y(a,{[n]:e})}for(let a of Pe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let o=[];for(let a of r)o.push(typeof t=="object"&&t?.withFileTypes?new At(a,await st(z(e,a))):a);return o}s(Vt,"readdir");async function Zs(e,t){if(e=x(e),!(await st(_(e))).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!(await st(_(t))).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(o){throw Y(o,{[r.path]:t,[n]:e})}}s(Zs,"link");async function ea(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await je(t))throw u.With("EEXIST",t.toString(),"symlink");await Di(t,e.toString()),await(await Bi(t,"r+",420,!1)).file._setType(40960)}s(ea,"symlink");async function jr(e,t){var o=[];try{let i=S(o,await Bi(x(e),"r",420,!1),!0);let n=await i.readFile();let r=typeof t=="object"?t?.encoding:t;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s(jr,"readlink");async function ta(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(ta,"chown");async function ia(e,t,i){var r=[];try{let n=S(r,await Bi(e,"r+",420,!1),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(ia,"lchown");async function na(e,t){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(na,"chmod");async function ra(e,t){var n=[];try{let i=S(n,await Bi(e,"r+",420,!1),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(ra,"lchmod");async function qr(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(qr,"utimes");async function oa(e,t,i){var r=[];try{let n=S(r,await Bi(e,"r+",420,!1),!0);await n.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(oa,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=Mn(e),r=z(n=="/"?"/":await Ue(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return(await o.stat(a)).isSymbolicLink()?Ue(c+await jr(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function eS(e,t={}){return{[Symbol.asyncIterator](){let i=new wi(e.toString(),typeof t!="string"?t:{encoding:t});function n(r){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:r})}),o.promise}}return s(n,"withDone"),{next:n(!1),return:n(!0),throw:n(!0)}}}}s(eS,"watch");async function sa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(sa,"access");async function $r(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Vt(e))await $r(z(e,n),t);await Ur(e);return;case 32768:case 40960:await An(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s($r,"rm");async function aa(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Pn(r),i=="buffer"?ri.Buffer.from(r):r}s(aa,"mkdtemp");async function zr(e,t,i){if(e=x(e),t=x(t),i&&i&1&&await je(t))throw new u(17,"Destination file already exists.",t,"copyFile");await Di(t,await On(e)),W("rename",t.toString())}s(zr,"copyFile");async function ca(e,t){return e=x(e),new Ot(e)}s(ca,"opendir");async function Vr(e,t,i){e=x(e),t=x(t);let n=await Wr(e);if(i?.errorOnExist&&await je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");await Pn(t,{recursive:!0});for(let r of await Vt(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Vr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await zr(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await qr(t,n.atime,n.mtime)}s(Vr,"cp");async function la(e,t){e=x(e);let{fs:i}=R(e);return Yn(i,t?.bigint)}s(la,"statfs");var I=s(()=>{},"nop");function Zu(e,t,i=I){Xs(e,t).then(()=>i()).catch(i)}s(Zu,"rename");function ed(e,t=I){je(e).then(t).catch(()=>t(!1))}s(ed,"exists");function td(e,t,i=I){i=typeof t=="function"?t:i,st(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(td,"stat");function id(e,t,i=I){i=typeof t=="function"?t:i,Wr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(id,"lstat");function nd(e,t=0,i=I){i=typeof t=="function"?t:i,Js(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(nd,"truncate");function rd(e,t=I){An(e).then(()=>t()).catch(t)}s(rd,"unlink");function od(e,t,i,n=I){let r=ke(i,420);n=typeof i=="function"?i:n,Se(e,t,r).then(o=>n(void 0,o.fd)).catch(n)}s(od,"open");function sd(e,t,i=I){i=typeof t=="function"?t:i,On(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(sd,"readFile");function ad(e,t,i,n=I){n=typeof i=="function"?i:n,Di(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(ad,"writeFile");function cd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Qs(e,t,r).then(()=>n()).catch(n)}s(cd,"appendFile");function ld(e,t,i=I){i=typeof t=="function"?t:i,j(e).stat().then(n=>i(void 0,typeof t=="object"&&t?.bigint?new be(n):n)).catch(i)}s(ld,"fstat");function fd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(fd,"close");function ud(e,t,i=I){let n=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let r=j(e);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}s(ud,"ftruncate");function dd(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(dd,"fsync");function hd(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(hd,"fdatasync");function pd(e,t,i,n,r,o=I){let a,c,l,f,d,h=new ce(e);if(typeof t=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=fa.Buffer.from(t),c=0,l=a.length;let b=o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a.toString(d))).catch(b)}else{a=fa.Buffer.from(t.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a)).catch(b)}}s(pd,"write");function yd(e,t,i,n,r,o=I){new ce(e).read(t,i,n,r).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(yd,"read");function md(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(md,"fchown");function bd(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(bd,"fchmod");function gd(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(gd,"futimes");function wd(e,t=I){Ur(e).then(()=>t()).catch(t)}s(wd,"rmdir");function Sd(e,t,i=I){Pn(e,t).then(()=>i()).catch(i)}s(Sd,"mkdir");function Ed(e,t,i=I){i=typeof t=="function"?t:i,Vt(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(Ed,"readdir");function _d(e,t,i=I){Zs(e,t).then(()=>i()).catch(i)}s(_d,"link");function xd(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,ea(e,t,r).then(()=>n()).catch(n)}s(xd,"symlink");function kd(e,t,i=I){i=typeof t=="function"?t:i,jr(e).then(n=>i(void 0,n)).catch(i)}s(kd,"readlink");function vd(e,t,i,n=I){ta(e,t,i).then(()=>n()).catch(n)}s(vd,"chown");function Fd(e,t,i,n=I){ia(e,t,i).then(()=>n()).catch(n)}s(Fd,"lchown");function Id(e,t,i=I){na(e,t).then(()=>i()).catch(i)}s(Id,"chmod");function Ad(e,t,i=I){ra(e,t).then(()=>i()).catch(i)}s(Ad,"lchmod");function Od(e,t,i,n=I){qr(e,t,i).then(()=>n()).catch(n)}s(Od,"utimes");function Pd(e,t,i,n=I){oa(e,t,i).then(()=>n()).catch(n)}s(Pd,"lutimes");function Td(e,t,i=I){i=typeof t=="function"?t:i,Ue(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Td,"realpath");function Rd(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,sa(e,n).then(()=>i()).catch(i)}s(Rd,"access");var Mi=new Map;function Nd(e,t,i){let n=x(e.toString()),r=typeof t!="function"?t:{};if(typeof t=="function"&&(i=t),!i)throw new u(22,"No listener specified",e.toString(),"watchFile");if(Mi.has(n)){let a=Mi.get(n);a&&a.listeners.add(i);return}let o=new Jn(n,r);o.on("change",(a,c)=>{let l=Mi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Mi.set(n,{watcher:o,listeners:new Set})}s(Nd,"watchFile");function Ld(e,t=I){let i=x(e.toString()),n=Mi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Mi.delete(i)))}s(Ld,"unwatchFile");function Cd(e,t,i){let n=new wi(x(e),typeof t=="object"?t:{});return i=typeof t=="function"?t:i,n.on("change",i||I),n}s(Cd,"watch");function Bd(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Lt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await Se(e,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(I)},"destroy")});return r.path=e.toString(),r}s(Bd,"createReadStream");function Dd(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Ct({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{n||=await Se(e,"w",i?.mode||438),await n.write(o,0,a),c(void 0)}catch(l){await n?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=e.toString(),r}s(Dd,"createWriteStream");function Md(e,t,i=I){i=typeof t=="function"?t:i,$r(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Md,"rm");function Wd(e,t,i=I){i=typeof t=="function"?t:i,aa(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Wd,"mkdtemp");function Ud(e,t,i,n=I){n=typeof i=="function"?i:n,zr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Ud,"copyFile");function jd(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(jd,"readv");function qd(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(qd,"writev");function $d(e,t,i=I){i=typeof t=="function"?t:i,ca(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s($d,"opendir");function zd(e,t,i,n=I){n=typeof i=="function"?i:n,Vr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(zd,"cp");function Vd(e,t,i=I){i=typeof t=="function"?t:i,la(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Vd,"statfs");async function Hd(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Hd,"openAsBlob");function Kd(e){return zi(e)||$i(e)||e instanceof pe}s(Kd,"isMountConfig");async function Wi(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Kd(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;$i(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Kd(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Wi(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await ro(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Wi,"resolveMountConfig");async function tS(e){if(!zi(e))throw new TypeError("Invalid single mount point configuration");let t=await Wi(e);gi("/"),$t("/",t)}s(tS,"configureSingle");async function iS(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Object.assign(ye,{uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[n,r]of Object.entries(e.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");zi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Wi(r)}un(e.mounts)}}s(iS,"configure");function ua(e){class t extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}static{s(this,"AsyncFS")}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(r=>{let o=s(()=>this._queueRunning?setTimeout(o):r(),"check");o()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(r){throw this._isInitialized=!1,r}}}checkSync(r,o){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",r,o);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",r,o)}renameSync(r,o){this.checkSync(r,"rename"),this._sync.renameSync(r,o),this.queue("rename",r,o)}statSync(r){return this.checkSync(r,"stat"),this._sync.statSync(r)}createFileSync(r,o,a){return this.checkSync(r,"createFile"),this._sync.createFileSync(r,o,a),this.queue("createFile",r,o,a),this.openFileSync(r,o)}openFileSync(r,o){this.checkSync(r,"openFile");let a=this._sync.openFileSync(r,o),c=a.statSync(),l=new Uint8Array(c.size);return a.readSync(l),new we(this,r,o,c,l)}unlinkSync(r){this.checkSync(r,"unlinkSync"),this._sync.unlinkSync(r),this.queue("unlink",r)}rmdirSync(r){this.checkSync(r,"rmdir"),this._sync.rmdirSync(r),this.queue("rmdir",r)}mkdirSync(r,o){this.checkSync(r,"mkdir"),this._sync.mkdirSync(r,o),this.queue("mkdir",r,o)}readdirSync(r){return this.checkSync(r,"readdir"),this._sync.readdirSync(r)}linkSync(r,o){this.checkSync(r,"link"),this._sync.linkSync(r,o),this.queue("link",r,o)}syncSync(r,o,a){this.checkSync(r,"sync"),this._sync.syncSync(r,o,a),this.queue("sync",r,o,a)}existsSync(r){return this.checkSync(r,"exists"),this._sync.existsSync(r)}async crossCopy(r){this.checkSync(r,"crossCopy");let o=await this.stat(r);if(!o.isDirectory()){var c=[];try{let b=S(c,await this.openFile(r,M("r")),!0);let p=S(c,this._sync.createFileSync(r,M("w"),o.mode));let w=new Uint8Array(o.size);await b.read(w);p.writeSync(w,0,o.size);return}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}if(r!=="/"){let b=await this.stat(r);this._sync.mkdirSync(r,b.mode)}let a=await this.readdir(r);for(let b of a)await this.crossCopy(z(r,b))}async _next(){if(!this._queueRunning)return;let[r,...o]=this._queue.shift();await this[r](...o),await this._next()}queue(...r){this._queue.push(r),this._next()}}return t}s(ua,"Async");function nS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(nS,"isFileData");function da(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(da,"isMessage");var Ui=new Map;function ha(e,{port:t,timeout:i=1e3,fs:n}={}){let r=`
|
|
3
|
-
`+new Error().stack.slice(6);if(!t)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);Ui.set(c,{resolve:o,reject:a,fs:n}),t.postMessage({...e,_zenfs:!0,id:c,stack:r});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=r,a(f),typeof l=="object"&&l.unref()},i)})}s(ha,"request");function Gd(e){if(!da(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!Ui.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=Ui.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),Ui.delete(t);return}if(nS(i)){let{fd:l,path:f,position:d}=i,h=new Nn(c,l,f,d);o(h),Ui.delete(t);return}o(i),Ui.delete(t)}s(Gd,"handleResponse");function Hr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Hr,"attach");function pa(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(pa,"detach");function Yd(e){let t=[],i=t.push.bind(t);return Hr(e,i),function(n){pa(e,i);for(let r of t){let o="data"in r?r.data:r;Ln(e,n,o)}}}s(Yd,"catchMessages");var Nn=class extends jt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}static{s(this,"PortFile")}rpc(i,...n){return ha({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}_throwNoSync(i){throw new u(95,"Synchronous operations not supported on PortFile",this.path,i)}async stat(){return new G(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){this._throwNoSync("write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){this._throwNoSync("read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}},Gr=class extends ua(pe){constructor(i){super();this.options=i;this._sync=ln.create({name:"port-tmpfs"});this.port=i.port,Hr(this.port,Gd)}static{s(this,"PortFS")}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return ha({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n){return this.rpc("rename",i,n)}async stat(i){return new G(await this.rpc("stat",i))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n){return this.rpc("openFile",i,n)}createFile(i,n,r){return this.rpc("createFile",i,n,r)}unlink(i){return this.rpc("unlink",i)}rmdir(i){return this.rpc("rmdir",i)}mkdir(i,n){return this.rpc("mkdir",i,n)}readdir(i){return this.rpc("readdir",i)}exists(i){return this.rpc("exists",i)}link(i,n){return this.rpc("link",i,n)}},Xd=0,Kr=new Map;async function Ln(e,t,i){if(!da(i))return;let{method:n,args:r,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[n](...r),l instanceof jt&&(Kr.set(++Xd,l),l={fd:Xd,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Kr.has(d))throw new u(9);l=await Kr.get(d)[n](...r),n=="close"&&Kr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:n,stack:c,value:l})}s(Ln,"handleRequest");function Jd(e,t){Hr(e,i=>Ln(e,t,i))}s(Jd,"attachFS");function oS(e,t){pa(e,i=>Ln(e,t,i))}s(oS,"detachFS");var Qd={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(e){if(typeof e?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(e){return new Gr(e)},"create")},sS=Qd;async function aS(e,t,i=0){let n=Yd(e),r=await Wi(t,i);return Jd(e,r),n(r),r}s(aS,"resolveRemoteMount");function ya(e){class t extends e{static{s(this,"ReadonlyFS")}metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r){throw new u(30)}renameSync(n,r){throw new u(30)}async createFile(n,r,o){throw new u(30)}createFileSync(n,r,o){throw new u(30)}async unlink(n){throw new u(30)}unlinkSync(n){throw new u(30)}async rmdir(n){throw new u(30)}rmdirSync(n){throw new u(30)}async mkdir(n,r){throw new u(30)}mkdirSync(n,r){throw new u(30)}async link(n,r){throw new u(30)}linkSync(n,r){throw new u(30)}async sync(n,r,o){throw new u(30)}syncSync(n,r,o){throw new u(30)}}return t}s(ya,"Readonly");var ma=1,Yr=class e extends Map{static{s(this,"Index")}files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:ma,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let n of this.keys())_(n)==t&&i.push(D(n));return i}fromJSON(t){if(t.version!=ma)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(t.entries)){let r=new G(n);r.isDirectory()&&(r.fileData=Le(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Xa(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new e;return n.fromJSON(i),n}},Cn=class extends ya(pe){constructor(i){super();this.indexData=i;this.index=new Yr;this._isInitialized=!1}static{s(this,"IndexFS")}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=await this.getData(i,n)}reloadFilesSync(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=this.getDataSync(i,n)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:this.getDataSync(i,r))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let n=this.index.get(i);if(!n)throw u.With("ENOENT",i,"readdir");if(!n.isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=JSON.parse(ai(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return r}};async function Zd(e,t){let i=await fetch(e).catch(n=>{throw new u(5,n.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let n=await i.arrayBuffer().catch(r=>{throw new u(5,r.message)});return new Uint8Array(n)}case"json":return i.json().catch(n=>{throw new u(5,n.message)});default:throw new u(22,"Invalid download type: "+t)}}s(Zd,"fetchFile");var Xr=class e extends Cn{static{s(this,"FetchFS")}async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:Zd(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:e.name,readonly:!0}}preload(t,i){let n=this.index.get(t);if(!n)throw u.With("ENOENT",t,"preload");if(!n.isFile())throw u.With("EISDIR",t,"preload");n.size=i.length,n.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let n=await Zd(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=n,n}getDataSync(t,i){if(i.fileData)return i.fileData;throw new u(61,"",t,"getData")}},cS={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(e){return new Xr(e)},"create")},lS=cS;var Jr=class{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}static{s(this,"MutexLock")}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}},Qr=class{static{s(this,"__MutexedFS")}async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new Jr(this.currentLock);return this.currentLock=t,t}async lock(t,i){let n=this.currentLock,r=this.addLock(),o=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",t,i);throw a.stack+=o?.slice(5),a}},5e3),await n?.done(),r}lockSync(t,i){if(this.currentLock)throw u.With("EBUSY",t,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,i){var r=[];try{let n=S(r,await this.lock(t,"rename"));await this._fs.rename(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}renameSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"rename"));return this._fs.renameSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async stat(t){var n=[];try{let i=S(n,await this.lock(t,"stat"));return await this._fs.stat(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}statSync(t){var n=[];try{let i=S(n,this.lockSync(t,"stat"));return this._fs.statSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async openFile(t,i){var o=[];try{let n=S(o,await this.lock(t,"openFile"));let r=await this._fs.openFile(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}openFileSync(t,i){var o=[];try{let n=S(o,this.lockSync(t,"openFile"));let r=this._fs.openFileSync(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async createFile(t,i,n){var a=[];try{let r=S(a,await this.lock(t,"createFile"));let o=await this._fs.createFile(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(t,i,n){var a=[];try{let r=S(a,this.lockSync(t,"createFile"));let o=this._fs.createFileSync(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(t){var n=[];try{let i=S(n,await this.lock(t,"unlink"));await this._fs.unlink(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}unlinkSync(t){var n=[];try{let i=S(n,this.lockSync(t,"unlink"));return this._fs.unlinkSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async rmdir(t){var n=[];try{let i=S(n,await this.lock(t,"rmdir"));await this._fs.rmdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}rmdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"rmdir"));return this._fs.rmdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async mkdir(t,i){var r=[];try{let n=S(r,await this.lock(t,"mkdir"));await this._fs.mkdir(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}mkdirSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"mkdir"));return this._fs.mkdirSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async readdir(t){var n=[];try{let i=S(n,await this.lock(t,"readdir"));return await this._fs.readdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}readdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"readdir"));return this._fs.readdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async exists(t){var n=[];try{let i=S(n,await this.lock(t,"exists"));return await this._fs.exists(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}existsSync(t){var n=[];try{let i=S(n,this.lockSync(t,"exists"));return this._fs.existsSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async link(t,i){var r=[];try{let n=S(r,await this.lock(t,"link"));await this._fs.link(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}linkSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"link"));return this._fs.linkSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async sync(t,i,n){var o=[];try{let r=S(o,await this.lock(t,"sync"));await this._fs.sync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}syncSync(t,i,n){var o=[];try{let r=S(o,this.lockSync(t,"sync"));return this._fs.syncSync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}};function ba(e){class t extends Qr{static{s(this,"MutexedFS")}constructor(...n){super(),this._fs=new e(...n)}}return t}s(ba,"Mutexed");var ga="/.deleted",Zr=class extends pe{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=n,this.writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}static{s(this,"UnmutexedOverlayFS")}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Bn.name}}async sync(i,n,r){await this.createParentDirectories(i),await this.writable.exists(i)||await this.writable.createFile(i,"w",420),await this.writable.sync(i,n,r)}syncSync(i,n,r){this.createParentDirectoriesSync(i),this.writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(ga,M("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ai(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("")}async rename(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this.writable.rename(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this.writable.renameSync(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i){this.checkInitialized();try{return await this.writable.stat(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(await this.readable.stat(i));return r.mode|=146,r}}statSync(i){this.checkInitialized();try{return this.writable.statSync(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(this.readable.statSync(i));return r.mode|=146,r}}async openFile(i,n){if(await this.writable.exists(i))return this.writable.openFile(i,n);let r=await this.readable.openFile(i,M("r")),o=new G(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new we(this,i,n,o,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,M("r")),o=new G(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new we(this,i,n,o,a)}async createFile(i,n,r){return this.checkInitialized(),await this.writable.createFile(i,n,r),this.openFile(i,n)}createFileSync(i,n,r){return this.checkInitialized(),this.writable.createFileSync(i,n,r),this.openFileSync(i,n)}async link(i,n){this.checkInitialized(),await this.writable.link(i,n)}linkSync(i,n){this.checkInitialized(),this.writable.linkSync(i,n)}async unlink(i){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i))throw u.With("ENOENT",i,"unlink");await this.writable.exists(i)&&await this.writable.unlink(i),await this.exists(i)&&await this.deletePath(i)}unlinkSync(i){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i))throw u.With("ENOENT",i,"unlink");this.writable.existsSync(i)&&this.writable.unlinkSync(i),this.existsSync(i)&&this.deletePath(i)}async rmdir(i){if(this.checkInitialized(),!await this.exists(i))throw u.With("ENOENT",i,"rmdir");if(await this.writable.exists(i)&&await this.writable.rmdir(i),await this.exists(i)){if((await this.readdir(i)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i)}}rmdirSync(i){if(this.checkInitialized(),!this.existsSync(i))throw u.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i)&&this.writable.rmdirSync(i),this.existsSync(i)){if(this.readdirSync(i).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i)}}async mkdir(i,n){if(this.checkInitialized(),await this.exists(i))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i),await this.writable.mkdir(i,n)}mkdirSync(i,n){if(this.checkInitialized(),this.existsSync(i))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i),this.writable.mkdirSync(i,n)}async readdir(i){if(this.checkInitialized(),!(await this.stat(i)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r.push(...await this.writable.readdir(i))}catch{}try{r.push(...(await this.readable.readdir(i)).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}readdirSync(i){if(this.checkInitialized(),!this.statSync(i).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r=r.concat(this.writable.readdirSync(i))}catch{}try{r=r.concat(this.readable.readdirSync(i).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
4
|
-
`)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(
|
|
5
|
-
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==
|
|
1
|
+
"use strict";var ZenFS=(()=>{var zh=Object.create;var Mt=Object.defineProperty;var lc=Object.getOwnPropertyDescriptor;var Vh=Object.getOwnPropertyNames;var Hh=Object.getPrototypeOf,Kh=Object.prototype.hasOwnProperty;var sc=(e,t)=>(t=Symbol[e])?t:Symbol.for("Symbol."+e),Dt=e=>{throw TypeError(e)};var Gh=(e,t,i)=>t in e?Mt(e,t,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[t]=i;var s=(e,t)=>Mt(e,"name",{value:t,configurable:!0});var T=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Un=(e,t)=>{for(var i in t)Mt(e,i,{get:t[i],enumerable:!0})},fc=(e,t,i,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Vh(t))!Kh.call(e,r)&&r!==i&&Mt(e,r,{get:()=>t[r],enumerable:!(n=lc(t,r))||n.enumerable});return e};var $i=(e,t,i)=>(i=e!=null?zh(Hh(e)):{},fc(t||!e||!e.__esModule?Mt(i,"default",{value:e,enumerable:!0}):i,e)),Yh=e=>fc(Mt({},"__esModule",{value:!0}),e);var uc=["class","method","getter","setter","accessor","field","value","get","set"],qi=e=>e!==void 0&&typeof e!="function"?Dt("Function expected"):e,Xh=(e,t,i,n)=>({kind:uc[e],name:t,addInitializer:r=>i._?Dt("Already initialized"):n.push(qi(r||null))}),dc=(e,t,i)=>{for(var n=0,r=e[t>>1],o=r&&r.length;n<o;n++)t&1?r[n].call(i):i=(0,r[n])(i);return i},_e=(e,t,i,n,r,o)=>{var a,c,l,f,d,h=t&7,b=!!(t&8),p=!!(t&16),w=h>3?e.length+1:h?b?1:2:0,g=uc[h+5],A=h>3&&(e[w-1]=[]),k=e[w]||(e[w]=[]),v=h&&(!p&&!b&&(r=r.prototype),h<5&&(h>3||!p)&&lc(h<4?r:{get[i](){return ac(this,o)},set[i](F){return cc(this,o,F)}},i));h?p&&h<4&&s(o,(h>2?"set ":h>1?"get ":"")+i):s(r,i);for(var L=n.length-1;L>=0;L--)f=Xh(h,i,l={},k),h&&(f.static=b,f.private=p,d=f.access={has:p?F=>Jh(r,F):F=>i in F},h^3&&(d.get=p?F=>(h^1?ac:Qh)(F,r,h^4?o:v.get):F=>F[i]),h>2&&(d.set=p?(F,B)=>cc(F,r,B,h^4?o:v.set):(F,B)=>F[i]=B)),c=(0,n[L])(h?h<4?p?o:v[g]:h>4?void 0:{get:v.get,set:v.set}:r,f),l._=1,h^4||c===void 0?qi(c)&&(h>4?A.unshift(c):h?p?o=c:v[g]=c:r=c):typeof c!="object"||c===null?Dt("Object expected"):(qi(a=c.get)&&(v.get=a),qi(a=c.set)&&(v.set=a),qi(a=c.init)&&A.unshift(a));return v&&Mt(r,i,v),p?h^4?o:v:r},oo=(e,t,i)=>Gh(e,typeof t!="symbol"?t+"":t,i),so=(e,t,i)=>t.has(e)||Dt("Cannot "+i),Jh=(e,t)=>Object(t)!==t?Dt('Cannot use the "in" operator on this value'):e.has(t),ac=(e,t,i)=>(so(e,t,"read from private field"),i?i.call(e):t.get(e));var cc=(e,t,i,n)=>(so(e,t,"write to private field"),n?n.call(e,i):t.set(e,i),i),Qh=(e,t,i)=>(so(e,t,"access private method"),i);var S=(e,t,i)=>{if(t!=null){typeof t!="object"&&typeof t!="function"&&Dt("Object expected");var n;i&&(n=t[sc("asyncDispose")]),n===void 0&&(n=t[sc("dispose")]),typeof n!="function"&&Dt("Object not disposable"),e.push([i,n,t])}else i&&e.push([i]);return t},E=(e,t,i)=>{var n=typeof SuppressedError=="function"?SuppressedError:function(a,c,l,f){return f=Error(l),f.name="SuppressedError",f.error=a,f.suppressed=c,f},r=a=>t=i?new n(a,t,"An error was suppressed during disposal"):(i=!0,a),o=a=>{for(;a=e.pop();)try{var c=a[1]&&a[1].call(a[2]);if(a[0])return Promise.resolve(c).then(o,l=>(r(l),o()))}catch(l){r(l)}if(i)throw t};return o()};var bc=T(zn=>{"use strict";zn.byteLength=op;zn.toByteArray=ap;zn.fromByteArray=fp;var qe=[],Fe=[],rp=typeof Uint8Array<"u"?Uint8Array:Array,fo="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Ut=0,yc=fo.length;Ut<yc;++Ut)qe[Ut]=fo[Ut],Fe[fo.charCodeAt(Ut)]=Ut;var Ut,yc;Fe[45]=62;Fe[95]=63;function mc(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=e.indexOf("=");i===-1&&(i=t);var n=i===t?0:4-i%4;return[i,n]}s(mc,"getLens");function op(e){var t=mc(e),i=t[0],n=t[1];return(i+n)*3/4-n}s(op,"byteLength");function sp(e,t,i){return(t+i)*3/4-i}s(sp,"_byteLength");function ap(e){var t,i=mc(e),n=i[0],r=i[1],o=new rp(sp(e,n,r)),a=0,c=r>0?n-4:n,l;for(l=0;l<c;l+=4)t=Fe[e.charCodeAt(l)]<<18|Fe[e.charCodeAt(l+1)]<<12|Fe[e.charCodeAt(l+2)]<<6|Fe[e.charCodeAt(l+3)],o[a++]=t>>16&255,o[a++]=t>>8&255,o[a++]=t&255;return r===2&&(t=Fe[e.charCodeAt(l)]<<2|Fe[e.charCodeAt(l+1)]>>4,o[a++]=t&255),r===1&&(t=Fe[e.charCodeAt(l)]<<10|Fe[e.charCodeAt(l+1)]<<4|Fe[e.charCodeAt(l+2)]>>2,o[a++]=t>>8&255,o[a++]=t&255),o}s(ap,"toByteArray");function cp(e){return qe[e>>18&63]+qe[e>>12&63]+qe[e>>6&63]+qe[e&63]}s(cp,"tripletToBase64");function lp(e,t,i){for(var n,r=[],o=t;o<i;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(e[o+2]&255),r.push(cp(n));return r.join("")}s(lp,"encodeChunk");function fp(e){for(var t,i=e.length,n=i%3,r=[],o=16383,a=0,c=i-n;a<c;a+=o)r.push(lp(e,a,a+o>c?c:a+o));return n===1?(t=e[i-1],r.push(qe[t>>2]+qe[t<<4&63]+"==")):n===2&&(t=(e[i-2]<<8)+e[i-1],r.push(qe[t>>10]+qe[t>>4&63]+qe[t<<2&63]+"=")),r.join("")}s(fp,"fromByteArray")});var gc=T(uo=>{uo.read=function(e,t,i,n,r){var o,a,c=r*8-n-1,l=(1<<c)-1,f=l>>1,d=-7,h=i?r-1:0,b=i?-1:1,p=e[t+h];for(h+=b,o=p&(1<<-d)-1,p>>=-d,d+=c;d>0;o=o*256+e[t+h],h+=b,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+e[t+h],h+=b,d-=8);if(o===0)o=1-f;else{if(o===l)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-f}return(p?-1:1)*a*Math.pow(2,o-n)};uo.write=function(e,t,i,n,r,o){var a,c,l,f=o*8-r-1,d=(1<<f)-1,h=d>>1,b=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,w=n?1:-1,g=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(c=isNaN(t)?1:0,a=d):(a=Math.floor(Math.log(t)/Math.LN2),t*(l=Math.pow(2,-a))<1&&(a--,l*=2),a+h>=1?t+=b/l:t+=b*Math.pow(2,1-h),t*l>=2&&(a++,l/=2),a+h>=d?(c=0,a=d):a+h>=1?(c=(t*l-1)*Math.pow(2,r),a=a+h):(c=t*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;e[i+p]=c&255,p+=w,c/=256,r-=8);for(a=a<<r|c,f+=r;f>0;e[i+p]=a&255,p+=w,a/=256,f-=8);e[i+p-w]|=g*128}});var Ie=T(ui=>{"use strict";var ho=bc(),li=gc(),wc=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;ui.Buffer=m;ui.SlowBuffer=mp;ui.INSPECT_MAX_BYTES=50;var Vn=2147483647;ui.kMaxLength=Vn;m.TYPED_ARRAY_SUPPORT=up();!m.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 up(){try{let e=new Uint8Array(1),t={foo:s(function(){return 42},"foo")};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),e.foo()===42}catch{return!1}}s(up,"typedArraySupport");Object.defineProperty(m.prototype,"parent",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.buffer},"get")});Object.defineProperty(m.prototype,"offset",{enumerable:!0,get:s(function(){if(m.isBuffer(this))return this.byteOffset},"get")});function ct(e){if(e>Vn)throw new RangeError('The value "'+e+'" is invalid for option "size"');let t=new Uint8Array(e);return Object.setPrototypeOf(t,m.prototype),t}s(ct,"createBuffer");function m(e,t,i){if(typeof e=="number"){if(typeof t=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return bo(e)}return xc(e,t,i)}s(m,"Buffer");m.poolSize=8192;function xc(e,t,i){if(typeof e=="string")return hp(e,t);if(ArrayBuffer.isView(e))return pp(e);if(e==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($e(e,ArrayBuffer)||e&&$e(e.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&($e(e,SharedArrayBuffer)||e&&$e(e.buffer,SharedArrayBuffer)))return yo(e,t,i);if(typeof e=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=e.valueOf&&e.valueOf();if(n!=null&&n!==e)return m.from(n,t,i);let r=yp(e);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof e[Symbol.toPrimitive]=="function")return m.from(e[Symbol.toPrimitive]("string"),t,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}s(xc,"from");m.from=function(e,t,i){return xc(e,t,i)};Object.setPrototypeOf(m.prototype,Uint8Array.prototype);Object.setPrototypeOf(m,Uint8Array);function kc(e){if(typeof e!="number")throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}s(kc,"assertSize");function dp(e,t,i){return kc(e),e<=0?ct(e):t!==void 0?typeof i=="string"?ct(e).fill(t,i):ct(e).fill(t):ct(e)}s(dp,"alloc");m.alloc=function(e,t,i){return dp(e,t,i)};function bo(e){return kc(e),ct(e<0?0:go(e)|0)}s(bo,"allocUnsafe");m.allocUnsafe=function(e){return bo(e)};m.allocUnsafeSlow=function(e){return bo(e)};function hp(e,t){if((typeof t!="string"||t==="")&&(t="utf8"),!m.isEncoding(t))throw new TypeError("Unknown encoding: "+t);let i=vc(e,t)|0,n=ct(i),r=n.write(e,t);return r!==i&&(n=n.slice(0,r)),n}s(hp,"fromString");function po(e){let t=e.length<0?0:go(e.length)|0,i=ct(t);for(let n=0;n<t;n+=1)i[n]=e[n]&255;return i}s(po,"fromArrayLike");function pp(e){if($e(e,Uint8Array)){let t=new Uint8Array(e);return yo(t.buffer,t.byteOffset,t.byteLength)}return po(e)}s(pp,"fromArrayView");function yo(e,t,i){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return t===void 0&&i===void 0?n=new Uint8Array(e):i===void 0?n=new Uint8Array(e,t):n=new Uint8Array(e,t,i),Object.setPrototypeOf(n,m.prototype),n}s(yo,"fromArrayBuffer");function yp(e){if(m.isBuffer(e)){let t=go(e.length)|0,i=ct(t);return i.length===0||e.copy(i,0,0,t),i}if(e.length!==void 0)return typeof e.length!="number"||So(e.length)?ct(0):po(e);if(e.type==="Buffer"&&Array.isArray(e.data))return po(e.data)}s(yp,"fromObject");function go(e){if(e>=Vn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Vn.toString(16)+" bytes");return e|0}s(go,"checked");function mp(e){return+e!=e&&(e=0),m.alloc(+e)}s(mp,"SlowBuffer");m.isBuffer=s(function(t){return t!=null&&t._isBuffer===!0&&t!==m.prototype},"isBuffer");m.compare=s(function(t,i){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),$e(i,Uint8Array)&&(i=m.from(i,i.offset,i.byteLength)),!m.isBuffer(t)||!m.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===i)return 0;let n=t.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(t[o]!==i[o]){n=t[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");m.isEncoding=s(function(t){switch(String(t).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}},"isEncoding");m.concat=s(function(t,i){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(t.length===0)return m.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<t.length;++n)i+=t[n].length;let r=m.allocUnsafe(i),o=0;for(n=0;n<t.length;++n){let a=t[n];if($e(a,Uint8Array))o+a.length>r.length?(m.isBuffer(a)||(a=m.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(m.isBuffer(a))a.copy(r,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=a.length}return r},"concat");function vc(e,t){if(m.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$e(e,ArrayBuffer))return e.byteLength;if(typeof e!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);let i=e.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(t){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return mo(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Nc(e).length;default:if(r)return n?-1:mo(e).length;t=(""+t).toLowerCase(),r=!0}}s(vc,"byteLength");m.byteLength=vc;function bp(e,t,i){let n=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,t>>>=0,i<=t))return"";for(e||(e="utf8");;)switch(e){case"hex":return Ip(this,t,i);case"utf8":case"utf-8":return Ic(this,t,i);case"ascii":return vp(this,t,i);case"latin1":case"binary":return Fp(this,t,i);case"base64":return xp(this,t,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Ap(this,t,i);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}s(bp,"slowToString");m.prototype._isBuffer=!0;function jt(e,t,i){let n=e[t];e[t]=e[i],e[i]=n}s(jt,"swap");m.prototype.swap16=s(function(){let t=this.length;if(t%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<t;i+=2)jt(this,i,i+1);return this},"swap16");m.prototype.swap32=s(function(){let t=this.length;if(t%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<t;i+=4)jt(this,i,i+3),jt(this,i+1,i+2);return this},"swap32");m.prototype.swap64=s(function(){let t=this.length;if(t%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<t;i+=8)jt(this,i,i+7),jt(this,i+1,i+6),jt(this,i+2,i+5),jt(this,i+3,i+4);return this},"swap64");m.prototype.toString=s(function(){let t=this.length;return t===0?"":arguments.length===0?Ic(this,0,t):bp.apply(this,arguments)},"toString");m.prototype.toLocaleString=m.prototype.toString;m.prototype.equals=s(function(t){if(!m.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t?!0:m.compare(this,t)===0},"equals");m.prototype.inspect=s(function(){let t="",i=ui.INSPECT_MAX_BYTES;return t=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(t+=" ... "),"<Buffer "+t+">"},"inspect");wc&&(m.prototype[wc]=m.prototype.inspect);m.prototype.compare=s(function(t,i,n,r,o){if($e(t,Uint8Array)&&(t=m.from(t,t.offset,t.byteLength)),!m.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(i===void 0&&(i=0),n===void 0&&(n=t?t.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>t.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&i>=n)return 0;if(r>=o)return-1;if(i>=n)return 1;if(i>>>=0,n>>>=0,r>>>=0,o>>>=0,this===t)return 0;let a=o-r,c=n-i,l=Math.min(a,c),f=this.slice(r,o),d=t.slice(i,n);for(let h=0;h<l;++h)if(f[h]!==d[h]){a=f[h],c=d[h];break}return a<c?-1:c<a?1:0},"compare");function Fc(e,t,i,n,r){if(e.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,So(i)&&(i=r?0:e.length-1),i<0&&(i=e.length+i),i>=e.length){if(r)return-1;i=e.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof t=="string"&&(t=m.from(t,n)),m.isBuffer(t))return t.length===0?-1:Sc(e,t,i,n,r);if(typeof t=="number")return t=t&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(e,t,i):Uint8Array.prototype.lastIndexOf.call(e,t,i):Sc(e,[t],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Fc,"bidirectionalIndexOf");function Sc(e,t,i,n,r){let o=1,a=e.length,c=t.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(e.length<2||t.length<2)return-1;o=2,a/=2,c/=2,i/=2}function l(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(l,"read");let f;if(r){let d=-1;for(f=i;f<a;f++)if(l(e,f)===l(t,d===-1?0:f-d)){if(d===-1&&(d=f),f-d+1===c)return d*o}else d!==-1&&(f-=f-d),d=-1}else for(i+c>a&&(i=a-c),f=i;f>=0;f--){let d=!0;for(let h=0;h<c;h++)if(l(e,f+h)!==l(t,h)){d=!1;break}if(d)return f}return-1}s(Sc,"arrayIndexOf");m.prototype.includes=s(function(t,i,n){return this.indexOf(t,i,n)!==-1},"includes");m.prototype.indexOf=s(function(t,i,n){return Fc(this,t,i,n,!0)},"indexOf");m.prototype.lastIndexOf=s(function(t,i,n){return Fc(this,t,i,n,!1)},"lastIndexOf");function gp(e,t,i,n){i=Number(i)||0;let r=e.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=t.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let c=parseInt(t.substr(a*2,2),16);if(So(c))return a;e[i+a]=c}return a}s(gp,"hexWrite");function wp(e,t,i,n){return Hn(mo(t,e.length-i),e,i,n)}s(wp,"utf8Write");function Sp(e,t,i,n){return Hn(Rp(t),e,i,n)}s(Sp,"asciiWrite");function Ep(e,t,i,n){return Hn(Nc(t),e,i,n)}s(Ep,"base64Write");function _p(e,t,i,n){return Hn(Lp(t,e.length-i),e,i,n)}s(_p,"ucs2Write");m.prototype.write=s(function(t,i,n,r){if(i===void 0)r="utf8",n=this.length,i=0;else if(n===void 0&&typeof i=="string")r=i,n=this.length,i=0;else if(isFinite(i))i=i>>>0,isFinite(n)?(n=n>>>0,r===void 0&&(r="utf8")):(r=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-i;if((n===void 0||n>o)&&(n=o),t.length>0&&(n<0||i<0)||i>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");let a=!1;for(;;)switch(r){case"hex":return gp(this,t,i,n);case"utf8":case"utf-8":return wp(this,t,i,n);case"ascii":case"latin1":case"binary":return Sp(this,t,i,n);case"base64":return Ep(this,t,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return _p(this,t,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");m.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function xp(e,t,i){return t===0&&i===e.length?ho.fromByteArray(e):ho.fromByteArray(e.slice(t,i))}s(xp,"base64Slice");function Ic(e,t,i){i=Math.min(e.length,i);let n=[],r=t;for(;r<i;){let o=e[r],a=null,c=o>239?4:o>223?3:o>191?2:1;if(r+c<=i){let l,f,d,h;switch(c){case 1:o<128&&(a=o);break;case 2:l=e[r+1],(l&192)===128&&(h=(o&31)<<6|l&63,h>127&&(a=h));break;case 3:l=e[r+1],f=e[r+2],(l&192)===128&&(f&192)===128&&(h=(o&15)<<12|(l&63)<<6|f&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:l=e[r+1],f=e[r+2],d=e[r+3],(l&192)===128&&(f&192)===128&&(d&192)===128&&(h=(o&15)<<18|(l&63)<<12|(f&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,c=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=c}return kp(n)}s(Ic,"utf8Slice");var Ec=4096;function kp(e){let t=e.length;if(t<=Ec)return String.fromCharCode.apply(String,e);let i="",n=0;for(;n<t;)i+=String.fromCharCode.apply(String,e.slice(n,n+=Ec));return i}s(kp,"decodeCodePointsArray");function vp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]&127);return n}s(vp,"asciiSlice");function Fp(e,t,i){let n="";i=Math.min(e.length,i);for(let r=t;r<i;++r)n+=String.fromCharCode(e[r]);return n}s(Fp,"latin1Slice");function Ip(e,t,i){let n=e.length;(!t||t<0)&&(t=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=t;o<i;++o)r+=Np[e[o]];return r}s(Ip,"hexSlice");function Ap(e,t,i){let n=e.slice(t,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Ap,"utf16leSlice");m.prototype.slice=s(function(t,i){let n=this.length;t=~~t,i=i===void 0?n:~~i,t<0?(t+=n,t<0&&(t=0)):t>n&&(t=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<t&&(i=t);let r=this.subarray(t,i);return Object.setPrototypeOf(r,m.prototype),r},"slice");function Z(e,t,i){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>i)throw new RangeError("Trying to access beyond buffer length")}s(Z,"checkOffset");m.prototype.readUintLE=m.prototype.readUIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return r},"readUIntLE");m.prototype.readUintBE=m.prototype.readUIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t+--i],o=1;for(;i>0&&(o*=256);)r+=this[t+--i]*o;return r},"readUIntBE");m.prototype.readUint8=m.prototype.readUInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]},"readUInt8");m.prototype.readUint16LE=m.prototype.readUInt16LE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]|this[t+1]<<8},"readUInt16LE");m.prototype.readUint16BE=m.prototype.readUInt16BE=s(function(t,i){return t=t>>>0,i||Z(t,2,this.length),this[t]<<8|this[t+1]},"readUInt16BE");m.prototype.readUint32LE=m.prototype.readUInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+this[t+3]*16777216},"readUInt32LE");m.prototype.readUint32BE=m.prototype.readUInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]*16777216+(this[t+1]<<16|this[t+2]<<8|this[t+3])},"readUInt32BE");m.prototype.readBigUInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24,o=this[++t]+this[++t]*2**8+this[++t]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));m.prototype.readBigUInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=i*2**24+this[++t]*2**16+this[++t]*2**8+this[++t],o=this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));m.prototype.readIntLE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=this[t],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[t+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");m.prototype.readIntBE=s(function(t,i,n){t=t>>>0,i=i>>>0,n||Z(t,i,this.length);let r=i,o=1,a=this[t+--r];for(;r>0&&(o*=256);)a+=this[t+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");m.prototype.readInt8=s(function(t,i){return t=t>>>0,i||Z(t,1,this.length),this[t]&128?(255-this[t]+1)*-1:this[t]},"readInt8");m.prototype.readInt16LE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t]|this[t+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");m.prototype.readInt16BE=s(function(t,i){t=t>>>0,i||Z(t,2,this.length);let n=this[t+1]|this[t]<<8;return n&32768?n|4294901760:n},"readInt16BE");m.prototype.readInt32LE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},"readInt32LE");m.prototype.readInt32BE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},"readInt32BE");m.prototype.readBigInt64LE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=this[t+4]+this[t+5]*2**8+this[t+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++t]*2**8+this[++t]*2**16+this[++t]*2**24)},"readBigInt64LE"));m.prototype.readBigInt64BE=xt(s(function(t){t=t>>>0,fi(t,"offset");let i=this[t],n=this[t+7];(i===void 0||n===void 0)&&Ki(t,this.length-8);let r=(i<<24)+this[++t]*2**16+this[++t]*2**8+this[++t];return(BigInt(r)<<BigInt(32))+BigInt(this[++t]*2**24+this[++t]*2**16+this[++t]*2**8+n)},"readBigInt64BE"));m.prototype.readFloatLE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!0,23,4)},"readFloatLE");m.prototype.readFloatBE=s(function(t,i){return t=t>>>0,i||Z(t,4,this.length),li.read(this,t,!1,23,4)},"readFloatBE");m.prototype.readDoubleLE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!0,52,8)},"readDoubleLE");m.prototype.readDoubleBE=s(function(t,i){return t=t>>>0,i||Z(t,8,this.length),li.read(this,t,!1,52,8)},"readDoubleBE");function fe(e,t,i,n,r,o){if(!m.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>r||t<o)throw new RangeError('"value" argument is out of bounds');if(i+n>e.length)throw new RangeError("Index out of range")}s(fe,"checkInt");m.prototype.writeUintLE=m.prototype.writeUIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=1,a=0;for(this[i]=t&255;++a<n&&(o*=256);)this[i+a]=t/o&255;return i+n},"writeUIntLE");m.prototype.writeUintBE=m.prototype.writeUIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,n=n>>>0,!r){let c=Math.pow(2,8*n)-1;fe(this,t,i,n,c,0)}let o=n-1,a=1;for(this[i+o]=t&255;--o>=0&&(a*=256);)this[i+o]=t/a&255;return i+n},"writeUIntBE");m.prototype.writeUint8=m.prototype.writeUInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,255,0),this[i]=t&255,i+1},"writeUInt8");m.prototype.writeUint16LE=m.prototype.writeUInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeUInt16LE");m.prototype.writeUint16BE=m.prototype.writeUInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,65535,0),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeUInt16BE");m.prototype.writeUint32LE=m.prototype.writeUInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i+3]=t>>>24,this[i+2]=t>>>16,this[i+1]=t>>>8,this[i]=t&255,i+4},"writeUInt32LE");m.prototype.writeUint32BE=m.prototype.writeUInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,4294967295,0),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeUInt32BE");function Ac(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o,o=o>>8,e[i++]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,a=a>>8,e[i++]=a,i}s(Ac,"wrtBigUInt64LE");function Oc(e,t,i,n,r){Lc(t,n,r,e,i,7);let o=Number(t&BigInt(4294967295));e[i+7]=o,o=o>>8,e[i+6]=o,o=o>>8,e[i+5]=o,o=o>>8,e[i+4]=o;let a=Number(t>>BigInt(32)&BigInt(4294967295));return e[i+3]=a,a=a>>8,e[i+2]=a,a=a>>8,e[i+1]=a,a=a>>8,e[i]=a,i+8}s(Oc,"wrtBigUInt64BE");m.prototype.writeBigUInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));m.prototype.writeBigUInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));m.prototype.writeIntLE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=0,a=1,c=0;for(this[i]=t&255;++o<n&&(a*=256);)t<0&&c===0&&this[i+o-1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntLE");m.prototype.writeIntBE=s(function(t,i,n,r){if(t=+t,i=i>>>0,!r){let l=Math.pow(2,8*n-1);fe(this,t,i,n,l-1,-l)}let o=n-1,a=1,c=0;for(this[i+o]=t&255;--o>=0&&(a*=256);)t<0&&c===0&&this[i+o+1]!==0&&(c=1),this[i+o]=(t/a>>0)-c&255;return i+n},"writeIntBE");m.prototype.writeInt8=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,1,127,-128),t<0&&(t=255+t+1),this[i]=t&255,i+1},"writeInt8");m.prototype.writeInt16LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t&255,this[i+1]=t>>>8,i+2},"writeInt16LE");m.prototype.writeInt16BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,2,32767,-32768),this[i]=t>>>8,this[i+1]=t&255,i+2},"writeInt16BE");m.prototype.writeInt32LE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),this[i]=t&255,this[i+1]=t>>>8,this[i+2]=t>>>16,this[i+3]=t>>>24,i+4},"writeInt32LE");m.prototype.writeInt32BE=s(function(t,i,n){return t=+t,i=i>>>0,n||fe(this,t,i,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[i]=t>>>24,this[i+1]=t>>>16,this[i+2]=t>>>8,this[i+3]=t&255,i+4},"writeInt32BE");m.prototype.writeBigInt64LE=xt(s(function(t,i=0){return Ac(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));m.prototype.writeBigInt64BE=xt(s(function(t,i=0){return Oc(this,t,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Pc(e,t,i,n,r,o){if(i+n>e.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Pc,"checkIEEE754");function Tc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,4,34028234663852886e22,-34028234663852886e22),li.write(e,t,i,n,23,4),i+4}s(Tc,"writeFloat");m.prototype.writeFloatLE=s(function(t,i,n){return Tc(this,t,i,!0,n)},"writeFloatLE");m.prototype.writeFloatBE=s(function(t,i,n){return Tc(this,t,i,!1,n)},"writeFloatBE");function Rc(e,t,i,n,r){return t=+t,i=i>>>0,r||Pc(e,t,i,8,17976931348623157e292,-17976931348623157e292),li.write(e,t,i,n,52,8),i+8}s(Rc,"writeDouble");m.prototype.writeDoubleLE=s(function(t,i,n){return Rc(this,t,i,!0,n)},"writeDoubleLE");m.prototype.writeDoubleBE=s(function(t,i,n){return Rc(this,t,i,!1,n)},"writeDoubleBE");m.prototype.copy=s(function(t,i,n,r){if(!m.isBuffer(t))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=t.length&&(i=t.length),i||(i=0),r>0&&r<n&&(r=n),r===n||t.length===0||this.length===0)return 0;if(i<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-i<r-n&&(r=t.length-i+n);let o=r-n;return this===t&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(t,this.subarray(n,r),i),o},"copy");m.prototype.fill=s(function(t,i,n,r){if(typeof t=="string"){if(typeof i=="string"?(r=i,i=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!m.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(t.length===1){let a=t.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(t=a)}}else typeof t=="number"?t=t&255:typeof t=="boolean"&&(t=Number(t));if(i<0||this.length<i||this.length<n)throw new RangeError("Out of range index");if(n<=i)return this;i=i>>>0,n=n===void 0?this.length:n>>>0,t||(t=0);let o;if(typeof t=="number")for(o=i;o<n;++o)this[o]=t;else{let a=m.isBuffer(t)?t:m.from(t,r),c=a.length;if(c===0)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%c]}return this},"fill");var ci={};function wo(e,t,i){var n;ci[e]=(n=class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:t.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${e}]`,this.stack,delete this.name}get code(){return e}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${e}]: ${this.message}`}},s(n,"NodeError"),n)}s(wo,"E");wo("ERR_BUFFER_OUT_OF_BOUNDS",function(e){return e?`${e} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);wo("ERR_INVALID_ARG_TYPE",function(e,t){return`The "${e}" argument must be of type number. Received type ${typeof t}`},TypeError);wo("ERR_OUT_OF_RANGE",function(e,t,i){let n=`The value of "${e}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=_c(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=_c(r)),r+="n"),n+=` It must be ${t}. Received ${r}`,n},RangeError);function _c(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(_c,"addNumericalSeparator");function Op(e,t,i){fi(t,"offset"),(e[t]===void 0||e[t+i]===void 0)&&Ki(t,e.length-(i+1))}s(Op,"checkBounds");function Lc(e,t,i,n,r,o){if(e>i||e<t){let a=typeof t=="bigint"?"n":"",c;throw o>3?t===0||t===BigInt(0)?c=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:c=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:c=`>= ${t}${a} and <= ${i}${a}`,new ci.ERR_OUT_OF_RANGE("value",c,e)}Op(n,r,o)}s(Lc,"checkIntBI");function fi(e,t){if(typeof e!="number")throw new ci.ERR_INVALID_ARG_TYPE(t,"number",e)}s(fi,"validateNumber");function Ki(e,t,i){throw Math.floor(e)!==e?(fi(e,i),new ci.ERR_OUT_OF_RANGE(i||"offset","an integer",e)):t<0?new ci.ERR_BUFFER_OUT_OF_BOUNDS:new ci.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${t}`,e)}s(Ki,"boundsError");var Pp=/[^+/0-9A-Za-z-_]/g;function Tp(e){if(e=e.split("=")[0],e=e.trim().replace(Pp,""),e.length<2)return"";for(;e.length%4!==0;)e=e+"=";return e}s(Tp,"base64clean");function mo(e,t){t=t||1/0;let i,n=e.length,r=null,o=[];for(let a=0;a<n;++a){if(i=e.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(t-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(t-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(t-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(t-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((t-=1)<0)break;o.push(i)}else if(i<2048){if((t-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((t-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((t-=4)<0)break;o.push(i>>18|240,i>>12&63|128,i>>6&63|128,i&63|128)}else throw new Error("Invalid code point")}return o}s(mo,"utf8ToBytes");function Rp(e){let t=[];for(let i=0;i<e.length;++i)t.push(e.charCodeAt(i)&255);return t}s(Rp,"asciiToBytes");function Lp(e,t){let i,n,r,o=[];for(let a=0;a<e.length&&!((t-=2)<0);++a)i=e.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Lp,"utf16leToBytes");function Nc(e){return ho.toByteArray(Tp(e))}s(Nc,"base64ToBytes");function Hn(e,t,i,n){let r;for(r=0;r<n&&!(r+i>=t.length||r>=e.length);++r)t[r+i]=e[r];return r}s(Hn,"blitBuffer");function $e(e,t){return e instanceof t||e!=null&&e.constructor!=null&&e.constructor.name!=null&&e.constructor.name===t.name}s($e,"isInstance");function So(e){return e!==e}s(So,"numberIsNaN");var Np=function(){let e="0123456789abcdef",t=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)t[n+r]=e[i]+e[r]}return t}();function xt(e){return typeof BigInt>"u"?Cp:e}s(xt,"defineBigIntMethod");function Cp(){throw new Error("BigInt not supported")}s(Cp,"BufferBigIntNotDefined")});var Bc=T((vE,ko)=>{"use strict";var sy=Object.prototype.hasOwnProperty,se="~";function Xi(){}s(Xi,"Events");Object.create&&(Xi.prototype=Object.create(null),new Xi().__proto__||(se=!1));function ay(e,t,i){this.fn=e,this.context=t,this.once=i||!1}s(ay,"EE");function Cc(e,t,i,n,r){if(typeof i!="function")throw new TypeError("The listener must be a function");var o=new ay(i,n||e,r),a=se?se+t:t;return e._events[a]?e._events[a].fn?e._events[a]=[e._events[a],o]:e._events[a].push(o):(e._events[a]=o,e._eventsCount++),e}s(Cc,"addListener");function Kn(e,t){--e._eventsCount===0?e._events=new Xi:delete e._events[t]}s(Kn,"clearEvent");function ne(){this._events=new Xi,this._eventsCount=0}s(ne,"EventEmitter");ne.prototype.eventNames=s(function(){var t=[],i,n;if(this._eventsCount===0)return t;for(n in i=this._events)sy.call(i,n)&&t.push(se?n.slice(1):n);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(i)):t},"eventNames");ne.prototype.listeners=s(function(t){var i=se?se+t:t,n=this._events[i];if(!n)return[];if(n.fn)return[n.fn];for(var r=0,o=n.length,a=new Array(o);r<o;r++)a[r]=n[r].fn;return a},"listeners");ne.prototype.listenerCount=s(function(t){var i=se?se+t:t,n=this._events[i];return n?n.fn?1:n.length:0},"listenerCount");ne.prototype.emit=s(function(t,i,n,r,o,a){var c=se?se+t:t;if(!this._events[c])return!1;var l=this._events[c],f=arguments.length,d,h;if(l.fn){switch(l.once&&this.removeListener(t,l.fn,void 0,!0),f){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,i),!0;case 3:return l.fn.call(l.context,i,n),!0;case 4:return l.fn.call(l.context,i,n,r),!0;case 5:return l.fn.call(l.context,i,n,r,o),!0;case 6:return l.fn.call(l.context,i,n,r,o,a),!0}for(h=1,d=new Array(f-1);h<f;h++)d[h-1]=arguments[h];l.fn.apply(l.context,d)}else{var b=l.length,p;for(h=0;h<b;h++)switch(l[h].once&&this.removeListener(t,l[h].fn,void 0,!0),f){case 1:l[h].fn.call(l[h].context);break;case 2:l[h].fn.call(l[h].context,i);break;case 3:l[h].fn.call(l[h].context,i,n);break;case 4:l[h].fn.call(l[h].context,i,n,r);break;default:if(!d)for(p=1,d=new Array(f-1);p<f;p++)d[p-1]=arguments[p];l[h].fn.apply(l[h].context,d)}}return!0},"emit");ne.prototype.on=s(function(t,i,n){return Cc(this,t,i,n,!1)},"on");ne.prototype.once=s(function(t,i,n){return Cc(this,t,i,n,!0)},"once");ne.prototype.removeListener=s(function(t,i,n,r){var o=se?se+t:t;if(!this._events[o])return this;if(!i)return Kn(this,o),this;var a=this._events[o];if(a.fn)a.fn===i&&(!r||a.once)&&(!n||a.context===n)&&Kn(this,o);else{for(var c=0,l=[],f=a.length;c<f;c++)(a[c].fn!==i||r&&!a[c].once||n&&a[c].context!==n)&&l.push(a[c]);l.length?this._events[o]=l.length===1?l[0]:l:Kn(this,o)}return this},"removeListener");ne.prototype.removeAllListeners=s(function(t){var i;return t?(i=se?se+t:t,this._events[i]&&Kn(this,i)):(this._events=new Xi,this._eventsCount=0),this},"removeAllListeners");ne.prototype.off=ne.prototype.removeListener;ne.prototype.addListener=ne.prototype.on;ne.prefixed=se;ne.EventEmitter=ne;typeof ko<"u"&&(ko.exports=ne)});var q=T((Sx,Rl)=>{"use strict";Rl.exports={ArrayIsArray:s(function(e){return Array.isArray(e)},"ArrayIsArray"),ArrayPrototypeIncludes:s(function(e,t){return e.includes(t)},"ArrayPrototypeIncludes"),ArrayPrototypeIndexOf:s(function(e,t){return e.indexOf(t)},"ArrayPrototypeIndexOf"),ArrayPrototypeJoin:s(function(e,t){return e.join(t)},"ArrayPrototypeJoin"),ArrayPrototypeMap:s(function(e,t){return e.map(t)},"ArrayPrototypeMap"),ArrayPrototypePop:s(function(e,t){return e.pop(t)},"ArrayPrototypePop"),ArrayPrototypePush:s(function(e,t){return e.push(t)},"ArrayPrototypePush"),ArrayPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"ArrayPrototypeSlice"),Error,FunctionPrototypeCall:s(function(e,t,...i){return e.call(t,...i)},"FunctionPrototypeCall"),FunctionPrototypeSymbolHasInstance:s(function(e,t){return Function.prototype[Symbol.hasInstance].call(e,t)},"FunctionPrototypeSymbolHasInstance"),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:s(function(e,t){return Object.defineProperties(e,t)},"ObjectDefineProperties"),ObjectDefineProperty:s(function(e,t,i){return Object.defineProperty(e,t,i)},"ObjectDefineProperty"),ObjectGetOwnPropertyDescriptor:s(function(e,t){return Object.getOwnPropertyDescriptor(e,t)},"ObjectGetOwnPropertyDescriptor"),ObjectKeys:s(function(e){return Object.keys(e)},"ObjectKeys"),ObjectSetPrototypeOf:s(function(e,t){return Object.setPrototypeOf(e,t)},"ObjectSetPrototypeOf"),Promise,PromisePrototypeCatch:s(function(e,t){return e.catch(t)},"PromisePrototypeCatch"),PromisePrototypeThen:s(function(e,t,i){return e.then(t,i)},"PromisePrototypeThen"),PromiseReject:s(function(e){return Promise.reject(e)},"PromiseReject"),PromiseResolve:s(function(e){return Promise.resolve(e)},"PromiseResolve"),ReflectApply:Reflect.apply,RegExpPrototypeTest:s(function(e,t){return e.test(t)},"RegExpPrototypeTest"),SafeSet:Set,String,StringPrototypeSlice:s(function(e,t,i){return e.slice(t,i)},"StringPrototypeSlice"),StringPrototypeToLowerCase:s(function(e){return e.toLowerCase()},"StringPrototypeToLowerCase"),StringPrototypeToUpperCase:s(function(e){return e.toUpperCase()},"StringPrototypeToUpperCase"),StringPrototypeTrim:s(function(e){return e.trim()},"StringPrototypeTrim"),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:s(function(e,t,i){return e.set(t,i)},"TypedArrayPrototypeSet"),Boolean,Uint8Array}});var Ei=T((_x,sr)=>{"use strict";var{AbortController:Ll,AbortSignal:Ey}=typeof self<"u"?self:typeof window<"u"?window:void 0;sr.exports=Ll;sr.exports.AbortSignal=Ey;sr.exports.default=Ll});var gn=T((xx,ls)=>{"use strict";var _i=typeof Reflect=="object"?Reflect:null,Nl=_i&&typeof _i.apply=="function"?_i.apply:s(function(t,i,n){return Function.prototype.apply.call(t,i,n)},"ReflectApply"),ar;_i&&typeof _i.ownKeys=="function"?ar=_i.ownKeys:Object.getOwnPropertySymbols?ar=s(function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))},"ReflectOwnKeys"):ar=s(function(t){return Object.getOwnPropertyNames(t)},"ReflectOwnKeys");function _y(e){console&&console.warn&&console.warn(e)}s(_y,"ProcessEmitWarning");var Bl=Number.isNaN||s(function(t){return t!==t},"NumberIsNaN");function N(){N.init.call(this)}s(N,"EventEmitter");ls.exports=N;ls.exports.once=Fy;N.EventEmitter=N;N.prototype._events=void 0;N.prototype._eventsCount=0;N.prototype._maxListeners=void 0;var Cl=10;function cr(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}s(cr,"checkListener");Object.defineProperty(N,"defaultMaxListeners",{enumerable:!0,get:s(function(){return Cl},"get"),set:s(function(e){if(typeof e!="number"||e<0||Bl(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Cl=e},"set")});N.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};N.prototype.setMaxListeners=s(function(t){if(typeof t!="number"||t<0||Bl(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},"setMaxListeners");function Dl(e){return e._maxListeners===void 0?N.defaultMaxListeners:e._maxListeners}s(Dl,"_getMaxListeners");N.prototype.getMaxListeners=s(function(){return Dl(this)},"getMaxListeners");N.prototype.emit=s(function(t){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=t==="error",o=this._events;if(o!==void 0)r=r&&o.error===void 0;else if(!r)return!1;if(r){var a;if(i.length>0&&(a=i[0]),a instanceof Error)throw a;var c=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw c.context=a,c}var l=o[t];if(l===void 0)return!1;if(typeof l=="function")Nl(l,this,i);else for(var f=l.length,d=ql(l,f),n=0;n<f;++n)Nl(d[n],this,i);return!0},"emit");function Ml(e,t,i,n){var r,o,a;if(cr(i),o=e._events,o===void 0?(o=e._events=Object.create(null),e._eventsCount=0):(o.newListener!==void 0&&(e.emit("newListener",t,i.listener?i.listener:i),o=e._events),a=o[t]),a===void 0)a=o[t]=i,++e._eventsCount;else if(typeof a=="function"?a=o[t]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Dl(e),r>0&&a.length>r&&!a.warned){a.warned=!0;var c=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");c.name="MaxListenersExceededWarning",c.emitter=e,c.type=t,c.count=a.length,_y(c)}return e}s(Ml,"_addListener");N.prototype.addListener=s(function(t,i){return Ml(this,t,i,!1)},"addListener");N.prototype.on=N.prototype.addListener;N.prototype.prependListener=s(function(t,i){return Ml(this,t,i,!0)},"prependListener");function xy(){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)}s(xy,"onceWrapper");function Wl(e,t,i){var n={fired:!1,wrapFn:void 0,target:e,type:t,listener:i},r=xy.bind(n);return r.listener=i,n.wrapFn=r,r}s(Wl,"_onceWrap");N.prototype.once=s(function(t,i){return cr(i),this.on(t,Wl(this,t,i)),this},"once");N.prototype.prependOnceListener=s(function(t,i){return cr(i),this.prependListener(t,Wl(this,t,i)),this},"prependOnceListener");N.prototype.removeListener=s(function(t,i){var n,r,o,a,c;if(cr(i),r=this._events,r===void 0)return this;if(n=r[t],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||i));else if(typeof n!="function"){for(o=-1,a=n.length-1;a>=0;a--)if(n[a]===i||n[a].listener===i){c=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():ky(n,o),n.length===1&&(r[t]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",t,c||i)}return this},"removeListener");N.prototype.off=N.prototype.removeListener;N.prototype.removeAllListeners=s(function(t){var i,n,r;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[t]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[t]),this;if(arguments.length===0){var o=Object.keys(n),a;for(r=0;r<o.length;++r)a=o[r],a!=="removeListener"&&this.removeAllListeners(a);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(i=n[t],typeof i=="function")this.removeListener(t,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(t,i[r]);return this},"removeAllListeners");function Ul(e,t,i){var n=e._events;if(n===void 0)return[];var r=n[t];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?vy(r):ql(r,r.length)}s(Ul,"_listeners");N.prototype.listeners=s(function(t){return Ul(this,t,!0)},"listeners");N.prototype.rawListeners=s(function(t){return Ul(this,t,!1)},"rawListeners");N.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):jl.call(e,t)};N.prototype.listenerCount=jl;function jl(e){var t=this._events;if(t!==void 0){var i=t[e];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(jl,"listenerCount");N.prototype.eventNames=s(function(){return this._eventsCount>0?ar(this._events):[]},"eventNames");function ql(e,t){for(var i=new Array(t),n=0;n<t;++n)i[n]=e[n];return i}s(ql,"arrayClone");function ky(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}s(ky,"spliceOne");function vy(e){for(var t=new Array(e.length),i=0;i<t.length;++i)t[i]=e[i].listener||e[i];return t}s(vy,"unwrapListeners");function Fy(e,t){return new Promise(function(i,n){function r(a){e.removeListener(t,o),n(a)}s(r,"errorListener");function o(){typeof e.removeListener=="function"&&e.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),$l(e,t,o,{once:!0}),t!=="error"&&Iy(e,r,{once:!0})})}s(Fy,"once");function Iy(e,t,i){typeof e.on=="function"&&$l(e,"error",t,i)}s(Iy,"addErrorHandlerIfEventEmitter");function $l(e,t,i,n){if(typeof e.on=="function")n.once?e.once(t,i):e.on(t,i);else if(typeof e.addEventListener=="function")e.addEventListener(t,s(function r(o){n.once&&e.removeEventListener(t,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e)}s($l,"eventTargetAgnosticAddListener")});var re=T((vx,us)=>{"use strict";var Ay=Ie(),{kResistStopPropagation:Oy,SymbolDispose:Py}=q(),Ty=globalThis.AbortSignal||Ei().AbortSignal,Ry=globalThis.AbortController||Ei().AbortController,Ly=Object.getPrototypeOf(async function(){}).constructor,zl=globalThis.Blob||Ay.Blob,Ny=s(typeof zl<"u"?function(t){return t instanceof zl}:function(t){return!1},"isBlob"),Vl=s((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new ERR_INVALID_ARG_TYPE(t,"AbortSignal",e)},"validateAbortSignal"),Cy=s((e,t)=>{if(typeof e!="function")throw new ERR_INVALID_ARG_TYPE(t,"Function",e)},"validateFunction"),ds=class ds extends Error{constructor(t){if(!Array.isArray(t))throw new TypeError(`Expected input to be an Array, got ${typeof t}`);let i="";for(let n=0;n<t.length;n++)i+=` ${t[n].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=t}};s(ds,"AggregateError");var fs=ds;us.exports={AggregateError:fs,kEmptyObject:Object.freeze({}),once:s(function(e){let t=!1;return function(...i){t||(t=!0,e.apply(this,i))}},"once"),createDeferredPromise:s(function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}},"createDeferredPromise"),promisify:s(function(e){return new Promise((t,i)=>{e((n,...r)=>n?i(n):t(...r))})},"promisify"),debuglog:s(function(){return function(){}},"debuglog"),format:s(function(e,...t){return e.replace(/%([sdifj])/g,function(...[i,n]){let r=t.shift();return n==="f"?r.toFixed(6):n==="j"?JSON.stringify(r):n==="s"&&typeof r=="object"?`${r.constructor!==Object?r.constructor.name:""} {}`.trim():r.toString()})},"format"),inspect:s(function(e){switch(typeof e){case"string":if(e.includes("'"))if(e.includes('"')){if(!e.includes("`")&&!e.includes("${"))return`\`${e}\``}else return`"${e}"`;return`'${e}'`;case"number":return isNaN(e)?"NaN":Object.is(e,-0)?String(e):e;case"bigint":return`${String(e)}n`;case"boolean":case"undefined":return String(e);case"object":return"{}"}},"inspect"),types:{isAsyncFunction:s(function(e){return e instanceof Ly},"isAsyncFunction"),isArrayBufferView:s(function(e){return ArrayBuffer.isView(e)},"isArrayBufferView")},isBlob:Ny,deprecate:s(function(e,t){return e},"deprecate"),addAbortListener:gn().addAbortListener||s(function(t,i){if(t===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",t);Vl(t,"signal"),Cy(i,"listener");let n;return t.aborted?queueMicrotask(()=>i()):(t.addEventListener("abort",i,{__proto__:null,once:!0,[Oy]:!0}),n=s(()=>{t.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[Py](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:Ty.any||s(function(t){if(t.length===1)return t[0];let i=new Ry,n=s(()=>i.abort(),"abort");return t.forEach(r=>{Vl(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{t.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};us.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ae=T((Ix,Gl)=>{"use strict";var{format:By,inspect:lr,AggregateError:Dy}=re(),My=globalThis.AggregateError||Dy,Wy=Symbol("kIsNodeError"),Uy=["string","function","number","object","Function","Object","boolean","bigint","symbol"],jy=/^([A-Z][a-z0-9]*)+$/,qy="__node_internal_",fr={};function Kt(e,t){if(!e)throw new fr.ERR_INTERNAL_ASSERTION(t)}s(Kt,"assert");function Hl(e){let t="",i=e.length,n=e[0]==="-"?1:0;for(;i>=n+4;i-=3)t=`_${e.slice(i-3,i)}${t}`;return`${e.slice(0,i)}${t}`}s(Hl,"addNumericalSeparator");function $y(e,t,i){if(typeof t=="function")return Kt(t.length<=i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${t.length}).`),t(...i);let n=(t.match(/%[dfijoOs]/g)||[]).length;return Kt(n===i.length,`Code: ${e}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?t:By(t,...i)}s($y,"getMessage");function ie(e,t,i){i||(i=Error);let r=class r extends i{constructor(...a){super($y(e,t,a))}toString(){return`${this.name} [${e}]: ${this.message}`}};s(r,"NodeError");let n=r;Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value:s(function(){return`${this.name} [${e}]: ${this.message}`},"value"),writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=e,n.prototype[Wy]=!0,fr[e]=n}s(ie,"E");function Kl(e){let t=qy+e.name;return Object.defineProperty(e,"name",{value:t}),e}s(Kl,"hideStackFrames");function zy(e,t){if(e&&t&&e!==t){if(Array.isArray(t.errors))return t.errors.push(e),t;let i=new My([t,e],t.message);return i.code=t.code,i}return e||t}s(zy,"aggregateTwoErrors");var ps=class ps extends Error{constructor(t="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new fr.ERR_INVALID_ARG_TYPE("options","Object",i);super(t,i),this.code="ABORT_ERR",this.name="AbortError"}};s(ps,"AbortError");var hs=ps;ie("ERR_ASSERTION","%s",Error);ie("ERR_INVALID_ARG_TYPE",(e,t,i)=>{Kt(typeof e=="string","'name' must be a string"),Array.isArray(t)||(t=[t]);let n="The ";e.endsWith(" argument")?n+=`${e} `:n+=`"${e}" ${e.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let l of t)Kt(typeof l=="string","All expected entries have to be of type string"),Uy.includes(l)?r.push(l.toLowerCase()):jy.test(l)?o.push(l):(Kt(l!=="object",'The value "object" should be written as "Object"'),a.push(l));if(o.length>0){let l=r.indexOf("object");l!==-1&&(r.splice(r,l,1),o.push("Object"))}if(r.length>0){switch(r.length){case 1:n+=`of type ${r[0]}`;break;case 2:n+=`one of type ${r[0]} or ${r[1]}`;break;default:{let l=r.pop();n+=`one of type ${r.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(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var c;if((c=i.constructor)!==null&&c!==void 0&&c.name)n+=`. Received an instance of ${i.constructor.name}`;else{let l=lr(i,{depth:-1});n+=`. Received ${l}`}}else{let l=lr(i,{colors:!1});l.length>25&&(l=`${l.slice(0,25)}...`),n+=`. Received type ${typeof i} (${l})`}return n},TypeError);ie("ERR_INVALID_ARG_VALUE",(e,t,i="is invalid")=>{let n=lr(t);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${e.includes(".")?"property":"argument"} '${e}' ${i}. Received ${n}`},TypeError);ie("ERR_INVALID_RETURN_VALUE",(e,t,i)=>{var n;let r=i!=null&&(n=i.constructor)!==null&&n!==void 0&&n.name?`instance of ${i.constructor.name}`:`type ${typeof i}`;return`Expected ${e} to be returned from the "${t}" function but got ${r}.`},TypeError);ie("ERR_MISSING_ARGS",(...e)=>{Kt(e.length>0,"At least one arg needs to be specified");let t,i=e.length;switch(e=(Array.isArray(e)?e:[e]).map(n=>`"${n}"`).join(" or "),i){case 1:t+=`The ${e[0]} argument`;break;case 2:t+=`The ${e[0]} and ${e[1]} arguments`;break;default:{let n=e.pop();t+=`The ${e.join(", ")}, and ${n} arguments`}break}return`${t} must be specified`},TypeError);ie("ERR_OUT_OF_RANGE",(e,t,i)=>{Kt(t,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Hl(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Hl(n)),n+="n"):n=lr(i),`The value of "${e}" is out of range. It must be ${t}. Received ${n}`},RangeError);ie("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);ie("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);ie("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);ie("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);ie("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);ie("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ie("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);ie("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);ie("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);ie("ERR_STREAM_WRITE_AFTER_END","write after end",Error);ie("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Gl.exports={AbortError:hs,aggregateTwoErrors:Kl(zy),hideStackFrames:Kl,codes:fr}});var ki=T((Ox,of)=>{"use strict";var{ArrayIsArray:ms,ArrayPrototypeIncludes:Ql,ArrayPrototypeJoin:Zl,ArrayPrototypeMap:Vy,NumberIsInteger:bs,NumberIsNaN:Hy,NumberMAX_SAFE_INTEGER:Ky,NumberMIN_SAFE_INTEGER:Gy,NumberParseInt:Yy,ObjectPrototypeHasOwnProperty:Xy,RegExpPrototypeExec:ef,String:Jy,StringPrototypeToUpperCase:Qy,StringPrototypeTrim:Zy}=q(),{hideStackFrames:Re,codes:{ERR_SOCKET_BAD_PORT:em,ERR_INVALID_ARG_TYPE:oe,ERR_INVALID_ARG_VALUE:xi,ERR_OUT_OF_RANGE:Gt,ERR_UNKNOWN_SIGNAL:Yl}}=ae(),{normalizeEncoding:tm}=re(),{isAsyncFunction:im,isArrayBufferView:nm}=re().types,Xl={};function rm(e){return e===(e|0)}s(rm,"isInt32");function om(e){return e===e>>>0}s(om,"isUint32");var sm=/^[0-7]+$/,am="must be a 32-bit unsigned integer or an octal string";function cm(e,t,i){if(typeof e>"u"&&(e=i),typeof e=="string"){if(ef(sm,e)===null)throw new xi(t,e,am);e=Yy(e,8)}return tf(e,t),e}s(cm,"parseFileMode");var lm=Re((e,t,i=Gy,n=Ky)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),fm=Re((e,t,i=-2147483648,n=2147483647)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);if(e<i||e>n)throw new Gt(t,`>= ${i} && <= ${n}`,e)}),tf=Re((e,t,i=!1)=>{if(typeof e!="number")throw new oe(t,"number",e);if(!bs(e))throw new Gt(t,"an integer",e);let n=i?1:0,r=4294967295;if(e<n||e>r)throw new Gt(t,`>= ${n} && <= ${r}`,e)});function gs(e,t){if(typeof e!="string")throw new oe(t,"string",e)}s(gs,"validateString");function um(e,t,i=void 0,n){if(typeof e!="number")throw new oe(t,"number",e);if(i!=null&&e<i||n!=null&&e>n||(i!=null||n!=null)&&Hy(e))throw new Gt(t,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,e)}s(um,"validateNumber");var dm=Re((e,t,i)=>{if(!Ql(i,e)){let r="must be one of: "+Zl(Vy(i,o=>typeof o=="string"?`'${o}'`:Jy(o)),", ");throw new xi(t,e,r)}});function nf(e,t){if(typeof e!="boolean")throw new oe(t,"boolean",e)}s(nf,"validateBoolean");function ys(e,t,i){return e==null||!Xy(e,t)?i:e[t]}s(ys,"getOwnPropertyValueOrDefault");var hm=Re((e,t,i=null)=>{let n=ys(i,"allowArray",!1),r=ys(i,"allowFunction",!1);if(!ys(i,"nullable",!1)&&e===null||!n&&ms(e)||typeof e!="object"&&(!r||typeof e!="function"))throw new oe(t,"Object",e)}),pm=Re((e,t)=>{if(e!=null&&typeof e!="object"&&typeof e!="function")throw new oe(t,"a dictionary",e)}),ur=Re((e,t,i=0)=>{if(!ms(e))throw new oe(t,"Array",e);if(e.length<i){let n=`must be longer than ${i}`;throw new xi(t,e,n)}});function ym(e,t){ur(e,t);for(let i=0;i<e.length;i++)gs(e[i],`${t}[${i}]`)}s(ym,"validateStringArray");function mm(e,t){ur(e,t);for(let i=0;i<e.length;i++)nf(e[i],`${t}[${i}]`)}s(mm,"validateBooleanArray");function bm(e,t){ur(e,t);for(let i=0;i<e.length;i++){let n=e[i],r=`${t}[${i}]`;if(n==null)throw new oe(r,"AbortSignal",n);rf(n,r)}}s(bm,"validateAbortSignalArray");function gm(e,t="signal"){if(gs(e,t),Xl[e]===void 0)throw Xl[Qy(e)]!==void 0?new Yl(e+" (signals must use all capital letters)"):new Yl(e)}s(gm,"validateSignalName");var wm=Re((e,t="buffer")=>{if(!nm(e))throw new oe(t,["Buffer","TypedArray","DataView"],e)});function Sm(e,t){let i=tm(t),n=e.length;if(i==="hex"&&n%2!==0)throw new xi("encoding",t,`is invalid for data of length ${n}`)}s(Sm,"validateEncoding");function Em(e,t="Port",i=!0){if(typeof e!="number"&&typeof e!="string"||typeof e=="string"&&Zy(e).length===0||+e!==+e>>>0||e>65535||e===0&&!i)throw new em(t,e,i);return e|0}s(Em,"validatePort");var rf=Re((e,t)=>{if(e!==void 0&&(e===null||typeof e!="object"||!("aborted"in e)))throw new oe(t,"AbortSignal",e)}),_m=Re((e,t)=>{if(typeof e!="function")throw new oe(t,"Function",e)}),xm=Re((e,t)=>{if(typeof e!="function"||im(e))throw new oe(t,"Function",e)}),km=Re((e,t)=>{if(e!==void 0)throw new oe(t,"undefined",e)});function vm(e,t,i){if(!Ql(i,e))throw new oe(t,`('${Zl(i,"|")}')`,e)}s(vm,"validateUnion");var Fm=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Jl(e,t){if(typeof e>"u"||!ef(Fm,e))throw new xi(t,e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Jl,"validateLinkHeaderFormat");function Im(e){if(typeof e=="string")return Jl(e,"hints"),e;if(ms(e)){let t=e.length,i="";if(t===0)return i;for(let n=0;n<t;n++){let r=e[n];Jl(r,"hints"),i+=r,n!==t-1&&(i+=", ")}return i}throw new xi("hints",e,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Im,"validateLinkHeaderValue");of.exports={isInt32:rm,isUint32:om,parseFileMode:cm,validateArray:ur,validateStringArray:ym,validateBooleanArray:mm,validateAbortSignalArray:bm,validateBoolean:nf,validateBuffer:wm,validateDictionary:pm,validateEncoding:Sm,validateFunction:_m,validateInt32:fm,validateInteger:lm,validateNumber:um,validateObject:hm,validateOneOf:dm,validatePlainFunction:xm,validatePort:Em,validateSignalName:gm,validateString:gs,validateUint32:tf,validateUndefined:km,validateUnion:vm,validateAbortSignal:rf,validateLinkHeaderValue:Im}});var Pt=T((Tx,lf)=>{var V=lf.exports={},Qe,Ze;function ws(){throw new Error("setTimeout has not been defined")}s(ws,"defaultSetTimout");function Ss(){throw new Error("clearTimeout has not been defined")}s(Ss,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Qe=setTimeout:Qe=ws}catch{Qe=ws}try{typeof clearTimeout=="function"?Ze=clearTimeout:Ze=Ss}catch{Ze=Ss}})();function sf(e){if(Qe===setTimeout)return setTimeout(e,0);if((Qe===ws||!Qe)&&setTimeout)return Qe=setTimeout,setTimeout(e,0);try{return Qe(e,0)}catch{try{return Qe.call(null,e,0)}catch{return Qe.call(this,e,0)}}}s(sf,"runTimeout");function Am(e){if(Ze===clearTimeout)return clearTimeout(e);if((Ze===Ss||!Ze)&&clearTimeout)return Ze=clearTimeout,clearTimeout(e);try{return Ze(e)}catch{try{return Ze.call(null,e)}catch{return Ze.call(this,e)}}}s(Am,"runClearTimeout");var yt=[],vi=!1,Yt,dr=-1;function Om(){!vi||!Yt||(vi=!1,Yt.length?yt=Yt.concat(yt):dr=-1,yt.length&&af())}s(Om,"cleanUpNextTick");function af(){if(!vi){var e=sf(Om);vi=!0;for(var t=yt.length;t;){for(Yt=yt,yt=[];++dr<t;)Yt&&Yt[dr].run();dr=-1,t=yt.length}Yt=null,vi=!1,Am(e)}}s(af,"drainQueue");V.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)t[i-1]=arguments[i];yt.push(new cf(e,t)),yt.length===1&&!vi&&sf(af)};function cf(e,t){this.fun=e,this.array=t}s(cf,"Item");cf.prototype.run=function(){this.fun.apply(null,this.array)};V.title="browser";V.browser=!0;V.env={};V.argv=[];V.version="";V.versions={};function mt(){}s(mt,"noop");V.on=mt;V.addListener=mt;V.once=mt;V.off=mt;V.removeListener=mt;V.removeAllListeners=mt;V.emit=mt;V.prependListener=mt;V.prependOnceListener=mt;V.listeners=function(e){return[]};V.binding=function(e){throw new Error("process.binding is not supported")};V.cwd=function(){return"/"};V.chdir=function(e){throw new Error("process.chdir is not supported")};V.umask=function(){return 0}});var tt=T((Lx,kf)=>{"use strict";var{SymbolAsyncIterator:ff,SymbolIterator:uf,SymbolFor:Xt}=q(),df=Xt("nodejs.stream.destroyed"),hf=Xt("nodejs.stream.errored"),Es=Xt("nodejs.stream.readable"),_s=Xt("nodejs.stream.writable"),pf=Xt("nodejs.stream.disturbed"),Pm=Xt("nodejs.webstream.isClosedPromise"),Tm=Xt("nodejs.webstream.controllerErrorFunction");function hr(e,t=!1){var i;return!!(e&&typeof e.pipe=="function"&&typeof e.on=="function"&&(!t||typeof e.pause=="function"&&typeof e.resume=="function")&&(!e._writableState||((i=e._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!e._writableState||e._readableState))}s(hr,"isReadableNodeStream");function pr(e){var t;return!!(e&&typeof e.write=="function"&&typeof e.on=="function"&&(!e._readableState||((t=e._writableState)===null||t===void 0?void 0:t.writable)!==!1))}s(pr,"isWritableNodeStream");function Rm(e){return!!(e&&typeof e.pipe=="function"&&e._readableState&&typeof e.on=="function"&&typeof e.write=="function")}s(Rm,"isDuplexNodeStream");function et(e){return e&&(e._readableState||e._writableState||typeof e.write=="function"&&typeof e.on=="function"||typeof e.pipe=="function"&&typeof e.on=="function")}s(et,"isNodeStream");function yf(e){return!!(e&&!et(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"&&typeof e.cancel=="function")}s(yf,"isReadableStream");function mf(e){return!!(e&&!et(e)&&typeof e.getWriter=="function"&&typeof e.abort=="function")}s(mf,"isWritableStream");function bf(e){return!!(e&&!et(e)&&typeof e.readable=="object"&&typeof e.writable=="object")}s(bf,"isTransformStream");function Lm(e){return yf(e)||mf(e)||bf(e)}s(Lm,"isWebStream");function Nm(e,t){return e==null?!1:t===!0?typeof e[ff]=="function":t===!1?typeof e[uf]=="function":typeof e[ff]=="function"||typeof e[uf]=="function"}s(Nm,"isIterable");function yr(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!!(e.destroyed||e[df]||n!=null&&n.destroyed)}s(yr,"isDestroyed");function gf(e){if(!pr(e))return null;if(e.writableEnded===!0)return!0;let t=e._writableState;return t!=null&&t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(gf,"isWritableEnded");function Cm(e,t){if(!pr(e))return null;if(e.writableFinished===!0)return!0;let i=e._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||t===!1&&i.ended===!0&&i.length===0)}s(Cm,"isWritableFinished");function Bm(e){if(!hr(e))return null;if(e.readableEnded===!0)return!0;let t=e._readableState;return!t||t.errored?!1:typeof t?.ended!="boolean"?null:t.ended}s(Bm,"isReadableEnded");function wf(e,t){if(!hr(e))return null;let i=e._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||t===!1&&i.ended===!0&&i.length===0)}s(wf,"isReadableFinished");function Sf(e){return e&&e[Es]!=null?e[Es]:typeof e?.readable!="boolean"?null:yr(e)?!1:hr(e)&&e.readable&&!wf(e)}s(Sf,"isReadable");function Ef(e){return e&&e[_s]!=null?e[_s]:typeof e?.writable!="boolean"?null:yr(e)?!1:pr(e)&&e.writable&&!gf(e)}s(Ef,"isWritable");function Dm(e,t){return et(e)?yr(e)?!0:!(t?.readable!==!1&&Sf(e)||t?.writable!==!1&&Ef(e)):null}s(Dm,"isFinished");function Mm(e){var t,i;return et(e)?e.writableErrored?e.writableErrored:(t=(i=e._writableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Mm,"isWritableErrored");function Wm(e){var t,i;return et(e)?e.readableErrored?e.readableErrored:(t=(i=e._readableState)===null||i===void 0?void 0:i.errored)!==null&&t!==void 0?t:null:null}s(Wm,"isReadableErrored");function Um(e){if(!et(e))return null;if(typeof e.closed=="boolean")return e.closed;let t=e._writableState,i=e._readableState;return typeof t?.closed=="boolean"||typeof i?.closed=="boolean"?t?.closed||i?.closed:typeof e._closed=="boolean"&&_f(e)?e._closed:null}s(Um,"isClosed");function _f(e){return typeof e._closed=="boolean"&&typeof e._defaultKeepAlive=="boolean"&&typeof e._removedConnection=="boolean"&&typeof e._removedContLen=="boolean"}s(_f,"isOutgoingMessage");function xf(e){return typeof e._sent100=="boolean"&&_f(e)}s(xf,"isServerResponse");function jm(e){var t;return typeof e._consuming=="boolean"&&typeof e._dumped=="boolean"&&((t=e.req)===null||t===void 0?void 0:t.upgradeOrConnect)===void 0}s(jm,"isServerRequest");function qm(e){if(!et(e))return null;let t=e._writableState,i=e._readableState,n=t||i;return!n&&xf(e)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(qm,"willEmitClose");function $m(e){var t;return!!(e&&((t=e[pf])!==null&&t!==void 0?t:e.readableDidRead||e.readableAborted))}s($m,"isDisturbed");function zm(e){var t,i,n,r,o,a,c,l,f,d;return!!(e&&((t=(i=(n=(r=(o=(a=e[hf])!==null&&a!==void 0?a:e.readableErrored)!==null&&o!==void 0?o:e.writableErrored)!==null&&r!==void 0?r:(c=e._readableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&n!==void 0?n:(l=e._writableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&i!==void 0?i:(f=e._readableState)===null||f===void 0?void 0:f.errored)!==null&&t!==void 0?t:!((d=e._writableState)===null||d===void 0)&&d.errored))}s(zm,"isErrored");kf.exports={isDestroyed:yr,kIsDestroyed:df,isDisturbed:$m,kIsDisturbed:pf,isErrored:zm,kIsErrored:hf,isReadable:Sf,kIsReadable:Es,kIsClosedPromise:Pm,kControllerErrorFunction:Tm,kIsWritable:_s,isClosed:Um,isDuplexNodeStream:Rm,isFinished:Dm,isIterable:Nm,isReadableNodeStream:hr,isReadableStream:yf,isReadableEnded:Bm,isReadableFinished:wf,isReadableErrored:Wm,isNodeStream:et,isWebStream:Lm,isWritable:Ef,isWritableNodeStream:pr,isWritableStream:mf,isWritableEnded:gf,isWritableFinished:Cm,isWritableErrored:Mm,isServerRequest:jm,isServerResponse:xf,willEmitClose:qm,isTransformStream:bf}});var bt=T((Cx,Is)=>{var Tt=Pt(),{AbortError:Lf,codes:Vm}=ae(),{ERR_INVALID_ARG_TYPE:Hm,ERR_STREAM_PREMATURE_CLOSE:vf}=Vm,{kEmptyObject:ks,once:vs}=re(),{validateAbortSignal:Km,validateFunction:Gm,validateObject:Ym,validateBoolean:Xm}=ki(),{Promise:Jm,PromisePrototypeThen:Qm,SymbolDispose:Nf}=q(),{isClosed:Zm,isReadable:Ff,isReadableNodeStream:xs,isReadableStream:eb,isReadableFinished:If,isReadableErrored:Af,isWritable:Of,isWritableNodeStream:Pf,isWritableStream:tb,isWritableFinished:Tf,isWritableErrored:Rf,isNodeStream:ib,willEmitClose:nb,kIsClosedPromise:rb}=tt(),Fi;function ob(e){return e.setHeader&&typeof e.abort=="function"}s(ob,"isRequest");var Fs=s(()=>{},"nop");function Cf(e,t,i){var n,r;if(arguments.length===2?(i=t,t=ks):t==null?t=ks:Ym(t,"options"),Gm(i,"callback"),Km(t.signal,"options.signal"),i=vs(i),eb(e)||tb(e))return sb(e,t,i);if(!ib(e))throw new Hm("stream",["ReadableStream","WritableStream","Stream"],e);let o=(n=t.readable)!==null&&n!==void 0?n:xs(e),a=(r=t.writable)!==null&&r!==void 0?r:Pf(e),c=e._writableState,l=e._readableState,f=s(()=>{e.writable||b()},"onlegacyfinish"),d=nb(e)&&xs(e)===o&&Pf(e)===a,h=Tf(e,!1),b=s(()=>{h=!0,e.destroyed&&(d=!1),!(d&&(!e.readable||o))&&(!o||p)&&i.call(e)},"onfinish"),p=If(e,!1),w=s(()=>{p=!0,e.destroyed&&(d=!1),!(d&&(!e.writable||a))&&(!a||h)&&i.call(e)},"onend"),g=s(B=>{i.call(e,B)},"onerror"),A=Zm(e),k=s(()=>{A=!0;let B=Rf(e)||Af(e);if(B&&typeof B!="boolean")return i.call(e,B);if(o&&!p&&xs(e,!0)&&!If(e,!1))return i.call(e,new vf);if(a&&!h&&!Tf(e,!1))return i.call(e,new vf);i.call(e)},"onclose"),v=s(()=>{A=!0;let B=Rf(e)||Af(e);if(B&&typeof B!="boolean")return i.call(e,B);i.call(e)},"onclosed"),L=s(()=>{e.req.on("finish",b)},"onrequest");ob(e)?(e.on("complete",b),d||e.on("abort",k),e.req?L():e.on("request",L)):a&&!c&&(e.on("end",f),e.on("close",f)),!d&&typeof e.aborted=="boolean"&&e.on("aborted",k),e.on("end",w),e.on("finish",b),t.error!==!1&&e.on("error",g),e.on("close",k),A?Tt.nextTick(k):c!=null&&c.errorEmitted||l!=null&&l.errorEmitted?d||Tt.nextTick(v):(!o&&(!d||Ff(e))&&(h||Of(e)===!1)||!a&&(!d||Of(e))&&(p||Ff(e)===!1)||l&&e.req&&e.aborted)&&Tt.nextTick(v);let F=s(()=>{i=Fs,e.removeListener("aborted",k),e.removeListener("complete",b),e.removeListener("abort",k),e.removeListener("request",L),e.req&&e.req.removeListener("finish",b),e.removeListener("end",f),e.removeListener("close",f),e.removeListener("finish",b),e.removeListener("end",w),e.removeListener("error",g),e.removeListener("close",k)},"cleanup");if(t.signal&&!A){let B=s(()=>{let Bt=i;F(),Bt.call(e,new Lf(void 0,{cause:t.signal.reason}))},"abort");if(t.signal.aborted)Tt.nextTick(B);else{Fi=Fi||re().addAbortListener;let Bt=Fi(t.signal,B),Ee=i;i=vs((...si)=>{Bt[Nf](),Ee.apply(e,si)})}}return F}s(Cf,"eos");function sb(e,t,i){let n=!1,r=Fs;if(t.signal)if(r=s(()=>{n=!0,i.call(e,new Lf(void 0,{cause:t.signal.reason}))},"abort"),t.signal.aborted)Tt.nextTick(r);else{Fi=Fi||re().addAbortListener;let a=Fi(t.signal,r),c=i;i=vs((...l)=>{a[Nf](),c.apply(e,l)})}let o=s((...a)=>{n||Tt.nextTick(()=>i.apply(e,a))},"resolverFn");return Qm(e[rb].promise,o,o),Fs}s(sb,"eosWeb");function ab(e,t){var i;let n=!1;return t===null&&(t=ks),(i=t)!==null&&i!==void 0&&i.cleanup&&(Xm(t.cleanup,"cleanup"),n=t.cleanup),new Jm((r,o)=>{let a=Cf(e,t,c=>{n&&a(),c?o(c):r()})})}s(ab,"finished");Is.exports=Cf;Is.exports.finished=ab});var Jt=T((Dx,$f)=>{"use strict";var it=Pt(),{aggregateTwoErrors:cb,codes:{ERR_MULTIPLE_CALLBACK:lb},AbortError:fb}=ae(),{Symbol:Mf}=q(),{kIsDestroyed:ub,isDestroyed:db,isFinished:hb,isServerRequest:pb}=tt(),Wf=Mf("kDestroy"),As=Mf("kConstruct");function Uf(e,t,i){e&&(e.stack,t&&!t.errored&&(t.errored=e),i&&!i.errored&&(i.errored=e))}s(Uf,"checkError");function yb(e,t){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof t=="function"&&t(),this):(Uf(e,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Bf(this,e,t):this.once(Wf,function(o){Bf(this,cb(o,e),t)}),this)}s(yb,"destroy");function Bf(e,t,i){let n=!1;function r(o){if(n)return;n=!0;let a=e._readableState,c=e._writableState;Uf(o,c,a),c&&(c.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?it.nextTick(mb,e,o):it.nextTick(jf,e)}s(r,"onDestroy");try{e._destroy(t||null,r)}catch(o){r(o)}}s(Bf,"_destroy");function mb(e,t){Os(e,t),jf(e)}s(mb,"emitErrorCloseNT");function jf(e){let t=e._readableState,i=e._writableState;i&&(i.closeEmitted=!0),t&&(t.closeEmitted=!0),(i!=null&&i.emitClose||t!=null&&t.emitClose)&&e.emit("close")}s(jf,"emitCloseNT");function Os(e,t){let i=e._readableState,n=e._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),e.emit("error",t))}s(Os,"emitErrorNT");function bb(){let e=this._readableState,t=this._writableState;e&&(e.constructed=!0,e.closed=!1,e.closeEmitted=!1,e.destroyed=!1,e.errored=null,e.errorEmitted=!1,e.reading=!1,e.ended=e.readable===!1,e.endEmitted=e.readable===!1),t&&(t.constructed=!0,t.destroyed=!1,t.closed=!1,t.closeEmitted=!1,t.errored=null,t.errorEmitted=!1,t.finalCalled=!1,t.prefinished=!1,t.ended=t.writable===!1,t.ending=t.writable===!1,t.finished=t.writable===!1)}s(bb,"undestroy");function Ps(e,t,i){let n=e._readableState,r=e._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?e.destroy(t):t&&(t.stack,r&&!r.errored&&(r.errored=t),n&&!n.errored&&(n.errored=t),i?it.nextTick(Os,e,t):Os(e,t))}s(Ps,"errorOrDestroy");function gb(e,t){if(typeof e._construct!="function")return;let i=e._readableState,n=e._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),e.once(As,t),!(e.listenerCount(As)>1)&&it.nextTick(wb,e)}s(gb,"construct");function wb(e){let t=!1;function i(n){if(t){Ps(e,n??new lb);return}t=!0;let r=e._readableState,o=e._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?e.emit(Wf,n):n?Ps(e,n,!0):it.nextTick(Sb,e)}s(i,"onConstruct");try{e._construct(n=>{it.nextTick(i,n)})}catch(n){it.nextTick(i,n)}}s(wb,"constructNT");function Sb(e){e.emit(As)}s(Sb,"emitConstructNT");function Df(e){return e?.setHeader&&typeof e.abort=="function"}s(Df,"isRequest");function qf(e){e.emit("close")}s(qf,"emitCloseLegacy");function Eb(e,t){e.emit("error",t),it.nextTick(qf,e)}s(Eb,"emitErrorCloseLegacy");function _b(e,t){!e||db(e)||(!t&&!hb(e)&&(t=new fb),pb(e)?(e.socket=null,e.destroy(t)):Df(e)?e.abort():Df(e.req)?e.req.abort():typeof e.destroy=="function"?e.destroy(t):typeof e.close=="function"?e.close():t?it.nextTick(Eb,e,t):it.nextTick(qf,e),e.destroyed||(e[ub]=!0))}s(_b,"destroyer");$f.exports={construct:gb,destroyer:_b,destroy:yb,undestroy:bb,errorOrDestroy:Ps}});var gr=T((Wx,Vf)=>{"use strict";var{ArrayIsArray:xb,ObjectSetPrototypeOf:zf}=q(),{EventEmitter:mr}=gn();function br(e){mr.call(this,e)}s(br,"Stream");zf(br.prototype,mr.prototype);zf(br,mr);br.prototype.pipe=function(e,t){let i=this;function n(d){e.writable&&e.write(d)===!1&&i.pause&&i.pause()}s(n,"ondata"),i.on("data",n);function r(){i.readable&&i.resume&&i.resume()}s(r,"ondrain"),e.on("drain",r),!e._isStdio&&(!t||t.end!==!1)&&(i.on("end",a),i.on("close",c));let o=!1;function a(){o||(o=!0,e.end())}s(a,"onend");function c(){o||(o=!0,typeof e.destroy=="function"&&e.destroy())}s(c,"onclose");function l(d){f(),mr.listenerCount(this,"error")===0&&this.emit("error",d)}s(l,"onerror"),Ts(i,"error",l),Ts(e,"error",l);function f(){i.removeListener("data",n),e.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",c),i.removeListener("error",l),e.removeListener("error",l),i.removeListener("end",f),i.removeListener("close",f),e.removeListener("close",f)}return s(f,"cleanup"),i.on("end",f),i.on("close",f),e.on("close",f),e.emit("pipe",i),e};function Ts(e,t,i){if(typeof e.prependListener=="function")return e.prependListener(t,i);!e._events||!e._events[t]?e.on(t,i):xb(e._events[t])?e._events[t].unshift(i):e._events[t]=[i,e._events[t]]}s(Ts,"prependListener");Vf.exports={Stream:br,prependListener:Ts}});var wn=T((jx,wr)=>{"use strict";var{SymbolDispose:kb}=q(),{AbortError:Hf,codes:vb}=ae(),{isNodeStream:Kf,isWebStream:Fb,kControllerErrorFunction:Ib}=tt(),Ab=bt(),{ERR_INVALID_ARG_TYPE:Gf}=vb,Rs,Ob=s((e,t)=>{if(typeof e!="object"||!("aborted"in e))throw new Gf(t,"AbortSignal",e)},"validateAbortSignal");wr.exports.addAbortSignal=s(function(t,i){if(Ob(t,"signal"),!Kf(i)&&!Fb(i))throw new Gf("stream",["ReadableStream","WritableStream","Stream"],i);return wr.exports.addAbortSignalNoValidate(t,i)},"addAbortSignal");wr.exports.addAbortSignalNoValidate=function(e,t){if(typeof e!="object"||!("aborted"in e))return t;let i=Kf(t)?()=>{t.destroy(new Hf(void 0,{cause:e.reason}))}:()=>{t[Ib](new Hf(void 0,{cause:e.reason}))};if(e.aborted)i();else{Rs=Rs||re().addAbortListener;let n=Rs(e,i);Ab(t,n[kb])}return t}});var Jf=T(($x,Xf)=>{"use strict";var{StringPrototypeSlice:Yf,SymbolIterator:Pb,TypedArrayPrototypeSet:Sr,Uint8Array:Tb}=q(),{Buffer:Ls}=Ie(),{inspect:Rb}=re(),Ii;Xf.exports=(Ii=class{constructor(){this.head=null,this.tail=null,this.length=0}push(t){let i={data:t,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(t){let i={data:t,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let t=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,t}clear(){this.head=this.tail=null,this.length=0}join(t){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=t+i.data;return n}concat(t){if(this.length===0)return Ls.alloc(0);let i=Ls.allocUnsafe(t>>>0),n=this.head,r=0;for(;n;)Sr(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(t,i){let n=this.head.data;if(t<n.length){let r=n.slice(0,t);return this.head.data=n.slice(t),r}return t===n.length?this.shift():i?this._getString(t):this._getBuffer(t)}first(){return this.head.data}*[Pb](){for(let t=this.head;t;t=t.next)yield t.data}_getString(t){let i="",n=this.head,r=0;do{let o=n.data;if(t>o.length)i+=o,t-=o.length;else{t===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Yf(o,0,t),this.head=n,n.data=Yf(o,t));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(t){let i=Ls.allocUnsafe(t),n=t,r=this.head,o=0;do{let a=r.data;if(t>a.length)Sr(i,a,n-t),t-=a.length;else{t===a.length?(Sr(i,a,n-t),++o,r.next?this.head=r.next:this.head=this.tail=null):(Sr(i,new Tb(a.buffer,a.byteOffset,t),n-t),this.head=r,r.data=a.slice(t));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](t,i){return Rb(this,{...i,depth:0,customInspect:!1})}},s(Ii,"BufferList"),Ii)});var Sn=T((Vx,tu)=>{"use strict";var{MathFloor:Lb,NumberIsInteger:Nb}=q(),{validateInteger:Cb}=ki(),{ERR_INVALID_ARG_VALUE:Bb}=ae().codes,Qf=16*1024,Zf=16;function Db(e,t,i){return e.highWaterMark!=null?e.highWaterMark:t?e[i]:null}s(Db,"highWaterMarkFrom");function eu(e){return e?Zf:Qf}s(eu,"getDefaultHighWaterMark");function Mb(e,t){Cb(t,"value",0),e?Zf=t:Qf=t}s(Mb,"setDefaultHighWaterMark");function Wb(e,t,i,n){let r=Db(t,n,i);if(r!=null){if(!Nb(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Bb(o,r)}return Lb(r)}return eu(e.objectMode)}s(Wb,"getHighWaterMark");tu.exports={getHighWaterMark:Wb,getDefaultHighWaterMark:eu,setDefaultHighWaterMark:Mb}});var ru=T((Ns,nu)=>{var Er=Ie(),nt=Er.Buffer;function iu(e,t){for(var i in e)t[i]=e[i]}s(iu,"copyProps");nt.from&&nt.alloc&&nt.allocUnsafe&&nt.allocUnsafeSlow?nu.exports=Er:(iu(Er,Ns),Ns.Buffer=Qt);function Qt(e,t,i){return nt(e,t,i)}s(Qt,"SafeBuffer");Qt.prototype=Object.create(nt.prototype);iu(nt,Qt);Qt.from=function(e,t,i){if(typeof e=="number")throw new TypeError("Argument must not be a number");return nt(e,t,i)};Qt.alloc=function(e,t,i){if(typeof e!="number")throw new TypeError("Argument must be a number");var n=nt(e);return t!==void 0?typeof i=="string"?n.fill(t,i):n.fill(t):n.fill(0),n};Qt.allocUnsafe=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return nt(e)};Qt.allocUnsafeSlow=function(e){if(typeof e!="number")throw new TypeError("Argument must be a number");return Er.SlowBuffer(e)}});var au=T(su=>{"use strict";var Bs=ru().Buffer,ou=Bs.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ub(e){if(!e)return"utf8";for(var t;;)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}s(Ub,"_normalizeEncoding");function jb(e){var t=Ub(e);if(typeof t!="string"&&(Bs.isEncoding===ou||!ou(e)))throw new Error("Unknown encoding: "+e);return t||e}s(jb,"normalizeEncoding");su.StringDecoder=En;function En(e){this.encoding=jb(e);var t;switch(this.encoding){case"utf16le":this.text=Kb,this.end=Gb,t=4;break;case"utf8":this.fillLast=zb,t=4;break;case"base64":this.text=Yb,this.end=Xb,t=3;break;default:this.write=Jb,this.end=Qb;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Bs.allocUnsafe(t)}s(En,"StringDecoder");En.prototype.write=function(e){if(e.length===0)return"";var t,i;if(this.lastNeed){if(t=this.fillLast(e),t===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<e.length?t?t+this.text(e,i):this.text(e,i):t||""};En.prototype.end=Hb;En.prototype.text=Vb;En.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length};function Cs(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}s(Cs,"utf8CheckByte");function qb(e,t,i){var n=t.length-1;if(n<i)return 0;var r=Cs(t[n]);return r>=0?(r>0&&(e.lastNeed=r-1),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(e.lastNeed=r-2),r):--n<i||r===-2?0:(r=Cs(t[n]),r>=0?(r>0&&(r===2?r=0:e.lastNeed=r-3),r):0))}s(qb,"utf8CheckIncomplete");function $b(e,t,i){if((t[0]&192)!==128)return e.lastNeed=0,"\uFFFD";if(e.lastNeed>1&&t.length>1){if((t[1]&192)!==128)return e.lastNeed=1,"\uFFFD";if(e.lastNeed>2&&t.length>2&&(t[2]&192)!==128)return e.lastNeed=2,"\uFFFD"}}s($b,"utf8CheckExtraBytes");function zb(e){var t=this.lastTotal-this.lastNeed,i=$b(this,e,t);if(i!==void 0)return i;if(this.lastNeed<=e.length)return e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,t,0,e.length),this.lastNeed-=e.length}s(zb,"utf8FillLast");function Vb(e,t){var i=qb(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=i;var n=e.length-(i-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}s(Vb,"utf8Text");function Hb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"\uFFFD":t}s(Hb,"utf8End");function Kb(e,t){if((e.length-t)%2===0){var i=e.toString("utf16le",t);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}s(Kb,"utf16Text");function Gb(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,i)}return t}s(Gb,"utf16End");function Yb(e,t){var i=(e.length-t)%3;return i===0?e.toString("base64",t):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-i))}s(Yb,"base64Text");function Xb(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}s(Xb,"base64End");function Jb(e){return e.toString(this.encoding)}s(Jb,"simpleWrite");function Qb(e){return e&&e.length?this.write(e):""}s(Qb,"simpleEnd")});var Ds=T((Xx,uu)=>{"use strict";var cu=Pt(),{PromisePrototypeThen:Zb,SymbolAsyncIterator:lu,SymbolIterator:fu}=q(),{Buffer:eg}=Ie(),{ERR_INVALID_ARG_TYPE:tg,ERR_STREAM_NULL_VALUES:ig}=ae().codes;function ng(e,t,i){let n;if(typeof t=="string"||t instanceof eg)return new e({objectMode:!0,...i,read:s(function(){this.push(t),this.push(null)},"read")});let r;if(t&&t[lu])r=!0,n=t[lu]();else if(t&&t[fu])r=!1,n=t[fu]();else throw new tg("iterable",["Iterable"],t);let o=new e({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,l())},o._destroy=function(f,d){Zb(c(f),()=>cu.nextTick(d,f),h=>cu.nextTick(d,h||f))};async function c(f){let d=f!=null,h=typeof n.throw=="function";if(d&&h){let{value:b,done:p}=await n.throw(f);if(await b,p)return}if(typeof n.return=="function"){let{value:b}=await n.return();await b}}s(c,"close");async function l(){for(;;){try{let{value:f,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=f&&typeof f.then=="function"?await f:f;if(h===null)throw a=!1,new ig;if(o.push(h))continue;a=!1}}catch(f){o.destroy(f)}break}}return s(l,"next"),o}s(ng,"from");uu.exports=ng});var xn=T((Qx,Ou)=>{var Me=Pt(),{ArrayPrototypeIndexOf:rg,NumberIsInteger:og,NumberIsNaN:sg,NumberParseInt:ag,ObjectDefineProperties:Vs,ObjectKeys:cg,ObjectSetPrototypeOf:pu,Promise:yu,SafeSet:lg,SymbolAsyncDispose:fg,SymbolAsyncIterator:ug,Symbol:dg}=q();Ou.exports=O;O.ReadableState=vr;var{EventEmitter:hg}=gn(),{Stream:Rt,prependListener:pg}=gr(),{Buffer:Ms}=Ie(),{addAbortSignal:yg}=wn(),mu=bt(),P=re().debuglog("stream",e=>{P=e}),mg=Jf(),Pi=Jt(),{getHighWaterMark:bg,getDefaultHighWaterMark:gg}=Sn(),{aggregateTwoErrors:du,codes:{ERR_INVALID_ARG_TYPE:wg,ERR_METHOD_NOT_IMPLEMENTED:Sg,ERR_OUT_OF_RANGE:Eg,ERR_STREAM_PUSH_AFTER_EOF:_g,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:xg},AbortError:kg}=ae(),{validateObject:vg}=ki(),Zt=dg("kPaused"),{StringDecoder:bu}=au(),Fg=Ds();pu(O.prototype,Rt.prototype);pu(O,Rt);var Ws=s(()=>{},"nop"),{errorOrDestroy:Ai}=Pi,Oi=1,Ig=2,gu=4,_n=8,wu=16,_r=32,xr=64,Su=128,Ag=256,Og=512,Pg=1024,$s=2048,zs=4096,Tg=8192,Rg=16384,Lg=32768,Eu=65536,Ng=1<<17,Cg=1<<18;function J(e){return{enumerable:!1,get:s(function(){return(this.state&e)!==0},"get"),set:s(function(t){t?this.state|=e:this.state&=~e},"set")}}s(J,"makeBitMapDescriptor");Vs(vr.prototype,{objectMode:J(Oi),ended:J(Ig),endEmitted:J(gu),reading:J(_n),constructed:J(wu),sync:J(_r),needReadable:J(xr),emittedReadable:J(Su),readableListening:J(Ag),resumeScheduled:J(Og),errorEmitted:J(Pg),emitClose:J($s),autoDestroy:J(zs),destroyed:J(Tg),closed:J(Rg),closeEmitted:J(Lg),multiAwaitDrain:J(Eu),readingMore:J(Ng),dataEmitted:J(Cg)});function vr(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.state=$s|zs|wu|_r,e&&e.objectMode&&(this.state|=Oi),i&&e&&e.readableObjectMode&&(this.state|=Oi),this.highWaterMark=e?bg(this,e,"readableHighWaterMark",i):gg(!1),this.buffer=new mg,this.length=0,this.pipes=[],this.flowing=null,this[Zt]=null,e&&e.emitClose===!1&&(this.state&=~$s),e&&e.autoDestroy===!1&&(this.state&=~zs),this.errored=null,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,e&&e.encoding&&(this.decoder=new bu(e.encoding),this.encoding=e.encoding)}s(vr,"ReadableState");function O(e){if(!(this instanceof O))return new O(e);let t=this instanceof rt();this._readableState=new vr(e,this,t),e&&(typeof e.read=="function"&&(this._read=e.read),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&!t&&yg(e.signal,this)),Rt.call(this,e),Pi.construct(this,()=>{this._readableState.needReadable&&kr(this,this._readableState)})}s(O,"Readable");O.prototype.destroy=Pi.destroy;O.prototype._undestroy=Pi.undestroy;O.prototype._destroy=function(e,t){t(e)};O.prototype[hg.captureRejectionSymbol]=function(e){this.destroy(e)};O.prototype[fg]=function(){let e;return this.destroyed||(e=this.readableEnded?null:new kg,this.destroy(e)),new yu((t,i)=>mu(this,n=>n&&n!==e?i(n):t(null)))};O.prototype.push=function(e,t){return _u(this,e,t,!1)};O.prototype.unshift=function(e,t){return _u(this,e,t,!0)};function _u(e,t,i,n){P("readableAddChunk",t);let r=e._readableState,o;if(r.state&Oi||(typeof t=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?t=Ms.from(t,i).toString(r.encoding):(t=Ms.from(t,i),i=""))):t instanceof Ms?i="":Rt._isUint8Array(t)?(t=Rt._uint8ArrayToBuffer(t),i=""):t!=null&&(o=new wg("chunk",["string","Buffer","Uint8Array"],t))),o)Ai(e,o);else if(t===null)r.state&=~_n,Mg(e,r);else if(r.state&Oi||t&&t.length>0)if(n)if(r.state&gu)Ai(e,new xg);else{if(r.destroyed||r.errored)return!1;Us(e,r,t,!0)}else if(r.ended)Ai(e,new _g);else{if(r.destroyed||r.errored)return!1;r.state&=~_n,r.decoder&&!i?(t=r.decoder.write(t),r.objectMode||t.length!==0?Us(e,r,t,!1):kr(e,r)):Us(e,r,t,!1)}else n||(r.state&=~_n,kr(e,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(_u,"readableAddChunk");function Us(e,t,i,n){t.flowing&&t.length===0&&!t.sync&&e.listenerCount("data")>0?(t.state&Eu?t.awaitDrainWriters.clear():t.awaitDrainWriters=null,t.dataEmitted=!0,e.emit("data",i)):(t.length+=t.objectMode?1:i.length,n?t.buffer.unshift(i):t.buffer.push(i),t.state&xr&&Fr(e)),kr(e,t)}s(Us,"addChunk");O.prototype.isPaused=function(){let e=this._readableState;return e[Zt]===!0||e.flowing===!1};O.prototype.setEncoding=function(e){let t=new bu(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=t.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Bg=1073741824;function Dg(e){if(e>Bg)throw new Eg("size","<= 1GiB",e);return e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++,e}s(Dg,"computeNewHighWaterMark");function hu(e,t){return e<=0||t.length===0&&t.ended?0:t.state&Oi?1:sg(e)?t.flowing&&t.length?t.buffer.first().length:t.length:e<=t.length?e:t.ended?t.length:0}s(hu,"howMuchToRead");O.prototype.read=function(e){P("read",e),e===void 0?e=NaN:og(e)||(e=ag(e,10));let t=this._readableState,i=e;if(e>t.highWaterMark&&(t.highWaterMark=Dg(e)),e!==0&&(t.state&=~Su),e===0&&t.needReadable&&((t.highWaterMark!==0?t.length>=t.highWaterMark:t.length>0)||t.ended))return P("read: emitReadable",t.length,t.ended),t.length===0&&t.ended?js(this):Fr(this),null;if(e=hu(e,t),e===0&&t.ended)return t.length===0&&js(this),null;let n=(t.state&xr)!==0;if(P("need readable",n),(t.length===0||t.length-e<t.highWaterMark)&&(n=!0,P("length less than watermark",n)),t.ended||t.reading||t.destroyed||t.errored||!t.constructed)n=!1,P("reading, ended or constructing",n);else if(n){P("do read"),t.state|=_n|_r,t.length===0&&(t.state|=xr);try{this._read(t.highWaterMark)}catch(o){Ai(this,o)}t.state&=~_r,t.reading||(e=hu(i,t))}let r;return e>0?r=Iu(e,t):r=null,r===null?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.multiAwaitDrain?t.awaitDrainWriters.clear():t.awaitDrainWriters=null),t.length===0&&(t.ended||(t.needReadable=!0),i!==e&&t.ended&&js(this)),r!==null&&!t.errorEmitted&&!t.closeEmitted&&(t.dataEmitted=!0,this.emit("data",r)),r};function Mg(e,t){if(P("onEofChunk"),!t.ended){if(t.decoder){let i=t.decoder.end();i&&i.length&&(t.buffer.push(i),t.length+=t.objectMode?1:i.length)}t.ended=!0,t.sync?Fr(e):(t.needReadable=!1,t.emittedReadable=!0,xu(e))}}s(Mg,"onEofChunk");function Fr(e){let t=e._readableState;P("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(P("emitReadable",t.flowing),t.emittedReadable=!0,Me.nextTick(xu,e))}s(Fr,"emitReadable");function xu(e){let t=e._readableState;P("emitReadable_",t.destroyed,t.length,t.ended),!t.destroyed&&!t.errored&&(t.length||t.ended)&&(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,vu(e)}s(xu,"emitReadable_");function kr(e,t){!t.readingMore&&t.constructed&&(t.readingMore=!0,Me.nextTick(Wg,e,t))}s(kr,"maybeReadMore");function Wg(e,t){for(;!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&t.length===0);){let i=t.length;if(P("maybeReadMore read 0"),e.read(0),i===t.length)break}t.readingMore=!1}s(Wg,"maybeReadMore_");O.prototype._read=function(e){throw new Sg("_read()")};O.prototype.pipe=function(e,t){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new lg(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(e),P("pipe count=%d opts=%j",n.pipes.length,t);let o=(!t||t.end!==!1)&&e!==Me.stdout&&e!==Me.stderr?c:A;n.endEmitted?Me.nextTick(o):i.once("end",o),e.on("unpipe",a);function a(k,v){P("onunpipe"),k===i&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,d())}s(a,"onunpipe");function c(){P("onend"),e.end()}s(c,"onend");let l,f=!1;function d(){P("cleanup"),e.removeListener("close",w),e.removeListener("finish",g),l&&e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),i.removeListener("end",c),i.removeListener("end",A),i.removeListener("data",b),f=!0,l&&n.awaitDrainWriters&&(!e._writableState||e._writableState.needDrain)&&l()}s(d,"cleanup");function h(){f||(n.pipes.length===1&&n.pipes[0]===e?(P("false write response, pause",0),n.awaitDrainWriters=e,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(e)&&(P("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(e)),i.pause()),l||(l=Ug(i,e),e.on("drain",l))}s(h,"pause"),i.on("data",b);function b(k){P("ondata");let v=e.write(k);P("dest.write",v),v===!1&&h()}s(b,"ondata");function p(k){if(P("onerror",k),A(),e.removeListener("error",p),e.listenerCount("error")===0){let v=e._writableState||e._readableState;v&&!v.errorEmitted?Ai(e,k):e.emit("error",k)}}s(p,"onerror"),pg(e,"error",p);function w(){e.removeListener("finish",g),A()}s(w,"onclose"),e.once("close",w);function g(){P("onfinish"),e.removeListener("close",w),A()}s(g,"onfinish"),e.once("finish",g);function A(){P("unpipe"),i.unpipe(e)}return s(A,"unpipe"),e.emit("pipe",i),e.writableNeedDrain===!0?h():n.flowing||(P("pipe resume"),i.resume()),e};function Ug(e,t){return s(function(){let n=e._readableState;n.awaitDrainWriters===t?(P("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(P("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(t)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&e.listenerCount("data")&&e.resume()},"pipeOnDrainFunctionResult")}s(Ug,"pipeOnDrain");O.prototype.unpipe=function(e){let t=this._readableState,i={hasUnpiped:!1};if(t.pipes.length===0)return this;if(!e){let r=t.pipes;t.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=rg(t.pipes,e);return n===-1?this:(t.pipes.splice(n,1),t.pipes.length===0&&this.pause(),e.emit("unpipe",this,i),this)};O.prototype.on=function(e,t){let i=Rt.prototype.on.call(this,e,t),n=this._readableState;return e==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):e==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,P("on readable",n.length,n.reading),n.length?Fr(this):n.reading||Me.nextTick(jg,this)),i};O.prototype.addListener=O.prototype.on;O.prototype.removeListener=function(e,t){let i=Rt.prototype.removeListener.call(this,e,t);return e==="readable"&&Me.nextTick(ku,this),i};O.prototype.off=O.prototype.removeListener;O.prototype.removeAllListeners=function(e){let t=Rt.prototype.removeAllListeners.apply(this,arguments);return(e==="readable"||e===void 0)&&Me.nextTick(ku,this),t};function ku(e){let t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&t[Zt]===!1?t.flowing=!0:e.listenerCount("data")>0?e.resume():t.readableListening||(t.flowing=null)}s(ku,"updateReadableListening");function jg(e){P("readable nexttick read 0"),e.read(0)}s(jg,"nReadingNextTick");O.prototype.resume=function(){let e=this._readableState;return e.flowing||(P("resume"),e.flowing=!e.readableListening,qg(this,e)),e[Zt]=!1,this};function qg(e,t){t.resumeScheduled||(t.resumeScheduled=!0,Me.nextTick($g,e,t))}s(qg,"resume");function $g(e,t){P("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),vu(e),t.flowing&&!t.reading&&e.read(0)}s($g,"resume_");O.prototype.pause=function(){return P("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(P("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Zt]=!0,this};function vu(e){let t=e._readableState;for(P("flow",t.flowing);t.flowing&&e.read()!==null;);}s(vu,"flow");O.prototype.wrap=function(e){let t=!1;e.on("data",n=>{!this.push(n)&&e.pause&&(t=!0,e.pause())}),e.on("end",()=>{this.push(null)}),e.on("error",n=>{Ai(this,n)}),e.on("close",()=>{this.destroy()}),e.on("destroy",()=>{this.destroy()}),this._read=()=>{t&&e.resume&&(t=!1,e.resume())};let i=cg(e);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof e[r]=="function"&&(this[r]=e[r].bind(e))}return this};O.prototype[ug]=function(){return Fu(this)};O.prototype.iterator=function(e){return e!==void 0&&vg(e,"options"),Fu(this,e)};function Fu(e,t){typeof e.read!="function"&&(e=O.wrap(e,{objectMode:!0}));let i=zg(e,t);return i.stream=e,i}s(Fu,"streamToAsyncIterator");async function*zg(e,t){let i=Ws;function n(a){this===e?(i(),i=Ws):i=a}s(n,"next"),e.on("readable",n);let r,o=mu(e,{writable:!1},a=>{r=a?du(r,a):null,i(),i=Ws});try{for(;;){let a=e.destroyed?null:e.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new yu(n)}}}catch(a){throw r=du(r,a),r}finally{(r||t?.destroyOnReturn!==!1)&&(r===void 0||e._readableState.autoDestroy)?Pi.destroyer(e,null):(e.off("readable",n),o())}}s(zg,"createAsyncIterator");Vs(O.prototype,{readable:{__proto__:null,get:s(function(){let e=this._readableState;return!!e&&e.readable!==!1&&!e.destroyed&&!e.errorEmitted&&!e.endEmitted},"get"),set:s(function(e){this._readableState&&(this._readableState.readable=!!e)},"set")},readableDidRead:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.dataEmitted},"get")},readableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)},"get")},readableHighWaterMark:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.highWaterMark},"get")},readableBuffer:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState&&this._readableState.buffer},"get")},readableFlowing:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.flowing},"get"),set:s(function(e){this._readableState&&(this._readableState.flowing=e)},"set")},readableLength:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState.length},"get")},readableObjectMode:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.objectMode:!1},"get")},readableEncoding:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.encoding:null},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.errored:null},"get")},closed:{__proto__:null,get:s(function(){return this._readableState?this._readableState.closed:!1},"get")},destroyed:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.destroyed:!1},"get"),set:s(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")},readableEnded:{__proto__:null,enumerable:!1,get:s(function(){return this._readableState?this._readableState.endEmitted:!1},"get")}});Vs(vr.prototype,{pipesCount:{__proto__:null,get:s(function(){return this.pipes.length},"get")},paused:{__proto__:null,get:s(function(){return this[Zt]!==!1},"get"),set:s(function(e){this[Zt]=!!e},"set")}});O._fromList=Iu;function Iu(e,t){if(t.length===0)return null;let i;return t.objectMode?i=t.buffer.shift():!e||e>=t.length?(t.decoder?i=t.buffer.join(""):t.buffer.length===1?i=t.buffer.first():i=t.buffer.concat(t.length),t.buffer.clear()):i=t.buffer.consume(e,t.decoder),i}s(Iu,"fromList");function js(e){let t=e._readableState;P("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,Me.nextTick(Vg,t,e))}s(js,"endReadable");function Vg(e,t){if(P("endReadableNT",e.endEmitted,e.length),!e.errored&&!e.closeEmitted&&!e.endEmitted&&e.length===0){if(e.endEmitted=!0,t.emit("end"),t.writable&&t.allowHalfOpen===!1)Me.nextTick(Hg,t);else if(e.autoDestroy){let i=t._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&t.destroy()}}}s(Vg,"endReadableNT");function Hg(e){e.writable&&!e.writableEnded&&!e.destroyed&&e.end()}s(Hg,"endWritableNT");O.from=function(e,t){return Fg(O,e,t)};var qs;function Au(){return qs===void 0&&(qs={}),qs}s(Au,"lazyWebStreams");O.fromWeb=function(e,t){return Au().newStreamReadableFromReadableStream(e,t)};O.toWeb=function(e,t){return Au().newReadableStreamFromStreamReadable(e,t)};O.wrap=function(e,t){var i,n;return new O({objectMode:(i=(n=e.readableObjectMode)!==null&&n!==void 0?n:e.objectMode)!==null&&i!==void 0?i:!0,...t,destroy:s(function(r,o){Pi.destroyer(e,r),o(r)},"destroy")}).wrap(e)}});var Tr=T((e0,ju)=>{var ei=Pt(),{ArrayPrototypeSlice:Ru,Error:Kg,FunctionPrototypeSymbolHasInstance:Lu,ObjectDefineProperty:Nu,ObjectDefineProperties:Gg,ObjectSetPrototypeOf:Cu,StringPrototypeToLowerCase:Yg,Symbol:Xg,SymbolHasInstance:Jg}=q();ju.exports=$;$.WritableState=Fn;var{EventEmitter:Qg}=gn(),kn=gr().Stream,{Buffer:Ir}=Ie(),Pr=Jt(),{addAbortSignal:Zg}=wn(),{getHighWaterMark:ew,getDefaultHighWaterMark:tw}=Sn(),{ERR_INVALID_ARG_TYPE:iw,ERR_METHOD_NOT_IMPLEMENTED:nw,ERR_MULTIPLE_CALLBACK:Bu,ERR_STREAM_CANNOT_PIPE:rw,ERR_STREAM_DESTROYED:vn,ERR_STREAM_ALREADY_FINISHED:ow,ERR_STREAM_NULL_VALUES:sw,ERR_STREAM_WRITE_AFTER_END:aw,ERR_UNKNOWN_ENCODING:Du}=ae().codes,{errorOrDestroy:Ti}=Pr;Cu($.prototype,kn.prototype);Cu($,kn);function Gs(){}s(Gs,"nop");var Ri=Xg("kOnFinished");function Fn(e,t,i){typeof i!="boolean"&&(i=t instanceof rt()),this.objectMode=!!(e&&e.objectMode),i&&(this.objectMode=this.objectMode||!!(e&&e.writableObjectMode)),this.highWaterMark=e?ew(this,e,"writableHighWaterMark",i):tw(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(e&&e.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=e&&e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=lw.bind(void 0,t),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,Or(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!e||e.emitClose!==!1,this.autoDestroy=!e||e.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[Ri]=[]}s(Fn,"WritableState");function Or(e){e.buffered=[],e.bufferedIndex=0,e.allBuffers=!0,e.allNoop=!0}s(Or,"resetBuffer");Fn.prototype.getBuffer=s(function(){return Ru(this.buffered,this.bufferedIndex)},"getBuffer");Nu(Fn.prototype,"bufferedRequestCount",{__proto__:null,get:s(function(){return this.buffered.length-this.bufferedIndex},"get")});function $(e){let t=this instanceof rt();if(!t&&!Lu($,this))return new $(e);this._writableState=new Fn(e,this,t),e&&(typeof e.write=="function"&&(this._write=e.write),typeof e.writev=="function"&&(this._writev=e.writev),typeof e.destroy=="function"&&(this._destroy=e.destroy),typeof e.final=="function"&&(this._final=e.final),typeof e.construct=="function"&&(this._construct=e.construct),e.signal&&Zg(e.signal,this)),kn.call(this,e),Pr.construct(this,()=>{let i=this._writableState;i.writing||Xs(this,i),Js(this,i)})}s($,"Writable");Nu($,Jg,{__proto__:null,value:s(function(e){return Lu(this,e)?!0:this!==$?!1:e&&e._writableState instanceof Fn},"value")});$.prototype.pipe=function(){Ti(this,new rw)};function Mu(e,t,i,n){let r=e._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!Ir.isEncoding(i))throw new Du(i);typeof n!="function"&&(n=Gs)}if(t===null)throw new sw;if(!r.objectMode)if(typeof t=="string")r.decodeStrings!==!1&&(t=Ir.from(t,i),i="buffer");else if(t instanceof Ir)i="buffer";else if(kn._isUint8Array(t))t=kn._uint8ArrayToBuffer(t),i="buffer";else throw new iw("chunk",["string","Buffer","Uint8Array"],t);let o;return r.ending?o=new aw:r.destroyed&&(o=new vn("write")),o?(ei.nextTick(n,o),Ti(e,o,!0),o):(r.pendingcb++,cw(e,r,t,i,n))}s(Mu,"_write");$.prototype.write=function(e,t,i){return Mu(this,e,t,i)===!0};$.prototype.cork=function(){this._writableState.corked++};$.prototype.uncork=function(){let e=this._writableState;e.corked&&(e.corked--,e.writing||Xs(this,e))};$.prototype.setDefaultEncoding=s(function(t){if(typeof t=="string"&&(t=Yg(t)),!Ir.isEncoding(t))throw new Du(t);return this._writableState.defaultEncoding=t,this},"setDefaultEncoding");function cw(e,t,i,n,r){let o=t.objectMode?1:i.length;t.length+=o;let a=t.length<t.highWaterMark;return a||(t.needDrain=!0),t.writing||t.corked||t.errored||!t.constructed?(t.buffered.push({chunk:i,encoding:n,callback:r}),t.allBuffers&&n!=="buffer"&&(t.allBuffers=!1),t.allNoop&&r!==Gs&&(t.allNoop=!1)):(t.writelen=o,t.writecb=r,t.writing=!0,t.sync=!0,e._write(i,n,t.onwrite),t.sync=!1),a&&!t.errored&&!t.destroyed}s(cw,"writeOrBuffer");function Pu(e,t,i,n,r,o,a){t.writelen=n,t.writecb=a,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new vn("write")):i?e._writev(r,t.onwrite):e._write(r,o,t.onwrite),t.sync=!1}s(Pu,"doWrite");function Tu(e,t,i,n){--t.pendingcb,n(i),Ys(t),Ti(e,i)}s(Tu,"onwriteError");function lw(e,t){let i=e._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){Ti(e,new Bu);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,t?(t.stack,i.errored||(i.errored=t),e._readableState&&!e._readableState.errored&&(e._readableState.errored=t),n?ei.nextTick(Tu,e,i,t,r):Tu(e,i,t,r)):(i.buffered.length>i.bufferedIndex&&Xs(e,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:e,state:i},ei.nextTick(fw,i.afterWriteTickInfo)):Wu(e,i,1,r))}s(lw,"onwrite");function fw({stream:e,state:t,count:i,cb:n}){return t.afterWriteTickInfo=null,Wu(e,t,i,n)}s(fw,"afterWriteTick");function Wu(e,t,i,n){for(!t.ending&&!e.destroyed&&t.length===0&&t.needDrain&&(t.needDrain=!1,e.emit("drain"));i-- >0;)t.pendingcb--,n();t.destroyed&&Ys(t),Js(e,t)}s(Wu,"afterWrite");function Ys(e){if(e.writing)return;for(let r=e.bufferedIndex;r<e.buffered.length;++r){var t;let{chunk:o,callback:a}=e.buffered[r],c=e.objectMode?1:o.length;e.length-=c,a((t=e.errored)!==null&&t!==void 0?t:new vn("write"))}let i=e[Ri].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=e.errored)!==null&&n!==void 0?n:new vn("end"))}Or(e)}s(Ys,"errorBuffer");function Xs(e,t){if(t.corked||t.bufferProcessing||t.destroyed||!t.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=t,o=i.length-n;if(!o)return;let a=n;if(t.bufferProcessing=!0,o>1&&e._writev){t.pendingcb-=o-1;let c=t.allNoop?Gs:f=>{for(let d=a;d<i.length;++d)i[d].callback(f)},l=t.allNoop&&a===0?i:Ru(i,a);l.allBuffers=t.allBuffers,Pu(e,t,!0,t.length,l,"",c),Or(t)}else{do{let{chunk:c,encoding:l,callback:f}=i[a];i[a++]=null;let d=r?1:c.length;Pu(e,t,!1,d,c,l,f)}while(a<i.length&&!t.writing);a===i.length?Or(t):a>256?(i.splice(0,a),t.bufferedIndex=0):t.bufferedIndex=a}t.bufferProcessing=!1}s(Xs,"clearBuffer");$.prototype._write=function(e,t,i){if(this._writev)this._writev([{chunk:e,encoding:t}],i);else throw new nw("_write()")};$.prototype._writev=null;$.prototype.end=function(e,t,i){let n=this._writableState;typeof e=="function"?(i=e,e=null,t=null):typeof t=="function"&&(i=t,t=null);let r;if(e!=null){let o=Mu(this,e,t);o instanceof Kg&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Js(this,n,!0),n.ended=!0):n.finished?r=new ow("end"):n.destroyed&&(r=new vn("end"))),typeof i=="function"&&(r||n.finished?ei.nextTick(i,r):n[Ri].push(i)),this};function Ar(e){return e.ending&&!e.destroyed&&e.constructed&&e.length===0&&!e.errored&&e.buffered.length===0&&!e.finished&&!e.writing&&!e.errorEmitted&&!e.closeEmitted}s(Ar,"needFinish");function uw(e,t){let i=!1;function n(r){if(i){Ti(e,r??Bu());return}if(i=!0,t.pendingcb--,r){let o=t[Ri].splice(0);for(let a=0;a<o.length;a++)o[a](r);Ti(e,r,t.sync)}else Ar(t)&&(t.prefinished=!0,e.emit("prefinish"),t.pendingcb++,ei.nextTick(Ks,e,t))}s(n,"onFinish"),t.sync=!0,t.pendingcb++;try{e._final(n)}catch(r){n(r)}t.sync=!1}s(uw,"callFinal");function dw(e,t){!t.prefinished&&!t.finalCalled&&(typeof e._final=="function"&&!t.destroyed?(t.finalCalled=!0,uw(e,t)):(t.prefinished=!0,e.emit("prefinish")))}s(dw,"prefinish");function Js(e,t,i){Ar(t)&&(dw(e,t),t.pendingcb===0&&(i?(t.pendingcb++,ei.nextTick((n,r)=>{Ar(r)?Ks(n,r):r.pendingcb--},e,t)):Ar(t)&&(t.pendingcb++,Ks(e,t))))}s(Js,"finishMaybe");function Ks(e,t){t.pendingcb--,t.finished=!0;let i=t[Ri].splice(0);for(let n=0;n<i.length;n++)i[n]();if(e.emit("finish"),t.autoDestroy){let n=e._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&e.destroy()}}s(Ks,"finish");Gg($.prototype,{closed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.closed:!1},"get")},destroyed:{__proto__:null,get:s(function(){return this._writableState?this._writableState.destroyed:!1},"get"),set:s(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")},writable:{__proto__:null,get:s(function(){let e=this._writableState;return!!e&&e.writable!==!1&&!e.destroyed&&!e.errored&&!e.ending&&!e.ended},"get"),set:s(function(e){this._writableState&&(this._writableState.writable=!!e)},"set")},writableFinished:{__proto__:null,get:s(function(){return this._writableState?this._writableState.finished:!1},"get")},writableObjectMode:{__proto__:null,get:s(function(){return this._writableState?this._writableState.objectMode:!1},"get")},writableBuffer:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.getBuffer()},"get")},writableEnded:{__proto__:null,get:s(function(){return this._writableState?this._writableState.ending:!1},"get")},writableNeedDrain:{__proto__:null,get:s(function(){let e=this._writableState;return e?!e.destroyed&&!e.ending&&e.needDrain:!1},"get")},writableHighWaterMark:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.highWaterMark},"get")},writableCorked:{__proto__:null,get:s(function(){return this._writableState?this._writableState.corked:0},"get")},writableLength:{__proto__:null,get:s(function(){return this._writableState&&this._writableState.length},"get")},errored:{__proto__:null,enumerable:!1,get:s(function(){return this._writableState?this._writableState.errored:null},"get")},writableAborted:{__proto__:null,enumerable:!1,get:s(function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)},"get")}});var hw=Pr.destroy;$.prototype.destroy=function(e,t){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[Ri].length)&&ei.nextTick(Ys,i),hw.call(this,e,t),this};$.prototype._undestroy=Pr.undestroy;$.prototype._destroy=function(e,t){t(e)};$.prototype[Qg.captureRejectionSymbol]=function(e){this.destroy(e)};var Hs;function Uu(){return Hs===void 0&&(Hs={}),Hs}s(Uu,"lazyWebStreams");$.fromWeb=function(e,t){return Uu().newStreamWritableFromWritableStream(e,t)};$.toWeb=function(e){return Uu().newWritableStreamFromStreamWritable(e)}});var id=T((i0,td)=>{var Qs=Pt(),pw=Ie(),{isReadable:yw,isWritable:mw,isIterable:qu,isNodeStream:bw,isReadableNodeStream:$u,isWritableNodeStream:zu,isDuplexNodeStream:gw,isReadableStream:Vu,isWritableStream:Hu}=tt(),Ku=bt(),{AbortError:Zu,codes:{ERR_INVALID_ARG_TYPE:ww,ERR_INVALID_RETURN_VALUE:Gu}}=ae(),{destroyer:Ni}=Jt(),Sw=rt(),ed=xn(),Ew=Tr(),{createDeferredPromise:Yu}=re(),Xu=Ds(),Ju=globalThis.Blob||pw.Blob,_w=s(typeof Ju<"u"?function(t){return t instanceof Ju}:function(t){return!1},"isBlob"),xw=globalThis.AbortController||Ei().AbortController,{FunctionPrototypeCall:Qu}=q(),Zs=class Zs extends Sw{constructor(t){super(t),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)}};s(Zs,"Duplexify");var Lt=Zs;td.exports=s(function e(t,i){if(gw(t))return t;if($u(t))return Li({readable:t});if(zu(t))return Li({writable:t});if(bw(t))return Li({writable:!1,readable:!1});if(Vu(t))return Li({readable:ed.fromWeb(t)});if(Hu(t))return Li({writable:Ew.fromWeb(t)});if(typeof t=="function"){let{value:r,write:o,final:a,destroy:c}=kw(t);if(qu(r))return Xu(Lt,r,{objectMode:!0,write:o,final:a,destroy:c});let l=r?.then;if(typeof l=="function"){let f,d=Qu(l,r,h=>{if(h!=null)throw new Gu("nully","body",h)},h=>{Ni(f,h)});return f=new Lt({objectMode:!0,readable:!1,write:o,final:s(function(h){a(async()=>{try{await d,Qs.nextTick(h,null)}catch(b){Qs.nextTick(h,b)}})},"final"),destroy:c})}throw new Gu("Iterable, AsyncIterable or AsyncFunction",i,r)}if(_w(t))return e(t.arrayBuffer());if(qu(t))return Xu(Lt,t,{objectMode:!0,writable:!1});if(Vu(t?.readable)&&Hu(t?.writable))return Lt.fromWeb(t);if(typeof t?.writable=="object"||typeof t?.readable=="object"){let r=t!=null&&t.readable?$u(t?.readable)?t?.readable:e(t.readable):void 0,o=t!=null&&t.writable?zu(t?.writable)?t?.writable:e(t.writable):void 0;return Li({readable:r,writable:o})}let n=t?.then;if(typeof n=="function"){let r;return Qu(n,t,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ni(r,o)}),r=new Lt({objectMode:!0,writable:!1,read:s(function(){},"read")})}throw new ww(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],t)},"duplexify");function kw(e){let{promise:t,resolve:i}=Yu(),n=new xw,r=n.signal;return{value:e(async function*(){for(;;){let a=t;t=null;let{chunk:c,done:l,cb:f}=await a;if(Qs.nextTick(f),l)return;if(r.aborted)throw new Zu(void 0,{cause:r.reason});({promise:t,resolve:i}=Yu()),yield c}}(),{signal:r}),write:s(function(a,c,l){let f=i;i=null,f({chunk:a,done:!1,cb:l})},"write"),final:s(function(a){let c=i;i=null,c({done:!0,cb:a})},"final"),destroy:s(function(a,c){n.abort(),c(a)},"destroy")}}s(kw,"fromAsyncGen");function Li(e){let t=e.readable&&typeof e.readable.read!="function"?ed.wrap(e.readable):e.readable,i=e.writable,n=!!yw(t),r=!!mw(i),o,a,c,l,f;function d(h){let b=l;l=null,b?b(h):h&&f.destroy(h)}return s(d,"onfinished"),f=new Lt({readableObjectMode:!!(t!=null&&t.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Ku(i,h=>{r=!1,h&&Ni(t,h),d(h)}),f._write=function(h,b,p){i.write(h,b)?p():o=p},f._final=function(h){i.end(),a=h},i.on("drain",function(){if(o){let h=o;o=null,h()}}),i.on("finish",function(){if(a){let h=a;a=null,h()}})),n&&(Ku(t,h=>{n=!1,h&&Ni(t,h),d(h)}),t.on("readable",function(){if(c){let h=c;c=null,h()}}),t.on("end",function(){f.push(null)}),f._read=function(){for(;;){let h=t.read();if(h===null){c=f._read;return}if(!f.push(h))return}}),f._destroy=function(h,b){!h&&l!==null&&(h=new Zu),c=null,o=null,a=null,l===null?b(h):(l=b,Ni(i,h),Ni(t,h))},f}s(Li,"_duplexify")});var rt=T((r0,od)=>{"use strict";var{ObjectDefineProperties:vw,ObjectGetOwnPropertyDescriptor:gt,ObjectKeys:Fw,ObjectSetPrototypeOf:nd}=q();od.exports=We;var ia=xn(),Le=Tr();nd(We.prototype,ia.prototype);nd(We,ia);{let e=Fw(Le.prototype);for(let t=0;t<e.length;t++){let i=e[t];We.prototype[i]||(We.prototype[i]=Le.prototype[i])}}function We(e){if(!(this instanceof We))return new We(e);ia.call(this,e),Le.call(this,e),e?(this.allowHalfOpen=e.allowHalfOpen!==!1,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)):this.allowHalfOpen=!0}s(We,"Duplex");vw(We.prototype,{writable:{__proto__:null,...gt(Le.prototype,"writable")},writableHighWaterMark:{__proto__:null,...gt(Le.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...gt(Le.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...gt(Le.prototype,"writableBuffer")},writableLength:{__proto__:null,...gt(Le.prototype,"writableLength")},writableFinished:{__proto__:null,...gt(Le.prototype,"writableFinished")},writableCorked:{__proto__:null,...gt(Le.prototype,"writableCorked")},writableEnded:{__proto__:null,...gt(Le.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...gt(Le.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get:s(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:s(function(e){this._readableState&&this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")}});var ea;function rd(){return ea===void 0&&(ea={}),ea}s(rd,"lazyWebStreams");We.fromWeb=function(e,t){return rd().newStreamDuplexFromReadableWritablePair(e,t)};We.toWeb=function(e){return rd().newReadableWritablePairFromDuplex(e)};var ta;We.from=function(e){return ta||(ta=id()),ta(e,"body")}});var oa=T((s0,ad)=>{"use strict";var{ObjectSetPrototypeOf:sd,Symbol:Iw}=q();ad.exports=wt;var{ERR_METHOD_NOT_IMPLEMENTED:Aw}=ae().codes,ra=rt(),{getHighWaterMark:Ow}=Sn();sd(wt.prototype,ra.prototype);sd(wt,ra);var In=Iw("kCallback");function wt(e){if(!(this instanceof wt))return new wt(e);let t=e?Ow(this,e,"readableHighWaterMark",!0):null;t===0&&(e={...e,highWaterMark:null,readableHighWaterMark:t,writableHighWaterMark:e.writableHighWaterMark||0}),ra.call(this,e),this._readableState.sync=!1,this[In]=null,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Pw)}s(wt,"Transform");function na(e){typeof this._flush=="function"&&!this.destroyed?this._flush((t,i)=>{if(t){e?e(t):this.destroy(t);return}i!=null&&this.push(i),this.push(null),e&&e()}):(this.push(null),e&&e())}s(na,"final");function Pw(){this._final!==na&&na.call(this)}s(Pw,"prefinish");wt.prototype._final=na;wt.prototype._transform=function(e,t,i){throw new Aw("_transform()")};wt.prototype._write=function(e,t,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(e,t,(a,c)=>{if(a){i(a);return}c!=null&&this.push(c),r.ended||o===n.length||n.length<n.highWaterMark?i():this[In]=i})};wt.prototype._read=function(){if(this[In]){let e=this[In];this[In]=null,e()}}});var aa=T((c0,ld)=>{"use strict";var{ObjectSetPrototypeOf:cd}=q();ld.exports=Ci;var sa=oa();cd(Ci.prototype,sa.prototype);cd(Ci,sa);function Ci(e){if(!(this instanceof Ci))return new Ci(e);sa.call(this,e)}s(Ci,"PassThrough");Ci.prototype._transform=function(e,t,i){i(null,e)}});var Cr=T((f0,pd)=>{var An=Pt(),{ArrayIsArray:Tw,Promise:Rw,SymbolAsyncIterator:Lw,SymbolDispose:Nw}=q(),Nr=bt(),{once:Cw}=re(),Bw=Jt(),fd=rt(),{aggregateTwoErrors:Dw,codes:{ERR_INVALID_ARG_TYPE:ma,ERR_INVALID_RETURN_VALUE:ca,ERR_MISSING_ARGS:Mw,ERR_STREAM_DESTROYED:Ww,ERR_STREAM_PREMATURE_CLOSE:Uw},AbortError:jw}=ae(),{validateFunction:qw,validateAbortSignal:$w}=ki(),{isIterable:ti,isReadable:la,isReadableNodeStream:Lr,isNodeStream:ud,isTransformStream:Bi,isWebStream:zw,isReadableStream:fa,isReadableFinished:Vw}=tt(),Hw=globalThis.AbortController||Ei().AbortController,ua,da,ha;function dd(e,t,i){let n=!1;e.on("close",()=>{n=!0});let r=Nr(e,{readable:t,writable:i},o=>{n=!o});return{destroy:s(o=>{n||(n=!0,Bw.destroyer(e,o||new Ww("pipe")))},"destroy"),cleanup:r}}s(dd,"destroyer");function Kw(e){return qw(e[e.length-1],"streams[stream.length - 1]"),e.pop()}s(Kw,"popCallback");function pa(e){if(ti(e))return e;if(Lr(e))return Gw(e);throw new ma("val",["Readable","Iterable","AsyncIterable"],e)}s(pa,"makeAsyncIterable");async function*Gw(e){da||(da=xn()),yield*da.prototype[Lw].call(e)}s(Gw,"fromReadable");async function Rr(e,t,i,{end:n}){let r,o=null,a=s(f=>{if(f&&(r=f),o){let d=o;o=null,d()}},"resume"),c=s(()=>new Rw((f,d)=>{r?d(r):o=s(()=>{r?d(r):f()},"onresolve")}),"wait");t.on("drain",a);let l=Nr(t,{readable:!1},a);try{t.writableNeedDrain&&await c();for await(let f of e)t.write(f)||await c();n&&(t.end(),await c()),i()}catch(f){i(r!==f?Dw(r,f):f)}finally{l(),t.off("drain",a)}}s(Rr,"pumpToNode");async function ya(e,t,i,{end:n}){Bi(t)&&(t=t.writable);let r=t.getWriter();try{for await(let o of e)await r.ready,r.write(o).catch(()=>{});await r.ready,n&&await r.close(),i()}catch(o){try{await r.abort(o),i(o)}catch(a){i(a)}}}s(ya,"pumpToWeb");function Yw(...e){return hd(e,Cw(Kw(e)))}s(Yw,"pipeline");function hd(e,t,i){if(e.length===1&&Tw(e[0])&&(e=e[0]),e.length<2)throw new Mw("streams");let n=new Hw,r=n.signal,o=i?.signal,a=[];$w(o,"options.signal");function c(){w(new jw)}s(c,"abort"),ha=ha||re().addAbortListener;let l;o&&(l=ha(o,c));let f,d,h=[],b=0;function p(L){w(L,--b===0)}s(p,"finish");function w(L,F){var B;if(L&&(!f||f.code==="ERR_STREAM_PREMATURE_CLOSE")&&(f=L),!(!f&&!F)){for(;h.length;)h.shift()(f);(B=l)===null||B===void 0||B[Nw](),n.abort(),F&&(f||a.forEach(Bt=>Bt()),An.nextTick(t,f,d))}}s(w,"finishImpl");let g;for(let L=0;L<e.length;L++){let F=e[L],B=L<e.length-1,Bt=L>0,Ee=B||i?.end!==!1,si=L===e.length-1;if(ud(F)){let le=function(at){at&&at.name!=="AbortError"&&at.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(at)};var v=le;if(s(le,"onError"),Ee){let{destroy:at,cleanup:ro}=dd(F,B,Bt);h.push(at),la(F)&&si&&a.push(ro)}F.on("error",le),la(F)&&si&&a.push(()=>{F.removeListener("error",le)})}if(L===0)if(typeof F=="function"){if(g=F({signal:r}),!ti(g))throw new ca("Iterable, AsyncIterable or Stream","source",g)}else ti(F)||Lr(F)||Bi(F)?g=F:g=fd.from(F);else if(typeof F=="function"){if(Bi(g)){var A;g=pa((A=g)===null||A===void 0?void 0:A.readable)}else g=pa(g);if(g=F(g,{signal:r}),B){if(!ti(g,!0))throw new ca("AsyncIterable",`transform[${L-1}]`,g)}else{var k;ua||(ua=aa());let le=new ua({objectMode:!0}),at=(k=g)===null||k===void 0?void 0:k.then;if(typeof at=="function")b++,at.call(g,Et=>{d=Et,Et!=null&&le.write(Et),Ee&&le.end(),An.nextTick(p)},Et=>{le.destroy(Et),An.nextTick(p,Et)});else if(ti(g,!0))b++,Rr(g,le,p,{end:Ee});else if(fa(g)||Bi(g)){let Et=g.readable||g;b++,Rr(Et,le,p,{end:Ee})}else throw new ca("AsyncIterable or Promise","destination",g);g=le;let{destroy:ro,cleanup:$h}=dd(g,!1,!0);h.push(ro),si&&a.push($h)}}else if(ud(F)){if(Lr(g)){b+=2;let le=Xw(g,F,p,{end:Ee});la(F)&&si&&a.push(le)}else if(Bi(g)||fa(g)){let le=g.readable||g;b++,Rr(le,F,p,{end:Ee})}else if(ti(g))b++,Rr(g,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else if(zw(F)){if(Lr(g))b++,ya(pa(g),F,p,{end:Ee});else if(fa(g)||ti(g))b++,ya(g,F,p,{end:Ee});else if(Bi(g))b++,ya(g.readable,F,p,{end:Ee});else throw new ma("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=F}else g=fd.from(F)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&An.nextTick(c),g}s(hd,"pipelineImpl");function Xw(e,t,i,{end:n}){let r=!1;if(t.on("close",()=>{r||i(new Uw)}),e.pipe(t,{end:!1}),n){let a=function(){r=!0,t.end()};var o=a;s(a,"endFn"),Vw(e)?An.nextTick(a):e.once("end",a)}else i();return Nr(e,{readable:!0,writable:!1},a=>{let c=e._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&c&&c.ended&&!c.errored&&!c.errorEmitted?e.once("end",i).once("error",i):i(a)}),Nr(t,{readable:!1,writable:!0},i)}s(Xw,"pipe");pd.exports={pipelineImpl:hd,pipeline:Yw}});var ga=T((d0,Sd)=>{"use strict";var{pipeline:Jw}=Cr(),Br=rt(),{destroyer:Qw}=Jt(),{isNodeStream:Dr,isReadable:yd,isWritable:md,isWebStream:ba,isTransformStream:ii,isWritableStream:bd,isReadableStream:gd}=tt(),{AbortError:Zw,codes:{ERR_INVALID_ARG_VALUE:wd,ERR_MISSING_ARGS:eS}}=ae(),tS=bt();Sd.exports=s(function(...t){if(t.length===0)throw new eS("streams");if(t.length===1)return Br.from(t[0]);let i=[...t];if(typeof t[0]=="function"&&(t[0]=Br.from(t[0])),typeof t[t.length-1]=="function"){let p=t.length-1;t[p]=Br.from(t[p])}for(let p=0;p<t.length;++p)if(!(!Dr(t[p])&&!ba(t[p]))){if(p<t.length-1&&!(yd(t[p])||gd(t[p])||ii(t[p])))throw new wd(`streams[${p}]`,i[p],"must be readable");if(p>0&&!(md(t[p])||bd(t[p])||ii(t[p])))throw new wd(`streams[${p}]`,i[p],"must be writable")}let n,r,o,a,c;function l(p){let w=a;a=null,w?w(p):p?c.destroy(p):!b&&!h&&c.destroy()}s(l,"onfinished");let f=t[0],d=Jw(t,l),h=!!(md(f)||bd(f)||ii(f)),b=!!(yd(d)||gd(d)||ii(d));if(c=new Br({writableObjectMode:!!(f!=null&&f.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:b}),h){if(Dr(f))c._write=function(w,g,A){f.write(w,g)?A():n=A},c._final=function(w){f.end(),r=w},f.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ba(f)){let g=(ii(f)?f.writable:f).getWriter();c._write=async function(A,k,v){try{await g.ready,g.write(A).catch(()=>{}),v()}catch(L){v(L)}},c._final=async function(A){try{await g.ready,g.close().catch(()=>{}),r=A}catch(k){A(k)}}}let p=ii(d)?d.readable:d;tS(p,()=>{if(r){let w=r;r=null,w()}})}if(b){if(Dr(d))d.on("readable",function(){if(o){let p=o;o=null,p()}}),d.on("end",function(){c.push(null)}),c._read=function(){for(;;){let p=d.read();if(p===null){o=c._read;return}if(!c.push(p))return}};else if(ba(d)){let w=(ii(d)?d.readable:d).getReader();c._read=async function(){for(;;)try{let{value:g,done:A}=await w.read();if(!c.push(g))return;if(A){c.push(null);return}}catch{return}}}}return c._destroy=function(p,w){!p&&a!==null&&(p=new Zw),o=null,n=null,r=null,a===null?w(p):(a=w,Dr(d)&&Qw(d,p))},c},"compose")});var Pd=T((p0,Ea)=>{"use strict";var iS=globalThis.AbortController||Ei().AbortController,{codes:{ERR_INVALID_ARG_VALUE:nS,ERR_INVALID_ARG_TYPE:On,ERR_MISSING_ARGS:rS,ERR_OUT_OF_RANGE:oS},AbortError:ot}=ae(),{validateAbortSignal:ni,validateInteger:Ed,validateObject:ri}=ki(),sS=q().Symbol("kWeak"),aS=q().Symbol("kResistStopPropagation"),{finished:cS}=bt(),lS=ga(),{addAbortSignalNoValidate:fS}=wn(),{isWritable:uS,isNodeStream:dS}=tt(),{deprecate:hS}=re(),{ArrayPrototypePush:pS,Boolean:yS,MathFloor:_d,Number:mS,NumberIsNaN:bS,Promise:xd,PromiseReject:kd,PromiseResolve:gS,PromisePrototypeThen:vd,Symbol:Id}=q(),Mr=Id("kEmpty"),Fd=Id("kEof");function wS(e,t){if(t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),dS(e)&&!uS(e))throw new nS("stream",e,"must be writable");let i=lS(this,e);return t!=null&&t.signal&&fS(t.signal,i),i}s(wS,"compose");function Wr(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal");let i=1;t?.concurrency!=null&&(i=_d(t.concurrency));let n=i-1;return t?.highWaterMark!=null&&(n=_d(t.highWaterMark)),Ed(i,"options.concurrency",1),Ed(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=re().AbortSignalAny([t?.signal].filter(yS)),a=this,c=[],l={signal:o},f,d,h=!1,b=0;function p(){h=!0,w()}s(p,"onCatch");function w(){b-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&b<i&&c.length<n&&(d(),d=null)}s(g,"maybeResume");async function A(){try{for await(let k of a){if(h)return;if(o.aborted)throw new ot;try{if(k=e(k,l),k===Mr)continue;k=gS(k)}catch(v){k=kd(v)}b+=1,vd(k,w,p),c.push(k),f&&(f(),f=null),!h&&(c.length>=n||b>=i)&&await new xd(v=>{d=v})}c.push(Fd)}catch(k){let v=kd(k);vd(v,w,p),c.push(v)}finally{h=!0,f&&(f(),f=null)}}s(A,"pump"),A();try{for(;;){for(;c.length>0;){let k=await c[0];if(k===Fd)return;if(o.aborted)throw new ot;k!==Mr&&(yield k),c.shift(),g()}await new xd(k=>{f=k})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Wr,"map");function SS(e=void 0){return e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new ot({cause:e.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(SS,"asIndexedPairs");async function Ad(e,t=void 0){for await(let i of Sa.call(this,e,t))return!0;return!1}s(Ad,"some");async function ES(e,t=void 0){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);return!await Ad.call(this,async(...i)=>!await e(...i),t)}s(ES,"every");async function _S(e,t){for await(let i of Sa.call(this,e,t))return i}s(_S,"find");async function xS(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r),Mr}s(i,"forEachFn");for await(let n of Wr.call(this,i,t));}s(xS,"forEach");function Sa(e,t){if(typeof e!="function")throw new On("fn",["Function","AsyncFunction"],e);async function i(n,r){return await e(n,r)?n:Mr}return s(i,"filterFn"),Wr.call(this,i,t)}s(Sa,"filter");var _a=class _a extends rS{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(_a,"ReduceAwareErrMissingArgs");var wa=_a;async function kS(e,t,i){var n;if(typeof e!="function")throw new On("reducer",["Function","AsyncFunction"],e);i!=null&&ri(i,"options"),i?.signal!=null&&ni(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let f=new ot(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await cS(this.destroy(f)),f}let o=new iS,a=o.signal;if(i!=null&&i.signal){let f={once:!0,[sS]:this,[aS]:!0};i.signal.addEventListener("abort",()=>o.abort(),f)}let c=!1;try{for await(let f of this){var l;if(c=!0,i!=null&&(l=i.signal)!==null&&l!==void 0&&l.aborted)throw new ot;r?t=await e(t,f,{signal:a}):(t=f,r=!0)}if(!c&&!r)throw new wa}finally{o.abort()}return t}s(kS,"reduce");async function vS(e){e!=null&&ri(e,"options"),e?.signal!=null&&ni(e.signal,"options.signal");let t=[];for await(let n of this){var i;if(e!=null&&(i=e.signal)!==null&&i!==void 0&&i.aborted)throw new ot(void 0,{cause:e.signal.reason});pS(t,n)}return t}s(vS,"toArray");function FS(e,t){let i=Wr.call(this,e,t);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(FS,"flatMap");function Od(e){if(e=mS(e),bS(e))return 0;if(e<0)throw new oS("number",">= 0",e);return e}s(Od,"toIntegerOrInfinity");function IS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Od(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;e--<=0&&(yield o)}},"drop").call(this)}s(IS,"drop");function AS(e,t=void 0){return t!=null&&ri(t,"options"),t?.signal!=null&&ni(t.signal,"options.signal"),e=Od(e),s(async function*(){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new ot;for await(let o of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new ot;if(e-- >0&&(yield o),e<=0)return}},"take").call(this)}s(AS,"take");Ea.exports.streamReturningOperators={asIndexedPairs:hS(SS,"readable.asIndexedPairs will be removed in a future version."),drop:IS,filter:Sa,flatMap:FS,map:Wr,take:AS,compose:wS};Ea.exports.promiseReturningOperators={every:ES,forEach:xS,reduce:kS,toArray:vS,some:Ad,find:_S}});var xa=T((m0,Td)=>{"use strict";var{ArrayPrototypePop:OS,Promise:PS}=q(),{isIterable:TS,isNodeStream:RS,isWebStream:LS}=tt(),{pipelineImpl:NS}=Cr(),{finished:CS}=bt();ka();function BS(...e){return new PS((t,i)=>{let n,r,o=e[e.length-1];if(o&&typeof o=="object"&&!RS(o)&&!TS(o)&&!LS(o)){let a=OS(e);n=a.signal,r=a.end}NS(e,(a,c)=>{a?i(a):t(c)},{signal:n,end:r})})}s(BS,"pipeline");Td.exports={finished:CS,pipeline:BS}});var ka=T((g0,Ud)=>{var{Buffer:DS}=Ie(),{ObjectDefineProperty:St,ObjectKeys:Nd,ReflectApply:Cd}=q(),{promisify:{custom:Bd}}=re(),{streamReturningOperators:Rd,promiseReturningOperators:Ld}=Pd(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Dd}}=ae(),MS=ga(),{setDefaultHighWaterMark:WS,getDefaultHighWaterMark:US}=Sn(),{pipeline:Md}=Cr(),{destroyer:jS}=Jt(),Wd=bt(),va=xa(),Pn=tt(),C=Ud.exports=gr().Stream;C.isDestroyed=Pn.isDestroyed;C.isDisturbed=Pn.isDisturbed;C.isErrored=Pn.isErrored;C.isReadable=Pn.isReadable;C.isWritable=Pn.isWritable;C.Readable=xn();for(let e of Nd(Rd)){let i=function(...n){if(new.target)throw Dd();return C.Readable.from(Cd(t,this,n))};Fa=i,s(i,"fn");let t=Rd[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;for(let e of Nd(Ld)){let i=function(...r){if(new.target)throw Dd();return Cd(t,this,r)};Fa=i,s(i,"fn");let t=Ld[e];St(i,"name",{__proto__:null,value:t.name}),St(i,"length",{__proto__:null,value:t.length}),St(C.Readable.prototype,e,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Fa;C.Writable=Tr();C.Duplex=rt();C.Transform=oa();C.PassThrough=aa();C.pipeline=Md;var{addAbortSignal:qS}=wn();C.addAbortSignal=qS;C.finished=Wd;C.destroy=jS;C.compose=MS;C.setDefaultHighWaterMark=WS;C.getDefaultHighWaterMark=US;St(C,"promises",{__proto__:null,configurable:!0,enumerable:!0,get:s(function(){return va},"get")});St(Md,Bd,{__proto__:null,enumerable:!0,get:s(function(){return va.pipeline},"get")});St(Wd,Bd,{__proto__:null,enumerable:!0,get:s(function(){return va.finished},"get")});C.Stream=C;C._isUint8Array=s(function(t){return t instanceof Uint8Array},"isUint8Array");C._uint8ArrayToBuffer=s(function(t){return DS.from(t.buffer,t.byteOffset,t.byteLength)},"_uint8ArrayToBuffer")});var jd=T((S0,H)=>{"use strict";var Q=ka(),$S=xa(),zS=Q.Readable.destroy;H.exports=Q.Readable;H.exports._uint8ArrayToBuffer=Q._uint8ArrayToBuffer;H.exports._isUint8Array=Q._isUint8Array;H.exports.isDisturbed=Q.isDisturbed;H.exports.isErrored=Q.isErrored;H.exports.isReadable=Q.isReadable;H.exports.Readable=Q.Readable;H.exports.Writable=Q.Writable;H.exports.Duplex=Q.Duplex;H.exports.Transform=Q.Transform;H.exports.PassThrough=Q.PassThrough;H.exports.addAbortSignal=Q.addAbortSignal;H.exports.finished=Q.finished;H.exports.destroy=Q.destroy;H.exports.destroy=zS;H.exports.pipeline=Q.pipeline;H.exports.compose=Q.compose;Object.defineProperty(Q,"promises",{configurable:!0,enumerable:!0,get:s(function(){return $S},"get")});H.exports.Stream=Q.Stream;H.exports.default=H.exports});var oE={};Un(oE,{Async:()=>Va,AsyncTransaction:()=>$o,BigIntStats:()=>be,BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,Errno:()=>U,ErrnoError:()=>u,Fetch:()=>eE,FetchFS:()=>Zr,File:()=>qt,FileSystem:()=>pe,InMemory:()=>dn,InMemoryStore:()=>Xn,Index:()=>Jr,IndexFS:()=>Mn,Inode:()=>Ge,MutexLock:()=>to,Mutexed:()=>ec,NoSyncFile:()=>mi,Overlay:()=>iE,OverlayFS:()=>Wn,Port:()=>JS,PortFS:()=>Xr,PortFile:()=>Bn,PreloadFile:()=>we,ReadStream:()=>Nt,Readonly:()=>Ja,SimpleAsyncStore:()=>Ko,SimpleTransaction:()=>bi,Stats:()=>G,StatsCommon:()=>nn,StatsFs:()=>rn,StoreFS:()=>ln,Sync:()=>nE,SyncTransaction:()=>un,Transaction:()=>fn,UnmutexedOverlayFS:()=>no,WriteStream:()=>Ct,ZenFsType:()=>Ro,_InMemory:()=>al,_Port:()=>jh,__MutexedFS:()=>io,_toUnixTimestamp:()=>ip,access:()=>Eh,accessSync:()=>Fl,appendFile:()=>Jd,appendFileSync:()=>dl,attachFS:()=>Uh,checkOptions:()=>lo,chmod:()=>mh,chmodSync:()=>xl,chown:()=>ph,chownSync:()=>El,close:()=>Zd,closeSync:()=>It,configure:()=>KS,configureSingle:()=>HS,constants:()=>kt,copyFile:()=>Oh,copyFileSync:()=>os,cp:()=>Lh,cpSync:()=>ss,createReadStream:()=>vh,createWriteStream:()=>Fh,credentials:()=>ye,decode:()=>ai,decodeDirListing:()=>$n,default:()=>rE,detachFS:()=>XS,encode:()=>Ne,encodeDirListing:()=>xe,errorMessages:()=>ao,exists:()=>$d,existsSync:()=>Je,fchmod:()=>sh,fchmodSync:()=>nr,fchown:()=>oh,fchownSync:()=>ir,fdatasync:()=>ih,fdatasyncSync:()=>ml,flagToMode:()=>sn,flagToNumber:()=>my,flagToString:()=>ol,fs:()=>Cn,fstat:()=>Qd,fstatSync:()=>hl,fsync:()=>th,fsyncSync:()=>yl,ftruncate:()=>eh,ftruncateSync:()=>pl,futimes:()=>ah,futimesSync:()=>rr,handleRequest:()=>Dn,isAppendable:()=>pt,isBackend:()=>Vi,isBackendConfig:()=>Hi,isExclusive:()=>cn,isReadable:()=>vt,isStatsEqual:()=>To,isSynchronous:()=>by,isTruncating:()=>an,isWriteable:()=>ge,lchmod:()=>bh,lchmodSync:()=>kl,lchown:()=>yh,lchownSync:()=>_l,levenshtein:()=>co,link:()=>uh,linkSync:()=>wl,lopenSync:()=>mn,lstat:()=>Vd,lstatSync:()=>es,lutimes:()=>wh,lutimesSync:()=>vl,mkdir:()=>lh,mkdirSync:()=>or,mkdirpSync:()=>pc,mkdtemp:()=>Ah,mkdtempSync:()=>Il,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,normalizeMode:()=>ke,normalizeOptions:()=>ve,normalizePath:()=>x,normalizeTime:()=>Wt,open:()=>Gd,openAsBlob:()=>Ch,openSync:()=>yn,opendir:()=>Rh,opendirSync:()=>Pl,parseFlag:()=>M,promises:()=>Nn,randomIno:()=>tn,read:()=>rh,readFile:()=>Yd,readFileSync:()=>tr,readSync:()=>gl,readdir:()=>fh,readdirSync:()=>Si,readlink:()=>hh,readlinkSync:()=>is,readv:()=>Ph,readvSync:()=>Al,realpath:()=>Sh,realpathSync:()=>Xe,rename:()=>qd,renameSync:()=>ll,resolveMountConfig:()=>Ui,resolveRemoteMount:()=>QS,rm:()=>Ih,rmSync:()=>rs,rmdir:()=>ch,rmdirSync:()=>ts,rootCredentials:()=>np,rootIno:()=>Ye,setImmediate:()=>tp,size_max:()=>Oe,stat:()=>zd,statSync:()=>Te,statfs:()=>Nh,statfsSync:()=>Tl,symlink:()=>dh,symlinkSync:()=>Sl,truncate:()=>Hd,truncateSync:()=>fl,umount:()=>gi,unlink:()=>Kd,unlinkSync:()=>er,unwatchFile:()=>xh,utimes:()=>gh,utimesSync:()=>ns,version:()=>Qa,watch:()=>kh,watchFile:()=>_h,write:()=>nh,writeFile:()=>Xd,writeFileSync:()=>bn,writeSync:()=>bl,writev:()=>Th,writevSync:()=>Ol});var U=(y=>(y[y.EPERM=1]="EPERM",y[y.ENOENT=2]="ENOENT",y[y.EINTR=4]="EINTR",y[y.EIO=5]="EIO",y[y.ENXIO=6]="ENXIO",y[y.EBADF=9]="EBADF",y[y.EAGAIN=11]="EAGAIN",y[y.ENOMEM=12]="ENOMEM",y[y.EACCES=13]="EACCES",y[y.EFAULT=14]="EFAULT",y[y.ENOTBLK=15]="ENOTBLK",y[y.EBUSY=16]="EBUSY",y[y.EEXIST=17]="EEXIST",y[y.EXDEV=18]="EXDEV",y[y.ENODEV=19]="ENODEV",y[y.ENOTDIR=20]="ENOTDIR",y[y.EISDIR=21]="EISDIR",y[y.EINVAL=22]="EINVAL",y[y.ENFILE=23]="ENFILE",y[y.EMFILE=24]="EMFILE",y[y.ETXTBSY=26]="ETXTBSY",y[y.EFBIG=27]="EFBIG",y[y.ENOSPC=28]="ENOSPC",y[y.ESPIPE=29]="ESPIPE",y[y.EROFS=30]="EROFS",y[y.EMLINK=31]="EMLINK",y[y.EPIPE=32]="EPIPE",y[y.EDOM=33]="EDOM",y[y.ERANGE=34]="ERANGE",y[y.EDEADLK=35]="EDEADLK",y[y.ENAMETOOLONG=36]="ENAMETOOLONG",y[y.ENOLCK=37]="ENOLCK",y[y.ENOSYS=38]="ENOSYS",y[y.ENOTEMPTY=39]="ENOTEMPTY",y[y.ELOOP=40]="ELOOP",y[y.ENOMSG=42]="ENOMSG",y[y.EBADE=52]="EBADE",y[y.EBADR=53]="EBADR",y[y.EXFULL=54]="EXFULL",y[y.ENOANO=55]="ENOANO",y[y.EBADRQC=56]="EBADRQC",y[y.ENOSTR=60]="ENOSTR",y[y.ENODATA=61]="ENODATA",y[y.ETIME=62]="ETIME",y[y.ENOSR=63]="ENOSR",y[y.ENONET=64]="ENONET",y[y.EREMOTE=66]="EREMOTE",y[y.ENOLINK=67]="ENOLINK",y[y.ECOMM=70]="ECOMM",y[y.EPROTO=71]="EPROTO",y[y.EBADMSG=74]="EBADMSG",y[y.EOVERFLOW=75]="EOVERFLOW",y[y.EBADFD=77]="EBADFD",y[y.ESTRPIPE=86]="ESTRPIPE",y[y.ENOTSOCK=88]="ENOTSOCK",y[y.EDESTADDRREQ=89]="EDESTADDRREQ",y[y.EMSGSIZE=90]="EMSGSIZE",y[y.EPROTOTYPE=91]="EPROTOTYPE",y[y.ENOPROTOOPT=92]="ENOPROTOOPT",y[y.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",y[y.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",y[y.ENOTSUP=95]="ENOTSUP",y[y.ENETDOWN=100]="ENETDOWN",y[y.ENETUNREACH=101]="ENETUNREACH",y[y.ENETRESET=102]="ENETRESET",y[y.ETIMEDOUT=110]="ETIMEDOUT",y[y.ECONNREFUSED=111]="ECONNREFUSED",y[y.EHOSTDOWN=112]="EHOSTDOWN",y[y.EHOSTUNREACH=113]="EHOSTUNREACH",y[y.EALREADY=114]="EALREADY",y[y.EINPROGRESS=115]="EINPROGRESS",y[y.ESTALE=116]="ESTALE",y[y.EREMOTEIO=121]="EREMOTEIO",y[y.EDQUOT=122]="EDQUOT",y))(U||{}),ao={1:"Operation not permitted",2:"No such file or directory",4:"Interrupted system call",5:"Input/output error",6:"No such device or address",9:"Bad file descriptor",11:"Resource temporarily unavailable",12:"Cannot allocate memory",13:"Permission denied",14:"Bad address",15:"Block device required",16:"Resource busy or locked",17:"File exists",18:"Invalid cross-device link",19:"No such device",20:"File is not a directory",21:"File is a directory",22:"Invalid argument",23:"Too many open files in system",24:"Too many open files",26:"Text file busy",27:"File is too big",28:"No space left on disk",29:"Illegal seek",30:"Cannot modify a read-only file system",31:"Too many links",32:"Broken pipe",33:"Numerical argument out of domain",34:"Numerical result out of range",35:"Resource deadlock would occur",36:"File name too long",37:"No locks available",38:"Function not implemented",39:"Directory is not empty",40:"Too many levels of symbolic links",42:"No message of desired type",52:"Invalid exchange",53:"Invalid request descriptor",54:"Exchange full",55:"No anode",56:"Invalid request code",60:"Device not a stream",61:"No data available",62:"Timer expired",63:"Out of streams resources",64:"Machine is not on the network",66:"Object is remote",67:"Link has been severed",70:"Communication error on send",71:"Protocol error",74:"Bad message",75:"Value too large for defined data type",77:"File descriptor in bad state",86:"Streams pipe error",88:"Socket operation on non-socket",89:"Destination address required",90:"Message too long",91:"Protocol wrong type for socket",92:"Protocol not available",93:"Protocol not supported",94:"Socket type not supported",95:"Operation is not supported",100:"Network is down",101:"Network is unreachable",102:"Network dropped connection on reset",110:"Connection timed out",111:"Connection refused",112:"Host is down",113:"No route to host",114:"Operation already in progress",115:"Operation now in progress",116:"Stale file handle",121:"Remote I/O error",122:"Disk quota exceeded"},zi=class zi extends Error{constructor(i,n=ao[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=U[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new zi(i.errno,i.message,i.path,i.syscall);return n.code=i.code,n.stack=i.stack,n}static With(i,n,r){return new zi(U[i],ao[U[i]],n,r)}toString(){return this.message}toJSON(){return{errno:this.errno,code:this.code,path:this.path,stack:this.stack,message:this.message,syscall:this.syscall}}bufferSize(){return 4+JSON.stringify(this.toJSON()).length}};s(zi,"ErrnoError");var u=zi;var Zh="/";function hc(e,t){let i="",n=0,r=-1,o=0,a="\0";for(let c=0;c<=e.length;++c){if(c<e.length)a=e[c];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===c-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let l=i.lastIndexOf("/");l===-1?(i="",n=0):(i=i.slice(0,l),n=i.length-1-i.lastIndexOf("/")),r=c,o=0;continue}else if(i.length!==0){i="",n=0,r=c,o=0;continue}}t&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+e.slice(r+1,c):i=e.slice(r+1,c),n=c-r-1;r=c,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(hc,"normalizeString");function _t(...e){let t="";for(let n of[...e.reverse(),Zh])if(n.length&&(t=`${n}/${t}`,n.startsWith("/")))break;let i=t.startsWith("/");return t=hc(t,!i),i?`/${t}`:t.length?t:"/"}s(_t,"resolve");function ep(e){if(!e.length)return".";let t=e.startsWith("/"),i=e.endsWith("/");return e=hc(e,!t),e.length?(i&&(e+="/"),t?`/${e}`:e):t?"/":i?"./":"."}s(ep,"normalize");function z(...e){if(!e.length)return".";let t=e.join("/");return t?.length?ep(t):"."}s(z,"join");function _(e){if(e.length===0)return".";let t=e[0]==="/",i=-1,n=!0;for(let r=e.length-1;r>=1;--r)if(e[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?t?"/":".":t&&i===1?"//":e.slice(0,i)}s(_,"dirname");function D(e,t){let i=0,n=-1,r=!0;if(t!==void 0&&t.length>0&&t.length<=e.length){if(t===e)return"";let o=t.length-1,a=-1;for(let c=e.length-1;c>=0;--c)if(e[c]==="/"){if(!r){i=c+1;break}}else a===-1&&(r=!1,a=c+1),o>=0&&(e[c]===t[o]?--o===-1&&(n=c):(o=-1,n=a));return i===n?n=a:n===-1&&(n=e.length),e.slice(i,n)}for(let o=e.length-1;o>=0;--o)if(e[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":e.slice(i,n)}s(D,"basename");function jn(e){let t=e.startsWith("/"),i={root:t?"/":"",dir:"",base:"",ext:"",name:""};if(e.length===0)return i;let n=t?1:0,r=-1,o=0,a=-1,c=!0,l=e.length-1,f=0;for(;l>=n;--l){if(e[l]==="/"){if(!c){o=l+1;break}continue}a===-1&&(c=!1,a=l+1),e[l]==="."?r===-1?r=l:f!==1&&(f=1):r!==-1&&(f=-1)}if(a!==-1){let d=o===0&&t?1:o;r===-1||f===0||f===1&&r===a-1&&r===o+1?i.base=i.name=e.slice(d,a):(i.name=e.slice(d,r),i.base=e.slice(d,a),i.ext=e.slice(r,a))}return o>0?i.dir=e.slice(0,o-1):t&&(i.dir="/"),i}s(jn,"parse");function pc(e,t,i){i.existsSync(e)||(pc(_(e),t,i),i.mkdirSync(e,t))}s(pc,"mkdirpSync");function qn(e,t,i,n,r){return Math.min(e+1,t+1,i+1,n===r?t:t+1)}s(qn,"_min");function co(e,t){if(e===t)return 0;e.length>t.length&&([e,t]=[t,e]);let i=e.length,n=t.length;for(;i>0&&e.charCodeAt(i-1)===t.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&e.charCodeAt(r)===t.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let b=0;b<i;)o[i+b]=e.charCodeAt(r+b),o[b]=++b;let a,c,l,f,d;for(a=0;a+3<n;){let b=t.charCodeAt(r+(c=a)),p=t.charCodeAt(r+(l=a+1)),w=t.charCodeAt(r+(f=a+2)),g=t.charCodeAt(r+(d=a+3)),A=a+=4;for(let k=0;k<i;){let v=o[i+k],L=o[k];c=qn(L,c,l,b,v),l=qn(c,l,f,p,v),f=qn(l,f,d,w,v),A=qn(f,d,A,g,v),o[k++]=A,d=f,f=l,l=c,c=L}}let h=0;for(;a<n;){let b=t.charCodeAt(r+(c=a));h=++a;for(let p=0;p<i;p++){let w=o[p];o[p]=h=w<c||h<c?w>h?h+1:w+1:b===o[i+p]?c:c+1,c=w}}return h}s(co,"levenshtein");var tp=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:e=>setTimeout(e,0);function Ne(e){if(typeof e!="string")throw new u(22,"Can not encode a non-string");return new Uint8Array(Array.from(e).map(t=>t.charCodeAt(0)))}s(Ne,"encode");function ai(e){if(!(e instanceof Uint8Array))throw new u(22,"Can not decode a non-Uint8Array");return Array.from(e).map(t=>String.fromCharCode(t)).join("")}s(ai,"decode");function $n(e){return JSON.parse(ai(e),(t,i)=>t==""?i:BigInt(i))}s($n,"decodeDirListing");function xe(e){return Ne(JSON.stringify(e,(t,i)=>t==""?i:i.toString()))}s(xe,"encodeDirListing");function ip(e){if(typeof e=="number")return Math.floor(e);if(e instanceof Date)return Math.floor(e.getTime()/1e3);throw new Error("Cannot parse time")}s(ip,"_toUnixTimestamp");function ke(e,t){if(typeof e=="number")return e;if(typeof e=="string"){let i=parseInt(e,8);if(!isNaN(i))return i}if(typeof t=="number")return t;throw new u(22,"Invalid mode: "+e?.toString())}s(ke,"normalizeMode");function Wt(e){if(e instanceof Date)return e;if(typeof e=="number")return new Date(e*1e3);if(typeof e=="string")return new Date(e);throw new u(22,"Invalid time.")}s(Wt,"normalizeTime");function x(e){if(e=e.toString(),e.includes("\0"))throw new u(22,"Path can not contain null character");if(e.length==0)throw new u(22,"Path can not be empty");return _t(e.replaceAll(/[/\\]+/g,"/"))}s(x,"normalizePath");function ve(e,t="utf8",i,n=0){return typeof e!="object"||e===null?{encoding:typeof e=="string"?e:t??null,flag:i,mode:n}:{encoding:typeof e?.encoding=="string"?e.encoding:t??null,flag:typeof e?.flag=="string"?e.flag:i,mode:ke("mode"in e?e?.mode:null,n)}}s(ve,"normalizeOptions");function Vi(e){return e!=null&&typeof e=="object"&&"isAvailable"in e&&typeof e.isAvailable=="function"&&"create"in e&&typeof e.create=="function"}s(Vi,"isBackend");async function lo(e,t){if(typeof t!="object"||t===null)throw new u(22,"Invalid options");for(let[i,n]of Object.entries(e.options)){let r=t?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(t).filter(c=>!(c in e.options)).map(c=>({str:c,distance:co(i,c)})).filter(c=>c.distance<5).sort((c,l)=>c.distance-l.distance);throw new u(22,`${e.name}: Required option '${i}' not provided.${a.length>0?` You provided '${a[0].str}', did you mean '${i}'.`:""}`)}if(!(Array.isArray(n.type)?n.type.indexOf(typeof r)!=-1:typeof r==n.type))throw new u(22,`${e.name}: Value provided for option ${i} is not the proper type. Expected ${Array.isArray(n.type)?`one of {${n.type.join(", ")}}`:n.type}, but received ${typeof r}`);n.validator&&await n.validator(r)}}s(lo,"checkOptions");function Hi(e){return e!=null&&typeof e=="object"&&"backend"in e&&Vi(e.backend)}s(Hi,"isBackendConfig");var ye={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0},np={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var Cn={};Un(Cn,{BigIntStatsFs:()=>on,Dir:()=>Ot,Dirent:()=>At,ReadStream:()=>Nt,Stats:()=>G,StatsFs:()=>rn,WriteStream:()=>Ct,access:()=>Eh,accessSync:()=>Fl,appendFile:()=>Jd,appendFileSync:()=>dl,chmod:()=>mh,chmodSync:()=>xl,chown:()=>ph,chownSync:()=>El,close:()=>Zd,closeSync:()=>It,constants:()=>kt,copyFile:()=>Oh,copyFileSync:()=>os,cp:()=>Lh,cpSync:()=>ss,createReadStream:()=>vh,createWriteStream:()=>Fh,exists:()=>$d,existsSync:()=>Je,fchmod:()=>sh,fchmodSync:()=>nr,fchown:()=>oh,fchownSync:()=>ir,fdatasync:()=>ih,fdatasyncSync:()=>ml,fstat:()=>Qd,fstatSync:()=>hl,fsync:()=>th,fsyncSync:()=>yl,ftruncate:()=>eh,ftruncateSync:()=>pl,futimes:()=>ah,futimesSync:()=>rr,lchmod:()=>bh,lchmodSync:()=>kl,lchown:()=>yh,lchownSync:()=>_l,link:()=>uh,linkSync:()=>wl,lopenSync:()=>mn,lstat:()=>Vd,lstatSync:()=>es,lutimes:()=>wh,lutimesSync:()=>vl,mkdir:()=>lh,mkdirSync:()=>or,mkdtemp:()=>Ah,mkdtempSync:()=>Il,mount:()=>zt,mountObject:()=>pn,mounts:()=>Pe,open:()=>Gd,openAsBlob:()=>Ch,openSync:()=>yn,opendir:()=>Rh,opendirSync:()=>Pl,promises:()=>Nn,read:()=>rh,readFile:()=>Yd,readFileSync:()=>tr,readSync:()=>gl,readdir:()=>fh,readdirSync:()=>Si,readlink:()=>hh,readlinkSync:()=>is,readv:()=>Ph,readvSync:()=>Al,realpath:()=>Sh,realpathSync:()=>Xe,rename:()=>qd,renameSync:()=>ll,rm:()=>Ih,rmSync:()=>rs,rmdir:()=>ch,rmdirSync:()=>ts,stat:()=>zd,statSync:()=>Te,statfs:()=>Nh,statfsSync:()=>Tl,symlink:()=>dh,symlinkSync:()=>Sl,truncate:()=>Hd,truncateSync:()=>fl,umount:()=>gi,unlink:()=>Kd,unlinkSync:()=>er,unwatchFile:()=>xh,utimes:()=>gh,utimesSync:()=>ns,watch:()=>kh,watchFile:()=>_h,write:()=>nh,writeFile:()=>Xd,writeFileSync:()=>bn,writeSync:()=>bl,writev:()=>Th,writevSync:()=>Ol});var za=$i(Ie(),1);var kt={};Un(kt,{COPYFILE_EXCL:()=>Yi,COPYFILE_FICLONE:()=>Dp,COPYFILE_FICLONE_FORCE:()=>Mp,F_OK:()=>Gi,O_APPEND:()=>Ke,O_CREAT:()=>ee,O_DIRECT:()=>Vp,O_DIRECTORY:()=>Up,O_DSYNC:()=>$p,O_EXCL:()=>Ve,O_NOATIME:()=>jp,O_NOCTTY:()=>Wp,O_NOFOLLOW:()=>qp,O_NONBLOCK:()=>Hp,O_RDONLY:()=>di,O_RDWR:()=>ue,O_SYMLINK:()=>zp,O_SYNC:()=>hi,O_TRUNC:()=>He,O_WRONLY:()=>ze,R_OK:()=>Ae,S_IFBLK:()=>ft,S_IFCHR:()=>ut,S_IFDIR:()=>he,S_IFIFO:()=>dt,S_IFLNK:()=>Ce,S_IFMT:()=>K,S_IFREG:()=>de,S_IFSOCK:()=>lt,S_IRGRP:()=>Zp,S_IROTH:()=>iy,S_IRUSR:()=>Xp,S_IRWXG:()=>_o,S_IRWXO:()=>xo,S_IRWXU:()=>Eo,S_ISGID:()=>Gp,S_ISUID:()=>Kp,S_ISVTX:()=>Yp,S_IWGRP:()=>ey,S_IWOTH:()=>ny,S_IWUSR:()=>Jp,S_IXGRP:()=>ty,S_IXOTH:()=>ry,S_IXUSR:()=>Qp,UV_FS_O_FILEMAP:()=>oy,W_OK:()=>X,X_OK:()=>Bp});var Gi=0,Ae=4,X=2,Bp=1,Yi=1,Dp=2,Mp=4,di=0,ze=1,ue=2,ee=64,Ve=128,Wp=256,He=512,Ke=1024,Up=65536,jp=262144,qp=131072,hi=1052672,$p=4096,zp=32768,Vp=16384,Hp=2048,K=61440,lt=49152,Ce=40960,de=32768,ft=24576,he=16384,ut=8192,dt=4096,Kp=2048,Gp=1024,Yp=512,Eo=448,Xp=256,Jp=128,Qp=64,_o=56,Zp=32,ey=16,ty=8,xo=7,iy=4,ny=2,ry=1,oy=0;var Ji=$i(Bc(),1);var Mc,vo=class vo extends Ji.default{constructor(i){super();oo(this,Mc,"List");oo(this,"data",new Set);i&&this.push(...i)}toSet(){return new Set(this.data)}toArray(){return Array.from(this.data)}toJSON(){return JSON.stringify(Array.from(this.data))}toString(){return this.join(",")}set(i,n){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not set an element outside the bounds of the list");let r=Array.from(this.data);r.splice(i,1,n),this.data=new Set(r),this.emit("update")}deleteAt(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not delete an element outside the bounds of the list");this.delete(Array.from(this.data).at(i))}at(i){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not access an element outside the bounds of the list");return Array.from(this.data).at(i)}pop(){let i=Array.from(this.data).pop();return i!==void 0&&this.delete(i),i}push(...i){for(let n of i)this.add(n);return this.data.size}join(i){return Array.from(this.data).join(i)}splice(i,n,...r){if(Math.abs(i)>this.data.size)throw new ReferenceError("Can not splice elements outside the bounds of the list");let o=Array.from(this.data),a=o.splice(i,n,...r);return this.data=new Set(o),this.emit("update"),a}add(i){return this.data.add(i),this.emit("update"),this}clear(){this.data.clear(),this.emit("update")}delete(i){let n=this.data.delete(i);return this.emit("update"),n}has(i){return this.data.has(i)}get size(){return this.data.size}entries(){return this.data.entries()}keys(){return this.data.keys()}values(){return this.data.values()}[(Mc=Symbol.toStringTag,Symbol.iterator)](){return this.data[Symbol.iterator]()}};s(vo,"List");var Dc=vo;function Wc(e){try{return JSON.parse(e),!0}catch{return!1}}s(Wc,"isJSON");function Qi(e){return e.at(0).toUpperCase()+e.slice(1)}s(Qi,"capitalize");var Uc=["int8","uint8","int16","uint16","int32","uint32","int64","uint64","float32","float64"],jc=[...Uc,...Uc.map(e=>Qi(e)),"char"],Gn=/^(u?int|float)(8|16|32|64)$/i;function Fo(e){return e=="char"?"uint8":e.toLowerCase()}s(Fo,"normalize");function Io(e){return Gn.test(e.toString())}s(Io,"isType");function Yn(e){return e=="char"||Gn.test(e.toString().toLowerCase())}s(Yn,"isValid");function qc(e){if(!Yn(e))throw new TypeError("Not a valid primitive type: "+e)}s(qc,"checkValid");var Zi=Symbol("struct_init"),yi=Symbol("struct");function ly(e){return e!=null&&typeof e=="object"&&yi in e}s(ly,"isValidMetadata");Symbol.metadata??=Symbol.for("Symbol.metadata");function fy(e){Symbol?.metadata&&(Symbol.metadata in e||Object.defineProperty(e,Symbol.metadata,{enumerable:!0,configurable:!0,writable:!0,value:Object.create(null)}))}s(fy,"_polyfill_contextMetadata");function pi(e){let t=Symbol.metadata||Object.getOwnPropertySymbols(e).find(i=>i.description=="Symbol.metadata");if(fy(e),!t)throw new ReferenceError("Could not get a reference to Symbol.metadata");return t}s(pi,"symbol_metadata");function en(e){return typeof e=="function"&&pi(e)in e&&ly(e[pi(e)])}s(en,"isStatic");function $c(e){return e!=null&&typeof e=="object"&&en(e.constructor)}s($c,"isInstance");function Ao(e){if(!$c(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct instance")}s(Ao,"checkInstance");function uy(e){return $c(e)||en(e)}s(uy,"isStruct");function zc(e){if(!uy(e))throw new TypeError((typeof e=="function"?e.name:typeof e=="object"&&e?e.constructor.name:e)+" is not a struct")}s(zc,"checkStruct");function ht(e){if(typeof e=="string")return qc(e),+Fo(e).match(Gn)[2]/8;zc(e);let t=en(e)?e:e.constructor;return t[pi(t)][yi].size}s(ht,"sizeof");function hy(e,t){return Math.ceil(e/t)*t}s(hy,"align");function Hc(e={}){return s(function(i,n){n.metadata??={},n.metadata[Zi]||=[];let r=0,o=new Map;for(let a of n.metadata[Zi]){let{name:c,type:l,length:f}=a;if(!Yn(l)&&!en(l))throw new TypeError("Not a valid type: "+l);o.set(c,{offset:r,type:Yn(l)?Fo(l):l,length:f}),r+=ht(l)*(f||1),r=hy(r,e.align||1)}return n.metadata[yi]={options:e,members:o,size:r},i},"_decorateStruct")}s(Hc,"struct");function Vc(e,t){return function(i,n){let r=n.name;if(typeof r=="symbol"&&(console.warn("Symbol used for struct member name will be coerced to string: "+r.toString()),r=r.toString()),!r)throw new ReferenceError("Invalid name for struct member");return n.metadata??={},n.metadata[Zi]||=[],n.metadata[Zi].push({name:r,type:e,length:t}),i}}s(Vc,"member");function Oo(e){Ao(e);let{options:t,members:i}=e.constructor[pi(e.constructor)][yi],n=new Uint8Array(ht(e)),r=new DataView(n.buffer);for(let[o,{type:a,length:c,offset:l}]of i)for(let f=0;f<(c||1);f++){let d=l+ht(a)*f,h=c>0?e[o][f]:e[o];if(typeof h=="string"&&(h=h.charCodeAt(0)),!Io(a)){n.set(h?Oo(h):new Uint8Array(ht(a)),d);continue}let p="set"+Qi(a);if(p=="setInt64"){r.setBigInt64(d,BigInt(h),!t.bigEndian);continue}if(p=="setUint64"){r.setBigUint64(d,BigInt(h),!t.bigEndian);continue}r[p](d,Number(h),!t.bigEndian)}return n}s(Oo,"serialize");function Po(e,t){Ao(e);let{options:i,members:n}=e.constructor[pi(e.constructor)][yi],r=t instanceof Uint8Array?t:new Uint8Array("buffer"in t?t.buffer:t),o=new DataView(r.buffer.slice(r.byteOffset,r.byteOffset+r.byteLength));for(let[a,{type:c,offset:l,length:f}]of n)for(let d=0;d<(f||1);d++){let h=f>0?e[a]:e,b=f>0?d:a,p=l+ht(c)*d;if(typeof e[a]=="string"){e[a]=e[a].slice(0,d)+String.fromCharCode(o.getUint8(p))+e[a].slice(d+1);continue}if(!Io(c)){if(h[b]===null||h[b]===void 0)continue;Po(h[b],new Uint8Array(r.slice(p,p+ht(c))));continue}f>0&&(h||=[]);let g="get"+Qi(c);if(g=="getInt64"){h[b]=o.getBigInt64(p,!i.bigEndian);continue}if(g=="getUint64"){h[b]=o.getBigUint64(p,!i.bigEndian);continue}h[b]=o[g](p,!i.bigEndian)}}s(Po,"deserialize");function py(e){function t(i,n){return typeof i=="number"?Vc(e,i):Vc(e)(i,n)}return s(t,"_structMemberDecorator"),t}s(py,"_member");var Be=Object.fromEntries(jc.map(e=>[e,py(e)]));var Oe=2**32-1,Ye=0n;function Kc(){return Math.round(Math.random()*2**32).toString(16)}s(Kc,"_random");function tn(){return BigInt("0x"+Kc()+Kc())}s(tn,"randomIno");var Gc,Yc,Xc,Jc,Qc,Zc,el,tl,il,nl,rl,me;me=[,,,],rl=[Hc()],nl=[Be.uint64],il=[Be.uint32],tl=[Be.uint16],el=[Be.uint32],Zc=[Be.uint32],Qc=[Be.uint32],Jc=[Be.float64],Xc=[Be.float64],Yc=[Be.float64],Gc=[Be.float64];var te=class te{get data(){return Oo(this)}constructor(t){if(t){if(t.byteLength<ht(te))throw new RangeError(`Can not create an inode from a buffer less than ${ht(te)} bytes`);Po(this,t);return}this.ino=tn(),this.nlink=1,this.size=4096;let i=Date.now();this.atimeMs=i,this.mtimeMs=i,this.ctimeMs=i,this.birthtimeMs=i}toStats(){return new G(this)}update(t){let i=!1;return this.size!==t.size&&(this.size=t.size,i=!0),this.mode!==t.mode&&(this.mode=t.mode,i=!0),this.nlink!==t.nlink&&(this.nlink=t.nlink,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.uid!==t.uid&&(this.uid=t.uid,i=!0),this.atimeMs!==t.atimeMs&&(this.atimeMs=t.atimeMs,i=!0),this.mtimeMs!==t.mtimeMs&&(this.mtimeMs=t.mtimeMs,i=!0),this.ctimeMs!==t.ctimeMs&&(this.ctimeMs=t.ctimeMs,i=!0),i}};_e(me,5,"ino",nl,te),_e(me,5,"size",il,te),_e(me,5,"mode",tl,te),_e(me,5,"nlink",el,te),_e(me,5,"uid",Zc,te),_e(me,5,"gid",Qc,te),_e(me,5,"atimeMs",Jc,te),_e(me,5,"birthtimeMs",Xc,te),_e(me,5,"mtimeMs",Yc,te),_e(me,5,"ctimeMs",Gc,te),te=_e(me,0,"Inode",rl,te),s(te,"Inode"),dc(me,1,te);var Ge=te;var Lo=class Lo{constructor({atimeMs:t,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:c,mode:l,ino:f}={}){this.dev=this._convert(0);this.ino=this._convert(0);this.rdev=this._convert(0);this.nlink=this._convert(1);this.blksize=this._convert(4096);this.uid=this._convert(0);this.gid=this._convert(0);let d=Date.now();this.atimeMs=this._convert(t??d),this.mtimeMs=this._convert(i??d),this.ctimeMs=this._convert(n??d),this.birthtimeMs=this._convert(r??d),this.uid=this._convert(o??0),this.gid=this._convert(a??0),this.size=this._convert(c??0),this.ino=this._convert(f??0),this.mode=this._convert(l??0),this.mode&61440||(this.mode=this.mode|this._convert(32768))}_convert(t){return this._isBigint?BigInt(t):Number(t)}get blocks(){return this._convert(Math.ceil(Number(this.size)/512))}get atime(){return new Date(Number(this.atimeMs))}set atime(t){this.atimeMs=this._convert(t.getTime())}get mtime(){return new Date(Number(this.mtimeMs))}set mtime(t){this.mtimeMs=this._convert(t.getTime())}get ctime(){return new Date(Number(this.ctimeMs))}set ctime(t){this.ctimeMs=this._convert(t.getTime())}get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(t){this.birthtimeMs=this._convert(t.getTime())}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return(this.mode&61440)===49152}isBlockDevice(){return(this.mode&61440)===24576}isCharacterDevice(){return(this.mode&61440)===8192}isFIFO(){return(this.mode&61440)===4096}hasAccess(t){if(ye.euid===0||ye.egid===0)return!0;let i=(ye.uid==this.uid?448:0)|(ye.gid==this.gid?56:0)|7;return(t&this.mode&i)==t}cred(t=Number(this.uid),i=Number(this.gid)){return{uid:t,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:t,egid:i}}chmod(t){this.mode=this._convert(this.mode&61440|t)}chown(t,i){t=Number(t),i=Number(i),!isNaN(t)&&0<=t&&t<2**32&&(this.uid=this._convert(t)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}get atimeNs(){return BigInt(this.atimeMs)*1000n}get mtimeNs(){return BigInt(this.mtimeMs)*1000n}get ctimeNs(){return BigInt(this.ctimeMs)*1000n}get birthtimeNs(){return BigInt(this.birthtimeMs)*1000n}};s(Lo,"StatsCommon");var nn=Lo,No=class No extends nn{constructor(){super(...arguments);this._isBigint=!1}};s(No,"Stats");var G=No,Co=class Co extends nn{constructor(){super(...arguments);this._isBigint=!0}};s(Co,"BigIntStats");var be=Co;function To(e,t){return e.size==t.size&&+e.atime==+t.atime&&+e.mtime==+t.mtime&&+e.ctime==+t.ctime&&e.mode==t.mode}s(To,"isStatsEqual");var Ro=525687744115,Bo=class Bo{constructor(){this.type=525687744115;this.bsize=4096;this.blocks=0;this.bfree=0;this.bavail=0;this.files=Oe;this.ffree=Oe}};s(Bo,"StatsFs");var rn=Bo,Do=class Do{constructor(){this.type=0x7a656e6673n;this.bsize=4096n;this.blocks=0n;this.bfree=0n;this.bavail=0n;this.files=BigInt(Oe);this.ffree=BigInt(Oe)}};s(Do,"BigIntStatsFs");var on=Do;var Nn={};Un(Nn,{FileHandle:()=>ce,access:()=>Wa,appendFile:()=>Ta,chmod:()=>Ba,chown:()=>Na,constants:()=>kt,copyFile:()=>Hr,cp:()=>Kr,exists:()=>je,lchmod:()=>Da,lchown:()=>Ca,link:()=>Ra,lstat:()=>jr,lutimes:()=>Ma,mkdir:()=>Ln,mkdtemp:()=>Ua,open:()=>Se,opendir:()=>ja,readFile:()=>Rn,readdir:()=>Ht,readlink:()=>$r,realpath:()=>Ue,rename:()=>Oa,rm:()=>Vr,rmdir:()=>qr,stat:()=>st,statfs:()=>qa,symlink:()=>La,truncate:()=>Pa,unlink:()=>Tn,utimes:()=>zr,watch:()=>VS,writeFile:()=>Mi});var oi=$i(Ie(),1);Promise.withResolvers??=function(){let e,t;return{promise:new Promise((n,r)=>{e=n,t=r}),resolve:e,reject:t}};Symbol.dispose??=Symbol("Symbol.dispose");Symbol.asyncDispose??=Symbol("Symbol.asyncDispose");var yy=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function M(e){if(typeof e=="number")return ol(e);if(!yy.includes(e))throw new Error("Invalid flag string: "+e);return e}s(M,"parseFlag");function ol(e){switch(e){case 0:return"r";case 1052672:return"rs";case 2:return"r+";case 1052674:return"rs+";case 577:return"w";case 705:return"wx";case 578:return"w+";case 706:return"wx+";case 1089:return"a";case 1217:return"ax";case 1090:return"a+";case 1218:return"ax+";default:throw new Error("Invalid flag number: "+e)}}s(ol,"flagToString");function my(e){switch(e){case"r":return 0;case"rs":return 1052672;case"r+":return 2;case"rs+":return 1052674;case"w":return 577;case"wx":return 705;case"w+":return 578;case"wx+":return 706;case"a":return 1089;case"ax":return 1217;case"a+":return 1090;case"ax+":return 1218;default:throw new Error("Invalid flag string: "+e)}}s(my,"flagToNumber");function sn(e){let t=0;return t<<=1,t+=+vt(e),t<<=1,t+=+ge(e),t<<=1,t}s(sn,"flagToMode");function vt(e){return e.indexOf("r")!==-1||e.indexOf("+")!==-1}s(vt,"isReadable");function ge(e){return e.indexOf("w")!==-1||e.indexOf("a")!==-1||e.indexOf("+")!==-1}s(ge,"isWriteable");function an(e){return e.indexOf("w")!==-1}s(an,"isTruncating");function pt(e){return e.indexOf("a")!==-1}s(pt,"isAppendable");function by(e){return e.indexOf("s")!==-1}s(by,"isSynchronous");function cn(e){return e.indexOf("x")!==-1}s(cn,"isExclusive");var Mo=class Mo{constructor(t,i){this.fs=t;this.path=i}[Symbol.asyncDispose](){return this.close()}[Symbol.dispose](){return this.closeSync()}datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Mo,"File");var qt=Mo,Wo=class Wo extends qt{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,i.metadata().noResizableBuffers?{}:{maxByteLength:Oe}))){super(i,n);this.fs=i;this.flag=r;this.stats=o;this._buffer=a;this._position=0;this.dirty=!1;this.closed=!1;if(this.stats.size!=a.byteLength){if(vt(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this.dirty=!0}}get buffer(){return this._buffer}get position(){return pt(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(await this.fs.sync(this.path,this._buffer,this.stats),this.dirty=!1)}syncSync(){if(this.closed)throw u.With("EBADF",this.path,"File.sync");this.dirty&&(this.fs.syncSync(this.path,this._buffer,this.stats),this.dirty=!1)}async close(){if(this.closed)throw u.With("EBADF",this.path,"File.close");await this.sync(),this.dispose()}closeSync(){if(this.closed)throw u.With("EBADF",this.path,"File.close");this.syncSync(),this.dispose()}dispose(i){if(this.closed)throw u.With("EBADF",this.path,"File.dispose");if(this.dirty&&!i)throw u.With("EBUSY",this.path,"File.dispose");delete this._buffer,delete this.stats,this.closed=!0}stat(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return Promise.resolve(new G(this.stats))}statSync(){if(this.closed)throw u.With("EBADF",this.path,"File.stat");return new G(this.stats)}_truncate(i){if(this.closed)throw u.With("EBADF",this.path,"File.truncate");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");if(this.stats.mtimeMs=Date.now(),i>this._buffer.length){let n=new Uint8Array(i-this._buffer.length);this.writeSync(n,0,n.length,this._buffer.length);return}this.stats.size=i,this._buffer=this._buffer.slice(0,i)}async truncate(i){this._truncate(i),await this.sync()}truncateSync(i){this._truncate(i),this.syncSync()}_write(i,n=0,r=this.stats.size,o=this.position){if(this.closed)throw u.With("EBADF",this.path,"File.write");if(this.dirty=!0,!ge(this.flag))throw new u(1,"File not opened with a writeable mode.");let a=o+r;if(a>this.stats.size&&(this.stats.size=a,a>this._buffer.byteLength))if(this._buffer.buffer.resizable&&this._buffer.buffer.maxByteLength<=a)this._buffer.buffer.resize(a);else{let l=new Uint8Array(new ArrayBuffer(a,this.fs.metadata().noResizableBuffers?{}:{maxByteLength:Oe}));l.set(this._buffer),this._buffer=l}let c=i.slice(n,n+r);return this._buffer.set(c,o),this.stats.mtimeMs=Date.now(),this.position=o+c.byteLength,c.byteLength}async write(i,n,r,o){let a=this._write(i,n,r,o);return await this.sync(),a}writeSync(i,n=0,r=this.stats.size,o=this.position){let a=this._write(i,n,r,o);return this.syncSync(),a}_read(i,n=0,r=this.stats.size,o){if(this.closed)throw u.With("EBADF",this.path,"File.read");if(!vt(this.flag))throw new u(1,"File not opened with a readable mode.");this.dirty=!0,o??=this.position;let a=o+r;a>this.stats.size&&(a=o+Math.max(this.stats.size-o,0)),this.stats.atimeMs=Date.now(),this._position=a;let c=a-o;return c==0||new Uint8Array(i.buffer,n,r).set(this._buffer.slice(o,a)),c}async read(i,n,r,o){let a=this._read(i,n,r,o);return await this.sync(),{bytesRead:a,buffer:i}}readSync(i,n,r,o){let a=this._read(i,n,r,o);return this.statSync(),a}async chmod(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),await this.sync()}chmodSync(i){if(this.closed)throw u.With("EBADF",this.path,"File.chmod");this.dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),await this.sync()}chownSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.chown");this.dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,await this.sync()}utimesSync(i,n){if(this.closed)throw u.With("EBADF",this.path,"File.utimes");this.dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}async _setType(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,await this.sync()}_setTypeSync(i){if(this.closed)throw u.With("EBADF",this.path,"File._setType");this.dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}async[Symbol.asyncDispose](){await this.close()}[Symbol.dispose](){this.closeSync()}};s(Wo,"PreloadFile");var we=Wo,Uo=class Uo extends we{constructor(t,i,n,r,o){super(t,i,n,r,o)}sync(){return Promise.resolve()}syncSync(){}close(){return Promise.resolve()}closeSync(){}};s(Uo,"NoSyncFile");var mi=Uo;var Ft=$i(Ie(),1);var jo=class jo{metadata(){return{name:this.constructor.name.toLowerCase(),readonly:!1,totalSpace:0,freeSpace:0,noResizableBuffers:!1,noAsyncCache:this._disableSync??!1,type:Ro}}constructor(...t){}async ready(){}async exists(t){try{return await this.stat(t),!0}catch(i){return i.code!="ENOENT"}}existsSync(t){try{return this.statSync(t),!0}catch(i){return i.code!="ENOENT"}}};s(jo,"FileSystem");var pe=jo;var sl=5,qo=class qo extends pe{constructor(i){super();this.store=i;this._initialized=!1}async ready(){this._initialized||(await this.checkRoot(),this._initialized=!0)}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){await this.store.clear(),await this.checkRoot()}emptySync(){this.store.clearSync(),this.checkRootSync()}async rename(i,n){var w=[];try{let r=S(w,this.store.transaction(),!0);let o=_(i),a=D(i),c=_(n),l=D(n),f=await this.findINode(r,o),d=await this.getDirListing(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")===0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=await this.findINode(r,c),p=await this.getDirListing(r,b,c));if(p[l]){let L=await this.getINode(r,p[l],n);if(!L.toStats().isFile())throw u.With("EPERM",n,"rename");await r.remove(L.ino),await r.remove(p[l])}p[l]=h;await r.set(f.ino,xe(d));await r.set(b.ino,xe(p));await r.commit()}catch(g){var A=g,k=!0}finally{var v=E(w,A,k);v&&await v}}renameSync(i,n){var w=[];try{let r=S(w,this.store.transaction());let o=_(i),a=D(i),c=_(n),l=D(n),f=this.findINodeSync(r,o),d=this.getDirListingSync(r,f,o);if(!d[a])throw u.With("ENOENT",i,"rename");let h=d[a];delete d[a];if((c+"/").indexOf(i+"/")==0)throw new u(16,o);let b,p;c===o?(b=f,p=d):(b=this.findINodeSync(r,c),p=this.getDirListingSync(r,b,c));if(p[l]){let v=this.getINodeSync(r,p[l],n);if(!v.toStats().isFile())throw u.With("EPERM",n,"rename");r.removeSync(v.ino),r.removeSync(p[l])}p[l]=h;r.setSync(f.ino,xe(d));r.setSync(b.ino,xe(p));r.commitSync()}catch(g){var A=g,k=!0}finally{E(w,A,k)}}async stat(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);if(!r)throw u.With("ENOENT",i,"stat");return r.toStats()}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}statSync(i){var r=[];try{let n=S(r,this.store.transaction());return this.findINodeSync(n,i).toStats()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async createFile(i,n,r){let o=await this.commitNew(i,32768,r,new Uint8Array(0));return new we(this,i,n,o.toStats(),new Uint8Array(0))}createFileSync(i,n,r){return this.commitNewSync(i,32768,r),this.openFileSync(i,n)}async openFile(i,n){var c=[];try{let r=S(c,this.store.transaction(),!0);let o=await this.findINode(r,i),a=await r.get(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}openFileSync(i,n){var c=[];try{let r=S(c,this.store.transaction());let o=this.findINodeSync(r,i),a=r.getSync(o.ino);if(!a)throw u.With("ENOENT",i,"openFile");return new we(this,i,n,o.toStats(),a)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}async unlink(i){return this.remove(i,!1)}unlinkSync(i){this.removeSync(i,!1)}async rmdir(i){if((await this.readdir(i)).length)throw u.With("ENOTEMPTY",i,"rmdir");await this.remove(i,!0)}rmdirSync(i){if(this.readdirSync(i).length)throw u.With("ENOTEMPTY",i,"rmdir");this.removeSync(i,!0)}async mkdir(i,n){await this.commitNew(i,16384,n,Ne("{}"))}mkdirSync(i,n){this.commitNewSync(i,16384,n,Ne("{}"))}async readdir(i){var o=[];try{let n=S(o,this.store.transaction(),!0);let r=await this.findINode(n,i);return Object.keys(await this.getDirListing(n,r,i))}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}readdirSync(i){var o=[];try{let n=S(o,this.store.transaction());let r=this.findINodeSync(n,i);return Object.keys(this.getDirListingSync(n,r,i))}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async sync(i,n,r){var f=[];try{let o=S(f,this.store.transaction(),!0);let a=await this._findINode(o,_(i),D(i)),c=await this.getINode(o,a,i),l=c.update(r);await o.set(c.ino,n);l&&await o.set(a,c.data);await o.commit()}catch(d){var h=d,b=!0}finally{var p=E(f,h,b);p&&await p}}syncSync(i,n,r){var f=[];try{let o=S(f,this.store.transaction());let a=this._findINodeSync(o,_(i),D(i)),c=this.getINodeSync(o,a,i),l=c.update(r);o.setSync(c.ino,n);l&&o.setSync(a,c.data);o.commitSync()}catch(d){var h=d,b=!0}finally{E(f,h,b)}}async link(i,n){var d=[];try{let r=S(d,this.store.transaction(),!0);let o=_(n),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o);let l=await this._findINode(r,_(i),D(i));let f=await this.getINode(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{var w=E(d,b,p);w&&await w}}linkSync(i,n){var d=[];try{let r=S(d,this.store.transaction());let o=_(n),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o);let l=this._findINodeSync(r,_(i),D(i));let f=this.getINodeSync(r,l,i);f.nlink++;c[D(n)]=l;r.setSync(l,f.data);r.setSync(a.ino,xe(c));r.commitSync()}catch(h){var b=h,p=!0}finally{E(d,b,p)}}async checkRoot(){var r=[];try{let i=S(r,this.store.transaction(),!0);if(await i.get(Ye))return;let n=new Ge;n.mode=16895;await i.set(n.ino,Ne("{}"));await i.set(Ye,n.data);await i.commit()}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}checkRootSync(){var r=[];try{let i=S(r,this.store.transaction());if(i.getSync(Ye))return;let n=new Ge;n.mode=16895;i.setSync(n.ino,Ne("{}"));i.setSync(Ye,n.data);i.commitSync()}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async _findINode(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?await this.getINode(i,Ye,n):await this.findINode(i,n,o),l=await this.getDirListing(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}_findINodeSync(i,n,r,o=new Set){let a=z(n,r);if(o.has(a))throw new u(5,"Infinite loop detected while finding inode",a);if(o.add(a),n=="/"&&r==="")return Ye;let c=n=="/"?this.getINodeSync(i,Ye,n):this.findINodeSync(i,n,o),l=this.getDirListingSync(i,c,n);if(!(r in l))throw u.With("ENOENT",_t(n,r),"_findINode");return l[r]}async findINode(i,n,r=new Set){let o=await this._findINode(i,_(n),D(n),r);return this.getINode(i,o,n)}findINodeSync(i,n,r=new Set){let o=this._findINodeSync(i,_(n),D(n),r);return this.getINodeSync(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}getINodeSync(i,n,r){let o=i.getSync(n);if(!o)throw u.With("ENOENT",r,"getINode");return new Ge(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}getDirListingSync(i,n,r){if(!n.toStats().isDirectory())throw u.With("ENOTDIR",r,"getDirListing");let o=i.getSync(n.ino);if(!o)throw u.With("ENOENT",r,"getDirListing");return $n(o)}async addNew(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!await i.get(a))return await i.set(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}addNewSync(i,n,r){for(let o=0;o<sl;o++){let a=tn();if(!i.getSync(a))return i.setSync(a,n),a}throw new u(28,"No inode IDs available",r,"addNewNode")}async commitNew(i,n,r,o){var b=[];try{let a=S(b,this.store.transaction(),!0);let c=_(i),l=await this.findINode(a,c);let f=D(i),d=await this.getDirListing(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw await a.abort(),u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=await this.addNew(a,o,i);h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;h.size=o.length;d[f]=await this.addNew(a,h.data,i);await a.set(l.ino,xe(d));await a.commit();return h}catch(p){var w=p,g=!0}finally{var A=E(b,w,g);A&&await A}}commitNewSync(i,n,r,o=new Uint8Array){var b=[];try{let a=S(b,this.store.transaction());let c=_(i),l=this.findINodeSync(a,c);let f=D(i),d=this.getDirListingSync(a,l,c);if(i==="/")throw u.With("EEXIST",i,"commitNew");if(d[f])throw u.With("EEXIST",i,"commitNew");let h=new Ge;h.ino=this.addNewSync(a,o,i);h.size=o.length;h.mode=r|n;h.uid=ye.uid;h.gid=ye.gid;d[f]=this.addNewSync(a,h.data,i);a.setSync(l.ino,xe(d));a.commitSync();return h}catch(p){var w=p,g=!0}finally{E(b,w,g)}}async remove(i,n){var h=[];try{let r=S(h,this.store.transaction(),!0);let o=_(i),a=await this.findINode(r,o),c=await this.getDirListing(r,a,o),l=D(i);if(!c[l])throw u.With("ENOENT",i,"remove");let f=c[l];let d=await this.getINode(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");await r.set(a.ino,xe(c));--d.nlink<1&&(await r.remove(d.ino),await r.remove(f));await r.commit()}catch(b){var p=b,w=!0}finally{var g=E(h,p,w);g&&await g}}removeSync(i,n){var h=[];try{let r=S(h,this.store.transaction());let o=_(i),a=this.findINodeSync(r,o),c=this.getDirListingSync(r,a,o),l=D(i),f=c[l];if(!f)throw u.With("ENOENT",i,"remove");let d=this.getINodeSync(r,f,i);delete c[l];if(!n&&d.toStats().isDirectory())throw u.With("EISDIR",i,"remove");if(n&&!d.toStats().isDirectory())throw u.With("ENOTDIR",i,"remove");r.setSync(a.ino,xe(c));--d.nlink<1&&(r.removeSync(d.ino),r.removeSync(f));r.commitSync()}catch(b){var p=b,w=!0}finally{E(h,p,w)}}};s(qo,"StoreFS");var ln=qo;var zo=class zo{constructor(t){this.store=t;this.done=!1}async[Symbol.asyncDispose](){this.done||await this.abort()}[Symbol.dispose](){this.done||this.abortSync()}};s(zo,"Transaction");var fn=zo,Vo=class Vo extends fn{async get(t){return this.getSync(t)}async set(t,i){return this.setSync(t,i)}async remove(t){return this.removeSync(t)}async commit(){return this.commitSync()}async abort(){return this.abortSync()}};s(Vo,"SyncTransaction");var un=Vo,Ho=class Ho extends fn{getSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.getSync")}setSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.setSync")}removeSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.removeSync")}commitSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.commitSync")}abortSync(){throw u.With("ENOSYS",void 0,"AsyncTransaction.abortSync")}};s(Ho,"AsyncTransaction");var $o=Ho;var Go=class Go{constructor(){this.cache=new Map;this.queue=new Set}get(t){return this.cache.get(t)}set(t,i){this.cache.set(t,i),this.queue.add(this._set(t,i))}delete(t){this.cache.delete(t),this.queue.add(this._delete(t))}clearSync(){this.cache.clear(),this.queue.add(this.clear())}async sync(){for(let[t,i]of await this.entries())this.cache.has(t)||this.cache.set(t,i);for(let t of this.queue)await t}transaction(){return new bi(this)}};s(Go,"SimpleAsyncStore");var Ko=Go,Yo=class Yo extends un{constructor(){super(...arguments);this.originalData=new Map;this.modifiedKeys=new Set}getSync(i){let n=this.store.get(i);return this.stashOldValue(i,n),n}setSync(i,n){return this.markModified(i),this.store.set(i,n)}removeSync(i){this.markModified(i),this.store.delete(i)}commitSync(){this.done=!0}abortSync(){if(this.done){for(let i of this.modifiedKeys){let n=this.originalData.get(i);n?this.store.set(i,n):this.store.delete(i)}this.done=!0}}stashOldValue(i,n){this.originalData.has(i)||this.originalData.set(i,n)}markModified(i){this.modifiedKeys.add(i),this.originalData.has(i)||this.originalData.set(i,this.store.get(i))}};s(Yo,"SimpleTransaction");var bi=Yo;var Xo=class Xo extends Map{constructor(i="tmp"){super();this.name=i}async sync(){}clearSync(){this.clear()}transaction(){return new bi(this)}};s(Xo,"InMemoryStore");var Xn=Xo,al={name:"InMemory",isAvailable:s(function(){return!0},"isAvailable"),options:{name:{type:"string",required:!1,description:"The name of the store"}},create:s(function({name:e}){let t=new ln(new Xn(e));return t.checkRootSync(),t},"create")},dn=al;var $t=new Map,gy=100;function hn(e){let t=gy++;return $t.set(t,e),t}s(hn,"file2fd");function j(e){if(!$t.has(e))throw new u(9);return $t.get(e)}s(j,"fd2file");var Pe=new Map;zt("/",dn.create({name:"root"}));function zt(e,t){if(e[0]!=="/"&&(e="/"+e),e=_t(e),Pe.has(e))throw new u(22,"Mount point "+e+" is already in use.");Pe.set(e,t)}s(zt,"mount");function gi(e){if(e[0]!=="/"&&(e=`/${e}`),e=_t(e),!Pe.has(e))throw new u(22,"Mount point "+e+" is already unmounted.");Pe.delete(e)}s(gi,"umount");function R(e){e=x(e);let t=[...Pe].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of t)if(i.length<=e.length&&e.startsWith(i))return e=e.slice(i.length>1?i.length:0),e===""&&(e="/"),{fs:n,path:e,mountPoint:i};throw new u(5,"ZenFS not initialized with a file system")}s(R,"resolveMount");function cl(e,t){for(let[i,n]of Object.entries(t))e=e?.replaceAll(i,n);return e}s(cl,"fixPaths");function Y(e,t){return typeof e.stack=="string"&&(e.stack=cl(e.stack,t)),e.message=cl(e.message,t),e}s(Y,"fixError");function pn(e){"/"in e&&gi("/");for(let[t,i]of Object.entries(e))zt(t,i)}s(pn,"mountObject");function Jn(e,t){let i=e.metadata(),n=i.blockSize||4096;return{type:(t?BigInt:Number)(i.type),bsize:(t?BigInt:Number)(n),ffree:(t?BigInt:Number)(i.freeNodes||Oe),files:(t?BigInt:Number)(i.totalNodes||Oe),bavail:(t?BigInt:Number)(i.freeSpace/n),bfree:(t?BigInt:Number)(i.freeSpace/n),blocks:(t?BigInt:Number)(i.totalSpace/n)}}s(Jn,"_statfs");var Jo=class Jo extends Ji.default{constructor(i){super();this.path=i}off(i,n,r,o){return super.off(i,n,r,o)}removeListener(i,n,r,o){return super.removeListener(i,n,r,o)}setMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.setMaxListeners")}getMaxListeners(){throw u.With("ENOSYS",this.path,"Watcher.getMaxListeners")}prependListener(){throw u.With("ENOSYS",this.path,"Watcher.prependListener")}prependOnceListener(){throw u.With("ENOSYS",this.path,"Watcher.prependOnceListener")}rawListeners(){throw u.With("ENOSYS",this.path,"Watcher.rawListeners")}ref(){return this}unref(){return this}};s(Jo,"Watcher");var Qn=Jo,Qo=class Qo extends Qn{constructor(i,n){super(i);this.options=n;wy(i.toString(),this)}close(){super.emit("close"),Sy(this.path.toString(),this)}[Symbol.dispose](){this.close()}};s(Qo,"FSWatcher");var wi=Qo,Zo=class Zo extends Qn{constructor(i,n){super(i);this.options=n;this.start()}onInterval(){try{let i=Te(this.path);To(this.previous,i)||(this.emit("change",i,this.previous),this.previous=i)}catch(i){this.emit("error",i)}}start(){let i=this.options.interval||5e3;try{this.previous=Te(this.path)}catch(n){this.emit("error",n);return}this.intervalId=setInterval(this.onInterval.bind(this),i),!this.options.persistent&&typeof this.intervalId=="object"&&this.intervalId.unref()}stop(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0),this.removeAllListeners()}};s(Zo,"StatWatcher");var Zn=Zo,De=new Map;function wy(e,t){let i=x(e);De.has(i)||De.set(i,new Set),De.get(i).add(t)}s(wy,"addWatcher");function Sy(e,t){let i=x(e);De.has(i)&&(De.get(i).delete(t),De.get(i).size===0&&De.delete(i))}s(Sy,"removeWatcher");function W(e,t){let i=x(t);if(De.has(i))for(let r of De.get(i))r.emit("change",e,D(t));let n=_(i);for(;n!==i&&n!=="/";){if(De.has(n))for(let r of De.get(n))r.emit("change",e,D(t));i=n,n=_(n)}}s(W,"emitChange");function ll(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!Te(_(e)).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i===n){i.fs.renameSync(i.path,n.path),W("rename",e.toString());return}bn(t,tr(e)),er(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(ll,"renameSync");function Je(e){e=x(e);try{let{fs:t,path:i}=R(Xe(e));return t.existsSync(i)}catch(t){if(t.errno==2)return!1;throw t}}s(Je,"existsSync");function Te(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e);try{let r=i.statSync(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(Te,"statSync");function es(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=i.statSync(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(es,"lstatSync");function fl(e,t=0){var n=[];try{let i=S(n,Vt(e,"r+"));t||=0;if(t<0)throw new u(22);i.truncateSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}s(fl,"truncateSync");function er(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"unlink");t.unlinkSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(er,"unlinkSync");function Vt(e,t,i,n=!0){e=x(e);let r=ke(i,420),o=M(t);e=n&&Je(e)?Xe(e):e;let{fs:a,path:c}=R(e);if(!a.existsSync(c)){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=a.statSync(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return a.createFileSync(c,o,r)}let l=a.statSync(c);if(!l.hasAccess(r)||!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=a.openFileSync(c,o);return an(o)&&(f.truncateSync(0),f.syncSync()),f}s(Vt,"_openSync");function yn(e,t,i=0){return hn(Vt(e,t,i,!0))}s(yn,"openSync");function mn(e,t,i){return hn(Vt(e,t,i,!1))}s(mn,"lopenSync");function ul(e,t,i){var a=[];try{let n=S(a,Vt(e,t,420,i));let r=n.statSync();let o=new Uint8Array(r.size);n.readSync(o,0,r.size,0);return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}s(ul,"_readFileSync");function tr(e,t={}){let i=ve(t,null,"r",420),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed to readFile must allow for reading.");let r=Ft.Buffer.from(ul(typeof e=="number"?j(e).path:e.toString(),i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(tr,"readFileSync");function bn(e,t,i={}){var c=[];try{let n=ve(i,"utf8","w+",420);let r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed to writeFile must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);if(!o)throw new u(22,"Data not specified");let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength,0);W("change",e.toString())}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(bn,"writeFileSync");function dl(e,t,i={}){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?Ft.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,Vt(typeof e=="number"?j(e).path:e.toString(),r,n.mode,!0));a.writeSync(o,0,o.byteLength)}catch(l){var f=l,d=!0}finally{E(c,f,d)}}s(dl,"appendFileSync");function hl(e,t){let i=j(e).statSync();return t?.bigint?new be(i):i}s(hl,"fstatSync");function It(e){j(e).closeSync(),$t.delete(e)}s(It,"closeSync");function pl(e,t=0){if(t||=0,t<0)throw new u(22);j(e).truncateSync(t)}s(pl,"ftruncateSync");function yl(e){j(e).syncSync()}s(yl,"fsyncSync");function ml(e){j(e).datasyncSync()}s(ml,"fdatasyncSync");function bl(e,t,i,n,r){let o,a,c,l;if(typeof t=="string"){l=typeof i=="number"?i:null;let h=typeof n=="string"?n:"utf8";a=0,o=Ft.Buffer.from(t,h),c=o.byteLength}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,l=typeof r=="number"?r:null;let f=j(e);l??=f.position;let d=f.writeSync(o,a,c,l);return W("change",f.path),d}s(bl,"writeSync");function gl(e,t,i,n,r){let o=j(e),a=typeof i=="object"?i.offset:i;return typeof i=="object"&&(n=i.length,r=i.position),r=Number(r),isNaN(r)&&(r=o.position),o.readSync(t,a,n,r)}s(gl,"readSync");function ir(e,t,i){j(e).chownSync(t,i)}s(ir,"fchownSync");function nr(e,t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");j(e).chmodSync(i)}s(nr,"fchmodSync");function rr(e,t,i){j(e).utimesSync(Wt(t),Wt(i))}s(rr,"futimesSync");function ts(e){e=x(e);let{fs:t,path:i}=R(Je(e)?Xe(e):e);try{if(!t.statSync(i).hasAccess(2))throw u.With("EACCES",i,"rmdir");t.rmdirSync(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(ts,"rmdirSync");function or(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=Je(e)?Xe(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!n.statSync(_(r)).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");return n.mkdirSync(r,i)}let a=[];for(let c=r,l=e;!n.existsSync(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!n.statSync(_(c)).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");n.mkdirSync(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(or,"mkdirSync");function Si(e,t){e=x(e);let{fs:i,path:n}=R(Je(e)?Xe(e):e),r;if(!Te(e).hasAccess(4))throw u.With("EACCES",e,"readdir");try{r=i.readdirSync(n)}catch(o){throw Y(o,{[n]:e})}for(let o of Pe.keys()){if(!o.startsWith(e))continue;let a=o.slice(e.length);a.includes("/")||a.length==0||r.push(a)}return r.map(o=>typeof t=="object"&&t?.withFileTypes?new At(o,Te(z(e.toString(),o))):t=="buffer"||typeof t=="object"&&t?.encoding=="buffer"?Ft.Buffer.from(o):o)}s(Si,"readdirSync");function wl(e,t){if(e=x(e),!Te(_(e)).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!Te(_(t)).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!i.statSync(n).hasAccess(2))throw u.With("EACCES",n,"link");return i.linkSync(n,t)}catch(o){throw Y(o,{[n]:e,[r.path]:t})}}s(wl,"linkSync");function Sl(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid type: "+i);if(Je(t))throw u.With("EEXIST",t.toString(),"symlink");bn(t,e.toString()),Vt(t,"r+",420,!1)._setTypeSync(40960)}s(Sl,"symlinkSync");function is(e,t){let i=Ft.Buffer.from(ul(e.toString(),"r",!1)),n=typeof t=="object"?t?.encoding:t;return n=="buffer"?i:i.toString(n)}s(is,"readlinkSync");function El(e,t,i){let n=yn(e,"r+");ir(n,t,i),It(n)}s(El,"chownSync");function _l(e,t,i){let n=mn(e,"r+");ir(n,t,i),It(n)}s(_l,"lchownSync");function xl(e,t){let i=yn(e,"r+");nr(i,t),It(i)}s(xl,"chmodSync");function kl(e,t){let i=mn(e,"r+");nr(i,t),It(i)}s(kl,"lchmodSync");function ns(e,t,i){let n=yn(e,"r+");rr(n,t,i),It(n)}s(ns,"utimesSync");function vl(e,t,i){let n=mn(e,"r+");rr(n,t,i),It(n)}s(vl,"lutimesSync");function Xe(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":Xe(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return o.statSync(a).isSymbolicLink()?Xe(c+is(r,t).toString()):r}catch(l){throw Y(l,{[a]:r})}}s(Xe,"realpathSync");function Fl(e,t=384){if(!Te(e).hasAccess(t))throw new u(13)}s(Fl,"accessSync");function rs(e,t){switch(e=x(e),Te(e).mode&61440){case 16384:if(t?.recursive)for(let n of Si(e))rs(z(e,n),t);ts(e);return;case 32768:case 40960:er(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(rs,"rmSync");function Il(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return or(r),i=="buffer"?Ft.Buffer.from(r):r}s(Il,"mkdtempSync");function os(e,t,i){if(e=x(e),t=x(t),i&&i&1&&Je(t))throw new u(17,"Destination file already exists.",t,"copyFile");bn(t,tr(e)),W("rename",t.toString())}s(os,"copyFileSync");function Al(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.readSync(o,0,o.byteLength,i+r);return r}s(Al,"readvSync");function Ol(e,t,i){let n=j(e),r=0;for(let o of t)r+=n.writeSync(new Uint8Array(o.buffer),0,o.byteLength,i+r);return r}s(Ol,"writevSync");function Pl(e,t){return e=x(e),new Ot(e)}s(Pl,"opendirSync");function ss(e,t,i){e=x(e),t=x(t);let n=es(e);if(i?.errorOnExist&&Je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");or(t,{recursive:!0});for(let r of Si(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||ss(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:os(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&ns(t,n.atime,n.mtime)}s(ss,"cpSync");function Tl(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(Tl,"statfsSync");var as=class as{constructor(t,i){this.path=t;this.stats=i}get name(){return D(this.path)}get parentPath(){return this.path}isFile(){return this.stats.isFile()}isDirectory(){return this.stats.isDirectory()}isBlockDevice(){return this.stats.isBlockDevice()}isCharacterDevice(){return this.stats.isCharacterDevice()}isSymbolicLink(){return this.stats.isSymbolicLink()}isFIFO(){return this.stats.isFIFO()}isSocket(){return this.stats.isSocket()}};s(as,"Dirent");var At=as,cs=class cs{constructor(t){this.path=t;this.closed=!1}checkClosed(){if(this.closed)throw new u(9,"Can not use closed Dir")}close(t){if(this.closed=!0,!t)return Promise.resolve();t()}closeSync(){this.closed=!0}async _read(){return this.checkClosed(),this._entries??=await Ht(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}read(t){if(!t)return this._read();this._read().then(i=>t(void 0,i))}readSync(){return this.checkClosed(),this._entries??=Si(this.path,{withFileTypes:!0}),this._entries.length?this._entries.shift()??null:null}async next(){let t=await this._read();return t?{done:!1,value:t}:(await this.close(),{done:!0,value:void 0})}[Symbol.asyncIterator](){return this}};s(cs,"Dir");var Ot=cs;var Ur=$i(jd(),1);var Ia=class Ia extends Ur.Readable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Ia,"ReadStream");var Nt=Ia,Aa=class Aa extends Ur.Writable{close(t=()=>null){try{super.destroy(),super.emit("close"),t()}catch(i){t(new u(5,i.toString()))}}};s(Aa,"WriteStream");var Ct=Aa;var $a=class $a{constructor(t){let i=typeof t!="number";this.fd=i?hn(t):t,this.file=i?t:j(t)}async chown(t,i){await this.file.chown(t,i),W("change",this.file.path)}async chmod(t){let i=ke(t,-1);if(i<0)throw new u(22,"Invalid mode.");await this.file.chmod(i),W("change",this.file.path)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}async truncate(t){if(t||=0,t<0)throw new u(22);await this.file.truncate(t),W("change",this.file.path)}async utimes(t,i){await this.file.utimes(Wt(t),Wt(i)),W("change",this.file.path)}async appendFile(t,i={}){let n=ve(i,"utf8","a",420),r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length),W("change",this.file.path)}read(t,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(t,i,n,r)}async readFile(t){let i=ve(t,null,"r",292),n=M(i.flag);if(!vt(n))throw new u(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),{buffer:o}=await this.file.read(new Uint8Array(r),0,r,0),a=oi.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(t={}){let i=s(async r=>{try{let c=0,l=0,f=NaN;for(;f>0;){let d=await this.read(new Uint8Array(65536),0,65536,l);if(!d.bytesRead){r.close();return}if(r.enqueue(d.buffer.slice(0,d.bytesRead)),l+=d.bytesRead,++c>=1e7)throw new u(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream");f=d.bytesRead}}catch(o){r.error(o)}},"start"),n=globalThis;if(!("ReadableStream"in n))throw new u(38,"ReadableStream is missing on globalThis");return new n.ReadableStream({start:i,type:t.type})}readLines(t){throw u.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(t){let i=await this.file.stat();if(!i.hasAccess(4))throw u.With("EACCES",this.file.path,"stat");return t?.bigint?new be(i):i}async write(t,i,n,r){let o,a,c;if(typeof t=="string"){r=typeof i=="number"?i:null;let f=typeof n=="string"?n:"utf8";a=0,o=oi.Buffer.from(t,f),c=o.length}else o=new Uint8Array(t.buffer,t.byteOffset,t.byteLength),a=i,c=n,r=typeof r=="number"?r:null;r??=this.file.position;let l=await this.file.write(o,a,c,r);return W("change",this.file.path),{buffer:o,bytesWritten:l}}async writeFile(t,i={}){let n=ve(i,"utf8","w",420),r=M(n.flag);if(!ge(r))throw new u(22,"Flag passed must allow for writing.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):t;await this.file.write(o,0,o.length,0),W("change",this.file.path)}async close(){await this.file.close(),$t.delete(this.fd)}async writev(t,i){let n=0;for(let r of t)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:t}}async readv(t,i){let n=0;for(let r of t)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:t}}createReadStream(t){let i=new Nt({highWaterMark:t?.highWaterMark||65536,encoding:t.encoding,read:s(async n=>{try{let r=await this.read(new Uint8Array(n),0,n,this.file.position);i.push(r.bytesRead?r.buffer.slice(0,r.bytesRead):null),this.file.position+=r.bytesRead}catch(r){i.destroy(r)}},"read")});return i.path=this.file.path,i}createWriteStream(t){let i={highWaterMark:t?.highWaterMark,encoding:t?.encoding,write:s(async(r,o,a)=>{try{let{bytesWritten:c}=await this.write(r,null,o);a(c==r.length?null:new Error("Failed to write full chunk"))}catch(c){a(c)}},"write")},n=new Ct(i);return n.path=this.file.path,n}};s($a,"FileHandle");var ce=$a;async function Oa(e,t){e=x(e),t=x(t);let i=R(e),n=R(t);if(!(await st(_(e))).hasAccess(2))throw u.With("EACCES",e,"rename");try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path),W("rename",e.toString());return}await Mi(t,await Rn(e)),await Tn(e),W("rename",e.toString())}catch(r){throw Y(r,{[i.path]:e,[n.path]:t})}}s(Oa,"rename");async function je(e){try{let{fs:t,path:i}=R(await Ue(e));return await t.exists(i)}catch(t){if(t instanceof u&&t.code=="ENOENT")return!1;throw t}}s(je,"exists");async function st(e,t){e=x(e);let{fs:i,path:n}=R(await je(e)?await Ue(e):e);try{let r=await i.stat(n);if(!r.hasAccess(4))throw u.With("EACCES",e,"stat");return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(st,"stat");async function jr(e,t){e=x(e);let{fs:i,path:n}=R(e);try{let r=await i.stat(n);return t?.bigint?new be(r):r}catch(r){throw Y(r,{[n]:e})}}s(jr,"lstat");async function Pa(e,t=0){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.truncate(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Pa,"truncate");async function Tn(e){e=x(e);let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"unlink");await t.unlink(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(Tn,"unlink");async function Di(e,t,i=420,n){e=x(e);let r=ke(i,420),o=M(t);e=n&&await je(e)?await Ue(e):e;let{fs:a,path:c}=R(e),l=await a.stat(c).catch(()=>null);if(!l){if(!ge(o)&&!pt(o)||o=="r+")throw u.With("ENOENT",e,"_open");let d=await a.stat(_(c));if(!d.hasAccess(2))throw u.With("EACCES",_(e),"_open");if(!d.isDirectory())throw u.With("ENOTDIR",_(e),"_open");return new ce(await a.createFile(c,o,r))}if(!l.hasAccess(sn(o)))throw u.With("EACCES",e,"_open");if(cn(o))throw u.With("EEXIST",e,"_open");let f=new ce(await a.openFile(c,o));return an(o)&&(await f.truncate(0),await f.sync()),f}s(Di,"_open");async function Se(e,t="r",i=420){return await Di(e,t,i,!0)}s(Se,"open");async function Rn(e,t){var r=[];try{let i=ve(t,null,"r",420);let n=S(r,typeof e=="object"&&"fd"in e?e:await Se(e,i.flag,i.mode),!0);return await n.readFile(i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Rn,"readFile");async function Mi(e,t,i){var a=[];try{let n=ve(i,"utf8","w+",420);let r=S(a,e instanceof ce?e:await Se(e.toString(),n.flag,n.mode),!0);let o=t;if(typeof o!="string"&&!(o instanceof Uint8Array))throw new u(22,"Iterables and streams not supported",r.file.path,"writeFile");await r.writeFile(o,n)}catch(c){var l=c,f=!0}finally{var d=E(a,l,f);d&&await d}}s(Mi,"writeFile");async function Ta(e,t,i){var c=[];try{let n=ve(i,"utf8","a",420);let r=M(n.flag);if(!pt(r))throw new u(22,"Flag passed to appendFile must allow for appending.");if(typeof t!="string"&&!n.encoding)throw new u(22,"Encoding not specified");let o=typeof t=="string"?oi.Buffer.from(t,n.encoding):new Uint8Array(t.buffer,t.byteOffset,t.byteLength);let a=S(c,typeof e=="object"&&"fd"in e?e:await Se(e,n.flag,n.mode),!0);await a.appendFile(o,n)}catch(l){var f=l,d=!0}finally{var h=E(c,f,d);h&&await h}}s(Ta,"appendFile");async function qr(e){e=x(e),e=await je(e)?await Ue(e):e;let{fs:t,path:i}=R(e);try{if(!(await t.stat(i)).hasAccess(2))throw u.With("EACCES",i,"rmdir");await t.rmdir(i),W("rename",e.toString())}catch(n){throw Y(n,{[i]:e})}}s(qr,"rmdir");async function Ln(e,t){t=typeof t=="object"?t:{mode:t};let i=ke(t?.mode,511);e=x(e),e=await je(e)?await Ue(e):e;let{fs:n,path:r}=R(e),o={[r]:e};try{if(!t?.recursive){if(!(await n.stat(_(r))).hasAccess(2))throw u.With("EACCES",_(r),"mkdir");await n.mkdir(r,i),W("rename",e.toString());return}let a=[];for(let c=r,l=e;!await n.exists(c);c=_(c),l=_(l))a.unshift(c),o[c]=l;for(let c of a){if(!(await n.stat(_(c))).hasAccess(2))throw u.With("EACCES",_(c),"mkdir");await n.mkdir(c,i),W("rename",c)}return a[0]}catch(a){throw Y(a,o)}}s(Ln,"mkdir");async function Ht(e,t){if(e=x(e),!(await st(e)).hasAccess(4))throw u.With("EACCES",e,"readdir");e=await je(e)?await Ue(e):e;let{fs:i,path:n}=R(e),r;try{r=await i.readdir(n)}catch(a){throw Y(a,{[n]:e})}for(let a of Pe.keys())if(a.startsWith(e)){let c=a.slice(e.length);if(c.includes("/")||c.length==0)continue;r.push(c)}let o=[];for(let a of r)o.push(typeof t=="object"&&t?.withFileTypes?new At(a,await st(z(e,a))):a);return o}s(Ht,"readdir");async function Ra(e,t){if(e=x(e),!(await st(_(e))).hasAccess(4))throw u.With("EACCES",_(e),"link");if(t=x(t),!(await st(_(t))).hasAccess(2))throw u.With("EACCES",_(t),"link");let{fs:i,path:n}=R(e),r=R(t);if(i!=r.fs)throw u.With("EXDEV",t,"link");try{if(!(await i.stat(n)).hasAccess(2))throw u.With("EACCES",n,"link");return await i.link(n,r.path)}catch(o){throw Y(o,{[r.path]:t,[n]:e})}}s(Ra,"link");async function La(e,t,i="file"){if(!["file","dir","junction"].includes(i))throw new u(22,"Invalid symlink type: "+i);if(await je(t))throw u.With("EEXIST",t.toString(),"symlink");await Mi(t,e.toString()),await(await Di(t,"r+",420,!1)).file._setType(40960)}s(La,"symlink");async function $r(e,t){var o=[];try{let i=S(o,await Di(x(e),"r",420,!1),!0);let n=await i.readFile();let r=typeof t=="object"?t?.encoding:t;return r=="buffer"?n:n.toString(r)}catch(a){var c=a,l=!0}finally{var f=E(o,c,l);f&&await f}}s($r,"readlink");async function Na(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Na,"chown");async function Ca(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.chown(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ca,"lchown");async function Ba(e,t){var n=[];try{let i=S(n,await Se(e,"r+"),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Ba,"chmod");async function Da(e,t){var n=[];try{let i=S(n,await Di(e,"r+",420,!1),!0);await i.chmod(t)}catch(r){var o=r,a=!0}finally{var c=E(n,o,a);c&&await c}}s(Da,"lchmod");async function zr(e,t,i){var r=[];try{let n=S(r,await Se(e,"r+"),!0);await n.utimes(t,i)}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(zr,"utimes");async function Ma(e,t,i){var r=[];try{let n=S(r,await Di(e,"r+",420,!1),!0);await n.utimes(new Date(t),new Date(i))}catch(o){var a=o,c=!0}finally{var l=E(r,a,c);l&&await l}}s(Ma,"lutimes");async function Ue(e,t){e=x(e);let{base:i,dir:n}=jn(e),r=z(n=="/"?"/":await Ue(n),i),{fs:o,path:a,mountPoint:c}=R(r);try{return(await o.stat(a)).isSymbolicLink()?Ue(c+await $r(r)):r}catch(l){throw Y(l,{[a]:r})}}s(Ue,"realpath");function VS(e,t={}){return{[Symbol.asyncIterator](){let i=new wi(e.toString(),typeof t!="string"?t:{encoding:t});function n(r){return function(){let o=Promise.withResolvers();return i.on("change",(a,c)=>{o.resolve({value:{eventType:a,filename:c},done:r})}),o.promise}}return s(n,"withDone"),{next:n(!1),return:n(!0),throw:n(!0)}}}}s(VS,"watch");async function Wa(e,t=0){if(!(await st(e)).hasAccess(t))throw new u(13)}s(Wa,"access");async function Vr(e,t){switch(e=x(e),(await st(e)).mode&61440){case 16384:if(t?.recursive)for(let n of await Ht(e))await Vr(z(e,n),t);await qr(e);return;case 32768:case 40960:await Tn(e);return;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}}s(Vr,"rm");async function Ua(e,t){let i=typeof t=="object"?t?.encoding:t||"utf8",r="/tmp/"+`${e}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await Ln(r),i=="buffer"?oi.Buffer.from(r):r}s(Ua,"mkdtemp");async function Hr(e,t,i){if(e=x(e),t=x(t),i&&i&1&&await je(t))throw new u(17,"Destination file already exists.",t,"copyFile");await Mi(t,await Rn(e)),W("rename",t.toString())}s(Hr,"copyFile");async function ja(e,t){return e=x(e),new Ot(e)}s(ja,"opendir");async function Kr(e,t,i){e=x(e),t=x(t);let n=await jr(e);if(i?.errorOnExist&&await je(t))throw new u(17,"Destination file or directory already exists.",t,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new u(21,e+" is a directory (not copied)",e,"cp");await Ln(t,{recursive:!0});for(let r of await Ht(e,{withFileTypes:!0}))i.filter&&!i.filter(z(e,r.name),z(t,r.name))||await Kr(z(e,r.name),z(t,r.name),i);break;case 32768:case 40960:await Hr(e,t);break;case 24576:case 8192:case 4096:case 49152:default:throw new u(1,"File type not supported",e,"rm")}i?.preserveTimestamps&&await zr(t,n.atime,n.mtime)}s(Kr,"cp");async function qa(e,t){e=x(e);let{fs:i}=R(e);return Jn(i,t?.bigint)}s(qa,"statfs");var I=s(()=>{},"nop");function qd(e,t,i=I){Oa(e,t).then(()=>i()).catch(i)}s(qd,"rename");function $d(e,t=I){je(e).then(t).catch(()=>t(!1))}s($d,"exists");function zd(e,t,i=I){i=typeof t=="function"?t:i,st(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(zd,"stat");function Vd(e,t,i=I){i=typeof t=="function"?t:i,jr(e,typeof t!="function"?t:{}).then(n=>i(void 0,n)).catch(i)}s(Vd,"lstat");function Hd(e,t=0,i=I){i=typeof t=="function"?t:i,Pa(e,typeof t=="number"?t:0).then(()=>i()).catch(i)}s(Hd,"truncate");function Kd(e,t=I){Tn(e).then(()=>t()).catch(t)}s(Kd,"unlink");function Gd(e,t,i,n=I){let r=ke(i,420);n=typeof i=="function"?i:n,Se(e,t,r).then(o=>n(void 0,o.fd)).catch(n)}s(Gd,"open");function Yd(e,t,i=I){i=typeof t=="function"?t:i,Rn(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Yd,"readFile");function Xd(e,t,i,n=I){n=typeof i=="function"?i:n,Mi(e,t,typeof i!="function"?i:null).then(()=>n(void 0)).catch(n)}s(Xd,"writeFile");function Jd(e,t,i,n=I){let r=typeof i!="function"?i:void 0;n=typeof i=="function"?i:n,Ta(e,t,r).then(()=>n()).catch(n)}s(Jd,"appendFile");function Qd(e,t,i=I){i=typeof t=="function"?t:i,j(e).stat().then(n=>i(void 0,typeof t=="object"&&t?.bigint?new be(n):n)).catch(i)}s(Qd,"fstat");function Zd(e,t=I){new ce(e).close().then(()=>t()).catch(t)}s(Zd,"close");function eh(e,t,i=I){let n=typeof t=="number"?t:0;i=typeof t=="function"?t:i;let r=j(e);if(n<0)throw new u(22);r.truncate(n).then(()=>i()).catch(i)}s(eh,"ftruncate");function th(e,t=I){j(e).sync().then(()=>t()).catch(t)}s(th,"fsync");function ih(e,t=I){j(e).datasync().then(()=>t()).catch(t)}s(ih,"fdatasync");function nh(e,t,i,n,r,o=I){let a,c,l,f,d,h=new ce(e);if(typeof t=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":f=i,d=typeof n=="string"?n:"utf8",o=typeof r=="function"?r:o;break;default:o=typeof n=="function"?n:typeof r=="function"?r:o,o(new u(22,"Invalid arguments."));return}a=za.Buffer.from(t),c=0,l=a.length;let b=o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a.toString(d))).catch(b)}else{a=za.Buffer.from(t.buffer),c=i,l=n,f=typeof r=="number"?r:null;let b=typeof r=="function"?r:o;h.write(a,c,l,f).then(({bytesWritten:p})=>b(void 0,p,a)).catch(b)}}s(nh,"write");function rh(e,t,i,n,r,o=I){new ce(e).read(t,i,n,r).then(({bytesRead:a,buffer:c})=>o(void 0,a,c)).catch(o)}s(rh,"read");function oh(e,t,i,n=I){new ce(e).chown(t,i).then(()=>n()).catch(n)}s(oh,"fchown");function sh(e,t,i){new ce(e).chmod(t).then(()=>i()).catch(i)}s(sh,"fchmod");function ah(e,t,i,n=I){new ce(e).utimes(t,i).then(()=>n()).catch(n)}s(ah,"futimes");function ch(e,t=I){qr(e).then(()=>t()).catch(t)}s(ch,"rmdir");function lh(e,t,i=I){Ln(e,t).then(()=>i()).catch(i)}s(lh,"mkdir");function fh(e,t,i=I){i=typeof t=="function"?t:i,Ht(e,typeof t!="function"?t:{}).then(r=>i(void 0,r)).catch(i)}s(fh,"readdir");function uh(e,t,i=I){Ra(e,t).then(()=>i()).catch(i)}s(uh,"link");function dh(e,t,i,n=I){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,La(e,t,r).then(()=>n()).catch(n)}s(dh,"symlink");function hh(e,t,i=I){i=typeof t=="function"?t:i,$r(e).then(n=>i(void 0,n)).catch(i)}s(hh,"readlink");function ph(e,t,i,n=I){Na(e,t,i).then(()=>n()).catch(n)}s(ph,"chown");function yh(e,t,i,n=I){Ca(e,t,i).then(()=>n()).catch(n)}s(yh,"lchown");function mh(e,t,i=I){Ba(e,t).then(()=>i()).catch(i)}s(mh,"chmod");function bh(e,t,i=I){Da(e,t).then(()=>i()).catch(i)}s(bh,"lchmod");function gh(e,t,i,n=I){zr(e,t,i).then(()=>n()).catch(n)}s(gh,"utimes");function wh(e,t,i,n=I){Ma(e,t,i).then(()=>n()).catch(n)}s(wh,"lutimes");function Sh(e,t,i=I){i=typeof t=="function"?t:i,Ue(e,typeof t=="function"?null:t).then(n=>i(void 0,n)).catch(i)}s(Sh,"realpath");function Eh(e,t,i=I){let n=typeof t=="number"?t:4;i=typeof t=="function"?t:i,Wa(e,n).then(()=>i()).catch(i)}s(Eh,"access");var Wi=new Map;function _h(e,t,i){let n=x(e.toString()),r=typeof t!="function"?t:{};if(typeof t=="function"&&(i=t),!i)throw new u(22,"No listener specified",e.toString(),"watchFile");if(Wi.has(n)){let a=Wi.get(n);a&&a.listeners.add(i);return}let o=new Zn(n,r);o.on("change",(a,c)=>{let l=Wi.get(n);if(l)for(let f of l.listeners)f(a,c)}),Wi.set(n,{watcher:o,listeners:new Set})}s(_h,"watchFile");function xh(e,t=I){let i=x(e.toString()),n=Wi.get(i);n&&(t&&t!==I?n.listeners.delete(t):n.listeners.clear(),n.listeners.size===0&&(n.watcher.stop(),Wi.delete(i)))}s(xh,"unwatchFile");function kh(e,t,i){let n=new wi(x(e),typeof t=="object"?t:{});return i=typeof t=="function"?t:i,n.on("change",i||I),n}s(kh,"watch");function vh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Nt({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",read:s(async function(o){try{n||=await Se(e,"r",i?.mode);let a=await n.read(new Uint8Array(o),0,o,n.file.position);r.push(a.bytesRead?a.buffer.slice(0,a.bytesRead):null),n.file.position+=a.bytesRead,a.bytesRead||await n.close()}catch(a){await n?.close(),r.destroy(a)}},"read"),destroy:s(function(o,a){n?.close().then(()=>a(o)).catch(I)},"destroy")});return r.path=e.toString(),r}s(vh,"createReadStream");function Fh(e,t){let i=typeof t=="object"?t:{encoding:t},n,r=new Ct({highWaterMark:i?.highWaterMark,write:s(async function(o,a,c){try{n||=await Se(e,"w",i?.mode||438),await n.write(o,0,a),c(void 0)}catch(l){await n?.close(),c(l)}},"write"),destroy:s(function(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},"destroy"),final:s(function(o){n?.close().then(()=>o()).catch(o)},"final")});return r.path=e.toString(),r}s(Fh,"createWriteStream");function Ih(e,t,i=I){i=typeof t=="function"?t:i,Vr(e,typeof t=="function"?void 0:t).then(()=>i(void 0)).catch(i)}s(Ih,"rm");function Ah(e,t,i=I){i=typeof t=="function"?t:i,Ua(e,typeof t!="function"?t:null).then(n=>i(void 0,n)).catch(i)}s(Ah,"mkdtemp");function Oh(e,t,i,n=I){n=typeof i=="function"?i:n,Hr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Oh,"copyFile");function Ph(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).readv(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesRead:o})=>n(void 0,o,r)).catch(n)}s(Ph,"readv");function Th(e,t,i,n=I){n=typeof i=="function"?i:n,new ce(e).writev(t,typeof i=="function"?void 0:i).then(({buffers:r,bytesWritten:o})=>n(void 0,o,r)).catch(n)}s(Th,"writev");function Rh(e,t,i=I){i=typeof t=="function"?t:i,ja(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Rh,"opendir");function Lh(e,t,i,n=I){n=typeof i=="function"?i:n,Kr(e,t,typeof i=="function"?void 0:i).then(()=>n(void 0)).catch(n)}s(Lh,"cp");function Nh(e,t,i=I){i=typeof t=="function"?t:i,qa(e,typeof t=="function"?void 0:t).then(n=>i(void 0,n)).catch(i)}s(Nh,"statfs");async function Ch(e,t){let i=await Se(e.toString(),"r"),n=await i.readFile();return await i.close(),new Blob([n],t)}s(Ch,"openAsBlob");function Bh(e){return Hi(e)||Vi(e)||e instanceof pe}s(Bh,"isMountConfig");async function Ui(e,t=0){if(typeof e!="object"||e==null)throw new u(22,"Invalid options on mount configuration");if(!Bh(e))throw new u(22,"Invalid mount configuration");if(e instanceof pe)return e;Vi(e)&&(e={backend:e});for(let[r,o]of Object.entries(e))if(r!="backend"&&Bh(o)){if(t>10)throw new u(22,"Invalid configuration, too deep and possibly infinite");e[r]=await Ui(o,++t)}let{backend:i}=e;if(!await i.isAvailable())throw new u(1,"Backend not available: "+i.name);await lo(i,e);let n=await i.create(e);return n._disableSync=e.disableAsyncCache||!1,await n.ready(),n}s(Ui,"resolveMountConfig");async function HS(e){if(!Hi(e))throw new TypeError("Invalid single mount point configuration");let t=await Ui(e);gi("/"),zt("/",t)}s(HS,"configureSingle");async function KS(e){let t="uid"in e&&e.uid||0,i="gid"in e&&e.gid||0;if(Object.assign(ye,{uid:t,gid:i,suid:t,sgid:i,euid:t,egid:i}),!!e.mounts){for(let[n,r]of Object.entries(e.mounts)){if(!n.startsWith("/"))throw new u(22,"Mount points must have absolute paths");Hi(r)&&(r.disableAsyncCache??=e.disableAsyncCache||!1),e.mounts[n]=await Ui(r)}pn(e.mounts)}}s(KS,"configure");function Va(e){let i=class i extends e{constructor(){super(...arguments);this._queue=[];this._isInitialized=!1}get _queueRunning(){return!!this._queue.length}queueDone(){return new Promise(o=>{let a=s(()=>this._queueRunning?setTimeout(a):o(),"check");a()})}async ready(){if(await super.ready(),!(this._isInitialized||this._disableSync)){this.checkSync(),await this._sync.ready();try{await this.crossCopy("/"),this._isInitialized=!0}catch(o){throw this._isInitialized=!1,o}}}checkSync(o,a){if(this._disableSync)throw new u(95,"Sync caching has been disabled for this async file system",o,a);if(!this._sync)throw new u(95,"No sync cache is attached to this async file system",o,a)}renameSync(o,a){this.checkSync(o,"rename"),this._sync.renameSync(o,a),this.queue("rename",o,a)}statSync(o){return this.checkSync(o,"stat"),this._sync.statSync(o)}createFileSync(o,a,c){return this.checkSync(o,"createFile"),this._sync.createFileSync(o,a,c),this.queue("createFile",o,a,c),this.openFileSync(o,a)}openFileSync(o,a){this.checkSync(o,"openFile");let c=this._sync.openFileSync(o,a),l=c.statSync(),f=new Uint8Array(l.size);return c.readSync(f),new we(this,o,a,l,f)}unlinkSync(o){this.checkSync(o,"unlinkSync"),this._sync.unlinkSync(o),this.queue("unlink",o)}rmdirSync(o){this.checkSync(o,"rmdir"),this._sync.rmdirSync(o),this.queue("rmdir",o)}mkdirSync(o,a){this.checkSync(o,"mkdir"),this._sync.mkdirSync(o,a),this.queue("mkdir",o,a)}readdirSync(o){return this.checkSync(o,"readdir"),this._sync.readdirSync(o)}linkSync(o,a){this.checkSync(o,"link"),this._sync.linkSync(o,a),this.queue("link",o,a)}syncSync(o,a,c){this.checkSync(o,"sync"),this._sync.syncSync(o,a,c),this.queue("sync",o,a,c)}existsSync(o){return this.checkSync(o,"exists"),this._sync.existsSync(o)}async crossCopy(o){this.checkSync(o,"crossCopy");let a=await this.stat(o);if(!a.isDirectory()){var l=[];try{let p=S(l,await this.openFile(o,M("r")),!0);let w=S(l,this._sync.createFileSync(o,M("w"),a.mode));let g=new Uint8Array(a.size);await p.read(g);w.writeSync(g,0,a.size);return}catch(f){var d=f,h=!0}finally{var b=E(l,d,h);b&&await b}}if(o!=="/"){let p=await this.stat(o);this._sync.mkdirSync(o,p.mode)}let c=await this.readdir(o);for(let p of c)await this.crossCopy(z(o,p))}async _next(){if(!this._queueRunning)return;let[o,...a]=this._queue.shift();await this[o](...a),await this._next()}queue(...o){this._queue.push(o),this._next()}};s(i,"AsyncFS");let t=i;return t}s(Va,"Async");function GS(e){return typeof e=="object"&&e!=null&&"fd"in e&&"path"in e&&"position"in e}s(GS,"isFileData");function Ha(e){return typeof e=="object"&&e!=null&&"_zenfs"in e&&!!e._zenfs}s(Ha,"isMessage");var ji=new Map;function Ka(e,{port:t,timeout:i=1e3,fs:n}={}){let r=`
|
|
3
|
+
`+new Error().stack.slice(6);if(!t)throw u.With("EINVAL");return new Promise((o,a)=>{let c=Math.random().toString(16).slice(10);ji.set(c,{resolve:o,reject:a,fs:n}),t.postMessage({...e,_zenfs:!0,id:c,stack:r});let l=setTimeout(()=>{let f=new u(5,"RPC Failed");f.stack+=r,a(f),typeof l=="object"&&l.unref()},i)})}s(Ka,"request");function Dh(e){if(!Ha(e))return;let{id:t,value:i,error:n,stack:r}=e;if(!ji.has(t)){let l=new u(5,"Invalid RPC id:"+t);throw l.stack+=r,l}let{resolve:o,reject:a,fs:c}=ji.get(t);if(n){let l=typeof i=="string"?new Error(i):u.fromJSON(i);l.stack+=r,a(l),ji.delete(t);return}if(GS(i)){let{fd:l,path:f,position:d}=i,h=new Bn(c,l,f,d);o(h),ji.delete(t);return}o(i),ji.delete(t)}s(Dh,"handleResponse");function Gr(e,t){if(!e)throw u.With("EINVAL");e["on"in e?"on":"addEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Gr,"attach");function Ga(e,t){if(!e)throw u.With("EINVAL");e["off"in e?"off":"removeEventListener"]("message",i=>{t("data"in i?i.data:i)})}s(Ga,"detach");function Mh(e){let t=[],i=t.push.bind(t);return Gr(e,i),function(n){Ga(e,i);for(let r of t){let o="data"in r?r.data:r;Dn(e,n,o)}}}s(Mh,"catchMessages");var Ya=class Ya extends qt{constructor(i,n,r,o){super(i,r);this.fs=i;this.fd=n;this.position=o}rpc(i,...n){return Ka({scope:"file",fd:this.fd,method:i,args:n},this.fs.options)}_throwNoSync(i){throw new u(95,"Synchronous operations not supported on PortFile",this.path,i)}async stat(){return new G(await this.rpc("stat"))}statSync(){this._throwNoSync("stat")}truncate(i){return this.rpc("truncate",i)}truncateSync(){this._throwNoSync("truncate")}write(i,n,r,o){return this.rpc("write",i,n,r,o)}writeSync(){this._throwNoSync("write")}async read(i,n,r,o){return await this.rpc("read",i,n,r,o)}readSync(){this._throwNoSync("read")}chown(i,n){return this.rpc("chown",i,n)}chownSync(){this._throwNoSync("chown")}chmod(i){return this.rpc("chmod",i)}chmodSync(){this._throwNoSync("chmod")}utimes(i,n){return this.rpc("utimes",i,n)}utimesSync(){this._throwNoSync("utimes")}_setType(i){return this.rpc("_setType",i)}_setTypeSync(){this._throwNoSync("_setType")}close(){return this.rpc("close")}closeSync(){this._throwNoSync("close")}sync(){return this.rpc("sync")}syncSync(){this._throwNoSync("sync")}};s(Ya,"PortFile");var Bn=Ya,Xa=class Xa extends Va(pe){constructor(i){super();this.options=i;this._sync=dn.create({name:"port-tmpfs"});this.port=i.port,Gr(this.port,Dh)}metadata(){return{...super.metadata(),name:"PortFS"}}rpc(i,...n){return Ka({scope:"fs",method:i,args:n},{...this.options,fs:this})}async ready(){await this.rpc("ready"),await super.ready()}rename(i,n){return this.rpc("rename",i,n)}async stat(i){return new G(await this.rpc("stat",i))}sync(i,n,r){return this.rpc("sync",i,n,r)}openFile(i,n){return this.rpc("openFile",i,n)}createFile(i,n,r){return this.rpc("createFile",i,n,r)}unlink(i){return this.rpc("unlink",i)}rmdir(i){return this.rpc("rmdir",i)}mkdir(i,n){return this.rpc("mkdir",i,n)}readdir(i){return this.rpc("readdir",i)}exists(i){return this.rpc("exists",i)}link(i,n){return this.rpc("link",i,n)}};s(Xa,"PortFS");var Xr=Xa,Wh=0,Yr=new Map;async function Dn(e,t,i){if(!Ha(i))return;let{method:n,args:r,id:o,scope:a,stack:c}=i,l,f=!1;try{switch(a){case"fs":l=await t[n](...r),l instanceof qt&&(Yr.set(++Wh,l),l={fd:Wh,path:l.path,position:l.position});break;case"file":let{fd:d}=i;if(!Yr.has(d))throw new u(9);l=await Yr.get(d)[n](...r),n=="close"&&Yr.delete(d);break;default:return}}catch(d){l=d instanceof u?d.toJSON():d.toString(),f=!0}e.postMessage({_zenfs:!0,scope:a,id:o,error:f,method:n,stack:c,value:l})}s(Dn,"handleRequest");function Uh(e,t){Gr(e,i=>Dn(e,t,i))}s(Uh,"attachFS");function XS(e,t){Ga(e,i=>Dn(e,t,i))}s(XS,"detachFS");var jh={name:"Port",options:{port:{type:"object",required:!0,description:"The target port that you want to connect to",validator:s(function(e){if(typeof e?.postMessage!="function")throw new u(22,"option must be a port.")},"validator")},timeout:{type:"number",required:!1,description:"How long to wait before the request times out"}},isAvailable:s(async function(){return!0},"isAvailable"),create:s(function(e){return new Xr(e)},"create")},JS=jh;async function QS(e,t,i=0){let n=Mh(e),r=await Ui(t,i);return Uh(e,r),n(r),r}s(QS,"resolveRemoteMount");function Ja(e){let i=class i extends e{metadata(){return{...super.metadata(),readonly:!0}}async rename(r,o){throw new u(30)}renameSync(r,o){throw new u(30)}async createFile(r,o,a){throw new u(30)}createFileSync(r,o,a){throw new u(30)}async unlink(r){throw new u(30)}unlinkSync(r){throw new u(30)}async rmdir(r){throw new u(30)}rmdirSync(r){throw new u(30)}async mkdir(r,o){throw new u(30)}mkdirSync(r,o){throw new u(30)}async link(r,o){throw new u(30)}linkSync(r,o){throw new u(30)}async sync(r,o,a){throw new u(30)}syncSync(r,o,a){throw new u(30)}};s(i,"ReadonlyFS");let t=i;return t}s(Ja,"Readonly");var Qa=1,Qr=class Qr extends Map{files(){let t=new Map;for(let[i,n]of this)n.isFile()&&t.set(i,n);return t}toJSON(){return{version:Qa,entries:Object.fromEntries(this)}}toString(){return JSON.stringify(this.toJSON())}dirEntries(t){let i=[];for(let n of this.keys())_(n)==t&&i.push(D(n));return i}fromJSON(t){if(t.version!=Qa)throw new u(22,"Index version mismatch");this.clear();for(let[i,n]of Object.entries(t.entries)){let r=new G(n);r.isDirectory()&&(r.fileData=Ne(JSON.stringify(this.dirEntries(i)))),this.set(i,r)}}static parse(t){if(!Wc(t))throw new u(22,"Invalid JSON");let i=JSON.parse(t),n=new Qr;return n.fromJSON(i),n}};s(Qr,"Index");var Jr=Qr,Za=class Za extends Ja(pe){constructor(i){super();this.indexData=i;this.index=new Jr;this._isInitialized=!1}async ready(){await super.ready(),!this._isInitialized&&(this.index.fromJSON(await this.indexData),this._isInitialized=!0)}async reloadFiles(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=await this.getData(i,n)}reloadFilesSync(){for(let[i,n]of this.index.files())delete n.fileData,n.fileData=this.getDataSync(i,n)}stat(i){return Promise.resolve(this.statSync(i))}statSync(i){if(!this.index.has(i))throw u.With("ENOENT",i,"stat");return this.index.get(i)}async openFile(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:await this.getData(i,r))}openFileSync(i,n){if(ge(n))throw new u(1,i);let r=this.index.get(i);if(!r)throw u.With("ENOENT",i,"openFile");return new mi(this,i,n,r,r.isDirectory()?r.fileData:this.getDataSync(i,r))}readdir(i){return Promise.resolve(this.readdirSync(i))}readdirSync(i){let n=this.index.get(i);if(!n)throw u.With("ENOENT",i,"readdir");if(!n.isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=JSON.parse(ai(n.fileData));if(!Array.isArray(r))throw u.With("ENODATA",i,"readdir");if(!r.every(o=>typeof o=="string"))throw u.With("ENODATA",i,"readdir");return r}};s(Za,"IndexFS");var Mn=Za;async function qh(e,t){let i=await fetch(e).catch(n=>{throw new u(5,n.message)});if(!i.ok)throw new u(5,"fetch failed: response returned code "+i.status);switch(t){case"buffer":{let n=await i.arrayBuffer().catch(r=>{throw new u(5,r.message)});return new Uint8Array(n)}case"json":return i.json().catch(n=>{throw new u(5,n.message)});default:throw new u(22,"Invalid download type: "+t)}}s(qh,"fetchFile");var eo=class eo extends Mn{async ready(){if(!this._isInitialized&&(await super.ready(),!this._disableSync))for(let[t,i]of this.index.files())await this.getData(t,i)}constructor({index:t="index.json",baseUrl:i=""}){super(typeof t!="string"?t:qh(t,"json")),i.at(-1)!="/"&&(i+="/"),this.baseUrl=i}metadata(){return{...super.metadata(),name:eo.name,readonly:!0}}preload(t,i){let n=this.index.get(t);if(!n)throw u.With("ENOENT",t,"preload");if(!n.isFile())throw u.With("EISDIR",t,"preload");n.size=i.length,n.fileData=i}async getData(t,i){if(i.fileData)return i.fileData;let n=await qh(this.baseUrl+(t.startsWith("/")?t.slice(1):t),"buffer");return i.fileData=n,n}getDataSync(t,i){if(i.fileData)return i.fileData;throw new u(61,"",t,"getData")}};s(eo,"FetchFS");var Zr=eo,ZS={name:"Fetch",options:{index:{type:["string","object"],required:!1,description:"URL to a file index as a JSON file or the file index object itself, generated with the make-index script. Defaults to `index.json`."},baseUrl:{type:"string",required:!1,description:"Used as the URL prefix for fetched files. Default: Fetch files relative to the index."}},isAvailable:s(function(){return typeof globalThis.fetch=="function"},"isAvailable"),create:s(function(e){return new Zr(e)},"create")},eE=ZS;var tc=class tc{constructor(t){this.previous=t;this.current=Promise.withResolvers();this._isLocked=!0}get isLocked(){return this._isLocked}async done(){await this.previous?.done(),await this.current.promise}unlock(){this.current.resolve(),this._isLocked=!1}[Symbol.dispose](){this.unlock()}};s(tc,"MutexLock");var to=tc,ic=class ic{async ready(){return await this._fs.ready()}metadata(){return this._fs.metadata()}addLock(){let t=new to(this.currentLock);return this.currentLock=t,t}async lock(t,i){let n=this.currentLock,r=this.addLock(),o=new Error().stack;return setTimeout(()=>{if(r.isLocked){let a=u.With("EDEADLK",t,i);throw a.stack+=o?.slice(5),a}},5e3),await n?.done(),r}lockSync(t,i){if(this.currentLock)throw u.With("EBUSY",t,i);return this.addLock()}get isLocked(){return!!this.currentLock?.isLocked}async rename(t,i){var r=[];try{let n=S(r,await this.lock(t,"rename"));await this._fs.rename(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}renameSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"rename"));return this._fs.renameSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async stat(t){var n=[];try{let i=S(n,await this.lock(t,"stat"));return await this._fs.stat(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}statSync(t){var n=[];try{let i=S(n,this.lockSync(t,"stat"));return this._fs.statSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async openFile(t,i){var o=[];try{let n=S(o,await this.lock(t,"openFile"));let r=await this._fs.openFile(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}openFileSync(t,i){var o=[];try{let n=S(o,this.lockSync(t,"openFile"));let r=this._fs.openFileSync(t,i);r.fs=this;return r}catch(a){var c=a,l=!0}finally{E(o,c,l)}}async createFile(t,i,n){var a=[];try{let r=S(a,await this.lock(t,"createFile"));let o=await this._fs.createFile(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}createFileSync(t,i,n){var a=[];try{let r=S(a,this.lockSync(t,"createFile"));let o=this._fs.createFileSync(t,i,n);o.fs=this;return o}catch(c){var l=c,f=!0}finally{E(a,l,f)}}async unlink(t){var n=[];try{let i=S(n,await this.lock(t,"unlink"));await this._fs.unlink(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}unlinkSync(t){var n=[];try{let i=S(n,this.lockSync(t,"unlink"));return this._fs.unlinkSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async rmdir(t){var n=[];try{let i=S(n,await this.lock(t,"rmdir"));await this._fs.rmdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}rmdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"rmdir"));return this._fs.rmdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async mkdir(t,i){var r=[];try{let n=S(r,await this.lock(t,"mkdir"));await this._fs.mkdir(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}mkdirSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"mkdir"));return this._fs.mkdirSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async readdir(t){var n=[];try{let i=S(n,await this.lock(t,"readdir"));return await this._fs.readdir(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}readdirSync(t){var n=[];try{let i=S(n,this.lockSync(t,"readdir"));return this._fs.readdirSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async exists(t){var n=[];try{let i=S(n,await this.lock(t,"exists"));return await this._fs.exists(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}existsSync(t){var n=[];try{let i=S(n,this.lockSync(t,"exists"));return this._fs.existsSync(t)}catch(r){var o=r,a=!0}finally{E(n,o,a)}}async link(t,i){var r=[];try{let n=S(r,await this.lock(t,"link"));await this._fs.link(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}linkSync(t,i){var r=[];try{let n=S(r,this.lockSync(t,"link"));return this._fs.linkSync(t,i)}catch(o){var a=o,c=!0}finally{E(r,a,c)}}async sync(t,i,n){var o=[];try{let r=S(o,await this.lock(t,"sync"));await this._fs.sync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}syncSync(t,i,n){var o=[];try{let r=S(o,this.lockSync(t,"sync"));return this._fs.syncSync(t,i,n)}catch(a){var c=a,l=!0}finally{E(o,c,l)}}};s(ic,"__MutexedFS");var io=ic;function ec(e){let i=class i extends io{constructor(...r){super(),this._fs=new e(...r)}};s(i,"MutexedFS");let t=i;return t}s(ec,"Mutexed");var nc="/.deleted",rc=class rc extends pe{constructor({writable:i,readable:n}){super();this._isInitialized=!1;this._deletedFiles=new Set;this._deleteLog="";this._deleteLogUpdatePending=!1;this._deleteLogUpdateNeeded=!1;if(this.writable=i,this.readable=n,this.writable.metadata().readonly)throw new u(22,"Writable file system must be writable.");this._ready=this._initialize()}async ready(){await this.readable.ready(),await this.writable.ready(),await this._ready}metadata(){return{...super.metadata(),name:Wn.name}}async sync(i,n,r){await this.createParentDirectories(i),await this.writable.exists(i)||await this.writable.createFile(i,"w",420),await this.writable.sync(i,n,r)}syncSync(i,n,r){this.createParentDirectoriesSync(i),this.writable.syncSync(i,n,r)}async _initialize(){if(!this._isInitialized){try{let i=await this.writable.openFile(nc,M("r")),{size:n}=await i.stat(),{buffer:r}=await i.read(new Uint8Array(n));this._deleteLog=ai(r)}catch(i){if(i.errno!==2)throw i}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}async restoreDeletionLog(i){this._deleteLog=i,this._reparseDeletionLog(),await this.updateLog("")}async rename(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{await this.writable.rename(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}renameSync(i,n){this.checkInitialized(),this.checkPath(i),this.checkPath(n);try{this.writable.renameSync(i,n)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"rename")}}async stat(i){this.checkInitialized();try{return await this.writable.stat(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(await this.readable.stat(i));return r.mode|=146,r}}statSync(i){this.checkInitialized();try{return this.writable.statSync(i)}catch{if(this._deletedFiles.has(i))throw u.With("ENOENT",i,"stat");let r=new G(this.readable.statSync(i));return r.mode|=146,r}}async openFile(i,n){if(await this.writable.exists(i))return this.writable.openFile(i,n);let r=await this.readable.openFile(i,M("r")),o=new G(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new we(this,i,n,o,a)}openFileSync(i,n){if(this.writable.existsSync(i))return this.writable.openFileSync(i,n);let r=this.readable.openFileSync(i,M("r")),o=new G(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new we(this,i,n,o,a)}async createFile(i,n,r){return this.checkInitialized(),await this.writable.createFile(i,n,r),this.openFile(i,n)}createFileSync(i,n,r){return this.checkInitialized(),this.writable.createFileSync(i,n,r),this.openFileSync(i,n)}async link(i,n){this.checkInitialized(),await this.writable.link(i,n)}linkSync(i,n){this.checkInitialized(),this.writable.linkSync(i,n)}async unlink(i){if(this.checkInitialized(),this.checkPath(i),!await this.exists(i))throw u.With("ENOENT",i,"unlink");await this.writable.exists(i)&&await this.writable.unlink(i),await this.exists(i)&&await this.deletePath(i)}unlinkSync(i){if(this.checkInitialized(),this.checkPath(i),!this.existsSync(i))throw u.With("ENOENT",i,"unlink");this.writable.existsSync(i)&&this.writable.unlinkSync(i),this.existsSync(i)&&this.deletePath(i)}async rmdir(i){if(this.checkInitialized(),!await this.exists(i))throw u.With("ENOENT",i,"rmdir");if(await this.writable.exists(i)&&await this.writable.rmdir(i),await this.exists(i)){if((await this.readdir(i)).length>0)throw u.With("ENOTEMPTY",i,"rmdir");await this.deletePath(i)}}rmdirSync(i){if(this.checkInitialized(),!this.existsSync(i))throw u.With("ENOENT",i,"rmdir");if(this.writable.existsSync(i)&&this.writable.rmdirSync(i),this.existsSync(i)){if(this.readdirSync(i).length>0)throw u.With("ENOTEMPTY",i,"rmdir");this.deletePath(i)}}async mkdir(i,n){if(this.checkInitialized(),await this.exists(i))throw u.With("EEXIST",i,"mkdir");await this.createParentDirectories(i),await this.writable.mkdir(i,n)}mkdirSync(i,n){if(this.checkInitialized(),this.existsSync(i))throw u.With("EEXIST",i,"mkdir");this.createParentDirectoriesSync(i),this.writable.mkdirSync(i,n)}async readdir(i){if(this.checkInitialized(),!(await this.stat(i)).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r.push(...await this.writable.readdir(i))}catch{}try{r.push(...(await this.readable.readdir(i)).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}readdirSync(i){if(this.checkInitialized(),!this.statSync(i).isDirectory())throw u.With("ENOTDIR",i,"readdir");let r=[];try{r=r.concat(this.writable.readdirSync(i))}catch{}try{r=r.concat(this.readable.readdirSync(i).filter(a=>!this._deletedFiles.has(`${i}/${a}`)))}catch{}let o={};return r.filter(a=>{let c=!o[a];return o[a]=!0,c})}async deletePath(i){this._deletedFiles.add(i),await this.updateLog(`d${i}
|
|
4
|
+
`)}async updateLog(i){if(this._deleteLog+=i,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this.writable.openFile(nc,M("w"));try{await n.write(Ne(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,await this.updateLog(""))}catch(r){this._deleteLogError=r}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let i of this._deleteLog.split(`
|
|
5
|
+
`))i.startsWith("d")&&this._deletedFiles.add(i.slice(1))}checkInitialized(){if(!this._isInitialized)throw new u(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let i=this._deleteLogError;throw delete this._deleteLogError,i}checkPath(i){if(i==nc)throw u.With("EPERM",i,"checkPath")}createParentDirectoriesSync(i){let n=_(i),r=[];for(;!this.writable.existsSync(n);)r.push(n),n=_(n);for(let o of r.reverse())this.writable.mkdirSync(o,this.statSync(o).mode)}async createParentDirectories(i){let n=_(i),r=[];for(;!await this.writable.exists(n);)r.push(n),n=_(n);for(let o of r.reverse()){let a=await this.stat(o);await this.writable.mkdir(o,a.mode)}}operateOnWritable(i){if(!this.existsSync(i))throw u.With("ENOENT",i,"operateOnWriteable");this.writable.existsSync(i)||this.copyToWritableSync(i)}async operateOnWritableAsync(i){if(!await this.exists(i))throw u.With("ENOENT",i,"operateOnWritable");if(!await this.writable.exists(i))return this.copyToWritable(i)}copyToWritableSync(i){let n=this.statSync(i);if(n.isDirectory()){this.writable.mkdirSync(i,n.mode);return}let r=new Uint8Array(n.size),o=this.readable.openFileSync(i,M("r"));o.readSync(r),o.closeSync();let a=this.writable.openFileSync(i,M("w"));a.writeSync(r),a.closeSync()}async copyToWritable(i){let n=await this.stat(i);if(n.isDirectory()){await this.writable.mkdir(i,n.mode);return}let r=new Uint8Array(n.size),o=await this.readable.openFile(i,M("r"));await o.read(r),await o.close();let a=await this.writable.openFile(i,M("w"));await a.write(r),await a.close()}};s(rc,"UnmutexedOverlayFS");var no=rc,oc=class oc extends ec(no){};s(oc,"OverlayFS");var Wn=oc,tE={name:"Overlay",options:{writable:{type:"object",required:!0,description:"The file system to write modified files to."},readable:{type:"object",required:!0,description:"The file system that initially populates this file system."}},isAvailable:s(function(){return!0},"isAvailable"),create:s(function(e){return new Wn(e)},"create")},iE=tE;function nE(e){let i=class i extends e{async exists(r){return this.existsSync(r)}async rename(r,o){return this.renameSync(r,o)}async stat(r){return this.statSync(r)}async createFile(r,o,a){return this.createFileSync(r,o,a)}async openFile(r,o){return this.openFileSync(r,o)}async unlink(r){return this.unlinkSync(r)}async rmdir(r){return this.rmdirSync(r)}async mkdir(r,o){return this.mkdirSync(r,o)}async readdir(r){return this.readdirSync(r)}async link(r,o){return this.linkSync(r,o)}async sync(r,o,a){return this.syncSync(r,o,a)}};s(i,"SyncFS");let t=i;return t}s(nE,"Sync");var rE=Cn;return Yh(oE);})();
|
|
6
6
|
/*! Bundled license information:
|
|
7
7
|
|
|
8
8
|
ieee754/index.js:
|