@legit-sdk/core 0.1.10 → 0.1.11
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/index.d.ts +2 -1
- package/dist/index.js +42 -42
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
// legit-sdk library bundle
|
|
2
2
|
// Generated by esbuild
|
|
3
3
|
|
|
4
|
-
var vx=Object.create;var $i=Object.defineProperty;var _x=Object.getOwnPropertyDescriptor;var Fx=Object.getOwnPropertyNames;var Ex=Object.getPrototypeOf,Sx=Object.prototype.hasOwnProperty;var xx=(t,e,r)=>e in t?$i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e)=>$i(t,"name",{value:e,configurable:!0}),Tx=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Ox=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Rx=(t,e)=>{for(var r in e)$i(t,r,{get:e[r],enumerable:!0})},ym=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Fx(e))!Sx.call(t,n)&&n!==r&&$i(t,n,{get:()=>e[n],enumerable:!(i=_x(e,n))||i.enumerable});return t};var ae=(t,e,r)=>(r=t!=null?vx(Ex(t)):{},ym(e||!t||!t.__esModule?$i(r,"default",{value:t,enumerable:!0}):r,t)),gm=t=>ym($i({},"__esModule",{value:!0}),t);var H=(t,e,r)=>xx(t,typeof e!="symbol"?e+"":e,r);var Sr=T((kM,vm)=>{"use strict";function Mt(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}a(Mt,"assertPath");function bm(t,e){for(var r="",i=0,n=-1,o=0,s,l=0;l<=t.length;++l){if(l<t.length)s=t.charCodeAt(l);else{if(s===47)break;s=47}if(s===47){if(!(n===l-1||o===1))if(n!==l-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=l,o=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else s===46&&o!==-1?++o:o=-1}return r}a(bm,"normalizeStringPosix");function kx(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}a(kx,"_format");var Mi={resolve:a(function(){for(var e="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=process.cwd()),o=i),Mt(o),o.length!==0&&(e=o+"/"+e,r=o.charCodeAt(0)===47)}return e=bm(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},"resolve"),normalize:a(function(e){if(Mt(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=bm(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},"normalize"),isAbsolute:a(function(e){return Mt(e),e.length>0&&e.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];Mt(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Mi.normalize(e)},"join"),relative:a(function(e,r){if(Mt(e),Mt(r),e===r||(e=Mi.resolve(e),r=Mi.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var n=e.length,o=n-i,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,c=o<f?o:f,u=-1,h=0;h<=c;++h){if(h===c){if(f>c){if(r.charCodeAt(s+h)===47)return r.slice(s+h+1);if(h===0)return r.slice(s+h)}else o>c&&(e.charCodeAt(i+h)===47?u=h:h===0&&(u=0));break}var d=e.charCodeAt(i+h),p=r.charCodeAt(s+h);if(d!==p)break;d===47&&(u=h)}var m="";for(h=i+u+1;h<=n;++h)(h===n||e.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(s+u):(s+=u,r.charCodeAt(s)===47&&++s,r.slice(s))},"relative"),_makeLong:a(function(e){return e},"_makeLong"),dirname:a(function(e){if(Mt(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,n=-1,o=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!o){n=s;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},"dirname"),basename:a(function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Mt(e);var i=0,n=-1,o=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!o){i=s+1;break}}else f===-1&&(o=!1,f=s+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(n=s):(l=-1,n=f))}return i===n?n=f:n===-1&&(n=e.length),e.slice(i,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){i=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":e.slice(i,n)}},"basename"),extname:a(function(e){Mt(e);for(var r=-1,i=0,n=-1,o=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!o){i=l+1;break}continue}n===-1&&(o=!1,n=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1)}return r===-1||n===-1||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)},"extname"),format:a(function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return kx("/",e)},"format"),parse:a(function(e){Mt(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var s=-1,l=0,f=-1,c=!0,u=e.length-1,h=0;u>=o;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}f===-1&&(c=!1,f=u+1),i===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||f===-1||h===0||h===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&n?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&n?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):n&&(r.dir="/"),r},"parse"),sep:"/",delimiter:":",win32:null,posix:null};Mi.posix=Mi;vm.exports=Mi});var Pt=T(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.constants=Ui.SEP=void 0;Ui.SEP="/";Ui.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var xf=T(ao=>{"use strict";Object.defineProperty(ao,"__esModule",{value:!0});ao.Stats=void 0;var Px=Pt(),{S_IFMT:Ax,S_IFDIR:Ix,S_IFREG:Dx,S_IFBLK:Cx,S_IFCHR:Nx,S_IFLNK:Bx,S_IFIFO:Lx,S_IFSOCK:$x}=Px.constants,Hs=class Hs{static build(e,r=!1){let i=new Hs,{uid:n,gid:o,atime:s,mtime:l,ctime:f}=e,c=r?h=>BigInt(h):h=>h;i.uid=c(n),i.gid=c(o),i.rdev=c(e.rdev),i.blksize=c(4096),i.ino=c(e.ino),i.size=c(e.getSize()),i.blocks=c(1),i.atime=s,i.mtime=l,i.ctime=f,i.birthtime=f,i.atimeMs=c(s.getTime()),i.mtimeMs=c(l.getTime());let u=c(f.getTime());if(i.ctimeMs=u,i.birthtimeMs=u,r){i.atimeNs=BigInt(s.getTime())*BigInt(1e6),i.mtimeNs=BigInt(l.getTime())*BigInt(1e6);let h=BigInt(f.getTime())*BigInt(1e6);i.ctimeNs=h,i.birthtimeNs=h}return i.dev=c(0),i.mode=c(e.mode),i.nlink=c(e.nlink),i}_checkModeProperty(e){return(Number(this.mode)&Ax)===e}isDirectory(){return this._checkModeProperty(Ix)}isFile(){return this._checkModeProperty(Dx)}isBlockDevice(){return this._checkModeProperty(Cx)}isCharacterDevice(){return this._checkModeProperty(Nx)}isSymbolicLink(){return this._checkModeProperty(Bx)}isFIFO(){return this._checkModeProperty(Lx)}isSocket(){return this._checkModeProperty($x)}};a(Hs,"Stats");var Us=Hs;ao.Stats=Us;ao.default=Us});var Em=T(qs=>{"use strict";qs.byteLength=jx;qs.toByteArray=Hx;qs.fromByteArray=Wx;var jt=[],ht=[],Mx=typeof Uint8Array<"u"?Uint8Array:Array,Tf="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ri=0,_m=Tf.length;ri<_m;++ri)jt[ri]=Tf[ri],ht[Tf.charCodeAt(ri)]=ri;var ri,_m;ht[45]=62;ht[95]=63;function Fm(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}a(Fm,"getLens");function jx(t){var e=Fm(t),r=e[0],i=e[1];return(r+i)*3/4-i}a(jx,"byteLength");function Ux(t,e,r){return(e+r)*3/4-r}a(Ux,"_byteLength");function Hx(t){var e,r=Fm(t),i=r[0],n=r[1],o=new Mx(Ux(t,i,n)),s=0,l=n>0?i-4:i,f;for(f=0;f<l;f+=4)e=ht[t.charCodeAt(f)]<<18|ht[t.charCodeAt(f+1)]<<12|ht[t.charCodeAt(f+2)]<<6|ht[t.charCodeAt(f+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=ht[t.charCodeAt(f)]<<2|ht[t.charCodeAt(f+1)]>>4,o[s++]=e&255),n===1&&(e=ht[t.charCodeAt(f)]<<10|ht[t.charCodeAt(f+1)]<<4|ht[t.charCodeAt(f+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}a(Hx,"toByteArray");function qx(t){return jt[t>>18&63]+jt[t>>12&63]+jt[t>>6&63]+jt[t&63]}a(qx,"tripletToBase64");function zx(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(qx(i));return n.join("")}a(zx,"encodeChunk");function Wx(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,l=r-i;s<l;s+=o)n.push(zx(t,s,s+o>l?l:s+o));return i===1?(e=t[r-1],n.push(jt[e>>2]+jt[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(jt[e>>10]+jt[e>>4&63]+jt[e<<2&63]+"=")),n.join("")}a(Wx,"fromByteArray")});var Sm=T(Of=>{Of.read=function(t,e,r,i,n){var o,s,l=n*8-i-1,f=(1<<l)-1,c=f>>1,u=-7,h=r?n-1:0,d=r?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=l;u>0;o=o*256+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+t[e+h],h+=d,u-=8);if(o===0)o=1-c;else{if(o===f)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(p?-1:1)*s*Math.pow(2,o-i)};Of.write=function(t,e,r,i,n,o){var s,l,f,c=o*8-n-1,u=(1<<c)-1,h=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?e+=d/f:e+=d*Math.pow(2,1-h),e*f>=2&&(s++,f/=2),s+h>=u?(l=0,s=u):s+h>=1?(l=(e*f-1)*Math.pow(2,n),s=s+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=l&255,p+=m,l/=256,n-=8);for(s=s<<n|l,c+=n;c>0;t[r+p]=s&255,p+=m,s/=256,c-=8);t[r+p-m]|=w*128}});var ni=T(Wi=>{"use strict";var Rf=Em(),qi=Sm(),xm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wi.Buffer=A;Wi.SlowBuffer=Yx;Wi.INSPECT_MAX_BYTES=50;var zs=2147483647;Wi.kMaxLength=zs;A.TYPED_ARRAY_SUPPORT=Vx();!A.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 Vx(){try{let t=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}a(Vx,"typedArraySupport");Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.buffer},"get")});Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.byteOffset},"get")});function or(t){if(t>zs)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,A.prototype),e}a(or,"createBuffer");function A(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return If(t)}return km(t,e,r)}a(A,"Buffer");A.poolSize=8192;function km(t,e,r){if(typeof t=="string")return Kx(t,e);if(ArrayBuffer.isView(t))return Zx(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(Ut(t,ArrayBuffer)||t&&Ut(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ut(t,SharedArrayBuffer)||t&&Ut(t.buffer,SharedArrayBuffer)))return Pf(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return A.from(i,e,r);let n=Xx(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return A.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a(km,"from");A.from=function(t,e,r){return km(t,e,r)};Object.setPrototypeOf(A.prototype,Uint8Array.prototype);Object.setPrototypeOf(A,Uint8Array);function Pm(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"')}a(Pm,"assertSize");function Gx(t,e,r){return Pm(t),t<=0?or(t):e!==void 0?typeof r=="string"?or(t).fill(e,r):or(t).fill(e):or(t)}a(Gx,"alloc");A.alloc=function(t,e,r){return Gx(t,e,r)};function If(t){return Pm(t),or(t<0?0:Df(t)|0)}a(If,"allocUnsafe");A.allocUnsafe=function(t){return If(t)};A.allocUnsafeSlow=function(t){return If(t)};function Kx(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!A.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Am(t,e)|0,i=or(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}a(Kx,"fromString");function kf(t){let e=t.length<0?0:Df(t.length)|0,r=or(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}a(kf,"fromArrayLike");function Zx(t){if(Ut(t,Uint8Array)){let e=new Uint8Array(t);return Pf(e.buffer,e.byteOffset,e.byteLength)}return kf(t)}a(Zx,"fromArrayView");function Pf(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,A.prototype),i}a(Pf,"fromArrayBuffer");function Xx(t){if(A.isBuffer(t)){let e=Df(t.length)|0,r=or(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Nf(t.length)?or(0):kf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return kf(t.data)}a(Xx,"fromObject");function Df(t){if(t>=zs)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+zs.toString(16)+" bytes");return t|0}a(Df,"checked");function Yx(t){return+t!=t&&(t=0),A.alloc(+t)}a(Yx,"SlowBuffer");A.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!==A.prototype},"isBuffer");A.compare=a(function(e,r){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),Ut(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),!A.isBuffer(e)||!A.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");A.isEncoding=a(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");A.concat=a(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return A.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=A.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(Ut(s,Uint8Array))o+s.length>n.length?(A.isBuffer(s)||(s=A.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(A.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n},"concat");function Am(t,e){if(A.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ut(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return Af(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return jm(t).length;default:if(n)return i?-1:Af(t).length;e=(""+e).toLowerCase(),n=!0}}a(Am,"byteLength");A.byteLength=Am;function Jx(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return lT(this,e,r);case"utf8":case"utf-8":return Dm(this,e,r);case"ascii":return sT(this,e,r);case"latin1":case"binary":return aT(this,e,r);case"base64":return nT(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return cT(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a(Jx,"slowToString");A.prototype._isBuffer=!0;function ii(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}a(ii,"swap");A.prototype.swap16=a(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ii(this,r,r+1);return this},"swap16");A.prototype.swap32=a(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ii(this,r,r+3),ii(this,r+1,r+2);return this},"swap32");A.prototype.swap64=a(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ii(this,r,r+7),ii(this,r+1,r+6),ii(this,r+2,r+5),ii(this,r+3,r+4);return this},"swap64");A.prototype.toString=a(function(){let e=this.length;return e===0?"":arguments.length===0?Dm(this,0,e):Jx.apply(this,arguments)},"toString");A.prototype.toLocaleString=A.prototype.toString;A.prototype.equals=a(function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:A.compare(this,e)===0},"equals");A.prototype.inspect=a(function(){let e="",r=Wi.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");xm&&(A.prototype[xm]=A.prototype.inspect);A.prototype.compare=a(function(e,r,i,n,o){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,l=i-r,f=Math.min(s,l),c=this.slice(n,o),u=e.slice(r,i);for(let h=0;h<f;++h)if(c[h]!==u[h]){s=c[h],l=u[h];break}return s<l?-1:l<s?1:0},"compare");function Im(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Nf(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=A.from(e,i)),A.isBuffer(e))return e.length===0?-1:Tm(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Tm(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}a(Im,"bidirectionalIndexOf");function Tm(t,e,r,i,n){let o=1,s=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function f(u,h){return o===1?u[h]:u.readUInt16BE(h*o)}a(f,"read");let c;if(n){let u=-1;for(c=r;c<s;c++)if(f(t,c)===f(e,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===l)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+l>s&&(r=s-l),c=r;c>=0;c--){let u=!0;for(let h=0;h<l;h++)if(f(t,c+h)!==f(e,h)){u=!1;break}if(u)return c}return-1}a(Tm,"arrayIndexOf");A.prototype.includes=a(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");A.prototype.indexOf=a(function(e,r,i){return Im(this,e,r,i,!0)},"indexOf");A.prototype.lastIndexOf=a(function(e,r,i){return Im(this,e,r,i,!1)},"lastIndexOf");function Qx(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let l=parseInt(e.substr(s*2,2),16);if(Nf(l))return s;t[r+s]=l}return s}a(Qx,"hexWrite");function eT(t,e,r,i){return Ws(Af(e,t.length-r),t,r,i)}a(eT,"utf8Write");function tT(t,e,r,i){return Ws(dT(e),t,r,i)}a(tT,"asciiWrite");function rT(t,e,r,i){return Ws(jm(e),t,r,i)}a(rT,"base64Write");function iT(t,e,r,i){return Ws(pT(e,t.length-r),t,r,i)}a(iT,"ucs2Write");A.prototype.write=a(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return Qx(this,e,r,i);case"utf8":case"utf-8":return eT(this,e,r,i);case"ascii":case"latin1":case"binary":return tT(this,e,r,i);case"base64":return rT(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return iT(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write");A.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function nT(t,e,r){return e===0&&r===t.length?Rf.fromByteArray(t):Rf.fromByteArray(t.slice(e,r))}a(nT,"base64Slice");function Dm(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let f,c,u,h;switch(l){case 1:o<128&&(s=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=t[n+1],c=t[n+2],(f&192)===128&&(c&192)===128&&(h=(o&15)<<12|(f&63)<<6|c&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=t[n+1],c=t[n+2],u=t[n+3],(f&192)===128&&(c&192)===128&&(u&192)===128&&(h=(o&15)<<18|(f&63)<<12|(c&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=l}return oT(i)}a(Dm,"utf8Slice");var Om=4096;function oT(t){let e=t.length;if(e<=Om)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Om));return r}a(oT,"decodeCodePointsArray");function sT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}a(sT,"asciiSlice");function aT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}a(aT,"latin1Slice");function lT(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=mT[t[o]];return n}a(lT,"hexSlice");function cT(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a(cT,"utf16leSlice");A.prototype.slice=a(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,A.prototype),n},"slice");function Ie(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a(Ie,"checkOffset");A.prototype.readUintLE=A.prototype.readUIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n},"readUIntLE");A.prototype.readUintBE=A.prototype.readUIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");A.prototype.readUint8=A.prototype.readUInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]},"readUInt8");A.prototype.readUint16LE=A.prototype.readUInt16LE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");A.prototype.readUint16BE=A.prototype.readUInt16BE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");A.prototype.readUint32LE=A.prototype.readUInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");A.prototype.readUint32BE=A.prototype.readUInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");A.prototype.readBigUInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&lo(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));A.prototype.readBigUInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&lo(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));A.prototype.readIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");A.prototype.readIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},"readIntBE");A.prototype.readInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");A.prototype.readInt16LE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");A.prototype.readInt16BE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");A.prototype.readInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");A.prototype.readInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");A.prototype.readBigInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&lo(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));A.prototype.readBigInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&lo(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));A.prototype.readFloatLE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!0,23,4)},"readFloatLE");A.prototype.readFloatBE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!1,23,4)},"readFloatBE");A.prototype.readDoubleLE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!0,52,8)},"readDoubleLE");A.prototype.readDoubleBE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!1,52,8)},"readDoubleBE");function Ye(t,e,r,i,n,o){if(!A.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}a(Ye,"checkInt");A.prototype.writeUintLE=A.prototype.writeUIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i},"writeUIntLE");A.prototype.writeUintBE=A.prototype.writeUIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i},"writeUIntBE");A.prototype.writeUint8=A.prototype.writeUInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");A.prototype.writeUint16LE=A.prototype.writeUInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");A.prototype.writeUint16BE=A.prototype.writeUInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");A.prototype.writeUint32LE=A.prototype.writeUInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");A.prototype.writeUint32BE=A.prototype.writeUInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function Cm(t,e,r,i,n){Mm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}a(Cm,"wrtBigUInt64LE");function Nm(t,e,r,i,n){Mm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}a(Nm,"wrtBigUInt64BE");A.prototype.writeBigUInt64LE=xr(a(function(e,r=0){return Cm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));A.prototype.writeBigUInt64BE=xr(a(function(e,r=0){return Nm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));A.prototype.writeIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=0,s=1,l=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntLE");A.prototype.writeIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=i-1,s=1,l=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntBE");A.prototype.writeInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");A.prototype.writeInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");A.prototype.writeInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");A.prototype.writeInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");A.prototype.writeInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");A.prototype.writeBigInt64LE=xr(a(function(e,r=0){return Cm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));A.prototype.writeBigInt64BE=xr(a(function(e,r=0){return Nm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Bm(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}a(Bm,"checkIEEE754");function Lm(t,e,r,i,n){return e=+e,r=r>>>0,n||Bm(t,e,r,4,34028234663852886e22,-34028234663852886e22),qi.write(t,e,r,i,23,4),r+4}a(Lm,"writeFloat");A.prototype.writeFloatLE=a(function(e,r,i){return Lm(this,e,r,!0,i)},"writeFloatLE");A.prototype.writeFloatBE=a(function(e,r,i){return Lm(this,e,r,!1,i)},"writeFloatBE");function $m(t,e,r,i,n){return e=+e,r=r>>>0,n||Bm(t,e,r,8,17976931348623157e292,-17976931348623157e292),qi.write(t,e,r,i,52,8),r+8}a($m,"writeDouble");A.prototype.writeDoubleLE=a(function(e,r,i){return $m(this,e,r,!0,i)},"writeDoubleLE");A.prototype.writeDoubleBE=a(function(e,r,i){return $m(this,e,r,!1,i)},"writeDoubleBE");A.prototype.copy=a(function(e,r,i,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");A.prototype.fill=a(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=A.isBuffer(e)?e:A.from(e,n),l=s.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%l]}return this},"fill");var Hi={};function Cf(t,e,r){var i;Hi[t]=(i=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},a(i,"NodeError"),i)}a(Cf,"E");Cf("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Cf("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Cf("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=Rm(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=Rm(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function Rm(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}a(Rm,"addNumericalSeparator");function fT(t,e,r){zi(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&lo(e,t.length-(r+1))}a(fT,"checkBounds");function Mm(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:l=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:l=`>= ${e}${s} and <= ${r}${s}`,new Hi.ERR_OUT_OF_RANGE("value",l,t)}fT(i,n,o)}a(Mm,"checkIntBI");function zi(t,e){if(typeof t!="number")throw new Hi.ERR_INVALID_ARG_TYPE(e,"number",t)}a(zi,"validateNumber");function lo(t,e,r){throw Math.floor(t)!==t?(zi(t,r),new Hi.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Hi.ERR_BUFFER_OUT_OF_BOUNDS:new Hi.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}a(lo,"boundsError");var uT=/[^+/0-9A-Za-z-_]/g;function hT(t){if(t=t.split("=")[0],t=t.trim().replace(uT,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}a(hT,"base64clean");function Af(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}a(Af,"utf8ToBytes");function dT(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}a(dT,"asciiToBytes");function pT(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}a(pT,"utf16leToBytes");function jm(t){return Rf.toByteArray(hT(t))}a(jm,"base64ToBytes");function Ws(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}a(Ws,"blitBuffer");function Ut(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}a(Ut,"isInstance");function Nf(t){return t!==t}a(Nf,"numberIsNaN");var mT=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function xr(t){return typeof BigInt>"u"?wT:t}a(xr,"defineBigIntMethod");function wT(){throw new Error("BigInt not supported")}a(wT,"BufferBigIntNotDefined")});var Um=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Buffer=void 0;var yT=ni();Object.defineProperty(Vs,"Buffer",{enumerable:!0,get:a(function(){return yT.Buffer},"get")})});var Or=T(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.bufferFrom=Tr.bufferAllocUnsafe=Tr.Buffer=void 0;var Gs=Um();Object.defineProperty(Tr,"Buffer",{enumerable:!0,get:a(function(){return Gs.Buffer},"get")});function Hm(t,...e){return new Gs.Buffer(t,...e)}a(Hm,"bufferV0P12Ponyfill");var gT=Gs.Buffer.allocUnsafe||Hm;Tr.bufferAllocUnsafe=gT;var bT=Gs.Buffer.from||Hm;Tr.bufferFrom=bT});var Lf=T(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.inherits=vT;Vi.promisify=_T;Vi.inspect=Bf;Vi.format=FT;function vT(t,e){if(t==null)throw new TypeError("The constructor to inherit from is not defined");if(e==null)throw new TypeError("The super constructor to inherit from is not defined");t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}a(vT,"inherits");function _T(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type function');return function(...e){return new Promise((r,i)=>{t.call(this,...e,(n,o)=>{n?i(n):r(o)})})}}a(_T,"promisify");function Bf(t){return t===null?"null":t===void 0?"undefined":typeof t=="string"?`'${t}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[ ${t.map(r=>Bf(r)).join(", ")} ]`:typeof t=="object"?`{ ${Object.entries(t).map(([r,i])=>`${r}: ${Bf(i)}`).join(", ")} }`:String(t)}a(Bf,"inspect");function FT(t,...e){if(e.length===0)return t;let r=t,i=0;for(r=r.replace(/%[sdj%]/g,n=>{if(i>=e.length)return n;let o=e[i++];switch(n){case"%s":return String(o);case"%d":return Number(o).toString();case"%j":try{return JSON.stringify(o)}catch{return"[Circular]"}case"%%":return"%";default:return n}});i<e.length;)r+=" "+String(e[i++]);return r}a(FT,"format")});var co=T(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.AssertionError=Ue.RangeError=Ue.TypeError=Ue.Error=void 0;Ue.message=Wm;Ue.E=Rr;var $f=Lf(),qm=typeof Symbol>"u"?"_kCode":Symbol("code"),zm={};function jf(t){var e;return e=class extends t{constructor(i,...n){super(Wm(i,n)),this.code=i,this[qm]=i,this.name=`${super.name} [${this[qm]}]`}},a(e,"NodeError"),e}a(jf,"makeNodeError");var Ks=globalThis,Uf=class Uf extends Ks.Error{constructor(e){if(typeof e!="object"||e===null)throw new Ue.TypeError("ERR_INVALID_ARG_TYPE","options","object");e.message?super(e.message):super(`${(0,$f.inspect)(e.actual).slice(0,128)} ${e.operator} ${(0,$f.inspect)(e.expected).slice(0,128)}`),this.generatedMessage=!e.message,this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,Ue.Error.captureStackTrace(this,e.stackStartFunction)}};a(Uf,"AssertionError");var Mf=Uf;Ue.AssertionError=Mf;function Wm(t,e){if(typeof t!="string")throw new Ue.Error("Error message key must be a string");let r=zm[t];if(!r)throw new Ue.Error(`An invalid error message key was used: ${t}.`);let i;if(typeof r=="function")i=r;else{if(i=$f.format,e===void 0||e.length===0)return r;e.unshift(r)}return String(i.apply(null,e))}a(Wm,"message");function Rr(t,e){zm[t]=typeof e=="function"?e:String(e)}a(Rr,"E");Ue.Error=jf(Ks.Error);Ue.TypeError=jf(Ks.TypeError);Ue.RangeError=jf(Ks.RangeError);Rr("ERR_DIR_CLOSED","Directory handle was closed");Rr("ERR_DIR_CONCURRENT_OPERATION","Cannot do synchronous work on directory handle with concurrent asynchronous operations");Rr("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');Rr("ERR_INVALID_FILE_URL_PATH","File URL path %s");Rr("ERR_INVALID_OPT_VALUE",(t,e)=>`The value "${String(e)}" is invalid for option "${t}"`);Rr("ERR_INVALID_OPT_VALUE_ENCODING",t=>`The value "${String(t)}" is invalid for option "encoding"`);Rr("ERR_INVALID_ARG_VALUE","Unable to open file as blob")});var fo=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ENCODING_UTF8=void 0;oi.assertEncoding=ST;oi.strToEncoding=xT;var Hf=Or(),ET=co();oi.ENCODING_UTF8="utf8";function ST(t){if(t&&!Hf.Buffer.isEncoding(t))throw new ET.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)}a(ST,"assertEncoding");function xT(t,e){return!e||e===oi.ENCODING_UTF8?t:e==="buffer"?new Hf.Buffer(t):new Hf.Buffer(t).toString(e)}a(xT,"strToEncoding")});var Ys=T(uo=>{"use strict";Object.defineProperty(uo,"__esModule",{value:!0});uo.Dirent=void 0;var TT=Pt(),OT=fo(),{S_IFMT:RT,S_IFDIR:kT,S_IFREG:PT,S_IFBLK:AT,S_IFCHR:IT,S_IFLNK:DT,S_IFIFO:CT,S_IFSOCK:NT}=TT.constants,Xs=class Xs{constructor(){this.name="",this.path="",this.parentPath="",this.mode=0}static build(e,r){let i=new Xs,{mode:n}=e.getNode();return i.name=(0,OT.strToEncoding)(e.getName(),r),i.mode=n,i.path=e.getParentPath(),i.parentPath=i.path,i}_checkModeProperty(e){return(this.mode&RT)===e}isDirectory(){return this._checkModeProperty(kT)}isFile(){return this._checkModeProperty(PT)}isBlockDevice(){return this._checkModeProperty(AT)}isCharacterDevice(){return this._checkModeProperty(IT)}isSymbolicLink(){return this._checkModeProperty(DT)}isFIFO(){return this._checkModeProperty(CT)}isSocket(){return this._checkModeProperty(NT)}};a(Xs,"Dirent");var Zs=Xs;uo.Dirent=Zs;uo.default=Zs});var Gi=T(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.basename=Se.isAbsolute=Se.normalize=Se.dirname=Se.relative=Se.join=Se.posix=Se.sep=Se.resolve=void 0;var sr=Sr();Object.defineProperty(Se,"resolve",{enumerable:!0,get:a(function(){return sr.resolve},"get")});Object.defineProperty(Se,"sep",{enumerable:!0,get:a(function(){return sr.sep},"get")});Object.defineProperty(Se,"posix",{enumerable:!0,get:a(function(){return sr.posix},"get")});Object.defineProperty(Se,"join",{enumerable:!0,get:a(function(){return sr.join},"get")});Object.defineProperty(Se,"relative",{enumerable:!0,get:a(function(){return sr.relative},"get")});Object.defineProperty(Se,"dirname",{enumerable:!0,get:a(function(){return sr.dirname},"get")});Object.defineProperty(Se,"normalize",{enumerable:!0,get:a(function(){return sr.normalize},"get")});Object.defineProperty(Se,"isAbsolute",{enumerable:!0,get:a(function(){return sr.isAbsolute},"get")});Object.defineProperty(Se,"basename",{enumerable:!0,get:a(function(){return sr.basename},"get")})});var Vf={};Rx(Vf,{__addDisposableResource:()=>ww,__assign:()=>Js,__asyncDelegator:()=>lw,__asyncGenerator:()=>aw,__asyncValues:()=>cw,__await:()=>Ki,__awaiter:()=>tw,__classPrivateFieldGet:()=>dw,__classPrivateFieldIn:()=>mw,__classPrivateFieldSet:()=>pw,__createBinding:()=>ea,__decorate:()=>Km,__disposeResources:()=>yw,__esDecorate:()=>Xm,__exportStar:()=>iw,__extends:()=>Vm,__generator:()=>rw,__importDefault:()=>hw,__importStar:()=>uw,__makeTemplateObject:()=>fw,__metadata:()=>ew,__param:()=>Zm,__propKey:()=>Jm,__read:()=>Wf,__rest:()=>Gm,__rewriteRelativeImportExtension:()=>gw,__runInitializers:()=>Ym,__setFunctionName:()=>Qm,__spread:()=>nw,__spreadArray:()=>sw,__spreadArrays:()=>ow,__values:()=>Qs,default:()=>$T});function Vm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");qf(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Gm(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Km(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function Zm(t,e){return function(r,i){e(r,i,t)}}function Xm(t,e,r,i,n,o){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}a(s,"accept");for(var l=i.kind,f=l==="getter"?"get":l==="setter"?"set":"value",c=!e&&t?i.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h,d=!1,p=r.length-1;p>=0;p--){var m={};for(var w in i)m[w]=w==="access"?{}:i[w];for(var w in i.access)m.access[w]=i.access[w];m.addInitializer=function(v){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(v||null))};var y=(0,r[p])(l==="accessor"?{get:u.get,set:u.set}:u[f],m);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=s(y.get))&&(u.get=h),(h=s(y.set))&&(u.set=h),(h=s(y.init))&&n.unshift(h)}else(h=s(y))&&(l==="field"?n.unshift(h):u[f]=h)}c&&Object.defineProperty(c,i.name,u),d=!0}function Ym(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function Jm(t){return typeof t=="symbol"?t:"".concat(t)}function Qm(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function ew(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function tw(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return a(n,"adopt"),new(r||(r=Promise))(function(o,s){function l(u){try{c(i.next(u))}catch(h){s(h)}}a(l,"fulfilled");function f(u){try{c(i.throw(u))}catch(h){s(h)}}a(f,"rejected");function c(u){u.done?o(u.value):n(u.value).then(l,f)}a(c,"step"),c((i=i.apply(t,e||[])).next())})}function rw(t,e){var r={label:0,sent:a(function(){if(o[0]&1)throw o[1];return o[1]},"sent"),trys:[],ops:[]},i,n,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return f([c,u])}}function f(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function iw(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ea(e,t,r)}function Qs(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Wf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(l){s={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function nw(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Wf(arguments[e]));return t}function ow(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}function sw(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function Ki(t){return this instanceof Ki?(this.v=t,this):new Ki(t)}function aw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(m){return Promise.resolve(m).then(p,h)}}function l(p,m){i[p]&&(n[p]=function(w){return new Promise(function(y,v){o.push([p,w,y,v])>1||f(p,w)})},m&&(n[p]=m(n[p])))}function f(p,m){try{c(i[p](m))}catch(w){d(o[0][3],w)}}function c(p){p.value instanceof Ki?Promise.resolve(p.value.v).then(u,h):d(o[0][2],p)}function u(p){f("next",p)}function h(p){f("throw",p)}function d(p,m){p(m),o.shift(),o.length&&f(o[0][0],o[0][1])}}function lw(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(s){return(r=!r)?{value:Ki(t[n](s)),done:!1}:o?o(s):s}:o}}function cw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Qs=="function"?Qs(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(s){return new Promise(function(l,f){s=t[o](s),n(l,f,s.done,s.value)})}}function n(o,s,l,f){Promise.resolve(f).then(function(c){o({value:c,done:l})},s)}}function fw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function uw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=zf(t),i=0;i<r.length;i++)r[i]!=="default"&&ea(e,t,r[i]);return BT(e,t),e}function hw(t){return t&&t.__esModule?t:{default:t}}function dw(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function pw(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function mw(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function ww(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=a(function(){try{n.call(this)}catch(o){return Promise.reject(o)}},"dispose")),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function yw(t){function e(o){t.error=t.hasError?new LT(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}a(e,"fail");var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(s){return e(s),n()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a(n,"next"),n()}function gw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,o,s){return i?e?".jsx":".js":n&&(!o||!s)?r:n+o+"."+s.toLowerCase()+"js"}):t}var qf,Js,ea,BT,zf,LT,$T,Gf=Ox(()=>{qf=a(function(t,e){return qf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},qf(t,e)},"extendStatics");a(Vm,"__extends");Js=a(function(){return Js=Object.assign||a(function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},"__assign"),Js.apply(this,arguments)},"__assign");a(Gm,"__rest");a(Km,"__decorate");a(Zm,"__param");a(Xm,"__esDecorate");a(Ym,"__runInitializers");a(Jm,"__propKey");a(Qm,"__setFunctionName");a(ew,"__metadata");a(tw,"__awaiter");a(rw,"__generator");ea=Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]};a(iw,"__exportStar");a(Qs,"__values");a(Wf,"__read");a(nw,"__spread");a(ow,"__spreadArrays");a(sw,"__spreadArray");a(Ki,"__await");a(aw,"__asyncGenerator");a(lw,"__asyncDelegator");a(cw,"__asyncValues");a(fw,"__makeTemplateObject");BT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},zf=a(function(t){return zf=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},zf(t)},"ownKeys");a(uw,"__importStar");a(hw,"__importDefault");a(dw,"__classPrivateFieldGet");a(pw,"__classPrivateFieldSet");a(mw,"__classPrivateFieldIn");a(ww,"__addDisposableResource");LT=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};a(yw,"__disposeResources");a(gw,"__rewriteRelativeImportExtension");$T={__extends:Vm,__assign:Js,__rest:Gm,__decorate:Km,__param:Zm,__esDecorate:Xm,__runInitializers:Ym,__propKey:Jm,__setFunctionName:Qm,__metadata:ew,__awaiter:tw,__generator:rw,__createBinding:ea,__exportStar:iw,__values:Qs,__read:Wf,__spread:nw,__spreadArrays:ow,__spreadArray:sw,__await:Ki,__asyncGenerator:aw,__asyncDelegator:lw,__asyncValues:cw,__makeTemplateObject:fw,__importStar:uw,__importDefault:hw,__classPrivateFieldGet:dw,__classPrivateFieldSet:pw,__classPrivateFieldIn:mw,__addDisposableResource:ww,__disposeResources:yw,__rewriteRelativeImportExtension:gw}});var vw=T(bw=>{"use strict";Object.defineProperty(bw,"__esModule",{value:!0})});var Zf=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.flattenJSON=void 0;var _w=Or(),Kf=Gi(),MT=Kf.posix?Kf.posix.join:Kf.join,jT=a(t=>{let e={};function r(i,n){for(let o in n){let s=n[o],l=MT(i,o);typeof s=="string"||s instanceof _w.Buffer?e[l]=s:typeof s=="object"&&s!==null&&!(s instanceof _w.Buffer)&&Object.keys(s).length>0?r(l,s):e[l]=null}}return a(r,"flatten"),r("",t),e},"flattenJSON");ta.flattenJSON=jT});var Jf=T(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.FanOut=void 0;var Yf=class Yf{constructor(){this.listeners=new Set}emit(e){this.listeners.forEach(r=>r(e))}listen(e){let r=this.listeners;return r.add(e),()=>r.delete(e)}};a(Yf,"FanOut");var Xf=Yf;ra.FanOut=Xf});var na=T(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.createProcess=Fw;var UT=a(()=>{if(typeof process<"u")return process;try{return Tx("process")}catch{return}},"maybeReturnProcess");function Fw(){let t=UT()||{};return t.cwd||(t.cwd=()=>"/"),t.emitWarning||(t.emitWarning=(e,r)=>{console.warn(`${r}${r?": ":""}${e}`)}),t.env||(t.env={}),t}a(Fw,"createProcess");ia.default=Fw()});var tu=T(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.Node=void 0;var HT=Jf(),Sw=na(),dt=Or(),qT=Pt(),{S_IFMT:ar,S_IFDIR:zT,S_IFREG:WT,S_IFLNK:Ew,S_IFCHR:VT}=qT.constants,oa=a(()=>Sw.default.getuid?.()??0,"getuid"),sa=a(()=>Sw.default.getgid?.()??0,"getgid"),eu=class eu{constructor(e,r=438){this.changes=new HT.FanOut,this._uid=oa(),this._gid=sa(),this._atime=new Date,this._mtime=new Date,this._ctime=new Date,this.rdev=0,this._nlink=1,this.mode=r,this.ino=e}set ctime(e){this._ctime=e}get ctime(){return this._ctime}set uid(e){this._uid=e,this.ctime=new Date}get uid(){return this._uid}set gid(e){this._gid=e,this.ctime=new Date}get gid(){return this._gid}set atime(e){this._atime=e}get atime(){return this._atime}set mtime(e){this._mtime=e,this.ctime=new Date}get mtime(){return this._mtime}get perm(){return this.mode&~ar}set perm(e){this.mode=this.mode&ar|e&~ar,this.ctime=new Date}set nlink(e){this._nlink=e,this.ctime=new Date}get nlink(){return this._nlink}getString(e="utf8"){return this.atime=new Date,this.getBuffer().toString(e)}setString(e){this.buf=(0,dt.bufferFrom)(e,"utf8"),this.touch()}getBuffer(){return this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),(0,dt.bufferFrom)(this.buf)}setBuffer(e){this.buf=(0,dt.bufferFrom)(e),this.touch()}getSize(){return this.buf?this.buf.length:0}setModeProperty(e){this.mode=e}isFile(){return(this.mode&ar)===WT}isDirectory(){return(this.mode&ar)===zT}isSymlink(){return(this.mode&ar)===Ew}isCharacterDevice(){return(this.mode&ar)===VT}makeSymlink(e){this.mode=Ew|438,this.symlink=e}write(e,r=0,i=e.length,n=0){if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n+i>this.buf.length){let o=(0,dt.bufferAllocUnsafe)(n+i);this.buf.copy(o,0,0,this.buf.length),this.buf=o}return e.copy(this.buf,n,r,r+i),this.touch(),i}read(e,r=0,i=e.byteLength,n=0){if(this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n>=this.buf.length)return 0;let o=i;o>e.byteLength&&(o=e.byteLength),o+n>this.buf.length&&(o=this.buf.length-n);let s=e instanceof dt.Buffer?e:dt.Buffer.from(e.buffer,e.byteOffset,e.byteLength);return this.buf.copy(s,r,n,n+o),o}truncate(e=0){if(!e)this.buf=(0,dt.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{let r=(0,dt.bufferAllocUnsafe)(e);this.buf.copy(r),r.fill(0,this.buf.length),this.buf=r}this.touch()}chmod(e){this.mode=this.mode&ar|e&~ar,this.touch()}chown(e,r){this.uid=e,this.gid=r,this.touch()}touch(){this.mtime=new Date,this.changes.emit(["modify"])}canRead(e=oa(),r=sa()){return!!(this.perm&4||r===this.gid&&this.perm&32||e===this.uid&&this.perm&256)}canWrite(e=oa(),r=sa()){return!!(this.perm&2||r===this.gid&&this.perm&16||e===this.uid&&this.perm&128)}canExecute(e=oa(),r=sa()){return!!(this.perm&1||r===this.gid&&this.perm&8||e===this.uid&&this.perm&64)}del(){this.changes.emit(["delete"])}toJSON(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}}};a(eu,"Node");var Qf=eu;aa.Node=Qf});var iu=T(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.Link=void 0;var GT=Pt(),KT=Jf(),{S_IFREG:ZT}=GT.constants,ho=class ho{get steps(){return this._steps}set steps(e){this._steps=e;for(let[r,i]of this.children.entries())r==="."||r===".."||i?.syncSteps()}constructor(e,r,i){this.changes=new KT.FanOut,this.children=new Map,this._steps=[],this.ino=0,this.length=0,this.vol=e,this.parent=r,this.name=i,this.syncSteps()}setNode(e){this.node=e,this.ino=e.ino}getNode(){return this.node}createChild(e,r=this.vol.createNode(ZT|438)){let i=new ho(this.vol,this,e);return i.setNode(r),r.isDirectory()&&(i.children.set(".",i),i.getNode().nlink++),this.setChild(e,i),i}setChild(e,r=new ho(this.vol,this,e)){return this.children.set(e,r),r.parent=this,this.length++,r.getNode().isDirectory()&&(r.children.set("..",this),this.getNode().nlink++),this.getNode().mtime=new Date,this.changes.emit(["child:add",r,this]),r}deleteChild(e){e.getNode().isDirectory()&&(e.children.delete(".."),this.getNode().nlink--),this.children.delete(e.getName()),this.length--,this.getNode().mtime=new Date,this.changes.emit(["child:del",e,this])}getChild(e){return this.getNode().atime=new Date,this.children.get(e)}getPath(){return this.steps.join("/")}getParentPath(){return this.steps.slice(0,-1).join("/")}getName(){return this.steps[this.steps.length-1]}toJSON(){return{steps:this.steps,ino:this.ino,children:Array.from(this.children.keys())}}syncSteps(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]}};a(ho,"Link");var ru=ho;la.Link=ru});var su=T(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.File=void 0;var XT=Pt(),{O_APPEND:YT}=XT.constants,ou=class ou{constructor(e,r,i,n){this.link=e,this.node=r,this.flags=i,this.fd=n,this.position=0,this.flags&YT&&(this.position=this.getSize())}getString(e="utf8"){return this.node.getString()}setString(e){this.node.setString(e)}getBuffer(){return this.node.getBuffer()}setBuffer(e){this.node.setBuffer(e)}getSize(){return this.node.getSize()}truncate(e){this.node.truncate(e)}seekTo(e){this.position=e}write(e,r=0,i=e.length,n){typeof n!="number"&&(n=this.position);let o=this.node.write(e,r,i,n);return this.position=n+o,o}read(e,r=0,i=e.byteLength,n){typeof n!="number"&&(n=this.position);let o=this.node.read(e,r,i,n);return this.position=n+o,o}chmod(e){this.node.chmod(e)}chown(e,r){this.node.chown(e,r)}};a(ou,"File");var nu=ou;ca.File=nu});var Yi=T(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FLAGS=Xi.ERRSTR=void 0;var JT=Pt();Xi.ERRSTR={PATH_STR:"path must be a string, Buffer, or Uint8Array",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var{O_RDONLY:xw,O_WRONLY:fa,O_RDWR:Zi,O_CREAT:kr,O_EXCL:ua,O_TRUNC:ha,O_APPEND:da,O_SYNC:Tw}=JT.constants,Ow;(function(t){t[t.r=xw]="r",t[t["r+"]=Zi]="r+",t[t.rs=xw|Tw]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=Zi|Tw]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=fa|kr|ha]="w",t[t.wx=fa|kr|ha|ua]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=Zi|kr|ha]="w+",t[t["wx+"]=Zi|kr|ha|ua]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=fa|da|kr]="a",t[t.ax=fa|da|kr|ua]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=Zi|da|kr]="a+",t[t["ax+"]=Zi|da|kr|ua]="ax+",t[t["xa+"]=t["ax+"]]="xa+"})(Ow||(Xi.FLAGS=Ow={}))});var lu=T(au=>{"use strict";Object.defineProperty(au,"__esModule",{value:!0});au.default=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(()=>t()).catch(()=>{})});var ya=T(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.filenameToSteps=De.resolve=De.unixify=De.isWin=void 0;De.isFd=kw;De.validateFd=lO;De.dataToBuffer=cO;var ma=Gi(),pa=Or(),Rw=na(),QT=fo(),eO=Yi();De.isWin=Rw.default.platform==="win32";var tO=ma.resolve,rO=ma.posix?ma.posix.sep:ma.sep,iO=a((t,e)=>{let r=t[e];return e>0&&(r==="/"||De.isWin&&r==="\\")},"isSeparator"),nO=a(t=>{let e=t.length-1;if(e<2)return t;for(;iO(t,e);)e--;return t.substr(0,e+1)},"removeTrailingSeparator"),oO=a((t,e)=>{if(typeof t!="string")throw new TypeError("expected a string");return t=t.replace(/[\\\/]+/g,"/"),e!==!1&&(t=nO(t)),t},"normalizePath"),sO=a((t,e=!0)=>De.isWin?(t=oO(t,e),t.replace(/^([a-zA-Z]+:|\.\/)/,"")):t,"unixify");De.unixify=sO;var wa=a((t,e=Rw.default.cwd())=>tO(e,t),"resolve");De.resolve=wa;if(De.isWin){let t=wa;De.resolve=wa=a((e,r)=>(0,De.unixify)(t(e,r)),"resolve")}var aO=a((t,e)=>{let i=wa(t,e).substring(1);return i?i.split(rO):[]},"filenameToSteps");De.filenameToSteps=aO;function kw(t){return t>>>0===t}a(kw,"isFd");function lO(t){if(!kw(t))throw TypeError(eO.ERRSTR.FD)}a(lO,"validateFd");function cO(t,e=QT.ENCODING_UTF8){return pa.Buffer.isBuffer(t)?t:t instanceof Uint8Array?(0,pa.bufferFrom)(t):e==="buffer"?(0,pa.bufferFrom)(String(t),"utf8"):(0,pa.bufferFrom)(String(t),e)}a(cO,"dataToBuffer")});var Pw=T((Ji,Qi)=>{(function(t){var e=typeof Ji=="object"&&Ji&&!Ji.nodeType&&Ji,r=typeof Qi=="object"&&Qi&&!Qi.nodeType&&Qi,i=typeof globalThis=="object"&&globalThis;(i.global===i||i.window===i||i.self===i)&&(t=i);var n,o=2147483647,s=36,l=1,f=26,c=38,u=700,h=72,d=128,p="-",m=/^xn--/,w=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=s-l,F=Math.floor,O=String.fromCharCode,S;function R($){throw new RangeError(v[$])}a(R,"error");function b($,q){for(var G=$.length,X=[];G--;)X[G]=q($[G]);return X}a(b,"map");function x($,q){var G=$.split("@"),X="";G.length>1&&(X=G[0]+"@",$=G[1]),$=$.replace(y,".");var z=$.split("."),fe=b(z,q).join(".");return X+fe}a(x,"mapDomain");function _($){for(var q=[],G=0,X=$.length,z,fe;G<X;)z=$.charCodeAt(G++),z>=55296&&z<=56319&&G<X?(fe=$.charCodeAt(G++),(fe&64512)==56320?q.push(((z&1023)<<10)+(fe&1023)+65536):(q.push(z),G--)):q.push(z);return q}a(_,"ucs2decode");function P($){return b($,function(q){var G="";return q>65535&&(q-=65536,G+=O(q>>>10&1023|55296),q=56320|q&1023),G+=O(q),G}).join("")}a(P,"ucs2encode");function k($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:s}a(k,"basicToDigit");function C($,q){return $+22+75*($<26)-((q!=0)<<5)}a(C,"digitToBasic");function N($,q,G){var X=0;for($=G?F($/u):$>>1,$+=F($/q);$>g*f>>1;X+=s)$=F($/g);return F(X+(g+1)*$/($+c))}a(N,"adapt");function U($){var q=[],G=$.length,X,z=0,fe=d,ee=h,Oe,Re,se,Rt,ve,Ve,Be,Y,he;for(Oe=$.lastIndexOf(p),Oe<0&&(Oe=0),Re=0;Re<Oe;++Re)$.charCodeAt(Re)>=128&&R("not-basic"),q.push($.charCodeAt(Re));for(se=Oe>0?Oe+1:0;se<G;){for(Rt=z,ve=1,Ve=s;se>=G&&R("invalid-input"),Be=k($.charCodeAt(se++)),(Be>=s||Be>F((o-z)/ve))&&R("overflow"),z+=Be*ve,Y=Ve<=ee?l:Ve>=ee+f?f:Ve-ee,!(Be<Y);Ve+=s)he=s-Y,ve>F(o/he)&&R("overflow"),ve*=he;X=q.length+1,ee=N(z-Rt,X,Rt==0),F(z/X)>o-fe&&R("overflow"),fe+=F(z/X),z%=X,q.splice(z++,0,fe)}return P(q)}a(U,"decode");function Z($){var q,G,X,z,fe,ee,Oe,Re,se,Rt,ve,Ve=[],Be,Y,he,je;for($=_($),Be=$.length,q=d,G=0,fe=h,ee=0;ee<Be;++ee)ve=$[ee],ve<128&&Ve.push(O(ve));for(X=z=Ve.length,z&&Ve.push(p);X<Be;){for(Oe=o,ee=0;ee<Be;++ee)ve=$[ee],ve>=q&&ve<Oe&&(Oe=ve);for(Y=X+1,Oe-q>F((o-G)/Y)&&R("overflow"),G+=(Oe-q)*Y,q=Oe,ee=0;ee<Be;++ee)if(ve=$[ee],ve<q&&++G>o&&R("overflow"),ve==q){for(Re=G,se=s;Rt=se<=fe?l:se>=fe+f?f:se-fe,!(Re<Rt);se+=s)je=Re-Rt,he=s-Rt,Ve.push(O(C(Rt+je%he,0))),Re=F(je/he);Ve.push(O(C(Re,0))),fe=N(G,Y,X==z),G=0,++X}++G,++q}return Ve.join("")}a(Z,"encode");function me($){return x($,function(q){return m.test(q)?U(q.slice(4).toLowerCase()):q})}a(me,"toUnicode");function Ee($){return x($,function(q){return w.test(q)?"xn--"+Z(q):q})}if(a(Ee,"toASCII"),n={version:"1.4.1",ucs2:{decode:_,encode:P},decode:U,encode:Z,toASCII:Ee,toUnicode:me},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return n});else if(e&&r)if(Qi.exports==e)r.exports=n;else for(S in n)n.hasOwnProperty(S)&&(e[S]=n[S]);else t.punycode=n})(Ji)});var Ht=T((F8,Aw)=>{"use strict";Aw.exports=TypeError});var Iw=T(()=>{});var go=T((x8,Jw)=>{var gu=typeof Map=="function"&&Map.prototype,cu=Object.getOwnPropertyDescriptor&&gu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ba=gu&&cu&&typeof cu.get=="function"?cu.get:null,Dw=gu&&Map.prototype.forEach,bu=typeof Set=="function"&&Set.prototype,fu=Object.getOwnPropertyDescriptor&&bu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,va=bu&&fu&&typeof fu.get=="function"?fu.get:null,Cw=bu&&Set.prototype.forEach,fO=typeof WeakMap=="function"&&WeakMap.prototype,mo=fO?WeakMap.prototype.has:null,uO=typeof WeakSet=="function"&&WeakSet.prototype,wo=uO?WeakSet.prototype.has:null,hO=typeof WeakRef=="function"&&WeakRef.prototype,Nw=hO?WeakRef.prototype.deref:null,dO=Boolean.prototype.valueOf,pO=Object.prototype.toString,mO=Function.prototype.toString,wO=String.prototype.match,vu=String.prototype.slice,Pr=String.prototype.replace,yO=String.prototype.toUpperCase,Bw=String.prototype.toLowerCase,Ww=RegExp.prototype.test,Lw=Array.prototype.concat,qt=Array.prototype.join,gO=Array.prototype.slice,$w=Math.floor,du=typeof BigInt=="function"?BigInt.prototype.valueOf:null,uu=Object.getOwnPropertySymbols,pu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",yo=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||!0)?Symbol.toStringTag:null,Vw=Object.prototype.propertyIsEnumerable,Mw=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function jw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Ww.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-$w(-t):$w(t);if(i!==t){var n=String(i),o=vu.call(e,n.length+1);return Pr.call(n,r,"$&_")+"."+Pr.call(Pr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pr.call(e,r,"$&_")}a(jw,"addNumericSeparator");var mu=Iw(),Uw=mu.custom,Hw=Zw(Uw)?Uw:null,Gw={__proto__:null,double:'"',single:"'"},bO={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Jw.exports=a(function t(e,r,i,n){var o=r||{};if(lr(o,"quoteStyle")&&!lr(Gw,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=lr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Yw(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?jw(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return l?jw(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof e=="object")return wu(e)?"[Array]":"[Object]";var h=LO(o,i);if(typeof n>"u")n=[];else if(Xw(n,e)>=0)return"[Circular]";function d(N,U,Z){if(U&&(n=gO.call(n),n.push(U)),Z){var me={depth:o.depth};return lr(o,"quoteStyle")&&(me.quoteStyle=o.quoteStyle),t(N,me,i+1,n)}return t(N,o,i+1,n)}if(a(d,"inspect"),typeof e=="function"&&!qw(e)){var p=RO(e),m=ga(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+qt.call(m,", ")+" }":"")}if(Zw(e)){var w=en?Pr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):pu.call(e);return typeof e=="object"&&!en?po(w):w}if(CO(e)){for(var y="<"+Bw.call(String(e.nodeName)),v=e.attributes||[],g=0;g<v.length;g++)y+=" "+v[g].name+"="+Kw(vO(v[g].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+Bw.call(String(e.nodeName))+">",y}if(wu(e)){if(e.length===0)return"[]";var F=ga(e,d);return h&&!BO(F)?"["+yu(F,h)+"]":"[ "+qt.call(F,", ")+" ]"}if(FO(e)){var O=ga(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Vw.call(e,"cause")?"{ ["+String(e)+"] "+qt.call(Lw.call("[cause]: "+d(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+qt.call(O,", ")+" }"}if(typeof e=="object"&&s){if(Hw&&typeof e[Hw]=="function"&&mu)return mu(e,{depth:u-i});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(kO(e)){var S=[];return Dw&&Dw.call(e,function(N,U){S.push(d(U,e,!0)+" => "+d(N,e))}),zw("Map",ba.call(e),S,h)}if(IO(e)){var R=[];return Cw&&Cw.call(e,function(N){R.push(d(N,e))}),zw("Set",va.call(e),R,h)}if(PO(e))return hu("WeakMap");if(DO(e))return hu("WeakSet");if(AO(e))return hu("WeakRef");if(SO(e))return po(d(Number(e)));if(TO(e))return po(d(du.call(e)));if(xO(e))return po(dO.call(e));if(EO(e))return po(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof globalThis<"u"&&e===globalThis)return"{ [object globalThis] }";if(!_O(e)&&!qw(e)){var b=ga(e,d),x=Mw?Mw(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",P=!x&&yo&&Object(e)===e&&yo in e?vu.call(Ar(e),8,-1):_?"Object":"",k=x||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",C=k+(P||_?"["+qt.call(Lw.call([],P||[],_||[]),": ")+"] ":"");return b.length===0?C+"{}":h?C+"{"+yu(b,h)+"}":C+"{ "+qt.call(b,", ")+" }"}return String(e)},"inspect_");function Kw(t,e,r){var i=r.quoteStyle||e,n=Gw[i];return n+t+n}a(Kw,"wrapQuotes");function vO(t){return Pr.call(String(t),/"/g,""")}a(vO,"quote");function si(t){return!yo||!(typeof t=="object"&&(yo in t||typeof t[yo]<"u"))}a(si,"canTrustToString");function wu(t){return Ar(t)==="[object Array]"&&si(t)}a(wu,"isArray");function _O(t){return Ar(t)==="[object Date]"&&si(t)}a(_O,"isDate");function qw(t){return Ar(t)==="[object RegExp]"&&si(t)}a(qw,"isRegExp");function FO(t){return Ar(t)==="[object Error]"&&si(t)}a(FO,"isError");function EO(t){return Ar(t)==="[object String]"&&si(t)}a(EO,"isString");function SO(t){return Ar(t)==="[object Number]"&&si(t)}a(SO,"isNumber");function xO(t){return Ar(t)==="[object Boolean]"&&si(t)}a(xO,"isBoolean");function Zw(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!pu)return!1;try{return pu.call(t),!0}catch{}return!1}a(Zw,"isSymbol");function TO(t){if(!t||typeof t!="object"||!du)return!1;try{return du.call(t),!0}catch{}return!1}a(TO,"isBigInt");var OO=Object.prototype.hasOwnProperty||function(t){return t in this};function lr(t,e){return OO.call(t,e)}a(lr,"has");function Ar(t){return pO.call(t)}a(Ar,"toStr");function RO(t){if(t.name)return t.name;var e=wO.call(mO.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}a(RO,"nameOf");function Xw(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Xw,"indexOf");function kO(t){if(!ba||!t||typeof t!="object")return!1;try{ba.call(t);try{va.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}a(kO,"isMap");function PO(t){if(!mo||!t||typeof t!="object")return!1;try{mo.call(t,mo);try{wo.call(t,wo)}catch{return!0}return t instanceof WeakMap}catch{}return!1}a(PO,"isWeakMap");function AO(t){if(!Nw||!t||typeof t!="object")return!1;try{return Nw.call(t),!0}catch{}return!1}a(AO,"isWeakRef");function IO(t){if(!va||!t||typeof t!="object")return!1;try{va.call(t);try{ba.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}a(IO,"isSet");function DO(t){if(!wo||!t||typeof t!="object")return!1;try{wo.call(t,wo);try{mo.call(t,mo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}a(DO,"isWeakSet");function CO(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}a(CO,"isElement");function Yw(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return Yw(vu.call(t,0,e.maxStringLength),e)+i}var n=bO[e.quoteStyle||"single"];n.lastIndex=0;var o=Pr.call(Pr.call(t,n,"\\$1"),/[\x00-\x1f]/g,NO);return Kw(o,"single",e)}a(Yw,"inspectString");function NO(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+yO.call(e.toString(16))}a(NO,"lowbyte");function po(t){return"Object("+t+")"}a(po,"markBoxed");function hu(t){return t+" { ? }"}a(hu,"weakCollectionOf");function zw(t,e,r,i){var n=i?yu(r,i):qt.call(r,", ");return t+" ("+e+") {"+n+"}"}a(zw,"collectionOf");function BO(t){for(var e=0;e<t.length;e++)if(Xw(t[e],`
|
|
5
|
-
`)>=0)return!1;return!0}a(
|
|
4
|
+
var _x=Object.create;var $i=Object.defineProperty;var Fx=Object.getOwnPropertyDescriptor;var Ex=Object.getOwnPropertyNames;var Sx=Object.getPrototypeOf,xx=Object.prototype.hasOwnProperty;var Tx=(t,e,r)=>e in t?$i(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var a=(t,e)=>$i(t,"name",{value:e,configurable:!0}),Ox=(t=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(t,{get:(e,r)=>(typeof require<"u"?require:e)[r]}):t)(function(t){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+t+'" is not supported')});var Rx=(t,e)=>()=>(t&&(e=t(t=0)),e);var T=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),kx=(t,e)=>{for(var r in e)$i(t,r,{get:e[r],enumerable:!0})},gm=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Ex(e))!xx.call(t,n)&&n!==r&&$i(t,n,{get:()=>e[n],enumerable:!(i=Fx(e,n))||i.enumerable});return t};var ae=(t,e,r)=>(r=t!=null?_x(Sx(t)):{},gm(e||!t||!t.__esModule?$i(r,"default",{value:t,enumerable:!0}):r,t)),bm=t=>gm($i({},"__esModule",{value:!0}),t);var H=(t,e,r)=>Tx(t,typeof e!="symbol"?e+"":e,r);var Sr=T((AM,_m)=>{"use strict";function Mt(t){if(typeof t!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(t))}a(Mt,"assertPath");function vm(t,e){for(var r="",i=0,n=-1,o=0,s,l=0;l<=t.length;++l){if(l<t.length)s=t.charCodeAt(l);else{if(s===47)break;s=47}if(s===47){if(!(n===l-1||o===1))if(n!==l-1&&o===2){if(r.length<2||i!==2||r.charCodeAt(r.length-1)!==46||r.charCodeAt(r.length-2)!==46){if(r.length>2){var f=r.lastIndexOf("/");if(f!==r.length-1){f===-1?(r="",i=0):(r=r.slice(0,f),i=r.length-1-r.lastIndexOf("/")),n=l,o=0;continue}}else if(r.length===2||r.length===1){r="",i=0,n=l,o=0;continue}}e&&(r.length>0?r+="/..":r="..",i=2)}else r.length>0?r+="/"+t.slice(n+1,l):r=t.slice(n+1,l),i=l-n-1;n=l,o=0}else s===46&&o!==-1?++o:o=-1}return r}a(vm,"normalizeStringPosix");function Px(t,e){var r=e.dir||e.root,i=e.base||(e.name||"")+(e.ext||"");return r?r===e.root?r+i:r+t+i:i}a(Px,"_format");var Mi={resolve:a(function(){for(var e="",r=!1,i,n=arguments.length-1;n>=-1&&!r;n--){var o;n>=0?o=arguments[n]:(i===void 0&&(i=process.cwd()),o=i),Mt(o),o.length!==0&&(e=o+"/"+e,r=o.charCodeAt(0)===47)}return e=vm(e,!r),r?e.length>0?"/"+e:"/":e.length>0?e:"."},"resolve"),normalize:a(function(e){if(Mt(e),e.length===0)return".";var r=e.charCodeAt(0)===47,i=e.charCodeAt(e.length-1)===47;return e=vm(e,!r),e.length===0&&!r&&(e="."),e.length>0&&i&&(e+="/"),r?"/"+e:e},"normalize"),isAbsolute:a(function(e){return Mt(e),e.length>0&&e.charCodeAt(0)===47},"isAbsolute"),join:a(function(){if(arguments.length===0)return".";for(var e,r=0;r<arguments.length;++r){var i=arguments[r];Mt(i),i.length>0&&(e===void 0?e=i:e+="/"+i)}return e===void 0?".":Mi.normalize(e)},"join"),relative:a(function(e,r){if(Mt(e),Mt(r),e===r||(e=Mi.resolve(e),r=Mi.resolve(r),e===r))return"";for(var i=1;i<e.length&&e.charCodeAt(i)===47;++i);for(var n=e.length,o=n-i,s=1;s<r.length&&r.charCodeAt(s)===47;++s);for(var l=r.length,f=l-s,c=o<f?o:f,u=-1,h=0;h<=c;++h){if(h===c){if(f>c){if(r.charCodeAt(s+h)===47)return r.slice(s+h+1);if(h===0)return r.slice(s+h)}else o>c&&(e.charCodeAt(i+h)===47?u=h:h===0&&(u=0));break}var d=e.charCodeAt(i+h),p=r.charCodeAt(s+h);if(d!==p)break;d===47&&(u=h)}var m="";for(h=i+u+1;h<=n;++h)(h===n||e.charCodeAt(h)===47)&&(m.length===0?m+="..":m+="/..");return m.length>0?m+r.slice(s+u):(s+=u,r.charCodeAt(s)===47&&++s,r.slice(s))},"relative"),_makeLong:a(function(e){return e},"_makeLong"),dirname:a(function(e){if(Mt(e),e.length===0)return".";for(var r=e.charCodeAt(0),i=r===47,n=-1,o=!0,s=e.length-1;s>=1;--s)if(r=e.charCodeAt(s),r===47){if(!o){n=s;break}}else o=!1;return n===-1?i?"/":".":i&&n===1?"//":e.slice(0,n)},"dirname"),basename:a(function(e,r){if(r!==void 0&&typeof r!="string")throw new TypeError('"ext" argument must be a string');Mt(e);var i=0,n=-1,o=!0,s;if(r!==void 0&&r.length>0&&r.length<=e.length){if(r.length===e.length&&r===e)return"";var l=r.length-1,f=-1;for(s=e.length-1;s>=0;--s){var c=e.charCodeAt(s);if(c===47){if(!o){i=s+1;break}}else f===-1&&(o=!1,f=s+1),l>=0&&(c===r.charCodeAt(l)?--l===-1&&(n=s):(l=-1,n=f))}return i===n?n=f:n===-1&&(n=e.length),e.slice(i,n)}else{for(s=e.length-1;s>=0;--s)if(e.charCodeAt(s)===47){if(!o){i=s+1;break}}else n===-1&&(o=!1,n=s+1);return n===-1?"":e.slice(i,n)}},"basename"),extname:a(function(e){Mt(e);for(var r=-1,i=0,n=-1,o=!0,s=0,l=e.length-1;l>=0;--l){var f=e.charCodeAt(l);if(f===47){if(!o){i=l+1;break}continue}n===-1&&(o=!1,n=l+1),f===46?r===-1?r=l:s!==1&&(s=1):r!==-1&&(s=-1)}return r===-1||n===-1||s===0||s===1&&r===n-1&&r===i+1?"":e.slice(r,n)},"extname"),format:a(function(e){if(e===null||typeof e!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof e);return Px("/",e)},"format"),parse:a(function(e){Mt(e);var r={root:"",dir:"",base:"",ext:"",name:""};if(e.length===0)return r;var i=e.charCodeAt(0),n=i===47,o;n?(r.root="/",o=1):o=0;for(var s=-1,l=0,f=-1,c=!0,u=e.length-1,h=0;u>=o;--u){if(i=e.charCodeAt(u),i===47){if(!c){l=u+1;break}continue}f===-1&&(c=!1,f=u+1),i===46?s===-1?s=u:h!==1&&(h=1):s!==-1&&(h=-1)}return s===-1||f===-1||h===0||h===1&&s===f-1&&s===l+1?f!==-1&&(l===0&&n?r.base=r.name=e.slice(1,f):r.base=r.name=e.slice(l,f)):(l===0&&n?(r.name=e.slice(1,s),r.base=e.slice(1,f)):(r.name=e.slice(l,s),r.base=e.slice(l,f)),r.ext=e.slice(s,f)),l>0?r.dir=e.slice(0,l-1):n&&(r.dir="/"),r},"parse"),sep:"/",delimiter:":",win32:null,posix:null};Mi.posix=Mi;_m.exports=Mi});var Pt=T(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.constants=Ui.SEP=void 0;Ui.SEP="/";Ui.constants={O_RDONLY:0,O_WRONLY:1,O_RDWR:2,S_IFMT:61440,S_IFREG:32768,S_IFDIR:16384,S_IFCHR:8192,S_IFBLK:24576,S_IFIFO:4096,S_IFLNK:40960,S_IFSOCK:49152,O_CREAT:64,O_EXCL:128,O_NOCTTY:256,O_TRUNC:512,O_APPEND:1024,O_DIRECTORY:65536,O_NOATIME:262144,O_NOFOLLOW:131072,O_SYNC:1052672,O_SYMLINK:2097152,O_DIRECT:16384,O_NONBLOCK:2048,S_IRWXU:448,S_IRUSR:256,S_IWUSR:128,S_IXUSR:64,S_IRWXG:56,S_IRGRP:32,S_IWGRP:16,S_IXGRP:8,S_IRWXO:7,S_IROTH:4,S_IWOTH:2,S_IXOTH:1,F_OK:0,R_OK:4,W_OK:2,X_OK:1,UV_FS_SYMLINK_DIR:1,UV_FS_SYMLINK_JUNCTION:2,UV_FS_COPYFILE_EXCL:1,UV_FS_COPYFILE_FICLONE:2,UV_FS_COPYFILE_FICLONE_FORCE:4,COPYFILE_EXCL:1,COPYFILE_FICLONE:2,COPYFILE_FICLONE_FORCE:4}});var Tf=T(lo=>{"use strict";Object.defineProperty(lo,"__esModule",{value:!0});lo.Stats=void 0;var Ax=Pt(),{S_IFMT:Ix,S_IFDIR:Dx,S_IFREG:Cx,S_IFBLK:Nx,S_IFCHR:Bx,S_IFLNK:Lx,S_IFIFO:$x,S_IFSOCK:Mx}=Ax.constants,Hs=class Hs{static build(e,r=!1){let i=new Hs,{uid:n,gid:o,atime:s,mtime:l,ctime:f}=e,c=r?h=>BigInt(h):h=>h;i.uid=c(n),i.gid=c(o),i.rdev=c(e.rdev),i.blksize=c(4096),i.ino=c(e.ino),i.size=c(e.getSize()),i.blocks=c(1),i.atime=s,i.mtime=l,i.ctime=f,i.birthtime=f,i.atimeMs=c(s.getTime()),i.mtimeMs=c(l.getTime());let u=c(f.getTime());if(i.ctimeMs=u,i.birthtimeMs=u,r){i.atimeNs=BigInt(s.getTime())*BigInt(1e6),i.mtimeNs=BigInt(l.getTime())*BigInt(1e6);let h=BigInt(f.getTime())*BigInt(1e6);i.ctimeNs=h,i.birthtimeNs=h}return i.dev=c(0),i.mode=c(e.mode),i.nlink=c(e.nlink),i}_checkModeProperty(e){return(Number(this.mode)&Ix)===e}isDirectory(){return this._checkModeProperty(Dx)}isFile(){return this._checkModeProperty(Cx)}isBlockDevice(){return this._checkModeProperty(Nx)}isCharacterDevice(){return this._checkModeProperty(Bx)}isSymbolicLink(){return this._checkModeProperty(Lx)}isFIFO(){return this._checkModeProperty($x)}isSocket(){return this._checkModeProperty(Mx)}};a(Hs,"Stats");var Us=Hs;lo.Stats=Us;lo.default=Us});var Sm=T(qs=>{"use strict";qs.byteLength=Ux;qs.toByteArray=qx;qs.fromByteArray=Vx;var jt=[],ht=[],jx=typeof Uint8Array<"u"?Uint8Array:Array,Of="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(ri=0,Fm=Of.length;ri<Fm;++ri)jt[ri]=Of[ri],ht[Of.charCodeAt(ri)]=ri;var ri,Fm;ht[45]=62;ht[95]=63;function Em(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var i=r===e?0:4-r%4;return[r,i]}a(Em,"getLens");function Ux(t){var e=Em(t),r=e[0],i=e[1];return(r+i)*3/4-i}a(Ux,"byteLength");function Hx(t,e,r){return(e+r)*3/4-r}a(Hx,"_byteLength");function qx(t){var e,r=Em(t),i=r[0],n=r[1],o=new jx(Hx(t,i,n)),s=0,l=n>0?i-4:i,f;for(f=0;f<l;f+=4)e=ht[t.charCodeAt(f)]<<18|ht[t.charCodeAt(f+1)]<<12|ht[t.charCodeAt(f+2)]<<6|ht[t.charCodeAt(f+3)],o[s++]=e>>16&255,o[s++]=e>>8&255,o[s++]=e&255;return n===2&&(e=ht[t.charCodeAt(f)]<<2|ht[t.charCodeAt(f+1)]>>4,o[s++]=e&255),n===1&&(e=ht[t.charCodeAt(f)]<<10|ht[t.charCodeAt(f+1)]<<4|ht[t.charCodeAt(f+2)]>>2,o[s++]=e>>8&255,o[s++]=e&255),o}a(qx,"toByteArray");function zx(t){return jt[t>>18&63]+jt[t>>12&63]+jt[t>>6&63]+jt[t&63]}a(zx,"tripletToBase64");function Wx(t,e,r){for(var i,n=[],o=e;o<r;o+=3)i=(t[o]<<16&16711680)+(t[o+1]<<8&65280)+(t[o+2]&255),n.push(zx(i));return n.join("")}a(Wx,"encodeChunk");function Vx(t){for(var e,r=t.length,i=r%3,n=[],o=16383,s=0,l=r-i;s<l;s+=o)n.push(Wx(t,s,s+o>l?l:s+o));return i===1?(e=t[r-1],n.push(jt[e>>2]+jt[e<<4&63]+"==")):i===2&&(e=(t[r-2]<<8)+t[r-1],n.push(jt[e>>10]+jt[e>>4&63]+jt[e<<2&63]+"=")),n.join("")}a(Vx,"fromByteArray")});var xm=T(Rf=>{Rf.read=function(t,e,r,i,n){var o,s,l=n*8-i-1,f=(1<<l)-1,c=f>>1,u=-7,h=r?n-1:0,d=r?-1:1,p=t[e+h];for(h+=d,o=p&(1<<-u)-1,p>>=-u,u+=l;u>0;o=o*256+t[e+h],h+=d,u-=8);for(s=o&(1<<-u)-1,o>>=-u,u+=i;u>0;s=s*256+t[e+h],h+=d,u-=8);if(o===0)o=1-c;else{if(o===f)return s?NaN:(p?-1:1)*(1/0);s=s+Math.pow(2,i),o=o-c}return(p?-1:1)*s*Math.pow(2,o-i)};Rf.write=function(t,e,r,i,n,o){var s,l,f,c=o*8-n-1,u=(1<<c)-1,h=u>>1,d=n===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=i?0:o-1,m=i?1:-1,w=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(l=isNaN(e)?1:0,s=u):(s=Math.floor(Math.log(e)/Math.LN2),e*(f=Math.pow(2,-s))<1&&(s--,f*=2),s+h>=1?e+=d/f:e+=d*Math.pow(2,1-h),e*f>=2&&(s++,f/=2),s+h>=u?(l=0,s=u):s+h>=1?(l=(e*f-1)*Math.pow(2,n),s=s+h):(l=e*Math.pow(2,h-1)*Math.pow(2,n),s=0));n>=8;t[r+p]=l&255,p+=m,l/=256,n-=8);for(s=s<<n|l,c+=n;c>0;t[r+p]=s&255,p+=m,s/=256,c-=8);t[r+p-m]|=w*128}});var ni=T(Wi=>{"use strict";var kf=Sm(),qi=xm(),Tm=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Wi.Buffer=A;Wi.SlowBuffer=Jx;Wi.INSPECT_MAX_BYTES=50;var zs=2147483647;Wi.kMaxLength=zs;A.TYPED_ARRAY_SUPPORT=Gx();!A.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 Gx(){try{let t=new Uint8Array(1),e={foo:a(function(){return 42},"foo")};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}a(Gx,"typedArraySupport");Object.defineProperty(A.prototype,"parent",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.buffer},"get")});Object.defineProperty(A.prototype,"offset",{enumerable:!0,get:a(function(){if(A.isBuffer(this))return this.byteOffset},"get")});function or(t){if(t>zs)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,A.prototype),e}a(or,"createBuffer");function A(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return Df(t)}return Pm(t,e,r)}a(A,"Buffer");A.poolSize=8192;function Pm(t,e,r){if(typeof t=="string")return Zx(t,e);if(ArrayBuffer.isView(t))return Xx(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(Ut(t,ArrayBuffer)||t&&Ut(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(Ut(t,SharedArrayBuffer)||t&&Ut(t.buffer,SharedArrayBuffer)))return Af(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let i=t.valueOf&&t.valueOf();if(i!=null&&i!==t)return A.from(i,e,r);let n=Yx(t);if(n)return n;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return A.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}a(Pm,"from");A.from=function(t,e,r){return Pm(t,e,r)};Object.setPrototypeOf(A.prototype,Uint8Array.prototype);Object.setPrototypeOf(A,Uint8Array);function Am(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"')}a(Am,"assertSize");function Kx(t,e,r){return Am(t),t<=0?or(t):e!==void 0?typeof r=="string"?or(t).fill(e,r):or(t).fill(e):or(t)}a(Kx,"alloc");A.alloc=function(t,e,r){return Kx(t,e,r)};function Df(t){return Am(t),or(t<0?0:Cf(t)|0)}a(Df,"allocUnsafe");A.allocUnsafe=function(t){return Df(t)};A.allocUnsafeSlow=function(t){return Df(t)};function Zx(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!A.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=Im(t,e)|0,i=or(r),n=i.write(t,e);return n!==r&&(i=i.slice(0,n)),i}a(Zx,"fromString");function Pf(t){let e=t.length<0?0:Cf(t.length)|0,r=or(e);for(let i=0;i<e;i+=1)r[i]=t[i]&255;return r}a(Pf,"fromArrayLike");function Xx(t){if(Ut(t,Uint8Array)){let e=new Uint8Array(t);return Af(e.buffer,e.byteOffset,e.byteLength)}return Pf(t)}a(Xx,"fromArrayView");function Af(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let i;return e===void 0&&r===void 0?i=new Uint8Array(t):r===void 0?i=new Uint8Array(t,e):i=new Uint8Array(t,e,r),Object.setPrototypeOf(i,A.prototype),i}a(Af,"fromArrayBuffer");function Yx(t){if(A.isBuffer(t)){let e=Cf(t.length)|0,r=or(e);return r.length===0||t.copy(r,0,0,e),r}if(t.length!==void 0)return typeof t.length!="number"||Bf(t.length)?or(0):Pf(t);if(t.type==="Buffer"&&Array.isArray(t.data))return Pf(t.data)}a(Yx,"fromObject");function Cf(t){if(t>=zs)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+zs.toString(16)+" bytes");return t|0}a(Cf,"checked");function Jx(t){return+t!=t&&(t=0),A.alloc(+t)}a(Jx,"SlowBuffer");A.isBuffer=a(function(e){return e!=null&&e._isBuffer===!0&&e!==A.prototype},"isBuffer");A.compare=a(function(e,r){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),Ut(r,Uint8Array)&&(r=A.from(r,r.offset,r.byteLength)),!A.isBuffer(e)||!A.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let i=e.length,n=r.length;for(let o=0,s=Math.min(i,n);o<s;++o)if(e[o]!==r[o]){i=e[o],n=r[o];break}return i<n?-1:n<i?1:0},"compare");A.isEncoding=a(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");A.concat=a(function(e,r){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return A.alloc(0);let i;if(r===void 0)for(r=0,i=0;i<e.length;++i)r+=e[i].length;let n=A.allocUnsafe(r),o=0;for(i=0;i<e.length;++i){let s=e[i];if(Ut(s,Uint8Array))o+s.length>n.length?(A.isBuffer(s)||(s=A.from(s)),s.copy(n,o)):Uint8Array.prototype.set.call(n,s,o);else if(A.isBuffer(s))s.copy(n,o);else throw new TypeError('"list" argument must be an Array of Buffers');o+=s.length}return n},"concat");function Im(t,e){if(A.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||Ut(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,i=arguments.length>2&&arguments[2]===!0;if(!i&&r===0)return 0;let n=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return If(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return Um(t).length;default:if(n)return i?-1:If(t).length;e=(""+e).toLowerCase(),n=!0}}a(Im,"byteLength");A.byteLength=Im;function Qx(t,e,r){let i=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return cT(this,e,r);case"utf8":case"utf-8":return Cm(this,e,r);case"ascii":return aT(this,e,r);case"latin1":case"binary":return lT(this,e,r);case"base64":return oT(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return fT(this,e,r);default:if(i)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),i=!0}}a(Qx,"slowToString");A.prototype._isBuffer=!0;function ii(t,e,r){let i=t[e];t[e]=t[r],t[r]=i}a(ii,"swap");A.prototype.swap16=a(function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;r<e;r+=2)ii(this,r,r+1);return this},"swap16");A.prototype.swap32=a(function(){let e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let r=0;r<e;r+=4)ii(this,r,r+3),ii(this,r+1,r+2);return this},"swap32");A.prototype.swap64=a(function(){let e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let r=0;r<e;r+=8)ii(this,r,r+7),ii(this,r+1,r+6),ii(this,r+2,r+5),ii(this,r+3,r+4);return this},"swap64");A.prototype.toString=a(function(){let e=this.length;return e===0?"":arguments.length===0?Cm(this,0,e):Qx.apply(this,arguments)},"toString");A.prototype.toLocaleString=A.prototype.toString;A.prototype.equals=a(function(e){if(!A.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e?!0:A.compare(this,e)===0},"equals");A.prototype.inspect=a(function(){let e="",r=Wi.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},"inspect");Tm&&(A.prototype[Tm]=A.prototype.inspect);A.prototype.compare=a(function(e,r,i,n,o){if(Ut(e,Uint8Array)&&(e=A.from(e,e.offset,e.byteLength)),!A.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),i===void 0&&(i=e?e.length:0),n===void 0&&(n=0),o===void 0&&(o=this.length),r<0||i>e.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&r>=i)return 0;if(n>=o)return-1;if(r>=i)return 1;if(r>>>=0,i>>>=0,n>>>=0,o>>>=0,this===e)return 0;let s=o-n,l=i-r,f=Math.min(s,l),c=this.slice(n,o),u=e.slice(r,i);for(let h=0;h<f;++h)if(c[h]!==u[h]){s=c[h],l=u[h];break}return s<l?-1:l<s?1:0},"compare");function Dm(t,e,r,i,n){if(t.length===0)return-1;if(typeof r=="string"?(i=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,Bf(r)&&(r=n?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(n)return-1;r=t.length-1}else if(r<0)if(n)r=0;else return-1;if(typeof e=="string"&&(e=A.from(e,i)),A.isBuffer(e))return e.length===0?-1:Om(t,e,r,i,n);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?n?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):Om(t,[e],r,i,n);throw new TypeError("val must be string, number or Buffer")}a(Dm,"bidirectionalIndexOf");function Om(t,e,r,i,n){let o=1,s=t.length,l=e.length;if(i!==void 0&&(i=String(i).toLowerCase(),i==="ucs2"||i==="ucs-2"||i==="utf16le"||i==="utf-16le")){if(t.length<2||e.length<2)return-1;o=2,s/=2,l/=2,r/=2}function f(u,h){return o===1?u[h]:u.readUInt16BE(h*o)}a(f,"read");let c;if(n){let u=-1;for(c=r;c<s;c++)if(f(t,c)===f(e,u===-1?0:c-u)){if(u===-1&&(u=c),c-u+1===l)return u*o}else u!==-1&&(c-=c-u),u=-1}else for(r+l>s&&(r=s-l),c=r;c>=0;c--){let u=!0;for(let h=0;h<l;h++)if(f(t,c+h)!==f(e,h)){u=!1;break}if(u)return c}return-1}a(Om,"arrayIndexOf");A.prototype.includes=a(function(e,r,i){return this.indexOf(e,r,i)!==-1},"includes");A.prototype.indexOf=a(function(e,r,i){return Dm(this,e,r,i,!0)},"indexOf");A.prototype.lastIndexOf=a(function(e,r,i){return Dm(this,e,r,i,!1)},"lastIndexOf");function eT(t,e,r,i){r=Number(r)||0;let n=t.length-r;i?(i=Number(i),i>n&&(i=n)):i=n;let o=e.length;i>o/2&&(i=o/2);let s;for(s=0;s<i;++s){let l=parseInt(e.substr(s*2,2),16);if(Bf(l))return s;t[r+s]=l}return s}a(eT,"hexWrite");function tT(t,e,r,i){return Ws(If(e,t.length-r),t,r,i)}a(tT,"utf8Write");function rT(t,e,r,i){return Ws(pT(e),t,r,i)}a(rT,"asciiWrite");function iT(t,e,r,i){return Ws(Um(e),t,r,i)}a(iT,"base64Write");function nT(t,e,r,i){return Ws(mT(e,t.length-r),t,r,i)}a(nT,"ucs2Write");A.prototype.write=a(function(e,r,i,n){if(r===void 0)n="utf8",i=this.length,r=0;else if(i===void 0&&typeof r=="string")n=r,i=this.length,r=0;else if(isFinite(r))r=r>>>0,isFinite(i)?(i=i>>>0,n===void 0&&(n="utf8")):(n=i,i=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let o=this.length-r;if((i===void 0||i>o)&&(i=o),e.length>0&&(i<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let s=!1;for(;;)switch(n){case"hex":return eT(this,e,r,i);case"utf8":case"utf-8":return tT(this,e,r,i);case"ascii":case"latin1":case"binary":return rT(this,e,r,i);case"base64":return iT(this,e,r,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return nT(this,e,r,i);default:if(s)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),s=!0}},"write");A.prototype.toJSON=a(function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}},"toJSON");function oT(t,e,r){return e===0&&r===t.length?kf.fromByteArray(t):kf.fromByteArray(t.slice(e,r))}a(oT,"base64Slice");function Cm(t,e,r){r=Math.min(t.length,r);let i=[],n=e;for(;n<r;){let o=t[n],s=null,l=o>239?4:o>223?3:o>191?2:1;if(n+l<=r){let f,c,u,h;switch(l){case 1:o<128&&(s=o);break;case 2:f=t[n+1],(f&192)===128&&(h=(o&31)<<6|f&63,h>127&&(s=h));break;case 3:f=t[n+1],c=t[n+2],(f&192)===128&&(c&192)===128&&(h=(o&15)<<12|(f&63)<<6|c&63,h>2047&&(h<55296||h>57343)&&(s=h));break;case 4:f=t[n+1],c=t[n+2],u=t[n+3],(f&192)===128&&(c&192)===128&&(u&192)===128&&(h=(o&15)<<18|(f&63)<<12|(c&63)<<6|u&63,h>65535&&h<1114112&&(s=h))}}s===null?(s=65533,l=1):s>65535&&(s-=65536,i.push(s>>>10&1023|55296),s=56320|s&1023),i.push(s),n+=l}return sT(i)}a(Cm,"utf8Slice");var Rm=4096;function sT(t){let e=t.length;if(e<=Rm)return String.fromCharCode.apply(String,t);let r="",i=0;for(;i<e;)r+=String.fromCharCode.apply(String,t.slice(i,i+=Rm));return r}a(sT,"decodeCodePointsArray");function aT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]&127);return i}a(aT,"asciiSlice");function lT(t,e,r){let i="";r=Math.min(t.length,r);for(let n=e;n<r;++n)i+=String.fromCharCode(t[n]);return i}a(lT,"latin1Slice");function cT(t,e,r){let i=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>i)&&(r=i);let n="";for(let o=e;o<r;++o)n+=wT[t[o]];return n}a(cT,"hexSlice");function fT(t,e,r){let i=t.slice(e,r),n="";for(let o=0;o<i.length-1;o+=2)n+=String.fromCharCode(i[o]+i[o+1]*256);return n}a(fT,"utf16leSlice");A.prototype.slice=a(function(e,r){let i=this.length;e=~~e,r=r===void 0?i:~~r,e<0?(e+=i,e<0&&(e=0)):e>i&&(e=i),r<0?(r+=i,r<0&&(r=0)):r>i&&(r=i),r<e&&(r=e);let n=this.subarray(e,r);return Object.setPrototypeOf(n,A.prototype),n},"slice");function Ie(t,e,r){if(t%1!==0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}a(Ie,"checkOffset");A.prototype.readUintLE=A.prototype.readUIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return n},"readUIntLE");A.prototype.readUintBE=A.prototype.readUIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e+--r],o=1;for(;r>0&&(o*=256);)n+=this[e+--r]*o;return n},"readUIntBE");A.prototype.readUint8=A.prototype.readUInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]},"readUInt8");A.prototype.readUint16LE=A.prototype.readUInt16LE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]|this[e+1]<<8},"readUInt16LE");A.prototype.readUint16BE=A.prototype.readUInt16BE=a(function(e,r){return e=e>>>0,r||Ie(e,2,this.length),this[e]<<8|this[e+1]},"readUInt16BE");A.prototype.readUint32LE=A.prototype.readUInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216},"readUInt32LE");A.prototype.readUint32BE=A.prototype.readUInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])},"readUInt32BE");A.prototype.readBigUInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,o=this[++e]+this[++e]*2**8+this[++e]*2**16+i*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))},"readBigUInt64LE"));A.prototype.readBigUInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],o=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i;return(BigInt(n)<<BigInt(32))+BigInt(o)},"readBigUInt64BE"));A.prototype.readIntLE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=this[e],o=1,s=0;for(;++s<r&&(o*=256);)n+=this[e+s]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*r)),n},"readIntLE");A.prototype.readIntBE=a(function(e,r,i){e=e>>>0,r=r>>>0,i||Ie(e,r,this.length);let n=r,o=1,s=this[e+--n];for(;n>0&&(o*=256);)s+=this[e+--n]*o;return o*=128,s>=o&&(s-=Math.pow(2,8*r)),s},"readIntBE");A.prototype.readInt8=a(function(e,r){return e=e>>>0,r||Ie(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]},"readInt8");A.prototype.readInt16LE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e]|this[e+1]<<8;return i&32768?i|4294901760:i},"readInt16LE");A.prototype.readInt16BE=a(function(e,r){e=e>>>0,r||Ie(e,2,this.length);let i=this[e+1]|this[e]<<8;return i&32768?i|4294901760:i},"readInt16BE");A.prototype.readInt32LE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},"readInt32LE");A.prototype.readInt32BE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},"readInt32BE");A.prototype.readBigInt64LE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(i<<24);return(BigInt(n)<<BigInt(32))+BigInt(r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24)},"readBigInt64LE"));A.prototype.readBigInt64BE=xr(a(function(e){e=e>>>0,zi(e,"offset");let r=this[e],i=this[e+7];(r===void 0||i===void 0)&&co(e,this.length-8);let n=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(n)<<BigInt(32))+BigInt(this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+i)},"readBigInt64BE"));A.prototype.readFloatLE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!0,23,4)},"readFloatLE");A.prototype.readFloatBE=a(function(e,r){return e=e>>>0,r||Ie(e,4,this.length),qi.read(this,e,!1,23,4)},"readFloatBE");A.prototype.readDoubleLE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!0,52,8)},"readDoubleLE");A.prototype.readDoubleBE=a(function(e,r){return e=e>>>0,r||Ie(e,8,this.length),qi.read(this,e,!1,52,8)},"readDoubleBE");function Ye(t,e,r,i,n,o){if(!A.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||e<o)throw new RangeError('"value" argument is out of bounds');if(r+i>t.length)throw new RangeError("Index out of range")}a(Ye,"checkInt");A.prototype.writeUintLE=A.prototype.writeUIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=1,s=0;for(this[r]=e&255;++s<i&&(o*=256);)this[r+s]=e/o&255;return r+i},"writeUIntLE");A.prototype.writeUintBE=A.prototype.writeUIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,i=i>>>0,!n){let l=Math.pow(2,8*i)-1;Ye(this,e,r,i,l,0)}let o=i-1,s=1;for(this[r+o]=e&255;--o>=0&&(s*=256);)this[r+o]=e/s&255;return r+i},"writeUIntBE");A.prototype.writeUint8=A.prototype.writeUInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,255,0),this[r]=e&255,r+1},"writeUInt8");A.prototype.writeUint16LE=A.prototype.writeUInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeUInt16LE");A.prototype.writeUint16BE=A.prototype.writeUInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeUInt16BE");A.prototype.writeUint32LE=A.prototype.writeUInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4},"writeUInt32LE");A.prototype.writeUint32BE=A.prototype.writeUInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeUInt32BE");function Nm(t,e,r,i,n){jm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o,o=o>>8,t[r++]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,s=s>>8,t[r++]=s,r}a(Nm,"wrtBigUInt64LE");function Bm(t,e,r,i,n){jm(e,i,n,t,r,7);let o=Number(e&BigInt(4294967295));t[r+7]=o,o=o>>8,t[r+6]=o,o=o>>8,t[r+5]=o,o=o>>8,t[r+4]=o;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s=s>>8,t[r+2]=s,s=s>>8,t[r+1]=s,s=s>>8,t[r]=s,r+8}a(Bm,"wrtBigUInt64BE");A.prototype.writeBigUInt64LE=xr(a(function(e,r=0){return Nm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64LE"));A.prototype.writeBigUInt64BE=xr(a(function(e,r=0){return Bm(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))},"writeBigUInt64BE"));A.prototype.writeIntLE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=0,s=1,l=0;for(this[r]=e&255;++o<i&&(s*=256);)e<0&&l===0&&this[r+o-1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntLE");A.prototype.writeIntBE=a(function(e,r,i,n){if(e=+e,r=r>>>0,!n){let f=Math.pow(2,8*i-1);Ye(this,e,r,i,f-1,-f)}let o=i-1,s=1,l=0;for(this[r+o]=e&255;--o>=0&&(s*=256);)e<0&&l===0&&this[r+o+1]!==0&&(l=1),this[r+o]=(e/s>>0)-l&255;return r+i},"writeIntBE");A.prototype.writeInt8=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1},"writeInt8");A.prototype.writeInt16LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2},"writeInt16LE");A.prototype.writeInt16BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2},"writeInt16BE");A.prototype.writeInt32LE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4},"writeInt32LE");A.prototype.writeInt32BE=a(function(e,r,i){return e=+e,r=r>>>0,i||Ye(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4},"writeInt32BE");A.prototype.writeBigInt64LE=xr(a(function(e,r=0){return Nm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64LE"));A.prototype.writeBigInt64BE=xr(a(function(e,r=0){return Bm(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))},"writeBigInt64BE"));function Lm(t,e,r,i,n,o){if(r+i>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}a(Lm,"checkIEEE754");function $m(t,e,r,i,n){return e=+e,r=r>>>0,n||Lm(t,e,r,4,34028234663852886e22,-34028234663852886e22),qi.write(t,e,r,i,23,4),r+4}a($m,"writeFloat");A.prototype.writeFloatLE=a(function(e,r,i){return $m(this,e,r,!0,i)},"writeFloatLE");A.prototype.writeFloatBE=a(function(e,r,i){return $m(this,e,r,!1,i)},"writeFloatBE");function Mm(t,e,r,i,n){return e=+e,r=r>>>0,n||Lm(t,e,r,8,17976931348623157e292,-17976931348623157e292),qi.write(t,e,r,i,52,8),r+8}a(Mm,"writeDouble");A.prototype.writeDoubleLE=a(function(e,r,i){return Mm(this,e,r,!0,i)},"writeDoubleLE");A.prototype.writeDoubleBE=a(function(e,r,i){return Mm(this,e,r,!1,i)},"writeDoubleBE");A.prototype.copy=a(function(e,r,i,n){if(!A.isBuffer(e))throw new TypeError("argument should be a Buffer");if(i||(i=0),!n&&n!==0&&(n=this.length),r>=e.length&&(r=e.length),r||(r=0),n>0&&n<i&&(n=i),n===i||e.length===0||this.length===0)return 0;if(r<0)throw new RangeError("targetStart out of bounds");if(i<0||i>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-r<n-i&&(n=e.length-r+i);let o=n-i;return this===e&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(r,i,n):Uint8Array.prototype.set.call(e,this.subarray(i,n),r),o},"copy");A.prototype.fill=a(function(e,r,i,n){if(typeof e=="string"){if(typeof r=="string"?(n=r,r=0,i=this.length):typeof i=="string"&&(n=i,i=this.length),n!==void 0&&typeof n!="string")throw new TypeError("encoding must be a string");if(typeof n=="string"&&!A.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(e.length===1){let s=e.charCodeAt(0);(n==="utf8"&&s<128||n==="latin1")&&(e=s)}}else typeof e=="number"?e=e&255:typeof e=="boolean"&&(e=Number(e));if(r<0||this.length<r||this.length<i)throw new RangeError("Out of range index");if(i<=r)return this;r=r>>>0,i=i===void 0?this.length:i>>>0,e||(e=0);let o;if(typeof e=="number")for(o=r;o<i;++o)this[o]=e;else{let s=A.isBuffer(e)?e:A.from(e,n),l=s.length;if(l===0)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<i-r;++o)this[o+r]=s[o%l]}return this},"fill");var Hi={};function Nf(t,e,r){var i;Hi[t]=(i=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(o){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:o,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}},a(i,"NodeError"),i)}a(Nf,"E");Nf("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError);Nf("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError);Nf("ERR_OUT_OF_RANGE",function(t,e,r){let i=`The value of "${t}" is out of range.`,n=r;return Number.isInteger(r)&&Math.abs(r)>2**32?n=km(String(r)):typeof r=="bigint"&&(n=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(n=km(n)),n+="n"),i+=` It must be ${e}. Received ${n}`,i},RangeError);function km(t){let e="",r=t.length,i=t[0]==="-"?1:0;for(;r>=i+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}a(km,"addNumericalSeparator");function uT(t,e,r){zi(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&co(e,t.length-(r+1))}a(uT,"checkBounds");function jm(t,e,r,i,n,o){if(t>r||t<e){let s=typeof e=="bigint"?"n":"",l;throw o>3?e===0||e===BigInt(0)?l=`>= 0${s} and < 2${s} ** ${(o+1)*8}${s}`:l=`>= -(2${s} ** ${(o+1)*8-1}${s}) and < 2 ** ${(o+1)*8-1}${s}`:l=`>= ${e}${s} and <= ${r}${s}`,new Hi.ERR_OUT_OF_RANGE("value",l,t)}uT(i,n,o)}a(jm,"checkIntBI");function zi(t,e){if(typeof t!="number")throw new Hi.ERR_INVALID_ARG_TYPE(e,"number",t)}a(zi,"validateNumber");function co(t,e,r){throw Math.floor(t)!==t?(zi(t,r),new Hi.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Hi.ERR_BUFFER_OUT_OF_BOUNDS:new Hi.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}a(co,"boundsError");var hT=/[^+/0-9A-Za-z-_]/g;function dT(t){if(t=t.split("=")[0],t=t.trim().replace(hT,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}a(dT,"base64clean");function If(t,e){e=e||1/0;let r,i=t.length,n=null,o=[];for(let s=0;s<i;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!n){if(r>56319){(e-=3)>-1&&o.push(239,191,189);continue}else if(s+1===i){(e-=3)>-1&&o.push(239,191,189);continue}n=r;continue}if(r<56320){(e-=3)>-1&&o.push(239,191,189),n=r;continue}r=(n-55296<<10|r-56320)+65536}else n&&(e-=3)>-1&&o.push(239,191,189);if(n=null,r<128){if((e-=1)<0)break;o.push(r)}else if(r<2048){if((e-=2)<0)break;o.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;o.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return o}a(If,"utf8ToBytes");function pT(t){let e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r)&255);return e}a(pT,"asciiToBytes");function mT(t,e){let r,i,n,o=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),i=r>>8,n=r%256,o.push(n),o.push(i);return o}a(mT,"utf16leToBytes");function Um(t){return kf.toByteArray(dT(t))}a(Um,"base64ToBytes");function Ws(t,e,r,i){let n;for(n=0;n<i&&!(n+r>=e.length||n>=t.length);++n)e[n+r]=t[n];return n}a(Ws,"blitBuffer");function Ut(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}a(Ut,"isInstance");function Bf(t){return t!==t}a(Bf,"numberIsNaN");var wT=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let i=r*16;for(let n=0;n<16;++n)e[i+n]=t[r]+t[n]}return e}();function xr(t){return typeof BigInt>"u"?yT:t}a(xr,"defineBigIntMethod");function yT(){throw new Error("BigInt not supported")}a(yT,"BufferBigIntNotDefined")});var Hm=T(Vs=>{"use strict";Object.defineProperty(Vs,"__esModule",{value:!0});Vs.Buffer=void 0;var gT=ni();Object.defineProperty(Vs,"Buffer",{enumerable:!0,get:a(function(){return gT.Buffer},"get")})});var Or=T(Tr=>{"use strict";Object.defineProperty(Tr,"__esModule",{value:!0});Tr.bufferFrom=Tr.bufferAllocUnsafe=Tr.Buffer=void 0;var Gs=Hm();Object.defineProperty(Tr,"Buffer",{enumerable:!0,get:a(function(){return Gs.Buffer},"get")});function qm(t,...e){return new Gs.Buffer(t,...e)}a(qm,"bufferV0P12Ponyfill");var bT=Gs.Buffer.allocUnsafe||qm;Tr.bufferAllocUnsafe=bT;var vT=Gs.Buffer.from||qm;Tr.bufferFrom=vT});var $f=T(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.inherits=_T;Vi.promisify=FT;Vi.inspect=Lf;Vi.format=ET;function _T(t,e){if(t==null)throw new TypeError("The constructor to inherit from is not defined");if(e==null)throw new TypeError("The super constructor to inherit from is not defined");t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}})}a(_T,"inherits");function FT(t){if(typeof t!="function")throw new TypeError('The "original" argument must be of type function');return function(...e){return new Promise((r,i)=>{t.call(this,...e,(n,o)=>{n?i(n):r(o)})})}}a(FT,"promisify");function Lf(t){return t===null?"null":t===void 0?"undefined":typeof t=="string"?`'${t}'`:typeof t=="number"||typeof t=="boolean"?String(t):Array.isArray(t)?`[ ${t.map(r=>Lf(r)).join(", ")} ]`:typeof t=="object"?`{ ${Object.entries(t).map(([r,i])=>`${r}: ${Lf(i)}`).join(", ")} }`:String(t)}a(Lf,"inspect");function ET(t,...e){if(e.length===0)return t;let r=t,i=0;for(r=r.replace(/%[sdj%]/g,n=>{if(i>=e.length)return n;let o=e[i++];switch(n){case"%s":return String(o);case"%d":return Number(o).toString();case"%j":try{return JSON.stringify(o)}catch{return"[Circular]"}case"%%":return"%";default:return n}});i<e.length;)r+=" "+String(e[i++]);return r}a(ET,"format")});var fo=T(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.AssertionError=Ue.RangeError=Ue.TypeError=Ue.Error=void 0;Ue.message=Vm;Ue.E=Rr;var Mf=$f(),zm=typeof Symbol>"u"?"_kCode":Symbol("code"),Wm={};function Uf(t){var e;return e=class extends t{constructor(i,...n){super(Vm(i,n)),this.code=i,this[zm]=i,this.name=`${super.name} [${this[zm]}]`}},a(e,"NodeError"),e}a(Uf,"makeNodeError");var Ks=globalThis,Hf=class Hf extends Ks.Error{constructor(e){if(typeof e!="object"||e===null)throw new Ue.TypeError("ERR_INVALID_ARG_TYPE","options","object");e.message?super(e.message):super(`${(0,Mf.inspect)(e.actual).slice(0,128)} ${e.operator} ${(0,Mf.inspect)(e.expected).slice(0,128)}`),this.generatedMessage=!e.message,this.name="AssertionError [ERR_ASSERTION]",this.code="ERR_ASSERTION",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,Ue.Error.captureStackTrace(this,e.stackStartFunction)}};a(Hf,"AssertionError");var jf=Hf;Ue.AssertionError=jf;function Vm(t,e){if(typeof t!="string")throw new Ue.Error("Error message key must be a string");let r=Wm[t];if(!r)throw new Ue.Error(`An invalid error message key was used: ${t}.`);let i;if(typeof r=="function")i=r;else{if(i=Mf.format,e===void 0||e.length===0)return r;e.unshift(r)}return String(i.apply(null,e))}a(Vm,"message");function Rr(t,e){Wm[t]=typeof e=="function"?e:String(e)}a(Rr,"E");Ue.Error=Uf(Ks.Error);Ue.TypeError=Uf(Ks.TypeError);Ue.RangeError=Uf(Ks.RangeError);Rr("ERR_DIR_CLOSED","Directory handle was closed");Rr("ERR_DIR_CONCURRENT_OPERATION","Cannot do synchronous work on directory handle with concurrent asynchronous operations");Rr("ERR_INVALID_FILE_URL_HOST",'File URL host must be "localhost" or empty on %s');Rr("ERR_INVALID_FILE_URL_PATH","File URL path %s");Rr("ERR_INVALID_OPT_VALUE",(t,e)=>`The value "${String(e)}" is invalid for option "${t}"`);Rr("ERR_INVALID_OPT_VALUE_ENCODING",t=>`The value "${String(t)}" is invalid for option "encoding"`);Rr("ERR_INVALID_ARG_VALUE","Unable to open file as blob")});var uo=T(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.ENCODING_UTF8=void 0;oi.assertEncoding=xT;oi.strToEncoding=TT;var qf=Or(),ST=fo();oi.ENCODING_UTF8="utf8";function xT(t){if(t&&!qf.Buffer.isEncoding(t))throw new ST.TypeError("ERR_INVALID_OPT_VALUE_ENCODING",t)}a(xT,"assertEncoding");function TT(t,e){return!e||e===oi.ENCODING_UTF8?t:e==="buffer"?new qf.Buffer(t):new qf.Buffer(t).toString(e)}a(TT,"strToEncoding")});var Ys=T(ho=>{"use strict";Object.defineProperty(ho,"__esModule",{value:!0});ho.Dirent=void 0;var OT=Pt(),RT=uo(),{S_IFMT:kT,S_IFDIR:PT,S_IFREG:AT,S_IFBLK:IT,S_IFCHR:DT,S_IFLNK:CT,S_IFIFO:NT,S_IFSOCK:BT}=OT.constants,Xs=class Xs{constructor(){this.name="",this.path="",this.parentPath="",this.mode=0}static build(e,r){let i=new Xs,{mode:n}=e.getNode();return i.name=(0,RT.strToEncoding)(e.getName(),r),i.mode=n,i.path=e.getParentPath(),i.parentPath=i.path,i}_checkModeProperty(e){return(this.mode&kT)===e}isDirectory(){return this._checkModeProperty(PT)}isFile(){return this._checkModeProperty(AT)}isBlockDevice(){return this._checkModeProperty(IT)}isCharacterDevice(){return this._checkModeProperty(DT)}isSymbolicLink(){return this._checkModeProperty(CT)}isFIFO(){return this._checkModeProperty(NT)}isSocket(){return this._checkModeProperty(BT)}};a(Xs,"Dirent");var Zs=Xs;ho.Dirent=Zs;ho.default=Zs});var Gi=T(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.basename=Se.isAbsolute=Se.normalize=Se.dirname=Se.relative=Se.join=Se.posix=Se.sep=Se.resolve=void 0;var sr=Sr();Object.defineProperty(Se,"resolve",{enumerable:!0,get:a(function(){return sr.resolve},"get")});Object.defineProperty(Se,"sep",{enumerable:!0,get:a(function(){return sr.sep},"get")});Object.defineProperty(Se,"posix",{enumerable:!0,get:a(function(){return sr.posix},"get")});Object.defineProperty(Se,"join",{enumerable:!0,get:a(function(){return sr.join},"get")});Object.defineProperty(Se,"relative",{enumerable:!0,get:a(function(){return sr.relative},"get")});Object.defineProperty(Se,"dirname",{enumerable:!0,get:a(function(){return sr.dirname},"get")});Object.defineProperty(Se,"normalize",{enumerable:!0,get:a(function(){return sr.normalize},"get")});Object.defineProperty(Se,"isAbsolute",{enumerable:!0,get:a(function(){return sr.isAbsolute},"get")});Object.defineProperty(Se,"basename",{enumerable:!0,get:a(function(){return sr.basename},"get")})});var Gf={};kx(Gf,{__addDisposableResource:()=>yw,__assign:()=>Js,__asyncDelegator:()=>cw,__asyncGenerator:()=>lw,__asyncValues:()=>fw,__await:()=>Ki,__awaiter:()=>rw,__classPrivateFieldGet:()=>pw,__classPrivateFieldIn:()=>ww,__classPrivateFieldSet:()=>mw,__createBinding:()=>ea,__decorate:()=>Zm,__disposeResources:()=>gw,__esDecorate:()=>Ym,__exportStar:()=>nw,__extends:()=>Gm,__generator:()=>iw,__importDefault:()=>dw,__importStar:()=>hw,__makeTemplateObject:()=>uw,__metadata:()=>tw,__param:()=>Xm,__propKey:()=>Qm,__read:()=>Vf,__rest:()=>Km,__rewriteRelativeImportExtension:()=>bw,__runInitializers:()=>Jm,__setFunctionName:()=>ew,__spread:()=>ow,__spreadArray:()=>aw,__spreadArrays:()=>sw,__values:()=>Qs,default:()=>MT});function Gm(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");zf(t,e);function r(){this.constructor=t}a(r,"__"),t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function Km(t,e){var r={};for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&e.indexOf(i)<0&&(r[i]=t[i]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,i=Object.getOwnPropertySymbols(t);n<i.length;n++)e.indexOf(i[n])<0&&Object.prototype.propertyIsEnumerable.call(t,i[n])&&(r[i[n]]=t[i[n]]);return r}function Zm(t,e,r,i){var n=arguments.length,o=n<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(t,e,r,i);else for(var l=t.length-1;l>=0;l--)(s=t[l])&&(o=(n<3?s(o):n>3?s(e,r,o):s(e,r))||o);return n>3&&o&&Object.defineProperty(e,r,o),o}function Xm(t,e){return function(r,i){e(r,i,t)}}function Ym(t,e,r,i,n,o){function s(v){if(v!==void 0&&typeof v!="function")throw new TypeError("Function expected");return v}a(s,"accept");for(var l=i.kind,f=l==="getter"?"get":l==="setter"?"set":"value",c=!e&&t?i.static?t:t.prototype:null,u=e||(c?Object.getOwnPropertyDescriptor(c,i.name):{}),h,d=!1,p=r.length-1;p>=0;p--){var m={};for(var w in i)m[w]=w==="access"?{}:i[w];for(var w in i.access)m.access[w]=i.access[w];m.addInitializer=function(v){if(d)throw new TypeError("Cannot add initializers after decoration has completed");o.push(s(v||null))};var y=(0,r[p])(l==="accessor"?{get:u.get,set:u.set}:u[f],m);if(l==="accessor"){if(y===void 0)continue;if(y===null||typeof y!="object")throw new TypeError("Object expected");(h=s(y.get))&&(u.get=h),(h=s(y.set))&&(u.set=h),(h=s(y.init))&&n.unshift(h)}else(h=s(y))&&(l==="field"?n.unshift(h):u[f]=h)}c&&Object.defineProperty(c,i.name,u),d=!0}function Jm(t,e,r){for(var i=arguments.length>2,n=0;n<e.length;n++)r=i?e[n].call(t,r):e[n].call(t);return i?r:void 0}function Qm(t){return typeof t=="symbol"?t:"".concat(t)}function ew(t,e,r){return typeof e=="symbol"&&(e=e.description?"[".concat(e.description,"]"):""),Object.defineProperty(t,"name",{configurable:!0,value:r?"".concat(r," ",e):e})}function tw(t,e){if(typeof Reflect=="object"&&typeof Reflect.metadata=="function")return Reflect.metadata(t,e)}function rw(t,e,r,i){function n(o){return o instanceof r?o:new r(function(s){s(o)})}return a(n,"adopt"),new(r||(r=Promise))(function(o,s){function l(u){try{c(i.next(u))}catch(h){s(h)}}a(l,"fulfilled");function f(u){try{c(i.throw(u))}catch(h){s(h)}}a(f,"rejected");function c(u){u.done?o(u.value):n(u.value).then(l,f)}a(c,"step"),c((i=i.apply(t,e||[])).next())})}function iw(t,e){var r={label:0,sent:a(function(){if(o[0]&1)throw o[1];return o[1]},"sent"),trys:[],ops:[]},i,n,o,s=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return s.next=l(0),s.throw=l(1),s.return=l(2),typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function l(c){return function(u){return f([c,u])}}function f(c){if(i)throw new TypeError("Generator is already executing.");for(;s&&(s=0,c[0]&&(r=0)),r;)try{if(i=1,n&&(o=c[0]&2?n.return:c[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,c[1])).done)return o;switch(n=0,o&&(c=[c[0]&2,o.value]),c[0]){case 0:case 1:o=c;break;case 4:return r.label++,{value:c[1],done:!1};case 5:r.label++,n=c[1],c=[0];continue;case 7:c=r.ops.pop(),r.trys.pop();continue;default:if(o=r.trys,!(o=o.length>0&&o[o.length-1])&&(c[0]===6||c[0]===2)){r=0;continue}if(c[0]===3&&(!o||c[1]>o[0]&&c[1]<o[3])){r.label=c[1];break}if(c[0]===6&&r.label<o[1]){r.label=o[1],o=c;break}if(o&&r.label<o[2]){r.label=o[2],r.ops.push(c);break}o[2]&&r.ops.pop(),r.trys.pop();continue}c=e.call(t,r)}catch(u){c=[6,u],n=0}finally{i=o=0}if(c[0]&5)throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}}function nw(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ea(e,t,r)}function Qs(t){var e=typeof Symbol=="function"&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&typeof t.length=="number")return{next:a(function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}},"next")};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Vf(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var i=r.call(t),n,o=[],s;try{for(;(e===void 0||e-- >0)&&!(n=i.next()).done;)o.push(n.value)}catch(l){s={error:l}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(s)throw s.error}}return o}function ow(){for(var t=[],e=0;e<arguments.length;e++)t=t.concat(Vf(arguments[e]));return t}function sw(){for(var t=0,e=0,r=arguments.length;e<r;e++)t+=arguments[e].length;for(var i=Array(t),n=0,e=0;e<r;e++)for(var o=arguments[e],s=0,l=o.length;s<l;s++,n++)i[n]=o[s];return i}function aw(t,e,r){if(r||arguments.length===2)for(var i=0,n=e.length,o;i<n;i++)(o||!(i in e))&&(o||(o=Array.prototype.slice.call(e,0,i)),o[i]=e[i]);return t.concat(o||Array.prototype.slice.call(e))}function Ki(t){return this instanceof Ki?(this.v=t,this):new Ki(t)}function lw(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),l("next"),l("throw"),l("return",s),n[Symbol.asyncIterator]=function(){return this},n;function s(p){return function(m){return Promise.resolve(m).then(p,h)}}function l(p,m){i[p]&&(n[p]=function(w){return new Promise(function(y,v){o.push([p,w,y,v])>1||f(p,w)})},m&&(n[p]=m(n[p])))}function f(p,m){try{c(i[p](m))}catch(w){d(o[0][3],w)}}function c(p){p.value instanceof Ki?Promise.resolve(p.value.v).then(u,h):d(o[0][2],p)}function u(p){f("next",p)}function h(p){f("throw",p)}function d(p,m){p(m),o.shift(),o.length&&f(o[0][0],o[0][1])}}function cw(t){var e,r;return e={},i("next"),i("throw",function(n){throw n}),i("return"),e[Symbol.iterator]=function(){return this},e;function i(n,o){e[n]=t[n]?function(s){return(r=!r)?{value:Ki(t[n](s)),done:!1}:o?o(s):s}:o}}function fw(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof Qs=="function"?Qs(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(s){return new Promise(function(l,f){s=t[o](s),n(l,f,s.done,s.value)})}}function n(o,s,l,f){Promise.resolve(f).then(function(c){o({value:c,done:l})},s)}}function uw(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function hw(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r=Wf(t),i=0;i<r.length;i++)r[i]!=="default"&&ea(e,t,r[i]);return LT(e,t),e}function dw(t){return t&&t.__esModule?t:{default:t}}function pw(t,e,r,i){if(r==="a"&&!i)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!i:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?i:r==="a"?i.call(t):i?i.value:e.get(t)}function mw(t,e,r,i,n){if(i==="m")throw new TypeError("Private method is not writable");if(i==="a"&&!n)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return i==="a"?n.call(t,r):n?n.value=r:e.set(t,r),r}function ww(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function yw(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var i,n;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");i=e[Symbol.asyncDispose]}if(i===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");i=e[Symbol.dispose],r&&(n=i)}if(typeof i!="function")throw new TypeError("Object not disposable.");n&&(i=a(function(){try{n.call(this)}catch(o){return Promise.reject(o)}},"dispose")),t.stack.push({value:e,dispose:i,async:r})}else r&&t.stack.push({async:!0});return e}function gw(t){function e(o){t.error=t.hasError?new $T(o,t.error,"An error was suppressed during disposal."):o,t.hasError=!0}a(e,"fail");var r,i=0;function n(){for(;r=t.stack.pop();)try{if(!r.async&&i===1)return i=0,t.stack.push(r),Promise.resolve().then(n);if(r.dispose){var o=r.dispose.call(r.value);if(r.async)return i|=2,Promise.resolve(o).then(n,function(s){return e(s),n()})}else i|=1}catch(s){e(s)}if(i===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return a(n,"next"),n()}function bw(t,e){return typeof t=="string"&&/^\.\.?\//.test(t)?t.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(r,i,n,o,s){return i?e?".jsx":".js":n&&(!o||!s)?r:n+o+"."+s.toLowerCase()+"js"}):t}var zf,Js,ea,LT,Wf,$T,MT,Kf=Rx(()=>{zf=a(function(t,e){return zf=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(r[n]=i[n])},zf(t,e)},"extendStatics");a(Gm,"__extends");Js=a(function(){return Js=Object.assign||a(function(e){for(var r,i=1,n=arguments.length;i<n;i++){r=arguments[i];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e},"__assign"),Js.apply(this,arguments)},"__assign");a(Km,"__rest");a(Zm,"__decorate");a(Xm,"__param");a(Ym,"__esDecorate");a(Jm,"__runInitializers");a(Qm,"__propKey");a(ew,"__setFunctionName");a(tw,"__metadata");a(rw,"__awaiter");a(iw,"__generator");ea=Object.create?function(t,e,r,i){i===void 0&&(i=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:a(function(){return e[r]},"get")}),Object.defineProperty(t,i,n)}:function(t,e,r,i){i===void 0&&(i=r),t[i]=e[r]};a(nw,"__exportStar");a(Qs,"__values");a(Vf,"__read");a(ow,"__spread");a(sw,"__spreadArrays");a(aw,"__spreadArray");a(Ki,"__await");a(lw,"__asyncGenerator");a(cw,"__asyncDelegator");a(fw,"__asyncValues");a(uw,"__makeTemplateObject");LT=Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e},Wf=a(function(t){return Wf=Object.getOwnPropertyNames||function(e){var r=[];for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(r[r.length]=i);return r},Wf(t)},"ownKeys");a(hw,"__importStar");a(dw,"__importDefault");a(pw,"__classPrivateFieldGet");a(mw,"__classPrivateFieldSet");a(ww,"__classPrivateFieldIn");a(yw,"__addDisposableResource");$T=typeof SuppressedError=="function"?SuppressedError:function(t,e,r){var i=new Error(r);return i.name="SuppressedError",i.error=t,i.suppressed=e,i};a(gw,"__disposeResources");a(bw,"__rewriteRelativeImportExtension");MT={__extends:Gm,__assign:Js,__rest:Km,__decorate:Zm,__param:Xm,__esDecorate:Ym,__runInitializers:Jm,__propKey:Qm,__setFunctionName:ew,__metadata:tw,__awaiter:rw,__generator:iw,__createBinding:ea,__exportStar:nw,__values:Qs,__read:Vf,__spread:ow,__spreadArrays:sw,__spreadArray:aw,__await:Ki,__asyncGenerator:lw,__asyncDelegator:cw,__asyncValues:fw,__makeTemplateObject:uw,__importStar:hw,__importDefault:dw,__classPrivateFieldGet:pw,__classPrivateFieldSet:mw,__classPrivateFieldIn:ww,__addDisposableResource:yw,__disposeResources:gw,__rewriteRelativeImportExtension:bw}});var _w=T(vw=>{"use strict";Object.defineProperty(vw,"__esModule",{value:!0})});var Xf=T(ta=>{"use strict";Object.defineProperty(ta,"__esModule",{value:!0});ta.flattenJSON=void 0;var Fw=Or(),Zf=Gi(),jT=Zf.posix?Zf.posix.join:Zf.join,UT=a(t=>{let e={};function r(i,n){for(let o in n){let s=n[o],l=jT(i,o);typeof s=="string"||s instanceof Fw.Buffer?e[l]=s:typeof s=="object"&&s!==null&&!(s instanceof Fw.Buffer)&&Object.keys(s).length>0?r(l,s):e[l]=null}}return a(r,"flatten"),r("",t),e},"flattenJSON");ta.flattenJSON=UT});var Qf=T(ra=>{"use strict";Object.defineProperty(ra,"__esModule",{value:!0});ra.FanOut=void 0;var Jf=class Jf{constructor(){this.listeners=new Set}emit(e){this.listeners.forEach(r=>r(e))}listen(e){let r=this.listeners;return r.add(e),()=>r.delete(e)}};a(Jf,"FanOut");var Yf=Jf;ra.FanOut=Yf});var na=T(ia=>{"use strict";Object.defineProperty(ia,"__esModule",{value:!0});ia.createProcess=Ew;var HT=a(()=>{if(typeof process<"u")return process;try{return Ox("process")}catch{return}},"maybeReturnProcess");function Ew(){let t=HT()||{};return t.cwd||(t.cwd=()=>"/"),t.emitWarning||(t.emitWarning=(e,r)=>{console.warn(`${r}${r?": ":""}${e}`)}),t.env||(t.env={}),t}a(Ew,"createProcess");ia.default=Ew()});var ru=T(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.Node=void 0;var qT=Qf(),xw=na(),dt=Or(),zT=Pt(),{S_IFMT:ar,S_IFDIR:WT,S_IFREG:VT,S_IFLNK:Sw,S_IFCHR:GT}=zT.constants,oa=a(()=>xw.default.getuid?.()??0,"getuid"),sa=a(()=>xw.default.getgid?.()??0,"getgid"),tu=class tu{constructor(e,r=438){this.changes=new qT.FanOut,this._uid=oa(),this._gid=sa(),this._atime=new Date,this._mtime=new Date,this._ctime=new Date,this.rdev=0,this._nlink=1,this.mode=r,this.ino=e}set ctime(e){this._ctime=e}get ctime(){return this._ctime}set uid(e){this._uid=e,this.ctime=new Date}get uid(){return this._uid}set gid(e){this._gid=e,this.ctime=new Date}get gid(){return this._gid}set atime(e){this._atime=e}get atime(){return this._atime}set mtime(e){this._mtime=e,this.ctime=new Date}get mtime(){return this._mtime}get perm(){return this.mode&~ar}set perm(e){this.mode=this.mode&ar|e&~ar,this.ctime=new Date}set nlink(e){this._nlink=e,this.ctime=new Date}get nlink(){return this._nlink}getString(e="utf8"){return this.atime=new Date,this.getBuffer().toString(e)}setString(e){this.buf=(0,dt.bufferFrom)(e,"utf8"),this.touch()}getBuffer(){return this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),(0,dt.bufferFrom)(this.buf)}setBuffer(e){this.buf=(0,dt.bufferFrom)(e),this.touch()}getSize(){return this.buf?this.buf.length:0}setModeProperty(e){this.mode=e}isFile(){return(this.mode&ar)===VT}isDirectory(){return(this.mode&ar)===WT}isSymlink(){return(this.mode&ar)===Sw}isCharacterDevice(){return(this.mode&ar)===GT}makeSymlink(e){this.mode=Sw|438,this.symlink=e}write(e,r=0,i=e.length,n=0){if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n+i>this.buf.length){let o=(0,dt.bufferAllocUnsafe)(n+i);this.buf.copy(o,0,0,this.buf.length),this.buf=o}return e.copy(this.buf,n,r,r+i),this.touch(),i}read(e,r=0,i=e.byteLength,n=0){if(this.atime=new Date,this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),n>=this.buf.length)return 0;let o=i;o>e.byteLength&&(o=e.byteLength),o+n>this.buf.length&&(o=this.buf.length-n);let s=e instanceof dt.Buffer?e:dt.Buffer.from(e.buffer,e.byteOffset,e.byteLength);return this.buf.copy(s,r,n,n+o),o}truncate(e=0){if(!e)this.buf=(0,dt.bufferAllocUnsafe)(0);else if(this.buf||(this.buf=(0,dt.bufferAllocUnsafe)(0)),e<=this.buf.length)this.buf=this.buf.slice(0,e);else{let r=(0,dt.bufferAllocUnsafe)(e);this.buf.copy(r),r.fill(0,this.buf.length),this.buf=r}this.touch()}chmod(e){this.mode=this.mode&ar|e&~ar,this.touch()}chown(e,r){this.uid=e,this.gid=r,this.touch()}touch(){this.mtime=new Date,this.changes.emit(["modify"])}canRead(e=oa(),r=sa()){return!!(this.perm&4||r===this.gid&&this.perm&32||e===this.uid&&this.perm&256)}canWrite(e=oa(),r=sa()){return!!(this.perm&2||r===this.gid&&this.perm&16||e===this.uid&&this.perm&128)}canExecute(e=oa(),r=sa()){return!!(this.perm&1||r===this.gid&&this.perm&8||e===this.uid&&this.perm&64)}del(){this.changes.emit(["delete"])}toJSON(){return{ino:this.ino,uid:this.uid,gid:this.gid,atime:this.atime.getTime(),mtime:this.mtime.getTime(),ctime:this.ctime.getTime(),perm:this.perm,mode:this.mode,nlink:this.nlink,symlink:this.symlink,data:this.getString()}}};a(tu,"Node");var eu=tu;aa.Node=eu});var nu=T(la=>{"use strict";Object.defineProperty(la,"__esModule",{value:!0});la.Link=void 0;var KT=Pt(),ZT=Qf(),{S_IFREG:XT}=KT.constants,po=class po{get steps(){return this._steps}set steps(e){this._steps=e;for(let[r,i]of this.children.entries())r==="."||r===".."||i?.syncSteps()}constructor(e,r,i){this.changes=new ZT.FanOut,this.children=new Map,this._steps=[],this.ino=0,this.length=0,this.vol=e,this.parent=r,this.name=i,this.syncSteps()}setNode(e){this.node=e,this.ino=e.ino}getNode(){return this.node}createChild(e,r=this.vol.createNode(XT|438)){let i=new po(this.vol,this,e);return i.setNode(r),r.isDirectory()&&(i.children.set(".",i),i.getNode().nlink++),this.setChild(e,i),i}setChild(e,r=new po(this.vol,this,e)){return this.children.set(e,r),r.parent=this,this.length++,r.getNode().isDirectory()&&(r.children.set("..",this),this.getNode().nlink++),this.getNode().mtime=new Date,this.changes.emit(["child:add",r,this]),r}deleteChild(e){e.getNode().isDirectory()&&(e.children.delete(".."),this.getNode().nlink--),this.children.delete(e.getName()),this.length--,this.getNode().mtime=new Date,this.changes.emit(["child:del",e,this])}getChild(e){return this.getNode().atime=new Date,this.children.get(e)}getPath(){return this.steps.join("/")}getParentPath(){return this.steps.slice(0,-1).join("/")}getName(){return this.steps[this.steps.length-1]}toJSON(){return{steps:this.steps,ino:this.ino,children:Array.from(this.children.keys())}}syncSteps(){this.steps=this.parent?this.parent.steps.concat([this.name]):[this.name]}};a(po,"Link");var iu=po;la.Link=iu});var au=T(ca=>{"use strict";Object.defineProperty(ca,"__esModule",{value:!0});ca.File=void 0;var YT=Pt(),{O_APPEND:JT}=YT.constants,su=class su{constructor(e,r,i,n){this.link=e,this.node=r,this.flags=i,this.fd=n,this.position=0,this.flags&JT&&(this.position=this.getSize())}getString(e="utf8"){return this.node.getString()}setString(e){this.node.setString(e)}getBuffer(){return this.node.getBuffer()}setBuffer(e){this.node.setBuffer(e)}getSize(){return this.node.getSize()}truncate(e){this.node.truncate(e)}seekTo(e){this.position=e}write(e,r=0,i=e.length,n){typeof n!="number"&&(n=this.position);let o=this.node.write(e,r,i,n);return this.position=n+o,o}read(e,r=0,i=e.byteLength,n){typeof n!="number"&&(n=this.position);let o=this.node.read(e,r,i,n);return this.position=n+o,o}chmod(e){this.node.chmod(e)}chown(e,r){this.node.chown(e,r)}};a(su,"File");var ou=su;ca.File=ou});var Yi=T(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.FLAGS=Xi.ERRSTR=void 0;var QT=Pt();Xi.ERRSTR={PATH_STR:"path must be a string, Buffer, or Uint8Array",FD:"fd must be a file descriptor",MODE_INT:"mode must be an int",CB:"callback must be a function",UID:"uid must be an unsigned int",GID:"gid must be an unsigned int",LEN:"len must be an integer",ATIME:"atime must be an integer",MTIME:"mtime must be an integer",PREFIX:"filename prefix is required",BUFFER:"buffer must be an instance of Buffer or StaticBuffer",OFFSET:"offset must be an integer",LENGTH:"length must be an integer",POSITION:"position must be an integer"};var{O_RDONLY:Tw,O_WRONLY:fa,O_RDWR:Zi,O_CREAT:kr,O_EXCL:ua,O_TRUNC:ha,O_APPEND:da,O_SYNC:Ow}=QT.constants,Rw;(function(t){t[t.r=Tw]="r",t[t["r+"]=Zi]="r+",t[t.rs=Tw|Ow]="rs",t[t.sr=t.rs]="sr",t[t["rs+"]=Zi|Ow]="rs+",t[t["sr+"]=t["rs+"]]="sr+",t[t.w=fa|kr|ha]="w",t[t.wx=fa|kr|ha|ua]="wx",t[t.xw=t.wx]="xw",t[t["w+"]=Zi|kr|ha]="w+",t[t["wx+"]=Zi|kr|ha|ua]="wx+",t[t["xw+"]=t["wx+"]]="xw+",t[t.a=fa|da|kr]="a",t[t.ax=fa|da|kr|ua]="ax",t[t.xa=t.ax]="xa",t[t["a+"]=Zi|da|kr]="a+",t[t["ax+"]=Zi|da|kr|ua]="ax+",t[t["xa+"]=t["ax+"]]="xa+"})(Rw||(Xi.FLAGS=Rw={}))});var cu=T(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.default=typeof queueMicrotask=="function"?queueMicrotask:t=>Promise.resolve().then(()=>t()).catch(()=>{})});var ya=T(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.filenameToSteps=De.resolve=De.unixify=De.isWin=void 0;De.isFd=Pw;De.validateFd=cO;De.dataToBuffer=fO;var ma=Gi(),pa=Or(),kw=na(),eO=uo(),tO=Yi();De.isWin=kw.default.platform==="win32";var rO=ma.resolve,iO=ma.posix?ma.posix.sep:ma.sep,nO=a((t,e)=>{let r=t[e];return e>0&&(r==="/"||De.isWin&&r==="\\")},"isSeparator"),oO=a(t=>{let e=t.length-1;if(e<2)return t;for(;nO(t,e);)e--;return t.substr(0,e+1)},"removeTrailingSeparator"),sO=a((t,e)=>{if(typeof t!="string")throw new TypeError("expected a string");return t=t.replace(/[\\\/]+/g,"/"),e!==!1&&(t=oO(t)),t},"normalizePath"),aO=a((t,e=!0)=>De.isWin?(t=sO(t,e),t.replace(/^([a-zA-Z]+:|\.\/)/,"")):t,"unixify");De.unixify=aO;var wa=a((t,e=kw.default.cwd())=>rO(e,t),"resolve");De.resolve=wa;if(De.isWin){let t=wa;De.resolve=wa=a((e,r)=>(0,De.unixify)(t(e,r)),"resolve")}var lO=a((t,e)=>{let i=wa(t,e).substring(1);return i?i.split(iO):[]},"filenameToSteps");De.filenameToSteps=lO;function Pw(t){return t>>>0===t}a(Pw,"isFd");function cO(t){if(!Pw(t))throw TypeError(tO.ERRSTR.FD)}a(cO,"validateFd");function fO(t,e=eO.ENCODING_UTF8){return pa.Buffer.isBuffer(t)?t:t instanceof Uint8Array?(0,pa.bufferFrom)(t):e==="buffer"?(0,pa.bufferFrom)(String(t),"utf8"):(0,pa.bufferFrom)(String(t),e)}a(fO,"dataToBuffer")});var Aw=T((Ji,Qi)=>{(function(t){var e=typeof Ji=="object"&&Ji&&!Ji.nodeType&&Ji,r=typeof Qi=="object"&&Qi&&!Qi.nodeType&&Qi,i=typeof globalThis=="object"&&globalThis;(i.global===i||i.window===i||i.self===i)&&(t=i);var n,o=2147483647,s=36,l=1,f=26,c=38,u=700,h=72,d=128,p="-",m=/^xn--/,w=/[^\x20-\x7E]/,y=/[\x2E\u3002\uFF0E\uFF61]/g,v={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},g=s-l,F=Math.floor,O=String.fromCharCode,S;function R($){throw new RangeError(v[$])}a(R,"error");function b($,q){for(var G=$.length,X=[];G--;)X[G]=q($[G]);return X}a(b,"map");function x($,q){var G=$.split("@"),X="";G.length>1&&(X=G[0]+"@",$=G[1]),$=$.replace(y,".");var z=$.split("."),fe=b(z,q).join(".");return X+fe}a(x,"mapDomain");function _($){for(var q=[],G=0,X=$.length,z,fe;G<X;)z=$.charCodeAt(G++),z>=55296&&z<=56319&&G<X?(fe=$.charCodeAt(G++),(fe&64512)==56320?q.push(((z&1023)<<10)+(fe&1023)+65536):(q.push(z),G--)):q.push(z);return q}a(_,"ucs2decode");function P($){return b($,function(q){var G="";return q>65535&&(q-=65536,G+=O(q>>>10&1023|55296),q=56320|q&1023),G+=O(q),G}).join("")}a(P,"ucs2encode");function k($){return $-48<10?$-22:$-65<26?$-65:$-97<26?$-97:s}a(k,"basicToDigit");function C($,q){return $+22+75*($<26)-((q!=0)<<5)}a(C,"digitToBasic");function N($,q,G){var X=0;for($=G?F($/u):$>>1,$+=F($/q);$>g*f>>1;X+=s)$=F($/g);return F(X+(g+1)*$/($+c))}a(N,"adapt");function U($){var q=[],G=$.length,X,z=0,fe=d,ee=h,Oe,Re,se,Rt,ve,Ve,Be,Y,he;for(Oe=$.lastIndexOf(p),Oe<0&&(Oe=0),Re=0;Re<Oe;++Re)$.charCodeAt(Re)>=128&&R("not-basic"),q.push($.charCodeAt(Re));for(se=Oe>0?Oe+1:0;se<G;){for(Rt=z,ve=1,Ve=s;se>=G&&R("invalid-input"),Be=k($.charCodeAt(se++)),(Be>=s||Be>F((o-z)/ve))&&R("overflow"),z+=Be*ve,Y=Ve<=ee?l:Ve>=ee+f?f:Ve-ee,!(Be<Y);Ve+=s)he=s-Y,ve>F(o/he)&&R("overflow"),ve*=he;X=q.length+1,ee=N(z-Rt,X,Rt==0),F(z/X)>o-fe&&R("overflow"),fe+=F(z/X),z%=X,q.splice(z++,0,fe)}return P(q)}a(U,"decode");function Z($){var q,G,X,z,fe,ee,Oe,Re,se,Rt,ve,Ve=[],Be,Y,he,je;for($=_($),Be=$.length,q=d,G=0,fe=h,ee=0;ee<Be;++ee)ve=$[ee],ve<128&&Ve.push(O(ve));for(X=z=Ve.length,z&&Ve.push(p);X<Be;){for(Oe=o,ee=0;ee<Be;++ee)ve=$[ee],ve>=q&&ve<Oe&&(Oe=ve);for(Y=X+1,Oe-q>F((o-G)/Y)&&R("overflow"),G+=(Oe-q)*Y,q=Oe,ee=0;ee<Be;++ee)if(ve=$[ee],ve<q&&++G>o&&R("overflow"),ve==q){for(Re=G,se=s;Rt=se<=fe?l:se>=fe+f?f:se-fe,!(Re<Rt);se+=s)je=Re-Rt,he=s-Rt,Ve.push(O(C(Rt+je%he,0))),Re=F(je/he);Ve.push(O(C(Re,0))),fe=N(G,Y,X==z),G=0,++X}++G,++q}return Ve.join("")}a(Z,"encode");function me($){return x($,function(q){return m.test(q)?U(q.slice(4).toLowerCase()):q})}a(me,"toUnicode");function Ee($){return x($,function(q){return w.test(q)?"xn--"+Z(q):q})}if(a(Ee,"toASCII"),n={version:"1.4.1",ucs2:{decode:_,encode:P},decode:U,encode:Z,toASCII:Ee,toUnicode:me},typeof define=="function"&&typeof define.amd=="object"&&define.amd)define("punycode",function(){return n});else if(e&&r)if(Qi.exports==e)r.exports=n;else for(S in n)n.hasOwnProperty(S)&&(e[S]=n[S]);else t.punycode=n})(Ji)});var Ht=T((S8,Iw)=>{"use strict";Iw.exports=TypeError});var Dw=T(()=>{});var bo=T((O8,Qw)=>{var bu=typeof Map=="function"&&Map.prototype,fu=Object.getOwnPropertyDescriptor&&bu?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,ba=bu&&fu&&typeof fu.get=="function"?fu.get:null,Cw=bu&&Map.prototype.forEach,vu=typeof Set=="function"&&Set.prototype,uu=Object.getOwnPropertyDescriptor&&vu?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,va=vu&&uu&&typeof uu.get=="function"?uu.get:null,Nw=vu&&Set.prototype.forEach,uO=typeof WeakMap=="function"&&WeakMap.prototype,wo=uO?WeakMap.prototype.has:null,hO=typeof WeakSet=="function"&&WeakSet.prototype,yo=hO?WeakSet.prototype.has:null,dO=typeof WeakRef=="function"&&WeakRef.prototype,Bw=dO?WeakRef.prototype.deref:null,pO=Boolean.prototype.valueOf,mO=Object.prototype.toString,wO=Function.prototype.toString,yO=String.prototype.match,_u=String.prototype.slice,Pr=String.prototype.replace,gO=String.prototype.toUpperCase,Lw=String.prototype.toLowerCase,Vw=RegExp.prototype.test,$w=Array.prototype.concat,qt=Array.prototype.join,bO=Array.prototype.slice,Mw=Math.floor,pu=typeof BigInt=="function"?BigInt.prototype.valueOf:null,hu=Object.getOwnPropertySymbols,mu=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,en=typeof Symbol=="function"&&typeof Symbol.iterator=="object",go=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===en||!0)?Symbol.toStringTag:null,Gw=Object.prototype.propertyIsEnumerable,jw=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function Uw(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||Vw.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var i=t<0?-Mw(-t):Mw(t);if(i!==t){var n=String(i),o=_u.call(e,n.length+1);return Pr.call(n,r,"$&_")+"."+Pr.call(Pr.call(o,/([0-9]{3})/g,"$&_"),/_$/,"")}}return Pr.call(e,r,"$&_")}a(Uw,"addNumericSeparator");var wu=Dw(),Hw=wu.custom,qw=Xw(Hw)?Hw:null,Kw={__proto__:null,double:'"',single:"'"},vO={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};Qw.exports=a(function t(e,r,i,n){var o=r||{};if(lr(o,"quoteStyle")&&!lr(Kw,o.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(lr(o,"maxStringLength")&&(typeof o.maxStringLength=="number"?o.maxStringLength<0&&o.maxStringLength!==1/0:o.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var s=lr(o,"customInspect")?o.customInspect:!0;if(typeof s!="boolean"&&s!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(lr(o,"indent")&&o.indent!==null&&o.indent!==" "&&!(parseInt(o.indent,10)===o.indent&&o.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(lr(o,"numericSeparator")&&typeof o.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var l=o.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return Jw(e,o);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var f=String(e);return l?Uw(e,f):f}if(typeof e=="bigint"){var c=String(e)+"n";return l?Uw(e,c):c}var u=typeof o.depth>"u"?5:o.depth;if(typeof i>"u"&&(i=0),i>=u&&u>0&&typeof e=="object")return yu(e)?"[Array]":"[Object]";var h=$O(o,i);if(typeof n>"u")n=[];else if(Yw(n,e)>=0)return"[Circular]";function d(N,U,Z){if(U&&(n=bO.call(n),n.push(U)),Z){var me={depth:o.depth};return lr(o,"quoteStyle")&&(me.quoteStyle=o.quoteStyle),t(N,me,i+1,n)}return t(N,o,i+1,n)}if(a(d,"inspect"),typeof e=="function"&&!zw(e)){var p=kO(e),m=ga(e,d);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+qt.call(m,", ")+" }":"")}if(Xw(e)){var w=en?Pr.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):mu.call(e);return typeof e=="object"&&!en?mo(w):w}if(NO(e)){for(var y="<"+Lw.call(String(e.nodeName)),v=e.attributes||[],g=0;g<v.length;g++)y+=" "+v[g].name+"="+Zw(_O(v[g].value),"double",o);return y+=">",e.childNodes&&e.childNodes.length&&(y+="..."),y+="</"+Lw.call(String(e.nodeName))+">",y}if(yu(e)){if(e.length===0)return"[]";var F=ga(e,d);return h&&!LO(F)?"["+gu(F,h)+"]":"[ "+qt.call(F,", ")+" ]"}if(EO(e)){var O=ga(e,d);return!("cause"in Error.prototype)&&"cause"in e&&!Gw.call(e,"cause")?"{ ["+String(e)+"] "+qt.call($w.call("[cause]: "+d(e.cause),O),", ")+" }":O.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+qt.call(O,", ")+" }"}if(typeof e=="object"&&s){if(qw&&typeof e[qw]=="function"&&wu)return wu(e,{depth:u-i});if(s!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(PO(e)){var S=[];return Cw&&Cw.call(e,function(N,U){S.push(d(U,e,!0)+" => "+d(N,e))}),Ww("Map",ba.call(e),S,h)}if(DO(e)){var R=[];return Nw&&Nw.call(e,function(N){R.push(d(N,e))}),Ww("Set",va.call(e),R,h)}if(AO(e))return du("WeakMap");if(CO(e))return du("WeakSet");if(IO(e))return du("WeakRef");if(xO(e))return mo(d(Number(e)));if(OO(e))return mo(d(pu.call(e)));if(TO(e))return mo(pO.call(e));if(SO(e))return mo(d(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof globalThis<"u"&&e===globalThis)return"{ [object globalThis] }";if(!FO(e)&&!zw(e)){var b=ga(e,d),x=jw?jw(e)===Object.prototype:e instanceof Object||e.constructor===Object,_=e instanceof Object?"":"null prototype",P=!x&&go&&Object(e)===e&&go in e?_u.call(Ar(e),8,-1):_?"Object":"",k=x||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",C=k+(P||_?"["+qt.call($w.call([],P||[],_||[]),": ")+"] ":"");return b.length===0?C+"{}":h?C+"{"+gu(b,h)+"}":C+"{ "+qt.call(b,", ")+" }"}return String(e)},"inspect_");function Zw(t,e,r){var i=r.quoteStyle||e,n=Kw[i];return n+t+n}a(Zw,"wrapQuotes");function _O(t){return Pr.call(String(t),/"/g,""")}a(_O,"quote");function si(t){return!go||!(typeof t=="object"&&(go in t||typeof t[go]<"u"))}a(si,"canTrustToString");function yu(t){return Ar(t)==="[object Array]"&&si(t)}a(yu,"isArray");function FO(t){return Ar(t)==="[object Date]"&&si(t)}a(FO,"isDate");function zw(t){return Ar(t)==="[object RegExp]"&&si(t)}a(zw,"isRegExp");function EO(t){return Ar(t)==="[object Error]"&&si(t)}a(EO,"isError");function SO(t){return Ar(t)==="[object String]"&&si(t)}a(SO,"isString");function xO(t){return Ar(t)==="[object Number]"&&si(t)}a(xO,"isNumber");function TO(t){return Ar(t)==="[object Boolean]"&&si(t)}a(TO,"isBoolean");function Xw(t){if(en)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!mu)return!1;try{return mu.call(t),!0}catch{}return!1}a(Xw,"isSymbol");function OO(t){if(!t||typeof t!="object"||!pu)return!1;try{return pu.call(t),!0}catch{}return!1}a(OO,"isBigInt");var RO=Object.prototype.hasOwnProperty||function(t){return t in this};function lr(t,e){return RO.call(t,e)}a(lr,"has");function Ar(t){return mO.call(t)}a(Ar,"toStr");function kO(t){if(t.name)return t.name;var e=yO.call(wO.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}a(kO,"nameOf");function Yw(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Yw,"indexOf");function PO(t){if(!ba||!t||typeof t!="object")return!1;try{ba.call(t);try{va.call(t)}catch{return!0}return t instanceof Map}catch{}return!1}a(PO,"isMap");function AO(t){if(!wo||!t||typeof t!="object")return!1;try{wo.call(t,wo);try{yo.call(t,yo)}catch{return!0}return t instanceof WeakMap}catch{}return!1}a(AO,"isWeakMap");function IO(t){if(!Bw||!t||typeof t!="object")return!1;try{return Bw.call(t),!0}catch{}return!1}a(IO,"isWeakRef");function DO(t){if(!va||!t||typeof t!="object")return!1;try{va.call(t);try{ba.call(t)}catch{return!0}return t instanceof Set}catch{}return!1}a(DO,"isSet");function CO(t){if(!yo||!t||typeof t!="object")return!1;try{yo.call(t,yo);try{wo.call(t,wo)}catch{return!0}return t instanceof WeakSet}catch{}return!1}a(CO,"isWeakSet");function NO(t){return!t||typeof t!="object"?!1:typeof HTMLElement<"u"&&t instanceof HTMLElement?!0:typeof t.nodeName=="string"&&typeof t.getAttribute=="function"}a(NO,"isElement");function Jw(t,e){if(t.length>e.maxStringLength){var r=t.length-e.maxStringLength,i="... "+r+" more character"+(r>1?"s":"");return Jw(_u.call(t,0,e.maxStringLength),e)+i}var n=vO[e.quoteStyle||"single"];n.lastIndex=0;var o=Pr.call(Pr.call(t,n,"\\$1"),/[\x00-\x1f]/g,BO);return Zw(o,"single",e)}a(Jw,"inspectString");function BO(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+gO.call(e.toString(16))}a(BO,"lowbyte");function mo(t){return"Object("+t+")"}a(mo,"markBoxed");function du(t){return t+" { ? }"}a(du,"weakCollectionOf");function Ww(t,e,r,i){var n=i?gu(r,i):qt.call(r,", ");return t+" ("+e+") {"+n+"}"}a(Ww,"collectionOf");function LO(t){for(var e=0;e<t.length;e++)if(Yw(t[e],`
|
|
5
|
+
`)>=0)return!1;return!0}a(LO,"singleLineValues");function $O(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=qt.call(Array(t.indent+1)," ");else return null;return{base:r,prev:qt.call(Array(e+1),r)}}a($O,"getIndent");function gu(t,e){if(t.length===0)return"";var r=`
|
|
6
6
|
`+e.prev+e.base;return r+qt.call(t,","+r)+`
|
|
7
|
-
`+e.prev}a(yu,"indentedJoin");function ga(t,e){var r=wu(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=lr(t,n)?e(t[n],t):""}var o=typeof uu=="function"?uu(t):[],s;if(en){s={};for(var l=0;l<o.length;l++)s["$"+o[l]]=o[l]}for(var f in t)lr(t,f)&&(r&&String(Number(f))===f&&f<t.length||en&&s["$"+f]instanceof Symbol||(Ww.call(/[^\w$]/,f)?i.push(e(f,t)+": "+e(t[f],t)):i.push(f+": "+e(t[f],t))));if(typeof uu=="function")for(var c=0;c<o.length;c++)Vw.call(t,o[c])&&i.push("["+e(o[c])+"]: "+e(t[o[c]],t));return i}a(ga,"arrObjKeys")});var ey=T((O8,Qw)=>{"use strict";var $O=go(),MO=Ht(),_a=a(function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},"listGetNode"),jO=a(function(t,e){if(t){var r=_a(t,e);return r&&r.value}},"listGet"),UO=a(function(t,e,r){var i=_a(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),HO=a(function(t,e){return t?!!_a(t,e):!1},"listHas"),qO=a(function(t,e){if(t)return _a(t,e,!0)},"listDelete");Qw.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new MO("Side channel does not contain "+$O(i))},"assert"),delete:a(function(i){var n=e&&e.next,o=qO(e,i);return o&&n&&n===o&&(e=void 0),!!o},"delete"),get:a(function(i){return jO(e,i)},"get"),has:a(function(i){return HO(e,i)},"has"),set:a(function(i,n){e||(e={next:void 0}),UO(e,i,n)},"set")};return r},"getSideChannelList")});var _u=T((k8,ty)=>{"use strict";ty.exports=Object});var iy=T((P8,ry)=>{"use strict";ry.exports=Error});var oy=T((A8,ny)=>{"use strict";ny.exports=EvalError});var ay=T((I8,sy)=>{"use strict";sy.exports=RangeError});var cy=T((D8,ly)=>{"use strict";ly.exports=ReferenceError});var Fu=T((C8,fy)=>{"use strict";fy.exports=SyntaxError});var hy=T((N8,uy)=>{"use strict";uy.exports=URIError});var py=T((B8,dy)=>{"use strict";dy.exports=Math.abs});var wy=T((L8,my)=>{"use strict";my.exports=Math.floor});var gy=T(($8,yy)=>{"use strict";yy.exports=Math.max});var vy=T((M8,by)=>{"use strict";by.exports=Math.min});var Fy=T((j8,_y)=>{"use strict";_y.exports=Math.pow});var Sy=T((U8,Ey)=>{"use strict";Ey.exports=Math.round});var Ty=T((H8,xy)=>{"use strict";xy.exports=Number.isNaN||a(function(e){return e!==e},"isNaN")});var Ry=T((z8,Oy)=>{"use strict";var zO=Ty();Oy.exports=a(function(e){return zO(e)||e===0?e:e<0?-1:1},"sign")});var Py=T((V8,ky)=>{"use strict";ky.exports=Object.getOwnPropertyDescriptor});var tn=T((G8,Ay)=>{"use strict";var Fa=Py();if(Fa)try{Fa([],"length")}catch{Fa=null}Ay.exports=Fa});var bo=T((K8,Iy)=>{"use strict";var Ea=Object.defineProperty||!1;if(Ea)try{Ea({},"a",{value:1})}catch{Ea=!1}Iy.exports=Ea});var Eu=T((Z8,Dy)=>{"use strict";Dy.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==n||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var By=T((Y8,Ny)=>{"use strict";var Cy=typeof Symbol<"u"&&Symbol,WO=Eu();Ny.exports=a(function(){return typeof Cy!="function"||typeof Symbol!="function"||typeof Cy("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:WO()},"hasNativeSymbols")});var Su=T((Q8,Ly)=>{"use strict";Ly.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var xu=T((ej,$y)=>{"use strict";var VO=_u();$y.exports=VO.getPrototypeOf||null});var Uy=T((tj,jy)=>{"use strict";var GO="Function.prototype.bind called on incompatible ",KO=Object.prototype.toString,ZO=Math.max,XO="[object Function]",My=a(function(e,r){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<r.length;o+=1)i[o+e.length]=r[o];return i},"concatty"),YO=a(function(e,r){for(var i=[],n=r||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),JO=a(function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r},"joiny");jy.exports=a(function(e){var r=this;if(typeof r!="function"||KO.apply(r)!==XO)throw new TypeError(GO+r);for(var i=YO(arguments,1),n,o=a(function(){if(this instanceof n){var u=r.apply(this,My(i,arguments));return Object(u)===u?u:this}return r.apply(e,My(i,arguments))},"binder"),s=ZO(0,r.length-i.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(n=Function("binder","return function ("+JO(l,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=a(function(){},"Empty");c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n},"bind")});var rn=T((ij,Hy)=>{"use strict";var QO=Uy();Hy.exports=Function.prototype.bind||QO});var Sa=T((nj,qy)=>{"use strict";qy.exports=Function.prototype.call});var xa=T((oj,zy)=>{"use strict";zy.exports=Function.prototype.apply});var Vy=T((sj,Wy)=>{"use strict";Wy.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Tu=T((aj,Gy)=>{"use strict";var eR=rn(),tR=xa(),rR=Sa(),iR=Vy();Gy.exports=iR||eR.call(rR,tR)});var Ta=T((lj,Ky)=>{"use strict";var nR=rn(),oR=Ht(),sR=Sa(),aR=Tu();Ky.exports=a(function(e){if(e.length<1||typeof e[0]!="function")throw new oR("a function is required");return aR(nR,sR,e)},"callBindBasic")});var e0=T((fj,Qy)=>{"use strict";var lR=Ta(),Zy=tn(),Yy;try{Yy=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ou=!!Yy&&Zy&&Zy(Object.prototype,"__proto__"),Jy=Object,Xy=Jy.getPrototypeOf;Qy.exports=Ou&&typeof Ou.get=="function"?lR([Ou.get]):typeof Xy=="function"?a(function(e){return Xy(e==null?e:Jy(e))},"getDunder"):!1});var Ru=T((hj,n0)=>{"use strict";var t0=Su(),r0=xu(),i0=e0();n0.exports=t0?a(function(e){return t0(e)},"getProto"):r0?a(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return r0(e)},"getProto"):i0?a(function(e){return i0(e)},"getProto"):null});var s0=T((pj,o0)=>{"use strict";var cR=Function.prototype.call,fR=Object.prototype.hasOwnProperty,uR=rn();o0.exports=uR.call(cR,fR)});var Eo=T((mj,h0)=>{"use strict";var J,hR=_u(),dR=iy(),pR=oy(),mR=ay(),wR=cy(),an=Fu(),sn=Ht(),yR=hy(),gR=py(),bR=wy(),vR=gy(),_R=vy(),FR=Fy(),ER=Sy(),SR=Ry(),f0=Function,ku=a(function(t){try{return f0('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),vo=tn(),xR=bo(),Pu=a(function(){throw new sn},"throwTypeError"),TR=vo?function(){try{return arguments.callee,Pu}catch{try{return vo(arguments,"callee").get}catch{return Pu}}}():Pu,nn=By()(),Ce=Ru(),OR=xu(),RR=Su(),u0=xa(),_o=Sa(),on={},kR=typeof Uint8Array>"u"||!Ce?J:Ce(Uint8Array),ai={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":nn&&Ce?Ce([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":on,"%AsyncGenerator%":on,"%AsyncGeneratorFunction%":on,"%AsyncIteratorPrototype%":on,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":dR,"%eval%":eval,"%EvalError%":pR,"%Float16Array%":typeof Float16Array>"u"?J:Float16Array,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":f0,"%GeneratorFunction%":on,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nn&&Ce?Ce(Ce([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nn||!Ce?J:Ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":hR,"%Object.getOwnPropertyDescriptor%":vo,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":mR,"%ReferenceError%":wR,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nn||!Ce?J:Ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nn&&Ce?Ce(""[Symbol.iterator]()):J,"%Symbol%":nn?Symbol:J,"%SyntaxError%":an,"%ThrowTypeError%":TR,"%TypedArray%":kR,"%TypeError%":sn,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":yR,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet,"%Function.prototype.call%":_o,"%Function.prototype.apply%":u0,"%Object.defineProperty%":xR,"%Object.getPrototypeOf%":OR,"%Math.abs%":gR,"%Math.floor%":bR,"%Math.max%":vR,"%Math.min%":_R,"%Math.pow%":FR,"%Math.round%":ER,"%Math.sign%":SR,"%Reflect.getPrototypeOf%":RR};if(Ce)try{null.error}catch(t){a0=Ce(Ce(t)),ai["%Error.prototype%"]=a0}var a0,PR=a(function t(e){var r;if(e==="%AsyncFunction%")r=ku("async function () {}");else if(e==="%GeneratorFunction%")r=ku("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=ku("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ce&&(r=Ce(n.prototype))}return ai[e]=r,r},"doEval"),l0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Fo=rn(),Oa=s0(),AR=Fo.call(_o,Array.prototype.concat),IR=Fo.call(u0,Array.prototype.splice),c0=Fo.call(_o,String.prototype.replace),Ra=Fo.call(_o,String.prototype.slice),DR=Fo.call(_o,RegExp.prototype.exec),CR=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,NR=/\\(\\)?/g,BR=a(function(e){var r=Ra(e,0,1),i=Ra(e,-1);if(r==="%"&&i!=="%")throw new an("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new an("invalid intrinsic syntax, expected opening `%`");var n=[];return c0(e,CR,function(o,s,l,f){n[n.length]=l?c0(f,NR,"$1"):s||o}),n},"stringToPath"),LR=a(function(e,r){var i=e,n;if(Oa(l0,i)&&(n=l0[i],i="%"+n[0]+"%"),Oa(ai,i)){var o=ai[i];if(o===on&&(o=PR(i)),typeof o>"u"&&!r)throw new sn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new an("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");h0.exports=a(function(e,r){if(typeof e!="string"||e.length===0)throw new sn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new sn('"allowMissing" argument must be a boolean');if(DR(/^%?[^%]*%?$/,e)===null)throw new an("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=BR(e),n=i.length>0?i[0]:"",o=LR("%"+n+"%",r),s=o.name,l=o.value,f=!1,c=o.alias;c&&(n=c[0],IR(i,AR([0,1],c)));for(var u=1,h=!0;u<i.length;u+=1){var d=i[u],p=Ra(d,0,1),m=Ra(d,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new an("property names with quotes must have matching quotes");if((d==="constructor"||!h)&&(f=!0),n+="."+d,s="%"+n+"%",Oa(ai,s))l=ai[s];else if(l!=null){if(!(d in l)){if(!r)throw new sn("base intrinsic for "+e+" exists, but the property is not available.");return}if(vo&&u+1>=i.length){var w=vo(l,d);h=!!w,h&&"get"in w&&!("originalValue"in w.get)?l=w.get:l=l[d]}else h=Oa(l,d),l=l[d];h&&!f&&(ai[s]=l)}}return l},"GetIntrinsic")});var So=T((yj,m0)=>{"use strict";var d0=Eo(),p0=Ta(),$R=p0([d0("%String.prototype.indexOf%")]);m0.exports=a(function(e,r){var i=d0(e,!!r);return typeof i=="function"&&$R(e,".prototype.")>-1?p0([i]):i},"callBoundIntrinsic")});var Au=T((bj,y0)=>{"use strict";var MR=Eo(),xo=So(),jR=go(),UR=Ht(),w0=MR("%Map%",!0),HR=xo("Map.prototype.get",!0),qR=xo("Map.prototype.set",!0),zR=xo("Map.prototype.has",!0),WR=xo("Map.prototype.delete",!0),VR=xo("Map.prototype.size",!0);y0.exports=!!w0&&a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new UR("Side channel does not contain "+jR(i))},"assert"),delete:a(function(i){if(e){var n=WR(e,i);return VR(e)===0&&(e=void 0),n}return!1},"delete"),get:a(function(i){if(e)return HR(e,i)},"get"),has:a(function(i){return e?zR(e,i):!1},"has"),set:a(function(i,n){e||(e=new w0),qR(e,i,n)},"set")};return r},"getSideChannelMap")});var b0=T((_j,g0)=>{"use strict";var GR=Eo(),Pa=So(),KR=go(),ka=Au(),ZR=Ht(),ln=GR("%WeakMap%",!0),XR=Pa("WeakMap.prototype.get",!0),YR=Pa("WeakMap.prototype.set",!0),JR=Pa("WeakMap.prototype.has",!0),QR=Pa("WeakMap.prototype.delete",!0);g0.exports=ln?a(function(){var e,r,i={assert:a(function(n){if(!i.has(n))throw new ZR("Side channel does not contain "+KR(n))},"assert"),delete:a(function(n){if(ln&&n&&(typeof n=="object"||typeof n=="function")){if(e)return QR(e,n)}else if(ka&&r)return r.delete(n);return!1},"delete"),get:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?XR(e,n):r&&r.get(n)},"get"),has:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?JR(e,n):!!r&&r.has(n)},"has"),set:a(function(n,o){ln&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new ln),YR(e,n,o)):ka&&(r||(r=ka()),r.set(n,o))},"set")};return i},"getSideChannelWeakMap"):ka});var _0=T((Ej,v0)=>{"use strict";var ek=Ht(),tk=go(),rk=ey(),ik=Au(),nk=b0(),ok=nk||ik||rk;v0.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new ek("Side channel does not contain "+tk(i))},"assert"),delete:a(function(i){return!!e&&e.delete(i)},"delete"),get:a(function(i){return e&&e.get(i)},"get"),has:a(function(i){return!!e&&e.has(i)},"has"),set:a(function(i,n){e||(e=ok()),e.set(i,n)},"set")};return r},"getSideChannel")});var Aa=T((xj,F0)=>{"use strict";var sk=String.prototype.replace,ak=/%20/g,Iu={RFC1738:"RFC1738",RFC3986:"RFC3986"};F0.exports={default:Iu.RFC3986,formatters:{RFC1738:a(function(t){return sk.call(t,ak,"+")},"RFC1738"),RFC3986:a(function(t){return String(t)},"RFC3986")},RFC1738:Iu.RFC1738,RFC3986:Iu.RFC3986}});var Nu=T((Oj,S0)=>{"use strict";var lk=Aa(),Du=Object.prototype.hasOwnProperty,li=Array.isArray,zt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),ck=a(function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(li(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&n.push(i[o]);r.obj[r.prop]=n}}},"compactQueue"),E0=a(function(e,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},"arrayToObject"),fk=a(function t(e,r,i){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(li(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Du.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return li(e)&&!li(r)&&(n=E0(e,i)),li(e)&&li(r)?(r.forEach(function(o,s){if(Du.call(e,s)){var l=e[s];l&&typeof l=="object"&&o&&typeof o=="object"?e[s]=t(l,o,i):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var l=r[s];return Du.call(o,s)?o[s]=t(o[s],l,i):o[s]=l,o},n)},"merge"),uk=a(function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},"assignSingleSource"),hk=a(function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},"decode"),Cu=1024,dk=a(function(e,r,i,n,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var l="",f=0;f<s.length;f+=Cu){for(var c=s.length>=Cu?s.slice(f,f+Cu):s,u=[],h=0;h<c.length;++h){var d=c.charCodeAt(h);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===lk.RFC1738&&(d===40||d===41)){u[u.length]=c.charAt(h);continue}if(d<128){u[u.length]=zt[d];continue}if(d<2048){u[u.length]=zt[192|d>>6]+zt[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=zt[224|d>>12]+zt[128|d>>6&63]+zt[128|d&63];continue}h+=1,d=65536+((d&1023)<<10|c.charCodeAt(h)&1023),u[u.length]=zt[240|d>>18]+zt[128|d>>12&63]+zt[128|d>>6&63]+zt[128|d&63]}l+=u.join("")}return l},"encode"),pk=a(function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],l=Object.keys(s),f=0;f<l.length;++f){var c=l[f],u=s[c];typeof u=="object"&&u!==null&&i.indexOf(u)===-1&&(r.push({obj:s,prop:c}),i.push(u))}return ck(r),e},"compact"),mk=a(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),wk=a(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),yk=a(function(e,r){return[].concat(e,r)},"combine"),gk=a(function(e,r){if(li(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},"maybeMap");S0.exports={arrayToObject:E0,assign:uk,combine:yk,compact:pk,decode:hk,encode:dk,isBuffer:wk,isRegExp:mk,maybeMap:gk,merge:fk}});var P0=T((kj,k0)=>{"use strict";var T0=_0(),Ia=Nu(),To=Aa(),bk=Object.prototype.hasOwnProperty,O0={brackets:a(function(e){return e+"[]"},"brackets"),comma:"comma",indices:a(function(e,r){return e+"["+r+"]"},"indices"),repeat:a(function(e){return e},"repeat")},Wt=Array.isArray,vk=Array.prototype.push,R0=a(function(t,e){vk.apply(t,Wt(e)?e:[e])},"pushToArray"),_k=Date.prototype.toISOString,x0=To.default,ke={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ia.encode,encodeValuesOnly:!1,filter:void 0,format:x0,formatter:To.formatters[x0],indices:!1,serializeDate:a(function(e){return _k.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},Fk=a(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Bu={},Ek=a(function t(e,r,i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g){for(var F=e,O=g,S=0,R=!1;(O=O.get(Bu))!==void 0&&!R;){var b=O.get(e);if(S+=1,typeof b<"u"){if(b===S)throw new RangeError("Cyclic object value");R=!0}typeof O.get(Bu)>"u"&&(S=0)}if(typeof u=="function"?F=u(r,F):F instanceof Date?F=p(F):i==="comma"&&Wt(F)&&(F=Ia.maybeMap(F,function(G){return G instanceof Date?p(G):G})),F===null){if(s)return c&&!y?c(r,ke.encoder,v,"key",m):r;F=""}if(Fk(F)||Ia.isBuffer(F)){if(c){var x=y?r:c(r,ke.encoder,v,"key",m);return[w(x)+"="+w(c(F,ke.encoder,v,"value",m))]}return[w(r)+"="+w(String(F))]}var _=[];if(typeof F>"u")return _;var P;if(i==="comma"&&Wt(F))y&&c&&(F=Ia.maybeMap(F,c)),P=[{value:F.length>0?F.join(",")||null:void 0}];else if(Wt(u))P=u;else{var k=Object.keys(F);P=h?k.sort(h):k}var C=f?String(r).replace(/\./g,"%2E"):String(r),N=n&&Wt(F)&&F.length===1?C+"[]":C;if(o&&Wt(F)&&F.length===0)return N+"[]";for(var U=0;U<P.length;++U){var Z=P[U],me=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:F[Z];if(!(l&&me===null)){var Ee=d&&f?String(Z).replace(/\./g,"%2E"):String(Z),$=Wt(F)?typeof i=="function"?i(N,Ee):N:N+(d?"."+Ee:"["+Ee+"]");g.set(e,S);var q=T0();q.set(Bu,g),R0(_,t(me,$,i,n,o,s,l,f,i==="comma"&&y&&Wt(F)?null:c,u,h,d,p,m,w,y,v,q))}}return _},"stringify"),Sk=a(function(e){if(!e)return ke;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ke.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=To.default;if(typeof e.format<"u"){if(!bk.call(To.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=To.formatters[i],o=ke.filter;(typeof e.filter=="function"||Wt(e.filter))&&(o=e.filter);var s;if(e.arrayFormat in O0?s=e.arrayFormat:"indices"in e?s=e.indices?"indices":"repeat":s=ke.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:ke.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ke.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ke.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ke.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?ke.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ke.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:ke.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:ke.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ke.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ke.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ke.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ke.strictNullHandling}},"normalizeStringifyOptions");k0.exports=function(t,e){var r=t,i=Sk(e),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):Wt(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var l=O0[i.arrayFormat],f=l==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=T0(),u=0;u<n.length;++u){var h=n[u],d=r[h];i.skipNulls&&d===null||R0(s,Ek(d,h,l,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var p=s.join(i.delimiter),m=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),p.length>0?m+p:""}});var C0=T((Aj,D0)=>{"use strict";var ci=Nu(),Lu=Object.prototype.hasOwnProperty,A0=Array.isArray,ye={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ci.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},xk=a(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),I0=a(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),Tk="utf8=%26%2310003%3B",Ok="utf8=%E2%9C%93",Rk=a(function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded?o+1:o);if(r.throwOnLimitExceeded&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var l=-1,f,c=r.charset;if(r.charsetSentinel)for(f=0;f<s.length;++f)s[f].indexOf("utf8=")===0&&(s[f]===Ok?c="utf-8":s[f]===Tk&&(c="iso-8859-1"),l=f,f=s.length);for(f=0;f<s.length;++f)if(f!==l){var u=s[f],h=u.indexOf("]="),d=h===-1?u.indexOf("="):h+1,p,m;d===-1?(p=r.decoder(u,ye.decoder,c,"key"),m=r.strictNullHandling?null:""):(p=r.decoder(u.slice(0,d),ye.decoder,c,"key"),m=ci.maybeMap(I0(u.slice(d+1),r,A0(i[p])?i[p].length:0),function(y){return r.decoder(y,ye.decoder,c,"value")})),m&&r.interpretNumericEntities&&c==="iso-8859-1"&&(m=xk(String(m))),u.indexOf("[]=")>-1&&(m=A0(m)?[m]:m);var w=Lu.call(i,p);w&&r.duplicates==="combine"?i[p]=ci.combine(i[p],m):(!w||r.duplicates==="last")&&(i[p]=m)}return i},"parseQueryStringValues"),kk=a(function(t,e,r,i){var n=0;if(t.length>0&&t[t.length-1]==="[]"){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var s=i?e:I0(e,r,n),l=t.length-1;l>=0;--l){var f,c=t[l];if(c==="[]"&&r.parseArrays)f=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:ci.combine([],s);else{f=r.plainObjects?{__proto__:null}:{};var u=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,h=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,d=parseInt(h,10);!r.parseArrays&&h===""?f={0:s}:!isNaN(d)&&c!==h&&String(d)===h&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(f=[],f[d]=s):h!=="__proto__"&&(f[h]=s)}s=f}return s},"parseObject"),Pk=a(function(e,r,i,n){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,f=i.depth>0&&s.exec(o),c=f?o.slice(0,f.index):o,u=[];if(c){if(!i.plainObjects&&Lu.call(Object.prototype,c)&&!i.allowPrototypes)return;u.push(c)}for(var h=0;i.depth>0&&(f=l.exec(o))!==null&&h<i.depth;){if(h+=1,!i.plainObjects&&Lu.call(Object.prototype,f[1].slice(1,-1))&&!i.allowPrototypes)return;u.push(f[1])}if(f){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");u.push("["+o.slice(f.index)+"]")}return kk(u,r,i,n)}},"parseQueryStringKeys"),Ak=a(function(e){if(!e)return ye;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?ye.charset:e.charset,i=typeof e.duplicates>"u"?ye.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ye.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ye.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ye.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ye.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ye.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ye.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ye.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ye.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ye.decoder,delimiter:typeof e.delimiter=="string"||ci.isRegExp(e.delimiter)?e.delimiter:ye.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ye.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ye.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ye.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ye.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ye.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ye.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");D0.exports=function(t,e){var r=Ak(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof t=="string"?Rk(t,r):t,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var l=o[s],f=Pk(l,i[l],r,typeof t=="string");n=ci.merge(n,f,r)}return r.allowSparse===!0?n:ci.compact(n)}});var B0=T((Dj,N0)=>{"use strict";var Ik=P0(),Dk=C0(),Ck=Aa();N0.exports={formats:Ck,parse:Dk,stringify:Ik}});var Ro=T(fn=>{"use strict";var Nk=Pw();function pt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}a(pt,"Url");var Bk=/^([a-z0-9.+-]+:)/i,Lk=/:[0-9]*$/,$k=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,Mk=["<",">",'"',"`"," ","\r",`
|
|
8
|
-
`," "],jk=["{","}","|","\\","^","`"].concat(Mk),$u=["'"].concat(jk),L0=["%","/","?",";","#"].concat($u),$0=["/","?","#"],Uk=255,M0=/^[+a-z0-9A-Z_-]{0,63}$/,Hk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,qk={javascript:!0,"javascript:":!0},Mu={javascript:!0,"javascript:":!0},cn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},ju=B0();function Oo(t,e,r){if(t&&typeof t=="object"&&t instanceof pt)return t;var i=new pt;return i.parse(t,e,r),i}a(Oo,"urlParse");pt.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n),s=/\\/g;o[0]=o[0].replace(s,"/"),t=o.join(n);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var f=$k.exec(l);if(f)return this.path=l,this.href=l,this.pathname=f[1],f[2]?(this.search=f[2],e?this.query=ju.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=Bk.exec(l);if(c){c=c[0];var u=c.toLowerCase();this.protocol=u,l=l.substr(c.length)}if(r||c||l.match(/^\/\/[^@/]+@[^@/]+/)){var h=l.substr(0,2)==="//";h&&!(c&&Mu[c])&&(l=l.substr(2),this.slashes=!0)}if(!Mu[c]&&(h||c&&!cn[c])){for(var d=-1,p=0;p<$0.length;p++){var m=l.indexOf($0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}var w,y;d===-1?y=l.lastIndexOf("@"):y=l.lastIndexOf("@",d),y!==-1&&(w=l.slice(0,y),l=l.slice(y+1),this.auth=decodeURIComponent(w)),d=-1;for(var p=0;p<L0.length;p++){var m=l.indexOf(L0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}d===-1&&(d=l.length),this.host=l.slice(0,d),l=l.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var g=this.hostname.split(/\./),p=0,F=g.length;p<F;p++){var O=g[p];if(O&&!O.match(M0)){for(var S="",R=0,b=O.length;R<b;R++)O.charCodeAt(R)>127?S+="x":S+=O[R];if(!S.match(M0)){var x=g.slice(0,p),_=g.slice(p+1),P=O.match(Hk);P&&(x.push(P[1]),_.unshift(P[2])),_.length&&(l="/"+_.join(".")+l),this.hostname=x.join(".");break}}}this.hostname.length>Uk?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Nk.toASCII(this.hostname));var k=this.port?":"+this.port:"",C=this.hostname||"";this.host=C+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!qk[u])for(var p=0,F=$u.length;p<F;p++){var N=$u[p];if(l.indexOf(N)!==-1){var U=encodeURIComponent(N);U===N&&(U=escape(N)),l=l.split(N).join(U)}}var Z=l.indexOf("#");Z!==-1&&(this.hash=l.substr(Z),l=l.slice(0,Z));var me=l.indexOf("?");if(me!==-1?(this.search=l.substr(me),this.query=l.substr(me+1),e&&(this.query=ju.parse(this.query)),l=l.slice(0,me)):e&&(this.search="",this.query={}),l&&(this.pathname=l),cn[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",Ee=this.search||"";this.path=k+Ee}return this.href=this.format(),this};function zk(t){return typeof t=="string"&&(t=Oo(t)),t instanceof pt?t.format():pt.prototype.format.call(t)}a(zk,"urlFormat");pt.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=ju.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||cn[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),s=s.replace("#","%23"),e+n+r+s+i};function Wk(t,e){return Oo(t,!1,!0).resolve(e)}a(Wk,"urlResolve");pt.prototype.resolve=function(t){return this.resolveObject(Oo(t,!1,!0)).format()};function Vk(t,e){return t?Oo(t,!1,!0).resolveObject(e):e}a(Vk,"urlResolveObject");pt.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new pt;e.parse(t,!1,!0),t=e}for(var r=new pt,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var f=s[l];f!=="protocol"&&(r[f]=t[f])}return cn[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!cn[t.protocol]){for(var c=Object.keys(t),u=0;u<c.length;u++){var h=c[u];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!Mu[t.protocol]){for(var F=(t.pathname||"").split("/");F.length&&!(t.host=F.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),F[0]!==""&&F.unshift(""),F.length<2&&F.unshift(""),r.pathname=F.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&r.pathname.charAt(0)==="/",w=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=w||m||r.host&&t.pathname,v=y,g=r.pathname&&r.pathname.split("/")||[],F=t.pathname&&t.pathname.split("/")||[],O=r.protocol&&!cn[r.protocol];if(O&&(r.hostname="",r.port=null,r.host&&(g[0]===""?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(F[0]===""?F[0]=t.host:F.unshift(t.host)),t.host=null),y=y&&(F[0]===""||g[0]==="")),w)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=F;else if(F.length)g||(g=[]),g.pop(),g=g.concat(F),r.search=t.search,r.query=t.query;else if(t.search!=null){if(O){r.host=g.shift(),r.hostname=r.host;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var R=g.slice(-1)[0],b=(r.host||t.host||g.length>1)&&(R==="."||R==="..")||R==="",x=0,_=g.length;_>=0;_--)R=g[_],R==="."?g.splice(_,1):R===".."?(g.splice(_,1),x++):x&&(g.splice(_,1),x--);if(!y&&!v)for(;x--;x)g.unshift("..");y&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),b&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(O){r.hostname=P?"":g.length?g.shift():"",r.host=r.hostname;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return y=y||r.host&&g.length,y&&!P&&g.unshift(""),g.length>0?r.pathname=g.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};pt.prototype.parseHost=function(){var t=this.host,e=Lk.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};fn.parse=Oo;fn.resolve=Wk;fn.resolveObject=Vk;fn.format=zk;fn.Url=pt});var Ir=T(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getWriteSyncArgs=Pe.getWriteArgs=Pe.bufToUint8=void 0;Pe.promisify=Kk;Pe.validateCallback=j0;Pe.modeToNumber=U0;Pe.nullCheck=H0;Pe.pathToFilename=Yk;Pe.createError=dP;Pe.genRndStr6=pP;Pe.flagsToNumber=mP;Pe.streamToBuffer=wP;Pe.bufferToEncoding=vP;Pe.isReadableStream=_P;var ko=Yi(),Uu=co(),Hu=Or(),Gk=lu(),Da=ya();function Kk(t,e,r=i=>i){return(...i)=>new Promise((n,o)=>{t[e].bind(t)(...i,(s,l)=>s?o(s):n(r(l)))})}a(Kk,"promisify");function j0(t){if(typeof t!="function")throw TypeError(ko.ERRSTR.CB);return t}a(j0,"validateCallback");function Zk(t,e){if(typeof t=="number")return t;if(typeof t=="string")return parseInt(t,8);if(e)return U0(e)}a(Zk,"_modeToNumber");function U0(t,e){let r=Zk(t,e);if(typeof r!="number"||isNaN(r))throw new TypeError(ko.ERRSTR.MODE_INT);return r}a(U0,"modeToNumber");function H0(t,e){if((""+t).indexOf("\0")!==-1){let r=new Error("Path must be a string without null bytes");if(r.code="ENOENT",typeof e!="function")throw r;return(0,Gk.default)(()=>{e(r)}),!1}return!0}a(H0,"nullCheck");function Xk(t){if(t.hostname!=="")throw new Uu.TypeError("ERR_INVALID_FILE_URL_HOST",process.platform);let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)|32;if(e[r+1]==="2"&&i===102)throw new Uu.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(e)}a(Xk,"getPathFromURLPosix");function Yk(t){if(t instanceof Uint8Array&&(t=(0,Hu.bufferFrom)(t)),typeof t!="string"&&!Hu.Buffer.isBuffer(t)){try{if(!(t instanceof Ro().URL))throw new TypeError(ko.ERRSTR.PATH_STR)}catch{throw new TypeError(ko.ERRSTR.PATH_STR)}t=Xk(t)}let e=String(t);return H0(e),e}a(Yk,"pathToFilename");var Jk="ENOENT",Qk="EBADF",eP="EINVAL",tP="EPERM",rP="EPROTO",iP="EEXIST",nP="ENOTDIR",oP="EMFILE",sP="EACCES",aP="EISDIR",lP="ENOTEMPTY",cP="ENOSYS",fP="ERR_FS_EISDIR",uP="ERR_OUT_OF_RANGE";function hP(t,e="",r="",i=""){let n="";switch(r&&(n=` '${r}'`),i&&(n+=` -> '${i}'`),t){case Jk:return`ENOENT: no such file or directory, ${e}${n}`;case Qk:return`EBADF: bad file descriptor, ${e}${n}`;case eP:return`EINVAL: invalid argument, ${e}${n}`;case tP:return`EPERM: operation not permitted, ${e}${n}`;case rP:return`EPROTO: protocol error, ${e}${n}`;case iP:return`EEXIST: file already exists, ${e}${n}`;case nP:return`ENOTDIR: not a directory, ${e}${n}`;case aP:return`EISDIR: illegal operation on a directory, ${e}${n}`;case sP:return`EACCES: permission denied, ${e}${n}`;case lP:return`ENOTEMPTY: directory not empty, ${e}${n}`;case oP:return`EMFILE: too many open files, ${e}${n}`;case cP:return`ENOSYS: function not implemented, ${e}${n}`;case fP:return`[ERR_FS_EISDIR]: Path is a directory: ${e} returned EISDIR (is a directory) ${r}`;case uP:return`[ERR_OUT_OF_RANGE]: value out of range, ${e}${n}`;default:return`${t}: error occurred, ${e}${n}`}}a(hP,"formatError");function dP(t,e="",r="",i="",n=Error){let o=new n(hP(t,e,r,i));return o.code=t,r&&(o.path=r),o}a(dP,"createError");function pP(){return Math.random().toString(36).slice(2,8).padEnd(6,"0")}a(pP,"genRndStr6");function mP(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=ko.FLAGS[t];if(typeof e<"u")return e}throw new Uu.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}a(mP,"flagsToNumber");function wP(t){let e=[];return new Promise((r,i)=>{t.on("data",n=>e.push(n)),t.on("end",()=>r(Hu.Buffer.concat(e))),t.on("error",i)})}a(wP,"streamToBuffer");var yP=a(t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"bufToUint8");Pe.bufToUint8=yP;var gP=a((t,e,r,i,n,o)=>{(0,Da.validateFd)(t);let s=0,l,f=null,c,u,h=typeof e,d=typeof r,p=typeof i,m=typeof n;h!=="string"?d==="function"?u=r:p==="function"?(s=r|0,u=i):m==="function"?(s=r|0,l=i,u=n):(s=r|0,l=i,f=n,u=o):d==="function"?u=r:p==="function"?(f=r,u=i):m==="function"&&(f=r,c=i,u=n);let w=(0,Da.dataToBuffer)(e,c);h!=="string"?typeof l>"u"&&(l=w.length):(s=0,l=w.length);let y=j0(u);return[t,h==="string",w,s,l,f,y]},"getWriteArgs");Pe.getWriteArgs=gP;var bP=a((t,e,r,i,n)=>{(0,Da.validateFd)(t);let o,s,l,f,c=typeof e!="string";c?(s=(r||0)|0,l=i,f=n):(f=r,o=i);let u=(0,Da.dataToBuffer)(e,o);return c?typeof l>"u"&&(l=u.length):(s=0,l=u.length),[t,u,s||0,l,f]},"getWriteSyncArgs");Pe.getWriteSyncArgs=bP;function vP(t,e){return!e||e==="buffer"?t:t.toString(e)}a(vP,"bufferToEncoding");function _P(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"&&t.readable===!0}a(_P,"isReadableStream")});var K0=T(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.Superblock=void 0;var Ne=Gi(),FP=tu(),q0=iu(),EP=su(),SP=Or(),z0=na(),Vt=Pt(),W0=Yi(),V=Ir(),At=ya(),xP=Zf(),un=Ne.posix?Ne.posix.sep:Ne.sep,V0=Ne.posix?Ne.posix.relative:Ne.relative,TP=Ne.posix?Ne.posix.join:Ne.join,{O_RDONLY:qu,O_WRONLY:Ca,O_RDWR:zu,O_CREAT:G0,O_EXCL:OP,O_TRUNC:RP,O_APPEND:kP,O_DIRECTORY:PP}=Vt.constants,hn=class hn{static fromJSON(e,r){let i=new hn;return i.fromJSON(e,r),i}static fromNestedJSON(e,r){let i=new hn;return i.fromNestedJSON(e,r),i}constructor(e={}){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.open=(i,n,o,s=!0)=>{let l=this.openFile(i,n,o,s);if(!l)throw(0,V.createError)("ENOENT","open",i);return l.fd},this.writeFile=(i,n,o,s)=>{let l=typeof i=="number",f;l?f=i:f=this.open((0,V.pathToFilename)(i),o,s);let c=0,u=n.length,h=o&kP?void 0:0;try{for(;u>0;){let d=this.write(f,n,c,u,h);c+=d,u-=d,h!==void 0&&(h+=d)}}finally{l||this.close(f)}},this.read=(i,n,o,s,l)=>{if(n.byteLength<s)throw(0,V.createError)("ERR_OUT_OF_RANGE","read",void 0,void 0,RangeError);let f=this.getFileByFdOrThrow(i);if(f.node.isSymlink())throw(0,V.createError)("EPERM","read",f.link.getPath());return f.read(n,Number(o),Number(s),l===-1||typeof l!="number"?void 0:l)},this.readv=(i,n,o)=>{let s=this.getFileByFdOrThrow(i),l=o??void 0;l===-1&&(l=void 0);let f=0;for(let c of n){let u=s.read(c,0,c.byteLength,l);if(l=void 0,f+=u,u<c.byteLength)break}return f},this.link=(i,n)=>{let o;try{o=this.getLinkOrThrow(i,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let s=(0,Ne.dirname)(n),l;try{l=this.getLinkOrThrow(s,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let f=(0,Ne.basename)(n);if(l.getChild(f))throw(0,V.createError)("EEXIST","link",i,n);let c=o.getNode();c.nlink++,l.createChild(f,c)},this.unlink=i=>{let n=this.getLinkOrThrow(i,"unlink");if(n.length)throw Error("Dir not empty...");this.deleteLink(n);let o=n.getNode();o.nlink--,o.nlink<=0&&this.deleteNode(o)},this.symlink=(i,n)=>{let o=(0,At.filenameToSteps)(n),s;try{s=this.getLinkParentAsDirOrThrow(o)}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"symlink",i,n)),u}let l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","symlink",i,n);let f=s.getNode();if(!f.canExecute()||!f.canWrite())throw(0,V.createError)("EACCES","symlink",i,n);let c=s.createChild(l);return c.getNode().makeSymlink(i),c},this.rename=(i,n)=>{let o;try{o=this.getResolvedLinkOrThrow(i)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let s;try{s=this.getLinkParentAsDirOrThrow(n)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let l=o.parent;if(!l)throw(0,V.createError)("EINVAL","rename",i,n);let f=l.getNode(),c=s.getNode();if(!f.canExecute()||!f.canWrite()||!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","rename",i,n);l.deleteChild(o);let u=(0,Ne.basename)(n);o.name=u,o.steps=[...s.steps,u],s.setChild(o.getName(),o)},this.mkdir=(i,n)=>{let o=(0,At.filenameToSteps)(i);if(!o.length)throw(0,V.createError)("EEXIST","mkdir",i);let s=this.getLinkParentAsDirOrThrow(i,"mkdir"),l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","mkdir",i);let f=s.getNode();if(!f.canWrite()||!f.canExecute())throw(0,V.createError)("EACCES","mkdir",i);s.createChild(l,this.createNode(Vt.constants.S_IFDIR|n))},this.mkdirp=(i,n)=>{let o=!1,s=(0,At.filenameToSteps)(i),l=null,f=s.length;for(f=s.length;f>=0&&(l=this.getResolvedLink(s.slice(0,f)),!l);f--);for(l||(l=this.root,f=0),l=this.getResolvedLinkOrThrow(Ne.sep+s.slice(0,f).join(Ne.sep),"mkdir"),f;f<s.length;f++){let c=l.getNode();if(c.isDirectory()){if(!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","mkdir",i)}else throw(0,V.createError)("ENOTDIR","mkdir",i);o=!0,l=l.createChild(s[f],this.createNode(Vt.constants.S_IFDIR|n))}return o?i:void 0},this.rmdir=(i,n=!1)=>{let o=this.getLinkAsDirOrThrow(i,"rmdir");if(o.length&&!n)throw(0,V.createError)("ENOTEMPTY","rmdir",i);this.deleteLink(o)},this.rm=(i,n=!1,o=!1)=>{let s;try{s=this.getResolvedLinkOrThrow(i,"stat")}catch(l){if(l.code==="ENOENT"&&n)return;throw l}if(s.getNode().isDirectory()&&!o)throw(0,V.createError)("ERR_FS_EISDIR","rm",i);if(!s.parent?.getNode().canWrite())throw(0,V.createError)("EACCES","rm",i);this.deleteLink(s)},this.close=i=>{(0,At.validateFd)(i);let n=this.getFileByFdOrThrow(i,"close");this.closeFile(n)};let r=this.createLink();r.setNode(this.createNode(Vt.constants.S_IFDIR|511)),r.setChild(".",r),r.getNode().nlink++,r.setChild("..",r),r.getNode().nlink++,this.root=r}createLink(e,r,i=!1,n){if(!e)return new q0.Link(this,void 0,"");if(!r)throw new Error("createLink: name cannot be empty");let o=n??(i?511:438),l=n&&n&Vt.constants.S_IFMT?n&Vt.constants.S_IFMT:i?Vt.constants.S_IFDIR:Vt.constants.S_IFREG,f=o&~Vt.constants.S_IFMT|l;return e.createChild(r,this.createNode(f))}deleteLink(e){let r=e.parent;return r?(r.deleteChild(e),!0):!1}newInoNumber(){let e=this.releasedInos.pop();return e||(this.ino=(this.ino+1)%4294967295,this.ino)}newFdNumber(){let e=this.releasedFds.pop();return typeof e=="number"?e:hn.fd--}createNode(e){let r=new FP.Node(this.newInoNumber(),e);return this.inodes[r.ino]=r,r}deleteNode(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)}walk(e,r=!1,i=!1,n=!1,o){let s,l;e instanceof q0.Link?(s=e.steps,l=un+s.join(un)):typeof e=="string"?(s=(0,At.filenameToSteps)(e),l=e):(s=e,l=un+s.join(un));let f=this.root,c=0;for(;c<s.length;){let u=f.getNode();if(u.isDirectory()){if(n&&!u.canExecute())throw(0,V.createError)("EACCES",o,l)}else if(c<s.length-1)throw(0,V.createError)("ENOTDIR",o,l);if(f=f.getChild(s[c])??null,!f){if(i)throw(0,V.createError)("ENOENT",o,l);return null}if(u=f?.getNode(),u.isSymlink()&&(r||c<s.length-1)){let h=(0,Ne.isAbsolute)(u.symlink)?u.symlink:TP((0,Ne.dirname)(f.getPath()),u.symlink);s=(0,At.filenameToSteps)(h).concat(s.slice(c+1)),f=this.root,c=0;continue}if(i&&!u.isDirectory()&&c<s.length-1){let h=z0.default.platform==="win32"?"ENOENT":"ENOTDIR";throw(0,V.createError)(h,o,l)}c++}return f}getLink(e){return this.walk(e,!1,!1,!1)}getLinkOrThrow(e,r){return this.walk(e,!1,!0,!0,r)}getResolvedLink(e){return this.walk(e,!0,!1,!1)}getResolvedLinkOrThrow(e,r){return this.walk(e,!0,!0,!0,r)}resolveSymlinks(e){return this.getResolvedLink(e.steps.slice(1))}getLinkAsDirOrThrow(e,r){let i=this.getLinkOrThrow(e,r);if(!i.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,e);return i}getLinkParent(e){return this.getLink(e.slice(0,-1))}getLinkParentAsDirOrThrow(e,r){let i=(e instanceof Array?e:(0,At.filenameToSteps)(e)).slice(0,-1),n=un+i.join(un),o=this.getLinkOrThrow(n,r);if(!o.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,n);return o}getFileByFd(e){return this.fds[String(e)]}getFileByFdOrThrow(e,r){if(!(0,At.isFd)(e))throw TypeError(W0.ERRSTR.FD);let i=this.getFileByFd(e);if(!i)throw(0,V.createError)("EBADF",r);return i}_toJSON(e=this.root,r={},i,n){let o=!0,s=e.children;e.getNode().isFile()&&(s=new Map([[e.getName(),e.parent.getChild(e.getName())]]),e=e.parent);for(let f of s.keys()){if(f==="."||f==="..")continue;o=!1;let c=e.getChild(f);if(!c)throw new Error("_toJSON: unexpected undefined");let u=c.getNode();if(u.isFile()){let h=c.getPath();i&&(h=V0(i,h)),r[h]=n?u.getBuffer():u.getString()}else u.isDirectory()&&this._toJSON(c,r,i,n)}let l=e.getPath();return i&&(l=V0(i,l)),l&&o&&(r[l]=null),r}toJSON(e,r={},i=!1,n=!1){let o=[];if(e){Array.isArray(e)||(e=[e]);for(let s of e){let l=(0,V.pathToFilename)(s),f=this.getResolvedLink(l);f&&o.push(f)}}else o.push(this.root);if(!o.length)return r;for(let s of o)this._toJSON(s,r,i?s.getPath():"",n);return r}fromJSON(e,r=z0.default.cwd()){for(let i in e){let n=e[i];if(i=(0,At.resolve)(i,r),typeof n=="string"||n instanceof SP.Buffer){let o=(0,Ne.dirname)(i);this.mkdirp(o,511);let s=(0,At.dataToBuffer)(n);this.writeFile(i,s,W0.FLAGS.w,438)}else this.mkdirp(i,511)}}fromNestedJSON(e,r){this.fromJSON((0,xP.flattenJSON)(e),r)}reset(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(Vt.constants.S_IFDIR|511))}mountSync(e,r){this.fromJSON(r,e)}openLink(e,r,i=!0){if(this.openFiles>=this.maxFiles)throw(0,V.createError)("EMFILE","open",e.getPath());let n=e;i&&(n=this.getResolvedLinkOrThrow(e.getPath(),"open"));let o=n.getNode();if(o.isDirectory()){if((r&(qu|zu|Ca))!==qu)throw(0,V.createError)("EISDIR","open",e.getPath())}else if(r&PP)throw(0,V.createError)("ENOTDIR","open",e.getPath());if((r&(qu|zu|Ca))!==Ca&&!o.canRead()||r&(Ca|zu)&&!o.canWrite())throw(0,V.createError)("EACCES","open",e.getPath());let s=new EP.File(e,o,r,this.newFdNumber());return this.fds[s.fd]=s,this.openFiles++,r&RP&&s.truncate(),s}openFile(e,r,i,n=!0){let o=(0,At.filenameToSteps)(e),s;try{if(s=n?this.getResolvedLinkOrThrow(e,"open"):this.getLinkOrThrow(e,"open"),s&&r&G0&&r&OP)throw(0,V.createError)("EEXIST","open",e)}catch(l){if(l.code==="ENOENT"&&r&G0){let f=(0,Ne.dirname)(e),c=this.getResolvedLinkOrThrow(f),u=c.getNode();if(!u.isDirectory())throw(0,V.createError)("ENOTDIR","open",e);if(!u.canExecute()||!u.canWrite())throw(0,V.createError)("EACCES","open",e);i??(i=438),s=this.createLink(c,o[o.length-1],!1,i)}else throw l}if(s)return this.openLink(s,r,n);throw(0,V.createError)("ENOENT","open",e)}closeFile(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))}write(e,r,i,n,o){let s=this.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,V.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}};a(hn,"Superblock");var Na=hn;Ba.Superblock=Na;Na.fd=2147483647});var X0=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.Superblock=mt.File=mt.Link=mt.Node=void 0;var Z0=(Gf(),gm(Vf));Z0.__exportStar(vw(),mt);Z0.__exportStar(Zf(),mt);var AP=tu();Object.defineProperty(mt,"Node",{enumerable:!0,get:a(function(){return AP.Node},"get")});var IP=iu();Object.defineProperty(mt,"Link",{enumerable:!0,get:a(function(){return IP.Link},"get")});var DP=su();Object.defineProperty(mt,"File",{enumerable:!0,get:a(function(){return DP.File},"get")});var CP=K0();Object.defineProperty(mt,"Superblock",{enumerable:!0,get:a(function(){return CP.Superblock},"get")})});var Y0=T(Po=>{"use strict";Object.defineProperty(Po,"__esModule",{value:!0});Po.StatFs=void 0;var $a=class $a{static build(e,r=!1){let i=new $a,n=r?u=>BigInt(u):u=>u;i.type=n(2240043254),i.bsize=n(4096);let o=Object.keys(e.inodes).length,s=1e6,l=Math.min(o*2,s),f=s-l;i.blocks=n(s),i.bfree=n(f),i.bavail=n(f);let c=1e6;return i.files=n(c),i.ffree=n(c-o),i}};a($a,"StatFs");var La=$a;Po.StatFs=La;Po.default=La});var J0=T(Wu=>{"use strict";Object.defineProperty(Wu,"__esModule",{value:!0});function NP(t,e,r){let i=setTimeout.apply(globalThis,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}a(NP,"setTimeoutUnref");Wu.default=NP});var Ao=T((Vj,Vu)=>{"use strict";var dn=typeof Reflect=="object"?Reflect:null,Q0=dn&&typeof dn.apply=="function"?dn.apply:a(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Ma;dn&&typeof dn.ownKeys=="function"?Ma=dn.ownKeys:Object.getOwnPropertySymbols?Ma=a(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ma=a(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function BP(t){console&&console.warn&&console.warn(t)}a(BP,"ProcessEmitWarning");var tg=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function le(){le.init.call(this)}a(le,"EventEmitter");Vu.exports=le;Vu.exports.once=jP;le.EventEmitter=le;le.prototype._events=void 0;le.prototype._eventsCount=0;le.prototype._maxListeners=void 0;var eg=10;function ja(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}a(ja,"checkListener");Object.defineProperty(le,"defaultMaxListeners",{enumerable:!0,get:a(function(){return eg},"get"),set:a(function(t){if(typeof t!="number"||t<0||tg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");eg=t},"set")});le.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};le.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||tg(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 rg(t){return t._maxListeners===void 0?le.defaultMaxListeners:t._maxListeners}a(rg,"_getMaxListeners");le.prototype.getMaxListeners=a(function(){return rg(this)},"getMaxListeners");le.prototype.emit=a(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var l=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")Q0(f,this,r);else for(var c=f.length,u=ag(f,c),i=0;i<c;++i)Q0(u[i],this,r);return!0},"emit");function ig(t,e,r,i){var n,o,s;if(ja(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),n=rg(t),n>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,BP(l)}return t}a(ig,"_addListener");le.prototype.addListener=a(function(e,r){return ig(this,e,r,!1)},"addListener");le.prototype.on=le.prototype.addListener;le.prototype.prependListener=a(function(e,r){return ig(this,e,r,!0)},"prependListener");function LP(){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)}a(LP,"onceWrapper");function ng(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=LP.bind(i);return n.listener=r,i.wrapFn=n,n}a(ng,"_onceWrap");le.prototype.once=a(function(e,r){return ja(r),this.on(e,ng(this,e,r)),this},"once");le.prototype.prependOnceListener=a(function(e,r){return ja(r),this.prependListener(e,ng(this,e,r)),this},"prependOnceListener");le.prototype.removeListener=a(function(e,r){var i,n,o,s,l;if(ja(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){l=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():$P(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=a(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n<o.length;++n)s=o[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function og(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?MP(n):ag(n,n.length)}a(og,"_listeners");le.prototype.listeners=a(function(e){return og(this,e,!0)},"listeners");le.prototype.rawListeners=a(function(e){return og(this,e,!1)},"rawListeners");le.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):sg.call(t,e)};le.prototype.listenerCount=sg;function sg(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}a(sg,"listenerCount");le.prototype.eventNames=a(function(){return this._eventsCount>0?Ma(this._events):[]},"eventNames");function ag(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}a(ag,"arrayClone");function $P(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}a($P,"spliceOne");function MP(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}a(MP,"unwrapListeners");function jP(t,e){return new Promise(function(r,i){function n(s){t.removeListener(e,o),i(s)}a(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}a(o,"resolver"),lg(t,e,o,{once:!0}),e!=="error"&&UP(t,n,{once:!0})})}a(jP,"once");function UP(t,e,r){typeof t.on=="function"&&lg(t,"error",e,r)}a(UP,"addErrorHandlerIfEventEmitter");function lg(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,a(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}a(lg,"eventTargetAgnosticAddListener")});var Gt=T((Kj,Gu)=>{typeof Object.create=="function"?Gu.exports=a(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Gu.exports=a(function(e,r){if(r){e.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}},"inherits")});var Ku=T((Xj,cg)=>{cg.exports=Ao().EventEmitter});var Zu=T(()=>{});var mg=T((Qj,pg)=>{"use strict";function fg(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}a(fg,"ownKeys");function ug(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?fg(Object(r),!0).forEach(function(i){HP(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):fg(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}a(ug,"_objectSpread");function HP(t,e,r){return e=dg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(HP,"_defineProperty");function qP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}a(qP,"_classCallCheck");function hg(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,dg(i.key),i)}}a(hg,"_defineProperties");function zP(t,e,r){return e&&hg(t.prototype,e),r&&hg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}a(zP,"_createClass");function dg(t){var e=WP(t,"string");return typeof e=="symbol"?e:String(e)}a(dg,"_toPropertyKey");function WP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(WP,"_toPrimitive");var VP=ni(),Ua=VP.Buffer,GP=Zu(),Xu=GP.inspect,KP=Xu&&Xu.custom||"inspect";function ZP(t,e,r){Ua.prototype.copy.call(t,e,r)}a(ZP,"copyBuffer");pg.exports=function(){function t(){qP(this,t),this.head=null,this.tail=null,this.length=0}return a(t,"BufferList"),zP(t,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return Ua.alloc(0);for(var i=Ua.allocUnsafe(r>>>0),n=this.head,o=0;n;)ZP(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,l=r>s.length?s.length:r;if(l===s.length?o+=s:o+=s.slice(0,r),r-=l,r===0){l===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(l));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=Ua.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,l=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,l),r-=l,r===0){l===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(l));break}++o}return this.length-=o,i},"_getBuffer")},{key:KP,value:a(function(r,i){return Xu(this,ug(ug({},i),{},{depth:0,customInspect:!1}))},"value")}]),t}()});var Ju=T((t6,yg)=>{"use strict";function XP(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Yu,this,t)):process.nextTick(Yu,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Ha,r):(r._writableState.errorEmitted=!0,process.nextTick(wg,r,o)):process.nextTick(wg,r,o):e?(process.nextTick(Ha,r),e(o)):process.nextTick(Ha,r)}),this)}a(XP,"destroy");function wg(t,e){Yu(t,e),Ha(t)}a(wg,"emitErrorAndCloseNT");function Ha(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}a(Ha,"emitCloseNT");function YP(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}a(YP,"undestroy");function Yu(t,e){t.emit("error",e)}a(Yu,"emitErrorNT");function JP(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}a(JP,"errorOrDestroy");yg.exports={destroy:XP,undestroy:YP,errorOrDestroy:JP}});var fi=T((i6,vg)=>{"use strict";function QP(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a(QP,"_inheritsLoose");var bg={};function wt(t,e,r){r||(r=Error);function i(o,s,l){return typeof e=="string"?e:e(o,s,l)}a(i,"getMessage");var n=function(o){QP(s,o);function s(l,f,c){return o.call(this,i(l,f,c))||this}return a(s,"NodeError"),s}(r);n.prototype.name=r.name,n.prototype.code=t,bg[t]=n}a(wt,"createErrorType");function gg(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}a(gg,"oneOf");function eA(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}a(eA,"startsWith");function tA(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}a(tA,"endsWith");function rA(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}a(rA,"includes");wt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);wt("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&eA(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(tA(t," argument"))n="The ".concat(t," ").concat(i," ").concat(gg(e,"type"));else{var o=rA(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(gg(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);wt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");wt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});wt("ERR_STREAM_PREMATURE_CLOSE","Premature close");wt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});wt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");wt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");wt("ERR_STREAM_WRITE_AFTER_END","write after end");wt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);wt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);wt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");vg.exports.codes=bg});var Qu=T((o6,_g)=>{"use strict";var iA=fi().codes.ERR_INVALID_OPT_VALUE;function nA(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}a(nA,"highWaterMarkFrom");function oA(t,e,r,i){var n=nA(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new iA(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}a(oA,"getHighWaterMark");_g.exports={getHighWaterMark:oA}});var Eg=T((a6,Fg)=>{Fg.exports=sA;function sA(t,e){if(eh("noDeprecation"))return t;var r=!1;function i(){if(!r){if(eh("throwDeprecation"))throw new Error(e);eh("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return a(i,"deprecated"),i}a(sA,"deprecate");function eh(t){try{if(!globalThis.localStorage)return!1}catch{return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}a(eh,"config")});var Wa=T((c6,kg)=>{"use strict";kg.exports=ge;function xg(t){var e=this;this.next=null,this.entry=null,this.finish=function(){DA(e,t)}}a(xg,"CorkedRequest");var pn;ge.WritableState=Do;var aA={deprecate:Eg()},Tg=Ku(),za=ni().Buffer,lA=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function cA(t){return za.from(t)}a(cA,"_uint8ArrayToBuffer");function fA(t){return za.isBuffer(t)||t instanceof lA}a(fA,"_isUint8Array");var rh=Ju(),uA=Qu(),hA=uA.getHighWaterMark,Dr=fi().codes,dA=Dr.ERR_INVALID_ARG_TYPE,pA=Dr.ERR_METHOD_NOT_IMPLEMENTED,mA=Dr.ERR_MULTIPLE_CALLBACK,wA=Dr.ERR_STREAM_CANNOT_PIPE,yA=Dr.ERR_STREAM_DESTROYED,gA=Dr.ERR_STREAM_NULL_VALUES,bA=Dr.ERR_STREAM_WRITE_AFTER_END,vA=Dr.ERR_UNKNOWN_ENCODING,mn=rh.errorOrDestroy;Gt()(ge,Tg);function _A(){}a(_A,"nop");function Do(t,e,r){pn=pn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof pn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=hA(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){RA(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new xg(this)}a(Do,"WritableState");Do.prototype.getBuffer=a(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(Do.prototype,"buffer",{get:aA.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qa;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qa=Function.prototype[Symbol.hasInstance],Object.defineProperty(ge,Symbol.hasInstance,{value:a(function(e){return qa.call(this,e)?!0:this!==ge?!1:e&&e._writableState instanceof Do},"value")})):qa=a(function(e){return e instanceof this},"realHasInstance");function ge(t){pn=pn||Cr();var e=this instanceof pn;if(!e&&!qa.call(ge,this))return new ge(t);this._writableState=new Do(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Tg.call(this)}a(ge,"Writable");ge.prototype.pipe=function(){mn(this,new wA)};function FA(t,e){var r=new bA;mn(t,r),process.nextTick(e,r)}a(FA,"writeAfterEnd");function EA(t,e,r,i){var n;return r===null?n=new gA:typeof r!="string"&&!e.objectMode&&(n=new dA("chunk",["string","Buffer"],r)),n?(mn(t,n),process.nextTick(i,n),!1):!0}a(EA,"validChunk");ge.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&fA(t);return o&&!za.isBuffer(t)&&(t=cA(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=_A),i.ending?FA(this,r):(o||EA(this,i,t,r))&&(i.pendingcb++,n=xA(this,i,o,t,e,r)),n};ge.prototype.cork=function(){this._writableState.corked++};ge.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Og(this,t))};ge.prototype.setDefaultEncoding=a(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new vA(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function SA(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=za.from(e,r)),e}a(SA,"decodeChunk");Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function xA(t,e,r,i,n,o){if(!r){var s=SA(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var l=e.objectMode?1:i.length;e.length+=l;var f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else th(t,e,!1,l,i,n,o);return f}a(xA,"writeOrBuffer");function th(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new yA("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}a(th,"doWrite");function TA(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Io,t,e),t._writableState.errorEmitted=!0,mn(t,i)):(n(i),t._writableState.errorEmitted=!0,mn(t,i),Io(t,e))}a(TA,"onwriteError");function OA(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}a(OA,"onwriteStateUpdate");function RA(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new mA;if(OA(r),e)TA(t,r,i,e,n);else{var o=Rg(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Og(t,r),i?process.nextTick(Sg,t,r,o,n):Sg(t,r,o,n)}}a(RA,"onwrite");function Sg(t,e,r,i){r||kA(t,e),e.pendingcb--,i(),Io(t,e)}a(Sg,"afterWrite");function kA(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}a(kA,"onwriteDrain");function Og(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,th(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new xg(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,u=r.callback,h=e.objectMode?1:f.length;if(th(t,e,!1,h,f,c,u),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}a(Og,"clearBuffer");ge.prototype._write=function(t,e,r){r(new pA("_write()"))};ge.prototype._writev=null;ge.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||IA(this,i,r),this};Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function Rg(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}a(Rg,"needFinish");function PA(t,e){t._final(function(r){e.pendingcb--,r&&mn(t,r),e.prefinished=!0,t.emit("prefinish"),Io(t,e)})}a(PA,"callFinal");function AA(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(PA,t,e)):(e.prefinished=!0,t.emit("prefinish")))}a(AA,"prefinish");function Io(t,e){var r=Rg(e);if(r&&(AA(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}a(Io,"finishMaybe");function IA(t,e,r){e.ending=!0,Io(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}a(IA,"endWritable");function DA(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}a(DA,"onCorkedFinish");Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});ge.prototype.destroy=rh.destroy;ge.prototype._undestroy=rh.undestroy;ge.prototype._destroy=function(t,e){e(t)}});var Cr=T((u6,Ag)=>{"use strict";var CA=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ag.exports=Kt;var Pg=Ka(),nh=Wa();Gt()(Kt,Pg);for(ih=CA(nh.prototype),Va=0;Va<ih.length;Va++)Ga=ih[Va],Kt.prototype[Ga]||(Kt.prototype[Ga]=nh.prototype[Ga]);var ih,Ga,Va;function Kt(t){if(!(this instanceof Kt))return new Kt(t);Pg.call(this,t),nh.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",NA)))}a(Kt,"Duplex");Object.defineProperty(Kt.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(Kt.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(Kt.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function NA(){this._writableState.ended||process.nextTick(BA,this)}a(NA,"onend");function BA(t){t.end()}a(BA,"onEndNT");Object.defineProperty(Kt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var Co=T((oh,Dg)=>{var Za=ni(),Zt=Za.Buffer;function Ig(t,e){for(var r in t)e[r]=t[r]}a(Ig,"copyProps");Zt.from&&Zt.alloc&&Zt.allocUnsafe&&Zt.allocUnsafeSlow?Dg.exports=Za:(Ig(Za,oh),oh.Buffer=ui);function ui(t,e,r){return Zt(t,e,r)}a(ui,"SafeBuffer");ui.prototype=Object.create(Zt.prototype);Ig(Zt,ui);ui.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Zt(t,e,r)};ui.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Zt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ui.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zt(t)};ui.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Za.SlowBuffer(t)}});var lh=T(Ng=>{"use strict";var ah=Co().Buffer,Cg=ah.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 LA(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}}a(LA,"_normalizeEncoding");function $A(t){var e=LA(t);if(typeof e!="string"&&(ah.isEncoding===Cg||!Cg(t)))throw new Error("Unknown encoding: "+t);return e||t}a($A,"normalizeEncoding");Ng.StringDecoder=No;function No(t){this.encoding=$A(t);var e;switch(this.encoding){case"utf16le":this.text=zA,this.end=WA,e=4;break;case"utf8":this.fillLast=UA,e=4;break;case"base64":this.text=VA,this.end=GA,e=3;break;default:this.write=KA,this.end=ZA;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=ah.allocUnsafe(e)}a(No,"StringDecoder");No.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};No.prototype.end=qA;No.prototype.text=HA;No.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 sh(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}a(sh,"utf8CheckByte");function MA(t,e,r){var i=e.length-1;if(i<r)return 0;var n=sh(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=sh(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=sh(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}a(MA,"utf8CheckIncomplete");function jA(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}a(jA,"utf8CheckExtraBytes");function UA(t){var e=this.lastTotal-this.lastNeed,r=jA(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}a(UA,"utf8FillLast");function HA(t,e){var r=MA(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}a(HA,"utf8Text");function qA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}a(qA,"utf8End");function zA(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}a(zA,"utf16Text");function WA(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}a(WA,"utf16End");function VA(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}a(VA,"base64Text");function GA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}a(GA,"base64End");function KA(t){return t.toString(this.encoding)}a(KA,"simpleWrite");function ZA(t){return t&&t.length?this.write(t):""}a(ZA,"simpleEnd")});var Bo=T((w6,$g)=>{"use strict";var Bg=fi().codes.ERR_STREAM_PREMATURE_CLOSE;function XA(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}a(XA,"once");function YA(){}a(YA,"noop");function JA(t){return t.setHeader&&typeof t.abort=="function"}a(JA,"isRequest");function Lg(t,e,r){if(typeof e=="function")return Lg(t,null,e);e||(e={}),r=XA(r||YA);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=a(function(){t.writable||l()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,l=a(function(){n=!1,s=!0,i||r.call(t)},"onfinish"),f=t._readableState&&t._readableState.endEmitted,c=a(function(){i=!1,f=!0,n||r.call(t)},"onend"),u=a(function(m){r.call(t,m)},"onerror"),h=a(function(){var m;if(i&&!f)return(!t._readableState||!t._readableState.ended)&&(m=new Bg),r.call(t,m);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new Bg),r.call(t,m)},"onclose"),d=a(function(){t.req.on("finish",l)},"onrequest");return JA(t)?(t.on("complete",l),t.on("abort",h),t.req?d():t.on("request",d)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",l),e.error!==!1&&t.on("error",u),t.on("close",h),function(){t.removeListener("complete",l),t.removeListener("abort",h),t.removeListener("request",d),t.req&&t.req.removeListener("finish",l),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",l),t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",h)}}a(Lg,"eos");$g.exports=Lg});var jg=T((g6,Mg)=>{"use strict";var Xa;function Nr(t,e,r){return e=QA(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(Nr,"_defineProperty");function QA(t){var e=eI(t,"string");return typeof e=="symbol"?e:String(e)}a(QA,"_toPropertyKey");function eI(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(eI,"_toPrimitive");var tI=Bo(),Br=Symbol("lastResolve"),hi=Symbol("lastReject"),Lo=Symbol("error"),Ya=Symbol("ended"),di=Symbol("lastPromise"),ch=Symbol("handlePromise"),pi=Symbol("stream");function Lr(t,e){return{value:t,done:e}}a(Lr,"createIterResult");function rI(t){var e=t[Br];if(e!==null){var r=t[pi].read();r!==null&&(t[di]=null,t[Br]=null,t[hi]=null,e(Lr(r,!1)))}}a(rI,"readAndResolve");function iI(t){process.nextTick(rI,t)}a(iI,"onReadable");function nI(t,e){return function(r,i){t.then(function(){if(e[Ya]){r(Lr(void 0,!0));return}e[ch](r,i)},i)}}a(nI,"wrapForNext");var oI=Object.getPrototypeOf(function(){}),sI=Object.setPrototypeOf((Xa={get stream(){return this[pi]},next:a(function(){var e=this,r=this[Lo];if(r!==null)return Promise.reject(r);if(this[Ya])return Promise.resolve(Lr(void 0,!0));if(this[pi].destroyed)return new Promise(function(s,l){process.nextTick(function(){e[Lo]?l(e[Lo]):s(Lr(void 0,!0))})});var i=this[di],n;if(i)n=new Promise(nI(i,this));else{var o=this[pi].read();if(o!==null)return Promise.resolve(Lr(o,!1));n=new Promise(this[ch])}return this[di]=n,n},"next")},Nr(Xa,Symbol.asyncIterator,function(){return this}),Nr(Xa,"return",a(function(){var e=this;return new Promise(function(r,i){e[pi].destroy(null,function(n){if(n){i(n);return}r(Lr(void 0,!0))})})},"_return")),Xa),oI),aI=a(function(e){var r,i=Object.create(sI,(r={},Nr(r,pi,{value:e,writable:!0}),Nr(r,Br,{value:null,writable:!0}),Nr(r,hi,{value:null,writable:!0}),Nr(r,Lo,{value:null,writable:!0}),Nr(r,Ya,{value:e._readableState.endEmitted,writable:!0}),Nr(r,ch,{value:a(function(o,s){var l=i[pi].read();l?(i[di]=null,i[Br]=null,i[hi]=null,o(Lr(l,!1))):(i[Br]=o,i[hi]=s)},"value"),writable:!0}),r));return i[di]=null,tI(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[hi];o!==null&&(i[di]=null,i[Br]=null,i[hi]=null,o(n)),i[Lo]=n;return}var s=i[Br];s!==null&&(i[di]=null,i[Br]=null,i[hi]=null,s(Lr(void 0,!0))),i[Ya]=!0}),e.on("readable",iI.bind(null,i)),i},"createReadableStreamAsyncIterator");Mg.exports=aI});var Hg=T((v6,Ug)=>{Ug.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ka=T((F6,Jg)=>{"use strict";Jg.exports=ie;var wn;ie.ReadableState=Vg;var _6=Ao().EventEmitter,Wg=a(function(e,r){return e.listeners(r).length},"EElistenerCount"),Mo=Ku(),Ja=ni().Buffer,lI=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function cI(t){return Ja.from(t)}a(cI,"_uint8ArrayToBuffer");function fI(t){return Ja.isBuffer(t)||t instanceof lI}a(fI,"_isUint8Array");var fh=Zu(),K;fh&&fh.debuglog?K=fh.debuglog("stream"):K=a(function(){},"debug");var uI=mg(),yh=Ju(),hI=Qu(),dI=hI.getHighWaterMark,Qa=fi().codes,pI=Qa.ERR_INVALID_ARG_TYPE,mI=Qa.ERR_STREAM_PUSH_AFTER_EOF,wI=Qa.ERR_METHOD_NOT_IMPLEMENTED,yI=Qa.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,yn,uh,hh;Gt()(ie,Mo);var $o=yh.errorOrDestroy,dh=["error","close","destroy","pause","resume"];function gI(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}a(gI,"prependListener");function Vg(t,e,r){wn=wn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof wn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=dI(this,t,"readableHighWaterMark",r),this.buffer=new uI,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(yn||(yn=lh().StringDecoder),this.decoder=new yn(t.encoding),this.encoding=t.encoding)}a(Vg,"ReadableState");function ie(t){if(wn=wn||Cr(),!(this instanceof ie))return new ie(t);var e=this instanceof wn;this._readableState=new Vg(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),Mo.call(this)}a(ie,"Readable");Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});ie.prototype.destroy=yh.destroy;ie.prototype._undestroy=yh.undestroy;ie.prototype._destroy=function(t,e){e(t)};ie.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ja.from(t,e),e=""),i=!0),Gg(this,t,e,!1,i)};ie.prototype.unshift=function(t){return Gg(this,t,null,!0,!1)};function Gg(t,e,r,i,n){K("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,_I(t,o);else{var s;if(n||(s=bI(o,e)),s)$o(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ja.prototype&&(e=cI(e)),i)o.endEmitted?$o(t,new yI):ph(t,o,e,!0);else if(o.ended)$o(t,new mI);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?ph(t,o,e,!1):wh(t,o)):ph(t,o,e,!1)}else i||(o.reading=!1,wh(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(Gg,"readableAddChunk");function ph(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&el(t)),wh(t,e)}a(ph,"addChunk");function bI(t,e){var r;return!fI(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new pI("chunk",["string","Buffer","Uint8Array"],e)),r}a(bI,"chunkInvalid");ie.prototype.isPaused=function(){return this._readableState.flowing===!1};ie.prototype.setEncoding=function(t){yn||(yn=lh().StringDecoder);var e=new yn(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var qg=1073741824;function vI(t){return t>=qg?t=qg:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}a(vI,"computeNewHighWaterMark");function zg(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=vI(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}a(zg,"howMuchToRead");ie.prototype.read=function(t){K("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?mh(this):el(this),null;if(t=zg(t,e),t===0&&e.ended)return e.length===0&&mh(this),null;var i=e.needReadable;K("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,K("length less than watermark",i)),e.ended||e.reading?(i=!1,K("reading or ended",i)):i&&(K("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=zg(r,e)));var n;return t>0?n=Xg(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&mh(this)),n!==null&&this.emit("data",n),n};function _I(t,e){if(K("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?el(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Kg(t)))}}a(_I,"onEofChunk");function el(t){var e=t._readableState;K("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Kg,t))}a(el,"emitReadable");function Kg(t){var e=t._readableState;K("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,gh(t)}a(Kg,"emitReadable_");function wh(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(FI,t,e))}a(wh,"maybeReadMore");function FI(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(K("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}a(FI,"maybeReadMore_");ie.prototype._read=function(t){$o(this,new wI("_read()"))};ie.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,K("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?l:w;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(y,v){K("onunpipe"),y===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,u())}a(s,"onunpipe");function l(){K("onend"),t.end()}a(l,"onend");var f=EI(r);t.on("drain",f);var c=!1;function u(){K("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",h),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f()}a(u,"cleanup"),r.on("data",h);function h(y){K("ondata");var v=t.write(y);K("dest.write",v),v===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Yg(i.pipes,t)!==-1)&&!c&&(K("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(h,"ondata");function d(y){K("onerror",y),w(),t.removeListener("error",d),Wg(t,"error")===0&&$o(t,y)}a(d,"onerror"),gI(t,"error",d);function p(){t.removeListener("finish",m),w()}a(p,"onclose"),t.once("close",p);function m(){K("onfinish"),t.removeListener("close",p),w()}a(m,"onfinish"),t.once("finish",m);function w(){K("unpipe"),r.unpipe(t)}return a(w,"unpipe"),t.emit("pipe",r),i.flowing||(K("pipe resume"),r.resume()),t};function EI(t){return a(function(){var r=t._readableState;K("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Wg(t,"data")&&(r.flowing=!0,gh(t))},"pipeOnDrainFunctionResult")}a(EI,"pipeOnDrain");ie.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Yg(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ie.prototype.on=function(t,e){var r=Mo.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,K("on readable",i.length,i.reading),i.length?el(this):i.reading||process.nextTick(SI,this)),r};ie.prototype.addListener=ie.prototype.on;ie.prototype.removeListener=function(t,e){var r=Mo.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Zg,this),r};ie.prototype.removeAllListeners=function(t){var e=Mo.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Zg,this),e};function Zg(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}a(Zg,"updateReadableListening");function SI(t){K("readable nexttick read 0"),t.read(0)}a(SI,"nReadingNextTick");ie.prototype.resume=function(){var t=this._readableState;return t.flowing||(K("resume"),t.flowing=!t.readableListening,xI(this,t)),t.paused=!1,this};function xI(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(TI,t,e))}a(xI,"resume");function TI(t,e){K("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),gh(t),e.flowing&&!e.reading&&t.read(0)}a(TI,"resume_");ie.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.paused=!0,this};function gh(t){var e=t._readableState;for(K("flow",e.flowing);e.flowing&&t.read()!==null;);}a(gh,"flow");ie.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(K("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(K("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var l=e.push(s);l||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=a(function(l){return a(function(){return t[l].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<dh.length;o++)t.on(dh[o],this.emit.bind(this,dh[o]));return this._read=function(s){K("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return uh===void 0&&(uh=jg()),uh(this)});Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});ie._fromList=Xg;Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function Xg(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}a(Xg,"fromList");function mh(t){var e=t._readableState;K("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(OI,e,t))}a(mh,"endReadable");function OI(t,e){if(K("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}a(OI,"endReadableNT");typeof Symbol=="function"&&(ie.from=function(t,e){return hh===void 0&&(hh=Hg()),hh(ie,t,e)});function Yg(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Yg,"indexOf")});var il=T((S6,eb)=>{"use strict";eb.exports=cr;var tl=fi().codes,RI=tl.ERR_METHOD_NOT_IMPLEMENTED,kI=tl.ERR_MULTIPLE_CALLBACK,PI=tl.ERR_TRANSFORM_ALREADY_TRANSFORMING,AI=tl.ERR_TRANSFORM_WITH_LENGTH_0,rl=Cr();Gt()(cr,rl);function II(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new kI);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(II,"afterTransform");function cr(t){if(!(this instanceof cr))return new cr(t);rl.call(this,t),this._transformState={afterTransform:II.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",DI)}a(cr,"Transform");function DI(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){Qg(t,e,r)}):Qg(this,null,null)}a(DI,"prefinish");cr.prototype.push=function(t,e){return this._transformState.needTransform=!1,rl.prototype.push.call(this,t,e)};cr.prototype._transform=function(t,e,r){r(new RI("_transform()"))};cr.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};cr.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};cr.prototype._destroy=function(t,e){rl.prototype._destroy.call(this,t,function(r){e(r)})};function Qg(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new AI;if(t._transformState.transforming)throw new PI;return t.push(null)}a(Qg,"done")});var bh=T((T6,rb)=>{"use strict";rb.exports=jo;var tb=il();Gt()(jo,tb);function jo(t){if(!(this instanceof jo))return new jo(t);tb.call(this,t)}a(jo,"PassThrough");jo.prototype._transform=function(t,e,r){r(null,t)}});var _h=T((R6,sb)=>{"use strict";var vh;function CI(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}a(CI,"once");var ob=fi().codes,NI=ob.ERR_MISSING_ARGS,BI=ob.ERR_STREAM_DESTROYED;function ib(t){if(t)throw t}a(ib,"noop");function LI(t){return t.setHeader&&typeof t.abort=="function"}a(LI,"isRequest");function $I(t,e,r,i){i=CI(i);var n=!1;t.on("close",function(){n=!0}),vh===void 0&&(vh=Bo()),vh(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,LI(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new BI("pipe"))}}}a($I,"destroyer");function nb(t){t()}a(nb,"call");function MI(t,e){return t.pipe(e)}a(MI,"pipe");function jI(t){return!t.length||typeof t[t.length-1]!="function"?ib:t.pop()}a(jI,"popCallback");function UI(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=jI(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new NI("streams");var n,o=e.map(function(s,l){var f=l<e.length-1,c=l>0;return $I(s,f,c,function(u){n||(n=u),u&&o.forEach(nb),!f&&(o.forEach(nb),i(n))})});return e.reduce(MI)}a(UI,"pipeline");sb.exports=UI});var lb=T((P6,ab)=>{ab.exports=yt;var Fh=Ao().EventEmitter,HI=Gt();HI(yt,Fh);yt.Readable=Ka();yt.Writable=Wa();yt.Duplex=Cr();yt.Transform=il();yt.PassThrough=bh();yt.finished=Bo();yt.pipeline=_h();yt.Stream=yt;function yt(){Fh.call(this)}a(yt,"Stream");yt.prototype.pipe=function(t,e){var r=this;function i(u){t.writable&&t.write(u)===!1&&r.pause&&r.pause()}a(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}a(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}a(s,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}a(l,"onclose");function f(u){if(c(),Fh.listenerCount(this,"error")===0)throw u}a(f,"onerror"),r.on("error",f),t.on("error",f);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return a(c,"cleanup"),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}});var fb=T(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.Writable=gn.Readable=void 0;var cb=lb();Object.defineProperty(gn,"Readable",{enumerable:!0,get:a(function(){return cb.Readable},"get")});Object.defineProperty(gn,"Writable",{enumerable:!0,get:a(function(){return cb.Writable},"get")})});var Eh=T(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.EventEmitter=void 0;var qI=Ao();Object.defineProperty(nl,"EventEmitter",{enumerable:!0,get:a(function(){return qI.EventEmitter},"get")})});var ub=T(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.FileHandle=void 0;var He=Ir(),zI=Eh(),xh=class xh extends zI.EventEmitter{constructor(e,r){super(),this.refs=1,this.closePromise=null,this.position=0,this.readableWebStreamLocked=!1,this.fs=e,this.fd=r}getAsyncId(){return this.fd}appendFile(e,r){return(0,He.promisify)(this.fs,"appendFile")(this.fd,e,r)}chmod(e){return(0,He.promisify)(this.fs,"fchmod")(this.fd,e)}chown(e,r){return(0,He.promisify)(this.fs,"fchown")(this.fd,e,r)}close(){if(this.fd===-1)return Promise.resolve();if(this.closePromise)return this.closePromise;if(this.refs--,this.refs===0){let e=this.fd;this.fd=-1,this.closePromise=(0,He.promisify)(this.fs,"close")(e).finally(()=>{this.closePromise=null})}else this.closePromise=new Promise((e,r)=>{this.closeResolve=e,this.closeReject=r}).finally(()=>{this.closePromise=null,this.closeReject=void 0,this.closeResolve=void 0});return this.emit("close"),this.closePromise}datasync(){return(0,He.promisify)(this.fs,"fdatasync")(this.fd)}createReadStream(e){return this.fs.createReadStream("",{...e,fd:this})}createWriteStream(e){return this.fs.createWriteStream("",{...e,fd:this})}readableWebStream(e={}){let{type:r="bytes",autoClose:i=!1}=e,n=0;if(this.fd===-1)throw new Error("The FileHandle is closed");if(this.closePromise)throw new Error("The FileHandle is closing");if(this.readableWebStreamLocked)throw new Error("An error will be thrown if this method is called more than once or is called after the FileHandle is closed or closing.");this.readableWebStreamLocked=!0,this.ref();let o=a(()=>{this.readableWebStreamLocked=!1,this.unref(),i&&this.close().catch(()=>{})},"unlockAndCleanup");return new ReadableStream({type:r==="bytes"?"bytes":void 0,autoAllocateChunkSize:16384,pull:a(async s=>{try{let l=s.byobRequest?.view;if(!l){let c=new Uint8Array(16384),u=await this.read(c,0,c.length,n);if(u.bytesRead===0){s.close(),o();return}n+=u.bytesRead,s.enqueue(c.slice(0,u.bytesRead));return}let f=await this.read(l,l.byteOffset,l.byteLength,n);if(f.bytesRead===0){s.close(),o();return}n+=f.bytesRead,s.byobRequest.respond(f.bytesRead)}catch(l){s.error(l),o()}},"pull"),cancel:a(async()=>{o()},"cancel")})}async read(e,r,i,n){let o=n??this.position,s=await(0,He.promisify)(this.fs,"read",l=>({bytesRead:l,buffer:e}))(this.fd,e,r,i,o);return n==null&&(this.position+=s.bytesRead),s}readv(e,r){return(0,He.promisify)(this.fs,"readv",i=>({bytesRead:i,buffers:e}))(this.fd,e,r)}readFile(e){return(0,He.promisify)(this.fs,"readFile")(this.fd,e)}stat(e){return(0,He.promisify)(this.fs,"fstat")(this.fd,e)}sync(){return(0,He.promisify)(this.fs,"fsync")(this.fd)}truncate(e){return(0,He.promisify)(this.fs,"ftruncate")(this.fd,e)}utimes(e,r){return(0,He.promisify)(this.fs,"futimes")(this.fd,e,r)}async write(e,r,i,n){let o=typeof n!="number",s=o?this.position:n,l=await(0,He.promisify)(this.fs,"write",f=>({bytesWritten:f,buffer:e}))(this.fd,e,r,i,s);return o&&(this.position+=l.bytesWritten),l}writev(e,r){return(0,He.promisify)(this.fs,"writev",i=>({bytesWritten:i,buffers:e}))(this.fd,e,r)}writeFile(e,r){return(0,He.promisify)(this.fs,"writeFile")(this.fd,e,r)}async[Symbol.asyncDispose](){await this.close()}ref(){this.refs++}unref(){this.refs--,this.refs===0&&(this.fd=-1,this.closeResolve&&(0,He.promisify)(this.fs,"close")(this.fd).then(this.closeResolve,this.closeReject))}};a(xh,"FileHandle");var Sh=xh;ol.FileHandle=Sh});var hb=T(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.FsPromises=void 0;var ne=Ir(),WI=Pt(),Rh=class Rh{constructor(e,r,i={}){if(this.fs=e,this.path=r,this.options=i,this.eventQueue=[],this.resolveQueue=[],this.finished=!1,this.maxQueue=i.maxQueue||2048,this.overflow=i.overflow||"ignore",this.startWatching(),i.signal){if(i.signal.aborted){this.finish();return}i.signal.addEventListener("abort",()=>{this.finish()})}}startWatching(){try{this.watcher=this.fs.watch(this.path,this.options,(e,r)=>{this.enqueueEvent({eventType:e,filename:r})})}catch(e){throw this.finish(),e}}enqueueEvent(e){if(!this.finished){if(this.eventQueue.length>=this.maxQueue)if(this.overflow==="throw"){let r=new Error(`Watch queue overflow: more than ${this.maxQueue} events queued`);this.finish(r);return}else this.eventQueue.shift(),console.warn(`Watch queue overflow: dropping event due to exceeding maxQueue of ${this.maxQueue}`);if(this.eventQueue.push(e),this.resolveQueue.length>0){let{resolve:r}=this.resolveQueue.shift(),i=this.eventQueue.shift();r({value:i,done:!1})}}}finish(e){if(!this.finished)for(this.finished=!0,this.watcher&&(this.watcher.close(),this.watcher=null);this.resolveQueue.length>0;){let{resolve:r,reject:i}=this.resolveQueue.shift();e?i(e):r({value:void 0,done:!0})}}async next(){return this.finished?{value:void 0,done:!0}:this.eventQueue.length>0?{value:this.eventQueue.shift(),done:!1}:new Promise((e,r)=>{this.resolveQueue.push({resolve:e,reject:r})})}async return(){return this.finish(),{value:void 0,done:!0}}async throw(e){throw this.finish(e),e}[Symbol.asyncIterator](){return this}};a(Rh,"FSWatchAsyncIterator");var Th=Rh,kh=class kh{constructor(e,r){this.fs=e,this.FileHandle=r,this.constants=WI.constants,this.cp=(0,ne.promisify)(this.fs,"cp"),this.opendir=(0,ne.promisify)(this.fs,"opendir"),this.statfs=(0,ne.promisify)(this.fs,"statfs"),this.lutimes=(0,ne.promisify)(this.fs,"lutimes"),this.glob=(0,ne.promisify)(this.fs,"glob"),this.access=(0,ne.promisify)(this.fs,"access"),this.chmod=(0,ne.promisify)(this.fs,"chmod"),this.chown=(0,ne.promisify)(this.fs,"chown"),this.copyFile=(0,ne.promisify)(this.fs,"copyFile"),this.lchmod=(0,ne.promisify)(this.fs,"lchmod"),this.lchown=(0,ne.promisify)(this.fs,"lchown"),this.link=(0,ne.promisify)(this.fs,"link"),this.lstat=(0,ne.promisify)(this.fs,"lstat"),this.mkdir=(0,ne.promisify)(this.fs,"mkdir"),this.mkdtemp=(0,ne.promisify)(this.fs,"mkdtemp"),this.readdir=(0,ne.promisify)(this.fs,"readdir"),this.readlink=(0,ne.promisify)(this.fs,"readlink"),this.realpath=(0,ne.promisify)(this.fs,"realpath"),this.rename=(0,ne.promisify)(this.fs,"rename"),this.rmdir=(0,ne.promisify)(this.fs,"rmdir"),this.rm=(0,ne.promisify)(this.fs,"rm"),this.stat=(0,ne.promisify)(this.fs,"stat"),this.symlink=(0,ne.promisify)(this.fs,"symlink"),this.truncate=(0,ne.promisify)(this.fs,"truncate"),this.unlink=(0,ne.promisify)(this.fs,"unlink"),this.utimes=(0,ne.promisify)(this.fs,"utimes"),this.readFile=(i,n)=>(0,ne.promisify)(this.fs,"readFile")(i instanceof this.FileHandle?i.fd:i,n),this.appendFile=(i,n,o)=>(0,ne.promisify)(this.fs,"appendFile")(i instanceof this.FileHandle?i.fd:i,n,o),this.open=(i,n="r",o)=>(0,ne.promisify)(this.fs,"open",s=>new this.FileHandle(this.fs,s))(i,n,o),this.writeFile=(i,n,o)=>((0,ne.isReadableStream)(n)?(0,ne.streamToBuffer)(n):Promise.resolve(n)).then(l=>(0,ne.promisify)(this.fs,"writeFile")(i instanceof this.FileHandle?i.fd:i,l,o)),this.watch=(i,n)=>{let o=typeof n=="string"?{encoding:n}:n||{};return new Th(this.fs,i,o)}}};a(kh,"FsPromises");var Oh=kh;sl.FsPromises=Oh});var db=T(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.printTree=void 0;var VI=a((t="",e)=>{let r="",i=e.length-1;for(;i>=0&&!e[i];i--);for(let n=0;n<=i;n++){let o=e[n];if(!o)continue;let s=n===i,l=o(t+(s?" ":"\u2502")+" "),f=l?s?"\u2514\u2500":"\u251C\u2500":"\u2502";r+=`
|
|
9
|
-
`+t+f+(l?" "+l:"")}return r},"printTree");al.printTree=
|
|
7
|
+
`+e.prev}a(gu,"indentedJoin");function ga(t,e){var r=yu(t),i=[];if(r){i.length=t.length;for(var n=0;n<t.length;n++)i[n]=lr(t,n)?e(t[n],t):""}var o=typeof hu=="function"?hu(t):[],s;if(en){s={};for(var l=0;l<o.length;l++)s["$"+o[l]]=o[l]}for(var f in t)lr(t,f)&&(r&&String(Number(f))===f&&f<t.length||en&&s["$"+f]instanceof Symbol||(Vw.call(/[^\w$]/,f)?i.push(e(f,t)+": "+e(t[f],t)):i.push(f+": "+e(t[f],t))));if(typeof hu=="function")for(var c=0;c<o.length;c++)Gw.call(t,o[c])&&i.push("["+e(o[c])+"]: "+e(t[o[c]],t));return i}a(ga,"arrObjKeys")});var ty=T((k8,ey)=>{"use strict";var MO=bo(),jO=Ht(),_a=a(function(t,e,r){for(var i=t,n;(n=i.next)!=null;i=n)if(n.key===e)return i.next=n.next,r||(n.next=t.next,t.next=n),n},"listGetNode"),UO=a(function(t,e){if(t){var r=_a(t,e);return r&&r.value}},"listGet"),HO=a(function(t,e,r){var i=_a(t,e);i?i.value=r:t.next={key:e,next:t.next,value:r}},"listSet"),qO=a(function(t,e){return t?!!_a(t,e):!1},"listHas"),zO=a(function(t,e){if(t)return _a(t,e,!0)},"listDelete");ey.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new jO("Side channel does not contain "+MO(i))},"assert"),delete:a(function(i){var n=e&&e.next,o=zO(e,i);return o&&n&&n===o&&(e=void 0),!!o},"delete"),get:a(function(i){return UO(e,i)},"get"),has:a(function(i){return qO(e,i)},"has"),set:a(function(i,n){e||(e={next:void 0}),HO(e,i,n)},"set")};return r},"getSideChannelList")});var Fu=T((A8,ry)=>{"use strict";ry.exports=Object});var ny=T((I8,iy)=>{"use strict";iy.exports=Error});var sy=T((D8,oy)=>{"use strict";oy.exports=EvalError});var ly=T((C8,ay)=>{"use strict";ay.exports=RangeError});var fy=T((N8,cy)=>{"use strict";cy.exports=ReferenceError});var Eu=T((B8,uy)=>{"use strict";uy.exports=SyntaxError});var dy=T((L8,hy)=>{"use strict";hy.exports=URIError});var my=T(($8,py)=>{"use strict";py.exports=Math.abs});var yy=T((M8,wy)=>{"use strict";wy.exports=Math.floor});var by=T((j8,gy)=>{"use strict";gy.exports=Math.max});var _y=T((U8,vy)=>{"use strict";vy.exports=Math.min});var Ey=T((H8,Fy)=>{"use strict";Fy.exports=Math.pow});var xy=T((q8,Sy)=>{"use strict";Sy.exports=Math.round});var Oy=T((z8,Ty)=>{"use strict";Ty.exports=Number.isNaN||a(function(e){return e!==e},"isNaN")});var ky=T((V8,Ry)=>{"use strict";var WO=Oy();Ry.exports=a(function(e){return WO(e)||e===0?e:e<0?-1:1},"sign")});var Ay=T((K8,Py)=>{"use strict";Py.exports=Object.getOwnPropertyDescriptor});var tn=T((Z8,Iy)=>{"use strict";var Fa=Ay();if(Fa)try{Fa([],"length")}catch{Fa=null}Iy.exports=Fa});var vo=T((X8,Dy)=>{"use strict";var Ea=Object.defineProperty||!1;if(Ea)try{Ea({},"a",{value:1})}catch{Ea=!1}Dy.exports=Ea});var Su=T((Y8,Cy)=>{"use strict";Cy.exports=a(function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),i=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(i)!=="[object Symbol]")return!1;var n=42;e[r]=n;for(var o in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var s=Object.getOwnPropertySymbols(e);if(s.length!==1||s[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var l=Object.getOwnPropertyDescriptor(e,r);if(l.value!==n||l.enumerable!==!0)return!1}return!0},"hasSymbols")});var Ly=T((Q8,By)=>{"use strict";var Ny=typeof Symbol<"u"&&Symbol,VO=Su();By.exports=a(function(){return typeof Ny!="function"||typeof Symbol!="function"||typeof Ny("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:VO()},"hasNativeSymbols")});var xu=T((tj,$y)=>{"use strict";$y.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var Tu=T((rj,My)=>{"use strict";var GO=Fu();My.exports=GO.getPrototypeOf||null});var Hy=T((ij,Uy)=>{"use strict";var KO="Function.prototype.bind called on incompatible ",ZO=Object.prototype.toString,XO=Math.max,YO="[object Function]",jy=a(function(e,r){for(var i=[],n=0;n<e.length;n+=1)i[n]=e[n];for(var o=0;o<r.length;o+=1)i[o+e.length]=r[o];return i},"concatty"),JO=a(function(e,r){for(var i=[],n=r||0,o=0;n<e.length;n+=1,o+=1)i[o]=e[n];return i},"slicy"),QO=a(function(t,e){for(var r="",i=0;i<t.length;i+=1)r+=t[i],i+1<t.length&&(r+=e);return r},"joiny");Uy.exports=a(function(e){var r=this;if(typeof r!="function"||ZO.apply(r)!==YO)throw new TypeError(KO+r);for(var i=JO(arguments,1),n,o=a(function(){if(this instanceof n){var u=r.apply(this,jy(i,arguments));return Object(u)===u?u:this}return r.apply(e,jy(i,arguments))},"binder"),s=XO(0,r.length-i.length),l=[],f=0;f<s;f++)l[f]="$"+f;if(n=Function("binder","return function ("+QO(l,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var c=a(function(){},"Empty");c.prototype=r.prototype,n.prototype=new c,c.prototype=null}return n},"bind")});var rn=T((oj,qy)=>{"use strict";var eR=Hy();qy.exports=Function.prototype.bind||eR});var Sa=T((sj,zy)=>{"use strict";zy.exports=Function.prototype.call});var xa=T((aj,Wy)=>{"use strict";Wy.exports=Function.prototype.apply});var Gy=T((lj,Vy)=>{"use strict";Vy.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var Ou=T((cj,Ky)=>{"use strict";var tR=rn(),rR=xa(),iR=Sa(),nR=Gy();Ky.exports=nR||tR.call(iR,rR)});var Ta=T((fj,Zy)=>{"use strict";var oR=rn(),sR=Ht(),aR=Sa(),lR=Ou();Zy.exports=a(function(e){if(e.length<1||typeof e[0]!="function")throw new sR("a function is required");return lR(oR,aR,e)},"callBindBasic")});var t0=T((hj,e0)=>{"use strict";var cR=Ta(),Xy=tn(),Jy;try{Jy=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var Ru=!!Jy&&Xy&&Xy(Object.prototype,"__proto__"),Qy=Object,Yy=Qy.getPrototypeOf;e0.exports=Ru&&typeof Ru.get=="function"?cR([Ru.get]):typeof Yy=="function"?a(function(e){return Yy(e==null?e:Qy(e))},"getDunder"):!1});var ku=T((pj,o0)=>{"use strict";var r0=xu(),i0=Tu(),n0=t0();o0.exports=r0?a(function(e){return r0(e)},"getProto"):i0?a(function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return i0(e)},"getProto"):n0?a(function(e){return n0(e)},"getProto"):null});var a0=T((wj,s0)=>{"use strict";var fR=Function.prototype.call,uR=Object.prototype.hasOwnProperty,hR=rn();s0.exports=hR.call(fR,uR)});var So=T((yj,d0)=>{"use strict";var J,dR=Fu(),pR=ny(),mR=sy(),wR=ly(),yR=fy(),an=Eu(),sn=Ht(),gR=dy(),bR=my(),vR=yy(),_R=by(),FR=_y(),ER=Ey(),SR=xy(),xR=ky(),u0=Function,Pu=a(function(t){try{return u0('"use strict"; return ('+t+").constructor;")()}catch{}},"getEvalledConstructor"),_o=tn(),TR=vo(),Au=a(function(){throw new sn},"throwTypeError"),OR=_o?function(){try{return arguments.callee,Au}catch{try{return _o(arguments,"callee").get}catch{return Au}}}():Au,nn=Ly()(),Ce=ku(),RR=Tu(),kR=xu(),h0=xa(),Fo=Sa(),on={},PR=typeof Uint8Array>"u"||!Ce?J:Ce(Uint8Array),ai={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?J:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?J:ArrayBuffer,"%ArrayIteratorPrototype%":nn&&Ce?Ce([][Symbol.iterator]()):J,"%AsyncFromSyncIteratorPrototype%":J,"%AsyncFunction%":on,"%AsyncGenerator%":on,"%AsyncGeneratorFunction%":on,"%AsyncIteratorPrototype%":on,"%Atomics%":typeof Atomics>"u"?J:Atomics,"%BigInt%":typeof BigInt>"u"?J:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?J:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?J:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?J:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":pR,"%eval%":eval,"%EvalError%":mR,"%Float16Array%":typeof Float16Array>"u"?J:Float16Array,"%Float32Array%":typeof Float32Array>"u"?J:Float32Array,"%Float64Array%":typeof Float64Array>"u"?J:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?J:FinalizationRegistry,"%Function%":u0,"%GeneratorFunction%":on,"%Int8Array%":typeof Int8Array>"u"?J:Int8Array,"%Int16Array%":typeof Int16Array>"u"?J:Int16Array,"%Int32Array%":typeof Int32Array>"u"?J:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":nn&&Ce?Ce(Ce([][Symbol.iterator]())):J,"%JSON%":typeof JSON=="object"?JSON:J,"%Map%":typeof Map>"u"?J:Map,"%MapIteratorPrototype%":typeof Map>"u"||!nn||!Ce?J:Ce(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":dR,"%Object.getOwnPropertyDescriptor%":_o,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?J:Promise,"%Proxy%":typeof Proxy>"u"?J:Proxy,"%RangeError%":wR,"%ReferenceError%":yR,"%Reflect%":typeof Reflect>"u"?J:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?J:Set,"%SetIteratorPrototype%":typeof Set>"u"||!nn||!Ce?J:Ce(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?J:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":nn&&Ce?Ce(""[Symbol.iterator]()):J,"%Symbol%":nn?Symbol:J,"%SyntaxError%":an,"%ThrowTypeError%":OR,"%TypedArray%":PR,"%TypeError%":sn,"%Uint8Array%":typeof Uint8Array>"u"?J:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?J:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?J:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?J:Uint32Array,"%URIError%":gR,"%WeakMap%":typeof WeakMap>"u"?J:WeakMap,"%WeakRef%":typeof WeakRef>"u"?J:WeakRef,"%WeakSet%":typeof WeakSet>"u"?J:WeakSet,"%Function.prototype.call%":Fo,"%Function.prototype.apply%":h0,"%Object.defineProperty%":TR,"%Object.getPrototypeOf%":RR,"%Math.abs%":bR,"%Math.floor%":vR,"%Math.max%":_R,"%Math.min%":FR,"%Math.pow%":ER,"%Math.round%":SR,"%Math.sign%":xR,"%Reflect.getPrototypeOf%":kR};if(Ce)try{null.error}catch(t){l0=Ce(Ce(t)),ai["%Error.prototype%"]=l0}var l0,AR=a(function t(e){var r;if(e==="%AsyncFunction%")r=Pu("async function () {}");else if(e==="%GeneratorFunction%")r=Pu("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=Pu("async function* () {}");else if(e==="%AsyncGenerator%"){var i=t("%AsyncGeneratorFunction%");i&&(r=i.prototype)}else if(e==="%AsyncIteratorPrototype%"){var n=t("%AsyncGenerator%");n&&Ce&&(r=Ce(n.prototype))}return ai[e]=r,r},"doEval"),c0={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},Eo=rn(),Oa=a0(),IR=Eo.call(Fo,Array.prototype.concat),DR=Eo.call(h0,Array.prototype.splice),f0=Eo.call(Fo,String.prototype.replace),Ra=Eo.call(Fo,String.prototype.slice),CR=Eo.call(Fo,RegExp.prototype.exec),NR=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,BR=/\\(\\)?/g,LR=a(function(e){var r=Ra(e,0,1),i=Ra(e,-1);if(r==="%"&&i!=="%")throw new an("invalid intrinsic syntax, expected closing `%`");if(i==="%"&&r!=="%")throw new an("invalid intrinsic syntax, expected opening `%`");var n=[];return f0(e,NR,function(o,s,l,f){n[n.length]=l?f0(f,BR,"$1"):s||o}),n},"stringToPath"),$R=a(function(e,r){var i=e,n;if(Oa(c0,i)&&(n=c0[i],i="%"+n[0]+"%"),Oa(ai,i)){var o=ai[i];if(o===on&&(o=AR(i)),typeof o>"u"&&!r)throw new sn("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:n,name:i,value:o}}throw new an("intrinsic "+e+" does not exist!")},"getBaseIntrinsic");d0.exports=a(function(e,r){if(typeof e!="string"||e.length===0)throw new sn("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new sn('"allowMissing" argument must be a boolean');if(CR(/^%?[^%]*%?$/,e)===null)throw new an("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var i=LR(e),n=i.length>0?i[0]:"",o=$R("%"+n+"%",r),s=o.name,l=o.value,f=!1,c=o.alias;c&&(n=c[0],DR(i,IR([0,1],c)));for(var u=1,h=!0;u<i.length;u+=1){var d=i[u],p=Ra(d,0,1),m=Ra(d,-1);if((p==='"'||p==="'"||p==="`"||m==='"'||m==="'"||m==="`")&&p!==m)throw new an("property names with quotes must have matching quotes");if((d==="constructor"||!h)&&(f=!0),n+="."+d,s="%"+n+"%",Oa(ai,s))l=ai[s];else if(l!=null){if(!(d in l)){if(!r)throw new sn("base intrinsic for "+e+" exists, but the property is not available.");return}if(_o&&u+1>=i.length){var w=_o(l,d);h=!!w,h&&"get"in w&&!("originalValue"in w.get)?l=w.get:l=l[d]}else h=Oa(l,d),l=l[d];h&&!f&&(ai[s]=l)}}return l},"GetIntrinsic")});var xo=T((bj,w0)=>{"use strict";var p0=So(),m0=Ta(),MR=m0([p0("%String.prototype.indexOf%")]);w0.exports=a(function(e,r){var i=p0(e,!!r);return typeof i=="function"&&MR(e,".prototype.")>-1?m0([i]):i},"callBoundIntrinsic")});var Iu=T((_j,g0)=>{"use strict";var jR=So(),To=xo(),UR=bo(),HR=Ht(),y0=jR("%Map%",!0),qR=To("Map.prototype.get",!0),zR=To("Map.prototype.set",!0),WR=To("Map.prototype.has",!0),VR=To("Map.prototype.delete",!0),GR=To("Map.prototype.size",!0);g0.exports=!!y0&&a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new HR("Side channel does not contain "+UR(i))},"assert"),delete:a(function(i){if(e){var n=VR(e,i);return GR(e)===0&&(e=void 0),n}return!1},"delete"),get:a(function(i){if(e)return qR(e,i)},"get"),has:a(function(i){return e?WR(e,i):!1},"has"),set:a(function(i,n){e||(e=new y0),zR(e,i,n)},"set")};return r},"getSideChannelMap")});var v0=T((Ej,b0)=>{"use strict";var KR=So(),Pa=xo(),ZR=bo(),ka=Iu(),XR=Ht(),ln=KR("%WeakMap%",!0),YR=Pa("WeakMap.prototype.get",!0),JR=Pa("WeakMap.prototype.set",!0),QR=Pa("WeakMap.prototype.has",!0),ek=Pa("WeakMap.prototype.delete",!0);b0.exports=ln?a(function(){var e,r,i={assert:a(function(n){if(!i.has(n))throw new XR("Side channel does not contain "+ZR(n))},"assert"),delete:a(function(n){if(ln&&n&&(typeof n=="object"||typeof n=="function")){if(e)return ek(e,n)}else if(ka&&r)return r.delete(n);return!1},"delete"),get:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?YR(e,n):r&&r.get(n)},"get"),has:a(function(n){return ln&&n&&(typeof n=="object"||typeof n=="function")&&e?QR(e,n):!!r&&r.has(n)},"has"),set:a(function(n,o){ln&&n&&(typeof n=="object"||typeof n=="function")?(e||(e=new ln),JR(e,n,o)):ka&&(r||(r=ka()),r.set(n,o))},"set")};return i},"getSideChannelWeakMap"):ka});var F0=T((xj,_0)=>{"use strict";var tk=Ht(),rk=bo(),ik=ty(),nk=Iu(),ok=v0(),sk=ok||nk||ik;_0.exports=a(function(){var e,r={assert:a(function(i){if(!r.has(i))throw new tk("Side channel does not contain "+rk(i))},"assert"),delete:a(function(i){return!!e&&e.delete(i)},"delete"),get:a(function(i){return e&&e.get(i)},"get"),has:a(function(i){return!!e&&e.has(i)},"has"),set:a(function(i,n){e||(e=sk()),e.set(i,n)},"set")};return r},"getSideChannel")});var Aa=T((Oj,E0)=>{"use strict";var ak=String.prototype.replace,lk=/%20/g,Du={RFC1738:"RFC1738",RFC3986:"RFC3986"};E0.exports={default:Du.RFC3986,formatters:{RFC1738:a(function(t){return ak.call(t,lk,"+")},"RFC1738"),RFC3986:a(function(t){return String(t)},"RFC3986")},RFC1738:Du.RFC1738,RFC3986:Du.RFC3986}});var Bu=T((kj,x0)=>{"use strict";var ck=Aa(),Cu=Object.prototype.hasOwnProperty,li=Array.isArray,zt=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),fk=a(function(e){for(;e.length>1;){var r=e.pop(),i=r.obj[r.prop];if(li(i)){for(var n=[],o=0;o<i.length;++o)typeof i[o]<"u"&&n.push(i[o]);r.obj[r.prop]=n}}},"compactQueue"),S0=a(function(e,r){for(var i=r&&r.plainObjects?{__proto__:null}:{},n=0;n<e.length;++n)typeof e[n]<"u"&&(i[n]=e[n]);return i},"arrayToObject"),uk=a(function t(e,r,i){if(!r)return e;if(typeof r!="object"&&typeof r!="function"){if(li(e))e.push(r);else if(e&&typeof e=="object")(i&&(i.plainObjects||i.allowPrototypes)||!Cu.call(Object.prototype,r))&&(e[r]=!0);else return[e,r];return e}if(!e||typeof e!="object")return[e].concat(r);var n=e;return li(e)&&!li(r)&&(n=S0(e,i)),li(e)&&li(r)?(r.forEach(function(o,s){if(Cu.call(e,s)){var l=e[s];l&&typeof l=="object"&&o&&typeof o=="object"?e[s]=t(l,o,i):e.push(o)}else e[s]=o}),e):Object.keys(r).reduce(function(o,s){var l=r[s];return Cu.call(o,s)?o[s]=t(o[s],l,i):o[s]=l,o},n)},"merge"),hk=a(function(e,r){return Object.keys(r).reduce(function(i,n){return i[n]=r[n],i},e)},"assignSingleSource"),dk=a(function(t,e,r){var i=t.replace(/\+/g," ");if(r==="iso-8859-1")return i.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(i)}catch{return i}},"decode"),Nu=1024,pk=a(function(e,r,i,n,o){if(e.length===0)return e;var s=e;if(typeof e=="symbol"?s=Symbol.prototype.toString.call(e):typeof e!="string"&&(s=String(e)),i==="iso-8859-1")return escape(s).replace(/%u[0-9a-f]{4}/gi,function(p){return"%26%23"+parseInt(p.slice(2),16)+"%3B"});for(var l="",f=0;f<s.length;f+=Nu){for(var c=s.length>=Nu?s.slice(f,f+Nu):s,u=[],h=0;h<c.length;++h){var d=c.charCodeAt(h);if(d===45||d===46||d===95||d===126||d>=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===ck.RFC1738&&(d===40||d===41)){u[u.length]=c.charAt(h);continue}if(d<128){u[u.length]=zt[d];continue}if(d<2048){u[u.length]=zt[192|d>>6]+zt[128|d&63];continue}if(d<55296||d>=57344){u[u.length]=zt[224|d>>12]+zt[128|d>>6&63]+zt[128|d&63];continue}h+=1,d=65536+((d&1023)<<10|c.charCodeAt(h)&1023),u[u.length]=zt[240|d>>18]+zt[128|d>>12&63]+zt[128|d>>6&63]+zt[128|d&63]}l+=u.join("")}return l},"encode"),mk=a(function(e){for(var r=[{obj:{o:e},prop:"o"}],i=[],n=0;n<r.length;++n)for(var o=r[n],s=o.obj[o.prop],l=Object.keys(s),f=0;f<l.length;++f){var c=l[f],u=s[c];typeof u=="object"&&u!==null&&i.indexOf(u)===-1&&(r.push({obj:s,prop:c}),i.push(u))}return fk(r),e},"compact"),wk=a(function(e){return Object.prototype.toString.call(e)==="[object RegExp]"},"isRegExp"),yk=a(function(e){return!e||typeof e!="object"?!1:!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},"isBuffer"),gk=a(function(e,r){return[].concat(e,r)},"combine"),bk=a(function(e,r){if(li(e)){for(var i=[],n=0;n<e.length;n+=1)i.push(r(e[n]));return i}return r(e)},"maybeMap");x0.exports={arrayToObject:S0,assign:hk,combine:gk,compact:mk,decode:dk,encode:pk,isBuffer:yk,isRegExp:wk,maybeMap:bk,merge:uk}});var A0=T((Aj,P0)=>{"use strict";var O0=F0(),Ia=Bu(),Oo=Aa(),vk=Object.prototype.hasOwnProperty,R0={brackets:a(function(e){return e+"[]"},"brackets"),comma:"comma",indices:a(function(e,r){return e+"["+r+"]"},"indices"),repeat:a(function(e){return e},"repeat")},Wt=Array.isArray,_k=Array.prototype.push,k0=a(function(t,e){_k.apply(t,Wt(e)?e:[e])},"pushToArray"),Fk=Date.prototype.toISOString,T0=Oo.default,ke={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Ia.encode,encodeValuesOnly:!1,filter:void 0,format:T0,formatter:Oo.formatters[T0],indices:!1,serializeDate:a(function(e){return Fk.call(e)},"serializeDate"),skipNulls:!1,strictNullHandling:!1},Ek=a(function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},"isNonNullishPrimitive"),Lu={},Sk=a(function t(e,r,i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g){for(var F=e,O=g,S=0,R=!1;(O=O.get(Lu))!==void 0&&!R;){var b=O.get(e);if(S+=1,typeof b<"u"){if(b===S)throw new RangeError("Cyclic object value");R=!0}typeof O.get(Lu)>"u"&&(S=0)}if(typeof u=="function"?F=u(r,F):F instanceof Date?F=p(F):i==="comma"&&Wt(F)&&(F=Ia.maybeMap(F,function(G){return G instanceof Date?p(G):G})),F===null){if(s)return c&&!y?c(r,ke.encoder,v,"key",m):r;F=""}if(Ek(F)||Ia.isBuffer(F)){if(c){var x=y?r:c(r,ke.encoder,v,"key",m);return[w(x)+"="+w(c(F,ke.encoder,v,"value",m))]}return[w(r)+"="+w(String(F))]}var _=[];if(typeof F>"u")return _;var P;if(i==="comma"&&Wt(F))y&&c&&(F=Ia.maybeMap(F,c)),P=[{value:F.length>0?F.join(",")||null:void 0}];else if(Wt(u))P=u;else{var k=Object.keys(F);P=h?k.sort(h):k}var C=f?String(r).replace(/\./g,"%2E"):String(r),N=n&&Wt(F)&&F.length===1?C+"[]":C;if(o&&Wt(F)&&F.length===0)return N+"[]";for(var U=0;U<P.length;++U){var Z=P[U],me=typeof Z=="object"&&Z&&typeof Z.value<"u"?Z.value:F[Z];if(!(l&&me===null)){var Ee=d&&f?String(Z).replace(/\./g,"%2E"):String(Z),$=Wt(F)?typeof i=="function"?i(N,Ee):N:N+(d?"."+Ee:"["+Ee+"]");g.set(e,S);var q=O0();q.set(Lu,g),k0(_,t(me,$,i,n,o,s,l,f,i==="comma"&&y&&Wt(F)?null:c,u,h,d,p,m,w,y,v,q))}}return _},"stringify"),xk=a(function(e){if(!e)return ke;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.encodeDotInKeys<"u"&&typeof e.encodeDotInKeys!="boolean")throw new TypeError("`encodeDotInKeys` option can only be `true` or `false`, when provided");if(e.encoder!==null&&typeof e.encoder<"u"&&typeof e.encoder!="function")throw new TypeError("Encoder has to be a function.");var r=e.charset||ke.charset;if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var i=Oo.default;if(typeof e.format<"u"){if(!vk.call(Oo.formatters,e.format))throw new TypeError("Unknown format option provided.");i=e.format}var n=Oo.formatters[i],o=ke.filter;(typeof e.filter=="function"||Wt(e.filter))&&(o=e.filter);var s;if(e.arrayFormat in R0?s=e.arrayFormat:"indices"in e?s=e.indices?"indices":"repeat":s=ke.arrayFormat,"commaRoundTrip"in e&&typeof e.commaRoundTrip!="boolean")throw new TypeError("`commaRoundTrip` must be a boolean, or absent");var l=typeof e.allowDots>"u"?e.encodeDotInKeys===!0?!0:ke.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:ke.addQueryPrefix,allowDots:l,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ke.allowEmptyArrays,arrayFormat:s,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ke.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?ke.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:ke.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:ke.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:ke.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:ke.encodeValuesOnly,filter:o,format:i,formatter:n,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:ke.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:ke.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ke.strictNullHandling}},"normalizeStringifyOptions");P0.exports=function(t,e){var r=t,i=xk(e),n,o;typeof i.filter=="function"?(o=i.filter,r=o("",r)):Wt(i.filter)&&(o=i.filter,n=o);var s=[];if(typeof r!="object"||r===null)return"";var l=R0[i.arrayFormat],f=l==="comma"&&i.commaRoundTrip;n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var c=O0(),u=0;u<n.length;++u){var h=n[u],d=r[h];i.skipNulls&&d===null||k0(s,Sk(d,h,l,f,i.allowEmptyArrays,i.strictNullHandling,i.skipNulls,i.encodeDotInKeys,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.format,i.formatter,i.encodeValuesOnly,i.charset,c))}var p=s.join(i.delimiter),m=i.addQueryPrefix===!0?"?":"";return i.charsetSentinel&&(i.charset==="iso-8859-1"?m+="utf8=%26%2310003%3B&":m+="utf8=%E2%9C%93&"),p.length>0?m+p:""}});var N0=T((Dj,C0)=>{"use strict";var ci=Bu(),$u=Object.prototype.hasOwnProperty,I0=Array.isArray,ye={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:ci.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},Tk=a(function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},"interpretNumericEntities"),D0=a(function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},"parseArrayValue"),Ok="utf8=%26%2310003%3B",Rk="utf8=%E2%9C%93",kk=a(function(e,r){var i={__proto__:null},n=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;n=n.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var o=r.parameterLimit===1/0?void 0:r.parameterLimit,s=n.split(r.delimiter,r.throwOnLimitExceeded?o+1:o);if(r.throwOnLimitExceeded&&s.length>o)throw new RangeError("Parameter limit exceeded. Only "+o+" parameter"+(o===1?"":"s")+" allowed.");var l=-1,f,c=r.charset;if(r.charsetSentinel)for(f=0;f<s.length;++f)s[f].indexOf("utf8=")===0&&(s[f]===Rk?c="utf-8":s[f]===Ok&&(c="iso-8859-1"),l=f,f=s.length);for(f=0;f<s.length;++f)if(f!==l){var u=s[f],h=u.indexOf("]="),d=h===-1?u.indexOf("="):h+1,p,m;d===-1?(p=r.decoder(u,ye.decoder,c,"key"),m=r.strictNullHandling?null:""):(p=r.decoder(u.slice(0,d),ye.decoder,c,"key"),m=ci.maybeMap(D0(u.slice(d+1),r,I0(i[p])?i[p].length:0),function(y){return r.decoder(y,ye.decoder,c,"value")})),m&&r.interpretNumericEntities&&c==="iso-8859-1"&&(m=Tk(String(m))),u.indexOf("[]=")>-1&&(m=I0(m)?[m]:m);var w=$u.call(i,p);w&&r.duplicates==="combine"?i[p]=ci.combine(i[p],m):(!w||r.duplicates==="last")&&(i[p]=m)}return i},"parseQueryStringValues"),Pk=a(function(t,e,r,i){var n=0;if(t.length>0&&t[t.length-1]==="[]"){var o=t.slice(0,-1).join("");n=Array.isArray(e)&&e[o]?e[o].length:0}for(var s=i?e:D0(e,r,n),l=t.length-1;l>=0;--l){var f,c=t[l];if(c==="[]"&&r.parseArrays)f=r.allowEmptyArrays&&(s===""||r.strictNullHandling&&s===null)?[]:ci.combine([],s);else{f=r.plainObjects?{__proto__:null}:{};var u=c.charAt(0)==="["&&c.charAt(c.length-1)==="]"?c.slice(1,-1):c,h=r.decodeDotInKeys?u.replace(/%2E/g,"."):u,d=parseInt(h,10);!r.parseArrays&&h===""?f={0:s}:!isNaN(d)&&c!==h&&String(d)===h&&d>=0&&r.parseArrays&&d<=r.arrayLimit?(f=[],f[d]=s):h!=="__proto__"&&(f[h]=s)}s=f}return s},"parseObject"),Ak=a(function(e,r,i,n){if(e){var o=i.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,s=/(\[[^[\]]*])/,l=/(\[[^[\]]*])/g,f=i.depth>0&&s.exec(o),c=f?o.slice(0,f.index):o,u=[];if(c){if(!i.plainObjects&&$u.call(Object.prototype,c)&&!i.allowPrototypes)return;u.push(c)}for(var h=0;i.depth>0&&(f=l.exec(o))!==null&&h<i.depth;){if(h+=1,!i.plainObjects&&$u.call(Object.prototype,f[1].slice(1,-1))&&!i.allowPrototypes)return;u.push(f[1])}if(f){if(i.strictDepth===!0)throw new RangeError("Input depth exceeded depth option of "+i.depth+" and strictDepth is true");u.push("["+o.slice(f.index)+"]")}return Pk(u,r,i,n)}},"parseQueryStringKeys"),Ik=a(function(e){if(!e)return ye;if(typeof e.allowEmptyArrays<"u"&&typeof e.allowEmptyArrays!="boolean")throw new TypeError("`allowEmptyArrays` option can only be `true` or `false`, when provided");if(typeof e.decodeDotInKeys<"u"&&typeof e.decodeDotInKeys!="boolean")throw new TypeError("`decodeDotInKeys` option can only be `true` or `false`, when provided");if(e.decoder!==null&&typeof e.decoder<"u"&&typeof e.decoder!="function")throw new TypeError("Decoder has to be a function.");if(typeof e.charset<"u"&&e.charset!=="utf-8"&&e.charset!=="iso-8859-1")throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");if(typeof e.throwOnLimitExceeded<"u"&&typeof e.throwOnLimitExceeded!="boolean")throw new TypeError("`throwOnLimitExceeded` option must be a boolean");var r=typeof e.charset>"u"?ye.charset:e.charset,i=typeof e.duplicates>"u"?ye.duplicates:e.duplicates;if(i!=="combine"&&i!=="first"&&i!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var n=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:ye.allowDots:!!e.allowDots;return{allowDots:n,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:ye.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:ye.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:ye.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:ye.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:ye.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:ye.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:ye.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:ye.decoder,delimiter:typeof e.delimiter=="string"||ci.isRegExp(e.delimiter)?e.delimiter:ye.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:ye.depth,duplicates:i,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:ye.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:ye.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:ye.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:ye.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:ye.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}},"normalizeParseOptions");C0.exports=function(t,e){var r=Ik(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var i=typeof t=="string"?kk(t,r):t,n=r.plainObjects?{__proto__:null}:{},o=Object.keys(i),s=0;s<o.length;++s){var l=o[s],f=Ak(l,i[l],r,typeof t=="string");n=ci.merge(n,f,r)}return r.allowSparse===!0?n:ci.compact(n)}});var L0=T((Nj,B0)=>{"use strict";var Dk=A0(),Ck=N0(),Nk=Aa();B0.exports={formats:Nk,parse:Ck,stringify:Dk}});var ko=T(fn=>{"use strict";var Bk=Aw();function pt(){this.protocol=null,this.slashes=null,this.auth=null,this.host=null,this.port=null,this.hostname=null,this.hash=null,this.search=null,this.query=null,this.pathname=null,this.path=null,this.href=null}a(pt,"Url");var Lk=/^([a-z0-9.+-]+:)/i,$k=/:[0-9]*$/,Mk=/^(\/\/?(?!\/)[^?\s]*)(\?[^\s]*)?$/,jk=["<",">",'"',"`"," ","\r",`
|
|
8
|
+
`," "],Uk=["{","}","|","\\","^","`"].concat(jk),Mu=["'"].concat(Uk),$0=["%","/","?",";","#"].concat(Mu),M0=["/","?","#"],Hk=255,j0=/^[+a-z0-9A-Z_-]{0,63}$/,qk=/^([+a-z0-9A-Z_-]{0,63})(.*)$/,zk={javascript:!0,"javascript:":!0},ju={javascript:!0,"javascript:":!0},cn={http:!0,https:!0,ftp:!0,gopher:!0,file:!0,"http:":!0,"https:":!0,"ftp:":!0,"gopher:":!0,"file:":!0},Uu=L0();function Ro(t,e,r){if(t&&typeof t=="object"&&t instanceof pt)return t;var i=new pt;return i.parse(t,e,r),i}a(Ro,"urlParse");pt.prototype.parse=function(t,e,r){if(typeof t!="string")throw new TypeError("Parameter 'url' must be a string, not "+typeof t);var i=t.indexOf("?"),n=i!==-1&&i<t.indexOf("#")?"?":"#",o=t.split(n),s=/\\/g;o[0]=o[0].replace(s,"/"),t=o.join(n);var l=t;if(l=l.trim(),!r&&t.split("#").length===1){var f=Mk.exec(l);if(f)return this.path=l,this.href=l,this.pathname=f[1],f[2]?(this.search=f[2],e?this.query=Uu.parse(this.search.substr(1)):this.query=this.search.substr(1)):e&&(this.search="",this.query={}),this}var c=Lk.exec(l);if(c){c=c[0];var u=c.toLowerCase();this.protocol=u,l=l.substr(c.length)}if(r||c||l.match(/^\/\/[^@/]+@[^@/]+/)){var h=l.substr(0,2)==="//";h&&!(c&&ju[c])&&(l=l.substr(2),this.slashes=!0)}if(!ju[c]&&(h||c&&!cn[c])){for(var d=-1,p=0;p<M0.length;p++){var m=l.indexOf(M0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}var w,y;d===-1?y=l.lastIndexOf("@"):y=l.lastIndexOf("@",d),y!==-1&&(w=l.slice(0,y),l=l.slice(y+1),this.auth=decodeURIComponent(w)),d=-1;for(var p=0;p<$0.length;p++){var m=l.indexOf($0[p]);m!==-1&&(d===-1||m<d)&&(d=m)}d===-1&&(d=l.length),this.host=l.slice(0,d),l=l.slice(d),this.parseHost(),this.hostname=this.hostname||"";var v=this.hostname[0]==="["&&this.hostname[this.hostname.length-1]==="]";if(!v)for(var g=this.hostname.split(/\./),p=0,F=g.length;p<F;p++){var O=g[p];if(O&&!O.match(j0)){for(var S="",R=0,b=O.length;R<b;R++)O.charCodeAt(R)>127?S+="x":S+=O[R];if(!S.match(j0)){var x=g.slice(0,p),_=g.slice(p+1),P=O.match(qk);P&&(x.push(P[1]),_.unshift(P[2])),_.length&&(l="/"+_.join(".")+l),this.hostname=x.join(".");break}}}this.hostname.length>Hk?this.hostname="":this.hostname=this.hostname.toLowerCase(),v||(this.hostname=Bk.toASCII(this.hostname));var k=this.port?":"+this.port:"",C=this.hostname||"";this.host=C+k,this.href+=this.host,v&&(this.hostname=this.hostname.substr(1,this.hostname.length-2),l[0]!=="/"&&(l="/"+l))}if(!zk[u])for(var p=0,F=Mu.length;p<F;p++){var N=Mu[p];if(l.indexOf(N)!==-1){var U=encodeURIComponent(N);U===N&&(U=escape(N)),l=l.split(N).join(U)}}var Z=l.indexOf("#");Z!==-1&&(this.hash=l.substr(Z),l=l.slice(0,Z));var me=l.indexOf("?");if(me!==-1?(this.search=l.substr(me),this.query=l.substr(me+1),e&&(this.query=Uu.parse(this.query)),l=l.slice(0,me)):e&&(this.search="",this.query={}),l&&(this.pathname=l),cn[u]&&this.hostname&&!this.pathname&&(this.pathname="/"),this.pathname||this.search){var k=this.pathname||"",Ee=this.search||"";this.path=k+Ee}return this.href=this.format(),this};function Wk(t){return typeof t=="string"&&(t=Ro(t)),t instanceof pt?t.format():pt.prototype.format.call(t)}a(Wk,"urlFormat");pt.prototype.format=function(){var t=this.auth||"";t&&(t=encodeURIComponent(t),t=t.replace(/%3A/i,":"),t+="@");var e=this.protocol||"",r=this.pathname||"",i=this.hash||"",n=!1,o="";this.host?n=t+this.host:this.hostname&&(n=t+(this.hostname.indexOf(":")===-1?this.hostname:"["+this.hostname+"]"),this.port&&(n+=":"+this.port)),this.query&&typeof this.query=="object"&&Object.keys(this.query).length&&(o=Uu.stringify(this.query,{arrayFormat:"repeat",addQueryPrefix:!1}));var s=this.search||o&&"?"+o||"";return e&&e.substr(-1)!==":"&&(e+=":"),this.slashes||(!e||cn[e])&&n!==!1?(n="//"+(n||""),r&&r.charAt(0)!=="/"&&(r="/"+r)):n||(n=""),i&&i.charAt(0)!=="#"&&(i="#"+i),s&&s.charAt(0)!=="?"&&(s="?"+s),r=r.replace(/[?#]/g,function(l){return encodeURIComponent(l)}),s=s.replace("#","%23"),e+n+r+s+i};function Vk(t,e){return Ro(t,!1,!0).resolve(e)}a(Vk,"urlResolve");pt.prototype.resolve=function(t){return this.resolveObject(Ro(t,!1,!0)).format()};function Gk(t,e){return t?Ro(t,!1,!0).resolveObject(e):e}a(Gk,"urlResolveObject");pt.prototype.resolveObject=function(t){if(typeof t=="string"){var e=new pt;e.parse(t,!1,!0),t=e}for(var r=new pt,i=Object.keys(this),n=0;n<i.length;n++){var o=i[n];r[o]=this[o]}if(r.hash=t.hash,t.href==="")return r.href=r.format(),r;if(t.slashes&&!t.protocol){for(var s=Object.keys(t),l=0;l<s.length;l++){var f=s[l];f!=="protocol"&&(r[f]=t[f])}return cn[r.protocol]&&r.hostname&&!r.pathname&&(r.pathname="/",r.path=r.pathname),r.href=r.format(),r}if(t.protocol&&t.protocol!==r.protocol){if(!cn[t.protocol]){for(var c=Object.keys(t),u=0;u<c.length;u++){var h=c[u];r[h]=t[h]}return r.href=r.format(),r}if(r.protocol=t.protocol,!t.host&&!ju[t.protocol]){for(var F=(t.pathname||"").split("/");F.length&&!(t.host=F.shift()););t.host||(t.host=""),t.hostname||(t.hostname=""),F[0]!==""&&F.unshift(""),F.length<2&&F.unshift(""),r.pathname=F.join("/")}else r.pathname=t.pathname;if(r.search=t.search,r.query=t.query,r.host=t.host||"",r.auth=t.auth,r.hostname=t.hostname||t.host,r.port=t.port,r.pathname||r.search){var d=r.pathname||"",p=r.search||"";r.path=d+p}return r.slashes=r.slashes||t.slashes,r.href=r.format(),r}var m=r.pathname&&r.pathname.charAt(0)==="/",w=t.host||t.pathname&&t.pathname.charAt(0)==="/",y=w||m||r.host&&t.pathname,v=y,g=r.pathname&&r.pathname.split("/")||[],F=t.pathname&&t.pathname.split("/")||[],O=r.protocol&&!cn[r.protocol];if(O&&(r.hostname="",r.port=null,r.host&&(g[0]===""?g[0]=r.host:g.unshift(r.host)),r.host="",t.protocol&&(t.hostname=null,t.port=null,t.host&&(F[0]===""?F[0]=t.host:F.unshift(t.host)),t.host=null),y=y&&(F[0]===""||g[0]==="")),w)r.host=t.host||t.host===""?t.host:r.host,r.hostname=t.hostname||t.hostname===""?t.hostname:r.hostname,r.search=t.search,r.query=t.query,g=F;else if(F.length)g||(g=[]),g.pop(),g=g.concat(F),r.search=t.search,r.query=t.query;else if(t.search!=null){if(O){r.host=g.shift(),r.hostname=r.host;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return r.search=t.search,r.query=t.query,(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.href=r.format(),r}if(!g.length)return r.pathname=null,r.search?r.path="/"+r.search:r.path=null,r.href=r.format(),r;for(var R=g.slice(-1)[0],b=(r.host||t.host||g.length>1)&&(R==="."||R==="..")||R==="",x=0,_=g.length;_>=0;_--)R=g[_],R==="."?g.splice(_,1):R===".."?(g.splice(_,1),x++):x&&(g.splice(_,1),x--);if(!y&&!v)for(;x--;x)g.unshift("..");y&&g[0]!==""&&(!g[0]||g[0].charAt(0)!=="/")&&g.unshift(""),b&&g.join("/").substr(-1)!=="/"&&g.push("");var P=g[0]===""||g[0]&&g[0].charAt(0)==="/";if(O){r.hostname=P?"":g.length?g.shift():"",r.host=r.hostname;var S=r.host&&r.host.indexOf("@")>0?r.host.split("@"):!1;S&&(r.auth=S.shift(),r.hostname=S.shift(),r.host=r.hostname)}return y=y||r.host&&g.length,y&&!P&&g.unshift(""),g.length>0?r.pathname=g.join("/"):(r.pathname=null,r.path=null),(r.pathname!==null||r.search!==null)&&(r.path=(r.pathname?r.pathname:"")+(r.search?r.search:"")),r.auth=t.auth||r.auth,r.slashes=r.slashes||t.slashes,r.href=r.format(),r};pt.prototype.parseHost=function(){var t=this.host,e=$k.exec(t);e&&(e=e[0],e!==":"&&(this.port=e.substr(1)),t=t.substr(0,t.length-e.length)),t&&(this.hostname=t)};fn.parse=Ro;fn.resolve=Vk;fn.resolveObject=Gk;fn.format=Wk;fn.Url=pt});var Ir=T(Pe=>{"use strict";Object.defineProperty(Pe,"__esModule",{value:!0});Pe.getWriteSyncArgs=Pe.getWriteArgs=Pe.bufToUint8=void 0;Pe.promisify=Zk;Pe.validateCallback=U0;Pe.modeToNumber=H0;Pe.nullCheck=q0;Pe.pathToFilename=Jk;Pe.createError=pP;Pe.genRndStr6=mP;Pe.flagsToNumber=wP;Pe.streamToBuffer=yP;Pe.bufferToEncoding=_P;Pe.isReadableStream=FP;var Po=Yi(),Hu=fo(),qu=Or(),Kk=cu(),Da=ya();function Zk(t,e,r=i=>i){return(...i)=>new Promise((n,o)=>{t[e].bind(t)(...i,(s,l)=>s?o(s):n(r(l)))})}a(Zk,"promisify");function U0(t){if(typeof t!="function")throw TypeError(Po.ERRSTR.CB);return t}a(U0,"validateCallback");function Xk(t,e){if(typeof t=="number")return t;if(typeof t=="string")return parseInt(t,8);if(e)return H0(e)}a(Xk,"_modeToNumber");function H0(t,e){let r=Xk(t,e);if(typeof r!="number"||isNaN(r))throw new TypeError(Po.ERRSTR.MODE_INT);return r}a(H0,"modeToNumber");function q0(t,e){if((""+t).indexOf("\0")!==-1){let r=new Error("Path must be a string without null bytes");if(r.code="ENOENT",typeof e!="function")throw r;return(0,Kk.default)(()=>{e(r)}),!1}return!0}a(q0,"nullCheck");function Yk(t){if(t.hostname!=="")throw new Hu.TypeError("ERR_INVALID_FILE_URL_HOST",process.platform);let e=t.pathname;for(let r=0;r<e.length;r++)if(e[r]==="%"){let i=e.codePointAt(r+2)|32;if(e[r+1]==="2"&&i===102)throw new Hu.TypeError("ERR_INVALID_FILE_URL_PATH","must not include encoded / characters")}return decodeURIComponent(e)}a(Yk,"getPathFromURLPosix");function Jk(t){if(t instanceof Uint8Array&&(t=(0,qu.bufferFrom)(t)),typeof t!="string"&&!qu.Buffer.isBuffer(t)){try{if(!(t instanceof ko().URL))throw new TypeError(Po.ERRSTR.PATH_STR)}catch{throw new TypeError(Po.ERRSTR.PATH_STR)}t=Yk(t)}let e=String(t);return q0(e),e}a(Jk,"pathToFilename");var Qk="ENOENT",eP="EBADF",tP="EINVAL",rP="EPERM",iP="EPROTO",nP="EEXIST",oP="ENOTDIR",sP="EMFILE",aP="EACCES",lP="EISDIR",cP="ENOTEMPTY",fP="ENOSYS",uP="ERR_FS_EISDIR",hP="ERR_OUT_OF_RANGE";function dP(t,e="",r="",i=""){let n="";switch(r&&(n=` '${r}'`),i&&(n+=` -> '${i}'`),t){case Qk:return`ENOENT: no such file or directory, ${e}${n}`;case eP:return`EBADF: bad file descriptor, ${e}${n}`;case tP:return`EINVAL: invalid argument, ${e}${n}`;case rP:return`EPERM: operation not permitted, ${e}${n}`;case iP:return`EPROTO: protocol error, ${e}${n}`;case nP:return`EEXIST: file already exists, ${e}${n}`;case oP:return`ENOTDIR: not a directory, ${e}${n}`;case lP:return`EISDIR: illegal operation on a directory, ${e}${n}`;case aP:return`EACCES: permission denied, ${e}${n}`;case cP:return`ENOTEMPTY: directory not empty, ${e}${n}`;case sP:return`EMFILE: too many open files, ${e}${n}`;case fP:return`ENOSYS: function not implemented, ${e}${n}`;case uP:return`[ERR_FS_EISDIR]: Path is a directory: ${e} returned EISDIR (is a directory) ${r}`;case hP:return`[ERR_OUT_OF_RANGE]: value out of range, ${e}${n}`;default:return`${t}: error occurred, ${e}${n}`}}a(dP,"formatError");function pP(t,e="",r="",i="",n=Error){let o=new n(dP(t,e,r,i));return o.code=t,r&&(o.path=r),o}a(pP,"createError");function mP(){return Math.random().toString(36).slice(2,8).padEnd(6,"0")}a(mP,"genRndStr6");function wP(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=Po.FLAGS[t];if(typeof e<"u")return e}throw new Hu.TypeError("ERR_INVALID_OPT_VALUE","flags",t)}a(wP,"flagsToNumber");function yP(t){let e=[];return new Promise((r,i)=>{t.on("data",n=>e.push(n)),t.on("end",()=>r(qu.Buffer.concat(e))),t.on("error",i)})}a(yP,"streamToBuffer");var gP=a(t=>new Uint8Array(t.buffer,t.byteOffset,t.byteLength),"bufToUint8");Pe.bufToUint8=gP;var bP=a((t,e,r,i,n,o)=>{(0,Da.validateFd)(t);let s=0,l,f=null,c,u,h=typeof e,d=typeof r,p=typeof i,m=typeof n;h!=="string"?d==="function"?u=r:p==="function"?(s=r|0,u=i):m==="function"?(s=r|0,l=i,u=n):(s=r|0,l=i,f=n,u=o):d==="function"?u=r:p==="function"?(f=r,u=i):m==="function"&&(f=r,c=i,u=n);let w=(0,Da.dataToBuffer)(e,c);h!=="string"?typeof l>"u"&&(l=w.length):(s=0,l=w.length);let y=U0(u);return[t,h==="string",w,s,l,f,y]},"getWriteArgs");Pe.getWriteArgs=bP;var vP=a((t,e,r,i,n)=>{(0,Da.validateFd)(t);let o,s,l,f,c=typeof e!="string";c?(s=(r||0)|0,l=i,f=n):(f=r,o=i);let u=(0,Da.dataToBuffer)(e,o);return c?typeof l>"u"&&(l=u.length):(s=0,l=u.length),[t,u,s||0,l,f]},"getWriteSyncArgs");Pe.getWriteSyncArgs=vP;function _P(t,e){return!e||e==="buffer"?t:t.toString(e)}a(_P,"bufferToEncoding");function FP(t){return t!==null&&typeof t=="object"&&typeof t.pipe=="function"&&typeof t.on=="function"&&t.readable===!0}a(FP,"isReadableStream")});var Z0=T(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.Superblock=void 0;var Ne=Gi(),EP=ru(),z0=nu(),SP=au(),xP=Or(),W0=na(),Vt=Pt(),V0=Yi(),V=Ir(),At=ya(),TP=Xf(),un=Ne.posix?Ne.posix.sep:Ne.sep,G0=Ne.posix?Ne.posix.relative:Ne.relative,OP=Ne.posix?Ne.posix.join:Ne.join,{O_RDONLY:zu,O_WRONLY:Ca,O_RDWR:Wu,O_CREAT:K0,O_EXCL:RP,O_TRUNC:kP,O_APPEND:PP,O_DIRECTORY:AP}=Vt.constants,hn=class hn{static fromJSON(e,r){let i=new hn;return i.fromJSON(e,r),i}static fromNestedJSON(e,r){let i=new hn;return i.fromNestedJSON(e,r),i}constructor(e={}){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.maxFiles=1e4,this.openFiles=0,this.open=(i,n,o,s=!0)=>{let l=this.openFile(i,n,o,s);if(!l)throw(0,V.createError)("ENOENT","open",i);return l.fd},this.writeFile=(i,n,o,s)=>{let l=typeof i=="number",f;l?f=i:f=this.open((0,V.pathToFilename)(i),o,s);let c=0,u=n.length,h=o&PP?void 0:0;try{for(;u>0;){let d=this.write(f,n,c,u,h);c+=d,u-=d,h!==void 0&&(h+=d)}}finally{l||this.close(f)}},this.read=(i,n,o,s,l)=>{if(n.byteLength<s)throw(0,V.createError)("ERR_OUT_OF_RANGE","read",void 0,void 0,RangeError);let f=this.getFileByFdOrThrow(i);if(f.node.isSymlink())throw(0,V.createError)("EPERM","read",f.link.getPath());return f.read(n,Number(o),Number(s),l===-1||typeof l!="number"?void 0:l)},this.readv=(i,n,o)=>{let s=this.getFileByFdOrThrow(i),l=o??void 0;l===-1&&(l=void 0);let f=0;for(let c of n){let u=s.read(c,0,c.byteLength,l);if(l=void 0,f+=u,u<c.byteLength)break}return f},this.link=(i,n)=>{let o;try{o=this.getLinkOrThrow(i,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let s=(0,Ne.dirname)(n),l;try{l=this.getLinkOrThrow(s,"link")}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"link",i,n)),u}let f=(0,Ne.basename)(n);if(l.getChild(f))throw(0,V.createError)("EEXIST","link",i,n);let c=o.getNode();c.nlink++,l.createChild(f,c)},this.unlink=i=>{let n=this.getLinkOrThrow(i,"unlink");if(n.length)throw Error("Dir not empty...");this.deleteLink(n);let o=n.getNode();o.nlink--,o.nlink<=0&&this.deleteNode(o)},this.symlink=(i,n)=>{let o=(0,At.filenameToSteps)(n),s;try{s=this.getLinkParentAsDirOrThrow(o)}catch(u){throw u.code&&(u=(0,V.createError)(u.code,"symlink",i,n)),u}let l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","symlink",i,n);let f=s.getNode();if(!f.canExecute()||!f.canWrite())throw(0,V.createError)("EACCES","symlink",i,n);let c=s.createChild(l);return c.getNode().makeSymlink(i),c},this.rename=(i,n)=>{let o;try{o=this.getResolvedLinkOrThrow(i)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let s;try{s=this.getLinkParentAsDirOrThrow(n)}catch(h){throw h.code&&(h=(0,V.createError)(h.code,"rename",i,n)),h}let l=o.parent;if(!l)throw(0,V.createError)("EINVAL","rename",i,n);let f=l.getNode(),c=s.getNode();if(!f.canExecute()||!f.canWrite()||!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","rename",i,n);l.deleteChild(o);let u=(0,Ne.basename)(n);o.name=u,o.steps=[...s.steps,u],s.setChild(o.getName(),o)},this.mkdir=(i,n)=>{let o=(0,At.filenameToSteps)(i);if(!o.length)throw(0,V.createError)("EEXIST","mkdir",i);let s=this.getLinkParentAsDirOrThrow(i,"mkdir"),l=o[o.length-1];if(s.getChild(l))throw(0,V.createError)("EEXIST","mkdir",i);let f=s.getNode();if(!f.canWrite()||!f.canExecute())throw(0,V.createError)("EACCES","mkdir",i);s.createChild(l,this.createNode(Vt.constants.S_IFDIR|n))},this.mkdirp=(i,n)=>{let o=!1,s=(0,At.filenameToSteps)(i),l=null,f=s.length;for(f=s.length;f>=0&&(l=this.getResolvedLink(s.slice(0,f)),!l);f--);for(l||(l=this.root,f=0),l=this.getResolvedLinkOrThrow(Ne.sep+s.slice(0,f).join(Ne.sep),"mkdir"),f;f<s.length;f++){let c=l.getNode();if(c.isDirectory()){if(!c.canExecute()||!c.canWrite())throw(0,V.createError)("EACCES","mkdir",i)}else throw(0,V.createError)("ENOTDIR","mkdir",i);o=!0,l=l.createChild(s[f],this.createNode(Vt.constants.S_IFDIR|n))}return o?i:void 0},this.rmdir=(i,n=!1)=>{let o=this.getLinkAsDirOrThrow(i,"rmdir");if(o.length&&!n)throw(0,V.createError)("ENOTEMPTY","rmdir",i);this.deleteLink(o)},this.rm=(i,n=!1,o=!1)=>{let s;try{s=this.getResolvedLinkOrThrow(i,"stat")}catch(l){if(l.code==="ENOENT"&&n)return;throw l}if(s.getNode().isDirectory()&&!o)throw(0,V.createError)("ERR_FS_EISDIR","rm",i);if(!s.parent?.getNode().canWrite())throw(0,V.createError)("EACCES","rm",i);this.deleteLink(s)},this.close=i=>{(0,At.validateFd)(i);let n=this.getFileByFdOrThrow(i,"close");this.closeFile(n)};let r=this.createLink();r.setNode(this.createNode(Vt.constants.S_IFDIR|511)),r.setChild(".",r),r.getNode().nlink++,r.setChild("..",r),r.getNode().nlink++,this.root=r}createLink(e,r,i=!1,n){if(!e)return new z0.Link(this,void 0,"");if(!r)throw new Error("createLink: name cannot be empty");let o=n??(i?511:438),l=n&&n&Vt.constants.S_IFMT?n&Vt.constants.S_IFMT:i?Vt.constants.S_IFDIR:Vt.constants.S_IFREG,f=o&~Vt.constants.S_IFMT|l;return e.createChild(r,this.createNode(f))}deleteLink(e){let r=e.parent;return r?(r.deleteChild(e),!0):!1}newInoNumber(){let e=this.releasedInos.pop();return e||(this.ino=(this.ino+1)%4294967295,this.ino)}newFdNumber(){let e=this.releasedFds.pop();return typeof e=="number"?e:hn.fd--}createNode(e){let r=new EP.Node(this.newInoNumber(),e);return this.inodes[r.ino]=r,r}deleteNode(e){e.del(),delete this.inodes[e.ino],this.releasedInos.push(e.ino)}walk(e,r=!1,i=!1,n=!1,o){let s,l;e instanceof z0.Link?(s=e.steps,l=un+s.join(un)):typeof e=="string"?(s=(0,At.filenameToSteps)(e),l=e):(s=e,l=un+s.join(un));let f=this.root,c=0;for(;c<s.length;){let u=f.getNode();if(u.isDirectory()){if(n&&!u.canExecute())throw(0,V.createError)("EACCES",o,l)}else if(c<s.length-1)throw(0,V.createError)("ENOTDIR",o,l);if(f=f.getChild(s[c])??null,!f){if(i)throw(0,V.createError)("ENOENT",o,l);return null}if(u=f?.getNode(),u.isSymlink()&&(r||c<s.length-1)){let h=(0,Ne.isAbsolute)(u.symlink)?u.symlink:OP((0,Ne.dirname)(f.getPath()),u.symlink);s=(0,At.filenameToSteps)(h).concat(s.slice(c+1)),f=this.root,c=0;continue}if(i&&!u.isDirectory()&&c<s.length-1){let h=W0.default.platform==="win32"?"ENOENT":"ENOTDIR";throw(0,V.createError)(h,o,l)}c++}return f}getLink(e){return this.walk(e,!1,!1,!1)}getLinkOrThrow(e,r){return this.walk(e,!1,!0,!0,r)}getResolvedLink(e){return this.walk(e,!0,!1,!1)}getResolvedLinkOrThrow(e,r){return this.walk(e,!0,!0,!0,r)}resolveSymlinks(e){return this.getResolvedLink(e.steps.slice(1))}getLinkAsDirOrThrow(e,r){let i=this.getLinkOrThrow(e,r);if(!i.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,e);return i}getLinkParent(e){return this.getLink(e.slice(0,-1))}getLinkParentAsDirOrThrow(e,r){let i=(e instanceof Array?e:(0,At.filenameToSteps)(e)).slice(0,-1),n=un+i.join(un),o=this.getLinkOrThrow(n,r);if(!o.getNode().isDirectory())throw(0,V.createError)("ENOTDIR",r,n);return o}getFileByFd(e){return this.fds[String(e)]}getFileByFdOrThrow(e,r){if(!(0,At.isFd)(e))throw TypeError(V0.ERRSTR.FD);let i=this.getFileByFd(e);if(!i)throw(0,V.createError)("EBADF",r);return i}_toJSON(e=this.root,r={},i,n){let o=!0,s=e.children;e.getNode().isFile()&&(s=new Map([[e.getName(),e.parent.getChild(e.getName())]]),e=e.parent);for(let f of s.keys()){if(f==="."||f==="..")continue;o=!1;let c=e.getChild(f);if(!c)throw new Error("_toJSON: unexpected undefined");let u=c.getNode();if(u.isFile()){let h=c.getPath();i&&(h=G0(i,h)),r[h]=n?u.getBuffer():u.getString()}else u.isDirectory()&&this._toJSON(c,r,i,n)}let l=e.getPath();return i&&(l=G0(i,l)),l&&o&&(r[l]=null),r}toJSON(e,r={},i=!1,n=!1){let o=[];if(e){Array.isArray(e)||(e=[e]);for(let s of e){let l=(0,V.pathToFilename)(s),f=this.getResolvedLink(l);f&&o.push(f)}}else o.push(this.root);if(!o.length)return r;for(let s of o)this._toJSON(s,r,i?s.getPath():"",n);return r}fromJSON(e,r=W0.default.cwd()){for(let i in e){let n=e[i];if(i=(0,At.resolve)(i,r),typeof n=="string"||n instanceof xP.Buffer){let o=(0,Ne.dirname)(i);this.mkdirp(o,511);let s=(0,At.dataToBuffer)(n);this.writeFile(i,s,V0.FLAGS.w,438)}else this.mkdirp(i,511)}}fromNestedJSON(e,r){this.fromJSON((0,TP.flattenJSON)(e),r)}reset(){this.ino=0,this.inodes={},this.releasedInos=[],this.fds={},this.releasedFds=[],this.openFiles=0,this.root=this.createLink(),this.root.setNode(this.createNode(Vt.constants.S_IFDIR|511))}mountSync(e,r){this.fromJSON(r,e)}openLink(e,r,i=!0){if(this.openFiles>=this.maxFiles)throw(0,V.createError)("EMFILE","open",e.getPath());let n=e;i&&(n=this.getResolvedLinkOrThrow(e.getPath(),"open"));let o=n.getNode();if(o.isDirectory()){if((r&(zu|Wu|Ca))!==zu)throw(0,V.createError)("EISDIR","open",e.getPath())}else if(r&AP)throw(0,V.createError)("ENOTDIR","open",e.getPath());if((r&(zu|Wu|Ca))!==Ca&&!o.canRead()||r&(Ca|Wu)&&!o.canWrite())throw(0,V.createError)("EACCES","open",e.getPath());let s=new SP.File(e,o,r,this.newFdNumber());return this.fds[s.fd]=s,this.openFiles++,r&kP&&s.truncate(),s}openFile(e,r,i,n=!0){let o=(0,At.filenameToSteps)(e),s;try{if(s=n?this.getResolvedLinkOrThrow(e,"open"):this.getLinkOrThrow(e,"open"),s&&r&K0&&r&RP)throw(0,V.createError)("EEXIST","open",e)}catch(l){if(l.code==="ENOENT"&&r&K0){let f=(0,Ne.dirname)(e),c=this.getResolvedLinkOrThrow(f),u=c.getNode();if(!u.isDirectory())throw(0,V.createError)("ENOTDIR","open",e);if(!u.canExecute()||!u.canWrite())throw(0,V.createError)("EACCES","open",e);i??(i=438),s=this.createLink(c,o[o.length-1],!1,i)}else throw l}if(s)return this.openLink(s,r,n);throw(0,V.createError)("ENOENT","open",e)}closeFile(e){this.fds[e.fd]&&(this.openFiles--,delete this.fds[e.fd],this.releasedFds.push(e.fd))}write(e,r,i,n,o){let s=this.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,V.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}};a(hn,"Superblock");var Na=hn;Ba.Superblock=Na;Na.fd=2147483647});var Y0=T(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.Superblock=mt.File=mt.Link=mt.Node=void 0;var X0=(Kf(),bm(Gf));X0.__exportStar(_w(),mt);X0.__exportStar(Xf(),mt);var IP=ru();Object.defineProperty(mt,"Node",{enumerable:!0,get:a(function(){return IP.Node},"get")});var DP=nu();Object.defineProperty(mt,"Link",{enumerable:!0,get:a(function(){return DP.Link},"get")});var CP=au();Object.defineProperty(mt,"File",{enumerable:!0,get:a(function(){return CP.File},"get")});var NP=Z0();Object.defineProperty(mt,"Superblock",{enumerable:!0,get:a(function(){return NP.Superblock},"get")})});var J0=T(Ao=>{"use strict";Object.defineProperty(Ao,"__esModule",{value:!0});Ao.StatFs=void 0;var $a=class $a{static build(e,r=!1){let i=new $a,n=r?u=>BigInt(u):u=>u;i.type=n(2240043254),i.bsize=n(4096);let o=Object.keys(e.inodes).length,s=1e6,l=Math.min(o*2,s),f=s-l;i.blocks=n(s),i.bfree=n(f),i.bavail=n(f);let c=1e6;return i.files=n(c),i.ffree=n(c-o),i}};a($a,"StatFs");var La=$a;Ao.StatFs=La;Ao.default=La});var Q0=T(Vu=>{"use strict";Object.defineProperty(Vu,"__esModule",{value:!0});function BP(t,e,r){let i=setTimeout.apply(globalThis,arguments);return i&&typeof i=="object"&&typeof i.unref=="function"&&i.unref(),i}a(BP,"setTimeoutUnref");Vu.default=BP});var Io=T((Kj,Gu)=>{"use strict";var dn=typeof Reflect=="object"?Reflect:null,eg=dn&&typeof dn.apply=="function"?dn.apply:a(function(e,r,i){return Function.prototype.apply.call(e,r,i)},"ReflectApply"),Ma;dn&&typeof dn.ownKeys=="function"?Ma=dn.ownKeys:Object.getOwnPropertySymbols?Ma=a(function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))},"ReflectOwnKeys"):Ma=a(function(e){return Object.getOwnPropertyNames(e)},"ReflectOwnKeys");function LP(t){console&&console.warn&&console.warn(t)}a(LP,"ProcessEmitWarning");var rg=Number.isNaN||a(function(e){return e!==e},"NumberIsNaN");function le(){le.init.call(this)}a(le,"EventEmitter");Gu.exports=le;Gu.exports.once=UP;le.EventEmitter=le;le.prototype._events=void 0;le.prototype._eventsCount=0;le.prototype._maxListeners=void 0;var tg=10;function ja(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}a(ja,"checkListener");Object.defineProperty(le,"defaultMaxListeners",{enumerable:!0,get:a(function(){return tg},"get"),set:a(function(t){if(typeof t!="number"||t<0||rg(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");tg=t},"set")});le.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};le.prototype.setMaxListeners=a(function(e){if(typeof e!="number"||e<0||rg(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 ig(t){return t._maxListeners===void 0?le.defaultMaxListeners:t._maxListeners}a(ig,"_getMaxListeners");le.prototype.getMaxListeners=a(function(){return ig(this)},"getMaxListeners");le.prototype.emit=a(function(e){for(var r=[],i=1;i<arguments.length;i++)r.push(arguments[i]);var n=e==="error",o=this._events;if(o!==void 0)n=n&&o.error===void 0;else if(!n)return!1;if(n){var s;if(r.length>0&&(s=r[0]),s instanceof Error)throw s;var l=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw l.context=s,l}var f=o[e];if(f===void 0)return!1;if(typeof f=="function")eg(f,this,r);else for(var c=f.length,u=lg(f,c),i=0;i<c;++i)eg(u[i],this,r);return!0},"emit");function ng(t,e,r,i){var n,o,s;if(ja(r),o=t._events,o===void 0?(o=t._events=Object.create(null),t._eventsCount=0):(o.newListener!==void 0&&(t.emit("newListener",e,r.listener?r.listener:r),o=t._events),s=o[e]),s===void 0)s=o[e]=r,++t._eventsCount;else if(typeof s=="function"?s=o[e]=i?[r,s]:[s,r]:i?s.unshift(r):s.push(r),n=ig(t),n>0&&s.length>n&&!s.warned){s.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=t,l.type=e,l.count=s.length,LP(l)}return t}a(ng,"_addListener");le.prototype.addListener=a(function(e,r){return ng(this,e,r,!1)},"addListener");le.prototype.on=le.prototype.addListener;le.prototype.prependListener=a(function(e,r){return ng(this,e,r,!0)},"prependListener");function $P(){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)}a($P,"onceWrapper");function og(t,e,r){var i={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},n=$P.bind(i);return n.listener=r,i.wrapFn=n,n}a(og,"_onceWrap");le.prototype.once=a(function(e,r){return ja(r),this.on(e,og(this,e,r)),this},"once");le.prototype.prependOnceListener=a(function(e,r){return ja(r),this.prependListener(e,og(this,e,r)),this},"prependOnceListener");le.prototype.removeListener=a(function(e,r){var i,n,o,s,l;if(ja(r),n=this._events,n===void 0)return this;if(i=n[e],i===void 0)return this;if(i===r||i.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,i.listener||r));else if(typeof i!="function"){for(o=-1,s=i.length-1;s>=0;s--)if(i[s]===r||i[s].listener===r){l=i[s].listener,o=s;break}if(o<0)return this;o===0?i.shift():MP(i,o),i.length===1&&(n[e]=i[0]),n.removeListener!==void 0&&this.emit("removeListener",e,l||r)}return this},"removeListener");le.prototype.off=le.prototype.removeListener;le.prototype.removeAllListeners=a(function(e){var r,i,n;if(i=this._events,i===void 0)return this;if(i.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):i[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete i[e]),this;if(arguments.length===0){var o=Object.keys(i),s;for(n=0;n<o.length;++n)s=o[n],s!=="removeListener"&&this.removeAllListeners(s);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(r=i[e],typeof r=="function")this.removeListener(e,r);else if(r!==void 0)for(n=r.length-1;n>=0;n--)this.removeListener(e,r[n]);return this},"removeAllListeners");function sg(t,e,r){var i=t._events;if(i===void 0)return[];var n=i[e];return n===void 0?[]:typeof n=="function"?r?[n.listener||n]:[n]:r?jP(n):lg(n,n.length)}a(sg,"_listeners");le.prototype.listeners=a(function(e){return sg(this,e,!0)},"listeners");le.prototype.rawListeners=a(function(e){return sg(this,e,!1)},"rawListeners");le.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):ag.call(t,e)};le.prototype.listenerCount=ag;function ag(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}a(ag,"listenerCount");le.prototype.eventNames=a(function(){return this._eventsCount>0?Ma(this._events):[]},"eventNames");function lg(t,e){for(var r=new Array(e),i=0;i<e;++i)r[i]=t[i];return r}a(lg,"arrayClone");function MP(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}a(MP,"spliceOne");function jP(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}a(jP,"unwrapListeners");function UP(t,e){return new Promise(function(r,i){function n(s){t.removeListener(e,o),i(s)}a(n,"errorListener");function o(){typeof t.removeListener=="function"&&t.removeListener("error",n),r([].slice.call(arguments))}a(o,"resolver"),cg(t,e,o,{once:!0}),e!=="error"&&HP(t,n,{once:!0})})}a(UP,"once");function HP(t,e,r){typeof t.on=="function"&&cg(t,"error",e,r)}a(HP,"addErrorHandlerIfEventEmitter");function cg(t,e,r,i){if(typeof t.on=="function")i.once?t.once(e,r):t.on(e,r);else if(typeof t.addEventListener=="function")t.addEventListener(e,a(function n(o){i.once&&t.removeEventListener(e,n),r(o)},"wrapListener"));else throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof t)}a(cg,"eventTargetAgnosticAddListener")});var Gt=T((Xj,Ku)=>{typeof Object.create=="function"?Ku.exports=a(function(e,r){r&&(e.super_=r,e.prototype=Object.create(r.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))},"inherits"):Ku.exports=a(function(e,r){if(r){e.super_=r;var i=a(function(){},"TempCtor");i.prototype=r.prototype,e.prototype=new i,e.prototype.constructor=e}},"inherits")});var Zu=T((Jj,fg)=>{fg.exports=Io().EventEmitter});var Xu=T(()=>{});var wg=T((t6,mg)=>{"use strict";function ug(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}a(ug,"ownKeys");function hg(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ug(Object(r),!0).forEach(function(i){qP(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ug(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}a(hg,"_objectSpread");function qP(t,e,r){return e=pg(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(qP,"_defineProperty");function zP(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}a(zP,"_classCallCheck");function dg(t,e){for(var r=0;r<e.length;r++){var i=e[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,pg(i.key),i)}}a(dg,"_defineProperties");function WP(t,e,r){return e&&dg(t.prototype,e),r&&dg(t,r),Object.defineProperty(t,"prototype",{writable:!1}),t}a(WP,"_createClass");function pg(t){var e=VP(t,"string");return typeof e=="symbol"?e:String(e)}a(pg,"_toPropertyKey");function VP(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(VP,"_toPrimitive");var GP=ni(),Ua=GP.Buffer,KP=Xu(),Yu=KP.inspect,ZP=Yu&&Yu.custom||"inspect";function XP(t,e,r){Ua.prototype.copy.call(t,e,r)}a(XP,"copyBuffer");mg.exports=function(){function t(){zP(this,t),this.head=null,this.tail=null,this.length=0}return a(t,"BufferList"),WP(t,[{key:"push",value:a(function(r){var i={data:r,next:null};this.length>0?this.tail.next=i:this.head=i,this.tail=i,++this.length},"push")},{key:"unshift",value:a(function(r){var i={data:r,next:this.head};this.length===0&&(this.tail=i),this.head=i,++this.length},"unshift")},{key:"shift",value:a(function(){if(this.length!==0){var r=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,r}},"shift")},{key:"clear",value:a(function(){this.head=this.tail=null,this.length=0},"clear")},{key:"join",value:a(function(r){if(this.length===0)return"";for(var i=this.head,n=""+i.data;i=i.next;)n+=r+i.data;return n},"join")},{key:"concat",value:a(function(r){if(this.length===0)return Ua.alloc(0);for(var i=Ua.allocUnsafe(r>>>0),n=this.head,o=0;n;)XP(n.data,i,o),o+=n.data.length,n=n.next;return i},"concat")},{key:"consume",value:a(function(r,i){var n;return r<this.head.data.length?(n=this.head.data.slice(0,r),this.head.data=this.head.data.slice(r)):r===this.head.data.length?n=this.shift():n=i?this._getString(r):this._getBuffer(r),n},"consume")},{key:"first",value:a(function(){return this.head.data},"first")},{key:"_getString",value:a(function(r){var i=this.head,n=1,o=i.data;for(r-=o.length;i=i.next;){var s=i.data,l=r>s.length?s.length:r;if(l===s.length?o+=s:o+=s.slice(0,r),r-=l,r===0){l===s.length?(++n,i.next?this.head=i.next:this.head=this.tail=null):(this.head=i,i.data=s.slice(l));break}++n}return this.length-=n,o},"_getString")},{key:"_getBuffer",value:a(function(r){var i=Ua.allocUnsafe(r),n=this.head,o=1;for(n.data.copy(i),r-=n.data.length;n=n.next;){var s=n.data,l=r>s.length?s.length:r;if(s.copy(i,i.length-r,0,l),r-=l,r===0){l===s.length?(++o,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=s.slice(l));break}++o}return this.length-=o,i},"_getBuffer")},{key:ZP,value:a(function(r,i){return Yu(this,hg(hg({},i),{},{depth:0,customInspect:!1}))},"value")}]),t}()});var Qu=T((i6,gg)=>{"use strict";function YP(t,e){var r=this,i=this._readableState&&this._readableState.destroyed,n=this._writableState&&this._writableState.destroyed;return i||n?(e?e(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Ju,this,t)):process.nextTick(Ju,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(o){!e&&o?r._writableState?r._writableState.errorEmitted?process.nextTick(Ha,r):(r._writableState.errorEmitted=!0,process.nextTick(yg,r,o)):process.nextTick(yg,r,o):e?(process.nextTick(Ha,r),e(o)):process.nextTick(Ha,r)}),this)}a(YP,"destroy");function yg(t,e){Ju(t,e),Ha(t)}a(yg,"emitErrorAndCloseNT");function Ha(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}a(Ha,"emitCloseNT");function JP(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}a(JP,"undestroy");function Ju(t,e){t.emit("error",e)}a(Ju,"emitErrorNT");function QP(t,e){var r=t._readableState,i=t._writableState;r&&r.autoDestroy||i&&i.autoDestroy?t.destroy(e):t.emit("error",e)}a(QP,"errorOrDestroy");gg.exports={destroy:YP,undestroy:JP,errorOrDestroy:QP}});var fi=T((o6,_g)=>{"use strict";function eA(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}a(eA,"_inheritsLoose");var vg={};function wt(t,e,r){r||(r=Error);function i(o,s,l){return typeof e=="string"?e:e(o,s,l)}a(i,"getMessage");var n=function(o){eA(s,o);function s(l,f,c){return o.call(this,i(l,f,c))||this}return a(s,"NodeError"),s}(r);n.prototype.name=r.name,n.prototype.code=t,vg[t]=n}a(wt,"createErrorType");function bg(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(i){return String(i)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:r===2?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}else return"of ".concat(e," ").concat(String(t))}a(bg,"oneOf");function tA(t,e,r){return t.substr(!r||r<0?0:+r,e.length)===e}a(tA,"startsWith");function rA(t,e,r){return(r===void 0||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}a(rA,"endsWith");function iA(t,e,r){return typeof r!="number"&&(r=0),r+e.length>t.length?!1:t.indexOf(e,r)!==-1}a(iA,"includes");wt("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError);wt("ERR_INVALID_ARG_TYPE",function(t,e,r){var i;typeof e=="string"&&tA(e,"not ")?(i="must not be",e=e.replace(/^not /,"")):i="must be";var n;if(rA(t," argument"))n="The ".concat(t," ").concat(i," ").concat(bg(e,"type"));else{var o=iA(t,".")?"property":"argument";n='The "'.concat(t,'" ').concat(o," ").concat(i," ").concat(bg(e,"type"))}return n+=". Received type ".concat(typeof r),n},TypeError);wt("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");wt("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"});wt("ERR_STREAM_PREMATURE_CLOSE","Premature close");wt("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"});wt("ERR_MULTIPLE_CALLBACK","Callback called multiple times");wt("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");wt("ERR_STREAM_WRITE_AFTER_END","write after end");wt("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);wt("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError);wt("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");_g.exports.codes=vg});var eh=T((a6,Fg)=>{"use strict";var nA=fi().codes.ERR_INVALID_OPT_VALUE;function oA(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}a(oA,"highWaterMarkFrom");function sA(t,e,r,i){var n=oA(e,i,r);if(n!=null){if(!(isFinite(n)&&Math.floor(n)===n)||n<0){var o=i?r:"highWaterMark";throw new nA(o,n)}return Math.floor(n)}return t.objectMode?16:16*1024}a(sA,"getHighWaterMark");Fg.exports={getHighWaterMark:sA}});var Sg=T((c6,Eg)=>{Eg.exports=aA;function aA(t,e){if(th("noDeprecation"))return t;var r=!1;function i(){if(!r){if(th("throwDeprecation"))throw new Error(e);th("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return a(i,"deprecated"),i}a(aA,"deprecate");function th(t){try{if(!globalThis.localStorage)return!1}catch{return!1}var e=globalThis.localStorage[t];return e==null?!1:String(e).toLowerCase()==="true"}a(th,"config")});var Wa=T((u6,Pg)=>{"use strict";Pg.exports=ge;function Tg(t){var e=this;this.next=null,this.entry=null,this.finish=function(){CA(e,t)}}a(Tg,"CorkedRequest");var pn;ge.WritableState=Co;var lA={deprecate:Sg()},Og=Zu(),za=ni().Buffer,cA=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fA(t){return za.from(t)}a(fA,"_uint8ArrayToBuffer");function uA(t){return za.isBuffer(t)||t instanceof cA}a(uA,"_isUint8Array");var ih=Qu(),hA=eh(),dA=hA.getHighWaterMark,Dr=fi().codes,pA=Dr.ERR_INVALID_ARG_TYPE,mA=Dr.ERR_METHOD_NOT_IMPLEMENTED,wA=Dr.ERR_MULTIPLE_CALLBACK,yA=Dr.ERR_STREAM_CANNOT_PIPE,gA=Dr.ERR_STREAM_DESTROYED,bA=Dr.ERR_STREAM_NULL_VALUES,vA=Dr.ERR_STREAM_WRITE_AFTER_END,_A=Dr.ERR_UNKNOWN_ENCODING,mn=ih.errorOrDestroy;Gt()(ge,Og);function FA(){}a(FA,"nop");function Co(t,e,r){pn=pn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof pn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=dA(this,t,"writableHighWaterMark",r),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var i=t.decodeStrings===!1;this.decodeStrings=!i,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(n){kA(e,n)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new Tg(this)}a(Co,"WritableState");Co.prototype.getBuffer=a(function(){for(var e=this.bufferedRequest,r=[];e;)r.push(e),e=e.next;return r},"getBuffer");(function(){try{Object.defineProperty(Co.prototype,"buffer",{get:lA.deprecate(a(function(){return this.getBuffer()},"writableStateBufferGetter"),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}})();var qa;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(qa=Function.prototype[Symbol.hasInstance],Object.defineProperty(ge,Symbol.hasInstance,{value:a(function(e){return qa.call(this,e)?!0:this!==ge?!1:e&&e._writableState instanceof Co},"value")})):qa=a(function(e){return e instanceof this},"realHasInstance");function ge(t){pn=pn||Cr();var e=this instanceof pn;if(!e&&!qa.call(ge,this))return new ge(t);this._writableState=new Co(t,this,e),this.writable=!0,t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final)),Og.call(this)}a(ge,"Writable");ge.prototype.pipe=function(){mn(this,new yA)};function EA(t,e){var r=new vA;mn(t,r),process.nextTick(e,r)}a(EA,"writeAfterEnd");function SA(t,e,r,i){var n;return r===null?n=new bA:typeof r!="string"&&!e.objectMode&&(n=new pA("chunk",["string","Buffer"],r)),n?(mn(t,n),process.nextTick(i,n),!1):!0}a(SA,"validChunk");ge.prototype.write=function(t,e,r){var i=this._writableState,n=!1,o=!i.objectMode&&uA(t);return o&&!za.isBuffer(t)&&(t=fA(t)),typeof e=="function"&&(r=e,e=null),o?e="buffer":e||(e=i.defaultEncoding),typeof r!="function"&&(r=FA),i.ending?EA(this,r):(o||SA(this,i,t,r))&&(i.pendingcb++,n=TA(this,i,o,t,e,r)),n};ge.prototype.cork=function(){this._writableState.corked++};ge.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,!t.writing&&!t.corked&&!t.bufferProcessing&&t.bufferedRequest&&Rg(this,t))};ge.prototype.setDefaultEncoding=a(function(e){if(typeof e=="string"&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new _A(e);return this._writableState.defaultEncoding=e,this},"setDefaultEncoding");Object.defineProperty(ge.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});function xA(t,e,r){return!t.objectMode&&t.decodeStrings!==!1&&typeof e=="string"&&(e=za.from(e,r)),e}a(xA,"decodeChunk");Object.defineProperty(ge.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});function TA(t,e,r,i,n,o){if(!r){var s=xA(e,i,n);i!==s&&(r=!0,n="buffer",i=s)}var l=e.objectMode?1:i.length;e.length+=l;var f=e.length<e.highWaterMark;if(f||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:i,encoding:n,isBuf:r,callback:o,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else rh(t,e,!1,l,i,n,o);return f}a(TA,"writeOrBuffer");function rh(t,e,r,i,n,o,s){e.writelen=i,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new gA("write")):r?t._writev(n,e.onwrite):t._write(n,o,e.onwrite),e.sync=!1}a(rh,"doWrite");function OA(t,e,r,i,n){--e.pendingcb,r?(process.nextTick(n,i),process.nextTick(Do,t,e),t._writableState.errorEmitted=!0,mn(t,i)):(n(i),t._writableState.errorEmitted=!0,mn(t,i),Do(t,e))}a(OA,"onwriteError");function RA(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}a(RA,"onwriteStateUpdate");function kA(t,e){var r=t._writableState,i=r.sync,n=r.writecb;if(typeof n!="function")throw new wA;if(RA(r),e)OA(t,r,i,e,n);else{var o=kg(r)||t.destroyed;!o&&!r.corked&&!r.bufferProcessing&&r.bufferedRequest&&Rg(t,r),i?process.nextTick(xg,t,r,o,n):xg(t,r,o,n)}}a(kA,"onwrite");function xg(t,e,r,i){r||PA(t,e),e.pendingcb--,i(),Do(t,e)}a(xg,"afterWrite");function PA(t,e){e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}a(PA,"onwriteDrain");function Rg(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var i=e.bufferedRequestCount,n=new Array(i),o=e.corkedRequestsFree;o.entry=r;for(var s=0,l=!0;r;)n[s]=r,r.isBuf||(l=!1),r=r.next,s+=1;n.allBuffers=l,rh(t,e,!0,e.length,n,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new Tg(e),e.bufferedRequestCount=0}else{for(;r;){var f=r.chunk,c=r.encoding,u=r.callback,h=e.objectMode?1:f.length;if(rh(t,e,!1,h,f,c,u),r=r.next,e.bufferedRequestCount--,e.writing)break}r===null&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}a(Rg,"clearBuffer");ge.prototype._write=function(t,e,r){r(new mA("_write()"))};ge.prototype._writev=null;ge.prototype.end=function(t,e,r){var i=this._writableState;return typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),t!=null&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||DA(this,i,r),this};Object.defineProperty(ge.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function kg(t){return t.ending&&t.length===0&&t.bufferedRequest===null&&!t.finished&&!t.writing}a(kg,"needFinish");function AA(t,e){t._final(function(r){e.pendingcb--,r&&mn(t,r),e.prefinished=!0,t.emit("prefinish"),Do(t,e)})}a(AA,"callFinal");function IA(t,e){!e.prefinished&&!e.finalCalled&&(typeof t._final=="function"&&!e.destroyed?(e.pendingcb++,e.finalCalled=!0,process.nextTick(AA,t,e)):(e.prefinished=!0,t.emit("prefinish")))}a(IA,"prefinish");function Do(t,e){var r=kg(e);if(r&&(IA(t,e),e.pendingcb===0&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return r}a(Do,"finishMaybe");function DA(t,e,r){e.ending=!0,Do(t,e),r&&(e.finished?process.nextTick(r):t.once("finish",r)),e.ended=!0,t.writable=!1}a(DA,"endWritable");function CA(t,e,r){var i=t.entry;for(t.entry=null;i;){var n=i.callback;e.pendingcb--,n(r),i=i.next}e.corkedRequestsFree.next=t}a(CA,"onCorkedFinish");Object.defineProperty(ge.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._writableState===void 0?!1:this._writableState.destroyed},"get"),set:a(function(e){this._writableState&&(this._writableState.destroyed=e)},"set")});ge.prototype.destroy=ih.destroy;ge.prototype._undestroy=ih.undestroy;ge.prototype._destroy=function(t,e){e(t)}});var Cr=T((d6,Ig)=>{"use strict";var NA=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};Ig.exports=Kt;var Ag=Ka(),oh=Wa();Gt()(Kt,Ag);for(nh=NA(oh.prototype),Va=0;Va<nh.length;Va++)Ga=nh[Va],Kt.prototype[Ga]||(Kt.prototype[Ga]=oh.prototype[Ga]);var nh,Ga,Va;function Kt(t){if(!(this instanceof Kt))return new Kt(t);Ag.call(this,t),oh.call(this,t),this.allowHalfOpen=!0,t&&(t.readable===!1&&(this.readable=!1),t.writable===!1&&(this.writable=!1),t.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",BA)))}a(Kt,"Duplex");Object.defineProperty(Kt.prototype,"writableHighWaterMark",{enumerable:!1,get:a(function(){return this._writableState.highWaterMark},"get")});Object.defineProperty(Kt.prototype,"writableBuffer",{enumerable:!1,get:a(function(){return this._writableState&&this._writableState.getBuffer()},"get")});Object.defineProperty(Kt.prototype,"writableLength",{enumerable:!1,get:a(function(){return this._writableState.length},"get")});function BA(){this._writableState.ended||process.nextTick(LA,this)}a(BA,"onend");function LA(t){t.end()}a(LA,"onEndNT");Object.defineProperty(Kt.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},"get"),set:a(function(e){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=e,this._writableState.destroyed=e)},"set")})});var No=T((sh,Cg)=>{var Za=ni(),Zt=Za.Buffer;function Dg(t,e){for(var r in t)e[r]=t[r]}a(Dg,"copyProps");Zt.from&&Zt.alloc&&Zt.allocUnsafe&&Zt.allocUnsafeSlow?Cg.exports=Za:(Dg(Za,sh),sh.Buffer=ui);function ui(t,e,r){return Zt(t,e,r)}a(ui,"SafeBuffer");ui.prototype=Object.create(Zt.prototype);Dg(Zt,ui);ui.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return Zt(t,e,r)};ui.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var i=Zt(t);return e!==void 0?typeof r=="string"?i.fill(e,r):i.fill(e):i.fill(0),i};ui.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Zt(t)};ui.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return Za.SlowBuffer(t)}});var ch=T(Bg=>{"use strict";var lh=No().Buffer,Ng=lh.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 $A(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}}a($A,"_normalizeEncoding");function MA(t){var e=$A(t);if(typeof e!="string"&&(lh.isEncoding===Ng||!Ng(t)))throw new Error("Unknown encoding: "+t);return e||t}a(MA,"normalizeEncoding");Bg.StringDecoder=Bo;function Bo(t){this.encoding=MA(t);var e;switch(this.encoding){case"utf16le":this.text=WA,this.end=VA,e=4;break;case"utf8":this.fillLast=HA,e=4;break;case"base64":this.text=GA,this.end=KA,e=3;break;default:this.write=ZA,this.end=XA;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=lh.allocUnsafe(e)}a(Bo,"StringDecoder");Bo.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""};Bo.prototype.end=zA;Bo.prototype.text=qA;Bo.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 ah(t){return t<=127?0:t>>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}a(ah,"utf8CheckByte");function jA(t,e,r){var i=e.length-1;if(i<r)return 0;var n=ah(e[i]);return n>=0?(n>0&&(t.lastNeed=n-1),n):--i<r||n===-2?0:(n=ah(e[i]),n>=0?(n>0&&(t.lastNeed=n-2),n):--i<r||n===-2?0:(n=ah(e[i]),n>=0?(n>0&&(n===2?n=0:t.lastNeed=n-3),n):0))}a(jA,"utf8CheckIncomplete");function UA(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}a(UA,"utf8CheckExtraBytes");function HA(t){var e=this.lastTotal-this.lastNeed,r=UA(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}a(HA,"utf8FillLast");function qA(t,e){var r=jA(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var i=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,i),t.toString("utf8",e,i)}a(qA,"utf8Text");function zA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}a(zA,"utf8End");function WA(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var i=r.charCodeAt(r.length-1);if(i>=55296&&i<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}a(WA,"utf16Text");function VA(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}a(VA,"utf16End");function GA(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}a(GA,"base64Text");function KA(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}a(KA,"base64End");function ZA(t){return t.toString(this.encoding)}a(ZA,"simpleWrite");function XA(t){return t&&t.length?this.write(t):""}a(XA,"simpleEnd")});var Lo=T((g6,Mg)=>{"use strict";var Lg=fi().codes.ERR_STREAM_PREMATURE_CLOSE;function YA(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,i=new Array(r),n=0;n<r;n++)i[n]=arguments[n];t.apply(this,i)}}}a(YA,"once");function JA(){}a(JA,"noop");function QA(t){return t.setHeader&&typeof t.abort=="function"}a(QA,"isRequest");function $g(t,e,r){if(typeof e=="function")return $g(t,null,e);e||(e={}),r=YA(r||JA);var i=e.readable||e.readable!==!1&&t.readable,n=e.writable||e.writable!==!1&&t.writable,o=a(function(){t.writable||l()},"onlegacyfinish"),s=t._writableState&&t._writableState.finished,l=a(function(){n=!1,s=!0,i||r.call(t)},"onfinish"),f=t._readableState&&t._readableState.endEmitted,c=a(function(){i=!1,f=!0,n||r.call(t)},"onend"),u=a(function(m){r.call(t,m)},"onerror"),h=a(function(){var m;if(i&&!f)return(!t._readableState||!t._readableState.ended)&&(m=new Lg),r.call(t,m);if(n&&!s)return(!t._writableState||!t._writableState.ended)&&(m=new Lg),r.call(t,m)},"onclose"),d=a(function(){t.req.on("finish",l)},"onrequest");return QA(t)?(t.on("complete",l),t.on("abort",h),t.req?d():t.on("request",d)):n&&!t._writableState&&(t.on("end",o),t.on("close",o)),t.on("end",c),t.on("finish",l),e.error!==!1&&t.on("error",u),t.on("close",h),function(){t.removeListener("complete",l),t.removeListener("abort",h),t.removeListener("request",d),t.req&&t.req.removeListener("finish",l),t.removeListener("end",o),t.removeListener("close",o),t.removeListener("finish",l),t.removeListener("end",c),t.removeListener("error",u),t.removeListener("close",h)}}a($g,"eos");Mg.exports=$g});var Ug=T((v6,jg)=>{"use strict";var Xa;function Nr(t,e,r){return e=eI(e),e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}a(Nr,"_defineProperty");function eI(t){var e=tI(t,"string");return typeof e=="symbol"?e:String(e)}a(eI,"_toPropertyKey");function tI(t,e){if(typeof t!="object"||t===null)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(typeof i!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}a(tI,"_toPrimitive");var rI=Lo(),Br=Symbol("lastResolve"),hi=Symbol("lastReject"),$o=Symbol("error"),Ya=Symbol("ended"),di=Symbol("lastPromise"),fh=Symbol("handlePromise"),pi=Symbol("stream");function Lr(t,e){return{value:t,done:e}}a(Lr,"createIterResult");function iI(t){var e=t[Br];if(e!==null){var r=t[pi].read();r!==null&&(t[di]=null,t[Br]=null,t[hi]=null,e(Lr(r,!1)))}}a(iI,"readAndResolve");function nI(t){process.nextTick(iI,t)}a(nI,"onReadable");function oI(t,e){return function(r,i){t.then(function(){if(e[Ya]){r(Lr(void 0,!0));return}e[fh](r,i)},i)}}a(oI,"wrapForNext");var sI=Object.getPrototypeOf(function(){}),aI=Object.setPrototypeOf((Xa={get stream(){return this[pi]},next:a(function(){var e=this,r=this[$o];if(r!==null)return Promise.reject(r);if(this[Ya])return Promise.resolve(Lr(void 0,!0));if(this[pi].destroyed)return new Promise(function(s,l){process.nextTick(function(){e[$o]?l(e[$o]):s(Lr(void 0,!0))})});var i=this[di],n;if(i)n=new Promise(oI(i,this));else{var o=this[pi].read();if(o!==null)return Promise.resolve(Lr(o,!1));n=new Promise(this[fh])}return this[di]=n,n},"next")},Nr(Xa,Symbol.asyncIterator,function(){return this}),Nr(Xa,"return",a(function(){var e=this;return new Promise(function(r,i){e[pi].destroy(null,function(n){if(n){i(n);return}r(Lr(void 0,!0))})})},"_return")),Xa),sI),lI=a(function(e){var r,i=Object.create(aI,(r={},Nr(r,pi,{value:e,writable:!0}),Nr(r,Br,{value:null,writable:!0}),Nr(r,hi,{value:null,writable:!0}),Nr(r,$o,{value:null,writable:!0}),Nr(r,Ya,{value:e._readableState.endEmitted,writable:!0}),Nr(r,fh,{value:a(function(o,s){var l=i[pi].read();l?(i[di]=null,i[Br]=null,i[hi]=null,o(Lr(l,!1))):(i[Br]=o,i[hi]=s)},"value"),writable:!0}),r));return i[di]=null,rI(e,function(n){if(n&&n.code!=="ERR_STREAM_PREMATURE_CLOSE"){var o=i[hi];o!==null&&(i[di]=null,i[Br]=null,i[hi]=null,o(n)),i[$o]=n;return}var s=i[Br];s!==null&&(i[di]=null,i[Br]=null,i[hi]=null,s(Lr(void 0,!0))),i[Ya]=!0}),e.on("readable",nI.bind(null,i)),i},"createReadableStreamAsyncIterator");jg.exports=lI});var qg=T((F6,Hg)=>{Hg.exports=function(){throw new Error("Readable.from is not available in the browser")}});var Ka=T((S6,Qg)=>{"use strict";Qg.exports=ie;var wn;ie.ReadableState=Gg;var E6=Io().EventEmitter,Vg=a(function(e,r){return e.listeners(r).length},"EElistenerCount"),jo=Zu(),Ja=ni().Buffer,cI=(typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function fI(t){return Ja.from(t)}a(fI,"_uint8ArrayToBuffer");function uI(t){return Ja.isBuffer(t)||t instanceof cI}a(uI,"_isUint8Array");var uh=Xu(),K;uh&&uh.debuglog?K=uh.debuglog("stream"):K=a(function(){},"debug");var hI=wg(),gh=Qu(),dI=eh(),pI=dI.getHighWaterMark,Qa=fi().codes,mI=Qa.ERR_INVALID_ARG_TYPE,wI=Qa.ERR_STREAM_PUSH_AFTER_EOF,yI=Qa.ERR_METHOD_NOT_IMPLEMENTED,gI=Qa.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,yn,hh,dh;Gt()(ie,jo);var Mo=gh.errorOrDestroy,ph=["error","close","destroy","pause","resume"];function bI(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}a(bI,"prependListener");function Gg(t,e,r){wn=wn||Cr(),t=t||{},typeof r!="boolean"&&(r=e instanceof wn),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=pI(this,t,"readableHighWaterMark",r),this.buffer=new hI,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=t.emitClose!==!1,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(yn||(yn=ch().StringDecoder),this.decoder=new yn(t.encoding),this.encoding=t.encoding)}a(Gg,"ReadableState");function ie(t){if(wn=wn||Cr(),!(this instanceof ie))return new ie(t);var e=this instanceof wn;this._readableState=new Gg(t,this,e),this.readable=!0,t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy)),jo.call(this)}a(ie,"Readable");Object.defineProperty(ie.prototype,"destroyed",{enumerable:!1,get:a(function(){return this._readableState===void 0?!1:this._readableState.destroyed},"get"),set:a(function(e){this._readableState&&(this._readableState.destroyed=e)},"set")});ie.prototype.destroy=gh.destroy;ie.prototype._undestroy=gh.undestroy;ie.prototype._destroy=function(t,e){e(t)};ie.prototype.push=function(t,e){var r=this._readableState,i;return r.objectMode?i=!0:typeof t=="string"&&(e=e||r.defaultEncoding,e!==r.encoding&&(t=Ja.from(t,e),e=""),i=!0),Kg(this,t,e,!1,i)};ie.prototype.unshift=function(t){return Kg(this,t,null,!0,!1)};function Kg(t,e,r,i,n){K("readableAddChunk",e);var o=t._readableState;if(e===null)o.reading=!1,FI(t,o);else{var s;if(n||(s=vI(o,e)),s)Mo(t,s);else if(o.objectMode||e&&e.length>0)if(typeof e!="string"&&!o.objectMode&&Object.getPrototypeOf(e)!==Ja.prototype&&(e=fI(e)),i)o.endEmitted?Mo(t,new gI):mh(t,o,e,!0);else if(o.ended)Mo(t,new wI);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?mh(t,o,e,!1):yh(t,o)):mh(t,o,e,!1)}else i||(o.reading=!1,yh(t,o))}return!o.ended&&(o.length<o.highWaterMark||o.length===0)}a(Kg,"readableAddChunk");function mh(t,e,r,i){e.flowing&&e.length===0&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,i?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&el(t)),yh(t,e)}a(mh,"addChunk");function vI(t,e){var r;return!uI(e)&&typeof e!="string"&&e!==void 0&&!t.objectMode&&(r=new mI("chunk",["string","Buffer","Uint8Array"],e)),r}a(vI,"chunkInvalid");ie.prototype.isPaused=function(){return this._readableState.flowing===!1};ie.prototype.setEncoding=function(t){yn||(yn=ch().StringDecoder);var e=new yn(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";r!==null;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),i!==""&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var zg=1073741824;function _I(t){return t>=zg?t=zg:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}a(_I,"computeNewHighWaterMark");function Wg(t,e){return t<=0||e.length===0&&e.ended?0:e.objectMode?1:t!==t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=_I(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}a(Wg,"howMuchToRead");ie.prototype.read=function(t){K("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(t!==0&&(e.emittedReadable=!1),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return K("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?wh(this):el(this),null;if(t=Wg(t,e),t===0&&e.ended)return e.length===0&&wh(this),null;var i=e.needReadable;K("need readable",i),(e.length===0||e.length-t<e.highWaterMark)&&(i=!0,K("length less than watermark",i)),e.ended||e.reading?(i=!1,K("reading or ended",i)):i&&(K("do read"),e.reading=!0,e.sync=!0,e.length===0&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=Wg(r,e)));var n;return t>0?n=Yg(t,e):n=null,n===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&wh(this)),n!==null&&this.emit("data",n),n};function FI(t,e){if(K("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?el(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,Zg(t)))}}a(FI,"onEofChunk");function el(t){var e=t._readableState;K("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(K("emitReadable",e.flowing),e.emittedReadable=!0,process.nextTick(Zg,t))}a(el,"emitReadable");function Zg(t){var e=t._readableState;K("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,bh(t)}a(Zg,"emitReadable_");function yh(t,e){e.readingMore||(e.readingMore=!0,process.nextTick(EI,t,e))}a(yh,"maybeReadMore");function EI(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&e.length===0);){var r=e.length;if(K("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}a(EI,"maybeReadMore_");ie.prototype._read=function(t){Mo(this,new yI("_read()"))};ie.prototype.pipe=function(t,e){var r=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t);break}i.pipesCount+=1,K("pipe count=%d opts=%j",i.pipesCount,e);var n=(!e||e.end!==!1)&&t!==process.stdout&&t!==process.stderr,o=n?l:w;i.endEmitted?process.nextTick(o):r.once("end",o),t.on("unpipe",s);function s(y,v){K("onunpipe"),y===r&&v&&v.hasUnpiped===!1&&(v.hasUnpiped=!0,u())}a(s,"onunpipe");function l(){K("onend"),t.end()}a(l,"onend");var f=SI(r);t.on("drain",f);var c=!1;function u(){K("cleanup"),t.removeListener("close",p),t.removeListener("finish",m),t.removeListener("drain",f),t.removeListener("error",d),t.removeListener("unpipe",s),r.removeListener("end",l),r.removeListener("end",w),r.removeListener("data",h),c=!0,i.awaitDrain&&(!t._writableState||t._writableState.needDrain)&&f()}a(u,"cleanup"),r.on("data",h);function h(y){K("ondata");var v=t.write(y);K("dest.write",v),v===!1&&((i.pipesCount===1&&i.pipes===t||i.pipesCount>1&&Jg(i.pipes,t)!==-1)&&!c&&(K("false write response, pause",i.awaitDrain),i.awaitDrain++),r.pause())}a(h,"ondata");function d(y){K("onerror",y),w(),t.removeListener("error",d),Vg(t,"error")===0&&Mo(t,y)}a(d,"onerror"),bI(t,"error",d);function p(){t.removeListener("finish",m),w()}a(p,"onclose"),t.once("close",p);function m(){K("onfinish"),t.removeListener("close",p),w()}a(m,"onfinish"),t.once("finish",m);function w(){K("unpipe"),r.unpipe(t)}return a(w,"unpipe"),t.emit("pipe",r),i.flowing||(K("pipe resume"),r.resume()),t};function SI(t){return a(function(){var r=t._readableState;K("pipeOnDrain",r.awaitDrain),r.awaitDrain&&r.awaitDrain--,r.awaitDrain===0&&Vg(t,"data")&&(r.flowing=!0,bh(t))},"pipeOnDrainFunctionResult")}a(SI,"pipeOnDrain");ie.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(e.pipesCount===0)return this;if(e.pipesCount===1)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r),this);if(!t){var i=e.pipes,n=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var o=0;o<n;o++)i[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Jg(e.pipes,t);return s===-1?this:(e.pipes.splice(s,1),e.pipesCount-=1,e.pipesCount===1&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r),this)};ie.prototype.on=function(t,e){var r=jo.prototype.on.call(this,t,e),i=this._readableState;return t==="data"?(i.readableListening=this.listenerCount("readable")>0,i.flowing!==!1&&this.resume()):t==="readable"&&!i.endEmitted&&!i.readableListening&&(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,K("on readable",i.length,i.reading),i.length?el(this):i.reading||process.nextTick(xI,this)),r};ie.prototype.addListener=ie.prototype.on;ie.prototype.removeListener=function(t,e){var r=jo.prototype.removeListener.call(this,t,e);return t==="readable"&&process.nextTick(Xg,this),r};ie.prototype.removeAllListeners=function(t){var e=jo.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&process.nextTick(Xg,this),e};function Xg(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}a(Xg,"updateReadableListening");function xI(t){K("readable nexttick read 0"),t.read(0)}a(xI,"nReadingNextTick");ie.prototype.resume=function(){var t=this._readableState;return t.flowing||(K("resume"),t.flowing=!t.readableListening,TI(this,t)),t.paused=!1,this};function TI(t,e){e.resumeScheduled||(e.resumeScheduled=!0,process.nextTick(OI,t,e))}a(TI,"resume");function OI(t,e){K("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),bh(t),e.flowing&&!e.reading&&t.read(0)}a(OI,"resume_");ie.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.paused=!0,this};function bh(t){var e=t._readableState;for(K("flow",e.flowing);e.flowing&&t.read()!==null;);}a(bh,"flow");ie.prototype.wrap=function(t){var e=this,r=this._readableState,i=!1;t.on("end",function(){if(K("wrapped end"),r.decoder&&!r.ended){var s=r.decoder.end();s&&s.length&&e.push(s)}e.push(null)}),t.on("data",function(s){if(K("wrapped data"),r.decoder&&(s=r.decoder.write(s)),!(r.objectMode&&s==null)&&!(!r.objectMode&&(!s||!s.length))){var l=e.push(s);l||(i=!0,t.pause())}});for(var n in t)this[n]===void 0&&typeof t[n]=="function"&&(this[n]=a(function(l){return a(function(){return t[l].apply(t,arguments)},"methodWrapReturnFunction")},"methodWrap")(n));for(var o=0;o<ph.length;o++)t.on(ph[o],this.emit.bind(this,ph[o]));return this._read=function(s){K("wrapped _read",s),i&&(i=!1,t.resume())},this};typeof Symbol=="function"&&(ie.prototype[Symbol.asyncIterator]=function(){return hh===void 0&&(hh=Ug()),hh(this)});Object.defineProperty(ie.prototype,"readableHighWaterMark",{enumerable:!1,get:a(function(){return this._readableState.highWaterMark},"get")});Object.defineProperty(ie.prototype,"readableBuffer",{enumerable:!1,get:a(function(){return this._readableState&&this._readableState.buffer},"get")});Object.defineProperty(ie.prototype,"readableFlowing",{enumerable:!1,get:a(function(){return this._readableState.flowing},"get"),set:a(function(e){this._readableState&&(this._readableState.flowing=e)},"set")});ie._fromList=Yg;Object.defineProperty(ie.prototype,"readableLength",{enumerable:!1,get:a(function(){return this._readableState.length},"get")});function Yg(t,e){if(e.length===0)return null;var r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}a(Yg,"fromList");function wh(t){var e=t._readableState;K("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,process.nextTick(RI,e,t))}a(wh,"endReadable");function RI(t,e){if(K("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&t.length===0&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}a(RI,"endReadableNT");typeof Symbol=="function"&&(ie.from=function(t,e){return dh===void 0&&(dh=qg()),dh(ie,t,e)});function Jg(t,e){for(var r=0,i=t.length;r<i;r++)if(t[r]===e)return r;return-1}a(Jg,"indexOf")});var il=T((T6,tb)=>{"use strict";tb.exports=cr;var tl=fi().codes,kI=tl.ERR_METHOD_NOT_IMPLEMENTED,PI=tl.ERR_MULTIPLE_CALLBACK,AI=tl.ERR_TRANSFORM_ALREADY_TRANSFORMING,II=tl.ERR_TRANSFORM_WITH_LENGTH_0,rl=Cr();Gt()(cr,rl);function DI(t,e){var r=this._transformState;r.transforming=!1;var i=r.writecb;if(i===null)return this.emit("error",new PI);r.writechunk=null,r.writecb=null,e!=null&&this.push(e),i(t);var n=this._readableState;n.reading=!1,(n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}a(DI,"afterTransform");function cr(t){if(!(this instanceof cr))return new cr(t);rl.call(this,t),this._transformState={afterTransform:DI.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",CI)}a(cr,"Transform");function CI(){var t=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(e,r){eb(t,e,r)}):eb(this,null,null)}a(CI,"prefinish");cr.prototype.push=function(t,e){return this._transformState.needTransform=!1,rl.prototype.push.call(this,t,e)};cr.prototype._transform=function(t,e,r){r(new kI("_transform()"))};cr.prototype._write=function(t,e,r){var i=this._transformState;if(i.writecb=r,i.writechunk=t,i.writeencoding=e,!i.transforming){var n=this._readableState;(i.needTransform||n.needReadable||n.length<n.highWaterMark)&&this._read(n.highWaterMark)}};cr.prototype._read=function(t){var e=this._transformState;e.writechunk!==null&&!e.transforming?(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform)):e.needTransform=!0};cr.prototype._destroy=function(t,e){rl.prototype._destroy.call(this,t,function(r){e(r)})};function eb(t,e,r){if(e)return t.emit("error",e);if(r!=null&&t.push(r),t._writableState.length)throw new II;if(t._transformState.transforming)throw new AI;return t.push(null)}a(eb,"done")});var vh=T((R6,ib)=>{"use strict";ib.exports=Uo;var rb=il();Gt()(Uo,rb);function Uo(t){if(!(this instanceof Uo))return new Uo(t);rb.call(this,t)}a(Uo,"PassThrough");Uo.prototype._transform=function(t,e,r){r(null,t)}});var Fh=T((P6,ab)=>{"use strict";var _h;function NI(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}a(NI,"once");var sb=fi().codes,BI=sb.ERR_MISSING_ARGS,LI=sb.ERR_STREAM_DESTROYED;function nb(t){if(t)throw t}a(nb,"noop");function $I(t){return t.setHeader&&typeof t.abort=="function"}a($I,"isRequest");function MI(t,e,r,i){i=NI(i);var n=!1;t.on("close",function(){n=!0}),_h===void 0&&(_h=Lo()),_h(t,{readable:e,writable:r},function(s){if(s)return i(s);n=!0,i()});var o=!1;return function(s){if(!n&&!o){if(o=!0,$I(t))return t.abort();if(typeof t.destroy=="function")return t.destroy();i(s||new LI("pipe"))}}}a(MI,"destroyer");function ob(t){t()}a(ob,"call");function jI(t,e){return t.pipe(e)}a(jI,"pipe");function UI(t){return!t.length||typeof t[t.length-1]!="function"?nb:t.pop()}a(UI,"popCallback");function HI(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var i=UI(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new BI("streams");var n,o=e.map(function(s,l){var f=l<e.length-1,c=l>0;return MI(s,f,c,function(u){n||(n=u),u&&o.forEach(ob),!f&&(o.forEach(ob),i(n))})});return e.reduce(jI)}a(HI,"pipeline");ab.exports=HI});var cb=T((I6,lb)=>{lb.exports=yt;var Eh=Io().EventEmitter,qI=Gt();qI(yt,Eh);yt.Readable=Ka();yt.Writable=Wa();yt.Duplex=Cr();yt.Transform=il();yt.PassThrough=vh();yt.finished=Lo();yt.pipeline=Fh();yt.Stream=yt;function yt(){Eh.call(this)}a(yt,"Stream");yt.prototype.pipe=function(t,e){var r=this;function i(u){t.writable&&t.write(u)===!1&&r.pause&&r.pause()}a(i,"ondata"),r.on("data",i);function n(){r.readable&&r.resume&&r.resume()}a(n,"ondrain"),t.on("drain",n),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",s),r.on("close",l));var o=!1;function s(){o||(o=!0,t.end())}a(s,"onend");function l(){o||(o=!0,typeof t.destroy=="function"&&t.destroy())}a(l,"onclose");function f(u){if(c(),Eh.listenerCount(this,"error")===0)throw u}a(f,"onerror"),r.on("error",f),t.on("error",f);function c(){r.removeListener("data",i),t.removeListener("drain",n),r.removeListener("end",s),r.removeListener("close",l),r.removeListener("error",f),t.removeListener("error",f),r.removeListener("end",c),r.removeListener("close",c),t.removeListener("close",c)}return a(c,"cleanup"),r.on("end",c),r.on("close",c),t.on("close",c),t.emit("pipe",r),t}});var ub=T(gn=>{"use strict";Object.defineProperty(gn,"__esModule",{value:!0});gn.Writable=gn.Readable=void 0;var fb=cb();Object.defineProperty(gn,"Readable",{enumerable:!0,get:a(function(){return fb.Readable},"get")});Object.defineProperty(gn,"Writable",{enumerable:!0,get:a(function(){return fb.Writable},"get")})});var Sh=T(nl=>{"use strict";Object.defineProperty(nl,"__esModule",{value:!0});nl.EventEmitter=void 0;var zI=Io();Object.defineProperty(nl,"EventEmitter",{enumerable:!0,get:a(function(){return zI.EventEmitter},"get")})});var hb=T(ol=>{"use strict";Object.defineProperty(ol,"__esModule",{value:!0});ol.FileHandle=void 0;var He=Ir(),WI=Sh(),Th=class Th extends WI.EventEmitter{constructor(e,r){super(),this.refs=1,this.closePromise=null,this.position=0,this.readableWebStreamLocked=!1,this.fs=e,this.fd=r}getAsyncId(){return this.fd}appendFile(e,r){return(0,He.promisify)(this.fs,"appendFile")(this.fd,e,r)}chmod(e){return(0,He.promisify)(this.fs,"fchmod")(this.fd,e)}chown(e,r){return(0,He.promisify)(this.fs,"fchown")(this.fd,e,r)}close(){if(this.fd===-1)return Promise.resolve();if(this.closePromise)return this.closePromise;if(this.refs--,this.refs===0){let e=this.fd;this.fd=-1,this.closePromise=(0,He.promisify)(this.fs,"close")(e).finally(()=>{this.closePromise=null})}else this.closePromise=new Promise((e,r)=>{this.closeResolve=e,this.closeReject=r}).finally(()=>{this.closePromise=null,this.closeReject=void 0,this.closeResolve=void 0});return this.emit("close"),this.closePromise}datasync(){return(0,He.promisify)(this.fs,"fdatasync")(this.fd)}createReadStream(e){return this.fs.createReadStream("",{...e,fd:this})}createWriteStream(e){return this.fs.createWriteStream("",{...e,fd:this})}readableWebStream(e={}){let{type:r="bytes",autoClose:i=!1}=e,n=0;if(this.fd===-1)throw new Error("The FileHandle is closed");if(this.closePromise)throw new Error("The FileHandle is closing");if(this.readableWebStreamLocked)throw new Error("An error will be thrown if this method is called more than once or is called after the FileHandle is closed or closing.");this.readableWebStreamLocked=!0,this.ref();let o=a(()=>{this.readableWebStreamLocked=!1,this.unref(),i&&this.close().catch(()=>{})},"unlockAndCleanup");return new ReadableStream({type:r==="bytes"?"bytes":void 0,autoAllocateChunkSize:16384,pull:a(async s=>{try{let l=s.byobRequest?.view;if(!l){let c=new Uint8Array(16384),u=await this.read(c,0,c.length,n);if(u.bytesRead===0){s.close(),o();return}n+=u.bytesRead,s.enqueue(c.slice(0,u.bytesRead));return}let f=await this.read(l,l.byteOffset,l.byteLength,n);if(f.bytesRead===0){s.close(),o();return}n+=f.bytesRead,s.byobRequest.respond(f.bytesRead)}catch(l){s.error(l),o()}},"pull"),cancel:a(async()=>{o()},"cancel")})}async read(e,r,i,n){let o=n??this.position,s=await(0,He.promisify)(this.fs,"read",l=>({bytesRead:l,buffer:e}))(this.fd,e,r,i,o);return n==null&&(this.position+=s.bytesRead),s}readv(e,r){return(0,He.promisify)(this.fs,"readv",i=>({bytesRead:i,buffers:e}))(this.fd,e,r)}readFile(e){return(0,He.promisify)(this.fs,"readFile")(this.fd,e)}stat(e){return(0,He.promisify)(this.fs,"fstat")(this.fd,e)}sync(){return(0,He.promisify)(this.fs,"fsync")(this.fd)}truncate(e){return(0,He.promisify)(this.fs,"ftruncate")(this.fd,e)}utimes(e,r){return(0,He.promisify)(this.fs,"futimes")(this.fd,e,r)}async write(e,r,i,n){let o=typeof n!="number",s=o?this.position:n,l=await(0,He.promisify)(this.fs,"write",f=>({bytesWritten:f,buffer:e}))(this.fd,e,r,i,s);return o&&(this.position+=l.bytesWritten),l}writev(e,r){return(0,He.promisify)(this.fs,"writev",i=>({bytesWritten:i,buffers:e}))(this.fd,e,r)}writeFile(e,r){return(0,He.promisify)(this.fs,"writeFile")(this.fd,e,r)}async[Symbol.asyncDispose](){await this.close()}ref(){this.refs++}unref(){this.refs--,this.refs===0&&(this.fd=-1,this.closeResolve&&(0,He.promisify)(this.fs,"close")(this.fd).then(this.closeResolve,this.closeReject))}};a(Th,"FileHandle");var xh=Th;ol.FileHandle=xh});var db=T(sl=>{"use strict";Object.defineProperty(sl,"__esModule",{value:!0});sl.FsPromises=void 0;var ne=Ir(),VI=Pt(),kh=class kh{constructor(e,r,i={}){if(this.fs=e,this.path=r,this.options=i,this.eventQueue=[],this.resolveQueue=[],this.finished=!1,this.maxQueue=i.maxQueue||2048,this.overflow=i.overflow||"ignore",this.startWatching(),i.signal){if(i.signal.aborted){this.finish();return}i.signal.addEventListener("abort",()=>{this.finish()})}}startWatching(){try{this.watcher=this.fs.watch(this.path,this.options,(e,r)=>{this.enqueueEvent({eventType:e,filename:r})})}catch(e){throw this.finish(),e}}enqueueEvent(e){if(!this.finished){if(this.eventQueue.length>=this.maxQueue)if(this.overflow==="throw"){let r=new Error(`Watch queue overflow: more than ${this.maxQueue} events queued`);this.finish(r);return}else this.eventQueue.shift(),console.warn(`Watch queue overflow: dropping event due to exceeding maxQueue of ${this.maxQueue}`);if(this.eventQueue.push(e),this.resolveQueue.length>0){let{resolve:r}=this.resolveQueue.shift(),i=this.eventQueue.shift();r({value:i,done:!1})}}}finish(e){if(!this.finished)for(this.finished=!0,this.watcher&&(this.watcher.close(),this.watcher=null);this.resolveQueue.length>0;){let{resolve:r,reject:i}=this.resolveQueue.shift();e?i(e):r({value:void 0,done:!0})}}async next(){return this.finished?{value:void 0,done:!0}:this.eventQueue.length>0?{value:this.eventQueue.shift(),done:!1}:new Promise((e,r)=>{this.resolveQueue.push({resolve:e,reject:r})})}async return(){return this.finish(),{value:void 0,done:!0}}async throw(e){throw this.finish(e),e}[Symbol.asyncIterator](){return this}};a(kh,"FSWatchAsyncIterator");var Oh=kh,Ph=class Ph{constructor(e,r){this.fs=e,this.FileHandle=r,this.constants=VI.constants,this.cp=(0,ne.promisify)(this.fs,"cp"),this.opendir=(0,ne.promisify)(this.fs,"opendir"),this.statfs=(0,ne.promisify)(this.fs,"statfs"),this.lutimes=(0,ne.promisify)(this.fs,"lutimes"),this.glob=(0,ne.promisify)(this.fs,"glob"),this.access=(0,ne.promisify)(this.fs,"access"),this.chmod=(0,ne.promisify)(this.fs,"chmod"),this.chown=(0,ne.promisify)(this.fs,"chown"),this.copyFile=(0,ne.promisify)(this.fs,"copyFile"),this.lchmod=(0,ne.promisify)(this.fs,"lchmod"),this.lchown=(0,ne.promisify)(this.fs,"lchown"),this.link=(0,ne.promisify)(this.fs,"link"),this.lstat=(0,ne.promisify)(this.fs,"lstat"),this.mkdir=(0,ne.promisify)(this.fs,"mkdir"),this.mkdtemp=(0,ne.promisify)(this.fs,"mkdtemp"),this.readdir=(0,ne.promisify)(this.fs,"readdir"),this.readlink=(0,ne.promisify)(this.fs,"readlink"),this.realpath=(0,ne.promisify)(this.fs,"realpath"),this.rename=(0,ne.promisify)(this.fs,"rename"),this.rmdir=(0,ne.promisify)(this.fs,"rmdir"),this.rm=(0,ne.promisify)(this.fs,"rm"),this.stat=(0,ne.promisify)(this.fs,"stat"),this.symlink=(0,ne.promisify)(this.fs,"symlink"),this.truncate=(0,ne.promisify)(this.fs,"truncate"),this.unlink=(0,ne.promisify)(this.fs,"unlink"),this.utimes=(0,ne.promisify)(this.fs,"utimes"),this.readFile=(i,n)=>(0,ne.promisify)(this.fs,"readFile")(i instanceof this.FileHandle?i.fd:i,n),this.appendFile=(i,n,o)=>(0,ne.promisify)(this.fs,"appendFile")(i instanceof this.FileHandle?i.fd:i,n,o),this.open=(i,n="r",o)=>(0,ne.promisify)(this.fs,"open",s=>new this.FileHandle(this.fs,s))(i,n,o),this.writeFile=(i,n,o)=>((0,ne.isReadableStream)(n)?(0,ne.streamToBuffer)(n):Promise.resolve(n)).then(l=>(0,ne.promisify)(this.fs,"writeFile")(i instanceof this.FileHandle?i.fd:i,l,o)),this.watch=(i,n)=>{let o=typeof n=="string"?{encoding:n}:n||{};return new Oh(this.fs,i,o)}}};a(Ph,"FsPromises");var Rh=Ph;sl.FsPromises=Rh});var pb=T(al=>{"use strict";Object.defineProperty(al,"__esModule",{value:!0});al.printTree=void 0;var GI=a((t="",e)=>{let r="",i=e.length-1;for(;i>=0&&!e[i];i--);for(let n=0;n<=i;n++){let o=e[n];if(!o)continue;let s=n===i,l=o(t+(s?" ":"\u2502")+" "),f=l?s?"\u2514\u2500":"\u251C\u2500":"\u2502";r+=`
|
|
9
|
+
`+t+f+(l?" "+l:"")}return r},"printTree");al.printTree=GI});var mb=T(ll=>{"use strict";Object.defineProperty(ll,"__esModule",{value:!0});ll.printBinary=void 0;var KI=a((t="",e)=>{let r=e[0],i=e[1],n="";return r&&(n+=`
|
|
10
10
|
`+t+"\u2190 "+r(t+" ")),i&&(n+=`
|
|
11
|
-
`+t+"\u2192 "+i(t+" ")),n},"printBinary");ll.printBinary=
|
|
11
|
+
`+t+"\u2192 "+i(t+" ")),n},"printBinary");ll.printBinary=KI});var wb=T(cl=>{"use strict";Object.defineProperty(cl,"__esModule",{value:!0});cl.printJson=void 0;var ZI=a((t="",e,r=2)=>(JSON.stringify(e,null,r)||"nil").split(`
|
|
12
12
|
`).join(`
|
|
13
|
-
`+t),"printJson");cl.printJson=KI});var wb=T(Uo=>{"use strict";Object.defineProperty(Uo,"__esModule",{value:!0});var Ph=(Gf(),gm(Vf));Ph.__exportStar(db(),Uo);Ph.__exportStar(pb(),Uo);Ph.__exportStar(mb(),Uo)});var yb=T(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.newNotAllowedError=qe.newTypeMismatchError=qe.newNotFoundError=qe.assertCanWrite=qe.assertName=qe.basename=qe.ctx=void 0;var ZI=a((t={})=>({separator:"/",syncHandleAllowed:!1,mode:"read",...t}),"ctx");qe.ctx=ZI;var XI=a((t,e)=>{t[t.length-1]===e&&(t=t.slice(0,-1));let r=t.lastIndexOf(e);return r===-1?t:t.slice(r+1)},"basename");qe.basename=XI;var YI=/^(\.{1,2})$|^(.*([\/\\]).*)$/,JI=a((t,e,r)=>{if(!t||YI.test(t))throw new TypeError(`Failed to execute '${e}' on '${r}': Name is not allowed.`)},"assertName");qe.assertName=JI;var QI=a(t=>{if(t!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")},"assertCanWrite");qe.assertCanWrite=QI;var eD=a(()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError"),"newNotFoundError");qe.newNotFoundError=eD;var tD=a(()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError"),"newTypeMismatchError");qe.newTypeMismatchError=tD;var rD=a(()=>new DOMException("Permission not granted.","NotAllowedError"),"newNotAllowedError");qe.newNotAllowedError=rD});var gb=T(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});Ho.toTreeSync=void 0;var iD=wb(),nD=yb(),oD=a((t,e={})=>{let r=e.separator||"/",i=e.dir||r;i[i.length-1]!==r&&(i+=r);let n=e.tab||"",o=e.depth??10,s=" (...)";if(o>0){let f=t.readdirSync(i,{withFileTypes:!0});s=(0,iD.printTree)(n,f.map(c=>u=>c.isDirectory()?(0,Ho.toTreeSync)(t,{dir:i+c.name,depth:o-1,tab:u}):c.isSymbolicLink()?""+c.name+" \u2192 "+t.readlinkSync(i+c.name):""+c.name))}return(0,nD.basename)(i,r)+r+s},"toTreeSync");Ho.toTreeSync=oD});var _b=T(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getWriteFileOptions=j.writeFileDefaults=j.getRealpathOptsAndCb=j.getRealpathOptions=j.getStatfsOptsAndCb=j.getStatfsOptions=j.getStatOptsAndCb=j.getStatOptions=j.getAppendFileOptsAndCb=j.getAppendFileOpts=j.getOpendirOptsAndCb=j.getOpendirOptions=j.getReaddirOptsAndCb=j.getReaddirOptions=j.getReadFileOptions=j.getRmOptsAndCb=j.getRmdirOptions=j.getDefaultOptsAndCb=j.getDefaultOpts=j.optsDefaults=j.getMkdirOptions=void 0;j.getOptions=vb;j.optsGenerator=fr;j.optsAndCbGenerator=mi;var fl=Yi(),sD=fo(),Ah=Ir(),bb={mode:511,recursive:!1},aD=a(t=>typeof t=="number"?Object.assign({},bb,{mode:t}):Object.assign({},bb,t),"getMkdirOptions");j.getMkdirOptions=aD;var lD=a(t=>`Expected options to be either an object or a string, but got ${t} instead`,"ERRSTR_OPTS");function vb(t,e){let r;if(e){let i=typeof e;switch(i){case"string":r=Object.assign({},t,{encoding:e});break;case"object":r=Object.assign({},t,e);break;default:throw TypeError(lD(i))}}else return t;return r.encoding!=="buffer"&&(0,sD.assertEncoding)(r.encoding),r}a(vb,"getOptions");function fr(t){return e=>vb(t,e)}a(fr,"optsGenerator");function mi(t){return(e,r)=>typeof e=="function"?[t(),e]:[t(e),(0,Ah.validateCallback)(r)]}a(mi,"optsAndCbGenerator");j.optsDefaults={encoding:"utf8"};j.getDefaultOpts=fr(j.optsDefaults);j.getDefaultOptsAndCb=mi(j.getDefaultOpts);var cD={recursive:!1},fD=a(t=>Object.assign({},cD,t),"getRmdirOptions");j.getRmdirOptions=fD;var uD=fr(j.optsDefaults);j.getRmOptsAndCb=mi(uD);var hD={flag:"r"};j.getReadFileOptions=fr(hD);var dD={encoding:"utf8",recursive:!1,withFileTypes:!1};j.getReaddirOptions=fr(dD);j.getReaddirOptsAndCb=mi(j.getReaddirOptions);var pD={encoding:"utf8",bufferSize:32,recursive:!1};j.getOpendirOptions=fr(pD);j.getOpendirOptsAndCb=mi(j.getOpendirOptions);var mD={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.a]};j.getAppendFileOpts=fr(mD);j.getAppendFileOptsAndCb=mi(j.getAppendFileOpts);var wD={bigint:!1},yD=a((t={})=>Object.assign({},wD,t),"getStatOptions");j.getStatOptions=yD;var gD=a((t,e)=>typeof t=="function"?[(0,j.getStatOptions)(),t]:[(0,j.getStatOptions)(t),(0,Ah.validateCallback)(e)],"getStatOptsAndCb");j.getStatOptsAndCb=gD;var bD={bigint:!1},vD=a((t={})=>Object.assign({},bD,t),"getStatfsOptions");j.getStatfsOptions=vD;var _D=a((t,e)=>typeof t=="function"?[(0,j.getStatfsOptions)(),t]:[(0,j.getStatfsOptions)(t),(0,Ah.validateCallback)(e)],"getStatfsOptsAndCb");j.getStatfsOptsAndCb=_D;var FD=j.optsDefaults;j.getRealpathOptions=fr(FD);j.getRealpathOptsAndCb=mi(j.getRealpathOptions);j.writeFileDefaults={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.w]};j.getWriteFileOptions=fr(j.writeFileDefaults)});var Eb=T(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.Dir=void 0;var Fb=Ir(),ED=Ys(),wi=co(),Dh=class Dh{constructor(e,r){this.link=e,this.options=r,this.iteratorInfo=[],this.closed=!1,this.operationQueue=null,this.path=e.getPath(),this.iteratorInfo.push(e.children[Symbol.iterator]())}closeBase(){}readBase(e){let r,i,n,o;do{do if({done:r,value:i}=e[e.length-1].next(),!r)[n,o]=i;else break;while(n==="."||n==="..");if(r){if(e.pop(),e.length===0)break;r=!1}else return this.options.recursive&&o.children.size&&e.push(o.children[Symbol.iterator]()),ED.default.build(o,this.options.encoding)}while(!r);return null}close(e){if(e===void 0)return this.closed?Promise.reject(new wi.Error("ERR_DIR_CLOSED")):new Promise((r,i)=>{this.close(n=>{n?i(n):r()})});if((0,Fb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.close(e)});return}this.closed=!0;try{this.closeBase(),process.nextTick(e)}catch(r){process.nextTick(e,r)}}closeSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");this.closed=!0,this.closeBase()}read(e){if(e===void 0)return new Promise((r,i)=>{this.read((n,o)=>{n?i(n):r(o??null)})});if((0,Fb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.read(e)});return}this.operationQueue=[];try{let r=this.readBase(this.iteratorInfo);process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(null,r)})}catch(r){process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(r)})}}readSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");return this.readBase(this.iteratorInfo)}[Symbol.asyncIterator](){return{next:a(async()=>{try{let e=await this.read();return e!==null?{done:!1,value:e}:{done:!0,value:void 0}}catch(e){throw e}},"next"),[Symbol.asyncIterator](){return this}}}};a(Dh,"Dir");var Ih=Dh;ul.Dir=Ih});var Sb=T(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.toMatcher=ur.toRegex=void 0;var SD=a(t=>/[.^$+{}()|\\]/.test(t)?`\\${t}`:t,"escapeRe"),xD=a((t,e,r,i)=>{let n=e,o=[],s="",l=1;for(;n<t.length&&l>0;){let u=t[n];if(u==="(")l++,s+=u,n++;else if(u===")")if(l--,l===0){o.push(s),n++;break}else s+=u,n++;else u==="|"&&l===1?(o.push(s),s="",n++):(s+=u,n++)}if(l!==0)return;let f="",c=o.length;for(let u=0;u<c;u++)f+=(f?"|":"")+(0,ur.toRegex)(o[u],i).source.replace(/^\^/,"").replace(/\$$/,"");switch(r){case"?":return[`(?:${f})?`,n];case"*":return[`(?:${f})*`,n];case"+":return[`(?:${f})+`,n];case"@":return[`(?:${f})`,n];case"!":return[`(?!${f})[^/]*`,n]}},"parseExtGlob"),TD=a((t,e)=>{let r="",i=0,n=a(()=>{i++;let l=[],f="",c=!1;for(;i<t.length;){let h=t[i];if(h==="}"){l.push(f),i++,c=!0;break}if(h===","){l.push(f),f="",i++;continue}f+=h,i++}return c?`(?:${l.map(h=>(0,ur.toRegex)(h,e).source.replace(/^\^/,"").replace(/\$$/,"")).join("|")})`:"\\{"+SD(f)},"parseBraceGroup"),o=!!e?.extglob;for(;i<t.length;){let l=t[i];if(o&&t[i+1]==="("&&(l==="?"||l==="*"||l==="+"||l==="@"||l==="!")){let f=xD(t,i+2,l,e);if(f){r+=f[0],i=f[1];continue}}switch(l){case"*":{if(t[i+1]==="*"){let f=i+2;for(;t[f]==="*";)f++;t[f]==="/"?(r+="(?:.*/)?",i=f+1):(r+=".*",i=f)}else r+="[^/]*",i++;break}case"?":r+="[^/]",i++;break;case"[":{let f="[";for(i++,i<t.length&&t[i]==="!"&&(f+="^",i++),i<t.length&&t[i]==="]"&&(f+="]",i++);i<t.length&&t[i]!=="]";){let c=t[i];f+=c==="\\"?"\\\\":c,i++}if(i<t.length&&t[i]==="]")f+="]",i++;else{r+="\\[";continue}r+=f;break}case"{":{r+=n();break}case"/":r+="/",i++;break;case".":case"^":case"$":case"+":case"(":case")":case"|":case"\\":r+=`\\${l}`,i++;break;default:r+=l,i++;break}}let s=e?.nocase?"i":"";return new RegExp("^"+r+"$",s)},"toRegex");ur.toRegex=TD;var OD=/^\/(.{1,4096})\/([gimsuy]{0,6})$/,RD=a((t,e)=>{let r=[],i=Array.isArray(t)?t:[t];for(let n of i)if(typeof n=="string"){let o=OD.exec(n);if(o){let[,s,l]=o;r.push(new RegExp(s,l))}else r.push((0,ur.toRegex)(n,e))}else r.push(n);return r.length?new Function("p","return "+r.map(n=>n+".test(p)").join("||")):()=>!1},"toMatcher");ur.toMatcher=RD});var Ob=T(Nh=>{"use strict";Object.defineProperty(Nh,"__esModule",{value:!0});Nh.globSync=CD;var yi=Gi(),kD=Sb(),xb=Ir(),PD=yi.posix.join,AD=yi.posix.relative,ID=yi.posix.resolve;function Tb(t,e){return(0,kD.toRegex)(e).test(t)}a(Tb,"matchesPattern");function DD(t,e){return e?typeof e=="function"?e(t):(Array.isArray(e)?e:[e]).some(i=>Tb(t,i)):!1}a(DD,"isExcluded");function Ch(t,e,r,i,n=0){let o=[],s=i.maxdepth??1/0,l=i.cwd?(0,xb.pathToFilename)(i.cwd):process.cwd();if(n>s)return o;try{let f=t.readdirSync(e,{withFileTypes:!0});for(let c of f){let u=PD(e,c.name.toString()),h=AD(l,u);if(DD(h,i.exclude))continue;if(r.some(p=>Tb(h,p))&&o.push(h),c.isDirectory()&&n<s){let p=Ch(t,u,r,i,n+1);o.push(...p)}}}catch{}return o}a(Ch,"walkDirectory");function CD(t,e,r={}){let i=r.cwd?(0,xb.pathToFilename)(r.cwd):process.cwd(),n=ID(i),o={cwd:n,exclude:r.exclude,maxdepth:r.maxdepth,withFileTypes:r.withFileTypes||!1},s=[];if(yi.posix.isAbsolute(e)){let l=yi.posix.dirname(e),f=yi.posix.basename(e),c=Ch(t,l,[f],{...o,cwd:l});s.push(...c.map(u=>yi.posix.resolve(l,u)))}else{let l=Ch(t,n,[e],o);s.push(...l)}return s=[...new Set(s)].sort(),s}a(CD,"globSync")});var Cb=T(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.FSWatcher=st.StatWatcher=st.Volume=void 0;st.pathToSteps=YD;st.dataToStr=JD;st.toUnixTimestamp=ot;var xe=Gi(),Mh=X0(),Bh=xf(),ND=Ys(),BD=Y0(),_n=Or(),wl=lu(),LD=J0(),yl=fb(),$D=Pt(),Ab=Eh(),gi=fo(),MD=ub(),Ib=Lf(),jD=hb(),UD=gb(),dl=Yi(),HD=co(),te=_b(),I=Ir(),qD=Eb(),Le=ya(),zD=xe.resolve,{O_SYMLINK:Rb,F_OK:Lh,R_OK:WD,W_OK:VD,X_OK:GD,COPYFILE_EXCL:KD,COPYFILE_FICLONE_FORCE:ZD}=$D.constants,o4=xe.posix?xe.posix.sep:xe.sep,hl=xe.posix?xe.posix.relative:xe.relative,$h=xe.posix?xe.posix.join:xe.join,kb=xe.posix?xe.posix.dirname:xe.dirname,Pb=xe.posix?xe.posix.normalize:xe.normalize,XD=128;function YD(t){return(0,Le.filenameToSteps)((0,I.pathToFilename)(t))}a(YD,"pathToSteps");function JD(t,e=gi.ENCODING_UTF8){return _n.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?(0,_n.bufferFrom)(t).toString(e):String(t)}a(JD,"dataToStr");function ot(t){if(typeof t=="string"&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return t<0?Date.now()/1e3:t;throw new Error("Cannot parse time: "+t)}a(ot,"toUnixTimestamp");function bn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.UID)}a(bn,"validateUid");function vn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.GID)}a(vn,"validateGid");var jh=class jh{get promises(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi}constructor(e=new Mh.Superblock){this._core=e,this.promisesApi=new jD.FsPromises(this,MD.FileHandle),this.openSync=(f,c,u=438)=>{let h=(0,I.modeToNumber)(u),d=(0,I.pathToFilename)(f),p=(0,I.flagsToNumber)(c);return this._core.open(d,p,h,!(p&Rb))},this.open=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&(d=438,p=u),d=d||438;let m=(0,I.modeToNumber)(d),w=(0,I.pathToFilename)(f),y=(0,I.flagsToNumber)(c);this.wrapAsync(this._core.open,[w,y,m,!(y&Rb)],p)},this.closeSync=f=>{this._core.close(f)},this.close=(f,c)=>{(0,Le.validateFd)(f);let u=this._core.getFileByFdOrThrow(f,"close");this.wrapAsync(this._core.close,[u.fd],c)},this.readSync=(f,c,u,h,d)=>((0,Le.validateFd)(f),this._core.read(f,c,u,h,d)),this.read=(f,c,u,h,d,p)=>{if((0,I.validateCallback)(p),h===0)return(0,wl.default)(()=>{p&&p(null,0,c)});Promise.resolve().then(()=>{try{let m=this._core.read(f,c,u,h,d);p(null,m,c)}catch(m){p(m)}})},this.readv=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this._core.readv(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.readvSync=(f,c,u)=>((0,Le.validateFd)(f),this._core.readv(f,c,u??null)),this._readfile=(f,c,u)=>{let h,p=typeof f=="number"&&(0,Le.isFd)(f),m;if(p)m=f;else{let w=(0,I.pathToFilename)(f),y=String(f),v=y.length>1&&y.endsWith("/"),g=this._core.getResolvedLinkOrThrow(w,"open"),F=g.getNode();if(F.isDirectory())throw(0,I.createError)("EISDIR","open",g.getPath());if(v&&F.isFile())throw(0,I.createError)("ENOTDIR","open",y);m=this.openSync(f,c)}try{h=(0,I.bufferToEncoding)(this._core.getFileByFdOrThrow(m).getBuffer(),u)}finally{p||this.closeSync(m)}return h},this.readFileSync=(f,c)=>{let u=(0,te.getReadFileOptions)(c),h=(0,I.flagsToNumber)(u.flag);return this._readfile(f,h,u.encoding)},this.readFile=(f,c,u)=>{let[h,d]=(0,te.optsAndCbGenerator)(te.getReadFileOptions)(c,u),p=(0,I.flagsToNumber)(h.flag);this.wrapAsync(this._readfile,[f,p,h.encoding],d)},this.writeSync=(f,c,u,h,d)=>{let[,p,m,w,y]=(0,I.getWriteSyncArgs)(f,c,u,h,d);return this._write(f,p,m,w,y)},this.write=(f,c,u,h,d,p)=>{let[,m,w,y,v,g,F]=(0,I.getWriteArgs)(f,c,u,h,d,p);Promise.resolve().then(()=>{try{let O=this._write(f,w,y,v,g);m?F(null,O,c):F(null,O,w)}catch(O){F(O)}})},this.writev=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this.writevBase(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.writevSync=(f,c,u)=>((0,Le.validateFd)(f),this.writevBase(f,c,u??null)),this.writeFileSync=(f,c,u)=>{let h=(0,te.getWriteFileOptions)(u),d=(0,I.flagsToNumber)(h.flag),p=(0,I.modeToNumber)(h.mode),m=(0,Le.dataToBuffer)(c,h.encoding);this._core.writeFile(f,m,d,p)},this.writeFile=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[te.writeFileDefaults,u]);let m=(0,I.validateCallback)(p),w=(0,te.getWriteFileOptions)(d),y=(0,I.flagsToNumber)(w.flag),v=(0,I.modeToNumber)(w.mode),g=(0,Le.dataToBuffer)(c,w.encoding);this.wrapAsync(this._core.writeFile,[f,g,y,v],m)},this.copyFileSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);return this._copyFile(h,d,(u||0)|0)},this.copyFile=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[0,u]:[m,w]=[u,h],(0,I.validateCallback)(w),this.wrapAsync(this._copyFile,[d,p,m],w)},this._cp=(f,c,u)=>{if(u.filter&&!u.filter(f,c))return;let h=u.dereference?this.statSync(f):this.lstatSync(f),d=null;try{d=this.lstatSync(c)}catch(p){if(p.code!=="ENOENT")throw p}if(d&&h.ino===d.ino&&h.dev===d.dev)throw(0,I.createError)("EINVAL","cp",f,c);if(d){if(h.isDirectory()&&!d.isDirectory())throw(0,I.createError)("EISDIR","cp",f,c);if(!h.isDirectory()&&d.isDirectory())throw(0,I.createError)("ENOTDIR","cp",f,c)}if(h.isDirectory()&&this.isSrcSubdir(f,c))throw(0,I.createError)("EINVAL","cp",f,c);{let p=kb(c);this.existsSync(p)||this.mkdirSync(p,{recursive:!0})}if(h.isDirectory()){if(!u.recursive)throw(0,I.createError)("EISDIR","cp",f);this.cpDirSync(h,d,f,c,u)}else if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())this.cpFileSync(h,d,f,c,u);else if(h.isSymbolicLink()&&!u.dereference)this.cpSymlinkSync(d,f,c,u);else throw(0,I.createError)("EINVAL","cp",f)},this.linkSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.link(u,h)},this.link=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.link,[h,d],u)},this.unlinkSync=f=>{let c=(0,I.pathToFilename)(f);this._core.unlink(c)},this.unlink=(f,c)=>{let u=(0,I.pathToFilename)(f);this.wrapAsync(this._core.unlink,[u],c)},this.symlinkSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this._core.symlink(h,d)},this.symlink=(f,c,u,h)=>{let d=(0,I.validateCallback)(typeof u=="function"?u:h),p=(0,I.pathToFilename)(f),m=(0,I.pathToFilename)(c);this.wrapAsync(this._core.symlink,[p,m],d)},this._lstat=(f,c=!1,u=!1)=>{let h;try{h=this._core.getLinkOrThrow(f,"lstat")}catch(d){if(d.code==="ENOENT"&&!u)return;throw d}return Bh.default.build(h.getNode(),c)},this.lstatSync=(f,c)=>{let{throwIfNoEntry:u=!0,bigint:h=!1}=(0,te.getStatOptions)(c);return this._lstat((0,I.pathToFilename)(f),h,u)},this.renameSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.rename(u,h)},this.rename=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.rename,[h,d],u)},this.existsSync=f=>{try{return this._exists((0,I.pathToFilename)(f))}catch{return!1}},this.exists=(f,c)=>{let u=(0,I.pathToFilename)(f);if(typeof c!="function")throw Error(dl.ERRSTR.CB);Promise.resolve().then(()=>{try{c(this._exists(u))}catch{c(!1)}})},this.accessSync=(f,c=Lh)=>{let u=(0,I.pathToFilename)(f);c=c|0,this._access(u,c)},this.access=(f,c,u)=>{let h=Lh,d;typeof c!="function"?[h,d]=[c|0,(0,I.validateCallback)(u)]:d=c;let p=(0,I.pathToFilename)(f);this.wrapAsync(this._access,[p,h],d)},this.appendFileSync=(f,c,u)=>{let h=(0,te.getAppendFileOpts)(u);(!h.flag||(0,Le.isFd)(f))&&(h.flag="a"),this.writeFileSync(f,c,h)},this.appendFile=(f,c,u,h)=>{let[d,p]=(0,te.getAppendFileOptsAndCb)(u,h);(!d.flag||(0,Le.isFd)(f))&&(d.flag="a"),this.writeFile(f,c,d,p)},this._readdir=(f,c)=>{let u=(0,Le.filenameToSteps)(f),h=this._core.getResolvedLinkOrThrow(f,"scandir"),d=h.getNode();if(!d.isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);if(!d.canRead())throw(0,I.createError)("EACCES","scandir",f);let p=[];for(let w of h.children.keys()){let y=h.getChild(w);if(!(!y||w==="."||w==="..")&&(p.push(ND.default.build(y,c.encoding)),c.recursive&&y.children.size)){let v={...c,recursive:!0,withFileTypes:!0},g=this._readdir(y.getPath(),v);p.push(...g)}}if(!Le.isWin&&c.encoding!=="buffer"&&p.sort((w,y)=>w.name<y.name?-1:w.name>y.name?1:0),c.withFileTypes)return p;let m=f;return Le.isWin&&(m=m.replace(/\\/g,"/")),p.map(w=>{if(c.recursive){let y=$h(w.parentPath,w.name.toString());return Le.isWin&&(y=y.replace(/\\/g,"/")),y.replace(m+xe.posix.sep,"")}return w.name})},this.readdirSync=(f,c)=>{let u=(0,te.getReaddirOptions)(c),h=(0,I.pathToFilename)(f);return this._readdir(h,u)},this.readdir=(f,c,u)=>{let[h,d]=(0,te.getReaddirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readdir,[p,h],d)},this._readlink=(f,c)=>{let h=this._core.getLinkOrThrow(f,"readlink").getNode();if(!h.isSymlink())throw(0,I.createError)("EINVAL","readlink",f);return(0,gi.strToEncoding)(h.symlink,c)},this.readlinkSync=(f,c)=>{let u=(0,te.getDefaultOpts)(c),h=(0,I.pathToFilename)(f);return this._readlink(h,u.encoding)},this.readlink=(f,c,u)=>{let[h,d]=(0,te.getDefaultOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readlink,[p,h.encoding],d)},this._fsync=f=>{this._core.getFileByFdOrThrow(f,"fsync")},this.fsyncSync=f=>{this._fsync(f)},this.fsync=(f,c)=>{this.wrapAsync(this._fsync,[f],c)},this._fdatasync=f=>{this._core.getFileByFdOrThrow(f,"fdatasync")},this.fdatasyncSync=f=>{this._fdatasync(f)},this.fdatasync=(f,c)=>{this.wrapAsync(this._fdatasync,[f],c)},this._ftruncate=(f,c)=>{this._core.getFileByFdOrThrow(f,"ftruncate").truncate(c)},this.ftruncateSync=(f,c)=>{this._ftruncate(f,c)},this.ftruncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);this.wrapAsync(this._ftruncate,[f,h],d)},this._truncate=(f,c)=>{let u=this.openSync(f,"r+");try{this.ftruncateSync(u,c)}finally{this.closeSync(u)}},this.truncateSync=(f,c)=>{if((0,Le.isFd)(f))return this.ftruncateSync(f,c);this._truncate(f,c)},this.truncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);if((0,Le.isFd)(f))return this.ftruncate(f,h,d);this.wrapAsync(this._truncate,[f,h],d)},this._futimes=(f,c,u)=>{let d=this._core.getFileByFdOrThrow(f,"futimes").node;d.atime=new Date(c*1e3),d.mtime=new Date(u*1e3)},this.futimesSync=(f,c,u)=>{this._futimes(f,ot(c),ot(u))},this.futimes=(f,c,u,h)=>{this.wrapAsync(this._futimes,[f,ot(c),ot(u)],h)},this._utimes=(f,c,u,h=!0)=>{let d=this._core,m=(h?d.getResolvedLinkOrThrow(f,"utimes"):d.getLinkOrThrow(f,"lutimes")).getNode();m.atime=new Date(c*1e3),m.mtime=new Date(u*1e3)},this.utimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!0)},this.utimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!0],h)},this.lutimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!1)},this.lutimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!1],h)},this.mkdirSync=(f,c)=>{let u=(0,te.getMkdirOptions)(c),h=(0,I.modeToNumber)(u.mode,511),d=(0,I.pathToFilename)(f);if(u.recursive)return this._core.mkdirp(d,h);this._core.mkdir(d,h)},this.mkdir=(f,c,u)=>{let h=(0,te.getMkdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u),p=(0,I.modeToNumber)(h.mode,511),m=(0,I.pathToFilename)(f);h.recursive?this.wrapAsync(this._core.mkdirp,[m,p],d):this.wrapAsync(this._core.mkdir,[m,p],d)},this._mkdtemp=(f,c,u=5)=>{let h=f+(0,I.genRndStr6)();try{return this._core.mkdir(h,511),(0,gi.strToEncoding)(h,c)}catch(d){if(d.code==="EEXIST"){if(u>1)return this._mkdtemp(f,c,u-1);throw Error("Could not create temp dir.")}else throw d}},this.mkdtempSync=(f,c)=>{let{encoding:u}=(0,te.getDefaultOpts)(c);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");return(0,I.nullCheck)(f),this._mkdtemp(f,u)},this.mkdtemp=(f,c,u)=>{let[{encoding:h},d]=(0,te.getDefaultOptsAndCb)(c,u);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");(0,I.nullCheck)(f)&&this.wrapAsync(this._mkdtemp,[f,h],d)},this.rmdirSync=(f,c)=>{let u=(0,te.getRmdirOptions)(c);this._core.rmdir((0,I.pathToFilename)(f),u.recursive)},this.rmdir=(f,c,u)=>{let h=(0,te.getRmdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u);this.wrapAsync(this._core.rmdir,[(0,I.pathToFilename)(f),h.recursive],d)},this.rmSync=(f,c)=>{this._core.rm((0,I.pathToFilename)(f),c?.force,c?.recursive)},this.rm=(f,c,u)=>{let[h,d]=(0,te.getRmOptsAndCb)(c,u);this.wrapAsync(this._core.rm,[(0,I.pathToFilename)(f),h?.force,h?.recursive],d)},this._fchmod=(f,c)=>{this._core.getFileByFdOrThrow(f,"fchmod").chmod(c)},this.fchmodSync=(f,c)=>{this._fchmod(f,(0,I.modeToNumber)(c))},this.fchmod=(f,c,u)=>{this.wrapAsync(this._fchmod,[f,(0,I.modeToNumber)(c)],u)},this._chmod=(f,c,u=!0)=>{(u?this._core.getResolvedLinkOrThrow(f,"chmod"):this._core.getLinkOrThrow(f,"chmod")).getNode().chmod(c)},this.chmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._chmod(h,u,!0)},this.chmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._chmod,[d,h],u)},this._lchmod=(f,c)=>{this._chmod(f,c,!1)},this.lchmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._lchmod(h,u)},this.lchmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._lchmod,[d,h],u)},this._fchown=(f,c,u)=>{this._core.getFileByFdOrThrow(f,"fchown").chown(c,u)},this.fchownSync=(f,c,u)=>{bn(c),vn(u),this._fchown(f,c,u)},this.fchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._fchown,[f,c,u],h)},this._chown=(f,c,u)=>{this._core.getResolvedLinkOrThrow(f,"chown").getNode().chown(c,u)},this.chownSync=(f,c,u)=>{bn(c),vn(u),this._chown((0,I.pathToFilename)(f),c,u)},this.chown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._chown,[(0,I.pathToFilename)(f),c,u],h)},this._lchown=(f,c,u)=>{this._core.getLinkOrThrow(f,"lchown").getNode().chown(c,u)},this.lchownSync=(f,c,u)=>{bn(c),vn(u),this._lchown((0,I.pathToFilename)(f),c,u)},this.lchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._lchown,[(0,I.pathToFilename)(f),c,u],h)},this.statWatchers={},this.cpSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c),p={dereference:u?.dereference??!1,errorOnExist:u?.errorOnExist??!1,filter:u?.filter,force:u?.force??!0,mode:u?.mode??0,preserveTimestamps:u?.preserveTimestamps??!1,recursive:u?.recursive??!1,verbatimSymlinks:u?.verbatimSymlinks??!1};return this._cp(h,d,p)},this.cp=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[{},u]:[m,w]=[u||{},h],(0,I.validateCallback)(w);let y={dereference:m?.dereference??!1,errorOnExist:m?.errorOnExist??!1,filter:m?.filter,force:m?.force??!0,mode:m?.mode??0,preserveTimestamps:m?.preserveTimestamps??!1,recursive:m?.recursive??!1,verbatimSymlinks:m?.verbatimSymlinks??!1};this.wrapAsync(this._cp,[d,p,y],w)},this.openAsBlob=async(f,c)=>{let u=(0,I.pathToFilename)(f),h;try{h=this._core.getResolvedLinkOrThrow(u,"open")}catch(w){throw w&&typeof w=="object"&&w.code==="ENOENT"?new HD.TypeError("ERR_INVALID_ARG_VALUE"):w}let p=h.getNode().getBuffer(),m=c?.type||"";return new Blob([p],{type:m})},this.glob=(f,...c)=>{let[u,h]=c.length===1?[{},c[0]]:[c[0],c[1]];this.wrapAsync(this._globSync,[f,u||{}],h)},this.globSync=(f,c={})=>this._globSync(f,c),this._globSync=(f,c={})=>{let{globSync:u}=Ob();return u(this,f,c)},this._opendir=(f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"scandir");if(!u.getNode().isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);return new qD.Dir(u,c)},this.opendirSync=(f,c)=>{let u=(0,te.getOpendirOptions)(c),h=(0,I.pathToFilename)(f);return this._opendir(h,u)},this.opendir=(f,c,u)=>{let[h,d]=(0,te.getOpendirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._opendir,[p,h],d)};let r=this;this.StatWatcher=class extends pl{constructor(){super(r)}};let i=Xt;this.ReadStream=class extends i{constructor(...f){super(r,...f)}};let n=bt;this.WriteStream=class extends n{constructor(...f){super(r,...f)}},this.FSWatcher=class extends ml{constructor(){super(r)}};let o=a((f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"realpath");return(0,gi.strToEncoding)(u.getPath()||"/",c)},"_realpath"),s=a((f,c,u)=>{let[h,d]=(0,te.getRealpathOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);r.wrapAsync(o,[p,h.encoding],d)},"realpathImpl"),l=a((f,c)=>o((0,I.pathToFilename)(f),(0,te.getRealpathOptions)(c).encoding),"realpathSyncImpl");this.realpath=s,this.realpath.native=s,this.realpathSync=l,this.realpathSync.native=l}wrapAsync(e,r,i){(0,I.validateCallback)(i),Promise.resolve().then(()=>{let n;try{n=e.apply(this,r)}catch(o){i(o);return}i(null,n)})}toTree(e={separator:xe.sep}){return(0,UD.toTreeSync)(this,e)}reset(){this._core.reset()}toJSON(e,r={},i=!1,n=!1){return this._core.toJSON(e,r,i,n)}fromJSON(e,r){return this._core.fromJSON(e,r)}fromNestedJSON(e,r){return this._core.fromNestedJSON(e,r)}mountSync(e,r){this._core.fromJSON(r,e)}_write(e,r,i,n,o){let s=this._core.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,I.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}writevBase(e,r,i){let n=this._core.getFileByFdOrThrow(e),o=i??void 0;o===-1&&(o=void 0);let s=0;for(let l of r){let f=_n.Buffer.from(l.buffer,l.byteOffset,l.byteLength),c=n.write(f,0,f.byteLength,o);if(o=void 0,s+=c,c<f.byteLength)break}return s}_copyFile(e,r,i){let n=this.readFileSync(e);if(i&KD&&this.existsSync(r))throw(0,I.createError)("EEXIST","copyFile",e,r);if(i&ZD)throw(0,I.createError)("ENOSYS","copyFile",e,r);this._core.writeFile(r,n,dl.FLAGS.w,438)}isSrcSubdir(e,r){try{let i=Pb(e.startsWith("/")?e:"/"+e),n=Pb(r.startsWith("/")?r:"/"+r);if(i===n)return!0;let o=hl(i,n);return o===""||!o.startsWith("..")&&!(0,xe.isAbsolute)(o)}catch{return!1}}cpFileSync(e,r,i,n,o){if(r){if(o.errorOnExist)throw(0,I.createError)("EEXIST","cp",n);if(!o.force)return;this.unlinkSync(n)}this.copyFileSync(i,n,o.mode),o.preserveTimestamps&&this.utimesSync(n,e.atime,e.mtime),this.chmodSync(n,Number(e.mode))}cpDirSync(e,r,i,n,o){r||this.mkdirSync(n);let s=this.readdirSync(i);for(let l of s){let f=$h(i,String(l)),c=$h(n,String(l));o.filter&&!o.filter(f,c)||this._cp(f,c,o)}this.chmodSync(n,Number(e.mode))}cpSymlinkSync(e,r,i,n){let o=String(this.readlinkSync(r));!n.verbatimSymlinks&&!(0,xe.isAbsolute)(o)&&(o=zD(kb(r),o)),e&&this.unlinkSync(i),this.symlinkSync(o,i)}lstat(e,r,i){let[{throwIfNoEntry:n=!0,bigint:o=!1},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._lstat,[(0,I.pathToFilename)(e),o,n],s)}_stat(e,r=!1,i=!0){let n;try{n=this._core.getResolvedLinkOrThrow(e,"stat")}catch(o){if(o.code==="ENOENT"&&!i)return;throw o}return Bh.default.build(n.getNode(),r)}statSync(e,r){let{bigint:i=!0,throwIfNoEntry:n=!0}=(0,te.getStatOptions)(r);return this._stat((0,I.pathToFilename)(e),i,n)}stat(e,r,i){let[{bigint:n=!1,throwIfNoEntry:o=!0},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._stat,[(0,I.pathToFilename)(e),n,o],s)}fstatBase(e,r=!1){let i=this._core.getFileByFd(e);if(!i)throw(0,I.createError)("EBADF","fstat");return Bh.default.build(i.node,r)}fstatSync(e,r){return this.fstatBase(e,(0,te.getStatOptions)(r).bigint)}fstat(e,r,i){let[n,o]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this.fstatBase,[e,n.bigint],o)}_exists(e){return!!this._stat(e)}_access(e,r){let n=this._core.getLinkOrThrow(e,"access").getNode();if(r!==Lh&&(r&WD&&!n.canRead()||r&VD&&!n.canWrite()||r&GD&&!n.canExecute()))throw(0,I.createError)("EACCES","access",e)}watchFile(e,r,i){let n=(0,I.pathToFilename)(e),o=r,s=i;if(typeof o=="function"&&(s=r,o=null),typeof s!="function")throw Error('"watchFile()" requires a listener function');let l=5007,f=!0;o&&typeof o=="object"&&(typeof o.interval=="number"&&(l=o.interval),typeof o.persistent=="boolean"&&(f=o.persistent));let c=this.statWatchers[n];return c||(c=new this.StatWatcher,c.start(n,f,l),this.statWatchers[n]=c),c.addListener("change",s),c}unwatchFile(e,r){let i=(0,I.pathToFilename)(e),n=this.statWatchers[i];n&&(typeof r=="function"?n.removeListener("change",r):n.removeAllListeners("change"),n.listenerCount("change")===0&&(n.stop(),delete this.statWatchers[i]))}createReadStream(e,r){return new this.ReadStream(e,r)}createWriteStream(e,r){return new this.WriteStream(e,r)}watch(e,r,i){let n=(0,I.pathToFilename)(e),o=r;typeof r=="function"&&(i=r,o=null);let{persistent:s,recursive:l,encoding:f}=(0,te.getDefaultOpts)(o);s===void 0&&(s=!0),l===void 0&&(l=!1);let c=new this.FSWatcher;return c.start(n,s,l,f),i&&c.addListener("change",i),c}_statfs(e,r=!1){return this._core.getResolvedLinkOrThrow(e,"statfs"),BD.default.build(this._core,r)}statfsSync(e,r){let{bigint:i=!1}=(0,te.getStatfsOptions)(r);return this._statfs((0,I.pathToFilename)(e),i)}statfs(e,r,i){let[{bigint:n=!1},o]=(0,te.getStatfsOptsAndCb)(r,i);this.wrapAsync(this._statfs,[(0,I.pathToFilename)(e),n],o)}};a(jh,"Volume");var bi=jh;st.Volume=bi;bi.fromJSON=(t,e)=>new bi(Mh.Superblock.fromJSON(t,e));bi.fromNestedJSON=(t,e)=>new bi(Mh.Superblock.fromNestedJSON(t,e));function QD(t){t.emit("stop")}a(QD,"emitStop");var Uh=class Uh extends Ab.EventEmitter{constructor(e){super(),this.onInterval=()=>{try{let r=this.vol.statSync(this.filename);this.hasChanged(r)&&(this.emit("change",r,this.prev),this.prev=r)}finally{this.loop()}},this.vol=e}loop(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)}hasChanged(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink}start(e,r=!0,i=5007){this.filename=(0,I.pathToFilename)(e),this.setTimeout=r?setTimeout.bind(globalThis):LD.default,this.interval=i,this.prev=this.vol.statSync(this.filename),this.loop()}stop(){clearTimeout(this.timeoutRef),(0,wl.default)(()=>{QD.call(this,this)})}};a(Uh,"StatWatcher");var pl=Uh;st.StatWatcher=pl;var gt;function eC(t){gt=(0,_n.bufferAllocUnsafe)(t),gt.used=0}a(eC,"allocNewPool");(0,Ib.inherits)(Xt,yl.Readable);st.ReadStream=Xt;function Xt(t,e,r){if(!(this instanceof Xt))return new Xt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),r.highWaterMark===void 0&&(r.highWaterMark=64*1024),yl.Readable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}a(Xt,"FsReadStream");Xt.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(e,r)=>{if(e){t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e);return}t.fd=r,t.emit("open",r),t.read()})};Xt.prototype._read=function(t){if(typeof this.fd!="number")return this.once("open",function(){this._read(t)});if(this.destroyed)return;(!gt||gt.length-gt.used<XD)&&eC(this._readableState.highWaterMark);var e=gt,r=Math.min(gt.length-gt.used,t),i=gt.used;if(this.pos!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);var n=this;this._vol.read(this.fd,gt,gt.used,r,this.pos,o),this.pos!==void 0&&(this.pos+=r),gt.used+=r;function o(s,l){if(s)n.autoClose&&n.destroy&&n.destroy(),n.emit("error",s);else{var f=null;l>0&&(n.bytesRead+=l,f=e.slice(i,i+l)),n.push(f)}}a(o,"onread")};Xt.prototype._destroy=function(t,e){this.close(r=>{e(t||r)})};Xt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Db);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._readableState?.closed=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};function Db(t){this.close()}a(Db,"closeOnOpen");(0,Ib.inherits)(bt,yl.Writable);st.WriteStream=bt;function bt(t,e,r){if(!(this instanceof bt))return new bt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),yl.Writable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:!!r.autoClose,this.pos=void 0,this.bytesWritten=0,this.pending=!0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}a(bt,"FsWriteStream");bt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){if(t){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t);return}this.fd=e,this.pending=!1,this.emit("open",e)}.bind(this))};bt.prototype._write=function(t,e,r){if(!(t instanceof _n.Buffer||t instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(t,e,r)});var i=this;this._vol.write(this.fd,t,0,t.length,this.pos,(n,o)=>{if(n)return i.autoClose&&i.destroy&&i.destroy(),r(n);i.bytesWritten+=o,r()}),this.pos!==void 0&&(this.pos+=t.length)};bt.prototype._writev=function(t,e){if(typeof this.fd!="number")return this.once("open",function(){this._writev(t,e)});let r=this,i=t.length,n=new Array(i);for(var o=0,s=0;s<i;s++){var l=t[s].chunk;n[s]=l,o+=l.length}let f=_n.Buffer.concat(n);this._vol.write(this.fd,f,0,f.length,this.pos,(c,u)=>{if(c)return r.destroy&&r.destroy(),e(c);r.bytesWritten+=u,e()}),this.pos!==void 0&&(this.pos+=o)};bt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Db);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._writableState?.closed=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};bt.prototype._destroy=Xt.prototype._destroy;bt.prototype.destroySoon=bt.prototype.end;var Hh=class Hh extends Ab.EventEmitter{constructor(e){super(),this._filename="",this._filenameEncoded="",this._recursive=!1,this._encoding=gi.ENCODING_UTF8,this._listenerRemovers=new Map,this._onParentChild=r=>{r.getName()===this._getName()&&this._emit("rename")},this._emit=r=>{this.emit("change",r,this._filenameEncoded)},this._persist=()=>{this._timer=setTimeout(this._persist,1e6)},this._vol=e}_getName(){return this._steps[this._steps.length-1]}start(e,r=!0,i=!1,n=gi.ENCODING_UTF8){this._filename=(0,I.pathToFilename)(e),this._steps=(0,Le.filenameToSteps)(this._filename),this._filenameEncoded=(0,gi.strToEncoding)(this._filename),this._recursive=i,this._encoding=n;try{this._link=this._vol._core.getLinkOrThrow(this._filename,"FSWatcher")}catch(f){let c=new Error(`watch ${this._filename} ${f.code}`);throw c.code=f.code,c.errno=f.code,c}let o=a(f=>{let c=f.getPath(),u=f.getNode(),h=a(()=>{let m=hl(this._filename,c);return m||(m=this._getName()),this.emit("change","change",m)},"onNodeChange"),d=u.changes.listen(([m])=>{m==="modify"&&h()}),p=this._listenerRemovers.get(u.ino)??[];p.push(()=>d()),this._listenerRemovers.set(u.ino,p)},"watchLinkNodeChanged"),s=a(f=>{let c=f.getNode(),u=a(m=>{this.emit("change","rename",hl(this._filename,m.getPath())),o(m),s(m)},"onLinkChildAdd"),h=a(m=>{let w=a(y=>{let v=y.getNode().ino,g=this._listenerRemovers.get(v);g&&(g.forEach(F=>F()),this._listenerRemovers.delete(v));for(let[F,O]of y.children.entries())O&&F!=="."&&F!==".."&&w(O)},"removeLinkNodeListeners");w(m),this.emit("change","rename",hl(this._filename,m.getPath()))},"onLinkChildDelete");for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&o(w);let d=f.changes.listen(([m,w])=>{m==="child:add"?u(w):m==="child:del"&&h(w)});if((this._listenerRemovers.get(c.ino)??[]).push(()=>{d()}),i)for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&s(w)},"watchLinkChildrenChanged");o(this._link),s(this._link);let l=this._link.parent;l&&l.changes.listen(([f,c])=>{f==="child:del"&&this._onParentChild(c)}),r&&this._persist()}close(){clearTimeout(this._timer),this._listenerRemovers.forEach(e=>{e.forEach(r=>r())}),this._listenerRemovers.clear(),this._parentChangesUnsub?.()}};a(Hh,"FSWatcher");var ml=Hh;st.FSWatcher=ml});var Nb=T(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.fsSynchronousApiList=void 0;gl.fsSynchronousApiList=["accessSync","appendFileSync","chmodSync","chownSync","closeSync","copyFileSync","existsSync","fchmodSync","fchownSync","fdatasyncSync","fstatSync","fsyncSync","ftruncateSync","futimesSync","lchmodSync","lchownSync","linkSync","lstatSync","mkdirSync","mkdtempSync","openSync","opendirSync","readdirSync","readFileSync","readlinkSync","readSync","readvSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","lutimesSync","writeFileSync","writeSync","writevSync"]});var Bb=T(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.fsCallbackApiList=void 0;bl.fsCallbackApiList=["access","appendFile","chmod","chown","close","copyFile","cp","createReadStream","createWriteStream","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","openAsBlob","opendir","read","readv","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","unwatchFile","utimes","lutimes","watch","watchFile","write","writev","writeFile"]});var qo=T((at,vl)=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.memfs=at.fs=at.vol=at.Volume=void 0;at.createFsFromVolume=qh;var tC=xf(),rC=Ys(),_l=Cb();Object.defineProperty(at,"Volume",{enumerable:!0,get:a(function(){return _l.Volume},"get")});var Lb=Pt(),iC=Nb(),nC=Bb(),{F_OK:oC,R_OK:sC,W_OK:aC,X_OK:lC}=Lb.constants;at.vol=new _l.Volume;function qh(t){let e={F_OK:oC,R_OK:sC,W_OK:aC,X_OK:lC,constants:Lb.constants,Stats:tC.default,Dirent:rC.default};for(let r of iC.fsSynchronousApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));for(let r of nC.fsCallbackApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,typeof t.realpath=="function"&&(e.realpath=t.realpath.bind(t),typeof t.realpath.native=="function"&&(e.realpath.native=t.realpath.native.bind(t))),typeof t.realpathSync=="function"&&(e.realpathSync=t.realpathSync.bind(t),typeof t.realpathSync.native=="function"&&(e.realpathSync.native=t.realpathSync.native.bind(t))),e._toUnixTimestamp=_l.toUnixTimestamp,e.__vol=t,e}a(qh,"createFsFromVolume");at.fs=qh(at.vol);var cC=a((t={},e="/")=>{let r=_l.Volume.fromNestedJSON(t,e);return{fs:qh(r),vol:r}},"memfs");at.memfs=cC;vl.exports={...vl.exports,...at.fs};vl.exports.semantic=!0});var nd=T((A4,Rl)=>{function Hb(t){return Array.isArray(t)?t:[t]}a(Hb,"makeArray");var fC=void 0,Xh="",jb=" ",Zh="\\",uC=/^\s+$/,hC=/(?:[^\\]|^)\\$/,dC=/^\\!/,pC=/^\\#/,mC=/\r?\n/g,wC=/^\.{0,2}\/|^\.{1,2}$/,yC=/\/$/,Fn="/",qb="node-ignore";typeof Symbol<"u"&&(qb=Symbol.for("node-ignore"));var zb=qb,En=a((t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),"define"),gC=/([0-z])-([0-z])/g,Wb=a(()=>!1,"RETURN_FALSE"),bC=a(t=>t.replace(gC,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Xh),"sanitizeRange"),vC=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),_C=[[/^\uFEFF/,()=>Xh],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?jb:Xh)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+jb}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Zh],[/\\\\/g,()=>Zh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Zh?`\\[${r}${vC(i)}${n}`:n==="]"&&i.length%2===0?`[${bC(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],FC=/(^|\\\/)?\\\*$/,Wo="regex",Tl="checkRegex",Ub="_",EC={[Wo](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Tl](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},SC=a(t=>_C.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),"makeRegexPrefix"),Ol=a(t=>typeof t=="string","isString"),xC=a(t=>t&&Ol(t)&&!uC.test(t)&&!hC.test(t)&&t.indexOf("#")!==0,"checkPattern"),TC=a(t=>t.split(mC).filter(Boolean),"splitPattern"),td=class td{constructor(e,r,i,n,o,s){this.pattern=e,this.mark=r,this.negative=o,En(this,"body",i),En(this,"ignoreCase",n),En(this,"regexPrefix",s)}get regex(){let e=Ub+Wo;return this[e]?this[e]:this._make(Wo,e)}get checkRegex(){let e=Ub+Tl;return this[e]?this[e]:this._make(Tl,e)}_make(e,r){let i=this.regexPrefix.replace(FC,EC[e]),n=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return En(this,r,n)}};a(td,"IgnoreRule");var Yh=td,OC=a(({pattern:t,mark:e},r)=>{let i=!1,n=t;n.indexOf("!")===0&&(i=!0,n=n.substr(1)),n=n.replace(dC,"!").replace(pC,"#");let o=SC(n);return new Yh(t,e,n,r,i,o)},"createRule"),rd=class rd{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[zb]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(Ol(e)&&(e={pattern:e}),xC(e.pattern)){let r=OC(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,Hb(Ol(e)?TC(e):e).forEach(this._add,this),this._added}test(e,r,i){let n=!1,o=!1,s;this._rules.forEach(f=>{let{negative:c}=f;o===c&&n!==o||c&&!n&&!o&&!r||!f[i].test(e)||(n=!c,o=c,s=c?fC:f)});let l={ignored:n,unignored:o};return s&&(l.rule=s),l}};a(rd,"RuleManager");var Jh=rd,RC=a((t,e)=>{throw new e(t)},"throwError"),hr=a((t,e,r)=>Ol(t)?t?hr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),Vb=a(t=>wC.test(t),"isNotRelative");hr.isNotRelative=Vb;hr.convert=t=>t;var id=class id{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){En(this,zb,!0),this._rules=new Jh(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,n){let o=e&&hr.convert(e);return hr(o,e,this._strictPathCheck?RC:Wb),this._t(o,r,i,n)}checkIgnore(e){if(!yC.test(e))return this.test(e);let r=e.split(Fn).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(Fn)+Fn,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,Tl)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Fn).filter(Boolean)),n.pop(),!n.length)return r[e]=this._rules.test(e,i,Wo);let o=this._t(n.join(Fn)+Fn,r,i,n);return r[e]=o.ignored?o:this._rules.test(e,i,Wo)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return Hb(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(id,"Ignore");var Qh=id,ed=a(t=>new Qh(t),"factory"),kC=a(t=>hr(t&&hr.convert(t),t,Wb),"isPathValid"),Gb=a(()=>{let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");hr.convert=t;let e=/^[a-z]:\//i;hr.isNotRelative=r=>e.test(r)||Vb(r)},"setupWindows");typeof process<"u"&&process.platform==="win32"&&Gb();Rl.exports=ed;ed.default=ed;Rl.exports.isPathValid=kC;En(Rl.exports,Symbol.for("setupWindows"),Gb)});var Yb=T((j4,Xb)=>{"use strict";var lt=a(function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||lt.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||lt.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||lt.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=lt.DEFAULT_MAX_PENDING},"AsyncLock");lt.DEFAULT_TIMEOUT=0;lt.DEFAULT_MAX_OCCUPATION_TIME=0;lt.DEFAULT_MAX_EXECUTION_TIME=0;lt.DEFAULT_MAX_PENDING=1e3;lt.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,o=null,s=null;typeof r!="function"&&(i=r,r=null,s=new this.Promise(function(g,F){n=g,o=F})),i=i||{};var l=!1,f=null,c=null,u=null,h=this,d=a(function(g,F,O){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),g&&(h.queues[t]&&h.queues[t].length===0&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),l||(s?F?o(F):n(O):typeof r=="function"&&r(F,O),l=!0),g&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},"done"),p=a(function(g){if(l)return d(g);f&&(clearTimeout(f),f=null),h.domainReentrant&&g&&(h.domains[t]=process.domain);var F=i.maxExecutionTime||h.maxExecutionTime;if(F&&(u=setTimeout(function(){h.queues[t]&&d(g,new Error("Maximum execution time is exceeded "+t))},F)),e.length===1){var O=!1;try{e(function(S,R){O||(O=!0,d(g,S,R))})}catch(S){O||(O=!0,d(g,S))}}else h._promiseTry(function(){return e()}).then(function(S){d(g,void 0,S)},function(S){d(g,S)})},"exec");h.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=i.maxPending||h.maxPending;if(!h.queues[t])h.queues[t]=[],p(!0);else if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])p(!1);else if(h.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var w=a(function(){p(!0)},"taskFn");i.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var y=i.timeout||h.timeout;y&&(f=setTimeout(function(){f=null,d(!1,new Error("async-lock timed out in queue "+t))},y))}var v=i.maxOccupationTime||h.maxOccupationTime;if(v&&(c=setTimeout(function(){h.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},v)),s)return s};lt.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,o=a(function(l,f){return function(c){n.acquire(l,f,c,i)}},"getFn"),s=t.reduceRight(function(l,f){return o(f,l)},e);if(typeof r=="function")s(r);else return new this.Promise(function(l,f){s.length===1?s(function(c,u){c?f(c):l(u)}):l(s())})};lt.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};lt.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Xb.exports=lt});var Qb=T((H4,Jb)=>{"use strict";Jb.exports=Yb()});var tv=T((q4,ev)=>{var PC={}.toString;ev.exports=Array.isArray||function(t){return PC.call(t)=="[object Array]"}});var ov=T((z4,nv)=>{"use strict";var iv=Function.prototype.toString,Sn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,ld,Al;if(typeof Sn=="function"&&typeof Object.defineProperty=="function")try{ld=Object.defineProperty({},"length",{get:a(function(){throw Al},"get")}),Al={},Sn(function(){throw 42},null,ld)}catch(t){t!==Al&&(Sn=null)}else Sn=null;var AC=/^\s*class\b/,cd=a(function(e){try{var r=iv.call(e);return AC.test(r)}catch{return!1}},"isES6ClassFunction"),ad=a(function(e){try{return cd(e)?!1:(iv.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Il=Object.prototype.toString,IC="[object Object]",DC="[object Function]",CC="[object GeneratorFunction]",NC="[object HTMLAllCollection]",BC="[object HTML document.all class]",LC="[object HTMLCollection]",$C=typeof Symbol=="function"&&!!Symbol.toStringTag,MC=!(0 in[,]),fd=a(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(rv=document.all,Il.call(rv)===Il.call(document.all)&&(fd=a(function(e){if((MC||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Il.call(e);return(r===NC||r===BC||r===LC||r===IC)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var rv;nv.exports=a(Sn?function(e){if(fd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{Sn(e,null,ld)}catch(r){if(r!==Al)return!1}return!cd(e)&&ad(e)}:function(e){if(fd(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if($C)return ad(e);if(cd(e))return!1;var r=Il.call(e);return r!==DC&&r!==CC&&!/^\[object HTML/.test(r)?!1:ad(e)},"isCallable")});var lv=T((V4,av)=>{"use strict";var jC=ov(),UC=Object.prototype.toString,sv=Object.prototype.hasOwnProperty,HC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)sv.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachArray"),qC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)i==null?r(e.charAt(n),n,e):r.call(i,e.charAt(n),n,e)},"forEachString"),zC=a(function(e,r,i){for(var n in e)sv.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachObject");function WC(t){return UC.call(t)==="[object Array]"}a(WC,"isArray");av.exports=a(function(e,r,i){if(!jC(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),WC(e)?HC(e,r,n):typeof e=="string"?qC(e,r,n):zC(e,r,n)},"forEach")});var fv=T((K4,cv)=>{"use strict";cv.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var hv=T((Z4,uv)=>{"use strict";var ud=fv(),VC=globalThis;uv.exports=a(function(){for(var e=[],r=0;r<ud.length;r++)typeof VC[ud[r]]=="function"&&(e[e.length]=ud[r]);return e},"availableTypedArrays")});var wv=T((Y4,mv)=>{"use strict";var dv=bo(),GC=Fu(),xn=Ht(),pv=tn();mv.exports=a(function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new xn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new xn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new xn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new xn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new xn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new xn("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!pv&&pv(e,r);if(dv)dv(e,r,{configurable:s===null&&f?f.configurable:!s,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(l||!n&&!o&&!s)e[r]=i;else throw new GC("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var bv=T((Q4,gv)=>{"use strict";var hd=bo(),yv=a(function(){return!!hd},"hasPropertyDescriptors");yv.hasArrayLengthDefineBug=a(function(){if(!hd)return null;try{return hd([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");gv.exports=yv});var Sv=T((tU,Ev)=>{"use strict";var KC=Eo(),vv=wv(),ZC=bv()(),_v=tn(),Fv=Ht(),XC=KC("%Math.floor%");Ev.exports=a(function(e,r){if(typeof e!="function")throw new Fv("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||XC(r)!==r)throw new Fv("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&_v){var s=_v(e,"length");s&&!s.configurable&&(n=!1),s&&!s.writable&&(o=!1)}return(n||o||!i)&&(ZC?vv(e,"length",r,!0,!0):vv(e,"length",r)),e},"setFunctionLength")});var Tv=T((iU,xv)=>{"use strict";var YC=rn(),JC=xa(),QC=Tu();xv.exports=a(function(){return QC(YC,JC,arguments)},"applyBind")});var kv=T((oU,Dl)=>{"use strict";var e2=Sv(),Ov=bo(),t2=Ta(),Rv=Tv();Dl.exports=a(function(e){var r=t2(arguments),i=e.length-(arguments.length-1);return e2(r,1+(i>0?i:0),!0)},"callBind");Ov?Ov(Dl.exports,"apply",{value:Rv}):Dl.exports.apply=Rv});var Av=T((aU,Pv)=>{"use strict";var r2=Eu();Pv.exports=a(function(){return r2()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Bv=T((cU,Nv)=>{"use strict";var Bl=lv(),i2=hv(),Iv=kv(),pd=So(),Nl=tn(),Cl=Ru(),n2=pd("Object.prototype.toString"),Cv=Av()(),Dv=globalThis,dd=i2(),md=pd("String.prototype.slice"),o2=pd("Array.prototype.indexOf",!0)||a(function(e,r){for(var i=0;i<e.length;i+=1)if(e[i]===r)return i;return-1},"indexOf"),Ll={__proto__:null};Cv&&Nl&&Cl?Bl(dd,function(t){var e=new Dv[t];if(Symbol.toStringTag in e&&Cl){var r=Cl(e),i=Nl(r,Symbol.toStringTag);if(!i&&r){var n=Cl(r);i=Nl(n,Symbol.toStringTag)}Ll["$"+t]=Iv(i.get)}}):Bl(dd,function(t){var e=new Dv[t],r=e.slice||e.set;r&&(Ll["$"+t]=Iv(r))});var s2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{"$"+i(e)===n&&(r=md(n,1))}catch{}}),r},"tryAllTypedArrays"),a2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{i(e),r=md(n,1)}catch{}}),r},"tryAllSlices");Nv.exports=a(function(e){if(!e||typeof e!="object")return!1;if(!Cv){var r=md(n2(e),8,-1);return o2(dd,r)>-1?r:r!=="Object"?!1:a2(e)}return Nl?s2(e):null},"whichTypedArray")});var $v=T((uU,Lv)=>{"use strict";var l2=Bv();Lv.exports=a(function(e){return!!l2(e)},"isTypedArray")});var jv=T((dU,Mv)=>{"use strict";var c2=Ht(),f2=So(),u2=f2("TypedArray.prototype.buffer",!0),h2=$v();Mv.exports=u2||a(function(e){if(!h2(e))throw new c2("Not a Typed Array");return e.buffer},"typedArrayBuffer")});var qv=T((mU,Hv)=>{"use strict";var It=Co().Buffer,d2=tv(),p2=jv(),m2=ArrayBuffer.isView||a(function(e){try{return p2(e),!0}catch{return!1}},"isView"),w2=typeof Uint8Array<"u",Uv=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",y2=Uv&&(It.prototype instanceof Uint8Array||It.TYPED_ARRAY_SUPPORT);Hv.exports=a(function(e,r){if(It.isBuffer(e))return e.constructor&&!("isBuffer"in e)?It.from(e):e;if(typeof e=="string")return It.from(e,r);if(Uv&&m2(e)){if(e.byteLength===0)return It.alloc(0);if(y2){var i=It.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=It.from(n);if(o.length===e.byteLength)return o}if(w2&&e instanceof Uint8Array)return It.from(e);var s=d2(e);if(s)for(var l=0;l<e.length;l+=1){var f=e[l];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(s||It.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return It.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},"toBuffer")});var Wv=T((yU,zv)=>{"use strict";var g2=Co().Buffer,b2=qv();function $l(t,e){this._block=g2.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a($l,"Hash");$l.prototype.update=function(t,e){t=b2(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,o=this._len,s=0;s<n;){for(var l=o%i,f=Math.min(n-s,i-l),c=0;c<f;c++)r[l+c]=t[s+c];o+=f,s+=f,o%i===0&&this._update(r)}return this._len+=n,this};$l.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};$l.prototype._update=function(){throw new Error("_update must be implemented by subclass")};zv.exports=$l});var Kv=T((bU,Gv)=>{"use strict";var v2=Gt(),Vv=Wv(),_2=Co().Buffer,F2=[1518500249,1859775393,-1894007588,-899497514],E2=new Array(80);function Ko(){this.init(),this._w=E2,Vv.call(this,64,56)}a(Ko,"Sha1");v2(Ko,Vv);Ko.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function S2(t){return t<<1|t>>>31}a(S2,"rotl1");function x2(t){return t<<5|t>>>27}a(x2,"rotl5");function T2(t){return t<<30|t>>>2}a(T2,"rotl30");function O2(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}a(O2,"ft");Ko.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,s=this._e|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<80;++l)e[l]=S2(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var f=0;f<80;++f){var c=~~(f/20),u=x2(r)+O2(c,i,n,o)+s+e[f]+F2[c]|0;s=o,o=n,n=T2(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};Ko.prototype._hash=function(){var t=_2.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};Gv.exports=Ko});var Xv=T(wd=>{var Zv;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof wd=="object"?t(wd):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(Zv={}):t(Zv={})})(function(t){t.version="1.2.2";function e(){for(var b=0,x=new Array(256),_=0;_!=256;++_)b=_,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,x[_]=b;return typeof Int32Array<"u"?new Int32Array(x):x}a(e,"signed_crc_table");var r=e();function i(b){var x=0,_=0,P=0,k=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)k[P]=b[P];for(P=0;P!=256;++P)for(_=b[P],x=256+P;x<4096;x+=256)_=k[x]=_>>>8^b[_&255];var C=[];for(P=1;P!=16;++P)C[P-1]=typeof Int32Array<"u"?k.subarray(P*256,P*256+256):k.slice(P*256,P*256+256);return C}a(i,"slice_by_16_tables");var n=i(r),o=n[0],s=n[1],l=n[2],f=n[3],c=n[4],u=n[5],h=n[6],d=n[7],p=n[8],m=n[9],w=n[10],y=n[11],v=n[12],g=n[13],F=n[14];function O(b,x){for(var _=x^-1,P=0,k=b.length;P<k;)_=_>>>8^r[(_^b.charCodeAt(P++))&255];return~_}a(O,"crc32_bstr");function S(b,x){for(var _=x^-1,P=b.length-15,k=0;k<P;)_=F[b[k++]^_&255]^g[b[k++]^_>>8&255]^v[b[k++]^_>>16&255]^y[b[k++]^_>>>24]^w[b[k++]]^m[b[k++]]^p[b[k++]]^d[b[k++]]^h[b[k++]]^u[b[k++]]^c[b[k++]]^f[b[k++]]^l[b[k++]]^s[b[k++]]^o[b[k++]]^r[b[k++]];for(P+=15;k<P;)_=_>>>8^r[(_^b[k++])&255];return~_}a(S,"crc32_buf");function R(b,x){for(var _=x^-1,P=0,k=b.length,C=0,N=0;P<k;)C=b.charCodeAt(P++),C<128?_=_>>>8^r[(_^C)&255]:C<2048?(_=_>>>8^r[(_^(192|C>>6&31))&255],_=_>>>8^r[(_^(128|C&63))&255]):C>=55296&&C<57344?(C=(C&1023)+64,N=b.charCodeAt(P++)&1023,_=_>>>8^r[(_^(240|C>>8&7))&255],_=_>>>8^r[(_^(128|C>>2&63))&255],_=_>>>8^r[(_^(128|N>>6&15|(C&3)<<4))&255],_=_>>>8^r[(_^(128|N&63))&255]):(_=_>>>8^r[(_^(224|C>>12&15))&255],_=_>>>8^r[(_^(128|C>>6&63))&255],_=_>>>8^r[(_^(128|C&63))&255]);return~_}a(R,"crc32_str"),t.table=r,t.bstr=O,t.buf=S,t.str=R})});var dr=T(Ge=>{"use strict";var R2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function k2(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(k2,"_has");Ge.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)k2(r,i)&&(t[i]=r[i])}}return t};Ge.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var P2={arraySet:a(function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){var e,r,i,n,o,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,n),n+=o.length;return s},"flattenChunks")},A2={arraySet:a(function(t,e,r,i,n){for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){return[].concat.apply([],t)},"flattenChunks")};Ge.setTyped=function(t){t?(Ge.Buf8=Uint8Array,Ge.Buf16=Uint16Array,Ge.Buf32=Int32Array,Ge.assign(Ge,P2)):(Ge.Buf8=Array,Ge.Buf16=Array,Ge.Buf32=Array,Ge.assign(Ge,A2))};Ge.setTyped(R2)});var b_=T(Rn=>{"use strict";var I2=dr(),D2=4,Yv=0,Jv=1,C2=2;function On(t){for(var e=t.length;--e>=0;)t[e]=0}a(On,"zero");var N2=0,n_=1,B2=2,L2=3,$2=258,Ed=29,es=256,Xo=es+1+Ed,Tn=30,Sd=19,o_=2*Xo+1,vi=15,yd=16,M2=7,xd=256,s_=16,a_=17,l_=18,_d=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ml=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],j2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],c_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],U2=512,pr=new Array((Xo+2)*2);On(pr);var Zo=new Array(Tn*2);On(Zo);var Yo=new Array(U2);On(Yo);var Jo=new Array($2-L2+1);On(Jo);var Td=new Array(Ed);On(Td);var jl=new Array(Tn);On(jl);function gd(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}a(gd,"StaticTreeDesc");var f_,u_,h_;function bd(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(bd,"TreeDesc");function d_(t){return t<256?Yo[t]:Yo[256+(t>>>7)]}a(d_,"d_code");function Qo(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}a(Qo,"put_short");function Je(t,e,r){t.bi_valid>yd-r?(t.bi_buf|=e<<t.bi_valid&65535,Qo(t,t.bi_buf),t.bi_buf=e>>yd-t.bi_valid,t.bi_valid+=r-yd):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}a(Je,"send_bits");function Yt(t,e,r){Je(t,r[e*2],r[e*2+1])}a(Yt,"send_code");function p_(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}a(p_,"bi_reverse");function H2(t){t.bi_valid===16?(Qo(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}a(H2,"bi_flush");function q2(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,u,h,d,p,m,w=0;for(d=0;d<=vi;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<o_;c++)u=t.heap[c],d=r[r[u*2+1]*2+1]+1,d>f&&(d=f,w++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,p=0,u>=l&&(p=s[u-l]),m=r[u*2],t.opt_len+=m*(d+p),o&&(t.static_len+=m*(n[u*2+1]+p)));if(w!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,w-=2}while(w>0);for(d=f;d!==0;d--)for(u=t.bl_count[d];u!==0;)h=t.heap[--c],!(h>i)&&(r[h*2+1]!==d&&(t.opt_len+=(d-r[h*2+1])*r[h*2],r[h*2+1]=d),u--)}}a(q2,"gen_bitlen");function m_(t,e,r){var i=new Array(vi+1),n=0,o,s;for(o=1;o<=vi;o++)i[o]=n=n+r[o-1]<<1;for(s=0;s<=e;s++){var l=t[s*2+1];l!==0&&(t[s*2]=p_(i[l]++,l))}}a(m_,"gen_codes");function z2(){var t,e,r,i,n,o=new Array(vi+1);for(r=0,i=0;i<Ed-1;i++)for(Td[i]=r,t=0;t<1<<_d[i];t++)Jo[r++]=i;for(Jo[r-1]=i,n=0,i=0;i<16;i++)for(jl[i]=n,t=0;t<1<<Ml[i];t++)Yo[n++]=i;for(n>>=7;i<Tn;i++)for(jl[i]=n<<7,t=0;t<1<<Ml[i]-7;t++)Yo[256+n++]=i;for(e=0;e<=vi;e++)o[e]=0;for(t=0;t<=143;)pr[t*2+1]=8,t++,o[8]++;for(;t<=255;)pr[t*2+1]=9,t++,o[9]++;for(;t<=279;)pr[t*2+1]=7,t++,o[7]++;for(;t<=287;)pr[t*2+1]=8,t++,o[8]++;for(m_(pr,Xo+1,o),t=0;t<Tn;t++)Zo[t*2+1]=5,Zo[t*2]=p_(t,5);f_=new gd(pr,_d,es+1,Xo,vi),u_=new gd(Zo,Ml,0,Tn,vi),h_=new gd(new Array(0),j2,0,Sd,M2)}a(z2,"tr_static_init");function w_(t){var e;for(e=0;e<Xo;e++)t.dyn_ltree[e*2]=0;for(e=0;e<Tn;e++)t.dyn_dtree[e*2]=0;for(e=0;e<Sd;e++)t.bl_tree[e*2]=0;t.dyn_ltree[xd*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}a(w_,"init_block");function y_(t){t.bi_valid>8?Qo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}a(y_,"bi_windup");function W2(t,e,r,i){y_(t),i&&(Qo(t,r),Qo(t,~r)),I2.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}a(W2,"copy_block");function Qv(t,e,r,i){var n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]}a(Qv,"smaller");function vd(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&Qv(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!Qv(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}a(vd,"pqdownheap");function e_(t,e,r){var i,n,o=0,s,l;if(t.last_lit!==0)do i=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],n=t.pending_buf[t.l_buf+o],o++,i===0?Yt(t,n,e):(s=Jo[n],Yt(t,s+es+1,e),l=_d[s],l!==0&&(n-=Td[s],Je(t,n,l)),i--,s=d_(i),Yt(t,s,r),l=Ml[s],l!==0&&(i-=jl[s],Je(t,i,l)));while(o<t.last_lit);Yt(t,xd,e)}a(e_,"compress_block");function Fd(t,e){var r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.elems,s,l,f=-1,c;for(t.heap_len=0,t.heap_max=o_,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)vd(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],vd(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=l,r[c*2]=r[s*2]+r[l*2],t.depth[c]=(t.depth[s]>=t.depth[l]?t.depth[s]:t.depth[l])+1,r[s*2+1]=r[l*2+1]=c,t.heap[1]=c++,vd(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],q2(t,e),m_(r,f,t.bl_count)}a(Fd,"build_tree");function t_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)&&(l<c?t.bl_tree[o*2]+=l:o!==0?(o!==n&&t.bl_tree[o*2]++,t.bl_tree[s_*2]++):l<=10?t.bl_tree[a_*2]++:t.bl_tree[l_*2]++,l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}a(t_,"scan_tree");function r_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),i=0;i<=r;i++)if(o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)){if(l<c)do Yt(t,o,t.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Yt(t,o,t.bl_tree),l--),Yt(t,s_,t.bl_tree),Je(t,l-3,2)):l<=10?(Yt(t,a_,t.bl_tree),Je(t,l-3,3)):(Yt(t,l_,t.bl_tree),Je(t,l-11,7));l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}a(r_,"send_tree");function V2(t){var e;for(t_(t,t.dyn_ltree,t.l_desc.max_code),t_(t,t.dyn_dtree,t.d_desc.max_code),Fd(t,t.bl_desc),e=Sd-1;e>=3&&t.bl_tree[c_[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}a(V2,"build_bl_tree");function G2(t,e,r,i){var n;for(Je(t,e-257,5),Je(t,r-1,5),Je(t,i-4,4),n=0;n<i;n++)Je(t,t.bl_tree[c_[n]*2+1],3);r_(t,t.dyn_ltree,e-1),r_(t,t.dyn_dtree,r-1)}a(G2,"send_all_trees");function K2(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Yv;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Jv;for(r=32;r<es;r++)if(t.dyn_ltree[r*2]!==0)return Jv;return Yv}a(K2,"detect_data_type");var i_=!1;function Z2(t){i_||(z2(),i_=!0),t.l_desc=new bd(t.dyn_ltree,f_),t.d_desc=new bd(t.dyn_dtree,u_),t.bl_desc=new bd(t.bl_tree,h_),t.bi_buf=0,t.bi_valid=0,w_(t)}a(Z2,"_tr_init");function g_(t,e,r,i){Je(t,(N2<<1)+(i?1:0),3),W2(t,e,r,!0)}a(g_,"_tr_stored_block");function X2(t){Je(t,n_<<1,3),Yt(t,xd,pr),H2(t)}a(X2,"_tr_align");function Y2(t,e,r,i){var n,o,s=0;t.level>0?(t.strm.data_type===C2&&(t.strm.data_type=K2(t)),Fd(t,t.l_desc),Fd(t,t.d_desc),s=V2(t),n=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&e!==-1?g_(t,e,r,i):t.strategy===D2||o===n?(Je(t,(n_<<1)+(i?1:0),3),e_(t,pr,Zo)):(Je(t,(B2<<1)+(i?1:0),3),G2(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),e_(t,t.dyn_ltree,t.dyn_dtree)),w_(t),i&&y_(t)}a(Y2,"_tr_flush_block");function J2(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Jo[r]+es+1)*2]++,t.dyn_dtree[d_(e)*2]++),t.last_lit===t.lit_bufsize-1}a(J2,"_tr_tally");Rn._tr_init=Z2;Rn._tr_stored_block=g_;Rn._tr_flush_block=Y2;Rn._tr_tally=J2;Rn._tr_align=X2});var Od=T((OU,v_)=>{"use strict";function Q2(t,e,r,i){for(var n=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0}a(Q2,"adler32");v_.exports=Q2});var Rd=T((kU,__)=>{"use strict";function eN(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}a(eN,"makeTable");var tN=eN();function rN(t,e,r,i){var n=tN,o=i+r;t^=-1;for(var s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1}a(rN,"crc32");__.exports=rN});var Ul=T((AU,F_)=>{"use strict";F_.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var A_=T(er=>{"use strict";var Ke=dr(),_t=b_(),T_=Od(),$r=Rd(),iN=Ul(),Si=0,nN=1,oN=3,qr=4,E_=5,Qt=0,S_=1,Ft=-2,sN=-3,kd=-5,aN=-1,lN=1,Hl=2,cN=3,fN=4,uN=0,hN=2,Vl=8,dN=9,pN=15,mN=8,wN=29,yN=256,Ad=yN+1+wN,gN=30,bN=19,vN=2*Ad+1,_N=15,Q=3,Ur=258,Dt=Ur+Q+1,FN=32,Gl=42,Id=69,ql=73,zl=91,Wl=103,_i=113,rs=666,Ae=1,is=2,Fi=3,An=4,EN=3;function Hr(t,e){return t.msg=iN[e],e}a(Hr,"err");function x_(t){return(t<<1)-(t>4?9:0)}a(x_,"rank");function jr(t){for(var e=t.length;--e>=0;)t[e]=0}a(jr,"zero");function Mr(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Ke.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}a(Mr,"flush_pending");function $e(t,e){_t._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mr(t.strm)}a($e,"flush_block_only");function oe(t,e){t.pending_buf[t.pending++]=e}a(oe,"put_byte");function ts(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}a(ts,"putShortMSB");function SN(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Ke.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=T_(t.adler,e,n,r):t.state.wrap===2&&(t.adler=$r(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}a(SN,"read_buf");function O_(t,e){var r=t.max_chain_length,i=t.strstart,n,o,s=t.prev_length,l=t.nice_match,f=t.strstart>t.w_size-Dt?t.strstart-(t.w_size-Dt):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+Ur,p=c[i+s-1],m=c[i+s];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(n=e,!(c[n+s]!==m||c[n+s-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<d);if(o=Ur-(d-i),i=d-Ur,o>s){if(t.match_start=e,s=o,o>=l)break;p=c[i+s-1],m=c[i+s]}}while((e=h[e&u])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}a(O_,"longest_match");function Ei(t){var e=t.w_size,r,i,n,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Dt)){Ke.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);o+=e}if(t.strm.avail_in===0)break;if(i=SN(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=i,t.lookahead+t.insert>=Q)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+Q-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<Q)););}while(t.lookahead<Dt&&t.strm.avail_in!==0)}a(Ei,"fill_window");function xN(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ei(t),t.lookahead===0&&e===Si)return Ae;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,$e(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Dt&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:An):(t.strstart>t.block_start&&($e(t,!1),t.strm.avail_out===0),Ae)}a(xN,"deflate_stored");function Pd(t,e){for(var r,i;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Dt&&(t.match_length=O_(t,r)),t.match_length>=Q)if(i=_t._tr_tally(t,t.strstart-t.match_start,t.match_length-Q),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Q){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:An):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(Pd,"deflate_fast");function kn(t,e){for(var r,i,n;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Q-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Dt&&(t.match_length=O_(t,r),t.match_length<=5&&(t.strategy===lN||t.match_length===Q&&t.strstart-t.match_start>4096)&&(t.match_length=Q-1)),t.prev_length>=Q&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Q,i=_t._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Q),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Q-1,t.strstart++,i&&($e(t,!1),t.strm.avail_out===0))return Ae}else if(t.match_available){if(i=_t._tr_tally(t,0,t.window[t.strstart-1]),i&&$e(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Ae}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=_t._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:An):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(kn,"deflate_slow");function TN(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=Ur){if(Ei(t),t.lookahead<=Ur&&e===Si)return Ae;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Q&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){o=t.strstart+Ur;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=Ur-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Q?(r=_t._tr_tally(t,1,t.match_length-Q),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:An):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(TN,"deflate_rle");function ON(t,e){for(var r;;){if(t.lookahead===0&&(Ei(t),t.lookahead===0)){if(e===Si)return Ae;break}if(t.match_length=0,r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:An):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(ON,"deflate_huff");function Jt(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}a(Jt,"Config");var Pn;Pn=[new Jt(0,0,0,0,xN),new Jt(4,4,8,4,Pd),new Jt(4,5,16,8,Pd),new Jt(4,6,32,32,Pd),new Jt(4,4,16,16,kn),new Jt(8,16,32,32,kn),new Jt(8,16,128,128,kn),new Jt(8,32,128,256,kn),new Jt(32,128,258,1024,kn),new Jt(32,258,258,4096,kn)];function RN(t){t.window_size=2*t.w_size,jr(t.head),t.max_lazy_match=Pn[t.level].max_lazy,t.good_match=Pn[t.level].good_length,t.nice_match=Pn[t.level].nice_length,t.max_chain_length=Pn[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Q-1,t.match_available=0,t.ins_h=0}a(RN,"lm_init");function kN(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Vl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ke.Buf16(vN*2),this.dyn_dtree=new Ke.Buf16((2*gN+1)*2),this.bl_tree=new Ke.Buf16((2*bN+1)*2),jr(this.dyn_ltree),jr(this.dyn_dtree),jr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ke.Buf16(_N+1),this.heap=new Ke.Buf16(2*Ad+1),jr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ke.Buf16(2*Ad+1),jr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}a(kN,"DeflateState");function R_(t){var e;return!t||!t.state?Hr(t,Ft):(t.total_in=t.total_out=0,t.data_type=hN,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Gl:_i,t.adler=e.wrap===2?0:1,e.last_flush=Si,_t._tr_init(e),Qt)}a(R_,"deflateResetKeep");function k_(t){var e=R_(t);return e===Qt&&RN(t.state),e}a(k_,"deflateReset");function PN(t,e){return!t||!t.state||t.state.wrap!==2?Ft:(t.state.gzhead=e,Qt)}a(PN,"deflateSetHeader");function P_(t,e,r,i,n,o){if(!t)return Ft;var s=1;if(e===aN&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>dN||r!==Vl||i<8||i>15||e<0||e>9||o<0||o>fN)return Hr(t,Ft);i===8&&(i=9);var l=new kN;return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Q-1)/Q),l.window=new Ke.Buf8(l.w_size*2),l.head=new Ke.Buf16(l.hash_size),l.prev=new Ke.Buf16(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Ke.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=r,k_(t)}a(P_,"deflateInit2");function AN(t,e){return P_(t,e,Vl,pN,mN,uN)}a(AN,"deflateInit");function IN(t,e){var r,i,n,o;if(!t||!t.state||e>E_||e<0)return t?Hr(t,Ft):Ft;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===rs&&e!==qr)return Hr(t,t.avail_out===0?kd:Ft);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===Gl)if(i.wrap===2)t.adler=0,oe(i,31),oe(i,139),oe(i,8),i.gzhead?(oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),oe(i,i.gzhead.time&255),oe(i,i.gzhead.time>>8&255),oe(i,i.gzhead.time>>16&255),oe(i,i.gzhead.time>>24&255),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(oe(i,i.gzhead.extra.length&255),oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=$r(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Id):(oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,EN),i.status=_i);else{var s=Vl+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=Hl||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,s|=l<<6,i.strstart!==0&&(s|=FN),s+=31-s%31,i.status=_i,ts(i,s),i.strstart!==0&&(ts(i,t.adler>>>16),ts(i,t.adler&65535)),t.adler=1}if(i.status===Id)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size));)oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=ql)}else i.status=ql;if(i.status===ql)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=zl)}else i.status=zl;if(i.status===zl)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=Wl)}else i.status=Wl;if(i.status===Wl&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Mr(t),i.pending+2<=i.pending_buf_size&&(oe(i,t.adler&255),oe(i,t.adler>>8&255),t.adler=0,i.status=_i)):i.status=_i),i.pending!==0){if(Mr(t),t.avail_out===0)return i.last_flush=-1,Qt}else if(t.avail_in===0&&x_(e)<=x_(r)&&e!==qr)return Hr(t,kd);if(i.status===rs&&t.avail_in!==0)return Hr(t,kd);if(t.avail_in!==0||i.lookahead!==0||e!==Si&&i.status!==rs){var f=i.strategy===Hl?ON(i,e):i.strategy===cN?TN(i,e):Pn[i.level].func(i,e);if((f===Fi||f===An)&&(i.status=rs),f===Ae||f===Fi)return t.avail_out===0&&(i.last_flush=-1),Qt;if(f===is&&(e===nN?_t._tr_align(i):e!==E_&&(_t._tr_stored_block(i,0,0,!1),e===oN&&(jr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Mr(t),t.avail_out===0))return i.last_flush=-1,Qt}return e!==qr?Qt:i.wrap<=0?S_:(i.wrap===2?(oe(i,t.adler&255),oe(i,t.adler>>8&255),oe(i,t.adler>>16&255),oe(i,t.adler>>24&255),oe(i,t.total_in&255),oe(i,t.total_in>>8&255),oe(i,t.total_in>>16&255),oe(i,t.total_in>>24&255)):(ts(i,t.adler>>>16),ts(i,t.adler&65535)),Mr(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qt:S_)}a(IN,"deflate");function DN(t){var e;return!t||!t.state?Ft:(e=t.state.status,e!==Gl&&e!==Id&&e!==ql&&e!==zl&&e!==Wl&&e!==_i&&e!==rs?Hr(t,Ft):(t.state=null,e===_i?Hr(t,sN):Qt))}a(DN,"deflateEnd");function CN(t,e){var r=e.length,i,n,o,s,l,f,c,u;if(!t||!t.state||(i=t.state,s=i.wrap,s===2||s===1&&i.status!==Gl||i.lookahead))return Ft;for(s===1&&(t.adler=T_(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(s===0&&(jr(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new Ke.Buf8(i.w_size),Ke.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),l=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Ei(i);i.lookahead>=Q;){n=i.strstart,o=i.lookahead-(Q-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+Q-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=Q-1,Ei(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Q-1,i.match_available=0,t.next_in=f,t.input=c,t.avail_in=l,i.wrap=s,Qt}a(CN,"deflateSetDictionary");er.deflateInit=AN;er.deflateInit2=P_;er.deflateReset=k_;er.deflateResetKeep=R_;er.deflateSetHeader=PN;er.deflate=IN;er.deflateEnd=DN;er.deflateSetDictionary=CN;er.deflateInfo="pako deflate (from Nodeca project)"});var Dd=T(In=>{"use strict";var Kl=dr(),I_=!0,D_=!0;try{String.fromCharCode.apply(null,[0])}catch{I_=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{D_=!1}var ns=new Kl.Buf8(256);for(mr=0;mr<256;mr++)ns[mr]=mr>=252?6:mr>=248?5:mr>=240?4:mr>=224?3:mr>=192?2:1;var mr;ns[254]=ns[254]=1;In.string2buf=function(t){var e,r,i,n,o,s=t.length,l=0;for(n=0;n<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Kl.Buf8(l),o=0,n=0;o<l;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function C_(t,e){if(e<65534&&(t.subarray&&D_||!t.subarray&&I_))return String.fromCharCode.apply(null,Kl.shrinkBuf(t,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}a(C_,"buf2binstring");In.buf2binstring=function(t){return C_(t,t.length)};In.binstring2buf=function(t){for(var e=new Kl.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e};In.buf2string=function(t,e){var r,i,n,o,s=e||t.length,l=new Array(s*2);for(i=0,r=0;r<s;){if(n=t[r++],n<128){l[i++]=n;continue}if(o=ns[n],o>4){l[i++]=65533,r+=o-1;continue}for(n&=o===2?31:o===3?15:7;o>1&&r<s;)n=n<<6|t[r++]&63,o--;if(o>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023)}return C_(l,i)};In.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+ns[t[r]]>e?r:e}});var Cd=T((BU,N_)=>{"use strict";function NN(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}a(NN,"ZStream");N_.exports=NN});var M_=T(as=>{"use strict";var os=A_(),ss=dr(),Bd=Dd(),Ld=Ul(),BN=Cd(),$_=Object.prototype.toString,LN=0,Nd=4,Dn=0,B_=1,L_=2,$N=-1,MN=0,jN=8;function xi(t){if(!(this instanceof xi))return new xi(t);this.options=ss.assign({level:$N,method:jN,chunkSize:16384,windowBits:15,memLevel:8,strategy:MN,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new BN,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Dn)throw new Error(Ld[r]);if(e.header&&os.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Bd.string2buf(e.dictionary):$_.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=os.deflateSetDictionary(this.strm,i),r!==Dn)throw new Error(Ld[r]);this._dict_set=!0}}a(xi,"Deflate");xi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Nd:LN,typeof t=="string"?r.input=Bd.string2buf(t):$_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new ss.Buf8(i),r.next_out=0,r.avail_out=i),n=os.deflate(r,o),n!==B_&&n!==Dn)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Nd||o===L_))&&(this.options.to==="string"?this.onData(Bd.buf2binstring(ss.shrinkBuf(r.output,r.next_out))):this.onData(ss.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==B_);return o===Nd?(n=os.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Dn):(o===L_&&(this.onEnd(Dn),r.avail_out=0),!0)};xi.prototype.onData=function(t){this.chunks.push(t)};xi.prototype.onEnd=function(t){t===Dn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ss.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function $d(t,e){var r=new xi(e);if(r.push(t,!0),r.err)throw r.msg||Ld[r.err];return r.result}a($d,"deflate");function UN(t,e){return e=e||{},e.raw=!0,$d(t,e)}a(UN,"deflateRaw");function HN(t,e){return e=e||{},e.gzip=!0,$d(t,e)}a(HN,"gzip");as.Deflate=xi;as.deflate=$d;as.deflateRaw=UN;as.gzip=HN});var U_=T((jU,j_)=>{"use strict";var Zl=30,qN=12;j_.exports=a(function(e,r){var i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g,F,O,S,R,b,x,_,P,k;i=e.state,n=e.next_in,P=e.input,o=n+(e.avail_in-5),s=e.next_out,k=e.output,l=s-(r-e.avail_out),f=s+(e.avail_out-257),c=i.dmax,u=i.wsize,h=i.whave,d=i.wnext,p=i.window,m=i.hold,w=i.bits,y=i.lencode,v=i.distcode,g=(1<<i.lenbits)-1,F=(1<<i.distbits)-1;e:do{w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=y[m&g];t:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S===0)k[s++]=O&65535;else if(S&16){R=O&65535,S&=15,S&&(w<S&&(m+=P[n++]<<w,w+=8),R+=m&(1<<S)-1,m>>>=S,w-=S),w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=v[m&F];r:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S&16){if(b=O&65535,S&=15,w<S&&(m+=P[n++]<<w,w+=8,w<S&&(m+=P[n++]<<w,w+=8)),b+=m&(1<<S)-1,b>c){e.msg="invalid distance too far back",i.mode=Zl;break e}if(m>>>=S,w-=S,S=s-l,b>S){if(S=b-S,S>h&&i.sane){e.msg="invalid distance too far back",i.mode=Zl;break e}if(x=0,_=p,d===0){if(x+=u-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}else if(d<S){if(x+=u+d-S,S-=d,S<R){R-=S;do k[s++]=p[x++];while(--S);if(x=0,d<R){S=d,R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}}else if(x+=d-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}for(;R>2;)k[s++]=_[x++],k[s++]=_[x++],k[s++]=_[x++],R-=3;R&&(k[s++]=_[x++],R>1&&(k[s++]=_[x++]))}else{x=s-b;do k[s++]=k[x++],k[s++]=k[x++],k[s++]=k[x++],R-=3;while(R>2);R&&(k[s++]=k[x++],R>1&&(k[s++]=k[x++]))}}else if(S&64){e.msg="invalid distance code",i.mode=Zl;break e}else{O=v[(O&65535)+(m&(1<<S)-1)];continue r}break}}else if(S&64)if(S&32){i.mode=qN;break e}else{e.msg="invalid literal/length code",i.mode=Zl;break e}else{O=y[(O&65535)+(m&(1<<S)-1)];continue t}break}}while(n<o&&s<f);R=w>>3,n-=R,w-=R<<3,m&=(1<<w)-1,e.next_in=n,e.next_out=s,e.avail_in=n<o?5+(o-n):5-(n-o),e.avail_out=s<f?257+(f-s):257-(s-f),i.hold=m,i.bits=w},"inflate_fast")});var K_=T((HU,G_)=>{"use strict";var H_=dr(),Cn=15,q_=852,z_=592,W_=0,Md=1,V_=2,zN=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],WN=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],VN=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],GN=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];G_.exports=a(function(e,r,i,n,o,s,l,f){var c=f.bits,u=0,h=0,d=0,p=0,m=0,w=0,y=0,v=0,g=0,F=0,O,S,R,b,x,_=null,P=0,k,C=new H_.Buf16(Cn+1),N=new H_.Buf16(Cn+1),U=null,Z=0,me,Ee,$;for(u=0;u<=Cn;u++)C[u]=0;for(h=0;h<n;h++)C[r[i+h]]++;for(m=c,p=Cn;p>=1&&C[p]===0;p--);if(m>p&&(m=p),p===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<p&&C[d]===0;d++);for(m<d&&(m=d),v=1,u=1;u<=Cn;u++)if(v<<=1,v-=C[u],v<0)return-1;if(v>0&&(e===W_||p!==1))return-1;for(N[1]=0,u=1;u<Cn;u++)N[u+1]=N[u]+C[u];for(h=0;h<n;h++)r[i+h]!==0&&(l[N[r[i+h]]++]=h);if(e===W_?(_=U=l,k=19):e===Md?(_=zN,P-=257,U=WN,Z-=257,k=256):(_=VN,U=GN,k=-1),F=0,h=0,u=d,x=s,w=m,y=0,R=-1,g=1<<m,b=g-1,e===Md&&g>q_||e===V_&&g>z_)return 1;for(;;){me=u-y,l[h]<k?(Ee=0,$=l[h]):l[h]>k?(Ee=U[Z+l[h]],$=_[P+l[h]]):(Ee=96,$=0),O=1<<u-y,S=1<<w,d=S;do S-=O,o[x+(F>>y)+S]=me<<24|Ee<<16|$|0;while(S!==0);for(O=1<<u-1;F&O;)O>>=1;if(O!==0?(F&=O-1,F+=O):F=0,h++,--C[u]===0){if(u===p)break;u=r[i+l[h]]}if(u>m&&(F&b)!==R){for(y===0&&(y=m),x+=d,w=u-y,v=1<<w;w+y<p&&(v-=C[w+y],!(v<=0));)w++,v<<=1;if(g+=1<<w,e===Md&&g>q_||e===V_&&g>z_)return 1;R=F&b,o[R]=m<<24|w<<16|x-s|0}}return F!==0&&(o[x+F]=u-y<<24|64<<16|0),f.bits=m,0},"inflate_table")});var kF=T(Ct=>{"use strict";var ct=dr(),Wd=Od(),tr=Rd(),KN=U_(),ls=K_(),ZN=0,vF=1,_F=2,Z_=4,XN=5,Xl=6,Ti=0,YN=1,JN=2,Et=-2,FF=-3,Vd=-4,QN=-5,X_=8,EF=1,Y_=2,J_=3,Q_=4,eF=5,tF=6,rF=7,iF=8,nF=9,oF=10,Ql=11,wr=12,jd=13,sF=14,Ud=15,aF=16,lF=17,cF=18,fF=19,Yl=20,Jl=21,uF=22,hF=23,dF=24,pF=25,mF=26,Hd=27,wF=28,yF=29,pe=30,Gd=31,eB=32,tB=852,rB=592,iB=15,nB=iB;function gF(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}a(gF,"zswap32");function oB(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ct.Buf16(320),this.work=new ct.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}a(oB,"InflateState");function SF(t){var e;return!t||!t.state?Et:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=EF,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new ct.Buf32(tB),e.distcode=e.distdyn=new ct.Buf32(rB),e.sane=1,e.back=-1,Ti)}a(SF,"inflateResetKeep");function xF(t){var e;return!t||!t.state?Et:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,SF(t))}a(xF,"inflateReset");function TF(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Et:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,xF(t))}a(TF,"inflateReset2");function OF(t,e){var r,i;return t?(i=new oB,t.state=i,i.window=null,r=TF(t,e),r!==Ti&&(t.state=null),r):Et}a(OF,"inflateInit2");function sB(t){return OF(t,nB)}a(sB,"inflateInit");var bF=!0,qd,zd;function aB(t){if(bF){var e;for(qd=new ct.Buf32(512),zd=new ct.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ls(vF,t.lens,0,288,qd,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ls(_F,t.lens,0,32,zd,0,t.work,{bits:5}),bF=!1}t.lencode=qd,t.lenbits=9,t.distcode=zd,t.distbits=5}a(aB,"fixedtables");function RF(t,e,r,i){var n,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ct.Buf8(o.wsize)),i>=o.wsize?(ct.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),ct.arraySet(o.window,e,r-i,n,o.wnext),i-=n,i?(ct.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}a(RF,"updatewindow");function lB(t,e){var r,i,n,o,s,l,f,c,u,h,d,p,m,w,y=0,v,g,F,O,S,R,b,x,_=new ct.Buf8(4),P,k,C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Et;r=t.state,r.mode===wr&&(r.mode=jd),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,h=l,d=f,x=Ti;e:for(;;)switch(r.mode){case EF:if(r.wrap===0){r.mode=jd;break}for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0),c=0,u=0,r.mode=Y_;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=pe;break}if((c&15)!==X_){t.msg="unknown compression method",r.mode=pe;break}if(c>>>=4,u-=4,b=(c&15)+8,r.wbits===0)r.wbits=b;else if(b>r.wbits){t.msg="invalid window size",r.mode=pe;break}r.dmax=1<<b,t.adler=r.check=1,r.mode=c&512?oF:wr,c=0,u=0;break;case Y_:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==X_){t.msg="unknown compression method",r.mode=pe;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=pe;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=J_;case J_:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=tr(r.check,_,4,0)),c=0,u=0,r.mode=Q_;case Q_:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=eF;case eF:if(r.flags&1024){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=tF;case tF:if(r.flags&1024&&(p=r.length,p>l&&(p=l),p&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ct.arraySet(r.head.extra,i,o,p,b)),r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,r.length-=p),r.length))break e;r.length=0,r.mode=rF;case rF:if(r.flags&2048){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=iF;case iF:if(r.flags&4096){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.comment=null);r.mode=nF;case nF:if(r.flags&512){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=pe;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=wr;break;case oF:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}t.adler=r.check=gF(c),c=0,u=0,r.mode=Ql;case Ql:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,JN;t.adler=r.check=1,r.mode=wr;case wr:if(e===XN||e===Xl)break e;case jd:if(r.last){c>>>=u&7,u-=u&7,r.mode=Hd;break}for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=sF;break;case 1:if(aB(r),r.mode=Yl,e===Xl){c>>>=2,u-=2;break e}break;case 2:r.mode=lF;break;case 3:t.msg="invalid block type",r.mode=pe}c>>>=2,u-=2;break;case sF:for(c>>>=u&7,u-=u&7;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=pe;break}if(r.length=c&65535,c=0,u=0,r.mode=Ud,e===Xl)break e;case Ud:r.mode=aF;case aF:if(p=r.length,p){if(p>l&&(p=l),p>f&&(p=f),p===0)break e;ct.arraySet(n,i,o,p,s),l-=p,o+=p,f-=p,s+=p,r.length-=p;break}r.mode=wr;break;case lF:for(;u<14;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=pe;break}r.have=0,r.mode=cF;case cF:for(;r.have<r.ncode;){for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.lens[C[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},x=ls(ZN,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid code lengths set",r.mode=pe;break}r.have=0,r.mode=fF;case fF:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(F<16)c>>>=v,u-=v,r.lens[r.have++]=F;else{if(F===16){for(k=v+2;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=pe;break}b=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(F===17){for(k=v+3;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=3+(c&7),c>>>=3,u-=3}else{for(k=v+7;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=pe;break}for(;p--;)r.lens[r.have++]=b}}if(r.mode===pe)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=pe;break}if(r.lenbits=9,P={bits:r.lenbits},x=ls(vF,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid literal/lengths set",r.mode=pe;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},x=ls(_F,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,x){t.msg="invalid distances set",r.mode=pe;break}if(r.mode=Yl,e===Xl)break e;case Yl:r.mode=Jl;case Jl:if(l>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,KN(t,d),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,r.mode===wr&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(g&&!(g&240)){for(O=v,S=g,R=F;y=r.lencode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,r.length=F,g===0){r.mode=mF;break}if(g&32){r.back=-1,r.mode=wr;break}if(g&64){t.msg="invalid literal/length code",r.mode=pe;break}r.extra=g&15,r.mode=uF;case uF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=hF;case hF:for(;y=r.distcode[c&(1<<r.distbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(!(g&240)){for(O=v,S=g,R=F;y=r.distcode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,g&64){t.msg="invalid distance code",r.mode=pe;break}r.offset=F,r.extra=g&15,r.mode=dF;case dF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=pe;break}r.mode=pF;case pF:if(f===0)break e;if(p=d-f,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=pe;break}p>r.wnext?(p-=r.wnext,m=r.wsize-p):m=r.wnext-p,p>r.length&&(p=r.length),w=r.window}else w=n,m=s-r.offset,p=r.length;p>f&&(p=f),f-=p,r.length-=p;do n[s++]=w[m++];while(--p);r.length===0&&(r.mode=Jl);break;case mF:if(f===0)break e;n[s++]=r.length,f--,r.mode=Jl;break;case Hd:if(r.wrap){for(;u<32;){if(l===0)break e;l--,c|=i[o++]<<u,u+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?tr(r.check,n,d,s-d):Wd(r.check,n,d,s-d)),d=f,(r.flags?c:gF(c))!==r.check){t.msg="incorrect data check",r.mode=pe;break}c=0,u=0}r.mode=wF;case wF:if(r.wrap&&r.flags){for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=pe;break}c=0,u=0}r.mode=yF;case yF:x=YN;break e;case pe:x=FF;break e;case Gd:return Vd;case eB:default:return Et}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,(r.wsize||d!==t.avail_out&&r.mode<pe&&(r.mode<Hd||e!==Z_))&&RF(t,t.output,t.next_out,d-t.avail_out)?(r.mode=Gd,Vd):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?tr(r.check,n,d,t.next_out-d):Wd(r.check,n,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===wr?128:0)+(r.mode===Yl||r.mode===Ud?256:0),(h===0&&d===0||e===Z_)&&x===Ti&&(x=QN),x)}a(lB,"inflate");function cB(t){if(!t||!t.state)return Et;var e=t.state;return e.window&&(e.window=null),t.state=null,Ti}a(cB,"inflateEnd");function fB(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Et:(r.head=e,e.done=!1,Ti)}a(fB,"inflateGetHeader");function uB(t,e){var r=e.length,i,n,o;return!t||!t.state||(i=t.state,i.wrap!==0&&i.mode!==Ql)?Et:i.mode===Ql&&(n=1,n=Wd(n,e,r,0),n!==i.check)?FF:(o=RF(t,e,r,r),o?(i.mode=Gd,Vd):(i.havedict=1,Ti))}a(uB,"inflateSetDictionary");Ct.inflateReset=xF;Ct.inflateReset2=TF;Ct.inflateResetKeep=SF;Ct.inflateInit=sB;Ct.inflateInit2=OF;Ct.inflate=lB;Ct.inflateEnd=cB;Ct.inflateGetHeader=fB;Ct.inflateSetDictionary=uB;Ct.inflateInfo="pako inflate (from Nodeca project)"});var Kd=T((VU,PF)=>{"use strict";PF.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var IF=T((GU,AF)=>{"use strict";function hB(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}a(hB,"GZheader");AF.exports=hB});var CF=T(fs=>{"use strict";var Nn=kF(),cs=dr(),ec=Dd(),_e=Kd(),Zd=Ul(),dB=Cd(),pB=IF(),DF=Object.prototype.toString;function Oi(t){if(!(this instanceof Oi))return new Oi(t);this.options=cs.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new dB,this.strm.avail_out=0;var r=Nn.inflateInit2(this.strm,e.windowBits);if(r!==_e.Z_OK)throw new Error(Zd[r]);if(this.header=new pB,Nn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=ec.string2buf(e.dictionary):DF.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Nn.inflateSetDictionary(this.strm,e.dictionary),r!==_e.Z_OK)))throw new Error(Zd[r])}a(Oi,"Inflate");Oi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,o,s,l,f,c,u=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?_e.Z_FINISH:_e.Z_NO_FLUSH,typeof t=="string"?r.input=ec.binstring2buf(t):DF.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new cs.Buf8(i),r.next_out=0,r.avail_out=i),o=Nn.inflate(r,_e.Z_NO_FLUSH),o===_e.Z_NEED_DICT&&n&&(o=Nn.inflateSetDictionary(this.strm,n)),o===_e.Z_BUF_ERROR&&u===!0&&(o=_e.Z_OK,u=!1),o!==_e.Z_STREAM_END&&o!==_e.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===_e.Z_STREAM_END||r.avail_in===0&&(s===_e.Z_FINISH||s===_e.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=ec.utf8border(r.output,r.next_out),f=r.next_out-l,c=ec.buf2string(r.output,l),r.next_out=f,r.avail_out=i-f,f&&cs.arraySet(r.output,r.output,l,f,0),this.onData(c)):this.onData(cs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==_e.Z_STREAM_END);return o===_e.Z_STREAM_END&&(s=_e.Z_FINISH),s===_e.Z_FINISH?(o=Nn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_e.Z_OK):(s===_e.Z_SYNC_FLUSH&&(this.onEnd(_e.Z_OK),r.avail_out=0),!0)};Oi.prototype.onData=function(t){this.chunks.push(t)};Oi.prototype.onEnd=function(t){t===_e.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=cs.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Xd(t,e){var r=new Oi(e);if(r.push(t,!0),r.err)throw r.msg||Zd[r.err];return r.result}a(Xd,"inflate");function mB(t,e){return e=e||{},e.raw=!0,Xd(t,e)}a(mB,"inflateRaw");fs.Inflate=Oi;fs.inflate=Xd;fs.inflateRaw=mB;fs.ungzip=Xd});var LF=T((YU,BF)=>{"use strict";var wB=dr().assign,yB=M_(),gB=CF(),bB=Kd(),NF={};wB(NF,yB,gB,bB);BF.exports=NF});var jF=T((JU,MF)=>{"use strict";var $F=a((t,e)=>function(...r){let i=e.promiseModule;return new i((n,o)=>{e.multiArgs?r.push((...s)=>{e.errorFirst?s[0]?o(s):(s.shift(),n(s)):n(s)}):e.errorFirst?r.push((s,l)=>{s?o(s):n(l)}):r.push(n),t.apply(this,r)})},"processFn");MF.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=a(o=>{let s=a(l=>typeof l=="string"?o===l:l.test(o),"match");return e.include?e.include.some(s):!e.exclude.some(s)},"filter"),n;r==="function"?n=a(function(...o){return e.excludeMain?t(...o):$F(t,e).apply(this,o)},"ret"):n=Object.create(Object.getPrototypeOf(t));for(let o in t){let s=t[o];n[o]=typeof s=="function"&&i(o)?$F(s,e):s}return n}});var ZF=T((eH,KF)=>{function UF(t){return Array.isArray(t)?t:[t]}a(UF,"makeArray");var Qd="",HF=" ",Yd="\\",vB=/^\s+$/,_B=/(?:[^\\]|^)\\$/,FB=/^\\!/,EB=/^\\#/,SB=/\r?\n/g,xB=/^\.*\/|^\.+$/,Jd="/",WF="node-ignore";typeof Symbol<"u"&&(WF=Symbol.for("node-ignore"));var qF=WF,TB=a((t,e,r)=>Object.defineProperty(t,e,{value:r}),"define"),OB=/([0-z])-([0-z])/g,VF=a(()=>!1,"RETURN_FALSE"),RB=a(t=>t.replace(OB,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Qd),"sanitizeRange"),kB=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),PB=[[/^\uFEFF/,()=>Qd],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?HF:Qd)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+HF}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Yd],[/\\\\/g,()=>Yd],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Yd?`\\[${r}${kB(i)}${n}`:n==="]"&&i.length%2===0?`[${RB(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],zF=Object.create(null),AB=a((t,e)=>{let r=zF[t];return r||(r=PB.reduce((i,[n,o])=>i.replace(n,o.bind(t)),t),zF[t]=r),e?new RegExp(r,"i"):new RegExp(r)},"makeRegex"),rp=a(t=>typeof t=="string","isString"),IB=a(t=>t&&rp(t)&&!vB.test(t)&&!_B.test(t)&&t.indexOf("#")!==0,"checkPattern"),DB=a(t=>t.split(SB),"splitPattern"),ip=class ip{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}};a(ip,"IgnoreRule");var ep=ip,CB=a((t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(FB,"!").replace(EB,"#");let n=AB(t,e);return new ep(r,t,i,n)},"createRule"),NB=a((t,e)=>{throw new e(t)},"throwError"),yr=a((t,e,r)=>rp(t)?t?yr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),GF=a(t=>xB.test(t),"isNotRelative");yr.isNotRelative=GF;yr.convert=t=>t;var np=class np{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){TB(this,qF,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[qF]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(IB(e)){let r=CB(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,UF(rp(e)?DB(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(o=>{let{negative:s}=o;if(n===s&&i!==n||s&&!i&&!n&&!r)return;o.regex.test(e)&&(i=!s,n=s)}),{ignored:i,unignored:n}}_test(e,r,i,n){let o=e&&yr.convert(e);return yr(o,e,this._allowRelativePaths?VF:NB),this._t(o,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Jd)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let o=this._t(n.join(Jd)+Jd,r,i,n);return r[e]=o.ignored?o:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return UF(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(np,"Ignore");var tp=np,tc=a(t=>new tp(t),"factory"),BB=a(t=>yr(t&&yr.convert(t),t,VF),"isPathValid");tc.isPathValid=BB;tc.default=tc;KF.exports=tc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");yr.convert=t;let e=/^[a-z]:\//i;yr.isNotRelative=r=>e.test(r)||GF(r)}});var YF=T((rH,XF)=>{"use strict";function LB(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a(LB,"escapeRegExp");function rr(t,e,r){return e=e instanceof RegExp?e:new RegExp(LB(e),"g"),t.replace(e,r)}a(rr,"replaceAll");var $B={clean:a(function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=rr(e,"./","/"),e=rr(e,"..","."),e=rr(e," ","-"),e=rr(e,/^[~^:?*\\\-]/g,""),e=rr(e,/[~^:?*\\]/g,"-"),e=rr(e,/[~^:?*\\\-]$/g,""),e=rr(e,"@{","-"),e=rr(e,/\.$/g,""),e=rr(e,/\/$/g,""),e=rr(e,/\.lock$/g,""),e},"clean")};XF.exports=$B});var QF=T((nH,JF)=>{"use strict";var MB=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;JF.exports=a(function(e,r){if(typeof e!="string")throw new TypeError("Reference name must be a string");return!MB.test(e)&&(!!r||e.includes("/"))},"validRef")});var tE=T((sH,eE)=>{eE.exports=function(t,e){var r=t,i=e,n=r.length,o=i.length,s=!1,l=null,f=n+1,c=[],u=[],h=[],d="",p=-1,m=0,w=1,y,v,g=a(function(){n>=o&&(y=r,v=n,r=i,i=y,n=o,o=v,s=!0,f=n+1)},"init"),F=a(function(b,x,_){return{x:b,y:x,k:_}},"P"),O=a(function(b,x){return{elem:b,t:x}},"seselem"),S=a(function(b,x,_){var P,k,C;for(x>_?P=c[b-1+f]:P=c[b+1+f],C=Math.max(x,_),k=C-b;k<n&&C<o&&r[k]===i[C];)++k,++C;return c[b+f]=u.length,u[u.length]=new F(k,C,P),C},"snake"),R=a(function(b){var x,_,P,k,C;for(x=_=1,P=k=0,C=b.length-1;C>=0;--C)for(;P<b[C].x||k<b[C].y;)b[C].y-b[C].x>k-P?(s?h[h.length]=new O(i[k],p):h[h.length]=new O(i[k],w),++_,++k):b[C].y-b[C].x<k-P?(s?h[h.length]=new O(r[P],w):h[h.length]=new O(r[P],p),++x,++P):(h[h.length]=new O(r[P],m),d+=r[P],++x,++_,++P,++k)},"recordseq");return g(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:a(function(){return l},"editdistance"),getlcs:a(function(){return d},"getlcs"),getses:a(function(){return h},"getses"),compose:a(function(){var b,x,_,P,k,C,N,U;for(b=o-n,x=n+o+3,_={},N=0;N<x;++N)_[N]=-1,c[N]=-1;P=-1;do{for(++P,U=-P;U<=b-1;++U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);for(U=b+P;U>=b+1;--U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);_[b+f]=S(b,_[b-1+f]+1,_[b+1+f])}while(_[b+f]!==o);for(l=b+2*P,k=c[b+f],C=[];k!==-1;)C[C.length]=new F(u[k].x,u[k].y,null),k=u[k].k;R(C)},"compose")}}});var nE=T((lH,iE)=>{var jB=tE();function UB(t,e){var r=new jB(t,e);r.compose();for(var i=r.getses(),n,o,s=t.length-1,l=e.length-1,f=i.length-1;f>=0;--f)i[f].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:l,chain:null},o=o.chain):(n={file1index:s,file2index:l,chain:null},o=n),s--,l--):i[f].t===r.SES_DELETE?s--:i[f].t===r.SES_ADD&&l--;var c={file1index:-1,file2index:-1,chain:null};return o?(o.chain=c,n):c}a(UB,"longestCommonSubsequence");function rE(t,e){for(var r=[],i=t.length,n=e.length,o=UB(t,e);o!==null;o=o.chain){var s=i-o.file1index-1,l=n-o.file2index-1;i=o.file1index,n=o.file2index,(s||l)&&r.push({file1:[i+1,s],file2:[n+1,l]})}return r.reverse(),r}a(rE,"diffIndices");function HB(t,e,r){var i,n=rE(e,t),o=rE(e,r),s=[];function l(N,U){s.push([N.file1[0],U,N.file1[1],N.file2[0],N.file2[1]])}for(a(l,"addHunk"),i=0;i<n.length;i++)l(n[i],0);for(i=0;i<o.length;i++)l(o[i],2);s.sort(function(N,U){return N[0]-U[0]});var f=[],c=0;function u(N){N>c&&(f.push([1,c,N-c]),c=N)}a(u,"copyCommon");for(var h=0;h<s.length;h++){for(var d=h,p=s[h],m=p[0],w=m+p[2];h<s.length-1;){var y=s[h+1],v=y[0];if(v>w)break;w=Math.max(w,v+y[2]),h++}if(u(m),d==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var g={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=h;i++){p=s[i];var F=p[1],O=g[F],S=p[0],R=S+p[2],b=p[3],x=b+p[4];O[0]=Math.min(b,O[0]),O[1]=Math.max(x,O[1]),O[2]=Math.min(S,O[2]),O[3]=Math.max(R,O[3])}var _=g[0][0]+(m-g[0][2]),P=g[0][1]+(w-g[0][3]),k=g[2][0]+(m-g[2][2]),C=g[2][1]+(w-g[2][3]);f.push([-1,_,P-_,m,w-m,k,C-k])}c=w}return u(e.length),f}a(HB,"diff3MergeIndices");function qB(t,e,r){var i=[],n=[t,e,r],o=HB(t,e,r),s=[];function l(){s.length&&i.push({ok:s}),s=[]}a(l,"flushOk");function f(p){for(var m=0;m<p.length;m++)s.push(p[m])}a(f,"pushOk");function c(p){if(p[2]!=p[6])return!0;for(var m=p[1],w=p[5],y=0;y<p[2];y++)if(t[y+m]!=r[y+w])return!0;return!1}a(c,"isTrueConflict");for(var u=0;u<o.length;u++){var h=o[u],d=h[0];d==-1?c(h)?(l(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(n[0].slice(h[1],h[1]+h[2])):f(n[d].slice(h[1],h[1]+h[2]))}return l(),i}a(qB,"diff3Merge");iE.exports=qB});var Me=T(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function vr(t){return t&&typeof t=="object"&&"default"in t?t.default:t}a(vr,"_interopDefault");var ds=vr(Qb()),OE=vr(Kv()),D=Sr(),zB=vr(Xv()),Pp=vr(LF()),op=vr(jF()),WB=vr(ZF()),ps=vr(YF()),ms=vr(QF()),VB=vr(nE()),pc=class pc extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new pc(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}};a(pc,"BaseError");var re=pc,mc=class mc extends re{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=mc.code,this.data={filepaths:e}}};a(mc,"UnmergedPathsError");var ws=mc;ws.code="UnmergedPathsError";var wc=class wc extends re{constructor(e){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=wc.code,this.data={message:e}}};a(wc,"InternalError");var W=wc;W.code="InternalError";var yc=class yc extends re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=yc.code,this.data={filepath:e}}};a(yc,"UnsafeFilepathError");var Mn=yc;Mn.code="UnsafeFilepathError";var Lp=class Lp{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};a(Lp,"BufferCursor");var St=Lp;function Qc(t,e){return-(t<e)||+(t>e)}a(Qc,"compareStrings");function RE(t,e){return Qc(t.path,e.path)}a(RE,"comparePath");function kE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}a(kE,"normalizeMode");var ir=2**32;function oE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),o=(r-n*1e3)*1e6;return[n,o]}a(oE,"SecondsNanoseconds");function jn(t){let[e,r]=oE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=oE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%ir,ctimeNanoseconds:r%ir,mtimeSeconds:i%ir,mtimeNanoseconds:n%ir,dev:t.dev%ir,ino:t.ino%ir,mode:kE(t.mode%ir),uid:t.uid%ir,gid:t.gid%ir,size:t.size>-1?t.size%ir:0}}a(jn,"normalizeStats");function GB(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}a(GB,"toHex");var sp=null;async function br(t){return sp===null&&(sp=await ZB()),sp?PE(t):KB(t)}a(br,"shasum");function KB(t){return new OE().update(t).digest("hex")}a(KB,"shasumSync");async function PE(t){let e=await crypto.subtle.digest("SHA-1",t);return GB(e)}a(PE,"subtleSHA1");async function ZB(){try{return await PE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}a(ZB,"testSubtleSHA1");function XB(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}a(XB,"parseCacheEntryFlags");function YB(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}a(YB,"renderCacheEntryFlags");var Wr=class Wr{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return Wr.fromBuffer(e);if(e===null)return new Wr(null);throw new W("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new W("Index file is empty (.git/index)");let r=new Wr,i=new St(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new W(`Invalid dircache magic file number: ${n}`);let o=await br(e.slice(0,-20)),s=e.slice(-20).toString("hex");if(s!==o)throw new W(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${o}`);let l=i.readUInt32BE();if(l!==2)throw new W(`Unsupported dircache version: ${l}`);let f=i.readUInt32BE(),c=0;for(;!i.eof()&&c<f;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let h=i.readUInt16BE();u.flags=XB(h);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new W(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new Mn(u.path);let p=8-(i.tell()-12)%8;for(p===0&&(p=8);p--;){let m=i.readUInt8();if(m!==0)throw new W(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(i.eof())throw new W("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(RE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=jn(r);let o=Buffer.from(e),s={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:o.length<4095?o.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(`
|
|
14
|
-
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),o=new St(n),s=
|
|
13
|
+
`+t),"printJson");cl.printJson=ZI});var yb=T(Ho=>{"use strict";Object.defineProperty(Ho,"__esModule",{value:!0});var Ah=(Kf(),bm(Gf));Ah.__exportStar(pb(),Ho);Ah.__exportStar(mb(),Ho);Ah.__exportStar(wb(),Ho)});var gb=T(qe=>{"use strict";Object.defineProperty(qe,"__esModule",{value:!0});qe.newNotAllowedError=qe.newTypeMismatchError=qe.newNotFoundError=qe.assertCanWrite=qe.assertName=qe.basename=qe.ctx=void 0;var XI=a((t={})=>({separator:"/",syncHandleAllowed:!1,mode:"read",...t}),"ctx");qe.ctx=XI;var YI=a((t,e)=>{t[t.length-1]===e&&(t=t.slice(0,-1));let r=t.lastIndexOf(e);return r===-1?t:t.slice(r+1)},"basename");qe.basename=YI;var JI=/^(\.{1,2})$|^(.*([\/\\]).*)$/,QI=a((t,e,r)=>{if(!t||JI.test(t))throw new TypeError(`Failed to execute '${e}' on '${r}': Name is not allowed.`)},"assertName");qe.assertName=QI;var eD=a(t=>{if(t!=="readwrite")throw new DOMException("The request is not allowed by the user agent or the platform in the current context.","NotAllowedError")},"assertCanWrite");qe.assertCanWrite=eD;var tD=a(()=>new DOMException("A requested file or directory could not be found at the time an operation was processed.","NotFoundError"),"newNotFoundError");qe.newNotFoundError=tD;var rD=a(()=>new DOMException("The path supplied exists, but was not an entry of requested type.","TypeMismatchError"),"newTypeMismatchError");qe.newTypeMismatchError=rD;var iD=a(()=>new DOMException("Permission not granted.","NotAllowedError"),"newNotAllowedError");qe.newNotAllowedError=iD});var bb=T(qo=>{"use strict";Object.defineProperty(qo,"__esModule",{value:!0});qo.toTreeSync=void 0;var nD=yb(),oD=gb(),sD=a((t,e={})=>{let r=e.separator||"/",i=e.dir||r;i[i.length-1]!==r&&(i+=r);let n=e.tab||"",o=e.depth??10,s=" (...)";if(o>0){let f=t.readdirSync(i,{withFileTypes:!0});s=(0,nD.printTree)(n,f.map(c=>u=>c.isDirectory()?(0,qo.toTreeSync)(t,{dir:i+c.name,depth:o-1,tab:u}):c.isSymbolicLink()?""+c.name+" \u2192 "+t.readlinkSync(i+c.name):""+c.name))}return(0,oD.basename)(i,r)+r+s},"toTreeSync");qo.toTreeSync=sD});var Fb=T(j=>{"use strict";Object.defineProperty(j,"__esModule",{value:!0});j.getWriteFileOptions=j.writeFileDefaults=j.getRealpathOptsAndCb=j.getRealpathOptions=j.getStatfsOptsAndCb=j.getStatfsOptions=j.getStatOptsAndCb=j.getStatOptions=j.getAppendFileOptsAndCb=j.getAppendFileOpts=j.getOpendirOptsAndCb=j.getOpendirOptions=j.getReaddirOptsAndCb=j.getReaddirOptions=j.getReadFileOptions=j.getRmOptsAndCb=j.getRmdirOptions=j.getDefaultOptsAndCb=j.getDefaultOpts=j.optsDefaults=j.getMkdirOptions=void 0;j.getOptions=_b;j.optsGenerator=fr;j.optsAndCbGenerator=mi;var fl=Yi(),aD=uo(),Ih=Ir(),vb={mode:511,recursive:!1},lD=a(t=>typeof t=="number"?Object.assign({},vb,{mode:t}):Object.assign({},vb,t),"getMkdirOptions");j.getMkdirOptions=lD;var cD=a(t=>`Expected options to be either an object or a string, but got ${t} instead`,"ERRSTR_OPTS");function _b(t,e){let r;if(e){let i=typeof e;switch(i){case"string":r=Object.assign({},t,{encoding:e});break;case"object":r=Object.assign({},t,e);break;default:throw TypeError(cD(i))}}else return t;return r.encoding!=="buffer"&&(0,aD.assertEncoding)(r.encoding),r}a(_b,"getOptions");function fr(t){return e=>_b(t,e)}a(fr,"optsGenerator");function mi(t){return(e,r)=>typeof e=="function"?[t(),e]:[t(e),(0,Ih.validateCallback)(r)]}a(mi,"optsAndCbGenerator");j.optsDefaults={encoding:"utf8"};j.getDefaultOpts=fr(j.optsDefaults);j.getDefaultOptsAndCb=mi(j.getDefaultOpts);var fD={recursive:!1},uD=a(t=>Object.assign({},fD,t),"getRmdirOptions");j.getRmdirOptions=uD;var hD=fr(j.optsDefaults);j.getRmOptsAndCb=mi(hD);var dD={flag:"r"};j.getReadFileOptions=fr(dD);var pD={encoding:"utf8",recursive:!1,withFileTypes:!1};j.getReaddirOptions=fr(pD);j.getReaddirOptsAndCb=mi(j.getReaddirOptions);var mD={encoding:"utf8",bufferSize:32,recursive:!1};j.getOpendirOptions=fr(mD);j.getOpendirOptsAndCb=mi(j.getOpendirOptions);var wD={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.a]};j.getAppendFileOpts=fr(wD);j.getAppendFileOptsAndCb=mi(j.getAppendFileOpts);var yD={bigint:!1},gD=a((t={})=>Object.assign({},yD,t),"getStatOptions");j.getStatOptions=gD;var bD=a((t,e)=>typeof t=="function"?[(0,j.getStatOptions)(),t]:[(0,j.getStatOptions)(t),(0,Ih.validateCallback)(e)],"getStatOptsAndCb");j.getStatOptsAndCb=bD;var vD={bigint:!1},_D=a((t={})=>Object.assign({},vD,t),"getStatfsOptions");j.getStatfsOptions=_D;var FD=a((t,e)=>typeof t=="function"?[(0,j.getStatfsOptions)(),t]:[(0,j.getStatfsOptions)(t),(0,Ih.validateCallback)(e)],"getStatfsOptsAndCb");j.getStatfsOptsAndCb=FD;var ED=j.optsDefaults;j.getRealpathOptions=fr(ED);j.getRealpathOptsAndCb=mi(j.getRealpathOptions);j.writeFileDefaults={encoding:"utf8",mode:438,flag:fl.FLAGS[fl.FLAGS.w]};j.getWriteFileOptions=fr(j.writeFileDefaults)});var Sb=T(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.Dir=void 0;var Eb=Ir(),SD=Ys(),wi=fo(),Ch=class Ch{constructor(e,r){this.link=e,this.options=r,this.iteratorInfo=[],this.closed=!1,this.operationQueue=null,this.path=e.getPath(),this.iteratorInfo.push(e.children[Symbol.iterator]())}closeBase(){}readBase(e){let r,i,n,o;do{do if({done:r,value:i}=e[e.length-1].next(),!r)[n,o]=i;else break;while(n==="."||n==="..");if(r){if(e.pop(),e.length===0)break;r=!1}else return this.options.recursive&&o.children.size&&e.push(o.children[Symbol.iterator]()),SD.default.build(o,this.options.encoding)}while(!r);return null}close(e){if(e===void 0)return this.closed?Promise.reject(new wi.Error("ERR_DIR_CLOSED")):new Promise((r,i)=>{this.close(n=>{n?i(n):r()})});if((0,Eb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.close(e)});return}this.closed=!0;try{this.closeBase(),process.nextTick(e)}catch(r){process.nextTick(e,r)}}closeSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");this.closed=!0,this.closeBase()}read(e){if(e===void 0)return new Promise((r,i)=>{this.read((n,o)=>{n?i(n):r(o??null)})});if((0,Eb.validateCallback)(e),this.closed){process.nextTick(e,new wi.Error("ERR_DIR_CLOSED"));return}if(this.operationQueue!==null){this.operationQueue.push(()=>{this.read(e)});return}this.operationQueue=[];try{let r=this.readBase(this.iteratorInfo);process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(null,r)})}catch(r){process.nextTick(()=>{let i=this.operationQueue;this.operationQueue=null;for(let n of i)n();e(r)})}}readSync(){if(this.closed)throw new wi.Error("ERR_DIR_CLOSED");if(this.operationQueue!==null)throw new wi.Error("ERR_DIR_CONCURRENT_OPERATION");return this.readBase(this.iteratorInfo)}[Symbol.asyncIterator](){return{next:a(async()=>{try{let e=await this.read();return e!==null?{done:!1,value:e}:{done:!0,value:void 0}}catch(e){throw e}},"next"),[Symbol.asyncIterator](){return this}}}};a(Ch,"Dir");var Dh=Ch;ul.Dir=Dh});var xb=T(ur=>{"use strict";Object.defineProperty(ur,"__esModule",{value:!0});ur.toMatcher=ur.toRegex=void 0;var xD=a(t=>/[.^$+{}()|\\]/.test(t)?`\\${t}`:t,"escapeRe"),TD=a((t,e,r,i)=>{let n=e,o=[],s="",l=1;for(;n<t.length&&l>0;){let u=t[n];if(u==="(")l++,s+=u,n++;else if(u===")")if(l--,l===0){o.push(s),n++;break}else s+=u,n++;else u==="|"&&l===1?(o.push(s),s="",n++):(s+=u,n++)}if(l!==0)return;let f="",c=o.length;for(let u=0;u<c;u++)f+=(f?"|":"")+(0,ur.toRegex)(o[u],i).source.replace(/^\^/,"").replace(/\$$/,"");switch(r){case"?":return[`(?:${f})?`,n];case"*":return[`(?:${f})*`,n];case"+":return[`(?:${f})+`,n];case"@":return[`(?:${f})`,n];case"!":return[`(?!${f})[^/]*`,n]}},"parseExtGlob"),OD=a((t,e)=>{let r="",i=0,n=a(()=>{i++;let l=[],f="",c=!1;for(;i<t.length;){let h=t[i];if(h==="}"){l.push(f),i++,c=!0;break}if(h===","){l.push(f),f="",i++;continue}f+=h,i++}return c?`(?:${l.map(h=>(0,ur.toRegex)(h,e).source.replace(/^\^/,"").replace(/\$$/,"")).join("|")})`:"\\{"+xD(f)},"parseBraceGroup"),o=!!e?.extglob;for(;i<t.length;){let l=t[i];if(o&&t[i+1]==="("&&(l==="?"||l==="*"||l==="+"||l==="@"||l==="!")){let f=TD(t,i+2,l,e);if(f){r+=f[0],i=f[1];continue}}switch(l){case"*":{if(t[i+1]==="*"){let f=i+2;for(;t[f]==="*";)f++;t[f]==="/"?(r+="(?:.*/)?",i=f+1):(r+=".*",i=f)}else r+="[^/]*",i++;break}case"?":r+="[^/]",i++;break;case"[":{let f="[";for(i++,i<t.length&&t[i]==="!"&&(f+="^",i++),i<t.length&&t[i]==="]"&&(f+="]",i++);i<t.length&&t[i]!=="]";){let c=t[i];f+=c==="\\"?"\\\\":c,i++}if(i<t.length&&t[i]==="]")f+="]",i++;else{r+="\\[";continue}r+=f;break}case"{":{r+=n();break}case"/":r+="/",i++;break;case".":case"^":case"$":case"+":case"(":case")":case"|":case"\\":r+=`\\${l}`,i++;break;default:r+=l,i++;break}}let s=e?.nocase?"i":"";return new RegExp("^"+r+"$",s)},"toRegex");ur.toRegex=OD;var RD=/^\/(.{1,4096})\/([gimsuy]{0,6})$/,kD=a((t,e)=>{let r=[],i=Array.isArray(t)?t:[t];for(let n of i)if(typeof n=="string"){let o=RD.exec(n);if(o){let[,s,l]=o;r.push(new RegExp(s,l))}else r.push((0,ur.toRegex)(n,e))}else r.push(n);return r.length?new Function("p","return "+r.map(n=>n+".test(p)").join("||")):()=>!1},"toMatcher");ur.toMatcher=kD});var Rb=T(Bh=>{"use strict";Object.defineProperty(Bh,"__esModule",{value:!0});Bh.globSync=ND;var yi=Gi(),PD=xb(),Tb=Ir(),AD=yi.posix.join,ID=yi.posix.relative,DD=yi.posix.resolve;function Ob(t,e){return(0,PD.toRegex)(e).test(t)}a(Ob,"matchesPattern");function CD(t,e){return e?typeof e=="function"?e(t):(Array.isArray(e)?e:[e]).some(i=>Ob(t,i)):!1}a(CD,"isExcluded");function Nh(t,e,r,i,n=0){let o=[],s=i.maxdepth??1/0,l=i.cwd?(0,Tb.pathToFilename)(i.cwd):process.cwd();if(n>s)return o;try{let f=t.readdirSync(e,{withFileTypes:!0});for(let c of f){let u=AD(e,c.name.toString()),h=ID(l,u);if(CD(h,i.exclude))continue;if(r.some(p=>Ob(h,p))&&o.push(h),c.isDirectory()&&n<s){let p=Nh(t,u,r,i,n+1);o.push(...p)}}}catch{}return o}a(Nh,"walkDirectory");function ND(t,e,r={}){let i=r.cwd?(0,Tb.pathToFilename)(r.cwd):process.cwd(),n=DD(i),o={cwd:n,exclude:r.exclude,maxdepth:r.maxdepth,withFileTypes:r.withFileTypes||!1},s=[];if(yi.posix.isAbsolute(e)){let l=yi.posix.dirname(e),f=yi.posix.basename(e),c=Nh(t,l,[f],{...o,cwd:l});s.push(...c.map(u=>yi.posix.resolve(l,u)))}else{let l=Nh(t,n,[e],o);s.push(...l)}return s=[...new Set(s)].sort(),s}a(ND,"globSync")});var Nb=T(st=>{"use strict";Object.defineProperty(st,"__esModule",{value:!0});st.FSWatcher=st.StatWatcher=st.Volume=void 0;st.pathToSteps=JD;st.dataToStr=QD;st.toUnixTimestamp=ot;var xe=Gi(),jh=Y0(),Lh=Tf(),BD=Ys(),LD=J0(),_n=Or(),wl=cu(),$D=Q0(),yl=ub(),MD=Pt(),Ib=Sh(),gi=uo(),jD=hb(),Db=$f(),UD=db(),HD=bb(),dl=Yi(),qD=fo(),te=Fb(),I=Ir(),zD=Sb(),Le=ya(),WD=xe.resolve,{O_SYMLINK:kb,F_OK:$h,R_OK:VD,W_OK:GD,X_OK:KD,COPYFILE_EXCL:ZD,COPYFILE_FICLONE_FORCE:XD}=MD.constants,a4=xe.posix?xe.posix.sep:xe.sep,hl=xe.posix?xe.posix.relative:xe.relative,Mh=xe.posix?xe.posix.join:xe.join,Pb=xe.posix?xe.posix.dirname:xe.dirname,Ab=xe.posix?xe.posix.normalize:xe.normalize,YD=128;function JD(t){return(0,Le.filenameToSteps)((0,I.pathToFilename)(t))}a(JD,"pathToSteps");function QD(t,e=gi.ENCODING_UTF8){return _n.Buffer.isBuffer(t)?t.toString(e):t instanceof Uint8Array?(0,_n.bufferFrom)(t).toString(e):String(t)}a(QD,"dataToStr");function ot(t){if(typeof t=="string"&&+t==t)return+t;if(t instanceof Date)return t.getTime()/1e3;if(isFinite(t))return t<0?Date.now()/1e3:t;throw new Error("Cannot parse time: "+t)}a(ot,"toUnixTimestamp");function bn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.UID)}a(bn,"validateUid");function vn(t){if(typeof t!="number")throw TypeError(dl.ERRSTR.GID)}a(vn,"validateGid");var Uh=class Uh{get promises(){if(this.promisesApi===null)throw new Error("Promise is not supported in this environment.");return this.promisesApi}constructor(e=new jh.Superblock){this._core=e,this.promisesApi=new UD.FsPromises(this,jD.FileHandle),this.openSync=(f,c,u=438)=>{let h=(0,I.modeToNumber)(u),d=(0,I.pathToFilename)(f),p=(0,I.flagsToNumber)(c);return this._core.open(d,p,h,!(p&kb))},this.open=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&(d=438,p=u),d=d||438;let m=(0,I.modeToNumber)(d),w=(0,I.pathToFilename)(f),y=(0,I.flagsToNumber)(c);this.wrapAsync(this._core.open,[w,y,m,!(y&kb)],p)},this.closeSync=f=>{this._core.close(f)},this.close=(f,c)=>{(0,Le.validateFd)(f);let u=this._core.getFileByFdOrThrow(f,"close");this.wrapAsync(this._core.close,[u.fd],c)},this.readSync=(f,c,u,h,d)=>((0,Le.validateFd)(f),this._core.read(f,c,u,h,d)),this.read=(f,c,u,h,d,p)=>{if((0,I.validateCallback)(p),h===0)return(0,wl.default)(()=>{p&&p(null,0,c)});Promise.resolve().then(()=>{try{let m=this._core.read(f,c,u,h,d);p(null,m,c)}catch(m){p(m)}})},this.readv=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this._core.readv(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.readvSync=(f,c,u)=>((0,Le.validateFd)(f),this._core.readv(f,c,u??null)),this._readfile=(f,c,u)=>{let h,p=typeof f=="number"&&(0,Le.isFd)(f),m;if(p)m=f;else{let w=(0,I.pathToFilename)(f),y=String(f),v=y.length>1&&y.endsWith("/"),g=this._core.getResolvedLinkOrThrow(w,"open"),F=g.getNode();if(F.isDirectory())throw(0,I.createError)("EISDIR","open",g.getPath());if(v&&F.isFile())throw(0,I.createError)("ENOTDIR","open",y);m=this.openSync(f,c)}try{h=(0,I.bufferToEncoding)(this._core.getFileByFdOrThrow(m).getBuffer(),u)}finally{p||this.closeSync(m)}return h},this.readFileSync=(f,c)=>{let u=(0,te.getReadFileOptions)(c),h=(0,I.flagsToNumber)(u.flag);return this._readfile(f,h,u.encoding)},this.readFile=(f,c,u)=>{let[h,d]=(0,te.optsAndCbGenerator)(te.getReadFileOptions)(c,u),p=(0,I.flagsToNumber)(h.flag);this.wrapAsync(this._readfile,[f,p,h.encoding],d)},this.writeSync=(f,c,u,h,d)=>{let[,p,m,w,y]=(0,I.getWriteSyncArgs)(f,c,u,h,d);return this._write(f,p,m,w,y)},this.write=(f,c,u,h,d,p)=>{let[,m,w,y,v,g,F]=(0,I.getWriteArgs)(f,c,u,h,d,p);Promise.resolve().then(()=>{try{let O=this._write(f,w,y,v,g);m?F(null,O,c):F(null,O,w)}catch(O){F(O)}})},this.writev=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[null,u]),(0,I.validateCallback)(p),Promise.resolve().then(()=>{try{let m=this.writevBase(f,c,d);p(null,m,c)}catch(m){p(m)}})},this.writevSync=(f,c,u)=>((0,Le.validateFd)(f),this.writevBase(f,c,u??null)),this.writeFileSync=(f,c,u)=>{let h=(0,te.getWriteFileOptions)(u),d=(0,I.flagsToNumber)(h.flag),p=(0,I.modeToNumber)(h.mode),m=(0,Le.dataToBuffer)(c,h.encoding);this._core.writeFile(f,m,d,p)},this.writeFile=(f,c,u,h)=>{let d=u,p=h;typeof u=="function"&&([d,p]=[te.writeFileDefaults,u]);let m=(0,I.validateCallback)(p),w=(0,te.getWriteFileOptions)(d),y=(0,I.flagsToNumber)(w.flag),v=(0,I.modeToNumber)(w.mode),g=(0,Le.dataToBuffer)(c,w.encoding);this.wrapAsync(this._core.writeFile,[f,g,y,v],m)},this.copyFileSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);return this._copyFile(h,d,(u||0)|0)},this.copyFile=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[0,u]:[m,w]=[u,h],(0,I.validateCallback)(w),this.wrapAsync(this._copyFile,[d,p,m],w)},this._cp=(f,c,u)=>{if(u.filter&&!u.filter(f,c))return;let h=u.dereference?this.statSync(f):this.lstatSync(f),d=null;try{d=this.lstatSync(c)}catch(p){if(p.code!=="ENOENT")throw p}if(d&&h.ino===d.ino&&h.dev===d.dev)throw(0,I.createError)("EINVAL","cp",f,c);if(d){if(h.isDirectory()&&!d.isDirectory())throw(0,I.createError)("EISDIR","cp",f,c);if(!h.isDirectory()&&d.isDirectory())throw(0,I.createError)("ENOTDIR","cp",f,c)}if(h.isDirectory()&&this.isSrcSubdir(f,c))throw(0,I.createError)("EINVAL","cp",f,c);{let p=Pb(c);this.existsSync(p)||this.mkdirSync(p,{recursive:!0})}if(h.isDirectory()){if(!u.recursive)throw(0,I.createError)("EISDIR","cp",f);this.cpDirSync(h,d,f,c,u)}else if(h.isFile()||h.isCharacterDevice()||h.isBlockDevice())this.cpFileSync(h,d,f,c,u);else if(h.isSymbolicLink()&&!u.dereference)this.cpSymlinkSync(d,f,c,u);else throw(0,I.createError)("EINVAL","cp",f)},this.linkSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.link(u,h)},this.link=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.link,[h,d],u)},this.unlinkSync=f=>{let c=(0,I.pathToFilename)(f);this._core.unlink(c)},this.unlink=(f,c)=>{let u=(0,I.pathToFilename)(f);this.wrapAsync(this._core.unlink,[u],c)},this.symlinkSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this._core.symlink(h,d)},this.symlink=(f,c,u,h)=>{let d=(0,I.validateCallback)(typeof u=="function"?u:h),p=(0,I.pathToFilename)(f),m=(0,I.pathToFilename)(c);this.wrapAsync(this._core.symlink,[p,m],d)},this._lstat=(f,c=!1,u=!1)=>{let h;try{h=this._core.getLinkOrThrow(f,"lstat")}catch(d){if(d.code==="ENOENT"&&!u)return;throw d}return Lh.default.build(h.getNode(),c)},this.lstatSync=(f,c)=>{let{throwIfNoEntry:u=!0,bigint:h=!1}=(0,te.getStatOptions)(c);return this._lstat((0,I.pathToFilename)(f),h,u)},this.renameSync=(f,c)=>{let u=(0,I.pathToFilename)(f),h=(0,I.pathToFilename)(c);this._core.rename(u,h)},this.rename=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c);this.wrapAsync(this._core.rename,[h,d],u)},this.existsSync=f=>{try{return this._exists((0,I.pathToFilename)(f))}catch{return!1}},this.exists=(f,c)=>{let u=(0,I.pathToFilename)(f);if(typeof c!="function")throw Error(dl.ERRSTR.CB);Promise.resolve().then(()=>{try{c(this._exists(u))}catch{c(!1)}})},this.accessSync=(f,c=$h)=>{let u=(0,I.pathToFilename)(f);c=c|0,this._access(u,c)},this.access=(f,c,u)=>{let h=$h,d;typeof c!="function"?[h,d]=[c|0,(0,I.validateCallback)(u)]:d=c;let p=(0,I.pathToFilename)(f);this.wrapAsync(this._access,[p,h],d)},this.appendFileSync=(f,c,u)=>{let h=(0,te.getAppendFileOpts)(u);(!h.flag||(0,Le.isFd)(f))&&(h.flag="a"),this.writeFileSync(f,c,h)},this.appendFile=(f,c,u,h)=>{let[d,p]=(0,te.getAppendFileOptsAndCb)(u,h);(!d.flag||(0,Le.isFd)(f))&&(d.flag="a"),this.writeFile(f,c,d,p)},this._readdir=(f,c)=>{let u=(0,Le.filenameToSteps)(f),h=this._core.getResolvedLinkOrThrow(f,"scandir"),d=h.getNode();if(!d.isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);if(!d.canRead())throw(0,I.createError)("EACCES","scandir",f);let p=[];for(let w of h.children.keys()){let y=h.getChild(w);if(!(!y||w==="."||w==="..")&&(p.push(BD.default.build(y,c.encoding)),c.recursive&&y.children.size)){let v={...c,recursive:!0,withFileTypes:!0},g=this._readdir(y.getPath(),v);p.push(...g)}}if(!Le.isWin&&c.encoding!=="buffer"&&p.sort((w,y)=>w.name<y.name?-1:w.name>y.name?1:0),c.withFileTypes)return p;let m=f;return Le.isWin&&(m=m.replace(/\\/g,"/")),p.map(w=>{if(c.recursive){let y=Mh(w.parentPath,w.name.toString());return Le.isWin&&(y=y.replace(/\\/g,"/")),y.replace(m+xe.posix.sep,"")}return w.name})},this.readdirSync=(f,c)=>{let u=(0,te.getReaddirOptions)(c),h=(0,I.pathToFilename)(f);return this._readdir(h,u)},this.readdir=(f,c,u)=>{let[h,d]=(0,te.getReaddirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readdir,[p,h],d)},this._readlink=(f,c)=>{let h=this._core.getLinkOrThrow(f,"readlink").getNode();if(!h.isSymlink())throw(0,I.createError)("EINVAL","readlink",f);return(0,gi.strToEncoding)(h.symlink,c)},this.readlinkSync=(f,c)=>{let u=(0,te.getDefaultOpts)(c),h=(0,I.pathToFilename)(f);return this._readlink(h,u.encoding)},this.readlink=(f,c,u)=>{let[h,d]=(0,te.getDefaultOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._readlink,[p,h.encoding],d)},this._fsync=f=>{this._core.getFileByFdOrThrow(f,"fsync")},this.fsyncSync=f=>{this._fsync(f)},this.fsync=(f,c)=>{this.wrapAsync(this._fsync,[f],c)},this._fdatasync=f=>{this._core.getFileByFdOrThrow(f,"fdatasync")},this.fdatasyncSync=f=>{this._fdatasync(f)},this.fdatasync=(f,c)=>{this.wrapAsync(this._fdatasync,[f],c)},this._ftruncate=(f,c)=>{this._core.getFileByFdOrThrow(f,"ftruncate").truncate(c)},this.ftruncateSync=(f,c)=>{this._ftruncate(f,c)},this.ftruncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);this.wrapAsync(this._ftruncate,[f,h],d)},this._truncate=(f,c)=>{let u=this.openSync(f,"r+");try{this.ftruncateSync(u,c)}finally{this.closeSync(u)}},this.truncateSync=(f,c)=>{if((0,Le.isFd)(f))return this.ftruncateSync(f,c);this._truncate(f,c)},this.truncate=(f,c,u)=>{let h=typeof c=="number"?c:0,d=(0,I.validateCallback)(typeof c=="number"?u:c);if((0,Le.isFd)(f))return this.ftruncate(f,h,d);this.wrapAsync(this._truncate,[f,h],d)},this._futimes=(f,c,u)=>{let d=this._core.getFileByFdOrThrow(f,"futimes").node;d.atime=new Date(c*1e3),d.mtime=new Date(u*1e3)},this.futimesSync=(f,c,u)=>{this._futimes(f,ot(c),ot(u))},this.futimes=(f,c,u,h)=>{this.wrapAsync(this._futimes,[f,ot(c),ot(u)],h)},this._utimes=(f,c,u,h=!0)=>{let d=this._core,m=(h?d.getResolvedLinkOrThrow(f,"utimes"):d.getLinkOrThrow(f,"lutimes")).getNode();m.atime=new Date(c*1e3),m.mtime=new Date(u*1e3)},this.utimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!0)},this.utimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!0],h)},this.lutimesSync=(f,c,u)=>{this._utimes((0,I.pathToFilename)(f),ot(c),ot(u),!1)},this.lutimes=(f,c,u,h)=>{this.wrapAsync(this._utimes,[(0,I.pathToFilename)(f),ot(c),ot(u),!1],h)},this.mkdirSync=(f,c)=>{let u=(0,te.getMkdirOptions)(c),h=(0,I.modeToNumber)(u.mode,511),d=(0,I.pathToFilename)(f);if(u.recursive)return this._core.mkdirp(d,h);this._core.mkdir(d,h)},this.mkdir=(f,c,u)=>{let h=(0,te.getMkdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u),p=(0,I.modeToNumber)(h.mode,511),m=(0,I.pathToFilename)(f);h.recursive?this.wrapAsync(this._core.mkdirp,[m,p],d):this.wrapAsync(this._core.mkdir,[m,p],d)},this._mkdtemp=(f,c,u=5)=>{let h=f+(0,I.genRndStr6)();try{return this._core.mkdir(h,511),(0,gi.strToEncoding)(h,c)}catch(d){if(d.code==="EEXIST"){if(u>1)return this._mkdtemp(f,c,u-1);throw Error("Could not create temp dir.")}else throw d}},this.mkdtempSync=(f,c)=>{let{encoding:u}=(0,te.getDefaultOpts)(c);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");return(0,I.nullCheck)(f),this._mkdtemp(f,u)},this.mkdtemp=(f,c,u)=>{let[{encoding:h},d]=(0,te.getDefaultOptsAndCb)(c,u);if(!f||typeof f!="string")throw new TypeError("filename prefix is required");(0,I.nullCheck)(f)&&this.wrapAsync(this._mkdtemp,[f,h],d)},this.rmdirSync=(f,c)=>{let u=(0,te.getRmdirOptions)(c);this._core.rmdir((0,I.pathToFilename)(f),u.recursive)},this.rmdir=(f,c,u)=>{let h=(0,te.getRmdirOptions)(c),d=(0,I.validateCallback)(typeof c=="function"?c:u);this.wrapAsync(this._core.rmdir,[(0,I.pathToFilename)(f),h.recursive],d)},this.rmSync=(f,c)=>{this._core.rm((0,I.pathToFilename)(f),c?.force,c?.recursive)},this.rm=(f,c,u)=>{let[h,d]=(0,te.getRmOptsAndCb)(c,u);this.wrapAsync(this._core.rm,[(0,I.pathToFilename)(f),h?.force,h?.recursive],d)},this._fchmod=(f,c)=>{this._core.getFileByFdOrThrow(f,"fchmod").chmod(c)},this.fchmodSync=(f,c)=>{this._fchmod(f,(0,I.modeToNumber)(c))},this.fchmod=(f,c,u)=>{this.wrapAsync(this._fchmod,[f,(0,I.modeToNumber)(c)],u)},this._chmod=(f,c,u=!0)=>{(u?this._core.getResolvedLinkOrThrow(f,"chmod"):this._core.getLinkOrThrow(f,"chmod")).getNode().chmod(c)},this.chmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._chmod(h,u,!0)},this.chmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._chmod,[d,h],u)},this._lchmod=(f,c)=>{this._chmod(f,c,!1)},this.lchmodSync=(f,c)=>{let u=(0,I.modeToNumber)(c),h=(0,I.pathToFilename)(f);this._lchmod(h,u)},this.lchmod=(f,c,u)=>{let h=(0,I.modeToNumber)(c),d=(0,I.pathToFilename)(f);this.wrapAsync(this._lchmod,[d,h],u)},this._fchown=(f,c,u)=>{this._core.getFileByFdOrThrow(f,"fchown").chown(c,u)},this.fchownSync=(f,c,u)=>{bn(c),vn(u),this._fchown(f,c,u)},this.fchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._fchown,[f,c,u],h)},this._chown=(f,c,u)=>{this._core.getResolvedLinkOrThrow(f,"chown").getNode().chown(c,u)},this.chownSync=(f,c,u)=>{bn(c),vn(u),this._chown((0,I.pathToFilename)(f),c,u)},this.chown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._chown,[(0,I.pathToFilename)(f),c,u],h)},this._lchown=(f,c,u)=>{this._core.getLinkOrThrow(f,"lchown").getNode().chown(c,u)},this.lchownSync=(f,c,u)=>{bn(c),vn(u),this._lchown((0,I.pathToFilename)(f),c,u)},this.lchown=(f,c,u,h)=>{bn(c),vn(u),this.wrapAsync(this._lchown,[(0,I.pathToFilename)(f),c,u],h)},this.statWatchers={},this.cpSync=(f,c,u)=>{let h=(0,I.pathToFilename)(f),d=(0,I.pathToFilename)(c),p={dereference:u?.dereference??!1,errorOnExist:u?.errorOnExist??!1,filter:u?.filter,force:u?.force??!0,mode:u?.mode??0,preserveTimestamps:u?.preserveTimestamps??!1,recursive:u?.recursive??!1,verbatimSymlinks:u?.verbatimSymlinks??!1};return this._cp(h,d,p)},this.cp=(f,c,u,h)=>{let d=(0,I.pathToFilename)(f),p=(0,I.pathToFilename)(c),m,w;typeof u=="function"?[m,w]=[{},u]:[m,w]=[u||{},h],(0,I.validateCallback)(w);let y={dereference:m?.dereference??!1,errorOnExist:m?.errorOnExist??!1,filter:m?.filter,force:m?.force??!0,mode:m?.mode??0,preserveTimestamps:m?.preserveTimestamps??!1,recursive:m?.recursive??!1,verbatimSymlinks:m?.verbatimSymlinks??!1};this.wrapAsync(this._cp,[d,p,y],w)},this.openAsBlob=async(f,c)=>{let u=(0,I.pathToFilename)(f),h;try{h=this._core.getResolvedLinkOrThrow(u,"open")}catch(w){throw w&&typeof w=="object"&&w.code==="ENOENT"?new qD.TypeError("ERR_INVALID_ARG_VALUE"):w}let p=h.getNode().getBuffer(),m=c?.type||"";return new Blob([p],{type:m})},this.glob=(f,...c)=>{let[u,h]=c.length===1?[{},c[0]]:[c[0],c[1]];this.wrapAsync(this._globSync,[f,u||{}],h)},this.globSync=(f,c={})=>this._globSync(f,c),this._globSync=(f,c={})=>{let{globSync:u}=Rb();return u(this,f,c)},this._opendir=(f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"scandir");if(!u.getNode().isDirectory())throw(0,I.createError)("ENOTDIR","scandir",f);return new zD.Dir(u,c)},this.opendirSync=(f,c)=>{let u=(0,te.getOpendirOptions)(c),h=(0,I.pathToFilename)(f);return this._opendir(h,u)},this.opendir=(f,c,u)=>{let[h,d]=(0,te.getOpendirOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);this.wrapAsync(this._opendir,[p,h],d)};let r=this;this.StatWatcher=class extends pl{constructor(){super(r)}};let i=Xt;this.ReadStream=class extends i{constructor(...f){super(r,...f)}};let n=bt;this.WriteStream=class extends n{constructor(...f){super(r,...f)}},this.FSWatcher=class extends ml{constructor(){super(r)}};let o=a((f,c)=>{let u=this._core.getResolvedLinkOrThrow(f,"realpath");return(0,gi.strToEncoding)(u.getPath()||"/",c)},"_realpath"),s=a((f,c,u)=>{let[h,d]=(0,te.getRealpathOptsAndCb)(c,u),p=(0,I.pathToFilename)(f);r.wrapAsync(o,[p,h.encoding],d)},"realpathImpl"),l=a((f,c)=>o((0,I.pathToFilename)(f),(0,te.getRealpathOptions)(c).encoding),"realpathSyncImpl");this.realpath=s,this.realpath.native=s,this.realpathSync=l,this.realpathSync.native=l}wrapAsync(e,r,i){(0,I.validateCallback)(i),Promise.resolve().then(()=>{let n;try{n=e.apply(this,r)}catch(o){i(o);return}i(null,n)})}toTree(e={separator:xe.sep}){return(0,HD.toTreeSync)(this,e)}reset(){this._core.reset()}toJSON(e,r={},i=!1,n=!1){return this._core.toJSON(e,r,i,n)}fromJSON(e,r){return this._core.fromJSON(e,r)}fromNestedJSON(e,r){return this._core.fromNestedJSON(e,r)}mountSync(e,r){this._core.fromJSON(r,e)}_write(e,r,i,n,o){let s=this._core.getFileByFdOrThrow(e,"write");if(s.node.isSymlink())throw(0,I.createError)("EBADF","write",s.link.getPath());return s.write(r,i,n,o===-1||typeof o!="number"?void 0:o)}writevBase(e,r,i){let n=this._core.getFileByFdOrThrow(e),o=i??void 0;o===-1&&(o=void 0);let s=0;for(let l of r){let f=_n.Buffer.from(l.buffer,l.byteOffset,l.byteLength),c=n.write(f,0,f.byteLength,o);if(o=void 0,s+=c,c<f.byteLength)break}return s}_copyFile(e,r,i){let n=this.readFileSync(e);if(i&ZD&&this.existsSync(r))throw(0,I.createError)("EEXIST","copyFile",e,r);if(i&XD)throw(0,I.createError)("ENOSYS","copyFile",e,r);this._core.writeFile(r,n,dl.FLAGS.w,438)}isSrcSubdir(e,r){try{let i=Ab(e.startsWith("/")?e:"/"+e),n=Ab(r.startsWith("/")?r:"/"+r);if(i===n)return!0;let o=hl(i,n);return o===""||!o.startsWith("..")&&!(0,xe.isAbsolute)(o)}catch{return!1}}cpFileSync(e,r,i,n,o){if(r){if(o.errorOnExist)throw(0,I.createError)("EEXIST","cp",n);if(!o.force)return;this.unlinkSync(n)}this.copyFileSync(i,n,o.mode),o.preserveTimestamps&&this.utimesSync(n,e.atime,e.mtime),this.chmodSync(n,Number(e.mode))}cpDirSync(e,r,i,n,o){r||this.mkdirSync(n);let s=this.readdirSync(i);for(let l of s){let f=Mh(i,String(l)),c=Mh(n,String(l));o.filter&&!o.filter(f,c)||this._cp(f,c,o)}this.chmodSync(n,Number(e.mode))}cpSymlinkSync(e,r,i,n){let o=String(this.readlinkSync(r));!n.verbatimSymlinks&&!(0,xe.isAbsolute)(o)&&(o=WD(Pb(r),o)),e&&this.unlinkSync(i),this.symlinkSync(o,i)}lstat(e,r,i){let[{throwIfNoEntry:n=!0,bigint:o=!1},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._lstat,[(0,I.pathToFilename)(e),o,n],s)}_stat(e,r=!1,i=!0){let n;try{n=this._core.getResolvedLinkOrThrow(e,"stat")}catch(o){if(o.code==="ENOENT"&&!i)return;throw o}return Lh.default.build(n.getNode(),r)}statSync(e,r){let{bigint:i=!0,throwIfNoEntry:n=!0}=(0,te.getStatOptions)(r);return this._stat((0,I.pathToFilename)(e),i,n)}stat(e,r,i){let[{bigint:n=!1,throwIfNoEntry:o=!0},s]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this._stat,[(0,I.pathToFilename)(e),n,o],s)}fstatBase(e,r=!1){let i=this._core.getFileByFd(e);if(!i)throw(0,I.createError)("EBADF","fstat");return Lh.default.build(i.node,r)}fstatSync(e,r){return this.fstatBase(e,(0,te.getStatOptions)(r).bigint)}fstat(e,r,i){let[n,o]=(0,te.getStatOptsAndCb)(r,i);this.wrapAsync(this.fstatBase,[e,n.bigint],o)}_exists(e){return!!this._stat(e)}_access(e,r){let n=this._core.getLinkOrThrow(e,"access").getNode();if(r!==$h&&(r&VD&&!n.canRead()||r&GD&&!n.canWrite()||r&KD&&!n.canExecute()))throw(0,I.createError)("EACCES","access",e)}watchFile(e,r,i){let n=(0,I.pathToFilename)(e),o=r,s=i;if(typeof o=="function"&&(s=r,o=null),typeof s!="function")throw Error('"watchFile()" requires a listener function');let l=5007,f=!0;o&&typeof o=="object"&&(typeof o.interval=="number"&&(l=o.interval),typeof o.persistent=="boolean"&&(f=o.persistent));let c=this.statWatchers[n];return c||(c=new this.StatWatcher,c.start(n,f,l),this.statWatchers[n]=c),c.addListener("change",s),c}unwatchFile(e,r){let i=(0,I.pathToFilename)(e),n=this.statWatchers[i];n&&(typeof r=="function"?n.removeListener("change",r):n.removeAllListeners("change"),n.listenerCount("change")===0&&(n.stop(),delete this.statWatchers[i]))}createReadStream(e,r){return new this.ReadStream(e,r)}createWriteStream(e,r){return new this.WriteStream(e,r)}watch(e,r,i){let n=(0,I.pathToFilename)(e),o=r;typeof r=="function"&&(i=r,o=null);let{persistent:s,recursive:l,encoding:f}=(0,te.getDefaultOpts)(o);s===void 0&&(s=!0),l===void 0&&(l=!1);let c=new this.FSWatcher;return c.start(n,s,l,f),i&&c.addListener("change",i),c}_statfs(e,r=!1){return this._core.getResolvedLinkOrThrow(e,"statfs"),LD.default.build(this._core,r)}statfsSync(e,r){let{bigint:i=!1}=(0,te.getStatfsOptions)(r);return this._statfs((0,I.pathToFilename)(e),i)}statfs(e,r,i){let[{bigint:n=!1},o]=(0,te.getStatfsOptsAndCb)(r,i);this.wrapAsync(this._statfs,[(0,I.pathToFilename)(e),n],o)}};a(Uh,"Volume");var bi=Uh;st.Volume=bi;bi.fromJSON=(t,e)=>new bi(jh.Superblock.fromJSON(t,e));bi.fromNestedJSON=(t,e)=>new bi(jh.Superblock.fromNestedJSON(t,e));function eC(t){t.emit("stop")}a(eC,"emitStop");var Hh=class Hh extends Ib.EventEmitter{constructor(e){super(),this.onInterval=()=>{try{let r=this.vol.statSync(this.filename);this.hasChanged(r)&&(this.emit("change",r,this.prev),this.prev=r)}finally{this.loop()}},this.vol=e}loop(){this.timeoutRef=this.setTimeout(this.onInterval,this.interval)}hasChanged(e){return e.mtimeMs>this.prev.mtimeMs||e.nlink!==this.prev.nlink}start(e,r=!0,i=5007){this.filename=(0,I.pathToFilename)(e),this.setTimeout=r?setTimeout.bind(globalThis):$D.default,this.interval=i,this.prev=this.vol.statSync(this.filename),this.loop()}stop(){clearTimeout(this.timeoutRef),(0,wl.default)(()=>{eC.call(this,this)})}};a(Hh,"StatWatcher");var pl=Hh;st.StatWatcher=pl;var gt;function tC(t){gt=(0,_n.bufferAllocUnsafe)(t),gt.used=0}a(tC,"allocNewPool");(0,Db.inherits)(Xt,yl.Readable);st.ReadStream=Xt;function Xt(t,e,r){if(!(this instanceof Xt))return new Xt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),r.highWaterMark===void 0&&(r.highWaterMark=64*1024),yl.Readable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"r":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.end=r.end,this.autoClose=r.autoClose===void 0?!0:r.autoClose,this.pos=void 0,this.bytesRead=0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.end===void 0)this.end=1/0;else if(typeof this.end!="number")throw new TypeError('"end" option must be a Number');if(this.start>this.end)throw new Error('"start" option must be <= "end" option');this.pos=this.start}typeof this.fd!="number"&&this.open(),this.on("end",function(){this.autoClose&&this.destroy&&this.destroy()})}a(Xt,"FsReadStream");Xt.prototype.open=function(){var t=this;this._vol.open(this.path,this.flags,this.mode,(e,r)=>{if(e){t.autoClose&&t.destroy&&t.destroy(),t.emit("error",e);return}t.fd=r,t.emit("open",r),t.read()})};Xt.prototype._read=function(t){if(typeof this.fd!="number")return this.once("open",function(){this._read(t)});if(this.destroyed)return;(!gt||gt.length-gt.used<YD)&&tC(this._readableState.highWaterMark);var e=gt,r=Math.min(gt.length-gt.used,t),i=gt.used;if(this.pos!==void 0&&(r=Math.min(this.end-this.pos+1,r)),r<=0)return this.push(null);var n=this;this._vol.read(this.fd,gt,gt.used,r,this.pos,o),this.pos!==void 0&&(this.pos+=r),gt.used+=r;function o(s,l){if(s)n.autoClose&&n.destroy&&n.destroy(),n.emit("error",s);else{var f=null;l>0&&(n.bytesRead+=l,f=e.slice(i,i+l)),n.push(f)}}a(o,"onread")};Xt.prototype._destroy=function(t,e){this.close(r=>{e(t||r)})};Xt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Cb);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._readableState?.closed=="boolean"?this._readableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};function Cb(t){this.close()}a(Cb,"closeOnOpen");(0,Db.inherits)(bt,yl.Writable);st.WriteStream=bt;function bt(t,e,r){if(!(this instanceof bt))return new bt(t,e,r);if(this._vol=t,r=Object.assign({},(0,te.getOptions)(r,{})),yl.Writable.call(this,r),this.path=(0,I.pathToFilename)(e),this.fd=r.fd===void 0?null:typeof r.fd!="number"?r.fd.fd:r.fd,this.flags=r.flags===void 0?"w":r.flags,this.mode=r.mode===void 0?438:r.mode,this.start=r.start,this.autoClose=r.autoClose===void 0?!0:!!r.autoClose,this.pos=void 0,this.bytesWritten=0,this.pending=!0,this.start!==void 0){if(typeof this.start!="number")throw new TypeError('"start" option must be a Number');if(this.start<0)throw new Error('"start" must be >= zero');this.pos=this.start}r.encoding&&this.setDefaultEncoding(r.encoding),typeof this.fd!="number"&&this.open(),this.once("finish",function(){this.autoClose&&this.close()})}a(bt,"FsWriteStream");bt.prototype.open=function(){this._vol.open(this.path,this.flags,this.mode,function(t,e){if(t){this.autoClose&&this.destroy&&this.destroy(),this.emit("error",t);return}this.fd=e,this.pending=!1,this.emit("open",e)}.bind(this))};bt.prototype._write=function(t,e,r){if(!(t instanceof _n.Buffer||t instanceof Uint8Array))return this.emit("error",new Error("Invalid data"));if(typeof this.fd!="number")return this.once("open",function(){this._write(t,e,r)});var i=this;this._vol.write(this.fd,t,0,t.length,this.pos,(n,o)=>{if(n)return i.autoClose&&i.destroy&&i.destroy(),r(n);i.bytesWritten+=o,r()}),this.pos!==void 0&&(this.pos+=t.length)};bt.prototype._writev=function(t,e){if(typeof this.fd!="number")return this.once("open",function(){this._writev(t,e)});let r=this,i=t.length,n=new Array(i);for(var o=0,s=0;s<i;s++){var l=t[s].chunk;n[s]=l,o+=l.length}let f=_n.Buffer.concat(n);this._vol.write(this.fd,f,0,f.length,this.pos,(c,u)=>{if(c)return r.destroy&&r.destroy(),e(c);r.bytesWritten+=u,e()}),this.pos!==void 0&&(this.pos+=o)};bt.prototype.close=function(t){if(t&&this.once("close",t),this.closed||typeof this.fd!="number"){if(typeof this.fd!="number"){this.once("open",Cb);return}return(0,wl.default)(()=>this.emit("close"))}typeof this._writableState?.closed=="boolean"?this._writableState.closed=!0:this.closed=!0,this._vol.close(this.fd,e=>{e?this.emit("error",e):this.emit("close")}),this.fd=null};bt.prototype._destroy=Xt.prototype._destroy;bt.prototype.destroySoon=bt.prototype.end;var qh=class qh extends Ib.EventEmitter{constructor(e){super(),this._filename="",this._filenameEncoded="",this._recursive=!1,this._encoding=gi.ENCODING_UTF8,this._listenerRemovers=new Map,this._onParentChild=r=>{r.getName()===this._getName()&&this._emit("rename")},this._emit=r=>{this.emit("change",r,this._filenameEncoded)},this._persist=()=>{this._timer=setTimeout(this._persist,1e6)},this._vol=e}_getName(){return this._steps[this._steps.length-1]}start(e,r=!0,i=!1,n=gi.ENCODING_UTF8){this._filename=(0,I.pathToFilename)(e),this._steps=(0,Le.filenameToSteps)(this._filename),this._filenameEncoded=(0,gi.strToEncoding)(this._filename),this._recursive=i,this._encoding=n;try{this._link=this._vol._core.getLinkOrThrow(this._filename,"FSWatcher")}catch(f){let c=new Error(`watch ${this._filename} ${f.code}`);throw c.code=f.code,c.errno=f.code,c}let o=a(f=>{let c=f.getPath(),u=f.getNode(),h=a(()=>{let m=hl(this._filename,c);return m||(m=this._getName()),this.emit("change","change",m)},"onNodeChange"),d=u.changes.listen(([m])=>{m==="modify"&&h()}),p=this._listenerRemovers.get(u.ino)??[];p.push(()=>d()),this._listenerRemovers.set(u.ino,p)},"watchLinkNodeChanged"),s=a(f=>{let c=f.getNode(),u=a(m=>{this.emit("change","rename",hl(this._filename,m.getPath())),o(m),s(m)},"onLinkChildAdd"),h=a(m=>{let w=a(y=>{let v=y.getNode().ino,g=this._listenerRemovers.get(v);g&&(g.forEach(F=>F()),this._listenerRemovers.delete(v));for(let[F,O]of y.children.entries())O&&F!=="."&&F!==".."&&w(O)},"removeLinkNodeListeners");w(m),this.emit("change","rename",hl(this._filename,m.getPath()))},"onLinkChildDelete");for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&o(w);let d=f.changes.listen(([m,w])=>{m==="child:add"?u(w):m==="child:del"&&h(w)});if((this._listenerRemovers.get(c.ino)??[]).push(()=>{d()}),i)for(let[m,w]of f.children.entries())w&&m!=="."&&m!==".."&&s(w)},"watchLinkChildrenChanged");o(this._link),s(this._link);let l=this._link.parent;l&&l.changes.listen(([f,c])=>{f==="child:del"&&this._onParentChild(c)}),r&&this._persist()}close(){clearTimeout(this._timer),this._listenerRemovers.forEach(e=>{e.forEach(r=>r())}),this._listenerRemovers.clear(),this._parentChangesUnsub?.()}};a(qh,"FSWatcher");var ml=qh;st.FSWatcher=ml});var Bb=T(gl=>{"use strict";Object.defineProperty(gl,"__esModule",{value:!0});gl.fsSynchronousApiList=void 0;gl.fsSynchronousApiList=["accessSync","appendFileSync","chmodSync","chownSync","closeSync","copyFileSync","existsSync","fchmodSync","fchownSync","fdatasyncSync","fstatSync","fsyncSync","ftruncateSync","futimesSync","lchmodSync","lchownSync","linkSync","lstatSync","mkdirSync","mkdtempSync","openSync","opendirSync","readdirSync","readFileSync","readlinkSync","readSync","readvSync","realpathSync","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","lutimesSync","writeFileSync","writeSync","writevSync"]});var Lb=T(bl=>{"use strict";Object.defineProperty(bl,"__esModule",{value:!0});bl.fsCallbackApiList=void 0;bl.fsCallbackApiList=["access","appendFile","chmod","chown","close","copyFile","cp","createReadStream","createWriteStream","exists","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","openAsBlob","opendir","read","readv","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","statfs","symlink","truncate","unlink","unwatchFile","utimes","lutimes","watch","watchFile","write","writev","writeFile"]});var Fn=T((at,vl)=>{"use strict";Object.defineProperty(at,"__esModule",{value:!0});at.memfs=at.fs=at.vol=at.Volume=void 0;at.createFsFromVolume=zh;var rC=Tf(),iC=Ys(),_l=Nb();Object.defineProperty(at,"Volume",{enumerable:!0,get:a(function(){return _l.Volume},"get")});var $b=Pt(),nC=Bb(),oC=Lb(),{F_OK:sC,R_OK:aC,W_OK:lC,X_OK:cC}=$b.constants;at.vol=new _l.Volume;function zh(t){let e={F_OK:sC,R_OK:aC,W_OK:lC,X_OK:cC,constants:$b.constants,Stats:rC.default,Dirent:iC.default};for(let r of nC.fsSynchronousApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));for(let r of oC.fsCallbackApiList)typeof t[r]=="function"&&(e[r]=t[r].bind(t));return e.StatWatcher=t.StatWatcher,e.FSWatcher=t.FSWatcher,e.WriteStream=t.WriteStream,e.ReadStream=t.ReadStream,e.promises=t.promises,typeof t.realpath=="function"&&(e.realpath=t.realpath.bind(t),typeof t.realpath.native=="function"&&(e.realpath.native=t.realpath.native.bind(t))),typeof t.realpathSync=="function"&&(e.realpathSync=t.realpathSync.bind(t),typeof t.realpathSync.native=="function"&&(e.realpathSync.native=t.realpathSync.native.bind(t))),e._toUnixTimestamp=_l.toUnixTimestamp,e.__vol=t,e}a(zh,"createFsFromVolume");at.fs=zh(at.vol);var fC=a((t={},e="/")=>{let r=_l.Volume.fromNestedJSON(t,e);return{fs:zh(r),vol:r}},"memfs");at.memfs=fC;vl.exports={...vl.exports,...at.fs};vl.exports.semantic=!0});var od=T((D4,Rl)=>{function qb(t){return Array.isArray(t)?t:[t]}a(qb,"makeArray");var uC=void 0,Yh="",Ub=" ",Xh="\\",hC=/^\s+$/,dC=/(?:[^\\]|^)\\$/,pC=/^\\!/,mC=/^\\#/,wC=/\r?\n/g,yC=/^\.{0,2}\/|^\.{1,2}$/,gC=/\/$/,En="/",zb="node-ignore";typeof Symbol<"u"&&(zb=Symbol.for("node-ignore"));var Wb=zb,Sn=a((t,e,r)=>(Object.defineProperty(t,e,{value:r}),r),"define"),bC=/([0-z])-([0-z])/g,Vb=a(()=>!1,"RETURN_FALSE"),vC=a(t=>t.replace(bC,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:Yh),"sanitizeRange"),_C=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),FC=[[/^\uFEFF/,()=>Yh],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?Ub:Yh)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+Ub}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Xh],[/\\\\/g,()=>Xh],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Xh?`\\[${r}${_C(i)}${n}`:n==="]"&&i.length%2===0?`[${vC(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`]],EC=/(^|\\\/)?\\\*$/,Wo="regex",Tl="checkRegex",Hb="_",SC={[Wo](t,e){return`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`},[Tl](t,e){return`${e?`${e}[^/]*`:"[^/]*"}(?=$|\\/$)`}},xC=a(t=>FC.reduce((e,[r,i])=>e.replace(r,i.bind(t)),t),"makeRegexPrefix"),Ol=a(t=>typeof t=="string","isString"),TC=a(t=>t&&Ol(t)&&!hC.test(t)&&!dC.test(t)&&t.indexOf("#")!==0,"checkPattern"),OC=a(t=>t.split(wC).filter(Boolean),"splitPattern"),rd=class rd{constructor(e,r,i,n,o,s){this.pattern=e,this.mark=r,this.negative=o,Sn(this,"body",i),Sn(this,"ignoreCase",n),Sn(this,"regexPrefix",s)}get regex(){let e=Hb+Wo;return this[e]?this[e]:this._make(Wo,e)}get checkRegex(){let e=Hb+Tl;return this[e]?this[e]:this._make(Tl,e)}_make(e,r){let i=this.regexPrefix.replace(EC,SC[e]),n=this.ignoreCase?new RegExp(i,"i"):new RegExp(i);return Sn(this,r,n)}};a(rd,"IgnoreRule");var Jh=rd,RC=a(({pattern:t,mark:e},r)=>{let i=!1,n=t;n.indexOf("!")===0&&(i=!0,n=n.substr(1)),n=n.replace(pC,"!").replace(mC,"#");let o=xC(n);return new Jh(t,e,n,r,i,o)},"createRule"),id=class id{constructor(e){this._ignoreCase=e,this._rules=[]}_add(e){if(e&&e[Wb]){this._rules=this._rules.concat(e._rules._rules),this._added=!0;return}if(Ol(e)&&(e={pattern:e}),TC(e.pattern)){let r=RC(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,qb(Ol(e)?OC(e):e).forEach(this._add,this),this._added}test(e,r,i){let n=!1,o=!1,s;this._rules.forEach(f=>{let{negative:c}=f;o===c&&n!==o||c&&!n&&!o&&!r||!f[i].test(e)||(n=!c,o=c,s=c?uC:f)});let l={ignored:n,unignored:o};return s&&(l.rule=s),l}};a(id,"RuleManager");var Qh=id,kC=a((t,e)=>{throw new e(t)},"throwError"),hr=a((t,e,r)=>Ol(t)?t?hr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),Gb=a(t=>yC.test(t),"isNotRelative");hr.isNotRelative=Gb;hr.convert=t=>t;var nd=class nd{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){Sn(this,Wb,!0),this._rules=new Qh(r),this._strictPathCheck=!i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}add(e){return this._rules.add(e)&&this._initCache(),this}addPattern(e){return this.add(e)}_test(e,r,i,n){let o=e&&hr.convert(e);return hr(o,e,this._strictPathCheck?kC:Vb),this._t(o,r,i,n)}checkIgnore(e){if(!gC.test(e))return this.test(e);let r=e.split(En).filter(Boolean);if(r.pop(),r.length){let i=this._t(r.join(En)+En,this._testCache,!0,r);if(i.ignored)return i}return this._rules.test(e,!1,Tl)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(En).filter(Boolean)),n.pop(),!n.length)return r[e]=this._rules.test(e,i,Wo);let o=this._t(n.join(En)+En,r,i,n);return r[e]=o.ignored?o:this._rules.test(e,i,Wo)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return qb(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(nd,"Ignore");var ed=nd,td=a(t=>new ed(t),"factory"),PC=a(t=>hr(t&&hr.convert(t),t,Vb),"isPathValid"),Kb=a(()=>{let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");hr.convert=t;let e=/^[a-z]:\//i;hr.isNotRelative=r=>e.test(r)||Gb(r)},"setupWindows");typeof process<"u"&&process.platform==="win32"&&Kb();Rl.exports=td;td.default=td;Rl.exports.isPathValid=PC;Sn(Rl.exports,Symbol.for("setupWindows"),Kb)});var Jb=T((H4,Yb)=>{"use strict";var lt=a(function(t){if(t=t||{},this.Promise=t.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=t.domainReentrant||!1,this.domainReentrant){if(typeof process>"u"||typeof process.domain>"u")throw new Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=t.timeout||lt.DEFAULT_TIMEOUT,this.maxOccupationTime=t.maxOccupationTime||lt.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=t.maxExecutionTime||lt.DEFAULT_MAX_EXECUTION_TIME,t.maxPending===1/0||Number.isInteger(t.maxPending)&&t.maxPending>=0?this.maxPending=t.maxPending:this.maxPending=lt.DEFAULT_MAX_PENDING},"AsyncLock");lt.DEFAULT_TIMEOUT=0;lt.DEFAULT_MAX_OCCUPATION_TIME=0;lt.DEFAULT_MAX_EXECUTION_TIME=0;lt.DEFAULT_MAX_PENDING=1e3;lt.prototype.acquire=function(t,e,r,i){if(Array.isArray(t))return this._acquireBatch(t,e,r,i);if(typeof e!="function")throw new Error("You must pass a function to execute");var n=null,o=null,s=null;typeof r!="function"&&(i=r,r=null,s=new this.Promise(function(g,F){n=g,o=F})),i=i||{};var l=!1,f=null,c=null,u=null,h=this,d=a(function(g,F,O){c&&(clearTimeout(c),c=null),u&&(clearTimeout(u),u=null),g&&(h.queues[t]&&h.queues[t].length===0&&delete h.queues[t],h.domainReentrant&&delete h.domains[t]),l||(s?F?o(F):n(O):typeof r=="function"&&r(F,O),l=!0),g&&h.queues[t]&&h.queues[t].length>0&&h.queues[t].shift()()},"done"),p=a(function(g){if(l)return d(g);f&&(clearTimeout(f),f=null),h.domainReentrant&&g&&(h.domains[t]=process.domain);var F=i.maxExecutionTime||h.maxExecutionTime;if(F&&(u=setTimeout(function(){h.queues[t]&&d(g,new Error("Maximum execution time is exceeded "+t))},F)),e.length===1){var O=!1;try{e(function(S,R){O||(O=!0,d(g,S,R))})}catch(S){O||(O=!0,d(g,S))}}else h._promiseTry(function(){return e()}).then(function(S){d(g,void 0,S)},function(S){d(g,S)})},"exec");h.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=i.maxPending||h.maxPending;if(!h.queues[t])h.queues[t]=[],p(!0);else if(h.domainReentrant&&process.domain&&process.domain===h.domains[t])p(!1);else if(h.queues[t].length>=m)d(!1,new Error("Too many pending tasks in queue "+t));else{var w=a(function(){p(!0)},"taskFn");i.skipQueue?h.queues[t].unshift(w):h.queues[t].push(w);var y=i.timeout||h.timeout;y&&(f=setTimeout(function(){f=null,d(!1,new Error("async-lock timed out in queue "+t))},y))}var v=i.maxOccupationTime||h.maxOccupationTime;if(v&&(c=setTimeout(function(){h.queues[t]&&d(!1,new Error("Maximum occupation time is exceeded in queue "+t))},v)),s)return s};lt.prototype._acquireBatch=function(t,e,r,i){typeof r!="function"&&(i=r,r=null);var n=this,o=a(function(l,f){return function(c){n.acquire(l,f,c,i)}},"getFn"),s=t.reduceRight(function(l,f){return o(f,l)},e);if(typeof r=="function")s(r);else return new this.Promise(function(l,f){s.length===1?s(function(c,u){c?f(c):l(u)}):l(s())})};lt.prototype.isBusy=function(t){return t?!!this.queues[t]:Object.keys(this.queues).length>0};lt.prototype._promiseTry=function(t){try{return this.Promise.resolve(t())}catch(e){return this.Promise.reject(e)}};Yb.exports=lt});var ev=T((z4,Qb)=>{"use strict";Qb.exports=Jb()});var rv=T((W4,tv)=>{var AC={}.toString;tv.exports=Array.isArray||function(t){return AC.call(t)=="[object Array]"}});var sv=T((V4,ov)=>{"use strict";var nv=Function.prototype.toString,xn=typeof Reflect=="object"&&Reflect!==null&&Reflect.apply,cd,Al;if(typeof xn=="function"&&typeof Object.defineProperty=="function")try{cd=Object.defineProperty({},"length",{get:a(function(){throw Al},"get")}),Al={},xn(function(){throw 42},null,cd)}catch(t){t!==Al&&(xn=null)}else xn=null;var IC=/^\s*class\b/,fd=a(function(e){try{var r=nv.call(e);return IC.test(r)}catch{return!1}},"isES6ClassFunction"),ld=a(function(e){try{return fd(e)?!1:(nv.call(e),!0)}catch{return!1}},"tryFunctionToStr"),Il=Object.prototype.toString,DC="[object Object]",CC="[object Function]",NC="[object GeneratorFunction]",BC="[object HTMLAllCollection]",LC="[object HTML document.all class]",$C="[object HTMLCollection]",MC=typeof Symbol=="function"&&!!Symbol.toStringTag,jC=!(0 in[,]),ud=a(function(){return!1},"isDocumentDotAll");typeof document=="object"&&(iv=document.all,Il.call(iv)===Il.call(document.all)&&(ud=a(function(e){if((jC||!e)&&(typeof e>"u"||typeof e=="object"))try{var r=Il.call(e);return(r===BC||r===LC||r===$C||r===DC)&&e("")==null}catch{}return!1},"isDocumentDotAll")));var iv;ov.exports=a(xn?function(e){if(ud(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;try{xn(e,null,cd)}catch(r){if(r!==Al)return!1}return!fd(e)&&ld(e)}:function(e){if(ud(e))return!0;if(!e||typeof e!="function"&&typeof e!="object")return!1;if(MC)return ld(e);if(fd(e))return!1;var r=Il.call(e);return r!==CC&&r!==NC&&!/^\[object HTML/.test(r)?!1:ld(e)},"isCallable")});var cv=T((K4,lv)=>{"use strict";var UC=sv(),HC=Object.prototype.toString,av=Object.prototype.hasOwnProperty,qC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)av.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachArray"),zC=a(function(e,r,i){for(var n=0,o=e.length;n<o;n++)i==null?r(e.charAt(n),n,e):r.call(i,e.charAt(n),n,e)},"forEachString"),WC=a(function(e,r,i){for(var n in e)av.call(e,n)&&(i==null?r(e[n],n,e):r.call(i,e[n],n,e))},"forEachObject");function VC(t){return HC.call(t)==="[object Array]"}a(VC,"isArray");lv.exports=a(function(e,r,i){if(!UC(r))throw new TypeError("iterator must be a function");var n;arguments.length>=3&&(n=i),VC(e)?qC(e,r,n):typeof e=="string"?zC(e,r,n):WC(e,r,n)},"forEach")});var uv=T((X4,fv)=>{"use strict";fv.exports=["Float16Array","Float32Array","Float64Array","Int8Array","Int16Array","Int32Array","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array"]});var dv=T((Y4,hv)=>{"use strict";var hd=uv(),GC=globalThis;hv.exports=a(function(){for(var e=[],r=0;r<hd.length;r++)typeof GC[hd[r]]=="function"&&(e[e.length]=hd[r]);return e},"availableTypedArrays")});var yv=T((Q4,wv)=>{"use strict";var pv=vo(),KC=Eu(),Tn=Ht(),mv=tn();wv.exports=a(function(e,r,i){if(!e||typeof e!="object"&&typeof e!="function")throw new Tn("`obj` must be an object or a function`");if(typeof r!="string"&&typeof r!="symbol")throw new Tn("`property` must be a string or a symbol`");if(arguments.length>3&&typeof arguments[3]!="boolean"&&arguments[3]!==null)throw new Tn("`nonEnumerable`, if provided, must be a boolean or null");if(arguments.length>4&&typeof arguments[4]!="boolean"&&arguments[4]!==null)throw new Tn("`nonWritable`, if provided, must be a boolean or null");if(arguments.length>5&&typeof arguments[5]!="boolean"&&arguments[5]!==null)throw new Tn("`nonConfigurable`, if provided, must be a boolean or null");if(arguments.length>6&&typeof arguments[6]!="boolean")throw new Tn("`loose`, if provided, must be a boolean");var n=arguments.length>3?arguments[3]:null,o=arguments.length>4?arguments[4]:null,s=arguments.length>5?arguments[5]:null,l=arguments.length>6?arguments[6]:!1,f=!!mv&&mv(e,r);if(pv)pv(e,r,{configurable:s===null&&f?f.configurable:!s,enumerable:n===null&&f?f.enumerable:!n,value:i,writable:o===null&&f?f.writable:!o});else if(l||!n&&!o&&!s)e[r]=i;else throw new KC("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.")},"defineDataProperty")});var vv=T((tU,bv)=>{"use strict";var dd=vo(),gv=a(function(){return!!dd},"hasPropertyDescriptors");gv.hasArrayLengthDefineBug=a(function(){if(!dd)return null;try{return dd([],"length",{value:1}).length!==1}catch{return!0}},"hasArrayLengthDefineBug");bv.exports=gv});var xv=T((iU,Sv)=>{"use strict";var ZC=So(),_v=yv(),XC=vv()(),Fv=tn(),Ev=Ht(),YC=ZC("%Math.floor%");Sv.exports=a(function(e,r){if(typeof e!="function")throw new Ev("`fn` is not a function");if(typeof r!="number"||r<0||r>4294967295||YC(r)!==r)throw new Ev("`length` must be a positive 32-bit integer");var i=arguments.length>2&&!!arguments[2],n=!0,o=!0;if("length"in e&&Fv){var s=Fv(e,"length");s&&!s.configurable&&(n=!1),s&&!s.writable&&(o=!1)}return(n||o||!i)&&(XC?_v(e,"length",r,!0,!0):_v(e,"length",r)),e},"setFunctionLength")});var Ov=T((oU,Tv)=>{"use strict";var JC=rn(),QC=xa(),e2=Ou();Tv.exports=a(function(){return e2(JC,QC,arguments)},"applyBind")});var Pv=T((aU,Dl)=>{"use strict";var t2=xv(),Rv=vo(),r2=Ta(),kv=Ov();Dl.exports=a(function(e){var r=r2(arguments),i=e.length-(arguments.length-1);return t2(r,1+(i>0?i:0),!0)},"callBind");Rv?Rv(Dl.exports,"apply",{value:kv}):Dl.exports.apply=kv});var Iv=T((cU,Av)=>{"use strict";var i2=Su();Av.exports=a(function(){return i2()&&!!Symbol.toStringTag},"hasToStringTagShams")});var Lv=T((uU,Bv)=>{"use strict";var Bl=cv(),n2=dv(),Dv=Pv(),md=xo(),Nl=tn(),Cl=ku(),o2=md("Object.prototype.toString"),Nv=Iv()(),Cv=globalThis,pd=n2(),wd=md("String.prototype.slice"),s2=md("Array.prototype.indexOf",!0)||a(function(e,r){for(var i=0;i<e.length;i+=1)if(e[i]===r)return i;return-1},"indexOf"),Ll={__proto__:null};Nv&&Nl&&Cl?Bl(pd,function(t){var e=new Cv[t];if(Symbol.toStringTag in e&&Cl){var r=Cl(e),i=Nl(r,Symbol.toStringTag);if(!i&&r){var n=Cl(r);i=Nl(n,Symbol.toStringTag)}Ll["$"+t]=Dv(i.get)}}):Bl(pd,function(t){var e=new Cv[t],r=e.slice||e.set;r&&(Ll["$"+t]=Dv(r))});var a2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{"$"+i(e)===n&&(r=wd(n,1))}catch{}}),r},"tryAllTypedArrays"),l2=a(function(e){var r=!1;return Bl(Ll,function(i,n){if(!r)try{i(e),r=wd(n,1)}catch{}}),r},"tryAllSlices");Bv.exports=a(function(e){if(!e||typeof e!="object")return!1;if(!Nv){var r=wd(o2(e),8,-1);return s2(pd,r)>-1?r:r!=="Object"?!1:l2(e)}return Nl?a2(e):null},"whichTypedArray")});var Mv=T((dU,$v)=>{"use strict";var c2=Lv();$v.exports=a(function(e){return!!c2(e)},"isTypedArray")});var Uv=T((mU,jv)=>{"use strict";var f2=Ht(),u2=xo(),h2=u2("TypedArray.prototype.buffer",!0),d2=Mv();jv.exports=h2||a(function(e){if(!d2(e))throw new f2("Not a Typed Array");return e.buffer},"typedArrayBuffer")});var zv=T((yU,qv)=>{"use strict";var It=No().Buffer,p2=rv(),m2=Uv(),w2=ArrayBuffer.isView||a(function(e){try{return m2(e),!0}catch{return!1}},"isView"),y2=typeof Uint8Array<"u",Hv=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",g2=Hv&&(It.prototype instanceof Uint8Array||It.TYPED_ARRAY_SUPPORT);qv.exports=a(function(e,r){if(It.isBuffer(e))return e.constructor&&!("isBuffer"in e)?It.from(e):e;if(typeof e=="string")return It.from(e,r);if(Hv&&w2(e)){if(e.byteLength===0)return It.alloc(0);if(g2){var i=It.from(e.buffer,e.byteOffset,e.byteLength);if(i.byteLength===e.byteLength)return i}var n=e instanceof Uint8Array?e:new Uint8Array(e.buffer,e.byteOffset,e.byteLength),o=It.from(n);if(o.length===e.byteLength)return o}if(y2&&e instanceof Uint8Array)return It.from(e);var s=p2(e);if(s)for(var l=0;l<e.length;l+=1){var f=e[l];if(typeof f!="number"||f<0||f>255||~~f!==f)throw new RangeError("Array items must be numbers in the range 0-255.")}if(s||It.isBuffer(e)&&e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e))return It.from(e);throw new TypeError('The "data" argument must be a string, an Array, a Buffer, a Uint8Array, or a DataView.')},"toBuffer")});var Vv=T((bU,Wv)=>{"use strict";var b2=No().Buffer,v2=zv();function $l(t,e){this._block=b2.alloc(t),this._finalSize=e,this._blockSize=t,this._len=0}a($l,"Hash");$l.prototype.update=function(t,e){t=v2(t,e||"utf8");for(var r=this._block,i=this._blockSize,n=t.length,o=this._len,s=0;s<n;){for(var l=o%i,f=Math.min(n-s,i-l),c=0;c<f;c++)r[l+c]=t[s+c];o+=f,s+=f,o%i===0&&this._update(r)}return this._len+=n,this};$l.prototype.digest=function(t){var e=this._len%this._blockSize;this._block[e]=128,this._block.fill(0,e+1),e>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var i=(r&4294967295)>>>0,n=(r-i)/4294967296;this._block.writeUInt32BE(n,this._blockSize-8),this._block.writeUInt32BE(i,this._blockSize-4)}this._update(this._block);var o=this._hash();return t?o.toString(t):o};$l.prototype._update=function(){throw new Error("_update must be implemented by subclass")};Wv.exports=$l});var Zv=T((_U,Kv)=>{"use strict";var _2=Gt(),Gv=Vv(),F2=No().Buffer,E2=[1518500249,1859775393,-1894007588,-899497514],S2=new Array(80);function Ko(){this.init(),this._w=S2,Gv.call(this,64,56)}a(Ko,"Sha1");_2(Ko,Gv);Ko.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function x2(t){return t<<1|t>>>31}a(x2,"rotl1");function T2(t){return t<<5|t>>>27}a(T2,"rotl5");function O2(t){return t<<30|t>>>2}a(O2,"rotl30");function R2(t,e,r,i){return t===0?e&r|~e&i:t===2?e&r|e&i|r&i:e^r^i}a(R2,"ft");Ko.prototype._update=function(t){for(var e=this._w,r=this._a|0,i=this._b|0,n=this._c|0,o=this._d|0,s=this._e|0,l=0;l<16;++l)e[l]=t.readInt32BE(l*4);for(;l<80;++l)e[l]=x2(e[l-3]^e[l-8]^e[l-14]^e[l-16]);for(var f=0;f<80;++f){var c=~~(f/20),u=T2(r)+R2(c,i,n,o)+s+e[f]+E2[c]|0;s=o,o=n,n=O2(i),i=r,r=u}this._a=r+this._a|0,this._b=i+this._b|0,this._c=n+this._c|0,this._d=o+this._d|0,this._e=s+this._e|0};Ko.prototype._hash=function(){var t=F2.allocUnsafe(20);return t.writeInt32BE(this._a|0,0),t.writeInt32BE(this._b|0,4),t.writeInt32BE(this._c|0,8),t.writeInt32BE(this._d|0,12),t.writeInt32BE(this._e|0,16),t};Kv.exports=Ko});var Yv=T(yd=>{var Xv;(function(t){typeof DO_NOT_EXPORT_CRC>"u"?typeof yd=="object"?t(yd):typeof define=="function"&&define.amd?define(function(){var e={};return t(e),e}):t(Xv={}):t(Xv={})})(function(t){t.version="1.2.2";function e(){for(var b=0,x=new Array(256),_=0;_!=256;++_)b=_,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,b=b&1?-306674912^b>>>1:b>>>1,x[_]=b;return typeof Int32Array<"u"?new Int32Array(x):x}a(e,"signed_crc_table");var r=e();function i(b){var x=0,_=0,P=0,k=typeof Int32Array<"u"?new Int32Array(4096):new Array(4096);for(P=0;P!=256;++P)k[P]=b[P];for(P=0;P!=256;++P)for(_=b[P],x=256+P;x<4096;x+=256)_=k[x]=_>>>8^b[_&255];var C=[];for(P=1;P!=16;++P)C[P-1]=typeof Int32Array<"u"?k.subarray(P*256,P*256+256):k.slice(P*256,P*256+256);return C}a(i,"slice_by_16_tables");var n=i(r),o=n[0],s=n[1],l=n[2],f=n[3],c=n[4],u=n[5],h=n[6],d=n[7],p=n[8],m=n[9],w=n[10],y=n[11],v=n[12],g=n[13],F=n[14];function O(b,x){for(var _=x^-1,P=0,k=b.length;P<k;)_=_>>>8^r[(_^b.charCodeAt(P++))&255];return~_}a(O,"crc32_bstr");function S(b,x){for(var _=x^-1,P=b.length-15,k=0;k<P;)_=F[b[k++]^_&255]^g[b[k++]^_>>8&255]^v[b[k++]^_>>16&255]^y[b[k++]^_>>>24]^w[b[k++]]^m[b[k++]]^p[b[k++]]^d[b[k++]]^h[b[k++]]^u[b[k++]]^c[b[k++]]^f[b[k++]]^l[b[k++]]^s[b[k++]]^o[b[k++]]^r[b[k++]];for(P+=15;k<P;)_=_>>>8^r[(_^b[k++])&255];return~_}a(S,"crc32_buf");function R(b,x){for(var _=x^-1,P=0,k=b.length,C=0,N=0;P<k;)C=b.charCodeAt(P++),C<128?_=_>>>8^r[(_^C)&255]:C<2048?(_=_>>>8^r[(_^(192|C>>6&31))&255],_=_>>>8^r[(_^(128|C&63))&255]):C>=55296&&C<57344?(C=(C&1023)+64,N=b.charCodeAt(P++)&1023,_=_>>>8^r[(_^(240|C>>8&7))&255],_=_>>>8^r[(_^(128|C>>2&63))&255],_=_>>>8^r[(_^(128|N>>6&15|(C&3)<<4))&255],_=_>>>8^r[(_^(128|N&63))&255]):(_=_>>>8^r[(_^(224|C>>12&15))&255],_=_>>>8^r[(_^(128|C>>6&63))&255],_=_>>>8^r[(_^(128|C&63))&255]);return~_}a(R,"crc32_str"),t.table=r,t.bstr=O,t.buf=S,t.str=R})});var dr=T(Ge=>{"use strict";var k2=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";function P2(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(P2,"_has");Ge.assign=function(t){for(var e=Array.prototype.slice.call(arguments,1);e.length;){var r=e.shift();if(r){if(typeof r!="object")throw new TypeError(r+"must be non-object");for(var i in r)P2(r,i)&&(t[i]=r[i])}}return t};Ge.shrinkBuf=function(t,e){return t.length===e?t:t.subarray?t.subarray(0,e):(t.length=e,t)};var A2={arraySet:a(function(t,e,r,i,n){if(e.subarray&&t.subarray){t.set(e.subarray(r,r+i),n);return}for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){var e,r,i,n,o,s;for(i=0,e=0,r=t.length;e<r;e++)i+=t[e].length;for(s=new Uint8Array(i),n=0,e=0,r=t.length;e<r;e++)o=t[e],s.set(o,n),n+=o.length;return s},"flattenChunks")},I2={arraySet:a(function(t,e,r,i,n){for(var o=0;o<i;o++)t[n+o]=e[r+o]},"arraySet"),flattenChunks:a(function(t){return[].concat.apply([],t)},"flattenChunks")};Ge.setTyped=function(t){t?(Ge.Buf8=Uint8Array,Ge.Buf16=Uint16Array,Ge.Buf32=Int32Array,Ge.assign(Ge,A2)):(Ge.Buf8=Array,Ge.Buf16=Array,Ge.Buf32=Array,Ge.assign(Ge,I2))};Ge.setTyped(k2)});var v_=T(kn=>{"use strict";var D2=dr(),C2=4,Jv=0,Qv=1,N2=2;function Rn(t){for(var e=t.length;--e>=0;)t[e]=0}a(Rn,"zero");var B2=0,o_=1,L2=2,$2=3,M2=258,Sd=29,es=256,Xo=es+1+Sd,On=30,xd=19,s_=2*Xo+1,vi=15,gd=16,j2=7,Td=256,a_=16,l_=17,c_=18,Fd=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],Ml=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],U2=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],f_=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],H2=512,pr=new Array((Xo+2)*2);Rn(pr);var Zo=new Array(On*2);Rn(Zo);var Yo=new Array(H2);Rn(Yo);var Jo=new Array(M2-$2+1);Rn(Jo);var Od=new Array(Sd);Rn(Od);var jl=new Array(On);Rn(jl);function bd(t,e,r,i,n){this.static_tree=t,this.extra_bits=e,this.extra_base=r,this.elems=i,this.max_length=n,this.has_stree=t&&t.length}a(bd,"StaticTreeDesc");var u_,h_,d_;function vd(t,e){this.dyn_tree=t,this.max_code=0,this.stat_desc=e}a(vd,"TreeDesc");function p_(t){return t<256?Yo[t]:Yo[256+(t>>>7)]}a(p_,"d_code");function Qo(t,e){t.pending_buf[t.pending++]=e&255,t.pending_buf[t.pending++]=e>>>8&255}a(Qo,"put_short");function Je(t,e,r){t.bi_valid>gd-r?(t.bi_buf|=e<<t.bi_valid&65535,Qo(t,t.bi_buf),t.bi_buf=e>>gd-t.bi_valid,t.bi_valid+=r-gd):(t.bi_buf|=e<<t.bi_valid&65535,t.bi_valid+=r)}a(Je,"send_bits");function Yt(t,e,r){Je(t,r[e*2],r[e*2+1])}a(Yt,"send_code");function m_(t,e){var r=0;do r|=t&1,t>>>=1,r<<=1;while(--e>0);return r>>>1}a(m_,"bi_reverse");function q2(t){t.bi_valid===16?(Qo(t,t.bi_buf),t.bi_buf=0,t.bi_valid=0):t.bi_valid>=8&&(t.pending_buf[t.pending++]=t.bi_buf&255,t.bi_buf>>=8,t.bi_valid-=8)}a(q2,"bi_flush");function z2(t,e){var r=e.dyn_tree,i=e.max_code,n=e.stat_desc.static_tree,o=e.stat_desc.has_stree,s=e.stat_desc.extra_bits,l=e.stat_desc.extra_base,f=e.stat_desc.max_length,c,u,h,d,p,m,w=0;for(d=0;d<=vi;d++)t.bl_count[d]=0;for(r[t.heap[t.heap_max]*2+1]=0,c=t.heap_max+1;c<s_;c++)u=t.heap[c],d=r[r[u*2+1]*2+1]+1,d>f&&(d=f,w++),r[u*2+1]=d,!(u>i)&&(t.bl_count[d]++,p=0,u>=l&&(p=s[u-l]),m=r[u*2],t.opt_len+=m*(d+p),o&&(t.static_len+=m*(n[u*2+1]+p)));if(w!==0){do{for(d=f-1;t.bl_count[d]===0;)d--;t.bl_count[d]--,t.bl_count[d+1]+=2,t.bl_count[f]--,w-=2}while(w>0);for(d=f;d!==0;d--)for(u=t.bl_count[d];u!==0;)h=t.heap[--c],!(h>i)&&(r[h*2+1]!==d&&(t.opt_len+=(d-r[h*2+1])*r[h*2],r[h*2+1]=d),u--)}}a(z2,"gen_bitlen");function w_(t,e,r){var i=new Array(vi+1),n=0,o,s;for(o=1;o<=vi;o++)i[o]=n=n+r[o-1]<<1;for(s=0;s<=e;s++){var l=t[s*2+1];l!==0&&(t[s*2]=m_(i[l]++,l))}}a(w_,"gen_codes");function W2(){var t,e,r,i,n,o=new Array(vi+1);for(r=0,i=0;i<Sd-1;i++)for(Od[i]=r,t=0;t<1<<Fd[i];t++)Jo[r++]=i;for(Jo[r-1]=i,n=0,i=0;i<16;i++)for(jl[i]=n,t=0;t<1<<Ml[i];t++)Yo[n++]=i;for(n>>=7;i<On;i++)for(jl[i]=n<<7,t=0;t<1<<Ml[i]-7;t++)Yo[256+n++]=i;for(e=0;e<=vi;e++)o[e]=0;for(t=0;t<=143;)pr[t*2+1]=8,t++,o[8]++;for(;t<=255;)pr[t*2+1]=9,t++,o[9]++;for(;t<=279;)pr[t*2+1]=7,t++,o[7]++;for(;t<=287;)pr[t*2+1]=8,t++,o[8]++;for(w_(pr,Xo+1,o),t=0;t<On;t++)Zo[t*2+1]=5,Zo[t*2]=m_(t,5);u_=new bd(pr,Fd,es+1,Xo,vi),h_=new bd(Zo,Ml,0,On,vi),d_=new bd(new Array(0),U2,0,xd,j2)}a(W2,"tr_static_init");function y_(t){var e;for(e=0;e<Xo;e++)t.dyn_ltree[e*2]=0;for(e=0;e<On;e++)t.dyn_dtree[e*2]=0;for(e=0;e<xd;e++)t.bl_tree[e*2]=0;t.dyn_ltree[Td*2]=1,t.opt_len=t.static_len=0,t.last_lit=t.matches=0}a(y_,"init_block");function g_(t){t.bi_valid>8?Qo(t,t.bi_buf):t.bi_valid>0&&(t.pending_buf[t.pending++]=t.bi_buf),t.bi_buf=0,t.bi_valid=0}a(g_,"bi_windup");function V2(t,e,r,i){g_(t),i&&(Qo(t,r),Qo(t,~r)),D2.arraySet(t.pending_buf,t.window,e,r,t.pending),t.pending+=r}a(V2,"copy_block");function e_(t,e,r,i){var n=e*2,o=r*2;return t[n]<t[o]||t[n]===t[o]&&i[e]<=i[r]}a(e_,"smaller");function _d(t,e,r){for(var i=t.heap[r],n=r<<1;n<=t.heap_len&&(n<t.heap_len&&e_(e,t.heap[n+1],t.heap[n],t.depth)&&n++,!e_(e,i,t.heap[n],t.depth));)t.heap[r]=t.heap[n],r=n,n<<=1;t.heap[r]=i}a(_d,"pqdownheap");function t_(t,e,r){var i,n,o=0,s,l;if(t.last_lit!==0)do i=t.pending_buf[t.d_buf+o*2]<<8|t.pending_buf[t.d_buf+o*2+1],n=t.pending_buf[t.l_buf+o],o++,i===0?Yt(t,n,e):(s=Jo[n],Yt(t,s+es+1,e),l=Fd[s],l!==0&&(n-=Od[s],Je(t,n,l)),i--,s=p_(i),Yt(t,s,r),l=Ml[s],l!==0&&(i-=jl[s],Je(t,i,l)));while(o<t.last_lit);Yt(t,Td,e)}a(t_,"compress_block");function Ed(t,e){var r=e.dyn_tree,i=e.stat_desc.static_tree,n=e.stat_desc.has_stree,o=e.stat_desc.elems,s,l,f=-1,c;for(t.heap_len=0,t.heap_max=s_,s=0;s<o;s++)r[s*2]!==0?(t.heap[++t.heap_len]=f=s,t.depth[s]=0):r[s*2+1]=0;for(;t.heap_len<2;)c=t.heap[++t.heap_len]=f<2?++f:0,r[c*2]=1,t.depth[c]=0,t.opt_len--,n&&(t.static_len-=i[c*2+1]);for(e.max_code=f,s=t.heap_len>>1;s>=1;s--)_d(t,r,s);c=o;do s=t.heap[1],t.heap[1]=t.heap[t.heap_len--],_d(t,r,1),l=t.heap[1],t.heap[--t.heap_max]=s,t.heap[--t.heap_max]=l,r[c*2]=r[s*2]+r[l*2],t.depth[c]=(t.depth[s]>=t.depth[l]?t.depth[s]:t.depth[l])+1,r[s*2+1]=r[l*2+1]=c,t.heap[1]=c++,_d(t,r,1);while(t.heap_len>=2);t.heap[--t.heap_max]=t.heap[1],z2(t,e),w_(r,f,t.bl_count)}a(Ed,"build_tree");function r_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),e[(r+1)*2+1]=65535,i=0;i<=r;i++)o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)&&(l<c?t.bl_tree[o*2]+=l:o!==0?(o!==n&&t.bl_tree[o*2]++,t.bl_tree[a_*2]++):l<=10?t.bl_tree[l_*2]++:t.bl_tree[c_*2]++,l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4))}a(r_,"scan_tree");function i_(t,e,r){var i,n=-1,o,s=e[0*2+1],l=0,f=7,c=4;for(s===0&&(f=138,c=3),i=0;i<=r;i++)if(o=s,s=e[(i+1)*2+1],!(++l<f&&o===s)){if(l<c)do Yt(t,o,t.bl_tree);while(--l!==0);else o!==0?(o!==n&&(Yt(t,o,t.bl_tree),l--),Yt(t,a_,t.bl_tree),Je(t,l-3,2)):l<=10?(Yt(t,l_,t.bl_tree),Je(t,l-3,3)):(Yt(t,c_,t.bl_tree),Je(t,l-11,7));l=0,n=o,s===0?(f=138,c=3):o===s?(f=6,c=3):(f=7,c=4)}}a(i_,"send_tree");function G2(t){var e;for(r_(t,t.dyn_ltree,t.l_desc.max_code),r_(t,t.dyn_dtree,t.d_desc.max_code),Ed(t,t.bl_desc),e=xd-1;e>=3&&t.bl_tree[f_[e]*2+1]===0;e--);return t.opt_len+=3*(e+1)+5+5+4,e}a(G2,"build_bl_tree");function K2(t,e,r,i){var n;for(Je(t,e-257,5),Je(t,r-1,5),Je(t,i-4,4),n=0;n<i;n++)Je(t,t.bl_tree[f_[n]*2+1],3);i_(t,t.dyn_ltree,e-1),i_(t,t.dyn_dtree,r-1)}a(K2,"send_all_trees");function Z2(t){var e=4093624447,r;for(r=0;r<=31;r++,e>>>=1)if(e&1&&t.dyn_ltree[r*2]!==0)return Jv;if(t.dyn_ltree[9*2]!==0||t.dyn_ltree[10*2]!==0||t.dyn_ltree[13*2]!==0)return Qv;for(r=32;r<es;r++)if(t.dyn_ltree[r*2]!==0)return Qv;return Jv}a(Z2,"detect_data_type");var n_=!1;function X2(t){n_||(W2(),n_=!0),t.l_desc=new vd(t.dyn_ltree,u_),t.d_desc=new vd(t.dyn_dtree,h_),t.bl_desc=new vd(t.bl_tree,d_),t.bi_buf=0,t.bi_valid=0,y_(t)}a(X2,"_tr_init");function b_(t,e,r,i){Je(t,(B2<<1)+(i?1:0),3),V2(t,e,r,!0)}a(b_,"_tr_stored_block");function Y2(t){Je(t,o_<<1,3),Yt(t,Td,pr),q2(t)}a(Y2,"_tr_align");function J2(t,e,r,i){var n,o,s=0;t.level>0?(t.strm.data_type===N2&&(t.strm.data_type=Z2(t)),Ed(t,t.l_desc),Ed(t,t.d_desc),s=G2(t),n=t.opt_len+3+7>>>3,o=t.static_len+3+7>>>3,o<=n&&(n=o)):n=o=r+5,r+4<=n&&e!==-1?b_(t,e,r,i):t.strategy===C2||o===n?(Je(t,(o_<<1)+(i?1:0),3),t_(t,pr,Zo)):(Je(t,(L2<<1)+(i?1:0),3),K2(t,t.l_desc.max_code+1,t.d_desc.max_code+1,s+1),t_(t,t.dyn_ltree,t.dyn_dtree)),y_(t),i&&g_(t)}a(J2,"_tr_flush_block");function Q2(t,e,r){return t.pending_buf[t.d_buf+t.last_lit*2]=e>>>8&255,t.pending_buf[t.d_buf+t.last_lit*2+1]=e&255,t.pending_buf[t.l_buf+t.last_lit]=r&255,t.last_lit++,e===0?t.dyn_ltree[r*2]++:(t.matches++,e--,t.dyn_ltree[(Jo[r]+es+1)*2]++,t.dyn_dtree[p_(e)*2]++),t.last_lit===t.lit_bufsize-1}a(Q2,"_tr_tally");kn._tr_init=X2;kn._tr_stored_block=b_;kn._tr_flush_block=J2;kn._tr_tally=Q2;kn._tr_align=Y2});var Rd=T((kU,__)=>{"use strict";function eN(t,e,r,i){for(var n=t&65535|0,o=t>>>16&65535|0,s=0;r!==0;){s=r>2e3?2e3:r,r-=s;do n=n+e[i++]|0,o=o+n|0;while(--s);n%=65521,o%=65521}return n|o<<16|0}a(eN,"adler32");__.exports=eN});var kd=T((AU,F_)=>{"use strict";function tN(){for(var t,e=[],r=0;r<256;r++){t=r;for(var i=0;i<8;i++)t=t&1?3988292384^t>>>1:t>>>1;e[r]=t}return e}a(tN,"makeTable");var rN=tN();function iN(t,e,r,i){var n=rN,o=i+r;t^=-1;for(var s=i;s<o;s++)t=t>>>8^n[(t^e[s])&255];return t^-1}a(iN,"crc32");F_.exports=iN});var Ul=T((DU,E_)=>{"use strict";E_.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}});var I_=T(er=>{"use strict";var Ke=dr(),_t=v_(),O_=Rd(),$r=kd(),nN=Ul(),Si=0,oN=1,sN=3,qr=4,S_=5,Qt=0,x_=1,Ft=-2,aN=-3,Pd=-5,lN=-1,cN=1,Hl=2,fN=3,uN=4,hN=0,dN=2,Vl=8,pN=9,mN=15,wN=8,yN=29,gN=256,Id=gN+1+yN,bN=30,vN=19,_N=2*Id+1,FN=15,Q=3,Ur=258,Dt=Ur+Q+1,EN=32,Gl=42,Dd=69,ql=73,zl=91,Wl=103,_i=113,rs=666,Ae=1,is=2,Fi=3,In=4,SN=3;function Hr(t,e){return t.msg=nN[e],e}a(Hr,"err");function T_(t){return(t<<1)-(t>4?9:0)}a(T_,"rank");function jr(t){for(var e=t.length;--e>=0;)t[e]=0}a(jr,"zero");function Mr(t){var e=t.state,r=e.pending;r>t.avail_out&&(r=t.avail_out),r!==0&&(Ke.arraySet(t.output,e.pending_buf,e.pending_out,r,t.next_out),t.next_out+=r,e.pending_out+=r,t.total_out+=r,t.avail_out-=r,e.pending-=r,e.pending===0&&(e.pending_out=0))}a(Mr,"flush_pending");function $e(t,e){_t._tr_flush_block(t,t.block_start>=0?t.block_start:-1,t.strstart-t.block_start,e),t.block_start=t.strstart,Mr(t.strm)}a($e,"flush_block_only");function oe(t,e){t.pending_buf[t.pending++]=e}a(oe,"put_byte");function ts(t,e){t.pending_buf[t.pending++]=e>>>8&255,t.pending_buf[t.pending++]=e&255}a(ts,"putShortMSB");function xN(t,e,r,i){var n=t.avail_in;return n>i&&(n=i),n===0?0:(t.avail_in-=n,Ke.arraySet(e,t.input,t.next_in,n,r),t.state.wrap===1?t.adler=O_(t.adler,e,n,r):t.state.wrap===2&&(t.adler=$r(t.adler,e,n,r)),t.next_in+=n,t.total_in+=n,n)}a(xN,"read_buf");function R_(t,e){var r=t.max_chain_length,i=t.strstart,n,o,s=t.prev_length,l=t.nice_match,f=t.strstart>t.w_size-Dt?t.strstart-(t.w_size-Dt):0,c=t.window,u=t.w_mask,h=t.prev,d=t.strstart+Ur,p=c[i+s-1],m=c[i+s];t.prev_length>=t.good_match&&(r>>=2),l>t.lookahead&&(l=t.lookahead);do if(n=e,!(c[n+s]!==m||c[n+s-1]!==p||c[n]!==c[i]||c[++n]!==c[i+1])){i+=2,n++;do;while(c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&c[++i]===c[++n]&&i<d);if(o=Ur-(d-i),i=d-Ur,o>s){if(t.match_start=e,s=o,o>=l)break;p=c[i+s-1],m=c[i+s]}}while((e=h[e&u])>f&&--r!==0);return s<=t.lookahead?s:t.lookahead}a(R_,"longest_match");function Ei(t){var e=t.w_size,r,i,n,o,s;do{if(o=t.window_size-t.lookahead-t.strstart,t.strstart>=e+(e-Dt)){Ke.arraySet(t.window,t.window,e,e,0),t.match_start-=e,t.strstart-=e,t.block_start-=e,i=t.hash_size,r=i;do n=t.head[--r],t.head[r]=n>=e?n-e:0;while(--i);i=e,r=i;do n=t.prev[--r],t.prev[r]=n>=e?n-e:0;while(--i);o+=e}if(t.strm.avail_in===0)break;if(i=xN(t.strm,t.window,t.strstart+t.lookahead,o),t.lookahead+=i,t.lookahead+t.insert>=Q)for(s=t.strstart-t.insert,t.ins_h=t.window[s],t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+1])&t.hash_mask;t.insert&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[s+Q-1])&t.hash_mask,t.prev[s&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=s,s++,t.insert--,!(t.lookahead+t.insert<Q)););}while(t.lookahead<Dt&&t.strm.avail_in!==0)}a(Ei,"fill_window");function TN(t,e){var r=65535;for(r>t.pending_buf_size-5&&(r=t.pending_buf_size-5);;){if(t.lookahead<=1){if(Ei(t),t.lookahead===0&&e===Si)return Ae;if(t.lookahead===0)break}t.strstart+=t.lookahead,t.lookahead=0;var i=t.block_start+r;if((t.strstart===0||t.strstart>=i)&&(t.lookahead=t.strstart-i,t.strstart=i,$e(t,!1),t.strm.avail_out===0)||t.strstart-t.block_start>=t.w_size-Dt&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):(t.strstart>t.block_start&&($e(t,!1),t.strm.avail_out===0),Ae)}a(TN,"deflate_stored");function Ad(t,e){for(var r,i;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),r!==0&&t.strstart-r<=t.w_size-Dt&&(t.match_length=R_(t,r)),t.match_length>=Q)if(i=_t._tr_tally(t,t.strstart-t.match_start,t.match_length-Q),t.lookahead-=t.match_length,t.match_length<=t.max_lazy_match&&t.lookahead>=Q){t.match_length--;do t.strstart++,t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart;while(--t.match_length!==0);t.strstart++}else t.strstart+=t.match_length,t.match_length=0,t.ins_h=t.window[t.strstart],t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+1])&t.hash_mask;else i=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++;if(i&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(Ad,"deflate_fast");function Pn(t,e){for(var r,i,n;;){if(t.lookahead<Dt){if(Ei(t),t.lookahead<Dt&&e===Si)return Ae;if(t.lookahead===0)break}if(r=0,t.lookahead>=Q&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart),t.prev_length=t.match_length,t.prev_match=t.match_start,t.match_length=Q-1,r!==0&&t.prev_length<t.max_lazy_match&&t.strstart-r<=t.w_size-Dt&&(t.match_length=R_(t,r),t.match_length<=5&&(t.strategy===cN||t.match_length===Q&&t.strstart-t.match_start>4096)&&(t.match_length=Q-1)),t.prev_length>=Q&&t.match_length<=t.prev_length){n=t.strstart+t.lookahead-Q,i=_t._tr_tally(t,t.strstart-1-t.prev_match,t.prev_length-Q),t.lookahead-=t.prev_length-1,t.prev_length-=2;do++t.strstart<=n&&(t.ins_h=(t.ins_h<<t.hash_shift^t.window[t.strstart+Q-1])&t.hash_mask,r=t.prev[t.strstart&t.w_mask]=t.head[t.ins_h],t.head[t.ins_h]=t.strstart);while(--t.prev_length!==0);if(t.match_available=0,t.match_length=Q-1,t.strstart++,i&&($e(t,!1),t.strm.avail_out===0))return Ae}else if(t.match_available){if(i=_t._tr_tally(t,0,t.window[t.strstart-1]),i&&$e(t,!1),t.strstart++,t.lookahead--,t.strm.avail_out===0)return Ae}else t.match_available=1,t.strstart++,t.lookahead--}return t.match_available&&(i=_t._tr_tally(t,0,t.window[t.strstart-1]),t.match_available=0),t.insert=t.strstart<Q-1?t.strstart:Q-1,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(Pn,"deflate_slow");function ON(t,e){for(var r,i,n,o,s=t.window;;){if(t.lookahead<=Ur){if(Ei(t),t.lookahead<=Ur&&e===Si)return Ae;if(t.lookahead===0)break}if(t.match_length=0,t.lookahead>=Q&&t.strstart>0&&(n=t.strstart-1,i=s[n],i===s[++n]&&i===s[++n]&&i===s[++n])){o=t.strstart+Ur;do;while(i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&i===s[++n]&&n<o);t.match_length=Ur-(o-n),t.match_length>t.lookahead&&(t.match_length=t.lookahead)}if(t.match_length>=Q?(r=_t._tr_tally(t,1,t.match_length-Q),t.lookahead-=t.match_length,t.strstart+=t.match_length,t.match_length=0):(r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++),r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(ON,"deflate_rle");function RN(t,e){for(var r;;){if(t.lookahead===0&&(Ei(t),t.lookahead===0)){if(e===Si)return Ae;break}if(t.match_length=0,r=_t._tr_tally(t,0,t.window[t.strstart]),t.lookahead--,t.strstart++,r&&($e(t,!1),t.strm.avail_out===0))return Ae}return t.insert=0,e===qr?($e(t,!0),t.strm.avail_out===0?Fi:In):t.last_lit&&($e(t,!1),t.strm.avail_out===0)?Ae:is}a(RN,"deflate_huff");function Jt(t,e,r,i,n){this.good_length=t,this.max_lazy=e,this.nice_length=r,this.max_chain=i,this.func=n}a(Jt,"Config");var An;An=[new Jt(0,0,0,0,TN),new Jt(4,4,8,4,Ad),new Jt(4,5,16,8,Ad),new Jt(4,6,32,32,Ad),new Jt(4,4,16,16,Pn),new Jt(8,16,32,32,Pn),new Jt(8,16,128,128,Pn),new Jt(8,32,128,256,Pn),new Jt(32,128,258,1024,Pn),new Jt(32,258,258,4096,Pn)];function kN(t){t.window_size=2*t.w_size,jr(t.head),t.max_lazy_match=An[t.level].max_lazy,t.good_match=An[t.level].good_length,t.nice_match=An[t.level].nice_length,t.max_chain_length=An[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=Q-1,t.match_available=0,t.ins_h=0}a(kN,"lm_init");function PN(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Vl,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Ke.Buf16(_N*2),this.dyn_dtree=new Ke.Buf16((2*bN+1)*2),this.bl_tree=new Ke.Buf16((2*vN+1)*2),jr(this.dyn_ltree),jr(this.dyn_dtree),jr(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Ke.Buf16(FN+1),this.heap=new Ke.Buf16(2*Id+1),jr(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Ke.Buf16(2*Id+1),jr(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}a(PN,"DeflateState");function k_(t){var e;return!t||!t.state?Hr(t,Ft):(t.total_in=t.total_out=0,t.data_type=dN,e=t.state,e.pending=0,e.pending_out=0,e.wrap<0&&(e.wrap=-e.wrap),e.status=e.wrap?Gl:_i,t.adler=e.wrap===2?0:1,e.last_flush=Si,_t._tr_init(e),Qt)}a(k_,"deflateResetKeep");function P_(t){var e=k_(t);return e===Qt&&kN(t.state),e}a(P_,"deflateReset");function AN(t,e){return!t||!t.state||t.state.wrap!==2?Ft:(t.state.gzhead=e,Qt)}a(AN,"deflateSetHeader");function A_(t,e,r,i,n,o){if(!t)return Ft;var s=1;if(e===lN&&(e=6),i<0?(s=0,i=-i):i>15&&(s=2,i-=16),n<1||n>pN||r!==Vl||i<8||i>15||e<0||e>9||o<0||o>uN)return Hr(t,Ft);i===8&&(i=9);var l=new PN;return t.state=l,l.strm=t,l.wrap=s,l.gzhead=null,l.w_bits=i,l.w_size=1<<l.w_bits,l.w_mask=l.w_size-1,l.hash_bits=n+7,l.hash_size=1<<l.hash_bits,l.hash_mask=l.hash_size-1,l.hash_shift=~~((l.hash_bits+Q-1)/Q),l.window=new Ke.Buf8(l.w_size*2),l.head=new Ke.Buf16(l.hash_size),l.prev=new Ke.Buf16(l.w_size),l.lit_bufsize=1<<n+6,l.pending_buf_size=l.lit_bufsize*4,l.pending_buf=new Ke.Buf8(l.pending_buf_size),l.d_buf=1*l.lit_bufsize,l.l_buf=3*l.lit_bufsize,l.level=e,l.strategy=o,l.method=r,P_(t)}a(A_,"deflateInit2");function IN(t,e){return A_(t,e,Vl,mN,wN,hN)}a(IN,"deflateInit");function DN(t,e){var r,i,n,o;if(!t||!t.state||e>S_||e<0)return t?Hr(t,Ft):Ft;if(i=t.state,!t.output||!t.input&&t.avail_in!==0||i.status===rs&&e!==qr)return Hr(t,t.avail_out===0?Pd:Ft);if(i.strm=t,r=i.last_flush,i.last_flush=e,i.status===Gl)if(i.wrap===2)t.adler=0,oe(i,31),oe(i,139),oe(i,8),i.gzhead?(oe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),oe(i,i.gzhead.time&255),oe(i,i.gzhead.time>>8&255),oe(i,i.gzhead.time>>16&255),oe(i,i.gzhead.time>>24&255),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,i.gzhead.os&255),i.gzhead.extra&&i.gzhead.extra.length&&(oe(i,i.gzhead.extra.length&255),oe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(t.adler=$r(t.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=Dd):(oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,0),oe(i,i.level===9?2:i.strategy>=Hl||i.level<2?4:0),oe(i,SN),i.status=_i);else{var s=Vl+(i.w_bits-8<<4)<<8,l=-1;i.strategy>=Hl||i.level<2?l=0:i.level<6?l=1:i.level===6?l=2:l=3,s|=l<<6,i.strstart!==0&&(s|=EN),s+=31-s%31,i.status=_i,ts(i,s),i.strstart!==0&&(ts(i,t.adler>>>16),ts(i,t.adler&65535)),t.adler=1}if(i.status===Dd)if(i.gzhead.extra){for(n=i.pending;i.gzindex<(i.gzhead.extra.length&65535)&&!(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size));)oe(i,i.gzhead.extra[i.gzindex]&255),i.gzindex++;i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=ql)}else i.status=ql;if(i.status===ql)if(i.gzhead.name){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.name.length?o=i.gzhead.name.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.gzindex=0,i.status=zl)}else i.status=zl;if(i.status===zl)if(i.gzhead.comment){n=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),Mr(t),n=i.pending,i.pending===i.pending_buf_size)){o=1;break}i.gzindex<i.gzhead.comment.length?o=i.gzhead.comment.charCodeAt(i.gzindex++)&255:o=0,oe(i,o)}while(o!==0);i.gzhead.hcrc&&i.pending>n&&(t.adler=$r(t.adler,i.pending_buf,i.pending-n,n)),o===0&&(i.status=Wl)}else i.status=Wl;if(i.status===Wl&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&Mr(t),i.pending+2<=i.pending_buf_size&&(oe(i,t.adler&255),oe(i,t.adler>>8&255),t.adler=0,i.status=_i)):i.status=_i),i.pending!==0){if(Mr(t),t.avail_out===0)return i.last_flush=-1,Qt}else if(t.avail_in===0&&T_(e)<=T_(r)&&e!==qr)return Hr(t,Pd);if(i.status===rs&&t.avail_in!==0)return Hr(t,Pd);if(t.avail_in!==0||i.lookahead!==0||e!==Si&&i.status!==rs){var f=i.strategy===Hl?RN(i,e):i.strategy===fN?ON(i,e):An[i.level].func(i,e);if((f===Fi||f===In)&&(i.status=rs),f===Ae||f===Fi)return t.avail_out===0&&(i.last_flush=-1),Qt;if(f===is&&(e===oN?_t._tr_align(i):e!==S_&&(_t._tr_stored_block(i,0,0,!1),e===sN&&(jr(i.head),i.lookahead===0&&(i.strstart=0,i.block_start=0,i.insert=0))),Mr(t),t.avail_out===0))return i.last_flush=-1,Qt}return e!==qr?Qt:i.wrap<=0?x_:(i.wrap===2?(oe(i,t.adler&255),oe(i,t.adler>>8&255),oe(i,t.adler>>16&255),oe(i,t.adler>>24&255),oe(i,t.total_in&255),oe(i,t.total_in>>8&255),oe(i,t.total_in>>16&255),oe(i,t.total_in>>24&255)):(ts(i,t.adler>>>16),ts(i,t.adler&65535)),Mr(t),i.wrap>0&&(i.wrap=-i.wrap),i.pending!==0?Qt:x_)}a(DN,"deflate");function CN(t){var e;return!t||!t.state?Ft:(e=t.state.status,e!==Gl&&e!==Dd&&e!==ql&&e!==zl&&e!==Wl&&e!==_i&&e!==rs?Hr(t,Ft):(t.state=null,e===_i?Hr(t,aN):Qt))}a(CN,"deflateEnd");function NN(t,e){var r=e.length,i,n,o,s,l,f,c,u;if(!t||!t.state||(i=t.state,s=i.wrap,s===2||s===1&&i.status!==Gl||i.lookahead))return Ft;for(s===1&&(t.adler=O_(t.adler,e,r,0)),i.wrap=0,r>=i.w_size&&(s===0&&(jr(i.head),i.strstart=0,i.block_start=0,i.insert=0),u=new Ke.Buf8(i.w_size),Ke.arraySet(u,e,r-i.w_size,i.w_size,0),e=u,r=i.w_size),l=t.avail_in,f=t.next_in,c=t.input,t.avail_in=r,t.next_in=0,t.input=e,Ei(i);i.lookahead>=Q;){n=i.strstart,o=i.lookahead-(Q-1);do i.ins_h=(i.ins_h<<i.hash_shift^i.window[n+Q-1])&i.hash_mask,i.prev[n&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=n,n++;while(--o);i.strstart=n,i.lookahead=Q-1,Ei(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=Q-1,i.match_available=0,t.next_in=f,t.input=c,t.avail_in=l,i.wrap=s,Qt}a(NN,"deflateSetDictionary");er.deflateInit=IN;er.deflateInit2=A_;er.deflateReset=P_;er.deflateResetKeep=k_;er.deflateSetHeader=AN;er.deflate=DN;er.deflateEnd=CN;er.deflateSetDictionary=NN;er.deflateInfo="pako deflate (from Nodeca project)"});var Cd=T(Dn=>{"use strict";var Kl=dr(),D_=!0,C_=!0;try{String.fromCharCode.apply(null,[0])}catch{D_=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{C_=!1}var ns=new Kl.Buf8(256);for(mr=0;mr<256;mr++)ns[mr]=mr>=252?6:mr>=248?5:mr>=240?4:mr>=224?3:mr>=192?2:1;var mr;ns[254]=ns[254]=1;Dn.string2buf=function(t){var e,r,i,n,o,s=t.length,l=0;for(n=0;n<s;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),l+=r<128?1:r<2048?2:r<65536?3:4;for(e=new Kl.Buf8(l),o=0,n=0;o<l;n++)r=t.charCodeAt(n),(r&64512)===55296&&n+1<s&&(i=t.charCodeAt(n+1),(i&64512)===56320&&(r=65536+(r-55296<<10)+(i-56320),n++)),r<128?e[o++]=r:r<2048?(e[o++]=192|r>>>6,e[o++]=128|r&63):r<65536?(e[o++]=224|r>>>12,e[o++]=128|r>>>6&63,e[o++]=128|r&63):(e[o++]=240|r>>>18,e[o++]=128|r>>>12&63,e[o++]=128|r>>>6&63,e[o++]=128|r&63);return e};function N_(t,e){if(e<65534&&(t.subarray&&C_||!t.subarray&&D_))return String.fromCharCode.apply(null,Kl.shrinkBuf(t,e));for(var r="",i=0;i<e;i++)r+=String.fromCharCode(t[i]);return r}a(N_,"buf2binstring");Dn.buf2binstring=function(t){return N_(t,t.length)};Dn.binstring2buf=function(t){for(var e=new Kl.Buf8(t.length),r=0,i=e.length;r<i;r++)e[r]=t.charCodeAt(r);return e};Dn.buf2string=function(t,e){var r,i,n,o,s=e||t.length,l=new Array(s*2);for(i=0,r=0;r<s;){if(n=t[r++],n<128){l[i++]=n;continue}if(o=ns[n],o>4){l[i++]=65533,r+=o-1;continue}for(n&=o===2?31:o===3?15:7;o>1&&r<s;)n=n<<6|t[r++]&63,o--;if(o>1){l[i++]=65533;continue}n<65536?l[i++]=n:(n-=65536,l[i++]=55296|n>>10&1023,l[i++]=56320|n&1023)}return N_(l,i)};Dn.utf8border=function(t,e){var r;for(e=e||t.length,e>t.length&&(e=t.length),r=e-1;r>=0&&(t[r]&192)===128;)r--;return r<0||r===0?e:r+ns[t[r]]>e?r:e}});var Nd=T(($U,B_)=>{"use strict";function BN(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}a(BN,"ZStream");B_.exports=BN});var j_=T(as=>{"use strict";var os=I_(),ss=dr(),Ld=Cd(),$d=Ul(),LN=Nd(),M_=Object.prototype.toString,$N=0,Bd=4,Cn=0,L_=1,$_=2,MN=-1,jN=0,UN=8;function xi(t){if(!(this instanceof xi))return new xi(t);this.options=ss.assign({level:MN,method:UN,chunkSize:16384,windowBits:15,memLevel:8,strategy:jN,to:""},t||{});var e=this.options;e.raw&&e.windowBits>0?e.windowBits=-e.windowBits:e.gzip&&e.windowBits>0&&e.windowBits<16&&(e.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new LN,this.strm.avail_out=0;var r=os.deflateInit2(this.strm,e.level,e.method,e.windowBits,e.memLevel,e.strategy);if(r!==Cn)throw new Error($d[r]);if(e.header&&os.deflateSetHeader(this.strm,e.header),e.dictionary){var i;if(typeof e.dictionary=="string"?i=Ld.string2buf(e.dictionary):M_.call(e.dictionary)==="[object ArrayBuffer]"?i=new Uint8Array(e.dictionary):i=e.dictionary,r=os.deflateSetDictionary(this.strm,i),r!==Cn)throw new Error($d[r]);this._dict_set=!0}}a(xi,"Deflate");xi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n,o;if(this.ended)return!1;o=e===~~e?e:e===!0?Bd:$N,typeof t=="string"?r.input=Ld.string2buf(t):M_.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new ss.Buf8(i),r.next_out=0,r.avail_out=i),n=os.deflate(r,o),n!==L_&&n!==Cn)return this.onEnd(n),this.ended=!0,!1;(r.avail_out===0||r.avail_in===0&&(o===Bd||o===$_))&&(this.options.to==="string"?this.onData(Ld.buf2binstring(ss.shrinkBuf(r.output,r.next_out))):this.onData(ss.shrinkBuf(r.output,r.next_out)))}while((r.avail_in>0||r.avail_out===0)&&n!==L_);return o===Bd?(n=os.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===Cn):(o===$_&&(this.onEnd(Cn),r.avail_out=0),!0)};xi.prototype.onData=function(t){this.chunks.push(t)};xi.prototype.onEnd=function(t){t===Cn&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=ss.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Md(t,e){var r=new xi(e);if(r.push(t,!0),r.err)throw r.msg||$d[r.err];return r.result}a(Md,"deflate");function HN(t,e){return e=e||{},e.raw=!0,Md(t,e)}a(HN,"deflateRaw");function qN(t,e){return e=e||{},e.gzip=!0,Md(t,e)}a(qN,"gzip");as.Deflate=xi;as.deflate=Md;as.deflateRaw=HN;as.gzip=qN});var H_=T((HU,U_)=>{"use strict";var Zl=30,zN=12;U_.exports=a(function(e,r){var i,n,o,s,l,f,c,u,h,d,p,m,w,y,v,g,F,O,S,R,b,x,_,P,k;i=e.state,n=e.next_in,P=e.input,o=n+(e.avail_in-5),s=e.next_out,k=e.output,l=s-(r-e.avail_out),f=s+(e.avail_out-257),c=i.dmax,u=i.wsize,h=i.whave,d=i.wnext,p=i.window,m=i.hold,w=i.bits,y=i.lencode,v=i.distcode,g=(1<<i.lenbits)-1,F=(1<<i.distbits)-1;e:do{w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=y[m&g];t:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S===0)k[s++]=O&65535;else if(S&16){R=O&65535,S&=15,S&&(w<S&&(m+=P[n++]<<w,w+=8),R+=m&(1<<S)-1,m>>>=S,w-=S),w<15&&(m+=P[n++]<<w,w+=8,m+=P[n++]<<w,w+=8),O=v[m&F];r:for(;;){if(S=O>>>24,m>>>=S,w-=S,S=O>>>16&255,S&16){if(b=O&65535,S&=15,w<S&&(m+=P[n++]<<w,w+=8,w<S&&(m+=P[n++]<<w,w+=8)),b+=m&(1<<S)-1,b>c){e.msg="invalid distance too far back",i.mode=Zl;break e}if(m>>>=S,w-=S,S=s-l,b>S){if(S=b-S,S>h&&i.sane){e.msg="invalid distance too far back",i.mode=Zl;break e}if(x=0,_=p,d===0){if(x+=u-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}else if(d<S){if(x+=u+d-S,S-=d,S<R){R-=S;do k[s++]=p[x++];while(--S);if(x=0,d<R){S=d,R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}}}else if(x+=d-S,S<R){R-=S;do k[s++]=p[x++];while(--S);x=s-b,_=k}for(;R>2;)k[s++]=_[x++],k[s++]=_[x++],k[s++]=_[x++],R-=3;R&&(k[s++]=_[x++],R>1&&(k[s++]=_[x++]))}else{x=s-b;do k[s++]=k[x++],k[s++]=k[x++],k[s++]=k[x++],R-=3;while(R>2);R&&(k[s++]=k[x++],R>1&&(k[s++]=k[x++]))}}else if(S&64){e.msg="invalid distance code",i.mode=Zl;break e}else{O=v[(O&65535)+(m&(1<<S)-1)];continue r}break}}else if(S&64)if(S&32){i.mode=zN;break e}else{e.msg="invalid literal/length code",i.mode=Zl;break e}else{O=y[(O&65535)+(m&(1<<S)-1)];continue t}break}}while(n<o&&s<f);R=w>>3,n-=R,w-=R<<3,m&=(1<<w)-1,e.next_in=n,e.next_out=s,e.avail_in=n<o?5+(o-n):5-(n-o),e.avail_out=s<f?257+(f-s):257-(s-f),i.hold=m,i.bits=w},"inflate_fast")});var Z_=T((zU,K_)=>{"use strict";var q_=dr(),Nn=15,z_=852,W_=592,V_=0,jd=1,G_=2,WN=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],VN=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],GN=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],KN=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];K_.exports=a(function(e,r,i,n,o,s,l,f){var c=f.bits,u=0,h=0,d=0,p=0,m=0,w=0,y=0,v=0,g=0,F=0,O,S,R,b,x,_=null,P=0,k,C=new q_.Buf16(Nn+1),N=new q_.Buf16(Nn+1),U=null,Z=0,me,Ee,$;for(u=0;u<=Nn;u++)C[u]=0;for(h=0;h<n;h++)C[r[i+h]]++;for(m=c,p=Nn;p>=1&&C[p]===0;p--);if(m>p&&(m=p),p===0)return o[s++]=1<<24|64<<16|0,o[s++]=1<<24|64<<16|0,f.bits=1,0;for(d=1;d<p&&C[d]===0;d++);for(m<d&&(m=d),v=1,u=1;u<=Nn;u++)if(v<<=1,v-=C[u],v<0)return-1;if(v>0&&(e===V_||p!==1))return-1;for(N[1]=0,u=1;u<Nn;u++)N[u+1]=N[u]+C[u];for(h=0;h<n;h++)r[i+h]!==0&&(l[N[r[i+h]]++]=h);if(e===V_?(_=U=l,k=19):e===jd?(_=WN,P-=257,U=VN,Z-=257,k=256):(_=GN,U=KN,k=-1),F=0,h=0,u=d,x=s,w=m,y=0,R=-1,g=1<<m,b=g-1,e===jd&&g>z_||e===G_&&g>W_)return 1;for(;;){me=u-y,l[h]<k?(Ee=0,$=l[h]):l[h]>k?(Ee=U[Z+l[h]],$=_[P+l[h]]):(Ee=96,$=0),O=1<<u-y,S=1<<w,d=S;do S-=O,o[x+(F>>y)+S]=me<<24|Ee<<16|$|0;while(S!==0);for(O=1<<u-1;F&O;)O>>=1;if(O!==0?(F&=O-1,F+=O):F=0,h++,--C[u]===0){if(u===p)break;u=r[i+l[h]]}if(u>m&&(F&b)!==R){for(y===0&&(y=m),x+=d,w=u-y,v=1<<w;w+y<p&&(v-=C[w+y],!(v<=0));)w++,v<<=1;if(g+=1<<w,e===jd&&g>z_||e===G_&&g>W_)return 1;R=F&b,o[R]=m<<24|w<<16|x-s|0}}return F!==0&&(o[x+F]=u-y<<24|64<<16|0),f.bits=m,0},"inflate_table")});var PF=T(Ct=>{"use strict";var ct=dr(),Vd=Rd(),tr=kd(),ZN=H_(),ls=Z_(),XN=0,_F=1,FF=2,X_=4,YN=5,Xl=6,Ti=0,JN=1,QN=2,Et=-2,EF=-3,Gd=-4,eB=-5,Y_=8,SF=1,J_=2,Q_=3,eF=4,tF=5,rF=6,iF=7,nF=8,oF=9,sF=10,Ql=11,wr=12,Ud=13,aF=14,Hd=15,lF=16,cF=17,fF=18,uF=19,Yl=20,Jl=21,hF=22,dF=23,pF=24,mF=25,wF=26,qd=27,yF=28,gF=29,pe=30,Kd=31,tB=32,rB=852,iB=592,nB=15,oB=nB;function bF(t){return(t>>>24&255)+(t>>>8&65280)+((t&65280)<<8)+((t&255)<<24)}a(bF,"zswap32");function sB(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new ct.Buf16(320),this.work=new ct.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}a(sB,"InflateState");function xF(t){var e;return!t||!t.state?Et:(e=t.state,t.total_in=t.total_out=e.total=0,t.msg="",e.wrap&&(t.adler=e.wrap&1),e.mode=SF,e.last=0,e.havedict=0,e.dmax=32768,e.head=null,e.hold=0,e.bits=0,e.lencode=e.lendyn=new ct.Buf32(rB),e.distcode=e.distdyn=new ct.Buf32(iB),e.sane=1,e.back=-1,Ti)}a(xF,"inflateResetKeep");function TF(t){var e;return!t||!t.state?Et:(e=t.state,e.wsize=0,e.whave=0,e.wnext=0,xF(t))}a(TF,"inflateReset");function OF(t,e){var r,i;return!t||!t.state||(i=t.state,e<0?(r=0,e=-e):(r=(e>>4)+1,e<48&&(e&=15)),e&&(e<8||e>15))?Et:(i.window!==null&&i.wbits!==e&&(i.window=null),i.wrap=r,i.wbits=e,TF(t))}a(OF,"inflateReset2");function RF(t,e){var r,i;return t?(i=new sB,t.state=i,i.window=null,r=OF(t,e),r!==Ti&&(t.state=null),r):Et}a(RF,"inflateInit2");function aB(t){return RF(t,oB)}a(aB,"inflateInit");var vF=!0,zd,Wd;function lB(t){if(vF){var e;for(zd=new ct.Buf32(512),Wd=new ct.Buf32(32),e=0;e<144;)t.lens[e++]=8;for(;e<256;)t.lens[e++]=9;for(;e<280;)t.lens[e++]=7;for(;e<288;)t.lens[e++]=8;for(ls(_F,t.lens,0,288,zd,0,t.work,{bits:9}),e=0;e<32;)t.lens[e++]=5;ls(FF,t.lens,0,32,Wd,0,t.work,{bits:5}),vF=!1}t.lencode=zd,t.lenbits=9,t.distcode=Wd,t.distbits=5}a(lB,"fixedtables");function kF(t,e,r,i){var n,o=t.state;return o.window===null&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new ct.Buf8(o.wsize)),i>=o.wsize?(ct.arraySet(o.window,e,r-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):(n=o.wsize-o.wnext,n>i&&(n=i),ct.arraySet(o.window,e,r-i,n,o.wnext),i-=n,i?(ct.arraySet(o.window,e,r-i,i,0),o.wnext=i,o.whave=o.wsize):(o.wnext+=n,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=n))),0}a(kF,"updatewindow");function cB(t,e){var r,i,n,o,s,l,f,c,u,h,d,p,m,w,y=0,v,g,F,O,S,R,b,x,_=new ct.Buf8(4),P,k,C=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!t||!t.state||!t.output||!t.input&&t.avail_in!==0)return Et;r=t.state,r.mode===wr&&(r.mode=Ud),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,h=l,d=f,x=Ti;e:for(;;)switch(r.mode){case SF:if(r.wrap===0){r.mode=Ud;break}for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.wrap&2&&c===35615){r.check=0,_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0),c=0,u=0,r.mode=J_;break}if(r.flags=0,r.head&&(r.head.done=!1),!(r.wrap&1)||(((c&255)<<8)+(c>>8))%31){t.msg="incorrect header check",r.mode=pe;break}if((c&15)!==Y_){t.msg="unknown compression method",r.mode=pe;break}if(c>>>=4,u-=4,b=(c&15)+8,r.wbits===0)r.wbits=b;else if(b>r.wbits){t.msg="invalid window size",r.mode=pe;break}r.dmax=1<<b,t.adler=r.check=1,r.mode=c&512?sF:wr,c=0,u=0;break;case J_:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.flags=c,(r.flags&255)!==Y_){t.msg="unknown compression method",r.mode=pe;break}if(r.flags&57344){t.msg="unknown header flags set",r.mode=pe;break}r.head&&(r.head.text=c>>8&1),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=Q_;case Q_:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.time=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,_[2]=c>>>16&255,_[3]=c>>>24&255,r.check=tr(r.check,_,4,0)),c=0,u=0,r.mode=eF;case eF:for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.head&&(r.head.xflags=c&255,r.head.os=c>>8),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0,r.mode=tF;case tF:if(r.flags&1024){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),r.flags&512&&(_[0]=c&255,_[1]=c>>>8&255,r.check=tr(r.check,_,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=rF;case rF:if(r.flags&1024&&(p=r.length,p>l&&(p=l),p&&(r.head&&(b=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Array(r.head.extra_len)),ct.arraySet(r.head.extra,i,o,p,b)),r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,r.length-=p),r.length))break e;r.length=0,r.mode=iF;case iF:if(r.flags&2048){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.name+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=nF;case nF:if(r.flags&4096){if(l===0)break e;p=0;do b=i[o+p++],r.head&&b&&r.length<65536&&(r.head.comment+=String.fromCharCode(b));while(b&&p<l);if(r.flags&512&&(r.check=tr(r.check,i,p,o)),l-=p,o+=p,b)break e}else r.head&&(r.head.comment=null);r.mode=oF;case oF:if(r.flags&512){for(;u<16;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.check&65535)){t.msg="header crc mismatch",r.mode=pe;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),t.adler=r.check=0,r.mode=wr;break;case sF:for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}t.adler=r.check=bF(c),c=0,u=0,r.mode=Ql;case Ql:if(r.havedict===0)return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,QN;t.adler=r.check=1,r.mode=wr;case wr:if(e===YN||e===Xl)break e;case Ud:if(r.last){c>>>=u&7,u-=u&7,r.mode=qd;break}for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}switch(r.last=c&1,c>>>=1,u-=1,c&3){case 0:r.mode=aF;break;case 1:if(lB(r),r.mode=Yl,e===Xl){c>>>=2,u-=2;break e}break;case 2:r.mode=cF;break;case 3:t.msg="invalid block type",r.mode=pe}c>>>=2,u-=2;break;case aF:for(c>>>=u&7,u-=u&7;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if((c&65535)!==(c>>>16^65535)){t.msg="invalid stored block lengths",r.mode=pe;break}if(r.length=c&65535,c=0,u=0,r.mode=Hd,e===Xl)break e;case Hd:r.mode=lF;case lF:if(p=r.length,p){if(p>l&&(p=l),p>f&&(p=f),p===0)break e;ct.arraySet(n,i,o,p,s),l-=p,o+=p,f-=p,s+=p,r.length-=p;break}r.mode=wr;break;case cF:for(;u<14;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(r.nlen=(c&31)+257,c>>>=5,u-=5,r.ndist=(c&31)+1,c>>>=5,u-=5,r.ncode=(c&15)+4,c>>>=4,u-=4,r.nlen>286||r.ndist>30){t.msg="too many length or distance symbols",r.mode=pe;break}r.have=0,r.mode=fF;case fF:for(;r.have<r.ncode;){for(;u<3;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.lens[C[r.have++]]=c&7,c>>>=3,u-=3}for(;r.have<19;)r.lens[C[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,P={bits:r.lenbits},x=ls(XN,r.lens,0,19,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid code lengths set",r.mode=pe;break}r.have=0,r.mode=uF;case uF:for(;r.have<r.nlen+r.ndist;){for(;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(F<16)c>>>=v,u-=v,r.lens[r.have++]=F;else{if(F===16){for(k=v+2;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c>>>=v,u-=v,r.have===0){t.msg="invalid bit length repeat",r.mode=pe;break}b=r.lens[r.have-1],p=3+(c&3),c>>>=2,u-=2}else if(F===17){for(k=v+3;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=3+(c&7),c>>>=3,u-=3}else{for(k=v+7;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=v,u-=v,b=0,p=11+(c&127),c>>>=7,u-=7}if(r.have+p>r.nlen+r.ndist){t.msg="invalid bit length repeat",r.mode=pe;break}for(;p--;)r.lens[r.have++]=b}}if(r.mode===pe)break;if(r.lens[256]===0){t.msg="invalid code -- missing end-of-block",r.mode=pe;break}if(r.lenbits=9,P={bits:r.lenbits},x=ls(_F,r.lens,0,r.nlen,r.lencode,0,r.work,P),r.lenbits=P.bits,x){t.msg="invalid literal/lengths set",r.mode=pe;break}if(r.distbits=6,r.distcode=r.distdyn,P={bits:r.distbits},x=ls(FF,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,P),r.distbits=P.bits,x){t.msg="invalid distances set",r.mode=pe;break}if(r.mode=Yl,e===Xl)break e;case Yl:r.mode=Jl;case Jl:if(l>=6&&f>=258){t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,ZN(t,d),s=t.next_out,n=t.output,f=t.avail_out,o=t.next_in,i=t.input,l=t.avail_in,c=r.hold,u=r.bits,r.mode===wr&&(r.back=-1);break}for(r.back=0;y=r.lencode[c&(1<<r.lenbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(g&&!(g&240)){for(O=v,S=g,R=F;y=r.lencode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,r.length=F,g===0){r.mode=wF;break}if(g&32){r.back=-1,r.mode=wr;break}if(g&64){t.msg="invalid literal/length code",r.mode=pe;break}r.extra=g&15,r.mode=hF;case hF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=dF;case dF:for(;y=r.distcode[c&(1<<r.distbits)-1],v=y>>>24,g=y>>>16&255,F=y&65535,!(v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(!(g&240)){for(O=v,S=g,R=F;y=r.distcode[R+((c&(1<<O+S)-1)>>O)],v=y>>>24,g=y>>>16&255,F=y&65535,!(O+v<=u);){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}c>>>=O,u-=O,r.back+=O}if(c>>>=v,u-=v,r.back+=v,g&64){t.msg="invalid distance code",r.mode=pe;break}r.offset=F,r.extra=g&15,r.mode=pF;case pF:if(r.extra){for(k=r.extra;u<k;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){t.msg="invalid distance too far back",r.mode=pe;break}r.mode=mF;case mF:if(f===0)break e;if(p=d-f,r.offset>p){if(p=r.offset-p,p>r.whave&&r.sane){t.msg="invalid distance too far back",r.mode=pe;break}p>r.wnext?(p-=r.wnext,m=r.wsize-p):m=r.wnext-p,p>r.length&&(p=r.length),w=r.window}else w=n,m=s-r.offset,p=r.length;p>f&&(p=f),f-=p,r.length-=p;do n[s++]=w[m++];while(--p);r.length===0&&(r.mode=Jl);break;case wF:if(f===0)break e;n[s++]=r.length,f--,r.mode=Jl;break;case qd:if(r.wrap){for(;u<32;){if(l===0)break e;l--,c|=i[o++]<<u,u+=8}if(d-=f,t.total_out+=d,r.total+=d,d&&(t.adler=r.check=r.flags?tr(r.check,n,d,s-d):Vd(r.check,n,d,s-d)),d=f,(r.flags?c:bF(c))!==r.check){t.msg="incorrect data check",r.mode=pe;break}c=0,u=0}r.mode=yF;case yF:if(r.wrap&&r.flags){for(;u<32;){if(l===0)break e;l--,c+=i[o++]<<u,u+=8}if(c!==(r.total&4294967295)){t.msg="incorrect length check",r.mode=pe;break}c=0,u=0}r.mode=gF;case gF:x=JN;break e;case pe:x=EF;break e;case Kd:return Gd;case tB:default:return Et}return t.next_out=s,t.avail_out=f,t.next_in=o,t.avail_in=l,r.hold=c,r.bits=u,(r.wsize||d!==t.avail_out&&r.mode<pe&&(r.mode<qd||e!==X_))&&kF(t,t.output,t.next_out,d-t.avail_out)?(r.mode=Kd,Gd):(h-=t.avail_in,d-=t.avail_out,t.total_in+=h,t.total_out+=d,r.total+=d,r.wrap&&d&&(t.adler=r.check=r.flags?tr(r.check,n,d,t.next_out-d):Vd(r.check,n,d,t.next_out-d)),t.data_type=r.bits+(r.last?64:0)+(r.mode===wr?128:0)+(r.mode===Yl||r.mode===Hd?256:0),(h===0&&d===0||e===X_)&&x===Ti&&(x=eB),x)}a(cB,"inflate");function fB(t){if(!t||!t.state)return Et;var e=t.state;return e.window&&(e.window=null),t.state=null,Ti}a(fB,"inflateEnd");function uB(t,e){var r;return!t||!t.state||(r=t.state,!(r.wrap&2))?Et:(r.head=e,e.done=!1,Ti)}a(uB,"inflateGetHeader");function hB(t,e){var r=e.length,i,n,o;return!t||!t.state||(i=t.state,i.wrap!==0&&i.mode!==Ql)?Et:i.mode===Ql&&(n=1,n=Vd(n,e,r,0),n!==i.check)?EF:(o=kF(t,e,r,r),o?(i.mode=Kd,Gd):(i.havedict=1,Ti))}a(hB,"inflateSetDictionary");Ct.inflateReset=TF;Ct.inflateReset2=OF;Ct.inflateResetKeep=xF;Ct.inflateInit=aB;Ct.inflateInit2=RF;Ct.inflate=cB;Ct.inflateEnd=fB;Ct.inflateGetHeader=uB;Ct.inflateSetDictionary=hB;Ct.inflateInfo="pako inflate (from Nodeca project)"});var Zd=T((KU,AF)=>{"use strict";AF.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}});var DF=T((ZU,IF)=>{"use strict";function dB(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}a(dB,"GZheader");IF.exports=dB});var NF=T(fs=>{"use strict";var Bn=PF(),cs=dr(),ec=Cd(),_e=Zd(),Xd=Ul(),pB=Nd(),mB=DF(),CF=Object.prototype.toString;function Oi(t){if(!(this instanceof Oi))return new Oi(t);this.options=cs.assign({chunkSize:16384,windowBits:0,to:""},t||{});var e=this.options;e.raw&&e.windowBits>=0&&e.windowBits<16&&(e.windowBits=-e.windowBits,e.windowBits===0&&(e.windowBits=-15)),e.windowBits>=0&&e.windowBits<16&&!(t&&t.windowBits)&&(e.windowBits+=32),e.windowBits>15&&e.windowBits<48&&(e.windowBits&15||(e.windowBits|=15)),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pB,this.strm.avail_out=0;var r=Bn.inflateInit2(this.strm,e.windowBits);if(r!==_e.Z_OK)throw new Error(Xd[r]);if(this.header=new mB,Bn.inflateGetHeader(this.strm,this.header),e.dictionary&&(typeof e.dictionary=="string"?e.dictionary=ec.string2buf(e.dictionary):CF.call(e.dictionary)==="[object ArrayBuffer]"&&(e.dictionary=new Uint8Array(e.dictionary)),e.raw&&(r=Bn.inflateSetDictionary(this.strm,e.dictionary),r!==_e.Z_OK)))throw new Error(Xd[r])}a(Oi,"Inflate");Oi.prototype.push=function(t,e){var r=this.strm,i=this.options.chunkSize,n=this.options.dictionary,o,s,l,f,c,u=!1;if(this.ended)return!1;s=e===~~e?e:e===!0?_e.Z_FINISH:_e.Z_NO_FLUSH,typeof t=="string"?r.input=ec.binstring2buf(t):CF.call(t)==="[object ArrayBuffer]"?r.input=new Uint8Array(t):r.input=t,r.next_in=0,r.avail_in=r.input.length;do{if(r.avail_out===0&&(r.output=new cs.Buf8(i),r.next_out=0,r.avail_out=i),o=Bn.inflate(r,_e.Z_NO_FLUSH),o===_e.Z_NEED_DICT&&n&&(o=Bn.inflateSetDictionary(this.strm,n)),o===_e.Z_BUF_ERROR&&u===!0&&(o=_e.Z_OK,u=!1),o!==_e.Z_STREAM_END&&o!==_e.Z_OK)return this.onEnd(o),this.ended=!0,!1;r.next_out&&(r.avail_out===0||o===_e.Z_STREAM_END||r.avail_in===0&&(s===_e.Z_FINISH||s===_e.Z_SYNC_FLUSH))&&(this.options.to==="string"?(l=ec.utf8border(r.output,r.next_out),f=r.next_out-l,c=ec.buf2string(r.output,l),r.next_out=f,r.avail_out=i-f,f&&cs.arraySet(r.output,r.output,l,f,0),this.onData(c)):this.onData(cs.shrinkBuf(r.output,r.next_out))),r.avail_in===0&&r.avail_out===0&&(u=!0)}while((r.avail_in>0||r.avail_out===0)&&o!==_e.Z_STREAM_END);return o===_e.Z_STREAM_END&&(s=_e.Z_FINISH),s===_e.Z_FINISH?(o=Bn.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,o===_e.Z_OK):(s===_e.Z_SYNC_FLUSH&&(this.onEnd(_e.Z_OK),r.avail_out=0),!0)};Oi.prototype.onData=function(t){this.chunks.push(t)};Oi.prototype.onEnd=function(t){t===_e.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=cs.flattenChunks(this.chunks)),this.chunks=[],this.err=t,this.msg=this.strm.msg};function Yd(t,e){var r=new Oi(e);if(r.push(t,!0),r.err)throw r.msg||Xd[r.err];return r.result}a(Yd,"inflate");function wB(t,e){return e=e||{},e.raw=!0,Yd(t,e)}a(wB,"inflateRaw");fs.Inflate=Oi;fs.inflate=Yd;fs.inflateRaw=wB;fs.ungzip=Yd});var $F=T((QU,LF)=>{"use strict";var yB=dr().assign,gB=j_(),bB=NF(),vB=Zd(),BF={};yB(BF,gB,bB,vB);LF.exports=BF});var UF=T((eH,jF)=>{"use strict";var MF=a((t,e)=>function(...r){let i=e.promiseModule;return new i((n,o)=>{e.multiArgs?r.push((...s)=>{e.errorFirst?s[0]?o(s):(s.shift(),n(s)):n(s)}):e.errorFirst?r.push((s,l)=>{s?o(s):n(l)}):r.push(n),t.apply(this,r)})},"processFn");jF.exports=(t,e)=>{e=Object.assign({exclude:[/.+(Sync|Stream)$/],errorFirst:!0,promiseModule:Promise},e);let r=typeof t;if(!(t!==null&&(r==="object"||r==="function")))throw new TypeError(`Expected \`input\` to be a \`Function\` or \`Object\`, got \`${t===null?"null":r}\``);let i=a(o=>{let s=a(l=>typeof l=="string"?o===l:l.test(o),"match");return e.include?e.include.some(s):!e.exclude.some(s)},"filter"),n;r==="function"?n=a(function(...o){return e.excludeMain?t(...o):MF(t,e).apply(this,o)},"ret"):n=Object.create(Object.getPrototypeOf(t));for(let o in t){let s=t[o];n[o]=typeof s=="function"&&i(o)?MF(s,e):s}return n}});var XF=T((rH,ZF)=>{function HF(t){return Array.isArray(t)?t:[t]}a(HF,"makeArray");var ep="",qF=" ",Jd="\\",_B=/^\s+$/,FB=/(?:[^\\]|^)\\$/,EB=/^\\!/,SB=/^\\#/,xB=/\r?\n/g,TB=/^\.*\/|^\.+$/,Qd="/",VF="node-ignore";typeof Symbol<"u"&&(VF=Symbol.for("node-ignore"));var zF=VF,OB=a((t,e,r)=>Object.defineProperty(t,e,{value:r}),"define"),RB=/([0-z])-([0-z])/g,GF=a(()=>!1,"RETURN_FALSE"),kB=a(t=>t.replace(RB,(e,r,i)=>r.charCodeAt(0)<=i.charCodeAt(0)?e:ep),"sanitizeRange"),PB=a(t=>{let{length:e}=t;return t.slice(0,e-e%2)},"cleanRangeBackSlash"),AB=[[/^\uFEFF/,()=>ep],[/((?:\\\\)*?)(\\?\s+)$/,(t,e,r)=>e+(r.indexOf("\\")===0?qF:ep)],[/(\\+?)\s/g,(t,e)=>{let{length:r}=e;return e.slice(0,r-r%2)+qF}],[/[\\$.|*+(){^]/g,t=>`\\${t}`],[/(?!\\)\?/g,()=>"[^/]"],[/^\//,()=>"^"],[/\//g,()=>"\\/"],[/^\^*\\\*\\\*\\\//,()=>"^(?:.*\\/)?"],[/^(?=[^^])/,a(function(){return/\/(?!$)/.test(this)?"^":"(?:^|\\/)"},"startingReplacer")],[/\\\/\\\*\\\*(?=\\\/|$)/g,(t,e,r)=>e+6<r.length?"(?:\\/[^\\/]+)*":"\\/.+"],[/(^|[^\\]+)(\\\*)+(?=.+)/g,(t,e,r)=>{let i=r.replace(/\\\*/g,"[^\\/]*");return e+i}],[/\\\\\\(?=[$.|*+(){^])/g,()=>Jd],[/\\\\/g,()=>Jd],[/(\\)?\[([^\]/]*?)(\\*)($|\])/g,(t,e,r,i,n)=>e===Jd?`\\[${r}${PB(i)}${n}`:n==="]"&&i.length%2===0?`[${kB(r)}${i}]`:"[]"],[/(?:[^*])$/,t=>/\/$/.test(t)?`${t}$`:`${t}(?=$|\\/$)`],[/(\^|\\\/)?\\\*$/,(t,e)=>`${e?`${e}[^/]+`:"[^/]*"}(?=$|\\/$)`]],WF=Object.create(null),IB=a((t,e)=>{let r=WF[t];return r||(r=AB.reduce((i,[n,o])=>i.replace(n,o.bind(t)),t),WF[t]=r),e?new RegExp(r,"i"):new RegExp(r)},"makeRegex"),ip=a(t=>typeof t=="string","isString"),DB=a(t=>t&&ip(t)&&!_B.test(t)&&!FB.test(t)&&t.indexOf("#")!==0,"checkPattern"),CB=a(t=>t.split(xB),"splitPattern"),np=class np{constructor(e,r,i,n){this.origin=e,this.pattern=r,this.negative=i,this.regex=n}};a(np,"IgnoreRule");var tp=np,NB=a((t,e)=>{let r=t,i=!1;t.indexOf("!")===0&&(i=!0,t=t.substr(1)),t=t.replace(EB,"!").replace(SB,"#");let n=IB(t,e);return new tp(r,t,i,n)},"createRule"),BB=a((t,e)=>{throw new e(t)},"throwError"),yr=a((t,e,r)=>ip(t)?t?yr.isNotRelative(t)?r(`path should be a \`path.relative()\`d string, but got "${e}"`,RangeError):!0:r("path must not be empty",TypeError):r(`path must be a string, but got \`${e}\``,TypeError),"checkPath"),KF=a(t=>TB.test(t),"isNotRelative");yr.isNotRelative=KF;yr.convert=t=>t;var op=class op{constructor({ignorecase:e=!0,ignoreCase:r=e,allowRelativePaths:i=!1}={}){OB(this,zF,!0),this._rules=[],this._ignoreCase=r,this._allowRelativePaths=i,this._initCache()}_initCache(){this._ignoreCache=Object.create(null),this._testCache=Object.create(null)}_addPattern(e){if(e&&e[zF]){this._rules=this._rules.concat(e._rules),this._added=!0;return}if(DB(e)){let r=NB(e,this._ignoreCase);this._added=!0,this._rules.push(r)}}add(e){return this._added=!1,HF(ip(e)?CB(e):e).forEach(this._addPattern,this),this._added&&this._initCache(),this}addPattern(e){return this.add(e)}_testOne(e,r){let i=!1,n=!1;return this._rules.forEach(o=>{let{negative:s}=o;if(n===s&&i!==n||s&&!i&&!n&&!r)return;o.regex.test(e)&&(i=!s,n=s)}),{ignored:i,unignored:n}}_test(e,r,i,n){let o=e&&yr.convert(e);return yr(o,e,this._allowRelativePaths?GF:BB),this._t(o,r,i,n)}_t(e,r,i,n){if(e in r)return r[e];if(n||(n=e.split(Qd)),n.pop(),!n.length)return r[e]=this._testOne(e,i);let o=this._t(n.join(Qd)+Qd,r,i,n);return r[e]=o.ignored?o:this._testOne(e,i)}ignores(e){return this._test(e,this._ignoreCache,!1).ignored}createFilter(){return e=>!this.ignores(e)}filter(e){return HF(e).filter(this.createFilter())}test(e){return this._test(e,this._testCache,!0)}};a(op,"Ignore");var rp=op,tc=a(t=>new rp(t),"factory"),LB=a(t=>yr(t&&yr.convert(t),t,GF),"isPathValid");tc.isPathValid=LB;tc.default=tc;ZF.exports=tc;if(typeof process<"u"&&(process.env&&process.env.IGNORE_TEST_WIN32||process.platform==="win32")){let t=a(r=>/^\\\\\?\\/.test(r)||/["<>|\u0000-\u001F]+/u.test(r)?r:r.replace(/\\/g,"/"),"makePosix");yr.convert=t;let e=/^[a-z]:\//i;yr.isNotRelative=r=>e.test(r)||KF(r)}});var JF=T((nH,YF)=>{"use strict";function $B(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}a($B,"escapeRegExp");function rr(t,e,r){return e=e instanceof RegExp?e:new RegExp($B(e),"g"),t.replace(e,r)}a(rr,"replaceAll");var MB={clean:a(function(e){if(typeof e!="string")throw new Error("Expected a string, received: "+e);return e=rr(e,"./","/"),e=rr(e,"..","."),e=rr(e," ","-"),e=rr(e,/^[~^:?*\\\-]/g,""),e=rr(e,/[~^:?*\\]/g,"-"),e=rr(e,/[~^:?*\\\-]$/g,""),e=rr(e,"@{","-"),e=rr(e,/\.$/g,""),e=rr(e,/\/$/g,""),e=rr(e,/\.lock$/g,""),e},"clean")};YF.exports=MB});var eE=T((sH,QF)=>{"use strict";var jB=/(^|[/.])([/.]|$)|^@$|@{|[\x00-\x20\x7f~^:?*[\\]|\.lock(\/|$)/;QF.exports=a(function(e,r){if(typeof e!="string")throw new TypeError("Reference name must be a string");return!jB.test(e)&&(!!r||e.includes("/"))},"validRef")});var rE=T((lH,tE)=>{tE.exports=function(t,e){var r=t,i=e,n=r.length,o=i.length,s=!1,l=null,f=n+1,c=[],u=[],h=[],d="",p=-1,m=0,w=1,y,v,g=a(function(){n>=o&&(y=r,v=n,r=i,i=y,n=o,o=v,s=!0,f=n+1)},"init"),F=a(function(b,x,_){return{x:b,y:x,k:_}},"P"),O=a(function(b,x){return{elem:b,t:x}},"seselem"),S=a(function(b,x,_){var P,k,C;for(x>_?P=c[b-1+f]:P=c[b+1+f],C=Math.max(x,_),k=C-b;k<n&&C<o&&r[k]===i[C];)++k,++C;return c[b+f]=u.length,u[u.length]=new F(k,C,P),C},"snake"),R=a(function(b){var x,_,P,k,C;for(x=_=1,P=k=0,C=b.length-1;C>=0;--C)for(;P<b[C].x||k<b[C].y;)b[C].y-b[C].x>k-P?(s?h[h.length]=new O(i[k],p):h[h.length]=new O(i[k],w),++_,++k):b[C].y-b[C].x<k-P?(s?h[h.length]=new O(r[P],w):h[h.length]=new O(r[P],p),++x,++P):(h[h.length]=new O(r[P],m),d+=r[P],++x,++_,++P,++k)},"recordseq");return g(),{SES_DELETE:-1,SES_COMMON:0,SES_ADD:1,editdistance:a(function(){return l},"editdistance"),getlcs:a(function(){return d},"getlcs"),getses:a(function(){return h},"getses"),compose:a(function(){var b,x,_,P,k,C,N,U;for(b=o-n,x=n+o+3,_={},N=0;N<x;++N)_[N]=-1,c[N]=-1;P=-1;do{for(++P,U=-P;U<=b-1;++U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);for(U=b+P;U>=b+1;--U)_[U+f]=S(U,_[U-1+f]+1,_[U+1+f]);_[b+f]=S(b,_[b-1+f]+1,_[b+1+f])}while(_[b+f]!==o);for(l=b+2*P,k=c[b+f],C=[];k!==-1;)C[C.length]=new F(u[k].x,u[k].y,null),k=u[k].k;R(C)},"compose")}}});var oE=T((fH,nE)=>{var UB=rE();function HB(t,e){var r=new UB(t,e);r.compose();for(var i=r.getses(),n,o,s=t.length-1,l=e.length-1,f=i.length-1;f>=0;--f)i[f].t===r.SES_COMMON?(o?(o.chain={file1index:s,file2index:l,chain:null},o=o.chain):(n={file1index:s,file2index:l,chain:null},o=n),s--,l--):i[f].t===r.SES_DELETE?s--:i[f].t===r.SES_ADD&&l--;var c={file1index:-1,file2index:-1,chain:null};return o?(o.chain=c,n):c}a(HB,"longestCommonSubsequence");function iE(t,e){for(var r=[],i=t.length,n=e.length,o=HB(t,e);o!==null;o=o.chain){var s=i-o.file1index-1,l=n-o.file2index-1;i=o.file1index,n=o.file2index,(s||l)&&r.push({file1:[i+1,s],file2:[n+1,l]})}return r.reverse(),r}a(iE,"diffIndices");function qB(t,e,r){var i,n=iE(e,t),o=iE(e,r),s=[];function l(N,U){s.push([N.file1[0],U,N.file1[1],N.file2[0],N.file2[1]])}for(a(l,"addHunk"),i=0;i<n.length;i++)l(n[i],0);for(i=0;i<o.length;i++)l(o[i],2);s.sort(function(N,U){return N[0]-U[0]});var f=[],c=0;function u(N){N>c&&(f.push([1,c,N-c]),c=N)}a(u,"copyCommon");for(var h=0;h<s.length;h++){for(var d=h,p=s[h],m=p[0],w=m+p[2];h<s.length-1;){var y=s[h+1],v=y[0];if(v>w)break;w=Math.max(w,v+y[2]),h++}if(u(m),d==h)p[4]>0&&f.push([p[1],p[3],p[4]]);else{var g={0:[t.length,-1,e.length,-1],2:[r.length,-1,e.length,-1]};for(i=d;i<=h;i++){p=s[i];var F=p[1],O=g[F],S=p[0],R=S+p[2],b=p[3],x=b+p[4];O[0]=Math.min(b,O[0]),O[1]=Math.max(x,O[1]),O[2]=Math.min(S,O[2]),O[3]=Math.max(R,O[3])}var _=g[0][0]+(m-g[0][2]),P=g[0][1]+(w-g[0][3]),k=g[2][0]+(m-g[2][2]),C=g[2][1]+(w-g[2][3]);f.push([-1,_,P-_,m,w-m,k,C-k])}c=w}return u(e.length),f}a(qB,"diff3MergeIndices");function zB(t,e,r){var i=[],n=[t,e,r],o=qB(t,e,r),s=[];function l(){s.length&&i.push({ok:s}),s=[]}a(l,"flushOk");function f(p){for(var m=0;m<p.length;m++)s.push(p[m])}a(f,"pushOk");function c(p){if(p[2]!=p[6])return!0;for(var m=p[1],w=p[5],y=0;y<p[2];y++)if(t[y+m]!=r[y+w])return!0;return!1}a(c,"isTrueConflict");for(var u=0;u<o.length;u++){var h=o[u],d=h[0];d==-1?c(h)?(l(),i.push({conflict:{a:t.slice(h[1],h[1]+h[2]),aIndex:h[1],o:e.slice(h[3],h[3]+h[4]),oIndex:h[3],b:r.slice(h[5],h[5]+h[6]),bIndex:h[5]}})):f(n[0].slice(h[1],h[1]+h[2])):f(n[d].slice(h[1],h[1]+h[2]))}return l(),i}a(zB,"diff3Merge");nE.exports=zB});var Me=T(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});function vr(t){return t&&typeof t=="object"&&"default"in t?t.default:t}a(vr,"_interopDefault");var ds=vr(ev()),RE=vr(Zv()),D=Sr(),WB=vr(Yv()),Ap=vr($F()),sp=vr(UF()),VB=vr(XF()),ps=vr(JF()),ms=vr(eE()),GB=vr(oE()),pc=class pc extends Error{constructor(e){super(e),this.caller=""}toJSON(){return{code:this.code,data:this.data,caller:this.caller,message:this.message,stack:this.stack}}fromJSON(e){let r=new pc(e.message);return r.code=e.code,r.data=e.data,r.caller=e.caller,r.stack=e.stack,r}get isIsomorphicGitError(){return!0}};a(pc,"BaseError");var re=pc,mc=class mc extends re{constructor(e){super(`Modifying the index is not possible because you have unmerged files: ${e.toString}. Fix them up in the work tree, and then use 'git add/rm as appropriate to mark resolution and make a commit.`),this.code=this.name=mc.code,this.data={filepaths:e}}};a(mc,"UnmergedPathsError");var ws=mc;ws.code="UnmergedPathsError";var wc=class wc extends re{constructor(e){super(`An internal error caused this command to fail. Please file a bug report at https://github.com/isomorphic-git/isomorphic-git/issues with this error message: ${e}`),this.code=this.name=wc.code,this.data={message:e}}};a(wc,"InternalError");var W=wc;W.code="InternalError";var yc=class yc extends re{constructor(e){super(`The filepath "${e}" contains unsafe character sequences`),this.code=this.name=yc.code,this.data={filepath:e}}};a(yc,"UnsafeFilepathError");var jn=yc;jn.code="UnsafeFilepathError";var $p=class $p{constructor(e){this.buffer=e,this._start=0}eof(){return this._start>=this.buffer.length}tell(){return this._start}seek(e){this._start=e}slice(e){let r=this.buffer.slice(this._start,this._start+e);return this._start+=e,r}toString(e,r){let i=this.buffer.toString(e,this._start,this._start+r);return this._start+=r,i}write(e,r,i){let n=this.buffer.write(e,this._start,r,i);return this._start+=r,n}copy(e,r,i){let n=e.copy(this.buffer,this._start,r,i);return this._start+=n,n}readUInt8(){let e=this.buffer.readUInt8(this._start);return this._start+=1,e}writeUInt8(e){let r=this.buffer.writeUInt8(e,this._start);return this._start+=1,r}readUInt16BE(){let e=this.buffer.readUInt16BE(this._start);return this._start+=2,e}writeUInt16BE(e){let r=this.buffer.writeUInt16BE(e,this._start);return this._start+=2,r}readUInt32BE(){let e=this.buffer.readUInt32BE(this._start);return this._start+=4,e}writeUInt32BE(e){let r=this.buffer.writeUInt32BE(e,this._start);return this._start+=4,r}};a($p,"BufferCursor");var St=$p;function Qc(t,e){return-(t<e)||+(t>e)}a(Qc,"compareStrings");function kE(t,e){return Qc(t.path,e.path)}a(kE,"comparePath");function PE(t){let e=t>0?t>>12:0;e!==4&&e!==8&&e!==10&&e!==14&&(e=8);let r=t&511;return r&73?r=493:r=420,e!==8&&(r=0),(e<<12)+r}a(PE,"normalizeMode");var ir=2**32;function sE(t,e,r,i){if(t!==void 0&&e!==void 0)return[t,e];r===void 0&&(r=i.valueOf());let n=Math.floor(r/1e3),o=(r-n*1e3)*1e6;return[n,o]}a(sE,"SecondsNanoseconds");function Un(t){let[e,r]=sE(t.ctimeSeconds,t.ctimeNanoseconds,t.ctimeMs,t.ctime),[i,n]=sE(t.mtimeSeconds,t.mtimeNanoseconds,t.mtimeMs,t.mtime);return{ctimeSeconds:e%ir,ctimeNanoseconds:r%ir,mtimeSeconds:i%ir,mtimeNanoseconds:n%ir,dev:t.dev%ir,ino:t.ino%ir,mode:PE(t.mode%ir),uid:t.uid%ir,gid:t.gid%ir,size:t.size>-1?t.size%ir:0}}a(Un,"normalizeStats");function KB(t){let e="";for(let r of new Uint8Array(t))r<16&&(e+="0"),e+=r.toString(16);return e}a(KB,"toHex");var ap=null;async function br(t){return ap===null&&(ap=await XB()),ap?AE(t):ZB(t)}a(br,"shasum");function ZB(t){return new RE().update(t).digest("hex")}a(ZB,"shasumSync");async function AE(t){let e=await crypto.subtle.digest("SHA-1",t);return KB(e)}a(AE,"subtleSHA1");async function XB(){try{return await AE(new Uint8Array([]))==="da39a3ee5e6b4b0d3255bfef95601890afd80709"}catch{}return!1}a(XB,"testSubtleSHA1");function YB(t){return{assumeValid:!!(t&32768),extended:!!(t&16384),stage:(t&12288)>>12,nameLength:t&4095}}a(YB,"parseCacheEntryFlags");function JB(t){let e=t.flags;return e.extended=!1,e.nameLength=Math.min(Buffer.from(t.path).length,4095),(e.assumeValid?32768:0)+(e.extended?16384:0)+((e.stage&3)<<12)+(e.nameLength&4095)}a(JB,"renderCacheEntryFlags");var Wr=class Wr{constructor(e,r){this._dirty=!1,this._unmergedPaths=r||new Set,this._entries=e||new Map}_addEntry(e){if(e.flags.stage===0)e.stages=[e],this._entries.set(e.path,e),this._unmergedPaths.delete(e.path);else{let r=this._entries.get(e.path);r||(this._entries.set(e.path,e),r=e),r.stages[e.flags.stage]=e,this._unmergedPaths.add(e.path)}}static async from(e){if(Buffer.isBuffer(e))return Wr.fromBuffer(e);if(e===null)return new Wr(null);throw new W("invalid type passed to GitIndex.from")}static async fromBuffer(e){if(e.length===0)throw new W("Index file is empty (.git/index)");let r=new Wr,i=new St(e),n=i.toString("utf8",4);if(n!=="DIRC")throw new W(`Invalid dircache magic file number: ${n}`);let o=await br(e.slice(0,-20)),s=e.slice(-20).toString("hex");if(s!==o)throw new W(`Invalid checksum in GitIndex buffer: expected ${s} but saw ${o}`);let l=i.readUInt32BE();if(l!==2)throw new W(`Unsupported dircache version: ${l}`);let f=i.readUInt32BE(),c=0;for(;!i.eof()&&c<f;){let u={};u.ctimeSeconds=i.readUInt32BE(),u.ctimeNanoseconds=i.readUInt32BE(),u.mtimeSeconds=i.readUInt32BE(),u.mtimeNanoseconds=i.readUInt32BE(),u.dev=i.readUInt32BE(),u.ino=i.readUInt32BE(),u.mode=i.readUInt32BE(),u.uid=i.readUInt32BE(),u.gid=i.readUInt32BE(),u.size=i.readUInt32BE(),u.oid=i.slice(20).toString("hex");let h=i.readUInt16BE();u.flags=YB(h);let d=e.indexOf(0,i.tell()+1)-i.tell();if(d<1)throw new W(`Got a path length of: ${d}`);if(u.path=i.toString("utf8",d),u.path.includes("..\\")||u.path.includes("../"))throw new jn(u.path);let p=8-(i.tell()-12)%8;for(p===0&&(p=8);p--;){let m=i.readUInt8();if(m!==0)throw new W(`Expected 1-8 null characters but got '${m}' after ${u.path}`);if(i.eof())throw new W("Unexpected end of file")}u.stages=[],r._addEntry(u),c++}return r}get unmergedPaths(){return[...this._unmergedPaths]}get entries(){return[...this._entries.values()].sort(kE)}get entriesMap(){return this._entries}get entriesFlat(){return[...this.entries].flatMap(e=>e.stages.length>1?e.stages.filter(r=>r):e)}*[Symbol.iterator](){for(let e of this.entries)yield e}insert({filepath:e,stats:r,oid:i,stage:n=0}){r||(r={ctimeSeconds:0,ctimeNanoseconds:0,mtimeSeconds:0,mtimeNanoseconds:0,dev:0,ino:0,mode:0,uid:0,gid:0,size:0}),r=Un(r);let o=Buffer.from(e),s={ctimeSeconds:r.ctimeSeconds,ctimeNanoseconds:r.ctimeNanoseconds,mtimeSeconds:r.mtimeSeconds,mtimeNanoseconds:r.mtimeNanoseconds,dev:r.dev,ino:r.ino,mode:r.mode||33188,uid:r.uid,gid:r.gid,size:r.size,path:e,oid:i,flags:{assumeValid:!1,extended:!1,stage:n,nameLength:o.length<4095?o.length:4095},stages:[]};this._addEntry(s),this._dirty=!0}delete({filepath:e}){if(this._entries.has(e))this._entries.delete(e);else for(let r of this._entries.keys())r.startsWith(e+"/")&&this._entries.delete(r);this._unmergedPaths.has(e)&&this._unmergedPaths.delete(e),this._dirty=!0}clear(){this._entries.clear(),this._dirty=!0}has({filepath:e}){return this._entries.has(e)}render(){return this.entries.map(e=>`${e.mode.toString(8)} ${e.oid} ${e.path}`).join(`
|
|
14
|
+
`)}static async _entryToBuffer(e){let r=Buffer.from(e.path),i=Math.ceil((62+r.length+1)/8)*8,n=Buffer.alloc(i),o=new St(n),s=Un(e);return o.writeUInt32BE(s.ctimeSeconds),o.writeUInt32BE(s.ctimeNanoseconds),o.writeUInt32BE(s.mtimeSeconds),o.writeUInt32BE(s.mtimeNanoseconds),o.writeUInt32BE(s.dev),o.writeUInt32BE(s.ino),o.writeUInt32BE(s.mode),o.writeUInt32BE(s.uid),o.writeUInt32BE(s.gid),o.writeUInt32BE(s.size),o.write(e.oid,20,"hex"),o.writeUInt16BE(JB(e)),o.write(e.path,r.length,"utf8"),n}async toObject(){let e=Buffer.alloc(12),r=new St(e);r.write("DIRC",4,"utf8"),r.writeUInt32BE(2),r.writeUInt32BE(this.entriesFlat.length);let i=[];for(let l of this.entries)if(i.push(Wr._entryToBuffer(l)),l.stages.length>1)for(let f of l.stages)f&&f!==l&&i.push(Wr._entryToBuffer(f));i=await Promise.all(i);let n=Buffer.concat(i),o=Buffer.concat([e,n]),s=await br(o);return Buffer.concat([o,Buffer.from(s,"hex")])}};a(Wr,"GitIndex");var bp=Wr;function nc(t,e,r=!0,i=!0){let n=Un(t),o=Un(e);return r&&n.mode!==o.mode||n.mtimeSeconds!==o.mtimeSeconds||n.ctimeSeconds!==o.ctimeSeconds||n.uid!==o.uid||n.gid!==o.gid||i&&n.ino!==o.ino||n.size!==o.size}a(nc,"compareStats");var lp=null,cp=Symbol("IndexCache");function QB(){return{map:new Map,stats:new Map}}a(QB,"createCache");async function eL(t,e,r){let[i,n]=await Promise.all([t.lstat(e),t.read(e)]),o=await bp.from(n);r.map.set(e,o),r.stats.set(e,i)}a(eL,"updateCachedIndexFile");async function tL(t,e,r){let i=r.stats.get(e);if(i===void 0)return!0;if(i===null)return!1;let n=await t.lstat(e);return n===null?!1:nc(i,n)}a(tL,"isIndexStale");var Mp=class Mp{static async acquire({fs:e,gitdir:r,cache:i,allowUnmerged:n=!0},o){i[cp]||(i[cp]=QB());let s=`${r}/index`;lp===null&&(lp=new ds({maxPending:1/0}));let l,f=[];return await lp.acquire(s,async()=>{let c=i[cp];await tL(e,s,c)&&await eL(e,s,c);let u=c.map.get(s);if(f=u.unmergedPaths,f.length&&!n)throw new ws(f);if(l=await o(u),u._dirty){let h=await u.toObject();await e.write(s,h),c.stats.set(s,await e.lstat(s)),u._dirty=!1}}),l}};a(Mp,"GitIndexManager");var Fe=Mp;function oc(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e>-1&&(t=t.slice(e+1)),t}a(oc,"basename");function Hn(t){let e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?".":e===0?"/":t.slice(0,e)}a(Hn,"dirname");function IE(t){let e=new Map,r=a(function(n){if(!e.has(n)){let o={type:"tree",fullpath:n,basename:oc(n),metadata:{},children:[]};e.set(n,o),o.parent=r(Hn(n)),o.parent&&o.parent!==o&&o.parent.children.push(o)}return e.get(n)},"mkdir"),i=a(function(n,o){if(!e.has(n)){let s={type:"blob",fullpath:n,basename:oc(n),metadata:o,parent:r(Hn(n)),children:[]};s.parent&&s.parent.children.push(s),e.set(n,s)}return e.get(n)},"mkfile");r(".");for(let n of t)i(n.path,n);return e}a(IE,"flatFileListToDirectoryStructure");function rL(t){switch(t){case 16384:return"tree";case 33188:return"blob";case 33261:return"blob";case 40960:return"blob";case 57344:return"commit"}throw new W(`Unexpected GitTree entry mode: ${t.toString(8)}`)}a(rL,"mode2type");var jp=class jp{constructor({fs:e,gitdir:r,cache:i}){var o;this.treePromise=Fe.acquire({fs:e,gitdir:r,cache:i},async function(s){return IE(s.entries)});let n=this;this.ConstructEntry=(o=class{constructor(l){this._fullpath=l,this._type=!1,this._mode=!1,this._stat=!1,this._oid=!1}async type(){return n.type(this)}async mode(){return n.mode(this)}async stat(){return n.stat(this)}async content(){return n.content(this)}async oid(){return n.oid(this)}},a(o,"StageEntry"),o)}async readdir(e){let r=e._fullpath,n=(await this.treePromise).get(r);if(!n||n.type==="blob")return null;if(n.type!=="tree")throw new Error(`ENOTDIR: not a directory, scandir '${r}'`);let o=n.children.map(s=>s.fullpath);return o.sort(Qc),o}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let i=(await this.treePromise).get(e._fullpath);if(!i)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let n=i.type==="tree"?{}:Un(i.metadata);e._type=i.type==="tree"?"tree":rL(n.mode),e._mode=n.mode,i.type==="tree"?e._stat=void 0:e._stat=n}return e._stat}async content(e){}async oid(e){if(e._oid===!1){let i=(await this.treePromise).get(e._fullpath);e._oid=i.metadata.oid}return e._oid}};a(jp,"GitWalkerIndex");var vp=jp,ef=Symbol("GitWalkSymbol");function Di(){let t=Object.create(null);return Object.defineProperty(t,ef,{value:a(function({fs:e,gitdir:r,cache:i}){return new vp({fs:e,gitdir:r,cache:i})},"value")}),Object.freeze(t),t}a(Di,"STAGE");var gc=class gc extends re{constructor(e){super(`Could not find ${e}.`),this.code=this.name=gc.code,this.data={what:e}}};a(gc,"NotFoundError");var ce=gc;ce.code="NotFoundError";var bc=class bc extends re{constructor(e,r,i,n){super(`Object ${e} ${n?`at ${n}`:""}was anticipated to be a ${i} but it is a ${r}.`),this.code=this.name=bc.code,this.data={oid:e,actual:r,expected:i,filepath:n}}};a(bc,"ObjectTypeError");var Ze=bc;Ze.code="ObjectTypeError";var vc=class vc extends re{constructor(e){super(`Expected a 40-char hex object id but saw "${e}".`),this.code=this.name=vc.code,this.data={value:e}}};a(vc,"InvalidOidError");var Gr=vc;Gr.code="InvalidOidError";var _c=class _c extends re{constructor(e){super(`Could not find a fetch refspec for remote "${e}". Make sure the config file has an entry like the following:
|
|
15
15
|
[remote "${e}"]
|
|
16
16
|
fetch = +refs/heads/*:refs/remotes/origin/*
|
|
17
17
|
`),this.code=this.name=_c.code,this.data={remote:e}}};a(_c,"NoRefspecError");var ys=_c;ys.code="NoRefspecError";var Fc=class Fc{constructor(e){if(this.refs=new Map,this.parsedConfig=[],e){let r=null;this.parsedConfig=e.trim().split(`
|
|
18
18
|
`).map(i=>{if(/^\s*#/.test(i))return{line:i,comment:!0};let n=i.indexOf(" ");if(i.startsWith("^")){let o=i.slice(1);return this.refs.set(r+"^{}",o),{line:i,ref:r,peeled:o}}else{let o=i.slice(0,n);return r=i.slice(n+1),this.refs.set(r,o),{line:i,ref:r,oid:o}}})}return this}static from(e){return new Fc(e)}delete(e){this.parsedConfig=this.parsedConfig.filter(r=>r.ref!==e),this.refs.delete(e)}toString(){return this.parsedConfig.map(({line:e})=>e).join(`
|
|
19
19
|
`)+`
|
|
20
|
-
`}};a(Fc,"GitPackedRefs");var sc=Fc,Ec=class Ec{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,o,s]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),l=r==="+",f=n==="*";if(f!==(s==="*"))throw new W("Invalid refspec");return new Ec({remotePath:i,localPath:o,force:l,matchPrefix:f})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}};a(Ec,"GitRefSpec");var ac=Ec,Sc=class Sc{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(ac.from(i));return new Sc(r)}add(e){let r=ac.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let o=i.translate(n);o&&r.push([n,o])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};a(Sc,"GitRefSpecSet");var
|
|
21
|
-
`).map(n=>{let o=null,s=null,l=n.trim(),f=
|
|
22
|
-
`)}};a(xc,"GitConfig");var
|
|
20
|
+
`}};a(Fc,"GitPackedRefs");var sc=Fc,Ec=class Ec{constructor({remotePath:e,localPath:r,force:i,matchPrefix:n}){Object.assign(this,{remotePath:e,localPath:r,force:i,matchPrefix:n})}static from(e){let[r,i,n,o,s]=e.match(/^(\+?)(.*?)(\*?):(.*?)(\*?)$/).slice(1),l=r==="+",f=n==="*";if(f!==(s==="*"))throw new W("Invalid refspec");return new Ec({remotePath:i,localPath:o,force:l,matchPrefix:f})}translate(e){if(this.matchPrefix){if(e.startsWith(this.remotePath))return this.localPath+e.replace(this.remotePath,"")}else if(e===this.remotePath)return this.localPath;return null}reverseTranslate(e){if(this.matchPrefix){if(e.startsWith(this.localPath))return this.remotePath+e.replace(this.localPath,"")}else if(e===this.localPath)return this.remotePath;return null}};a(Ec,"GitRefSpec");var ac=Ec,Sc=class Sc{constructor(e=[]){this.rules=e}static from(e){let r=[];for(let i of e)r.push(ac.from(i));return new Sc(r)}add(e){let r=ac.from(e);this.rules.push(r)}translate(e){let r=[];for(let i of this.rules)for(let n of e){let o=i.translate(n);o&&r.push([n,o])}return r}translateOne(e){let r=null;for(let i of this.rules){let n=i.translate(e);n&&(r=n)}return r}localNamespaces(){return this.rules.filter(e=>e.matchPrefix).map(e=>e.localPath.replace(/\/$/,""))}};a(Sc,"GitRefSpecSet");var _p=Sc;function iL(t,e){let r=t.replace(/\^\{\}$/,""),i=e.replace(/\^\{\}$/,""),n=-(r<i)||+(r>i);return n===0?t.endsWith("^{}")?1:-1:n}a(iL,"compareRefNames");var nL=a(t=>{if(typeof t=="number")return t;t=t.toLowerCase();let e=parseInt(t);return t.endsWith("k")&&(e*=1024),t.endsWith("m")&&(e*=1024*1024),t.endsWith("g")&&(e*=1024*1024*1024),e},"num"),us=a(t=>{if(typeof t=="boolean")return t;if(t=t.trim().toLowerCase(),t==="true"||t==="yes"||t==="on")return!0;if(t==="false"||t==="no"||t==="off")return!1;throw Error(`Expected 'true', 'false', 'yes', 'no', 'on', or 'off', but got ${t}`)},"bool"),aE={core:{filemode:us,bare:us,logallrefupdates:us,symlinks:us,ignorecase:us,bigFileThreshold:nL}},oL=/^\[([A-Za-z0-9-.]+)(?: "(.*)")?\]$/,sL=/^[A-Za-z0-9-.]+$/,aL=/^([A-Za-z][A-Za-z-]*)(?: *= *(.*))?$/,lL=/^[A-Za-z][A-Za-z-]*$/,cL=/^(.*?)( *[#;].*)$/,fL=a(t=>{let e=oL.exec(t);if(e!=null){let[r,i]=e.slice(1);return[r,i]}return null},"extractSectionLine"),uL=a(t=>{let e=aL.exec(t);if(e!=null){let[r,i="true"]=e.slice(1),n=hL(i),o=dL(n);return[r,o]}return null},"extractVariableLine"),hL=a(t=>{let e=cL.exec(t);if(e==null)return t;let[r,i]=e.slice(1);return lE(r)&&lE(i)?`${r}${i}`:r},"removeComments"),lE=a(t=>(t.match(/(?:^|[^\\])"/g)||[]).length%2!==0,"hasOddNumberOfQuotes"),dL=a(t=>t.split("").reduce((e,r,i,n)=>{let o=r==='"'&&n[i-1]!=="\\",s=r==="\\"&&n[i+1]==='"';return o||s?e:e+r},""),"removeQuotes"),cE=a(t=>t!=null?t.toLowerCase():null,"lower"),Fp=a((t,e,r)=>[cE(t),e,cE(r)].filter(i=>i!=null).join("."),"getPath"),fE=a(t=>{let e=t.split("."),r=e.shift(),i=e.pop(),n=e.length?e.join("."):void 0;return{section:r,subsection:n,name:i,path:Fp(r,n,i),sectionPath:Fp(r,n,null),isSection:!!r}},"normalizePath"),pL=a((t,e)=>t.reduce((r,i,n)=>e(i)?n:r,-1),"findLastIndex"),xc=class xc{constructor(e){let r=null,i=null;this.parsedConfig=e?e.split(`
|
|
21
|
+
`).map(n=>{let o=null,s=null,l=n.trim(),f=fL(l),c=f!=null;if(c)[r,i]=f;else{let h=uL(l);h!=null&&([o,s]=h)}let u=Fp(r,i,o);return{line:n,isSection:c,section:r,subsection:i,name:o,value:s,path:u}}):[]}static from(e){return new xc(e)}async get(e,r=!1){let i=fE(e).path,n=this.parsedConfig.filter(o=>o.path===i).map(({section:o,name:s,value:l})=>{let f=aE[o]&&aE[o][s];return f?f(l):l});return r?n:n.pop()}async getall(e){return this.get(e,!0)}async getSubsections(e){return this.parsedConfig.filter(r=>r.isSection&&r.section===e).map(r=>r.subsection)}async deleteSection(e,r){this.parsedConfig=this.parsedConfig.filter(i=>!(i.section===e&&i.subsection===r))}async append(e,r){return this.set(e,r,!0)}async set(e,r,i=!1){let{section:n,subsection:o,name:s,path:l,sectionPath:f,isSection:c}=fE(e),u=pL(this.parsedConfig,h=>h.path===l);if(r==null)u!==-1&&this.parsedConfig.splice(u,1);else if(u!==-1){let h=this.parsedConfig[u],d=Object.assign({},h,{name:s,value:r,modified:!0});i?this.parsedConfig.splice(u+1,0,d):this.parsedConfig[u]=d}else{let h=this.parsedConfig.findIndex(p=>p.path===f),d={section:n,subsection:o,name:s,value:r,modified:!0,path:l};if(sL.test(n)&&lL.test(s))if(h>=0)this.parsedConfig.splice(h+1,0,d);else{let p={isSection:c,section:n,subsection:o,modified:!0,path:f};this.parsedConfig.push(p,d)}}}toString(){return this.parsedConfig.map(({line:e,section:r,subsection:i,name:n,value:o,modified:s=!1})=>s?n!=null&&o!=null?typeof o=="string"&&/[#;]/.test(o)?` ${n} = "${o}"`:` ${n} = ${o}`:i!=null?`[${r} "${i}"]`:`[${r}]`:e).join(`
|
|
22
|
+
`)}};a(xc,"GitConfig");var Ep=xc,Up=class Up{static async get({fs:e,gitdir:r}){let i=await e.read(`${r}/config`,{encoding:"utf8"});return Ep.from(i)}static async save({fs:e,gitdir:r,config:i}){await e.write(`${r}/config`,i.toString(),{encoding:"utf8"})}};a(Up,"GitConfigManager");var be=Up,rc=a(t=>[`${t}`,`refs/${t}`,`refs/tags/${t}`,`refs/heads/${t}`,`refs/remotes/${t}`,`refs/remotes/${t}/HEAD`],"refpaths"),mL=["config","description","index","shallow","commondir"],fp;async function zr(t,e){return fp===void 0&&(fp=new ds),fp.acquire(t,e)}a(zr,"acquireLock");var Te=class Te{static async updateRemoteRefs({fs:e,gitdir:r,remote:i,refs:n,symrefs:o,tags:s,refspecs:l=void 0,prune:f=!1,pruneTags:c=!1}){for(let y of n.values())if(!y.match(/[0-9a-f]{40}/))throw new Gr(y);let u=await be.get({fs:e,gitdir:r});if(!l){if(l=await u.getall(`remote.${i}.fetch`),l.length===0)throw new ys(i);l.unshift(`+HEAD:refs/remotes/${i}/HEAD`)}let h=_p.from(l),d=new Map;if(c){let y=await Te.listRefs({fs:e,gitdir:r,filepath:"refs/tags"});await Te.deleteRefs({fs:e,gitdir:r,refs:y.map(v=>`refs/tags/${v}`)})}if(s){for(let y of n.keys())if(y.startsWith("refs/tags")&&!y.endsWith("^{}")&&!await Te.exists({fs:e,gitdir:r,ref:y})){let v=n.get(y);d.set(y,v)}}let p=h.translate([...n.keys()]);for(let[y,v]of p){let g=n.get(y);d.set(v,g)}let m=h.translate([...o.keys()]);for(let[y,v]of m){let g=o.get(y),F=h.translateOne(g);F&&d.set(v,`ref: ${F}`)}let w=[];if(f){for(let y of h.localNamespaces()){let v=(await Te.listRefs({fs:e,gitdir:r,filepath:y})).map(g=>`${y}/${g}`);for(let g of v)d.has(g)||w.push(g)}w.length>0&&await Te.deleteRefs({fs:e,gitdir:r,refs:w})}for(let[y,v]of d)await zr(y,async()=>e.write(D.join(r,y),`${v.trim()}
|
|
23
23
|
`,"utf8"));return{pruned:w}}static async writeRef({fs:e,gitdir:r,ref:i,value:n}){if(!n.match(/[0-9a-f]{40}/))throw new Gr(n);await zr(i,async()=>e.write(D.join(r,i),`${n.trim()}
|
|
24
24
|
`,"utf8"))}static async writeSymbolicRef({fs:e,gitdir:r,ref:i,value:n}){await zr(i,async()=>e.write(D.join(r,i),`ref: ${n.trim()}
|
|
25
|
-
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return Te.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(l=>e.rm(D.join(r,l))));let n=await zr("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),o=sc.from(n),s=o.refs.size;for(let l of i)o.refs.has(l)&&o.delete(l);o.refs.size<s&&(n=o.toString(),await zr("packed-refs",async()=>e.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),Te.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let o=await Te.packedRefs({fs:e,gitdir:r}),s=rc(i).filter(l=>!
|
|
26
|
-
`)}toObject(){let e=[...this._entries];return e.sort(mL),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),o=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),l=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,o,s,l])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}};a(Tc,"GitTree");var tt=Tc,Up=class Up{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,o=n+r.length,s=new Uint8Array(o);for(let l=0;l<n;l++)s[l]=i.charCodeAt(l);return s.set(r,n),s}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),o=e.slice(r+1,i).toString("utf8"),s=e.length-(i+1);if(parseInt(o)!==s)throw new W(`Length mismatch: expected ${o} bytes but got ${s} instead.`);return{type:n,object:Buffer.from(e.slice(i+1))}}};a(Up,"GitObject");var Kr=Up;async function DE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}a(DE,"readObjectLoose");function bL(t,e){let r=new St(t),i=uE(r);if(i!==e.byteLength)throw new W(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=uE(r),o,s=dE(r,e);if(s.byteLength===n)o=s;else{o=Buffer.alloc(n);let l=new St(o);for(l.copy(s);!r.eof();)l.copy(dE(r,e));let f=l.tell();if(n!==f)throw new W(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${f} bytes`)}return o}a(bL,"applyDelta");function uE(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}a(uE,"readVarIntLE");function hE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}a(hE,"readCompactLE");function dE(t,e){let r=t.readUInt8(),i=128,n=15,o=112;if(r&i){let s=hE(t,r&n,4),l=hE(t,(r&o)>>4,3);return l===0&&(l=65536),e.slice(s,s+l)}else return t.slice(r)}a(dE,"readOp");function vL(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(vL,"fromValue");function CE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:vL(t)}a(CE,"getIterator");var Hp=class Hp{constructor(e){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=CE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>_L(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};a(Hp,"StreamReader");var lc=Hp;function _L(t){return t.reduce((e,r)=>e+r.length,0)}a(_L,"lengthBuffers");async function FL(t,e){let r=new lc(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new W(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new W(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){let s=r.tell(),{type:l,length:f,ofs:c,reference:u}=await EL(r),h=new Pp.Inflate;for(;!h.result;){let d=await r.chunk();if(!d)break;if(h.push(d,!1),h.err)throw new W(`Pako error: ${h.msg}`);if(h.result){if(h.result.length!==f)throw new W("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-h.strm.avail_in);let p=r.tell();await e({data:h.result,type:l,num:o,offset:s,end:p,reference:u,ofs:c})}}}}a(FL,"listpack");async function EL(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let s=4;do e=await t.byte(),i|=(e&127)<<s,s+=7;while(e&128)}let n,o;if(r===6){let s=0;n=0;let l=[];do e=await t.byte(),n|=(e&127)<<s,s+=7,l.push(e);while(e&128);o=Buffer.from(l)}return r===7&&(o=await t.read(20)),{type:r,length:i,ofs:n,reference:o}}a(EL,"parseHeader");var fp=!1;async function NE(t){return fp===null&&(fp=xL()),fp?SL(t):Pp.inflate(t)}a(NE,"inflate");async function SL(t){let e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(SL,"browserInflate");function xL(){try{if(new DecompressionStream("deflate"))return!0}catch{}return!1}a(xL,"testDecompressionStream");function TL(t){let e=[],r=0,i=0;do{r=t.readUInt8();let n=r&127;e.push(n),i=r&128}while(i);return e.reduce((n,o)=>n+1<<7|o,-1)}a(TL,"decodeVarInt");function OL(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<<i,i+=7;while(n&128);return r}a(OL,"otherVarIntDecode");var hs=class hs{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:e,getExternalRefDelta:r}){let i=new St(e);if(i.slice(4).toString("hex")!=="ff744f63")return;let o=i.readUInt32BE();if(o!==2)throw new W(`Unable to read version ${o} packfile IDX. (Only version 2 supported)`);if(e.byteLength>2048*1024*1024)throw new W("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let s=i.readUInt32BE(),l=[];for(let u=0;u<s;u++){let h=i.slice(20).toString("hex");l[u]=h}i.seek(i.tell()+4*s);let f=new Map;for(let u=0;u<s;u++)f.set(l[u],i.readUInt32BE());let c=i.slice(20).toString("hex");return new hs({hashes:l,crcs:{},offsets:f,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:e,getExternalRefDelta:r,onProgress:i}){let n={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},o={},s=e.slice(-20).toString("hex"),l=[],f={},c=new Map,u=null,h=null;await FL([e],async({data:y,type:v,reference:g,offset:F,num:O})=>{u===null&&(u=O);let S=Math.floor((u-O)*100/u);S!==h&&i&&await i({phase:"Receiving objects",loaded:u-O,total:u}),h=S,v=n[v],["commit","tree","blob","tag"].includes(v)?o[F]={type:v,offset:F}:v==="ofs-delta"?o[F]={type:v,offset:F}:v==="ref-delta"&&(o[F]={type:v,offset:F})});let d=Object.keys(o).map(Number);for(let[y,v]of d.entries()){let g=y+1===d.length?e.byteLength-20:d[y+1],F=o[v],O=zB.buf(e.slice(v,g))>>>0;F.end=g,F.crc=O}let p=new hs({pack:Promise.resolve(e),packfileSha:s,crcs:f,hashes:l,offsets:c,getExternalRefDelta:r});h=null;let m=0,w=[0,0,0,0,0,0,0,0,0,0,0,0];for(let y in o){y=Number(y);let v=Math.floor(m*100/u);v!==h&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,h=v;let g=o[y];if(!g.oid)try{p.readDepth=0,p.externalReadDepth=0;let{type:F,object:O}=await p.readSlice({start:y});w[p.readDepth]+=1;let S=await br(Kr.wrap({type:F,object:O}));g.oid=S,l.push(S),c.set(S,y),f[S]=g.crc}catch{continue}}return l.sort(),p}async toBuffer(){let e=[],r=a((c,u)=>{e.push(Buffer.from(c,u))},"write");r("ff744f63","hex"),r("00000002","hex");let i=new St(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let h of this.hashes)parseInt(h.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let o=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)o.writeUInt32BE(this.offsets.get(c));e.push(o.buffer),r(this.packfileSha,"hex");let s=Buffer.concat(e),l=await br(s),f=Buffer.alloc(20);return f.write(l,"hex"),Buffer.concat([s,f])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new W(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new W("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new St(i),o=n.readUInt8(),s=o&112,l=r[s];if(l===void 0)throw new W("Unrecognized type: 0b"+s.toString(2));let f=o&15,c=f;o&128&&(c=OL(n,f));let h=null,d=null;if(l==="ofs_delta"){let m=TL(n),w=e-m;({object:h,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let m=n.slice(20).toString("hex");({object:h,type:l}=await this.read({oid:m}))}let p=i.slice(n.tell());if(d=Buffer.from(await NE(p)),d.byteLength!==c)throw new W(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return h&&(d=Buffer.from(bL(d,h))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:d}),{type:l,format:"content",object:d}}};a(hs,"GitPackIndex");var gs=hs,ic=Symbol("PackfileCache");async function RL({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let o=await t.read(e);return gs.fromIdx({idx:o,getExternalRefDelta:r})}a(RL,"loadPackIndex");function Ap({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}){e[ic]||(e[ic]=new Map);let s=e[ic].get(r);return s||(s=RL({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}),e[ic].set(r,s)),s}a(Ap,"readPackIndex");async function kL({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(D.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Ap({fs:t,cache:e,filename:f,getExternalRefDelta:o});if(c.error)throw new W(c.error);if(c.offsets.has(i)){if(!c.pack){let h=f.replace(/idx$/,"pack");c.pack=t.read(h)}let u=await c.read({oid:i,getExternalRefDelta:o});return u.format="content",u.source=`objects/pack/${l.replace(/idx$/,"pack")}`,u}}return null}a(kL,"readObjectPacked");async function de({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(u=>de({fs:t,cache:e,gitdir:r,oid:u}),"getExternalRefDelta"),s;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await DE({fs:t,gitdir:r,oid:i})),!s){if(s=await kL({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new ce(i);return s}if(n==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await NE(s.object)),s.format="wrapped"),n==="wrapped"))return s;let l=await br(s.object);if(l!==i)throw new W(`SHA check failed! Expected ${i}, computed ${l}`);let{object:f,type:c}=Kr.unwrap(s.object);if(s.type=c,s.object=f,s.format="content",n==="content")return s;throw new W(`invalid requested format "${n}"`)}a(de,"_readObject");var Oc=class Oc extends re{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=Oc.code,this.data={noun:e,where:r,canForce:i}}};a(Oc,"AlreadyExistsError");var Nt=Oc;Nt.code="AlreadyExistsError";var Rc=class Rc extends re{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Rc.code,this.data={nouns:e,short:r,matches:i}}};a(Rc,"AmbiguousError");var bs=Rc;bs.code="AmbiguousError";var kc=class kc extends re{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=kc.code,this.data={filepaths:e}}};a(kc,"CheckoutConflictError");var vs=kc;vs.code="CheckoutConflictError";var Pc=class Pc extends re{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Pc.code,this.data={ref:e,oid:r}}};a(Pc,"CommitNotFetchedError");var _s=Pc;_s.code="CommitNotFetchedError";var Ac=class Ac extends re{constructor(){super("Empty response from git server."),this.code=this.name=Ac.code,this.data={}}};a(Ac,"EmptyServerResponseError");var Fs=Ac;Fs.code="EmptyServerResponseError";var Ic=class Ic extends re{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Ic.code,this.data={}}};a(Ic,"FastForwardError");var Es=Ic;Es.code="FastForwardError";var Dc=class Dc extends re{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=Dc.code,this.data={prettyDetails:e,result:r}}};a(Dc,"GitPushError");var Ss=Dc;Ss.code="GitPushError";var Cc=class Cc extends re{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=Cc.code,this.data={statusCode:e,statusMessage:r,response:i}}};a(Cc,"HttpError");var Hn=Cc;Hn.code="HttpError";var Nc=class Nc extends re{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=Nc.code,this.data={reason:e}}};a(Nc,"InvalidFilepathError");var Zr=Nc;Zr.code="InvalidFilepathError";var Bc=class Bc extends re{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=Bc.code,this.data={ref:e,suggestion:r}}};a(Bc,"InvalidRefNameError");var Bt=Bc;Bt.code="InvalidRefNameError";var Lc=class Lc extends re{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=Lc.code,this.data={depth:e}}};a(Lc,"MaxDepthError");var xs=Lc;xs.code="MaxDepthError";var $c=class $c extends re{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=$c.code,this.data={}}};a($c,"MergeNotSupportedError");var qn=$c;qn.code="MergeNotSupportedError";var Mc=class Mc extends re{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Mc.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};a(Mc,"MergeConflictError");var zn=Mc;zn.code="MergeConflictError";var jc=class jc extends re{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=jc.code,this.data={role:e}}};a(jc,"MissingNameError");var ze=jc;ze.code="MissingNameError";var Uc=class Uc extends re{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=Uc.code,this.data={parameter:e}}};a(Uc,"MissingParameterError");var et=Uc;et.code="MissingParameterError";var Hc=class Hc extends re{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=Hc.code,this.data={errors:e},this.errors=e}};a(Hc,"MultipleGitError");var Ts=Hc;Ts.code="MultipleGitError";var qc=class qc extends re{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=qc.code,this.data={expected:e,actual:r}}};a(qc,"ParseError");var Pi=qc;Pi.code="ParseError";var zc=class zc extends re{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=zc.code,this.data={reason:e}}};a(zc,"PushRejectedError");var Wn=zc;Wn.code="PushRejectedError";var Wc=class Wc extends re{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=Wc.code,this.data={capability:e,parameter:r}}};a(Wc,"RemoteCapabilityError");var Vr=Wc;Vr.code="RemoteCapabilityError";var Vc=class Vc extends re{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=Vc.code,this.data={preview:e,response:r}}};a(Vc,"SmartHttpError");var Os=Vc;Os.code="SmartHttpError";var Gc=class Gc extends re{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=Gc.code,this.data={url:e,transport:r,suggestion:i}}};a(Gc,"UnknownTransportError");var Rs=Gc;Rs.code="UnknownTransportError";var Kc=class Kc extends re{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=Kc.code,this.data={url:e}}};a(Kc,"UrlParseError");var ks=Kc;ks.code="UrlParseError";var Zc=class Zc extends re{constructor(){super("The operation was canceled."),this.code=this.name=Zc.code,this.data={}}};a(Zc,"UserCanceledError");var Vn=Zc;Vn.code="UserCanceledError";var Xc=class Xc extends re{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Xc.code,this.data={filepath:e}}};a(Xc,"IndexResetError");var Ps=Xc;Ps.code="IndexResetError";var Yc=class Yc extends re{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Yc.code,this.data={ref:e}}};a(Yc,"NoCommitError");var As=Yc;As.code="NoCommitError";var BE=Object.freeze({__proto__:null,AlreadyExistsError:Nt,AmbiguousError:bs,CheckoutConflictError:vs,CommitNotFetchedError:_s,EmptyServerResponseError:Fs,FastForwardError:Es,GitPushError:Ss,HttpError:Hn,InternalError:W,InvalidFilepathError:Zr,InvalidOidError:Gr,InvalidRefNameError:Bt,MaxDepthError:xs,MergeNotSupportedError:qn,MergeConflictError:zn,MissingNameError:ze,MissingParameterError:et,MultipleGitError:Ts,NoRefspecError:ys,NotFoundError:ce,ObjectTypeError:Ze,ParseError:Pi,PushRejectedError:Wn,RemoteCapabilityError:Vr,SmartHttpError:Os,UnknownTransportError:Rs,UnsafeFilepathError:Mn,UrlParseError:ks,UserCanceledError:Vn,UnmergedPathsError:ws,IndexResetError:Ps,NoCommitError:As});function Ep({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=PL(i),`${t} <${e}> ${r} ${i}`}a(Ep,"formatAuthor");function PL(t){let e=AL(IL(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}a(PL,"formatTimezoneOffset");function AL(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}a(AL,"simpleSign");function IL(t){return t===0?t:-t}a(IL,"negateExceptForZero");function gr(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+`
|
|
27
|
-
`,t}a(gr,"normalizeNewlines");function cc(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:
|
|
25
|
+
`,"utf8"))}static async deleteRef({fs:e,gitdir:r,ref:i}){return Te.deleteRefs({fs:e,gitdir:r,refs:[i]})}static async deleteRefs({fs:e,gitdir:r,refs:i}){await Promise.all(i.map(l=>e.rm(D.join(r,l))));let n=await zr("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"})),o=sc.from(n),s=o.refs.size;for(let l of i)o.refs.has(l)&&o.delete(l);o.refs.size<s&&(n=o.toString(),await zr("packed-refs",async()=>e.write(`${r}/packed-refs`,n,{encoding:"utf8"})))}static async resolve({fs:e,gitdir:r,ref:i,depth:n=void 0}){if(n!==void 0&&(n--,n===-1))return i;if(i.startsWith("ref: "))return i=i.slice(5),Te.resolve({fs:e,gitdir:r,ref:i,depth:n});if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let o=await Te.packedRefs({fs:e,gitdir:r}),s=rc(i).filter(l=>!mL.includes(l));for(let l of s){let f=await zr(l,async()=>await e.read(`${r}/${l}`,{encoding:"utf8"})||o.get(l));if(f)return Te.resolve({fs:e,gitdir:r,ref:f.trim(),depth:n})}throw new ce(i)}static async exists({fs:e,gitdir:r,ref:i}){try{return await Te.expand({fs:e,gitdir:r,ref:i}),!0}catch{return!1}}static async expand({fs:e,gitdir:r,ref:i}){if(i.length===40&&/[0-9a-f]{40}/.test(i))return i;let n=await Te.packedRefs({fs:e,gitdir:r}),o=rc(i);for(let s of o)if(await zr(s,async()=>e.exists(`${r}/${s}`))||n.has(s))return s;throw new ce(i)}static async expandAgainstMap({ref:e,map:r}){let i=rc(e);for(let n of i)if(await r.has(n))return n;throw new ce(e)}static resolveAgainstMap({ref:e,fullref:r=e,depth:i=void 0,map:n}){if(i!==void 0&&(i--,i===-1))return{fullref:r,oid:e};if(e.startsWith("ref: "))return e=e.slice(5),Te.resolveAgainstMap({ref:e,fullref:r,depth:i,map:n});if(e.length===40&&/[0-9a-f]{40}/.test(e))return{fullref:r,oid:e};let o=rc(e);for(let s of o){let l=n.get(s);if(l)return Te.resolveAgainstMap({ref:l.trim(),fullref:s,depth:i,map:n})}throw new ce(e)}static async packedRefs({fs:e,gitdir:r}){let i=await zr("packed-refs",async()=>e.read(`${r}/packed-refs`,{encoding:"utf8"}));return sc.from(i).refs}static async listRefs({fs:e,gitdir:r,filepath:i}){let n=Te.packedRefs({fs:e,gitdir:r}),o=null;try{o=await e.readdirDeep(`${r}/${i}`),o=o.map(s=>s.replace(`${r}/${i}/`,""))}catch{o=[]}for(let s of(await n).keys())s.startsWith(i)&&(s=s.replace(i+"/",""),o.includes(s)||o.push(s));return o.sort(iL),o}static async listBranches({fs:e,gitdir:r,remote:i}){return i?Te.listRefs({fs:e,gitdir:r,filepath:`refs/remotes/${i}`}):Te.listRefs({fs:e,gitdir:r,filepath:"refs/heads"})}static async listTags({fs:e,gitdir:r}){return(await Te.listRefs({fs:e,gitdir:r,filepath:"refs/tags"})).filter(n=>!n.endsWith("^{}"))}};a(Te,"GitRefManager");var B=Te;function wL(t,e){return Qc(uE(t),uE(e))}a(wL,"compareTreeEntryPath");function uE(t){return t.mode==="040000"?t.path+"/":t.path}a(uE,"appendSlashIfDir");function DE(t){switch(t){case"040000":return"tree";case"100644":return"blob";case"100755":return"blob";case"120000":return"blob";case"160000":return"commit"}throw new W(`Unexpected GitTree entry mode: ${t}`)}a(DE,"mode2type$1");function yL(t){let e=[],r=0;for(;r<t.length;){let i=t.indexOf(32,r);if(i===-1)throw new W(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next space character.`);let n=t.indexOf(0,r);if(n===-1)throw new W(`GitTree: Error parsing buffer at byte location ${r}: Could not find the next null character.`);let o=t.slice(r,i).toString("utf8");o==="40000"&&(o="040000");let s=DE(o),l=t.slice(i+1,n).toString("utf8");if(l.includes("\\")||l.includes("/"))throw new jn(l);let f=t.slice(n+1,n+21).toString("hex");r=n+21,e.push({mode:o,path:l,oid:f,type:s})}return e}a(yL,"parseBuffer");function gL(t){if(typeof t=="number"&&(t=t.toString(8)),t.match(/^0?4.*/))return"040000";if(t.match(/^1006.*/))return"100644";if(t.match(/^1007.*/))return"100755";if(t.match(/^120.*/))return"120000";if(t.match(/^160.*/))return"160000";throw new W(`Could not understand file mode: ${t}`)}a(gL,"limitModeToAllowed");function bL(t){return!t.oid&&t.sha&&(t.oid=t.sha),t.mode=gL(t.mode),t.type||(t.type=DE(t.mode)),t}a(bL,"nudgeIntoShape");var Tc=class Tc{constructor(e){if(Buffer.isBuffer(e))this._entries=yL(e);else if(Array.isArray(e))this._entries=e.map(bL);else throw new W("invalid type passed to GitTree constructor");this._entries.sort(kE)}static from(e){return new Tc(e)}render(){return this._entries.map(e=>`${e.mode} ${e.type} ${e.oid} ${e.path}`).join(`
|
|
26
|
+
`)}toObject(){let e=[...this._entries];return e.sort(wL),Buffer.concat(e.map(r=>{let i=Buffer.from(r.mode.replace(/^0/,"")),n=Buffer.from(" "),o=Buffer.from(r.path,"utf8"),s=Buffer.from([0]),l=Buffer.from(r.oid,"hex");return Buffer.concat([i,n,o,s,l])}))}entries(){return this._entries}*[Symbol.iterator](){for(let e of this._entries)yield e}};a(Tc,"GitTree");var tt=Tc,Hp=class Hp{static wrap({type:e,object:r}){let i=`${e} ${r.length}\0`,n=i.length,o=n+r.length,s=new Uint8Array(o);for(let l=0;l<n;l++)s[l]=i.charCodeAt(l);return s.set(r,n),s}static unwrap(e){let r=e.indexOf(32),i=e.indexOf(0),n=e.slice(0,r).toString("utf8"),o=e.slice(r+1,i).toString("utf8"),s=e.length-(i+1);if(parseInt(o)!==s)throw new W(`Length mismatch: expected ${o} bytes but got ${s} instead.`);return{type:n,object:Buffer.from(e.slice(i+1))}}};a(Hp,"GitObject");var Kr=Hp;async function CE({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`,n=await t.read(`${e}/${i}`);return n?{object:n,format:"deflated",source:i}:null}a(CE,"readObjectLoose");function vL(t,e){let r=new St(t),i=hE(r);if(i!==e.byteLength)throw new W(`applyDelta expected source buffer to be ${i} bytes but the provided buffer was ${e.length} bytes`);let n=hE(r),o,s=pE(r,e);if(s.byteLength===n)o=s;else{o=Buffer.alloc(n);let l=new St(o);for(l.copy(s);!r.eof();)l.copy(pE(r,e));let f=l.tell();if(n!==f)throw new W(`applyDelta expected target buffer to be ${n} bytes but the resulting buffer was ${f} bytes`)}return o}a(vL,"applyDelta");function hE(t){let e=0,r=0,i=null;do i=t.readUInt8(),e|=(i&127)<<r,r+=7;while(i&128);return e}a(hE,"readVarIntLE");function dE(t,e,r){let i=0,n=0;for(;r--;)e&1&&(i|=t.readUInt8()<<n),e>>=1,n+=8;return i}a(dE,"readCompactLE");function pE(t,e){let r=t.readUInt8(),i=128,n=15,o=112;if(r&i){let s=dE(t,r&n,4),l=dE(t,(r&o)>>4,3);return l===0&&(l=65536),e.slice(s,s+l)}else return t.slice(r)}a(pE,"readOp");function _L(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(_L,"fromValue");function NE(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:_L(t)}a(NE,"getIterator");var qp=class qp{constructor(e){if(typeof Buffer>"u")throw new Error("Missing Buffer dependency");this.stream=NE(e),this.buffer=null,this.cursor=0,this.undoCursor=0,this.started=!1,this._ended=!1,this._discardedBytes=0}eof(){return this._ended&&this.cursor===this.buffer.length}tell(){return this._discardedBytes+this.cursor}async byte(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(1),this.buffer[this.undoCursor]}async chunk(){if(!this.eof()&&(this.started||await this._init(),!(this.cursor===this.buffer.length&&(await this._loadnext(),this._ended))))return this._moveCursor(this.buffer.length),this.buffer.slice(this.undoCursor,this.cursor)}async read(e){if(!this.eof())return this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e),this.buffer.slice(this.undoCursor,this.cursor)}async skip(e){this.eof()||(this.started||await this._init(),this.cursor+e>this.buffer.length&&(this._trim(),await this._accumulate(e)),this._moveCursor(e))}async undo(){this.cursor=this.undoCursor}async _next(){this.started=!0;let{done:e,value:r}=await this.stream.next();return e&&(this._ended=!0,!r)?Buffer.alloc(0):(r&&(r=Buffer.from(r)),r)}_trim(){this.buffer=this.buffer.slice(this.undoCursor),this.cursor-=this.undoCursor,this._discardedBytes+=this.undoCursor,this.undoCursor=0}_moveCursor(e){this.undoCursor=this.cursor,this.cursor+=e,this.cursor>this.buffer.length&&(this.cursor=this.buffer.length)}async _accumulate(e){if(this._ended)return;let r=[this.buffer];for(;this.cursor+e>FL(r);){let i=await this._next();if(this._ended)break;r.push(i)}this.buffer=Buffer.concat(r)}async _loadnext(){this._discardedBytes+=this.buffer.length,this.undoCursor=0,this.cursor=0,this.buffer=await this._next()}async _init(){this.buffer=await this._next()}};a(qp,"StreamReader");var lc=qp;function FL(t){return t.reduce((e,r)=>e+r.length,0)}a(FL,"lengthBuffers");async function EL(t,e){let r=new lc(t),i=await r.read(4);if(i=i.toString("utf8"),i!=="PACK")throw new W(`Invalid PACK header '${i}'`);let n=await r.read(4);if(n=n.readUInt32BE(0),n!==2)throw new W(`Invalid packfile version: ${n}`);let o=await r.read(4);if(o=o.readUInt32BE(0),!(o<1))for(;!r.eof()&&o--;){let s=r.tell(),{type:l,length:f,ofs:c,reference:u}=await SL(r),h=new Ap.Inflate;for(;!h.result;){let d=await r.chunk();if(!d)break;if(h.push(d,!1),h.err)throw new W(`Pako error: ${h.msg}`);if(h.result){if(h.result.length!==f)throw new W("Inflated object size is different from that stated in packfile.");await r.undo(),await r.read(d.length-h.strm.avail_in);let p=r.tell();await e({data:h.result,type:l,num:o,offset:s,end:p,reference:u,ofs:c})}}}}a(EL,"listpack");async function SL(t){let e=await t.byte(),r=e>>4&7,i=e&15;if(e&128){let s=4;do e=await t.byte(),i|=(e&127)<<s,s+=7;while(e&128)}let n,o;if(r===6){let s=0;n=0;let l=[];do e=await t.byte(),n|=(e&127)<<s,s+=7,l.push(e);while(e&128);o=Buffer.from(l)}return r===7&&(o=await t.read(20)),{type:r,length:i,ofs:n,reference:o}}a(SL,"parseHeader");var up=!1;async function BE(t){return up===null&&(up=TL()),up?xL(t):Ap.inflate(t)}a(BE,"inflate");async function xL(t){let e=new DecompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(xL,"browserInflate");function TL(){try{if(new DecompressionStream("deflate"))return!0}catch{}return!1}a(TL,"testDecompressionStream");function OL(t){let e=[],r=0,i=0;do{r=t.readUInt8();let n=r&127;e.push(n),i=r&128}while(i);return e.reduce((n,o)=>n+1<<7|o,-1)}a(OL,"decodeVarInt");function RL(t,e){let r=e,i=4,n=null;do n=t.readUInt8(),r|=(n&127)<<i,i+=7;while(n&128);return r}a(RL,"otherVarIntDecode");var hs=class hs{constructor(e){Object.assign(this,e),this.offsetCache={}}static async fromIdx({idx:e,getExternalRefDelta:r}){let i=new St(e);if(i.slice(4).toString("hex")!=="ff744f63")return;let o=i.readUInt32BE();if(o!==2)throw new W(`Unable to read version ${o} packfile IDX. (Only version 2 supported)`);if(e.byteLength>2048*1024*1024)throw new W("To keep implementation simple, I haven't implemented the layer 5 feature needed to support packfiles > 2GB in size.");i.seek(i.tell()+4*255);let s=i.readUInt32BE(),l=[];for(let u=0;u<s;u++){let h=i.slice(20).toString("hex");l[u]=h}i.seek(i.tell()+4*s);let f=new Map;for(let u=0;u<s;u++)f.set(l[u],i.readUInt32BE());let c=i.slice(20).toString("hex");return new hs({hashes:l,crcs:{},offsets:f,packfileSha:c,getExternalRefDelta:r})}static async fromPack({pack:e,getExternalRefDelta:r,onProgress:i}){let n={1:"commit",2:"tree",3:"blob",4:"tag",6:"ofs-delta",7:"ref-delta"},o={},s=e.slice(-20).toString("hex"),l=[],f={},c=new Map,u=null,h=null;await EL([e],async({data:y,type:v,reference:g,offset:F,num:O})=>{u===null&&(u=O);let S=Math.floor((u-O)*100/u);S!==h&&i&&await i({phase:"Receiving objects",loaded:u-O,total:u}),h=S,v=n[v],["commit","tree","blob","tag"].includes(v)?o[F]={type:v,offset:F}:v==="ofs-delta"?o[F]={type:v,offset:F}:v==="ref-delta"&&(o[F]={type:v,offset:F})});let d=Object.keys(o).map(Number);for(let[y,v]of d.entries()){let g=y+1===d.length?e.byteLength-20:d[y+1],F=o[v],O=WB.buf(e.slice(v,g))>>>0;F.end=g,F.crc=O}let p=new hs({pack:Promise.resolve(e),packfileSha:s,crcs:f,hashes:l,offsets:c,getExternalRefDelta:r});h=null;let m=0,w=[0,0,0,0,0,0,0,0,0,0,0,0];for(let y in o){y=Number(y);let v=Math.floor(m*100/u);v!==h&&i&&await i({phase:"Resolving deltas",loaded:m,total:u}),m++,h=v;let g=o[y];if(!g.oid)try{p.readDepth=0,p.externalReadDepth=0;let{type:F,object:O}=await p.readSlice({start:y});w[p.readDepth]+=1;let S=await br(Kr.wrap({type:F,object:O}));g.oid=S,l.push(S),c.set(S,y),f[S]=g.crc}catch{continue}}return l.sort(),p}async toBuffer(){let e=[],r=a((c,u)=>{e.push(Buffer.from(c,u))},"write");r("ff744f63","hex"),r("00000002","hex");let i=new St(Buffer.alloc(256*4));for(let c=0;c<256;c++){let u=0;for(let h of this.hashes)parseInt(h.slice(0,2),16)<=c&&u++;i.writeUInt32BE(u)}e.push(i.buffer);for(let c of this.hashes)r(c,"hex");let n=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)n.writeUInt32BE(this.crcs[c]);e.push(n.buffer);let o=new St(Buffer.alloc(this.hashes.length*4));for(let c of this.hashes)o.writeUInt32BE(this.offsets.get(c));e.push(o.buffer),r(this.packfileSha,"hex");let s=Buffer.concat(e),l=await br(s),f=Buffer.alloc(20);return f.write(l,"hex"),Buffer.concat([s,f])}async load({pack:e}){this.pack=e}async unload(){this.pack=null}async read({oid:e}){if(!this.offsets.get(e)){if(this.getExternalRefDelta)return this.externalReadDepth++,this.getExternalRefDelta(e);throw new W(`Could not read object ${e} from packfile`)}let r=this.offsets.get(e);return this.readSlice({start:r})}async readSlice({start:e}){if(this.offsetCache[e])return Object.assign({},this.offsetCache[e]);this.readDepth++;let r={16:"commit",32:"tree",48:"blob",64:"tag",96:"ofs_delta",112:"ref_delta"};if(!this.pack)throw new W("Tried to read from a GitPackIndex with no packfile loaded into memory");let i=(await this.pack).slice(e),n=new St(i),o=n.readUInt8(),s=o&112,l=r[s];if(l===void 0)throw new W("Unrecognized type: 0b"+s.toString(2));let f=o&15,c=f;o&128&&(c=RL(n,f));let h=null,d=null;if(l==="ofs_delta"){let m=OL(n),w=e-m;({object:h,type:l}=await this.readSlice({start:w}))}if(l==="ref_delta"){let m=n.slice(20).toString("hex");({object:h,type:l}=await this.read({oid:m}))}let p=i.slice(n.tell());if(d=Buffer.from(await BE(p)),d.byteLength!==c)throw new W(`Packfile told us object would have length ${c} but it had length ${d.byteLength}`);return h&&(d=Buffer.from(vL(d,h))),this.readDepth>3&&(this.offsetCache[e]={type:l,object:d}),{type:l,format:"content",object:d}}};a(hs,"GitPackIndex");var gs=hs,ic=Symbol("PackfileCache");async function kL({fs:t,filename:e,getExternalRefDelta:r,emitter:i,emitterPrefix:n}){let o=await t.read(e);return gs.fromIdx({idx:o,getExternalRefDelta:r})}a(kL,"loadPackIndex");function Ip({fs:t,cache:e,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}){e[ic]||(e[ic]=new Map);let s=e[ic].get(r);return s||(s=kL({fs:t,filename:r,getExternalRefDelta:i,emitter:n,emitterPrefix:o}),e[ic].set(r,s)),s}a(Ip,"readPackIndex");async function PL({fs:t,cache:e,gitdir:r,oid:i,format:n="content",getExternalRefDelta:o}){let s=await t.readdir(D.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Ip({fs:t,cache:e,filename:f,getExternalRefDelta:o});if(c.error)throw new W(c.error);if(c.offsets.has(i)){if(!c.pack){let h=f.replace(/idx$/,"pack");c.pack=t.read(h)}let u=await c.read({oid:i,getExternalRefDelta:o});return u.format="content",u.source=`objects/pack/${l.replace(/idx$/,"pack")}`,u}}return null}a(PL,"readObjectPacked");async function de({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(u=>de({fs:t,cache:e,gitdir:r,oid:u}),"getExternalRefDelta"),s;if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904"&&(s={format:"wrapped",object:Buffer.from("tree 0\0")}),s||(s=await CE({fs:t,gitdir:r,oid:i})),!s){if(s=await PL({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o}),!s)throw new ce(i);return s}if(n==="deflated"||(s.format==="deflated"&&(s.object=Buffer.from(await BE(s.object)),s.format="wrapped"),n==="wrapped"))return s;let l=await br(s.object);if(l!==i)throw new W(`SHA check failed! Expected ${i}, computed ${l}`);let{object:f,type:c}=Kr.unwrap(s.object);if(s.type=c,s.object=f,s.format="content",n==="content")return s;throw new W(`invalid requested format "${n}"`)}a(de,"_readObject");var Oc=class Oc extends re{constructor(e,r,i=!0){super(`Failed to create ${e} at ${r} because it already exists.${i?` (Hint: use 'force: true' parameter to overwrite existing ${e}.)`:""}`),this.code=this.name=Oc.code,this.data={noun:e,where:r,canForce:i}}};a(Oc,"AlreadyExistsError");var Nt=Oc;Nt.code="AlreadyExistsError";var Rc=class Rc extends re{constructor(e,r,i){super(`Found multiple ${e} matching "${r}" (${i.join(", ")}). Use a longer abbreviation length to disambiguate them.`),this.code=this.name=Rc.code,this.data={nouns:e,short:r,matches:i}}};a(Rc,"AmbiguousError");var bs=Rc;bs.code="AmbiguousError";var kc=class kc extends re{constructor(e){super(`Your local changes to the following files would be overwritten by checkout: ${e.join(", ")}`),this.code=this.name=kc.code,this.data={filepaths:e}}};a(kc,"CheckoutConflictError");var vs=kc;vs.code="CheckoutConflictError";var Pc=class Pc extends re{constructor(e,r){super(`Failed to checkout "${e}" because commit ${r} is not available locally. Do a git fetch to make the branch available locally.`),this.code=this.name=Pc.code,this.data={ref:e,oid:r}}};a(Pc,"CommitNotFetchedError");var _s=Pc;_s.code="CommitNotFetchedError";var Ac=class Ac extends re{constructor(){super("Empty response from git server."),this.code=this.name=Ac.code,this.data={}}};a(Ac,"EmptyServerResponseError");var Fs=Ac;Fs.code="EmptyServerResponseError";var Ic=class Ic extends re{constructor(){super("A simple fast-forward merge was not possible."),this.code=this.name=Ic.code,this.data={}}};a(Ic,"FastForwardError");var Es=Ic;Es.code="FastForwardError";var Dc=class Dc extends re{constructor(e,r){super(`One or more branches were not updated: ${e}`),this.code=this.name=Dc.code,this.data={prettyDetails:e,result:r}}};a(Dc,"GitPushError");var Ss=Dc;Ss.code="GitPushError";var Cc=class Cc extends re{constructor(e,r,i){super(`HTTP Error: ${e} ${r}`),this.code=this.name=Cc.code,this.data={statusCode:e,statusMessage:r,response:i}}};a(Cc,"HttpError");var qn=Cc;qn.code="HttpError";var Nc=class Nc extends re{constructor(e){let r="invalid filepath";e==="leading-slash"||e==="trailing-slash"?r='"filepath" parameter should not include leading or trailing directory separators because these can cause problems on some platforms.':e==="directory"&&(r='"filepath" should not be a directory.'),super(r),this.code=this.name=Nc.code,this.data={reason:e}}};a(Nc,"InvalidFilepathError");var Zr=Nc;Zr.code="InvalidFilepathError";var Bc=class Bc extends re{constructor(e,r){super(`"${e}" would be an invalid git reference. (Hint: a valid alternative would be "${r}".)`),this.code=this.name=Bc.code,this.data={ref:e,suggestion:r}}};a(Bc,"InvalidRefNameError");var Bt=Bc;Bt.code="InvalidRefNameError";var Lc=class Lc extends re{constructor(e){super(`Maximum search depth of ${e} exceeded.`),this.code=this.name=Lc.code,this.data={depth:e}}};a(Lc,"MaxDepthError");var xs=Lc;xs.code="MaxDepthError";var $c=class $c extends re{constructor(){super("Merges with conflicts are not supported yet."),this.code=this.name=$c.code,this.data={}}};a($c,"MergeNotSupportedError");var zn=$c;zn.code="MergeNotSupportedError";var Mc=class Mc extends re{constructor(e,r,i,n){super(`Automatic merge failed with one or more merge conflicts in the following files: ${e.toString()}. Fix conflicts then commit the result.`),this.code=this.name=Mc.code,this.data={filepaths:e,bothModified:r,deleteByUs:i,deleteByTheirs:n}}};a(Mc,"MergeConflictError");var Wn=Mc;Wn.code="MergeConflictError";var jc=class jc extends re{constructor(e){super(`No name was provided for ${e} in the argument or in the .git/config file.`),this.code=this.name=jc.code,this.data={role:e}}};a(jc,"MissingNameError");var ze=jc;ze.code="MissingNameError";var Uc=class Uc extends re{constructor(e){super(`The function requires a "${e}" parameter but none was provided.`),this.code=this.name=Uc.code,this.data={parameter:e}}};a(Uc,"MissingParameterError");var et=Uc;et.code="MissingParameterError";var Hc=class Hc extends re{constructor(e){super('There are multiple errors that were thrown by the method. Please refer to the "errors" property to see more'),this.code=this.name=Hc.code,this.data={errors:e},this.errors=e}};a(Hc,"MultipleGitError");var Ts=Hc;Ts.code="MultipleGitError";var qc=class qc extends re{constructor(e,r){super(`Expected "${e}" but received "${r}".`),this.code=this.name=qc.code,this.data={expected:e,actual:r}}};a(qc,"ParseError");var Pi=qc;Pi.code="ParseError";var zc=class zc extends re{constructor(e){let r="";e==="not-fast-forward"?r=" because it was not a simple fast-forward":e==="tag-exists"&&(r=" because tag already exists"),super(`Push rejected${r}. Use "force: true" to override.`),this.code=this.name=zc.code,this.data={reason:e}}};a(zc,"PushRejectedError");var Vn=zc;Vn.code="PushRejectedError";var Wc=class Wc extends re{constructor(e,r){super(`Remote does not support the "${e}" so the "${r}" parameter cannot be used.`),this.code=this.name=Wc.code,this.data={capability:e,parameter:r}}};a(Wc,"RemoteCapabilityError");var Vr=Wc;Vr.code="RemoteCapabilityError";var Vc=class Vc extends re{constructor(e,r){super(`Remote did not reply using the "smart" HTTP protocol. Expected "001e# service=git-upload-pack" but received: ${e}`),this.code=this.name=Vc.code,this.data={preview:e,response:r}}};a(Vc,"SmartHttpError");var Os=Vc;Os.code="SmartHttpError";var Gc=class Gc extends re{constructor(e,r,i){super(`Git remote "${e}" uses an unrecognized transport protocol: "${r}"`),this.code=this.name=Gc.code,this.data={url:e,transport:r,suggestion:i}}};a(Gc,"UnknownTransportError");var Rs=Gc;Rs.code="UnknownTransportError";var Kc=class Kc extends re{constructor(e){super(`Cannot parse remote URL: "${e}"`),this.code=this.name=Kc.code,this.data={url:e}}};a(Kc,"UrlParseError");var ks=Kc;ks.code="UrlParseError";var Zc=class Zc extends re{constructor(){super("The operation was canceled."),this.code=this.name=Zc.code,this.data={}}};a(Zc,"UserCanceledError");var Gn=Zc;Gn.code="UserCanceledError";var Xc=class Xc extends re{constructor(e){super(`Could not merge index: Entry for '${e}' is not up to date. Either reset the index entry to HEAD, or stage your unstaged changes.`),this.code=this.name=Xc.code,this.data={filepath:e}}};a(Xc,"IndexResetError");var Ps=Xc;Ps.code="IndexResetError";var Yc=class Yc extends re{constructor(e){super(`"${e}" does not point to any commit. You're maybe working on a repository with no commits yet. `),this.code=this.name=Yc.code,this.data={ref:e}}};a(Yc,"NoCommitError");var As=Yc;As.code="NoCommitError";var LE=Object.freeze({__proto__:null,AlreadyExistsError:Nt,AmbiguousError:bs,CheckoutConflictError:vs,CommitNotFetchedError:_s,EmptyServerResponseError:Fs,FastForwardError:Es,GitPushError:Ss,HttpError:qn,InternalError:W,InvalidFilepathError:Zr,InvalidOidError:Gr,InvalidRefNameError:Bt,MaxDepthError:xs,MergeNotSupportedError:zn,MergeConflictError:Wn,MissingNameError:ze,MissingParameterError:et,MultipleGitError:Ts,NoRefspecError:ys,NotFoundError:ce,ObjectTypeError:Ze,ParseError:Pi,PushRejectedError:Vn,RemoteCapabilityError:Vr,SmartHttpError:Os,UnknownTransportError:Rs,UnsafeFilepathError:jn,UrlParseError:ks,UserCanceledError:Gn,UnmergedPathsError:ws,IndexResetError:Ps,NoCommitError:As});function Sp({name:t,email:e,timestamp:r,timezoneOffset:i}){return i=AL(i),`${t} <${e}> ${r} ${i}`}a(Sp,"formatAuthor");function AL(t){let e=IL(DL(t));t=Math.abs(t);let r=Math.floor(t/60);t-=r*60;let i=String(r),n=String(t);return i.length<2&&(i="0"+i),n.length<2&&(n="0"+n),(e===-1?"-":"+")+i+n}a(AL,"formatTimezoneOffset");function IL(t){return Math.sign(t)||(Object.is(t,-0)?-1:1)}a(IL,"simpleSign");function DL(t){return t===0?t:-t}a(DL,"negateExceptForZero");function gr(t){return t=t.replace(/\r/g,""),t=t.replace(/^\n+/,""),t=t.replace(/\n+$/,"")+`
|
|
27
|
+
`,t}a(gr,"normalizeNewlines");function cc(t){let[,e,r,i,n]=t.match(/^(.*) <(.*)> (.*) (.*)$/);return{name:e,email:r,timestamp:Number(i),timezoneOffset:CL(n)}}a(cc,"parseAuthor");function CL(t){let[,e,r,i]=t.match(/(\+|-)(\d\d)(\d\d)/);return i=(e==="+"?1:-1)*(Number(r)*60+Number(i)),NL(i)}a(CL,"parseTimezoneOffset");function NL(t){return t===0?t:-t}a(NL,"negateExceptForZero$1");var Ln=class Ln{constructor(e){if(typeof e=="string")this._tag=e;else if(Buffer.isBuffer(e))this._tag=e.toString("utf8");else if(typeof e=="object")this._tag=Ln.render(e);else throw new W("invalid type passed to GitAnnotatedTag constructor")}static from(e){return new Ln(e)}static render(e){return`object ${e.object}
|
|
28
28
|
type ${e.type}
|
|
29
29
|
tag ${e.tag}
|
|
30
|
-
tagger ${
|
|
30
|
+
tagger ${Sp(e.tagger)}
|
|
31
31
|
|
|
32
32
|
${e.message}
|
|
33
33
|
${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexOf(`
|
|
@@ -40,13 +40,13 @@ ${e.gpgsig?e.gpgsig:""}`}justHeaders(){return this._tag.slice(0,this._tag.indexO
|
|
|
40
40
|
-----BEGIN PGP SIGNATURE-----`)===-1?e:e.slice(0,e.lastIndexOf(`
|
|
41
41
|
-----BEGIN PGP SIGNATURE-----`))}gpgsig(){if(this._tag.indexOf(`
|
|
42
42
|
-----BEGIN PGP SIGNATURE-----`)===-1)return;let e=this._tag.slice(this._tag.indexOf("-----BEGIN PGP SIGNATURE-----"),this._tag.indexOf("-----END PGP SIGNATURE-----")+27);return gr(e)}payload(){return this.withoutSignature()+`
|
|
43
|
-
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:o}=await r({payload:n,secretKey:i});o=gr(o);let s=n+o;return
|
|
43
|
+
`}toObject(){return Buffer.from(this._tag,"utf8")}static async sign(e,r,i){let n=e.payload(),{signature:o}=await r({payload:n,secretKey:i});o=gr(o);let s=n+o;return Ln.from(s)}};a(Ln,"GitAnnotatedTag");var ut=Ln;function hp(t){return t.trim().split(`
|
|
44
44
|
`).map(e=>" "+e).join(`
|
|
45
45
|
`)+`
|
|
46
|
-
`}a(
|
|
46
|
+
`}a(hp,"indent");function BL(t){return t.split(`
|
|
47
47
|
`).map(e=>e.replace(/^ /,"")).join(`
|
|
48
|
-
`)}a(
|
|
49
|
-
gpgsig`+
|
|
48
|
+
`)}a(BL,"outdent");var Qe=class Qe{constructor(e){if(typeof e=="string")this._commit=e;else if(Buffer.isBuffer(e))this._commit=e.toString("utf8");else if(typeof e=="object")this._commit=Qe.render(e);else throw new W("invalid type passed to GitCommit constructor")}static fromPayloadSignature({payload:e,signature:r}){let i=Qe.justHeaders(e),n=Qe.justMessage(e),o=gr(i+`
|
|
49
|
+
gpgsig`+hp(r)+`
|
|
50
50
|
`+n);return new Qe(o)}static from(e){return new Qe(e)}toObject(){return Buffer.from(this._commit,"utf8")}headers(){return this.parseHeaders()}message(){return Qe.justMessage(this._commit)}parse(){return Object.assign({message:this.message()},this.headers())}static justMessage(e){return gr(e.slice(e.indexOf(`
|
|
51
51
|
|
|
52
52
|
`)+2))}static justHeaders(e){return e.slice(0,e.indexOf(`
|
|
@@ -56,29 +56,29 @@ gpgsig`+up(r)+`
|
|
|
56
56
|
`+n.slice(1):r.push(n);let i={parent:[]};for(let n of r){let o=n.slice(0,n.indexOf(" ")),s=n.slice(n.indexOf(" ")+1);Array.isArray(i[o])?i[o].push(s):i[o]=s}return i.author&&(i.author=cc(i.author)),i.committer&&(i.committer=cc(i.committer)),i}static renderHeaders(e){let r="";if(e.tree?r+=`tree ${e.tree}
|
|
57
57
|
`:r+=`tree 4b825dc642cb6eb9a060e54bf8d69288fbee4904
|
|
58
58
|
`,e.parent){if(e.parent.length===void 0)throw new W("commit 'parent' property should be an array");for(let o of e.parent)r+=`parent ${o}
|
|
59
|
-
`}let i=e.author;r+=`author ${
|
|
60
|
-
`;let n=e.committer||e.author;return r+=`committer ${
|
|
61
|
-
`,e.gpgsig&&(r+="gpgsig"+
|
|
59
|
+
`}let i=e.author;r+=`author ${Sp(i)}
|
|
60
|
+
`;let n=e.committer||e.author;return r+=`committer ${Sp(n)}
|
|
61
|
+
`,e.gpgsig&&(r+="gpgsig"+hp(e.gpgsig)),r}static render(e){return Qe.renderHeaders(e)+`
|
|
62
62
|
`+gr(e.message)}render(){return this._commit}withoutSignature(){let e=gr(this._commit);if(e.indexOf(`
|
|
63
63
|
gpgsig`)===-1)return e;let r=e.slice(0,e.indexOf(`
|
|
64
64
|
gpgsig`)),i=e.slice(e.indexOf(`-----END PGP SIGNATURE-----
|
|
65
65
|
`)+28);return gr(r+`
|
|
66
|
-
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return
|
|
67
|
-
gpgsig`+
|
|
68
|
-
`+o;return Qe.from(f)}};a(Qe,"GitCommit");var rt=Qe;async function
|
|
69
|
-
`),i=new TextEncoder().encode(i)}catch{}return typeof i!="string"&&(i=Buffer.from(i)),i}catch{return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i);return}catch{await this.mkdir(Un(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e);return}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=Un(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Qc),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let o=e+"/"+n;return(await this._stat(o)).isDirectory()?this.readdirDeep(o):o}))).reduce((n,o)=>n.concat(o),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};a(Vp,"FileSystem");var M=Vp;function E(t,e){if(e===void 0)throw new et(t)}a(E,"assertParameter");async function fc(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}a(fc,"modified");async function $E({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i="HEAD",cache:n={}}){try{E("fs",t),E("dir",e),E("gitdir",r);let o=new M(t),s=[ft({ref:i}),Qn(),Di()],l=[];await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){l=c.unmergedPaths});let f=await Xr({fs:o,cache:n,dir:e,gitdir:r,trees:s,map:a(async function(c,[u,h,d]){let p=!await fc(h,d),m=l.includes(c),w=!await fc(d,u);if(p||m)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(w)return!1;throw new Ps(c)},"map")});await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){for(let u of f)if(u!==!1){if(!u){await o.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let h=new TextDecoder().decode(u.content);await o.write(`${e}/${u.path}`,h,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(o){throw o.caller="git.abortMerge",o}}a($E,"abortMerge");var Gp=class Gp{static async isIgnored({fs:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n}){if(oc(n)===".git")return!0;if(n===".")return!1;let o="",s=D.join(i,"info","exclude");await e.exists(s)&&(o=await e.read(s,"utf8"));let l=[{gitignore:D.join(r,".gitignore"),filepath:n}],f=n.split("/").filter(Boolean);for(let u=1;u<f.length;u++){let h=f.slice(0,u).join("/"),d=f.slice(u).join("/");l.push({gitignore:D.join(r,h,".gitignore"),filepath:d})}let c=!1;for(let u of l){let h;try{h=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=WB().add(o);d.add(h);let p=Un(u.filepath);if(p!=="."&&d.ignores(p))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};a(Gp,"GitIgnoreManager");var Yr=Gp;async function jL({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new W("GitObjectStoreLoose expects objects to write to be in deflated format");let o=`objects/${n.slice(0,2)}/${n.slice(2)}`,s=`${e}/${o}`;await t.exists(s)||await t.write(s,r)}a(jL,"writeObjectLoose");var hp=null;async function ME(t){return hp===null&&(hp=HL()),hp?UL(t):Pp.deflate(t)}a(ME,"deflate");async function UL(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(UL,"browserDeflate");function HL(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}a(HL,"testCompressionStream");async function it({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o=void 0,dryRun:s=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Kr.wrap({type:r,object:i})),o=await br(i),i=Buffer.from(await ME(i))),s||await jL({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}a(it,"_writeObject");function jE(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}a(jE,"posixifyPathBuffer");async function UE({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={},force:o=!1,parallel:s=!0}){try{E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i);let l=new M(t);await Fe.acquire({fs:l,gitdir:r,cache:n},async f=>{let u=await(await be.get({fs:l,gitdir:r})).get("core.autocrlf");return Rp({dir:e,gitdir:r,fs:l,filepath:i,index:f,force:o,parallel:s,autocrlf:u})})}catch(l){throw l.caller="git.add",l}}a(UE,"add");async function Rp({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:o,parallel:s,autocrlf:l}){i=Array.isArray(i)?i:[i];let f=i.map(async d=>{if(!o&&await Yr.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let p=await r.lstat(D.join(t,d));if(!p)throw new ce(d);if(p.isDirectory()){let m=await r.readdir(D.join(t,d));if(s){let w=m.map(y=>Rp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,y)],index:n,force:o,parallel:s,autocrlf:l}));await Promise.all(w)}else for(let w of m)await Rp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,w)],index:n,force:o,parallel:s,autocrlf:l})}else{let m=p.isSymbolicLink()?await r.readlink(D.join(t,d)).then(jE):await r.read(D.join(t,d),{autocrlf:l});if(m===null)throw new ce(d);let w=await it({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:p,oid:w})}}),c=await Promise.allSettled(f),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Ts(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}a(Rp,"addToIndex");async function Is({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).get(r)}a(Is,"_getConfig");function HE(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}a(HE,"assignDefined");async function Jr({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),o={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},s=HE({},o,i?i.author:void 0,r);if(s.name!==void 0)return s}a(Jr,"normalizeAuthorObject");async function Kn({fs:t,gitdir:e,author:r,committer:i,commit:n}){let o=Math.floor(Date.now()/1e3),s={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},l=HE({},s,n?n.committer:void 0,r,i);if(l.name!==void 0)return l}a(Kn,"normalizeCommitterObject");async function qE({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=ut.from(o).parse().object,qE({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new Ze(i,n,"commit");return{commit:rt.from(o),oid:i}}a(qE,"resolveCommit");async function Zn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:o}=await qE({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,commit:n.parse(),payload:n.withoutSignature()}}a(Zn,"_readCommit");async function tf({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p}){let m=!1;h||(h=await B.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await B.resolve({fs:t,gitdir:i,ref:h}),y=await Zn({fs:t,gitdir:i,oid:w,cache:{}})}catch{m=!0}if(f&&m)throw new As(h);let v=f?await Jr({fs:t,gitdir:i,author:o,commit:y.commit}):await Jr({fs:t,gitdir:i,author:o});if(!v)throw new ze("author");let g=f?await Kn({fs:t,gitdir:i,author:v,committer:s,commit:y.commit}):await Kn({fs:t,gitdir:i,author:v,committer:s});if(!g)throw new ze("committer");return Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(F){let S=AE(F.entries).get(".");if(p||(p=await zE({fs:t,gitdir:i,inode:S,dryRun:c})),d?d=await Promise.all(d.map(x=>B.resolve({fs:t,gitdir:i,ref:x}))):f?d=y.commit.parent:d=w?[w]:[],!n)if(f)n=y.commit.message;else throw new et("message");let R=rt.from({tree:p,parent:d,author:v,committer:g,message:n});l&&(R=await rt.sign(R,r,l));let b=await it({fs:t,gitdir:i,type:"commit",object:R.toObject(),dryRun:c});return!u&&!c&&await B.writeRef({fs:t,gitdir:i,ref:h,value:b}),b})}a(tf,"_commit");async function zE({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let f of n)f.type==="tree"&&(f.metadata.mode="040000",f.metadata.oid=await zE({fs:t,gitdir:e,inode:f,dryRun:i}));let o=n.map(f=>({mode:f.metadata.mode,path:f.basename,oid:f.metadata.oid,type:f.type})),s=tt.from(o);return await it({fs:t,gitdir:e,type:"tree",object:s.toObject(),dryRun:i})}a(zE,"constructTree");async function Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Zr("leading-slash");if(n.endsWith("/"))throw new Zr("trailing-slash");let o=i,s=await Gn({fs:t,cache:e,gitdir:r,oid:i}),l=s.tree;if(n==="")i=s.oid;else{let f=n.split("/");i=await WE({fs:t,cache:e,gitdir:r,tree:l,pathArray:f,oid:o,filepath:n})}return i}a(Ds,"resolveFilepath");async function WE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s}){let l=n.shift();for(let f of i)if(f.path===l){if(n.length===0)return f.oid;{let{type:c,object:u}=await de({fs:t,cache:e,gitdir:r,oid:f.oid});if(c!=="tree")throw new Ze(o,c,"tree",s);return i=tt.from(u),WE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s})}}throw new ce(`file or directory found at "${o}:${s}"`)}a(WE,"_resolveFilepath");async function eo({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:o,oid:s}=await Gn({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,tree:o.entries()}}a(eo,"_readTree");async function Cs({fs:t,gitdir:e,tree:r}){let i=tt.from(r).toObject();return await it({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}a(Cs,"_writeTree");async function qL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:o,note:s,force:l,author:f,committer:c,signingKey:u}){let h;try{h=await B.resolve({gitdir:i,fs:t,ref:n})}catch(v){if(!(v instanceof ce))throw v}let p=(await eo({fs:t,cache:e,gitdir:i,oid:h||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(l)p=p.filter(v=>v.path!==o);else for(let v of p)if(v.path===o)throw new Nt("note",o);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let m=await it({fs:t,gitdir:i,type:"blob",object:s,format:"content"});p.push({mode:"100644",path:o,oid:m,type:"blob"});let w=await Cs({fs:t,gitdir:i,tree:p});return await tf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:w,parent:h&&[h],message:`Note added by 'isomorphic-git addNote'
|
|
70
|
-
`,author:f,committer:c,signingKey:u})}a(qL,"_addNote");async function VE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n="refs/notes/commits",oid:o,note:s,force:l,author:f,committer:c,signingKey:u,cache:h={}}){try{E("fs",t),E("gitdir",i),E("oid",o),E("note",s),u&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:f});if(!p)throw new ze("author");let m=await Kn({fs:d,gitdir:i,author:p,committer:c});if(!m)throw new ze("committer");return await qL({fs:new M(d),cache:h,onSign:e,gitdir:i,ref:n,oid:o,note:s,force:l,author:p,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}a(VE,"addNote");async function GE({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let o=await be.get({fs:t,gitdir:e});if(!n&&(await o.getSubsections("remote")).includes(r)&&i!==await o.get(`remote.${r}.url`))throw new Nt("remote",r);await o.set(`remote.${r}.url`,i),await o.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await be.save({fs:t,gitdir:e,config:o})}a(GE,"_addRemote");async function KE({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i,url:n,force:o=!1}){try{return E("fs",t),E("gitdir",r),E("remote",i),E("url",n),await GE({fs:new M(t),gitdir:r,remote:i,url:n,force:o})}catch(s){throw s.caller="git.addRemote",s}}a(KE,"addRemote");async function zL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await B.exists({fs:t,gitdir:i,ref:n}))throw new Nt("tag",n);let h=await B.resolve({fs:t,gitdir:i,ref:f||"HEAD"}),{type:d}=await de({fs:t,cache:e,gitdir:i,oid:h}),p=ut.from({object:h,type:d,tag:n.replace("refs/tags/",""),tagger:o,message:s,gpgsig:l});c&&(p=await ut.sign(p,r,c));let m=await it({fs:t,gitdir:i,type:"tag",object:p.toObject()});await B.writeRef({fs:t,gitdir:i,ref:n,value:m})}a(zL,"_annotatedTag");async function ZE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1,cache:h={}}){try{E("fs",t),E("gitdir",i),E("ref",n),c&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:o});if(!p)throw new ze("tagger");return await zL({fs:d,cache:h,onSign:e,gitdir:i,ref:n,tagger:p,message:s,gpgsig:l,object:f,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}a(ZE,"annotatedTag");async function WL({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:o=!1}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let s=`refs/heads/${r}`;if(!o&&await B.exists({fs:t,gitdir:e,ref:s}))throw new Nt("branch",r,!1);let l;try{l=await B.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch{}l&&await B.writeRef({fs:t,gitdir:e,ref:s,value:l}),n&&await B.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(WL,"_branch");async function XE({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,checkout:o=!1,force:s=!1}){try{return E("fs",t),E("gitdir",r),E("ref",i),await WL({fs:new M(t),gitdir:r,ref:i,object:n,checkout:o,force:s})}catch(l){throw l.caller="git.branch",l}}a(XE,"branch");var YE=a((t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e),"worthWalking");async function Ip({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:l,filepaths:f,noCheckout:c,noUpdateHead:u,dryRun:h,force:d,track:p=!0,nonBlocking:m=!1,batchSize:w=100}){let y;if(i)try{y=await B.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch{y="0000000000000000000000000000000000000000"}let v;try{v=await B.resolve({fs:t,gitdir:o,ref:l})}catch(g){if(l==="HEAD")throw g;let F=`${s}/${l}`;if(v=await B.resolve({fs:t,gitdir:o,ref:F}),p){let O=await be.get({fs:t,gitdir:o});await O.set(`branch.${l}.remote`,s),await O.set(`branch.${l}.merge`,`refs/heads/${l}`),await be.save({fs:t,gitdir:o,config:O})}await B.writeRef({fs:t,gitdir:o,ref:`refs/heads/${l}`,value:v})}if(!c){let g;try{g=await VL({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:l,force:d,filepaths:f})}catch(b){throw b instanceof ce&&b.data.what===v?new _s(l,v):b}let F=g.filter(([b])=>b==="conflict").map(([b,x])=>x);if(F.length>0)throw new vs(F);let O=g.filter(([b])=>b==="error").map(([b,x])=>x);if(O.length>0)throw new W(O.join(", "));if(h){i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"});return}let S=0,R=g.length;if(await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){await Promise.all(g.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}))}),await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){for(let[x,_]of g)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(k){if(k.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw k}}}),await Promise.all(g.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,x]){let _=`${n}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++S,total:R})})),m){let b=g.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),x=await gE("Update Working Dir",b.map(([_,P,k,C,N])=>()=>KL({fs:t,cache:e,gitdir:o,dir:n},[_,P,k,C,N])),r,w);await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(_){await gE("Update Index",x.map(([P,k,C])=>()=>GL({index:_,fullpath:P,oid:k,stats:C})),r,w)})}else await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(b){await Promise.all(g.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,_,P,k,C]){let N=`${n}/${_}`;try{if(x!=="create-index"&&x!=="mkdir-index"){let{object:Z}=await de({fs:t,cache:e,gitdir:o,oid:P});if(C&&await t.rm(N),k===33188)await t.write(N,Z);else if(k===33261)await t.write(N,Z,{mode:511});else if(k===40960)await t.writelink(N,Z);else throw new W(`Invalid mode 0o${k.toString(8)} detected in blob ${P}`)}let U=await t.lstat(N);k===33261&&(U.mode=493),x==="mkdir-index"&&(U.mode=57344),b.insert({filepath:_,stats:U,oid:P}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(U){console.log(U)}}))});i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"})}if(!u){let g=await B.expand({fs:t,gitdir:o,ref:l});g.startsWith("refs/heads")?await B.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:g}):await B.writeRef({fs:t,gitdir:o,ref:"HEAD",value:v})}}a(Ip,"_checkout");async function VL({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:o,force:s,filepaths:l}){let f=0;return Xr({fs:t,cache:e,dir:i,gitdir:n,trees:[ft({ref:o}),Qn(),Di()],map:a(async function(c,[u,h,d]){if(c===".")return;if(l&&!l.some(m=>YE(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!d,!!u,!!h].map(Number).join("")){case"000":return;case"001":return s&&l&&l.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await h.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await h.oid()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]:await u.mode()!==await h.mode()?s?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await h.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!s)return;if(h){if(await h.oid()!==await d.oid()&&await h.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},"map"),reduce:a(async function(c,u){return u=LE(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u},"reduce")})}a(VL,"analyze");async function GL({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}a(GL,"updateIndex");async function KL({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,l,f]){let c=`${i}/${o}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(c),l===33188)await t.write(c,h);else if(l===33261)await t.write(c,h,{mode:511});else if(l===40960)await t.writelink(c,h);else throw new W(`Invalid mode 0o${l.toString(8)} detected in blob ${s}`)}let u=await t.lstat(c);return l===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[o,s,u]}a(KL,"updateWorkingDir");async function gE(t,e,r,i){let n=[];try{for(let o=0;o<e.length;o+=i){let s=e.slice(o,o+i).map(f=>f());(await Promise.allSettled(s)).forEach(f=>{f.status==="fulfilled"&&n.push(f.value)}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}return n}catch(o){console.error(`Error during ${t}: ${o}`)}return n}a(gE,"batchAllSettled");async function Dp({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=D.join(i,".git"),remote:o="origin",ref:s,filepaths:l,noCheckout:f=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:h=!1,track:d=!0,cache:p={},nonBlocking:m=!1,batchSize:w=100}){try{E("fs",t),E("dir",i),E("gitdir",n);let y=s||"HEAD";return await Ip({fs:new M(t),cache:p,onProgress:e,onPostCheckout:r,dir:i,gitdir:n,remote:o,ref:y,filepaths:l,noCheckout:f,noUpdateHead:c,dryRun:u,force:h,track:d,nonBlocking:m,batchSize:w})}catch(y){throw y.caller="git.checkout",y}}a(Dp,"checkout");var ZL=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function ki(t){let e=ZL.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}a(ki,"abbreviateRef");async function Qr({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await B.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await B.resolve({fs:t,gitdir:e,ref:n})}catch{return}if(n.startsWith("refs/"))return r?n:ki(n)}a(Qr,"_currentBranch");function XL(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}a(XL,"translateSSHtoHTTP");function JE({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}a(JE,"calculateBasicAuthHeader");async function Ns(t,e){let r=CE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(Ns,"forAwait");async function uc(t){let e=0,r=[];await Ns(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(uc,"collect");function bE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}a(bE,"extractAuthFromUrl");function kp(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}a(kp,"padHex");var Kp=class Kp{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=kp(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new lc(e);return a(async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let o=await r.read(n-4);return o??!0}catch(n){return e.error=n,!0}},"read")}};a(Kp,"GitPktLine");var we=Kp;async function vE(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),o=r.slice(i+1);e[n]=o}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}a(vE,"parseCapabilitiesV2");async function _E(t,{service:e}){let r=new Set,i=new Map,n=new Map,o=we.streamReader(t),s=await o();for(;s===null;)s=await o();if(s===!0)throw new Fs;if(s.includes("version 2"))return vE(o);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Pi(`# service=${e}\\n`,s.toString("utf8"));let l=await o();for(;l===null;)l=await o();if(l===!0)return{capabilities:r,refs:i,symrefs:n};if(l=l.toString("utf8"),l.includes("version 2"))return vE(o);let[f,c]=dp(l,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),f!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,h]=dp(f," "," ");for(i.set(h,u);;){let d=await o();if(d===!0)break;if(d!==null){let[p,m]=dp(d.toString("utf8")," "," ");i.set(m,p)}}}for(let u of r)if(u.startsWith("symref=")){let h=u.match(/symref=([^:]+):(.*)/);h.length===3&&n.set(h[1],h[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}a(_E,"parseRefsAdResponse");function dp(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Pi(`Two strings separated by '${r}'`,t.toString("utf8"));return i}a(dp,"splitAndAssert");var FE=a((t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,"corsProxify"),EE=a((t,e)=>{(e.username||e.password)&&(t.Authorization=JE(e)),e.headers&&Object.assign(t,e.headers)},"updateHeaders"),pp=a(async t=>{try{let e=Buffer.from(await uc(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch{return{}}},"stringifyBody"),Zp=class Zp{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:o,corsProxy:s,service:l,url:f,headers:c,protocolVersion:u}){let{url:h,auth:d}=bE(f),p=s?FE(s,h):h;(d.username||d.password)&&(c.Authorization=JE(d)),u===2&&(c["Git-Protocol"]="version=2");let m,w,y=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${p}/info/refs?service=${l}`,headers:c}),w=!1,m.statusCode===401||m.statusCode===203){let v=y?o:i;if(v){if(d=await v(h,{...d,headers:{...c}}),d&&d.cancel)throw new Vn;d&&(EE(c,d),y=!0,w=!0)}}else m.statusCode===200&&y&&n&&await n(h,d);while(w);if(m.statusCode!==200){let{response:v}=await pp(m);throw new Hn(m.statusCode,m.statusMessage,v)}if(m.headers["content-type"]===`application/x-${l}-advertisement`){let v=await _E(m.body,{service:l});return v.auth=d,v}else{let{preview:v,response:g,data:F}=await pp(m);try{let O=await _E([F],{service:l});return O.auth=d,O}catch{throw new Os(v,g)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:o,auth:s,body:l,headers:f}){let c=bE(o);c&&(o=c.url),i&&(o=FE(i,o)),f["content-type"]=`application/x-${n}-request`,f.accept=`application/x-${n}-result`,EE(f,s);let u=await e.request({onProgress:r,method:"POST",url:`${o}/${n}`,body:l,headers:f});if(u.statusCode!==200){let{response:h}=pp(u);throw new Hn(u.statusCode,u.statusMessage,h)}return u}};a(Zp,"GitRemoteHTTP");var Xn=Zp,Xp=class Xp{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",Xn),r.set("https",Xn);let i=YL({url:e});if(!i)throw new ks(e);if(r.has(i.transport))return r.get(i.transport);throw new Rs(e,i.transport,i.transport==="ssh"?XL(e):void 0)}};a(Xp,"GitRemoteManager");var Yn=Xp;function YL({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}a(YL,"parseRemoteUrl");var Ri=null,Yp=class Yp{static async read({fs:e,gitdir:r}){Ri===null&&(Ri=new ds);let i=D.join(r,"shallow"),n=new Set;return await Ri.acquire(i,async function(){let o=await e.read(i,{encoding:"utf8"});if(o===null||o.trim()==="")return n;o.trim().split(`
|
|
66
|
+
`+i)}isolateSignature(){let e=this._commit.slice(this._commit.indexOf("-----BEGIN PGP SIGNATURE-----"),this._commit.indexOf("-----END PGP SIGNATURE-----")+27);return BL(e)}static async sign(e,r,i){let n=e.withoutSignature(),o=Qe.justMessage(e._commit),{signature:s}=await r({payload:n,secretKey:i});s=gr(s);let f=Qe.justHeaders(e._commit)+`
|
|
67
|
+
gpgsig`+hp(s)+`
|
|
68
|
+
`+o;return Qe.from(f)}};a(Qe,"GitCommit");var rt=Qe;async function Kn({fs:t,cache:e,gitdir:r,oid:i}){if(i==="4b825dc642cb6eb9a060e54bf8d69288fbee4904")return{tree:tt.from([]),oid:i};let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=ut.from(o).parse().object,Kn({fs:t,cache:e,gitdir:r,oid:i});if(n==="commit")return i=rt.from(o).parse().tree,Kn({fs:t,cache:e,gitdir:r,oid:i});if(n!=="tree")throw new Ze(i,n,"tree");return{tree:tt.from(o),oid:i}}a(Kn,"resolveTree");var zp=class zp{constructor({fs:e,gitdir:r,ref:i,cache:n}){var s;this.fs=e,this.cache=n,this.gitdir=r,this.mapPromise=(async()=>{let l=new Map,f;try{f=await B.resolve({fs:e,gitdir:r,ref:i})}catch(u){u instanceof ce&&(f="4b825dc642cb6eb9a060e54bf8d69288fbee4904")}let c=await Kn({fs:e,cache:this.cache,gitdir:r,oid:f});return c.type="tree",c.mode="40000",l.set(".",c),l})();let o=this;this.ConstructEntry=(s=class{constructor(f){this._fullpath=f,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}},a(s,"TreeEntry"),s)}async readdir(e){let r=e._fullpath,{fs:i,cache:n,gitdir:o}=this,s=await this.mapPromise,l=s.get(r);if(!l)throw new Error(`No obj for ${r}`);let f=l.oid;if(!f)throw new Error(`No oid for obj ${JSON.stringify(l)}`);if(l.type!=="tree")return null;let{type:c,object:u}=await de({fs:i,cache:n,gitdir:o,oid:f});if(c!==l.type)throw new Ze(f,c,l.type);let h=tt.from(u);for(let d of h)s.set(D.join(r,d.path),d);return h.entries().map(d=>D.join(r,d.path))}async type(e){if(e._type===!1){let r=await this.mapPromise,{type:i}=r.get(e._fullpath);e._type=i}return e._type}async mode(e){if(e._mode===!1){let r=await this.mapPromise,{mode:i}=r.get(e._fullpath);e._mode=PE(parseInt(i,8))}return e._mode}async stat(e){}async content(e){if(e._content===!1){let r=await this.mapPromise,{fs:i,cache:n,gitdir:o}=this,l=r.get(e._fullpath).oid,{type:f,object:c}=await de({fs:i,cache:n,gitdir:o,oid:l});f!=="blob"?e._content=void 0:e._content=new Uint8Array(c)}return e._content}async oid(e){if(e._oid===!1){let i=(await this.mapPromise).get(e._fullpath);e._oid=i.oid}return e._oid}};a(zp,"GitWalkerRepo");var xp=zp;function ft({ref:t="HEAD"}={}){let e=Object.create(null);return Object.defineProperty(e,ef,{value:a(function({fs:r,gitdir:i,cache:n}){return new xp({fs:r,gitdir:i,ref:t,cache:n})},"value")}),Object.freeze(e),e}a(ft,"TREE");var Wp=class Wp{constructor({fs:e,dir:r,gitdir:i,cache:n}){var s;this.fs=e,this.cache=n,this.dir=r,this.gitdir=i,this.config=null;let o=this;this.ConstructEntry=(s=class{constructor(f){this._fullpath=f,this._type=!1,this._mode=!1,this._stat=!1,this._content=!1,this._oid=!1}async type(){return o.type(this)}async mode(){return o.mode(this)}async stat(){return o.stat(this)}async content(){return o.content(this)}async oid(){return o.oid(this)}},a(s,"WorkdirEntry"),s)}async readdir(e){let r=e._fullpath,{fs:i,dir:n}=this,o=await i.readdir(D.join(n,r));return o===null?null:o.map(s=>D.join(r,s))}async type(e){return e._type===!1&&await e.stat(),e._type}async mode(e){return e._mode===!1&&await e.stat(),e._mode}async stat(e){if(e._stat===!1){let{fs:r,dir:i}=this,n=await r.lstat(`${i}/${e._fullpath}`);if(!n)throw new Error(`ENOENT: no such file or directory, lstat '${e._fullpath}'`);let o=n.isDirectory()?"tree":"blob";o==="blob"&&!n.isFile()&&!n.isSymbolicLink()&&(o="special"),e._type=o,n=Un(n),e._mode=n.mode,n.size===-1&&e._actualSize&&(n.size=e._actualSize),e._stat=n}return e._stat}async content(e){if(e._content===!1){let{fs:r,dir:i,gitdir:n}=this;if(await e.type()==="tree")e._content=void 0;else{let s=await(await this._getGitConfig(r,n)).get("core.autocrlf"),l=await r.read(`${i}/${e._fullpath}`,{autocrlf:s});e._actualSize=l.length,e._stat&&e._stat.size===-1&&(e._stat.size=e._actualSize),e._content=new Uint8Array(l)}}return e._content}async oid(e){if(e._oid===!1){let r=this,{fs:i,gitdir:n,cache:o}=this,s;await Fe.acquire({fs:i,gitdir:n,cache:o},async function(l){let f=l.entriesMap.get(e._fullpath),c=await e.stat(),h=await(await r._getGitConfig(i,n)).get("core.filemode"),d=typeof process<"u"?process.platform!=="win32":!0;if(!f||nc(c,f,h,d)){let p=await e.content();p===void 0?s=void 0:(s=await br(Kr.wrap({type:"blob",object:p})),f&&s===f.oid&&(!h||c.mode===f.mode)&&nc(c,f,h,d)&&l.insert({filepath:e._fullpath,stats:c,oid:s}))}else s=f.oid}),e._oid=s}return e._oid}async _getGitConfig(e,r){return this.config?this.config:(this.config=await be.get({fs:e,gitdir:r}),this.config)}};a(Wp,"GitWalkerFs");var Tp=Wp;function eo(){let t=Object.create(null);return Object.defineProperty(t,ef,{value:a(function({fs:e,dir:r,gitdir:i,cache:n}){return new Tp({fs:e,dir:r,gitdir:i,cache:n})},"value")}),Object.freeze(t),t}a(eo,"WORKDIR");function LL(t,e){let r=e-t;return Array.from({length:r},(i,n)=>t+n)}a(LL,"arrayRange");var $E=typeof Array.prototype.flat>"u"?t=>t.reduce((e,r)=>e.concat(r),[]):t=>t.flat(),Vp=class Vp{constructor(){this.value=null}consider(e){e!=null&&(this.value===null?this.value=e:e<this.value&&(this.value=e))}reset(){this.value=null}};a(Vp,"RunningMinimum");var Op=Vp;function*$L(t){let e=new Op,r,i=[],n=t.length;for(let o=0;o<n;o++)i[o]=t[o].next().value,i[o]!==void 0&&e.consider(i[o]);if(e.value!==null)for(;;){let o=[];r=e.value,e.reset();for(let s=0;s<n;s++)i[s]!==void 0&&i[s]===r?(o[s]=i[s],i[s]=t[s].next().value):o[s]=null,i[s]!==void 0&&e.consider(i[s]);if(yield o,e.value===null)return}}a($L,"unionOfIterators");async function Xr({fs:t,cache:e,dir:r,gitdir:i,trees:n,map:o=a(async(f,c)=>c,"map"),reduce:s=a(async(f,c)=>{let u=$E(c);return f!==void 0&&u.unshift(f),u},"reduce"),iterate:l=a((f,c)=>Promise.all([...c].map(f)),"iterate")}){let f=n.map(p=>p[ef]({fs:t,dir:r,gitdir:i,cache:e})),c=new Array(f.length).fill("."),u=LL(0,f.length),h=a(async p=>{u.map(y=>{let v=p[y];p[y]=v&&new f[y].ConstructEntry(v)});let w=(await Promise.all(u.map(y=>{let v=p[y];return v?f[y].readdir(v):[]}))).map(y=>(y===null?[]:y)[Symbol.iterator]());return{entries:p,children:$L(w)}},"unionWalkerFromReaddir"),d=a(async p=>{let{entries:m,children:w}=await h(p),y=m.find(g=>g&&g._fullpath)._fullpath,v=await o(y,m);if(v!==null){let g=await l(d,w);return g=g.filter(F=>F!==void 0),s(v,g)}},"walk");return d(c)}a(Xr,"_walk");async function Rp(t,e){let r=await t.readdir(e);r==null?await t.rm(e):r.length?await Promise.all(r.map(i=>{let n=D.join(e,i);return t.lstat(n).then(o=>{if(o)return o.isDirectory()?Rp(t,n):t.rm(n)})})).then(()=>t.rmdir(e)):await t.rmdir(e)}a(Rp,"rmRecursive");function ML(t){return jL(t)&&mE(t.then)&&mE(t.catch)}a(ML,"isPromiseLike");function jL(t){return t&&typeof t=="object"}a(jL,"isObject");function mE(t){return typeof t=="function"}a(mE,"isFunction");function wE(t){return ML(a(r=>{try{return r.readFile().catch(i=>i)}catch(i){return i}},"test")(t))}a(wE,"isPromiseFs");var yE=["readFile","writeFile","mkdir","rmdir","unlink","stat","lstat","readdir","readlink","symlink"];function gE(t,e){if(wE(e))for(let r of yE)t[`_${r}`]=e[r].bind(e);else for(let r of yE)t[`_${r}`]=sp(e[r].bind(e));wE(e)?e.rm?t._rm=e.rm.bind(e):e.rmdir.length>1?t._rm=e.rmdir.bind(e):t._rm=Rp.bind(null,t):e.rm?t._rm=sp(e.rm.bind(e)):e.rmdir.length>2?t._rm=sp(e.rmdir.bind(e)):t._rm=Rp.bind(null,t)}a(gE,"bindFs");var Gp=class Gp{constructor(e){if(typeof e._original_unwrapped_fs<"u")return e;let r=Object.getOwnPropertyDescriptor(e,"promises");r&&r.enumerable?gE(this,e.promises):gE(this,e),this._original_unwrapped_fs=e}async exists(e,r={}){try{return await this._stat(e),!0}catch(i){if(i.code==="ENOENT"||i.code==="ENOTDIR"||(i.code||"").includes("ENS"))return!1;throw console.log('Unhandled error in "FileSystem.exists()" function',i),i}}async read(e,r={}){try{let i=await this._readFile(e,r);if(r.autocrlf==="true")try{i=new TextDecoder("utf8",{fatal:!0}).decode(i),i=i.replace(/\r\n/g,`
|
|
69
|
+
`),i=new TextEncoder().encode(i)}catch{}return typeof i!="string"&&(i=Buffer.from(i)),i}catch{return null}}async write(e,r,i={}){try{await this._writeFile(e,r,i);return}catch{await this.mkdir(Hn(e)),await this._writeFile(e,r,i)}}async mkdir(e,r=!1){try{await this._mkdir(e);return}catch(i){if(i===null||i.code==="EEXIST")return;if(r)throw i;if(i.code==="ENOENT"){let n=Hn(e);if(n==="."||n==="/"||n===e)throw i;await this.mkdir(n),await this.mkdir(e,!0)}}}async rm(e){try{await this._unlink(e)}catch(r){if(r.code!=="ENOENT")throw r}}async rmdir(e,r){try{r&&r.recursive?await this._rm(e,r):await this._rmdir(e)}catch(i){if(i.code!=="ENOENT")throw i}}async readdir(e){try{let r=await this._readdir(e);return r.sort(Qc),r}catch(r){return r.code==="ENOTDIR"?null:[]}}async readdirDeep(e){let r=await this._readdir(e);return(await Promise.all(r.map(async n=>{let o=e+"/"+n;return(await this._stat(o)).isDirectory()?this.readdirDeep(o):o}))).reduce((n,o)=>n.concat(o),[])}async lstat(e){try{return await this._lstat(e)}catch(r){if(r.code==="ENOENT"||(r.code||"").includes("ENS"))return null;throw r}}async readlink(e,r={encoding:"buffer"}){try{let i=await this._readlink(e,r);return Buffer.isBuffer(i)?i:Buffer.from(i)}catch(i){if(i.code==="ENOENT"||(i.code||"").includes("ENS"))return null;throw i}}async writelink(e,r){return this._symlink(r.toString("utf8"),e)}};a(Gp,"FileSystem");var M=Gp;function E(t,e){if(e===void 0)throw new et(t)}a(E,"assertParameter");async function fc(t,e){return!t&&!e?!1:t&&!e||!t&&e?!0:!(await t.type()==="tree"&&await e.type()==="tree"||await t.type()===await e.type()&&await t.mode()===await e.mode()&&await t.oid()===await e.oid())}a(fc,"modified");async function ME({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i="HEAD",cache:n={}}){try{E("fs",t),E("dir",e),E("gitdir",r);let o=new M(t),s=[ft({ref:i}),eo(),Di()],l=[];await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){l=c.unmergedPaths});let f=await Xr({fs:o,cache:n,dir:e,gitdir:r,trees:s,map:a(async function(c,[u,h,d]){let p=!await fc(h,d),m=l.includes(c),w=!await fc(d,u);if(p||m)return u?{path:c,mode:await u.mode(),oid:await u.oid(),type:await u.type(),content:await u.content()}:void 0;if(w)return!1;throw new Ps(c)},"map")});await Fe.acquire({fs:o,gitdir:r,cache:n},async function(c){for(let u of f)if(u!==!1){if(!u){await o.rmdir(`${e}/${u.path}`,{recursive:!0}),c.delete({filepath:u.path});continue}if(u.type==="blob"){let h=new TextDecoder().decode(u.content);await o.write(`${e}/${u.path}`,h,{mode:u.mode}),c.insert({filepath:u.path,oid:u.oid,stage:0})}}})}catch(o){throw o.caller="git.abortMerge",o}}a(ME,"abortMerge");var Kp=class Kp{static async isIgnored({fs:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n}){if(oc(n)===".git")return!0;if(n===".")return!1;let o="",s=D.join(i,"info","exclude");await e.exists(s)&&(o=await e.read(s,"utf8"));let l=[{gitignore:D.join(r,".gitignore"),filepath:n}],f=n.split("/").filter(Boolean);for(let u=1;u<f.length;u++){let h=f.slice(0,u).join("/"),d=f.slice(u).join("/");l.push({gitignore:D.join(r,h,".gitignore"),filepath:d})}let c=!1;for(let u of l){let h;try{h=await e.read(u.gitignore,"utf8")}catch(m){if(m.code==="NOENT")continue}let d=VB().add(o);d.add(h);let p=Hn(u.filepath);if(p!=="."&&d.ignores(p))return!0;c?c=!d.test(u.filepath).unignored:c=d.test(u.filepath).ignored}return c}};a(Kp,"GitIgnoreManager");var Yr=Kp;async function UL({fs:t,gitdir:e,object:r,format:i,oid:n}){if(i!=="deflated")throw new W("GitObjectStoreLoose expects objects to write to be in deflated format");let o=`objects/${n.slice(0,2)}/${n.slice(2)}`,s=`${e}/${o}`;await t.exists(s)||await t.write(s,r)}a(UL,"writeObjectLoose");var dp=null;async function jE(t){return dp===null&&(dp=qL()),dp?HL(t):Ap.deflate(t)}a(jE,"deflate");async function HL(t){let e=new CompressionStream("deflate"),r=new Blob([t]).stream().pipeThrough(e);return new Uint8Array(await new Response(r).arrayBuffer())}a(HL,"browserDeflate");function qL(){try{return new CompressionStream("deflate").writable.close(),new Blob([]).stream().cancel(),!0}catch{return!1}}a(qL,"testCompressionStream");async function it({fs:t,gitdir:e,type:r,object:i,format:n="content",oid:o=void 0,dryRun:s=!1}){return n!=="deflated"&&(n!=="wrapped"&&(i=Kr.wrap({type:r,object:i})),o=await br(i),i=Buffer.from(await jE(i))),s||await UL({fs:t,gitdir:e,object:i,format:"deflated",oid:o}),o}a(it,"_writeObject");function UE(t){let e;for(;~(e=t.indexOf(92));)t[e]=47;return t}a(UE,"posixifyPathBuffer");async function HE({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={},force:o=!1,parallel:s=!0}){try{E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i);let l=new M(t);await Fe.acquire({fs:l,gitdir:r,cache:n},async f=>{let u=await(await be.get({fs:l,gitdir:r})).get("core.autocrlf");return kp({dir:e,gitdir:r,fs:l,filepath:i,index:f,force:o,parallel:s,autocrlf:u})})}catch(l){throw l.caller="git.add",l}}a(HE,"add");async function kp({dir:t,gitdir:e,fs:r,filepath:i,index:n,force:o,parallel:s,autocrlf:l}){i=Array.isArray(i)?i:[i];let f=i.map(async d=>{if(!o&&await Yr.isIgnored({fs:r,dir:t,gitdir:e,filepath:d}))return;let p=await r.lstat(D.join(t,d));if(!p)throw new ce(d);if(p.isDirectory()){let m=await r.readdir(D.join(t,d));if(s){let w=m.map(y=>kp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,y)],index:n,force:o,parallel:s,autocrlf:l}));await Promise.all(w)}else for(let w of m)await kp({dir:t,gitdir:e,fs:r,filepath:[D.join(d,w)],index:n,force:o,parallel:s,autocrlf:l})}else{let m=p.isSymbolicLink()?await r.readlink(D.join(t,d)).then(UE):await r.read(D.join(t,d),{autocrlf:l});if(m===null)throw new ce(d);let w=await it({fs:r,gitdir:e,type:"blob",object:m});n.insert({filepath:d,stats:p,oid:w})}}),c=await Promise.allSettled(f),u=c.filter(d=>d.status==="rejected").map(d=>d.reason);if(u.length>1)throw new Ts(u);if(u.length===1)throw u[0];return c.filter(d=>d.status==="fulfilled"&&d.value).map(d=>d.value)}a(kp,"addToIndex");async function Is({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).get(r)}a(Is,"_getConfig");function qE(t,...e){for(let r of e)if(r)for(let i of Object.keys(r)){let n=r[i];n!==void 0&&(t[i]=n)}return t}a(qE,"assignDefined");async function Jr({fs:t,gitdir:e,author:r,commit:i}){let n=Math.floor(Date.now()/1e3),o={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:n,timezoneOffset:new Date(n*1e3).getTimezoneOffset()},s=qE({},o,i?i.author:void 0,r);if(s.name!==void 0)return s}a(Jr,"normalizeAuthorObject");async function Zn({fs:t,gitdir:e,author:r,committer:i,commit:n}){let o=Math.floor(Date.now()/1e3),s={name:await Is({fs:t,gitdir:e,path:"user.name"}),email:await Is({fs:t,gitdir:e,path:"user.email"})||"",timestamp:o,timezoneOffset:new Date(o*1e3).getTimezoneOffset()},l=qE({},s,n?n.committer:void 0,r,i);if(l.name!==void 0)return l}a(Zn,"normalizeCommitterObject");async function zE({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=ut.from(o).parse().object,zE({fs:t,cache:e,gitdir:r,oid:i});if(n!=="commit")throw new Ze(i,n,"commit");return{commit:rt.from(o),oid:i}}a(zE,"resolveCommit");async function Xn({fs:t,cache:e,gitdir:r,oid:i}){let{commit:n,oid:o}=await zE({fs:t,cache:e,gitdir:r,oid:i});return{oid:o,commit:n.parse(),payload:n.withoutSignature()}}a(Xn,"_readCommit");async function tf({fs:t,cache:e,onSign:r,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p}){let m=!1;h||(h=await B.resolve({fs:t,gitdir:i,ref:"HEAD",depth:2}));let w,y;try{w=await B.resolve({fs:t,gitdir:i,ref:h}),y=await Xn({fs:t,gitdir:i,oid:w,cache:{}})}catch{m=!0}if(f&&m)throw new As(h);let v=f?await Jr({fs:t,gitdir:i,author:o,commit:y.commit}):await Jr({fs:t,gitdir:i,author:o});if(!v)throw new ze("author");let g=f?await Zn({fs:t,gitdir:i,author:v,committer:s,commit:y.commit}):await Zn({fs:t,gitdir:i,author:v,committer:s});if(!g)throw new ze("committer");return Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async function(F){let S=IE(F.entries).get(".");if(p||(p=await WE({fs:t,gitdir:i,inode:S,dryRun:c})),d?d=await Promise.all(d.map(x=>B.resolve({fs:t,gitdir:i,ref:x}))):f?d=y.commit.parent:d=w?[w]:[],!n)if(f)n=y.commit.message;else throw new et("message");let R=rt.from({tree:p,parent:d,author:v,committer:g,message:n});l&&(R=await rt.sign(R,r,l));let b=await it({fs:t,gitdir:i,type:"commit",object:R.toObject(),dryRun:c});return!u&&!c&&await B.writeRef({fs:t,gitdir:i,ref:h,value:b}),b})}a(tf,"_commit");async function WE({fs:t,gitdir:e,inode:r,dryRun:i}){let n=r.children;for(let f of n)f.type==="tree"&&(f.metadata.mode="040000",f.metadata.oid=await WE({fs:t,gitdir:e,inode:f,dryRun:i}));let o=n.map(f=>({mode:f.metadata.mode,path:f.basename,oid:f.metadata.oid,type:f.type})),s=tt.from(o);return await it({fs:t,gitdir:e,type:"tree",object:s.toObject(),dryRun:i})}a(WE,"constructTree");async function Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}){if(n.startsWith("/"))throw new Zr("leading-slash");if(n.endsWith("/"))throw new Zr("trailing-slash");let o=i,s=await Kn({fs:t,cache:e,gitdir:r,oid:i}),l=s.tree;if(n==="")i=s.oid;else{let f=n.split("/");i=await VE({fs:t,cache:e,gitdir:r,tree:l,pathArray:f,oid:o,filepath:n})}return i}a(Ds,"resolveFilepath");async function VE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s}){let l=n.shift();for(let f of i)if(f.path===l){if(n.length===0)return f.oid;{let{type:c,object:u}=await de({fs:t,cache:e,gitdir:r,oid:f.oid});if(c!=="tree")throw new Ze(o,c,"tree",s);return i=tt.from(u),VE({fs:t,cache:e,gitdir:r,tree:i,pathArray:n,oid:o,filepath:s})}}throw new ce(`file or directory found at "${o}:${s}"`)}a(VE,"_resolveFilepath");async function to({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n}));let{tree:o,oid:s}=await Kn({fs:t,cache:e,gitdir:r,oid:i});return{oid:s,tree:o.entries()}}a(to,"_readTree");async function Cs({fs:t,gitdir:e,tree:r}){let i=tt.from(r).toObject();return await it({fs:t,gitdir:e,type:"tree",object:i,format:"content"})}a(Cs,"_writeTree");async function zL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,oid:o,note:s,force:l,author:f,committer:c,signingKey:u}){let h;try{h=await B.resolve({gitdir:i,fs:t,ref:n})}catch(v){if(!(v instanceof ce))throw v}let p=(await to({fs:t,cache:e,gitdir:i,oid:h||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;if(l)p=p.filter(v=>v.path!==o);else for(let v of p)if(v.path===o)throw new Nt("note",o);typeof s=="string"&&(s=Buffer.from(s,"utf8"));let m=await it({fs:t,gitdir:i,type:"blob",object:s,format:"content"});p.push({mode:"100644",path:o,oid:m,type:"blob"});let w=await Cs({fs:t,gitdir:i,tree:p});return await tf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:w,parent:h&&[h],message:`Note added by 'isomorphic-git addNote'
|
|
70
|
+
`,author:f,committer:c,signingKey:u})}a(zL,"_addNote");async function GE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n="refs/notes/commits",oid:o,note:s,force:l,author:f,committer:c,signingKey:u,cache:h={}}){try{E("fs",t),E("gitdir",i),E("oid",o),E("note",s),u&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:f});if(!p)throw new ze("author");let m=await Zn({fs:d,gitdir:i,author:p,committer:c});if(!m)throw new ze("committer");return await zL({fs:new M(d),cache:h,onSign:e,gitdir:i,ref:n,oid:o,note:s,force:l,author:p,committer:m,signingKey:u})}catch(d){throw d.caller="git.addNote",d}}a(GE,"addNote");async function KE({fs:t,gitdir:e,remote:r,url:i,force:n}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let o=await be.get({fs:t,gitdir:e});if(!n&&(await o.getSubsections("remote")).includes(r)&&i!==await o.get(`remote.${r}.url`))throw new Nt("remote",r);await o.set(`remote.${r}.url`,i),await o.set(`remote.${r}.fetch`,`+refs/heads/*:refs/remotes/${r}/*`),await be.save({fs:t,gitdir:e,config:o})}a(KE,"_addRemote");async function ZE({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i,url:n,force:o=!1}){try{return E("fs",t),E("gitdir",r),E("remote",i),E("url",n),await KE({fs:new M(t),gitdir:r,remote:i,url:n,force:o})}catch(s){throw s.caller="git.addRemote",s}}a(ZE,"addRemote");async function WL({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1}){if(n=n.startsWith("refs/tags/")?n:`refs/tags/${n}`,!u&&await B.exists({fs:t,gitdir:i,ref:n}))throw new Nt("tag",n);let h=await B.resolve({fs:t,gitdir:i,ref:f||"HEAD"}),{type:d}=await de({fs:t,cache:e,gitdir:i,oid:h}),p=ut.from({object:h,type:d,tag:n.replace("refs/tags/",""),tagger:o,message:s,gpgsig:l});c&&(p=await ut.sign(p,r,c));let m=await it({fs:t,gitdir:i,type:"tag",object:p.toObject()});await B.writeRef({fs:t,gitdir:i,ref:n,value:m})}a(WL,"_annotatedTag");async function XE({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n,tagger:o,message:s=n,gpgsig:l,object:f,signingKey:c,force:u=!1,cache:h={}}){try{E("fs",t),E("gitdir",i),E("ref",n),c&&E("onSign",e);let d=new M(t),p=await Jr({fs:d,gitdir:i,author:o});if(!p)throw new ze("tagger");return await WL({fs:d,cache:h,onSign:e,gitdir:i,ref:n,tagger:p,message:s,gpgsig:l,object:f,signingKey:c,force:u})}catch(d){throw d.caller="git.annotatedTag",d}}a(XE,"annotatedTag");async function VL({fs:t,gitdir:e,ref:r,object:i,checkout:n=!1,force:o=!1}){if(!ms(r,!0))throw new Bt(r,ps.clean(r));let s=`refs/heads/${r}`;if(!o&&await B.exists({fs:t,gitdir:e,ref:s}))throw new Nt("branch",r,!1);let l;try{l=await B.resolve({fs:t,gitdir:e,ref:i||"HEAD"})}catch{}l&&await B.writeRef({fs:t,gitdir:e,ref:s,value:l}),n&&await B.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(VL,"_branch");async function YE({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,checkout:o=!1,force:s=!1}){try{return E("fs",t),E("gitdir",r),E("ref",i),await VL({fs:new M(t),gitdir:r,ref:i,object:n,checkout:o,force:s})}catch(l){throw l.caller="git.branch",l}}a(YE,"branch");var JE=a((t,e)=>t==="."||e==null||e.length===0||e==="."?!0:e.length>=t.length?e.startsWith(t):t.startsWith(e),"worthWalking");async function Dp({fs:t,cache:e,onProgress:r,onPostCheckout:i,dir:n,gitdir:o,remote:s,ref:l,filepaths:f,noCheckout:c,noUpdateHead:u,dryRun:h,force:d,track:p=!0,nonBlocking:m=!1,batchSize:w=100}){let y;if(i)try{y=await B.resolve({fs:t,gitdir:o,ref:"HEAD"})}catch{y="0000000000000000000000000000000000000000"}let v;try{v=await B.resolve({fs:t,gitdir:o,ref:l})}catch(g){if(l==="HEAD")throw g;let F=`${s}/${l}`;if(v=await B.resolve({fs:t,gitdir:o,ref:F}),p){let O=await be.get({fs:t,gitdir:o});await O.set(`branch.${l}.remote`,s),await O.set(`branch.${l}.merge`,`refs/heads/${l}`),await be.save({fs:t,gitdir:o,config:O})}await B.writeRef({fs:t,gitdir:o,ref:`refs/heads/${l}`,value:v})}if(!c){let g;try{g=await GL({fs:t,cache:e,onProgress:r,dir:n,gitdir:o,ref:l,force:d,filepaths:f})}catch(b){throw b instanceof ce&&b.data.what===v?new _s(l,v):b}let F=g.filter(([b])=>b==="conflict").map(([b,x])=>x);if(F.length>0)throw new vs(F);let O=g.filter(([b])=>b==="error").map(([b,x])=>x);if(O.length>0)throw new W(O.join(", "));if(h){i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"});return}let S=0,R=g.length;if(await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){await Promise.all(g.filter(([x])=>x==="delete"||x==="delete-index").map(async function([x,_]){let P=`${n}/${_}`;x==="delete"&&await t.rm(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}))}),await Fe.acquire({fs:t,gitdir:o,cache:e},async function(b){for(let[x,_]of g)if(x==="rmdir"||x==="rmdir-index"){let P=`${n}/${_}`;try{x==="rmdir"&&await t.rmdir(P),b.delete({filepath:_}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(k){if(k.code==="ENOTEMPTY")console.log(`Did not delete ${_} because directory is not empty`);else throw k}}}),await Promise.all(g.filter(([b])=>b==="mkdir"||b==="mkdir-index").map(async function([b,x]){let _=`${n}/${x}`;await t.mkdir(_),r&&await r({phase:"Updating workdir",loaded:++S,total:R})})),m){let b=g.filter(([_])=>_==="create"||_==="create-index"||_==="update"||_==="mkdir-index"),x=await bE("Update Working Dir",b.map(([_,P,k,C,N])=>()=>ZL({fs:t,cache:e,gitdir:o,dir:n},[_,P,k,C,N])),r,w);await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(_){await bE("Update Index",x.map(([P,k,C])=>()=>KL({index:_,fullpath:P,oid:k,stats:C})),r,w)})}else await Fe.acquire({fs:t,gitdir:o,cache:e,allowUnmerged:!0},async function(b){await Promise.all(g.filter(([x])=>x==="create"||x==="create-index"||x==="update"||x==="mkdir-index").map(async function([x,_,P,k,C]){let N=`${n}/${_}`;try{if(x!=="create-index"&&x!=="mkdir-index"){let{object:Z}=await de({fs:t,cache:e,gitdir:o,oid:P});if(C&&await t.rm(N),k===33188)await t.write(N,Z);else if(k===33261)await t.write(N,Z,{mode:511});else if(k===40960)await t.writelink(N,Z);else throw new W(`Invalid mode 0o${k.toString(8)} detected in blob ${P}`)}let U=await t.lstat(N);k===33261&&(U.mode=493),x==="mkdir-index"&&(U.mode=57344),b.insert({filepath:_,stats:U,oid:P}),r&&await r({phase:"Updating workdir",loaded:++S,total:R})}catch(U){console.log(U)}}))});i&&await i({previousHead:y,newHead:v,type:f!=null&&f.length>0?"file":"branch"})}if(!u){let g=await B.expand({fs:t,gitdir:o,ref:l});g.startsWith("refs/heads")?await B.writeSymbolicRef({fs:t,gitdir:o,ref:"HEAD",value:g}):await B.writeRef({fs:t,gitdir:o,ref:"HEAD",value:v})}}a(Dp,"_checkout");async function GL({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,ref:o,force:s,filepaths:l}){let f=0;return Xr({fs:t,cache:e,dir:i,gitdir:n,trees:[ft({ref:o}),eo(),Di()],map:a(async function(c,[u,h,d]){if(c===".")return;if(l&&!l.some(m=>JE(c,m)))return null;switch(r&&await r({phase:"Analyzing workdir",loaded:++f}),[!!d,!!u,!!h].map(Number).join("")){case"000":return;case"001":return s&&l&&l.includes(c)?["delete",c]:void 0;case"010":switch(await u.type()){case"tree":return["mkdir",c];case"blob":return["create",c,await u.oid(),await u.mode()];case"commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`new entry Unhandled type ${await u.type()}`]}case"011":switch(`${await u.type()}-${await h.type()}`){case"tree-tree":return;case"tree-blob":case"blob-tree":return["conflict",c];case"blob-blob":return await u.oid()!==await h.oid()?s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]:await u.mode()!==await h.mode()?s?["update",c,await u.oid(),await u.mode(),!0]:["conflict",c]:["create-index",c,await u.oid(),await u.mode()];case"commit-tree":return;case"commit-blob":return["conflict",c];default:return["error",`new entry Unhandled type ${u.type}`]}case"100":return["delete-index",c];case"101":switch(await d.type()){case"tree":return["rmdir-index",c];case"blob":return await d.oid()!==await h.oid()?s?["delete",c]:["conflict",c]:["delete",c];case"commit":return["rmdir-index",c];default:return["error",`delete entry Unhandled type ${await d.type()}`]}case"110":case"111":switch(`${await d.type()}-${await u.type()}`){case"tree-tree":return;case"blob-blob":{if(await d.oid()===await u.oid()&&await d.mode()===await u.mode()&&!s)return;if(h){if(await h.oid()!==await d.oid()&&await h.oid()!==await u.oid())return s?["update",c,await u.oid(),await u.mode(),await u.mode()!==await h.mode()]:["conflict",c]}else if(s)return["update",c,await u.oid(),await u.mode(),await u.mode()!==await d.mode()];return await u.mode()!==await d.mode()?["update",c,await u.oid(),await u.mode(),!0]:await u.oid()!==await d.oid()?["update",c,await u.oid(),await u.mode(),!1]:void 0}case"tree-blob":return["update-dir-to-blob",c,await u.oid()];case"blob-tree":return["update-blob-to-tree",c];case"commit-commit":return["mkdir-index",c,await u.oid(),await u.mode()];default:return["error",`update entry Unhandled type ${await d.type()}-${await u.type()}`]}}},"map"),reduce:a(async function(c,u){return u=$E(u),c?c&&c[0]==="rmdir"?(u.push(c),u):(u.unshift(c),u):u},"reduce")})}a(GL,"analyze");async function KL({index:t,fullpath:e,stats:r,oid:i}){try{t.insert({filepath:e,stats:r,oid:i})}catch(n){console.warn(`Error inserting ${e} into index:`,n)}}a(KL,"updateIndex");async function ZL({fs:t,cache:e,gitdir:r,dir:i},[n,o,s,l,f]){let c=`${i}/${o}`;if(n!=="create-index"&&n!=="mkdir-index"){let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:s});if(f&&await t.rm(c),l===33188)await t.write(c,h);else if(l===33261)await t.write(c,h,{mode:511});else if(l===40960)await t.writelink(c,h);else throw new W(`Invalid mode 0o${l.toString(8)} detected in blob ${s}`)}let u=await t.lstat(c);return l===33261&&(u.mode=493),n==="mkdir-index"&&(u.mode=57344),[o,s,u]}a(ZL,"updateWorkingDir");async function bE(t,e,r,i){let n=[];try{for(let o=0;o<e.length;o+=i){let s=e.slice(o,o+i).map(f=>f());(await Promise.allSettled(s)).forEach(f=>{f.status==="fulfilled"&&n.push(f.value)}),r&&await r({phase:"Updating workdir",loaded:o+s.length,total:e.length})}return n}catch(o){console.error(`Error during ${t}: ${o}`)}return n}a(bE,"batchAllSettled");async function Cp({fs:t,onProgress:e,onPostCheckout:r,dir:i,gitdir:n=D.join(i,".git"),remote:o="origin",ref:s,filepaths:l,noCheckout:f=!1,noUpdateHead:c=s===void 0,dryRun:u=!1,force:h=!1,track:d=!0,cache:p={},nonBlocking:m=!1,batchSize:w=100}){try{E("fs",t),E("dir",i),E("gitdir",n);let y=s||"HEAD";return await Dp({fs:new M(t),cache:p,onProgress:e,onPostCheckout:r,dir:i,gitdir:n,remote:o,ref:y,filepaths:l,noCheckout:f,noUpdateHead:c,dryRun:u,force:h,track:d,nonBlocking:m,batchSize:w})}catch(y){throw y.caller="git.checkout",y}}a(Cp,"checkout");var XL=new RegExp("^refs/(heads/|tags/|remotes/)?(.*)");function ki(t){let e=XL.exec(t);return e?e[1]==="remotes/"&&t.endsWith("/HEAD")?e[2].slice(0,-5):e[2]:t}a(ki,"abbreviateRef");async function Qr({fs:t,gitdir:e,fullname:r=!1,test:i=!1}){let n=await B.resolve({fs:t,gitdir:e,ref:"HEAD",depth:2});if(i)try{await B.resolve({fs:t,gitdir:e,ref:n})}catch{return}if(n.startsWith("refs/"))return r?n:ki(n)}a(Qr,"_currentBranch");function YL(t){return t=t.replace(/^git@([^:]+):/,"https://$1/"),t=t.replace(/^ssh:\/\//,"https://"),t}a(YL,"translateSSHtoHTTP");function QE({username:t="",password:e=""}){return`Basic ${Buffer.from(`${t}:${e}`).toString("base64")}`}a(QE,"calculateBasicAuthHeader");async function Ns(t,e){let r=NE(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(Ns,"forAwait");async function uc(t){let e=0,r=[];await Ns(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(uc,"collect");function vE(t){let e=t.match(/^https?:\/\/([^/]+)@/);if(e==null)return{url:t,auth:{}};e=e[1];let[r,i]=e.split(":");return t=t.replace(`${e}@`,""),{url:t,auth:{username:r,password:i}}}a(vE,"extractAuthFromUrl");function Pp(t,e){let r=e.toString(16);return"0".repeat(t-r.length)+r}a(Pp,"padHex");var Zp=class Zp{static flush(){return Buffer.from("0000","utf8")}static delim(){return Buffer.from("0001","utf8")}static encode(e){typeof e=="string"&&(e=Buffer.from(e));let r=e.length+4,i=Pp(4,r);return Buffer.concat([Buffer.from(i,"utf8"),e])}static streamReader(e){let r=new lc(e);return a(async function(){try{let n=await r.read(4);if(n==null)return!0;if(n=parseInt(n.toString("utf8"),16),n===0||n===1)return null;let o=await r.read(n-4);return o??!0}catch(n){return e.error=n,!0}},"read")}};a(Zp,"GitPktLine");var we=Zp;async function _E(t){let e={},r;for(;r=await t(),r!==!0;){if(r===null)continue;r=r.toString("utf8").replace(/\n$/,"");let i=r.indexOf("=");if(i>-1){let n=r.slice(0,i),o=r.slice(i+1);e[n]=o}else e[r]=!0}return{protocolVersion:2,capabilities2:e}}a(_E,"parseCapabilitiesV2");async function FE(t,{service:e}){let r=new Set,i=new Map,n=new Map,o=we.streamReader(t),s=await o();for(;s===null;)s=await o();if(s===!0)throw new Fs;if(s.includes("version 2"))return _E(o);if(s.toString("utf8").replace(/\n$/,"")!==`# service=${e}`)throw new Pi(`# service=${e}\\n`,s.toString("utf8"));let l=await o();for(;l===null;)l=await o();if(l===!0)return{capabilities:r,refs:i,symrefs:n};if(l=l.toString("utf8"),l.includes("version 2"))return _E(o);let[f,c]=pp(l,"\0","\\x00");if(c.split(" ").map(u=>r.add(u)),f!=="0000000000000000000000000000000000000000 capabilities^{}"){let[u,h]=pp(f," "," ");for(i.set(h,u);;){let d=await o();if(d===!0)break;if(d!==null){let[p,m]=pp(d.toString("utf8")," "," ");i.set(m,p)}}}for(let u of r)if(u.startsWith("symref=")){let h=u.match(/symref=([^:]+):(.*)/);h.length===3&&n.set(h[1],h[2])}return{protocolVersion:1,capabilities:r,refs:i,symrefs:n}}a(FE,"parseRefsAdResponse");function pp(t,e,r){let i=t.trim().split(e);if(i.length!==2)throw new Pi(`Two strings separated by '${r}'`,t.toString("utf8"));return i}a(pp,"splitAndAssert");var EE=a((t,e)=>t.endsWith("?")?`${t}${e}`:`${t}/${e.replace(/^https?:\/\//,"")}`,"corsProxify"),SE=a((t,e)=>{(e.username||e.password)&&(t.Authorization=QE(e)),e.headers&&Object.assign(t,e.headers)},"updateHeaders"),mp=a(async t=>{try{let e=Buffer.from(await uc(t.body)),r=e.toString("utf8");return{preview:r.length<256?r:r.slice(0,256)+"...",response:r,data:e}}catch{return{}}},"stringifyBody"),Xp=class Xp{static async capabilities(){return["discover","connect"]}static async discover({http:e,onProgress:r,onAuth:i,onAuthSuccess:n,onAuthFailure:o,corsProxy:s,service:l,url:f,headers:c,protocolVersion:u}){let{url:h,auth:d}=vE(f),p=s?EE(s,h):h;(d.username||d.password)&&(c.Authorization=QE(d)),u===2&&(c["Git-Protocol"]="version=2");let m,w,y=!1;do if(m=await e.request({onProgress:r,method:"GET",url:`${p}/info/refs?service=${l}`,headers:c}),w=!1,m.statusCode===401||m.statusCode===203){let v=y?o:i;if(v){if(d=await v(h,{...d,headers:{...c}}),d&&d.cancel)throw new Gn;d&&(SE(c,d),y=!0,w=!0)}}else m.statusCode===200&&y&&n&&await n(h,d);while(w);if(m.statusCode!==200){let{response:v}=await mp(m);throw new qn(m.statusCode,m.statusMessage,v)}if(m.headers["content-type"]===`application/x-${l}-advertisement`){let v=await FE(m.body,{service:l});return v.auth=d,v}else{let{preview:v,response:g,data:F}=await mp(m);try{let O=await FE([F],{service:l});return O.auth=d,O}catch{throw new Os(v,g)}}}static async connect({http:e,onProgress:r,corsProxy:i,service:n,url:o,auth:s,body:l,headers:f}){let c=vE(o);c&&(o=c.url),i&&(o=EE(i,o)),f["content-type"]=`application/x-${n}-request`,f.accept=`application/x-${n}-result`,SE(f,s);let u=await e.request({onProgress:r,method:"POST",url:`${o}/${n}`,body:l,headers:f});if(u.statusCode!==200){let{response:h}=mp(u);throw new qn(u.statusCode,u.statusMessage,h)}return u}};a(Xp,"GitRemoteHTTP");var Yn=Xp,Yp=class Yp{static getRemoteHelperFor({url:e}){let r=new Map;r.set("http",Yn),r.set("https",Yn);let i=JL({url:e});if(!i)throw new ks(e);if(r.has(i.transport))return r.get(i.transport);throw new Rs(e,i.transport,i.transport==="ssh"?YL(e):void 0)}};a(Yp,"GitRemoteManager");var Jn=Yp;function JL({url:t}){if(t.startsWith("git@"))return{transport:"ssh",address:t};let e=t.match(/(\w+)(:\/\/|::)(.*)/);if(e!==null){if(e[2]==="://")return{transport:e[1],address:e[0]};if(e[2]==="::")return{transport:e[1],address:e[3]}}}a(JL,"parseRemoteUrl");var Ri=null,Jp=class Jp{static async read({fs:e,gitdir:r}){Ri===null&&(Ri=new ds);let i=D.join(r,"shallow"),n=new Set;return await Ri.acquire(i,async function(){let o=await e.read(i,{encoding:"utf8"});if(o===null||o.trim()==="")return n;o.trim().split(`
|
|
71
71
|
`).map(s=>n.add(s))}),n}static async write({fs:e,gitdir:r,oids:i}){Ri===null&&(Ri=new ds);let n=D.join(r,"shallow");if(i.size>0){let o=[...i].join(`
|
|
72
72
|
`)+`
|
|
73
|
-
`;await Ri.acquire(n,async function(){await e.write(n,o,{encoding:"utf8"})})}else await Ri.acquire(n,async function(){await e.rm(n)})}};a(
|
|
74
|
-
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}a(
|
|
73
|
+
`;await Ri.acquire(n,async function(){await e.write(n,o,{encoding:"utf8"})})}else await Ri.acquire(n,async function(){await e.rm(n)})}};a(Jp,"GitShallowManager");var Ai=Jp;async function QL({fs:t,gitdir:e,oid:r}){let i=`objects/${r.slice(0,2)}/${r.slice(2)}`;return t.exists(`${e}/${i}`)}a(QL,"hasObjectLoose");async function e$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=await t.readdir(D.join(r,"objects/pack"));o=o.filter(s=>s.endsWith(".idx"));for(let s of o){let l=`${r}/objects/pack/${s}`,f=await Ip({fs:t,cache:e,filename:l,getExternalRefDelta:n});if(f.error)throw new W(f.error);if(f.offsets.has(i))return!0}return!1}a(e$,"hasObjectPacked");async function xE({fs:t,cache:e,gitdir:r,oid:i,format:n="content"}){let o=a(l=>de({fs:t,cache:e,gitdir:r,oid:l}),"getExternalRefDelta"),s=await QL({fs:t,gitdir:r,oid:i});return s||(s=await e$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:o})),s}a(xE,"hasObject");function t$(t){let n="5041434b"+"00000002"+"00000000";return t.slice(0,12).toString("hex")===n}a(t$,"emptyPackfile");function eS(t,e){let r=t.map(i=>i.split("=",1)[0]);return e.filter(i=>{let n=i.split("=",1)[0];return r.includes(n)})}a(eS,"filterCapabilities");var rf={name:"isomorphic-git",version:"1.34.0",agent:"git/isomorphic-git@1.34.0"},Qp=class Qp{constructor(){this._queue=[]}write(e){if(this._ended)throw Error("You cannot write to a FIFO that has already been ended!");if(this._waiting){let r=this._waiting;this._waiting=null,r({value:e})}else this._queue.push(e)}end(){if(this._ended=!0,this._waiting){let e=this._waiting;this._waiting=null,e({done:!0})}}destroy(e){this.error=e,this.end()}async next(){if(this._queue.length>0)return{value:this._queue.shift()};if(this._ended)return{done:!0};if(this._waiting)throw Error("You cannot call read until the previous call to read has returned!");return new Promise(e=>{this._waiting=e})}};a(Qp,"FIFO");var Mn=Qp;function r$(t){let e=t.indexOf("\r"),r=t.indexOf(`
|
|
74
|
+
`);return e===-1&&r===-1?-1:e===-1?r+1:r===-1?e+1:r===e+1?r+1:Math.min(e,r)+1}a(r$,"findSplit");function tS(t){let e=new Mn,r="";return(async()=>(await Ns(t,i=>{for(i=i.toString("utf8"),r+=i;;){let n=r$(r);if(n===-1)break;e.write(r.slice(0,n)),r=r.slice(n)}}),r.length>0&&e.write(r),e.end()))(),e}a(tS,"splitLines");var em=class em{static demux(e){let r=we.streamReader(e),i=new Mn,n=new Mn,o=new Mn,s=a(async function(){let l=await r();if(l===null)return s();if(l===!0){i.end(),o.end(),e.error?n.destroy(e.error):n.end();return}switch(l[0]){case 1:{n.write(l.slice(1));break}case 2:{o.write(l.slice(1));break}case 3:{let f=l.slice(1);o.write(f),i.end(),o.end(),n.destroy(new Error(f.toString("utf8")));return}default:i.write(l)}s()},"nextBit");return s(),{packetlines:i,packfile:n,progress:o}}};a(em,"GitSideBand");var hc=em;async function i$(t){let{packetlines:e,packfile:r,progress:i}=hc.demux(t),n=[],o=[],s=[],l=!1,f=!1;return new Promise((c,u)=>{Ns(e,h=>{let d=h.toString("utf8").trim();if(d.startsWith("shallow")){let p=d.slice(-41).trim();p.length!==40&&u(new Gr(p)),n.push(p)}else if(d.startsWith("unshallow")){let p=d.slice(-41).trim();p.length!==40&&u(new Gr(p)),o.push(p)}else if(d.startsWith("ACK")){let[,p,m]=d.split(" ");s.push({oid:p,status:m}),m||(f=!0)}else d.startsWith("NAK")?(l=!0,f=!0):(f=!0,l=!0);f&&(t.error?u(t.error):c({shallows:n,unshallows:o,acks:s,nak:l,packfile:r,progress:i}))}).finally(()=>{f||(t.error?u(t.error):c({shallows:n,unshallows:o,acks:s,nak:l,packfile:r,progress:i}))})})}a(i$,"parseUploadPackResponse");function n$({capabilities:t=[],wants:e=[],haves:r=[],shallows:i=[],depth:n=null,since:o=null,exclude:s=[]}){let l=[];e=[...new Set(e)];let f=` ${t.join(" ")}`;for(let c of e)l.push(we.encode(`want ${c}${f}
|
|
75
75
|
`)),f="";for(let c of i)l.push(we.encode(`shallow ${c}
|
|
76
76
|
`));n!==null&&l.push(we.encode(`deepen ${n}
|
|
77
77
|
`)),o!==null&&l.push(we.encode(`deepen-since ${Math.floor(o.valueOf()/1e3)}
|
|
78
78
|
`));for(let c of s)l.push(we.encode(`deepen-not ${c}
|
|
79
79
|
`));l.push(we.flush());for(let c of r)l.push(we.encode(`have ${c}
|
|
80
80
|
`));return l.push(we.encode(`done
|
|
81
|
-
`)),l}a(
|
|
81
|
+
`)),l}a(n$,"writeUploadPackRequest");async function Np({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:f,ref:c,remoteRef:u,remote:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:F=!1,headers:O={},prune:S=!1,pruneTags:R=!1}){let b=c||await Qr({fs:t,gitdir:f,test:!0}),x=await be.get({fs:t,gitdir:f}),_=h||b&&await x.get(`branch.${b}.remote`)||"origin",P=d||await x.get(`remote.${_}.url`);if(typeof P>"u")throw new et("remote OR url");let k=u||b&&await x.get(`branch.${b}.merge`)||c||"HEAD";p===void 0&&(p=await x.get("http.corsProxy"));let C=Jn.getRemoteHelperFor({url:P}),N=await C.discover({http:r,onAuth:o,onAuthSuccess:s,onAuthFailure:l,corsProxy:p,service:"git-upload-pack",url:P,headers:O,protocolVersion:1}),U=N.auth,Z=N.refs;if(Z.size===0)return{defaultBranch:null,fetchHead:null,fetchHeadDescription:null};if(m!==null&&!N.capabilities.has("shallow"))throw new Vr("shallow","depth");if(w!==null&&!N.capabilities.has("deepen-since"))throw new Vr("deepen-since","since");if(y.length>0&&!N.capabilities.has("deepen-not"))throw new Vr("deepen-not","exclude");if(v===!0&&!N.capabilities.has("deepen-relative"))throw new Vr("deepen-relative","relative");let{oid:me,fullref:Ee}=B.resolveAgainstMap({ref:k,map:Z});for(let Y of Z.keys())Y===Ee||Y==="HEAD"||Y.startsWith("refs/heads/")||g&&Y.startsWith("refs/tags/")||Z.delete(Y);let $=eS([...N.capabilities],["multi_ack_detailed","no-done","side-band-64k","ofs-delta",`agent=${rf.agent}`]);v&&$.push("deepen-relative");let q=F?[me]:Z.values(),G=F?[b]:await B.listRefs({fs:t,gitdir:f,filepath:"refs"}),X=[];for(let Y of G)try{Y=await B.expand({fs:t,gitdir:f,ref:Y});let he=await B.resolve({fs:t,gitdir:f,ref:Y});await xE({fs:t,cache:e,gitdir:f,oid:he})&&X.push(he)}catch{}X=[...new Set(X)];let z=await Ai.read({fs:t,gitdir:f}),fe=N.capabilities.has("shallow")?[...z]:[],ee=n$({capabilities:$,wants:q,haves:X,shallows:fe,depth:m,since:w,exclude:y}),Oe=Buffer.from(await uc(ee)),Re=await C.connect({http:r,onProgress:i,corsProxy:p,service:"git-upload-pack",url:P,auth:U,body:[Oe],headers:O}),se=await i$(Re.body);Re.headers&&(se.headers=Re.headers);for(let Y of se.shallows)if(!z.has(Y))try{let{object:he}=await de({fs:t,cache:e,gitdir:f,oid:Y}),je=new rt(he),$t=await Promise.all(je.headers().parent.map(ao=>xE({fs:t,cache:e,gitdir:f,oid:ao})));$t.length===0||$t.every(ao=>ao)||z.add(Y)}catch{z.add(Y)}for(let Y of se.unshallows)z.delete(Y);if(await Ai.write({fs:t,gitdir:f,oids:z}),F){let Y=new Map([[Ee,me]]),he=new Map,je=10,$t=Ee;for(;je--;){let Ef=N.symrefs.get($t);if(Ef===void 0)break;he.set($t,Ef),$t=Ef}let Ff=Z.get($t);Ff&&Y.set($t,Ff);let{pruned:ao}=await B.updateRemoteRefs({fs:t,gitdir:f,remote:_,refs:Y,symrefs:he,tags:g,prune:S});S&&(se.pruned=ao)}else{let{pruned:Y}=await B.updateRemoteRefs({fs:t,gitdir:f,remote:_,refs:Z,symrefs:N.symrefs,tags:g,prune:S,pruneTags:R});S&&(se.pruned=Y)}if(se.HEAD=N.symrefs.get("HEAD"),se.HEAD===void 0){let{oid:Y}=B.resolveAgainstMap({ref:"HEAD",map:Z});for(let[he,je]of Z.entries())if(he!=="HEAD"&&je===Y){se.HEAD=he;break}}let Rt=Ee.startsWith("refs/tags")?"tag":"branch";if(se.FETCH_HEAD={oid:me,description:`${Rt} '${ki(Ee)}' of ${P}`},i||n){let Y=tS(se.progress);Ns(Y,async he=>{if(n&&await n(he),i){let je=he.match(/([^:]*).*\((\d+?)\/(\d+?)\)/);je&&await i({phase:je[1].trim(),loaded:parseInt(je[2],10),total:parseInt(je[3],10)})}})}let ve=Buffer.from(await uc(se.packfile));if(Re.body.error)throw Re.body.error;let Ve=ve.slice(-20).toString("hex"),Be={defaultBranch:se.HEAD,fetchHead:se.FETCH_HEAD.oid,fetchHeadDescription:se.FETCH_HEAD.description};if(se.headers&&(Be.headers=se.headers),S&&(Be.pruned=se.pruned),Ve!==""&&!t$(ve)){Be.packfile=`objects/pack/pack-${Ve}.pack`;let Y=D.join(f,Be.packfile);await t.write(Y,ve);let he=a($t=>de({fs:t,cache:e,gitdir:f,oid:$t}),"getExternalRefDelta"),je=await gs.fromPack({pack:ve,getExternalRefDelta:he,onProgress:i});await t.write(Y.replace(/\.pack$/,".idx"),await je.toBuffer())}return Be}a(Np,"_fetch");async function rS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:D.join(r,".git"),defaultBranch:n="master"}){if(await t.exists(i+"/config"))return;let o=["hooks","info","objects/info","objects/pack","refs/heads","refs/tags"];o=o.map(s=>i+"/"+s);for(let s of o)await t.mkdir(s);await t.write(i+"/config",`[core]
|
|
82
82
|
repositoryformatversion = 0
|
|
83
83
|
filemode = false
|
|
84
84
|
bare = ${e}
|
|
@@ -86,24 +86,24 @@ gpgsig`+up(s)+`
|
|
|
86
86
|
`)+` symlinks = false
|
|
87
87
|
ignorecase = true
|
|
88
88
|
`),await t.write(i+"/HEAD",`ref: refs/heads/${n}
|
|
89
|
-
`)}a(
|
|
89
|
+
`)}a(rS,"_init");async function o$({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,onPostCheckout:f,dir:c,gitdir:u,url:h,corsProxy:d,ref:p,remote:m,depth:w,since:y,exclude:v,relative:g,singleBranch:F,noCheckout:O,noTags:S,headers:R,nonBlocking:b,batchSize:x=100}){try{if(await rS({fs:t,gitdir:u}),await KE({fs:t,gitdir:u,remote:m,url:h,force:!1}),d){let k=await be.get({fs:t,gitdir:u});await k.set("http.corsProxy",d),await be.save({fs:t,gitdir:u,config:k})}let{defaultBranch:_,fetchHead:P}=await Np({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:u,ref:p,remote:m,corsProxy:d,depth:w,since:y,exclude:v,relative:g,singleBranch:F,headers:R,tags:!S});if(P===null)return;p=p||_,p=p.replace("refs/heads/",""),await Dp({fs:t,cache:e,onProgress:i,onPostCheckout:f,dir:c,gitdir:u,ref:p,remote:m,noCheckout:O,nonBlocking:b,batchSize:x})}catch(_){throw await t.rmdir(u,{recursive:!0,maxRetries:10}).catch(()=>{}),_}}a(o$,"_clone");async function iS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:l,dir:f,gitdir:c=D.join(f,".git"),url:u,corsProxy:h=void 0,ref:d=void 0,remote:p="origin",depth:m=void 0,since:w=void 0,exclude:y=[],relative:v=!1,singleBranch:g=!1,noCheckout:F=!1,noTags:O=!1,headers:S={},cache:R={},nonBlocking:b=!1,batchSize:x=100}){try{return E("fs",t),E("http",e),E("gitdir",c),F||E("dir",f),E("url",u),await o$({fs:new M(t),cache:R,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPostCheckout:l,dir:f,gitdir:c,url:u,corsProxy:h,ref:d,remote:p,depth:m,since:w,exclude:y,relative:v,singleBranch:g,noCheckout:F,noTags:O,headers:S,nonBlocking:b,batchSize:x})}catch(_){throw _.caller="git.clone",_}}a(iS,"clone");async function nS({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),message:n,author:o,committer:s,signingKey:l,amend:f=!1,dryRun:c=!1,noUpdateBranch:u=!1,ref:h,parent:d,tree:p,cache:m={}}){try{E("fs",t),f||E("message",n),l&&E("onSign",e);let w=new M(t);return await tf({fs:w,cache:m,onSign:e,gitdir:i,message:n,author:o,committer:s,signingKey:l,amend:f,dryRun:c,noUpdateBranch:u,ref:h,parent:d,tree:p})}catch(w){throw w.caller="git.commit",w}}a(nS,"commit");async function oS({fs:t,dir:e,gitdir:r=D.join(e,".git"),fullname:i=!1,test:n=!1}){try{return E("fs",t),E("gitdir",r),await Qr({fs:new M(t),gitdir:r,fullname:i,test:n})}catch(o){throw o.caller="git.currentBranch",o}}a(oS,"currentBranch");async function s$({fs:t,gitdir:e,ref:r}){if(r=r.startsWith("refs/heads/")?r:`refs/heads/${r}`,!await B.exists({fs:t,gitdir:e,ref:r}))throw new ce(r);let n=await B.expand({fs:t,gitdir:e,ref:r}),o=await Qr({fs:t,gitdir:e,fullname:!0});if(n===o){let f=await B.resolve({fs:t,gitdir:e,ref:n});await B.writeRef({fs:t,gitdir:e,ref:"HEAD",value:f})}await B.deleteRef({fs:t,gitdir:e,ref:n});let s=ki(r),l=await be.get({fs:t,gitdir:e});await l.deleteSection("branch",s),await be.save({fs:t,gitdir:e,config:l})}a(s$,"_deleteBranch");async function sS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i}){try{return E("fs",t),E("ref",i),await s$({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteBranch",n}}a(sS,"deleteBranch");async function aS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i}){try{E("fs",t),E("ref",i),await B.deleteRef({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteRef",n}}a(aS,"deleteRef");async function a$({fs:t,gitdir:e,remote:r}){let i=await be.get({fs:t,gitdir:e});await i.deleteSection("remote",r),await be.save({fs:t,gitdir:e,config:i})}a(a$,"_deleteRemote");async function lS({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i}){try{return E("fs",t),E("remote",i),await a$({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.deleteRemote",n}}a(lS,"deleteRemote");async function l$({fs:t,gitdir:e,ref:r}){r=r.startsWith("refs/tags/")?r:`refs/tags/${r}`,await B.deleteRef({fs:t,gitdir:e,ref:r})}a(l$,"_deleteTag");async function cS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i}){try{return E("fs",t),E("ref",i),await l$({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.deleteTag",n}}a(cS,"deleteTag");async function c$({fs:t,gitdir:e,oid:r}){let i=r.slice(0,2);return(await t.readdir(`${e}/objects/${i}`)).map(o=>`${i}${o}`).filter(o=>o.startsWith(r))}a(c$,"expandOidLoose");async function f$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n}){let o=[],s=await t.readdir(D.join(r,"objects/pack"));s=s.filter(l=>l.endsWith(".idx"));for(let l of s){let f=`${r}/objects/pack/${l}`,c=await Ip({fs:t,cache:e,filename:f,getExternalRefDelta:n});if(c.error)throw new W(c.error);for(let u of c.offsets.keys())u.startsWith(i)&&o.push(u)}return o}a(f$,"expandOidPacked");async function u$({fs:t,cache:e,gitdir:r,oid:i}){let n=a(l=>de({fs:t,cache:e,gitdir:r,oid:l}),"getExternalRefDelta"),o=await c$({fs:t,gitdir:r,oid:i}),s=await f$({fs:t,cache:e,gitdir:r,oid:i,getExternalRefDelta:n});for(let l of s)o.indexOf(l)===-1&&o.push(l);if(o.length===1)return o[0];throw o.length>1?new bs("oids",i,o):new ce(`an object matching "${i}"`)}a(u$,"_expandOid");async function fS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),await u$({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.expandOid",o}}a(fS,"expandOid");async function uS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i}){try{return E("fs",t),E("gitdir",r),E("ref",i),await B.expand({fs:new M(t),gitdir:r,ref:i})}catch(n){throw n.caller="git.expandRef",n}}a(uS,"expandRef");async function Bp({fs:t,cache:e,gitdir:r,oids:i}){let n={},o=i.length,s=i.map((l,f)=>({index:f,oid:l}));for(;s.length;){let l=new Set;for(let{oid:c,index:u}of s)n[c]||(n[c]=new Set),n[c].add(u),n[c].size===o&&l.add(c);if(l.size>0)return[...l];let f=new Map;for(let{oid:c,index:u}of s)try{let{object:h}=await de({fs:t,cache:e,gitdir:r,oid:c}),d=rt.from(h),{parent:p}=d.parseHeaders();for(let m of p)(!n[m]||!n[m].has(u))&&f.set(m+":"+u,{oid:m,index:u})}catch{}s=Array.from(f.values())}return[]}a(Bp,"_findMergeBase");var wp=/^.*(\r?\n|$)/gm;function h$({branches:t,contents:e}){let r=t[1],i=t[2],n=e[0],o=e[1],s=e[2],l=o.match(wp),f=n.match(wp),c=s.match(wp),u=GB(l,f,c),h=7,d="",p=!0;for(let m of u)m.ok&&(d+=m.ok.join("")),m.conflict&&(p=!1,d+=`${"<".repeat(h)} ${r}
|
|
90
90
|
`,d+=m.conflict.a.join(""),d+=`${"=".repeat(h)}
|
|
91
91
|
`,d+=m.conflict.b.join(""),d+=`${">".repeat(h)} ${i}
|
|
92
|
-
`);return{cleanMerge:p,mergedText:d}}a(u$,"mergeFile");async function h$({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),index:n,ourOid:o,baseOid:s,theirOid:l,ourName:f="ours",baseName:c="base",theirName:u="theirs",dryRun:h=!1,abortOnConflict:d=!0,mergeDriver:p}){let m=ft({ref:o}),w=ft({ref:s}),y=ft({ref:l}),v=[],g=[],F=[],O=[],S=await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[m,w,y],map:a(async function(R,[b,x,_]){let P=oc(R),k=await fc(b,x),C=await fc(_,x);switch(`${k}-${C}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await b.type()==="tree"?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!b&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:b?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:void 0;case"true-true":{if(b&&_&&await b.type()==="tree"&&await _.type()==="tree")return{mode:await b.mode(),path:P,oid:await b.oid(),type:"tree"};if(b&&_&&await b.type()==="blob"&&await _.type()==="blob")return d$({fs:t,gitdir:i,path:P,ours:b,base:x,theirs:_,ourName:f,baseName:c,theirName:u,mergeDriver:p}).then(async N=>{if(N.cleanMerge)d||n.insert({filepath:R,oid:N.mergeResult.oid,stage:0});else if(v.push(R),g.push(R),!d){let U="";x&&await x.type()==="blob"&&(U=await x.oid());let Z=await b.oid(),me=await _.oid();n.delete({filepath:R}),U&&n.insert({filepath:R,oid:U,stage:1}),n.insert({filepath:R,oid:Z,stage:2}),n.insert({filepath:R,oid:me,stage:3})}return N.mergeResult});if(x&&!b&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(v.push(R),F.push(R),!d){let N=await x.oid(),U=await _.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&b&&!_&&await x.type()==="blob"&&await b.type()==="blob"){if(v.push(R),O.push(R),!d){let N=await x.oid(),U=await b.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:2})}return{mode:await b.mode(),oid:await b.oid(),type:"blob",path:P}}if(x&&!b&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new qn}}},"map"),reduce:v.length!==0&&(!r||d)?void 0:async(R,b)=>{let x=b.filter(Boolean);if(R&&!(R&&R.type==="tree"&&x.length===0&&R.path!==".")){if(x.length>0||R.path==="."&&x.length===0){let P=new tt(x).toObject(),k=await it({fs:t,gitdir:i,type:"tree",object:P,dryRun:h});R.oid=k}return R}}});return v.length!==0?(r&&!d&&await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[ft({ref:S.oid})],map:a(async function(R,[b]){let x=`${r}/${R}`;if(await b.type()==="blob"){let _=await b.mode(),P=new TextDecoder().decode(await b.content());await t.write(x,P,{mode:_})}return!0},"map")}),new zn(v,g,F,O)):S.oid}a(h$,"mergeTree");async function d$({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:o,ourName:s,theirName:l,baseName:f,dryRun:c,mergeDriver:u=u$}){let h="blob",d="100755",p="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),p=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let w=d===await i.mode()?await o.mode():await i.mode();if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};if(await i.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await o.oid(),type:h}};if(await o.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};let y=Buffer.from(await i.content()).toString("utf8"),v=Buffer.from(await o.content()).toString("utf8"),{mergedText:g,cleanMerge:F}=await u({branches:[f,s,l],contents:[m,y,v],path:r}),O=await it({fs:t,gitdir:e,type:"blob",object:Buffer.from(g,"utf8"),dryRun:c});return{cleanMerge:F,mergeResult:{mode:w,path:r,oid:O,type:h}}}a(d$,"mergeBlobs");async function uS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,onSign:w,mergeDriver:y,allowUnrelatedHistories:v=!1}){n===void 0&&(n=await Qr({fs:t,gitdir:i,fullname:!0})),n=await B.expand({fs:t,gitdir:i,ref:n}),o=await B.expand({fs:t,gitdir:i,ref:o});let g=await B.resolve({fs:t,gitdir:i,ref:n}),F=await B.resolve({fs:t,gitdir:i,ref:o}),O=await Np({fs:t,cache:e,gitdir:i,oids:[g,F]});if(O.length!==1)if(O.length===0&&v)O.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new qn;let S=O[0];if(S===F)return{oid:g,alreadyMerged:!0};if(s&&S===g)return!f&&!c&&await B.writeRef({fs:t,gitdir:i,ref:n,value:F}),{oid:F,fastForward:!0};{if(l)throw new Es;let R=await Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async x=>h$({fs:t,cache:e,dir:r,gitdir:i,index:x,ourOid:g,theirOid:F,baseOid:S,ourName:ki(n),baseName:"base",theirName:ki(o),dryRun:f,abortOnConflict:u,mergeDriver:y}));if(R instanceof zn)throw R;return h||(h=`Merge branch '${ki(o)}' into ${ki(n)}`),{oid:await tf({fs:t,cache:e,gitdir:i,message:h,ref:n,tree:R,parent:[g,F],author:d,committer:p,signingKey:m,onSign:w,dryRun:f,noUpdateBranch:c}),tree:R,mergeCommit:!0}}}a(uS,"_merge");async function hS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,dir:f,gitdir:c,ref:u,url:h,remote:d,remoteRef:p,prune:m,pruneTags:w,fastForward:y,fastForwardOnly:v,corsProxy:g,singleBranch:F,headers:O,author:S,committer:R,signingKey:b}){try{if(!u){let P=await Qr({fs:t,gitdir:c});if(!P)throw new et("ref");u=P}let{fetchHead:x,fetchHeadDescription:_}=await Cp({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:c,corsProxy:g,ref:u,url:h,remote:d,remoteRef:p,singleBranch:F,headers:O,prune:m,pruneTags:w});await uS({fs:t,cache:e,gitdir:c,ours:u,theirs:x,fastForward:y,fastForwardOnly:v,message:`Merge ${_}`,author:S,committer:R,signingKey:b,dryRun:!1,noUpdateBranch:!1}),await Ip({fs:t,cache:e,onProgress:i,dir:f,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(x){throw x.caller="git.pull",x}}a(hS,"_pull");async function dS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,corsProxy:p,singleBranch:m,headers:w={},cache:y={}}){try{E("fs",t),E("http",e),E("gitdir",f);let v={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await hS({fs:new M(t),cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForwardOnly:!0,corsProxy:p,singleBranch:m,headers:w,author:v,committer:v})}catch(v){throw v.caller="git.fastForward",v}}a(dS,"fastForward");async function pS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:F=!1,headers:O={},prune:S=!1,pruneTags:R=!1,cache:b={}}){try{return E("fs",t),E("http",e),E("gitdir",f),await Cp({fs:new M(t),cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,gitdir:f,ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m,since:w,exclude:y,relative:v,tags:g,singleBranch:F,headers:O,prune:S,pruneTags:R})}catch(x){throw x.caller="git.fetch",x}}a(pS,"fetch");async function mS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oids:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oids",i),await Np({fs:new M(t),cache:n,gitdir:r,oids:i})}catch(o){throw o.caller="git.findMergeBase",o}}a(mS,"findMergeBase");async function wS({fs:t,filepath:e}){if(await t.exists(D.join(e,".git")))return e;{let r=Un(e);if(r===e)throw new ce(`git root for ${e}`);return wS({fs:t,filepath:r})}}a(wS,"_findRoot");async function yS({fs:t,filepath:e}){try{return E("fs",t),E("filepath",e),await wS({fs:new M(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}a(yS,"findRoot");async function gS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await Is({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfig",n}}a(gS,"getConfig");async function p$({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).getall(r)}a(p$,"_getConfigAll");async function bS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await p$({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}a(bS,"getConfigAll");async function vS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1}){try{E("http",t),E("url",o);let c=await Yn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[h,d]of c.refs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}for(let[h,d]of c.symrefs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}return u}catch(f){throw f.caller="git.getRemoteInfo",f}}a(vS,"getRemoteInfo");function _S(t,e,r,i){let n=[];for(let[o,s]of t.refs){if(e&&!o.startsWith(e))continue;if(o.endsWith("^{}")){if(i){let f=o.replace("^{}",""),c=n[n.length-1],u=c.ref===f?c:n.find(h=>h.ref===f);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let l={ref:o,oid:s};r&&t.symrefs.has(o)&&(l.target=t.symrefs.get(o)),n.push(l)}return n}a(_S,"formatInfoRefs");async function FS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2}){try{E("http",t),E("url",o);let u=await Yn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let h={};for(let d of u.capabilities){let[p,m]=d.split("=");m?h[p]=m:h[p]=!0}return{protocolVersion:1,capabilities:h,refs:_S(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}a(FS,"getRemoteInfo2");async function m$({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Kr.wrap({type:t,object:e})),i=await br(e)),{oid:i,object:e}}a(m$,"hashObject");async function ES({object:t}){try{E("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await m$({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}a(ES,"hashBlob");async function w$({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:o}){try{o=D.join(i,o);let s=await t.read(o),l=a(c=>de({fs:t,cache:e,gitdir:n,oid:c}),"getExternalRefDelta"),f=await gs.fromPack({pack:s,getExternalRefDelta:l,onProgress:r});return await t.write(o.replace(/\.pack$/,".idx"),await f.toBuffer()),{oids:[...f.hashes]}}catch(s){throw s.caller="git.indexPack",s}}a(w$,"_indexPack");async function SS({fs:t,onProgress:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n,cache:o={}}){try{return E("fs",t),E("dir",r),E("gitdir",r),E("filepath",n),await w$({fs:new M(t),cache:o,onProgress:e,dir:r,gitdir:i,filepath:n})}catch(s){throw s.caller="git.indexPack",s}}a(SS,"indexPack");async function xS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:D.join(r,".git"),defaultBranch:n="master"}){try{return E("fs",t),E("gitdir",i),e||E("dir",r),await tS({fs:new M(t),bare:e,dir:r,gitdir:i,defaultBranch:n})}catch(o){throw o.caller="git.init",o}}a(xS,"init");async function TS({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:o}){let s=await Ai.read({fs:t,gitdir:r});if(!i)throw new et("oid");if(!n)throw new et("ancestor");if(i===n)return!1;let l=[i],f=new Set,c=0;for(;l.length;){if(c++===o)throw new xs(o);let u=l.shift(),{type:h,object:d}=await de({fs:t,cache:e,gitdir:r,oid:u});if(h!=="commit")throw new Ze(u,h,"commit");let p=rt.from(d).parse();for(let m of p.parent)if(m===n)return!0;if(!s.has(u))for(let m of p.parent)f.has(m)||(l.push(m),f.add(m))}return!1}a(TS,"_isDescendent");async function OS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,ancestor:n,depth:o=-1,cache:s={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),E("ancestor",n),await TS({fs:new M(t),cache:s,gitdir:r,oid:i,ancestor:n,depth:o})}catch(l){throw l.caller="git.isDescendent",l}}a(OS,"isDescendent");async function RS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i),Yr.isIgnored({fs:new M(t),dir:e,gitdir:r,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}a(RS,"isIgnored");async function kS({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i}){try{return E("fs",t),E("gitdir",r),B.listBranches({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.listBranches",n}}a(kS,"listBranches");async function y$({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await B.resolve({gitdir:e,fs:t,ref:r}),o=[];return await PS({fs:t,cache:i,gitdir:e,oid:n,filenames:o,prefix:""}),o}else return Fe.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(o=>o.path)})}a(y$,"_listFiles");async function PS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:o}){let{tree:s}=await eo({fs:t,cache:e,gitdir:r,oid:i});for(let l of s)l.type==="tree"?await PS({fs:t,cache:e,gitdir:r,oid:l.oid,filenames:n,prefix:D.join(o,l.path)}):n.push(D.join(o,l.path))}a(PS,"accumulateFilesFromOid");async function AS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),await y$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listFiles",o}}a(AS,"listFiles");async function g$({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await B.resolve({gitdir:r,fs:t,ref:i})}catch(l){if(l instanceof ce)return[]}return(await eo({fs:t,cache:e,gitdir:r,oid:n})).tree.map(l=>({target:l.path,note:l.oid}))}a(g$,"_listNotes");async function IS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{return E("fs",t),E("gitdir",r),E("ref",i),await g$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listNotes",o}}a(IS,"listNotes");async function DS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("gitdir",r),B.listRefs({fs:new M(t),gitdir:r,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}a(DS,"listRefs");async function b$({fs:t,gitdir:e}){let r=await be.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async o=>{let s=await r.get(`remote.${o}.url`);return{remote:o,url:s}}))}a(b$,"_listRemotes");async function CS({fs:t,dir:e,gitdir:r=D.join(e,".git")}){try{return E("fs",t),E("gitdir",r),await b$({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listRemotes",i}}a(CS,"listRemotes");async function v$(t){let e=we.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,o,...s]=i.split(" "),l={ref:o,oid:n};for(let f of s){let[c,u]=f.split(":");c==="symref-target"?l.target=u:c==="peeled"&&(l.peeled=u)}r.push(l)}return r}a(v$,"parseListRefsResponse");async function _$({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(we.encode(`command=ls-refs
|
|
92
|
+
`);return{cleanMerge:p,mergedText:d}}a(h$,"mergeFile");async function d$({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),index:n,ourOid:o,baseOid:s,theirOid:l,ourName:f="ours",baseName:c="base",theirName:u="theirs",dryRun:h=!1,abortOnConflict:d=!0,mergeDriver:p}){let m=ft({ref:o}),w=ft({ref:s}),y=ft({ref:l}),v=[],g=[],F=[],O=[],S=await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[m,w,y],map:a(async function(R,[b,x,_]){let P=oc(R),k=await fc(b,x),C=await fc(_,x);switch(`${k}-${C}`){case"false-false":return{mode:await x.mode(),path:P,oid:await x.oid(),type:await x.type()};case"false-true":return!_&&await b.type()==="tree"?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:_?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:void 0;case"true-false":return!b&&await _.type()==="tree"?{mode:await _.mode(),path:P,oid:await _.oid(),type:await _.type()}:b?{mode:await b.mode(),path:P,oid:await b.oid(),type:await b.type()}:void 0;case"true-true":{if(b&&_&&await b.type()==="tree"&&await _.type()==="tree")return{mode:await b.mode(),path:P,oid:await b.oid(),type:"tree"};if(b&&_&&await b.type()==="blob"&&await _.type()==="blob")return p$({fs:t,gitdir:i,path:P,ours:b,base:x,theirs:_,ourName:f,baseName:c,theirName:u,mergeDriver:p}).then(async N=>{if(N.cleanMerge)d||n.insert({filepath:R,oid:N.mergeResult.oid,stage:0});else if(v.push(R),g.push(R),!d){let U="";x&&await x.type()==="blob"&&(U=await x.oid());let Z=await b.oid(),me=await _.oid();n.delete({filepath:R}),U&&n.insert({filepath:R,oid:U,stage:1}),n.insert({filepath:R,oid:Z,stage:2}),n.insert({filepath:R,oid:me,stage:3})}return N.mergeResult});if(x&&!b&&_&&await x.type()==="blob"&&await _.type()==="blob"){if(v.push(R),F.push(R),!d){let N=await x.oid(),U=await _.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:3})}return{mode:await _.mode(),oid:await _.oid(),type:"blob",path:P}}if(x&&b&&!_&&await x.type()==="blob"&&await b.type()==="blob"){if(v.push(R),O.push(R),!d){let N=await x.oid(),U=await b.oid();n.delete({filepath:R}),n.insert({filepath:R,oid:N,stage:1}),n.insert({filepath:R,oid:U,stage:2})}return{mode:await b.mode(),oid:await b.oid(),type:"blob",path:P}}if(x&&!b&&!_&&(await x.type()==="blob"||await x.type()==="tree"))return;throw new zn}}},"map"),reduce:v.length!==0&&(!r||d)?void 0:async(R,b)=>{let x=b.filter(Boolean);if(R&&!(R&&R.type==="tree"&&x.length===0&&R.path!==".")){if(x.length>0||R.path==="."&&x.length===0){let P=new tt(x).toObject(),k=await it({fs:t,gitdir:i,type:"tree",object:P,dryRun:h});R.oid=k}return R}}});return v.length!==0?(r&&!d&&await Xr({fs:t,cache:e,dir:r,gitdir:i,trees:[ft({ref:S.oid})],map:a(async function(R,[b]){let x=`${r}/${R}`;if(await b.type()==="blob"){let _=await b.mode(),P=new TextDecoder().decode(await b.content());await t.write(x,P,{mode:_})}return!0},"map")}),new Wn(v,g,F,O)):S.oid}a(d$,"mergeTree");async function p$({fs:t,gitdir:e,path:r,ours:i,base:n,theirs:o,ourName:s,theirName:l,baseName:f,dryRun:c,mergeDriver:u=h$}){let h="blob",d="100755",p="",m="";n&&await n.type()==="blob"&&(d=await n.mode(),p=await n.oid(),m=Buffer.from(await n.content()).toString("utf8"));let w=d===await i.mode()?await o.mode():await i.mode();if(await i.oid()===await o.oid())return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};if(await i.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await o.oid(),type:h}};if(await o.oid()===p)return{cleanMerge:!0,mergeResult:{mode:w,path:r,oid:await i.oid(),type:h}};let y=Buffer.from(await i.content()).toString("utf8"),v=Buffer.from(await o.content()).toString("utf8"),{mergedText:g,cleanMerge:F}=await u({branches:[f,s,l],contents:[m,y,v],path:r}),O=await it({fs:t,gitdir:e,type:"blob",object:Buffer.from(g,"utf8"),dryRun:c});return{cleanMerge:F,mergeResult:{mode:w,path:r,oid:O,type:h}}}a(p$,"mergeBlobs");async function hS({fs:t,cache:e,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,onSign:w,mergeDriver:y,allowUnrelatedHistories:v=!1}){n===void 0&&(n=await Qr({fs:t,gitdir:i,fullname:!0})),n=await B.expand({fs:t,gitdir:i,ref:n}),o=await B.expand({fs:t,gitdir:i,ref:o});let g=await B.resolve({fs:t,gitdir:i,ref:n}),F=await B.resolve({fs:t,gitdir:i,ref:o}),O=await Bp({fs:t,cache:e,gitdir:i,oids:[g,F]});if(O.length!==1)if(O.length===0&&v)O.push("4b825dc642cb6eb9a060e54bf8d69288fbee4904");else throw new zn;let S=O[0];if(S===F)return{oid:g,alreadyMerged:!0};if(s&&S===g)return!f&&!c&&await B.writeRef({fs:t,gitdir:i,ref:n,value:F}),{oid:F,fastForward:!0};{if(l)throw new Es;let R=await Fe.acquire({fs:t,gitdir:i,cache:e,allowUnmerged:!1},async x=>d$({fs:t,cache:e,dir:r,gitdir:i,index:x,ourOid:g,theirOid:F,baseOid:S,ourName:ki(n),baseName:"base",theirName:ki(o),dryRun:f,abortOnConflict:u,mergeDriver:y}));if(R instanceof Wn)throw R;return h||(h=`Merge branch '${ki(o)}' into ${ki(n)}`),{oid:await tf({fs:t,cache:e,gitdir:i,message:h,ref:n,tree:R,parent:[g,F],author:d,committer:p,signingKey:m,onSign:w,dryRun:f,noUpdateBranch:c}),tree:R,mergeCommit:!0}}}a(hS,"_merge");async function dS({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,dir:f,gitdir:c,ref:u,url:h,remote:d,remoteRef:p,prune:m,pruneTags:w,fastForward:y,fastForwardOnly:v,corsProxy:g,singleBranch:F,headers:O,author:S,committer:R,signingKey:b}){try{if(!u){let P=await Qr({fs:t,gitdir:c});if(!P)throw new et("ref");u=P}let{fetchHead:x,fetchHeadDescription:_}=await Np({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,gitdir:c,corsProxy:g,ref:u,url:h,remote:d,remoteRef:p,singleBranch:F,headers:O,prune:m,pruneTags:w});await hS({fs:t,cache:e,gitdir:c,ours:u,theirs:x,fastForward:y,fastForwardOnly:v,message:`Merge ${_}`,author:S,committer:R,signingKey:b,dryRun:!1,noUpdateBranch:!1}),await Dp({fs:t,cache:e,onProgress:i,dir:f,gitdir:c,ref:u,remote:d,noCheckout:!1})}catch(x){throw x.caller="git.pull",x}}a(dS,"_pull");async function pS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,corsProxy:p,singleBranch:m,headers:w={},cache:y={}}){try{E("fs",t),E("http",e),E("gitdir",f);let v={name:"",email:"",timestamp:Date.now(),timezoneOffset:0};return await dS({fs:new M(t),cache:y,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForwardOnly:!0,corsProxy:p,singleBranch:m,headers:w,author:v,committer:v})}catch(v){throw v.caller="git.fastForward",v}}a(pS,"fastForward");async function mS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m=null,since:w=null,exclude:y=[],relative:v=!1,tags:g=!1,singleBranch:F=!1,headers:O={},prune:S=!1,pruneTags:R=!1,cache:b={}}){try{return E("fs",t),E("http",e),E("gitdir",f),await Np({fs:new M(t),cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,gitdir:f,ref:c,remote:u,remoteRef:h,url:d,corsProxy:p,depth:m,since:w,exclude:y,relative:v,tags:g,singleBranch:F,headers:O,prune:S,pruneTags:R})}catch(x){throw x.caller="git.fetch",x}}a(mS,"fetch");async function wS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oids:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oids",i),await Bp({fs:new M(t),cache:n,gitdir:r,oids:i})}catch(o){throw o.caller="git.findMergeBase",o}}a(wS,"findMergeBase");async function yS({fs:t,filepath:e}){if(await t.exists(D.join(e,".git")))return e;{let r=Hn(e);if(r===e)throw new ce(`git root for ${e}`);return yS({fs:t,filepath:r})}}a(yS,"_findRoot");async function gS({fs:t,filepath:e}){try{return E("fs",t),E("filepath",e),await yS({fs:new M(t),filepath:e})}catch(r){throw r.caller="git.findRoot",r}}a(gS,"findRoot");async function bS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await Is({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfig",n}}a(bS,"getConfig");async function m$({fs:t,gitdir:e,path:r}){return(await be.get({fs:t,gitdir:e})).getall(r)}a(m$,"_getConfigAll");async function vS({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i}){try{return E("fs",t),E("gitdir",r),E("path",i),await m$({fs:new M(t),gitdir:r,path:i})}catch(n){throw n.caller="git.getConfigAll",n}}a(vS,"getConfigAll");async function _S({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1}){try{E("http",t),E("url",o);let c=await Jn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:1}),u={capabilities:[...c.capabilities]};for(let[h,d]of c.refs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}for(let[h,d]of c.symrefs){let p=h.split("/"),m=p.pop(),w=u;for(let y of p)w[y]=w[y]||{},w=w[y];w[m]=d}return u}catch(f){throw f.caller="git.getRemoteInfo",f}}a(_S,"getRemoteInfo");function FS(t,e,r,i){let n=[];for(let[o,s]of t.refs){if(e&&!o.startsWith(e))continue;if(o.endsWith("^{}")){if(i){let f=o.replace("^{}",""),c=n[n.length-1],u=c.ref===f?c:n.find(h=>h.ref===f);if(u===void 0)throw new Error("I did not expect this to happen");u.peeled=s}continue}let l={ref:o,oid:s};r&&t.symrefs.has(o)&&(l.target=t.symrefs.get(o)),n.push(l)}return n}a(FS,"formatInfoRefs");async function ES({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2}){try{E("http",t),E("url",o);let u=await Jn.getRemoteHelperFor({url:o}).discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(u.protocolVersion===2)return{protocolVersion:u.protocolVersion,capabilities:u.capabilities2};let h={};for(let d of u.capabilities){let[p,m]=d.split("=");m?h[p]=m:h[p]=!0}return{protocolVersion:1,capabilities:h,refs:FS(u,void 0,!0,!0)}}catch(c){throw c.caller="git.getRemoteInfo2",c}}a(ES,"getRemoteInfo2");async function w$({type:t,object:e,format:r="content",oid:i=void 0}){return r!=="deflated"&&(r!=="wrapped"&&(e=Kr.wrap({type:t,object:e})),i=await br(e)),{oid:i,object:e}}a(w$,"hashObject");async function SS({object:t}){try{E("object",t),typeof t=="string"?t=Buffer.from(t,"utf8"):t instanceof Uint8Array||(t=new Uint8Array(t));let e="blob",{oid:r,object:i}=await w$({type:e,format:"content",object:t});return{oid:r,type:e,object:i,format:"wrapped"}}catch(e){throw e.caller="git.hashBlob",e}}a(SS,"hashBlob");async function y$({fs:t,cache:e,onProgress:r,dir:i,gitdir:n,filepath:o}){try{o=D.join(i,o);let s=await t.read(o),l=a(c=>de({fs:t,cache:e,gitdir:n,oid:c}),"getExternalRefDelta"),f=await gs.fromPack({pack:s,getExternalRefDelta:l,onProgress:r});return await t.write(o.replace(/\.pack$/,".idx"),await f.toBuffer()),{oids:[...f.hashes]}}catch(s){throw s.caller="git.indexPack",s}}a(y$,"_indexPack");async function xS({fs:t,onProgress:e,dir:r,gitdir:i=D.join(r,".git"),filepath:n,cache:o={}}){try{return E("fs",t),E("dir",r),E("gitdir",r),E("filepath",n),await y$({fs:new M(t),cache:o,onProgress:e,dir:r,gitdir:i,filepath:n})}catch(s){throw s.caller="git.indexPack",s}}a(xS,"indexPack");async function TS({fs:t,bare:e=!1,dir:r,gitdir:i=e?r:D.join(r,".git"),defaultBranch:n="master"}){try{return E("fs",t),E("gitdir",i),e||E("dir",r),await rS({fs:new M(t),bare:e,dir:r,gitdir:i,defaultBranch:n})}catch(o){throw o.caller="git.init",o}}a(TS,"init");async function OS({fs:t,cache:e,gitdir:r,oid:i,ancestor:n,depth:o}){let s=await Ai.read({fs:t,gitdir:r});if(!i)throw new et("oid");if(!n)throw new et("ancestor");if(i===n)return!1;let l=[i],f=new Set,c=0;for(;l.length;){if(c++===o)throw new xs(o);let u=l.shift(),{type:h,object:d}=await de({fs:t,cache:e,gitdir:r,oid:u});if(h!=="commit")throw new Ze(u,h,"commit");let p=rt.from(d).parse();for(let m of p.parent)if(m===n)return!0;if(!s.has(u))for(let m of p.parent)f.has(m)||(l.push(m),f.add(m))}return!1}a(OS,"_isDescendent");async function RS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,ancestor:n,depth:o=-1,cache:s={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),E("ancestor",n),await OS({fs:new M(t),cache:s,gitdir:r,oid:i,ancestor:n,depth:o})}catch(l){throw l.caller="git.isDescendent",l}}a(RS,"isDescendent");async function kS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("dir",e),E("gitdir",r),E("filepath",i),Yr.isIgnored({fs:new M(t),dir:e,gitdir:r,filepath:i})}catch(n){throw n.caller="git.isIgnored",n}}a(kS,"isIgnored");async function PS({fs:t,dir:e,gitdir:r=D.join(e,".git"),remote:i}){try{return E("fs",t),E("gitdir",r),B.listBranches({fs:new M(t),gitdir:r,remote:i})}catch(n){throw n.caller="git.listBranches",n}}a(PS,"listBranches");async function g$({fs:t,gitdir:e,ref:r,cache:i}){if(r){let n=await B.resolve({gitdir:e,fs:t,ref:r}),o=[];return await AS({fs:t,cache:i,gitdir:e,oid:n,filenames:o,prefix:""}),o}else return Fe.acquire({fs:t,gitdir:e,cache:i},async function(n){return n.entries.map(o=>o.path)})}a(g$,"_listFiles");async function AS({fs:t,cache:e,gitdir:r,oid:i,filenames:n,prefix:o}){let{tree:s}=await to({fs:t,cache:e,gitdir:r,oid:i});for(let l of s)l.type==="tree"?await AS({fs:t,cache:e,gitdir:r,oid:l.oid,filenames:n,prefix:D.join(o,l.path)}):n.push(D.join(o,l.path))}a(AS,"accumulateFilesFromOid");async function IS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),await g$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listFiles",o}}a(IS,"listFiles");async function b$({fs:t,cache:e,gitdir:r,ref:i}){let n;try{n=await B.resolve({gitdir:r,fs:t,ref:i})}catch(l){if(l instanceof ce)return[]}return(await to({fs:t,cache:e,gitdir:r,oid:n})).tree.map(l=>({target:l.path,note:l.oid}))}a(b$,"_listNotes");async function DS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="refs/notes/commits",cache:n={}}){try{return E("fs",t),E("gitdir",r),E("ref",i),await b$({fs:new M(t),cache:n,gitdir:r,ref:i})}catch(o){throw o.caller="git.listNotes",o}}a(DS,"listNotes");async function CS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i}){try{return E("fs",t),E("gitdir",r),B.listRefs({fs:new M(t),gitdir:r,filepath:i})}catch(n){throw n.caller="git.listRefs",n}}a(CS,"listRefs");async function v$({fs:t,gitdir:e}){let r=await be.get({fs:t,gitdir:e}),i=await r.getSubsections("remote");return Promise.all(i.map(async o=>{let s=await r.get(`remote.${o}.url`);return{remote:o,url:s}}))}a(v$,"_listRemotes");async function NS({fs:t,dir:e,gitdir:r=D.join(e,".git")}){try{return E("fs",t),E("gitdir",r),await v$({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listRemotes",i}}a(NS,"listRemotes");async function _$(t){let e=we.streamReader(t),r=[],i;for(;i=await e(),i!==!0;){if(i===null)continue;i=i.toString("utf8").replace(/\n$/,"");let[n,o,...s]=i.split(" "),l={ref:o,oid:n};for(let f of s){let[c,u]=f.split(":");c==="symref-target"?l.target=u:c==="peeled"&&(l.peeled=u)}r.push(l)}return r}a(_$,"parseListRefsResponse");async function F$({prefix:t,symrefs:e,peelTags:r}){let i=[];return i.push(we.encode(`command=ls-refs
|
|
93
93
|
`)),i.push(we.encode(`agent=${rf.agent}
|
|
94
|
-
`)),(r||e||t)&&i.push(we.delim()),r&&i.push(we.encode("peel")),e&&i.push(we.encode("symrefs")),t&&i.push(we.encode(`ref-prefix ${t}`)),i.push(we.flush()),i}a(
|
|
94
|
+
`)),(r||e||t)&&i.push(we.delim()),r&&i.push(we.encode("peel")),e&&i.push(we.encode("symrefs")),t&&i.push(we.encode(`ref-prefix ${t}`)),i.push(we.flush()),i}a(F$,"writeListRefsRequest");async function BS({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,url:o,headers:s={},forPush:l=!1,protocolVersion:f=2,prefix:c,symrefs:u,peelTags:h}){try{E("http",t),E("url",o);let d=await Yn.discover({http:t,onAuth:e,onAuthSuccess:r,onAuthFailure:i,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,headers:s,protocolVersion:f});if(d.protocolVersion===1)return FS(d,c,u,h);let p=await F$({prefix:c,symrefs:u,peelTags:h}),m=await Yn.connect({http:t,auth:d.auth,headers:s,corsProxy:n,service:l?"git-receive-pack":"git-upload-pack",url:o,body:p});return _$(m.body)}catch(d){throw d.caller="git.listServerRefs",d}}a(BS,"listServerRefs");async function LS({fs:t,dir:e,gitdir:r=D.join(e,".git")}){try{return E("fs",t),E("gitdir",r),B.listTags({fs:new M(t),gitdir:r})}catch(i){throw i.caller="git.listTags",i}}a(LS,"listTags");function E$(t,e){return t.committer.timestamp-e.committer.timestamp}a(E$,"compareAge");var S$="e69de29bb2d1d6434b8b29ae775ad8c2e48c5391";async function TE({fs:t,cache:e,gitdir:r,oid:i,fileId:n}){if(n===S$)return;let o=i,s,l=await Kn({fs:t,cache:e,gitdir:r,oid:i}),f=l.tree;return n===l.oid?s=l.path:(s=await $S({fs:t,cache:e,gitdir:r,tree:f,fileId:n,oid:o}),Array.isArray(s)&&(s.length===0?s=void 0:s.length===1&&(s=s[0]))),s}a(TE,"resolveFileIdInTree");async function $S({fs:t,cache:e,gitdir:r,tree:i,fileId:n,oid:o,filepaths:s=[],parentPath:l=""}){let f=i.entries().map(function(c){let u;return c.oid===n?(u=D.join(l,c.path),s.push(u)):c.type==="tree"&&(u=de({fs:t,cache:e,gitdir:r,oid:c.oid}).then(function({object:h}){return $S({fs:t,cache:e,gitdir:r,tree:tt.from(h),fileId:n,oid:o,filepaths:s,parentPath:D.join(l,c.path)})})),u});return await Promise.all(f),s}a($S,"_resolveFileId");async function x$({fs:t,cache:e,gitdir:r,filepath:i,ref:n,depth:o,since:s,force:l,follow:f}){let c=typeof s>"u"?void 0:Math.floor(s.valueOf()/1e3),u=[],h=await Ai.read({fs:t,gitdir:r}),d=await B.resolve({fs:t,gitdir:r,ref:n}),p=[await Xn({fs:t,cache:e,gitdir:r,oid:d})],m,w,y;function v(g){y&&i&&u.push(g)}for(a(v,"endCommit");p.length>0;){let g=p.pop();if(c!==void 0&&g.commit.committer.timestamp<=c)break;if(i){let F;try{F=await Ds({fs:t,cache:e,gitdir:r,oid:g.commit.tree,filepath:i}),w&&m!==F&&u.push(w),m=F,w=g,y=!0}catch(O){if(O instanceof ce){let S=f&&m;if(S&&(S=await TE({fs:t,cache:e,gitdir:r,oid:g.commit.tree,fileId:m}),S))if(Array.isArray(S)){if(w){let R=await TE({fs:t,cache:e,gitdir:r,oid:w.commit.tree,fileId:m});if(Array.isArray(R))if(S=S.filter(b=>R.indexOf(b)===-1),S.length===1)S=S[0],i=S,w&&u.push(w);else{S=!1,w&&u.push(w);break}}}else i=S,w&&u.push(w);if(!S){if(y&&m&&(u.push(w),!l))break;if(!l&&!f)throw O}w=g,y=!1}else throw O}}else u.push(g);if(o!==void 0&&u.length===o){v(g);break}if(!h.has(g.oid))for(let F of g.commit.parent){let O=await Xn({fs:t,cache:e,gitdir:r,oid:F});p.map(S=>S.oid).includes(O.oid)||p.push(O)}p.length===0&&v(g),p.sort((F,O)=>E$(F.commit,O.commit))}return u}a(x$,"_log");async function MS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,ref:n="HEAD",depth:o,since:s,force:l,follow:f,cache:c={}}){try{return E("fs",t),E("gitdir",r),E("ref",n),await x$({fs:new M(t),cache:c,gitdir:r,filepath:i,ref:n,depth:o,since:s,force:l,follow:f})}catch(u){throw u.caller="git.log",u}}a(MS,"log");async function jS({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ours:n,theirs:o,fastForward:s=!0,fastForwardOnly:l=!1,dryRun:f=!1,noUpdateBranch:c=!1,abortOnConflict:u=!0,message:h,author:d,committer:p,signingKey:m,cache:w={},mergeDriver:y,allowUnrelatedHistories:v=!1}){try{E("fs",t),m&&E("onSign",e);let g=new M(t),F=await Jr({fs:g,gitdir:i,author:d});if(!F&&(!l||!s))throw new ze("author");let O=await Zn({fs:g,gitdir:i,author:F,committer:p});if(!O&&(!l||!s))throw new ze("committer");return await hS({fs:g,cache:w,dir:r,gitdir:i,ours:n,theirs:o,fastForward:s,fastForwardOnly:l,dryRun:f,noUpdateBranch:c,abortOnConflict:u,message:h,author:F,committer:O,signingKey:m,onSign:e,mergeDriver:y,allowUnrelatedHistories:v})}catch(g){throw g.caller="git.merge",g}}a(jS,"merge");var T$={commit:16,tree:32,blob:48,tag:64,ofs_delta:96,ref_delta:112};async function US({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),oids:n}){let o=new RE,s=[];function l(u,h){let d=Buffer.from(u,h);s.push(d),o.update(d)}a(l,"write");async function f({stype:u,object:h}){let d=T$[u],p=h.length,m=p>15?128:0,w=p&15;p=p>>>4;let y=(m|d|w).toString(16);for(l(y,"hex");m;)m=p>127?128:0,y=m|p&127,l(Pp(2,y),"hex"),p=p>>>7;l(Buffer.from(await jE(h)))}a(f,"writeObject"),l("PACK"),l("00000002","hex"),l(Pp(8,n.length),"hex");for(let u of n){let{type:h,object:d}=await de({fs:t,cache:e,gitdir:i,oid:u});await f({write:l,object:d,stype:h})}let c=o.digest();return s.push(c),s}a(US,"_pack");async function O$({fs:t,cache:e,gitdir:r,oids:i,write:n}){let o=await US({fs:t,cache:e,gitdir:r,oids:i}),s=Buffer.from(await uc(o)),f=`pack-${s.slice(-20).toString("hex")}.pack`;return n?(await t.write(D.join(r,`objects/pack/${f}`),s),{filename:f}):{filename:f,packfile:new Uint8Array(s)}}a(O$,"_packObjects");async function HS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oids:i,write:n=!1,cache:o={}}){try{return E("fs",t),E("gitdir",r),E("oids",i),await O$({fs:new M(t),cache:o,gitdir:r,oids:i,write:n})}catch(s){throw s.caller="git.packObjects",s}}a(HS,"packObjects");async function qS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f=D.join(l,".git"),ref:c,url:u,remote:h,remoteRef:d,prune:p=!1,pruneTags:m=!1,fastForward:w=!0,fastForwardOnly:y=!1,corsProxy:v,singleBranch:g,headers:F={},author:O,committer:S,signingKey:R,cache:b={}}){try{E("fs",t),E("gitdir",f);let x=new M(t),_=await Jr({fs:x,gitdir:f,author:O});if(!_)throw new ze("author");let P=await Zn({fs:x,gitdir:f,author:_,committer:S});if(!P)throw new ze("committer");return await dS({fs:x,cache:b,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,dir:l,gitdir:f,ref:c,url:u,remote:h,remoteRef:d,fastForward:w,fastForwardOnly:y,corsProxy:v,singleBranch:g,headers:F,author:_,committer:P,signingKey:R,prune:p,pruneTags:m})}catch(x){throw x.caller="git.pull",x}}a(qS,"pull");async function R$({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),start:n,finish:o}){let s=await Ai.read({fs:t,gitdir:i}),l=new Set,f=new Set;for(let h of n)l.add(await B.resolve({fs:t,gitdir:i,ref:h}));for(let h of o)try{let d=await B.resolve({fs:t,gitdir:i,ref:h});f.add(d)}catch{}let c=new Set;async function u(h){c.add(h);let{type:d,object:p}=await de({fs:t,cache:e,gitdir:i,oid:h});if(d==="tag"){let w=ut.from(p).headers().object;return u(w)}if(d!=="commit")throw new Ze(h,d,"commit");if(!s.has(h)){let w=rt.from(p).headers().parent;for(h of w)!f.has(h)&&!c.has(h)&&await u(h)}}a(u,"walk");for(let h of l)await u(h);return c}a(R$,"listCommitsAndTags");async function yp({fs:t,cache:e,dir:r,gitdir:i=D.join(r,".git"),oids:n}){let o=new Set;async function s(l){if(o.has(l))return;o.add(l);let{type:f,object:c}=await de({fs:t,cache:e,gitdir:i,oid:l});if(f==="tag"){let h=ut.from(c).headers().object;await s(h)}else if(f==="commit"){let h=rt.from(c).headers().tree;await s(h)}else if(f==="tree"){let u=tt.from(c);for(let h of u)h.type==="blob"&&o.add(h.oid),h.type==="tree"&&await s(h.oid)}}a(s,"walk");for(let l of n)await s(l);return o}a(yp,"listObjects");async function k$(t){let e={},r="",i=we.streamReader(t),n=await i();for(;n!==!0;)n!==null&&(r+=n.toString("utf8")+`
|
|
95
95
|
`),n=await i();let o=r.toString("utf8").split(`
|
|
96
|
-
`);if(n=o.shift(),!n.startsWith("unpack "))throw new Pi('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let s of o){if(s.trim()==="")continue;let l=s.slice(0,2),f=s.slice(3),c=f.indexOf(" ");c===-1&&(c=f.length);let u=f.slice(0,c),h=f.slice(c+1);e.refs[u]={ok:l==="ok",error:h}}return e}a(
|
|
97
|
-
`)),i="";return r.push(we.flush()),r}a(
|
|
98
|
-
- ${fe}: ${ee.error}`).join("");throw new Ss(z,X)}}a(
|
|
99
|
-
`,author:s,committer:l,signingKey:f})}a(
|
|
96
|
+
`);if(n=o.shift(),!n.startsWith("unpack "))throw new Pi('unpack ok" or "unpack [error message]',n);e.ok=n==="unpack ok",e.ok||(e.error=n.slice(7)),e.refs={};for(let s of o){if(s.trim()==="")continue;let l=s.slice(0,2),f=s.slice(3),c=f.indexOf(" ");c===-1&&(c=f.length);let u=f.slice(0,c),h=f.slice(c+1);e.refs[u]={ok:l==="ok",error:h}}return e}a(k$,"parseReceivePackResponse");async function P$({capabilities:t=[],triplets:e=[]}){let r=[],i=`\0 ${t.join(" ")}`;for(let n of e)r.push(we.encode(`${n.oldoid} ${n.oid} ${n.fullRef}${i}
|
|
97
|
+
`)),i="";return r.push(we.flush()),r}a(P$,"writeReceivePackRequest");async function A$({fs:t,cache:e,http:r,onProgress:i,onMessage:n,onAuth:o,onAuthSuccess:s,onAuthFailure:l,onPrePush:f,gitdir:c,ref:u,remoteRef:h,remote:d,url:p,force:m=!1,delete:w=!1,corsProxy:y,headers:v={}}){let g=u||await Qr({fs:t,gitdir:c});if(typeof g>"u")throw new et("ref");let F=await be.get({fs:t,gitdir:c});d=d||await F.get(`branch.${g}.pushRemote`)||await F.get("remote.pushDefault")||await F.get(`branch.${g}.remote`)||"origin";let O=p||await F.get(`remote.${d}.pushurl`)||await F.get(`remote.${d}.url`);if(typeof O>"u")throw new et("remote OR url");let S=h||await F.get(`branch.${g}.merge`);if(typeof O>"u")throw new et("remoteRef");y===void 0&&(y=await F.get("http.corsProxy"));let R=await B.expand({fs:t,gitdir:c,ref:g}),b=w?"0000000000000000000000000000000000000000":await B.resolve({fs:t,gitdir:c,ref:R}),x=Jn.getRemoteHelperFor({url:O}),_=await x.discover({http:r,onAuth:o,onAuthSuccess:s,onAuthFailure:l,corsProxy:y,service:"git-receive-pack",url:O,headers:v,protocolVersion:1}),P=_.auth,k;if(!S)k=R;else try{k=await B.expandAgainstMap({ref:S,map:_.refs})}catch(z){if(z instanceof ce)k=S.startsWith("refs/")?S:`refs/heads/${S}`;else throw z}let C=_.refs.get(k)||"0000000000000000000000000000000000000000";if(f&&!await f({remote:d,url:O,localRef:{ref:w?"(delete)":R,oid:b},remoteRef:{ref:k,oid:C}}))throw new Gn;let N=!_.capabilities.has("no-thin"),U=new Set;if(!w){let z=[..._.refs.values()],fe=new Set;if(C!=="0000000000000000000000000000000000000000"){let ee=await Bp({fs:t,cache:e,gitdir:c,oids:[b,C]});for(let Oe of ee)z.push(Oe);N&&(fe=await yp({fs:t,cache:e,gitdir:c,oids:ee}))}if(!z.includes(b)){let ee=await R$({fs:t,cache:e,gitdir:c,start:[b],finish:z});U=await yp({fs:t,cache:e,gitdir:c,oids:ee})}if(N){try{let ee=await B.resolve({fs:t,gitdir:c,ref:`refs/remotes/${d}/HEAD`,depth:2}),{oid:Oe}=await B.resolveAgainstMap({ref:ee.replace(`refs/remotes/${d}/`,""),fullref:ee,map:_.refs}),Re=[Oe];for(let se of await yp({fs:t,cache:e,gitdir:c,oids:Re}))fe.add(se)}catch{}for(let ee of fe)U.delete(ee)}if(b===C&&(m=!0),!m){if(R.startsWith("refs/tags")&&C!=="0000000000000000000000000000000000000000")throw new Vn("tag-exists");if(b!=="0000000000000000000000000000000000000000"&&C!=="0000000000000000000000000000000000000000"&&!await OS({fs:t,cache:e,gitdir:c,oid:b,ancestor:C,depth:-1}))throw new Vn("not-fast-forward")}}let Z=eS([..._.capabilities],["report-status","side-band-64k",`agent=${rf.agent}`]),me=await P$({capabilities:Z,triplets:[{oldoid:C,oid:b,fullRef:k}]}),Ee=w?[]:await US({fs:t,cache:e,gitdir:c,oids:[...U]}),$=await x.connect({http:r,onProgress:i,corsProxy:y,service:"git-receive-pack",url:O,auth:P,headers:v,body:[...me,...Ee]}),{packfile:q,progress:G}=await hc.demux($.body);if(n){let z=tS(G);Ns(z,async fe=>{await n(fe)})}let X=await k$(q);if($.headers&&(X.headers=$.headers),d&&X.ok&&X.refs[k].ok&&!R.startsWith("refs/tags")){let z=`refs/remotes/${d}/${k.replace("refs/heads","")}`;w?await B.deleteRef({fs:t,gitdir:c,ref:z}):await B.writeRef({fs:t,gitdir:c,ref:z,value:b})}if(X.ok&&Object.values(X.refs).every(z=>z.ok))return X;{let z=Object.entries(X.refs).filter(([fe,ee])=>!ee.ok).map(([fe,ee])=>`
|
|
98
|
+
- ${fe}: ${ee.error}`).join("");throw new Ss(z,X)}}a(A$,"_push");async function zS({fs:t,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPrePush:l,dir:f,gitdir:c=D.join(f,".git"),ref:u,remoteRef:h,remote:d="origin",url:p,force:m=!1,delete:w=!1,corsProxy:y,headers:v={},cache:g={}}){try{return E("fs",t),E("http",e),E("gitdir",c),await A$({fs:new M(t),cache:g,http:e,onProgress:r,onMessage:i,onAuth:n,onAuthSuccess:o,onAuthFailure:s,onPrePush:l,gitdir:c,ref:u,remoteRef:h,remote:d,url:p,force:m,delete:w,corsProxy:y,headers:v})}catch(F){throw F.caller="git.push",F}}a(zS,"push");async function WS({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i});if(n==="tag")return i=ut.from(o).parse().object,WS({fs:t,cache:e,gitdir:r,oid:i});if(n!=="blob")throw new Ze(i,n,"blob");return{oid:i,blob:new Uint8Array(o)}}a(WS,"resolveBlob");async function VS({fs:t,cache:e,gitdir:r,oid:i,filepath:n=void 0}){return n!==void 0&&(i=await Ds({fs:t,cache:e,gitdir:r,oid:i,filepath:n})),await WS({fs:t,cache:e,gitdir:r,oid:i})}a(VS,"_readBlob");async function GS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,filepath:n,cache:o={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),await VS({fs:new M(t),cache:o,gitdir:r,oid:i,filepath:n})}catch(s){throw s.caller="git.readBlob",s}}a(GS,"readBlob");async function Lp({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),await Xn({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.readCommit",o}}a(Lp,"readCommit");async function I$({fs:t,cache:e,gitdir:r,ref:i="refs/notes/commits",oid:n}){let o=await B.resolve({gitdir:r,fs:t,ref:i}),{blob:s}=await VS({fs:t,cache:e,gitdir:r,oid:o,filepath:n});return s}a(I$,"_readNote");async function KS({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="refs/notes/commits",oid:n,cache:o={}}){try{return E("fs",t),E("gitdir",r),E("ref",i),E("oid",n),await I$({fs:new M(t),cache:o,gitdir:r,ref:i,oid:n})}catch(s){throw s.caller="git.readNote",s}}a(KS,"readNote");async function ZS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,format:n="parsed",filepath:o=void 0,encoding:s=void 0,cache:l={}}){try{E("fs",t),E("gitdir",r),E("oid",i);let f=new M(t);o!==void 0&&(i=await Ds({fs:f,cache:l,gitdir:r,oid:i,filepath:o}));let u=await de({fs:f,cache:l,gitdir:r,oid:i,format:n==="parsed"?"content":n});if(u.oid=i,n==="parsed")switch(u.format="parsed",u.type){case"commit":u.object=rt.from(u.object).parse();break;case"tree":u.object=tt.from(u.object).entries();break;case"blob":s?u.object=u.object.toString(s):(u.object=new Uint8Array(u.object),u.format="content");break;case"tag":u.object=ut.from(u.object).parse();break;default:throw new Ze(u.oid,u.type,"blob|commit|tag|tree")}else(u.format==="deflated"||u.format==="wrapped")&&(u.type=u.format);return u}catch(f){throw f.caller="git.readObject",f}}a(ZS,"readObject");async function D$({fs:t,cache:e,gitdir:r,oid:i}){let{type:n,object:o}=await de({fs:t,cache:e,gitdir:r,oid:i,format:"content"});if(n!=="tag")throw new Ze(i,n,"tag");let s=ut.from(o);return{oid:i,tag:s.parse(),payload:s.payload()}}a(D$,"_readTag");async function XS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,cache:n={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),await D$({fs:new M(t),cache:n,gitdir:r,oid:i})}catch(o){throw o.caller="git.readTag",o}}a(XS,"readTag");async function YS({fs:t,dir:e,gitdir:r=D.join(e,".git"),oid:i,filepath:n=void 0,cache:o={}}){try{return E("fs",t),E("gitdir",r),E("oid",i),await to({fs:new M(t),cache:o,gitdir:r,oid:i,filepath:n})}catch(s){throw s.caller="git.readTree",s}}a(YS,"readTree");async function JS({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={}}){try{E("fs",t),E("gitdir",r),E("filepath",i),await Fe.acquire({fs:new M(t),gitdir:r,cache:n},async function(o){o.delete({filepath:i})})}catch(o){throw o.caller="git.remove",o}}a(JS,"remove");async function C$({fs:t,cache:e,onSign:r,gitdir:i,ref:n="refs/notes/commits",oid:o,author:s,committer:l,signingKey:f}){let c;try{c=await B.resolve({gitdir:i,fs:t,ref:n})}catch(m){if(!(m instanceof ce))throw m}let h=(await to({fs:t,gitdir:i,oid:c||"4b825dc642cb6eb9a060e54bf8d69288fbee4904"})).tree;h=h.filter(m=>m.path!==o);let d=await Cs({fs:t,gitdir:i,tree:h});return await tf({fs:t,cache:e,onSign:r,gitdir:i,ref:n,tree:d,parent:c&&[c],message:`Note removed by 'isomorphic-git removeNote'
|
|
99
|
+
`,author:s,committer:l,signingKey:f})}a(C$,"_removeNote");async function QS({fs:t,onSign:e,dir:r,gitdir:i=D.join(r,".git"),ref:n="refs/notes/commits",oid:o,author:s,committer:l,signingKey:f,cache:c={}}){try{E("fs",t),E("gitdir",i),E("oid",o);let u=new M(t),h=await Jr({fs:u,gitdir:i,author:s});if(!h)throw new ze("author");let d=await Zn({fs:u,gitdir:i,author:h,committer:l});if(!d)throw new ze("committer");return await C$({fs:u,cache:c,onSign:e,gitdir:i,ref:n,oid:o,author:h,committer:d,signingKey:f})}catch(u){throw u.caller="git.removeNote",u}}a(QS,"removeNote");async function N$({fs:t,gitdir:e,oldref:r,ref:i,checkout:n=!1}){if(!ms(i,!0))throw new Bt(i,ps.clean(i));if(!ms(r,!0))throw new Bt(r,ps.clean(r));let o=`refs/heads/${r}`,s=`refs/heads/${i}`;if(await B.exists({fs:t,gitdir:e,ref:s}))throw new Nt("branch",i,!1);let f=await B.resolve({fs:t,gitdir:e,ref:o,depth:1});await B.writeRef({fs:t,gitdir:e,ref:s,value:f}),await B.deleteRef({fs:t,gitdir:e,ref:o});let u=await Qr({fs:t,gitdir:e,fullname:!0})===o;(n||u)&&await B.writeSymbolicRef({fs:t,gitdir:e,ref:"HEAD",value:s})}a(N$,"_renameBranch");async function e1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,oldref:n,checkout:o=!1}){try{return E("fs",t),E("gitdir",r),E("ref",i),E("oldref",n),await N$({fs:new M(t),gitdir:r,ref:i,oldref:n,checkout:o})}catch(s){throw s.caller="git.renameBranch",s}}a(e1,"renameBranch");async function t1({gitdir:t,type:e,object:r}){return br(Kr.wrap({type:e,object:r}))}a(t1,"hashObject$1");async function r1({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,ref:n,cache:o={}}){try{E("fs",t),E("gitdir",r),E("filepath",i);let s=new M(t),l,f;try{l=await B.resolve({fs:s,gitdir:r,ref:n||"HEAD"})}catch(h){if(n)throw h}if(l)try{l=await Ds({fs:s,cache:o,gitdir:r,oid:l,filepath:i})}catch{l=null}let c={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:0,uid:0,gid:0,size:0},u=e&&await s.read(D.join(e,i));u&&(f=await t1({gitdir:r,type:"blob",object:u}),l===f&&(c=await s.lstat(D.join(e,i)))),await Fe.acquire({fs:s,gitdir:r,cache:o},async function(h){h.delete({filepath:i}),l&&h.insert({filepath:i,stats:c,oid:l})})}catch(s){throw s.caller="git.reset",s}}a(r1,"resetIndex");async function i1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,depth:n}){try{return E("fs",t),E("gitdir",r),E("ref",i),await B.resolve({fs:new M(t),gitdir:r,ref:i,depth:n})}catch(o){throw o.caller="git.resolveRef",o}}a(i1,"resolveRef");async function n1({fs:t,dir:e,gitdir:r=D.join(e,".git"),path:i,value:n,append:o=!1}){try{E("fs",t),E("gitdir",r),E("path",i);let s=new M(t),l=await be.get({fs:s,gitdir:r});o?await l.append(i,n):await l.set(i,n),await be.save({fs:s,gitdir:r,config:l})}catch(s){throw s.caller="git.setConfig",s}}a(n1,"setConfig");async function o1({fs:t,gitdir:e,commit:r}){let i=rt.from(r).toObject();return await it({fs:t,gitdir:e,type:"commit",object:i,format:"content"})}a(o1,"_writeCommit");var Jc=class Jc{static get timezoneOffsetForRefLogEntry(){let e=new Date().getTimezoneOffset(),r=Math.abs(Math.floor(e/60)),i=Math.abs(e%60).toString().padStart(2,"0");return`${e>0?"-":"+"}${r.toString().padStart(2,"0")}${i}`}static createStashReflogEntry(e,r,i){let n=e.name.replace(/\s/g,""),o="0000000000000000000000000000000000000000",s=Math.floor(Date.now()/1e3),l=Jc.timezoneOffsetForRefLogEntry;return`${o} ${r} ${n} ${e.email} ${s} ${l} ${i}
|
|
100
100
|
`}static getStashReflogEntry(e,r=!1){return e.split(`
|
|
101
|
-
`).filter(o=>o).reverse().map((o,s)=>r?`stash@{${s}}: ${o.split(" ")[1]}`:o)}};a(Jc,"GitRefStash");var dc=Jc,
|
|
101
|
+
`).filter(o=>o).reverse().map((o,s)=>r?`stash@{${s}}: ${o.split(" ")[1]}`:o)}};a(Jc,"GitRefStash");var dc=Jc,B$={stage:Di,workdir:eo},gp;async function Qn(t,e){return gp===void 0&&(gp=new ds),gp.acquire(t,e)}a(Qn,"acquireLock$1");async function L$(t,e,r,i,n=null){let o=D.join(r,i),s=await t.lstat(o);if(!s)throw new ce(o);if(s.isDirectory())throw new W(`${o}: file expected, but found directory`);let l=n?await CE({fs:t,gitdir:e,oid:n}):void 0,f=l?n:void 0;return l||await Qn({fs:t,gitdir:e,currentFilepath:o},async()=>{let c=s.isSymbolicLink()?await t.readlink(o).then(UE):await t.read(o);if(c===null)throw new ce(o);f=await it({fs:t,gitdir:e,type:"blob",object:c})}),f}a(L$,"checkAndWriteBlob");async function $$({fs:t,dir:e,gitdir:r,entries:i}){async function n(o){if(o.type==="tree"){if(!o.oid){let s=await Promise.all(o.children.map(n));o.oid=await Cs({fs:t,gitdir:r,tree:s}),o.mode=16384}}else o.type==="blob"&&(o.oid=await L$(t,r,e,o.path,o.oid),o.mode=33188);return o.path=o.path.split("/").pop(),o}return a(n,"processTreeEntry"),Promise.all(i.map(n))}a($$,"processTreeEntries");async function OE({fs:t,dir:e,gitdir:r,treePair:i}){let n=i[1]==="stage",o=i.map(p=>typeof p=="string"?B$[p]():p),s=[],u=await Xr({fs:t,cache:{},dir:e,gitdir:r,trees:o,map:a(async(p,[m,w])=>{if(!(p==="."||await Yr.isIgnored({fs:t,dir:e,gitdir:r,filepath:p}))&&w)return(!m||await m.oid()!==await w.oid()&&await w.oid()!==void 0)&&s.push([m,w]),{mode:await w.mode(),path:p,oid:await w.oid(),type:await w.type()}},"map"),reduce:a(async(p,m)=>(m=m.filter(Boolean),p?(p.children=m,p):m.length>0?m:void 0),"reduce"),iterate:a(async(p,m)=>{let w=[];for(let y of m){let[v,g]=y;n?g&&(await t.exists(`${e}/${g.toString()}`)?w.push(y):s.push([null,g])):v&&(g?w.push(y):s.push([v,null]))}return w.length?Promise.all(w.map(p)):[]},"iterate")});if(s.length===0||u.length===0)return null;let d=(await $$({fs:t,dir:e,gitdir:r,entries:u})).filter(Boolean).map(p=>({mode:p.mode,path:p.path,oid:p.oid,type:p.type}));return Cs({fs:t,gitdir:r,tree:d})}a(OE,"writeTreeChanges");async function M$({fs:t,dir:e,gitdir:r,stashCommit:i,parentCommit:n,wasStaged:o}){let s=[],l=[],f=await Xr({fs:t,cache:{},dir:e,gitdir:r,trees:[ft({ref:n}),ft({ref:i})],map:a(async(c,[u,h])=>{if(c==="."||await Yr.isIgnored({fs:t,dir:e,gitdir:r,filepath:c}))return;let d=h?await h.type():await u.type();if(d!=="tree"&&d!=="blob")return;if(!h&&u){let m=d==="tree"?"rmdir":"rm";return d==="tree"&&s.push(c),d==="blob"&&o&&l.push({filepath:c,oid:await u.oid()}),{method:m,filepath:c}}let p=await h.oid();if(!u||await u.oid()!==p)return d==="tree"?{method:"mkdir",filepath:c}:(o&&l.push({filepath:c,oid:p,stats:await t.lstat(D.join(e,c))}),{method:"write",filepath:c,oid:p})},"map")});await Qn({fs:t,gitdir:r,dirRemoved:s,ops:f},async()=>{for(let c of f){let u=D.join(e,c.filepath);switch(c.method){case"rmdir":await t.rmdir(u);break;case"mkdir":await t.mkdir(u);break;case"rm":await t.rm(u);break;case"write":if(!s.some(h=>u.startsWith(h))){let{object:h}=await de({fs:t,cache:{},gitdir:r,oid:c.oid});await t.exists(u)&&await t.rm(u),await t.write(u,h)}break}}}),await Fe.acquire({fs:t,gitdir:r,cache:{}},async c=>{l.forEach(({filepath:u,stats:h,oid:d})=>{c.insert({filepath:u,stats:h,oid:d})})})}a(M$,"applyTreeChanges");var $n=class $n{constructor({fs:e,dir:r,gitdir:i=D.join(r,".git")}){Object.assign(this,{fs:e,dir:r,gitdir:i,_author:null})}static get refStash(){return"refs/stash"}static get refLogsStash(){return"logs/refs/stash"}get refStashPath(){return D.join(this.gitdir,$n.refStash)}get refLogsStashPath(){return D.join(this.gitdir,$n.refLogsStash)}async getAuthor(){if(!this._author&&(this._author=await Jr({fs:this.fs,gitdir:this.gitdir,author:{}}),!this._author))throw new ze("author");return this._author}async getStashSHA(e,r){return await this.fs.exists(this.refStashPath)?(r||await this.readStashReflogs({parsed:!1}))[e].split(" ")[1]:null}async writeStashCommit({message:e,tree:r,parent:i}){return o1({fs:this.fs,gitdir:this.gitdir,commit:{message:e,tree:r,parent:i,author:await this.getAuthor(),committer:await this.getAuthor()}})}async readStashCommit(e){let r=await this.readStashReflogs({parsed:!1});if(e!==0&&(e<0||e>r.length-1))throw new Bt(`stash@${e}`,"number that is in range of [0, num of stash pushed]");let i=await this.getStashSHA(e,r);return i?Xn({fs:this.fs,cache:{},gitdir:this.gitdir,oid:i}):{}}async writeStashRef(e){return B.writeRef({fs:this.fs,gitdir:this.gitdir,ref:$n.refStash,value:e})}async writeStashReflogEntry({stashCommit:e,message:r}){let i=await this.getAuthor(),n=dc.createStashReflogEntry(i,e,r),o=this.refLogsStashPath;await Qn({filepath:o,entry:n},async()=>{let s=await this.fs.exists(o)?await this.fs.read(o,"utf8"):"";await this.fs.write(o,s+n,"utf8")})}async readStashReflogs({parsed:e=!1}){if(!await this.fs.exists(this.refLogsStashPath))return[];let r=await this.fs.read(this.refLogsStashPath,"utf8");return dc.getStashReflogEntry(r,e)}};a($n,"GitStashManager");var Ii=$n;async function s1({fs:t,dir:e,gitdir:r,message:i=""}){let n=new Ii({fs:t,dir:e,gitdir:r});await n.getAuthor();let o=await Qr({fs:t,gitdir:r,fullname:!1}),s=await B.resolve({fs:t,gitdir:r,ref:"HEAD"}),f=(await Lp({fs:t,dir:e,gitdir:r,oid:s})).commit.message,c=[s],u=null,h=ft({ref:"HEAD"}),d=await OE({fs:t,dir:e,gitdir:r,treePair:[ft({ref:"HEAD"}),"stage"]});if(d){let y=await n.writeStashCommit({message:`stash-Index: WIP on ${o} - ${new Date().toISOString()}`,tree:d,parent:c});c.push(y),u=d,h=Di()}let p=await OE({fs:t,dir:e,gitdir:r,treePair:[h,"workdir"]});if(p){let y=await n.writeStashCommit({message:`stash-WorkDir: WIP on ${o} - ${new Date().toISOString()}`,tree:p,parent:[c[c.length-1]]});c.push(y),u=p}if(!u||!d&&!p)throw new ce("changes, nothing to stash");let m=(i.trim()||`WIP on ${o}`)+`: ${s.substring(0,7)} ${f}`;return{stashCommit:await n.writeStashCommit({message:m,tree:u,parent:c}),stashMsg:m,branch:o,stashMgr:n}}a(s1,"_createStashCommit");async function j$({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n,stashMsg:o,branch:s,stashMgr:l}=await s1({fs:t,dir:e,gitdir:r,message:i});return await l.writeStashRef(n),await l.writeStashReflogEntry({stashCommit:n,message:o}),await Cp({fs:t,dir:e,gitdir:r,ref:s,track:!1,force:!0}),n}a(j$,"_stashPush");async function U$({fs:t,dir:e,gitdir:r,message:i=""}){let{stashCommit:n}=await s1({fs:t,dir:e,gitdir:r,message:i});return n}a(U$,"_stashCreate");async function a1({fs:t,dir:e,gitdir:r,refIdx:i=0}){let o=await new Ii({fs:t,dir:e,gitdir:r}).readStashCommit(i),{parent:s=null}=o.commit?o.commit:{};if(!(!s||!Array.isArray(s)))for(let l=0;l<s.length-1;l++){let c=(await Xn({fs:t,cache:{},gitdir:r,oid:s[l+1]})).commit.message.startsWith("stash-Index");await M$({fs:t,dir:e,gitdir:r,stashCommit:s[l+1],parentCommit:s[l],wasStaged:c})}}a(a1,"_stashApply");async function l1({fs:t,dir:e,gitdir:r,refIdx:i=0}){let n=new Ii({fs:t,dir:e,gitdir:r});if(!(await n.readStashCommit(i)).commit)return;let s=n.refStashPath;await Qn(s,async()=>{await t.exists(s)&&await t.rm(s)});let l=await n.readStashReflogs({parsed:!1});if(!l.length)return;l.splice(i,1);let f=n.refLogsStashPath;await Qn({reflogEntries:l,stashReflogPath:f,stashMgr:n},async()=>{if(l.length){await t.write(f,l.reverse().join(`
|
|
102
102
|
`)+`
|
|
103
|
-
`,"utf8");let c=l[l.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(f)})}a(a1,"_stashDrop");async function U$({fs:t,dir:e,gitdir:r}){return new Ii({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}a(U$,"_stashList");async function H$({fs:t,dir:e,gitdir:r}){let i=new Ii({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Jn(n,async()=>{await Promise.all(n.map(async o=>{if(await t.exists(o))return t.rm(o)}))})}a(H$,"_stashClear");async function q$({fs:t,dir:e,gitdir:r,refIdx:i=0}){await s1({fs:t,dir:e,gitdir:r,refIdx:i}),await a1({fs:t,dir:e,gitdir:r,refIdx:i})}a(q$,"_stashPop");async function l1({fs:t,dir:e,gitdir:r=D.join(e,".git"),op:i="push",message:n="",refIdx:o=0}){E("fs",t),E("dir",e),E("gitdir",r),E("op",i);let s={push:M$,apply:s1,drop:a1,list:U$,clear:H$,pop:q$,create:j$},l=["apply","drop","pop"];try{let f=new M(t);["refs","logs","logs/refs"].map(h=>D.join(r,h)).forEach(async h=>{await f.exists(h)||await f.mkdir(h)});let u=s[i];if(u){if(l.includes(i)&&o<0)throw new Bt(`stash@${o}`,"number that is in range of [0, num of stash pushed]");return await u({fs:f,dir:e,gitdir:r,message:n,refIdx:o})}throw new Error(`To be implemented: ${i}`)}catch(f){throw f.caller="git.stash",f}}a(l1,"stash");async function c1({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={}}){try{E("fs",t),E("gitdir",r),E("filepath",i);let o=new M(t);if(await Yr.isIgnored({fs:o,gitdir:r,dir:e,filepath:i}))return"ignored";let l=await z$({fs:o,cache:n,gitdir:r}),f=await f1({fs:o,cache:n,gitdir:r,tree:l,path:i}),c=await Fe.acquire({fs:o,gitdir:r,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),u=await o.lstat(D.join(e,i)),h=f!==null,d=c!==null,p=u!==null,m=a(async()=>{if(d&&!nc(c,u))return c.oid;{let w=await o.read(D.join(e,i)),y=await e1({gitdir:r,type:"blob",object:w});return d&&c.oid===y&&u.size!==-1&&Fe.acquire({fs:o,gitdir:r,cache:n},async function(v){v.insert({filepath:i,stats:u,oid:y})}),y}},"getWorkdirOid");if(!h&&!p&&!d)return"absent";if(!h&&!p&&d)return"*absent";if(!h&&p&&!d)return"*added";if(!h&&p&&d)return await m()===c.oid?"added":"*added";if(h&&!p&&!d)return"deleted";if(h&&!p&&d)return f===c.oid,"*deleted";if(h&&p&&!d)return await m()===f?"*undeleted":"*undeletemodified";if(h&&p&&d){let w=await m();return w===f?w===c.oid?"unmodified":"*unmodified":w===c.oid?"modified":"*modified"}}catch(o){throw o.caller="git.status",o}}a(c1,"status");async function f1({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let o=n.shift();for(let s of i)if(s.path===o){if(n.length===0)return s.oid;let{type:l,object:f}=await de({fs:t,cache:e,gitdir:r,oid:s.oid});if(l==="tree"){let c=tt.from(f);return f1({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(l==="blob")throw new Ze(s.oid,l,"blob",n.join("/"))}return null}a(f1,"getOidAtPath");async function z$({fs:t,cache:e,gitdir:r}){let i;try{i=await B.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(o){if(o instanceof ce)return[]}let{tree:n}=await eo({fs:t,cache:e,gitdir:r,oid:i});return n}a(z$,"getHeadTree");async function u1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:o,cache:s={},ignored:l=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let f=new M(t);return await Xr({fs:f,cache:s,dir:e,gitdir:r,trees:[ft({ref:i}),Qn(),Di()],map:a(async function(c,[u,h,d]){if(!u&&!d&&h&&!l&&await Yr.isIgnored({fs:f,dir:e,filepath:c})||!n.some(R=>YE(c,R)))return null;if(o&&!o(c))return;let[p,m,w]=await Promise.all([u&&u.type(),h&&h.type(),d&&d.type()]),y=[p,m,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((m==="tree"||m==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let v=p==="blob"?await u.oid():void 0,g=w==="blob"?await d.oid():void 0,F;p!=="blob"&&m==="blob"&&w!=="blob"?F="42":m==="blob"&&(F=await h.oid());let O=[void 0,v,F,g],S=O.map(R=>O.indexOf(R));return S.shift(),[c,...S]},"map")})}catch(f){throw f.caller="git.statusMatrix",f}}a(u1,"statusMatrix");async function h1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,force:o=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let s=new M(t);if(i===void 0)throw new et("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let l=await B.resolve({fs:s,gitdir:r,ref:n||"HEAD"});if(!o&&await B.exists({fs:s,gitdir:r,ref:i}))throw new Nt("tag",i);await B.writeRef({fs:s,gitdir:r,ref:i,value:l})}catch(s){throw s.caller="git.tag",s}}a(h1,"tag");async function d1({fs:t,dir:e,gitdir:r=D.join(e,".git"),cache:i={},filepath:n,oid:o,mode:s,add:l,remove:f,force:c}){try{E("fs",t),E("gitdir",r),E("filepath",n);let u=new M(t);if(f)return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!c){let p=await u.lstat(D.join(e,n));if(p){if(p.isDirectory())throw new Zr("directory");return}}d.has({filepath:n})&&d.delete({filepath:n})});let h;if(!o){if(h=await u.lstat(D.join(e,n)),!h)throw new ce(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Zr("directory")}return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!l&&!d.has({filepath:n}))throw new ce(`file at "${n}" in index and "add" not set`);let p;if(o)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};else{p=h;let m=p.isSymbolicLink()?await u.readlink(D.join(e,n)):await u.read(D.join(e,n));o=await it({fs:u,gitdir:r,type:"blob",format:"content",object:m})}return d.insert({filepath:n,oid:o,stats:p}),o})}catch(u){throw u.caller="git.updateIndex",u}}a(d1,"updateIndex$1");function p1(){try{return rf.version}catch(t){throw t.caller="git.version",t}}a(p1,"version");async function m1({fs:t,dir:e,gitdir:r=D.join(e,".git"),trees:i,map:n,reduce:o,iterate:s,cache:l={}}){try{return E("fs",t),E("gitdir",r),E("trees",i),await Xr({fs:new M(t),cache:l,dir:e,gitdir:r,trees:i,map:n,reduce:o,iterate:s})}catch(f){throw f.caller="git.walk",f}}a(m1,"walk");async function w1({fs:t,dir:e,gitdir:r=D.join(e,".git"),blob:i}){try{return E("fs",t),E("gitdir",r),E("blob",i),await it({fs:new M(t),gitdir:r,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}a(w1,"writeBlob");async function y1({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i}){try{return E("fs",t),E("gitdir",r),E("commit",i),await n1({fs:new M(t),gitdir:r,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}a(y1,"writeCommit");async function g1({fs:t,dir:e,gitdir:r=D.join(e,".git"),type:i,object:n,format:o="parsed",oid:s,encoding:l=void 0}){try{let f=new M(t);if(o==="parsed"){switch(i){case"commit":n=rt.from(n).toObject();break;case"tree":n=tt.from(n).toObject();break;case"blob":n=Buffer.from(n,l);break;case"tag":n=ut.from(n).toObject();break;default:throw new Ze(s||"",i,"blob|commit|tag|tree")}o="content"}return s=await it({fs:f,gitdir:r,type:i,object:n,oid:s,format:o}),s}catch(f){throw f.caller="git.writeObject",f}}a(g1,"writeObject");async function b1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,value:n,force:o=!1,symbolic:s=!1}){try{E("fs",t),E("gitdir",r),E("ref",i),E("value",n);let l=new M(t);if(!ms(i,!0))throw new Bt(i,ps.clean(i));if(!o&&await B.exists({fs:l,gitdir:r,ref:i}))throw new Nt("ref",i);s?await B.writeSymbolicRef({fs:l,gitdir:r,ref:i,value:n}):(n=await B.resolve({fs:l,gitdir:r,ref:n}),await B.writeRef({fs:l,gitdir:r,ref:i,value:n}))}catch(l){throw l.caller="git.writeRef",l}}a(b1,"writeRef");async function W$({fs:t,gitdir:e,tag:r}){let i=ut.from(r).toObject();return await it({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}a(W$,"_writeTag");async function v1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tag:i}){try{return E("fs",t),E("gitdir",r),E("tag",i),await W$({fs:new M(t),gitdir:r,tag:i})}catch(n){throw n.caller="git.writeTag",n}}a(v1,"writeTag");async function _1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tree:i}){try{return E("fs",t),E("gitdir",r),E("tree",i),await Cs({fs:new M(t),gitdir:r,tree:i})}catch(n){throw n.caller="git.writeTree",n}}a(_1,"writeTree");var V$={Errors:BE,STAGE:Di,TREE:ft,WORKDIR:Qn,add:UE,abortMerge:$E,addNote:VE,addRemote:KE,annotatedTag:ZE,branch:XE,checkout:Dp,clone:rS,commit:iS,getConfig:gS,getConfigAll:bS,setConfig:i1,currentBranch:nS,deleteBranch:oS,deleteRef:sS,deleteRemote:aS,deleteTag:lS,expandOid:cS,expandRef:fS,fastForward:dS,fetch:pS,findMergeBase:mS,findRoot:yS,getRemoteInfo:vS,getRemoteInfo2:FS,hashBlob:ES,indexPack:SS,init:xS,isDescendent:OS,isIgnored:RS,listBranches:kS,listFiles:AS,listNotes:IS,listRefs:DS,listRemotes:CS,listServerRefs:NS,listTags:BS,log:$S,merge:MS,packObjects:US,pull:HS,push:qS,readBlob:VS,readCommit:Bp,readNote:GS,readObject:KS,readTag:ZS,readTree:XS,remove:YS,removeNote:JS,renameBranch:QS,resetIndex:t1,updateIndex:d1,resolveRef:r1,status:c1,statusMatrix:u1,tag:h1,version:p1,walk:m1,writeBlob:w1,writeCommit:y1,writeObject:g1,writeRef:b1,writeTag:v1,writeTree:_1,stash:l1};L.Errors=BE;L.STAGE=Di;L.TREE=ft;L.WORKDIR=Qn;L.abortMerge=$E;L.add=UE;L.addNote=VE;L.addRemote=KE;L.annotatedTag=ZE;L.branch=XE;L.checkout=Dp;L.clone=rS;L.commit=iS;L.currentBranch=nS;L.default=V$;L.deleteBranch=oS;L.deleteRef=sS;L.deleteRemote=aS;L.deleteTag=lS;L.expandOid=cS;L.expandRef=fS;L.fastForward=dS;L.fetch=pS;L.findMergeBase=mS;L.findRoot=yS;L.getConfig=gS;L.getConfigAll=bS;L.getRemoteInfo=vS;L.getRemoteInfo2=FS;L.hashBlob=ES;L.indexPack=SS;L.init=xS;L.isDescendent=OS;L.isIgnored=RS;L.listBranches=kS;L.listFiles=AS;L.listNotes=IS;L.listRefs=DS;L.listRemotes=CS;L.listServerRefs=NS;L.listTags=BS;L.log=$S;L.merge=MS;L.packObjects=US;L.pull=HS;L.push=qS;L.readBlob=VS;L.readCommit=Bp;L.readNote=GS;L.readObject=KS;L.readTag=ZS;L.readTree=XS;L.remove=YS;L.removeNote=JS;L.renameBranch=QS;L.resetIndex=t1;L.resolveRef=r1;L.setConfig=i1;L.stash=l1;L.status=c1;L.statusMatrix=u1;L.tag=h1;L.updateIndex=d1;L.version=p1;L.walk=m1;L.writeBlob=w1;L.writeCommit=y1;L.writeObject=g1;L.writeRef=b1;L.writeTag=v1;L.writeTree=_1});var L1=T((Kq,B1)=>{B1.exports=function(t,e){var r=[];t.on("data",function(i){r.push(i)}),t.once("end",function(){e&&e(null,Buffer.concat(r)),e=null}),t.once("error",function(i){e&&e(i),e=null})}});var $1=T(()=>{});var am=T(xt=>{xt.fetch=Ls(globalThis.fetch)&&Ls(globalThis.ReadableStream);xt.writableStream=Ls(globalThis.WritableStream);xt.abortController=Ls(globalThis.AbortController);var ti;function om(){if(ti!==void 0)return ti;if(globalThis.XMLHttpRequest){ti=new globalThis.XMLHttpRequest;try{ti.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{ti=null}}else ti=null;return ti}a(om,"getXHR");function sm(t){var e=om();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch{}return!1}a(sm,"checkTypeSupport");xt.arraybuffer=xt.fetch||sm("arraybuffer");xt.msstream=!xt.fetch&&sm("ms-stream");xt.mozchunkedarraybuffer=!xt.fetch&&sm("moz-chunked-arraybuffer");xt.overrideMimeType=xt.fetch||(om()?Ls(om().overrideMimeType):!1);function Ls(t){return typeof t=="function"}a(Ls,"isFunction");ti=null});var wf=T((Tt,M1)=>{Tt=M1.exports=Ka();Tt.Stream=Tt;Tt.Readable=Tt;Tt.Writable=Wa();Tt.Duplex=Cr();Tt.Transform=il();Tt.PassThrough=bh();Tt.finished=Bo();Tt.pipeline=_h()});var fm=T(cm=>{var j1=am(),Y$=Gt(),U1=wf(),yf=cm.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},lm=cm.IncomingMessage=function(t,e,r,i){var n=this;if(U1.Readable.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})}),r==="fetch"){let h=function(){s.read().then(function(d){if(!n._destroyed){if(i(d.done),d.done){n.push(null);return}n.push(Buffer.from(d.value)),h()}}).catch(function(d){i(!0),n._destroyed||n.emit("error",d)})};var u=h;if(a(h,"read"),n._fetchResponse=e,n.url=e.url,n.statusCode=e.status,n.statusMessage=e.statusText,e.headers.forEach(function(d,p){n.headers[p.toLowerCase()]=d,n.rawHeaders.push(p,d)}),j1.writableStream){var o=new WritableStream({write:a(function(d){return i(!1),new Promise(function(p,m){n._destroyed?m():n.push(Buffer.from(d))?p():n._resumeFetch=p})},"write"),close:a(function(){i(!0),n._destroyed||n.push(null)},"close"),abort:a(function(d){i(!0),n._destroyed||n.emit("error",d)},"abort")});try{e.body.pipeTo(o).catch(function(d){i(!0),n._destroyed||n.emit("error",d)});return}catch{}}var s=e.body.getReader();h()}else{n._xhr=t,n._pos=0,n.url=t.responseURL,n.statusCode=t.status,n.statusMessage=t.statusText;var l=t.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(h){var d=h.match(/^([^:]+):\s*(.*)/);if(d){var p=d[1].toLowerCase();p==="set-cookie"?(n.headers[p]===void 0&&(n.headers[p]=[]),n.headers[p].push(d[2])):n.headers[p]!==void 0?n.headers[p]+=", "+d[2]:n.headers[p]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!j1.overrideMimeType){var f=n.rawHeaders["mime-type"];if(f){var c=f.match(/;\s*charset=([^;])(;|$)/);c&&(n._charset=c[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};Y$(lm,U1.Readable);lm.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};lm.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if(i=r.responseText,i.length>e._pos){var n=i.substr(e._pos);if(e._charset==="x-user-defined"){for(var o=Buffer.alloc(n.length),s=0;s<n.length;s++)o[s]=n.charCodeAt(s)&255;e.push(o)}else e.push(n,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==yf.DONE||!r.response)break;i=r.response,e.push(Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==yf.LOADING||!i)break;e.push(Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==yf.LOADING)break;var l=new globalThis.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(Buffer.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(i);break}e._xhr.readyState===yf.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))}});var W1=T((t3,z1)=>{var Li=am(),J$=Gt(),q1=fm(),um=wf(),Q$=q1.IncomingMessage,H1=q1.readyStates;function eM(t,e){return Li.fetch&&e?"fetch":Li.mozchunkedarraybuffer?"moz-chunked-arraybuffer":Li.msstream?"ms-stream":Li.arraybuffer&&t?"arraybuffer":"text"}a(eM,"decideMode");var We=z1.exports=function(t){var e=this;um.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(n){e.setHeader(n,t.headers[n])});var r,i=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!Li.abortController)i=!1,r=!0;else if(t.mode==="prefer-streaming")r=!1;else if(t.mode==="allow-wrong-content-type")r=!Li.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");e._mode=eM(r,i),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};J$(We,um.Writable);We.prototype.setHeader=function(t,e){var r=this,i=t.toLowerCase();rM.indexOf(i)===-1&&(r._headers[i]={name:t,value:e})};We.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};We.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};We.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var r=t._headers,i=null;e.method!=="GET"&&e.method!=="HEAD"&&(i=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var n=[];if(Object.keys(r).forEach(function(f){var c=r[f].name,u=r[f].value;Array.isArray(u)?u.forEach(function(h){n.push([c,h])}):n.push([c,u])}),t._mode==="fetch"){var o=null;if(Li.abortController){var s=new AbortController;o=s.signal,t._fetchAbortController=s,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=globalThis.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}globalThis.fetch(t._opts.url,{method:t._opts.method,headers:n,body:i||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:o}).then(function(f){t._fetchResponse=f,t._resetTimers(!1),t._connect()},function(f){t._resetTimers(!0),t._destroyed||t.emit("error",f)})}else{var l=t._xhr=new globalThis.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(f){process.nextTick(function(){t.emit("error",f)});return}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),n.forEach(function(f){l.setRequestHeader(f[0],f[1])}),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case H1.LOADING:case H1.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{l.send(i)}catch(f){process.nextTick(function(){t.emit("error",f)});return}}}};function tM(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}a(tM,"statusValid");We.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!tM(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};We.prototype._connect=function(){var t=this;t._destroyed||(t._response=new Q$(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};We.prototype._write=function(t,e,r){var i=this;i._body.push(t),r()};We.prototype._resetTimers=function(t){var e=this;globalThis.clearTimeout(e._socketTimer),e._socketTimer=null,t?(globalThis.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=globalThis.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};We.prototype.abort=We.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};We.prototype.end=function(t,e,r){var i=this;typeof t=="function"&&(r=t,t=void 0),um.Writable.prototype.end.call(i,t,e,r)};We.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)};We.prototype.flushHeaders=function(){};We.prototype.setNoDelay=function(){};We.prototype.setSocketKeepAlive=function(){};var rM=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]});var G1=T((i3,V1)=>{V1.exports=nM;var iM=Object.prototype.hasOwnProperty;function nM(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)iM.call(r,i)&&(t[i]=r[i])}return t}a(nM,"extend")});var Z1=T((o3,K1)=>{K1.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}});var hm=T(Y1=>{var X1=W1(),oM=fm(),sM=G1(),aM=Z1(),lM=Ro(),Lt=Y1;Lt.request=function(t,e){typeof t=="string"?t=lM.parse(t):t=sM(t);var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",i=t.protocol||r,n=t.hostname||t.host,o=t.port,s=t.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var l=new X1(t);return e&&l.on("response",e),l};Lt.get=a(function(e,r){var i=Lt.request(e,r);return i.end(),i},"get");Lt.ClientRequest=X1;Lt.IncomingMessage=oM.IncomingMessage;Lt.Agent=function(){};Lt.Agent.defaultMaxSockets=4;Lt.globalAgent=new Lt.Agent;Lt.STATUS_CODES=aM;Lt.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]});var ex=T((l3,Q1)=>{var $s=hm(),cM=Ro(),dm=Q1.exports;for(gf in $s)$s.hasOwnProperty(gf)&&(dm[gf]=$s[gf]);var gf;dm.request=function(t,e){return t=J1(t),$s.request.call(this,t,e)};dm.get=function(t,e){return t=J1(t),$s.get.call(this,t,e)};function J1(t){if(typeof t=="string"&&(t=cM.parse(t)),t.protocol||(t.protocol="https:"),t.protocol!=="https:")throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a(J1,"validateParams")});var ix=T((f3,rx)=>{rx.exports=tx;function tx(t,e){if(t&&e)return tx(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(l){o[l]=s[l]}),o}a(r,"wrapper")}a(tx,"wrappy")});var sx=T((h3,pm)=>{var nx=ix();pm.exports=nx(bf);pm.exports.strict=nx(ox);bf.proto=bf(function(){Object.defineProperty(Function.prototype,"once",{value:a(function(){return bf(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:a(function(){return ox(this)},"value"),configurable:!0})});function bf(t){var e=a(function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))},"f");return e.called=!1,e}a(bf,"once");function ox(t){var e=a(function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},"f"),r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}a(ox,"onceStrict")});var lx=T((p3,ax)=>{"use strict";function fM(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(fM,"hasOwnProperty");ax.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var c=t[f].replace(o,"%20"),u=c.indexOf(r),h,d,p,m;u>=0?(h=c.substr(0,u),d=c.substr(u+1)):(h=c,d=""),p=decodeURIComponent(h),m=decodeURIComponent(d),fM(n,p)?uM(n[p])?n[p].push(m):n[p]=[n[p],m]:n[p]=m}return n};var uM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var ux=T((w3,fx)=>{"use strict";var Ms=a(function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},"stringifyPrimitive");fx.exports=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?cx(dM(t),function(n){var o=encodeURIComponent(Ms(n))+r;return hM(t[n])?cx(t[n],function(s){return o+encodeURIComponent(Ms(s))}).join(e):o+encodeURIComponent(Ms(t[n]))}).join(e):i?encodeURIComponent(Ms(i))+r+encodeURIComponent(Ms(t)):""};var hM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function cx(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}a(cx,"map");var dM=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}});var hx=T(js=>{"use strict";js.decode=js.parse=lx();js.encode=js.stringify=ux()});var wx=T((b3,mx)=>{mx.exports=oo;var pM=L1(),dx=$1(),mM=hm(),wM=ex(),yM=sx(),gM=hx(),px=Ro(),mm=a(t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function","isStream");function oo(t,e){if(t=Object.assign({maxRedirects:10},typeof t=="string"?{url:t}:t),e=yM(e),t.url){let{hostname:l,port:f,protocol:c,auth:u,path:h}=px.parse(t.url);delete t.url,!l&&!f&&!c&&!u?t.path=h:Object.assign(t,{hostname:l,port:f,protocol:c,auth:u,path:h})}let r={"accept-encoding":"gzip, deflate"};t.headers&&Object.keys(t.headers).forEach(l=>r[l.toLowerCase()]=t.headers[l]),t.headers=r;let i;t.body?i=t.json&&!mm(t.body)?JSON.stringify(t.body):t.body:t.form&&(i=typeof t.form=="string"?t.form:gM.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),i&&(t.method||(t.method="POST"),mm(i)||(t.headers["content-length"]=Buffer.byteLength(i)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());let n=t.hostname,s=(t.protocol==="https:"?wM:mM).request(t,l=>{if(t.followRedirects!==!1&&l.statusCode>=300&&l.statusCode<400&&l.headers.location){t.url=l.headers.location,delete t.headers.host,l.resume();let c=px.parse(t.url).hostname;return c!==null&&c!==n&&(delete t.headers.cookie,delete t.headers.authorization),t.method==="POST"&&[301,302].includes(l.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),t.maxRedirects--===0?e(new Error("too many redirects")):oo(t,e)}let f=typeof dx=="function"&&t.method!=="HEAD";e(null,f?dx(l):l)});return s.on("timeout",()=>{s.abort(),e(new Error("Request timed out"))}),s.on("error",e),mm(i)?i.on("error",e).pipe(s):s.end(i),s}a(oo,"simpleGet");oo.concat=(t,e)=>oo(t,(r,i)=>{if(r)return e(r);pM(i,(n,o)=>{if(n)return e(n);if(t.json)try{o=JSON.parse(o.toString())}catch(s){return e(s,i,o)}e(null,i,o)})});["get","post","put","patch","head","delete"].forEach(t=>{oo[t]=(e,r)=>(typeof e=="string"&&(e={url:e}),oo(Object.assign({method:t.toUpperCase()},e),r))})});var Gh=ae(Sr(),1);var Ef=class Ef{constructor(e,r){H(this,"entries",[]);H(this,"currentIndex",0);H(this,"closed",!1);H(this,"compositFs");H(this,"dirPath");H(this,"initialized",!1);this.compositFs=e,this.dirPath=r}async initialize(){if(this.initialized)return;let e=new Set;for(let r of[...this.compositFs.subFilesystems].reverse()){let i=await r.readdir(this.dirPath);for(let n of i)e.add(n)}for(let r of Array.from(e)){let i=this.dirPath+"/"+r;await this.compositFs.hiddenFilesFileSystem?.responsible(i)||this.entries.push({name:r,path:i})}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);yield{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${e.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);return{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};a(Ef,"CompositeFsDir");var ji=Ef;var Sf=class Sf{constructor(e){H(this,"delegate");H(this,"_subFsFileDescriptor");H(this,"handleType","file");H(this,"_compositFsFileDescriptor",-1);this.delegate=e.fs,this._subFsFileDescriptor=e.subFsFileDescriptor,this._compositFsFileDescriptor=-1;let r=e.fs.fileType(),i=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(e){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=e}readableWebStream(e){throw new Error("Method not implemented.")}async appendFile(e,r){return await this.delegate.appendFile(this,e,r)}async chmod(e){return this.delegate.fchmod(this,e)}async chown(e,r){return this.delegate.fchown(this,e,r)}async close(){return this.delegate.close(this)}async datasync(){return this.delegate.dataSync(this)}async read(e,r,i,n){return await this.delegate.read(this,e,r,i,n)}readv(e,r){return this.delegate.readv(this,e,r)}async stat(e){return this.delegate.fstat(this,e)}async truncate(e){return this.delegate.ftruncate(this,e)}async utimes(e,r){return this.delegate.futimes(this,e,r)}async write(e,r,i,n){return this.delegate.write(this,e,r,i,n)}async writev(e,r){return this.delegate.writev(this,e,r)}async sync(){return this.delegate.dataSync(this)}};a(Sf,"CompositFsFileHandle");var kt=Sf;var $b=ae(Sr(),1),El=ae(qo(),1);var zh=class zh{constructor({parentFs:e,gitRoot:r}){H(this,"compositFs");H(this,"gitRoot");this.compositFs=e,this.gitRoot=r}toStr(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():e&&typeof e=="object"&&"fd"in e?`FileHandle(fd=${e.fd})`:String(e)}async open(e,r,i){throw new Error(`open not implemented for: ${this.toStr(e)}`)}async access(e,r){throw new Error(`access not implemented for: ${this.toStr(e)}`)}async stat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async lstat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async opendir(e,r){throw new Error(`opendir not implemented for: ${this.toStr(e)}`)}async link(e,r){throw new Error(`link not implemented for: ${this.toStr(e)}`)}async mkdir(e,r){throw new Error(`mkdir not implemented for: ${this.toStr(e)}`)}async readdir(e,r){throw new Error(`readdir not implemented for: ${this.toStr(e)}`)}async readlink(e,...r){throw new Error(`readlink not implemented for: ${this.toStr(e)}`)}async unlink(e){throw new Error(`unlink not implemented for: ${this.toStr(e)}`)}async rename(e,r){throw new Error(`rename not implemented for: ${this.toStr(e)}`)}async rmdir(e,...r){throw new Error(`rmdir not implemented for: ${this.toStr(e)}`)}async symlink(e,r,i){throw new Error(`symlink not implemented for: ${this.toStr(r)}`)}async lookup(e){throw new Error(`lookup not implemented for: ${this.toStr(e)}`)}resolvePath(e){throw new Error(`resolvePath not implemented for fd: ${e}`)}async close(e){this.compositFs.close(e)}async dataSync(e){throw new Error(`dataSync not implemented for: ${e.subFsFileDescriptor}`)}async read(e,r,i,n,o){throw new Error(`read not implemented for: ${e.subFsFileDescriptor}`)}async appendFile(e,r,i){throw new Error(`appendFile not implemented for: ${e.subFsFileDescriptor}`)}async fchmod(e,r){throw new Error(`fchmod not implemented for: ${e.subFsFileDescriptor}`)}async fchown(e,r,i){throw new Error(`fchown not implemented for: ${e.subFsFileDescriptor}`)}async ftruncate(e,r){throw new Error(`ftruncate not implemented for: ${e.subFsFileDescriptor}`)}async fstat(e,r){throw new Error(`fstat not implemented for: ${e.subFsFileDescriptor}`)}async futimes(e,r,i){throw new Error(`futimes not implemented for: ${e.subFsFileDescriptor}`)}async write(e,r,i,n,o){throw new Error(`write not implemented for: ${e.subFsFileDescriptor}`)}async writev(e,r,i){throw new Error(`writev not implemented for: ${e.subFsFileDescriptor}`)}async readv(e,r,i){throw new Error(`readv not implemented for: ${e.subFsFileDescriptor}`)}async readFile(e,r){throw new Error(`readFile not implemented for: ${this.toStr(e)}`)}async writeFile(e,r,i){throw new Error(`writeFile not implemented for: ${this.toStr(e)}`)}};a(zh,"BaseCompositeSubFs");var vt=zh;var Wh=class Wh extends vt{constructor({parentFs:r,gitRoot:i}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,El.createFsFromVolume)(new El.Volume));H(this,"targetFs");if(this.compositFs=r,this.gitRoot=i,this.compositFs.parentFs===void 0)throw new Error("PassThroughSubFs not allowed in root fs");this.targetFs=this.compositFs.parentFs}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=$b.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[s.fd]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){return await this.targetFs.promises.opendir(r,i)}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){let n=typeof r=="string"?r:r.toString();return await this.targetFs.promises.mkdir(n,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return typeof r=="string"||Buffer.isBuffer(r)?this.targetFs.readFile(r.toString(),i):super.readFile(r,i)}async writeFile(r,i,n){let o=typeof n=="object"&&n.flag?n.flag:"w",s=await this.targetFs.open(r,o);try{let l;if(typeof i=="string"){let f=typeof n=="object"&&n.encoding?n.encoding:"utf8";l=Buffer.from(i,f)}else Buffer.isBuffer(i)?l=i:l=Buffer.from(i);await s.write(l,0,l.length,0)}finally{await this.targetFs.close(s)}}};a(Wh,"PassThroughSubFs");var Fl=Wh;var Mb=ae(Sr(),1),xl=ae(qo(),1);var Vh=class Vh extends vt{constructor({parentFs:r,gitRoot:i,passThroughFs:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,xl.createFsFromVolume)(new xl.Volume));H(this,"targetFs");this.compositFs=r,this.gitRoot=i,this.targetFs=n}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=Mb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,...i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){let n=await this.targetFs.promises.opendir(r,i);return new ji(this.compositFs,r.toString())}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){await this.targetFs.promises.mkdir(r,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return this.targetFs.promises.readFile(r,i)}async writeFile(r,i,n){return this.targetFs.promises.writeFile(r,i,n)}};a(Vh,"PassThroughToAsyncFsSubFs");var Sl=Vh;var Kh=class Kh{constructor({name:e,parentFs:r,storageFs:i,gitRoot:n}){H(this,"promises");H(this,"gitRoot");H(this,"ephemeralFilesFileSystem");H(this,"hiddenFilesFileSystem");H(this,"passThroughFileSystem");H(this,"subFilesystems",[]);H(this,"parentFs");H(this,"name");H(this,"pathToFileDescriptors",new Map);H(this,"openFileHandles",new Map);if(this.name=e,this.parentFs=r,this.gitRoot=n,this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)},!r&&i){this.passThroughFileSystem=new Sl({passThroughFs:i,gitRoot:n,parentFs:this});return}if(!i&&r){this.passThroughFileSystem=new Fl({parentFs:this,gitRoot:n});return}throw new Error("invalid configuration")}getNextFileDescriptor(){let e=Array.from(this.openFileHandles.keys());return e.length===0?1:Math.max(...e)+1}getFilehandle(e){return this.openFileHandles.get(e)}setEphemeralFilesSubFs(e){this.ephemeralFilesFileSystem=e}setHiddenFilesSubFs(e){this.hiddenFilesFileSystem=e}addSubFs(e){this.subFilesystems.push(e)}async getResponsibleFs(e){if(!e.toString().startsWith(this.gitRoot)&&this.gitRoot!=="./")throw new Error("tried to access a file ("+e+") outside of the legit folder: "+this.gitRoot);if(!this.hiddenFilesFileSystem)throw new Error(this.name+" intialize hidden fs first!");if(!this.ephemeralFilesFileSystem)throw new Error(this.name+" intialize ephemeral fs first!");if(await this.hiddenFilesFileSystem.responsible(e.toString()))return this.hiddenFilesFileSystem;if(await this.ephemeralFilesFileSystem.responsible(e.toString()))return this.ephemeralFilesFileSystem;for(let r of this.subFilesystems)if(await r.responsible(e.toString()))return r;return this.passThroughFileSystem}async access(e,r){return(await this.getResponsibleFs(e)).access(e,r)}async opendir(e,r){let i=e.toString();if(!i.startsWith(this.gitRoot))throw new Error("tried to access a directory ("+i+") outside of the legit folder: "+this.gitRoot);return new ji(this,i)}async mkdir(e,r){return(await this.getResponsibleFs(e)).mkdir(e,r)}async readdir(e,r){let i=await this.getResponsibleFs(e);if(i!==this.passThroughFileSystem)return i.readdir(e,r);let n=new Set;for(let s of[...this.subFilesystems].reverse()){let l=await s.readdir(e,r);for(let f of l)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+f)||n.add(f)}let o=await this.passThroughFileSystem.readdir(e,r);for(let s of o)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+s)||n.add(s);try{let s=await this.ephemeralFilesFileSystem.readdir(e,r);for(let l of s)n.add(l)}catch(s){console.log(s.code)}for(let s of n){let l=(e=="/"?"":e)+"/"+s;await this.hiddenFilesFileSystem.responsible(l)&&n.delete(s)}return Array.from(n)}async open(e,r,i){let o=await(await this.getResponsibleFs(e)).open(e,r,i),s=this.getNextFileDescriptor();return o.realize(s),this.openFileHandles.set(s,o),this.pathToFileDescriptors.get(e)||this.pathToFileDescriptors.set(e,[]),this.pathToFileDescriptors.get(e).push(s),o}async close(e){for(let[r,i]of this.pathToFileDescriptors.entries()){let n=i.indexOf(e.fd);if(n!==-1){i.splice(n,1),i.length===0&&this.pathToFileDescriptors.delete(r);break}}}async stat(e,r){let i=e.toString();return(await this.getResponsibleFs(e)).stat(e)}async lstat(e,r){return(await this.getResponsibleFs(e)).lstat(e,r)}async link(e,r){throw new Error("not implemented")}async readlink(e,r){throw new Error("not implemented")}async unlink(e){return(await this.getResponsibleFs(e)).unlink(e)}async rename(e,r){if(this.hiddenFilesFileSystem){if(await this.hiddenFilesFileSystem.responsible(Gh.basename(e.toString())))throw new Error("Renaming of hidden Files is not allowed "+e);if(await this.hiddenFilesFileSystem.responsible(Gh.basename(r.toString())))throw new Error("Renaming to hidden Files is not allowed "+r)}let i=await this.getResponsibleFs(e),n=await this.getResponsibleFs(r);if(i===n)return i.rename(e,r);let o=await i.open(e.toString(),"r");try{let s=await i.fstat(o),l=Buffer.alloc(s.size);await i.read(o,l,0,s.size,0),await i.close(o),await n.writeFile(r.toString(),l,"utf8"),await i.unlink(e)}catch(s){try{await i.close(o)}catch{}throw s}}async rmdir(e,r){return(await this.getResponsibleFs(e)).rmdir(e,r)}async symlink(e,r,i){throw new Error("not implemented")}async readFile(e,r){let i=!0,n;if(typeof e=="number"){i=!1;let o=this.getFilehandle(e);if(!o)throw new Error("Invalid file descriptor");n=o}else if(typeof e=="string")n=await this.open(e,"r");else throw new Error("only filehandle and path are supported atm");try{let s=(await n.stat()).size;if(typeof s=="bigint"){if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");s=Number(s)}let l=Buffer.alloc(s),{bytesRead:f}=await n.read(l,0,s,0);if(r&&typeof r.encoding=="string")return l.slice(0,f).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return l.slice(0,f).toString(r);throw new Error("Unsupported encoding: "+r)}return l.slice(0,f)}finally{n&&i&&await n.close()}}async writeFile(e,r,i){let n=typeof e!="number",o,s,l,f="w";if(typeof i=="string"?s=i:i&&typeof i=="object"&&(s=i.encoding,l=i.mode,f=i.flag||"w"),typeof e=="number"){let c=this.getFilehandle(e);if(!c)throw new Error("Invalid file descriptor");o=c}else if(typeof e=="string")o=await this.open(e,f,l);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,s||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let u=0;for(;u<c.length;){let{bytesWritten:h}=await o.write(c,u,c.length-u,u);u+=h}}finally{o&&n&&await o.close()}}};a(Kh,"CompositeFs");var zo=Kh;var Kb=ae(nd(),1);var od=class od extends vt{constructor({parentFs:r,gitRoot:i,hiddenFiles:n}){super({parentFs:r,gitRoot:i});H(this,"ig");this.ig=(0,Kb.default)(),this.ig.add(n)}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${this.toStr(r)}`)}async open(r,i,n){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,i){throw this.error(i)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,i,n,o,s){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};a(od,"HiddenFileSubFs");var Vo=od;var kl=ae(Sr(),1),Pl=ae(qo(),1);var Zb=ae(nd(),1);var sd=class sd extends vt{constructor({parentFs:r,gitRoot:i,ephemeralPatterns:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,Pl.createFsFromVolume)(new Pl.Volume));H(this,"ig");H(this,"patterns");this.compositFs=r,this.gitRoot=i,this.ig=(0,Zb.default)(),this.ig.add(n),this.patterns=n}normalizePath(r){let i=typeof r=="string"?r:r.toString();return i.startsWith("/")?i:"/"+i}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 5}async open(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0});let l=await this.memFs.promises.open(o,i,n);return this.openFh.set(l.fd,l),new kt({fs:this,subFsFileDescriptor:l.fd,parentFsFileDescriptors:[l.fd]})}async access(r,i){let n=this.normalizePath(r);return await this.memFs.promises.access(n,i)}async stat(r,i){let n=this.normalizePath(r);return this.memFs.promises.stat(n,{bigint:!1})}async lstat(r,i){let n=this.normalizePath(r);return this.memFs.promises.lstat(n,{bigint:!1})}async opendir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.opendir(n,i)}async link(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.link(n,o)}async mkdir(r,i){let n=this.normalizePath(r);if(!(typeof i=="object"&&i&&"recursive"in i&&i.recursive)){let s=kl.dirname(n);if(s&&s!=="/"&&s!==".")try{await this.memFs.promises.stat(s)}catch{await this.memFs.promises.mkdir(s,{recursive:!0})}}await this.memFs.promises.mkdir(n,i)}async readdir(r,...i){let n=this.normalizePath(r),o=await this.memFs.promises.readdir(n,...i);return console.log("EPHEMERAL: READDIR: ",o),o}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let i=this.normalizePath(r);return await this.memFs.promises.unlink(i)}async rename(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.rename(n,o)}async rmdir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.rmdir(n,i)}async symlink(r,i,n){let o=this.normalizePath(r),s=this.normalizePath(i);return await this.memFs.promises.symlink(o,s,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.datasync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){if(typeof r=="string"||Buffer.isBuffer(r)){let n=this.normalizePath(r);return this.memFs.promises.readFile(n,i)}return super.readFile(r,i)}async writeFile(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);return s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0}),this.memFs.promises.writeFile(o,i,n)}};a(sd,"EphemeralSubFs");var Go=sd;var nm=ae(Sr(),1),pf=ae(qo(),1);var nf=ae(Me(),1);var of={type:"gitBranchesListVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await nf.default.listBranches({fs:e,dir:t}),i=await nf.default.currentBranch({fs:e,dir:t}),n=await Promise.all(r.map(async o=>{let s=await nf.default.resolveRef({fs:e,dir:t,ref:o});return o}));return{type:"directory",content:n,mode:493,size:n}}catch(r){throw r}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ue=ae(Me(),1);var _r=ae(Me(),1);async function Fr(t,e,r){try{return await _r.default.resolveRef({fs:t,dir:e,ref:`refs/heads/${r}`})}catch{return}}a(Fr,"tryResolveRef");async function to({dir:t,fs:e,treeOid:r,deletePathParts:i,addPathParts:n,addObj:o}){let[s,...l]=n??[],[f,...c]=i??[],u=[];if(r){let{tree:h}=await _r.default.readTree({fs:e,dir:t,oid:r});u=[...h]}if(s===f){let h=s;if(h===void 0)throw new Error("illegal arguement - called with out a path part");if(l.length===0)throw new Error("can not move into it self");if(c.length===0)throw new Error("can not move from it self");let d=u.findIndex(v=>v.path===h),m=(d!==-1?u[d]:void 0)?.oid,w=await to({dir:t,fs:e,treeOid:m,addPathParts:l,deletePathParts:c,addObj:o});if(w===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let y=!1;if(w!==m){y=!0;let v={mode:"040000",path:h,oid:w,type:"tree"};d!==-1?u[d]=v:u.push(v)}if(r==null&&!y)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(y)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let h=!1,d;if(f){let p=u.findIndex(w=>w.path===f),m=p!==-1?u[p]:void 0;if(m===void 0)throw new Error("Element doesnt exist in tree");if(c.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let w=await to({dir:t,fs:e,treeOid:m.oid,addPathParts:void 0,deletePathParts:c,addObj:o});if(w===m.oid)throw new Error("in case of a delete we expect a different subtree oid");h=!0,w===void 0?u.splice(p,1):u[p]={mode:"040000",path:f,oid:w,type:"tree"}}else h=!0,u.splice(p,1);d=m}if(s){let p=u.findIndex(w=>w.path===s),m=p!==-1?u[p]:void 0;if(l.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let w=await to({dir:t,fs:e,treeOid:m?.oid,addPathParts:l,deletePathParts:void 0,addObj:o});if(w===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(w!==m?.oid){h=!0;let y={mode:"040000",path:s,oid:w,type:"tree"};p!==-1?u[p]=y:u.push(y)}}else{h=!0;let w={mode:o.type==="tree"?"040000":"100644",path:s,oid:o.oid,type:o.type};p!==-1?u[p]=w:u.push(w)}}if(u.length===0)return;if(h)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}a(to,"buildUpdatedTree");async function Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:i,pathParams:n}){if(!n.filePath){let l=await _r.default.readTree({fs:r,dir:e,oid:i});return{type:"tree",entries:l.tree.map(c=>c.path),oid:l.oid}}return(await _r.default.walk({fs:r,dir:e,trees:[_r.default.TREE({ref:i})],map:a(async(l,[f])=>{if(l===n.filePath&&f){let c=await f.type();if(c==="blob")return{type:"blob",oid:await f.oid()};if(c=="tree"){let u=await _r.default.readTree({fs:r,dir:e,oid:await f.oid()});return{type:"tree",entries:u.tree.map(d=>d.path),oid:u.oid}}}},"map")})).find(l=>l!==void 0)}a(Ci,"resolveGitObjAtPath");var sf=class sf extends Error{constructor(r,i){super(r);H(this,"code","ENOENT");H(this,"path");this.name="ENOENTError",this.path=i,Object.setPrototypeOf(this,sf.prototype)}};a(sf,"ENOENTError");var Ni=sf;async function F1(t,e,r,i){let[n,...o]=i;if(!n)return r;let{tree:s}=await ue.default.readTree({fs:t,dir:e,oid:r}),l=[...s],f=l.findIndex(c=>c.path===n);if(f===-1)return r;if(o.length===0)l.splice(f,1);else{let c=l[f];if(c&&c.type==="tree"){let u=await F1(t,e,c.oid,o);if(u!==c.oid)l[f]={mode:c.mode,path:c.path,type:c.type,oid:u};else return r}else return r}return await ue.default.writeTree({fs:t,dir:e,tree:l})}a(F1,"buildTreeWithoutFile");var ro={type:"gitBranchFileVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,filePath:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=await Fr(e,t,n.branchName);if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let s=await Ci({filePath:r,gitRoot:t,nodeFs:e,commitSha:o,pathParams:n});if(!s)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let l=await ue.default.readCommit({fs:e,dir:t,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;if(s.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)};{let{blob:u}=await ue.default.readBlob({fs:e,dir:t,oid:s.oid});return{mode:420,size:u.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(u.length/4096),atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=[];try{let s=await Fr(r,e,n.branchName),l=await Fr(r,e,"refs/heads/"+n.branchName);if(!s){let c=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:n.branchName,object:c}),s=await ue.default.resolveRef({fs:r,ref:`refs/heads/${n.branchName}`,dir:e})}let f=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:s,pathParams:n});if(!f)return;if(f.type==="blob"){let{blob:c}=await ue.default.readBlob({fs:r,dir:e,oid:f.oid});return{type:"file",content:Buffer.from(c),mode:420,size:c.length,oid:f.oid}}else{let c=[];try{let h=await i.promises.stat(t);if(h&&h.isDirectory()){let d=await i.promises.readdir(t,{withFileTypes:!1,encoding:"utf-8"});c.push(...d.filter(p=>p!==".keep"))}}catch{}return{type:"directory",content:Array.from(new Set([...f.entries.filter(h=>h!==".keep"),...c])),mode:493}}}catch{return}},"getFile"),unlink:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(!n.branchName)throw new Error("branchName should be in pathParams");if(!n.filePath)throw new Error("filePath should be in pathParams");let o=await ue.default.resolveRef({fs:r,dir:e,ref:n.branchName}),s=await ue.default.readTree({fs:r,dir:e,oid:o}),l=await F1(r,e,s.oid,n.filePath.split("/"));if(l!==s.oid){let f=await ue.default.commit({fs:r,dir:e,message:`Delete ${n.filePath}`,tree:l,noUpdateBranch:!0,parent:[o],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${n.branchName}`,value:f,force:!0})}},"unlink"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");if(o.filePath===void 0)throw new Error("filePath should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await ue.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f){let h=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:o.branchName,object:h}),f=await ue.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`})}let c=await ue.default.readTree({fs:r,dir:e,oid:f}),u=await to({dir:e,fs:r,treeOid:c.oid,addPathParts:o.filePath.split("/"),deletePathParts:void 0,addObj:{type:"blob",oid:l}});if(u!==c.oid){let h=await ue.default.commit({fs:r,dir:e,message:`\u{1F4BE} Change '${o.filePath}'`,tree:u,noUpdateBranch:!0,parent:[f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){if(n.branchName===void 0)throw new Error("branchName should be in pathParams");if(n.filePath===void 0)throw new Error("filePath should be in pathParams");if(o.branchName===void 0)throw new Error("branchName should be in newPathParams");if(o.filePath===void 0)throw new Error("filePath should be in newPathParams");let s=await Fr(i,r,n.branchName);if(!s)throw new Error("Invalid branch file path - source branch must exist");let l=await Fr(i,r,o.branchName);if(!l){let h=await ue.default.resolveRef({fs:i,dir:r,ref:"HEAD"});await ue.default.branch({fs:i,dir:r,ref:o.branchName,object:h}),l=await ue.default.resolveRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`})}if(o.branchName!==n.branchName)throw new Error("cross branch move not implemented yet");let f=await Ci({gitRoot:r,nodeFs:i,commitSha:s,filePath:t,pathParams:n});if(f===void 0)throw new Error("no obj at path exists");let c=await to({dir:r,fs:i,deletePathParts:n.filePath.split("/"),addPathParts:o.filePath.split("/"),addObj:f,treeOid:l}),u=await ue.default.readTree({fs:i,dir:r,oid:s});if(c!==u.oid){let h=await ue.default.commit({fs:i,dir:r,message:`\u{1F500} Rename '${n.filePath}' to '${o.filePath}'`,tree:c,noUpdateBranch:!0,parent:[l],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"rename"),mkdir:a(async function(t){try{throw await ro.getStats(t),new Error("Folder exists")}catch{}t.filePath.endsWith("/")&&(t.filePath=t.filePath.replace(/\/+$/,"")),t.pathParams&&typeof t.pathParams.filePath=="string"&&(t.pathParams.filePath=t.pathParams.filePath.replace(/\/+$/,""));let e={...t,filePath:t.filePath+=".keep",content:""};e.pathParams.filePath+="/.keep",await ro.writeFile(e)},"mkdir")};var ei=ae(Me(),1);var af={type:"gitBranchHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await ei.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");try{let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}return{type:"file",content:i+`
|
|
104
|
-
`,mode:420,size:i.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(console.log("gitBranchHeadVirtualFile writeFile called",{pathParams:o,content:i}),o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=i.toString().trim();try{await ei.default.readCommit({fs:r,dir:e,oid:s})}catch{throw new Error(`Commit ${s} does not exist in the repository`)}await ei.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:s,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var
|
|
105
|
-
`,mode:420,size:n.length+1}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var lf=ae(Me(),1);var cf={type:"gitCommitFileVirtualFile",getStats:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40,o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${t}'`,t);let s=await lf.default.readCommit({fs:r,dir:e,oid:n}),{commit:l}=s,f=l.committer.timestamp*1e3;if(o.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)};{let{blob:c}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{mode:420,size:c.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(c.length/4096),atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40;try{let o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)return;if(o.type==="blob"){let{blob:s}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{type:"file",content:Buffer.from(s),mode:420,size:s.length,oid:o.oid}}else return{type:"directory",content:Array.from(new Set([...o.entries.filter(l=>l!==".keep")])),mode:493}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ff=ae(Me(),1);function G$(t,e,r){return t===0&&e===2&&r===0?"untracked":t===1&&e===0&&r===0?"deleted":t===1&&e===2&&r!==0?"modified":t===0&&e===2&&r===2?"added":"unknown"}a(G$,"getFileStatus");var x1={type:"gitStatusVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await ff.default.currentBranch({fs:e,dir:t})||"HEAD",i=await ff.default.resolveRef({fs:e,dir:t,ref:"HEAD"}),o=(await ff.default.statusMatrix({fs:e,dir:t})).filter(([,l,f,c])=>l!==f||f!==c).map(([l,f,c,u])=>({path:l,status:G$(f,c,u)})),s=JSON.stringify({branch:r,commit:i,clean:o.length===0,files:o},null,2);return{type:"file",content:s,mode:33188,size:Buffer.byteLength(s)}}catch(r){throw console.error(r),r}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bs={type:"legitVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var T1=[Bs,x1,cf,of,ro,af,S1];var em=class em{constructor(e){this.routes=e;H(this,"compiledRoutes");let r={},i=a((n,o)=>{if(typeof n.type=="string"){r[o]={handler:n,siblings:[]};let s=n}else{let s=[];for(let[l,f]of Object.entries(n))if(l==="."){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s}}else if(l.startsWith("[[")&&l.endsWith("]]")){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s},l.startsWith("[[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l)}else l.startsWith("[")&&l.endsWith("]")?l.startsWith("[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l):(s.push(l),i(f,o?`${o}/${l}`:l))}},"walk");for(let[n,o]of Object.entries(e))i(o,n);this.compiledRoutes=Object.entries(r).map(([n,o])=>{let s=[],l=n.split("/").map(c=>{if(c.startsWith("[[")&&c.endsWith("]]")){let u=c.slice(2,-2).replace(/^\.\.\./,"");return s.push(u),"(.*)"}if(c.startsWith("[")&&c.endsWith("]")){let u=c.slice(1,-1);return s.push(u),"([^/]+)"}return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("/");return{regex:new RegExp(`^${l}$`),paramNames:s,staticSiblings:o.siblings,handler:o.handler}})}match(e){e.length>1&&e.endsWith("/")&&(e=e.replace(/\/+$/,""));for(let{regex:r,paramNames:i,handler:n,staticSiblings:o}of this.compiledRoutes){let s=e.match(r);if(!s)continue;let l={};for(let f=0;f<i.length;f++)l[i[f]]=decodeURIComponent(s[f+1]||"");return{handler:n,params:l,staticSiblings:o}}}};a(em,"LegitPathRouter");var uf=em;var hf=ae(Me(),1);var tm={type:"gitCommitVirtualFolder",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{let n=await hf.default.listBranches({fs:r,dir:e}),o=new Set,s=new Set;for(let c of n){let u=`refs/heads/${c}`;try{let h=await hf.default.resolveRef({fs:r,dir:e,ref:u});o.add(h)}catch{}}for(let c of o){let u=await hf.default.log({fs:r,dir:e,ref:c});for(let h of u)s.add(h.oid)}if(!i.sha_1_1_2){let c=new Set;for(let h of s)if(c.add(h.slice(0,2)),c.size>=256)break;let u=Array.from(c).sort();return{type:"directory",content:u,mode:493,size:u}}let l=new Set;for(let c of s)c.startsWith(i.sha_1_1_2)&&l.add(c.slice(2,40));let f=Array.from(l).sort();return{type:"directory",content:f,mode:493,size:f.length}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nt=ae(Me(),1);var O1=ae(Me(),1);var rm="-operation";async function Xe(t,e,r){return(await O1.default.listBranches({fs:t,dir:e})).filter(n=>n.endsWith("__"+r+rm))[0]}a(Xe,"resolveOperationBranchName");var R1={type:"gitBranchOperationVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await nt.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await nt.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o,s=!1;return n?(o=await nt.default.resolveRef({fs:r,dir:e,ref:n}),s=!0):o=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`}),{type:"file",content:Buffer.from(o),mode:420,size:o.length}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await nt.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f)throw new Error("Invalid branch file path - branch doesn't exist");let c=await Xe(r,e,o.branchName),u=!1;c||(c="legit/__"+o.branchName+rm,await nt.default.branch({fs:r,dir:e,ref:c,object:f}),u=!0);let h=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${c}`}),d=await nt.default.readTree({fs:r,dir:e,oid:f}),p;i instanceof ArrayBuffer?p=Buffer.from(i).toString("utf-8"):typeof i=="string"?p=i:i instanceof Uint8Array?p=Buffer.from(i).toString("utf-8"):p=String(i);let m=!1;if(!u){let y=await nt.default.findMergeBase({fs:r,dir:e,oids:m?[h]:[h,f]});y.length===1&&y[0]===f&&(m=!0)}let w=await nt.default.commit({fs:r,dir:e,message:p,tree:d.oid,noUpdateBranch:!0,parent:m?u?[f,f]:[h]:[h,f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await nt.default.writeRef({fs:r,dir:e,ref:`refs/heads/${c}`,value:w,force:!0})},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bi=ae(Me(),1);var im={type:"gitBranchOperationsVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t;if(i.branchName===void 0)throw new Error("branchName should be in pathParams");let n=await Xe(r,e,i.branchName),o,s=!1;if(n)try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:n}),s=!0}catch{try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}}else try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let l=await Bi.default.readCommit({fs:r,dir:e,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:(s?await im.getFile(t):void 0)?.content?.length??0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o=[];if(n){let f=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),c=!1,u=f;for(;u&&!c;){let h=await Bi.default.readCommit({fs:r,dir:e,oid:u});o.push({oid:h.oid,parentOids:h.commit.parent,message:h.commit.message,originBranchOid:"unset"}),u=h.commit.parent&&h.commit.parent.length>0?h.commit.parent[0]:null,h.commit.parent.length===2&&h.commit.parent[0]===h.commit.parent[1]&&(c=!0)}}let s;for(let f=o.length-1;f>=0;f--){let c=o[f];if(s===void 0){if(c.parentOids.length!==2&&c.parentOids[0]!==c.parentOids[1])throw new Error(`Operation commit ${c.oid} does not have two parents as expected`);s=c.parentOids[1]}c.parentOids.length===2&&(s=c.parentOids[1]),c.originBranchOid=s}let l=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:l,mode:420,size:l.length}},"getFile"),rename:a(async function(t){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var io=ae(Me(),1);var K$=new Set([" ","~","^",":","?","*","[","\\"]),Z$=[/^\/|\/$/,/\/\//,/\.$/,/\.lock$/,/^@$/,/@\{/],P1="\u2002";function k1(t){let e=t.codePointAt(0);return!(e>=0&&e<=31||e===127||K$.has(t))}a(k1,"isValidChar");function A1(t){let e="";for(let r of t)r===" "?e+=P1:k1(r)?e+=r:e+="%"+r.codePointAt(0);for(let r of Z$)if(r.test(e))return Array.from(e).map(i=>k1(i)?i:"%"+i.codePointAt(0)).join("");return e}a(A1,"encodeName");function I1(t){return t.replace(/%(\d+)/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(new RegExp(P1,"g")," ")}a(I1,"decodeName");var D1={type:"getThreadName",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await io.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await io.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await io.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await io.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o;if(n){let s="legit/",l=`__${i.branchName}-operation`;return n.startsWith(s)&&n.endsWith(l)?o=n.slice(s.length,n.length-l.length):o=n,{type:"file",content:Buffer.from(I1(o)),mode:420,size:o.length}}return{type:"file",content:Buffer.from(""),mode:420,size:0}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName);if(s){let l=`legit/${A1(i.toString())}__${o.branchName}-operation`;await io.default.renameBranch({fs:r,dir:e,oldref:s,ref:l}),s=l}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var no=ae(Me(),1);var C1={type:"gitBranchHistory",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await no.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await no.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await no.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:1e4,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=i.branchName,o=[];if(n){let l=await no.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),f=!1,c=l;for(;c&&!f;){let u=await no.default.readCommit({fs:r,dir:e,oid:c});o.push({oid:u.oid,...u.commit}),c=u.commit.parent[0]}}let s=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:s,mode:420,size:s.length}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nr=ae(Me(),1);var N1={type:"gitBranchOperationHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i){let f=new Date(0);return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:f.getTime(),mtimeMs:f.getTime(),ctimeMs:f.getTime(),birthtimeMs:f.getTime(),atime:f,mtime:f,ctime:f,birthtime:f}}let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}let o=await nr.default.readCommit({fs:e,dir:t,oid:n}),{commit:s}=o,l=s.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:l,mtimeMs:l,ctimeMs:l,birthtimeMs:l,atime:new Date(l),mtime:new Date(l),ctime:new Date(l),birthtime:new Date(l)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i)return{type:"file",content:"",mode:420,size:0};try{let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}return{type:"file",content:n+`
|
|
106
|
-
`,mode:420,size:n.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName),l=await nr.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${s}`});if(!s)throw new Error(`Operation branch name could not be resolved for branch ${o.branchName}`);let f=i.toString().trim(),c,u,h=!1;if(!l)throw new Error(`Operation branch ref could not be resolved for branch ${s}`);let d=l;for(;d&&!h;){let p=await nr.default.readCommit({fs:r,dir:e,oid:d});if(p.oid===f&&(c=p.oid),d=p.commit.parent&&p.commit.parent.length>0?p.commit.parent[0]:null,p.commit.parent.length===2){if(p.commit.parent[0]===p.commit.parent[1])h=!0;else if(c!==void 0){u=p.commit.parent[1];break}}}if(c===void 0)throw new Error(`Cant rollback to ${f} couldn't find newOperationBranchHead ${c}`);if(u===void 0)throw new Error(`Cant rollback to ${f} couldn't find newBranchHead ${u}`);await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+s,value:c,force:!0}),await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:u,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Er=class Er extends vt{constructor({parentFs:r,gitRoot:i,virtualFiles:n=T1}){super({parentFs:r,gitRoot:i});H(this,"memFs");H(this,"openFh",{});H(this,"virtualFiles");H(this,"legitFileNames");this.gitRoot=i,this.memFs=(0,pf.createFsFromVolume)(new pf.Volume),this.virtualFiles=n,this.legitFileNames=["branches","commits"]}async responsible(r){return this.isLegitPath(r)}isLegitPath(r){return r.includes(`/${Er.LEGIT_DIR}/`)||r.includes(`/${Er.LEGIT_DIR}`)}getRouteHandler(r){let i=r.indexOf(`/${Er.LEGIT_DIR}`);if(i===-1)throw new Error("Not a legit path");let n=r.slice(i+1);return Er.pathRouter.match(n)}async open(r,i,n){let o=this.getRouteHandler(r);if(!o)throw new Error("Not a virtual legit file");if(!(o?.handler.writeFile!==void 0)&&(i.includes("w")||i.includes("a")))throw new Error(`Write operations not allowed for ${o?.handler.type}`);if(i.includes("x")&&o?.handler.type!=="gitBranchFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${o?.handler.type}`);let l=await o.handler.getFile({cacheFs:this.memFs,filePath:r,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(i.includes("x")){for(let d of Object.values(this.openFh))if(d.path===r)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(l!==void 0)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r})}if(l&&i.includes("x"))throw new Error("file existed - openend with x flag");if(!l&&!(i.includes("w")||i.includes("a")))throw new Error(`ENOENT: no such file or directory, open '${r}'`);let f=nm.dirname(r);if(await this.memFs.promises.mkdir(f,{recursive:!0}),l===void 0&&!i.includes("x")||l&&l.type==="file")try{let d=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let c=await this.memFs.promises.open(r,i,n),u=c.fd,h=new kt({fs:this,subFsFileDescriptor:u,parentFsFileDescriptors:[]});return this.openFh[u]={path:r,mode:i,fh:c,openSha:l?.oid,readSha:void 0,unflushed:[]},(i.includes("x")||i.includes("w"))&&this.openFh[u].unflushed.push({length:0,start:0}),h}async mkdir(r,i){let n=r.toString(),o=this.getRouteHandler(n),s=i?{options:i}:{};try{await o?.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:o.params,...s});let l=typeof i=="object"?{...i,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,l);let f=n.split("/"),c="";for(let u=1;u<=f.length;u++){c="/"+f.slice(0,u).join("/");try{if((await this.memFs.promises.stat(c)).isDirectory()){let d=await this.memFs.promises.open(c,"r");this.openFh[d.fd]={path:c,mode:"r",fh:d,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(l){throw l}}async access(r,i){await this.stat(r)}async futimes(r,i,n){let o=this.openFh[r.subFsFileDescriptor];if(!o)throw new Error("Invalid file handle");return await o.fh.utimes(i,n)}async fstat(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return this.stat(n.path,i)}async ftruncate(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return await n.fh.truncate(i)}async stat(r,i){let n=r.toString(),o=Object.values(this.openFh).find(f=>f.path===n);if(o&&o.unflushed.length>0)return await o.fh.stat(i);let s=this.getRouteHandler(n);if(!s)throw new Error(`ENOENT: no such file or directory, stat '${n}'`);return await s.handler.getStats({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:s.params})}async lstat(r,i){return this.stat(r,i)}async readdir(r,i){let n=r.toString();if(!this.isLegitPath(n))return[".legit"];let o=this.getRouteHandler(n);if(!o)throw new Error(`ENOENT: no such file or directory, scandir '${n}'`);let s=await o?.handler.getFile({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(s){if(s.type!=="directory")throw new Error("not a folder");let l=o?.staticSiblings??[],f=s.content;return f&&!Array.isArray(s.content)&&(f=JSON.parse(s.content)),Array.from(new Set([...f,...l])).sort((u,h)=>u.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"}))}return[]}async read(r,i,n,o,s){let l=r.subFsFileDescriptor,f=this.openFh[l];if(!f)throw new Error("Invalid file handle");if(f.unflushed.length===0){let c=this.getRouteHandler(f.path),u=await c.handler.getFile({cacheFs:this.memFs,filePath:f.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:c?.params});if(!u?.content)throw new Error("couldnt access content");if(u.type!=="file")throw new Error("not a file");let h=typeof u.content=="string"?Buffer.from(u.content):u.content,d=typeof s=="number"?s:0,p=Math.min(d+o,h.length),m=Math.max(0,p-d);return h.copy(i,n,d,d+m),{bytesRead:m,buffer:i}}return await f.fh.read(i,n,o,s)}async write(r,i,n,o,s){let l=this.openFh[r.subFsFileDescriptor];if(!l)throw new Error("Invalid file handle");let f=l.mode;if(!f.includes("w")&&!f.includes("a")&&!f.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(l.unflushed.length===0){let d=this.getRouteHandler(l.path),p=await d.handler.getFile({cacheFs:this.memFs,filePath:l.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:d.params});p&&p.oid&&(await this.memFs.promises.writeFile(l.path,p.content),l.readSha=p.oid)}let c=await l.fh.write(i,n,o,s),u=n??0,h=s??0;return l.unflushed.push({start:h,length:o||i.byteLength-u+h}),c}async close(r){let i=r.subFsFileDescriptor;if(!this.openFh[i])throw new Error("Invalid file handle");await this.dataSync(r),delete this.openFh[i]}async dataSync(r){let i=r.subFsFileDescriptor,n=this.openFh[i];if(!n)throw new Error("Invalid file handle");if(n.unflushed.length>0){let o=this.getRouteHandler(n.path);if(o&&o.handler.writeFile){let s=await this.memFs.promises.readFile(n.path);await o.handler.writeFile({cacheFs:this.memFs,filePath:n.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,content:s,pathParams:o.params})}n.unflushed=[],await this.memFs.promises.writeFile(n.path,"")}}async readFile(r,i){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),o=null;typeof i=="string"?o=i:i&&typeof i=="object"&&i.encoding&&(o=i.encoding);let s=await this.open(n,"r");try{let f=(await this.fstat(s)).size,c=Buffer.alloc(f);return await this.read(s,c,0,f,0),await this.close(s),o?c.toString(o):c}catch(l){try{await this.close(s)}catch{}throw l}}async writeFile(r,i,n){let o="w",s="utf8",l;typeof n=="string"?s=n:n&&typeof n=="object"&&(n.flag&&(o=String(n.flag)),n.encoding&&(s=n.encoding),n.mode&&(l=typeof n.mode=="string"?parseInt(n.mode,8):n.mode));let f=await this.open(r,o,l);try{let c;typeof i=="string"?c=Buffer.from(i,s):Buffer.isBuffer(i)?c=i:i instanceof Uint8Array?c=Buffer.from(i):ArrayBuffer.isView(i)?c=Buffer.from(i.buffer,i.byteOffset,i.byteLength):c=Buffer.from(i),await this.write(f,c,0,c.length,0)}finally{await this.close(f)}}async rename(r,i){let n=r.toString(),o=i.toString(),s=this.getRouteHandler(n),l=this.getRouteHandler(o);if(s?.handler.type==="gitBranchFileVirtualFile"&&l?.handler.type==="gitBranchFileVirtualFile"){let f=!0;try{await this.memFs.promises.access(o)}catch{f=!1}let c=!0;try{await this.stat(o)}catch{c=!1}let u=!0;try{await this.stat(n)}catch{u=!1}let h=!0;try{await this.memFs.promises.access(n)}catch{h=!1}if(h){let m=nm.dirname(o);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,i)}let d=this.getRouteHandler(n);if(!d)throw new Error("VF not found");let p=await d.handler.rename({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,newPath:o,pathParams:d?.params??{},newPathParams:l?.params??{}})}else throw new Error(`Unsupported rename operation from ${s?.handler.type} to ${l?.handler.type}`)}async fchmod(r,i){}async unlink(r){let i=r.toString(),n=this.getRouteHandler(i);if(n?.handler.unlink!==void 0){await n.handler.unlink({cacheFs:this.memFs,filePath:i,fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:n.params});for(let[o,s]of Object.entries(this.openFh))s.path===i&&(await s.fh.close(),await this.memFs.promises.unlink(i),delete this.openFh[Number(o)])}else throw new Error(`Cannot unlink ${n?.handler.type} files`)}fileType(){return 10}};a(Er,"GitSubFs"),H(Er,"LEGIT_DIR",".legit"),H(Er,"pathRouter",new uf({".legit":{".":Bs,branches:{".":of,"[branchName]":{".legit":{".":Bs,operation:R1,head:af,operationHead:N1,operationHistory:im,threadName:D1,history:C1},"[[...filePath]]":ro}},commits:{".":tm,"[sha_1_1_2]":{".":tm,"[sha1_3__40]":{"[[...filePath]]":cf}}}}}));var df=Er;var mf=ae(Me(),1);async function Wq(t,e){let r=!1;try{await t.promises.readdir(e+"/.git"),r=!0}catch{}if(r)throw new Error(`cant use initLegitFs on a folder with a git repo (${e}), use openLegitFs instead`);return await mf.default.init({fs:t,dir:"/",defaultBranch:"main"}),await t.promises.writeFile(e+"/.keep",""),await mf.default.add({fs:t,dir:"/",filepath:".keep"}),await mf.default.commit({fs:t,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"}}),X$(t,e)}a(Wq,"initLegitFs");function X$(t,e){let r=new zo({name:"root",parentFs:void 0,storageFs:t,gitRoot:e}),i=new Go({parentFs:r,gitRoot:e,ephemeralPatterns:[]}),n=new Vo({parentFs:r,gitRoot:e,hiddenFiles:[]});r.setHiddenFilesSubFs(n),r.setEphemeralFilesSubFs(i);let o=new zo({name:"git",parentFs:r,storageFs:void 0,gitRoot:e}),s=new df({parentFs:r,gitRoot:e}),l=new Vo({parentFs:o,gitRoot:e,hiddenFiles:[".git"]}),f=new Go({parentFs:o,gitRoot:e,ephemeralPatterns:["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp"]});return o.addSubFs(s),o.setHiddenFilesSubFs(l),o.setEphemeralFilesSubFs(f),o}a(X$,"openLegitFs");var Ot=ae(Me(),1);var yx=ae(wx(),1);function bM(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(bM,"fromValue");function vM(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:bM(t)}a(vM,"getIterator");async function gx(t,e){let r=vM(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(gx,"forAwait");function _M(t){let{PassThrough:e}=wf(),r=new e;return setTimeout(async()=>{await gx(t,i=>r.write(i)),r.end()},1),r}a(_M,"asyncIteratorToStream");async function FM(t){let e=0,r=[];await gx(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(FM,"collect");function EM(t){let e=Object.getOwnPropertyDescriptor(t,Symbol.asyncIterator);if(e&&e.enumerable)return t;let r=!1,i=[],n={};return t.on("data",o=>{i.push(o),n.resolve&&(n.resolve({value:i.shift(),done:!1}),n={})}),t.on("error",o=>{n.reject&&(n.reject(o),n={})}),t.on("end",()=>{r=!0,n.resolve&&(n.resolve({done:!0}),n={})}),{next(){return new Promise((o,s)=>{if(i.length===0&&r)return o({done:!0});if(i.length>0)return o({value:i.shift(),done:!1});i.length===0&&!r&&(n={resolve:o,reject:s})})},return(){t.removeAllListeners(),t.destroy&&t.destroy()},[Symbol.asyncIterator](){return this}}}a(EM,"fromNodeStream");async function SM({onProgress:t,url:e,method:r="GET",headers:i={},agent:n,body:o}){return o&&Array.isArray(o)?o=Buffer.from(await FM(o)):o&&(o=_M(o)),new Promise((s,l)=>{(0,yx.default)({url:e,method:r,headers:i,agent:n,body:o},(f,c)=>{if(f)return l(f);try{let u=EM(c);s({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:u,headers:c.headers})}catch(u){l(u)}})})}a(SM,"request");var xM={request:SM},vf=xM;function TM(t){let e=/^git@([^:]+):(.+)$/,r=t.match(e);if(r){let i=r[1],n=r[2];return`https://${i}/${n}`}return t}a(TM,"normalizeRemoteUrl");var x3=a(({fs:t,gitRepoPath:e,originPrefix:r,corsProxy:i,user:n,password:o})=>{let s=!1,l,f;async function c(){let m=await Ot.default.fetch({fs:t,http:vf,dir:e,url:f,corsProxy:i,onAuth:a(()=>({username:n,password:o}),"onAuth")}),w="origin",y=await Ot.default.listBranches({fs:t,dir:e}),v=[];for(let g of y){let F=`${w}/${g}`,O,S;try{O=await Ot.default.resolveRef({fs:t,dir:e,ref:g})}catch(R){console.log(`Could not resolve local ref ${g}:`,R)}try{S=await Ot.default.resolveRef({fs:t,dir:e,ref:F})}catch{S=void 0}if(O&&S&&O!==S){let R=await Ot.default.findMergeBase({fs:t,dir:e,oids:[O,S]});if(R[0]!==O&&R[0]!==S){let b=await Ot.default.merge({fs:t,dir:e,ours:O,theirs:S,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:a(async({branches:x,contents:_,path:P})=>{let[k,C,N]=_;return console.log(`Merging ${x[0]} with ${x[1]}...`),console.log("merged:"),console.log(_),{cleanMerge:!0,mergedText:N===void 0?C:N}},"mergeDriver")});await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:b.oid,force:!0})}R[0]===O?(console.log(`branch ${g} differs - remote ahaed, not behind`),await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:S,force:!0})):R[0]===S?(console.log(`branch ${g} differs - local ahead, not behind`),v.push(g)):(console.log(`branch ${g} differs - both changed`),v.push(g))}}v.length!==0&&await u(v)}a(c,"pull");async function u(m){for(let w of m)await Ot.default.push({fs:t,http:vf,dir:e,corsProxy:i,url:f,ref:w,onAuth:a(()=>({username:n,password:o}),"onAuth")})}a(u,"push");async function h(){let m=await Ot.default.getConfig({fs:t,dir:e,path:"remote.origin.url"});f=TM(m);try{await c()}catch(w){console.error("Error monitoring changes:",w)}finally{s&&setTimeout(h,1e3)}}a(h,"monitorChanges");function d(){s=!0,h()}a(d,"startPolling");function p(){s=!1}return a(p,"stopPolling"),{clone:a(async m=>Ot.default.clone({fs:t,http:vf,corsProxy:i,dir:e,url:m,onAuth:a(()=>({username:n,password:o}),"onAuth")}),"clone"),start:a(()=>{s||(d(),s=!0)},"start"),stop:a(()=>{p()},"stop")}},"createGitSyncService");var wm=ae(ni(),1);function bx(t){let e=t.name||"untitled";return{kind:"file",name:e,async getFile(){let i=(await t.stat()).size;console.log("reading data into buffer of size"+i);let n=wm.Buffer.alloc(i);await t.read(n,0,i,0);let o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);console.log("buffer read",o);let s=o;return new File([s],e||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",t);let i;if(typeof r=="string")i=wm.Buffer.from(r,"utf-8");else if(r instanceof Blob){let n=await r.arrayBuffer();i=new Uint8Array(n)}else if(ArrayBuffer.isView(r))i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await t.write(i),await t.sync(),console.log("write completed")},async close(){await t.close()}}}}}a(bx,"fileHandleToFileSystemFileHandle");async function OM(t){let e=await t.getFile();return e.handle=t,e}a(OM,"fileSystemFileHandleToFileWithHandle");async function R3(t){return{openFile:a(async e=>{let r=await t.promises.open(e,"w");return r.name=e,await OM(bx(r))},"openFile"),fileSave:a(async(e,r,i,n,o)=>{if(i)console.log("using existing handle",i);else{let f=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",f),!f)throw new Error("no file choosen");try{let c=await t.promises.open(`${f}`,"w");i=bx(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let s=e instanceof Blob?e:await e;return await(await i.createWritable()).write(s),i},"fileSave")}}a(R3,"getLegitFsAccess");export{zo as CompositeFs,Go as EphemeralSubFs,df as GitSubFs,Vo as HiddenFileSubFs,Fl as PassThroughSubFs,x3 as createGitSyncService,R3 as getLegitFsAccess,im as gitBranchOperationsVirtualFile,Wq as initLegitFs,X$ as openLegitFs};
|
|
103
|
+
`,"utf8");let c=l[l.length-1].split(" ")[1];await n.writeStashRef(c)}else await t.rm(f)})}a(l1,"_stashDrop");async function H$({fs:t,dir:e,gitdir:r}){return new Ii({fs:t,dir:e,gitdir:r}).readStashReflogs({parsed:!0})}a(H$,"_stashList");async function q$({fs:t,dir:e,gitdir:r}){let i=new Ii({fs:t,dir:e,gitdir:r}),n=[i.refStashPath,i.refLogsStashPath];await Qn(n,async()=>{await Promise.all(n.map(async o=>{if(await t.exists(o))return t.rm(o)}))})}a(q$,"_stashClear");async function z$({fs:t,dir:e,gitdir:r,refIdx:i=0}){await a1({fs:t,dir:e,gitdir:r,refIdx:i}),await l1({fs:t,dir:e,gitdir:r,refIdx:i})}a(z$,"_stashPop");async function c1({fs:t,dir:e,gitdir:r=D.join(e,".git"),op:i="push",message:n="",refIdx:o=0}){E("fs",t),E("dir",e),E("gitdir",r),E("op",i);let s={push:j$,apply:a1,drop:l1,list:H$,clear:q$,pop:z$,create:U$},l=["apply","drop","pop"];try{let f=new M(t);["refs","logs","logs/refs"].map(h=>D.join(r,h)).forEach(async h=>{await f.exists(h)||await f.mkdir(h)});let u=s[i];if(u){if(l.includes(i)&&o<0)throw new Bt(`stash@${o}`,"number that is in range of [0, num of stash pushed]");return await u({fs:f,dir:e,gitdir:r,message:n,refIdx:o})}throw new Error(`To be implemented: ${i}`)}catch(f){throw f.caller="git.stash",f}}a(c1,"stash");async function f1({fs:t,dir:e,gitdir:r=D.join(e,".git"),filepath:i,cache:n={}}){try{E("fs",t),E("gitdir",r),E("filepath",i);let o=new M(t);if(await Yr.isIgnored({fs:o,gitdir:r,dir:e,filepath:i}))return"ignored";let l=await W$({fs:o,cache:n,gitdir:r}),f=await u1({fs:o,cache:n,gitdir:r,tree:l,path:i}),c=await Fe.acquire({fs:o,gitdir:r,cache:n},async function(w){for(let y of w)if(y.path===i)return y;return null}),u=await o.lstat(D.join(e,i)),h=f!==null,d=c!==null,p=u!==null,m=a(async()=>{if(d&&!nc(c,u))return c.oid;{let w=await o.read(D.join(e,i)),y=await t1({gitdir:r,type:"blob",object:w});return d&&c.oid===y&&u.size!==-1&&Fe.acquire({fs:o,gitdir:r,cache:n},async function(v){v.insert({filepath:i,stats:u,oid:y})}),y}},"getWorkdirOid");if(!h&&!p&&!d)return"absent";if(!h&&!p&&d)return"*absent";if(!h&&p&&!d)return"*added";if(!h&&p&&d)return await m()===c.oid?"added":"*added";if(h&&!p&&!d)return"deleted";if(h&&!p&&d)return f===c.oid,"*deleted";if(h&&p&&!d)return await m()===f?"*undeleted":"*undeletemodified";if(h&&p&&d){let w=await m();return w===f?w===c.oid?"unmodified":"*unmodified":w===c.oid?"modified":"*modified"}}catch(o){throw o.caller="git.status",o}}a(f1,"status");async function u1({fs:t,cache:e,gitdir:r,tree:i,path:n}){typeof n=="string"&&(n=n.split("/"));let o=n.shift();for(let s of i)if(s.path===o){if(n.length===0)return s.oid;let{type:l,object:f}=await de({fs:t,cache:e,gitdir:r,oid:s.oid});if(l==="tree"){let c=tt.from(f);return u1({fs:t,cache:e,gitdir:r,tree:c,path:n})}if(l==="blob")throw new Ze(s.oid,l,"blob",n.join("/"))}return null}a(u1,"getOidAtPath");async function W$({fs:t,cache:e,gitdir:r}){let i;try{i=await B.resolve({fs:t,gitdir:r,ref:"HEAD"})}catch(o){if(o instanceof ce)return[]}let{tree:n}=await to({fs:t,cache:e,gitdir:r,oid:i});return n}a(W$,"getHeadTree");async function h1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i="HEAD",filepaths:n=["."],filter:o,cache:s={},ignored:l=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let f=new M(t);return await Xr({fs:f,cache:s,dir:e,gitdir:r,trees:[ft({ref:i}),eo(),Di()],map:a(async function(c,[u,h,d]){if(!u&&!d&&h&&!l&&await Yr.isIgnored({fs:f,dir:e,filepath:c})||!n.some(R=>JE(c,R)))return null;if(o&&!o(c))return;let[p,m,w]=await Promise.all([u&&u.type(),h&&h.type(),d&&d.type()]),y=[p,m,w].includes("blob");if((p==="tree"||p==="special")&&!y)return;if(p==="commit")return null;if((m==="tree"||m==="special")&&!y)return;if(w==="commit")return null;if((w==="tree"||w==="special")&&!y)return;let v=p==="blob"?await u.oid():void 0,g=w==="blob"?await d.oid():void 0,F;p!=="blob"&&m==="blob"&&w!=="blob"?F="42":m==="blob"&&(F=await h.oid());let O=[void 0,v,F,g],S=O.map(R=>O.indexOf(R));return S.shift(),[c,...S]},"map")})}catch(f){throw f.caller="git.statusMatrix",f}}a(h1,"statusMatrix");async function d1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,object:n,force:o=!1}){try{E("fs",t),E("gitdir",r),E("ref",i);let s=new M(t);if(i===void 0)throw new et("ref");i=i.startsWith("refs/tags/")?i:`refs/tags/${i}`;let l=await B.resolve({fs:s,gitdir:r,ref:n||"HEAD"});if(!o&&await B.exists({fs:s,gitdir:r,ref:i}))throw new Nt("tag",i);await B.writeRef({fs:s,gitdir:r,ref:i,value:l})}catch(s){throw s.caller="git.tag",s}}a(d1,"tag");async function p1({fs:t,dir:e,gitdir:r=D.join(e,".git"),cache:i={},filepath:n,oid:o,mode:s,add:l,remove:f,force:c}){try{E("fs",t),E("gitdir",r),E("filepath",n);let u=new M(t);if(f)return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!c){let p=await u.lstat(D.join(e,n));if(p){if(p.isDirectory())throw new Zr("directory");return}}d.has({filepath:n})&&d.delete({filepath:n})});let h;if(!o){if(h=await u.lstat(D.join(e,n)),!h)throw new ce(`file at "${n}" on disk and "remove" not set`);if(h.isDirectory())throw new Zr("directory")}return await Fe.acquire({fs:u,gitdir:r,cache:i},async function(d){if(!l&&!d.has({filepath:n}))throw new ce(`file at "${n}" in index and "add" not set`);let p;if(o)p={ctime:new Date(0),mtime:new Date(0),dev:0,ino:0,mode:s,uid:0,gid:0,size:0};else{p=h;let m=p.isSymbolicLink()?await u.readlink(D.join(e,n)):await u.read(D.join(e,n));o=await it({fs:u,gitdir:r,type:"blob",format:"content",object:m})}return d.insert({filepath:n,oid:o,stats:p}),o})}catch(u){throw u.caller="git.updateIndex",u}}a(p1,"updateIndex$1");function m1(){try{return rf.version}catch(t){throw t.caller="git.version",t}}a(m1,"version");async function w1({fs:t,dir:e,gitdir:r=D.join(e,".git"),trees:i,map:n,reduce:o,iterate:s,cache:l={}}){try{return E("fs",t),E("gitdir",r),E("trees",i),await Xr({fs:new M(t),cache:l,dir:e,gitdir:r,trees:i,map:n,reduce:o,iterate:s})}catch(f){throw f.caller="git.walk",f}}a(w1,"walk");async function y1({fs:t,dir:e,gitdir:r=D.join(e,".git"),blob:i}){try{return E("fs",t),E("gitdir",r),E("blob",i),await it({fs:new M(t),gitdir:r,type:"blob",object:i,format:"content"})}catch(n){throw n.caller="git.writeBlob",n}}a(y1,"writeBlob");async function g1({fs:t,dir:e,gitdir:r=D.join(e,".git"),commit:i}){try{return E("fs",t),E("gitdir",r),E("commit",i),await o1({fs:new M(t),gitdir:r,commit:i})}catch(n){throw n.caller="git.writeCommit",n}}a(g1,"writeCommit");async function b1({fs:t,dir:e,gitdir:r=D.join(e,".git"),type:i,object:n,format:o="parsed",oid:s,encoding:l=void 0}){try{let f=new M(t);if(o==="parsed"){switch(i){case"commit":n=rt.from(n).toObject();break;case"tree":n=tt.from(n).toObject();break;case"blob":n=Buffer.from(n,l);break;case"tag":n=ut.from(n).toObject();break;default:throw new Ze(s||"",i,"blob|commit|tag|tree")}o="content"}return s=await it({fs:f,gitdir:r,type:i,object:n,oid:s,format:o}),s}catch(f){throw f.caller="git.writeObject",f}}a(b1,"writeObject");async function v1({fs:t,dir:e,gitdir:r=D.join(e,".git"),ref:i,value:n,force:o=!1,symbolic:s=!1}){try{E("fs",t),E("gitdir",r),E("ref",i),E("value",n);let l=new M(t);if(!ms(i,!0))throw new Bt(i,ps.clean(i));if(!o&&await B.exists({fs:l,gitdir:r,ref:i}))throw new Nt("ref",i);s?await B.writeSymbolicRef({fs:l,gitdir:r,ref:i,value:n}):(n=await B.resolve({fs:l,gitdir:r,ref:n}),await B.writeRef({fs:l,gitdir:r,ref:i,value:n}))}catch(l){throw l.caller="git.writeRef",l}}a(v1,"writeRef");async function V$({fs:t,gitdir:e,tag:r}){let i=ut.from(r).toObject();return await it({fs:t,gitdir:e,type:"tag",object:i,format:"content"})}a(V$,"_writeTag");async function _1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tag:i}){try{return E("fs",t),E("gitdir",r),E("tag",i),await V$({fs:new M(t),gitdir:r,tag:i})}catch(n){throw n.caller="git.writeTag",n}}a(_1,"writeTag");async function F1({fs:t,dir:e,gitdir:r=D.join(e,".git"),tree:i}){try{return E("fs",t),E("gitdir",r),E("tree",i),await Cs({fs:new M(t),gitdir:r,tree:i})}catch(n){throw n.caller="git.writeTree",n}}a(F1,"writeTree");var G$={Errors:LE,STAGE:Di,TREE:ft,WORKDIR:eo,add:HE,abortMerge:ME,addNote:GE,addRemote:ZE,annotatedTag:XE,branch:YE,checkout:Cp,clone:iS,commit:nS,getConfig:bS,getConfigAll:vS,setConfig:n1,currentBranch:oS,deleteBranch:sS,deleteRef:aS,deleteRemote:lS,deleteTag:cS,expandOid:fS,expandRef:uS,fastForward:pS,fetch:mS,findMergeBase:wS,findRoot:gS,getRemoteInfo:_S,getRemoteInfo2:ES,hashBlob:SS,indexPack:xS,init:TS,isDescendent:RS,isIgnored:kS,listBranches:PS,listFiles:IS,listNotes:DS,listRefs:CS,listRemotes:NS,listServerRefs:BS,listTags:LS,log:MS,merge:jS,packObjects:HS,pull:qS,push:zS,readBlob:GS,readCommit:Lp,readNote:KS,readObject:ZS,readTag:XS,readTree:YS,remove:JS,removeNote:QS,renameBranch:e1,resetIndex:r1,updateIndex:p1,resolveRef:i1,status:f1,statusMatrix:h1,tag:d1,version:m1,walk:w1,writeBlob:y1,writeCommit:g1,writeObject:b1,writeRef:v1,writeTag:_1,writeTree:F1,stash:c1};L.Errors=LE;L.STAGE=Di;L.TREE=ft;L.WORKDIR=eo;L.abortMerge=ME;L.add=HE;L.addNote=GE;L.addRemote=ZE;L.annotatedTag=XE;L.branch=YE;L.checkout=Cp;L.clone=iS;L.commit=nS;L.currentBranch=oS;L.default=G$;L.deleteBranch=sS;L.deleteRef=aS;L.deleteRemote=lS;L.deleteTag=cS;L.expandOid=fS;L.expandRef=uS;L.fastForward=pS;L.fetch=mS;L.findMergeBase=wS;L.findRoot=gS;L.getConfig=bS;L.getConfigAll=vS;L.getRemoteInfo=_S;L.getRemoteInfo2=ES;L.hashBlob=SS;L.indexPack=xS;L.init=TS;L.isDescendent=RS;L.isIgnored=kS;L.listBranches=PS;L.listFiles=IS;L.listNotes=DS;L.listRefs=CS;L.listRemotes=NS;L.listServerRefs=BS;L.listTags=LS;L.log=MS;L.merge=jS;L.packObjects=HS;L.pull=qS;L.push=zS;L.readBlob=GS;L.readCommit=Lp;L.readNote=KS;L.readObject=ZS;L.readTag=XS;L.readTree=YS;L.remove=JS;L.removeNote=QS;L.renameBranch=e1;L.resetIndex=r1;L.resolveRef=i1;L.setConfig=n1;L.stash=c1;L.status=f1;L.statusMatrix=h1;L.tag=d1;L.updateIndex=p1;L.version=m1;L.walk=w1;L.writeBlob=y1;L.writeCommit=g1;L.writeObject=b1;L.writeRef=v1;L.writeTag=_1;L.writeTree=F1});var $1=T((Xq,L1)=>{L1.exports=function(t,e){var r=[];t.on("data",function(i){r.push(i)}),t.once("end",function(){e&&e(null,Buffer.concat(r)),e=null}),t.once("error",function(i){e&&e(i),e=null})}});var M1=T(()=>{});var lm=T(xt=>{xt.fetch=Ls(globalThis.fetch)&&Ls(globalThis.ReadableStream);xt.writableStream=Ls(globalThis.WritableStream);xt.abortController=Ls(globalThis.AbortController);var ti;function sm(){if(ti!==void 0)return ti;if(globalThis.XMLHttpRequest){ti=new globalThis.XMLHttpRequest;try{ti.open("GET",globalThis.XDomainRequest?"/":"https://example.com")}catch{ti=null}}else ti=null;return ti}a(sm,"getXHR");function am(t){var e=sm();if(!e)return!1;try{return e.responseType=t,e.responseType===t}catch{}return!1}a(am,"checkTypeSupport");xt.arraybuffer=xt.fetch||am("arraybuffer");xt.msstream=!xt.fetch&&am("ms-stream");xt.mozchunkedarraybuffer=!xt.fetch&&am("moz-chunked-arraybuffer");xt.overrideMimeType=xt.fetch||(sm()?Ls(sm().overrideMimeType):!1);function Ls(t){return typeof t=="function"}a(Ls,"isFunction");ti=null});var yf=T((Tt,j1)=>{Tt=j1.exports=Ka();Tt.Stream=Tt;Tt.Readable=Tt;Tt.Writable=Wa();Tt.Duplex=Cr();Tt.Transform=il();Tt.PassThrough=vh();Tt.finished=Lo();Tt.pipeline=Fh()});var um=T(fm=>{var U1=lm(),Q$=Gt(),H1=yf(),gf=fm.readyStates={UNSENT:0,OPENED:1,HEADERS_RECEIVED:2,LOADING:3,DONE:4},cm=fm.IncomingMessage=function(t,e,r,i){var n=this;if(H1.Readable.call(n),n._mode=r,n.headers={},n.rawHeaders=[],n.trailers={},n.rawTrailers=[],n.on("end",function(){process.nextTick(function(){n.emit("close")})}),r==="fetch"){let h=function(){s.read().then(function(d){if(!n._destroyed){if(i(d.done),d.done){n.push(null);return}n.push(Buffer.from(d.value)),h()}}).catch(function(d){i(!0),n._destroyed||n.emit("error",d)})};var u=h;if(a(h,"read"),n._fetchResponse=e,n.url=e.url,n.statusCode=e.status,n.statusMessage=e.statusText,e.headers.forEach(function(d,p){n.headers[p.toLowerCase()]=d,n.rawHeaders.push(p,d)}),U1.writableStream){var o=new WritableStream({write:a(function(d){return i(!1),new Promise(function(p,m){n._destroyed?m():n.push(Buffer.from(d))?p():n._resumeFetch=p})},"write"),close:a(function(){i(!0),n._destroyed||n.push(null)},"close"),abort:a(function(d){i(!0),n._destroyed||n.emit("error",d)},"abort")});try{e.body.pipeTo(o).catch(function(d){i(!0),n._destroyed||n.emit("error",d)});return}catch{}}var s=e.body.getReader();h()}else{n._xhr=t,n._pos=0,n.url=t.responseURL,n.statusCode=t.status,n.statusMessage=t.statusText;var l=t.getAllResponseHeaders().split(/\r?\n/);if(l.forEach(function(h){var d=h.match(/^([^:]+):\s*(.*)/);if(d){var p=d[1].toLowerCase();p==="set-cookie"?(n.headers[p]===void 0&&(n.headers[p]=[]),n.headers[p].push(d[2])):n.headers[p]!==void 0?n.headers[p]+=", "+d[2]:n.headers[p]=d[2],n.rawHeaders.push(d[1],d[2])}}),n._charset="x-user-defined",!U1.overrideMimeType){var f=n.rawHeaders["mime-type"];if(f){var c=f.match(/;\s*charset=([^;])(;|$)/);c&&(n._charset=c[1].toLowerCase())}n._charset||(n._charset="utf-8")}}};Q$(cm,H1.Readable);cm.prototype._read=function(){var t=this,e=t._resumeFetch;e&&(t._resumeFetch=null,e())};cm.prototype._onXHRProgress=function(t){var e=this,r=e._xhr,i=null;switch(e._mode){case"text":if(i=r.responseText,i.length>e._pos){var n=i.substr(e._pos);if(e._charset==="x-user-defined"){for(var o=Buffer.alloc(n.length),s=0;s<n.length;s++)o[s]=n.charCodeAt(s)&255;e.push(o)}else e.push(n,e._charset);e._pos=i.length}break;case"arraybuffer":if(r.readyState!==gf.DONE||!r.response)break;i=r.response,e.push(Buffer.from(new Uint8Array(i)));break;case"moz-chunked-arraybuffer":if(i=r.response,r.readyState!==gf.LOADING||!i)break;e.push(Buffer.from(new Uint8Array(i)));break;case"ms-stream":if(i=r.response,r.readyState!==gf.LOADING)break;var l=new globalThis.MSStreamReader;l.onprogress=function(){l.result.byteLength>e._pos&&(e.push(Buffer.from(new Uint8Array(l.result.slice(e._pos)))),e._pos=l.result.byteLength)},l.onload=function(){t(!0),e.push(null)},l.readAsArrayBuffer(i);break}e._xhr.readyState===gf.DONE&&e._mode!=="ms-stream"&&(t(!0),e.push(null))}});var V1=T((i3,W1)=>{var Li=lm(),eM=Gt(),z1=um(),hm=yf(),tM=z1.IncomingMessage,q1=z1.readyStates;function rM(t,e){return Li.fetch&&e?"fetch":Li.mozchunkedarraybuffer?"moz-chunked-arraybuffer":Li.msstream?"ms-stream":Li.arraybuffer&&t?"arraybuffer":"text"}a(rM,"decideMode");var We=W1.exports=function(t){var e=this;hm.Writable.call(e),e._opts=t,e._body=[],e._headers={},t.auth&&e.setHeader("Authorization","Basic "+Buffer.from(t.auth).toString("base64")),Object.keys(t.headers).forEach(function(n){e.setHeader(n,t.headers[n])});var r,i=!0;if(t.mode==="disable-fetch"||"requestTimeout"in t&&!Li.abortController)i=!1,r=!0;else if(t.mode==="prefer-streaming")r=!1;else if(t.mode==="allow-wrong-content-type")r=!Li.overrideMimeType;else if(!t.mode||t.mode==="default"||t.mode==="prefer-fast")r=!0;else throw new Error("Invalid value for opts.mode");e._mode=rM(r,i),e._fetchTimer=null,e._socketTimeout=null,e._socketTimer=null,e.on("finish",function(){e._onFinish()})};eM(We,hm.Writable);We.prototype.setHeader=function(t,e){var r=this,i=t.toLowerCase();nM.indexOf(i)===-1&&(r._headers[i]={name:t,value:e})};We.prototype.getHeader=function(t){var e=this._headers[t.toLowerCase()];return e?e.value:null};We.prototype.removeHeader=function(t){var e=this;delete e._headers[t.toLowerCase()]};We.prototype._onFinish=function(){var t=this;if(!t._destroyed){var e=t._opts;"timeout"in e&&e.timeout!==0&&t.setTimeout(e.timeout);var r=t._headers,i=null;e.method!=="GET"&&e.method!=="HEAD"&&(i=new Blob(t._body,{type:(r["content-type"]||{}).value||""}));var n=[];if(Object.keys(r).forEach(function(f){var c=r[f].name,u=r[f].value;Array.isArray(u)?u.forEach(function(h){n.push([c,h])}):n.push([c,u])}),t._mode==="fetch"){var o=null;if(Li.abortController){var s=new AbortController;o=s.signal,t._fetchAbortController=s,"requestTimeout"in e&&e.requestTimeout!==0&&(t._fetchTimer=globalThis.setTimeout(function(){t.emit("requestTimeout"),t._fetchAbortController&&t._fetchAbortController.abort()},e.requestTimeout))}globalThis.fetch(t._opts.url,{method:t._opts.method,headers:n,body:i||void 0,mode:"cors",credentials:e.withCredentials?"include":"same-origin",signal:o}).then(function(f){t._fetchResponse=f,t._resetTimers(!1),t._connect()},function(f){t._resetTimers(!0),t._destroyed||t.emit("error",f)})}else{var l=t._xhr=new globalThis.XMLHttpRequest;try{l.open(t._opts.method,t._opts.url,!0)}catch(f){process.nextTick(function(){t.emit("error",f)});return}"responseType"in l&&(l.responseType=t._mode),"withCredentials"in l&&(l.withCredentials=!!e.withCredentials),t._mode==="text"&&"overrideMimeType"in l&&l.overrideMimeType("text/plain; charset=x-user-defined"),"requestTimeout"in e&&(l.timeout=e.requestTimeout,l.ontimeout=function(){t.emit("requestTimeout")}),n.forEach(function(f){l.setRequestHeader(f[0],f[1])}),t._response=null,l.onreadystatechange=function(){switch(l.readyState){case q1.LOADING:case q1.DONE:t._onXHRProgress();break}},t._mode==="moz-chunked-arraybuffer"&&(l.onprogress=function(){t._onXHRProgress()}),l.onerror=function(){t._destroyed||(t._resetTimers(!0),t.emit("error",new Error("XHR error")))};try{l.send(i)}catch(f){process.nextTick(function(){t.emit("error",f)});return}}}};function iM(t){try{var e=t.status;return e!==null&&e!==0}catch{return!1}}a(iM,"statusValid");We.prototype._onXHRProgress=function(){var t=this;t._resetTimers(!1),!(!iM(t._xhr)||t._destroyed)&&(t._response||t._connect(),t._response._onXHRProgress(t._resetTimers.bind(t)))};We.prototype._connect=function(){var t=this;t._destroyed||(t._response=new tM(t._xhr,t._fetchResponse,t._mode,t._resetTimers.bind(t)),t._response.on("error",function(e){t.emit("error",e)}),t.emit("response",t._response))};We.prototype._write=function(t,e,r){var i=this;i._body.push(t),r()};We.prototype._resetTimers=function(t){var e=this;globalThis.clearTimeout(e._socketTimer),e._socketTimer=null,t?(globalThis.clearTimeout(e._fetchTimer),e._fetchTimer=null):e._socketTimeout&&(e._socketTimer=globalThis.setTimeout(function(){e.emit("timeout")},e._socketTimeout))};We.prototype.abort=We.prototype.destroy=function(t){var e=this;e._destroyed=!0,e._resetTimers(!0),e._response&&(e._response._destroyed=!0),e._xhr?e._xhr.abort():e._fetchAbortController&&e._fetchAbortController.abort(),t&&e.emit("error",t)};We.prototype.end=function(t,e,r){var i=this;typeof t=="function"&&(r=t,t=void 0),hm.Writable.prototype.end.call(i,t,e,r)};We.prototype.setTimeout=function(t,e){var r=this;e&&r.once("timeout",e),r._socketTimeout=t,r._resetTimers(!1)};We.prototype.flushHeaders=function(){};We.prototype.setNoDelay=function(){};We.prototype.setSocketKeepAlive=function(){};var nM=["accept-charset","accept-encoding","access-control-request-headers","access-control-request-method","connection","content-length","cookie","cookie2","date","dnt","expect","host","keep-alive","origin","referer","te","trailer","transfer-encoding","upgrade","via"]});var K1=T((o3,G1)=>{G1.exports=sM;var oM=Object.prototype.hasOwnProperty;function sM(){for(var t={},e=0;e<arguments.length;e++){var r=arguments[e];for(var i in r)oM.call(r,i)&&(t[i]=r[i])}return t}a(sM,"extend")});var X1=T((a3,Z1)=>{Z1.exports={100:"Continue",101:"Switching Protocols",102:"Processing",200:"OK",201:"Created",202:"Accepted",203:"Non-Authoritative Information",204:"No Content",205:"Reset Content",206:"Partial Content",207:"Multi-Status",208:"Already Reported",226:"IM Used",300:"Multiple Choices",301:"Moved Permanently",302:"Found",303:"See Other",304:"Not Modified",305:"Use Proxy",307:"Temporary Redirect",308:"Permanent Redirect",400:"Bad Request",401:"Unauthorized",402:"Payment Required",403:"Forbidden",404:"Not Found",405:"Method Not Allowed",406:"Not Acceptable",407:"Proxy Authentication Required",408:"Request Timeout",409:"Conflict",410:"Gone",411:"Length Required",412:"Precondition Failed",413:"Payload Too Large",414:"URI Too Long",415:"Unsupported Media Type",416:"Range Not Satisfiable",417:"Expectation Failed",418:"I'm a teapot",421:"Misdirected Request",422:"Unprocessable Entity",423:"Locked",424:"Failed Dependency",425:"Unordered Collection",426:"Upgrade Required",428:"Precondition Required",429:"Too Many Requests",431:"Request Header Fields Too Large",451:"Unavailable For Legal Reasons",500:"Internal Server Error",501:"Not Implemented",502:"Bad Gateway",503:"Service Unavailable",504:"Gateway Timeout",505:"HTTP Version Not Supported",506:"Variant Also Negotiates",507:"Insufficient Storage",508:"Loop Detected",509:"Bandwidth Limit Exceeded",510:"Not Extended",511:"Network Authentication Required"}});var dm=T(J1=>{var Y1=V1(),aM=um(),lM=K1(),cM=X1(),fM=ko(),Lt=J1;Lt.request=function(t,e){typeof t=="string"?t=fM.parse(t):t=lM(t);var r=globalThis.location.protocol.search(/^https?:$/)===-1?"http:":"",i=t.protocol||r,n=t.hostname||t.host,o=t.port,s=t.path||"/";n&&n.indexOf(":")!==-1&&(n="["+n+"]"),t.url=(n?i+"//"+n:"")+(o?":"+o:"")+s,t.method=(t.method||"GET").toUpperCase(),t.headers=t.headers||{};var l=new Y1(t);return e&&l.on("response",e),l};Lt.get=a(function(e,r){var i=Lt.request(e,r);return i.end(),i},"get");Lt.ClientRequest=Y1;Lt.IncomingMessage=aM.IncomingMessage;Lt.Agent=function(){};Lt.Agent.defaultMaxSockets=4;Lt.globalAgent=new Lt.Agent;Lt.STATUS_CODES=cM;Lt.METHODS=["CHECKOUT","CONNECT","COPY","DELETE","GET","HEAD","LOCK","M-SEARCH","MERGE","MKACTIVITY","MKCOL","MOVE","NOTIFY","OPTIONS","PATCH","POST","PROPFIND","PROPPATCH","PURGE","PUT","REPORT","SEARCH","SUBSCRIBE","TRACE","UNLOCK","UNSUBSCRIBE"]});var tx=T((f3,ex)=>{var $s=dm(),uM=ko(),pm=ex.exports;for(bf in $s)$s.hasOwnProperty(bf)&&(pm[bf]=$s[bf]);var bf;pm.request=function(t,e){return t=Q1(t),$s.request.call(this,t,e)};pm.get=function(t,e){return t=Q1(t),$s.get.call(this,t,e)};function Q1(t){if(typeof t=="string"&&(t=uM.parse(t)),t.protocol||(t.protocol="https:"),t.protocol!=="https:")throw new Error('Protocol "'+t.protocol+'" not supported. Expected "https:"');return t}a(Q1,"validateParams")});var nx=T((h3,ix)=>{ix.exports=rx;function rx(t,e){if(t&&e)return rx(t)(e);if(typeof t!="function")throw new TypeError("need wrapper function");return Object.keys(t).forEach(function(i){r[i]=t[i]}),r;function r(){for(var i=new Array(arguments.length),n=0;n<i.length;n++)i[n]=arguments[n];var o=t.apply(this,i),s=i[i.length-1];return typeof o=="function"&&o!==s&&Object.keys(s).forEach(function(l){o[l]=s[l]}),o}a(r,"wrapper")}a(rx,"wrappy")});var ax=T((p3,mm)=>{var ox=nx();mm.exports=ox(vf);mm.exports.strict=ox(sx);vf.proto=vf(function(){Object.defineProperty(Function.prototype,"once",{value:a(function(){return vf(this)},"value"),configurable:!0}),Object.defineProperty(Function.prototype,"onceStrict",{value:a(function(){return sx(this)},"value"),configurable:!0})});function vf(t){var e=a(function(){return e.called?e.value:(e.called=!0,e.value=t.apply(this,arguments))},"f");return e.called=!1,e}a(vf,"once");function sx(t){var e=a(function(){if(e.called)throw new Error(e.onceError);return e.called=!0,e.value=t.apply(this,arguments)},"f"),r=t.name||"Function wrapped with `once`";return e.onceError=r+" shouldn't be called more than once",e.called=!1,e}a(sx,"onceStrict")});var cx=T((w3,lx)=>{"use strict";function hM(t,e){return Object.prototype.hasOwnProperty.call(t,e)}a(hM,"hasOwnProperty");lx.exports=function(t,e,r,i){e=e||"&",r=r||"=";var n={};if(typeof t!="string"||t.length===0)return n;var o=/\+/g;t=t.split(e);var s=1e3;i&&typeof i.maxKeys=="number"&&(s=i.maxKeys);var l=t.length;s>0&&l>s&&(l=s);for(var f=0;f<l;++f){var c=t[f].replace(o,"%20"),u=c.indexOf(r),h,d,p,m;u>=0?(h=c.substr(0,u),d=c.substr(u+1)):(h=c,d=""),p=decodeURIComponent(h),m=decodeURIComponent(d),hM(n,p)?dM(n[p])?n[p].push(m):n[p]=[n[p],m]:n[p]=m}return n};var dM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"}});var hx=T((g3,ux)=>{"use strict";var Ms=a(function(t){switch(typeof t){case"string":return t;case"boolean":return t?"true":"false";case"number":return isFinite(t)?t:"";default:return""}},"stringifyPrimitive");ux.exports=function(t,e,r,i){return e=e||"&",r=r||"=",t===null&&(t=void 0),typeof t=="object"?fx(mM(t),function(n){var o=encodeURIComponent(Ms(n))+r;return pM(t[n])?fx(t[n],function(s){return o+encodeURIComponent(Ms(s))}).join(e):o+encodeURIComponent(Ms(t[n]))}).join(e):i?encodeURIComponent(Ms(i))+r+encodeURIComponent(Ms(t)):""};var pM=Array.isArray||function(t){return Object.prototype.toString.call(t)==="[object Array]"};function fx(t,e){if(t.map)return t.map(e);for(var r=[],i=0;i<t.length;i++)r.push(e(t[i],i));return r}a(fx,"map");var mM=Object.keys||function(t){var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.push(r);return e}});var dx=T(js=>{"use strict";js.decode=js.parse=cx();js.encode=js.stringify=hx()});var yx=T((_3,wx)=>{wx.exports=so;var wM=$1(),px=M1(),yM=dm(),gM=tx(),bM=ax(),vM=dx(),mx=ko(),wm=a(t=>t!==null&&typeof t=="object"&&typeof t.pipe=="function","isStream");function so(t,e){if(t=Object.assign({maxRedirects:10},typeof t=="string"?{url:t}:t),e=bM(e),t.url){let{hostname:l,port:f,protocol:c,auth:u,path:h}=mx.parse(t.url);delete t.url,!l&&!f&&!c&&!u?t.path=h:Object.assign(t,{hostname:l,port:f,protocol:c,auth:u,path:h})}let r={"accept-encoding":"gzip, deflate"};t.headers&&Object.keys(t.headers).forEach(l=>r[l.toLowerCase()]=t.headers[l]),t.headers=r;let i;t.body?i=t.json&&!wm(t.body)?JSON.stringify(t.body):t.body:t.form&&(i=typeof t.form=="string"?t.form:vM.stringify(t.form),t.headers["content-type"]="application/x-www-form-urlencoded"),i&&(t.method||(t.method="POST"),wm(i)||(t.headers["content-length"]=Buffer.byteLength(i)),t.json&&!t.form&&(t.headers["content-type"]="application/json")),delete t.body,delete t.form,t.json&&(t.headers.accept="application/json"),t.method&&(t.method=t.method.toUpperCase());let n=t.hostname,s=(t.protocol==="https:"?gM:yM).request(t,l=>{if(t.followRedirects!==!1&&l.statusCode>=300&&l.statusCode<400&&l.headers.location){t.url=l.headers.location,delete t.headers.host,l.resume();let c=mx.parse(t.url).hostname;return c!==null&&c!==n&&(delete t.headers.cookie,delete t.headers.authorization),t.method==="POST"&&[301,302].includes(l.statusCode)&&(t.method="GET",delete t.headers["content-length"],delete t.headers["content-type"]),t.maxRedirects--===0?e(new Error("too many redirects")):so(t,e)}let f=typeof px=="function"&&t.method!=="HEAD";e(null,f?px(l):l)});return s.on("timeout",()=>{s.abort(),e(new Error("Request timed out"))}),s.on("error",e),wm(i)?i.on("error",e).pipe(s):s.end(i),s}a(so,"simpleGet");so.concat=(t,e)=>so(t,(r,i)=>{if(r)return e(r);wM(i,(n,o)=>{if(n)return e(n);if(t.json)try{o=JSON.parse(o.toString())}catch(s){return e(s,i,o)}e(null,i,o)})});["get","post","put","patch","head","delete"].forEach(t=>{so[t]=(e,r)=>(typeof e=="string"&&(e={url:e}),so(Object.assign({method:t.toUpperCase()},e),r))})});var Kh=ae(Sr(),1);var Sf=class Sf{constructor(e,r){H(this,"entries",[]);H(this,"currentIndex",0);H(this,"closed",!1);H(this,"compositFs");H(this,"dirPath");H(this,"initialized",!1);this.compositFs=e,this.dirPath=r}async initialize(){if(this.initialized)return;let e=new Set;for(let r of[...this.compositFs.subFilesystems].reverse()){let i=await r.readdir(this.dirPath);for(let n of i)e.add(n)}for(let r of Array.from(e)){let i=this.dirPath+"/"+r;await this.compositFs.hiddenFilesFileSystem?.responsible(i)||this.entries.push({name:r,path:i})}this.initialized=!0}async*[Symbol.asyncIterator](){for(await this.initialize();this.currentIndex<this.entries.length&&!this.closed;){let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);yield{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch(r){console.debug(`Failed to stat ${e.path}:`,r)}}}async read(){if(this.closed)throw new Error("Directory handle is closed");if(await this.initialize(),this.currentIndex>=this.entries.length)return null;let e=this.entries[this.currentIndex++];try{let r=await this.compositFs.stat(e.path);return{name:e.name,isFile:a(()=>r.isFile(),"isFile"),isDirectory:a(()=>r.isDirectory(),"isDirectory"),isBlockDevice:a(()=>r.isBlockDevice(),"isBlockDevice"),isCharacterDevice:a(()=>r.isCharacterDevice(),"isCharacterDevice"),isSymbolicLink:a(()=>r.isSymbolicLink(),"isSymbolicLink"),isFIFO:a(()=>r.isFIFO(),"isFIFO"),isSocket:a(()=>r.isSocket(),"isSocket")}}catch{return this.read()}}async close(){this.closed=!0,this.entries=[]}get path(){return this.dirPath}};a(Sf,"CompositeFsDir");var ji=Sf;var xf=class xf{constructor(e){H(this,"delegate");H(this,"_subFsFileDescriptor");H(this,"handleType","file");H(this,"_compositFsFileDescriptor",-1);this.delegate=e.fs,this._subFsFileDescriptor=e.subFsFileDescriptor,this._compositFsFileDescriptor=-1;let r=e.fs.fileType(),i=this._subFsFileDescriptor}get fsType(){return this.delegate.fileType()}get subFsFileDescriptor(){return this._subFsFileDescriptor}get fd(){return this._compositFsFileDescriptor}realize(e){if(this._compositFsFileDescriptor!==-1)throw new Error("was already realized");this._compositFsFileDescriptor=e}readableWebStream(e){throw new Error("Method not implemented.")}async appendFile(e,r){return await this.delegate.appendFile(this,e,r)}async chmod(e){return this.delegate.fchmod(this,e)}async chown(e,r){return this.delegate.fchown(this,e,r)}async close(){return this.delegate.close(this)}async datasync(){return this.delegate.dataSync(this)}async read(e,r,i,n){return await this.delegate.read(this,e,r,i,n)}readv(e,r){return this.delegate.readv(this,e,r)}async stat(e){return this.delegate.fstat(this,e)}async truncate(e){return this.delegate.ftruncate(this,e)}async utimes(e,r){return this.delegate.futimes(this,e,r)}async write(e,r,i,n){return this.delegate.write(this,e,r,i,n)}async writev(e,r){return this.delegate.writev(this,e,r)}async sync(){return this.delegate.dataSync(this)}};a(xf,"CompositFsFileHandle");var kt=xf;var Mb=ae(Sr(),1),El=ae(Fn(),1);var Wh=class Wh{constructor({parentFs:e,gitRoot:r}){H(this,"compositFs");H(this,"gitRoot");this.compositFs=e,this.gitRoot=r}toStr(e){return typeof e=="string"?e:Buffer.isBuffer(e)?e.toString():e&&typeof e=="object"&&"fd"in e?`FileHandle(fd=${e.fd})`:String(e)}async open(e,r,i){throw new Error(`open not implemented for: ${this.toStr(e)}`)}async access(e,r){throw new Error(`access not implemented for: ${this.toStr(e)}`)}async stat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async lstat(e,r){throw new Error(`lstat not implemented for: ${this.toStr(e)}`)}async opendir(e,r){throw new Error(`opendir not implemented for: ${this.toStr(e)}`)}async link(e,r){throw new Error(`link not implemented for: ${this.toStr(e)}`)}async mkdir(e,r){throw new Error(`mkdir not implemented for: ${this.toStr(e)}`)}async readdir(e,r){throw new Error(`readdir not implemented for: ${this.toStr(e)}`)}async readlink(e,...r){throw new Error(`readlink not implemented for: ${this.toStr(e)}`)}async unlink(e){throw new Error(`unlink not implemented for: ${this.toStr(e)}`)}async rename(e,r){throw new Error(`rename not implemented for: ${this.toStr(e)}`)}async rmdir(e,...r){throw new Error(`rmdir not implemented for: ${this.toStr(e)}`)}async symlink(e,r,i){throw new Error(`symlink not implemented for: ${this.toStr(r)}`)}async lookup(e){throw new Error(`lookup not implemented for: ${this.toStr(e)}`)}resolvePath(e){throw new Error(`resolvePath not implemented for fd: ${e}`)}async close(e){this.compositFs.close(e)}async dataSync(e){throw new Error(`dataSync not implemented for: ${e.subFsFileDescriptor}`)}async read(e,r,i,n,o){throw new Error(`read not implemented for: ${e.subFsFileDescriptor}`)}async appendFile(e,r,i){throw new Error(`appendFile not implemented for: ${e.subFsFileDescriptor}`)}async fchmod(e,r){throw new Error(`fchmod not implemented for: ${e.subFsFileDescriptor}`)}async fchown(e,r,i){throw new Error(`fchown not implemented for: ${e.subFsFileDescriptor}`)}async ftruncate(e,r){throw new Error(`ftruncate not implemented for: ${e.subFsFileDescriptor}`)}async fstat(e,r){throw new Error(`fstat not implemented for: ${e.subFsFileDescriptor}`)}async futimes(e,r,i){throw new Error(`futimes not implemented for: ${e.subFsFileDescriptor}`)}async write(e,r,i,n,o){throw new Error(`write not implemented for: ${e.subFsFileDescriptor}`)}async writev(e,r,i){throw new Error(`writev not implemented for: ${e.subFsFileDescriptor}`)}async readv(e,r,i){throw new Error(`readv not implemented for: ${e.subFsFileDescriptor}`)}async readFile(e,r){throw new Error(`readFile not implemented for: ${this.toStr(e)}`)}async writeFile(e,r,i){throw new Error(`writeFile not implemented for: ${this.toStr(e)}`)}};a(Wh,"BaseCompositeSubFs");var vt=Wh;var Vh=class Vh extends vt{constructor({parentFs:r,gitRoot:i}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,El.createFsFromVolume)(new El.Volume));H(this,"targetFs");if(this.compositFs=r,this.gitRoot=i,this.compositFs.parentFs===void 0)throw new Error("PassThroughSubFs not allowed in root fs");this.targetFs=this.compositFs.parentFs}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=Mb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[s.fd]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){return await this.targetFs.promises.opendir(r,i)}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){let n=typeof r=="string"?r:r.toString();return await this.targetFs.promises.mkdir(n,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return typeof r=="string"||Buffer.isBuffer(r)?this.targetFs.readFile(r.toString(),i):super.readFile(r,i)}async writeFile(r,i,n){let o=typeof n=="object"&&n.flag?n.flag:"w",s=await this.targetFs.open(r,o);try{let l;if(typeof i=="string"){let f=typeof n=="object"&&n.encoding?n.encoding:"utf8";l=Buffer.from(i,f)}else Buffer.isBuffer(i)?l=i:l=Buffer.from(i);await s.write(l,0,l.length,0)}finally{await this.targetFs.close(s)}}};a(Vh,"PassThroughSubFs");var Fl=Vh;var jb=ae(Sr(),1),xl=ae(Fn(),1);var Gh=class Gh extends vt{constructor({parentFs:r,gitRoot:i,passThroughFs:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,xl.createFsFromVolume)(new xl.Volume));H(this,"targetFs");this.compositFs=r,this.gitRoot=i,this.targetFs=n}async responsible(r){return!0}fileType(){return 4}async open(r,i,n){let o=jb.dirname(r),s=await this.targetFs.promises.open(r,i,n);return this.openFh.set(s.fd,s),new kt({fs:this,subFsFileDescriptor:s.fd,parentFsFileDescriptors:[]})}async access(r,i){return await this.targetFs.promises.access(r,i)}async stat(r,...i){return this.targetFs.promises.stat(r,{bigint:!1})}async lstat(r,...i){return this.targetFs.promises.lstat(r,{bigint:!1})}async opendir(r,i){let n=await this.targetFs.promises.opendir(r,i);return new ji(this.compositFs,r.toString())}async link(r,i){return await this.targetFs.promises.link(r,i)}async mkdir(r,i){await this.targetFs.promises.mkdir(r,i)}async readdir(r,...i){return this.targetFs.promises.readdir(r,...i)}async readlink(r,...i){throw new Error("not implemented")}async unlink(r){return await this.targetFs.promises.unlink(r)}async rename(r,i){return await this.targetFs.promises.rename(r,i)}async rmdir(r,i){return await this.targetFs.promises.rmdir(r,i)}async symlink(r,i,n){return await this.targetFs.promises.symlink(r,i,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor)),this.compositFs.close(r)}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.sync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){return this.targetFs.promises.readFile(r,i)}async writeFile(r,i,n){return this.targetFs.promises.writeFile(r,i,n)}};a(Gh,"PassThroughToAsyncFsSubFs");var Sl=Gh;var Zh=class Zh{constructor({name:e,parentFs:r,storageFs:i,gitRoot:n}){H(this,"promises");H(this,"gitRoot");H(this,"ephemeralFilesFileSystem");H(this,"hiddenFilesFileSystem");H(this,"passThroughFileSystem");H(this,"subFilesystems",[]);H(this,"parentFs");H(this,"name");H(this,"pathToFileDescriptors",new Map);H(this,"openFileHandles",new Map);if(this.name=e,this.parentFs=r,this.gitRoot=n,this.promises={access:this.access.bind(this),opendir:this.opendir.bind(this),mkdir:this.mkdir.bind(this),readdir:this.readdir.bind(this),open:this.open.bind(this),stat:this.stat.bind(this),lstat:this.lstat.bind(this),link:this.link.bind(this),readlink:this.readlink.bind(this),unlink:this.unlink.bind(this),rename:this.rename.bind(this),rmdir:this.rmdir.bind(this),symlink:this.symlink.bind(this),readFile:this.readFile.bind(this),writeFile:this.writeFile.bind(this),getFilehandle:this.getFilehandle.bind(this)},!r&&i){this.passThroughFileSystem=new Sl({passThroughFs:i,gitRoot:n,parentFs:this});return}if(!i&&r){this.passThroughFileSystem=new Fl({parentFs:this,gitRoot:n});return}throw new Error("invalid configuration")}getNextFileDescriptor(){let e=Array.from(this.openFileHandles.keys());return e.length===0?1:Math.max(...e)+1}getFilehandle(e){return this.openFileHandles.get(e)}setEphemeralFilesSubFs(e){this.ephemeralFilesFileSystem=e}setHiddenFilesSubFs(e){this.hiddenFilesFileSystem=e}addSubFs(e){this.subFilesystems.push(e)}async getResponsibleFs(e){if(!e.toString().startsWith(this.gitRoot)&&this.gitRoot!=="./")throw new Error("tried to access a file ("+e+") outside of the legit folder: "+this.gitRoot);if(!this.hiddenFilesFileSystem)throw new Error(this.name+" intialize hidden fs first!");if(!this.ephemeralFilesFileSystem)throw new Error(this.name+" intialize ephemeral fs first!");if(await this.hiddenFilesFileSystem.responsible(e.toString()))return this.hiddenFilesFileSystem;if(await this.ephemeralFilesFileSystem.responsible(e.toString()))return this.ephemeralFilesFileSystem;for(let r of this.subFilesystems)if(await r.responsible(e.toString()))return r;return this.passThroughFileSystem}async access(e,r){return(await this.getResponsibleFs(e)).access(e,r)}async opendir(e,r){let i=e.toString();if(!i.startsWith(this.gitRoot))throw new Error("tried to access a directory ("+i+") outside of the legit folder: "+this.gitRoot);return new ji(this,i)}async mkdir(e,r){return(await this.getResponsibleFs(e)).mkdir(e,r)}async readdir(e,r){let i=await this.getResponsibleFs(e);if(i!==this.passThroughFileSystem)return i.readdir(e,r);let n=new Set;for(let s of[...this.subFilesystems].reverse()){let l=await s.readdir(e,r);for(let f of l)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+f)||n.add(f)}let o=await this.passThroughFileSystem.readdir(e,r);for(let s of o)await this.ephemeralFilesFileSystem?.responsible((e=="/"?"":e)+"/"+s)||n.add(s);try{let s=await this.ephemeralFilesFileSystem.readdir(e,r);for(let l of s)n.add(l)}catch(s){console.log(s.code)}for(let s of n){let l=(e=="/"?"":e)+"/"+s;await this.hiddenFilesFileSystem.responsible(l)&&n.delete(s)}return Array.from(n)}async open(e,r,i){let o=await(await this.getResponsibleFs(e)).open(e,r,i),s=this.getNextFileDescriptor();return o.realize(s),this.openFileHandles.set(s,o),this.pathToFileDescriptors.get(e)||this.pathToFileDescriptors.set(e,[]),this.pathToFileDescriptors.get(e).push(s),o}async close(e){for(let[r,i]of this.pathToFileDescriptors.entries()){let n=i.indexOf(e.fd);if(n!==-1){i.splice(n,1),i.length===0&&this.pathToFileDescriptors.delete(r);break}}}async stat(e,r){let i=e.toString();return(await this.getResponsibleFs(e)).stat(e)}async lstat(e,r){return(await this.getResponsibleFs(e)).lstat(e,r)}async link(e,r){throw new Error("not implemented")}async readlink(e,r){throw new Error("not implemented")}async unlink(e){return(await this.getResponsibleFs(e)).unlink(e)}async rename(e,r){if(this.hiddenFilesFileSystem){if(await this.hiddenFilesFileSystem.responsible(Kh.basename(e.toString())))throw new Error("Renaming of hidden Files is not allowed "+e);if(await this.hiddenFilesFileSystem.responsible(Kh.basename(r.toString())))throw new Error("Renaming to hidden Files is not allowed "+r)}let i=await this.getResponsibleFs(e),n=await this.getResponsibleFs(r);if(i===n)return i.rename(e,r);let o=await i.open(e.toString(),"r");try{let s=await i.fstat(o),l=Buffer.alloc(s.size);await i.read(o,l,0,s.size,0),await i.close(o),await n.writeFile(r.toString(),l,"utf8"),await i.unlink(e)}catch(s){try{await i.close(o)}catch{}throw s}}async rmdir(e,r){return(await this.getResponsibleFs(e)).rmdir(e,r)}async symlink(e,r,i){throw new Error("not implemented")}async readFile(e,r){let i=!0,n;if(typeof e=="number"){i=!1;let o=this.getFilehandle(e);if(!o)throw new Error("Invalid file descriptor");n=o}else if(typeof e=="string")n=await this.open(e,"r");else throw new Error("only filehandle and path are supported atm");try{let s=(await n.stat()).size;if(typeof s=="bigint"){if(s>BigInt(Number.MAX_SAFE_INTEGER))throw new Error("File too large to read into buffer");s=Number(s)}let l=Buffer.alloc(s),{bytesRead:f}=await n.read(l,0,s,0);if(r&&typeof r.encoding=="string")return l.slice(0,f).toString(r.encoding);if(typeof r=="string"){if(r==="utf8"||r==="utf-8")return l.slice(0,f).toString(r);throw new Error("Unsupported encoding: "+r)}return l.slice(0,f)}finally{n&&i&&await n.close()}}async writeFile(e,r,i){let n=typeof e!="number",o,s,l,f="w";if(typeof i=="string"?s=i:i&&typeof i=="object"&&(s=i.encoding,l=i.mode,f=i.flag||"w"),typeof e=="number"){let c=this.getFilehandle(e);if(!c)throw new Error("Invalid file descriptor");o=c}else if(typeof e=="string")o=await this.open(e,f,l);else throw new Error("only filehandle and path are supported atm");try{let c;if(typeof r=="string")c=Buffer.from(r,s||"utf8");else if(r instanceof Buffer)c=r;else if(r instanceof Uint8Array)c=Buffer.from(r);else throw new Error("Invalid data type for writeFile");let u=0;for(;u<c.length;){let{bytesWritten:h}=await o.write(c,u,c.length-u,u);u+=h}}finally{o&&n&&await o.close()}}};a(Zh,"CompositeFs");var zo=Zh;var Zb=ae(od(),1);var sd=class sd extends vt{constructor({parentFs:r,gitRoot:i,hiddenFiles:n}){super({parentFs:r,gitRoot:i});H(this,"ig");this.ig=(0,Zb.default)(),this.ig.add(n)}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 255}error(r){return new Error(`Access to hidden file is not allowed: ${this.toStr(r)}`)}async open(r,i,n){throw this.error(r)}async access(r){throw this.error(r)}async stat(r){throw this.error(r)}async lstat(r){throw this.error(r)}async opendir(r){throw this.error(r)}async link(r){throw this.error(r)}async mkdir(r){throw this.error(r)}async readdir(r){throw this.error(r)}async readlink(r){throw this.error(r)}async unlink(r){throw this.error(r)}async rename(r){throw this.error(r)}async rmdir(r){throw this.error(r)}async symlink(r,i){throw this.error(i)}async lookup(r){throw this.error(r)}resolvePath(r){throw new Error(`Access to hidden file is not allowed: resolvePath(${r})`)}async close(r){throw new Error("Access to hidden file is not allowed: close: "+r.subFsFileDescriptor)}async dataSync(r){throw new Error("Access to hidden file is not allowed: dataSync: "+r.subFsFileDescriptor)}async read(r,i,n,o,s){throw new Error("Access to hidden file is not allowed: readFileHandle: "+r.subFsFileDescriptor)}};a(sd,"HiddenFileSubFs");var Vo=sd;var kl=ae(Sr(),1),Pl=ae(Fn(),1);var Xb=ae(od(),1);var ad=class ad extends vt{constructor({parentFs:r,gitRoot:i,ephemeralPatterns:n}){super({parentFs:r,gitRoot:i});H(this,"openFh",new Map);H(this,"memFs",(0,Pl.createFsFromVolume)(new Pl.Volume));H(this,"ig");H(this,"patterns");this.compositFs=r,this.gitRoot=i,this.ig=(0,Xb.default)(),this.ig.add(n),this.patterns=n}normalizePath(r){let i=typeof r=="string"?r:r.toString();return i.startsWith("/")?i:"/"+i}async responsible(r){let i=r.replace(/\\/g,"/"),n=i.startsWith("./")?i.slice(2):i;return n=n.startsWith("/")?n.slice(1):n,n===""||n==="."?!1:this.ig.ignores(n)}fileType(){return 5}async open(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0});let l=await this.memFs.promises.open(o,i,n);return this.openFh.set(l.fd,l),new kt({fs:this,subFsFileDescriptor:l.fd,parentFsFileDescriptors:[l.fd]})}async access(r,i){let n=this.normalizePath(r);return await this.memFs.promises.access(n,i)}async stat(r,i){let n=this.normalizePath(r);return this.memFs.promises.stat(n,{bigint:!1})}async lstat(r,i){let n=this.normalizePath(r);return this.memFs.promises.lstat(n,{bigint:!1})}async opendir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.opendir(n,i)}async link(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.link(n,o)}async mkdir(r,i){let n=this.normalizePath(r);if(!(typeof i=="object"&&i&&"recursive"in i&&i.recursive)){let s=kl.dirname(n);if(s&&s!=="/"&&s!==".")try{await this.memFs.promises.stat(s)}catch{await this.memFs.promises.mkdir(s,{recursive:!0})}}await this.memFs.promises.mkdir(n,i)}async readdir(r,...i){let n=this.normalizePath(r),o=await this.memFs.promises.readdir(n,...i);return console.log("EPHEMERAL: READDIR: ",o),o}async readlink(r){throw new Error("readlink is not implemented for EphemeralFileSubFs")}async unlink(r){let i=this.normalizePath(r);return await this.memFs.promises.unlink(i)}async rename(r,i){let n=this.normalizePath(r),o=this.normalizePath(i);return await this.memFs.promises.rename(n,o)}async rmdir(r,i){let n=this.normalizePath(r);return await this.memFs.promises.rmdir(n,i)}async symlink(r,i,n){let o=this.normalizePath(r),s=this.normalizePath(i);return await this.memFs.promises.symlink(o,s,n)}async lookup(r){throw new Error(`lookup is not implemented for: ${this.toStr(r)}`)}async close(r){let i=this.openFh.get(r.subFsFileDescriptor);i&&(await i.close(),this.openFh.delete(r.subFsFileDescriptor))}async dataSync(r){let i=this.openFh.get(r.subFsFileDescriptor);if(i)return await i.datasync()}async read(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.read(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async fchmod(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.chmod(i)}async fchown(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.chown(i,n)}async write(r,i,n,o,s){let l=this.openFh.get(r.subFsFileDescriptor);if(l)return await l.write(i,n,o,s);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async ftruncate(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.truncate(i)}resolvePath(r){throw new Error(`resolvePath is not implemented: resolvePath(${r})`)}async fstat(r,i){let n=this.openFh.get(r.subFsFileDescriptor);if(n)return await n.stat(i);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async futimes(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.utimes(i,n)}async writev(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.writev(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readv(r,i,n){let o=this.openFh.get(r.subFsFileDescriptor);if(o)return await o.readv(i,n??void 0);throw new Error(`File handle not found: ${r.subFsFileDescriptor}`)}async readFile(r,i){if(typeof r=="string"||Buffer.isBuffer(r)){let n=this.normalizePath(r);return this.memFs.promises.readFile(n,i)}return super.readFile(r,i)}async writeFile(r,i,n){let o=this.normalizePath(r),s=kl.dirname(o);return s&&s!=="/"&&s!=="."&&await this.memFs.promises.mkdir(s,{recursive:!0}),this.memFs.promises.writeFile(o,i,n)}};a(ad,"EphemeralSubFs");var Go=ad;var om=ae(Sr(),1),pf=ae(Fn(),1);var nf=ae(Me(),1);var of={type:"gitBranchesListVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await nf.default.listBranches({fs:e,dir:t}),i=await nf.default.currentBranch({fs:e,dir:t}),n=await Promise.all(r.map(async o=>{let s=await nf.default.resolveRef({fs:e,dir:t,ref:o});return o}));return{type:"directory",content:n,mode:493,size:n}}catch(r){throw r}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ue=ae(Me(),1);var _r=ae(Me(),1);async function Fr(t,e,r){try{return await _r.default.resolveRef({fs:t,dir:e,ref:`refs/heads/${r}`})}catch{return}}a(Fr,"tryResolveRef");async function ro({dir:t,fs:e,treeOid:r,deletePathParts:i,addPathParts:n,addObj:o}){let[s,...l]=n??[],[f,...c]=i??[],u=[];if(r){let{tree:h}=await _r.default.readTree({fs:e,dir:t,oid:r});u=[...h]}if(s===f){let h=s;if(h===void 0)throw new Error("illegal arguement - called with out a path part");if(l.length===0)throw new Error("can not move into it self");if(c.length===0)throw new Error("can not move from it self");let d=u.findIndex(v=>v.path===h),m=(d!==-1?u[d]:void 0)?.oid,w=await ro({dir:t,fs:e,treeOid:m,addPathParts:l,deletePathParts:c,addObj:o});if(w===void 0)throw new Error("on the same path we expect an update - respectivly a newly created subTreeOid");let y=!1;if(w!==m){y=!0;let v={mode:"040000",path:h,oid:w,type:"tree"};d!==-1?u[d]=v:u.push(v)}if(r==null&&!y)throw new Error("Illegal state - if the currentOid is undefined - a new tree should have been created (an update should have happened)");if(y)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}else{let h=!1,d;if(f){let p=u.findIndex(w=>w.path===f),m=p!==-1?u[p]:void 0;if(m===void 0)throw new Error("Element doesnt exist in tree");if(c.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to delete is not a tree");let w=await ro({dir:t,fs:e,treeOid:m.oid,addPathParts:void 0,deletePathParts:c,addObj:o});if(w===m.oid)throw new Error("in case of a delete we expect a different subtree oid");h=!0,w===void 0?u.splice(p,1):u[p]={mode:"040000",path:f,oid:w,type:"tree"}}else h=!0,u.splice(p,1);d=m}if(s){let p=u.findIndex(w=>w.path===s),m=p!==-1?u[p]:void 0;if(l.length>0){if(m&&m.type!=="tree")throw new Error("SubPart of the path for the obj to add is not a tree");let w=await ro({dir:t,fs:e,treeOid:m?.oid,addPathParts:l,deletePathParts:void 0,addObj:o});if(w===void 0)throw new Error("in case we add, we expect an update - respectivly a newly created subTreeOid");if(w!==m?.oid){h=!0;let y={mode:"040000",path:s,oid:w,type:"tree"};p!==-1?u[p]=y:u.push(y)}}else{h=!0;let w={mode:o.type==="tree"?"040000":"100644",path:s,oid:o.oid,type:o.type};p!==-1?u[p]=w:u.push(w)}}if(u.length===0)return;if(h)return await _r.default.writeTree({fs:e,dir:t,tree:u});if(r===void 0)throw new Error("currentOid should be set - since the sub tree didn't exist and ");return r}}a(ro,"buildUpdatedTree");async function Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:i,pathParams:n}){if(!n.filePath){let l=await _r.default.readTree({fs:r,dir:e,oid:i});return{type:"tree",entries:l.tree.map(c=>c.path),oid:l.oid}}return(await _r.default.walk({fs:r,dir:e,trees:[_r.default.TREE({ref:i})],map:a(async(l,[f])=>{if(l===n.filePath&&f){let c=await f.type();if(c==="blob")return{type:"blob",oid:await f.oid()};if(c=="tree"){let u=await _r.default.readTree({fs:r,dir:e,oid:await f.oid()});return{type:"tree",entries:u.tree.map(d=>d.path),oid:u.oid}}}},"map")})).find(l=>l!==void 0)}a(Ci,"resolveGitObjAtPath");var sf=class sf extends Error{constructor(r,i){super(r);H(this,"code","ENOENT");H(this,"path");this.name="ENOENTError",this.path=i,Object.setPrototypeOf(this,sf.prototype)}};a(sf,"ENOENTError");var Ni=sf;async function E1(t,e,r,i){let[n,...o]=i;if(!n)return r;let{tree:s}=await ue.default.readTree({fs:t,dir:e,oid:r}),l=[...s],f=l.findIndex(c=>c.path===n);if(f===-1)return r;if(o.length===0)l.splice(f,1);else{let c=l[f];if(c&&c.type==="tree"){let u=await E1(t,e,c.oid,o);if(u!==c.oid)l[f]={mode:c.mode,path:c.path,type:c.type,oid:u};else return r}else return r}return await ue.default.writeTree({fs:t,dir:e,tree:l})}a(E1,"buildTreeWithoutFile");var io={type:"gitBranchFileVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,filePath:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=await Fr(e,t,n.branchName);if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let s=await Ci({filePath:r,gitRoot:t,nodeFs:e,commitSha:o,pathParams:n});if(!s)throw new Ni(`ENOENT: no such file or directory, stat '${r}'`,r);let l=await ue.default.readCommit({fs:e,dir:t,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;if(s.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)};{let{blob:u}=await ue.default.readBlob({fs:e,dir:t,oid:s.oid});return{mode:420,size:u.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(u.length/4096),atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(n.branchName===void 0)throw new Error("branchName should be in pathParams");let o=[];try{let s=await Fr(r,e,n.branchName),l=await Fr(r,e,"refs/heads/"+n.branchName);if(!s){let c=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:n.branchName,object:c}),s=await ue.default.resolveRef({fs:r,ref:`refs/heads/${n.branchName}`,dir:e})}let f=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:s,pathParams:n});if(!f)return;if(f.type==="blob"){let{blob:c}=await ue.default.readBlob({fs:r,dir:e,oid:f.oid});return{type:"file",content:Buffer.from(c),mode:420,size:c.length,oid:f.oid}}else{let c=[];try{let h=await i.promises.stat(t);if(h&&h.isDirectory()){let d=await i.promises.readdir(t,{withFileTypes:!1,encoding:"utf-8"});c.push(...d.filter(p=>p!==".keep"))}}catch{}return{type:"directory",content:Array.from(new Set([...f.entries.filter(h=>h!==".keep"),...c])),mode:493}}}catch{return}},"getFile"),unlink:a(async({filePath:t,gitRoot:e,nodeFs:r,cacheFs:i,pathParams:n})=>{if(!n.branchName)throw new Error("branchName should be in pathParams");if(!n.filePath)throw new Error("filePath should be in pathParams");let o=await ue.default.resolveRef({fs:r,dir:e,ref:n.branchName}),s=await ue.default.readTree({fs:r,dir:e,oid:o}),l=await E1(r,e,s.oid,n.filePath.split("/"));if(l!==s.oid){let f=await ue.default.commit({fs:r,dir:e,message:`Delete ${n.filePath}`,tree:l,noUpdateBranch:!0,parent:[o],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${n.branchName}`,value:f,force:!0})}},"unlink"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");if(o.filePath===void 0)throw new Error("filePath should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await ue.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f){let h=await ue.default.resolveRef({fs:r,dir:e,ref:"HEAD"});await ue.default.branch({fs:r,dir:e,ref:o.branchName,object:h}),f=await ue.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`})}let c=await ue.default.readTree({fs:r,dir:e,oid:f}),u=await ro({dir:e,fs:r,treeOid:c.oid,addPathParts:o.filePath.split("/"),deletePathParts:void 0,addObj:{type:"blob",oid:l}});if(u!==c.oid){let h=await ue.default.commit({fs:r,dir:e,message:`\u{1F4BE} Change '${o.filePath}'`,tree:u,noUpdateBranch:!0,parent:[f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:r,dir:e,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){if(n.branchName===void 0)throw new Error("branchName should be in pathParams");if(n.filePath===void 0)throw new Error("filePath should be in pathParams");if(o.branchName===void 0)throw new Error("branchName should be in newPathParams");if(o.filePath===void 0)throw new Error("filePath should be in newPathParams");let s=await Fr(i,r,n.branchName);if(!s)throw new Error("Invalid branch file path - source branch must exist");let l=await Fr(i,r,o.branchName);if(!l){let h=await ue.default.resolveRef({fs:i,dir:r,ref:"HEAD"});await ue.default.branch({fs:i,dir:r,ref:o.branchName,object:h}),l=await ue.default.resolveRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`})}if(o.branchName!==n.branchName)throw new Error("cross branch move not implemented yet");let f=await Ci({gitRoot:r,nodeFs:i,commitSha:s,filePath:t,pathParams:n});if(f===void 0)throw new Error("no obj at path exists");let c=await ro({dir:r,fs:i,deletePathParts:n.filePath.split("/"),addPathParts:o.filePath.split("/"),addObj:f,treeOid:l}),u=await ue.default.readTree({fs:i,dir:r,oid:s});if(c!==u.oid){let h=await ue.default.commit({fs:i,dir:r,message:`\u{1F500} Rename '${n.filePath}' to '${o.filePath}'`,tree:c,noUpdateBranch:!0,parent:[l],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await ue.default.writeRef({fs:i,dir:r,ref:`refs/heads/${o.branchName}`,value:h,force:!0})}},"rename"),mkdir:a(async function(t){try{throw await io.getStats(t),new Error("Folder exists")}catch{}t.filePath.endsWith("/")&&(t.filePath=t.filePath.replace(/\/+$/,"")),t.pathParams&&typeof t.pathParams.filePath=="string"&&(t.pathParams.filePath=t.pathParams.filePath.replace(/\/+$/,""));let e={...t,filePath:t.filePath+=".keep",content:""};e.pathParams.filePath+="/.keep",await io.writeFile(e)},"mkdir")};var ei=ae(Me(),1);var af={type:"gitBranchHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await ei.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");try{let i;try{i=await ei.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await ei.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}return{type:"file",content:i+`
|
|
104
|
+
`,mode:420,size:i.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(console.log("gitBranchHeadVirtualFile writeFile called",{pathParams:o,content:i}),o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=i.toString().trim();try{await ei.default.readCommit({fs:r,dir:e,oid:s})}catch{throw new Error(`Commit ${s} does not exist in the repository`)}await ei.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:s,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var S1=ae(Me(),1);var x1={type:"gitBranchTipVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.branchName)throw new Error("branchName should be in pathParams");try{let n=await S1.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`});return{type:"file",content:n+`
|
|
105
|
+
`,mode:420,size:n.length+1}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var lf=ae(Me(),1);var cf={type:"gitCommitFileVirtualFile",getStats:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40,o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)throw new Ni(`ENOENT: no such file or directory, stat '${t}'`,t);let s=await lf.default.readCommit({fs:r,dir:e,oid:n}),{commit:l}=s,f=l.committer.timestamp*1e3;if(o.type==="tree")return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!0,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0,atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)};{let{blob:c}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{mode:420,size:c.length,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(c.length/4096),atimeMs:f,mtimeMs:f,ctimeMs:f,birthtimeMs:f,atime:new Date(f),mtime:new Date(f),ctime:new Date(f),birthtime:new Date(f)}}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{if(!i.sha_1_1_2)throw new Error("sha_1_1_2 should be in pathParams");if(!i.sha1_3__40)throw new Error("sha1_3__40 should be in pathParams");let n=i.sha_1_1_2+i.sha1_3__40;try{let o=await Ci({filePath:t,gitRoot:e,nodeFs:r,commitSha:n,pathParams:i});if(!o)return;if(o.type==="blob"){let{blob:s}=await lf.default.readBlob({fs:r,dir:e,oid:o.oid});return{type:"file",content:Buffer.from(s),mode:420,size:s.length,oid:o.oid}}else return{type:"directory",content:Array.from(new Set([...o.entries.filter(l=>l!==".keep")])),mode:493}}catch{return}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var ff=ae(Me(),1);function K$(t,e,r){return t===0&&e===2&&r===0?"untracked":t===1&&e===0&&r===0?"deleted":t===1&&e===2&&r!==0?"modified":t===0&&e===2&&r===2?"added":"unknown"}a(K$,"getFileStatus");var T1={type:"gitStatusVirtualFile",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>{try{let r=await ff.default.currentBranch({fs:e,dir:t})||"HEAD",i=await ff.default.resolveRef({fs:e,dir:t,ref:"HEAD"}),o=(await ff.default.statusMatrix({fs:e,dir:t})).filter(([,l,f,c])=>l!==f||f!==c).map(([l,f,c,u])=>({path:l,status:K$(f,c,u)})),s=JSON.stringify({branch:r,commit:i,clean:o.length===0,files:o},null,2);return{type:"file",content:s,mode:33188,size:Buffer.byteLength(s)}}catch(r){throw console.error(r),r}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bs={type:"legitVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e})=>{let r=t+"/.git";try{return await e.stat(r)}catch{throw new Error(`ENOENT: no such file or directory, stat '${r}'`)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e})=>({type:"directory",content:[],mode:493,size:0}),"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var O1=[Bs,T1,cf,of,io,af,x1];var tm=class tm{constructor(e){this.routes=e;H(this,"compiledRoutes");let r={},i=a((n,o)=>{if(typeof n.type=="string"){r[o]={handler:n,siblings:[]};let s=n}else{let s=[];for(let[l,f]of Object.entries(n))if(l==="."){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s}}else if(l.startsWith("[[")&&l.endsWith("]]")){if(r[o])throw new Error(`Conflict: multiple handlers for path '${o}', '.' and optional '[[parameter_name]]' defined?`);r[o]={handler:f,siblings:s},l.startsWith("[[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l)}else l.startsWith("[")&&l.endsWith("]")?l.startsWith("[...")?r[o?`${o}/${l}`:l]={handler:f,siblings:[]}:i(f,o?`${o}/${l}`:l):(s.push(l),i(f,o?`${o}/${l}`:l))}},"walk");for(let[n,o]of Object.entries(e))i(o,n);this.compiledRoutes=Object.entries(r).map(([n,o])=>{let s=[],l=n.split("/").map(c=>{if(c.startsWith("[[")&&c.endsWith("]]")){let u=c.slice(2,-2).replace(/^\.\.\./,"");return s.push(u),"(.*)"}if(c.startsWith("[")&&c.endsWith("]")){let u=c.slice(1,-1);return s.push(u),"([^/]+)"}return c.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}).join("/");return{regex:new RegExp(`^${l}$`),paramNames:s,staticSiblings:o.siblings,handler:o.handler}})}match(e){e.length>1&&e.endsWith("/")&&(e=e.replace(/\/+$/,""));for(let{regex:r,paramNames:i,handler:n,staticSiblings:o}of this.compiledRoutes){let s=e.match(r);if(!s)continue;let l={};for(let f=0;f<i.length;f++)l[i[f]]=decodeURIComponent(s[f+1]||"");return{handler:n,params:l,staticSiblings:o}}}};a(tm,"LegitPathRouter");var uf=tm;var hf=ae(Me(),1);var rm={type:"gitCommitVirtualFolder",getStats:a(async t=>{let e=t.gitRoot+"/.git";try{return await t.fs.stat(e)}catch{throw new Error(`ENOENT: no such file or directory, stat '${e}'`)}},"getStats"),getFile:a(async({filePath:t,gitRoot:e,nodeFs:r,pathParams:i})=>{let n=await hf.default.listBranches({fs:r,dir:e}),o=new Set,s=new Set;for(let c of n){let u=`refs/heads/${c}`;try{let h=await hf.default.resolveRef({fs:r,dir:e,ref:u});o.add(h)}catch{}}for(let c of o){let u=await hf.default.log({fs:r,dir:e,ref:c});for(let h of u)s.add(h.oid)}if(!i.sha_1_1_2){let c=new Set;for(let h of s)if(c.add(h.slice(0,2)),c.size>=256)break;let u=Array.from(c).sort();return{type:"directory",content:u,mode:493,size:u}}let l=new Set;for(let c of s)c.startsWith(i.sha_1_1_2)&&l.add(c.slice(2,40));let f=Array.from(l).sort();return{type:"directory",content:f,mode:493,size:f.length}},"getFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nt=ae(Me(),1);var R1=ae(Me(),1);var im="-operation";async function Xe(t,e,r){return(await R1.default.listBranches({fs:t,dir:e})).filter(n=>n.endsWith("__"+r+im))[0]}a(Xe,"resolveOperationBranchName");var k1={type:"gitBranchOperationVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await nt.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await nt.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o,s=!1;return n?(o=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0):o=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`}),{type:"file",content:Buffer.from(o),mode:420,size:o.length}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s;typeof i=="string"?s=new TextEncoder().encode(i):s=new Uint8Array(i);let l=await nt.default.writeBlob({fs:r,dir:e,blob:s}),f=await Fr(r,e,o.branchName);if(!f)throw new Error("Invalid branch file path - branch doesn't exist");let c=await Xe(r,e,o.branchName),u=!1;c||(c="legit/__"+o.branchName+im,await nt.default.branch({fs:r,dir:e,ref:c,object:f}),u=!0);let h=await nt.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${c}`}),d=await nt.default.readTree({fs:r,dir:e,oid:f}),p;i instanceof ArrayBuffer?p=Buffer.from(i).toString("utf-8"):typeof i=="string"?p=i:i instanceof Uint8Array?p=Buffer.from(i).toString("utf-8"):p=String(i);let m=!1;if(!u){let y=await nt.default.findMergeBase({fs:r,dir:e,oids:m?[h]:[h,f]});y.length===1&&y[0]===f&&(m=!0)}let w=await nt.default.commit({fs:r,dir:e,message:p,tree:d.oid,noUpdateBranch:!0,parent:m?u?[f,f]:[h]:[h,f],author:{name:"GitLegitFs",email:"gitlegit@example.com",timestamp:Math.floor(Date.now()/1e3),timezoneOffset:0}});await nt.default.writeRef({fs:r,dir:e,ref:`refs/heads/${c}`,value:w,force:!0})},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Bi=ae(Me(),1);var nm={type:"gitBranchOperationsVirtualFile",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t;if(i.branchName===void 0)throw new Error("branchName should be in pathParams");let n=await Xe(r,e,i.branchName),o,s=!1;if(n)try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:n}),s=!0}catch{try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),s=!0}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}}else try{o=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let l=await Bi.default.readCommit({fs:r,dir:e,oid:o}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:(s?await nm.getFile(t):void 0)?.content?.length??0,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o=[];if(n){let f=await Bi.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),c=!1,u=f;for(;u&&!c;){let h=await Bi.default.readCommit({fs:r,dir:e,oid:u});o.push({oid:h.oid,parentOids:h.commit.parent,message:h.commit.message,originBranchOid:"unset"}),u=h.commit.parent&&h.commit.parent.length>0?h.commit.parent[0]:null,h.commit.parent.length===2&&h.commit.parent[0]===h.commit.parent[1]&&(c=!0)}}let s;for(let f=o.length-1;f>=0;f--){let c=o[f];if(s===void 0){if(c.parentOids.length!==2&&c.parentOids[0]!==c.parentOids[1])throw new Error(`Operation commit ${c.oid} does not have two parents as expected`);s=c.parentOids[1]}c.parentOids.length===2&&(s=c.parentOids[1]),c.originBranchOid=s}let l=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:l,mode:420,size:l.length}},"getFile"),rename:a(async function(t){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var no=ae(Me(),1);var Z$=new Set([" ","~","^",":","?","*","[","\\"]),X$=[/^\/|\/$/,/\/\//,/\.$/,/\.lock$/,/^@$/,/@\{/],A1="\u2002";function P1(t){let e=t.codePointAt(0);return!(e>=0&&e<=31||e===127||Z$.has(t))}a(P1,"isValidChar");function I1(t){let e="";for(let r of t)r===" "?e+=A1:P1(r)?e+=r:e+="%"+r.codePointAt(0);for(let r of X$)if(r.test(e))return Array.from(e).map(i=>P1(i)?i:"%"+i.codePointAt(0)).join("");return e}a(I1,"encodeName");function D1(t){return t.replace(/%(\d+)/g,(e,r)=>String.fromCodePoint(parseInt(r,10))).replace(new RegExp(A1,"g")," ")}a(D1,"decodeName");var C1={type:"getThreadName",getStats:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n;try{n=await no.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${i.branchName}`})}catch{throw new Error(`Base Branch ${i.branchName} for operations does not exis`)}let o=await Xe(r,e,i.branchName),s=!1;if(o)try{n=await no.default.resolveRef({fs:r,dir:e,ref:o}),s=!0}catch{try{n=await no.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${o}`}),s=!0}catch{}}let l=await no.default.readCommit({fs:r,dir:e,oid:n}),{commit:f}=l,c=f.committer.timestamp*1e3;try{return{mode:420,size:40,atimeMs:c,mtimeMs:c,ctimeMs:c,birthtimeMs:c,atime:new Date(c),mtime:new Date(c),ctime:new Date(c),birthtime:new Date(c),isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:0}}catch{throw new Error("ENOENT: no such file or directory, stat operationHistory")}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=await Xe(r,e,i.branchName),o;if(n){let s="legit/",l=`__${i.branchName}-operation`;return n.startsWith(s)&&n.endsWith(l)?o=n.slice(s.length,n.length-l.length):o=n,{type:"file",content:Buffer.from(D1(o)),mode:420,size:o.length}}return{type:"file",content:Buffer.from(""),mode:420,size:0}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName);if(s){let l=`legit/${I1(i.toString())}__${o.branchName}-operation`;await no.default.renameBranch({fs:r,dir:e,oldref:s,ref:l}),s=l}},"writeFile"),rename:a(async function({filePath:t,newPath:e,gitRoot:r,nodeFs:i,pathParams:n,newPathParams:o}){throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var oo=ae(Me(),1);var N1={type:"gitBranchHistory",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i;try{i=await oo.default.resolveRef({fs:e,dir:t,ref:r.branchName})}catch{i=await oo.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${r.branchName}`})}let n=await oo.default.readCommit({fs:e,dir:t,oid:i}),{commit:o}=n,s=o.committer.timestamp*1e3;return{mode:420,size:1e4,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:s,mtimeMs:s,ctimeMs:s,birthtimeMs:s,atime:new Date(s),mtime:new Date(s),ctime:new Date(s),birthtime:new Date(s)}},"getStats"),getFile:a(async t=>{let{gitRoot:e,nodeFs:r,pathParams:i}=t,n=i.branchName,o=[];if(n){let l=await oo.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${n}`}),f=!1,c=l;for(;c&&!f;){let u=await oo.default.readCommit({fs:r,dir:e,oid:c});o.push({oid:u.oid,...u.commit}),c=u.commit.parent[0]}}let s=Buffer.from(JSON.stringify(o,null,2),"utf-8");return{type:"file",content:s,mode:420,size:s.length}},"getFile"),rename:a(async t=>{throw new Error("not implemented")},"rename"),mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var nr=ae(Me(),1);var B1={type:"gitBranchOperationHeadVirtualFile",getStats:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i){let f=new Date(0);return{mode:420,size:0,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:f.getTime(),mtimeMs:f.getTime(),ctimeMs:f.getTime(),birthtimeMs:f.getTime(),atime:f,mtime:f,ctime:f,birthtime:f}}let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}let o=await nr.default.readCommit({fs:e,dir:t,oid:n}),{commit:s}=o,l=s.committer.timestamp*1e3;return{mode:420,size:40,isFile:a(()=>!0,"isFile"),isDirectory:a(()=>!1,"isDirectory"),isSymbolicLink:a(()=>!1,"isSymbolicLink"),isBlockDevice:a(()=>!1,"isBlockDevice"),isCharacterDevice:a(()=>!1,"isCharacterDevice"),isSocket:a(()=>!1,"isSocket"),isFIFO:a(()=>!1,"isFIFO"),isFileSync:a(()=>!0,"isFileSync"),isDirectorySync:a(()=>!1,"isDirectorySync"),dev:0,ino:0,nlink:1,uid:0,gid:0,rdev:0,blksize:4096,blocks:Math.ceil(40/4096),atimeMs:l,mtimeMs:l,ctimeMs:l,birthtimeMs:l,atime:new Date(l),mtime:new Date(l),ctime:new Date(l),birthtime:new Date(l)}},"getStats"),getFile:a(async({gitRoot:t,nodeFs:e,pathParams:r})=>{if(r.branchName===void 0)throw new Error("branchName should be in pathParams");let i=await Xe(e,t,r.branchName);if(!i)return{type:"file",content:"",mode:420,size:0};try{let n;try{n=await nr.default.resolveRef({fs:e,dir:t,ref:i})}catch{n=await nr.default.resolveRef({fs:e,dir:t,ref:`refs/heads/${i}`})}return{type:"file",content:n+`
|
|
106
|
+
`,mode:420,size:n.length}}catch{return}},"getFile"),writeFile:a(async({filePath:t,gitRoot:e,nodeFs:r,content:i,cacheFs:n,pathParams:o})=>{if(o.branchName===void 0)throw new Error("branchName should be in pathParams");let s=await Xe(r,e,o.branchName),l=await nr.default.resolveRef({fs:r,dir:e,ref:`refs/heads/${s}`});if(!s)throw new Error(`Operation branch name could not be resolved for branch ${o.branchName}`);let f=i.toString().trim(),c,u,h=!1;if(!l)throw new Error(`Operation branch ref could not be resolved for branch ${s}`);let d=l;for(;d&&!h;){let p=await nr.default.readCommit({fs:r,dir:e,oid:d});if(p.oid===f&&(c=p.oid),d=p.commit.parent&&p.commit.parent.length>0?p.commit.parent[0]:null,p.commit.parent.length===2){if(p.commit.parent[0]===p.commit.parent[1])h=!0;else if(c!==void 0){u=p.commit.parent[1];break}}}if(c===void 0)throw new Error(`Cant rollback to ${f} couldn't find newOperationBranchHead ${c}`);if(u===void 0)throw new Error(`Cant rollback to ${f} couldn't find newBranchHead ${u}`);await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+s,value:c,force:!0}),await nr.default.writeRef({fs:r,dir:e,ref:"refs/heads/"+o.branchName,value:u,force:!0})},"writeFile"),rename(t){throw new Error("not implementsd")},mkdir:a(async function(t){throw new Error("not implemented")},"mkdir")};var Er=class Er extends vt{constructor({parentFs:r,gitRoot:i,virtualFiles:n=O1}){super({parentFs:r,gitRoot:i});H(this,"memFs");H(this,"openFh",{});H(this,"virtualFiles");H(this,"legitFileNames");this.gitRoot=i,this.memFs=(0,pf.createFsFromVolume)(new pf.Volume),this.virtualFiles=n,this.legitFileNames=["branches","commits"]}async responsible(r){return this.isLegitPath(r)}isLegitPath(r){return r.includes(`/${Er.LEGIT_DIR}/`)||r.includes(`/${Er.LEGIT_DIR}`)}getRouteHandler(r){let i=r.indexOf(`/${Er.LEGIT_DIR}`);if(i===-1)throw new Error("Not a legit path");let n=r.slice(i+1);return Er.pathRouter.match(n)}async open(r,i,n){let o=this.getRouteHandler(r);if(!o)throw new Error("Not a virtual legit file");if(!(o?.handler.writeFile!==void 0)&&(i.includes("w")||i.includes("a")))throw new Error(`Write operations not allowed for ${o?.handler.type}`);if(i.includes("x")&&o?.handler.type!=="gitBranchFileVirtualFile")throw new Error(`Exclusive operations not allowed for ${o?.handler.type}`);let l=await o.handler.getFile({cacheFs:this.memFs,filePath:r,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(i.includes("x")){for(let d of Object.values(this.openFh))if(d.path===r)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r});if(l!==void 0)throw Object.assign(new Error(`EEXIST: file already exists, open '${r}'`),{code:"EEXIST",errno:-17,syscall:"open",path:r})}if(l&&i.includes("x"))throw new Error("file existed - openend with x flag");if(!l&&!(i.includes("w")||i.includes("a")))throw new Error(`ENOENT: no such file or directory, open '${r}'`);let f=om.dirname(r);if(await this.memFs.promises.mkdir(f,{recursive:!0}),l===void 0&&!i.includes("x")||l&&l.type==="file")try{let d=await this.memFs.promises.access(r)}catch{await this.memFs.promises.writeFile(r,"")}let c=await this.memFs.promises.open(r,i,n),u=c.fd,h=new kt({fs:this,subFsFileDescriptor:u,parentFsFileDescriptors:[]});return this.openFh[u]={path:r,mode:i,fh:c,openSha:l?.oid,readSha:void 0,unflushed:[]},(i.includes("x")||i.includes("w"))&&this.openFh[u].unflushed.push({length:0,start:0}),h}async mkdir(r,i){let n=r.toString(),o=this.getRouteHandler(n),s=i?{options:i}:{};try{await o?.handler.mkdir({cacheFs:this.memFs,filePath:r.toString(),fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:o.params,...s});let l=typeof i=="object"?{...i,recursive:!0}:{recursive:!0};await this.memFs.promises.mkdir(r,l);let f=n.split("/"),c="";for(let u=1;u<=f.length;u++){c="/"+f.slice(0,u).join("/");try{if((await this.memFs.promises.stat(c)).isDirectory()){let d=await this.memFs.promises.open(c,"r");this.openFh[d.fd]={path:c,mode:"r",fh:d,openSha:void 0,readSha:void 0,unflushed:[]}}}catch{}}}catch(l){throw l}}async access(r,i){await this.stat(r)}async futimes(r,i,n){let o=this.openFh[r.subFsFileDescriptor];if(!o)throw new Error("Invalid file handle");return await o.fh.utimes(i,n)}async fstat(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return this.stat(n.path,i)}async ftruncate(r,i){let n=this.openFh[r.subFsFileDescriptor];if(!n)throw new Error("Invalid file handle");return await n.fh.truncate(i)}async stat(r,i){let n=r.toString(),o=Object.values(this.openFh).find(f=>f.path===n);if(o&&o.unflushed.length>0)return await o.fh.stat(i);let s=this.getRouteHandler(n);if(!s)throw new Error(`ENOENT: no such file or directory, stat '${n}'`);return await s.handler.getStats({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:s.params})}async lstat(r,i){return this.stat(r,i)}async readdir(r,i){let n=r.toString();if(!this.isLegitPath(n))return[".legit"];let o=this.getRouteHandler(n);if(!o)throw new Error(`ENOENT: no such file or directory, scandir '${n}'`);let s=await o?.handler.getFile({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:o.params});if(s){if(s.type!=="directory")throw new Error("not a folder");let l=o?.staticSiblings??[],f=s.content;return f&&!Array.isArray(s.content)&&(f=JSON.parse(s.content)),Array.from(new Set([...f,...l])).sort((u,h)=>u.localeCompare(h,void 0,{numeric:!0,sensitivity:"base"}))}return[]}async read(r,i,n,o,s){let l=r.subFsFileDescriptor,f=this.openFh[l];if(!f)throw new Error("Invalid file handle");if(f.unflushed.length===0){let c=this.getRouteHandler(f.path),u=await c.handler.getFile({cacheFs:this.memFs,filePath:f.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:c?.params});if(!u?.content)throw new Error("couldnt access content");if(u.type!=="file")throw new Error("not a file");let h=typeof u.content=="string"?Buffer.from(u.content):u.content,d=typeof s=="number"?s:0,p=Math.min(d+o,h.length),m=Math.max(0,p-d);return h.copy(i,n,d,d+m),{bytesRead:m,buffer:i}}return await f.fh.read(i,n,o,s)}async write(r,i,n,o,s){let l=this.openFh[r.subFsFileDescriptor];if(!l)throw new Error("Invalid file handle");let f=l.mode;if(!f.includes("w")&&!f.includes("a")&&!f.includes("+"))throw Object.assign(new Error("EBADF: bad file descriptor, write"),{code:"EBADF",errno:-9,syscall:"write"});if(l.unflushed.length===0){let d=this.getRouteHandler(l.path),p=await d.handler.getFile({cacheFs:this.memFs,filePath:l.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,pathParams:d.params});p&&p.oid&&(await this.memFs.promises.writeFile(l.path,p.content),l.readSha=p.oid)}let c=await l.fh.write(i,n,o,s),u=n??0,h=s??0;return l.unflushed.push({start:h,length:o||i.byteLength-u+h}),c}async close(r){let i=r.subFsFileDescriptor;if(!this.openFh[i])throw new Error("Invalid file handle");await this.dataSync(r),delete this.openFh[i]}async dataSync(r){let i=r.subFsFileDescriptor,n=this.openFh[i];if(!n)throw new Error("Invalid file handle");if(n.unflushed.length>0){let o=this.getRouteHandler(n.path);if(o&&o.handler.writeFile){let s=await this.memFs.promises.readFile(n.path);await o.handler.writeFile({cacheFs:this.memFs,filePath:n.path,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,content:s,pathParams:o.params})}n.unflushed=[],await this.memFs.promises.writeFile(n.path,"")}}async readFile(r,i){let n=typeof r=="string"?r:Buffer.isBuffer(r)?r.toString():r.fd?`FileHandle(${r.fd})`:r.toString(),o=null;typeof i=="string"?o=i:i&&typeof i=="object"&&i.encoding&&(o=i.encoding);let s=await this.open(n,"r");try{let f=(await this.fstat(s)).size,c=Buffer.alloc(f);return await this.read(s,c,0,f,0),await this.close(s),o?c.toString(o):c}catch(l){try{await this.close(s)}catch{}throw l}}async writeFile(r,i,n){let o="w",s="utf8",l;typeof n=="string"?s=n:n&&typeof n=="object"&&(n.flag&&(o=String(n.flag)),n.encoding&&(s=n.encoding),n.mode&&(l=typeof n.mode=="string"?parseInt(n.mode,8):n.mode));let f=await this.open(r,o,l);try{let c;typeof i=="string"?c=Buffer.from(i,s):Buffer.isBuffer(i)?c=i:i instanceof Uint8Array?c=Buffer.from(i):ArrayBuffer.isView(i)?c=Buffer.from(i.buffer,i.byteOffset,i.byteLength):c=Buffer.from(i),await this.write(f,c,0,c.length,0)}finally{await this.close(f)}}async rename(r,i){let n=r.toString(),o=i.toString(),s=this.getRouteHandler(n),l=this.getRouteHandler(o);if(s?.handler.type==="gitBranchFileVirtualFile"&&l?.handler.type==="gitBranchFileVirtualFile"){let f=!0;try{await this.memFs.promises.access(o)}catch{f=!1}let c=!0;try{await this.stat(o)}catch{c=!1}let u=!0;try{await this.stat(n)}catch{u=!1}let h=!0;try{await this.memFs.promises.access(n)}catch{h=!1}if(h){let m=om.dirname(o);try{await this.memFs.promises.access(m)}catch{await this.memFs.promises.mkdir(m,{recursive:!0})}await this.memFs.promises.rename(r,i)}let d=this.getRouteHandler(n);if(!d)throw new Error("VF not found");let p=await d.handler.rename({cacheFs:this.memFs,filePath:n,fs:this.compositFs,gitRoot:this.gitRoot,nodeFs:this.compositFs,newPath:o,pathParams:d?.params??{},newPathParams:l?.params??{}})}else throw new Error(`Unsupported rename operation from ${s?.handler.type} to ${l?.handler.type}`)}async fchmod(r,i){}async unlink(r){let i=r.toString(),n=this.getRouteHandler(i);if(n?.handler.unlink!==void 0){await n.handler.unlink({cacheFs:this.memFs,filePath:i,fs:this.compositFs,nodeFs:this.compositFs,gitRoot:this.gitRoot,pathParams:n.params});for(let[o,s]of Object.entries(this.openFh))s.path===i&&(await s.fh.close(),await this.memFs.promises.unlink(i),delete this.openFh[Number(o)])}else throw new Error(`Cannot unlink ${n?.handler.type} files`)}fileType(){return 10}};a(Er,"GitSubFs"),H(Er,"LEGIT_DIR",".legit"),H(Er,"pathRouter",new uf({".legit":{".":Bs,branches:{".":of,"[branchName]":{".legit":{".":Bs,operation:k1,head:af,operationHead:B1,operationHistory:nm,threadName:C1,history:N1},"[[...filePath]]":io}},commits:{".":rm,"[sha_1_1_2]":{".":rm,"[sha1_3__40]":{"[[...filePath]]":cf}}}}}));var df=Er;var mf=ae(Me(),1);var wf=ae(Fn(),1);async function Gq(){let t=new wf.Volume,e=(0,wf.createFsFromVolume)(t);return Y$(e,"/")}a(Gq,"initMemFSLegitFs");async function Y$(t,e){let r=!1;try{await t.promises.readdir(e+"/.git"),r=!0}catch{}if(r)throw new Error(`cant use initLegitFs on a folder with a git repo (${e}), use openLegitFs instead`);return await mf.default.init({fs:t,dir:"/",defaultBranch:"main"}),await t.promises.writeFile(e+"/.keep",""),await mf.default.add({fs:t,dir:"/",filepath:".keep"}),await mf.default.commit({fs:t,dir:"/",message:"Initial commit",author:{name:"Test",email:"test@example.com"}}),J$(t,e)}a(Y$,"initLegitFs");function J$(t,e){let r=new zo({name:"root",parentFs:void 0,storageFs:t,gitRoot:e}),i=new Go({parentFs:r,gitRoot:e,ephemeralPatterns:[]}),n=new Vo({parentFs:r,gitRoot:e,hiddenFiles:[]});r.setHiddenFilesSubFs(n),r.setEphemeralFilesSubFs(i);let o=new zo({name:"git",parentFs:r,storageFs:void 0,gitRoot:e}),s=new df({parentFs:r,gitRoot:e}),l=new Vo({parentFs:o,gitRoot:e,hiddenFiles:[".git"]}),f=new Go({parentFs:o,gitRoot:e,ephemeralPatterns:["**/._*","**/.DS_Store","**/.AppleDouble/","**/.AppleDB","**/.AppleDesktop","**/.Spotlight-V100","**/.TemporaryItems","**/.Trashes","**/.fseventsd","**/.VolumeIcon.icns","**/.ql_disablethumbnails","**/.~lock.*","**/lu[0-9a-zA-Z]*.tmp","**/.metaentries.json.tmp"]});return o.addSubFs(s),o.setHiddenFilesSubFs(l),o.setEphemeralFilesSubFs(f),o}a(J$,"openLegitFs");var Ot=ae(Me(),1);var gx=ae(yx(),1);function _M(t){let e=[t];return{next(){return Promise.resolve({done:e.length===0,value:e.pop()})},return(){return e=[],{}},[Symbol.asyncIterator](){return this}}}a(_M,"fromValue");function FM(t){return t[Symbol.asyncIterator]?t[Symbol.asyncIterator]():t[Symbol.iterator]?t[Symbol.iterator]():t.next?t:_M(t)}a(FM,"getIterator");async function bx(t,e){let r=FM(t);for(;;){let{value:i,done:n}=await r.next();if(i&&await e(i),n)break}r.return&&r.return()}a(bx,"forAwait");function EM(t){let{PassThrough:e}=yf(),r=new e;return setTimeout(async()=>{await bx(t,i=>r.write(i)),r.end()},1),r}a(EM,"asyncIteratorToStream");async function SM(t){let e=0,r=[];await bx(t,o=>{r.push(o),e+=o.byteLength});let i=new Uint8Array(e),n=0;for(let o of r)i.set(o,n),n+=o.byteLength;return i}a(SM,"collect");function xM(t){let e=Object.getOwnPropertyDescriptor(t,Symbol.asyncIterator);if(e&&e.enumerable)return t;let r=!1,i=[],n={};return t.on("data",o=>{i.push(o),n.resolve&&(n.resolve({value:i.shift(),done:!1}),n={})}),t.on("error",o=>{n.reject&&(n.reject(o),n={})}),t.on("end",()=>{r=!0,n.resolve&&(n.resolve({done:!0}),n={})}),{next(){return new Promise((o,s)=>{if(i.length===0&&r)return o({done:!0});if(i.length>0)return o({value:i.shift(),done:!1});i.length===0&&!r&&(n={resolve:o,reject:s})})},return(){t.removeAllListeners(),t.destroy&&t.destroy()},[Symbol.asyncIterator](){return this}}}a(xM,"fromNodeStream");async function TM({onProgress:t,url:e,method:r="GET",headers:i={},agent:n,body:o}){return o&&Array.isArray(o)?o=Buffer.from(await SM(o)):o&&(o=EM(o)),new Promise((s,l)=>{(0,gx.default)({url:e,method:r,headers:i,agent:n,body:o},(f,c)=>{if(f)return l(f);try{let u=xM(c);s({url:c.url,method:c.method,statusCode:c.statusCode,statusMessage:c.statusMessage,body:u,headers:c.headers})}catch(u){l(u)}})})}a(TM,"request");var OM={request:TM},_f=OM;function RM(t){let e=/^git@([^:]+):(.+)$/,r=t.match(e);if(r){let i=r[1],n=r[2];return`https://${i}/${n}`}return t}a(RM,"normalizeRemoteUrl");var O3=a(({fs:t,gitRepoPath:e,originPrefix:r,corsProxy:i,user:n,password:o})=>{let s=!1,l,f;async function c(){let m=await Ot.default.fetch({fs:t,http:_f,dir:e,url:f,corsProxy:i,onAuth:a(()=>({username:n,password:o}),"onAuth")}),w="origin",y=await Ot.default.listBranches({fs:t,dir:e}),v=[];for(let g of y){let F=`${w}/${g}`,O,S;try{O=await Ot.default.resolveRef({fs:t,dir:e,ref:g})}catch(R){console.log(`Could not resolve local ref ${g}:`,R)}try{S=await Ot.default.resolveRef({fs:t,dir:e,ref:F})}catch{S=void 0}if(O&&S&&O!==S){let R=await Ot.default.findMergeBase({fs:t,dir:e,oids:[O,S]});if(R[0]!==O&&R[0]!==S){let b=await Ot.default.merge({fs:t,dir:e,ours:O,theirs:S,fastForwardOnly:!1,abortOnConflict:!1,author:{name:"Your Name",email:"your.email@example.com"},mergeDriver:a(async({branches:x,contents:_,path:P})=>{let[k,C,N]=_;return console.log(`Merging ${x[0]} with ${x[1]}...`),console.log("merged:"),console.log(_),{cleanMerge:!0,mergedText:N===void 0?C:N}},"mergeDriver")});await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:b.oid,force:!0})}R[0]===O?(console.log(`branch ${g} differs - remote ahaed, not behind`),await Ot.default.writeRef({fs:t,dir:e,ref:`refs/heads/${g}`,value:S,force:!0})):R[0]===S?(console.log(`branch ${g} differs - local ahead, not behind`),v.push(g)):(console.log(`branch ${g} differs - both changed`),v.push(g))}}v.length!==0&&await u(v)}a(c,"pull");async function u(m){for(let w of m)await Ot.default.push({fs:t,http:_f,dir:e,corsProxy:i,url:f,ref:w,onAuth:a(()=>({username:n,password:o}),"onAuth")})}a(u,"push");async function h(){let m=await Ot.default.getConfig({fs:t,dir:e,path:"remote.origin.url"});f=RM(m);try{await c()}catch(w){console.error("Error monitoring changes:",w)}finally{s&&setTimeout(h,1e3)}}a(h,"monitorChanges");function d(){s=!0,h()}a(d,"startPolling");function p(){s=!1}return a(p,"stopPolling"),{clone:a(async m=>Ot.default.clone({fs:t,http:_f,corsProxy:i,dir:e,url:m,onAuth:a(()=>({username:n,password:o}),"onAuth")}),"clone"),start:a(()=>{s||(d(),s=!0)},"start"),stop:a(()=>{p()},"stop")}},"createGitSyncService");var ym=ae(ni(),1);function vx(t){let e=t.name||"untitled";return{kind:"file",name:e,async getFile(){let i=(await t.stat()).size;console.log("reading data into buffer of size"+i);let n=ym.Buffer.alloc(i);await t.read(n,0,i,0);let o=new Uint8Array(n.buffer,n.byteOffset,n.byteLength);console.log("buffer read",o);let s=o;return new File([s],e||"untitled")},async createWritable(){return{async write(r){console.log("writing data to handle",t);let i;if(typeof r=="string")i=ym.Buffer.from(r,"utf-8");else if(r instanceof Blob){let n=await r.arrayBuffer();i=new Uint8Array(n)}else if(ArrayBuffer.isView(r))i=new Uint8Array(r.buffer,r.byteOffset,r.byteLength);else throw console.log("data",r),new Error("Unsupported data type for write");await t.write(i),await t.sync(),console.log("write completed")},async close(){await t.close()}}}}}a(vx,"fileHandleToFileSystemFileHandle");async function kM(t){let e=await t.getFile();return e.handle=t,e}a(kM,"fileSystemFileHandleToFileWithHandle");async function P3(t){return{openFile:a(async e=>{let r=await t.promises.open(e,"w");return r.name=e,await kM(vx(r))},"openFile"),fileSave:a(async(e,r,i,n,o)=>{if(i)console.log("using existing handle",i);else{let f=window.prompt("Save as",r?.fileName??"untitled");if(console.log("result of prompt",f),!f)throw new Error("no file choosen");try{let c=await t.promises.open(`${f}`,"w");i=vx(c)}catch(c){throw console.error("Failed to open file in legitFs",c),new Error("Failed to open file in legitFs")}}let s=e instanceof Blob?e:await e;return await(await i.createWritable()).write(s),i},"fileSave")}}a(P3,"getLegitFsAccess");export{zo as CompositeFs,Go as EphemeralSubFs,df as GitSubFs,Vo as HiddenFileSubFs,Fl as PassThroughSubFs,O3 as createGitSyncService,P3 as getLegitFsAccess,nm as gitBranchOperationsVirtualFile,Y$ as initLegitFs,Gq as initMemFSLegitFs,J$ as openLegitFs};
|
|
107
107
|
/*! Bundled license information:
|
|
108
108
|
|
|
109
109
|
ieee754/index.js:
|