@zenfs/core 0.8.0 → 0.9.0
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/ApiError.d.ts +2 -0
- package/dist/ApiError.js +3 -0
- package/dist/backends/AsyncStore.d.ts +2 -8
- package/dist/{FileIndex.d.ts → backends/FileIndex.d.ts} +9 -9
- package/dist/{FileIndex.js → backends/FileIndex.js} +10 -10
- package/dist/backends/Overlay.js +8 -8
- package/dist/backends/SyncStore.js +11 -11
- package/dist/browser.min.js +4 -4
- package/dist/browser.min.js.map +4 -4
- package/dist/emulation/async.d.ts +45 -20
- package/dist/emulation/async.js +78 -16
- package/dist/emulation/index.d.ts +1 -1
- package/dist/emulation/index.js +1 -1
- package/dist/emulation/promises.d.ts +62 -16
- package/dist/emulation/promises.js +201 -34
- package/dist/emulation/shared.d.ts +1 -46
- package/dist/emulation/shared.js +3 -95
- package/dist/emulation/sync.d.ts +38 -10
- package/dist/emulation/sync.js +123 -24
- package/dist/filesystem.d.ts +3 -0
- package/dist/filesystem.js +3 -4
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/utils.d.ts +45 -0
- package/dist/utils.js +94 -1
- package/package.json +1 -1
package/dist/browser.min.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
var ZenFS=(()=>{var Df=Object.create;var gi=Object.defineProperty;var Bf=Object.getOwnPropertyDescriptor;var Mf=Object.getOwnPropertyNames;var Uf=Object.getPrototypeOf,Wf=Object.prototype.hasOwnProperty;var s=(t,e)=>gi(t,"name",{value:e,configurable:!0});var F=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),nn=(t,e)=>{for(var i in e)gi(t,i,{get:e[i],enumerable:!0})},ks=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of Mf(e))!Wf.call(t,r)&&r!==i&&gi(t,r,{get:()=>e[r],enumerable:!(n=Bf(e,r))||n.enumerable});return t};var gr=(t,e,i)=>(i=t!=null?Df(Uf(t)):{},ks(e||!t||!t.__esModule?gi(i,"default",{value:t,enumerable:!0}):i,t)),qf=t=>ks(gi({},"__esModule",{value:!0}),t);var Cs=F(mn=>{"use strict";mn.byteLength=kd;mn.toByteArray=Id;mn.fromByteArray=Td;var Re=[],pe=[],vd=typeof Uint8Array<"u"?Uint8Array:Array,Tr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(mt=0,Ps=Tr.length;mt<Ps;++mt)Re[mt]=Tr[mt],pe[Tr.charCodeAt(mt)]=mt;var mt,Ps;pe["-".charCodeAt(0)]=62;pe["_".charCodeAt(0)]=63;function Rs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}s(Rs,"getLens");function kd(t){var e=Rs(t),i=e[0],n=e[1];return(i+n)*3/4-n}s(kd,"byteLength");function Nd(t,e,i){return(e+i)*3/4-i}s(Nd,"_byteLength");function Id(t){var e,i=Rs(t),n=i[0],r=i[1],o=new vd(Nd(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=pe[t.charCodeAt(c)]<<18|pe[t.charCodeAt(c+1)]<<12|pe[t.charCodeAt(c+2)]<<6|pe[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=pe[t.charCodeAt(c)]<<2|pe[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=pe[t.charCodeAt(c)]<<10|pe[t.charCodeAt(c+1)]<<4|pe[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Id,"toByteArray");function Fd(t){return Re[t>>18&63]+Re[t>>12&63]+Re[t>>6&63]+Re[t&63]}s(Fd,"tripletToBase64");function Ad(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(Fd(n));return r.join("")}s(Ad,"encodeChunk");function Td(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Ad(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Re[e>>2]+Re[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Re[e>>10]+Re[e>>4&63]+Re[e<<2&63]+"=")),r.join("")}s(Td,"fromByteArray")});var Ds=F(Or=>{Or.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,u=c>>1,d=-7,h=i?r-1:0,m=i?-1:1,b=t[e+h];for(h+=m,o=b&(1<<-d)-1,b>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(b?-1:1)*a*Math.pow(2,o-n)};Or.write=function(t,e,i,n,r,o){var a,l,c,u=o*8-r-1,d=(1<<u)-1,h=d>>1,m=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:o-1,w=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=m/c:e+=m*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,r),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+b]=l&255,b+=w,l/=256,r-=8);for(a=a<<r|l,u+=r;u>0;t[i+b]=a&255,b+=w,a/=256,u-=8);t[i+b-w]|=g*128}});var Ee=F(Yt=>{"use strict";var Lr=Cs(),Kt=Ds(),Bs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Yt.Buffer=y;Yt.SlowBuffer=Dd;Yt.INSPECT_MAX_BYTES=50;var bn=2147483647;Yt.kMaxLength=bn;y.TYPED_ARRAY_SUPPORT=Od();!y.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 Od(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Od,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function He(t){if(t>bn)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(He,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Dr(t)}return qs(t,e,i)}s(y,"Buffer");y.poolSize=8192;function qs(t,e,i){if(typeof t=="string")return Pd(t,e);if(ArrayBuffer.isView(t))return Rd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(Ce(t,ArrayBuffer)||t&&Ce(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ce(t,SharedArrayBuffer)||t&&Ce(t.buffer,SharedArrayBuffer)))return Rr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Cd(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(qs,"from");y.from=function(t,e,i){return qs(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function js(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(js,"assertSize");function Ld(t,e,i){return js(t),t<=0?He(t):e!==void 0?typeof i=="string"?He(t).fill(e,i):He(t).fill(e):He(t)}s(Ld,"alloc");y.alloc=function(t,e,i){return Ld(t,e,i)};function Dr(t){return js(t),He(t<0?0:Br(t)|0)}s(Dr,"allocUnsafe");y.allocUnsafe=function(t){return Dr(t)};y.allocUnsafeSlow=function(t){return Dr(t)};function Pd(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=$s(t,e)|0,n=He(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Pd,"fromString");function Pr(t){let e=t.length<0?0:Br(t.length)|0,i=He(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Pr,"fromArrayLike");function Rd(t){if(Ce(t,Uint8Array)){let e=new Uint8Array(t);return Rr(e.buffer,e.byteOffset,e.byteLength)}return Pr(t)}s(Rd,"fromArrayView");function Rr(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Rr,"fromArrayBuffer");function Cd(t){if(y.isBuffer(t)){let e=Br(t.length)|0,i=He(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||Ur(t.length)?He(0):Pr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Pr(t.data)}s(Cd,"fromObject");function Br(t){if(t>=bn)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+bn.toString(16)+" bytes");return t|0}s(Br,"checked");function Dd(t){return+t!=t&&(t=0),y.alloc(+t)}s(Dd,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(Ce(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),Ce(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");y.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(Ce(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.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 $s(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ce(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Cr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return Qs(t).length;default:if(r)return n?-1:Cr(t).length;e=(""+e).toLowerCase(),r=!0}}s($s,"byteLength");y.byteLength=$s;function Bd(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Kd(this,e,i);case"utf8":case"utf-8":return zs(this,e,i);case"ascii":return zd(this,e,i);case"latin1":case"binary":return Hd(this,e,i);case"base64":return $d(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Gd(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(Bd,"slowToString");y.prototype._isBuffer=!0;function bt(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(bt,"swap");y.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)bt(this,i,i+1);return this},"swap16");y.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)bt(this,i,i+3),bt(this,i+1,i+2);return this},"swap32");y.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)bt(this,i,i+7),bt(this,i+1,i+6),bt(this,i+2,i+5),bt(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?zs(this,0,e):Bd.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=Yt.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Bs&&(y.prototype[Bs]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(Ce(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.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===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),u=this.slice(r,o),d=e.slice(i,n);for(let h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function Vs(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,Ur(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:Ms(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ms(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(Vs,"bidirectionalIndexOf");function Ms(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let u;if(r){let d=-1;for(u=i;u<a;u++)if(c(t,u)===c(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===l)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+l>a&&(i=a-l),u=i;u>=0;u--){let d=!0;for(let h=0;h<l;h++)if(c(t,u+h)!==c(e,h)){d=!1;break}if(d)return u}return-1}s(Ms,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return Vs(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return Vs(this,e,i,n,!1)},"lastIndexOf");function Md(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(Ur(l))return a;t[i+a]=l}return a}s(Md,"hexWrite");function Ud(t,e,i,n){return gn(Cr(e,t.length-i),t,i,n)}s(Ud,"utf8Write");function Wd(t,e,i,n){return gn(Qd(e),t,i,n)}s(Wd,"asciiWrite");function qd(t,e,i,n){return gn(Qs(e),t,i,n)}s(qd,"base64Write");function jd(t,e,i,n){return gn(Zd(e,t.length-i),t,i,n)}s(jd,"ucs2Write");y.prototype.write=s(function(e,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),e.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 Md(this,e,i,n);case"utf8":case"utf-8":return Ud(this,e,i,n);case"ascii":case"latin1":case"binary":return Wd(this,e,i,n);case"base64":return qd(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jd(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function $d(t,e,i){return e===0&&i===t.length?Lr.fromByteArray(t):Lr.fromByteArray(t.slice(e,i))}s($d,"base64Slice");function zs(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,u,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[r+1],u=t[r+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[r+1],u=t[r+2],d=t[r+3],(c&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return Vd(n)}s(zs,"utf8Slice");var Us=4096;function Vd(t){let e=t.length;if(e<=Us)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=Us));return i}s(Vd,"decodeCodePointsArray");function zd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(zd,"asciiSlice");function Hd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(Hd,"latin1Slice");function Kd(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=eh[t[o]];return r}s(Kd,"hexSlice");function Gd(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Gd,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function Y(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(Y,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||Y(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||Y(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||Y(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||Y(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||Y(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=st(s(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Fi(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=st(s(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Fi(e,this.length-8);let r=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||Y(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||Y(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||Y(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||Y(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||Y(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=st(s(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Fi(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=st(s(function(e){e=e>>>0,Gt(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&Fi(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),Kt.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||Y(e,4,this.length),Kt.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||Y(e,8,this.length),Kt.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||Y(e,8,this.length),Kt.read(this,e,!1,52,8)},"readDoubleBE");function se(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(se,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;se(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;se(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function Hs(t,e,i,n,r){Js(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(Hs,"wrtBigUInt64LE");function Ks(t,e,i,n,r){Js(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(Ks,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=st(s(function(e,i=0){return Hs(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=st(s(function(e,i=0){return Ks(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);se(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);se(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||se(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=st(s(function(e,i=0){return Hs(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=st(s(function(e,i=0){return Ks(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Gs(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(Gs,"checkIEEE754");function Ys(t,e,i,n,r){return e=+e,i=i>>>0,r||Gs(t,e,i,4,34028234663852886e22,-34028234663852886e22),Kt.write(t,e,i,n,23,4),i+4}s(Ys,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return Ys(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return Ys(this,e,i,!1,n)},"writeFloatBE");function Xs(t,e,i,n,r){return e=+e,i=i>>>0,r||Gs(t,e,i,8,17976931348623157e292,-17976931348623157e292),Kt.write(t,e,i,n,52,8),i+8}s(Xs,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return Xs(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return Xs(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.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),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="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"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var Ht={};function Mr(t,e,i){Ht[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Mr,"E");Mr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Mr("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Mr("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Ws(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Ws(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function Ws(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ws,"addNumericalSeparator");function Yd(t,e,i){Gt(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&Fi(e,t.length-(i+1))}s(Yd,"checkBounds");function Js(t,e,i,n,r,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new Ht.ERR_OUT_OF_RANGE("value",l,t)}Yd(n,r,o)}s(Js,"checkIntBI");function Gt(t,e){if(typeof t!="number")throw new Ht.ERR_INVALID_ARG_TYPE(e,"number",t)}s(Gt,"validateNumber");function Fi(t,e,i){throw Math.floor(t)!==t?(Gt(t,i),new Ht.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new Ht.ERR_BUFFER_OUT_OF_BOUNDS:new Ht.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(Fi,"boundsError");var Xd=/[^+/0-9A-Za-z-_]/g;function Jd(t){if(t=t.split("=")[0],t=t.trim().replace(Xd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Jd,"base64clean");function Cr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=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(Cr,"utf8ToBytes");function Qd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Qd,"asciiToBytes");function Zd(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Zd,"utf16leToBytes");function Qs(t){return Lr.toByteArray(Jd(t))}s(Qs,"base64ToBytes");function gn(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(gn,"blitBuffer");function Ce(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(Ce,"isInstance");function Ur(t){return t!==t}s(Ur,"numberIsNaN");var eh=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function st(t){return typeof BigInt>"u"?th:t}s(st,"defineBigIntMethod");function th(){throw new Error("BigInt not supported")}s(th,"BufferBigIntNotDefined")});var R=F((QS,kl)=>{"use strict";kl.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var ti=F((ZS,On)=>{"use strict";var{AbortController:Nl,AbortSignal:ah}=typeof self<"u"?self:typeof window<"u"?window:void 0;On.exports=Nl;On.exports.AbortSignal=ah;On.exports.default=Nl});var Ui=F((e_,ho)=>{"use strict";var ii=typeof Reflect=="object"?Reflect:null,Il=ii&&typeof ii.apply=="function"?ii.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),Ln;ii&&typeof ii.ownKeys=="function"?Ln=ii.ownKeys:Object.getOwnPropertySymbols?Ln=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ln=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function lh(t){console&&console.warn&&console.warn(t)}s(lh,"ProcessEmitWarning");var Al=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function T(){T.init.call(this)}s(T,"EventEmitter");ho.exports=T;ho.exports.once=dh;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var Fl=10;function Pn(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Pn,"checkListener");Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return Fl},set:function(t){if(typeof t!="number"||t<0||Al(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Fl=t}});T.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};T.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Al(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Tl(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}s(Tl,"_getMaxListeners");T.prototype.getMaxListeners=s(function(){return Tl(this)},"getMaxListeners");T.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="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 l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Il(c,this,i);else for(var u=c.length,d=Cl(c,u),n=0;n<u;++n)Il(d[n],this,i);return!0},"emit");function Ol(t,e,i,n){var r,o,a;if(Pn(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Tl(t),r>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,lh(l)}return t}s(Ol,"_addListener");T.prototype.addListener=s(function(e,i){return Ol(this,e,i,!1)},"addListener");T.prototype.on=T.prototype.addListener;T.prototype.prependListener=s(function(e,i){return Ol(this,e,i,!0)},"prependListener");function ch(){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(ch,"onceWrapper");function Ll(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=ch.bind(n);return r.listener=i,n.wrapFn=r,r}s(Ll,"_onceWrap");T.prototype.once=s(function(e,i){return Pn(i),this.on(e,Ll(this,e,i)),this},"once");T.prototype.prependOnceListener=s(function(e,i){return Pn(i),this.prependListener(e,Ll(this,e,i)),this},"prependOnceListener");T.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if(Pn(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,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){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():uh(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=s(function(e){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[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(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[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function Pl(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?fh(r):Cl(r,r.length)}s(Pl,"_listeners");T.prototype.listeners=s(function(e){return Pl(this,e,!0)},"listeners");T.prototype.rawListeners=s(function(e){return Pl(this,e,!1)},"rawListeners");T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):Rl.call(t,e)};T.prototype.listenerCount=Rl;function Rl(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s(Rl,"listenerCount");T.prototype.eventNames=s(function(){return this._eventsCount>0?Ln(this._events):[]},"eventNames");function Cl(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s(Cl,"arrayClone");function uh(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(uh,"spliceOne");function fh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(fh,"unwrapListeners");function dh(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),Dl(t,e,o,{once:!0}),e!=="error"&&hh(t,r,{once:!0})})}s(dh,"once");function hh(t,e,i){typeof t.on=="function"&&Dl(t,"error",e,i)}s(hh,"addErrorHandlerIfEventEmitter");function Dl(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(Dl,"eventTargetAgnosticAddListener")});var J=F((i_,po)=>{"use strict";var ph=Ee(),{kResistStopPropagation:yh,SymbolDispose:mh}=R(),bh=globalThis.AbortSignal||ti().AbortSignal,gh=globalThis.AbortController||ti().AbortController,wh=Object.getPrototypeOf(async function(){}).constructor,Bl=globalThis.Blob||ph.Blob,Sh=s(typeof Bl<"u"?function(e){return e instanceof Bl}:function(e){return!1},"isBlob"),Ml=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),_h=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),Rn=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
-
`;super(i),this.name="AggregateError",this.errors=e}};s(Rn,"AggregateError");po.exports={AggregateError:Rn,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.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()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof wh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:Sh,deprecate(t,e){return t},addAbortListener:Ui().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ml(e,"signal"),_h(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[yh]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[mh](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:bh.any||s(function(e){if(e.length===1)return e[0];let i=new gh,n=s(()=>i.abort(),"abort");return e.forEach(r=>{Ml(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};po.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ie=F((r_,ql)=>{"use strict";var{format:Eh,inspect:Dn,AggregateError:xh}=J(),vh=globalThis.AggregateError||xh,kh=Symbol("kIsNodeError"),Nh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],Ih=/^([A-Z][a-z0-9]*)+$/,Fh="__node_internal_",Bn={};function _t(t,e){if(!t)throw new Bn.ERR_INTERNAL_ASSERTION(e)}s(_t,"assert");function Ul(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ul,"addNumericalSeparator");function Ah(t,e,i){if(typeof e=="function")return _t(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return _t(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:Eh(e,...i)}s(Ah,"getMessage");function X(t,e,i){i||(i=Error);class n extends i{constructor(...o){super(Ah(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(n,"NodeError"),Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[kh]=!0,Bn[t]=n}s(X,"E");function Wl(t){let e=Fh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Wl,"hideStackFrames");function Th(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new vh([e,t],e.message);return i.code=e.code,i}return t||e}s(Th,"aggregateTwoErrors");var Cn=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Bn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(Cn,"AbortError");X("ERR_ASSERTION","%s",Error);X("ERR_INVALID_ARG_TYPE",(t,e,i)=>{_t(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)_t(typeof c=="string","All expected entries have to be of type string"),Nh.includes(c)?r.push(c.toLowerCase()):Ih.test(c)?o.push(c):(_t(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,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 c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(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 c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}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 c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=Dn(i,{depth:-1});n+=`. Received ${c}`}}else{let c=Dn(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);X("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=Dn(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);X("ERR_INVALID_RETURN_VALUE",(t,e,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 ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);X("ERR_MISSING_ARGS",(...t)=>{_t(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);X("ERR_OUT_OF_RANGE",(t,e,i)=>{_t(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Ul(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Ul(n)),n+="n"):n=Dn(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);X("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);X("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);X("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);X("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);X("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);X("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);X("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);X("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);X("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);X("ERR_STREAM_WRITE_AFTER_END","write after end",Error);X("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);ql.exports={AbortError:Cn,aggregateTwoErrors:Wl(Th),hideStackFrames:Wl,codes:Bn}});var ri=F((s_,Jl)=>{"use strict";var{ArrayIsArray:mo,ArrayPrototypeIncludes:zl,ArrayPrototypeJoin:Hl,ArrayPrototypeMap:Oh,NumberIsInteger:bo,NumberIsNaN:Lh,NumberMAX_SAFE_INTEGER:Ph,NumberMIN_SAFE_INTEGER:Rh,NumberParseInt:Ch,ObjectPrototypeHasOwnProperty:Dh,RegExpPrototypeExec:Kl,String:Bh,StringPrototypeToUpperCase:Mh,StringPrototypeTrim:Uh}=R(),{hideStackFrames:be,codes:{ERR_SOCKET_BAD_PORT:Wh,ERR_INVALID_ARG_TYPE:Q,ERR_INVALID_ARG_VALUE:ni,ERR_OUT_OF_RANGE:Et,ERR_UNKNOWN_SIGNAL:jl}}=ie(),{normalizeEncoding:qh}=J(),{isAsyncFunction:jh,isArrayBufferView:$h}=J().types,$l={};function Vh(t){return t===(t|0)}s(Vh,"isInt32");function zh(t){return t===t>>>0}s(zh,"isUint32");var Hh=/^[0-7]+$/,Kh="must be a 32-bit unsigned integer or an octal string";function Gh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(Kl(Hh,t)===null)throw new ni(e,t,Kh);t=Ch(t,8)}return Gl(t,e),t}s(Gh,"parseFileMode");var Yh=be((t,e,i=Rh,n=Ph)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new Et(e,"an integer",t);if(t<i||t>n)throw new Et(e,`>= ${i} && <= ${n}`,t)}),Xh=be((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new Et(e,"an integer",t);if(t<i||t>n)throw new Et(e,`>= ${i} && <= ${n}`,t)}),Gl=be((t,e,i=!1)=>{if(typeof t!="number")throw new Q(e,"number",t);if(!bo(t))throw new Et(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Et(e,`>= ${n} && <= ${r}`,t)});function go(t,e){if(typeof t!="string")throw new Q(e,"string",t)}s(go,"validateString");function Jh(t,e,i=void 0,n){if(typeof t!="number")throw new Q(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Lh(t))throw new Et(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(Jh,"validateNumber");var Qh=be((t,e,i)=>{if(!zl(i,t)){let r="must be one of: "+Hl(Oh(i,o=>typeof o=="string"?`'${o}'`:Bh(o)),", ");throw new ni(e,t,r)}});function Yl(t,e){if(typeof t!="boolean")throw new Q(e,"boolean",t)}s(Yl,"validateBoolean");function yo(t,e,i){return t==null||!Dh(t,e)?i:t[e]}s(yo,"getOwnPropertyValueOrDefault");var Zh=be((t,e,i=null)=>{let n=yo(i,"allowArray",!1),r=yo(i,"allowFunction",!1);if(!yo(i,"nullable",!1)&&t===null||!n&&mo(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new Q(e,"Object",t)}),ep=be((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new Q(e,"a dictionary",t)}),Mn=be((t,e,i=0)=>{if(!mo(t))throw new Q(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new ni(e,t,n)}});function tp(t,e){Mn(t,e);for(let i=0;i<t.length;i++)go(t[i],`${e}[${i}]`)}s(tp,"validateStringArray");function ip(t,e){Mn(t,e);for(let i=0;i<t.length;i++)Yl(t[i],`${e}[${i}]`)}s(ip,"validateBooleanArray");function np(t,e){Mn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new Q(r,"AbortSignal",n);Xl(n,r)}}s(np,"validateAbortSignalArray");function rp(t,e="signal"){if(go(t,e),$l[t]===void 0)throw $l[Mh(t)]!==void 0?new jl(t+" (signals must use all capital letters)"):new jl(t)}s(rp,"validateSignalName");var op=be((t,e="buffer")=>{if(!$h(t))throw new Q(e,["Buffer","TypedArray","DataView"],t)});function sp(t,e){let i=qh(e),n=t.length;if(i==="hex"&&n%2!==0)throw new ni("encoding",e,`is invalid for data of length ${n}`)}s(sp,"validateEncoding");function ap(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Uh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Wh(e,t,i);return t|0}s(ap,"validatePort");var Xl=be((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new Q(e,"AbortSignal",t)}),lp=be((t,e)=>{if(typeof t!="function")throw new Q(e,"Function",t)}),cp=be((t,e)=>{if(typeof t!="function"||jh(t))throw new Q(e,"Function",t)}),up=be((t,e)=>{if(t!==void 0)throw new Q(e,"undefined",t)});function fp(t,e,i){if(!zl(i,t))throw new Q(e,`('${Hl(i,"|")}')`,t)}s(fp,"validateUnion");var dp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Vl(t,e){if(typeof t>"u"||!Kl(dp,t))throw new ni(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Vl,"validateLinkHeaderFormat");function hp(t){if(typeof t=="string")return Vl(t,"hints"),t;if(mo(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];Vl(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new ni("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(hp,"validateLinkHeaderValue");Jl.exports={isInt32:Vh,isUint32:zh,parseFileMode:Gh,validateArray:Mn,validateStringArray:tp,validateBooleanArray:ip,validateAbortSignalArray:np,validateBoolean:Yl,validateBuffer:op,validateDictionary:ep,validateEncoding:sp,validateFunction:lp,validateInt32:Xh,validateInteger:Yh,validateNumber:Jh,validateObject:Zh,validateOneOf:Qh,validatePlainFunction:cp,validatePort:ap,validateSignalName:rp,validateString:go,validateUint32:Gl,validateUndefined:up,validateUnion:fp,validateAbortSignal:Xl,validateLinkHeaderValue:hp}});var ut=F((l_,tc)=>{var U=tc.exports={},De,Be;function wo(){throw new Error("setTimeout has not been defined")}s(wo,"defaultSetTimout");function So(){throw new Error("clearTimeout has not been defined")}s(So,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?De=setTimeout:De=wo}catch{De=wo}try{typeof clearTimeout=="function"?Be=clearTimeout:Be=So}catch{Be=So}})();function Ql(t){if(De===setTimeout)return setTimeout(t,0);if((De===wo||!De)&&setTimeout)return De=setTimeout,setTimeout(t,0);try{return De(t,0)}catch{try{return De.call(null,t,0)}catch{return De.call(this,t,0)}}}s(Ql,"runTimeout");function pp(t){if(Be===clearTimeout)return clearTimeout(t);if((Be===So||!Be)&&clearTimeout)return Be=clearTimeout,clearTimeout(t);try{return Be(t)}catch{try{return Be.call(null,t)}catch{return Be.call(this,t)}}}s(pp,"runClearTimeout");var Ye=[],oi=!1,xt,Un=-1;function yp(){!oi||!xt||(oi=!1,xt.length?Ye=xt.concat(Ye):Un=-1,Ye.length&&Zl())}s(yp,"cleanUpNextTick");function Zl(){if(!oi){var t=Ql(yp);oi=!0;for(var e=Ye.length;e;){for(xt=Ye,Ye=[];++Un<e;)xt&&xt[Un].run();Un=-1,e=Ye.length}xt=null,oi=!1,pp(t)}}s(Zl,"drainQueue");U.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];Ye.push(new ec(t,e)),Ye.length===1&&!oi&&Ql(Zl)};function ec(t,e){this.fun=t,this.array=e}s(ec,"Item");ec.prototype.run=function(){this.fun.apply(null,this.array)};U.title="browser";U.browser=!0;U.env={};U.argv=[];U.version="";U.versions={};function Xe(){}s(Xe,"noop");U.on=Xe;U.addListener=Xe;U.once=Xe;U.off=Xe;U.removeListener=Xe;U.removeAllListeners=Xe;U.emit=Xe;U.prependListener=Xe;U.prependOnceListener=Xe;U.listeners=function(t){return[]};U.binding=function(t){throw new Error("process.binding is not supported")};U.cwd=function(){return"/"};U.chdir=function(t){throw new Error("process.chdir is not supported")};U.umask=function(){return 0}});var Ue=F((u_,mc)=>{"use strict";var{SymbolAsyncIterator:ic,SymbolIterator:nc,SymbolFor:vt}=R(),rc=vt("nodejs.stream.destroyed"),oc=vt("nodejs.stream.errored"),_o=vt("nodejs.stream.readable"),Eo=vt("nodejs.stream.writable"),sc=vt("nodejs.stream.disturbed"),mp=vt("nodejs.webstream.isClosedPromise"),bp=vt("nodejs.webstream.controllerErrorFunction");function Wn(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Wn,"isReadableNodeStream");function qn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(qn,"isWritableNodeStream");function gp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(gp,"isDuplexNodeStream");function Me(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(Me,"isNodeStream");function ac(t){return!!(t&&!Me(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(ac,"isReadableStream");function lc(t){return!!(t&&!Me(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(lc,"isWritableStream");function cc(t){return!!(t&&!Me(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(cc,"isTransformStream");function wp(t){return ac(t)||lc(t)||cc(t)}s(wp,"isWebStream");function Sp(t,e){return t==null?!1:e===!0?typeof t[ic]=="function":e===!1?typeof t[nc]=="function":typeof t[ic]=="function"||typeof t[nc]=="function"}s(Sp,"isIterable");function jn(t){if(!Me(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[rc]||n!=null&&n.destroyed)}s(jn,"isDestroyed");function uc(t){if(!qn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(uc,"isWritableEnded");function _p(t,e){if(!qn(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(_p,"isWritableFinished");function Ep(t){if(!Wn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(Ep,"isReadableEnded");function fc(t,e){if(!Wn(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(fc,"isReadableFinished");function dc(t){return t&&t[_o]!=null?t[_o]:typeof t?.readable!="boolean"?null:jn(t)?!1:Wn(t)&&t.readable&&!fc(t)}s(dc,"isReadable");function hc(t){return t&&t[Eo]!=null?t[Eo]:typeof t?.writable!="boolean"?null:jn(t)?!1:qn(t)&&t.writable&&!uc(t)}s(hc,"isWritable");function xp(t,e){return Me(t)?jn(t)?!0:!(e?.readable!==!1&&dc(t)||e?.writable!==!1&&hc(t)):null}s(xp,"isFinished");function vp(t){var e,i;return Me(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(vp,"isWritableErrored");function kp(t){var e,i;return Me(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(kp,"isReadableErrored");function Np(t){if(!Me(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&pc(t)?t._closed:null}s(Np,"isClosed");function pc(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(pc,"isOutgoingMessage");function yc(t){return typeof t._sent100=="boolean"&&pc(t)}s(yc,"isServerResponse");function Ip(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(Ip,"isServerRequest");function Fp(t){if(!Me(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&yc(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(Fp,"willEmitClose");function Ap(t){var e;return!!(t&&((e=t[sc])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Ap,"isDisturbed");function Tp(t){var e,i,n,r,o,a,l,c,u,d;return!!(t&&((e=(i=(n=(r=(o=(a=t[oc])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Tp,"isErrored");mc.exports={isDestroyed:jn,kIsDestroyed:rc,isDisturbed:Ap,kIsDisturbed:sc,isErrored:Tp,kIsErrored:oc,isReadable:dc,kIsReadable:_o,kIsClosedPromise:mp,kControllerErrorFunction:bp,kIsWritable:Eo,isClosed:Np,isDuplexNodeStream:gp,isFinished:xp,isIterable:Sp,isReadableNodeStream:Wn,isReadableStream:ac,isReadableEnded:Ep,isReadableFinished:fc,isReadableErrored:kp,isNodeStream:Me,isWebStream:wp,isWritable:hc,isWritableNodeStream:qn,isWritableStream:lc,isWritableEnded:uc,isWritableFinished:_p,isWritableErrored:vp,isServerRequest:Ip,isServerResponse:yc,willEmitClose:Fp,isTransformStream:cc}});var Je=F((d_,Io)=>{var ft=ut(),{AbortError:kc,codes:Op}=ie(),{ERR_INVALID_ARG_TYPE:Lp,ERR_STREAM_PREMATURE_CLOSE:bc}=Op,{kEmptyObject:vo,once:ko}=J(),{validateAbortSignal:Pp,validateFunction:Rp,validateObject:Cp,validateBoolean:Dp}=ri(),{Promise:Bp,PromisePrototypeThen:Mp,SymbolDispose:Nc}=R(),{isClosed:Up,isReadable:gc,isReadableNodeStream:xo,isReadableStream:Wp,isReadableFinished:wc,isReadableErrored:Sc,isWritable:_c,isWritableNodeStream:Ec,isWritableStream:qp,isWritableFinished:xc,isWritableErrored:vc,isNodeStream:jp,willEmitClose:$p,kIsClosedPromise:Vp}=Ue(),si;function zp(t){return t.setHeader&&typeof t.abort=="function"}s(zp,"isRequest");var No=s(()=>{},"nop");function Ic(t,e,i){var n,r;if(arguments.length===2?(i=e,e=vo):e==null?e=vo:Cp(e,"options"),Rp(i,"callback"),Pp(e.signal,"options.signal"),i=ko(i),Wp(t)||qp(t))return Hp(t,e,i);if(!jp(t))throw new Lp("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:xo(t),a=(r=e.writable)!==null&&r!==void 0?r:Ec(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||m()},"onlegacyfinish"),d=$p(t)&&xo(t)===o&&Ec(t)===a,h=xc(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||b)&&i.call(t)},"onfinish"),b=wc(t,!1),w=s(()=>{b=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s(q=>{i.call(t,q)},"onerror"),N=Up(t),S=s(()=>{N=!0;let q=vc(t)||Sc(t);if(q&&typeof q!="boolean")return i.call(t,q);if(o&&!b&&xo(t,!0)&&!wc(t,!1))return i.call(t,new bc);if(a&&!h&&!xc(t,!1))return i.call(t,new bc);i.call(t)},"onclose"),A=s(()=>{N=!0;let q=vc(t)||Sc(t);if(q&&typeof q!="boolean")return i.call(t,q);i.call(t)},"onclosed"),D=s(()=>{t.req.on("finish",m)},"onrequest");zp(t)?(t.on("complete",m),d||t.on("abort",S),t.req?D():t.on("request",D)):a&&!l&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",g),t.on("close",S),N?ft.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||ft.nextTick(A):(!o&&(!d||gc(t))&&(h||_c(t)===!1)||!a&&(!d||_c(t))&&(b||gc(t)===!1)||c&&t.req&&t.aborted)&&ft.nextTick(A);let I=s(()=>{i=No,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",D),t.req&&t.req.removeListener("finish",m),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",S)},"cleanup");if(e.signal&&!N){let q=s(()=>{let ht=i;I(),ht.call(t,new kc(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)ft.nextTick(q);else{si=si||J().addAbortListener;let ht=si(e.signal,q),ue=i;i=ko((...Rt)=>{ht[Nc](),ue.apply(t,Rt)})}}return I}s(Ic,"eos");function Hp(t,e,i){let n=!1,r=No;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new kc(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)ft.nextTick(r);else{si=si||J().addAbortListener;let a=si(e.signal,r),l=i;i=ko((...c)=>{a[Nc](),l.apply(t,c)})}let o=s((...a)=>{n||ft.nextTick(()=>i.apply(t,a))},"resolverFn");return Mp(t[Vp].promise,o,o),No}s(Hp,"eosWeb");function Kp(t,e){var i;let n=!1;return e===null&&(e=vo),(i=e)!==null&&i!==void 0&&i.cleanup&&(Dp(e.cleanup,"cleanup"),n=e.cleanup),new Bp((r,o)=>{let a=Ic(t,e,l=>{n&&a(),l?o(l):r()})})}s(Kp,"finished");Io.exports=Ic;Io.exports.finished=Kp});var kt=F((p_,Cc)=>{"use strict";var We=ut(),{aggregateTwoErrors:Gp,codes:{ERR_MULTIPLE_CALLBACK:Yp},AbortError:Xp}=ie(),{Symbol:Tc}=R(),{kIsDestroyed:Jp,isDestroyed:Qp,isFinished:Zp,isServerRequest:ey}=Ue(),Oc=Tc("kDestroy"),Fo=Tc("kConstruct");function Lc(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(Lc,"checkError");function ty(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(Lc(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Fc(this,t,e):this.once(Oc,function(o){Fc(this,Gp(o,t),e)}),this)}s(ty,"destroy");function Fc(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;Lc(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?We.nextTick(iy,t,o):We.nextTick(Pc,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Fc,"_destroy");function iy(t,e){Ao(t,e),Pc(t)}s(iy,"emitErrorCloseNT");function Pc(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(Pc,"emitCloseNT");function Ao(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(Ao,"emitErrorNT");function ny(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(ny,"undestroy");function To(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?We.nextTick(Ao,t,e):Ao(t,e))}s(To,"errorOrDestroy");function ry(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(Fo,e),!(t.listenerCount(Fo)>1)&&We.nextTick(oy,t)}s(ry,"construct");function oy(t){let e=!1;function i(n){if(e){To(t,n??new Yp);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Oc,n):n?To(t,n,!0):We.nextTick(sy,t)}s(i,"onConstruct");try{t._construct(n=>{We.nextTick(i,n)})}catch(n){We.nextTick(i,n)}}s(oy,"constructNT");function sy(t){t.emit(Fo)}s(sy,"emitConstructNT");function Ac(t){return t?.setHeader&&typeof t.abort=="function"}s(Ac,"isRequest");function Rc(t){t.emit("close")}s(Rc,"emitCloseLegacy");function ay(t,e){t.emit("error",e),We.nextTick(Rc,t)}s(ay,"emitErrorCloseLegacy");function ly(t,e){!t||Qp(t)||(!e&&!Zp(t)&&(e=new Xp),ey(t)?(t.socket=null,t.destroy(e)):Ac(t)?t.abort():Ac(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?We.nextTick(ay,t,e):We.nextTick(Rc,t),t.destroyed||(t[Jp]=!0))}s(ly,"destroyer");Cc.exports={construct:ry,destroyer:ly,destroy:ty,undestroy:ny,errorOrDestroy:To}});var zn=F((m_,Bc)=>{"use strict";var{ArrayIsArray:cy,ObjectSetPrototypeOf:Dc}=R(),{EventEmitter:$n}=Ui();function Vn(t){$n.call(this,t)}s(Vn,"Stream");Dc(Vn.prototype,$n.prototype);Dc(Vn,$n);Vn.prototype.pipe=function(t,e){let i=this;function n(d){t.writable&&t.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"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){u(),$n.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),Oo(i,"error",c),Oo(t,"error",c);function u(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function Oo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):cy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Oo,"prependListener");Bc.exports={Stream:Vn,prependListener:Oo}});var Wi=F((g_,Hn)=>{"use strict";var{SymbolDispose:uy}=R(),{AbortError:Mc,codes:fy}=ie(),{isNodeStream:Uc,isWebStream:dy,kControllerErrorFunction:hy}=Ue(),py=Je(),{ERR_INVALID_ARG_TYPE:Wc}=fy,Lo,yy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Wc(e,"AbortSignal",t)},"validateAbortSignal");Hn.exports.addAbortSignal=s(function(e,i){if(yy(e,"signal"),!Uc(i)&&!dy(i))throw new Wc("stream",["ReadableStream","WritableStream","Stream"],i);return Hn.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Hn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Uc(e)?()=>{e.destroy(new Mc(void 0,{cause:t.reason}))}:()=>{e[hy](new Mc(void 0,{cause:t.reason}))};if(t.aborted)i();else{Lo=Lo||J().addAbortListener;let n=Lo(t,i);py(e,n[uy])}return e}});var $c=F((__,jc)=>{"use strict";var{StringPrototypeSlice:qc,SymbolIterator:my,TypedArrayPrototypeSet:Kn,Uint8Array:by}=R(),{Buffer:Po}=Ee(),{inspect:gy}=J();jc.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return Po.alloc(0);let i=Po.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)Kn(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[my](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=qc(o,0,e),this.head=n,n.data=qc(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=Po.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)Kn(i,a,n-e),e-=a.length;else{e===a.length?(Kn(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(Kn(i,new by(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return gy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var qi=F((x_,Kc)=>{"use strict";var{MathFloor:wy,NumberIsInteger:Sy}=R(),{validateInteger:_y}=ri(),{ERR_INVALID_ARG_VALUE:Ey}=ie().codes,Vc=16*1024,zc=16;function xy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(xy,"highWaterMarkFrom");function Hc(t){return t?zc:Vc}s(Hc,"getDefaultHighWaterMark");function vy(t,e){_y(e,"value",0),t?zc=e:Vc=e}s(vy,"setDefaultHighWaterMark");function ky(t,e,i,n){let r=xy(e,n,i);if(r!=null){if(!Sy(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new Ey(o,r)}return wy(r)}return Hc(t.objectMode)}s(ky,"getHighWaterMark");Kc.exports={getHighWaterMark:ky,getDefaultHighWaterMark:Hc,setDefaultHighWaterMark:vy}});var Xc=F((Ro,Yc)=>{var Gn=Ee(),qe=Gn.Buffer;function Gc(t,e){for(var i in t)e[i]=t[i]}s(Gc,"copyProps");qe.from&&qe.alloc&&qe.allocUnsafe&&qe.allocUnsafeSlow?Yc.exports=Gn:(Gc(Gn,Ro),Ro.Buffer=Nt);function Nt(t,e,i){return qe(t,e,i)}s(Nt,"SafeBuffer");Nt.prototype=Object.create(qe.prototype);Gc(qe,Nt);Nt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return qe(t,e,i)};Nt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=qe(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Nt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return qe(t)};Nt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Gn.SlowBuffer(t)}});var Zc=F(Qc=>{"use strict";var Do=Xc().Buffer,Jc=Do.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function Ny(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(Ny,"_normalizeEncoding");function Iy(t){var e=Ny(t);if(typeof e!="string"&&(Do.isEncoding===Jc||!Jc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(Iy,"normalizeEncoding");Qc.StringDecoder=ji;function ji(t){this.encoding=Iy(t);var e;switch(this.encoding){case"utf16le":this.text=Py,this.end=Ry,e=4;break;case"utf8":this.fillLast=Ty,e=4;break;case"base64":this.text=Cy,this.end=Dy,e=3;break;default:this.write=By,this.end=My;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Do.allocUnsafe(e)}s(ji,"StringDecoder");ji.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};ji.prototype.end=Ly;ji.prototype.text=Oy;ji.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Co(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Co,"utf8CheckByte");function Fy(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Co(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Co(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Co(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(Fy,"utf8CheckIncomplete");function Ay(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(Ay,"utf8CheckExtraBytes");function Ty(t){var e=this.lastTotal-this.lastNeed,i=Ay(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Ty,"utf8FillLast");function Oy(t,e){var i=Fy(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(Oy,"utf8Text");function Ly(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Ly,"utf8End");function Py(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Py,"utf16Text");function Ry(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Ry,"utf16End");function Cy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Cy,"base64Text");function Dy(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Dy,"base64End");function By(t){return t.toString(this.encoding)}s(By,"simpleWrite");function My(t){return t&&t.length?this.write(t):""}s(My,"simpleEnd")});var Bo=F((F_,nu)=>{"use strict";var eu=ut(),{PromisePrototypeThen:Uy,SymbolAsyncIterator:tu,SymbolIterator:iu}=R(),{Buffer:Wy}=Ee(),{ERR_INVALID_ARG_TYPE:qy,ERR_STREAM_NULL_VALUES:jy}=ie().codes;function $y(t,e,i){let n;if(typeof e=="string"||e instanceof Wy)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let r;if(e&&e[tu])r=!0,n=e[tu]();else if(e&&e[iu])r=!1,n=e[iu]();else throw new qy("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,d){Uy(l(u),()=>eu.nextTick(d,u),h=>eu.nextTick(d,h||u))};async function l(u){let d=u!=null,h=typeof n.throw=="function";if(d&&h){let{value:m,done:b}=await n.throw(u);if(await m,b)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}s(l,"close");async function c(){for(;;){try{let{value:u,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw a=!1,new jy;if(o.push(h))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s($y,"from");nu.exports=$y});var Vi=F((T_,_u)=>{var Ne=ut(),{ArrayPrototypeIndexOf:Vy,NumberIsInteger:zy,NumberIsNaN:Hy,NumberParseInt:Ky,ObjectDefineProperties:zo,ObjectKeys:Gy,ObjectSetPrototypeOf:su,Promise:au,SafeSet:Yy,SymbolAsyncDispose:Xy,SymbolAsyncIterator:Jy,Symbol:Qy}=R();_u.exports=E;E.ReadableState=Qn;var{EventEmitter:Zy}=Ui(),{Stream:dt,prependListener:em}=zn(),{Buffer:Mo}=Ee(),{addAbortSignal:tm}=Wi(),lu=Je(),k=J().debuglog("stream",t=>{k=t}),im=$c(),ci=kt(),{getHighWaterMark:nm,getDefaultHighWaterMark:rm}=qi(),{aggregateTwoErrors:ru,codes:{ERR_INVALID_ARG_TYPE:om,ERR_METHOD_NOT_IMPLEMENTED:sm,ERR_OUT_OF_RANGE:am,ERR_STREAM_PUSH_AFTER_EOF:lm,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:cm},AbortError:um}=ie(),{validateObject:fm}=ri(),It=Qy("kPaused"),{StringDecoder:cu}=Zc(),dm=Bo();su(E.prototype,dt.prototype);su(E,dt);var Uo=s(()=>{},"nop"),{errorOrDestroy:ai}=ci,li=1<<0,hm=1<<1,uu=1<<2,$i=1<<3,fu=1<<4,Yn=1<<5,Xn=1<<6,du=1<<7,pm=1<<8,ym=1<<9,mm=1<<10,$o=1<<11,Vo=1<<12,bm=1<<13,gm=1<<14,wm=1<<15,hu=1<<16,Sm=1<<17,_m=1<<18;function z(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(z,"makeBitMapDescriptor");zo(Qn.prototype,{objectMode:z(li),ended:z(hm),endEmitted:z(uu),reading:z($i),constructed:z(fu),sync:z(Yn),needReadable:z(Xn),emittedReadable:z(du),readableListening:z(pm),resumeScheduled:z(ym),errorEmitted:z(mm),emitClose:z($o),autoDestroy:z(Vo),destroyed:z(bm),closed:z(gm),closeEmitted:z(wm),multiAwaitDrain:z(hu),readingMore:z(Sm),dataEmitted:z(_m)});function Qn(t,e,i){typeof i!="boolean"&&(i=e instanceof je()),this.state=$o|Vo|fu|Yn,t&&t.objectMode&&(this.state|=li),i&&t&&t.readableObjectMode&&(this.state|=li),this.highWaterMark=t?nm(this,t,"readableHighWaterMark",i):rm(!1),this.buffer=new im,this.length=0,this.pipes=[],this.flowing=null,this[It]=null,t&&t.emitClose===!1&&(this.state&=~$o),t&&t.autoDestroy===!1&&(this.state&=~Vo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new cu(t.encoding),this.encoding=t.encoding)}s(Qn,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof je();this._readableState=new Qn(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&tm(t.signal,this)),dt.call(this,t),ci.construct(this,()=>{this._readableState.needReadable&&Jn(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=ci.destroy;E.prototype._undestroy=ci.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Zy.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[Xy]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new um,this.destroy(t)),new au((e,i)=>lu(this,n=>n&&n!==t?i(n):e(null)))};E.prototype.push=function(t,e){return pu(this,t,e,!1)};E.prototype.unshift=function(t,e){return pu(this,t,e,!0)};function pu(t,e,i,n){k("readableAddChunk",e);let r=t._readableState,o;if(r.state&li||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=Mo.from(e,i).toString(r.encoding):(e=Mo.from(e,i),i=""))):e instanceof Mo?i="":dt._isUint8Array(e)?(e=dt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new om("chunk",["string","Buffer","Uint8Array"],e))),o)ai(t,o);else if(e===null)r.state&=~$i,vm(t,r);else if(r.state&li||e&&e.length>0)if(n)if(r.state&uu)ai(t,new cm);else{if(r.destroyed||r.errored)return!1;Wo(t,r,e,!0)}else if(r.ended)ai(t,new lm);else{if(r.destroyed||r.errored)return!1;r.state&=~$i,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?Wo(t,r,e,!1):Jn(t,r)):Wo(t,r,e,!1)}else n||(r.state&=~$i,Jn(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(pu,"readableAddChunk");function Wo(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&hu?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&Xn&&Zn(t)),Jn(t,e)}s(Wo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[It]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new cu(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var Em=1073741824;function xm(t){if(t>Em)throw new am("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(xm,"computeNewHighWaterMark");function ou(t,e){return t<=0||e.length===0&&e.ended?0:e.state&li?1:Hy(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(ou,"howMuchToRead");E.prototype.read=function(t){k("read",t),t===void 0?t=NaN:zy(t)||(t=Ky(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=xm(t)),t!==0&&(e.state&=~du),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?qo(this):Zn(this),null;if(t=ou(t,e),t===0&&e.ended)return e.length===0&&qo(this),null;let n=(e.state&Xn)!==0;if(k("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,k("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,k("reading, ended or constructing",n);else if(n){k("do read"),e.state|=$i|Yn,e.length===0&&(e.state|=Xn);try{this._read(e.highWaterMark)}catch(o){ai(this,o)}e.state&=~Yn,e.reading||(t=ou(i,e))}let r;return t>0?r=wu(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&qo(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function vm(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?Zn(t):(e.needReadable=!1,e.emittedReadable=!0,yu(t))}}s(vm,"onEofChunk");function Zn(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,Ne.nextTick(yu,t))}s(Zn,"emitReadable");function yu(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,bu(t)}s(yu,"emitReadable_");function Jn(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ne.nextTick(km,t,e))}s(Jn,"maybeReadMore");function km(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(k("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(km,"maybeReadMore_");E.prototype._read=function(t){throw new sm("_read()")};E.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Yy(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),k("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ne.stdout&&t!==Ne.stderr?l:N;n.endEmitted?Ne.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,A){k("onunpipe"),S===i&&A&&A.hasUnpiped===!1&&(A.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){k("onend"),t.end()}s(l,"onend");let c,u=!1;function d(){k("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",b),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",N),i.removeListener("data",m),u=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){u||(n.pipes.length===1&&n.pipes[0]===t?(k("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(k("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=Nm(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",m);function m(S){k("ondata");let A=t.write(S);k("dest.write",A),A===!1&&h()}s(m,"ondata");function b(S){if(k("onerror",S),N(),t.removeListener("error",b),t.listenerCount("error")===0){let A=t._writableState||t._readableState;A&&!A.errorEmitted?ai(t,S):t.emit("error",S)}}s(b,"onerror"),em(t,"error",b);function w(){t.removeListener("finish",g),N()}s(w,"onclose"),t.once("close",w);function g(){k("onfinish"),t.removeListener("close",w),N()}s(g,"onfinish"),t.once("finish",g);function N(){k("unpipe"),i.unpipe(t)}return s(N,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():n.flowing||(k("pipe resume"),i.resume()),t};function Nm(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(k("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(k("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(Nm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=Vy(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=dt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,k("on readable",n.length,n.reading),n.length?Zn(this):n.reading||Ne.nextTick(Im,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=dt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ne.nextTick(mu,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=dt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ne.nextTick(mu,this),e};function mu(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[It]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(mu,"updateReadableListening");function Im(t){k("readable nexttick read 0"),t.read(0)}s(Im,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,Fm(this,t)),t[It]=!1,this};function Fm(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ne.nextTick(Am,t,e))}s(Fm,"resume");function Am(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),bu(t),e.flowing&&!e.reading&&t.read(0)}s(Am,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[It]=!0,this};function bu(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}s(bu,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{ai(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=Gy(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};E.prototype[Jy]=function(){return gu(this)};E.prototype.iterator=function(t){return t!==void 0&&fm(t,"options"),gu(this,t)};function gu(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Tm(t,e);return i.stream=t,i}s(gu,"streamToAsyncIterator");async function*Tm(t,e){let i=Uo;function n(a){this===t?(i(),i=Uo):i=a}s(n,"next"),t.on("readable",n);let r,o=lu(t,{writable:!1},a=>{r=a?ru(r,a):null,i(),i=Uo});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new au(n)}}}catch(a){throw r=ru(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?ci.destroyer(t,null):(t.off("readable",n),o())}}s(Tm,"createAsyncIterator");zo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});zo(Qn.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[It]!==!1},set(t){this[It]=!!t}}});E._fromList=wu;function wu(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(wu,"fromList");function qo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ne.nextTick(Om,e,t))}s(qo,"endReadable");function Om(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ne.nextTick(Lm,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Om,"endReadableNT");function Lm(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Lm,"endWritableNT");E.from=function(t,e){return dm(E,t,e)};var jo;function Su(){return jo===void 0&&(jo={}),jo}s(Su,"lazyWebStreams");E.fromWeb=function(t,e){return Su().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Su().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,n;return new E({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(r,o){ci.destroyer(t,r),o(r)}}).wrap(t)}});var rr=F((L_,Pu)=>{var Ft=ut(),{ArrayPrototypeSlice:vu,Error:Pm,FunctionPrototypeSymbolHasInstance:ku,ObjectDefineProperty:Nu,ObjectDefineProperties:Rm,ObjectSetPrototypeOf:Iu,StringPrototypeToLowerCase:Cm,Symbol:Dm,SymbolHasInstance:Bm}=R();Pu.exports=C;C.WritableState=Ki;var{EventEmitter:Mm}=Ui(),zi=zn().Stream,{Buffer:er}=Ee(),nr=kt(),{addAbortSignal:Um}=Wi(),{getHighWaterMark:Wm,getDefaultHighWaterMark:qm}=qi(),{ERR_INVALID_ARG_TYPE:jm,ERR_METHOD_NOT_IMPLEMENTED:$m,ERR_MULTIPLE_CALLBACK:Fu,ERR_STREAM_CANNOT_PIPE:Vm,ERR_STREAM_DESTROYED:Hi,ERR_STREAM_ALREADY_FINISHED:zm,ERR_STREAM_NULL_VALUES:Hm,ERR_STREAM_WRITE_AFTER_END:Km,ERR_UNKNOWN_ENCODING:Au}=ie().codes,{errorOrDestroy:ui}=nr;Iu(C.prototype,zi.prototype);Iu(C,zi);function Go(){}s(Go,"nop");var fi=Dm("kOnFinished");function Ki(t,e,i){typeof i!="boolean"&&(i=e instanceof je()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Wm(this,t,"writableHighWaterMark",i):qm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Ym.bind(void 0,e),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=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[fi]=[]}s(Ki,"WritableState");function ir(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(ir,"resetBuffer");Ki.prototype.getBuffer=s(function(){return vu(this.buffered,this.bufferedIndex)},"getBuffer");Nu(Ki.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function C(t){let e=this instanceof je();if(!e&&!ku(C,this))return new C(t);this._writableState=new Ki(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Um(t.signal,this)),zi.call(this,t),nr.construct(this,()=>{let i=this._writableState;i.writing||Xo(this,i),Jo(this,i)})}s(C,"Writable");Nu(C,Bm,{__proto__:null,value:function(t){return ku(this,t)?!0:this!==C?!1:t&&t._writableState instanceof Ki}});C.prototype.pipe=function(){ui(this,new Vm)};function Tu(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!er.isEncoding(i))throw new Au(i);typeof n!="function"&&(n=Go)}if(e===null)throw new Hm;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=er.from(e,i),i="buffer");else if(e instanceof er)i="buffer";else if(zi._isUint8Array(e))e=zi._uint8ArrayToBuffer(e),i="buffer";else throw new jm("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new Km:r.destroyed&&(o=new Hi("write")),o?(Ft.nextTick(n,o),ui(t,o,!0),o):(r.pendingcb++,Gm(t,r,e,i,n))}s(Tu,"_write");C.prototype.write=function(t,e,i){return Tu(this,t,e,i)===!0};C.prototype.cork=function(){this._writableState.corked++};C.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Xo(this,t))};C.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Cm(e)),!er.isEncoding(e))throw new Au(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function Gm(t,e,i,n,r){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==Go&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(Gm,"writeOrBuffer");function Eu(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new Hi("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(Eu,"doWrite");function xu(t,e,i,n){--e.pendingcb,n(i),Yo(e),ui(t,i)}s(xu,"onwriteError");function Ym(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){ui(t,new Fu);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?Ft.nextTick(xu,t,i,e,r):xu(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Xo(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},Ft.nextTick(Xm,i.afterWriteTickInfo)):Ou(t,i,1,r))}s(Ym,"onwrite");function Xm({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Ou(t,e,i,n)}s(Xm,"afterWriteTick");function Ou(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&Yo(e),Jo(t,e)}s(Ou,"afterWrite");function Yo(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new Hi("write"))}let i=t[fi].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new Hi("end"))}ir(t)}s(Yo,"errorBuffer");function Xo(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?Go:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},c=e.allNoop&&a===0?i:vu(i,a);c.allBuffers=e.allBuffers,Eu(t,e,!0,e.length,c,"",l),ir(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let d=r?1:l.length;Eu(t,e,!1,d,l,c,u)}while(a<i.length&&!e.writing);a===i.length?ir(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Xo,"clearBuffer");C.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new $m("_write()")};C.prototype._writev=null;C.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Tu(this,t,e);o instanceof Pm&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Jo(this,n,!0),n.ended=!0):n.finished?r=new zm("end"):n.destroyed&&(r=new Hi("end"))),typeof i=="function"&&(r||n.finished?Ft.nextTick(i,r):n[fi].push(i)),this};function tr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(tr,"needFinish");function Jm(t,e){let i=!1;function n(r){if(i){ui(t,r??Fu());return}if(i=!0,e.pendingcb--,r){let o=e[fi].splice(0);for(let a=0;a<o.length;a++)o[a](r);ui(t,r,e.sync)}else tr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Ft.nextTick(Ko,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(Jm,"callFinal");function Qm(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Jm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(Qm,"prefinish");function Jo(t,e,i){tr(e)&&(Qm(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Ft.nextTick((n,r)=>{tr(r)?Ko(n,r):r.pendingcb--},t,e)):tr(e)&&(e.pendingcb++,Ko(t,e))))}s(Jo,"finishMaybe");function Ko(t,e){e.pendingcb--,e.finished=!0;let i=e[fi].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s(Ko,"finish");Rm(C.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Zm=nr.destroy;C.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[fi].length)&&Ft.nextTick(Yo,i),Zm.call(this,t,e),this};C.prototype._undestroy=nr.undestroy;C.prototype._destroy=function(t,e){e(t)};C.prototype[Mm.captureRejectionSymbol]=function(t){this.destroy(t)};var Ho;function Lu(){return Ho===void 0&&(Ho={}),Ho}s(Lu,"lazyWebStreams");C.fromWeb=function(t,e){return Lu().newStreamWritableFromWritableStream(t,e)};C.toWeb=function(t){return Lu().newWritableStreamFromStreamWritable(t)}});var Gu=F((R_,Ku)=>{var Qo=ut(),eb=Ee(),{isReadable:tb,isWritable:ib,isIterable:Ru,isNodeStream:nb,isReadableNodeStream:Cu,isWritableNodeStream:Du,isDuplexNodeStream:rb,isReadableStream:Bu,isWritableStream:Mu}=Ue(),Uu=Je(),{AbortError:zu,codes:{ERR_INVALID_ARG_TYPE:ob,ERR_INVALID_RETURN_VALUE:Wu}}=ie(),{destroyer:hi}=kt(),sb=je(),Hu=Vi(),ab=rr(),{createDeferredPromise:qu}=J(),ju=Bo(),$u=globalThis.Blob||eb.Blob,lb=s(typeof $u<"u"?function(e){return e instanceof $u}:function(e){return!1},"isBlob"),cb=globalThis.AbortController||ti().AbortController,{FunctionPrototypeCall:Vu}=R(),Qe=class extends sb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(Qe,"Duplexify");Ku.exports=s(function t(e,i){if(rb(e))return e;if(Cu(e))return di({readable:e});if(Du(e))return di({writable:e});if(nb(e))return di({writable:!1,readable:!1});if(Bu(e))return di({readable:Hu.fromWeb(e)});if(Mu(e))return di({writable:ab.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=ub(e);if(Ru(r))return ju(Qe,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let u,d=Vu(c,r,h=>{if(h!=null)throw new Wu("nully","body",h)},h=>{hi(u,h)});return u=new Qe({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Qo.nextTick(h,null)}catch(m){Qo.nextTick(h,m)}})},destroy:l})}throw new Wu("Iterable, AsyncIterable or AsyncFunction",i,r)}if(lb(e))return t(e.arrayBuffer());if(Ru(e))return ju(Qe,e,{objectMode:!0,writable:!1});if(Bu(e?.readable)&&Mu(e?.writable))return Qe.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?Cu(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?Du(e?.writable)?e?.writable:t(e.writable):void 0;return di({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return Vu(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{hi(r,o)}),r=new Qe({objectMode:!0,writable:!1,read(){}})}throw new ob(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ub(t){let{promise:e,resolve:i}=qu(),n=new cb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Qo.nextTick(u),c)return;if(r.aborted)throw new zu(void 0,{cause:r.reason});({promise:e,resolve:i}=qu()),yield l}}(),{signal:r}),write(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){n.abort(),l(a)}}}s(ub,"fromAsyncGen");function di(t){let e=t.readable&&typeof t.readable.read!="function"?Hu.wrap(t.readable):t.readable,i=t.writable,n=!!tb(e),r=!!ib(i),o,a,l,c,u;function d(h){let m=c;c=null,m?m(h):h&&u.destroy(h)}return s(d,"onfinished"),u=new Qe({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Uu(i,h=>{r=!1,h&&hi(e,h),d(h)}),u._write=function(h,m,b){i.write(h,m)?b():o=b},u._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&&(Uu(e,h=>{n=!1,h&&hi(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){l=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,m){!h&&c!==null&&(h=new zu),l=null,o=null,a=null,c===null?m(h):(c=m,hi(i,h),hi(e,h))},u}s(di,"_duplexify")});var je=F((D_,Ju)=>{"use strict";var{ObjectDefineProperties:fb,ObjectGetOwnPropertyDescriptor:Ze,ObjectKeys:db,ObjectSetPrototypeOf:Yu}=R();Ju.exports=Ie;var ts=Vi(),ge=rr();Yu(Ie.prototype,ts.prototype);Yu(Ie,ts);{let t=db(ge.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ie.prototype[i]||(Ie.prototype[i]=ge.prototype[i])}}function Ie(t){if(!(this instanceof Ie))return new Ie(t);ts.call(this,t),ge.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ie,"Duplex");fb(Ie.prototype,{writable:{__proto__:null,...Ze(ge.prototype,"writable")},writableHighWaterMark:{__proto__:null,...Ze(ge.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...Ze(ge.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...Ze(ge.prototype,"writableBuffer")},writableLength:{__proto__:null,...Ze(ge.prototype,"writableLength")},writableFinished:{__proto__:null,...Ze(ge.prototype,"writableFinished")},writableCorked:{__proto__:null,...Ze(ge.prototype,"writableCorked")},writableEnded:{__proto__:null,...Ze(ge.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...Ze(ge.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Zo;function Xu(){return Zo===void 0&&(Zo={}),Zo}s(Xu,"lazyWebStreams");Ie.fromWeb=function(t,e){return Xu().newStreamDuplexFromReadableWritablePair(t,e)};Ie.toWeb=function(t){return Xu().newReadableWritablePairFromDuplex(t)};var es;Ie.from=function(t){return es||(es=Gu()),es(t,"body")}});var rs=F((M_,Zu)=>{"use strict";var{ObjectSetPrototypeOf:Qu,Symbol:hb}=R();Zu.exports=et;var{ERR_METHOD_NOT_IMPLEMENTED:pb}=ie().codes,ns=je(),{getHighWaterMark:yb}=qi();Qu(et.prototype,ns.prototype);Qu(et,ns);var Gi=hb("kCallback");function et(t){if(!(this instanceof et))return new et(t);let e=t?yb(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),ns.call(this,t),this._readableState.sync=!1,this[Gi]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",mb)}s(et,"Transform");function is(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(is,"final");function mb(){this._final!==is&&is.call(this)}s(mb,"prefinish");et.prototype._final=is;et.prototype._transform=function(t,e,i){throw new pb("_transform()")};et.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[Gi]=i})};et.prototype._read=function(){if(this[Gi]){let t=this[Gi];this[Gi]=null,t()}}});var ss=F((W_,tf)=>{"use strict";var{ObjectSetPrototypeOf:ef}=R();tf.exports=pi;var os=rs();ef(pi.prototype,os.prototype);ef(pi,os);function pi(t){if(!(this instanceof pi))return new pi(t);os.call(this,t)}s(pi,"PassThrough");pi.prototype._transform=function(t,e,i){i(null,t)}});var lr=F((j_,af)=>{var Yi=ut(),{ArrayIsArray:bb,Promise:gb,SymbolAsyncIterator:wb,SymbolDispose:Sb}=R(),ar=Je(),{once:_b}=J(),Eb=kt(),nf=je(),{aggregateTwoErrors:xb,codes:{ERR_INVALID_ARG_TYPE:ys,ERR_INVALID_RETURN_VALUE:as,ERR_MISSING_ARGS:vb,ERR_STREAM_DESTROYED:kb,ERR_STREAM_PREMATURE_CLOSE:Nb},AbortError:Ib}=ie(),{validateFunction:Fb,validateAbortSignal:Ab}=ri(),{isIterable:At,isReadable:ls,isReadableNodeStream:sr,isNodeStream:rf,isTransformStream:yi,isWebStream:Tb,isReadableStream:cs,isReadableFinished:Ob}=Ue(),Lb=globalThis.AbortController||ti().AbortController,us,fs,ds;function of(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=ar(t,{readable:e,writable:i},o=>{n=!o});return{destroy:o=>{n||(n=!0,Eb.destroyer(t,o||new kb("pipe")))},cleanup:r}}s(of,"destroyer");function Pb(t){return Fb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Pb,"popCallback");function hs(t){if(At(t))return t;if(sr(t))return Rb(t);throw new ys("val",["Readable","Iterable","AsyncIterable"],t)}s(hs,"makeAsyncIterable");async function*Rb(t){fs||(fs=Vi()),yield*fs.prototype[wb].call(t)}s(Rb,"fromReadable");async function or(t,e,i,{end:n}){let r,o=null,a=s(u=>{if(u&&(r=u),o){let d=o;o=null,d()}},"resume"),l=s(()=>new gb((u,d)=>{r?d(r):o=s(()=>{r?d(r):u()},"onresolve")}),"wait");e.on("drain",a);let c=ar(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();n&&(e.end(),await l()),i()}catch(u){i(r!==u?xb(r,u):u)}finally{c(),e.off("drain",a)}}s(or,"pumpToNode");async function ps(t,e,i,{end:n}){yi(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)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(ps,"pumpToWeb");function Cb(...t){return sf(t,_b(Pb(t)))}s(Cb,"pipeline");function sf(t,e,i){if(t.length===1&&bb(t[0])&&(t=t[0]),t.length<2)throw new vb("streams");let n=new Lb,r=n.signal,o=i?.signal,a=[];Ab(o,"options.signal");function l(){w(new Ib)}s(l,"abort"),ds=ds||J().addAbortListener;let c;o&&(c=ds(o,l));let u,d,h=[],m=0;function b(D){w(D,--m===0)}s(b,"finish");function w(D,I){var q;if(D&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=D),!(!u&&!I)){for(;h.length;)h.shift()(u);(q=c)===null||q===void 0||q[Sb](),n.abort(),I&&(u||a.forEach(ht=>ht()),Yi.nextTick(e,u,d))}}s(w,"finishImpl");let g;for(let D=0;D<t.length;D++){let I=t[D],q=D<t.length-1,ht=D>0,ue=q||i?.end!==!1,Rt=D===t.length-1;if(rf(I)){let ne=function(Ve){Ve&&Ve.name!=="AbortError"&&Ve.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(Ve)};var A=ne;if(s(ne,"onError"),ue){let{destroy:Ve,cleanup:br}=of(I,q,ht);h.push(Ve),ls(I)&&Rt&&a.push(br)}I.on("error",ne),ls(I)&&Rt&&a.push(()=>{I.removeListener("error",ne)})}if(D===0)if(typeof I=="function"){if(g=I({signal:r}),!At(g))throw new as("Iterable, AsyncIterable or Stream","source",g)}else At(I)||sr(I)||yi(I)?g=I:g=nf.from(I);else if(typeof I=="function"){if(yi(g)){var N;g=hs((N=g)===null||N===void 0?void 0:N.readable)}else g=hs(g);if(g=I(g,{signal:r}),q){if(!At(g,!0))throw new as("AsyncIterable",`transform[${D-1}]`,g)}else{var S;us||(us=ss());let ne=new us({objectMode:!0}),Ve=(S=g)===null||S===void 0?void 0:S.then;if(typeof Ve=="function")m++,Ve.call(g,nt=>{d=nt,nt!=null&&ne.write(nt),ue&&ne.end(),Yi.nextTick(b)},nt=>{ne.destroy(nt),Yi.nextTick(b,nt)});else if(At(g,!0))m++,or(g,ne,b,{end:ue});else if(cs(g)||yi(g)){let nt=g.readable||g;m++,or(nt,ne,b,{end:ue})}else throw new as("AsyncIterable or Promise","destination",g);g=ne;let{destroy:br,cleanup:Cf}=of(g,!1,!0);h.push(br),Rt&&a.push(Cf)}}else if(rf(I)){if(sr(g)){m+=2;let ne=Db(g,I,b,{end:ue});ls(I)&&Rt&&a.push(ne)}else if(yi(g)||cs(g)){let ne=g.readable||g;m++,or(ne,I,b,{end:ue})}else if(At(g))m++,or(g,I,b,{end:ue});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else if(Tb(I)){if(sr(g))m++,ps(hs(g),I,b,{end:ue});else if(cs(g)||At(g))m++,ps(g,I,b,{end:ue});else if(yi(g))m++,ps(g.readable,I,b,{end:ue});else throw new ys("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else g=nf.from(I)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&Yi.nextTick(l),g}s(sf,"pipelineImpl");function Db(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new Nb)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),Ob(t)?Yi.nextTick(a):t.once("end",a)}else i();return ar(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),ar(e,{readable:!1,writable:!0},i)}s(Db,"pipe");af.exports={pipelineImpl:sf,pipeline:Cb}});var bs=F((V_,hf)=>{"use strict";var{pipeline:Bb}=lr(),cr=je(),{destroyer:Mb}=kt(),{isNodeStream:ur,isReadable:lf,isWritable:cf,isWebStream:ms,isTransformStream:Tt,isWritableStream:uf,isReadableStream:ff}=Ue(),{AbortError:Ub,codes:{ERR_INVALID_ARG_VALUE:df,ERR_MISSING_ARGS:Wb}}=ie(),qb=Je();hf.exports=s(function(...e){if(e.length===0)throw new Wb("streams");if(e.length===1)return cr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=cr.from(e[0])),typeof e[e.length-1]=="function"){let b=e.length-1;e[b]=cr.from(e[b])}for(let b=0;b<e.length;++b)if(!(!ur(e[b])&&!ms(e[b]))){if(b<e.length-1&&!(lf(e[b])||ff(e[b])||Tt(e[b])))throw new df(`streams[${b}]`,i[b],"must be readable");if(b>0&&!(cf(e[b])||uf(e[b])||Tt(e[b])))throw new df(`streams[${b}]`,i[b],"must be writable")}let n,r,o,a,l;function c(b){let w=a;a=null,w?w(b):b?l.destroy(b):!m&&!h&&l.destroy()}s(c,"onfinished");let u=e[0],d=Bb(e,c),h=!!(cf(u)||uf(u)||Tt(u)),m=!!(lf(d)||ff(d)||Tt(d));if(l=new cr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(ur(u))l._write=function(w,g,N){u.write(w,g)?N():n=N},l._final=function(w){u.end(),r=w},u.on("drain",function(){if(n){let w=n;n=null,w()}});else if(ms(u)){let g=(Tt(u)?u.writable:u).getWriter();l._write=async function(N,S,A){try{await g.ready,g.write(N).catch(()=>{}),A()}catch(D){A(D)}},l._final=async function(N){try{await g.ready,g.close().catch(()=>{}),r=N}catch(S){N(S)}}}let b=Tt(d)?d.readable:d;qb(b,()=>{if(r){let w=r;r=null,w()}})}if(m){if(ur(d))d.on("readable",function(){if(o){let b=o;o=null,b()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let b=d.read();if(b===null){o=l._read;return}if(!l.push(b))return}};else if(ms(d)){let w=(Tt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:g,done:N}=await w.read();if(!l.push(g))return;if(N){l.push(null);return}}catch{return}}}}return l._destroy=function(b,w){!b&&a!==null&&(b=new Ub),o=null,n=null,r=null,a===null?w(b):(a=w,ur(d)&&Mb(d,b))},l},"compose")});var xf=F((H_,ws)=>{"use strict";var jb=globalThis.AbortController||ti().AbortController,{codes:{ERR_INVALID_ARG_VALUE:$b,ERR_INVALID_ARG_TYPE:Xi,ERR_MISSING_ARGS:Vb,ERR_OUT_OF_RANGE:zb},AbortError:$e}=ie(),{validateAbortSignal:Ot,validateInteger:pf,validateObject:Lt}=ri(),Hb=R().Symbol("kWeak"),Kb=R().Symbol("kResistStopPropagation"),{finished:Gb}=Je(),Yb=bs(),{addAbortSignalNoValidate:Xb}=Wi(),{isWritable:Jb,isNodeStream:Qb}=Ue(),{deprecate:Zb}=J(),{ArrayPrototypePush:eg,Boolean:tg,MathFloor:yf,Number:ig,NumberIsNaN:ng,Promise:mf,PromiseReject:bf,PromiseResolve:rg,PromisePrototypeThen:gf,Symbol:Sf}=R(),dr=Sf("kEmpty"),wf=Sf("kEof");function og(t,e){if(e!=null&&Lt(e,"options"),e?.signal!=null&&Ot(e.signal,"options.signal"),Qb(t)&&!Jb(t))throw new $b("stream",t,"must be writable");let i=Yb(this,t);return e!=null&&e.signal&&Xb(e.signal,i),i}s(og,"compose");function hr(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);e!=null&&Lt(e,"options"),e?.signal!=null&&Ot(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=yf(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=yf(e.highWaterMark)),pf(i,"options.concurrency",1),pf(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=J().AbortSignalAny([e?.signal].filter(tg)),a=this,l=[],c={signal:o},u,d,h=!1,m=0;function b(){h=!0,w()}s(b,"onCatch");function w(){m-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&m<i&&l.length<n&&(d(),d=null)}s(g,"maybeResume");async function N(){try{for await(let S of a){if(h)return;if(o.aborted)throw new $e;try{if(S=t(S,c),S===dr)continue;S=rg(S)}catch(A){S=bf(A)}m+=1,gf(S,w,b),l.push(S),u&&(u(),u=null),!h&&(l.length>=n||m>=i)&&await new mf(A=>{d=A})}l.push(wf)}catch(S){let A=bf(S);gf(A,w,b),l.push(A)}finally{h=!0,u&&(u(),u=null)}}s(N,"pump"),N();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===wf)return;if(o.aborted)throw new $e;S!==dr&&(yield S),l.shift(),g()}await new mf(S=>{u=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(hr,"map");function sg(t=void 0){return t!=null&&Lt(t,"options"),t?.signal!=null&&Ot(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new $e({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(sg,"asIndexedPairs");async function _f(t,e=void 0){for await(let i of gs.call(this,t,e))return!0;return!1}s(_f,"some");async function ag(t,e=void 0){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);return!await _f.call(this,async(...i)=>!await t(...i),e)}s(ag,"every");async function lg(t,e){for await(let i of gs.call(this,t,e))return i}s(lg,"find");async function cg(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),dr}s(i,"forEachFn");for await(let n of hr.call(this,i,e));}s(cg,"forEach");function gs(t,e){if(typeof t!="function")throw new Xi("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:dr}return s(i,"filterFn"),hr.call(this,i,e)}s(gs,"filter");var fr=class extends Vb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(fr,"ReduceAwareErrMissingArgs");async function ug(t,e,i){var n;if(typeof t!="function")throw new Xi("reducer",["Function","AsyncFunction"],t);i!=null&&Lt(i,"options"),i?.signal!=null&&Ot(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let u=new $e(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await Gb(this.destroy(u)),u}let o=new jb,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[Hb]:this,[Kb]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new $e;r?e=await t(e,u,{signal:a}):(e=u,r=!0)}if(!l&&!r)throw new fr}finally{o.abort()}return e}s(ug,"reduce");async function fg(t){t!=null&&Lt(t,"options"),t?.signal!=null&&Ot(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new $e(void 0,{cause:t.signal.reason});eg(e,n)}return e}s(fg,"toArray");function dg(t,e){let i=hr.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(dg,"flatMap");function Ef(t){if(t=ig(t),ng(t))return 0;if(t<0)throw new zb("number",">= 0",t);return t}s(Ef,"toIntegerOrInfinity");function hg(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ot(e.signal,"options.signal"),t=Ef(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new $e;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new $e;t--<=0&&(yield o)}},"drop").call(this)}s(hg,"drop");function pg(t,e=void 0){return e!=null&&Lt(e,"options"),e?.signal!=null&&Ot(e.signal,"options.signal"),t=Ef(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new $e;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new $e;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(pg,"take");ws.exports.streamReturningOperators={asIndexedPairs:Zb(sg,"readable.asIndexedPairs will be removed in a future version."),drop:hg,filter:gs,flatMap:dg,map:hr,take:pg,compose:og};ws.exports.promiseReturningOperators={every:ag,forEach:cg,reduce:ug,toArray:fg,some:_f,find:lg}});var Ss=F((G_,vf)=>{"use strict";var{ArrayPrototypePop:yg,Promise:mg}=R(),{isIterable:bg,isNodeStream:gg,isWebStream:wg}=Ue(),{pipelineImpl:Sg}=lr(),{finished:_g}=Je();_s();function Eg(...t){return new mg((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!gg(o)&&!bg(o)&&!wg(o)){let a=yg(t);n=a.signal,r=a.end}Sg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(Eg,"pipeline");vf.exports={finished:_g,pipeline:Eg}});var _s=F((X_,Pf)=>{var{Buffer:xg}=Ee(),{ObjectDefineProperty:tt,ObjectKeys:If,ReflectApply:Ff}=R(),{promisify:{custom:Af}}=J(),{streamReturningOperators:kf,promiseReturningOperators:Nf}=xf(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Tf}}=ie(),vg=bs(),{setDefaultHighWaterMark:kg,getDefaultHighWaterMark:Ng}=qi(),{pipeline:Of}=lr(),{destroyer:Ig}=kt(),Lf=Je(),Es=Ss(),Ji=Ue(),P=Pf.exports=zn().Stream;P.isDestroyed=Ji.isDestroyed;P.isDisturbed=Ji.isDisturbed;P.isErrored=Ji.isErrored;P.isReadable=Ji.isReadable;P.isWritable=Ji.isWritable;P.Readable=Vi();for(let t of If(kf)){let i=function(...n){if(new.target)throw Tf();return P.Readable.from(Ff(e,this,n))};Ag=i,s(i,"fn");let e=kf[t];tt(i,"name",{__proto__:null,value:e.name}),tt(i,"length",{__proto__:null,value:e.length}),tt(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ag;for(let t of If(Nf)){let i=function(...r){if(new.target)throw Tf();return Ff(e,this,r)};Ag=i,s(i,"fn");let e=Nf[t];tt(i,"name",{__proto__:null,value:e.name}),tt(i,"length",{__proto__:null,value:e.length}),tt(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ag;P.Writable=rr();P.Duplex=je();P.Transform=rs();P.PassThrough=ss();P.pipeline=Of;var{addAbortSignal:Fg}=Wi();P.addAbortSignal=Fg;P.finished=Lf;P.destroy=Ig;P.compose=vg;P.setDefaultHighWaterMark=kg;P.getDefaultHighWaterMark=Ng;tt(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return Es}});tt(Of,Af,{__proto__:null,enumerable:!0,get(){return Es.pipeline}});tt(Lf,Af,{__proto__:null,enumerable:!0,get(){return Es.finished}});P.Stream=P;P._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");P._uint8ArrayToBuffer=s(function(e){return xg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var Rf=F((Q_,W)=>{"use strict";var H=_s(),Tg=Ss(),Og=H.Readable.destroy;W.exports=H.Readable;W.exports._uint8ArrayToBuffer=H._uint8ArrayToBuffer;W.exports._isUint8Array=H._isUint8Array;W.exports.isDisturbed=H.isDisturbed;W.exports.isErrored=H.isErrored;W.exports.isReadable=H.isReadable;W.exports.Readable=H.Readable;W.exports.Writable=H.Writable;W.exports.Duplex=H.Duplex;W.exports.Transform=H.Transform;W.exports.PassThrough=H.PassThrough;W.exports.addAbortSignal=H.addAbortSignal;W.exports.finished=H.finished;W.exports.destroy=H.destroy;W.exports.destroy=Og;W.exports.pipeline=H.pipeline;W.exports.compose=H.compose;Object.defineProperty(H,"promises",{configurable:!0,enumerable:!0,get(){return Tg}});W.exports.Stream=H.Stream;W.exports.default=W.exports});var Rg={};nn(Rg,{ActionType:()=>hn,ApiError:()=>f,Async:()=>Ir,AsyncIndexFS:()=>mr,AsyncStoreFS:()=>yn,BigIntStats:()=>G,BigIntStatsFs:()=>fn,Dir:()=>Li,Dirent:()=>Ge,ErrorCode:()=>$,File:()=>Ei,FileIndex:()=>Pt,FileSystem:()=>ee,FileType:()=>M,InMemory:()=>Ni,InMemoryStore:()=>ki,IndexDirInode:()=>it,IndexFS:()=>bi,IndexFileInode:()=>tn,IndexInode:()=>mi,Inode:()=>fe,LockedFS:()=>Vt,Mutex:()=>$t,NoSyncFile:()=>yt,Overlay:()=>xd,OverlayFS:()=>zt,PreloadFile:()=>Z,ReadStream:()=>Qi,Readonly:()=>Fr,SimpleSyncTransaction:()=>qt,Stats:()=>B,StatsCommon:()=>Mt,StatsFs:()=>Ut,Sync:()=>Nr,SyncIndexFS:()=>yr,SyncStoreFS:()=>jt,UnlockedOverlayFS:()=>Ii,WriteStream:()=>Zi,_toUnixTimestamp:()=>Wr,access:()=>ul,accessSync:()=>_a,appendFile:()=>Wa,appendFileSync:()=>oa,checkOptions:()=>an,chmod:()=>ol,chmodSync:()=>ba,chown:()=>nl,chownSync:()=>ya,close:()=>ja,closeSync:()=>Ke,configure:()=>Lg,constants:()=>Bt,copyFile:()=>gl,copyFileSync:()=>va,cp:()=>El,cpSync:()=>Fa,createBackend:()=>zf,createReadStream:()=>pl,createWriteStream:()=>yl,decode:()=>sn,decodeDirListing:()=>wi,default:()=>Pg,encode:()=>Ae,encodeDirListing:()=>ae,errorMessages:()=>wr,exists:()=>La,existsSync:()=>Sn,fchmod:()=>Ya,fchmodSync:()=>vn,fchown:()=>Ga,fchownSync:()=>xn,fdatasync:()=>za,fdatasyncSync:()=>la,flagToMode:()=>rt,flagToNumber:()=>Ed,flagToString:()=>Ts,fs:()=>en,fstat:()=>qa,fstatSync:()=>sa,fsync:()=>Va,fsyncSync:()=>aa,ftruncate:()=>$a,ftruncateSync:()=>$r,futimes:()=>Xa,futimesSync:()=>kn,isAppendable:()=>ot,isBackend:()=>Si,isBackendConfig:()=>_r,isExclusive:()=>Ls,isReadable:()=>ze,isSynchronous:()=>_i,isTruncating:()=>Os,isWriteable:()=>he,lchmod:()=>sl,lchmodSync:()=>ga,lchown:()=>rl,lchownSync:()=>ma,levenshtein:()=>Sr,link:()=>el,linkSync:()=>ha,lopenSync:()=>Oi,lstat:()=>Ra,lstatSync:()=>ia,lutimes:()=>ll,lutimesSync:()=>Sa,mkdir:()=>Qa,mkdirSync:()=>da,mkdirpSync:()=>Fs,mkdtemp:()=>bl,mkdtempSync:()=>xa,mount:()=>Ai,mountMapping:()=>Ti,mounts:()=>ye,open:()=>Ba,openAsBlob:()=>vl,openSync:()=>ei,opendir:()=>_l,opendirSync:()=>Ia,parseFlag:()=>L,pathExistsAction:()=>xi,pathNotExistsAction:()=>vi,promises:()=>Mi,randomIno:()=>Wt,read:()=>Ka,readFile:()=>Ma,readFileSync:()=>jr,readSync:()=>ua,readdir:()=>Za,readdirSync:()=>Nn,readlink:()=>il,readlinkSync:()=>Vr,readv:()=>wl,readvSync:()=>ka,realpath:()=>cl,realpathSync:()=>Qt,rename:()=>Oa,renameSync:()=>ta,resolveMountConfig:()=>vs,rm:()=>ml,rmSync:()=>Ea,rmdir:()=>Ja,rmdirSync:()=>fa,rootCred:()=>_e,rootIno:()=>de,setImmediate:()=>Vf,size_max:()=>dn,stat:()=>Pa,statSync:()=>_n,statfs:()=>xl,statfsSync:()=>Aa,symlink:()=>tl,symlinkSync:()=>pa,truncate:()=>Ca,truncateSync:()=>na,umount:()=>wn,unlink:()=>Da,unlinkSync:()=>qr,unwatchFile:()=>dl,utimes:()=>al,utimesSync:()=>wa,watch:()=>hl,watchFile:()=>fl,write:()=>Ha,writeFile:()=>Ua,writeFileSync:()=>En,writeSync:()=>ca,writev:()=>Sl,writevSync:()=>Na});var $=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))($||{}),wr={[1]:"Operation not permitted",[2]:"No such file or directory",[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"},f=class extends Error{constructor(i,n=wr[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=$[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new f(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 f($[i],wr[$[i]],n,r)}code;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(f,"ApiError");var jf="/";var Ns="/";function pt(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(pt,"validateString");function Is(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Is,"normalizeString");function Fe(...t){let e="",i=!1;for(let n=t.length-1;n>=-1&&!i;n--){let r=n>=0?t[n]:jf;pt(r,`paths[${n}]`),r.length&&(e=`${r}/${e}`,i=r[0]=="/")}return e=Is(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Fe,"resolve");function $f(t){if(pt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=Is(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s($f,"normalize");function re(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let n=t[i];pt(n,"path"),n.length>0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":$f(e)}s(re,"join");function x(t){if(pt(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function O(t,e){e!==void 0&&pt(e,"ext"),pt(t,"path");let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(O,"basename");function rn(t){pt(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}if(a!==-1){let d=o===0&&e?1:o;r===-1||u===0||u===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,r),i.base=t.slice(d,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(rn,"parse");function Fs(t,e,i,n){n.existsSync(t,i)||(Fs(x(t),e,i,n),n.mkdirSync(t,e,i))}s(Fs,"mkdirpSync");function on(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(on,"_min");function Sr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(r+m),o[m]=++m;let a,l,c,u,d;for(a=0;a+3<n;){let m=e.charCodeAt(r+(l=a)),b=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(u=a+2)),g=e.charCodeAt(r+(d=a+3)),N=a+=4;for(let S=0;S<i;){let A=o[i+S],D=o[S];l=on(D,l,c,m,A),c=on(l,c,u,b,A),u=on(c,u,d,w,A),N=on(u,d,N,g,A),o[S++]=N,d=u,u=c,c=l,l=D}}let h=0;for(;a<n;){let m=e.charCodeAt(r+(l=a));h=++a;for(let b=0;b<i;b++){let w=o[b];o[b]=h=w<l||h<l?w>h?h+1:w+1:m===o[i+b]?l:l+1,l=w}}return h}s(Sr,"levenshtein");var Vf=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Ae(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Ae,"encode");function sn(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(sn,"decode");function wi(t){return JSON.parse(sn(t),(e,i)=>e==""?i:BigInt(i))}s(wi,"decodeDirListing");function ae(t){return Ae(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(ae,"encodeDirListing");function Si(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(Si,"isBackend");async function an(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Sr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.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 f(22,`${t.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(an,"checkOptions");function zf(t,e){return an(t,e),t.create(e).ready()}s(zf,"createBackend");function _r(t){return t!=null&&typeof t=="object"&&"backend"in t&&Si(t.backend)}s(_r,"isBackendConfig");var Bt={};nn(Bt,{COPYFILE_EXCL:()=>Kf,COPYFILE_FICLONE:()=>Gf,COPYFILE_FICLONE_FORCE:()=>Yf,F_OK:()=>Er,O_APPEND:()=>Pe,O_CREAT:()=>K,O_DIRECT:()=>id,O_DIRECTORY:()=>Jf,O_DSYNC:()=>ed,O_EXCL:()=>Oe,O_NOATIME:()=>Qf,O_NOCTTY:()=>Xf,O_NOFOLLOW:()=>Zf,O_NONBLOCK:()=>nd,O_RDONLY:()=>Ct,O_RDWR:()=>oe,O_SYMLINK:()=>td,O_SYNC:()=>Dt,O_TRUNC:()=>Le,O_WRONLY:()=>Te,R_OK:()=>we,S_IFBLK:()=>od,S_IFCHR:()=>sd,S_IFDIR:()=>un,S_IFIFO:()=>ad,S_IFLNK:()=>ln,S_IFMT:()=>Se,S_IFREG:()=>cn,S_IFSOCK:()=>rd,S_IRGRP:()=>pd,S_IROTH:()=>bd,S_IRUSR:()=>fd,S_IRWXG:()=>vr,S_IRWXO:()=>kr,S_IRWXU:()=>xr,S_ISGID:()=>cd,S_ISUID:()=>ld,S_ISVTX:()=>ud,S_IWGRP:()=>yd,S_IWOTH:()=>gd,S_IWUSR:()=>dd,S_IXGRP:()=>md,S_IXOTH:()=>wd,S_IXUSR:()=>hd,UV_FS_O_FILEMAP:()=>Sd,W_OK:()=>le,X_OK:()=>Hf});var Er=0,we=4,le=2,Hf=1,Kf=1,Gf=2,Yf=4,Ct=0,Te=1,oe=2,K=64,Oe=128,Xf=256,Le=512,Pe=1024,Jf=65536,Qf=262144,Zf=131072,Dt=1052672,ed=4096,td=32768,id=16384,nd=2048,Se=61440,rd=49152,ln=40960,cn=32768,od=24576,un=16384,sd=8192,ad=4096,ld=2048,cd=1024,ud=512,xr=448,fd=256,dd=128,hd=64,vr=56,pd=32,yd=16,md=8,kr=7,bd=4,gd=2,wd=1,Sd=0;var M=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(M||{}),Mt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c}={}){let u=Date.now(),d=s((m,b)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:b),"resolveT");this.atimeMs=d(e,u),this.mtimeMs=d(i,u),this.ctimeMs=d(n,u),this.birthtimeMs=d(r,u),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(c)&61440||M.FILE;if(c)this.mode=this._convert(c);else switch(h){case M.FILE:this.mode=this._convert(420);break;case M.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Mt,"StatsCommon");var B=class extends Mt{_isBigint=!1;static clone(e){return new B(e)}};s(B,"Stats");var G=class extends Mt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new G(e)}};s(G,"BigIntStats");var Ut=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Ut,"StatsFs");var fn=class{type;bsize;blocks;bfree;bavail;files;ffree};s(fn,"BigIntStatsFs");var dn=2**32-1,de=0n;function As(){return Math.round(Math.random()*2**32).toString(16)}s(As,"_random");function Wt(){return BigInt("0x"+As()+As())}s(Wt,"randomIno");var fe=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Wt(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new B(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(fe,"Inode");var hn=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(hn||{}),_d=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function L(t){if(typeof t=="number")return Ts(t);if(!_d.includes(t))throw new Error("Invalid flag string: "+t);return t}s(L,"parseFlag");function Ts(t){switch(t){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: "+t)}}s(Ts,"flagToString");function Ed(t){switch(t){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: "+t)}}s(Ed,"flagToNumber");function rt(t){let e=0;return e<<=1,e+=+ze(t),e<<=1,e+=+he(t),e<<=1,e}s(rt,"flagToMode");function ze(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(ze,"isReadable");function he(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(he,"isWriteable");function Os(t){return t.indexOf("w")!==-1}s(Os,"isTruncating");function ot(t){return t.indexOf("a")!==-1}s(ot,"isAppendable");function _i(t){return t.indexOf("s")!==-1}s(_i,"isSynchronous");function Ls(t){return t.indexOf("x")!==-1}s(Ls,"isExclusive");function xi(t){return Ls(t)?1:Os(t)?2:0}s(xi,"pathExistsAction");function vi(t){return(he(t)||ot(t))&&t!=="r+"?3:1}s(vi,"pathNotExistsAction");var Ei=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Ei,"File");var Z=class extends Ei{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:dn}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(ze(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return ot(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new B(this.stats)}statSync(){return new B(this.stats)}truncate(i){if(this.truncateSync(i),_i(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!he(this.flag))throw new f(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),_i(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),_i(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){return this.writeSync(i,n,r,o)}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!he(this.flag))throw new f(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 u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:dn}));u.set(this._buffer),this._buffer=u}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),_i(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o=0){if(!ze(this.flag))throw new f(1,"File not opened with a readable mode.");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 l=a-o;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(o,a),n),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(Z,"PreloadFile");var yt=class extends Z{constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(yt,"NoSyncFile");var _e={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var ee=class{metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(ee,"FileSystem");function Nr(t){class e extends t{async ready(){return this}async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return s(e,"_SyncFileSystem"),e}s(Nr,"Sync");function Ir(t){class e extends t{_queue=[];_queueRunning=!1;_isInitialized=!1;async ready(){if(await this._sync.ready(),this._isInitialized)return this;try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}return this}renameSync(n,r,o){this._sync.renameSync(n,r,o),this.queue("rename",n,r,o)}statSync(n,r){return this._sync.statSync(n,r)}createFileSync(n,r,o,a){let l=this._sync.createFileSync(n,r,o,a);this.queue("createFile",n,r,o,a);let c=l.statSync(),u=new Uint8Array(c.size);return l.readSync(u),new Z(this,n,r,c,u)}openFileSync(n,r,o){return this._sync.openFileSync(n,r,o)}unlinkSync(n,r){this._sync.unlinkSync(n,r),this.queue("unlink",n,r)}rmdirSync(n,r){this._sync.rmdirSync(n,r),this.queue("rmdir",n,r)}mkdirSync(n,r,o){this._sync.mkdirSync(n,r,o),this.queue("mkdir",n,r,o)}readdirSync(n,r){return this._sync.readdirSync(n,r)}linkSync(n,r,o){this._sync.linkSync(n,r,o),this.queue("link",n,r,o)}syncSync(n,r,o){this._sync.syncSync(n,r,o),this.queue("sync",n,r,o)}existsSync(n,r){return this._sync.existsSync(n,r)}async crossCopy(n){let r=await this.stat(n,_e);if(r.isDirectory()){if(n!=="/"){let a=await this.stat(n,_e);this._sync.mkdirSync(n,a.mode,a.cred())}let o=await this.readdir(n,_e);for(let a of o)await this.crossCopy(re(n,a))}else{let o=await this.openFile(n,L("r"),_e),a=this._sync.createFileSync(n,L("w"),r.mode,_e);try{let{size:l}=await o.stat(),c=new Uint8Array(l);await o.read(c),a.writeSync(c)}finally{await o.close(),a.closeSync()}}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let[n,...r]=this._queue.shift();await this[n](...r),await this._next()}queue(...n){this._queue.push(n),!this._queueRunning&&(this._queueRunning=!0,this._next())}}return s(e,"_AsyncFileSystem"),e}s(Ir,"Async");function Fr(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new f(30)}renameSync(n,r,o){throw new f(30)}async createFile(n,r,o,a){throw new f(30)}createFileSync(n,r,o,a){throw new f(30)}async unlink(n,r){throw new f(30)}unlinkSync(n,r){throw new f(30)}async rmdir(n,r){throw new f(30)}rmdirSync(n,r){throw new f(30)}async mkdir(n,r,o){throw new f(30)}mkdirSync(n,r,o){throw new f(30)}async link(n,r,o){throw new f(30)}linkSync(n,r,o){throw new f(30)}async sync(n,r,o){throw new f(30)}syncSync(n,r,o){throw new f(30)}}return s(e,"_ReadonlyFileSystem"),e}s(Fr,"Readonly");var qt=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,n){return this.markModified(e),this.store.put(e,i,n)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(qt,"SimpleSyncTransaction");var jt=class extends Nr(ee){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=O(e),l=x(i),c=O(i),u=this.findINode(r,o),d=this.getDirListing(r,u,o);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",e,"renameSync");if(!d[a])throw f.With("ENOENT",e,"renameSync");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new f(16,o);let m,b;if(l===o?(m=u,b=d):(m=this.findINode(r,l),b=this.getDirListing(r,m,l)),b[c]){let w=this.getINode(r,b[c],i);if(w.toStats().isFile())try{r.remove(w.ino),r.remove(b[c])}catch(g){throw r.abort(),g}else throw f.With("EPERM",i,"renameSync")}b[c]=h;try{r.put(u.ino,ae(d),!0),r.put(m.ino,ae(b),!0)}catch(w){throw r.abort(),w}r.commit()}statSync(e,i){let n=this.findINode(this.store.beginTransaction(),e).toStats();if(!n.hasAccess(4,i))throw f.With("EACCES",e,"statSync");return n}createFileSync(e,i,n,r){return this.commitNewFile(e,M.FILE,n,r),this.openFileSync(e,i,r)}openFileSync(e,i,n){let r=this.store.beginTransaction(),o=this.findINode(r,e),a=r.get(o.ino);if(!o.toStats().hasAccess(rt(i),n))throw f.With("EACCES",e,"openFileSync");if(a===null)throw f.With("ENOENT",e,"openFileSync");return new Z(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdirSync");this.removeEntry(e,!0,i)}mkdirSync(e,i,n){this.commitNewFile(e,M.DIRECTORY,i,n,Ae("{}"))}readdirSync(e,i){let n=this.store.beginTransaction(),r=this.findINode(n,e);if(!r.toStats().hasAccess(4,i))throw f.With("EACCES",e,"readdirSync");return Object.keys(this.getDirListing(n,r,e))}syncSync(e,i,n){let r=this.store.beginTransaction(),o=this._findINode(r,x(e),O(e)),a=this.getINode(r,o,e),l=a.update(n);try{r.put(a.ino,i,!0),l&&r.put(o,a.data,!0)}catch(c){throw r.abort(),c}r.commit()}linkSync(e,i,n){let r=this.store.beginTransaction(),o=x(e);if(!this.findINode(r,o).toStats().hasAccess(4,n))throw f.With("EACCES",o,"linkSync");let l=x(i),c=this.findINode(r,l),u=this.getDirListing(r,c,l);if(!c.toStats().hasAccess(2,n))throw f.With("EACCES",l,"linkSync");let d=this._findINode(r,o,O(e)),h=this.getINode(r,d,e);if(!h.toStats().hasAccess(2,n))throw f.With("EACCES",i,"linkSync");h.nlink++,u[O(i)]=d;try{r.put(d,h.data,!0),r.put(c.ino,ae(u),!0)}catch(m){throw r.abort(),m}r.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(de))return;let i=new fe;i.mode=511|M.DIRECTORY,e.put(i.ino,Ae("{}"),!1),e.put(de,i.data,!1),e.commit()}_findINode(e,i,n,r=new Set){let o=re(i,n);if(r.has(o))throw new f(5,"Infinite loop detected while finding inode",o);if(r.add(o),i!="/"){let a=this._findINode(e,x(i),O(i),r),l=this.getDirListing(e,this.getINode(e,a,i+Ns+n),i);if(!(n in l))throw f.With("ENOENT",Fe(i,n),"_findINode");return l[n]}if(n!=""){let a=this.getDirListing(e,this.getINode(e,de,i),i);if(!(n in a))throw f.With("ENOENT",Fe(i,n),"_findINode");return a[n]}return de}findINode(e,i){let n=this._findINode(e,x(i),O(i));return this.getINode(e,n,i)}getINode(e,i,n){let r=e.get(i);if(!r)throw f.With("ENOENT",n,"getINode");return new fe(r.buffer)}getDirListing(e,i,n){if(!i.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let r=e.get(i.ino);if(!r)throw f.With("ENOENT",n,"getDirListing");return wi(r)}addNewNode(e,i,n=5){for(let r=0;r<n;r++){let o=Wt();if(e.put(o,i,!1))return o}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,n,r,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=O(e),u=this.findINode(a,l),d=this.getDirListing(a,u,l);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",e,"commitNewFile");if(e==="/")throw f.With("EEXIST",e,"commitNewFile");if(d[c])throw f.With("EEXIST",e,"commitNewFile");let h=new fe;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=n|i,h.uid=r.uid,h.gid=r.gid,d[c]=this.addNewNode(a,h.data),a.put(u.ino,ae(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=this.findINode(r,o),l=this.getDirListing(r,a,o),c=O(e),u=l[c];if(!u)throw f.With("ENOENT",e,"removeEntry");let d=this.getINode(r,u,e);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw f.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw f.With("ENOTDIR",e,"removeEntry");try{r.put(a.ino,ae(l),!0),--d.nlink<1&&(r.remove(d.ino),r.remove(u))}catch(h){throw r.abort(),h}r.commit()}};s(jt,"SyncStoreFS");var ki=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new qt(this)}get(e){return this.store.get(e)}put(e,i,n){return!n&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(ki,"InMemoryStore");var Ni={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new jt({store:new ki(t)})}};var pn=class{constructor(e){this.limit=e}cache=[];set(e,i){let n=this.cache.findIndex(r=>r.key===e);n!=-1?this.cache.splice(n,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(n=>n.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(n=>n.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(pn,"LRUCache");var yn=class extends Ir(ee){constructor(i){super();this._options=i}store;_cache;_sync;async ready(){return this._options.lruCacheSize>0&&(this._cache=new pn(this._options.lruCacheSize)),this.store=await this._options.store,this._sync=this._options.sync||Ni.create({name:"test"}),await this.makeRootDirectory(),await super.ready(),this}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(i,n,r){let o=this._cache;this._cache&&(this._cache=null,o.reset());try{let a=this.store.beginTransaction(),l=x(i),c=O(i),u=x(n),d=O(n),h=await this.findINode(a,l),m=await this.getDirListing(a,h,l);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!m[c])throw f.With("ENOENT",i,"rename");let b=m[c];if(delete m[c],(u+"/").indexOf(i+"/")===0)throw new f(16,l);let w,g;if(u===l?(w=h,g=m):(w=await this.findINode(a,u),g=await this.getDirListing(a,w,u)),g[d]){let N=await this.getINode(a,g[d],n);if(N.toStats().isFile())try{await a.remove(N.ino),await a.remove(g[d])}catch(S){throw await a.abort(),S}else throw f.With("EPERM",n,"rename")}g[d]=b;try{await a.put(h.ino,ae(m),!0),await a.put(w.ino,ae(g),!0)}catch(N){throw await a.abort(),N}await a.commit()}finally{o&&(this._cache=o)}}async stat(i,n){let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw f.With("EACCES",i,"stat");return a}async createFile(i,n,r,o){let a=this.store.beginTransaction(),l=new Uint8Array(0),c=await this.commitNewFile(a,i,M.FILE,r,o,l);return new Z(this,i,n,c.toStats(),l)}async openFile(i,n,r){let o=this.store.beginTransaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(rt(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new Z(this,i,n,a.toStats(),l)}async unlink(i,n){return this.removeEntry(i,!1,n)}async rmdir(i,n){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.removeEntry(i,!0,n)}async mkdir(i,n,r){let o=this.store.beginTransaction(),a=Ae("{}");await this.commitNewFile(o,i,M.DIRECTORY,n,r,a)}async readdir(i,n){let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}async sync(i,n,r){let o=this.store.beginTransaction(),a=await this._findINode(o,x(i),O(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.put(l.ino,n,!0),c&&await o.put(a,l.data,!0)}catch(u){throw await o.abort(),u}await o.commit()}async link(i,n,r){let o=this.store.beginTransaction(),a=x(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=x(n),u=await this.findINode(o,c),d=await this.getDirListing(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let h=await this._findINode(o,a,O(i)),m=await this.getINode(o,h,i);if(!m.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");m.nlink++,d[O(n)]=h;try{o.put(h,m.data,!0),o.put(u.ino,ae(d),!0)}catch(b){throw o.abort(),b}o.commit()}async makeRootDirectory(){let i=this.store.beginTransaction();if(await i.get(de)===void 0){let n=new fe;n.mode=511|M.DIRECTORY,await i.put(n.ino,Ae("{}"),!1),await i.put(de,n.data,!1),await i.commit()}}async _findINode(i,n,r,o=new Set){let a=re(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(n==="/"){if(r==="")return this._cache&&this._cache.set(a,de),de;{let l=await this.getINode(i,de,n),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Fe(n,r),"_findINode")}}else{let l=await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Fe(n,r),"_findINode")}}async findINode(i,n,r=new Set){let o=await this._findINode(i,x(n),O(n),r);return this.getINode(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw f.With("ENOENT",r,"getINode");return new fe(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return wi(o)}async addNewNode(i,n,r=5){if(r<=0)throw new f(5,"Unable to commit data to key-value store.");let o=Wt();return await i.put(o,n,!1)?o:await this.addNewNode(i,n,--r)}async commitNewFile(i,n,r,o,a,l){let c=x(n),u=O(n),d=await this.findINode(i,c),h=await this.getDirListing(i,d,c);if(!d.toStats().hasAccess(2,a))throw f.With("EACCES",n,"commitNewFile");if(n==="/")throw f.With("EEXIST",n,"commitNewFile");if(h[u])throw await i.abort(),f.With("EEXIST",n,"commitNewFile");try{let m=new fe;return m.ino=await this.addNewNode(i,l),m.mode=o|r,m.uid=a.uid,m.gid=a.gid,m.size=l.length,h[u]=await this.addNewNode(i,m.data),await i.put(d.ino,ae(h),!0),await i.commit(),m}catch(m){throw i.abort(),m}}async removeEntry(i,n,r){this._cache&&this._cache.remove(i);let o=this.store.beginTransaction(),a=x(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),u=O(i);if(!c[u])throw f.With("ENOENT",i,"removeEntry");let d=c[u],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&h.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!h.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.put(l.ino,ae(c),!0),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(m){throw await o.abort(),m}await o.commit()}};s(yn,"AsyncStoreFS");var $t=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s($t,"Mutex");var Vt=class{constructor(e){this.fs=e}_mu=new $t;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this._mu.lock(e),await this.fs.rename(e,i,n),this._mu.unlock(e)}renameSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,n)}async stat(e,i){await this._mu.lock(e);let n=await this.fs.stat(e,i);return this._mu.unlock(e),n}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,n){await this._mu.lock(e);let r=await this.fs.openFile(e,i,n);return this._mu.unlock(e),r}openFileSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this._mu.lock(e);let o=await this.fs.createFile(e,i,n,r);return this._mu.unlock(e),o}createFileSync(e,i,n,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this._mu.lock(e),await this.fs.mkdir(e,i,n),this._mu.unlock(e)}mkdirSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this._mu.lock(e);let n=await this.fs.readdir(e,i);return this._mu.unlock(e),n}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let n=await this.fs.exists(e,i);return this._mu.unlock(e),n}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,n){await this._mu.lock(e),await this.fs.link(e,i,n),this._mu.unlock(e)}linkSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this._mu.lock(e),await this.fs.sync(e,i,n),this._mu.unlock(e)}syncSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,n)}};s(Vt,"LockedFS");var Ar="/.deleted",Ii=class extends ee{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:zt.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,n){let r=n.cred(0,0);await this.createParentDirectories(e,r),await this._writable.sync(e,i,n)}syncSync(e,i,n){let r=n.cred(0,0);this.createParentDirectoriesSync(e,r),this._writable.syncSync(e,i,n)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Ar,L("r"),_e),{size:i}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(i));this._deleteLog=sn(n)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}renameSync(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"renameSync")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let r=new B(await this._readable.stat(e,i));return r.mode|=146,r}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"statSync");let r=new B(this._readable.statSync(e,i));return r.mode|=146,r}}async openFile(e,i,n){if(await this._writable.exists(e,n))return this._writable.openFile(e,i,n);let r=await this._readable.openFile(e,L("r"),n),o=new B(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new Z(this,e,i,o,a)}openFileSync(e,i,n){if(this._writable.existsSync(e,n))return this._writable.openFileSync(e,i,n);let r=this._readable.openFileSync(e,L("r"),n),o=B.clone(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new Z(this,e,i,o,a)}async createFile(e,i,n,r){return this.checkInitialized(),await this._writable.createFile(e,i,n,r),this.openFile(e,i,r)}createFileSync(e,i,n,r){return this.checkInitialized(),this._writable.createFileSync(e,i,n,r),this.openFileSync(e,i,r)}async link(e,i,n){this.checkInitialized(),await this._writable.link(e,i,n)}linkSync(e,i,n){this.checkInitialized(),this._writable.linkSync(e,i,n)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw f.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw f.With("ENOENT",e,"unlinkSync");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw f.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw f.With("ENOENT",e,"rmdirSync");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdirSync");this.deletePath(e,i)}}async mkdir(e,i,n){if(this.checkInitialized(),await this.exists(e,n))throw f.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,n),await this._writable.mkdir(e,i,n)}mkdirSync(e,i,n){if(this.checkInitialized(),this.existsSync(e,n))throw f.With("EEXIST",e,"mkdirSync");this.createParentDirectoriesSync(e,n),this._writable.mkdirSync(e,i,n)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw f.With("ENOTDIR",e,"readdir");let r=[];try{r.push(...await this._writable.readdir(e,i))}catch{}try{r.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw f.With("ENOTDIR",e,"readdirSync");let r=[];try{r=r.concat(this._writable.readdirSync(e,i))}catch{}try{r=r.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
-
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(
|
|
4
|
-
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==Ar)throw f.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let n=x(e),r=[];for(;!this._writable.existsSync(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let n=x(e),r=[];for(;!await this._writable.exists(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw f.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw f.With("ENOENT",e,"operateOnWritableAsync");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let n=this.statSync(e,i);if(n.isDirectory()){this._writable.mkdirSync(e,n.mode,i);return}let r=new Uint8Array(n.size),o=this._readable.openFileSync(e,L("r"),i);o.readSync(r),o.closeSync();let a=this._writable.openFileSync(e,L("w"),i);a.writeSync(r),a.closeSync()}async copyToWritable(e,i){let n=await this.stat(e,i);if(n.isDirectory()){await this._writable.mkdir(e,n.mode,i);return}let r=new Uint8Array(n.size),o=await this._readable.openFile(e,L("r"),i);await o.read(r),await o.close();let a=await this._writable.openFile(e,L("w"),i);await a.write(r),await a.close()}};s(Ii,"UnlockedOverlayFS");var zt=class extends Vt{async ready(){return await super.ready(),this}constructor(e){super(new Ii(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(zt,"OverlayFS");var xd={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(){return!0},create(t){return new zt(t)}};var en={};nn(en,{BigIntStats:()=>G,Dir:()=>Li,Dirent:()=>Ge,ReadStream:()=>Qi,Stats:()=>B,StatsFs:()=>Ut,WriteStream:()=>Zi,_toUnixTimestamp:()=>Wr,access:()=>ul,accessSync:()=>_a,appendFile:()=>Wa,appendFileSync:()=>oa,chmod:()=>ol,chmodSync:()=>ba,chown:()=>nl,chownSync:()=>ya,close:()=>ja,closeSync:()=>Ke,constants:()=>Bt,copyFile:()=>gl,copyFileSync:()=>va,cp:()=>El,cpSync:()=>Fa,createReadStream:()=>pl,createWriteStream:()=>yl,exists:()=>La,existsSync:()=>Sn,fchmod:()=>Ya,fchmodSync:()=>vn,fchown:()=>Ga,fchownSync:()=>xn,fdatasync:()=>za,fdatasyncSync:()=>la,fstat:()=>qa,fstatSync:()=>sa,fsync:()=>Va,fsyncSync:()=>aa,ftruncate:()=>$a,ftruncateSync:()=>$r,futimes:()=>Xa,futimesSync:()=>kn,lchmod:()=>sl,lchmodSync:()=>ga,lchown:()=>rl,lchownSync:()=>ma,link:()=>el,linkSync:()=>ha,lopenSync:()=>Oi,lstat:()=>Ra,lstatSync:()=>ia,lutimes:()=>ll,lutimesSync:()=>Sa,mkdir:()=>Qa,mkdirSync:()=>da,mkdtemp:()=>bl,mkdtempSync:()=>xa,mount:()=>Ai,mountMapping:()=>Ti,mounts:()=>ye,open:()=>Ba,openAsBlob:()=>vl,openSync:()=>ei,opendir:()=>_l,opendirSync:()=>Ia,promises:()=>Mi,read:()=>Ka,readFile:()=>Ma,readFileSync:()=>jr,readSync:()=>ua,readdir:()=>Za,readdirSync:()=>Nn,readlink:()=>il,readlinkSync:()=>Vr,readv:()=>wl,readvSync:()=>ka,realpath:()=>cl,realpathSync:()=>Qt,rename:()=>Oa,renameSync:()=>ta,rm:()=>ml,rmSync:()=>Ea,rmdir:()=>Ja,rmdirSync:()=>fa,stat:()=>Pa,statSync:()=>_n,statfs:()=>xl,statfsSync:()=>Aa,symlink:()=>tl,symlinkSync:()=>pa,truncate:()=>Ca,truncateSync:()=>na,umount:()=>wn,unlink:()=>Da,unlinkSync:()=>qr,unwatchFile:()=>dl,utimes:()=>al,utimesSync:()=>wa,watch:()=>hl,watchFile:()=>fl,write:()=>Ha,writeFile:()=>Ua,writeFileSync:()=>En,writeSync:()=>ca,writev:()=>Sl,writevSync:()=>Na});var Mi={};nn(Mi,{FileHandle:()=>te,access:()=>oo,appendFile:()=>Gr,chmod:()=>to,chown:()=>Zr,constants:()=>Bt,copyFile:()=>lo,cp:()=>uo,exists:()=>Ri,lchmod:()=>io,lchown:()=>eo,link:()=>Jr,lopen:()=>Fn,lstat:()=>Hr,lutimes:()=>ro,mkdir:()=>Xr,mkdtemp:()=>ao,open:()=>ct,opendir:()=>co,readFile:()=>An,readdir:()=>Pi,readlink:()=>Tn,realpath:()=>St,rename:()=>zr,rm:()=>so,rmdir:()=>Yr,stat:()=>Ci,statfs:()=>fo,symlink:()=>Qr,truncate:()=>Kr,unlink:()=>In,utimes:()=>no,watch:()=>sh,writeFile:()=>Bi});var lt=gr(Ee(),1);var wt=gr(Ee(),1);function Wr(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Wr,"_toUnixTimestamp");function xe(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(xe,"normalizeMode");function Xt(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(Xt,"normalizeTime");function V(t){if(t.includes("\0"))throw new f(22,"Path must be a string without null bytes.");if(t.length==0)throw new f(22,"Path must not be empty.");return Fe(t.replaceAll(/[/\\]+/g,"/"))}s(V,"normalizePath");function ve(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:xe("mode"in t?t?.mode:null,n)}}s(ve,"normalizeOptions");function _(){}s(_,"nop");var v=_e;function ea(t){v=t}s(ea,"setCred");var gt=new Map,ih=100;function Jt(t){let e=ih++;return gt.set(e,t),e}s(Jt,"getFdForFile");function j(t){if(!gt.has(t))throw new f(9);return gt.get(t)}s(j,"fd2file");var ye=new Map;Ai("/",Ni.create({name:"root"}));function Ai(t,e){if(t[0]!=="/"&&(t="/"+t),t=Fe(t),ye.has(t))throw new f(22,"Mount point "+t+" is already in use.");ye.set(t,e)}s(Ai,"mount");function wn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Fe(t),!ye.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");ye.delete(t)}s(wn,"umount");function me(t){t=V(t);let e=[...ye].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(me,"resolveMount");function Zs(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(Zs,"fixPaths");function at(t,e){return typeof t.stack=="string"&&(t.stack=Zs(t.stack,e)),t.message=Zs(t.message,e),t}s(at,"fixError");function Ti(t){"/"in t&&wn("/");for(let[e,i]of Object.entries(t))Ai(e,i)}s(Ti,"mountMapping");function ce(...[t,e,i,...n]){i=V(i);let{fs:r,path:o}=me(e&&Sn(i)?Qt(i):i);try{return r[t](o,...n)}catch(a){throw at(a,{[o]:i})}}s(ce,"doOp");function ta(t,e){t=V(t),e=V(e);let i=me(t),n=me(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,v);En(e,jr(t)),qr(t)}catch(o){throw at(o,r)}}s(ta,"renameSync");function Sn(t){t=V(t);try{let{fs:e,path:i}=me(Qt(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Sn,"existsSync");function _n(t,e){let i=ce("statSync",!0,t,v);return e?.bigint?new G(i):i}s(_n,"statSync");function ia(t,e){let i=ce("statSync",!1,t,v);return e?.bigint?new G(i):i}s(ia,"lstatSync");function na(t,e=0){let i=ei(t,"r+");try{$r(i,e)}finally{Ke(i)}}s(na,"truncateSync");function qr(t){return ce("unlinkSync",!1,t,v)}s(qr,"unlinkSync");function Zt(t,e,i,n){let r=V(t),o=xe(i,420),a=L(e),l;try{l=ce("statSync",n,r,v)}catch{switch(vi(a)){case 3:if(!ce("statSync",n,x(r),v).isDirectory())throw f.With("ENOTDIR",x(r),"_openSync");return ce("createFileSync",n,r,a,o,v);case 1:throw f.With("ENOENT",r,"_openSync");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,v))throw f.With("EACCES",r,"_openSync");switch(xi(a)){case 1:throw f.With("EEXIST",r,"_openSync");case 2:return ce("unlinkSync",n,r,v),ce("createFileSync",n,r,a,l.mode,v);case 0:return ce("openFileSync",n,r,a,v);default:throw new f(22,"Invalid FileFlag object.")}}s(Zt,"_openSync");function ei(t,e,i){return Jt(Zt(t,e,i,!0))}s(ei,"openSync");function Oi(t,e,i){return Jt(Zt(t,e,i,!1))}s(Oi,"lopenSync");function ra(t,e,i){let n=Zt(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(ra,"_readFileSync");function jr(t,e={}){let i=ve(e,null,"r",420),n=L(i.flag);if(!ze(n))throw new f(22,"Flag passed to readFile must allow for reading.");let r=wt.Buffer.from(ra(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(jr,"readFileSync");function nh(t,e,i,n,r){let o=Zt(t,i,n,r);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(nh,"_writeFileSync");function En(t,e,i){let n=ve(i,"utf8","w+",420),r=L(n.flag);if(!he(r))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?wt.Buffer.from(e,n.encoding):e;if(o===void 0)throw new f(22,"Data not specified");nh(t,o,n.flag,n.mode,!0)}s(En,"writeFileSync");function rh(t,e,i,n,r){let o=Zt(t,i,n,r);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(rh,"_appendFileSync");function oa(t,e,i){let n=ve(i,"utf8","a",420),r=L(n.flag);if(!ot(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?wt.Buffer.from(e,n.encoding):e;rh(t,o,n.flag,n.mode,!0)}s(oa,"appendFileSync");function sa(t,e){let i=j(t).statSync();return e?.bigint?new G(i):i}s(sa,"fstatSync");function Ke(t){j(t).closeSync(),gt.delete(t)}s(Ke,"closeSync");function $r(t,e=0){if(e<0)throw new f(22);j(t).truncateSync(e)}s($r,"ftruncateSync");function aa(t){j(t).syncSync()}s(aa,"fsyncSync");function la(t){j(t).datasyncSync()}s(la,"fdatasyncSync");function ca(t,e,i,n,r){let o,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof n=="string"?n:"utf8";a=0,o=wt.Buffer.from(e,d),l=o.length}else o=e,a=i,l=n,c=typeof r=="number"?r:null;let u=j(t);return c==null&&(c=u.position),u.writeSync(o,a,l,c)}s(ca,"writeSync");function ua(t,e,i,n,r){let o=j(t),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(e,a,n,r)}s(ua,"readSync");function xn(t,e,i){j(t).chownSync(e,i)}s(xn,"fchownSync");function vn(t,e){let i=xe(e,-1);if(i<0)throw new f(22,"Invalid mode.");j(t).chmodSync(i)}s(vn,"fchmodSync");function kn(t,e,i){j(t).utimesSync(Xt(e),Xt(i))}s(kn,"futimesSync");function fa(t){return ce("rmdirSync",!0,t,v)}s(fa,"rmdirSync");function da(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;ce("mkdirSync",!0,t,xe(i,511),v)}s(da,"mkdirSync");function Nn(t,e){t=V(t);let i=ce("readdirSync",!0,t,v);for(let n of ye.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new Ge(n,_n(re(t,n))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?wt.Buffer.from(n):n)}s(Nn,"readdirSync");function ha(t,e){return e=V(e),ce("linkSync",!1,t,e,v)}s(ha,"linkSync");function pa(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(Sn(e))throw f.With("EEXIST",e,"symlinkSync");En(e,t),Zt(e,"r+",420,!1)._setTypeSync(M.SYMLINK)}s(pa,"symlinkSync");function Vr(t,e){let i=wt.Buffer.from(ra(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(Vr,"readlinkSync");function ya(t,e,i){let n=ei(t,"r+");xn(n,e,i),Ke(n)}s(ya,"chownSync");function ma(t,e,i){let n=Oi(t,"r+");xn(n,e,i),Ke(n)}s(ma,"lchownSync");function ba(t,e){let i=ei(t,"r+");vn(i,e),Ke(i)}s(ba,"chmodSync");function ga(t,e){let i=Oi(t,"r+");vn(i,e),Ke(i)}s(ga,"lchmodSync");function wa(t,e,i){let n=ei(t,"r+");kn(n,e,i),Ke(n)}s(wa,"utimesSync");function Sa(t,e,i){let n=Oi(t,"r+");kn(n,e,i),Ke(n)}s(Sa,"lutimesSync");function Qt(t,e){t=V(t);let{base:i,dir:n}=rn(t),r=re(n=="/"?"/":Qt(n),i),{fs:o,path:a,mountPoint:l}=me(r);try{return o.statSync(a,v).isSymbolicLink()?Qt(l+Vr(r)):r}catch(c){throw at(c,{[a]:r})}}s(Qt,"realpathSync");function _a(t,e=384){if(!_n(t).hasAccess(e,v))throw new f(13)}s(_a,"accessSync");function Ea(t){throw f.With("ENOTSUP",t,"rmSync")}s(Ea,"rmSync");function xa(t,e){throw f.With("ENOTSUP",t,"mkdtempSync")}s(xa,"mkdtempSync");function va(t,e,i){throw f.With("ENOTSUP",t,"copyFileSync")}s(va,"copyFileSync");function ka(t,e,i){throw f.With("ENOTSUP",j(t).path,"readvSync")}s(ka,"readvSync");function Na(t,e,i){throw f.With("ENOTSUP",j(t).path,"writevSync")}s(Na,"writevSync");function Ia(t,e){throw f.With("ENOTSUP",t,"opendirSync")}s(Ia,"opendirSync");function Fa(t,e,i){throw f.With("ENOTSUP",t,"cpSync")}s(Fa,"cpSync");function Aa(t,e){throw f.With("ENOTSUP",t,"statfsSync")}s(Aa,"statfsSync");var Ge=class{constructor(e,i){this.path=e;this.stats=i}get name(){return O(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(Ge,"Dirent");var Li=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Pi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=Nn(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(Li,"Dir");var te=class{constructor(e){this.fd=e}get file(){return j(this.fd)}get path(){return this.file.path}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=xe(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Xt(e),Xt(i))}async appendFile(e,i){let n=ve(i,"utf8","a",420),r=L(n.flag);if(!ot(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?lt.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=ve(e,null,"r",292),n=L(i.flag);if(!ze(n))throw new f(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),o=new Uint8Array(r);await this.file.read(o,0,r,0);let a=lt.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){throw f.With("ENOTSUP",this.path,"FileHandle.readableWebStream")}readLines(e){throw f.With("ENOTSUP",this.path,"FileHandle.readLines")}[Symbol.asyncDispose](){throw f.With("ENOTSUP",this.path,"FileHandle.@@asyncDispose")}async stat(e){let i=await this.file.stat();return e?.bigint?new G(i):i}async write(e,i,n,r){let o,a=0,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let u=typeof n=="string"?n:"utf8";a=0,o=lt.Buffer.from(e,u),l=o.length}else o=e,a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i){let n=ve(i,"utf8","w",420),r=L(n.flag);if(!he(r))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?lt.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),gt.delete(this.fd)}writev(e,i){throw f.With("ENOTSUP",this.path,"FileHandle.writev")}readv(e,i){throw f.With("ENOTSUP",this.path,"FileHandle.readv")}createReadStream(e){throw f.With("ENOTSUP",this.path,"createReadStream")}createWriteStream(e){throw f.With("ENOTSUP",this.path,"createWriteStream")}};s(te,"FileHandle");async function ke(...[t,e,i,...n]){i=V(i);let r=e&&await Ri(i)?await St(i):i,{fs:o,path:a}=me(r);try{return o[t](a,...n)}catch(l){throw at(l,{[a]:i})}}s(ke,"doOp");async function zr(t,e){t=V(t),e=V(e);let i=me(t),n=me(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,v);return}await Bi(e,await An(t)),await In(t)}catch(r){throw at(r,{[i.path]:t,[n.path]:e})}}s(zr,"rename");async function Ri(t){try{let{fs:e,path:i}=me(await St(t));return await e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Ri,"exists");async function Ci(t,e){let i=await ke("stat",!0,t,v);return e?.bigint?new G(i):i}s(Ci,"stat");async function Hr(t,e){let i=await ke("stat",!1,t,v);return e?.bigint?new G(i):i}s(Hr,"lstat");async function Kr(t,e=0){let i=await ct(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(Kr,"truncate");async function In(t){return ke("unlink",!1,t,v)}s(In,"unlink");async function Di(t,e,i=420,n){let r=V(t),o=xe(i,420),a=L(e);try{switch(xi(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:let l=await ke("openFile",n,r,a,v);if(!l)throw new f(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await ke("openFile",n,r,a,v);default:throw new f(22,"Invalid file flag")}}catch{switch(vi(a)){case 3:let c=await ke("stat",n,x(r),v);if(c&&!c.isDirectory())throw f.With("ENOTDIR",x(r),"_open");return await ke("createFile",n,r,a,o,v);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid file flag")}}}s(Di,"_open");async function ct(t,e,i=420){let n=await Di(t,e,i,!0);return new te(Jt(n))}s(ct,"open");async function Fn(t,e,i=420){let n=await Di(t,e,i,!1);return new te(Jt(n))}s(Fn,"lopen");async function Ta(t,e,i){let n=await Di(V(t),e,420,i);try{let r=await n.stat(),o=new Uint8Array(r.size);return await n.read(o,0,r.size,0),await n.close(),o}catch(r){throw await n.close(),r}}s(Ta,"_readFile");async function An(t,e){let i=ve(e,null,"r",0),n=L(i.flag);if(!ze(n))throw new f(22,"Flag passed must allow for reading.");let r=lt.Buffer.from(await Ta(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(An,"readFile");async function Bi(t,e,i){let n=ve(i,"utf8","w+",420),r=await ct(t,n.flag,n.mode);try{await r.writeFile(e,n)}finally{await r.close()}}s(Bi,"writeFile");async function oh(t,e,i,n,r){let o=await Di(t,i,n,r);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(oh,"_appendFile");async function Gr(t,e,i){let n=ve(i,"utf8","a",420),r=L(n.flag);if(!ot(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?lt.Buffer.from(e,n.encoding):e;await oh(t,o,n.flag,n.mode,!0)}s(Gr,"appendFile");async function Yr(t){return ke("rmdir",!0,t,v)}s(Yr,"rmdir");async function Xr(t,e){await ke("mkdir",!0,t,xe(typeof e=="object"?e?.mode:e,511),v)}s(Xr,"mkdir");async function Pi(t,e){t=V(t);let i=await ke("readdir",!0,t,v),n=[...ye.keys()];for(let o of n)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let r=[];for(let o of i)r.push(typeof e=="object"&&e?.withFileTypes?new Ge(o,await Ci(re(t,o))):o);return r}s(Pi,"readdir");async function Jr(t,e){return e=V(e),ke("link",!1,t,e,v)}s(Jr,"link");async function Qr(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Ri(e))throw f.With("EEXIST",e,"symlink");await Bi(e,t),await(await Di(e,"r+",420,!1))._setType(M.SYMLINK)}s(Qr,"symlink");async function Tn(t,e){let i=lt.Buffer.from(await Ta(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(Tn,"readlink");async function Zr(t,e,i){let n=await ct(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Zr,"chown");async function eo(t,e,i){let n=await Fn(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(eo,"lchown");async function to(t,e){let i=await ct(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(to,"chmod");async function io(t,e){let i=await Fn(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(io,"lchmod");async function no(t,e,i){let n=await ct(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(no,"utimes");async function ro(t,e,i){let n=await Fn(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(ro,"lutimes");async function St(t,e){t=V(t);let{base:i,dir:n}=rn(t),r=re(n=="/"?"/":await St(n),i),{fs:o,path:a,mountPoint:l}=me(r);try{return(await o.stat(a,v)).isSymbolicLink()?St(l+await Tn(r)):r}catch(c){throw at(c,{[a]:r})}}s(St,"realpath");function sh(t,e){throw f.With("ENOTSUP",t,"watch")}s(sh,"watch");async function oo(t,e=0){if(!(await Ci(t)).hasAccess(e,v))throw new f(13)}s(oo,"access");async function so(t,e){throw f.With("ENOTSUP",t,"rm")}s(so,"rm");async function ao(t,e){throw f.With("ENOTSUP",t,"mkdtemp")}s(ao,"mkdtemp");async function lo(t,e,i){throw f.With("ENOTSUP",t,"copyFile")}s(lo,"copyFile");async function co(t,e){throw f.With("ENOTSUP",t,"opendir")}s(co,"opendir");async function uo(t,e,i){throw f.With("ENOTSUP",t,"cp")}s(uo,"cp");async function fo(t,e){throw f.With("ENOTSUP",t,"statfs")}s(fo,"statfs");function Oa(t,e,i=_){zr(t,e).then(()=>i()).catch(i)}s(Oa,"rename");function La(t,e=_){Ri(t).then(e).catch(()=>e(!1))}s(La,"exists");function Pa(t,e,i=_){i=typeof e=="function"?e:i,Ci(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Pa,"stat");function Ra(t,e,i=_){i=typeof e=="function"?e:i,Hr(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Ra,"lstat");function Ca(t,e=0,i=_){i=typeof e=="function"?e:i,Kr(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Ca,"truncate");function Da(t,e=_){In(t).then(()=>e()).catch(e)}s(Da,"unlink");function Ba(t,e,i,n=_){let r=xe(i,420);n=typeof i=="function"?i:n,ct(t,e,r).then(o=>n(null,o.fd)).catch(n)}s(Ba,"open");function Ma(t,e,i=_){i=typeof e=="function"?e:i,An(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Ma,"readFile");function Ua(t,e,i,n=_){n=typeof i=="function"?i:n,Bi(t,e,typeof i!="function"?i:null).then(()=>n(null)).catch(n)}s(Ua,"writeFile");function Wa(t,e,i,n=_){n=typeof i=="function"?i:n,Gr(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(Wa,"appendFile");function qa(t,e,i=_){i=typeof e=="function"?e:i,j(t).stat().then(n=>i(null,typeof e=="object"&&e?.bigint?new G(n):n)).catch(i)}s(qa,"fstat");function ja(t,e=_){new te(t).close().then(()=>e()).catch(e)}s(ja,"close");function $a(t,e,i=_){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=j(t);if(n<0)throw new f(22);r.truncate(n).then(()=>i()).catch(i)}s($a,"ftruncate");function Va(t,e=_){j(t).sync().then(()=>e()).catch(e)}s(Va,"fsync");function za(t,e=_){j(t).datasync().then(()=>e()).catch(e)}s(za,"fdatasync");function Ha(t,e,i,n,r,o=_){let a,l,c,u=null,d,h=new te(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":u=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 f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let m=o;h.write(a,l,c,u).then(({bytesWritten:b})=>m(null,b,a.toString(d))).catch(m)}else{a=Buffer.from(e),l=i,c=n,u=typeof r=="number"?r:null;let m=typeof r=="function"?r:o;h.write(a,l,c,u).then(({bytesWritten:b})=>m(null,b,a)).catch(m)}}s(Ha,"write");function Ka(t,e,i,n,r,o=_){new te(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(Ka,"read");function Ga(t,e,i,n=_){new te(t).chown(e,i).then(()=>n()).catch(n)}s(Ga,"fchown");function Ya(t,e,i){new te(t).chmod(e).then(()=>i()).catch(i)}s(Ya,"fchmod");function Xa(t,e,i,n=_){new te(t).utimes(e,i).then(()=>n()).catch(n)}s(Xa,"futimes");function Ja(t,e=_){Yr(t).then(()=>e()).catch(e)}s(Ja,"rmdir");function Qa(t,e,i=_){Xr(t,e).then(()=>i()).catch(i)}s(Qa,"mkdir");function Za(t,e,i=_){i=typeof e=="function"?e:i,Pi(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(Za,"readdir");function el(t,e,i=_){Jr(t,e).then(()=>i()).catch(i)}s(el,"link");function tl(t,e,i,n=_){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,Qr(t,e,r).then(()=>n()).catch(n)}s(tl,"symlink");function il(t,e,i=_){i=typeof e=="function"?e:i,Tn(t).then(n=>i(null,n)).catch(i)}s(il,"readlink");function nl(t,e,i,n=_){Zr(t,e,i).then(()=>n()).catch(n)}s(nl,"chown");function rl(t,e,i,n=_){eo(t,e,i).then(()=>n()).catch(n)}s(rl,"lchown");function ol(t,e,i=_){to(t,e).then(()=>i()).catch(i)}s(ol,"chmod");function sl(t,e,i=_){io(t,e).then(()=>i()).catch(i)}s(sl,"lchmod");function al(t,e,i,n=_){no(t,e,i).then(()=>n()).catch(n)}s(al,"utimes");function ll(t,e,i,n=_){ro(t,e,i).then(()=>n()).catch(n)}s(ll,"lutimes");function cl(t,e,i=_){i=typeof e=="function"?e:i,St(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(cl,"realpath");function ul(t,e,i=_){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,oo(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(ul,"access");function fl(t,e,i=_){throw f.With("ENOTSUP",t,"watchFile")}s(fl,"watchFile");function dl(t,e=_){throw f.With("ENOTSUP",t,"unwatchFile")}s(dl,"unwatchFile");function hl(t,e,i=_){throw f.With("ENOTSUP",t,"watch")}s(hl,"watch");function pl(t,e){throw f.With("ENOTSUP",t,"createReadStream")}s(pl,"createReadStream");function yl(t,e){throw f.With("ENOTSUP",t,"createWriteStream")}s(yl,"createWriteStream");function ml(t,e,i=_){i=typeof e=="function"?e:i,so(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}s(ml,"rm");function bl(t,e,i=_){i=typeof e=="function"?e:i,ao(t,typeof e!="function"?e:null).then(n=>i(null,n)).catch(i)}s(bl,"mkdtemp");function gl(t,e,i,n){n=typeof i=="function"?i:n,lo(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(gl,"copyFile");function wl(t,e,i,n=_){n=typeof i=="function"?i:n,new te(t).readv(e,typeof i=="function"?null:i).then(({buffers:r,bytesRead:o})=>n(null,o,r)).catch(n)}s(wl,"readv");function Sl(t,e,i,n=_){n=typeof i=="function"?i:n,new te(t).writev(e,typeof i=="function"?null:i).then(({buffers:r,bytesWritten:o})=>n(null,o,r)).catch(n)}s(Sl,"writev");function _l(t,e,i=_){i=typeof e=="function"?e:i,co(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(_l,"opendir");function El(t,e,i,n){n=typeof i=="function"?i:n,uo(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(El,"cp");function xl(t,e,i=_){i=typeof e=="function"?e:i,fo(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(xl,"statfs");function vl(t,e){throw f.With("ENOTSUP",t,"openAsBlob")}s(vl,"openAsBlob");var pr=gr(Rf(),1);var Qi=class extends pr.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(Qi,"ReadStream");var Zi=class extends pr.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(Zi,"WriteStream");function xs(t){return _r(t)||Si(t)||t instanceof ee}s(xs,"isMountConfig");async function vs(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!xs(t))throw new f(22,"Invalid mount configuration");if(t instanceof ee)return t;Si(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&xs(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[r]=await vs(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);an(i,t);let n=i.create(t);return await n.ready(),n}s(vs,"resolveMountConfig");async function Lg(t){let e="uid"in t&&+t.uid||0,i="gid"in t&&+t.gid||0;xs(t)&&(t={"/":t});for(let[n,r]of Object.entries(t))n=="uid"||n=="gid"||typeof r=="number"||(t[n]=await vs(r));Ti(t),ea({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Lg,"configure");var Pt=class{static FromListing(e){let i=new Pt,n=new it;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let d=a[u];if(d){let h=l+"/"+u;o=new it,i._index.set(h,o),r.push({pwd:h,tree:d,parent:o})}else o=new tn(new B({mode:M.FILE|365}));c&&c._listing.set(u,o)}}return i}_index=new Map;constructor(){this.add("/",new it)}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r?.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let n=x(e),r=this._index.get(n);return!r&&e!="/"&&(r=new it,!this.add(n,r))||e!="/"&&!r.add(O(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=x(e),r=O(e),o=this._index.get(n);return o||(o=new it,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),n=this._index.get(i);if(!n)return;let r=n.remove(O(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(re(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),n=this._index.get(i);return i==e?n:n?.get(O(e))}};s(Pt,"FileIndex");var mi=class{constructor(e){this.data=e}};s(mi,"IndexInode");var tn=class extends mi{isFile(){return!0}isDirectory(){return!1}toStats(){return new B({mode:M.FILE|438,size:4096})}};s(tn,"IndexFileInode");var it=class extends mi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new B({mode:M.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(it,"IndexDirInode");var bi=class extends Fr(ee){_index;constructor(e){super(),this._index=Pt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"statSync");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,n){if(he(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(rt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new yt(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(he(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFileSync");if(!r.toStats().hasAccess(rt(i),n))throw f.With("EACCES",e,"openFileSync");if(r.isDirectory()){let o=r.stats;return new yt(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdirSync");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdirSync")}};s(bi,"IndexFS");var yr=class extends bi{async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}};s(yr,"SyncIndexFS");var mr=class extends bi{statFileInodeSync(){throw new f(95)}openFileInodeSync(){throw new f(95)}};s(mr,"AsyncIndexFS");var Pg=en;return qf(Rg);})();
|
|
1
|
+
var ZenFS=(()=>{var Wf=Object.create;var Pi=Object.defineProperty;var Uf=Object.getOwnPropertyDescriptor;var qf=Object.getOwnPropertyNames;var jf=Object.getPrototypeOf,$f=Object.prototype.hasOwnProperty;var s=(t,e)=>Pi(t,"name",{value:e,configurable:!0});var A=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),gn=(t,e)=>{for(var i in e)Pi(t,i,{get:e[i],enumerable:!0})},Ds=(t,e,i,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of qf(e))!$f.call(t,r)&&r!==i&&Pi(t,r,{get:()=>e[r],enumerable:!(n=Uf(e,r))||n.enumerable});return t};var Rr=(t,e,i)=>(i=t!=null?Wf(jf(t)):{},Ds(e||!t||!t.__esModule?Pi(i,"default",{value:t,enumerable:!0}):i,t)),Vf=t=>Ds(Pi({},"__esModule",{value:!0}),t);var Hs=A(Fn=>{"use strict";Fn.byteLength=vd;Fn.toByteArray=Nd;Fn.fromByteArray=Ad;var Me=[],be=[],xd=typeof Uint8Array<"u"?Uint8Array:Array,zr="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(At=0,Vs=zr.length;At<Vs;++At)Me[At]=zr[At],be[zr.charCodeAt(At)]=At;var At,Vs;be["-".charCodeAt(0)]=62;be["_".charCodeAt(0)]=63;function zs(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");i===-1&&(i=e);var n=i===e?0:4-i%4;return[i,n]}s(zs,"getLens");function vd(t){var e=zs(t),i=e[0],n=e[1];return(i+n)*3/4-n}s(vd,"byteLength");function kd(t,e,i){return(e+i)*3/4-i}s(kd,"_byteLength");function Nd(t){var e,i=zs(t),n=i[0],r=i[1],o=new xd(kd(t,n,r)),a=0,l=r>0?n-4:n,c;for(c=0;c<l;c+=4)e=be[t.charCodeAt(c)]<<18|be[t.charCodeAt(c+1)]<<12|be[t.charCodeAt(c+2)]<<6|be[t.charCodeAt(c+3)],o[a++]=e>>16&255,o[a++]=e>>8&255,o[a++]=e&255;return r===2&&(e=be[t.charCodeAt(c)]<<2|be[t.charCodeAt(c+1)]>>4,o[a++]=e&255),r===1&&(e=be[t.charCodeAt(c)]<<10|be[t.charCodeAt(c+1)]<<4|be[t.charCodeAt(c+2)]>>2,o[a++]=e>>8&255,o[a++]=e&255),o}s(Nd,"toByteArray");function Id(t){return Me[t>>18&63]+Me[t>>12&63]+Me[t>>6&63]+Me[t&63]}s(Id,"tripletToBase64");function Fd(t,e,i){for(var n,r=[],o=e;o<i;o+=3)n=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),r.push(Id(n));return r.join("")}s(Fd,"encodeChunk");function Ad(t){for(var e,i=t.length,n=i%3,r=[],o=16383,a=0,l=i-n;a<l;a+=o)r.push(Fd(t,a,a+o>l?l:a+o));return n===1?(e=t[i-1],r.push(Me[e>>2]+Me[e<<4&63]+"==")):n===2&&(e=(t[i-2]<<8)+t[i-1],r.push(Me[e>>10]+Me[e>>4&63]+Me[e<<2&63]+"=")),r.join("")}s(Ad,"fromByteArray")});var Ks=A(Hr=>{Hr.read=function(t,e,i,n,r){var o,a,l=r*8-n-1,c=(1<<l)-1,u=c>>1,d=-7,h=i?r-1:0,m=i?-1:1,b=t[e+h];for(h+=m,o=b&(1<<-d)-1,b>>=-d,d+=l;d>0;o=o*256+t[e+h],h+=m,d-=8);for(a=o&(1<<-d)-1,o>>=-d,d+=n;d>0;a=a*256+t[e+h],h+=m,d-=8);if(o===0)o=1-u;else{if(o===c)return a?NaN:(b?-1:1)*(1/0);a=a+Math.pow(2,n),o=o-u}return(b?-1:1)*a*Math.pow(2,o-n)};Hr.write=function(t,e,i,n,r,o){var a,l,c,u=o*8-r-1,d=(1<<u)-1,h=d>>1,m=r===23?Math.pow(2,-24)-Math.pow(2,-77):0,b=n?0:o-1,w=n?1:-1,g=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,a=d):(a=Math.floor(Math.log(e)/Math.LN2),e*(c=Math.pow(2,-a))<1&&(a--,c*=2),a+h>=1?e+=m/c:e+=m*Math.pow(2,1-h),e*c>=2&&(a++,c/=2),a+h>=d?(l=0,a=d):a+h>=1?(l=(e*c-1)*Math.pow(2,r),a=a+h):(l=e*Math.pow(2,h-1)*Math.pow(2,r),a=0));r>=8;t[i+b]=l&255,b+=w,l/=256,r-=8);for(a=a<<r|l,u+=r;u>0;t[i+b]=a&255,b+=w,a/=256,u-=8);t[i+b-w]|=g*128}});var ke=A(li=>{"use strict";var Kr=Hs(),si=Ks(),Gs=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;li.Buffer=y;li.SlowBuffer=Cd;li.INSPECT_MAX_BYTES=50;var An=2147483647;li.kMaxLength=An;y.TYPED_ARRAY_SUPPORT=Ld();!y.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 Ld(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}s(Ld,"typedArraySupport");Object.defineProperty(y.prototype,"parent",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.buffer}});Object.defineProperty(y.prototype,"offset",{enumerable:!0,get:function(){if(y.isBuffer(this))return this.byteOffset}});function Xe(t){if(t>An)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,y.prototype),e}s(Xe,"createBuffer");function y(t,e,i){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Jr(t)}return Qs(t,e,i)}s(y,"Buffer");y.poolSize=8192;function Qs(t,e,i){if(typeof t=="string")return Od(t,e);if(ArrayBuffer.isView(t))return Rd(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(We(t,ArrayBuffer)||t&&We(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(We(t,SharedArrayBuffer)||t&&We(t.buffer,SharedArrayBuffer)))return Yr(t,e,i);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return y.from(n,e,i);let r=Pd(t);if(r)return r;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return y.from(t[Symbol.toPrimitive]("string"),e,i);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}s(Qs,"from");y.from=function(t,e,i){return Qs(t,e,i)};Object.setPrototypeOf(y.prototype,Uint8Array.prototype);Object.setPrototypeOf(y,Uint8Array);function Zs(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}s(Zs,"assertSize");function Td(t,e,i){return Zs(t),t<=0?Xe(t):e!==void 0?typeof i=="string"?Xe(t).fill(e,i):Xe(t).fill(e):Xe(t)}s(Td,"alloc");y.alloc=function(t,e,i){return Td(t,e,i)};function Jr(t){return Zs(t),Xe(t<0?0:Qr(t)|0)}s(Jr,"allocUnsafe");y.allocUnsafe=function(t){return Jr(t)};y.allocUnsafeSlow=function(t){return Jr(t)};function Od(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!y.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let i=ea(t,e)|0,n=Xe(i),r=n.write(t,e);return r!==i&&(n=n.slice(0,r)),n}s(Od,"fromString");function Gr(t){let e=t.length<0?0:Qr(t.length)|0,i=Xe(e);for(let n=0;n<e;n+=1)i[n]=t[n]&255;return i}s(Gr,"fromArrayLike");function Rd(t){if(We(t,Uint8Array)){let e=new Uint8Array(t);return Yr(e.buffer,e.byteOffset,e.byteLength)}return Gr(t)}s(Rd,"fromArrayView");function Yr(t,e,i){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(i||0))throw new RangeError('"length" is outside of buffer bounds');let n;return e===void 0&&i===void 0?n=new Uint8Array(t):i===void 0?n=new Uint8Array(t,e):n=new Uint8Array(t,e,i),Object.setPrototypeOf(n,y.prototype),n}s(Yr,"fromArrayBuffer");function Pd(t){if(y.isBuffer(t)){let e=Qr(t.length)|0,i=Xe(e);return i.length===0||t.copy(i,0,0,e),i}if(t.length!==void 0)return typeof t.length!="number"||eo(t.length)?Xe(0):Gr(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Gr(t.data)}s(Pd,"fromObject");function Qr(t){if(t>=An)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+An.toString(16)+" bytes");return t|0}s(Qr,"checked");function Cd(t){return+t!=t&&(t=0),y.alloc(+t)}s(Cd,"SlowBuffer");y.isBuffer=s(function(e){return e!=null&&e._isBuffer===!0&&e!==y.prototype},"isBuffer");y.compare=s(function(e,i){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),We(i,Uint8Array)&&(i=y.from(i,i.offset,i.byteLength)),!y.isBuffer(e)||!y.isBuffer(i))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===i)return 0;let n=e.length,r=i.length;for(let o=0,a=Math.min(n,r);o<a;++o)if(e[o]!==i[o]){n=e[o],r=i[o];break}return n<r?-1:r<n?1:0},"compare");y.isEncoding=s(function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},"isEncoding");y.concat=s(function(e,i){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return y.alloc(0);let n;if(i===void 0)for(i=0,n=0;n<e.length;++n)i+=e[n].length;let r=y.allocUnsafe(i),o=0;for(n=0;n<e.length;++n){let a=e[n];if(We(a,Uint8Array))o+a.length>r.length?(y.isBuffer(a)||(a=y.from(a)),a.copy(r,o)):Uint8Array.prototype.set.call(r,a,o);else if(y.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 ea(t,e){if(y.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||We(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let i=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&i===0)return 0;let r=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":return Xr(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return i*2;case"hex":return i>>>1;case"base64":return ca(t).length;default:if(r)return n?-1:Xr(t).length;e=(""+e).toLowerCase(),r=!0}}s(ea,"byteLength");y.byteLength=ea;function Dd(t,e,i){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((i===void 0||i>this.length)&&(i=this.length),i<=0)||(i>>>=0,e>>>=0,i<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Hd(this,e,i);case"utf8":case"utf-8":return ia(this,e,i);case"ascii":return Vd(this,e,i);case"latin1":case"binary":return zd(this,e,i);case"base64":return jd(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Kd(this,e,i);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}s(Dd,"slowToString");y.prototype._isBuffer=!0;function Lt(t,e,i){let n=t[e];t[e]=t[i],t[i]=n}s(Lt,"swap");y.prototype.swap16=s(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let i=0;i<e;i+=2)Lt(this,i,i+1);return this},"swap16");y.prototype.swap32=s(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let i=0;i<e;i+=4)Lt(this,i,i+3),Lt(this,i+1,i+2);return this},"swap32");y.prototype.swap64=s(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let i=0;i<e;i+=8)Lt(this,i,i+7),Lt(this,i+1,i+6),Lt(this,i+2,i+5),Lt(this,i+3,i+4);return this},"swap64");y.prototype.toString=s(function(){let e=this.length;return e===0?"":arguments.length===0?ia(this,0,e):Dd.apply(this,arguments)},"toString");y.prototype.toLocaleString=y.prototype.toString;y.prototype.equals=s(function(e){if(!y.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:y.compare(this,e)===0},"equals");y.prototype.inspect=s(function(){let e="",i=li.INSPECT_MAX_BYTES;return e=this.toString("hex",0,i).replace(/(.{2})/g,"$1 ").trim(),this.length>i&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Gs&&(y.prototype[Gs]=y.prototype.inspect);y.prototype.compare=s(function(e,i,n,r,o){if(We(e,Uint8Array)&&(e=y.from(e,e.offset,e.byteLength)),!y.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(i===void 0&&(i=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),i<0||n>e.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===e)return 0;let a=o-r,l=n-i,c=Math.min(a,l),u=this.slice(r,o),d=e.slice(i,n);for(let h=0;h<c;++h)if(u[h]!==d[h]){a=u[h],l=d[h];break}return a<l?-1:l<a?1:0},"compare");function ta(t,e,i,n,r){if(t.length===0)return-1;if(typeof i=="string"?(n=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,eo(i)&&(i=r?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(r)return-1;i=t.length-1}else if(i<0)if(r)i=0;else return-1;if(typeof e=="string"&&(e=y.from(e,n)),y.isBuffer(e))return e.length===0?-1:Ys(t,e,i,n,r);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?r?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):Ys(t,[e],i,n,r);throw new TypeError("val must be string, number or Buffer")}s(ta,"bidirectionalIndexOf");function Ys(t,e,i,n,r){let o=1,a=t.length,l=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,a/=2,l/=2,i/=2}function c(d,h){return o===1?d[h]:d.readUInt16BE(h*o)}s(c,"read");let u;if(r){let d=-1;for(u=i;u<a;u++)if(c(t,u)===c(e,d===-1?0:u-d)){if(d===-1&&(d=u),u-d+1===l)return d*o}else d!==-1&&(u-=u-d),d=-1}else for(i+l>a&&(i=a-l),u=i;u>=0;u--){let d=!0;for(let h=0;h<l;h++)if(c(t,u+h)!==c(e,h)){d=!1;break}if(d)return u}return-1}s(Ys,"arrayIndexOf");y.prototype.includes=s(function(e,i,n){return this.indexOf(e,i,n)!==-1},"includes");y.prototype.indexOf=s(function(e,i,n){return ta(this,e,i,n,!0)},"indexOf");y.prototype.lastIndexOf=s(function(e,i,n){return ta(this,e,i,n,!1)},"lastIndexOf");function Bd(t,e,i,n){i=Number(i)||0;let r=t.length-i;n?(n=Number(n),n>r&&(n=r)):n=r;let o=e.length;n>o/2&&(n=o/2);let a;for(a=0;a<n;++a){let l=parseInt(e.substr(a*2,2),16);if(eo(l))return a;t[i+a]=l}return a}s(Bd,"hexWrite");function Md(t,e,i,n){return Ln(Xr(e,t.length-i),t,i,n)}s(Md,"utf8Write");function Wd(t,e,i,n){return Ln(Jd(e),t,i,n)}s(Wd,"asciiWrite");function Ud(t,e,i,n){return Ln(ca(e),t,i,n)}s(Ud,"base64Write");function qd(t,e,i,n){return Ln(Qd(e,t.length-i),t,i,n)}s(qd,"ucs2Write");y.prototype.write=s(function(e,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),e.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 Bd(this,e,i,n);case"utf8":case"utf-8":return Md(this,e,i,n);case"ascii":case"latin1":case"binary":return Wd(this,e,i,n);case"base64":return Ud(this,e,i,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return qd(this,e,i,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},"write");y.prototype.toJSON=s(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function jd(t,e,i){return e===0&&i===t.length?Kr.fromByteArray(t):Kr.fromByteArray(t.slice(e,i))}s(jd,"base64Slice");function ia(t,e,i){i=Math.min(t.length,i);let n=[],r=e;for(;r<i;){let o=t[r],a=null,l=o>239?4:o>223?3:o>191?2:1;if(r+l<=i){let c,u,d,h;switch(l){case 1:o<128&&(a=o);break;case 2:c=t[r+1],(c&192)===128&&(h=(o&31)<<6|c&63,h>127&&(a=h));break;case 3:c=t[r+1],u=t[r+2],(c&192)===128&&(u&192)===128&&(h=(o&15)<<12|(c&63)<<6|u&63,h>2047&&(h<55296||h>57343)&&(a=h));break;case 4:c=t[r+1],u=t[r+2],d=t[r+3],(c&192)===128&&(u&192)===128&&(d&192)===128&&(h=(o&15)<<18|(c&63)<<12|(u&63)<<6|d&63,h>65535&&h<1114112&&(a=h))}}a===null?(a=65533,l=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),r+=l}return $d(n)}s(ia,"utf8Slice");var Xs=4096;function $d(t){let e=t.length;if(e<=Xs)return String.fromCharCode.apply(String,t);let i="",n=0;for(;n<e;)i+=String.fromCharCode.apply(String,t.slice(n,n+=Xs));return i}s($d,"decodeCodePointsArray");function Vd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]&127);return n}s(Vd,"asciiSlice");function zd(t,e,i){let n="";i=Math.min(t.length,i);for(let r=e;r<i;++r)n+=String.fromCharCode(t[r]);return n}s(zd,"latin1Slice");function Hd(t,e,i){let n=t.length;(!e||e<0)&&(e=0),(!i||i<0||i>n)&&(i=n);let r="";for(let o=e;o<i;++o)r+=Zd[t[o]];return r}s(Hd,"hexSlice");function Kd(t,e,i){let n=t.slice(e,i),r="";for(let o=0;o<n.length-1;o+=2)r+=String.fromCharCode(n[o]+n[o+1]*256);return r}s(Kd,"utf16leSlice");y.prototype.slice=s(function(e,i){let n=this.length;e=~~e,i=i===void 0?n:~~i,e<0?(e+=n,e<0&&(e=0)):e>n&&(e=n),i<0?(i+=n,i<0&&(i=0)):i>n&&(i=n),i<e&&(i=e);let r=this.subarray(e,i);return Object.setPrototypeOf(r,y.prototype),r},"slice");function X(t,e,i){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>i)throw new RangeError("Trying to access beyond buffer length")}s(X,"checkOffset");y.prototype.readUintLE=y.prototype.readUIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return r},"readUIntLE");y.prototype.readUintBE=y.prototype.readUIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e+--i],o=1;for(;i>0&&(o*=256);)r+=this[e+--i]*o;return r},"readUIntBE");y.prototype.readUint8=y.prototype.readUInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]},"readUInt8");y.prototype.readUint16LE=y.prototype.readUInt16LE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");y.prototype.readUint16BE=y.prototype.readUInt16BE=s(function(e,i){return e=e>>>0,i||X(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");y.prototype.readUint32LE=y.prototype.readUInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");y.prototype.readUint32BE=y.prototype.readUInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");y.prototype.readBigUInt64LE=pt(s(function(e){e=e>>>0,ai(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&zi(e,this.length-8);let r=i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(r)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));y.prototype.readBigUInt64BE=pt(s(function(e){e=e>>>0,ai(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&zi(e,this.length-8);let r=i*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(r)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));y.prototype.readIntLE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=this[e],o=1,a=0;for(;++a<i&&(o*=256);)r+=this[e+a]*o;return o*=128,r>=o&&(r-=Math.pow(2,8*i)),r},"readIntLE");y.prototype.readIntBE=s(function(e,i,n){e=e>>>0,i=i>>>0,n||X(e,i,this.length);let r=i,o=1,a=this[e+--r];for(;r>0&&(o*=256);)a+=this[e+--r]*o;return o*=128,a>=o&&(a-=Math.pow(2,8*i)),a},"readIntBE");y.prototype.readInt8=s(function(e,i){return e=e>>>0,i||X(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");y.prototype.readInt16LE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n},"readInt16LE");y.prototype.readInt16BE=s(function(e,i){e=e>>>0,i||X(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n},"readInt16BE");y.prototype.readInt32LE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");y.prototype.readInt32BE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");y.prototype.readBigInt64LE=pt(s(function(e){e=e>>>0,ai(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&zi(e,this.length-8);let r=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(r)<<BigInt(32))+BigInt(i+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));y.prototype.readBigInt64BE=pt(s(function(e){e=e>>>0,ai(e,"offset");let i=this[e],n=this[e+7];(i===void 0||n===void 0)&&zi(e,this.length-8);let r=(i<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(r)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n)},"readBigInt64BE"));y.prototype.readFloatLE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),si.read(this,e,!0,23,4)},"readFloatLE");y.prototype.readFloatBE=s(function(e,i){return e=e>>>0,i||X(e,4,this.length),si.read(this,e,!1,23,4)},"readFloatBE");y.prototype.readDoubleLE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),si.read(this,e,!0,52,8)},"readDoubleLE");y.prototype.readDoubleBE=s(function(e,i){return e=e>>>0,i||X(e,8,this.length),si.read(this,e,!1,52,8)},"readDoubleBE");function ae(t,e,i,n,r,o){if(!y.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>r||e<o)throw new RangeError('"value" argument is out of bounds');if(i+n>t.length)throw new RangeError("Index out of range")}s(ae,"checkInt");y.prototype.writeUintLE=y.prototype.writeUIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=1,a=0;for(this[i]=e&255;++a<n&&(o*=256);)this[i+a]=e/o&255;return i+n},"writeUIntLE");y.prototype.writeUintBE=y.prototype.writeUIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,n=n>>>0,!r){let l=Math.pow(2,8*n)-1;ae(this,e,i,n,l,0)}let o=n-1,a=1;for(this[i+o]=e&255;--o>=0&&(a*=256);)this[i+o]=e/a&255;return i+n},"writeUIntBE");y.prototype.writeUint8=y.prototype.writeUInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,255,0),this[i]=e&255,i+1},"writeUInt8");y.prototype.writeUint16LE=y.prototype.writeUInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeUInt16LE");y.prototype.writeUint16BE=y.prototype.writeUInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,65535,0),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeUInt16BE");y.prototype.writeUint32LE=y.prototype.writeUInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i+3]=e>>>24,this[i+2]=e>>>16,this[i+1]=e>>>8,this[i]=e&255,i+4},"writeUInt32LE");y.prototype.writeUint32BE=y.prototype.writeUInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,4294967295,0),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeUInt32BE");function na(t,e,i,n,r){la(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o,o=o>>8,t[i++]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,a=a>>8,t[i++]=a,i}s(na,"wrtBigUInt64LE");function ra(t,e,i,n,r){la(e,n,r,t,i,7);let o=Number(e&BigInt(4294967295));t[i+7]=o,o=o>>8,t[i+6]=o,o=o>>8,t[i+5]=o,o=o>>8,t[i+4]=o;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[i+3]=a,a=a>>8,t[i+2]=a,a=a>>8,t[i+1]=a,a=a>>8,t[i]=a,i+8}s(ra,"wrtBigUInt64BE");y.prototype.writeBigUInt64LE=pt(s(function(e,i=0){return na(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));y.prototype.writeBigUInt64BE=pt(s(function(e,i=0){return ra(this,e,i,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));y.prototype.writeIntLE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=0,a=1,l=0;for(this[i]=e&255;++o<n&&(a*=256);)e<0&&l===0&&this[i+o-1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntLE");y.prototype.writeIntBE=s(function(e,i,n,r){if(e=+e,i=i>>>0,!r){let c=Math.pow(2,8*n-1);ae(this,e,i,n,c-1,-c)}let o=n-1,a=1,l=0;for(this[i+o]=e&255;--o>=0&&(a*=256);)e<0&&l===0&&this[i+o+1]!==0&&(l=1),this[i+o]=(e/a>>0)-l&255;return i+n},"writeIntBE");y.prototype.writeInt8=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,1,127,-128),e<0&&(e=255+e+1),this[i]=e&255,i+1},"writeInt8");y.prototype.writeInt16LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e&255,this[i+1]=e>>>8,i+2},"writeInt16LE");y.prototype.writeInt16BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,2,32767,-32768),this[i]=e>>>8,this[i+1]=e&255,i+2},"writeInt16BE");y.prototype.writeInt32LE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),this[i]=e&255,this[i+1]=e>>>8,this[i+2]=e>>>16,this[i+3]=e>>>24,i+4},"writeInt32LE");y.prototype.writeInt32BE=s(function(e,i,n){return e=+e,i=i>>>0,n||ae(this,e,i,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[i]=e>>>24,this[i+1]=e>>>16,this[i+2]=e>>>8,this[i+3]=e&255,i+4},"writeInt32BE");y.prototype.writeBigInt64LE=pt(s(function(e,i=0){return na(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));y.prototype.writeBigInt64BE=pt(s(function(e,i=0){return ra(this,e,i,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function oa(t,e,i,n,r,o){if(i+n>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}s(oa,"checkIEEE754");function sa(t,e,i,n,r){return e=+e,i=i>>>0,r||oa(t,e,i,4,34028234663852886e22,-34028234663852886e22),si.write(t,e,i,n,23,4),i+4}s(sa,"writeFloat");y.prototype.writeFloatLE=s(function(e,i,n){return sa(this,e,i,!0,n)},"writeFloatLE");y.prototype.writeFloatBE=s(function(e,i,n){return sa(this,e,i,!1,n)},"writeFloatBE");function aa(t,e,i,n,r){return e=+e,i=i>>>0,r||oa(t,e,i,8,17976931348623157e292,-17976931348623157e292),si.write(t,e,i,n,52,8),i+8}s(aa,"writeDouble");y.prototype.writeDoubleLE=s(function(e,i,n){return aa(this,e,i,!0,n)},"writeDoubleLE");y.prototype.writeDoubleBE=s(function(e,i,n){return aa(this,e,i,!1,n)},"writeDoubleBE");y.prototype.copy=s(function(e,i,n,r){if(!y.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!r&&r!==0&&(r=this.length),i>=e.length&&(i=e.length),i||(i=0),r>0&&r<n&&(r=n),r===n||e.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),e.length-i<r-n&&(r=e.length-i+n);let o=r-n;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(i,n,r):Uint8Array.prototype.set.call(e,this.subarray(n,r),i),o},"copy");y.prototype.fill=s(function(e,i,n,r){if(typeof e=="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"&&!y.isEncoding(r))throw new TypeError("Unknown encoding: "+r);if(e.length===1){let a=e.charCodeAt(0);(r==="utf8"&&a<128||r==="latin1")&&(e=a)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));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,e||(e=0);let o;if(typeof e=="number")for(o=i;o<n;++o)this[o]=e;else{let a=y.isBuffer(e)?e:y.from(e,r),l=a.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<n-i;++o)this[o+i]=a[o%l]}return this},"fill");var oi={};function Zr(t,e,i){oi[t]=s(class extends i{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(r){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:r,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},"NodeError")}s(Zr,"E");Zr("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Zr("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Zr("ERR_OUT_OF_RANGE",function(t,e,i){let n=`The value of "${t}" is out of range.`,r=i;return Number.isInteger(i)&&Math.abs(i)>2**32?r=Js(String(i)):typeof i=="bigint"&&(r=String(i),(i>BigInt(2)**BigInt(32)||i<-(BigInt(2)**BigInt(32)))&&(r=Js(r)),r+="n"),n+=` It must be ${e}. Received ${r}`,n},RangeError);function Js(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Js,"addNumericalSeparator");function Gd(t,e,i){ai(e,"offset"),(t[e]===void 0||t[e+i]===void 0)&&zi(e,t.length-(i+1))}s(Gd,"checkBounds");function la(t,e,i,n,r,o){if(t>i||t<e){let a=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${a} and < 2${a} ** ${(o+1)*8}${a}`:l=`>= -(2${a} ** ${(o+1)*8-1}${a}) and < 2 ** ${(o+1)*8-1}${a}`:l=`>= ${e}${a} and <= ${i}${a}`,new oi.ERR_OUT_OF_RANGE("value",l,t)}Gd(n,r,o)}s(la,"checkIntBI");function ai(t,e){if(typeof t!="number")throw new oi.ERR_INVALID_ARG_TYPE(e,"number",t)}s(ai,"validateNumber");function zi(t,e,i){throw Math.floor(t)!==t?(ai(t,i),new oi.ERR_OUT_OF_RANGE(i||"offset","an integer",t)):e<0?new oi.ERR_BUFFER_OUT_OF_BOUNDS:new oi.ERR_OUT_OF_RANGE(i||"offset",`>= ${i?1:0} and <= ${e}`,t)}s(zi,"boundsError");var Yd=/[^+/0-9A-Za-z-_]/g;function Xd(t){if(t=t.split("=")[0],t=t.trim().replace(Yd,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}s(Xd,"base64clean");function Xr(t,e){e=e||1/0;let i,n=t.length,r=null,o=[];for(let a=0;a<n;++a){if(i=t.charCodeAt(a),i>55295&&i<57344){if(!r){if(i>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&o.push(239,191,189);continue}r=i;continue}if(i<56320){(e-=3)>-1&&o.push(239,191,189),r=i;continue}i=(r-55296<<10|i-56320)+65536}else r&&(e-=3)>-1&&o.push(239,191,189);if(r=null,i<128){if((e-=1)<0)break;o.push(i)}else if(i<2048){if((e-=2)<0)break;o.push(i>>6|192,i&63|128)}else if(i<65536){if((e-=3)<0)break;o.push(i>>12|224,i>>6&63|128,i&63|128)}else if(i<1114112){if((e-=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(Xr,"utf8ToBytes");function Jd(t){let e=[];for(let i=0;i<t.length;++i)e.push(t.charCodeAt(i)&255);return e}s(Jd,"asciiToBytes");function Qd(t,e){let i,n,r,o=[];for(let a=0;a<t.length&&!((e-=2)<0);++a)i=t.charCodeAt(a),n=i>>8,r=i%256,o.push(r),o.push(n);return o}s(Qd,"utf16leToBytes");function ca(t){return Kr.toByteArray(Xd(t))}s(ca,"base64ToBytes");function Ln(t,e,i,n){let r;for(r=0;r<n&&!(r+i>=e.length||r>=t.length);++r)e[r+i]=t[r];return r}s(Ln,"blitBuffer");function We(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}s(We,"isInstance");function eo(t){return t!==t}s(eo,"numberIsNaN");var Zd=function(){let t="0123456789abcdef",e=new Array(256);for(let i=0;i<16;++i){let n=i*16;for(let r=0;r<16;++r)e[n+r]=t[i]+t[r]}return e}();function pt(t){return typeof BigInt>"u"?eh:t}s(pt,"defineBigIntMethod");function eh(){throw new Error("BigInt not supported")}s(eh,"BufferBigIntNotDefined")});var D=A((MS,Pa)=>{"use strict";Pa.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,i){return t.slice(e,i)},Error,FunctionPrototypeCall(t,e,...i){return t.call(e,...i)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,i){return Object.defineProperty(t,e,i)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,i){return t.then(e,i)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,i){return t.slice(e,i)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,i){return t.set(e,i)},Boolean,Uint8Array}});var yi=A((WS,Mn)=>{"use strict";var{AbortController:Ca,AbortSignal:rh}=typeof self<"u"?self:typeof window<"u"?window:void 0;Mn.exports=Ca;Mn.exports.AbortSignal=rh;Mn.exports.default=Ca});var Ji=A((US,co)=>{"use strict";var mi=typeof Reflect=="object"?Reflect:null,Da=mi&&typeof mi.apply=="function"?mi.apply:s(function(e,i,n){return Function.prototype.apply.call(e,i,n)},"ReflectApply"),Wn;mi&&typeof mi.ownKeys=="function"?Wn=mi.ownKeys:Object.getOwnPropertySymbols?Wn=s(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Wn=s(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function oh(t){console&&console.warn&&console.warn(t)}s(oh,"ProcessEmitWarning");var Ma=Number.isNaN||s(function(e){return e!==e},"NumberIsNaN");function T(){T.init.call(this)}s(T,"EventEmitter");co.exports=T;co.exports.once=ch;T.EventEmitter=T;T.prototype._events=void 0;T.prototype._eventsCount=0;T.prototype._maxListeners=void 0;var Ba=10;function Un(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}s(Un,"checkListener");Object.defineProperty(T,"defaultMaxListeners",{enumerable:!0,get:function(){return Ba},set:function(t){if(typeof t!="number"||t<0||Ma(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");Ba=t}});T.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};T.prototype.setMaxListeners=s(function(e){if(typeof e!="number"||e<0||Ma(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},"setMaxListeners");function Wa(t){return t._maxListeners===void 0?T.defaultMaxListeners:t._maxListeners}s(Wa,"_getMaxListeners");T.prototype.getMaxListeners=s(function(){return Wa(this)},"getMaxListeners");T.prototype.emit=s(function(e){for(var i=[],n=1;n<arguments.length;n++)i.push(arguments[n]);var r=e==="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 l=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw l.context=a,l}var c=o[e];if(c===void 0)return!1;if(typeof c=="function")Da(c,this,i);else for(var u=c.length,d=Va(c,u),n=0;n<u;++n)Da(d[n],this,i);return!0},"emit");function Ua(t,e,i,n){var r,o,a;if(Un(i),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,i.listener?i.listener:i),o=t._events),a=o[e]),a===void 0)a=o[e]=i,++t._eventsCount;else if(typeof a=="function"?a=o[e]=n?[i,a]:[a,i]:n?a.unshift(i):a.push(i),r=Wa(t),r>0&&a.length>r&&!a.warned){a.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=a.length,oh(l)}return t}s(Ua,"_addListener");T.prototype.addListener=s(function(e,i){return Ua(this,e,i,!1)},"addListener");T.prototype.on=T.prototype.addListener;T.prototype.prependListener=s(function(e,i){return Ua(this,e,i,!0)},"prependListener");function sh(){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(sh,"onceWrapper");function qa(t,e,i){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},r=sh.bind(n);return r.listener=i,n.wrapFn=r,r}s(qa,"_onceWrap");T.prototype.once=s(function(e,i){return Un(i),this.on(e,qa(this,e,i)),this},"once");T.prototype.prependOnceListener=s(function(e,i){return Un(i),this.prependListener(e,qa(this,e,i)),this},"prependOnceListener");T.prototype.removeListener=s(function(e,i){var n,r,o,a,l;if(Un(i),r=this._events,r===void 0)return this;if(n=r[e],n===void 0)return this;if(n===i||n.listener===i)--this._eventsCount===0?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,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){l=n[a].listener,o=a;break}if(o<0)return this;o===0?n.shift():ah(n,o),n.length===1&&(r[e]=n[0]),r.removeListener!==void 0&&this.emit("removeListener",e,l||i)}return this},"removeListener");T.prototype.off=T.prototype.removeListener;T.prototype.removeAllListeners=s(function(e){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[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var o=Object.keys(n),a;for(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[e],typeof i=="function")this.removeListener(e,i);else if(i!==void 0)for(r=i.length-1;r>=0;r--)this.removeListener(e,i[r]);return this},"removeAllListeners");function ja(t,e,i){var n=t._events;if(n===void 0)return[];var r=n[e];return r===void 0?[]:typeof r=="function"?i?[r.listener||r]:[r]:i?lh(r):Va(r,r.length)}s(ja,"_listeners");T.prototype.listeners=s(function(e){return ja(this,e,!0)},"listeners");T.prototype.rawListeners=s(function(e){return ja(this,e,!1)},"rawListeners");T.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):$a.call(t,e)};T.prototype.listenerCount=$a;function $a(t){var e=this._events;if(e!==void 0){var i=e[t];if(typeof i=="function")return 1;if(i!==void 0)return i.length}return 0}s($a,"listenerCount");T.prototype.eventNames=s(function(){return this._eventsCount>0?Wn(this._events):[]},"eventNames");function Va(t,e){for(var i=new Array(e),n=0;n<e;++n)i[n]=t[n];return i}s(Va,"arrayClone");function ah(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}s(ah,"spliceOne");function lh(t){for(var e=new Array(t.length),i=0;i<e.length;++i)e[i]=t[i].listener||t[i];return e}s(lh,"unwrapListeners");function ch(t,e){return new Promise(function(i,n){function r(a){t.removeListener(e,o),n(a)}s(r,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",r),i([].slice.call(arguments))}s(o,"resolver"),za(t,e,o,{once:!0}),e!=="error"&&uh(t,r,{once:!0})})}s(ch,"once");function uh(t,e,i){typeof t.on=="function"&&za(t,"error",e,i)}s(uh,"addErrorHandlerIfEventEmitter");function za(t,e,i,n){if(typeof t.on=="function")n.once?t.once(e,i):t.on(e,i);else if(typeof t.addEventListener=="function")t.addEventListener(e,s(function r(o){n.once&&t.removeEventListener(e,r),i(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}s(za,"eventTargetAgnosticAddListener")});var Z=A((jS,uo)=>{"use strict";var fh=ke(),{kResistStopPropagation:dh,SymbolDispose:hh}=D(),ph=globalThis.AbortSignal||yi().AbortSignal,yh=globalThis.AbortController||yi().AbortController,mh=Object.getPrototypeOf(async function(){}).constructor,Ha=globalThis.Blob||fh.Blob,bh=s(typeof Ha<"u"?function(e){return e instanceof Ha}:function(e){return!1},"isBlob"),Ka=s((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},"validateAbortSignal"),gh=s((t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},"validateFunction"),qn=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let i="";for(let n=0;n<e.length;n++)i+=` ${e[n].stack}
|
|
2
|
+
`;super(i),this.name="AggregateError",this.errors=e}};s(qn,"AggregateError");uo.exports={AggregateError:qn,kEmptyObject:Object.freeze({}),once(t){let e=!1;return function(...i){e||(e=!0,t.apply(this,i))}},createDeferredPromise:function(){let t,e;return{promise:new Promise((n,r)=>{t=n,e=r}),resolve:t,reject:e}},promisify(t){return new Promise((e,i)=>{t((n,...r)=>n?i(n):e(...r))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[i,n]){let r=e.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()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof mh},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:bh,deprecate(t,e){return t},addAbortListener:Ji().addAbortListener||s(function(e,i){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);Ka(e,"signal"),gh(i,"listener");let n;return e.aborted?queueMicrotask(()=>i()):(e.addEventListener("abort",i,{__proto__:null,once:!0,[dh]:!0}),n=s(()=>{e.removeEventListener("abort",i)},"removeEventListener")),{__proto__:null,[hh](){var r;(r=n)===null||r===void 0||r()}}},"addAbortListener"),AbortSignalAny:ph.any||s(function(e){if(e.length===1)return e[0];let i=new yh,n=s(()=>i.abort(),"abort");return e.forEach(r=>{Ka(r,"signals"),r.addEventListener("abort",n,{once:!0})}),i.signal.addEventListener("abort",()=>{e.forEach(r=>r.removeEventListener("abort",n))},{once:!0}),i.signal},"AbortSignalAny")};uo.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var ne=A((VS,Xa)=>{"use strict";var{format:wh,inspect:$n,AggregateError:Sh}=Z(),_h=globalThis.AggregateError||Sh,Eh=Symbol("kIsNodeError"),xh=["string","function","number","object","Function","Object","boolean","bigint","symbol"],vh=/^([A-Z][a-z0-9]*)+$/,kh="__node_internal_",Vn={};function Rt(t,e){if(!t)throw new Vn.ERR_INTERNAL_ASSERTION(e)}s(Rt,"assert");function Ga(t){let e="",i=t.length,n=t[0]==="-"?1:0;for(;i>=n+4;i-=3)e=`_${t.slice(i-3,i)}${e}`;return`${t.slice(0,i)}${e}`}s(Ga,"addNumericalSeparator");function Nh(t,e,i){if(typeof e=="function")return Rt(e.length<=i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${e.length}).`),e(...i);let n=(e.match(/%[dfijoOs]/g)||[]).length;return Rt(n===i.length,`Code: ${t}; The provided arguments length (${i.length}) does not match the required ones (${n}).`),i.length===0?e:wh(e,...i)}s(Nh,"getMessage");function Q(t,e,i){i||(i=Error);class n extends i{constructor(...o){super(Nh(t,e,o))}toString(){return`${this.name} [${t}]: ${this.message}`}}s(n,"NodeError"),Object.defineProperties(n.prototype,{name:{value:i.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[Eh]=!0,Vn[t]=n}s(Q,"E");function Ya(t){let e=kh+t.name;return Object.defineProperty(t,"name",{value:e}),t}s(Ya,"hideStackFrames");function Ih(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let i=new _h([e,t],e.message);return i.code=e.code,i}return t||e}s(Ih,"aggregateTwoErrors");var jn=class extends Error{constructor(e="The operation was aborted",i=void 0){if(i!==void 0&&typeof i!="object")throw new Vn.ERR_INVALID_ARG_TYPE("options","Object",i);super(e,i),this.code="ABORT_ERR",this.name="AbortError"}};s(jn,"AbortError");Q("ERR_ASSERTION","%s",Error);Q("ERR_INVALID_ARG_TYPE",(t,e,i)=>{Rt(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let r=[],o=[],a=[];for(let c of e)Rt(typeof c=="string","All expected entries have to be of type string"),xh.includes(c)?r.push(c.toLowerCase()):vh.test(c)?o.push(c):(Rt(c!=="object",'The value "object" should be written as "Object"'),a.push(c));if(o.length>0){let c=r.indexOf("object");c!==-1&&(r.splice(r,c,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 c=r.pop();n+=`one of type ${r.join(", ")}, or ${c}`}}(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 c=o.pop();n+=`an instance of ${o.join(", ")}, or ${c}`}}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 c=a.pop();n+=`one of ${a.join(", ")}, or ${c}`}}if(i==null)n+=`. Received ${i}`;else if(typeof i=="function"&&i.name)n+=`. Received function ${i.name}`;else if(typeof i=="object"){var l;if((l=i.constructor)!==null&&l!==void 0&&l.name)n+=`. Received an instance of ${i.constructor.name}`;else{let c=$n(i,{depth:-1});n+=`. Received ${c}`}}else{let c=$n(i,{colors:!1});c.length>25&&(c=`${c.slice(0,25)}...`),n+=`. Received type ${typeof i} (${c})`}return n},TypeError);Q("ERR_INVALID_ARG_VALUE",(t,e,i="is invalid")=>{let n=$n(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${i}. Received ${n}`},TypeError);Q("ERR_INVALID_RETURN_VALUE",(t,e,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 ${t} to be returned from the "${e}" function but got ${r}.`},TypeError);Q("ERR_MISSING_ARGS",(...t)=>{Rt(t.length>0,"At least one arg needs to be specified");let e,i=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),i){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);Q("ERR_OUT_OF_RANGE",(t,e,i)=>{Rt(e,'Missing "range" argument');let n;return Number.isInteger(i)&&Math.abs(i)>2**32?n=Ga(String(i)):typeof i=="bigint"?(n=String(i),(i>2n**32n||i<-(2n**32n))&&(n=Ga(n)),n+="n"):n=$n(i),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);Q("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);Q("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);Q("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);Q("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);Q("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);Q("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);Q("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);Q("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);Q("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);Q("ERR_STREAM_WRITE_AFTER_END","write after end",Error);Q("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);Xa.exports={AbortError:jn,aggregateTwoErrors:Ya(Ih),hideStackFrames:Ya,codes:Vn}});var gi=A((HS,sl)=>{"use strict";var{ArrayIsArray:ho,ArrayPrototypeIncludes:el,ArrayPrototypeJoin:tl,ArrayPrototypeMap:Fh,NumberIsInteger:po,NumberIsNaN:Ah,NumberMAX_SAFE_INTEGER:Lh,NumberMIN_SAFE_INTEGER:Th,NumberParseInt:Oh,ObjectPrototypeHasOwnProperty:Rh,RegExpPrototypeExec:il,String:Ph,StringPrototypeToUpperCase:Ch,StringPrototypeTrim:Dh}=D(),{hideStackFrames:Se,codes:{ERR_SOCKET_BAD_PORT:Bh,ERR_INVALID_ARG_TYPE:ee,ERR_INVALID_ARG_VALUE:bi,ERR_OUT_OF_RANGE:Pt,ERR_UNKNOWN_SIGNAL:Ja}}=ne(),{normalizeEncoding:Mh}=Z(),{isAsyncFunction:Wh,isArrayBufferView:Uh}=Z().types,Qa={};function qh(t){return t===(t|0)}s(qh,"isInt32");function jh(t){return t===t>>>0}s(jh,"isUint32");var $h=/^[0-7]+$/,Vh="must be a 32-bit unsigned integer or an octal string";function zh(t,e,i){if(typeof t>"u"&&(t=i),typeof t=="string"){if(il($h,t)===null)throw new bi(e,t,Vh);t=Oh(t,8)}return nl(t,e),t}s(zh,"parseFileMode");var Hh=Se((t,e,i=Th,n=Lh)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Pt(e,"an integer",t);if(t<i||t>n)throw new Pt(e,`>= ${i} && <= ${n}`,t)}),Kh=Se((t,e,i=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Pt(e,"an integer",t);if(t<i||t>n)throw new Pt(e,`>= ${i} && <= ${n}`,t)}),nl=Se((t,e,i=!1)=>{if(typeof t!="number")throw new ee(e,"number",t);if(!po(t))throw new Pt(e,"an integer",t);let n=i?1:0,r=4294967295;if(t<n||t>r)throw new Pt(e,`>= ${n} && <= ${r}`,t)});function yo(t,e){if(typeof t!="string")throw new ee(e,"string",t)}s(yo,"validateString");function Gh(t,e,i=void 0,n){if(typeof t!="number")throw new ee(e,"number",t);if(i!=null&&t<i||n!=null&&t>n||(i!=null||n!=null)&&Ah(t))throw new Pt(e,`${i!=null?`>= ${i}`:""}${i!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}s(Gh,"validateNumber");var Yh=Se((t,e,i)=>{if(!el(i,t)){let r="must be one of: "+tl(Fh(i,o=>typeof o=="string"?`'${o}'`:Ph(o)),", ");throw new bi(e,t,r)}});function rl(t,e){if(typeof t!="boolean")throw new ee(e,"boolean",t)}s(rl,"validateBoolean");function fo(t,e,i){return t==null||!Rh(t,e)?i:t[e]}s(fo,"getOwnPropertyValueOrDefault");var Xh=Se((t,e,i=null)=>{let n=fo(i,"allowArray",!1),r=fo(i,"allowFunction",!1);if(!fo(i,"nullable",!1)&&t===null||!n&&ho(t)||typeof t!="object"&&(!r||typeof t!="function"))throw new ee(e,"Object",t)}),Jh=Se((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new ee(e,"a dictionary",t)}),zn=Se((t,e,i=0)=>{if(!ho(t))throw new ee(e,"Array",t);if(t.length<i){let n=`must be longer than ${i}`;throw new bi(e,t,n)}});function Qh(t,e){zn(t,e);for(let i=0;i<t.length;i++)yo(t[i],`${e}[${i}]`)}s(Qh,"validateStringArray");function Zh(t,e){zn(t,e);for(let i=0;i<t.length;i++)rl(t[i],`${e}[${i}]`)}s(Zh,"validateBooleanArray");function ep(t,e){zn(t,e);for(let i=0;i<t.length;i++){let n=t[i],r=`${e}[${i}]`;if(n==null)throw new ee(r,"AbortSignal",n);ol(n,r)}}s(ep,"validateAbortSignalArray");function tp(t,e="signal"){if(yo(t,e),Qa[t]===void 0)throw Qa[Ch(t)]!==void 0?new Ja(t+" (signals must use all capital letters)"):new Ja(t)}s(tp,"validateSignalName");var ip=Se((t,e="buffer")=>{if(!Uh(t))throw new ee(e,["Buffer","TypedArray","DataView"],t)});function np(t,e){let i=Mh(e),n=t.length;if(i==="hex"&&n%2!==0)throw new bi("encoding",e,`is invalid for data of length ${n}`)}s(np,"validateEncoding");function rp(t,e="Port",i=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&Dh(t).length===0||+t!==+t>>>0||t>65535||t===0&&!i)throw new Bh(e,t,i);return t|0}s(rp,"validatePort");var ol=Se((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ee(e,"AbortSignal",t)}),op=Se((t,e)=>{if(typeof t!="function")throw new ee(e,"Function",t)}),sp=Se((t,e)=>{if(typeof t!="function"||Wh(t))throw new ee(e,"Function",t)}),ap=Se((t,e)=>{if(t!==void 0)throw new ee(e,"undefined",t)});function lp(t,e,i){if(!el(i,t))throw new ee(e,`('${tl(i,"|")}')`,t)}s(lp,"validateUnion");var cp=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function Za(t,e){if(typeof t>"u"||!il(cp,t))throw new bi(e,t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(Za,"validateLinkHeaderFormat");function up(t){if(typeof t=="string")return Za(t,"hints"),t;if(ho(t)){let e=t.length,i="";if(e===0)return i;for(let n=0;n<e;n++){let r=t[n];Za(r,"hints"),i+=r,n!==e-1&&(i+=", ")}return i}throw new bi("hints",t,'must be an array or string of format "</styles.css>; rel=preload; as=style"')}s(up,"validateLinkHeaderValue");sl.exports={isInt32:qh,isUint32:jh,parseFileMode:zh,validateArray:zn,validateStringArray:Qh,validateBooleanArray:Zh,validateAbortSignalArray:ep,validateBoolean:rl,validateBuffer:ip,validateDictionary:Jh,validateEncoding:np,validateFunction:op,validateInt32:Kh,validateInteger:Hh,validateNumber:Gh,validateObject:Xh,validateOneOf:Yh,validatePlainFunction:sp,validatePort:rp,validateSignalName:tp,validateString:yo,validateUint32:nl,validateUndefined:ap,validateUnion:lp,validateAbortSignal:ol,validateLinkHeaderValue:up}});var bt=A((GS,ul)=>{var q=ul.exports={},Ue,qe;function mo(){throw new Error("setTimeout has not been defined")}s(mo,"defaultSetTimout");function bo(){throw new Error("clearTimeout has not been defined")}s(bo,"defaultClearTimeout");(function(){try{typeof setTimeout=="function"?Ue=setTimeout:Ue=mo}catch{Ue=mo}try{typeof clearTimeout=="function"?qe=clearTimeout:qe=bo}catch{qe=bo}})();function al(t){if(Ue===setTimeout)return setTimeout(t,0);if((Ue===mo||!Ue)&&setTimeout)return Ue=setTimeout,setTimeout(t,0);try{return Ue(t,0)}catch{try{return Ue.call(null,t,0)}catch{return Ue.call(this,t,0)}}}s(al,"runTimeout");function fp(t){if(qe===clearTimeout)return clearTimeout(t);if((qe===bo||!qe)&&clearTimeout)return qe=clearTimeout,clearTimeout(t);try{return qe(t)}catch{try{return qe.call(null,t)}catch{return qe.call(this,t)}}}s(fp,"runClearTimeout");var et=[],wi=!1,Ct,Hn=-1;function dp(){!wi||!Ct||(wi=!1,Ct.length?et=Ct.concat(et):Hn=-1,et.length&&ll())}s(dp,"cleanUpNextTick");function ll(){if(!wi){var t=al(dp);wi=!0;for(var e=et.length;e;){for(Ct=et,et=[];++Hn<e;)Ct&&Ct[Hn].run();Hn=-1,e=et.length}Ct=null,wi=!1,fp(t)}}s(ll,"drainQueue");q.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var i=1;i<arguments.length;i++)e[i-1]=arguments[i];et.push(new cl(t,e)),et.length===1&&!wi&&al(ll)};function cl(t,e){this.fun=t,this.array=e}s(cl,"Item");cl.prototype.run=function(){this.fun.apply(null,this.array)};q.title="browser";q.browser=!0;q.env={};q.argv=[];q.version="";q.versions={};function tt(){}s(tt,"noop");q.on=tt;q.addListener=tt;q.once=tt;q.off=tt;q.removeListener=tt;q.removeAllListeners=tt;q.emit=tt;q.prependListener=tt;q.prependOnceListener=tt;q.listeners=function(t){return[]};q.binding=function(t){throw new Error("process.binding is not supported")};q.cwd=function(){return"/"};q.chdir=function(t){throw new Error("process.chdir is not supported")};q.umask=function(){return 0}});var $e=A((XS,kl)=>{"use strict";var{SymbolAsyncIterator:fl,SymbolIterator:dl,SymbolFor:Dt}=D(),hl=Dt("nodejs.stream.destroyed"),pl=Dt("nodejs.stream.errored"),go=Dt("nodejs.stream.readable"),wo=Dt("nodejs.stream.writable"),yl=Dt("nodejs.stream.disturbed"),hp=Dt("nodejs.webstream.isClosedPromise"),pp=Dt("nodejs.webstream.controllerErrorFunction");function Kn(t,e=!1){var i;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((i=t._readableState)===null||i===void 0?void 0:i.readable)!==!1)&&(!t._writableState||t._readableState))}s(Kn,"isReadableNodeStream");function Gn(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}s(Gn,"isWritableNodeStream");function yp(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}s(yp,"isDuplexNodeStream");function je(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}s(je,"isNodeStream");function ml(t){return!!(t&&!je(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}s(ml,"isReadableStream");function bl(t){return!!(t&&!je(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}s(bl,"isWritableStream");function gl(t){return!!(t&&!je(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}s(gl,"isTransformStream");function mp(t){return ml(t)||bl(t)||gl(t)}s(mp,"isWebStream");function bp(t,e){return t==null?!1:e===!0?typeof t[fl]=="function":e===!1?typeof t[dl]=="function":typeof t[fl]=="function"||typeof t[dl]=="function"}s(bp,"isIterable");function Yn(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!!(t.destroyed||t[hl]||n!=null&&n.destroyed)}s(Yn,"isDestroyed");function wl(t){if(!Gn(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(wl,"isWritableEnded");function gp(t,e){if(!Gn(t))return null;if(t.writableFinished===!0)return!0;let i=t._writableState;return i!=null&&i.errored?!1:typeof i?.finished!="boolean"?null:!!(i.finished||e===!1&&i.ended===!0&&i.length===0)}s(gp,"isWritableFinished");function wp(t){if(!Kn(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}s(wp,"isReadableEnded");function Sl(t,e){if(!Kn(t))return null;let i=t._readableState;return i!=null&&i.errored?!1:typeof i?.endEmitted!="boolean"?null:!!(i.endEmitted||e===!1&&i.ended===!0&&i.length===0)}s(Sl,"isReadableFinished");function _l(t){return t&&t[go]!=null?t[go]:typeof t?.readable!="boolean"?null:Yn(t)?!1:Kn(t)&&t.readable&&!Sl(t)}s(_l,"isReadable");function El(t){return t&&t[wo]!=null?t[wo]:typeof t?.writable!="boolean"?null:Yn(t)?!1:Gn(t)&&t.writable&&!wl(t)}s(El,"isWritable");function Sp(t,e){return je(t)?Yn(t)?!0:!(e?.readable!==!1&&_l(t)||e?.writable!==!1&&El(t)):null}s(Sp,"isFinished");function _p(t){var e,i;return je(t)?t.writableErrored?t.writableErrored:(e=(i=t._writableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(_p,"isWritableErrored");function Ep(t){var e,i;return je(t)?t.readableErrored?t.readableErrored:(e=(i=t._readableState)===null||i===void 0?void 0:i.errored)!==null&&e!==void 0?e:null:null}s(Ep,"isReadableErrored");function xp(t){if(!je(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,i=t._readableState;return typeof e?.closed=="boolean"||typeof i?.closed=="boolean"?e?.closed||i?.closed:typeof t._closed=="boolean"&&xl(t)?t._closed:null}s(xp,"isClosed");function xl(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}s(xl,"isOutgoingMessage");function vl(t){return typeof t._sent100=="boolean"&&xl(t)}s(vl,"isServerResponse");function vp(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}s(vp,"isServerRequest");function kp(t){if(!je(t))return null;let e=t._writableState,i=t._readableState,n=e||i;return!n&&vl(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}s(kp,"willEmitClose");function Np(t){var e;return!!(t&&((e=t[yl])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}s(Np,"isDisturbed");function Ip(t){var e,i,n,r,o,a,l,c,u,d;return!!(t&&((e=(i=(n=(r=(o=(a=t[pl])!==null&&a!==void 0?a:t.readableErrored)!==null&&o!==void 0?o:t.writableErrored)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errorEmitted)!==null&&n!==void 0?n:(c=t._writableState)===null||c===void 0?void 0:c.errorEmitted)!==null&&i!==void 0?i:(u=t._readableState)===null||u===void 0?void 0:u.errored)!==null&&e!==void 0?e:!((d=t._writableState)===null||d===void 0)&&d.errored))}s(Ip,"isErrored");kl.exports={isDestroyed:Yn,kIsDestroyed:hl,isDisturbed:Np,kIsDisturbed:yl,isErrored:Ip,kIsErrored:pl,isReadable:_l,kIsReadable:go,kIsClosedPromise:hp,kControllerErrorFunction:pp,kIsWritable:wo,isClosed:xp,isDuplexNodeStream:yp,isFinished:Sp,isIterable:bp,isReadableNodeStream:Kn,isReadableStream:ml,isReadableEnded:wp,isReadableFinished:Sl,isReadableErrored:Ep,isNodeStream:je,isWebStream:mp,isWritable:El,isWritableNodeStream:Gn,isWritableStream:bl,isWritableEnded:wl,isWritableFinished:gp,isWritableErrored:_p,isServerRequest:vp,isServerResponse:vl,willEmitClose:kp,isTransformStream:gl}});var it=A((QS,vo)=>{var gt=bt(),{AbortError:Pl,codes:Fp}=ne(),{ERR_INVALID_ARG_TYPE:Ap,ERR_STREAM_PREMATURE_CLOSE:Nl}=Fp,{kEmptyObject:_o,once:Eo}=Z(),{validateAbortSignal:Lp,validateFunction:Tp,validateObject:Op,validateBoolean:Rp}=gi(),{Promise:Pp,PromisePrototypeThen:Cp,SymbolDispose:Cl}=D(),{isClosed:Dp,isReadable:Il,isReadableNodeStream:So,isReadableStream:Bp,isReadableFinished:Fl,isReadableErrored:Al,isWritable:Ll,isWritableNodeStream:Tl,isWritableStream:Mp,isWritableFinished:Ol,isWritableErrored:Rl,isNodeStream:Wp,willEmitClose:Up,kIsClosedPromise:qp}=$e(),Si;function jp(t){return t.setHeader&&typeof t.abort=="function"}s(jp,"isRequest");var xo=s(()=>{},"nop");function Dl(t,e,i){var n,r;if(arguments.length===2?(i=e,e=_o):e==null?e=_o:Op(e,"options"),Tp(i,"callback"),Lp(e.signal,"options.signal"),i=Eo(i),Bp(t)||Mp(t))return $p(t,e,i);if(!Wp(t))throw new Ap("stream",["ReadableStream","WritableStream","Stream"],t);let o=(n=e.readable)!==null&&n!==void 0?n:So(t),a=(r=e.writable)!==null&&r!==void 0?r:Tl(t),l=t._writableState,c=t._readableState,u=s(()=>{t.writable||m()},"onlegacyfinish"),d=Up(t)&&So(t)===o&&Tl(t)===a,h=Ol(t,!1),m=s(()=>{h=!0,t.destroyed&&(d=!1),!(d&&(!t.readable||o))&&(!o||b)&&i.call(t)},"onfinish"),b=Fl(t,!1),w=s(()=>{b=!0,t.destroyed&&(d=!1),!(d&&(!t.writable||a))&&(!a||h)&&i.call(t)},"onend"),g=s($=>{i.call(t,$)},"onerror"),N=Dp(t),S=s(()=>{N=!0;let $=Rl(t)||Al(t);if($&&typeof $!="boolean")return i.call(t,$);if(o&&!b&&So(t,!0)&&!Fl(t,!1))return i.call(t,new Nl);if(a&&!h&&!Ol(t,!1))return i.call(t,new Nl);i.call(t)},"onclose"),L=s(()=>{N=!0;let $=Rl(t)||Al(t);if($&&typeof $!="boolean")return i.call(t,$);i.call(t)},"onclosed"),M=s(()=>{t.req.on("finish",m)},"onrequest");jp(t)?(t.on("complete",m),d||t.on("abort",S),t.req?M():t.on("request",M)):a&&!l&&(t.on("end",u),t.on("close",u)),!d&&typeof t.aborted=="boolean"&&t.on("aborted",S),t.on("end",w),t.on("finish",m),e.error!==!1&&t.on("error",g),t.on("close",S),N?gt.nextTick(S):l!=null&&l.errorEmitted||c!=null&&c.errorEmitted?d||gt.nextTick(L):(!o&&(!d||Il(t))&&(h||Ll(t)===!1)||!a&&(!d||Ll(t))&&(b||Il(t)===!1)||c&&t.req&&t.aborted)&>.nextTick(L);let I=s(()=>{i=xo,t.removeListener("aborted",S),t.removeListener("complete",m),t.removeListener("abort",S),t.removeListener("request",M),t.req&&t.req.removeListener("finish",m),t.removeListener("end",u),t.removeListener("close",u),t.removeListener("finish",m),t.removeListener("end",w),t.removeListener("error",g),t.removeListener("close",S)},"cleanup");if(e.signal&&!N){let $=s(()=>{let St=i;I(),St.call(t,new Pl(void 0,{cause:e.signal.reason}))},"abort");if(e.signal.aborted)gt.nextTick($);else{Si=Si||Z().addAbortListener;let St=Si(e.signal,$),fe=i;i=Eo((...Gt)=>{St[Cl](),fe.apply(t,Gt)})}}return I}s(Dl,"eos");function $p(t,e,i){let n=!1,r=xo;if(e.signal)if(r=s(()=>{n=!0,i.call(t,new Pl(void 0,{cause:e.signal.reason}))},"abort"),e.signal.aborted)gt.nextTick(r);else{Si=Si||Z().addAbortListener;let a=Si(e.signal,r),l=i;i=Eo((...c)=>{a[Cl](),l.apply(t,c)})}let o=s((...a)=>{n||gt.nextTick(()=>i.apply(t,a))},"resolverFn");return Cp(t[qp].promise,o,o),xo}s($p,"eosWeb");function Vp(t,e){var i;let n=!1;return e===null&&(e=_o),(i=e)!==null&&i!==void 0&&i.cleanup&&(Rp(e.cleanup,"cleanup"),n=e.cleanup),new Pp((r,o)=>{let a=Dl(t,e,l=>{n&&a(),l?o(l):r()})})}s(Vp,"finished");vo.exports=Dl;vo.exports.finished=Vp});var Bt=A((e_,Vl)=>{"use strict";var Ve=bt(),{aggregateTwoErrors:zp,codes:{ERR_MULTIPLE_CALLBACK:Hp},AbortError:Kp}=ne(),{Symbol:Wl}=D(),{kIsDestroyed:Gp,isDestroyed:Yp,isFinished:Xp,isServerRequest:Jp}=$e(),Ul=Wl("kDestroy"),ko=Wl("kConstruct");function ql(t,e,i){t&&(t.stack,e&&!e.errored&&(e.errored=t),i&&!i.errored&&(i.errored=t))}s(ql,"checkError");function Qp(t,e){let i=this._readableState,n=this._writableState,r=n||i;return n!=null&&n.destroyed||i!=null&&i.destroyed?(typeof e=="function"&&e(),this):(ql(t,n,i),n&&(n.destroyed=!0),i&&(i.destroyed=!0),r.constructed?Bl(this,t,e):this.once(Ul,function(o){Bl(this,zp(o,t),e)}),this)}s(Qp,"destroy");function Bl(t,e,i){let n=!1;function r(o){if(n)return;n=!0;let a=t._readableState,l=t._writableState;ql(o,l,a),l&&(l.closed=!0),a&&(a.closed=!0),typeof i=="function"&&i(o),o?Ve.nextTick(Zp,t,o):Ve.nextTick(jl,t)}s(r,"onDestroy");try{t._destroy(e||null,r)}catch(o){r(o)}}s(Bl,"_destroy");function Zp(t,e){No(t,e),jl(t)}s(Zp,"emitErrorCloseNT");function jl(t){let e=t._readableState,i=t._writableState;i&&(i.closeEmitted=!0),e&&(e.closeEmitted=!0),(i!=null&&i.emitClose||e!=null&&e.emitClose)&&t.emit("close")}s(jl,"emitCloseNT");function No(t,e){let i=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||i!=null&&i.errorEmitted||(n&&(n.errorEmitted=!0),i&&(i.errorEmitted=!0),t.emit("error",e))}s(No,"emitErrorNT");function ey(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}s(ey,"undestroy");function Io(t,e,i){let n=t._readableState,r=t._writableState;if(r!=null&&r.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||r!=null&&r.autoDestroy?t.destroy(e):e&&(e.stack,r&&!r.errored&&(r.errored=e),n&&!n.errored&&(n.errored=e),i?Ve.nextTick(No,t,e):No(t,e))}s(Io,"errorOrDestroy");function ty(t,e){if(typeof t._construct!="function")return;let i=t._readableState,n=t._writableState;i&&(i.constructed=!1),n&&(n.constructed=!1),t.once(ko,e),!(t.listenerCount(ko)>1)&&Ve.nextTick(iy,t)}s(ty,"construct");function iy(t){let e=!1;function i(n){if(e){Io(t,n??new Hp);return}e=!0;let r=t._readableState,o=t._writableState,a=o||r;r&&(r.constructed=!0),o&&(o.constructed=!0),a.destroyed?t.emit(Ul,n):n?Io(t,n,!0):Ve.nextTick(ny,t)}s(i,"onConstruct");try{t._construct(n=>{Ve.nextTick(i,n)})}catch(n){Ve.nextTick(i,n)}}s(iy,"constructNT");function ny(t){t.emit(ko)}s(ny,"emitConstructNT");function Ml(t){return t?.setHeader&&typeof t.abort=="function"}s(Ml,"isRequest");function $l(t){t.emit("close")}s($l,"emitCloseLegacy");function ry(t,e){t.emit("error",e),Ve.nextTick($l,t)}s(ry,"emitErrorCloseLegacy");function oy(t,e){!t||Yp(t)||(!e&&!Xp(t)&&(e=new Kp),Jp(t)?(t.socket=null,t.destroy(e)):Ml(t)?t.abort():Ml(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?Ve.nextTick(ry,t,e):Ve.nextTick($l,t),t.destroyed||(t[Gp]=!0))}s(oy,"destroyer");Vl.exports={construct:ty,destroyer:oy,destroy:Qp,undestroy:ey,errorOrDestroy:Io}});var Qn=A((i_,Hl)=>{"use strict";var{ArrayIsArray:sy,ObjectSetPrototypeOf:zl}=D(),{EventEmitter:Xn}=Ji();function Jn(t){Xn.call(this,t)}s(Jn,"Stream");zl(Jn.prototype,Xn.prototype);zl(Jn,Xn);Jn.prototype.pipe=function(t,e){let i=this;function n(d){t.writable&&t.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"),t.on("drain",r),!t._isStdio&&(!e||e.end!==!1)&&(i.on("end",a),i.on("close",l));let o=!1;function a(){o||(o=!0,t.end())}s(a,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}s(l,"onclose");function c(d){u(),Xn.listenerCount(this,"error")===0&&this.emit("error",d)}s(c,"onerror"),Fo(i,"error",c),Fo(t,"error",c);function u(){i.removeListener("data",n),t.removeListener("drain",r),i.removeListener("end",a),i.removeListener("close",l),i.removeListener("error",c),t.removeListener("error",c),i.removeListener("end",u),i.removeListener("close",u),t.removeListener("close",u)}return s(u,"cleanup"),i.on("end",u),i.on("close",u),t.on("close",u),t.emit("pipe",i),t};function Fo(t,e,i){if(typeof t.prependListener=="function")return t.prependListener(e,i);!t._events||!t._events[e]?t.on(e,i):sy(t._events[e])?t._events[e].unshift(i):t._events[e]=[i,t._events[e]]}s(Fo,"prependListener");Hl.exports={Stream:Jn,prependListener:Fo}});var Qi=A((r_,Zn)=>{"use strict";var{SymbolDispose:ay}=D(),{AbortError:Kl,codes:ly}=ne(),{isNodeStream:Gl,isWebStream:cy,kControllerErrorFunction:uy}=$e(),fy=it(),{ERR_INVALID_ARG_TYPE:Yl}=ly,Ao,dy=s((t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new Yl(e,"AbortSignal",t)},"validateAbortSignal");Zn.exports.addAbortSignal=s(function(e,i){if(dy(e,"signal"),!Gl(i)&&!cy(i))throw new Yl("stream",["ReadableStream","WritableStream","Stream"],i);return Zn.exports.addAbortSignalNoValidate(e,i)},"addAbortSignal");Zn.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let i=Gl(e)?()=>{e.destroy(new Kl(void 0,{cause:t.reason}))}:()=>{e[uy](new Kl(void 0,{cause:t.reason}))};if(t.aborted)i();else{Ao=Ao||Z().addAbortListener;let n=Ao(t,i);fy(e,n[ay])}return e}});var Ql=A((a_,Jl)=>{"use strict";var{StringPrototypeSlice:Xl,SymbolIterator:hy,TypedArrayPrototypeSet:er,Uint8Array:py}=D(),{Buffer:Lo}=ke(),{inspect:yy}=Z();Jl.exports=s(class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let i={data:e,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length}unshift(e){let i={data:e,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let i=this.head,n=""+i.data;for(;(i=i.next)!==null;)n+=e+i.data;return n}concat(e){if(this.length===0)return Lo.alloc(0);let i=Lo.allocUnsafe(e>>>0),n=this.head,r=0;for(;n;)er(i,n.data,r),r+=n.data.length,n=n.next;return i}consume(e,i){let n=this.head.data;if(e<n.length){let r=n.slice(0,e);return this.head.data=n.slice(e),r}return e===n.length?this.shift():i?this._getString(e):this._getBuffer(e)}first(){return this.head.data}*[hy](){for(let e=this.head;e;e=e.next)yield e.data}_getString(e){let i="",n=this.head,r=0;do{let o=n.data;if(e>o.length)i+=o,e-=o.length;else{e===o.length?(i+=o,++r,n.next?this.head=n.next:this.head=this.tail=null):(i+=Xl(o,0,e),this.head=n,n.data=Xl(o,e));break}++r}while((n=n.next)!==null);return this.length-=r,i}_getBuffer(e){let i=Lo.allocUnsafe(e),n=e,r=this.head,o=0;do{let a=r.data;if(e>a.length)er(i,a,n-e),e-=a.length;else{e===a.length?(er(i,a,n-e),++o,r.next?this.head=r.next:this.head=this.tail=null):(er(i,new py(a.buffer,a.byteOffset,e),n-e),this.head=r,r.data=a.slice(e));break}++o}while((r=r.next)!==null);return this.length-=o,i}[Symbol.for("nodejs.util.inspect.custom")](e,i){return yy(this,{...i,depth:0,customInspect:!1})}},"BufferList")});var Zi=A((c_,ic)=>{"use strict";var{MathFloor:my,NumberIsInteger:by}=D(),{validateInteger:gy}=gi(),{ERR_INVALID_ARG_VALUE:wy}=ne().codes,Zl=16*1024,ec=16;function Sy(t,e,i){return t.highWaterMark!=null?t.highWaterMark:e?t[i]:null}s(Sy,"highWaterMarkFrom");function tc(t){return t?ec:Zl}s(tc,"getDefaultHighWaterMark");function _y(t,e){gy(e,"value",0),t?ec=e:Zl=e}s(_y,"setDefaultHighWaterMark");function Ey(t,e,i,n){let r=Sy(e,n,i);if(r!=null){if(!by(r)||r<0){let o=n?`options.${i}`:"options.highWaterMark";throw new wy(o,r)}return my(r)}return tc(t.objectMode)}s(Ey,"getHighWaterMark");ic.exports={getHighWaterMark:Ey,getDefaultHighWaterMark:tc,setDefaultHighWaterMark:_y}});var oc=A((To,rc)=>{var tr=ke(),ze=tr.Buffer;function nc(t,e){for(var i in t)e[i]=t[i]}s(nc,"copyProps");ze.from&&ze.alloc&&ze.allocUnsafe&&ze.allocUnsafeSlow?rc.exports=tr:(nc(tr,To),To.Buffer=Mt);function Mt(t,e,i){return ze(t,e,i)}s(Mt,"SafeBuffer");Mt.prototype=Object.create(ze.prototype);nc(ze,Mt);Mt.from=function(t,e,i){if(typeof t=="number")throw new TypeError("Argument must not be a number");return ze(t,e,i)};Mt.alloc=function(t,e,i){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=ze(t);return e!==void 0?typeof i=="string"?n.fill(e,i):n.fill(e):n.fill(0),n};Mt.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return ze(t)};Mt.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return tr.SlowBuffer(t)}});var lc=A(ac=>{"use strict";var Ro=oc().Buffer,sc=Ro.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function xy(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}s(xy,"_normalizeEncoding");function vy(t){var e=xy(t);if(typeof e!="string"&&(Ro.isEncoding===sc||!sc(t)))throw new Error("Unknown encoding: "+t);return e||t}s(vy,"normalizeEncoding");ac.StringDecoder=en;function en(t){this.encoding=vy(t);var e;switch(this.encoding){case"utf16le":this.text=Ly,this.end=Ty,e=4;break;case"utf8":this.fillLast=Iy,e=4;break;case"base64":this.text=Oy,this.end=Ry,e=3;break;default:this.write=Py,this.end=Cy;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=Ro.allocUnsafe(e)}s(en,"StringDecoder");en.prototype.write=function(t){if(t.length===0)return"";var e,i;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";i=this.lastNeed,this.lastNeed=0}else i=0;return i<t.length?e?e+this.text(t,i):this.text(t,i):e||""};en.prototype.end=Ay;en.prototype.text=Fy;en.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length};function Oo(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}s(Oo,"utf8CheckByte");function ky(t,e,i){var n=e.length-1;if(n<i)return 0;var r=Oo(e[n]);return r>=0?(r>0&&(t.lastNeed=r-1),r):--n<i||r===-2?0:(r=Oo(e[n]),r>=0?(r>0&&(t.lastNeed=r-2),r):--n<i||r===-2?0:(r=Oo(e[n]),r>=0?(r>0&&(r===2?r=0:t.lastNeed=r-3),r):0))}s(ky,"utf8CheckIncomplete");function Ny(t,e,i){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}s(Ny,"utf8CheckExtraBytes");function Iy(t){var e=this.lastTotal-this.lastNeed,i=Ny(this,t,e);if(i!==void 0)return i;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}s(Iy,"utf8FillLast");function Fy(t,e){var i=ky(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=i;var n=t.length-(i-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}s(Fy,"utf8Text");function Ay(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}s(Ay,"utf8End");function Ly(t,e){if((t.length-e)%2===0){var i=t.toString("utf16le",e);if(i){var n=i.charCodeAt(i.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],i.slice(0,-1)}return i}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}s(Ly,"utf16Text");function Ty(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var i=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,i)}return e}s(Ty,"utf16End");function Oy(t,e){var i=(t.length-e)%3;return i===0?t.toString("base64",e):(this.lastNeed=3-i,this.lastTotal=3,i===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-i))}s(Oy,"base64Text");function Ry(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}s(Ry,"base64End");function Py(t){return t.toString(this.encoding)}s(Py,"simpleWrite");function Cy(t){return t&&t.length?this.write(t):""}s(Cy,"simpleEnd")});var Po=A((p_,dc)=>{"use strict";var cc=bt(),{PromisePrototypeThen:Dy,SymbolAsyncIterator:uc,SymbolIterator:fc}=D(),{Buffer:By}=ke(),{ERR_INVALID_ARG_TYPE:My,ERR_STREAM_NULL_VALUES:Wy}=ne().codes;function Uy(t,e,i){let n;if(typeof e=="string"||e instanceof By)return new t({objectMode:!0,...i,read(){this.push(e),this.push(null)}});let r;if(e&&e[uc])r=!0,n=e[uc]();else if(e&&e[fc])r=!1,n=e[fc]();else throw new My("iterable",["Iterable"],e);let o=new t({objectMode:!0,highWaterMark:1,...i}),a=!1;o._read=function(){a||(a=!0,c())},o._destroy=function(u,d){Dy(l(u),()=>cc.nextTick(d,u),h=>cc.nextTick(d,h||u))};async function l(u){let d=u!=null,h=typeof n.throw=="function";if(d&&h){let{value:m,done:b}=await n.throw(u);if(await m,b)return}if(typeof n.return=="function"){let{value:m}=await n.return();await m}}s(l,"close");async function c(){for(;;){try{let{value:u,done:d}=r?await n.next():n.next();if(d)o.push(null);else{let h=u&&typeof u.then=="function"?await u:u;if(h===null)throw a=!1,new Wy;if(o.push(h))continue;a=!1}}catch(u){o.destroy(u)}break}}return s(c,"next"),o}s(Uy,"from");dc.exports=Uy});var nn=A((m_,Lc)=>{var Ne=bt(),{ArrayPrototypeIndexOf:qy,NumberIsInteger:jy,NumberIsNaN:$y,NumberParseInt:Vy,ObjectDefineProperties:jo,ObjectKeys:zy,ObjectSetPrototypeOf:yc,Promise:mc,SafeSet:Hy,SymbolAsyncDispose:Ky,SymbolAsyncIterator:Gy,Symbol:Yy}=D();Lc.exports=E;E.ReadableState=or;var{EventEmitter:Xy}=Ji(),{Stream:wt,prependListener:Jy}=Qn(),{Buffer:Co}=ke(),{addAbortSignal:Qy}=Qi(),bc=it(),k=Z().debuglog("stream",t=>{k=t}),Zy=Ql(),xi=Bt(),{getHighWaterMark:em,getDefaultHighWaterMark:tm}=Zi(),{aggregateTwoErrors:hc,codes:{ERR_INVALID_ARG_TYPE:im,ERR_METHOD_NOT_IMPLEMENTED:nm,ERR_OUT_OF_RANGE:rm,ERR_STREAM_PUSH_AFTER_EOF:om,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:sm},AbortError:am}=ne(),{validateObject:lm}=gi(),Wt=Yy("kPaused"),{StringDecoder:gc}=lc(),cm=Po();yc(E.prototype,wt.prototype);yc(E,wt);var Do=s(()=>{},"nop"),{errorOrDestroy:_i}=xi,Ei=1<<0,um=1<<1,wc=1<<2,tn=1<<3,Sc=1<<4,ir=1<<5,nr=1<<6,_c=1<<7,fm=1<<8,dm=1<<9,hm=1<<10,Uo=1<<11,qo=1<<12,pm=1<<13,ym=1<<14,mm=1<<15,Ec=1<<16,bm=1<<17,gm=1<<18;function H(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}s(H,"makeBitMapDescriptor");jo(or.prototype,{objectMode:H(Ei),ended:H(um),endEmitted:H(wc),reading:H(tn),constructed:H(Sc),sync:H(ir),needReadable:H(nr),emittedReadable:H(_c),readableListening:H(fm),resumeScheduled:H(dm),errorEmitted:H(hm),emitClose:H(Uo),autoDestroy:H(qo),destroyed:H(pm),closed:H(ym),closeEmitted:H(mm),multiAwaitDrain:H(Ec),readingMore:H(bm),dataEmitted:H(gm)});function or(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.state=Uo|qo|Sc|ir,t&&t.objectMode&&(this.state|=Ei),i&&t&&t.readableObjectMode&&(this.state|=Ei),this.highWaterMark=t?em(this,t,"readableHighWaterMark",i):tm(!1),this.buffer=new Zy,this.length=0,this.pipes=[],this.flowing=null,this[Wt]=null,t&&t.emitClose===!1&&(this.state&=~Uo),t&&t.autoDestroy===!1&&(this.state&=~qo),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new gc(t.encoding),this.encoding=t.encoding)}s(or,"ReadableState");function E(t){if(!(this instanceof E))return new E(t);let e=this instanceof He();this._readableState=new or(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&Qy(t.signal,this)),wt.call(this,t),xi.construct(this,()=>{this._readableState.needReadable&&rr(this,this._readableState)})}s(E,"Readable");E.prototype.destroy=xi.destroy;E.prototype._undestroy=xi.undestroy;E.prototype._destroy=function(t,e){e(t)};E.prototype[Xy.captureRejectionSymbol]=function(t){this.destroy(t)};E.prototype[Ky]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new am,this.destroy(t)),new mc((e,i)=>bc(this,n=>n&&n!==t?i(n):e(null)))};E.prototype.push=function(t,e){return xc(this,t,e,!1)};E.prototype.unshift=function(t,e){return xc(this,t,e,!0)};function xc(t,e,i,n){k("readableAddChunk",e);let r=t._readableState,o;if(r.state&Ei||(typeof e=="string"?(i=i||r.defaultEncoding,r.encoding!==i&&(n&&r.encoding?e=Co.from(e,i).toString(r.encoding):(e=Co.from(e,i),i=""))):e instanceof Co?i="":wt._isUint8Array(e)?(e=wt._uint8ArrayToBuffer(e),i=""):e!=null&&(o=new im("chunk",["string","Buffer","Uint8Array"],e))),o)_i(t,o);else if(e===null)r.state&=~tn,_m(t,r);else if(r.state&Ei||e&&e.length>0)if(n)if(r.state&wc)_i(t,new sm);else{if(r.destroyed||r.errored)return!1;Bo(t,r,e,!0)}else if(r.ended)_i(t,new om);else{if(r.destroyed||r.errored)return!1;r.state&=~tn,r.decoder&&!i?(e=r.decoder.write(e),r.objectMode||e.length!==0?Bo(t,r,e,!1):rr(t,r)):Bo(t,r,e,!1)}else n||(r.state&=~tn,rr(t,r));return!r.ended&&(r.length<r.highWaterMark||r.length===0)}s(xc,"readableAddChunk");function Bo(t,e,i,n){e.flowing&&e.length===0&&!e.sync&&t.listenerCount("data")>0?(e.state&Ec?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",i)):(e.length+=e.objectMode?1:i.length,n?e.buffer.unshift(i):e.buffer.push(i),e.state&nr&&sr(t)),rr(t,e)}s(Bo,"addChunk");E.prototype.isPaused=function(){let t=this._readableState;return t[Wt]===!0||t.flowing===!1};E.prototype.setEncoding=function(t){let e=new gc(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let i=this._readableState.buffer,n="";for(let r of i)n+=e.write(r);return i.clear(),n!==""&&i.push(n),this._readableState.length=n.length,this};var wm=1073741824;function Sm(t){if(t>wm)throw new rm("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}s(Sm,"computeNewHighWaterMark");function pc(t,e){return t<=0||e.length===0&&e.ended?0:e.state&Ei?1:$y(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}s(pc,"howMuchToRead");E.prototype.read=function(t){k("read",t),t===void 0?t=NaN:jy(t)||(t=Vy(t,10));let e=this._readableState,i=t;if(t>e.highWaterMark&&(e.highWaterMark=Sm(t)),t!==0&&(e.state&=~_c),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return k("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?Mo(this):sr(this),null;if(t=pc(t,e),t===0&&e.ended)return e.length===0&&Mo(this),null;let n=(e.state&nr)!==0;if(k("need readable",n),(e.length===0||e.length-t<e.highWaterMark)&&(n=!0,k("length less than watermark",n)),e.ended||e.reading||e.destroyed||e.errored||!e.constructed)n=!1,k("reading, ended or constructing",n);else if(n){k("do read"),e.state|=tn|ir,e.length===0&&(e.state|=nr);try{this._read(e.highWaterMark)}catch(o){_i(this,o)}e.state&=~ir,e.reading||(t=pc(i,e))}let r;return t>0?r=Fc(t,e):r=null,r===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),i!==t&&e.ended&&Mo(this)),r!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",r)),r};function _m(t,e){if(k("onEofChunk"),!e.ended){if(e.decoder){let i=e.decoder.end();i&&i.length&&(e.buffer.push(i),e.length+=e.objectMode?1:i.length)}e.ended=!0,e.sync?sr(t):(e.needReadable=!1,e.emittedReadable=!0,vc(t))}}s(_m,"onEofChunk");function sr(t){let e=t._readableState;k("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(k("emitReadable",e.flowing),e.emittedReadable=!0,Ne.nextTick(vc,t))}s(sr,"emitReadable");function vc(t){let e=t._readableState;k("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,Nc(t)}s(vc,"emitReadable_");function rr(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,Ne.nextTick(Em,t,e))}s(rr,"maybeReadMore");function Em(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){let i=e.length;if(k("maybeReadMore read 0"),t.read(0),i===e.length)break}e.readingMore=!1}s(Em,"maybeReadMore_");E.prototype._read=function(t){throw new nm("_read()")};E.prototype.pipe=function(t,e){let i=this,n=this._readableState;n.pipes.length===1&&(n.multiAwaitDrain||(n.multiAwaitDrain=!0,n.awaitDrainWriters=new Hy(n.awaitDrainWriters?[n.awaitDrainWriters]:[]))),n.pipes.push(t),k("pipe count=%d opts=%j",n.pipes.length,e);let o=(!e||e.end!==!1)&&t!==Ne.stdout&&t!==Ne.stderr?l:N;n.endEmitted?Ne.nextTick(o):i.once("end",o),t.on("unpipe",a);function a(S,L){k("onunpipe"),S===i&&L&&L.hasUnpiped===!1&&(L.hasUnpiped=!0,d())}s(a,"onunpipe");function l(){k("onend"),t.end()}s(l,"onend");let c,u=!1;function d(){k("cleanup"),t.removeListener("close",w),t.removeListener("finish",g),c&&t.removeListener("drain",c),t.removeListener("error",b),t.removeListener("unpipe",a),i.removeListener("end",l),i.removeListener("end",N),i.removeListener("data",m),u=!0,c&&n.awaitDrainWriters&&(!t._writableState||t._writableState.needDrain)&&c()}s(d,"cleanup");function h(){u||(n.pipes.length===1&&n.pipes[0]===t?(k("false write response, pause",0),n.awaitDrainWriters=t,n.multiAwaitDrain=!1):n.pipes.length>1&&n.pipes.includes(t)&&(k("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),i.pause()),c||(c=xm(i,t),t.on("drain",c))}s(h,"pause"),i.on("data",m);function m(S){k("ondata");let L=t.write(S);k("dest.write",L),L===!1&&h()}s(m,"ondata");function b(S){if(k("onerror",S),N(),t.removeListener("error",b),t.listenerCount("error")===0){let L=t._writableState||t._readableState;L&&!L.errorEmitted?_i(t,S):t.emit("error",S)}}s(b,"onerror"),Jy(t,"error",b);function w(){t.removeListener("finish",g),N()}s(w,"onclose"),t.once("close",w);function g(){k("onfinish"),t.removeListener("close",w),N()}s(g,"onfinish"),t.once("finish",g);function N(){k("unpipe"),i.unpipe(t)}return s(N,"unpipe"),t.emit("pipe",i),t.writableNeedDrain===!0?h():n.flowing||(k("pipe resume"),i.resume()),t};function xm(t,e){return s(function(){let n=t._readableState;n.awaitDrainWriters===e?(k("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(k("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()},"pipeOnDrainFunctionResult")}s(xm,"pipeOnDrain");E.prototype.unpipe=function(t){let e=this._readableState,i={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let r=e.pipes;e.pipes=[],this.pause();for(let o=0;o<r.length;o++)r[o].emit("unpipe",this,{hasUnpiped:!1});return this}let n=qy(e.pipes,t);return n===-1?this:(e.pipes.splice(n,1),e.pipes.length===0&&this.pause(),t.emit("unpipe",this,i),this)};E.prototype.on=function(t,e){let i=wt.prototype.on.call(this,t,e),n=this._readableState;return t==="data"?(n.readableListening=this.listenerCount("readable")>0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,k("on readable",n.length,n.reading),n.length?sr(this):n.reading||Ne.nextTick(vm,this)),i};E.prototype.addListener=E.prototype.on;E.prototype.removeListener=function(t,e){let i=wt.prototype.removeListener.call(this,t,e);return t==="readable"&&Ne.nextTick(kc,this),i};E.prototype.off=E.prototype.removeListener;E.prototype.removeAllListeners=function(t){let e=wt.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&Ne.nextTick(kc,this),e};function kc(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[Wt]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}s(kc,"updateReadableListening");function vm(t){k("readable nexttick read 0"),t.read(0)}s(vm,"nReadingNextTick");E.prototype.resume=function(){let t=this._readableState;return t.flowing||(k("resume"),t.flowing=!t.readableListening,km(this,t)),t[Wt]=!1,this};function km(t,e){e.resumeScheduled||(e.resumeScheduled=!0,Ne.nextTick(Nm,t,e))}s(km,"resume");function Nm(t,e){k("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),Nc(t),e.flowing&&!e.reading&&t.read(0)}s(Nm,"resume_");E.prototype.pause=function(){return k("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(k("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[Wt]=!0,this};function Nc(t){let e=t._readableState;for(k("flow",e.flowing);e.flowing&&t.read()!==null;);}s(Nc,"flow");E.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{_i(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let i=zy(t);for(let n=1;n<i.length;n++){let r=i[n];this[r]===void 0&&typeof t[r]=="function"&&(this[r]=t[r].bind(t))}return this};E.prototype[Gy]=function(){return Ic(this)};E.prototype.iterator=function(t){return t!==void 0&&lm(t,"options"),Ic(this,t)};function Ic(t,e){typeof t.read!="function"&&(t=E.wrap(t,{objectMode:!0}));let i=Im(t,e);return i.stream=t,i}s(Ic,"streamToAsyncIterator");async function*Im(t,e){let i=Do;function n(a){this===t?(i(),i=Do):i=a}s(n,"next"),t.on("readable",n);let r,o=bc(t,{writable:!1},a=>{r=a?hc(r,a):null,i(),i=Do});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(r)throw r;if(r===null)return;await new mc(n)}}}catch(a){throw r=hc(r,a),r}finally{(r||e?.destroyOnReturn!==!1)&&(r===void 0||t._readableState.autoDestroy)?xi.destroyer(t,null):(t.off("readable",n),o())}}s(Im,"createAsyncIterator");jo(E.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});jo(or.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[Wt]!==!1},set(t){this[Wt]=!!t}}});E._fromList=Fc;function Fc(t,e){if(e.length===0)return null;let i;return e.objectMode?i=e.buffer.shift():!t||t>=e.length?(e.decoder?i=e.buffer.join(""):e.buffer.length===1?i=e.buffer.first():i=e.buffer.concat(e.length),e.buffer.clear()):i=e.buffer.consume(t,e.decoder),i}s(Fc,"fromList");function Mo(t){let e=t._readableState;k("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,Ne.nextTick(Fm,e,t))}s(Mo,"endReadable");function Fm(t,e){if(k("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)Ne.nextTick(Am,e);else if(t.autoDestroy){let i=e._writableState;(!i||i.autoDestroy&&(i.finished||i.writable===!1))&&e.destroy()}}}s(Fm,"endReadableNT");function Am(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}s(Am,"endWritableNT");E.from=function(t,e){return cm(E,t,e)};var Wo;function Ac(){return Wo===void 0&&(Wo={}),Wo}s(Ac,"lazyWebStreams");E.fromWeb=function(t,e){return Ac().newStreamReadableFromReadableStream(t,e)};E.toWeb=function(t,e){return Ac().newReadableStreamFromStreamReadable(t,e)};E.wrap=function(t,e){var i,n;return new E({objectMode:(i=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&i!==void 0?i:!0,...e,destroy(r,o){xi.destroyer(t,r),o(r)}}).wrap(t)}});var fr=A((g_,jc)=>{var Ut=bt(),{ArrayPrototypeSlice:Rc,Error:Lm,FunctionPrototypeSymbolHasInstance:Pc,ObjectDefineProperty:Cc,ObjectDefineProperties:Tm,ObjectSetPrototypeOf:Dc,StringPrototypeToLowerCase:Om,Symbol:Rm,SymbolHasInstance:Pm}=D();jc.exports=B;B.WritableState=sn;var{EventEmitter:Cm}=Ji(),rn=Qn().Stream,{Buffer:ar}=ke(),ur=Bt(),{addAbortSignal:Dm}=Qi(),{getHighWaterMark:Bm,getDefaultHighWaterMark:Mm}=Zi(),{ERR_INVALID_ARG_TYPE:Wm,ERR_METHOD_NOT_IMPLEMENTED:Um,ERR_MULTIPLE_CALLBACK:Bc,ERR_STREAM_CANNOT_PIPE:qm,ERR_STREAM_DESTROYED:on,ERR_STREAM_ALREADY_FINISHED:jm,ERR_STREAM_NULL_VALUES:$m,ERR_STREAM_WRITE_AFTER_END:Vm,ERR_UNKNOWN_ENCODING:Mc}=ne().codes,{errorOrDestroy:vi}=ur;Dc(B.prototype,rn.prototype);Dc(B,rn);function zo(){}s(zo,"nop");var ki=Rm("kOnFinished");function sn(t,e,i){typeof i!="boolean"&&(i=e instanceof He()),this.objectMode=!!(t&&t.objectMode),i&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?Bm(this,t,"writableHighWaterMark",i):Mm(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=Hm.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,cr(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[ki]=[]}s(sn,"WritableState");function cr(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}s(cr,"resetBuffer");sn.prototype.getBuffer=s(function(){return Rc(this.buffered,this.bufferedIndex)},"getBuffer");Cc(sn.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function B(t){let e=this instanceof He();if(!e&&!Pc(B,this))return new B(t);this._writableState=new sn(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&Dm(t.signal,this)),rn.call(this,t),ur.construct(this,()=>{let i=this._writableState;i.writing||Ko(this,i),Go(this,i)})}s(B,"Writable");Cc(B,Pm,{__proto__:null,value:function(t){return Pc(this,t)?!0:this!==B?!1:t&&t._writableState instanceof sn}});B.prototype.pipe=function(){vi(this,new qm)};function Wc(t,e,i,n){let r=t._writableState;if(typeof i=="function")n=i,i=r.defaultEncoding;else{if(!i)i=r.defaultEncoding;else if(i!=="buffer"&&!ar.isEncoding(i))throw new Mc(i);typeof n!="function"&&(n=zo)}if(e===null)throw new $m;if(!r.objectMode)if(typeof e=="string")r.decodeStrings!==!1&&(e=ar.from(e,i),i="buffer");else if(e instanceof ar)i="buffer";else if(rn._isUint8Array(e))e=rn._uint8ArrayToBuffer(e),i="buffer";else throw new Wm("chunk",["string","Buffer","Uint8Array"],e);let o;return r.ending?o=new Vm:r.destroyed&&(o=new on("write")),o?(Ut.nextTick(n,o),vi(t,o,!0),o):(r.pendingcb++,zm(t,r,e,i,n))}s(Wc,"_write");B.prototype.write=function(t,e,i){return Wc(this,t,e,i)===!0};B.prototype.cork=function(){this._writableState.corked++};B.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||Ko(this,t))};B.prototype.setDefaultEncoding=s(function(e){if(typeof e=="string"&&(e=Om(e)),!ar.isEncoding(e))throw new Mc(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");function zm(t,e,i,n,r){let o=e.objectMode?1:i.length;e.length+=o;let a=e.length<e.highWaterMark;return a||(e.needDrain=!0),e.writing||e.corked||e.errored||!e.constructed?(e.buffered.push({chunk:i,encoding:n,callback:r}),e.allBuffers&&n!=="buffer"&&(e.allBuffers=!1),e.allNoop&&r!==zo&&(e.allNoop=!1)):(e.writelen=o,e.writecb=r,e.writing=!0,e.sync=!0,t._write(i,n,e.onwrite),e.sync=!1),a&&!e.errored&&!e.destroyed}s(zm,"writeOrBuffer");function Tc(t,e,i,n,r,o,a){e.writelen=n,e.writecb=a,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new on("write")):i?t._writev(r,e.onwrite):t._write(r,o,e.onwrite),e.sync=!1}s(Tc,"doWrite");function Oc(t,e,i,n){--e.pendingcb,n(i),Ho(e),vi(t,i)}s(Oc,"onwriteError");function Hm(t,e){let i=t._writableState,n=i.sync,r=i.writecb;if(typeof r!="function"){vi(t,new Bc);return}i.writing=!1,i.writecb=null,i.length-=i.writelen,i.writelen=0,e?(e.stack,i.errored||(i.errored=e),t._readableState&&!t._readableState.errored&&(t._readableState.errored=e),n?Ut.nextTick(Oc,t,i,e,r):Oc(t,i,e,r)):(i.buffered.length>i.bufferedIndex&&Ko(t,i),n?i.afterWriteTickInfo!==null&&i.afterWriteTickInfo.cb===r?i.afterWriteTickInfo.count++:(i.afterWriteTickInfo={count:1,cb:r,stream:t,state:i},Ut.nextTick(Km,i.afterWriteTickInfo)):Uc(t,i,1,r))}s(Hm,"onwrite");function Km({stream:t,state:e,count:i,cb:n}){return e.afterWriteTickInfo=null,Uc(t,e,i,n)}s(Km,"afterWriteTick");function Uc(t,e,i,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));i-- >0;)e.pendingcb--,n();e.destroyed&&Ho(e),Go(t,e)}s(Uc,"afterWrite");function Ho(t){if(t.writing)return;for(let r=t.bufferedIndex;r<t.buffered.length;++r){var e;let{chunk:o,callback:a}=t.buffered[r],l=t.objectMode?1:o.length;t.length-=l,a((e=t.errored)!==null&&e!==void 0?e:new on("write"))}let i=t[ki].splice(0);for(let r=0;r<i.length;r++){var n;i[r]((n=t.errored)!==null&&n!==void 0?n:new on("end"))}cr(t)}s(Ho,"errorBuffer");function Ko(t,e){if(e.corked||e.bufferProcessing||e.destroyed||!e.constructed)return;let{buffered:i,bufferedIndex:n,objectMode:r}=e,o=i.length-n;if(!o)return;let a=n;if(e.bufferProcessing=!0,o>1&&t._writev){e.pendingcb-=o-1;let l=e.allNoop?zo:u=>{for(let d=a;d<i.length;++d)i[d].callback(u)},c=e.allNoop&&a===0?i:Rc(i,a);c.allBuffers=e.allBuffers,Tc(t,e,!0,e.length,c,"",l),cr(e)}else{do{let{chunk:l,encoding:c,callback:u}=i[a];i[a++]=null;let d=r?1:l.length;Tc(t,e,!1,d,l,c,u)}while(a<i.length&&!e.writing);a===i.length?cr(e):a>256?(i.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}s(Ko,"clearBuffer");B.prototype._write=function(t,e,i){if(this._writev)this._writev([{chunk:t,encoding:e}],i);else throw new Um("_write()")};B.prototype._writev=null;B.prototype.end=function(t,e,i){let n=this._writableState;typeof t=="function"?(i=t,t=null,e=null):typeof e=="function"&&(i=e,e=null);let r;if(t!=null){let o=Wc(this,t,e);o instanceof Lm&&(r=o)}return n.corked&&(n.corked=1,this.uncork()),r||(!n.errored&&!n.ending?(n.ending=!0,Go(this,n,!0),n.ended=!0):n.finished?r=new jm("end"):n.destroyed&&(r=new on("end"))),typeof i=="function"&&(r||n.finished?Ut.nextTick(i,r):n[ki].push(i)),this};function lr(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}s(lr,"needFinish");function Gm(t,e){let i=!1;function n(r){if(i){vi(t,r??Bc());return}if(i=!0,e.pendingcb--,r){let o=e[ki].splice(0);for(let a=0;a<o.length;a++)o[a](r);vi(t,r,e.sync)}else lr(e)&&(e.prefinished=!0,t.emit("prefinish"),e.pendingcb++,Ut.nextTick(Vo,t,e))}s(n,"onFinish"),e.sync=!0,e.pendingcb++;try{t._final(n)}catch(r){n(r)}e.sync=!1}s(Gm,"callFinal");function Ym(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.finalCalled=!0,Gm(t,e)):(e.prefinished=!0,t.emit("prefinish")))}s(Ym,"prefinish");function Go(t,e,i){lr(e)&&(Ym(t,e),e.pendingcb===0&&(i?(e.pendingcb++,Ut.nextTick((n,r)=>{lr(r)?Vo(n,r):r.pendingcb--},t,e)):lr(e)&&(e.pendingcb++,Vo(t,e))))}s(Go,"finishMaybe");function Vo(t,e){e.pendingcb--,e.finished=!0;let i=e[ki].splice(0);for(let n=0;n<i.length;n++)i[n]();if(t.emit("finish"),e.autoDestroy){let n=t._readableState;(!n||n.autoDestroy&&(n.endEmitted||n.readable===!1))&&t.destroy()}}s(Vo,"finish");Tm(B.prototype,{closed:{__proto__:null,get(){return this._writableState?this._writableState.closed:!1}},destroyed:{__proto__:null,get(){return this._writableState?this._writableState.destroyed:!1},set(t){this._writableState&&(this._writableState.destroyed=t)}},writable:{__proto__:null,get(){let t=this._writableState;return!!t&&t.writable!==!1&&!t.destroyed&&!t.errored&&!t.ending&&!t.ended},set(t){this._writableState&&(this._writableState.writable=!!t)}},writableFinished:{__proto__:null,get(){return this._writableState?this._writableState.finished:!1}},writableObjectMode:{__proto__:null,get(){return this._writableState?this._writableState.objectMode:!1}},writableBuffer:{__proto__:null,get(){return this._writableState&&this._writableState.getBuffer()}},writableEnded:{__proto__:null,get(){return this._writableState?this._writableState.ending:!1}},writableNeedDrain:{__proto__:null,get(){let t=this._writableState;return t?!t.destroyed&&!t.ending&&t.needDrain:!1}},writableHighWaterMark:{__proto__:null,get(){return this._writableState&&this._writableState.highWaterMark}},writableCorked:{__proto__:null,get(){return this._writableState?this._writableState.corked:0}},writableLength:{__proto__:null,get(){return this._writableState&&this._writableState.length}},errored:{__proto__:null,enumerable:!1,get(){return this._writableState?this._writableState.errored:null}},writableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._writableState.writable!==!1&&(this._writableState.destroyed||this._writableState.errored)&&!this._writableState.finished)}}});var Xm=ur.destroy;B.prototype.destroy=function(t,e){let i=this._writableState;return!i.destroyed&&(i.bufferedIndex<i.buffered.length||i[ki].length)&&Ut.nextTick(Ho,i),Xm.call(this,t,e),this};B.prototype._undestroy=ur.undestroy;B.prototype._destroy=function(t,e){e(t)};B.prototype[Cm.captureRejectionSymbol]=function(t){this.destroy(t)};var $o;function qc(){return $o===void 0&&($o={}),$o}s(qc,"lazyWebStreams");B.fromWeb=function(t,e){return qc().newStreamWritableFromWritableStream(t,e)};B.toWeb=function(t){return qc().newWritableStreamFromStreamWritable(t)}});var nu=A((S_,iu)=>{var Yo=bt(),Jm=ke(),{isReadable:Qm,isWritable:Zm,isIterable:$c,isNodeStream:eb,isReadableNodeStream:Vc,isWritableNodeStream:zc,isDuplexNodeStream:tb,isReadableStream:Hc,isWritableStream:Kc}=$e(),Gc=it(),{AbortError:eu,codes:{ERR_INVALID_ARG_TYPE:ib,ERR_INVALID_RETURN_VALUE:Yc}}=ne(),{destroyer:Ii}=Bt(),nb=He(),tu=nn(),rb=fr(),{createDeferredPromise:Xc}=Z(),Jc=Po(),Qc=globalThis.Blob||Jm.Blob,ob=s(typeof Qc<"u"?function(e){return e instanceof Qc}:function(e){return!1},"isBlob"),sb=globalThis.AbortController||yi().AbortController,{FunctionPrototypeCall:Zc}=D(),nt=class extends nb{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};s(nt,"Duplexify");iu.exports=s(function t(e,i){if(tb(e))return e;if(Vc(e))return Ni({readable:e});if(zc(e))return Ni({writable:e});if(eb(e))return Ni({writable:!1,readable:!1});if(Hc(e))return Ni({readable:tu.fromWeb(e)});if(Kc(e))return Ni({writable:rb.fromWeb(e)});if(typeof e=="function"){let{value:r,write:o,final:a,destroy:l}=ab(e);if($c(r))return Jc(nt,r,{objectMode:!0,write:o,final:a,destroy:l});let c=r?.then;if(typeof c=="function"){let u,d=Zc(c,r,h=>{if(h!=null)throw new Yc("nully","body",h)},h=>{Ii(u,h)});return u=new nt({objectMode:!0,readable:!1,write:o,final(h){a(async()=>{try{await d,Yo.nextTick(h,null)}catch(m){Yo.nextTick(h,m)}})},destroy:l})}throw new Yc("Iterable, AsyncIterable or AsyncFunction",i,r)}if(ob(e))return t(e.arrayBuffer());if($c(e))return Jc(nt,e,{objectMode:!0,writable:!1});if(Hc(e?.readable)&&Kc(e?.writable))return nt.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let r=e!=null&&e.readable?Vc(e?.readable)?e?.readable:t(e.readable):void 0,o=e!=null&&e.writable?zc(e?.writable)?e?.writable:t(e.writable):void 0;return Ni({readable:r,writable:o})}let n=e?.then;if(typeof n=="function"){let r;return Zc(n,e,o=>{o!=null&&r.push(o),r.push(null)},o=>{Ii(r,o)}),r=new nt({objectMode:!0,writable:!1,read(){}})}throw new ib(i,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)},"duplexify");function ab(t){let{promise:e,resolve:i}=Xc(),n=new sb,r=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:l,done:c,cb:u}=await a;if(Yo.nextTick(u),c)return;if(r.aborted)throw new eu(void 0,{cause:r.reason});({promise:e,resolve:i}=Xc()),yield l}}(),{signal:r}),write(a,l,c){let u=i;i=null,u({chunk:a,done:!1,cb:c})},final(a){let l=i;i=null,l({done:!0,cb:a})},destroy(a,l){n.abort(),l(a)}}}s(ab,"fromAsyncGen");function Ni(t){let e=t.readable&&typeof t.readable.read!="function"?tu.wrap(t.readable):t.readable,i=t.writable,n=!!Qm(e),r=!!Zm(i),o,a,l,c,u;function d(h){let m=c;c=null,m?m(h):h&&u.destroy(h)}return s(d,"onfinished"),u=new nt({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(i!=null&&i.writableObjectMode),readable:n,writable:r}),r&&(Gc(i,h=>{r=!1,h&&Ii(e,h),d(h)}),u._write=function(h,m,b){i.write(h,m)?b():o=b},u._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&&(Gc(e,h=>{n=!1,h&&Ii(e,h),d(h)}),e.on("readable",function(){if(l){let h=l;l=null,h()}}),e.on("end",function(){u.push(null)}),u._read=function(){for(;;){let h=e.read();if(h===null){l=u._read;return}if(!u.push(h))return}}),u._destroy=function(h,m){!h&&c!==null&&(h=new eu),l=null,o=null,a=null,c===null?m(h):(c=m,Ii(i,h),Ii(e,h))},u}s(Ni,"_duplexify")});var He=A((E_,su)=>{"use strict";var{ObjectDefineProperties:lb,ObjectGetOwnPropertyDescriptor:rt,ObjectKeys:cb,ObjectSetPrototypeOf:ru}=D();su.exports=Ie;var Qo=nn(),_e=fr();ru(Ie.prototype,Qo.prototype);ru(Ie,Qo);{let t=cb(_e.prototype);for(let e=0;e<t.length;e++){let i=t[e];Ie.prototype[i]||(Ie.prototype[i]=_e.prototype[i])}}function Ie(t){if(!(this instanceof Ie))return new Ie(t);Qo.call(this,t),_e.call(this,t),t?(this.allowHalfOpen=t.allowHalfOpen!==!1,t.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),t.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)):this.allowHalfOpen=!0}s(Ie,"Duplex");lb(Ie.prototype,{writable:{__proto__:null,...rt(_e.prototype,"writable")},writableHighWaterMark:{__proto__:null,...rt(_e.prototype,"writableHighWaterMark")},writableObjectMode:{__proto__:null,...rt(_e.prototype,"writableObjectMode")},writableBuffer:{__proto__:null,...rt(_e.prototype,"writableBuffer")},writableLength:{__proto__:null,...rt(_e.prototype,"writableLength")},writableFinished:{__proto__:null,...rt(_e.prototype,"writableFinished")},writableCorked:{__proto__:null,...rt(_e.prototype,"writableCorked")},writableEnded:{__proto__:null,...rt(_e.prototype,"writableEnded")},writableNeedDrain:{__proto__:null,...rt(_e.prototype,"writableNeedDrain")},destroyed:{__proto__:null,get(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set(t){this._readableState&&this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}}});var Xo;function ou(){return Xo===void 0&&(Xo={}),Xo}s(ou,"lazyWebStreams");Ie.fromWeb=function(t,e){return ou().newStreamDuplexFromReadableWritablePair(t,e)};Ie.toWeb=function(t){return ou().newReadableWritablePairFromDuplex(t)};var Jo;Ie.from=function(t){return Jo||(Jo=nu()),Jo(t,"body")}});var ts=A((v_,lu)=>{"use strict";var{ObjectSetPrototypeOf:au,Symbol:ub}=D();lu.exports=ot;var{ERR_METHOD_NOT_IMPLEMENTED:fb}=ne().codes,es=He(),{getHighWaterMark:db}=Zi();au(ot.prototype,es.prototype);au(ot,es);var an=ub("kCallback");function ot(t){if(!(this instanceof ot))return new ot(t);let e=t?db(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),es.call(this,t),this._readableState.sync=!1,this[an]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",hb)}s(ot,"Transform");function Zo(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,i)=>{if(e){t?t(e):this.destroy(e);return}i!=null&&this.push(i),this.push(null),t&&t()}):(this.push(null),t&&t())}s(Zo,"final");function hb(){this._final!==Zo&&Zo.call(this)}s(hb,"prefinish");ot.prototype._final=Zo;ot.prototype._transform=function(t,e,i){throw new fb("_transform()")};ot.prototype._write=function(t,e,i){let n=this._readableState,r=this._writableState,o=n.length;this._transform(t,e,(a,l)=>{if(a){i(a);return}l!=null&&this.push(l),r.ended||o===n.length||n.length<n.highWaterMark?i():this[an]=i})};ot.prototype._read=function(){if(this[an]){let t=this[an];this[an]=null,t()}}});var ns=A((N_,uu)=>{"use strict";var{ObjectSetPrototypeOf:cu}=D();uu.exports=Fi;var is=ts();cu(Fi.prototype,is.prototype);cu(Fi,is);function Fi(t){if(!(this instanceof Fi))return new Fi(t);is.call(this,t)}s(Fi,"PassThrough");Fi.prototype._transform=function(t,e,i){i(null,t)}});var yr=A((F_,yu)=>{var ln=bt(),{ArrayIsArray:pb,Promise:yb,SymbolAsyncIterator:mb,SymbolDispose:bb}=D(),pr=it(),{once:gb}=Z(),wb=Bt(),fu=He(),{aggregateTwoErrors:Sb,codes:{ERR_INVALID_ARG_TYPE:ds,ERR_INVALID_RETURN_VALUE:rs,ERR_MISSING_ARGS:_b,ERR_STREAM_DESTROYED:Eb,ERR_STREAM_PREMATURE_CLOSE:xb},AbortError:vb}=ne(),{validateFunction:kb,validateAbortSignal:Nb}=gi(),{isIterable:qt,isReadable:os,isReadableNodeStream:hr,isNodeStream:du,isTransformStream:Ai,isWebStream:Ib,isReadableStream:ss,isReadableFinished:Fb}=$e(),Ab=globalThis.AbortController||yi().AbortController,as,ls,cs;function hu(t,e,i){let n=!1;t.on("close",()=>{n=!0});let r=pr(t,{readable:e,writable:i},o=>{n=!o});return{destroy:o=>{n||(n=!0,wb.destroyer(t,o||new Eb("pipe")))},cleanup:r}}s(hu,"destroyer");function Lb(t){return kb(t[t.length-1],"streams[stream.length - 1]"),t.pop()}s(Lb,"popCallback");function us(t){if(qt(t))return t;if(hr(t))return Tb(t);throw new ds("val",["Readable","Iterable","AsyncIterable"],t)}s(us,"makeAsyncIterable");async function*Tb(t){ls||(ls=nn()),yield*ls.prototype[mb].call(t)}s(Tb,"fromReadable");async function dr(t,e,i,{end:n}){let r,o=null,a=s(u=>{if(u&&(r=u),o){let d=o;o=null,d()}},"resume"),l=s(()=>new yb((u,d)=>{r?d(r):o=s(()=>{r?d(r):u()},"onresolve")}),"wait");e.on("drain",a);let c=pr(e,{readable:!1},a);try{e.writableNeedDrain&&await l();for await(let u of t)e.write(u)||await l();n&&(e.end(),await l()),i()}catch(u){i(r!==u?Sb(r,u):u)}finally{c(),e.off("drain",a)}}s(dr,"pumpToNode");async function fs(t,e,i,{end:n}){Ai(e)&&(e=e.writable);let r=e.getWriter();try{for await(let o of t)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(fs,"pumpToWeb");function Ob(...t){return pu(t,gb(Lb(t)))}s(Ob,"pipeline");function pu(t,e,i){if(t.length===1&&pb(t[0])&&(t=t[0]),t.length<2)throw new _b("streams");let n=new Ab,r=n.signal,o=i?.signal,a=[];Nb(o,"options.signal");function l(){w(new vb)}s(l,"abort"),cs=cs||Z().addAbortListener;let c;o&&(c=cs(o,l));let u,d,h=[],m=0;function b(M){w(M,--m===0)}s(b,"finish");function w(M,I){var $;if(M&&(!u||u.code==="ERR_STREAM_PREMATURE_CLOSE")&&(u=M),!(!u&&!I)){for(;h.length;)h.shift()(u);($=c)===null||$===void 0||$[bb](),n.abort(),I&&(u||a.forEach(St=>St()),ln.nextTick(e,u,d))}}s(w,"finishImpl");let g;for(let M=0;M<t.length;M++){let I=t[M],$=M<t.length-1,St=M>0,fe=$||i?.end!==!1,Gt=M===t.length-1;if(du(I)){let oe=function(Ge){Ge&&Ge.name!=="AbortError"&&Ge.code!=="ERR_STREAM_PREMATURE_CLOSE"&&b(Ge)};var L=oe;if(s(oe,"onError"),fe){let{destroy:Ge,cleanup:Or}=hu(I,$,St);h.push(Ge),os(I)&&Gt&&a.push(Or)}I.on("error",oe),os(I)&&Gt&&a.push(()=>{I.removeListener("error",oe)})}if(M===0)if(typeof I=="function"){if(g=I({signal:r}),!qt(g))throw new rs("Iterable, AsyncIterable or Stream","source",g)}else qt(I)||hr(I)||Ai(I)?g=I:g=fu.from(I);else if(typeof I=="function"){if(Ai(g)){var N;g=us((N=g)===null||N===void 0?void 0:N.readable)}else g=us(g);if(g=I(g,{signal:r}),$){if(!qt(g,!0))throw new rs("AsyncIterable",`transform[${M-1}]`,g)}else{var S;as||(as=ns());let oe=new as({objectMode:!0}),Ge=(S=g)===null||S===void 0?void 0:S.then;if(typeof Ge=="function")m++,Ge.call(g,ft=>{d=ft,ft!=null&&oe.write(ft),fe&&oe.end(),ln.nextTick(b)},ft=>{oe.destroy(ft),ln.nextTick(b,ft)});else if(qt(g,!0))m++,dr(g,oe,b,{end:fe});else if(ss(g)||Ai(g)){let ft=g.readable||g;m++,dr(ft,oe,b,{end:fe})}else throw new rs("AsyncIterable or Promise","destination",g);g=oe;let{destroy:Or,cleanup:Mf}=hu(g,!1,!0);h.push(Or),Gt&&a.push(Mf)}}else if(du(I)){if(hr(g)){m+=2;let oe=Rb(g,I,b,{end:fe});os(I)&&Gt&&a.push(oe)}else if(Ai(g)||ss(g)){let oe=g.readable||g;m++,dr(oe,I,b,{end:fe})}else if(qt(g))m++,dr(g,I,b,{end:fe});else throw new ds("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else if(Ib(I)){if(hr(g))m++,fs(us(g),I,b,{end:fe});else if(ss(g)||qt(g))m++,fs(g,I,b,{end:fe});else if(Ai(g))m++,fs(g.readable,I,b,{end:fe});else throw new ds("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],g);g=I}else g=fu.from(I)}return(r!=null&&r.aborted||o!=null&&o.aborted)&&ln.nextTick(l),g}s(pu,"pipelineImpl");function Rb(t,e,i,{end:n}){let r=!1;if(e.on("close",()=>{r||i(new xb)}),t.pipe(e,{end:!1}),n){let a=function(){r=!0,e.end()};var o=a;s(a,"endFn"),Fb(t)?ln.nextTick(a):t.once("end",a)}else i();return pr(t,{readable:!0,writable:!1},a=>{let l=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&l&&l.ended&&!l.errored&&!l.errorEmitted?t.once("end",i).once("error",i):i(a)}),pr(e,{readable:!1,writable:!0},i)}s(Rb,"pipe");yu.exports={pipelineImpl:pu,pipeline:Ob}});var ps=A((L_,_u)=>{"use strict";var{pipeline:Pb}=yr(),mr=He(),{destroyer:Cb}=Bt(),{isNodeStream:br,isReadable:mu,isWritable:bu,isWebStream:hs,isTransformStream:jt,isWritableStream:gu,isReadableStream:wu}=$e(),{AbortError:Db,codes:{ERR_INVALID_ARG_VALUE:Su,ERR_MISSING_ARGS:Bb}}=ne(),Mb=it();_u.exports=s(function(...e){if(e.length===0)throw new Bb("streams");if(e.length===1)return mr.from(e[0]);let i=[...e];if(typeof e[0]=="function"&&(e[0]=mr.from(e[0])),typeof e[e.length-1]=="function"){let b=e.length-1;e[b]=mr.from(e[b])}for(let b=0;b<e.length;++b)if(!(!br(e[b])&&!hs(e[b]))){if(b<e.length-1&&!(mu(e[b])||wu(e[b])||jt(e[b])))throw new Su(`streams[${b}]`,i[b],"must be readable");if(b>0&&!(bu(e[b])||gu(e[b])||jt(e[b])))throw new Su(`streams[${b}]`,i[b],"must be writable")}let n,r,o,a,l;function c(b){let w=a;a=null,w?w(b):b?l.destroy(b):!m&&!h&&l.destroy()}s(c,"onfinished");let u=e[0],d=Pb(e,c),h=!!(bu(u)||gu(u)||jt(u)),m=!!(mu(d)||wu(d)||jt(d));if(l=new mr({writableObjectMode:!!(u!=null&&u.writableObjectMode),readableObjectMode:!!(d!=null&&d.readableObjectMode),writable:h,readable:m}),h){if(br(u))l._write=function(w,g,N){u.write(w,g)?N():n=N},l._final=function(w){u.end(),r=w},u.on("drain",function(){if(n){let w=n;n=null,w()}});else if(hs(u)){let g=(jt(u)?u.writable:u).getWriter();l._write=async function(N,S,L){try{await g.ready,g.write(N).catch(()=>{}),L()}catch(M){L(M)}},l._final=async function(N){try{await g.ready,g.close().catch(()=>{}),r=N}catch(S){N(S)}}}let b=jt(d)?d.readable:d;Mb(b,()=>{if(r){let w=r;r=null,w()}})}if(m){if(br(d))d.on("readable",function(){if(o){let b=o;o=null,b()}}),d.on("end",function(){l.push(null)}),l._read=function(){for(;;){let b=d.read();if(b===null){o=l._read;return}if(!l.push(b))return}};else if(hs(d)){let w=(jt(d)?d.readable:d).getReader();l._read=async function(){for(;;)try{let{value:g,done:N}=await w.read();if(!l.push(g))return;if(N){l.push(null);return}}catch{return}}}}return l._destroy=function(b,w){!b&&a!==null&&(b=new Db),o=null,n=null,r=null,a===null?w(b):(a=w,br(d)&&Cb(d,b))},l},"compose")});var Tu=A((O_,ms)=>{"use strict";var Wb=globalThis.AbortController||yi().AbortController,{codes:{ERR_INVALID_ARG_VALUE:Ub,ERR_INVALID_ARG_TYPE:cn,ERR_MISSING_ARGS:qb,ERR_OUT_OF_RANGE:jb},AbortError:Ke}=ne(),{validateAbortSignal:$t,validateInteger:Eu,validateObject:Vt}=gi(),$b=D().Symbol("kWeak"),Vb=D().Symbol("kResistStopPropagation"),{finished:zb}=it(),Hb=ps(),{addAbortSignalNoValidate:Kb}=Qi(),{isWritable:Gb,isNodeStream:Yb}=$e(),{deprecate:Xb}=Z(),{ArrayPrototypePush:Jb,Boolean:Qb,MathFloor:xu,Number:Zb,NumberIsNaN:eg,Promise:vu,PromiseReject:ku,PromiseResolve:tg,PromisePrototypeThen:Nu,Symbol:Fu}=D(),wr=Fu("kEmpty"),Iu=Fu("kEof");function ig(t,e){if(e!=null&&Vt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),Yb(t)&&!Gb(t))throw new Ub("stream",t,"must be writable");let i=Hb(this,t);return e!=null&&e.signal&&Kb(e.signal,i),i}s(ig,"compose");function Sr(t,e){if(typeof t!="function")throw new cn("fn",["Function","AsyncFunction"],t);e!=null&&Vt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal");let i=1;e?.concurrency!=null&&(i=xu(e.concurrency));let n=i-1;return e?.highWaterMark!=null&&(n=xu(e.highWaterMark)),Eu(i,"options.concurrency",1),Eu(n,"options.highWaterMark",0),n+=i,s(async function*(){let o=Z().AbortSignalAny([e?.signal].filter(Qb)),a=this,l=[],c={signal:o},u,d,h=!1,m=0;function b(){h=!0,w()}s(b,"onCatch");function w(){m-=1,g()}s(w,"afterItemProcessed");function g(){d&&!h&&m<i&&l.length<n&&(d(),d=null)}s(g,"maybeResume");async function N(){try{for await(let S of a){if(h)return;if(o.aborted)throw new Ke;try{if(S=t(S,c),S===wr)continue;S=tg(S)}catch(L){S=ku(L)}m+=1,Nu(S,w,b),l.push(S),u&&(u(),u=null),!h&&(l.length>=n||m>=i)&&await new vu(L=>{d=L})}l.push(Iu)}catch(S){let L=ku(S);Nu(L,w,b),l.push(L)}finally{h=!0,u&&(u(),u=null)}}s(N,"pump"),N();try{for(;;){for(;l.length>0;){let S=await l[0];if(S===Iu)return;if(o.aborted)throw new Ke;S!==wr&&(yield S),l.shift(),g()}await new vu(S=>{u=S})}}finally{h=!0,d&&(d(),d=null)}},"map").call(this)}s(Sr,"map");function ng(t=void 0){return t!=null&&Vt(t,"options"),t?.signal!=null&&$t(t.signal,"options.signal"),s(async function*(){let i=0;for await(let r of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new Ke({cause:t.signal.reason});yield[i++,r]}},"asIndexedPairs").call(this)}s(ng,"asIndexedPairs");async function Au(t,e=void 0){for await(let i of ys.call(this,t,e))return!0;return!1}s(Au,"some");async function rg(t,e=void 0){if(typeof t!="function")throw new cn("fn",["Function","AsyncFunction"],t);return!await Au.call(this,async(...i)=>!await t(...i),e)}s(rg,"every");async function og(t,e){for await(let i of ys.call(this,t,e))return i}s(og,"find");async function sg(t,e){if(typeof t!="function")throw new cn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r),wr}s(i,"forEachFn");for await(let n of Sr.call(this,i,e));}s(sg,"forEach");function ys(t,e){if(typeof t!="function")throw new cn("fn",["Function","AsyncFunction"],t);async function i(n,r){return await t(n,r)?n:wr}return s(i,"filterFn"),Sr.call(this,i,e)}s(ys,"filter");var gr=class extends qb{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};s(gr,"ReduceAwareErrMissingArgs");async function ag(t,e,i){var n;if(typeof t!="function")throw new cn("reducer",["Function","AsyncFunction"],t);i!=null&&Vt(i,"options"),i?.signal!=null&&$t(i.signal,"options.signal");let r=arguments.length>1;if(i!=null&&(n=i.signal)!==null&&n!==void 0&&n.aborted){let u=new Ke(void 0,{cause:i.signal.reason});throw this.once("error",()=>{}),await zb(this.destroy(u)),u}let o=new Wb,a=o.signal;if(i!=null&&i.signal){let u={once:!0,[$b]:this,[Vb]:!0};i.signal.addEventListener("abort",()=>o.abort(),u)}let l=!1;try{for await(let u of this){var c;if(l=!0,i!=null&&(c=i.signal)!==null&&c!==void 0&&c.aborted)throw new Ke;r?e=await t(e,u,{signal:a}):(e=u,r=!0)}if(!l&&!r)throw new gr}finally{o.abort()}return e}s(ag,"reduce");async function lg(t){t!=null&&Vt(t,"options"),t?.signal!=null&&$t(t.signal,"options.signal");let e=[];for await(let n of this){var i;if(t!=null&&(i=t.signal)!==null&&i!==void 0&&i.aborted)throw new Ke(void 0,{cause:t.signal.reason});Jb(e,n)}return e}s(lg,"toArray");function cg(t,e){let i=Sr.call(this,t,e);return s(async function*(){for await(let r of i)yield*r},"flatMap").call(this)}s(cg,"flatMap");function Lu(t){if(t=Zb(t),eg(t))return 0;if(t<0)throw new jb("number",">= 0",t);return t}s(Lu,"toIntegerOrInfinity");function ug(t,e=void 0){return e!=null&&Vt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),t=Lu(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;t--<=0&&(yield o)}},"drop").call(this)}s(ug,"drop");function fg(t,e=void 0){return e!=null&&Vt(e,"options"),e?.signal!=null&&$t(e.signal,"options.signal"),t=Lu(t),s(async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new Ke;for await(let o of this){var r;if(e!=null&&(r=e.signal)!==null&&r!==void 0&&r.aborted)throw new Ke;if(t-- >0&&(yield o),t<=0)return}},"take").call(this)}s(fg,"take");ms.exports.streamReturningOperators={asIndexedPairs:Xb(ng,"readable.asIndexedPairs will be removed in a future version."),drop:ug,filter:ys,flatMap:cg,map:Sr,take:fg,compose:ig};ms.exports.promiseReturningOperators={every:rg,forEach:sg,reduce:ag,toArray:lg,some:Au,find:og}});var bs=A((P_,Ou)=>{"use strict";var{ArrayPrototypePop:dg,Promise:hg}=D(),{isIterable:pg,isNodeStream:yg,isWebStream:mg}=$e(),{pipelineImpl:bg}=yr(),{finished:gg}=it();gs();function wg(...t){return new hg((e,i)=>{let n,r,o=t[t.length-1];if(o&&typeof o=="object"&&!yg(o)&&!pg(o)&&!mg(o)){let a=dg(t);n=a.signal,r=a.end}bg(t,(a,l)=>{a?i(a):e(l)},{signal:n,end:r})})}s(wg,"pipeline");Ou.exports={finished:gg,pipeline:wg}});var gs=A((D_,qu)=>{var{Buffer:Sg}=ke(),{ObjectDefineProperty:st,ObjectKeys:Cu,ReflectApply:Du}=D(),{promisify:{custom:Bu}}=Z(),{streamReturningOperators:Ru,promiseReturningOperators:Pu}=Tu(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:Mu}}=ne(),_g=ps(),{setDefaultHighWaterMark:Eg,getDefaultHighWaterMark:xg}=Zi(),{pipeline:Wu}=yr(),{destroyer:vg}=Bt(),Uu=it(),ws=bs(),un=$e(),P=qu.exports=Qn().Stream;P.isDestroyed=un.isDestroyed;P.isDisturbed=un.isDisturbed;P.isErrored=un.isErrored;P.isReadable=un.isReadable;P.isWritable=un.isWritable;P.Readable=nn();for(let t of Cu(Ru)){let i=function(...n){if(new.target)throw Mu();return P.Readable.from(Du(e,this,n))};Ng=i,s(i,"fn");let e=Ru[t];st(i,"name",{__proto__:null,value:e.name}),st(i,"length",{__proto__:null,value:e.length}),st(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ng;for(let t of Cu(Pu)){let i=function(...r){if(new.target)throw Mu();return Du(e,this,r)};Ng=i,s(i,"fn");let e=Pu[t];st(i,"name",{__proto__:null,value:e.name}),st(i,"length",{__proto__:null,value:e.length}),st(P.Readable.prototype,t,{__proto__:null,value:i,enumerable:!1,configurable:!0,writable:!0})}var Ng;P.Writable=fr();P.Duplex=He();P.Transform=ts();P.PassThrough=ns();P.pipeline=Wu;var{addAbortSignal:kg}=Qi();P.addAbortSignal=kg;P.finished=Uu;P.destroy=vg;P.compose=_g;P.setDefaultHighWaterMark=Eg;P.getDefaultHighWaterMark=xg;st(P,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return ws}});st(Wu,Bu,{__proto__:null,enumerable:!0,get(){return ws.pipeline}});st(Uu,Bu,{__proto__:null,enumerable:!0,get(){return ws.finished}});P.Stream=P;P._isUint8Array=s(function(e){return e instanceof Uint8Array},"isUint8Array");P._uint8ArrayToBuffer=s(function(e){return Sg.from(e.buffer,e.byteOffset,e.byteLength)},"_uint8ArrayToBuffer")});var ju=A((M_,j)=>{"use strict";var K=gs(),Ig=bs(),Fg=K.Readable.destroy;j.exports=K.Readable;j.exports._uint8ArrayToBuffer=K._uint8ArrayToBuffer;j.exports._isUint8Array=K._isUint8Array;j.exports.isDisturbed=K.isDisturbed;j.exports.isErrored=K.isErrored;j.exports.isReadable=K.isReadable;j.exports.Readable=K.Readable;j.exports.Writable=K.Writable;j.exports.Duplex=K.Duplex;j.exports.Transform=K.Transform;j.exports.PassThrough=K.PassThrough;j.exports.addAbortSignal=K.addAbortSignal;j.exports.finished=K.finished;j.exports.destroy=K.destroy;j.exports.destroy=Fg;j.exports.pipeline=K.pipeline;j.exports.compose=K.compose;Object.defineProperty(K,"promises",{configurable:!0,enumerable:!0,get(){return Ig}});j.exports.Stream=K.Stream;j.exports.default=j.exports});var Pg={};gn(Pg,{ActionType:()=>kn,ApiError:()=>f,Async:()=>jr,AsyncIndexFS:()=>Tr,AsyncStoreFS:()=>In,BigIntStats:()=>Y,BigIntStatsFs:()=>xn,Dir:()=>Ze,Dirent:()=>Qe,ErrorCode:()=>z,File:()=>Wi,FileIndex:()=>Kt,FileSystem:()=>ie,FileType:()=>U,InMemory:()=>$i,InMemoryStore:()=>ji,IndexDirInode:()=>ut,IndexFS:()=>Ri,IndexFileInode:()=>bn,IndexInode:()=>Oi,Inode:()=>pe,LockedFS:()=>ni,Mutex:()=>ii,NoSyncFile:()=>Ft,Overlay:()=>Ed,OverlayFS:()=>ri,PreloadFile:()=>te,ReadStream:()=>at,Readonly:()=>$r,SimpleSyncTransaction:()=>ei,Stats:()=>W,StatsCommon:()=>Jt,StatsFs:()=>Qt,Sync:()=>qr,SyncIndexFS:()=>Lr,SyncStoreFS:()=>ti,UnlockedOverlayFS:()=>Vi,WriteStream:()=>lt,_toUnixTimestamp:()=>Gf,access:()=>vf,accessSync:()=>Fa,appendFile:()=>Zu,appendFileSync:()=>ya,checkOptions:()=>En,chmod:()=>wf,chmodSync:()=>ka,chown:()=>bf,chownSync:()=>xa,close:()=>tf,closeSync:()=>Je,configure:()=>Og,constants:()=>It,copyFile:()=>Of,copyFileSync:()=>ao,cp:()=>Df,cpSync:()=>lo,createBackend:()=>Yf,createReadStream:()=>Ff,createWriteStream:()=>Af,decode:()=>_n,decodeDirListing:()=>Ci,default:()=>Rg,encode:()=>Le,encodeDirListing:()=>le,errorMessages:()=>Pr,exists:()=>zu,existsSync:()=>fi,fchmod:()=>cf,fchmodSync:()=>Cn,fchown:()=>lf,fchownSync:()=>Pn,fdatasync:()=>of,fdatasyncSync:()=>ga,flagToMode:()=>dt,flagToNumber:()=>_d,flagToString:()=>qs,fs:()=>mn,fstat:()=>ef,fstatSync:()=>ma,fsync:()=>rf,fsyncSync:()=>ba,ftruncate:()=>nf,ftruncateSync:()=>io,futimes:()=>uf,futimesSync:()=>Dn,isAppendable:()=>ht,isBackend:()=>Di,isBackendConfig:()=>Dr,isExclusive:()=>$s,isReadable:()=>Ye,isSynchronous:()=>Mi,isTruncating:()=>js,isWriteable:()=>me,lchmod:()=>Sf,lchmodSync:()=>Na,lchown:()=>gf,lchownSync:()=>va,levenshtein:()=>Cr,link:()=>pf,linkSync:()=>_a,lopenSync:()=>Yi,lstat:()=>Ku,lstatSync:()=>to,lutimes:()=>Ef,lutimesSync:()=>Ia,mkdir:()=>df,mkdirSync:()=>Bn,mkdirpSync:()=>Ws,mkdtemp:()=>Tf,mkdtempSync:()=>Aa,mount:()=>Hi,mountMapping:()=>Ki,mounts:()=>ge,nop:()=>_,normalizeMode:()=>de,normalizeOptions:()=>he,normalizePath:()=>F,normalizeTime:()=>Et,open:()=>Xu,openSync:()=>hi,opendir:()=>Cf,opendirSync:()=>Oa,parseFlag:()=>R,pathExistsAction:()=>Ui,pathNotExistsAction:()=>qi,promises:()=>yn,randomIno:()=>Zt,read:()=>af,readFile:()=>Ju,readFileSync:()=>Rn,readSync:()=>Sa,readdir:()=>hf,readdirSync:()=>pi,readlink:()=>mf,readlinkSync:()=>ro,readv:()=>Rf,readvSync:()=>La,realpath:()=>xf,realpathSync:()=>ui,rename:()=>Vu,renameSync:()=>da,resolveMountConfig:()=>Cs,rm:()=>Lf,rmSync:()=>so,rmdir:()=>ff,rmdirSync:()=>no,rootCred:()=>ve,rootIno:()=>ye,setImmediate:()=>Kf,size_max:()=>vn,stat:()=>Hu,statSync:()=>Gi,statfs:()=>Bf,statfsSync:()=>Ra,symlink:()=>yf,symlinkSync:()=>Ea,truncate:()=>Gu,truncateSync:()=>ha,umount:()=>Tn,unlink:()=>Yu,unlinkSync:()=>On,unwatchFile:()=>Nf,utimes:()=>_f,utimesSync:()=>oo,watch:()=>If,watchFile:()=>kf,write:()=>sf,writeFile:()=>Qu,writeFileSync:()=>Xi,writeSync:()=>wa,writev:()=>Pf,writevSync:()=>Ta});var z=(p=>(p[p.EPERM=1]="EPERM",p[p.ENOENT=2]="ENOENT",p[p.EINTR=4]="EINTR",p[p.EIO=5]="EIO",p[p.ENXIO=6]="ENXIO",p[p.EBADF=9]="EBADF",p[p.EAGAIN=11]="EAGAIN",p[p.ENOMEM=12]="ENOMEM",p[p.EACCES=13]="EACCES",p[p.EFAULT=14]="EFAULT",p[p.ENOTBLK=15]="ENOTBLK",p[p.EBUSY=16]="EBUSY",p[p.EEXIST=17]="EEXIST",p[p.EXDEV=18]="EXDEV",p[p.ENODEV=19]="ENODEV",p[p.ENOTDIR=20]="ENOTDIR",p[p.EISDIR=21]="EISDIR",p[p.EINVAL=22]="EINVAL",p[p.ENFILE=23]="ENFILE",p[p.EMFILE=24]="EMFILE",p[p.ETXTBSY=26]="ETXTBSY",p[p.EFBIG=27]="EFBIG",p[p.ENOSPC=28]="ENOSPC",p[p.ESPIPE=29]="ESPIPE",p[p.EROFS=30]="EROFS",p[p.EMLINK=31]="EMLINK",p[p.EPIPE=32]="EPIPE",p[p.EDOM=33]="EDOM",p[p.ERANGE=34]="ERANGE",p[p.EDEADLK=35]="EDEADLK",p[p.ENAMETOOLONG=36]="ENAMETOOLONG",p[p.ENOLCK=37]="ENOLCK",p[p.ENOSYS=38]="ENOSYS",p[p.ENOTEMPTY=39]="ENOTEMPTY",p[p.ELOOP=40]="ELOOP",p[p.ENOMSG=42]="ENOMSG",p[p.EBADE=52]="EBADE",p[p.EBADR=53]="EBADR",p[p.EXFULL=54]="EXFULL",p[p.ENOANO=55]="ENOANO",p[p.EBADRQC=56]="EBADRQC",p[p.ENOSTR=60]="ENOSTR",p[p.ENODATA=61]="ENODATA",p[p.ETIME=62]="ETIME",p[p.ENOSR=63]="ENOSR",p[p.ENONET=64]="ENONET",p[p.EREMOTE=66]="EREMOTE",p[p.ENOLINK=67]="ENOLINK",p[p.ECOMM=70]="ECOMM",p[p.EPROTO=71]="EPROTO",p[p.EBADMSG=74]="EBADMSG",p[p.EOVERFLOW=75]="EOVERFLOW",p[p.EBADFD=77]="EBADFD",p[p.ESTRPIPE=86]="ESTRPIPE",p[p.ENOTSOCK=88]="ENOTSOCK",p[p.EDESTADDRREQ=89]="EDESTADDRREQ",p[p.EMSGSIZE=90]="EMSGSIZE",p[p.EPROTOTYPE=91]="EPROTOTYPE",p[p.ENOPROTOOPT=92]="ENOPROTOOPT",p[p.EPROTONOSUPPORT=93]="EPROTONOSUPPORT",p[p.ESOCKTNOSUPPORT=94]="ESOCKTNOSUPPORT",p[p.ENOTSUP=95]="ENOTSUP",p[p.ENETDOWN=100]="ENETDOWN",p[p.ENETUNREACH=101]="ENETUNREACH",p[p.ENETRESET=102]="ENETRESET",p[p.ETIMEDOUT=110]="ETIMEDOUT",p[p.ECONNREFUSED=111]="ECONNREFUSED",p[p.EHOSTDOWN=112]="EHOSTDOWN",p[p.EHOSTUNREACH=113]="EHOSTUNREACH",p[p.EALREADY=114]="EALREADY",p[p.EINPROGRESS=115]="EINPROGRESS",p[p.ESTALE=116]="ESTALE",p[p.EREMOTEIO=121]="EREMOTEIO",p[p.EDQUOT=122]="EDQUOT",p))(z||{}),Pr={[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"},f=class extends Error{constructor(i,n=Pr[i],r,o=""){super(n);this.errno=i;this.path=r;this.syscall=o;this.code=z[i],this.message=`${this.code}: ${n}${this.path?`, '${this.path}'`:""}`}static fromJSON(i){let n=new f(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 f(z[i],Pr[z[i]],n,r)}code;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(f,"ApiError");var zf="/";var Bs="/";function _t(t,e){if(typeof t!="string")throw new TypeError(`"${e}" is not a string`)}s(_t,"validateString");function Ms(t,e){let i="",n=0,r=-1,o=0,a="\0";for(let l=0;l<=t.length;++l){if(l<t.length)a=t[l];else{if(a=="/")break;a="/"}if(a=="/"){if(!(r===l-1||o===1))if(o===2){if(i.length<2||n!==2||i.at(-1)!=="."||i.at(-2)!=="."){if(i.length>2){let c=i.lastIndexOf("/");c===-1?(i="",n=0):(i=i.slice(0,c),n=i.length-1-i.lastIndexOf("/")),r=l,o=0;continue}else if(i.length!==0){i="",n=0,r=l,o=0;continue}}e&&(i+=i.length>0?"/..":"..",n=2)}else i.length>0?i+="/"+t.slice(r+1,l):i=t.slice(r+1,l),n=l-r-1;r=l,o=0}else a==="."&&o!==-1?++o:o=-1}return i}s(Ms,"normalizeString");function Ee(...t){let e="",i=!1;for(let n=t.length-1;n>=-1&&!i;n--){let r=n>=0?t[n]:zf;_t(r,`paths[${n}]`),r.length&&(e=`${r}/${e}`,i=r[0]=="/")}return e=Ms(e,!i),i?`/${e}`:e.length>0?e:"/"}s(Ee,"resolve");function Hf(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=t.at(-1)==="/";return t=Ms(t,!e),t.length===0?e?"/":i?"./":".":(i&&(t+="/"),e?`/${t}`:t)}s(Hf,"normalize");function C(...t){if(t.length===0)return".";let e;for(let i=0;i<t.length;++i){let n=t[i];_t(n,"path"),n.length>0&&(e===void 0?e=n:e+=`/${n}`)}return e===void 0?".":Hf(e)}s(C,"join");function x(t){if(_t(t,"path"),t.length===0)return".";let e=t[0]==="/",i=-1,n=!0;for(let r=t.length-1;r>=1;--r)if(t[r]==="/"){if(!n){i=r;break}}else n=!1;return i===-1?e?"/":".":e&&i===1?"//":t.slice(0,i)}s(x,"dirname");function O(t,e){e!==void 0&&_t(e,"ext"),_t(t,"path");let i=0,n=-1,r=!0;if(e!==void 0&&e.length>0&&e.length<=t.length){if(e===t)return"";let o=e.length-1,a=-1;for(let l=t.length-1;l>=0;--l)if(t[l]==="/"){if(!r){i=l+1;break}}else a===-1&&(r=!1,a=l+1),o>=0&&(t[l]===e[o]?--o===-1&&(n=l):(o=-1,n=a));return i===n?n=a:n===-1&&(n=t.length),t.slice(i,n)}for(let o=t.length-1;o>=0;--o)if(t[o]==="/"){if(!r){i=o+1;break}}else n===-1&&(r=!1,n=o+1);return n===-1?"":t.slice(i,n)}s(O,"basename");function wn(t){_t(t,"path");let e=t[0]==="/",i={root:e?"/":"",dir:"",base:"",ext:"",name:""};if(t.length===0)return i;let n=e?1:0,r=-1,o=0,a=-1,l=!0,c=t.length-1,u=0;for(;c>=n;--c){if(t[c]==="/"){if(!l){o=c+1;break}continue}a===-1&&(l=!1,a=c+1),t[c]==="."?r===-1?r=c:u!==1&&(u=1):r!==-1&&(u=-1)}if(a!==-1){let d=o===0&&e?1:o;r===-1||u===0||u===1&&r===a-1&&r===o+1?i.base=i.name=t.slice(d,a):(i.name=t.slice(d,r),i.base=t.slice(d,a),i.ext=t.slice(r,a))}return o>0?i.dir=t.slice(0,o-1):e&&(i.dir="/"),i}s(wn,"parse");function Ws(t,e,i,n){n.existsSync(t,i)||(Ws(x(t),e,i,n),n.mkdirSync(t,e,i))}s(Ws,"mkdirpSync");function Sn(t,e,i,n,r){return Math.min(t+1,e+1,i+1,n===r?e:e+1)}s(Sn,"_min");function Cr(t,e){if(t===e)return 0;t.length>e.length&&([t,e]=[e,t]);let i=t.length,n=e.length;for(;i>0&&t.charCodeAt(i-1)===e.charCodeAt(n-1);)i--,n--;let r=0;for(;r<i&&t.charCodeAt(r)===e.charCodeAt(r);)r++;if(i-=r,n-=r,i===0||n===1)return n;let o=new Array(i<<1);for(let m=0;m<i;)o[i+m]=t.charCodeAt(r+m),o[m]=++m;let a,l,c,u,d;for(a=0;a+3<n;){let m=e.charCodeAt(r+(l=a)),b=e.charCodeAt(r+(c=a+1)),w=e.charCodeAt(r+(u=a+2)),g=e.charCodeAt(r+(d=a+3)),N=a+=4;for(let S=0;S<i;){let L=o[i+S],M=o[S];l=Sn(M,l,c,m,L),c=Sn(l,c,u,b,L),u=Sn(c,u,d,w,L),N=Sn(u,d,N,g,L),o[S++]=N,d=u,u=c,c=l,l=M}}let h=0;for(;a<n;){let m=e.charCodeAt(r+(l=a));h=++a;for(let b=0;b<i;b++){let w=o[b];o[b]=h=w<l||h<l?w>h?h+1:w+1:m===o[i+b]?l:l+1,l=w}}return h}s(Cr,"levenshtein");var Kf=typeof globalThis.setImmediate=="function"?globalThis.setImmediate:t=>setTimeout(t,0);function Le(t){if(typeof t!="string")throw new f(22,"Can not encode a non-string");return new Uint8Array(Array.from(t).map(e=>e.charCodeAt(0)))}s(Le,"encode");function _n(t){if(!(t instanceof Uint8Array))throw new f(22,"Can not decode a non-Uint8Array");return Array.from(t).map(e=>String.fromCharCode(e)).join("")}s(_n,"decode");function Ci(t){return JSON.parse(_n(t),(e,i)=>e==""?i:BigInt(i))}s(Ci,"decodeDirListing");function le(t){return Le(JSON.stringify(t,(e,i)=>e==""?i:i.toString()))}s(le,"encodeDirListing");function Gf(t){if(typeof t=="number")return Math.floor(t);if(t instanceof Date)return Math.floor(t.getTime()/1e3);throw new Error("Cannot parse time: "+t)}s(Gf,"_toUnixTimestamp");function de(t,e){if(typeof t=="number")return t;if(typeof t=="string"){let i=parseInt(t,8);if(!isNaN(i))return i}if(typeof e=="number")return e;throw new f(22,"Invalid mode: "+t?.toString())}s(de,"normalizeMode");function Et(t){if(t instanceof Date)return t;if(typeof t=="number")return new Date(t*1e3);if(typeof t=="string")return new Date(t);throw new f(22,"Invalid time.")}s(Et,"normalizeTime");function F(t){if(t.includes("\0"))throw new f(22,"Path must be a string without null bytes.");if(t.length==0)throw new f(22,"Path must not be empty.");return Ee(t.replaceAll(/[/\\]+/g,"/"))}s(F,"normalizePath");function he(t,e="utf8",i,n=0){return typeof t!="object"||t===null?{encoding:typeof t=="string"?t:e,flag:i,mode:n}:{encoding:typeof t?.encoding=="string"?t.encoding:e,flag:typeof t?.flag=="string"?t.flag:i,mode:de("mode"in t?t?.mode:null,n)}}s(he,"normalizeOptions");function _(){}s(_,"nop");function Di(t){return t!=null&&typeof t=="object"&&"isAvailable"in t&&typeof t.isAvailable=="function"&&"create"in t&&typeof t.create=="function"}s(Di,"isBackend");async function En(t,e){if(typeof e!="object"||e===null)throw new f(22,"Invalid options");for(let[i,n]of Object.entries(t.options)){let r=e?.[i];if(r==null){if(!n.required)continue;let a=Object.keys(e).filter(l=>!(l in t.options)).map(l=>({str:l,distance:Cr(i,l)})).filter(l=>l.distance<5).sort((l,c)=>l.distance-c.distance);throw new f(22,`${t.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 f(22,`${t.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(En,"checkOptions");function Yf(t,e){return En(t,e),t.create(e).ready()}s(Yf,"createBackend");function Dr(t){return t!=null&&typeof t=="object"&&"backend"in t&&Di(t.backend)}s(Dr,"isBackendConfig");var It={};gn(It,{COPYFILE_EXCL:()=>Bi,COPYFILE_FICLONE:()=>Jf,COPYFILE_FICLONE_FORCE:()=>Qf,F_OK:()=>Br,O_APPEND:()=>Pe,O_CREAT:()=>G,O_DIRECT:()=>od,O_DIRECTORY:()=>ed,O_DSYNC:()=>nd,O_EXCL:()=>Oe,O_NOATIME:()=>td,O_NOCTTY:()=>Zf,O_NOFOLLOW:()=>id,O_NONBLOCK:()=>sd,O_RDONLY:()=>Yt,O_RDWR:()=>se,O_SYMLINK:()=>rd,O_SYNC:()=>Xt,O_TRUNC:()=>Re,O_WRONLY:()=>Te,R_OK:()=>xe,S_IFBLK:()=>vt,S_IFCHR:()=>kt,S_IFDIR:()=>Be,S_IFIFO:()=>Nt,S_IFLNK:()=>Ce,S_IFMT:()=>J,S_IFREG:()=>De,S_IFSOCK:()=>xt,S_IRGRP:()=>hd,S_IROTH:()=>md,S_IRUSR:()=>ud,S_IRWXG:()=>Wr,S_IRWXO:()=>Ur,S_IRWXU:()=>Mr,S_ISGID:()=>ld,S_ISUID:()=>ad,S_ISVTX:()=>cd,S_IWGRP:()=>pd,S_IWOTH:()=>bd,S_IWUSR:()=>fd,S_IXGRP:()=>yd,S_IXOTH:()=>gd,S_IXUSR:()=>dd,UV_FS_O_FILEMAP:()=>wd,W_OK:()=>ce,X_OK:()=>Xf});var Br=0,xe=4,ce=2,Xf=1,Bi=1,Jf=2,Qf=4,Yt=0,Te=1,se=2,G=64,Oe=128,Zf=256,Re=512,Pe=1024,ed=65536,td=262144,id=131072,Xt=1052672,nd=4096,rd=32768,od=16384,sd=2048,J=61440,xt=49152,Ce=40960,De=32768,vt=24576,Be=16384,kt=8192,Nt=4096,ad=2048,ld=1024,cd=512,Mr=448,ud=256,fd=128,dd=64,Wr=56,hd=32,pd=16,yd=8,Ur=7,md=4,bd=2,gd=1,wd=0;var U=(n=>(n[n.FILE=32768]="FILE",n[n.DIRECTORY=16384]="DIRECTORY",n[n.SYMLINK=40960]="SYMLINK",n))(U||{}),Jt=class{get _typename(){return this._isBigint?"bigint":"number"}get _typename_inverse(){return this._isBigint?"number":"bigint"}_convert(e){return this._isBigint?BigInt(e):Number(e)}blocks;mode;dev=this._convert(0);ino=this._convert(0);rdev=this._convert(0);nlink=this._convert(1);blksize=this._convert(4096);uid=this._convert(0);gid=this._convert(0);fileData=null;atimeMs;get atime(){return new Date(Number(this.atimeMs))}set atime(e){this.atimeMs=this._convert(e.getTime())}mtimeMs;get mtime(){return new Date(Number(this.mtimeMs))}set mtime(e){this.mtimeMs=this._convert(e.getTime())}ctimeMs;get ctime(){return new Date(Number(this.ctimeMs))}set ctime(e){this.ctimeMs=this._convert(e.getTime())}birthtimeMs;get birthtime(){return new Date(Number(this.birthtimeMs))}set birthtime(e){this.birthtimeMs=this._convert(e.getTime())}size;constructor({atimeMs:e,mtimeMs:i,ctimeMs:n,birthtimeMs:r,uid:o,gid:a,size:l,mode:c}={}){let u=Date.now(),d=s((m,b)=>typeof m==this._typename?m:this._convert(typeof m==this._typename_inverse?m:b),"resolveT");this.atimeMs=d(e,u),this.mtimeMs=d(i,u),this.ctimeMs=d(n,u),this.birthtimeMs=d(r,u),this.uid=d(o,0),this.gid=d(a,0),this.size=this._convert(l);let h=Number(c)&61440||U.FILE;if(c)this.mode=this._convert(c);else switch(h){case U.FILE:this.mode=this._convert(420);break;case U.DIRECTORY:default:this.mode=this._convert(511)}this.blocks=this._convert(Math.ceil(Number(l)/512)),this.mode&61440||(this.mode=this.mode|this._convert(h))}isFile(){return(this.mode&61440)===32768}isDirectory(){return(this.mode&61440)===16384}isSymbolicLink(){return(this.mode&61440)===40960}isSocket(){return!1}isBlockDevice(){return!1}isCharacterDevice(){return!1}isFIFO(){return!1}hasAccess(e,i){if(i.euid===0||i.egid===0)return!0;let n=(i.uid==this.uid?448:0)|(i.gid==this.gid?56:0)|7;return(e&this.mode&n)==e}cred(e=Number(this.uid),i=Number(this.gid)){return{uid:e,gid:i,suid:Number(this.uid),sgid:Number(this.gid),euid:e,egid:i}}chmod(e){this.mode=this._convert(this.mode&61440|e)}chown(e,i){e=Number(e),i=Number(i),!isNaN(e)&&0<=e&&e<2**32&&(this.uid=this._convert(e)),!isNaN(i)&&0<=i&&i<2**32&&(this.gid=this._convert(i))}};s(Jt,"StatsCommon");var W=class extends Jt{_isBigint=!1;static clone(e){return new W(e)}};s(W,"Stats");var Y=class extends Jt{_isBigint=!0;atimeNs;mtimeNs;ctimeNs;birthtimeNs;static clone(e){return new Y(e)}};s(Y,"BigIntStats");var Qt=class{type;bsize;blocks;bfree;bavail;files;ffree};s(Qt,"StatsFs");var xn=class{type;bsize;blocks;bfree;bavail;files;ffree};s(xn,"BigIntStatsFs");var vn=2**32-1,ye=0n;function Us(){return Math.round(Math.random()*2**32).toString(16)}s(Us,"_random");function Zt(){return BigInt("0x"+Us()+Us())}s(Zt,"randomIno");var pe=class{buffer;get data(){return new Uint8Array(this.buffer)}view;constructor(e){let i=!e;if(e??=new ArrayBuffer(58),e?.byteLength<58)throw new RangeError("Can not create an inode from a buffer less than 58 bytes");if(this.view=new DataView(e),this.buffer=e,!i)return;this.ino=Zt(),this.nlink=1,this.size=4096;let n=Date.now();this.atimeMs=n,this.mtimeMs=n,this.ctimeMs=n,this.birthtimeMs=n}get ino(){return this.view.getBigUint64(0,!0)}set ino(e){this.view.setBigUint64(0,e,!0)}get size(){return this.view.getUint32(8,!0)}set size(e){this.view.setUint32(8,e,!0)}get mode(){return this.view.getUint16(12,!0)}set mode(e){this.view.setUint16(12,e,!0)}get nlink(){return this.view.getUint32(14,!0)}set nlink(e){this.view.setUint32(14,e,!0)}get uid(){return this.view.getUint32(18,!0)}set uid(e){this.view.setUint32(18,e,!0)}get gid(){return this.view.getUint32(22,!0)}set gid(e){this.view.setUint32(22,e,!0)}get atimeMs(){return this.view.getFloat64(26,!0)}set atimeMs(e){this.view.setFloat64(26,e,!0)}get birthtimeMs(){return this.view.getFloat64(34,!0)}set birthtimeMs(e){this.view.setFloat64(34,e,!0)}get mtimeMs(){return this.view.getFloat64(42,!0)}set mtimeMs(e){this.view.setFloat64(42,e,!0)}get ctimeMs(){return this.view.getFloat64(50,!0)}set ctimeMs(e){this.view.setFloat64(50,e,!0)}toStats(){return new W(this)}update(e){let i=!1;return this.size!==e.size&&(this.size=e.size,i=!0),this.mode!==e.mode&&(this.mode=e.mode,i=!0),this.nlink!==e.nlink&&(this.nlink=e.nlink,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.uid!==e.uid&&(this.uid=e.uid,i=!0),this.atimeMs!==e.atimeMs&&(this.atimeMs=e.atimeMs,i=!0),this.mtimeMs!==e.mtimeMs&&(this.mtimeMs=e.mtimeMs,i=!0),this.ctimeMs!==e.ctimeMs&&(this.ctimeMs=e.ctimeMs,i=!0),i}};s(pe,"Inode");var kn=(r=>(r[r.NOP=0]="NOP",r[r.THROW=1]="THROW",r[r.TRUNCATE=2]="TRUNCATE",r[r.CREATE=3]="CREATE",r))(kn||{}),Sd=["r","r+","rs","rs+","w","wx","w+","wx+","a","ax","a+","ax+"];function R(t){if(typeof t=="number")return qs(t);if(!Sd.includes(t))throw new Error("Invalid flag string: "+t);return t}s(R,"parseFlag");function qs(t){switch(t){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: "+t)}}s(qs,"flagToString");function _d(t){switch(t){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: "+t)}}s(_d,"flagToNumber");function dt(t){let e=0;return e<<=1,e+=+Ye(t),e<<=1,e+=+me(t),e<<=1,e}s(dt,"flagToMode");function Ye(t){return t.indexOf("r")!==-1||t.indexOf("+")!==-1}s(Ye,"isReadable");function me(t){return t.indexOf("w")!==-1||t.indexOf("a")!==-1||t.indexOf("+")!==-1}s(me,"isWriteable");function js(t){return t.indexOf("w")!==-1}s(js,"isTruncating");function ht(t){return t.indexOf("a")!==-1}s(ht,"isAppendable");function Mi(t){return t.indexOf("s")!==-1}s(Mi,"isSynchronous");function $s(t){return t.indexOf("x")!==-1}s($s,"isExclusive");function Ui(t){return $s(t)?1:js(t)?2:0}s(Ui,"pathExistsAction");function qi(t){return(me(t)||ht(t))&&t!=="r+"?3:1}s(qi,"pathNotExistsAction");var Wi=class{datasync(){return this.sync()}datasyncSync(){return this.syncSync()}};s(Wi,"File");var te=class extends Wi{constructor(i,n,r,o,a=new Uint8Array(new ArrayBuffer(0,{maxByteLength:vn}))){super();this.fs=i;this.path=n;this.flag=r;this.stats=o;this._buffer=a;if(this.stats.size!=a.byteLength){if(Ye(this.flag))throw new Error(`Size mismatch: buffer length ${a.byteLength}, stats size ${this.stats.size}`);this._dirty=!0}}_position=0;_dirty=!1;get buffer(){return this._buffer}get position(){return ht(this.flag)?this.stats.size:this._position}set position(i){this._position=i}async sync(){this.isDirty()&&(await this.fs.sync(this.path,this._buffer,this.stats),this._dirty=!1)}syncSync(){this.isDirty()&&(this.fs.syncSync(this.path,this._buffer,this.stats),this._dirty=!1)}async close(){await this.sync()}closeSync(){this.syncSync()}async stat(){return new W(this.stats)}statSync(){return new W(this.stats)}truncate(i){if(this.truncateSync(i),Mi(this.flag))return this.sync()}truncateSync(i){if(this._dirty=!0,!me(this.flag))throw new f(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),Mi(this.flag)&&this.syncSync();return}this.stats.size=i,this._buffer=this._buffer.subarray(0,i),Mi(this.flag)&&this.syncSync()}async write(i,n=0,r=this.stats.size,o=0){return this.writeSync(i,n,r,o)}writeSync(i,n=0,r=this.stats.size,o=0){if(this._dirty=!0,o??=this.position,!me(this.flag))throw new f(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 u=new Uint8Array(new ArrayBuffer(a,{maxByteLength:vn}));u.set(this._buffer),this._buffer=u}let l=i.slice(n,n+r);this._buffer.set(l,o);let c=l.byteLength;return this.stats.mtimeMs=Date.now(),Mi(this.flag)?(this.syncSync(),c):(this.position=o+c,c)}async read(i,n=0,r=this.stats.size,o=0){return{bytesRead:this.readSync(i,n,r,o),buffer:i}}readSync(i,n=0,r=this.stats.size,o=0){if(!Ye(this.flag))throw new f(1,"File not opened with a readable mode.");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 l=a-o;return l==0||new Uint8Array(i.buffer).set(this._buffer.slice(o,a),n),l}async chmod(i){this.chmodSync(i)}chmodSync(i){this._dirty=!0,this.stats.chmod(i),this.syncSync()}async chown(i,n){this.chownSync(i,n)}chownSync(i,n){this._dirty=!0,this.stats.chown(i,n),this.syncSync()}async utimes(i,n){this.utimesSync(i,n)}utimesSync(i,n){this._dirty=!0,this.stats.atime=i,this.stats.mtime=n,this.syncSync()}isDirty(){return this._dirty}resetDirty(){this._dirty=!1}_setType(i){return this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.sync()}_setTypeSync(i){this._dirty=!0,this.stats.mode=this.stats.mode&-61441|i,this.syncSync()}};s(te,"PreloadFile");var Ft=class extends te{constructor(e,i,n,r,o){super(e,i,n,r,o)}async sync(){}syncSync(){}async close(){}closeSync(){}};s(Ft,"NoSyncFile");var ve={uid:0,gid:0,suid:0,sgid:0,euid:0,egid:0};var ie=class{metadata(){return{name:this.constructor.name,readonly:!1,totalSpace:0,freeSpace:0}}constructor(e){}async exists(e,i){try{return await this.stat(e,i),!0}catch{return!1}}existsSync(e,i){try{return this.statSync(e,i),!0}catch{return!1}}};s(ie,"FileSystem");function qr(t){class e extends t{async ready(){return this}async exists(n,r){return this.existsSync(n,r)}async rename(n,r,o){return this.renameSync(n,r,o)}async stat(n,r){return this.statSync(n,r)}async createFile(n,r,o,a){return this.createFileSync(n,r,o,a)}async openFile(n,r,o){return this.openFileSync(n,r,o)}async unlink(n,r){return this.unlinkSync(n,r)}async rmdir(n,r){return this.rmdirSync(n,r)}async mkdir(n,r,o){return this.mkdirSync(n,r,o)}async readdir(n,r){return this.readdirSync(n,r)}async link(n,r,o){return this.linkSync(n,r,o)}async sync(n,r,o){return this.syncSync(n,r,o)}}return s(e,"_SyncFileSystem"),e}s(qr,"Sync");function jr(t){class e extends t{_queue=[];_queueRunning=!1;_isInitialized=!1;async ready(){if(await this._sync.ready(),this._isInitialized)return this;try{await this.crossCopy("/"),this._isInitialized=!0}catch(n){throw this._isInitialized=!1,n}return this}renameSync(n,r,o){this._sync.renameSync(n,r,o),this.queue("rename",n,r,o)}statSync(n,r){return this._sync.statSync(n,r)}createFileSync(n,r,o,a){let l=this._sync.createFileSync(n,r,o,a);this.queue("createFile",n,r,o,a);let c=l.statSync(),u=new Uint8Array(c.size);return l.readSync(u),new te(this,n,r,c,u)}openFileSync(n,r,o){return this._sync.openFileSync(n,r,o)}unlinkSync(n,r){this._sync.unlinkSync(n,r),this.queue("unlink",n,r)}rmdirSync(n,r){this._sync.rmdirSync(n,r),this.queue("rmdir",n,r)}mkdirSync(n,r,o){this._sync.mkdirSync(n,r,o),this.queue("mkdir",n,r,o)}readdirSync(n,r){return this._sync.readdirSync(n,r)}linkSync(n,r,o){this._sync.linkSync(n,r,o),this.queue("link",n,r,o)}syncSync(n,r,o){this._sync.syncSync(n,r,o),this.queue("sync",n,r,o)}existsSync(n,r){return this._sync.existsSync(n,r)}async crossCopy(n){let r=await this.stat(n,ve);if(r.isDirectory()){if(n!=="/"){let a=await this.stat(n,ve);this._sync.mkdirSync(n,a.mode,a.cred())}let o=await this.readdir(n,ve);for(let a of o)await this.crossCopy(C(n,a))}else{let o=await this.openFile(n,R("r"),ve),a=this._sync.createFileSync(n,R("w"),r.mode,ve);try{let{size:l}=await o.stat(),c=new Uint8Array(l);await o.read(c),a.writeSync(c)}finally{await o.close(),a.closeSync()}}}async _next(){if(this._queue.length==0){this._queueRunning=!1;return}let[n,...r]=this._queue.shift();await this[n](...r),await this._next()}queue(...n){this._queue.push(n),!this._queueRunning&&(this._queueRunning=!0,this._next())}}return s(e,"_AsyncFileSystem"),e}s(jr,"Async");function $r(t){class e extends t{metadata(){return{...super.metadata(),readonly:!0}}async rename(n,r,o){throw new f(30)}renameSync(n,r,o){throw new f(30)}async createFile(n,r,o,a){throw new f(30)}createFileSync(n,r,o,a){throw new f(30)}async unlink(n,r){throw new f(30)}unlinkSync(n,r){throw new f(30)}async rmdir(n,r){throw new f(30)}rmdirSync(n,r){throw new f(30)}async mkdir(n,r,o){throw new f(30)}mkdirSync(n,r,o){throw new f(30)}async link(n,r,o){throw new f(30)}linkSync(n,r,o){throw new f(30)}async sync(n,r,o){throw new f(30)}syncSync(n,r,o){throw new f(30)}}return s(e,"_ReadonlyFileSystem"),e}s($r,"Readonly");var ei=class{constructor(e){this.store=e}originalData=new Map;modifiedKeys=new Set;get(e){let i=this.store.get(e);return this.stashOldValue(e,i),i}put(e,i,n){return this.markModified(e),this.store.put(e,i,n)}remove(e){this.markModified(e),this.store.remove(e)}commit(){}abort(){for(let e of this.modifiedKeys){let i=this.originalData.get(e);i?this.store.put(e,i,!0):this.store.remove(e)}}stashOldValue(e,i){this.originalData.has(e)||this.originalData.set(e,i)}markModified(e){this.modifiedKeys.add(e),this.originalData.has(e)||this.originalData.set(e,this.store.get(e))}};s(ei,"SimpleSyncTransaction");var ti=class extends qr(ie){store;constructor(e){super(),this.store=e.store,this.makeRootDirectory()}metadata(){return{...super.metadata(),name:this.store.name}}empty(){this.store.clear(),this.makeRootDirectory()}renameSync(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=O(e),l=x(i),c=O(i),u=this.findINode(r,o),d=this.getDirListing(r,u,o);if(!u.toStats().hasAccess(2,n))throw f.With("EACCES",e,"rename");if(!d[a])throw f.With("ENOENT",e,"rename");let h=d[a];if(delete d[a],(l+"/").indexOf(e+"/")==0)throw new f(16,o);let m,b;if(l===o?(m=u,b=d):(m=this.findINode(r,l),b=this.getDirListing(r,m,l)),b[c]){let w=this.getINode(r,b[c],i);if(w.toStats().isFile())try{r.remove(w.ino),r.remove(b[c])}catch(g){throw r.abort(),g}else throw f.With("EPERM",i,"rename")}b[c]=h;try{r.put(u.ino,le(d),!0),r.put(m.ino,le(b),!0)}catch(w){throw r.abort(),w}r.commit()}statSync(e,i){let n=this.findINode(this.store.beginTransaction(),e).toStats();if(!n.hasAccess(4,i))throw f.With("EACCES",e,"stat");return n}createFileSync(e,i,n,r){return this.commitNewFile(e,U.FILE,n,r),this.openFileSync(e,i,r)}openFileSync(e,i,n){let r=this.store.beginTransaction(),o=this.findINode(r,e),a=r.get(o.ino);if(!o.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(a===null)throw f.With("ENOENT",e,"openFile");return new te(this,e,i,o.toStats(),a)}unlinkSync(e,i){this.removeEntry(e,!1,i)}rmdirSync(e,i){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.removeEntry(e,!0,i)}mkdirSync(e,i,n){this.commitNewFile(e,U.DIRECTORY,i,n,Le("{}"))}readdirSync(e,i){let n=this.store.beginTransaction(),r=this.findINode(n,e);if(!r.toStats().hasAccess(4,i))throw f.With("EACCES",e,"readdir");return Object.keys(this.getDirListing(n,r,e))}syncSync(e,i,n){let r=this.store.beginTransaction(),o=this._findINode(r,x(e),O(e)),a=this.getINode(r,o,e),l=a.update(n);try{r.put(a.ino,i,!0),l&&r.put(o,a.data,!0)}catch(c){throw r.abort(),c}r.commit()}linkSync(e,i,n){let r=this.store.beginTransaction(),o=x(e);if(!this.findINode(r,o).toStats().hasAccess(4,n))throw f.With("EACCES",o,"link");let l=x(i),c=this.findINode(r,l),u=this.getDirListing(r,c,l);if(!c.toStats().hasAccess(2,n))throw f.With("EACCES",l,"link");let d=this._findINode(r,o,O(e)),h=this.getINode(r,d,e);if(!h.toStats().hasAccess(2,n))throw f.With("EACCES",i,"link");h.nlink++,u[O(i)]=d;try{r.put(d,h.data,!0),r.put(c.ino,le(u),!0)}catch(m){throw r.abort(),m}r.commit()}makeRootDirectory(){let e=this.store.beginTransaction();if(e.get(ye))return;let i=new pe;i.mode=511|U.DIRECTORY,e.put(i.ino,Le("{}"),!1),e.put(ye,i.data,!1),e.commit()}_findINode(e,i,n,r=new Set){let o=C(i,n);if(r.has(o))throw new f(5,"Infinite loop detected while finding inode",o);if(r.add(o),i!="/"){let a=this._findINode(e,x(i),O(i),r),l=this.getDirListing(e,this.getINode(e,a,i+Bs+n),i);if(!(n in l))throw f.With("ENOENT",Ee(i,n),"_findINode");return l[n]}if(n!=""){let a=this.getDirListing(e,this.getINode(e,ye,i),i);if(!(n in a))throw f.With("ENOENT",Ee(i,n),"_findINode");return a[n]}return ye}findINode(e,i){let n=this._findINode(e,x(i),O(i));return this.getINode(e,n,i)}getINode(e,i,n){let r=e.get(i);if(!r)throw f.With("ENOENT",n,"getINode");return new pe(r.buffer)}getDirListing(e,i,n){if(!i.toStats().isDirectory())throw f.With("ENOTDIR",n,"getDirListing");let r=e.get(i.ino);if(!r)throw f.With("ENOENT",n,"getDirListing");return Ci(r)}addNewNode(e,i,n=5){for(let r=0;r<n;r++){let o=Zt();if(e.put(o,i,!1))return o}throw new f(5,"Unable to commit data to key-value store.")}commitNewFile(e,i,n,r,o=new Uint8Array){let a=this.store.beginTransaction(),l=x(e),c=O(e),u=this.findINode(a,l),d=this.getDirListing(a,u,l);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",e,"commitNewFile");if(e==="/")throw f.With("EEXIST",e,"commitNewFile");if(d[c])throw f.With("EEXIST",e,"commitNewFile");let h=new pe;try{h.ino=this.addNewNode(a,o),h.size=o.length,h.mode=n|i,h.uid=r.uid,h.gid=r.gid,d[c]=this.addNewNode(a,h.data),a.put(u.ino,le(d),!0)}catch(m){throw a.abort(),m}return a.commit(),h}removeEntry(e,i,n){let r=this.store.beginTransaction(),o=x(e),a=this.findINode(r,o),l=this.getDirListing(r,a,o),c=O(e),u=l[c];if(!u)throw f.With("ENOENT",e,"removeEntry");let d=this.getINode(r,u,e);if(!d.toStats().hasAccess(2,n))throw f.With("EACCES",e,"removeEntry");if(delete l[c],!i&&d.toStats().isDirectory())throw f.With("EISDIR",e,"removeEntry");if(i&&!d.toStats().isDirectory())throw f.With("ENOTDIR",e,"removeEntry");try{r.put(a.ino,le(l),!0),--d.nlink<1&&(r.remove(d.ino),r.remove(u))}catch(h){throw r.abort(),h}r.commit()}};s(ti,"SyncStoreFS");var ji=class{constructor(e="tmp"){this.name=e}store=new Map;clear(){this.store.clear()}beginTransaction(){return new ei(this)}get(e){return this.store.get(e)}put(e,i,n){return!n&&this.store.has(e)?!1:(this.store.set(e,i),!0)}remove(e){this.store.delete(e)}};s(ji,"InMemoryStore");var $i={name:"InMemory",isAvailable(){return!0},options:{name:{type:"string",required:!1,description:"The name of the store"}},create({name:t}){return new ti({store:new ji(t)})}};var Nn=class{constructor(e){this.limit=e}cache=[];set(e,i){let n=this.cache.findIndex(r=>r.key===e);n!=-1?this.cache.splice(n,1):this.cache.length>=this.limit&&this.cache.shift(),this.cache.push({key:e,value:i})}get(e){let i=this.cache.find(n=>n.key===e);if(i)return this.set(e,i.value),i.value}remove(e){let i=this.cache.findIndex(n=>n.key===e);i!==-1&&this.cache.splice(i,1)}reset(){this.cache=[]}};s(Nn,"LRUCache");var In=class extends jr(ie){constructor(i){super();this._options=i}store;_cache;_sync;async ready(){return this._options.lruCacheSize>0&&(this._cache=new Nn(this._options.lruCacheSize)),this.store=await this._options.store,this._sync=this._options.sync||$i.create({name:"test"}),await this.makeRootDirectory(),await super.ready(),this}metadata(){return{...super.metadata(),name:this.store.name}}async empty(){this._cache&&this._cache.reset(),await this.store.clear(),await this.makeRootDirectory()}async rename(i,n,r){let o=this._cache;this._cache&&(this._cache=null,o.reset());try{let a=this.store.beginTransaction(),l=x(i),c=O(i),u=x(n),d=O(n),h=await this.findINode(a,l),m=await this.getDirListing(a,h,l);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"rename");if(!m[c])throw f.With("ENOENT",i,"rename");let b=m[c];if(delete m[c],(u+"/").indexOf(i+"/")===0)throw new f(16,l);let w,g;if(u===l?(w=h,g=m):(w=await this.findINode(a,u),g=await this.getDirListing(a,w,u)),g[d]){let N=await this.getINode(a,g[d],n);if(N.toStats().isFile())try{await a.remove(N.ino),await a.remove(g[d])}catch(S){throw await a.abort(),S}else throw f.With("EPERM",n,"rename")}g[d]=b;try{await a.put(h.ino,le(m),!0),await a.put(w.ino,le(g),!0)}catch(N){throw await a.abort(),N}await a.commit()}finally{o&&(this._cache=o)}}async stat(i,n){let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o)throw f.With("ENOENT",i,"stat");let a=o.toStats();if(!a.hasAccess(4,n))throw f.With("EACCES",i,"stat");return a}async createFile(i,n,r,o){let a=this.store.beginTransaction(),l=new Uint8Array(0),c=await this.commitNewFile(a,i,U.FILE,r,o,l);return new te(this,i,n,c.toStats(),l)}async openFile(i,n,r){let o=this.store.beginTransaction(),a=await this.findINode(o,i),l=await o.get(a.ino);if(!a.toStats().hasAccess(dt(n),r))throw f.With("EACCES",i,"openFile");if(!l)throw f.With("ENOENT",i,"openFile");return new te(this,i,n,a.toStats(),l)}async unlink(i,n){return this.removeEntry(i,!1,n)}async rmdir(i,n){if((await this.readdir(i,n)).length>0)throw f.With("ENOTEMPTY",i,"rmdir");await this.removeEntry(i,!0,n)}async mkdir(i,n,r){let o=this.store.beginTransaction(),a=Le("{}");await this.commitNewFile(o,i,U.DIRECTORY,n,r,a)}async readdir(i,n){let r=this.store.beginTransaction(),o=await this.findINode(r,i);if(!o.toStats().hasAccess(4,n))throw f.With("EACCES",i,"readdur");return Object.keys(await this.getDirListing(r,o,i))}async sync(i,n,r){let o=this.store.beginTransaction(),a=await this._findINode(o,x(i),O(i)),l=await this.getINode(o,a,i),c=l.update(r);try{await o.put(l.ino,n,!0),c&&await o.put(a,l.data,!0)}catch(u){throw await o.abort(),u}await o.commit()}async link(i,n,r){let o=this.store.beginTransaction(),a=x(i);if(!(await this.findINode(o,a)).toStats().hasAccess(4,r))throw f.With("EACCES",a,"link");let c=x(n),u=await this.findINode(o,c),d=await this.getDirListing(o,u,c);if(!u.toStats().hasAccess(2,r))throw f.With("EACCES",c,"link");let h=await this._findINode(o,a,O(i)),m=await this.getINode(o,h,i);if(!m.toStats().hasAccess(2,r))throw f.With("EACCES",n,"link");m.nlink++,d[O(n)]=h;try{o.put(h,m.data,!0),o.put(u.ino,le(d),!0)}catch(b){throw o.abort(),b}o.commit()}async makeRootDirectory(){let i=this.store.beginTransaction();if(await i.get(ye)===void 0){let n=new pe;n.mode=511|U.DIRECTORY,await i.put(n.ino,Le("{}"),!1),await i.put(ye,n.data,!1),await i.commit()}}async _findINode(i,n,r,o=new Set){let a=C(n,r);if(o.has(a))throw new f(5,"Infinite loop detected while finding inode",a);if(o.add(a),this._cache){let l=this._cache.get(a);if(l)return l}if(n==="/"){if(r==="")return this._cache&&this._cache.set(a,ye),ye;{let l=await this.getINode(i,ye,n),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Ee(n,r),"_findINode")}}else{let l=await this.findINode(i,n,o),c=await this.getDirListing(i,l,n);if(c[r]){let u=c[r];return this._cache&&this._cache.set(a,u),u}else throw f.With("ENOENT",Ee(n,r),"_findINode")}}async findINode(i,n,r=new Set){let o=await this._findINode(i,x(n),O(n),r);return this.getINode(i,o,n)}async getINode(i,n,r){let o=await i.get(n);if(!o)throw f.With("ENOENT",r,"getINode");return new pe(o.buffer)}async getDirListing(i,n,r){if(!n.toStats().isDirectory())throw f.With("ENOTDIR",r,"getDirListing");let o=await i.get(n.ino);if(!o)throw f.With("ENOENT",r,"getDirListing");return Ci(o)}async addNewNode(i,n,r=5){if(r<=0)throw new f(5,"Unable to commit data to key-value store.");let o=Zt();return await i.put(o,n,!1)?o:await this.addNewNode(i,n,--r)}async commitNewFile(i,n,r,o,a,l){let c=x(n),u=O(n),d=await this.findINode(i,c),h=await this.getDirListing(i,d,c);if(!d.toStats().hasAccess(2,a))throw f.With("EACCES",n,"commitNewFile");if(n==="/")throw f.With("EEXIST",n,"commitNewFile");if(h[u])throw await i.abort(),f.With("EEXIST",n,"commitNewFile");try{let m=new pe;return m.ino=await this.addNewNode(i,l),m.mode=o|r,m.uid=a.uid,m.gid=a.gid,m.size=l.length,h[u]=await this.addNewNode(i,m.data),await i.put(d.ino,le(h),!0),await i.commit(),m}catch(m){throw i.abort(),m}}async removeEntry(i,n,r){this._cache&&this._cache.remove(i);let o=this.store.beginTransaction(),a=x(i),l=await this.findINode(o,a),c=await this.getDirListing(o,l,a),u=O(i);if(!c[u])throw f.With("ENOENT",i,"removeEntry");let d=c[u],h=await this.getINode(o,d,i);if(!h.toStats().hasAccess(2,r))throw f.With("EACCES",i,"removeEntry");if(delete c[u],!n&&h.toStats().isDirectory())throw f.With("EISDIR",i,"removeEntry");if(n&&!h.toStats().isDirectory())throw f.With("ENOTDIR",i,"removeEntry");try{await o.put(l.ino,le(c),!0),--h.nlink<1&&(await o.remove(h.ino),await o.remove(d))}catch(m){throw await o.abort(),m}await o.commit()}};s(In,"AsyncStoreFS");var ii=class{_locks=new Map;lock(e){return new Promise(i=>{this._locks.has(e)?this._locks.get(e).push(i):this._locks.set(e,[])})}unlock(e){if(!this._locks.has(e))throw new Error("unlock of a non-locked mutex");let i=this._locks.get(e).shift();if(i){setTimeout(i,0);return}this._locks.delete(e)}tryLock(e){return this._locks.has(e)?!1:(this._locks.set(e,[]),!0)}isLocked(e){return this._locks.has(e)}};s(ii,"Mutex");var ni=class{constructor(e){this.fs=e}_mu=new ii;async ready(){return await this.fs.ready(),this}metadata(){return{...this.fs.metadata(),name:"Locked<"+this.fs.metadata().name+">"}}async rename(e,i,n){await this._mu.lock(e),await this.fs.rename(e,i,n),this._mu.unlock(e)}renameSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.renameSync(e,i,n)}async stat(e,i){await this._mu.lock(e);let n=await this.fs.stat(e,i);return this._mu.unlock(e),n}statSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.statSync(e,i)}async openFile(e,i,n){await this._mu.lock(e);let r=await this.fs.openFile(e,i,n);return this._mu.unlock(e),r}openFileSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.openFileSync(e,i,n)}async createFile(e,i,n,r){await this._mu.lock(e);let o=await this.fs.createFile(e,i,n,r);return this._mu.unlock(e),o}createFileSync(e,i,n,r){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.createFileSync(e,i,n,r)}async unlink(e,i){await this._mu.lock(e),await this.fs.unlink(e,i),this._mu.unlock(e)}unlinkSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.unlinkSync(e,i)}async rmdir(e,i){await this._mu.lock(e),await this.fs.rmdir(e,i),this._mu.unlock(e)}rmdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.rmdirSync(e,i)}async mkdir(e,i,n){await this._mu.lock(e),await this.fs.mkdir(e,i,n),this._mu.unlock(e)}mkdirSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.mkdirSync(e,i,n)}async readdir(e,i){await this._mu.lock(e);let n=await this.fs.readdir(e,i);return this._mu.unlock(e),n}readdirSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.readdirSync(e,i)}async exists(e,i){await this._mu.lock(e);let n=await this.fs.exists(e,i);return this._mu.unlock(e),n}existsSync(e,i){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.existsSync(e,i)}async link(e,i,n){await this._mu.lock(e),await this.fs.link(e,i,n),this._mu.unlock(e)}linkSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.linkSync(e,i,n)}async sync(e,i,n){await this._mu.lock(e),await this.fs.sync(e,i,n),this._mu.unlock(e)}syncSync(e,i,n){if(this._mu.isLocked(e))throw new Error("invalid sync call");return this.fs.syncSync(e,i,n)}};s(ni,"LockedFS");var Vr="/.deleted",Vi=class extends ie{async ready(){return await this._readable.ready(),await this._writable.ready(),await this._ready,this}_writable;_readable;_isInitialized=!1;_deletedFiles=new Set;_deleteLog="";_deleteLogUpdatePending=!1;_deleteLogUpdateNeeded=!1;_deleteLogError;_ready;constructor({writable:e,readable:i}){if(super(),this._writable=e,this._readable=i,this._writable.metadata().readonly)throw new f(22,"Writable file system must be writable.");this._ready=this._initialize()}metadata(){return{...super.metadata(),name:ri.name}}getOverlayedFileSystems(){return{readable:this._readable,writable:this._writable}}async sync(e,i,n){let r=n.cred(0,0);await this.createParentDirectories(e,r),await this._writable.sync(e,i,n)}syncSync(e,i,n){let r=n.cred(0,0);this.createParentDirectoriesSync(e,r),this._writable.syncSync(e,i,n)}async _initialize(){if(!this._isInitialized){try{let e=await this._writable.openFile(Vr,R("r"),ve),{size:i}=await e.stat(),{buffer:n}=await e.read(new Uint8Array(i));this._deleteLog=_n(n)}catch(e){if(e.errno!==2)throw e}this._isInitialized=!0,this._reparseDeletionLog()}}getDeletionLog(){return this._deleteLog}restoreDeletionLog(e,i){this._deleteLog=e,this._reparseDeletionLog(),this.updateLog("",i)}async rename(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{await this._writable.rename(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}renameSync(e,i,n){this.checkInitialized(),this.checkPath(e),this.checkPath(i);try{this._writable.renameSync(e,i,n)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"rename")}}async stat(e,i){this.checkInitialized();try{return this._writable.stat(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let r=new W(await this._readable.stat(e,i));return r.mode|=146,r}}statSync(e,i){this.checkInitialized();try{return this._writable.statSync(e,i)}catch{if(this._deletedFiles.has(e))throw f.With("ENOENT",e,"stat");let r=new W(this._readable.statSync(e,i));return r.mode|=146,r}}async openFile(e,i,n){if(await this._writable.exists(e,n))return this._writable.openFile(e,i,n);let r=await this._readable.openFile(e,R("r"),n),o=new W(await r.stat()),{buffer:a}=await r.read(new Uint8Array(o.size));return new te(this,e,i,o,a)}openFileSync(e,i,n){if(this._writable.existsSync(e,n))return this._writable.openFileSync(e,i,n);let r=this._readable.openFileSync(e,R("r"),n),o=W.clone(r.statSync()),a=new Uint8Array(o.size);return r.readSync(a),new te(this,e,i,o,a)}async createFile(e,i,n,r){return this.checkInitialized(),await this._writable.createFile(e,i,n,r),this.openFile(e,i,r)}createFileSync(e,i,n,r){return this.checkInitialized(),this._writable.createFileSync(e,i,n,r),this.openFileSync(e,i,r)}async link(e,i,n){this.checkInitialized(),await this._writable.link(e,i,n)}linkSync(e,i,n){this.checkInitialized(),this._writable.linkSync(e,i,n)}async unlink(e,i){if(this.checkInitialized(),this.checkPath(e),!await this.exists(e,i))throw f.With("ENOENT",e,"unlink");await this._writable.exists(e,i)&&await this._writable.unlink(e,i),await this.exists(e,i)&&this.deletePath(e,i)}unlinkSync(e,i){if(this.checkInitialized(),this.checkPath(e),!this.existsSync(e,i))throw f.With("ENOENT",e,"unlink");this._writable.existsSync(e,i)&&this._writable.unlinkSync(e,i),this.existsSync(e,i)&&this.deletePath(e,i)}async rmdir(e,i){if(this.checkInitialized(),!await this.exists(e,i))throw f.With("ENOENT",e,"rmdir");if(await this._writable.exists(e,i)&&await this._writable.rmdir(e,i),await this.exists(e,i)){if((await this.readdir(e,i)).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}rmdirSync(e,i){if(this.checkInitialized(),!this.existsSync(e,i))throw f.With("ENOENT",e,"rmdir");if(this._writable.existsSync(e,i)&&this._writable.rmdirSync(e,i),this.existsSync(e,i)){if(this.readdirSync(e,i).length>0)throw f.With("ENOTEMPTY",e,"rmdir");this.deletePath(e,i)}}async mkdir(e,i,n){if(this.checkInitialized(),await this.exists(e,n))throw f.With("EEXIST",e,"mkdir");await this.createParentDirectories(e,n),await this._writable.mkdir(e,i,n)}mkdirSync(e,i,n){if(this.checkInitialized(),this.existsSync(e,n))throw f.With("EEXIST",e,"mkdir");this.createParentDirectoriesSync(e,n),this._writable.mkdirSync(e,i,n)}async readdir(e,i){if(this.checkInitialized(),!(await this.stat(e,i)).isDirectory())throw f.With("ENOTDIR",e,"readdir");let r=[];try{r.push(...await this._writable.readdir(e,i))}catch{}try{r.push(...(await this._readable.readdir(e,i)).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}readdirSync(e,i){if(this.checkInitialized(),!this.statSync(e,i).isDirectory())throw f.With("ENOTDIR",e,"readdir");let r=[];try{r=r.concat(this._writable.readdirSync(e,i))}catch{}try{r=r.concat(this._readable.readdirSync(e,i).filter(a=>!this._deletedFiles.has(`${e}/${a}`)))}catch{}let o={};return r.filter(a=>{let l=!o[a];return o[a]=!0,l})}deletePath(e,i){this._deletedFiles.add(e),this.updateLog(`d${e}
|
|
3
|
+
`,i)}async updateLog(e,i){if(this._deleteLog+=e,this._deleteLogUpdatePending){this._deleteLogUpdateNeeded=!0;return}this._deleteLogUpdatePending=!0;let n=await this._writable.openFile(Vr,R("w"),i);try{await n.write(Le(this._deleteLog)),this._deleteLogUpdateNeeded&&(this._deleteLogUpdateNeeded=!1,this.updateLog("",i))}catch(r){this._deleteLogError=r}finally{this._deleteLogUpdatePending=!1}}_reparseDeletionLog(){this._deletedFiles.clear();for(let e of this._deleteLog.split(`
|
|
4
|
+
`))e.startsWith("d")&&this._deletedFiles.add(e.slice(1))}checkInitialized(){if(!this._isInitialized)throw new f(1,"OverlayFS is not initialized. Please initialize OverlayFS using its initialize() method before using it.");if(!this._deleteLogError)return;let e=this._deleteLogError;throw this._deleteLogError=null,e}checkPath(e){if(e==Vr)throw f.With("EPERM",e,"checkPath")}createParentDirectoriesSync(e,i){let n=x(e),r=[];for(;!this._writable.existsSync(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r)this._writable.mkdirSync(o,this.statSync(o,i).mode,i)}async createParentDirectories(e,i){let n=x(e),r=[];for(;!await this._writable.exists(n,i);)r.push(n),n=x(n);r=r.reverse();for(let o of r){let a=await this.stat(o,i);await this._writable.mkdir(o,a.mode,i)}}operateOnWritable(e,i){if(!this.existsSync(e,i))throw f.With("ENOENT",e,"operateOnWriteable");this._writable.existsSync(e,i)||this.copyToWritableSync(e,i)}async operateOnWritableAsync(e,i){if(!await this.exists(e,i))throw f.With("ENOENT",e,"operateOnWritable");if(!await this._writable.exists(e,i))return this.copyToWritable(e,i)}copyToWritableSync(e,i){let n=this.statSync(e,i);if(n.isDirectory()){this._writable.mkdirSync(e,n.mode,i);return}let r=new Uint8Array(n.size),o=this._readable.openFileSync(e,R("r"),i);o.readSync(r),o.closeSync();let a=this._writable.openFileSync(e,R("w"),i);a.writeSync(r),a.closeSync()}async copyToWritable(e,i){let n=await this.stat(e,i);if(n.isDirectory()){await this._writable.mkdir(e,n.mode,i);return}let r=new Uint8Array(n.size),o=await this._readable.openFile(e,R("r"),i);await o.read(r),await o.close();let a=await this._writable.openFile(e,R("w"),i);await a.write(r),await a.close()}};s(Vi,"UnlockedOverlayFS");var ri=class extends ni{async ready(){return await super.ready(),this}constructor(e){super(new Vi(e))}getOverlayedFileSystems(){return super.fs.getOverlayedFileSystems()}getDeletionLog(){return super.fs.getDeletionLog()}resDeletionLog(){return super.fs.getDeletionLog()}unwrap(){return super.fs}};s(ri,"OverlayFS");var Ed={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(){return!0},create(t){return new ri(t)}};var mn={};gn(mn,{BigIntStats:()=>Y,Dir:()=>Ze,Dirent:()=>Qe,ReadStream:()=>at,Stats:()=>W,StatsFs:()=>Qt,WriteStream:()=>lt,access:()=>vf,accessSync:()=>Fa,appendFile:()=>Zu,appendFileSync:()=>ya,chmod:()=>wf,chmodSync:()=>ka,chown:()=>bf,chownSync:()=>xa,close:()=>tf,closeSync:()=>Je,constants:()=>It,copyFile:()=>Of,copyFileSync:()=>ao,cp:()=>Df,cpSync:()=>lo,createReadStream:()=>Ff,createWriteStream:()=>Af,exists:()=>zu,existsSync:()=>fi,fchmod:()=>cf,fchmodSync:()=>Cn,fchown:()=>lf,fchownSync:()=>Pn,fdatasync:()=>of,fdatasyncSync:()=>ga,fstat:()=>ef,fstatSync:()=>ma,fsync:()=>rf,fsyncSync:()=>ba,ftruncate:()=>nf,ftruncateSync:()=>io,futimes:()=>uf,futimesSync:()=>Dn,lchmod:()=>Sf,lchmodSync:()=>Na,lchown:()=>gf,lchownSync:()=>va,link:()=>pf,linkSync:()=>_a,lopenSync:()=>Yi,lstat:()=>Ku,lstatSync:()=>to,lutimes:()=>Ef,lutimesSync:()=>Ia,mkdir:()=>df,mkdirSync:()=>Bn,mkdtemp:()=>Tf,mkdtempSync:()=>Aa,mount:()=>Hi,mountMapping:()=>Ki,mounts:()=>ge,open:()=>Xu,openSync:()=>hi,opendir:()=>Cf,opendirSync:()=>Oa,promises:()=>yn,read:()=>af,readFile:()=>Ju,readFileSync:()=>Rn,readSync:()=>Sa,readdir:()=>hf,readdirSync:()=>pi,readlink:()=>mf,readlinkSync:()=>ro,readv:()=>Rf,readvSync:()=>La,realpath:()=>xf,realpathSync:()=>ui,rename:()=>Vu,renameSync:()=>da,rm:()=>Lf,rmSync:()=>so,rmdir:()=>ff,rmdirSync:()=>no,stat:()=>Hu,statSync:()=>Gi,statfs:()=>Bf,statfsSync:()=>Ra,symlink:()=>yf,symlinkSync:()=>Ea,truncate:()=>Gu,truncateSync:()=>ha,umount:()=>Tn,unlink:()=>Yu,unlinkSync:()=>On,unwatchFile:()=>Nf,utimes:()=>_f,utimesSync:()=>oo,watch:()=>If,watchFile:()=>kf,write:()=>sf,writeFile:()=>Qu,writeFileSync:()=>Xi,writeSync:()=>wa,writev:()=>Pf,writevSync:()=>Ta});var yn={};gn(yn,{FileHandle:()=>re,access:()=>Ls,appendFile:()=>Es,chmod:()=>Is,chown:()=>ks,constants:()=>It,copyFile:()=>Fr,cp:()=>Ar,exists:()=>Ht,lchmod:()=>Fs,lchown:()=>Ns,link:()=>xs,lopen:()=>xr,lstat:()=>Er,lutimes:()=>As,mkdir:()=>pn,mkdtemp:()=>Ts,open:()=>Ae,openAsBlob:()=>Tg,opendir:()=>Os,readFile:()=>hn,readdir:()=>Ot,readlink:()=>kr,realpath:()=>zt,rename:()=>Ss,rm:()=>Ir,rmdir:()=>vr,stat:()=>Li,statfs:()=>Rs,symlink:()=>vs,truncate:()=>_s,unlink:()=>fn,utimes:()=>Nr,watch:()=>Lg,writeFile:()=>Ti});var ct=Rr(ke(),1);var mt=Rr(ke(),1);var v=ve;function fa(t){v=t}s(fa,"setCred");var Tt=new Map,th=100;function ci(t){let e=th++;return Tt.set(e,t),e}s(ci,"getFdForFile");function V(t){if(!Tt.has(t))throw new f(9);return Tt.get(t)}s(V,"fd2file");var ge=new Map;Hi("/",$i.create({name:"root"}));function Hi(t,e){if(t[0]!=="/"&&(t="/"+t),t=Ee(t),ge.has(t))throw new f(22,"Mount point "+t+" is already in use.");ge.set(t,e)}s(Hi,"mount");function Tn(t){if(t[0]!=="/"&&(t=`/${t}`),t=Ee(t),!ge.has(t))throw new f(22,"Mount point "+t+" is already unmounted.");ge.delete(t)}s(Tn,"umount");function we(t){t=F(t);let e=[...ge].sort((i,n)=>i[0].length>n[0].length?-1:1);for(let[i,n]of e)if(i.length<=t.length&&t.startsWith(i))return t=t.slice(i.length>1?i.length:0),t===""&&(t="/"),{fs:n,path:t,mountPoint:i};throw new f(5,"ZenFS not initialized with a file system")}s(we,"resolveMount");function ua(t,e){for(let[i,n]of Object.entries(e))t=t?.replaceAll(i,n);return t}s(ua,"fixPaths");function yt(t,e){return typeof t.stack=="string"&&(t.stack=ua(t.stack,e)),t.message=ua(t.message,e),t}s(yt,"fixError");function Ki(t){"/"in t&&Tn("/");for(let[e,i]of Object.entries(t))Hi(e,i)}s(Ki,"mountMapping");function ue(...[t,e,i,...n]){i=F(i);let{fs:r,path:o}=we(e&&fi(i)?ui(i):i);try{return r[t](o,...n)}catch(a){throw yt(a,{[o]:i})}}s(ue,"doOp");function da(t,e){t=F(t),e=F(e);let i=we(t),n=we(e),r={[i.path]:t,[n.path]:e};try{if(i===n)return i.fs.renameSync(i.path,n.path,v);Xi(e,Rn(t)),On(t)}catch(o){throw yt(o,r)}}s(da,"renameSync");function fi(t){t=F(t);try{let{fs:e,path:i}=we(ui(t));return e.existsSync(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(fi,"existsSync");function Gi(t,e){let i=ue("statSync",!0,t,v);return e?.bigint?new Y(i):i}s(Gi,"statSync");function to(t,e){let i=ue("statSync",!1,t,v);return e?.bigint?new Y(i):i}s(to,"lstatSync");function ha(t,e=0){let i=hi(t,"r+");try{io(i,e)}finally{Je(i)}}s(ha,"truncateSync");function On(t){return ue("unlinkSync",!1,t,v)}s(On,"unlinkSync");function di(t,e,i,n){let r=F(t),o=de(i,420),a=R(e),l;try{l=ue("statSync",n,r,v)}catch{switch(qi(a)){case 3:if(!ue("statSync",n,x(r),v).isDirectory())throw f.With("ENOTDIR",x(r),"_open");return ue("createFileSync",n,r,a,o,v);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid FileFlag object.")}}if(!l.hasAccess(o,v))throw f.With("EACCES",r,"_open");switch(Ui(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:return ue("unlinkSync",n,r,v),ue("createFileSync",n,r,a,l.mode,v);case 0:return ue("openFileSync",n,r,a,v);default:throw new f(22,"Invalid FileFlag object.")}}s(di,"_openSync");function hi(t,e,i){return ci(di(t,e,i,!0))}s(hi,"openSync");function Yi(t,e,i){return ci(di(t,e,i,!1))}s(Yi,"lopenSync");function pa(t,e,i){let n=di(t,e,420,i);try{let r=n.statSync(),o=new Uint8Array(r.size);return n.readSync(o,0,r.size,0),n.closeSync(),o}finally{n.closeSync()}}s(pa,"_readFileSync");function Rn(t,e={}){let i=he(e,null,"r",420),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed to readFile must allow for reading.");let r=mt.Buffer.from(pa(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(Rn,"readFileSync");function ih(t,e,i,n,r){let o=di(t,i,n,r);try{o.writeSync(e,0,e.length,0)}finally{o.closeSync()}}s(ih,"_writeFileSync");function Xi(t,e,i){let n=he(i,"utf8","w+",420),r=R(n.flag);if(!me(r))throw new f(22,"Flag passed to writeFile must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):e;if(o===void 0)throw new f(22,"Data not specified");ih(t,o,n.flag,n.mode,!0)}s(Xi,"writeFileSync");function nh(t,e,i,n,r){let o=di(t,i,n,r);try{o.writeSync(e,0,e.length,null)}finally{o.closeSync()}}s(nh,"_appendFileSync");function ya(t,e,i){let n=he(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?mt.Buffer.from(e,n.encoding):e;nh(t,o,n.flag,n.mode,!0)}s(ya,"appendFileSync");function ma(t,e){let i=V(t).statSync();return e?.bigint?new Y(i):i}s(ma,"fstatSync");function Je(t){V(t).closeSync(),Tt.delete(t)}s(Je,"closeSync");function io(t,e=0){if(e<0)throw new f(22);V(t).truncateSync(e)}s(io,"ftruncateSync");function ba(t){V(t).syncSync()}s(ba,"fsyncSync");function ga(t){V(t).datasyncSync()}s(ga,"fdatasyncSync");function wa(t,e,i,n,r){let o,a=0,l,c;if(typeof e=="string"){c=typeof i=="number"?i:null;let d=typeof n=="string"?n:"utf8";a=0,o=mt.Buffer.from(e,d),l=o.length}else o=e,a=i,l=n,c=typeof r=="number"?r:null;let u=V(t);return c==null&&(c=u.position),u.writeSync(o,a,l,c)}s(wa,"writeSync");function Sa(t,e,i,n,r){let o=V(t),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(e,a,n,r)}s(Sa,"readSync");function Pn(t,e,i){V(t).chownSync(e,i)}s(Pn,"fchownSync");function Cn(t,e){let i=de(e,-1);if(i<0)throw new f(22,"Invalid mode.");V(t).chmodSync(i)}s(Cn,"fchmodSync");function Dn(t,e,i){V(t).utimesSync(Et(e),Et(i))}s(Dn,"futimesSync");function no(t){return ue("rmdirSync",!0,t,v)}s(no,"rmdirSync");function Bn(t,e){let i=typeof e=="number"||typeof e=="string"?e:e?.mode,n=typeof e=="object"&&e?.recursive;ue("mkdirSync",!0,t,de(i,511),v)}s(Bn,"mkdirSync");function pi(t,e){t=F(t);let i=ue("readdirSync",!0,t,v);for(let n of ge.keys()){if(!n.startsWith(t))continue;let r=n.slice(t.length);r.includes("/")||r.length==0||i.push(r)}return i.map(n=>typeof e=="object"&&e?.withFileTypes?new Qe(n,Gi(C(t,n))):e=="buffer"||typeof e=="object"&&e.encoding=="buffer"?mt.Buffer.from(n):n)}s(pi,"readdirSync");function _a(t,e){return e=F(e),ue("linkSync",!1,t,e,v)}s(_a,"linkSync");function Ea(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid type: "+i);if(fi(e))throw f.With("EEXIST",e,"symlink");Xi(e,t),di(e,"r+",420,!1)._setTypeSync(U.SYMLINK)}s(Ea,"symlinkSync");function ro(t,e){let i=mt.Buffer.from(pa(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(ro,"readlinkSync");function xa(t,e,i){let n=hi(t,"r+");Pn(n,e,i),Je(n)}s(xa,"chownSync");function va(t,e,i){let n=Yi(t,"r+");Pn(n,e,i),Je(n)}s(va,"lchownSync");function ka(t,e){let i=hi(t,"r+");Cn(i,e),Je(i)}s(ka,"chmodSync");function Na(t,e){let i=Yi(t,"r+");Cn(i,e),Je(i)}s(Na,"lchmodSync");function oo(t,e,i){let n=hi(t,"r+");Dn(n,e,i),Je(n)}s(oo,"utimesSync");function Ia(t,e,i){let n=Yi(t,"r+");Dn(n,e,i),Je(n)}s(Ia,"lutimesSync");function ui(t,e){t=F(t);let{base:i,dir:n}=wn(t),r=C(n=="/"?"/":ui(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return o.statSync(a,v).isSymbolicLink()?ui(l+ro(r)):r}catch(c){throw yt(c,{[a]:r})}}s(ui,"realpathSync");function Fa(t,e=384){if(!Gi(t).hasAccess(e,v))throw new f(13)}s(Fa,"accessSync");function so(t,e){switch(t=F(t),Gi(t).mode&61440){case 16384:if(e?.recursive)for(let n of pi(t))so(C(t,n));no(t);return;case 32768:case 40960:On(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(so,"rmSync");function Aa(t,e){let i=typeof e=="object"?e.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return Bn(r),i=="buffer"?mt.Buffer.from(r):r}s(Aa,"mkdtempSync");function ao(t,e,i){if(t=F(t),e=F(e),i&&i&1&&fi(e))throw new f(17,"Destination file already exists.",e,"copyFile");Xi(e,Rn(t))}s(ao,"copyFileSync");function La(t,e,i){let n=V(t),r=0;for(let o of e)r+=n.readSync(o,0,o.length,i+r);return r}s(La,"readvSync");function Ta(t,e,i){let n=V(t),r=0;for(let o of e)r+=n.writeSync(o,0,o.length,i+r);return r}s(Ta,"writevSync");function Oa(t,e){return t=F(t),new Ze(t)}s(Oa,"opendirSync");function lo(t,e,i){t=F(t),e=F(e);let n=to(t);if(i?.errorOnExist&&fi(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");Bn(e,{recursive:!0});for(let r of pi(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||lo(C(t,r.name),C(e,r.name),i);break;case 32768:case 40960:ao(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&oo(e,n.atime,n.mtime)}s(lo,"cpSync");function Ra(t,e){throw f.With("ENOSYS",t,"statfs")}s(Ra,"statfsSync");var Qe=class{constructor(e,i){this.path=e;this.stats=i}get name(){return O(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(Qe,"Dirent");var Ze=class{constructor(e){this.path=e}closed=!1;checkClosed(){if(this.closed)throw new f(9,"Can not use closed Dir")}_entries;close(e){if(this.closed=!0,!e)return Promise.resolve();e()}closeSync(){this.closed=!0}async _read(){return this._entries||(this._entries=await Ot(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}read(e){if(!e)return this._read();this._read().then(i=>e(null,i))}readSync(){return this._entries||(this._entries=pi(this.path,{withFileTypes:!0})),this._entries.length==0?null:this._entries.shift()}[Symbol.asyncIterator](){let e=this;return{[Symbol.asyncIterator]:this[Symbol.asyncIterator],async next(){let i=await e._read();return i!=null?{done:!1,value:i}:(await e.close(),{done:!0,value:void 0})}}}};s(Ze,"Dir");var _r=Rr(ju(),1);var at=class extends _r.Readable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesRead;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(at,"ReadStream");var lt=class extends _r.Writable{close(e=()=>null){try{super.destroy(),super.emit("close"),e()}catch(i){e(i)}}bytesWritten;path;pending;addListener(e,i){return super.addListener(e,i)}on(e,i){return super.on(e,i)}once(e,i){return super.once(e,i)}prependListener(e,i){return super.prependListener(e,i)}prependOnceListener(e,i){return super.prependOnceListener(e,i)}};s(lt,"WriteStream");var re=class{constructor(e){this.fd=e}get file(){return V(this.fd)}chown(e,i){return this.file.chown(e,i)}chmod(e){let i=de(e,-1);if(i<0)throw new f(22,"Invalid mode.");return this.file.chmod(i)}datasync(){return this.file.datasync()}sync(){return this.file.sync()}truncate(e){if(e<0)throw new f(22);return this.file.truncate(e)}utimes(e,i){return this.file.utimes(Et(e),Et(i))}async appendFile(e,i){let n=he(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ct.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,null)}read(e,i,n,r){return isNaN(+r)&&(r=this.file.position),this.file.read(e,i,n,r)}async readFile(e){let i=he(e,null,"r",292),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed must allow for reading.");let{size:r}=await this.stat(),o=new Uint8Array(r);await this.file.read(o,0,r,0);let a=ct.Buffer.from(o);return i.encoding?a.toString(i.encoding):a}readableWebStream(e){let i=s(async({close:n,enqueue:r,error:o})=>{try{let c=0,u=0,d;for(;d.bytesRead>0;){if(d=await this.read(new Uint8Array(65536),0,65536,u),!d.bytesRead){n();return}if(r(d.buffer.slice(0,d.bytesRead)),u+=d.bytesRead,++c>=1e7)throw new f(27,"Too many iterations on readable stream",this.file.path,"FileHandle.readableWebStream")}}catch(a){o(a)}},"start");return new ReadableStream({start:i,type:e.type})}readLines(e){throw f.With("ENOSYS",this.file.path,"FileHandle.readLines")}[Symbol.asyncDispose](){return this.close()}async stat(e){let i=await this.file.stat();return e?.bigint?new Y(i):i}async write(e,i,n,r){let o,a=0,l;if(typeof e=="string"){r=typeof i=="number"?i:null;let u=typeof n=="string"?n:"utf8";a=0,o=ct.Buffer.from(e,u),l=o.length}else o=e,a=i,l=n,r=typeof r=="number"?r:null;r??=this.file.position;let c=await this.file.write(o,a,l,r);return{buffer:o,bytesWritten:c}}async writeFile(e,i){let n=he(i,"utf8","w",420),r=R(n.flag);if(!me(r))throw new f(22,"Flag passed must allow for writing.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ct.Buffer.from(e,n.encoding):e;await this.file.write(o,0,o.length,0)}async close(){await this.file.close(),Tt.delete(this.fd)}async writev(e,i){let n=0;for(let r of e)n+=(await this.write(r,0,r.length,i+n)).bytesWritten;return{bytesWritten:n,buffers:e}}async readv(e,i){let n=0;for(let r of e)n+=(await this.read(r,0,r.byteLength,i+n)).bytesRead;return{bytesRead:n,buffers:e}}createReadStream(e){let i={highWaterMark:e?.highWaterMark||65536,encoding:e?.encoding,read:async r=>{try{let o=await this.read(new Uint8Array(r),0,r,this.file.position);n.push(o.bytesRead?o.buffer.slice(0,o.bytesRead):null),this.file.position+=o.bytesRead}catch(o){n.destroy(o)}}},n=new at(i);return n.path=this.file.path,n}createWriteStream(e){let i={highWaterMark:e?.highWaterMark,encoding:e?.encoding,write:async(r,o,a)=>{try{let{bytesWritten:l}=await this.write(r,null,o);a(l==r.length?null:new Error("Failed to write full chunk"))}catch(l){a(l)}}},n=new lt(i);return n.path=this.file.path,n}};s(re,"FileHandle");async function Fe(...[t,e,i,...n]){i=F(i);let r=e&&await Ht(i)?await zt(i):i,{fs:o,path:a}=we(r);try{return o[t](a,...n)}catch(l){throw yt(l,{[a]:i})}}s(Fe,"doOp");async function Ss(t,e){t=F(t),e=F(e);let i=we(t),n=we(e);try{if(i.mountPoint==n.mountPoint){await i.fs.rename(i.path,n.path,v);return}await Ti(e,await hn(t)),await fn(t)}catch(r){throw yt(r,{[i.path]:t,[n.path]:e})}}s(Ss,"rename");async function Ht(t){try{let{fs:e,path:i}=we(await zt(t));return await e.exists(i,v)}catch(e){if(e.errno==2)return!1;throw e}}s(Ht,"exists");async function Li(t,e){let i=await Fe("stat",!0,t,v);return e?.bigint?new Y(i):i}s(Li,"stat");async function Er(t,e){let i=await Fe("stat",!1,t,v);return e?.bigint?new Y(i):i}s(Er,"lstat");async function _s(t,e=0){let i=await Ae(t,"r+");try{await i.truncate(e)}finally{await i.close()}}s(_s,"truncate");async function fn(t){return Fe("unlink",!1,t,v)}s(fn,"unlink");async function dn(t,e,i=420,n){let r=F(t),o=de(i,420),a=R(e);try{switch(Ui(a)){case 1:throw f.With("EEXIST",r,"_open");case 2:let l=await Fe("openFile",n,r,a,v);if(!l)throw new f(5,"Impossible code path reached");return await l.truncate(0),await l.sync(),l;case 0:return await Fe("openFile",n,r,a,v);default:throw new f(22,"Invalid file flag")}}catch{switch(qi(a)){case 3:let c=await Fe("stat",n,x(r),v);if(c&&!c.isDirectory())throw f.With("ENOTDIR",x(r),"_open");return await Fe("createFile",n,r,a,o,v);case 1:throw f.With("ENOENT",r,"_open");default:throw new f(22,"Invalid file flag")}}}s(dn,"_open");async function Ae(t,e,i=420){let n=await dn(t,e,i,!0);return new re(ci(n))}s(Ae,"open");async function xr(t,e,i=420){let n=await dn(t,e,i,!1);return new re(ci(n))}s(xr,"lopen");async function $u(t,e,i){let n=await dn(F(t),e,420,i);try{let r=await n.stat(),o=new Uint8Array(r.size);return await n.read(o,0,r.size,0),await n.close(),o}catch(r){throw await n.close(),r}}s($u,"_readFile");async function hn(t,e){let i=he(e,null,"r",0),n=R(i.flag);if(!Ye(n))throw new f(22,"Flag passed must allow for reading.");let r=ct.Buffer.from(await $u(t,i.flag,!0));return i.encoding?r.toString(i.encoding):r}s(hn,"readFile");async function Ti(t,e,i){let n=he(i,"utf8","w+",420),r=await Ae(t,n.flag,n.mode);try{await r.writeFile(e,n)}finally{await r.close()}}s(Ti,"writeFile");async function Ag(t,e,i,n,r){let o=await dn(t,i,n,r);try{await o.write(e,0,e.length,null)}finally{await o.close()}}s(Ag,"_appendFile");async function Es(t,e,i){let n=he(i,"utf8","a",420),r=R(n.flag);if(!ht(r))throw new f(22,"Flag passed to appendFile must allow for appending.");if(typeof e!="string"&&!n.encoding)throw new f(22,"Encoding not specified");let o=typeof e=="string"?ct.Buffer.from(e,n.encoding):e;await Ag(t,o,n.flag,n.mode,!0)}s(Es,"appendFile");async function vr(t){return Fe("rmdir",!0,t,v)}s(vr,"rmdir");async function pn(t,e){await Fe("mkdir",!0,t,de(typeof e=="object"?e?.mode:e,511),v)}s(pn,"mkdir");async function Ot(t,e){t=F(t);let i=await Fe("readdir",!0,t,v),n=[...ge.keys()];for(let o of n)if(o.startsWith(t)){let a=o.slice(t.length);if(a.includes("/")||a.length==0)continue;i.push(a)}let r=[];for(let o of i)r.push(typeof e=="object"&&e?.withFileTypes?new Qe(o,await Li(C(t,o))):o);return r}s(Ot,"readdir");async function xs(t,e){return e=F(e),Fe("link",!1,t,e,v)}s(xs,"link");async function vs(t,e,i="file"){if(!["file","dir","junction"].includes(i))throw new f(22,"Invalid symlink type: "+i);if(await Ht(e))throw f.With("EEXIST",e,"symlink");await Ti(e,t),await(await dn(e,"r+",420,!1))._setType(U.SYMLINK)}s(vs,"symlink");async function kr(t,e){let i=ct.Buffer.from(await $u(t,"r",!1)),n=typeof e=="object"?e.encoding:e;return n=="buffer"?i:i.toString(n)}s(kr,"readlink");async function ks(t,e,i){let n=await Ae(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(ks,"chown");async function Ns(t,e,i){let n=await xr(t,"r+");try{await n.chown(e,i)}finally{await n.close()}}s(Ns,"lchown");async function Is(t,e){let i=await Ae(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Is,"chmod");async function Fs(t,e){let i=await xr(t,"r+");try{await i.chmod(e)}finally{await i.close()}}s(Fs,"lchmod");async function Nr(t,e,i){let n=await Ae(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(Nr,"utimes");async function As(t,e,i){let n=await xr(t,"r+");try{await n.utimes(e,i)}finally{await n.close()}}s(As,"lutimes");async function zt(t,e){t=F(t);let{base:i,dir:n}=wn(t),r=C(n=="/"?"/":await zt(n),i),{fs:o,path:a,mountPoint:l}=we(r);try{return(await o.stat(a,v)).isSymbolicLink()?zt(l+await kr(r)):r}catch(c){throw yt(c,{[a]:r})}}s(zt,"realpath");function Lg(t,e){throw f.With("ENOSYS",t,"watch")}s(Lg,"watch");async function Ls(t,e=0){if(!(await Li(t)).hasAccess(e,v))throw new f(13)}s(Ls,"access");async function Ir(t,e){switch(t=F(t),(await Li(t)).mode&61440){case 16384:if(e?.recursive)for(let n of await Ot(t))await Ir(C(t,n));await vr(t);return;case 32768:case 40960:await fn(t);return;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}}s(Ir,"rm");async function Ts(t,e){let i=typeof e=="object"?e.encoding:e||"utf8",r="/tmp/"+`${t}${Date.now()}-${Math.random().toString(36).slice(2)}`;return await pn(r),i=="buffer"?ct.Buffer.from(r):r}s(Ts,"mkdtemp");async function Fr(t,e,i){if(t=F(t),e=F(e),i&&i&1&&await Ht(e))throw new f(17,"Destination file already exists.",e,"copyFile");await Ti(e,await hn(t))}s(Fr,"copyFile");async function Os(t,e){return t=F(t),new Ze(t)}s(Os,"opendir");async function Ar(t,e,i){t=F(t),e=F(e);let n=await Er(t);if(i?.errorOnExist&&await Ht(e))throw new f(17,"Destination file or directory already exists.",e,"cp");switch(n.mode&61440){case 16384:if(!i?.recursive)throw new f(21,t+" is a directory (not copied)",t,"cp");await pn(e,{recursive:!0});for(let r of await Ot(t,{withFileTypes:!0}))i.filter&&!i.filter(C(t,r.name),C(e,r.name))||await Ar(C(t,r.name),C(e,r.name),i);break;case 32768:case 40960:await Fr(t,e);break;case 24576:case 8192:case 4096:case 49152:default:throw new f(1,"File type not supported",t,"rm")}i?.preserveTimestamps&&await Nr(e,n.atime,n.mtime)}s(Ar,"cp");async function Rs(t,e){throw f.With("ENOSYS",t,"statfs")}s(Rs,"statfs");async function Tg(t,e){let i=await Ae(t,"r"),n=await i.readFile();return await i.close(),new Blob([n],e)}s(Tg,"openAsBlob");function Vu(t,e,i=_){Ss(t,e).then(()=>i()).catch(i)}s(Vu,"rename");function zu(t,e=_){Ht(t).then(e).catch(()=>e(!1))}s(zu,"exists");function Hu(t,e,i=_){i=typeof e=="function"?e:i,Li(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Hu,"stat");function Ku(t,e,i=_){i=typeof e=="function"?e:i,Er(t,typeof e!="function"?e:{}).then(n=>i(null,n)).catch(i)}s(Ku,"lstat");function Gu(t,e=0,i=_){i=typeof e=="function"?e:i,_s(t,typeof e=="number"?e:0).then(()=>i()).catch(i)}s(Gu,"truncate");function Yu(t,e=_){fn(t).then(()=>e()).catch(e)}s(Yu,"unlink");function Xu(t,e,i,n=_){let r=de(i,420);n=typeof i=="function"?i:n,Ae(t,e,r).then(o=>n(null,o.fd)).catch(n)}s(Xu,"open");function Ju(t,e,i=_){i=typeof e=="function"?e:i,hn(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Ju,"readFile");function Qu(t,e,i,n=_){n=typeof i=="function"?i:n,Ti(t,e,typeof i!="function"?i:null).then(()=>n(null)).catch(n)}s(Qu,"writeFile");function Zu(t,e,i,n=_){n=typeof i=="function"?i:n,Es(t,e,typeof i=="function"?null:i).then(()=>n()).catch(n)}s(Zu,"appendFile");function ef(t,e,i=_){i=typeof e=="function"?e:i,V(t).stat().then(n=>i(null,typeof e=="object"&&e?.bigint?new Y(n):n)).catch(i)}s(ef,"fstat");function tf(t,e=_){new re(t).close().then(()=>e()).catch(e)}s(tf,"close");function nf(t,e,i=_){let n=typeof e=="number"?e:0;i=typeof e=="function"?e:i;let r=V(t);if(n<0)throw new f(22);r.truncate(n).then(()=>i()).catch(i)}s(nf,"ftruncate");function rf(t,e=_){V(t).sync().then(()=>e()).catch(e)}s(rf,"fsync");function of(t,e=_){V(t).datasync().then(()=>e()).catch(e)}s(of,"fdatasync");function sf(t,e,i,n,r,o=_){let a,l,c,u=null,d,h=new re(t);if(typeof e=="string"){switch(d="utf8",typeof i){case"function":o=i;break;case"number":u=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 f(22,"Invalid arguments."));return}a=Buffer.from(e),l=0,c=a.length;let m=o;h.write(a,l,c,u).then(({bytesWritten:b})=>m(null,b,a.toString(d))).catch(m)}else{a=Buffer.from(e),l=i,c=n,u=typeof r=="number"?r:null;let m=typeof r=="function"?r:o;h.write(a,l,c,u).then(({bytesWritten:b})=>m(null,b,a)).catch(m)}}s(sf,"write");function af(t,e,i,n,r,o=_){new re(t).read(e,i,n,r).then(({bytesRead:a,buffer:l})=>o(null,a,l)).catch(o)}s(af,"read");function lf(t,e,i,n=_){new re(t).chown(e,i).then(()=>n()).catch(n)}s(lf,"fchown");function cf(t,e,i){new re(t).chmod(e).then(()=>i()).catch(i)}s(cf,"fchmod");function uf(t,e,i,n=_){new re(t).utimes(e,i).then(()=>n()).catch(n)}s(uf,"futimes");function ff(t,e=_){vr(t).then(()=>e()).catch(e)}s(ff,"rmdir");function df(t,e,i=_){pn(t,e).then(()=>i()).catch(i)}s(df,"mkdir");function hf(t,e,i=_){i=typeof e=="function"?e:i,Ot(t,typeof e!="function"?e:{}).then(r=>i(null,r)).catch(i)}s(hf,"readdir");function pf(t,e,i=_){xs(t,e).then(()=>i()).catch(i)}s(pf,"link");function yf(t,e,i,n=_){let r=typeof i=="string"?i:"file";n=typeof i=="function"?i:n,vs(t,e,r).then(()=>n()).catch(n)}s(yf,"symlink");function mf(t,e,i=_){i=typeof e=="function"?e:i,kr(t).then(n=>i(null,n)).catch(i)}s(mf,"readlink");function bf(t,e,i,n=_){ks(t,e,i).then(()=>n()).catch(n)}s(bf,"chown");function gf(t,e,i,n=_){Ns(t,e,i).then(()=>n()).catch(n)}s(gf,"lchown");function wf(t,e,i=_){Is(t,e).then(()=>i()).catch(i)}s(wf,"chmod");function Sf(t,e,i=_){Fs(t,e).then(()=>i()).catch(i)}s(Sf,"lchmod");function _f(t,e,i,n=_){Nr(t,e,i).then(()=>n()).catch(n)}s(_f,"utimes");function Ef(t,e,i,n=_){As(t,e,i).then(()=>n()).catch(n)}s(Ef,"lutimes");function xf(t,e,i=_){i=typeof e=="function"?e:i,zt(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(xf,"realpath");function vf(t,e,i=_){let n=typeof e=="number"?e:4;i=typeof e=="function"?e:i,Ls(t,typeof e=="function"?null:e).then(()=>i()).catch(i)}s(vf,"access");function kf(t,e,i=_){throw f.With("ENOSYS",t,"watchFile")}s(kf,"watchFile");function Nf(t,e=_){throw f.With("ENOSYS",t,"unwatchFile")}s(Nf,"unwatchFile");function If(t,e,i=_){throw f.With("ENOSYS",t,"watch")}s(If,"watch");function Ff(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new at({highWaterMark:i.highWaterMark||64*1024,encoding:i.encoding||"utf8",async read(o){try{n||=await Ae(t,"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)}},destroy(o,a){n?.close().then(()=>a(o)).catch(a)}});return r.path=t,r}s(Ff,"createReadStream");function Af(t,e){let i=typeof e=="object"?e:{encoding:e},n,r=new lt({highWaterMark:i?.highWaterMark,async write(o,a,l){try{n||=await Ae(t,"w",i?.mode||438),await n.write(o,null,a),l(null)}catch(c){await n?.close(),l(c)}},destroy(o,a){a(o),n?.close().then(()=>a(o)).catch(a)},final(o){n?.close().then(()=>o()).catch(o)}});return r.path=t,r}s(Af,"createWriteStream");function Lf(t,e,i=_){i=typeof e=="function"?e:i,Ir(t,typeof e=="function"?null:e).then(()=>i(null)).catch(i)}s(Lf,"rm");function Tf(t,e,i=_){i=typeof e=="function"?e:i,Ts(t,typeof e!="function"?e:null).then(n=>i(null,n)).catch(i)}s(Tf,"mkdtemp");function Of(t,e,i,n){n=typeof i=="function"?i:n,Fr(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(Of,"copyFile");function Rf(t,e,i,n=_){n=typeof i=="function"?i:n,new re(t).readv(e,typeof i=="function"?null:i).then(({buffers:r,bytesRead:o})=>n(null,o,r)).catch(n)}s(Rf,"readv");function Pf(t,e,i,n=_){n=typeof i=="function"?i:n,new re(t).writev(e,typeof i=="function"?null:i).then(({buffers:r,bytesWritten:o})=>n(null,o,r)).catch(n)}s(Pf,"writev");function Cf(t,e,i=_){i=typeof e=="function"?e:i,Os(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Cf,"opendir");function Df(t,e,i,n){n=typeof i=="function"?i:n,Ar(t,e,typeof i=="function"?null:i).then(()=>n(null)).catch(n)}s(Df,"cp");function Bf(t,e,i=_){i=typeof e=="function"?e:i,Rs(t,typeof e=="function"?null:e).then(n=>i(null,n)).catch(i)}s(Bf,"statfs");function Ps(t){return Dr(t)||Di(t)||t instanceof ie}s(Ps,"isMountConfig");async function Cs(t,e=0){if(typeof t!="object"||t==null)throw new f(22,"Invalid options on mount configuration");if(!Ps(t))throw new f(22,"Invalid mount configuration");if(t instanceof ie)return t;Di(t)&&(t={backend:t});for(let[r,o]of Object.entries(t))if(r!="backend"&&Ps(o)){if(e>10)throw new f(22,"Invalid configuration, too deep and possibly infinite");t[r]=await Cs(o,++e)}let{backend:i}=t;if(!await i.isAvailable())throw new f(1,"Backend not available: "+i);En(i,t);let n=i.create(t);return await n.ready(),n}s(Cs,"resolveMountConfig");async function Og(t){let e="uid"in t&&+t.uid||0,i="gid"in t&&+t.gid||0;Ps(t)&&(t={"/":t});for(let[n,r]of Object.entries(t))n=="uid"||n=="gid"||typeof r=="number"||(t[n]=await Cs(r));Ki(t),fa({uid:e,gid:i,suid:e,sgid:i,euid:e,egid:i})}s(Og,"configure");var Kt=class{static FromListing(e){let i=new Kt,n=new ut;i._index.set("/",n);let r=[{pwd:"",tree:e,parent:n}];for(;r.length>0;){let o,{tree:a,pwd:l,parent:c}=r.pop();for(let u in a){if(!Object.hasOwn(a,u))continue;let d=a[u];if(d){let h=l+"/"+u;o=new ut,i._index.set(h,o),r.push({pwd:h,tree:d,parent:o})}else o=new bn(new W({mode:U.FILE|365}));c&&c._listing.set(u,o)}}return i}_index=new Map;constructor(){this.add("/",new ut)}files(){let e=[];for(let i of this._index.values())for(let n of i.listing){let r=i.get(n);r?.isFile()&&e.push(r)}return e}add(e,i){if(!i)throw new Error("Inode must be specified");if(!e.startsWith("/"))throw new Error("Path must be absolute, got: "+e);if(this._index.has(e))return this._index.get(e)===i;let n=x(e),r=this._index.get(n);return!r&&e!="/"&&(r=new ut,!this.add(n,r))||e!="/"&&!r.add(O(e),i)?!1:(i.isDirectory()&&this._index.set(e,i),!0)}addFast(e,i){let n=x(e),r=O(e),o=this._index.get(n);return o||(o=new ut,this.addFast(n,o)),o.add(r,i)?(i.isDirectory()&&this._index.set(e,i),!0):!1}remove(e){let i=x(e),n=this._index.get(i);if(!n)return;let r=n.remove(O(e));if(!r)return;if(!r.isDirectory())return r;let o=r.listing;for(let a of o)this.remove(C(e,a));e!="/"&&this._index.delete(e)}ls(e){return this._index.get(e)?.listing}get(e){let i=x(e),n=this._index.get(i);return i==e?n:n?.get(O(e))}};s(Kt,"FileIndex");var Oi=class{constructor(e){this.data=e}};s(Oi,"IndexInode");var bn=class extends Oi{isFile(){return!0}isDirectory(){return!1}toStats(){return new W({mode:U.FILE|438,size:4096})}};s(bn,"IndexFileInode");var ut=class extends Oi{_listing=new Map;isFile(){return!1}isDirectory(){return!0}get stats(){return new W({mode:U.DIRECTORY|365,size:4096})}toStats(){return this.stats}get listing(){return[...this._listing.keys()]}get(e){return this._listing.get(e)}add(e,i){return this._listing.has(e)?!1:(this._listing.set(e,i),!0)}remove(e){let i=this._listing.get(e);if(i)return this._listing.delete(e),i}};s(ut,"IndexDirInode");var Ri=class extends $r(ie){_index;constructor(e){super(),this._index=Kt.FromListing(e)}async stat(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInode(i,e);throw new f(22,"Invalid inode.")}statSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"stat");if(i.isDirectory())return i.stats;if(i.isFile())return this.statFileInodeSync(i,e);throw new f(22,"Invalid inode.")}async openFile(e,i,n){if(me(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ft(this,e,i,o,o.fileData)}return this.openFileInode(r,e,i)}openFileSync(e,i,n){if(me(i))throw new f(1,e);let r=this._index.get(e);if(!r)throw f.With("ENOENT",e,"openFile");if(!r.toStats().hasAccess(dt(i),n))throw f.With("EACCES",e,"openFile");if(r.isDirectory()){let o=r.stats;return new Ft(this,e,i,o,o.fileData)}return this.openFileInodeSync(r,e,i)}async readdir(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}readdirSync(e){let i=this._index.get(e);if(!i)throw f.With("ENOENT",e,"readdir");if(i.isDirectory())return i.listing;throw f.With("ENOTDIR",e,"readdir")}};s(Ri,"IndexFS");var Lr=class extends Ri{async statFileInode(e,i){return this.statFileInodeSync(e,i)}async openFileInode(e,i,n){return this.openFileInodeSync(e,i,n)}};s(Lr,"SyncIndexFS");var Tr=class extends Ri{statFileInodeSync(){throw new f(95)}openFileInodeSync(){throw new f(95)}};s(Tr,"AsyncIndexFS");var Rg=mn;return Vf(Pg);})();
|
|
5
5
|
/*! Bundled license information:
|
|
6
6
|
|
|
7
7
|
ieee754/index.js:
|