create-expo-nightly 0.0.9 → 0.0.10
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/build/index.js +1 -1
- package/package.json +7 -5
package/build/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as t}from"module";var e={3353:t=>{t.exports=balanced;function balanced(t,e,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(e instanceof RegExp)e=maybeMatch(e,i);var s=range(t,e,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+t.length,s[1]),post:i.slice(s[1]+e.length)}}function maybeMatch(t,e){var i=e.match(t);return i?i[0]:null}balanced.range=range;function range(t,e,i){var s,n,r,o,a;var c=i.indexOf(t);var l=i.indexOf(e,c+1);var h=c;if(c>=0&&l>0){if(t===e){return[c,l]}s=[];r=i.length;while(h>=0&&!a){if(h==c){s.push(h);c=i.indexOf(t,h+1)}else if(s.length==1){a=[s.pop(),l]}else{n=s.pop();if(n<r){r=n;o=l}l=i.indexOf(e,h+1)}h=c<l&&c>=0?c:l}if(s.length){a=[r,o]}}return a}},2297:(t,e,i)=>{var s=i(3353);t.exports=expandTop;var n="\0SLASH"+Math.random()+"\0";var r="\0OPEN"+Math.random()+"\0";var o="\0CLOSE"+Math.random()+"\0";var a="\0COMMA"+Math.random()+"\0";var c="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(n).split("\\{").join(r).split("\\}").join(o).split("\\,").join(a).split("\\.").join(c)}function unescapeBraces(t){return t.split(n).join("\\").split(r).join("{").split(o).join("}").split(a).join(",").split(c).join(".")}function parseCommaParts(t){if(!t)return[""];var e=[];var i=s("{","}",t);if(!i)return t.split(",");var n=i.pre;var r=i.body;var o=i.post;var a=n.split(",");a[a.length-1]+="{"+r+"}";var c=parseCommaParts(o);if(o.length){a[a.length-1]+=c.shift();a.push.apply(a,c)}e.push.apply(e,a);return e}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,e){return t<=e}function gte(t,e){return t>=e}function expand(t,e){var i=[];var n=s("{","}",t);if(!n)return[t];var r=n.pre;var a=n.post.length?expand(n.post,false):[""];if(/\$$/.test(n.pre)){for(var c=0;c<a.length;c++){var l=r+"{"+n.body+"}"+a[c];i.push(l)}}else{var h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var f=h||u;var p=n.body.indexOf(",")>=0;if(!f&&!p){if(n.post.match(/,.*\}/)){t=n.pre+"{"+n.body+o+n.post;return expand(t)}return[t]}var d;if(f){d=n.body.split(/\.\./)}else{d=parseCommaParts(n.body);if(d.length===1){d=expand(d[0],false).map(embrace);if(d.length===1){return a.map((function(t){return n.pre+d[0]+t}))}}}var g;if(f){var y=numeric(d[0]);var w=numeric(d[1]);var b=Math.max(d[0].length,d[1].length);var S=d.length==3?Math.abs(numeric(d[2])):1;var v=lte;var _=w<y;if(_){S*=-1;v=gte}var k=d.some(isPadded);g=[];for(var x=y;v(x,w);x+=S){var O;if(u){O=String.fromCharCode(x);if(O==="\\")O=""}else{O=String(x);if(k){var E=b-O.length;if(E>0){var A=new Array(E+1).join("0");if(x<0)O="-"+A+O.slice(1);else O=A+O}}}g.push(O)}}else{g=[];for(var C=0;C<d.length;C++){g.push.apply(g,expand(d[C],false))}}for(var C=0;C<g.length;C++){for(var c=0;c<a.length;c++){var l=r+g[C]+a[c];if(!e||f||l)i.push(l)}}}return i}},9132:t=>{t.exports=clone;var e=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:e(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}));return i}},552:(t,e,i)=>{var s=i(7147);var n=i(1290);var r=i(4410);var o=i(9132);var a=i(3837);var c;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){c=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{c="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(t,e){Object.defineProperty(t,c,{get:function(){return e}})}var h=noop;if(a.debuglog)h=a.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h=function(){var t=a.format.apply(a,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!s[c]){var u=global[c]||[];publishQueue(s,u);s.close=function(t){function close(e,i){return t.call(s,e,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,l,{value:t});return close}(s.close);s.closeSync=function(t){function closeSync(e){t.apply(s,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:t});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){h(s[c]);i(9491).equal(s[c].length,0)}))}}if(!global[c]){publishQueue(global,s[c])}t.exports=patch(o(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){t.exports=patch(s);s.__patched=true}function patch(t){n(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var e=t.readFile;t.readFile=readFile;function readFile(t,i,s){if(typeof i==="function")s=i,i=null;return go$readFile(t,i,s);function go$readFile(t,i,s,n){return e(t,i,(function(e){if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readFile,[t,i,s],e,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,e,s,n){if(typeof s==="function")n=s,s=null;return go$writeFile(t,e,s,n);function go$writeFile(t,e,s,n,r){return i(t,e,s,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,e,s,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var s=t.appendFile;if(s)t.appendFile=appendFile;function appendFile(t,e,i,n){if(typeof i==="function")n=i,i=null;return go$appendFile(t,e,i,n);function go$appendFile(t,e,i,n,r){return s(t,e,i,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[t,e,i,n],s,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=t.copyFile;if(o)t.copyFile=copyFile;function copyFile(t,e,i,s){if(typeof i==="function"){s=i;i=0}return go$copyFile(t,e,i,s);function go$copyFile(t,e,i,s,n){return o(t,e,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$copyFile,[t,e,i,s],r,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var a=t.readdir;t.readdir=readdir;var c=/^v[0-5]\./;function readdir(t,e,i){if(typeof e==="function")i=e,e=null;var s=c.test(process.version)?function go$readdir(t,e,i,s){return a(t,fs$readdirCallback(t,e,i,s))}:function go$readdir(t,e,i,s){return a(t,e,fs$readdirCallback(t,e,i,s))};return s(t,e,i);function fs$readdirCallback(t,e,i,n){return function(r,o){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([s,[t,e,i],r,n||Date.now(),Date.now()]);else{if(o&&o.sort)o.sort();if(typeof i==="function")i.call(this,r,o)}}}}if(process.version.substr(0,4)==="v0.8"){var l=r(t);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var h=t.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var u=t.WriteStream;if(u){WriteStream.prototype=Object.create(u.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var f=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return f},set:function(t){f=t},enumerable:true,configurable:true});var p=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return p},set:function(t){p=t},enumerable:true,configurable:true});function ReadStream(t,e){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,i){if(e){if(t.autoClose)t.destroy();t.emit("error",e)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,e){if(this instanceof WriteStream)return u.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,i){if(e){t.destroy();t.emit("error",e)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(e,i){return new t.ReadStream(e,i)}function createWriteStream(e,i){return new t.WriteStream(e,i)}var d=t.open;t.open=open;function open(t,e,i,s){if(typeof i==="function")s=i,i=null;return go$open(t,e,i,s);function go$open(t,e,i,s,n){return d(t,e,i,(function(r,o){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$open,[t,e,i,s],r,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}return t}function enqueue(t){h("ENQUEUE",t[0].name,t[1]);s[c].push(t);retry()}var f;function resetQueue(){var t=Date.now();for(var e=0;e<s[c].length;++e){if(s[c][e].length>2){s[c][e][3]=t;s[c][e][4]=t}}retry()}function retry(){clearTimeout(f);f=undefined;if(s[c].length===0)return;var t=s[c].shift();var e=t[0];var i=t[1];var n=t[2];var r=t[3];var o=t[4];if(r===undefined){h("RETRY",e.name,i);e.apply(null,i)}else if(Date.now()-r>=6e4){h("TIMEOUT",e.name,i);var a=i.pop();if(typeof a==="function")a.call(null,n)}else{var l=Date.now()-o;var u=Math.max(o-r,1);var p=Math.min(u*1.2,100);if(l>=p){h("RETRY",e.name,i);e.apply(null,i.concat([r]))}else{s[c].push(t)}}if(f===undefined){f=setTimeout(retry,0)}}},4410:(t,e,i)=>{var s=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(e,i){if(!(this instanceof ReadStream))return new ReadStream(e,i);s.call(this);var n=this;this.path=e;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var r=Object.keys(i);for(var o=0,a=r.length;o<a;o++){var c=r[o];this[c]=i[c]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,e){if(t){n.emit("error",t);n.readable=false;return}n.fd=e;n.emit("open",e);n._read()}))}function WriteStream(e,i){if(!(this instanceof WriteStream))return new WriteStream(e,i);s.call(this);this.path=e;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var n=Object.keys(i);for(var r=0,o=n.length;r<o;r++){var a=n[r];this[a]=i[a]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(t,e,i)=>{var s=i(2057);var n=process.cwd;var r=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!r)r=n.call(process);return r};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var a=process.chdir;process.chdir=function(t){r=null;a.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,a)}t.exports=patch;function patch(t){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,e,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,e,i,s){if(s)process.nextTick(s)};t.lchownSync=function(){}}if(o==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(e){function rename(i,s,n){var r=Date.now();var o=0;e(i,s,(function CB(a){if(a&&(a.code==="EACCES"||a.code==="EPERM"||a.code==="EBUSY")&&Date.now()-r<6e4){setTimeout((function(){t.stat(s,(function(t,r){if(t&&t.code==="ENOENT")e(i,s,CB);else n(a)}))}),o);if(o<100)o+=10;return}if(n)n(a)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,e);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(e){function read(i,s,n,r,o,a){var c;if(a&&typeof a==="function"){var l=0;c=function(h,u,f){if(h&&h.code==="EAGAIN"&&l<10){l++;return e.call(t,i,s,n,r,o,c)}a.apply(this,arguments)}}return e.call(t,i,s,n,r,o,c)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,e);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(e){return function(i,s,n,r,o){var a=0;while(true){try{return e.call(t,i,s,n,r,o)}catch(t){if(t.code==="EAGAIN"&&a<10){a++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(e,i,n){t.open(e,s.O_WRONLY|s.O_SYMLINK,i,(function(e,s){if(e){if(n)n(e);return}t.fchmod(s,i,(function(e){t.close(s,(function(t){if(n)n(e||t)}))}))}))};t.lchmodSync=function(e,i){var n=t.openSync(e,s.O_WRONLY|s.O_SYMLINK,i);var r=true;var o;try{o=t.fchmodSync(n,i);r=false}finally{if(r){try{t.closeSync(n)}catch(t){}}else{t.closeSync(n)}}return o}}function patchLutimes(t){if(s.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(e,i,n,r){t.open(e,s.O_SYMLINK,(function(e,s){if(e){if(r)r(e);return}t.futimes(s,i,n,(function(e){t.close(s,(function(t){if(r)r(e||t)}))}))}))};t.lutimesSync=function(e,i,n){var r=t.openSync(e,s.O_SYMLINK);var o;var a=true;try{o=t.futimesSync(r,i,n);a=false}finally{if(a){try{t.closeSync(r)}catch(t){}}else{t.closeSync(r)}}return o}}else if(t.futimes){t.lutimes=function(t,e,i,s){if(s)process.nextTick(s)};t.lutimesSync=function(){}}}function chmodFix(e){if(!e)return e;return function(i,s,n){return e.call(t,i,s,(function(t){if(chownErOk(t))t=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(e){if(!e)return e;return function(i,s){try{return e.call(t,i,s)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(e){if(!e)return e;return function(i,s,n,r){return e.call(t,i,s,n,(function(t){if(chownErOk(t))t=null;if(r)r.apply(this,arguments)}))}}function chownFixSync(e){if(!e)return e;return function(i,s,n){try{return e.call(t,i,s,n)}catch(t){if(!chownErOk(t))throw t}}}function statFix(e){if(!e)return e;return function(i,s,n){if(typeof s==="function"){n=s;s=null}function callback(t,e){if(e){if(e.uid<0)e.uid+=4294967296;if(e.gid<0)e.gid+=4294967296}if(n)n.apply(this,arguments)}return s?e.call(t,i,s,callback):e.call(t,i,callback)}}function statFixSync(e){if(!e)return e;return function(i,s){var n=s?e.call(t,i,s):e.call(t,i);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var e=!process.getuid||process.getuid()!==0;if(e){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},1215:(t,e,i)=>{let s;try{s=i(552)}catch(t){s=i(7147)}const n=i(2703);const{stringify:r,stripBom:o}=i(4978);async function _readFile(t,e={}){if(typeof e==="string"){e={encoding:e}}const i=e.fs||s;const r="throws"in e?e.throws:true;let a=await n.fromCallback(i.readFile)(t,e);a=o(a);let c;try{c=JSON.parse(a,e?e.reviver:null)}catch(e){if(r){e.message=`${t}: ${e.message}`;throw e}else{return null}}return c}const a=n.fromPromise(_readFile);function readFileSync(t,e={}){if(typeof e==="string"){e={encoding:e}}const i=e.fs||s;const n="throws"in e?e.throws:true;try{let s=i.readFileSync(t,e);s=o(s);return JSON.parse(s,e.reviver)}catch(e){if(n){e.message=`${t}: ${e.message}`;throw e}else{return null}}}async function _writeFile(t,e,i={}){const o=i.fs||s;const a=r(e,i);await n.fromCallback(o.writeFile)(t,a,i)}const c=n.fromPromise(_writeFile);function writeFileSync(t,e,i={}){const n=i.fs||s;const o=r(e,i);return n.writeFileSync(t,o,i)}const l={readFile:a,readFileSync:readFileSync,writeFile:c,writeFileSync:writeFileSync};t.exports=l},4978:t=>{function stringify(t,{EOL:e="\n",finalEOL:i=true,replacer:s=null,spaces:n}={}){const r=i?e:"";const o=JSON.stringify(t,s,n);return o.replace(/\n/g,e)+r}function stripBom(t){if(Buffer.isBuffer(t))t=t.toString("utf8");return t.replace(/^\uFEFF/,"")}t.exports={stringify:stringify,stripBom:stripBom}},2703:(t,e)=>{e.fromCallback=function(t){return Object.defineProperty((function(...e){if(typeof e[e.length-1]==="function")t.apply(this,e);else{return new Promise(((i,s)=>{t.call(this,...e,((t,e)=>t!=null?s(t):i(e)))}))}}),"name",{value:t.name})};e.fromPromise=function(t){return Object.defineProperty((function(...e){const i=e[e.length-1];if(typeof i!=="function")return t.apply(this,e);else t.apply(this,e.slice(0,-1)).then((t=>i(null,t)),i)}),"name",{value:t.name})}},1085:(t,e,i)=>{const s=i(552);const n=i(1017);const r=i(9181).mkdirsSync;const o=i(8605).utimesMillisSync;const a=i(9783);function copySync(t,e,i){if(typeof i==="function"){i={filter:i}}i=i||{};i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:o,destStat:c}=a.checkPathsSync(t,e,"copy",i);a.checkParentPathsSync(t,o,e,"copy");if(i.filter&&!i.filter(t,e))return;const l=n.dirname(e);if(!s.existsSync(l))r(l);return getStats(c,t,e,i)}function getStats(t,e,i,n){const r=n.dereference?s.statSync:s.lstatSync;const o=r(e);if(o.isDirectory())return onDir(o,t,e,i,n);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,t,e,i,n);else if(o.isSymbolicLink())return onLink(t,e,i,n);else if(o.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);else if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function onFile(t,e,i,s,n){if(!e)return copyFile(t,i,s,n);return mayCopyFile(t,i,s,n)}function mayCopyFile(t,e,i,n){if(n.overwrite){s.unlinkSync(i);return copyFile(t,e,i,n)}else if(n.errorOnExist){throw new Error(`'${i}' already exists`)}}function copyFile(t,e,i,n){s.copyFileSync(e,i);if(n.preserveTimestamps)handleTimestamps(t.mode,e,i);return setDestMode(i,t.mode)}function handleTimestamps(t,e,i){if(fileIsNotWritable(t))makeFileWritable(i,t);return setDestTimestamps(e,i)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return setDestMode(t,e|128)}function setDestMode(t,e){return s.chmodSync(t,e)}function setDestTimestamps(t,e){const i=s.statSync(t);return o(e,i.atime,i.mtime)}function onDir(t,e,i,s,n){if(!e)return mkDirAndCopy(t.mode,i,s,n);return copyDir(i,s,n)}function mkDirAndCopy(t,e,i,n){s.mkdirSync(i);copyDir(e,i,n);return setDestMode(i,t)}function copyDir(t,e,i){s.readdirSync(t).forEach((s=>copyDirItem(s,t,e,i)))}function copyDirItem(t,e,i,s){const r=n.join(e,t);const o=n.join(i,t);if(s.filter&&!s.filter(r,o))return;const{destStat:c}=a.checkPathsSync(r,o,"copy",s);return getStats(c,r,o,s)}function onLink(t,e,i,r){let o=s.readlinkSync(e);if(r.dereference){o=n.resolve(process.cwd(),o)}if(!t){return s.symlinkSync(o,i)}else{let t;try{t=s.readlinkSync(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return s.symlinkSync(o,i);throw t}if(r.dereference){t=n.resolve(process.cwd(),t)}if(a.isSrcSubdir(o,t)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)}if(a.isSrcSubdir(t,o)){throw new Error(`Cannot overwrite '${t}' with '${o}'.`)}return copyLink(o,i)}}function copyLink(t,e){s.unlinkSync(e);return s.symlinkSync(t,e)}t.exports=copySync},4487:(t,e,i)=>{const s=i(893);const n=i(1017);const{mkdirs:r}=i(9181);const{pathExists:o}=i(5516);const{utimesMillis:a}=i(8605);const c=i(9783);async function copy(t,e,i={}){if(typeof i==="function"){i={filter:i}}i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001")}const{srcStat:s,destStat:a}=await c.checkPaths(t,e,"copy",i);await c.checkParentPaths(t,s,e,"copy");const l=await runFilter(t,e,i);if(!l)return;const h=n.dirname(e);const u=await o(h);if(!u){await r(h)}await getStatsAndPerformCopy(a,t,e,i)}async function runFilter(t,e,i){if(!i.filter)return true;return i.filter(t,e)}async function getStatsAndPerformCopy(t,e,i,n){const r=n.dereference?s.stat:s.lstat;const o=await r(e);if(o.isDirectory())return onDir(o,t,e,i,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,t,e,i,n);if(o.isSymbolicLink())return onLink(t,e,i,n);if(o.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}async function onFile(t,e,i,n,r){if(!e)return copyFile(t,i,n,r);if(r.overwrite){await s.unlink(n);return copyFile(t,i,n,r)}if(r.errorOnExist){throw new Error(`'${n}' already exists`)}}async function copyFile(t,e,i,n){await s.copyFile(e,i);if(n.preserveTimestamps){if(fileIsNotWritable(t.mode)){await makeFileWritable(i,t.mode)}const n=await s.stat(e);await a(i,n.atime,n.mtime)}return s.chmod(i,t.mode)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return s.chmod(t,e|128)}async function onDir(t,e,i,r,o){if(!e){await s.mkdir(r)}const a=await s.readdir(i);await Promise.all(a.map((async t=>{const e=n.join(i,t);const s=n.join(r,t);const a=await runFilter(e,s,o);if(!a)return;const{destStat:l}=await c.checkPaths(e,s,"copy",o);return getStatsAndPerformCopy(l,e,s,o)})));if(!e){await s.chmod(r,t.mode)}}async function onLink(t,e,i,r){let o=await s.readlink(e);if(r.dereference){o=n.resolve(process.cwd(),o)}if(!t){return s.symlink(o,i)}let a=null;try{a=await s.readlink(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return s.symlink(o,i);throw t}if(r.dereference){a=n.resolve(process.cwd(),a)}if(c.isSrcSubdir(o,a)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`)}if(c.isSrcSubdir(a,o)){throw new Error(`Cannot overwrite '${a}' with '${o}'.`)}await s.unlink(i);return s.symlink(o,i)}t.exports=copy},8852:(t,e,i)=>{const s=i(2703).fromPromise;t.exports={copy:s(i(4487)),copySync:i(1085)}},2677:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);const r=i(1017);const o=i(9181);const a=i(4879);const c=s((async function emptyDir(t){let e;try{e=await n.readdir(t)}catch{return o.mkdirs(t)}return Promise.all(e.map((e=>a.remove(r.join(t,e)))))}));function emptyDirSync(t){let e;try{e=n.readdirSync(t)}catch{return o.mkdirsSync(t)}e.forEach((e=>{e=r.join(t,e);a.removeSync(e)}))}t.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:c,emptydir:c}},2446:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const o=i(9181);async function createFile(t){let e;try{e=await r.stat(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);let s=null;try{s=await r.stat(i)}catch(e){if(e.code==="ENOENT"){await o.mkdirs(i);await r.writeFile(t,"");return}else{throw e}}if(s.isDirectory()){await r.writeFile(t,"")}else{await r.readdir(i)}}function createFileSync(t){let e;try{e=r.statSync(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);try{if(!r.statSync(i).isDirectory()){r.readdirSync(i)}}catch(t){if(t&&t.code==="ENOENT")o.mkdirsSync(i);else throw t}r.writeFileSync(t,"")}t.exports={createFile:s(createFile),createFileSync:createFileSync}},6004:(t,e,i)=>{const{createFile:s,createFileSync:n}=i(2446);const{createLink:r,createLinkSync:o}=i(9140);const{createSymlink:a,createSymlinkSync:c}=i(3674);t.exports={createFile:s,createFileSync:n,ensureFile:s,ensureFileSync:n,createLink:r,createLinkSync:o,ensureLink:r,ensureLinkSync:o,createSymlink:a,createSymlinkSync:c,ensureSymlink:a,ensureSymlinkSync:c}},9140:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const o=i(9181);const{pathExists:a}=i(5516);const{areIdentical:c}=i(9783);async function createLink(t,e){let i;try{i=await r.lstat(e)}catch{}let s;try{s=await r.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}if(i&&c(s,i))return;const l=n.dirname(e);const h=await a(l);if(!h){await o.mkdirs(l)}await r.link(t,e)}function createLinkSync(t,e){let i;try{i=r.lstatSync(e)}catch{}try{const e=r.lstatSync(t);if(i&&c(e,i))return}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}const s=n.dirname(e);const a=r.existsSync(s);if(a)return r.linkSync(t,e);o.mkdirsSync(s);return r.linkSync(t,e)}t.exports={createLink:s(createLink),createLinkSync:createLinkSync}},6522:(t,e,i)=>{const s=i(1017);const n=i(893);const{pathExists:r}=i(5516);const o=i(2703).fromPromise;async function symlinkPaths(t,e){if(s.isAbsolute(t)){try{await n.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:t}}const i=s.dirname(e);const o=s.join(i,t);const a=await r(o);if(a){return{toCwd:o,toDst:t}}try{await n.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:s.relative(i,t)}}function symlinkPathsSync(t,e){if(s.isAbsolute(t)){const e=n.existsSync(t);if(!e)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}const i=s.dirname(e);const r=s.join(i,t);const o=n.existsSync(r);if(o){return{toCwd:r,toDst:t}}const a=n.existsSync(t);if(!a)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:s.relative(i,t)}}t.exports={symlinkPaths:o(symlinkPaths),symlinkPathsSync:symlinkPathsSync}},9634:(t,e,i)=>{const s=i(893);const n=i(2703).fromPromise;async function symlinkType(t,e){if(e)return e;let i;try{i=await s.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}function symlinkTypeSync(t,e){if(e)return e;let i;try{i=s.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}t.exports={symlinkType:n(symlinkType),symlinkTypeSync:symlinkTypeSync}},3674:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const{mkdirs:o,mkdirsSync:a}=i(9181);const{symlinkPaths:c,symlinkPathsSync:l}=i(6522);const{symlinkType:h,symlinkTypeSync:u}=i(9634);const{pathExists:f}=i(5516);const{areIdentical:p}=i(9783);async function createSymlink(t,e,i){let s;try{s=await r.lstat(e)}catch{}if(s&&s.isSymbolicLink()){const[i,s]=await Promise.all([r.stat(t),r.stat(e)]);if(p(i,s))return}const a=await c(t,e);t=a.toDst;const l=await h(a.toCwd,i);const u=n.dirname(e);if(!await f(u)){await o(u)}return r.symlink(t,e,l)}function createSymlinkSync(t,e,i){let s;try{s=r.lstatSync(e)}catch{}if(s&&s.isSymbolicLink()){const i=r.statSync(t);const s=r.statSync(e);if(p(i,s))return}const o=l(t,e);t=o.toDst;i=u(o.toCwd,i);const c=n.dirname(e);const h=r.existsSync(c);if(h)return r.symlinkSync(t,e,i);a(c);return r.symlinkSync(t,e,i)}t.exports={createSymlink:s(createSymlink),createSymlinkSync:createSymlinkSync}},893:(t,e,i)=>{const s=i(2703).fromCallback;const n=i(552);const r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((t=>typeof n[t]==="function"));Object.assign(e,n);r.forEach((t=>{e[t]=s(n[t])}));e.exists=function(t,e){if(typeof e==="function"){return n.exists(t,e)}return new Promise((e=>n.exists(t,e)))};e.read=function(t,e,i,s,r,o){if(typeof o==="function"){return n.read(t,e,i,s,r,o)}return new Promise(((o,a)=>{n.read(t,e,i,s,r,((t,e,i)=>{if(t)return a(t);o({bytesRead:e,buffer:i})}))}))};e.write=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.write(t,e,...i)}return new Promise(((s,r)=>{n.write(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesWritten:e,buffer:i})}))}))};e.readv=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.readv(t,e,...i)}return new Promise(((s,r)=>{n.readv(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesRead:e,buffers:i})}))}))};e.writev=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.writev(t,e,...i)}return new Promise(((s,r)=>{n.writev(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesWritten:e,buffers:i})}))}))};if(typeof n.realpath.native==="function"){e.realpath.native=s(n.realpath.native)}else{process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}},5392:(t,e,i)=>{t.exports={...i(893),...i(8852),...i(2677),...i(6004),...i(3960),...i(9181),...i(7819),...i(2546),...i(5516),...i(4879)}},3960:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(2855);n.outputJson=s(i(7583));n.outputJsonSync=i(3719);n.outputJSON=n.outputJson;n.outputJSONSync=n.outputJsonSync;n.writeJSON=n.writeJson;n.writeJSONSync=n.writeJsonSync;n.readJSON=n.readJson;n.readJSONSync=n.readJsonSync;t.exports=n},2855:(t,e,i)=>{const s=i(1215);t.exports={readJson:s.readFile,readJsonSync:s.readFileSync,writeJson:s.writeFile,writeJsonSync:s.writeFileSync}},3719:(t,e,i)=>{const{stringify:s}=i(4978);const{outputFileSync:n}=i(2546);function outputJsonSync(t,e,i){const r=s(e,i);n(t,r,i)}t.exports=outputJsonSync},7583:(t,e,i)=>{const{stringify:s}=i(4978);const{outputFile:n}=i(2546);async function outputJson(t,e,i={}){const r=s(e,i);await n(t,r,i)}t.exports=outputJson},9181:(t,e,i)=>{const s=i(2703).fromPromise;const{makeDir:n,makeDirSync:r}=i(511);const o=s(n);t.exports={mkdirs:o,mkdirsSync:r,mkdirp:o,mkdirpSync:r,ensureDir:o,ensureDirSync:r}},511:(t,e,i)=>{const s=i(893);const{checkPath:n}=i(1176);const getMode=t=>{const e={mode:511};if(typeof t==="number")return t;return{...e,...t}.mode};t.exports.makeDir=async(t,e)=>{n(t);return s.mkdir(t,{mode:getMode(e),recursive:true})};t.exports.makeDirSync=(t,e)=>{n(t);return s.mkdirSync(t,{mode:getMode(e),recursive:true})}},1176:(t,e,i)=>{const s=i(1017);t.exports.checkPath=function checkPath(t){if(process.platform==="win32"){const e=/[<>:"|?*]/.test(t.replace(s.parse(t).root,""));if(e){const e=new Error(`Path contains invalid characters: ${t}`);e.code="EINVAL";throw e}}}},7819:(t,e,i)=>{const s=i(2703).fromPromise;t.exports={move:s(i(4064)),moveSync:i(9079)}},9079:(t,e,i)=>{const s=i(552);const n=i(1017);const r=i(8852).copySync;const o=i(4879).removeSync;const a=i(9181).mkdirpSync;const c=i(9783);function moveSync(t,e,i){i=i||{};const s=i.overwrite||i.clobber||false;const{srcStat:r,isChangingCase:o=false}=c.checkPathsSync(t,e,"move",i);c.checkParentPathsSync(t,r,e,"move");if(!isParentRoot(e))a(n.dirname(e));return doRename(t,e,s,o)}function isParentRoot(t){const e=n.dirname(t);const i=n.parse(e);return i.root===e}function doRename(t,e,i,n){if(n)return rename(t,e,i);if(i){o(e);return rename(t,e,i)}if(s.existsSync(e))throw new Error("dest already exists.");return rename(t,e,i)}function rename(t,e,i){try{s.renameSync(t,e)}catch(s){if(s.code!=="EXDEV")throw s;return moveAcrossDevice(t,e,i)}}function moveAcrossDevice(t,e,i){const s={overwrite:i,errorOnExist:true,preserveTimestamps:true};r(t,e,s);return o(t)}t.exports=moveSync},4064:(t,e,i)=>{const s=i(893);const n=i(1017);const{copy:r}=i(8852);const{remove:o}=i(4879);const{mkdirp:a}=i(9181);const{pathExists:c}=i(5516);const l=i(9783);async function move(t,e,i={}){const s=i.overwrite||i.clobber||false;const{srcStat:r,isChangingCase:o=false}=await l.checkPaths(t,e,"move",i);await l.checkParentPaths(t,r,e,"move");const c=n.dirname(e);const h=n.parse(c);if(h.root!==c){await a(c)}return doRename(t,e,s,o)}async function doRename(t,e,i,n){if(!n){if(i){await o(e)}else if(await c(e)){throw new Error("dest already exists.")}}try{await s.rename(t,e)}catch(s){if(s.code!=="EXDEV"){throw s}await moveAcrossDevice(t,e,i)}}async function moveAcrossDevice(t,e,i){const s={overwrite:i,errorOnExist:true,preserveTimestamps:true};await r(t,e,s);return o(t)}t.exports=move},2546:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);const r=i(1017);const o=i(9181);const a=i(5516).pathExists;async function outputFile(t,e,i="utf-8"){const s=r.dirname(t);if(!await a(s)){await o.mkdirs(s)}return n.writeFile(t,e,i)}function outputFileSync(t,...e){const i=r.dirname(t);if(!n.existsSync(i)){o.mkdirsSync(i)}n.writeFileSync(t,...e)}t.exports={outputFile:s(outputFile),outputFileSync:outputFileSync}},5516:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);function pathExists(t){return n.access(t).then((()=>true)).catch((()=>false))}t.exports={pathExists:s(pathExists),pathExistsSync:n.existsSync}},4879:(t,e,i)=>{const s=i(552);const n=i(2703).fromCallback;function remove(t,e){s.rm(t,{recursive:true,force:true},e)}function removeSync(t){s.rmSync(t,{recursive:true,force:true})}t.exports={remove:n(remove),removeSync:removeSync}},9783:(t,e,i)=>{const s=i(893);const n=i(1017);const r=i(2703).fromPromise;function getStats(t,e,i){const n=i.dereference?t=>s.stat(t,{bigint:true}):t=>s.lstat(t,{bigint:true});return Promise.all([n(t),n(e).catch((t=>{if(t.code==="ENOENT")return null;throw t}))]).then((([t,e])=>({srcStat:t,destStat:e})))}function getStatsSync(t,e,i){let n;const r=i.dereference?t=>s.statSync(t,{bigint:true}):t=>s.lstatSync(t,{bigint:true});const o=r(t);try{n=r(e)}catch(t){if(t.code==="ENOENT")return{srcStat:o,destStat:null};throw t}return{srcStat:o,destStat:n}}async function checkPaths(t,e,i,s){const{srcStat:r,destStat:o}=await getStats(t,e,s);if(o){if(areIdentical(r,o)){const s=n.basename(t);const a=n.basename(e);if(i==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase()){return{srcStat:r,destStat:o,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&!o.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!r.isDirectory()&&o.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(r.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,i))}return{srcStat:r,destStat:o}}function checkPathsSync(t,e,i,s){const{srcStat:r,destStat:o}=getStatsSync(t,e,s);if(o){if(areIdentical(r,o)){const s=n.basename(t);const a=n.basename(e);if(i==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase()){return{srcStat:r,destStat:o,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&!o.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!r.isDirectory()&&o.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(r.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,i))}return{srcStat:r,destStat:o}}async function checkParentPaths(t,e,i,r){const o=n.resolve(n.dirname(t));const a=n.resolve(n.dirname(i));if(a===o||a===n.parse(a).root)return;let c;try{c=await s.stat(a,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,c)){throw new Error(errMsg(t,i,r))}return checkParentPaths(t,e,a,r)}function checkParentPathsSync(t,e,i,r){const o=n.resolve(n.dirname(t));const a=n.resolve(n.dirname(i));if(a===o||a===n.parse(a).root)return;let c;try{c=s.statSync(a,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,c)){throw new Error(errMsg(t,i,r))}return checkParentPathsSync(t,e,a,r)}function areIdentical(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function isSrcSubdir(t,e){const i=n.resolve(t).split(n.sep).filter((t=>t));const s=n.resolve(e).split(n.sep).filter((t=>t));return i.every(((t,e)=>s[e]===t))}function errMsg(t,e,i){return`Cannot ${i} '${t}' to a subdirectory of itself, '${e}'.`}t.exports={checkPaths:r(checkPaths),checkPathsSync:checkPathsSync,checkParentPaths:r(checkParentPaths),checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir,areIdentical:areIdentical}},8605:(t,e,i)=>{const s=i(893);const n=i(2703).fromPromise;async function utimesMillis(t,e,i){const n=await s.open(t,"r+");let r=null;try{await s.futimes(n,e,i)}finally{try{await s.close(n)}catch(t){r=t}}if(r){throw r}}function utimesMillisSync(t,e,i){const n=s.openSync(t,"r+");s.futimesSync(n,e,i);return s.closeSync(n)}t.exports={utimesMillis:n(utimesMillis),utimesMillisSync:utimesMillisSync}},9491:e=>{e.exports=t(import.meta.url)("assert")},2057:e=>{e.exports=t(import.meta.url)("constants")},7147:e=>{e.exports=t(import.meta.url)("fs")},7718:e=>{e.exports=t(import.meta.url)("node:child_process")},5673:e=>{e.exports=t(import.meta.url)("node:events")},7561:e=>{e.exports=t(import.meta.url)("node:fs")},9411:e=>{e.exports=t(import.meta.url)("node:path")},7742:e=>{e.exports=t(import.meta.url)("node:process")},1017:e=>{e.exports=t(import.meta.url)("path")},2781:e=>{e.exports=t(import.meta.url)("stream")},3837:e=>{e.exports=t(import.meta.url)("util")},1776:(t,e,i)=>{const{Argument:s}=i(5e3);const{Command:n}=i(8966);const{CommanderError:r,InvalidArgumentError:o}=i(2315);const{Help:a}=i(9320);const{Option:c}=i(4790);e.program=new n;e.createCommand=t=>new n(t);e.createOption=(t,e)=>new c(t,e);e.createArgument=(t,e)=>new s(t,e);e.Command=n;e.Option=c;e.Argument=s;e.Help=a;e.CommanderError=r;e.InvalidArgumentError=o;e.InvalidOptionArgumentError=o},5e3:(t,e,i)=>{const{InvalidArgumentError:s}=i(2315);class Argument{constructor(t,e){this.description=e||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}e.Argument=Argument;e.humanReadableArgName=humanReadableArgName},8966:(t,e,i)=>{const s=i(5673).EventEmitter;const n=i(7718);const r=i(9411);const o=i(7561);const a=i(7742);const{Argument:c,humanReadableArgName:l}=i(5e3);const{CommanderError:h}=i(2315);const{Help:u}=i(9320);const{Option:f,DualOptions:p}=i(4790);const{suggestSimilar:d}=i(1492);class Command extends s{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>a.stdout.write(t),writeErr:t=>a.stderr.write(t),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:undefined,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:undefined,outputError:(t,e)=>e(t)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._helpOption=t._helpOption;this._helpCommand=t._helpCommand;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}_getCommandAndAncestors(){const t=[];for(let e=this;e;e=e.parent){t.push(e)}return t}command(t,e,i){let s=e;let n=i;if(typeof s==="object"&&s!==null){n=s;s=null}n=n||{};const[,r,o]=t.match(/([^ ]+) *(.*)/);const a=this.createCommand(r);if(s){a.description(s);a._executableHandler=true}if(n.isDefault)this._defaultCommandName=a._name;a._hidden=!!(n.noHelp||n.hidden);a._executableFile=n.executableFile||null;if(o)a.arguments(o);this._registerCommand(a);a.parent=this;a.copyInheritedSettings(this);if(s)return this;return a}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,e){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}e=e||{};if(e.isDefault)this._defaultCommandName=t._name;if(e.noHelp||e.hidden)t._hidden=true;this._registerCommand(t);t.parent=this;t._checkForBrokenPassThrough();return this}createArgument(t,e){return new c(t,e)}argument(t,e,i,s){const n=this.createArgument(t,e);if(typeof i==="function"){n.default(s).argParser(i)}else{n.default(i)}this.addArgument(n);return this}arguments(t){t.trim().split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const e=this.registeredArguments.slice(-1)[0];if(e&&e.variadic){throw new Error(`only the last argument can be variadic '${e.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this.registeredArguments.push(t);return this}helpCommand(t,e){if(typeof t==="boolean"){this._addImplicitHelpCommand=t;return this}t=t??"help [command]";const[,i,s]=t.match(/([^ ]+) *(.*)/);const n=e??"display help for command";const r=this.createCommand(i);r.helpOption(false);if(s)r.arguments(s);if(n)r.description(n);this._addImplicitHelpCommand=true;this._helpCommand=r;return this}addHelpCommand(t,e){if(typeof t!=="object"){this.helpCommand(t,e);return this}this._addImplicitHelpCommand=true;this._helpCommand=t;return this}_getHelpCommand(){const t=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(t){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(t,e){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(e)}else{this._lifeCycleHooks[t]=[e]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,e,i){if(this._exitCallback){this._exitCallback(new h(t,e,i))}a.exit(t)}action(t){const listener=e=>{const i=this.registeredArguments.length;const s=e.slice(0,i);if(this._storeOptionsAsProperties){s[i]=this}else{s[i]=this.opts()}s.push(this);return t.apply(this,s)};this._actionHandler=listener;return this}createOption(t,e){return new f(t,e)}_callParseArg(t,e,i,s){try{return t.parseArg(e,i)}catch(t){if(t.code==="commander.invalidArgument"){const e=`${s} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){const i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'\n- already used by option '${e.flags}'`)}this.options.push(t)}_registerCommand(t){const knownBy=t=>[t.name()].concat(t.aliases());const e=knownBy(t).find((t=>this._findCommand(t)));if(e){const i=knownBy(this._findCommand(e)).join("|");const s=knownBy(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);const e=t.name();const i=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");if(!this._findOption(e)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}const handleOptionValue=(e,s,n)=>{if(e==null&&t.presetArg!==undefined){e=t.presetArg}const r=this.getOptionValue(i);if(e!==null&&t.parseArg){e=this._callParseArg(t,e,r,s)}else if(e!==null&&t.variadic){e=t._concatValue(e,r)}if(e==null){if(t.negate){e=false}else if(t.isBoolean()||t.optional){e=true}else{e=""}}this.setOptionValueWithSource(i,e,n)};this.on("option:"+e,(e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;handleOptionValue(e,i,"cli")}));if(t.envVar){this.on("optionEnv:"+e,(e=>{const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;handleOptionValue(e,i,"env")}))}return this}_optionEx(t,e,i,s,n){if(typeof e==="object"&&e instanceof f){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const r=this.createOption(e,i);r.makeOptionMandatory(!!t.mandatory);if(typeof s==="function"){r.default(n).argParser(s)}else if(s instanceof RegExp){const t=s;s=(e,i)=>{const s=t.exec(e);return s?s[0]:i};r.default(n).argParser(s)}else{r.default(s)}return this.addOption(r)}option(t,e,i,s){return this._optionEx({},t,e,i,s)}requiredOption(t,e,i,s){return this._optionEx({mandatory:true},t,e,i,s)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(t=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!t;return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,undefined)}setOptionValueWithSource(t,e,i){if(this._storeOptionsAsProperties){this[t]=e}else{this._optionValues[t]=e}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;this._getCommandAndAncestors().forEach((i=>{if(i.getOptionValueSource(t)!==undefined){e=i.getOptionValueSource(t)}}));return e}_prepareUserArgs(t,e){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}e=e||{};if(t===undefined&&e.from===undefined){if(a.versions?.electron){e.from="electron"}const t=a.execArgv??[];if(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print")){e.from="eval"}}if(t===undefined){t=a.argv}this.rawArgs=t.slice();let i;switch(e.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(a.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,e){const i=this._prepareUserArgs(t,e);this._parseCommand([],i);return this}async parseAsync(t,e){const i=this._prepareUserArgs(t,e);await this._parseCommand([],i);return this}_executeSubCommand(t,e){e=e.slice();let i=false;const s=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,e){const i=r.resolve(t,e);if(o.existsSync(i))return i;if(s.includes(r.extname(e)))return undefined;const n=s.find((t=>o.existsSync(`${i}${t}`)));if(n)return`${i}${n}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let c=t._executableFile||`${this._name}-${t._name}`;let l=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}l=r.resolve(r.dirname(t),l)}if(l){let e=findFile(l,c);if(!e&&!t._executableFile&&this._scriptPath){const i=r.basename(this._scriptPath,r.extname(this._scriptPath));if(i!==this._name){e=findFile(l,`${i}-${t._name}`)}}c=e||c}i=s.includes(r.extname(c));let u;if(a.platform!=="win32"){if(i){e.unshift(c);e=incrementNodeInspectorPort(a.execArgv).concat(e);u=n.spawn(a.argv[0],e,{stdio:"inherit"})}else{u=n.spawn(c,e,{stdio:"inherit"})}}else{e.unshift(c);e=incrementNodeInspectorPort(a.execArgv).concat(e);u=n.spawn(a.execPath,e,{stdio:"inherit"})}if(!u.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{a.on(t,(()=>{if(u.killed===false&&u.exitCode===null){u.kill(t)}}))}))}const f=this._exitCallback;u.on("close",(t=>{t=t??1;if(!f){a.exit(t)}else{f(new h(t,"commander.executeSubCommandAsync","(close)"))}}));u.on("error",(e=>{if(e.code==="ENOENT"){const e=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${c}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;throw new Error(i)}else if(e.code==="EACCES"){throw new Error(`'${c}' not executable`)}if(!f){a.exit(1)}else{const t=new h(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e;f(t)}}));this.runningCommand=u}_dispatchSubcommand(t,e,i){const s=this._findCommand(t);if(!s)this.help({error:true});let n;n=this._chainOrCallSubCommandHook(n,s,"preSubcommand");n=this._chainOrCall(n,(()=>{if(s._executableHandler){this._executeSubCommand(s,e.concat(i))}else{return s._parseCommand(e,i)}}));return n}_dispatchHelpCommand(t){if(!t){this.help()}const e=this._findCommand(t);if(e&&!e._executableHandler){e.help()}return this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,e)=>{if(t.required&&this.args[e]==null){this.missingArgument(t.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,e,i)=>{let s=e;if(e!==null&&t.parseArg){const n=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;s=this._callParseArg(t,e,i,n)}return s};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((e,i)=>{let s=e.defaultValue;if(e.variadic){if(i<this.args.length){s=this.args.slice(i);if(e.parseArg){s=s.reduce(((t,i)=>myParseArg(e,i,t)),e.defaultValue)}}else if(s===undefined){s=[]}}else if(i<this.args.length){s=this.args[i];if(e.parseArg){s=myParseArg(e,s,e.defaultValue)}}t[i]=s}));this.processedArgs=t}_chainOrCall(t,e){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>e()))}return e()}_chainOrCallHooks(t,e){let i=t;const s=[];this._getCommandAndAncestors().reverse().filter((t=>t._lifeCycleHooks[e]!==undefined)).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{s.push({hookedCommand:t,callback:e})}))}));if(e==="postAction"){s.reverse()}s.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_chainOrCallSubCommandHook(t,e,i){let s=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{s=this._chainOrCall(s,(()=>t(this,e)))}))}return s}_parseCommand(t,e){const i=this.parseOptions(e);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(i.operands);e=i.unknown;this.args=t.concat(e);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),e)}if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(t[1])}if(this._defaultCommandName){this._outputHelpIfRequested(e);return this._dispatchSubcommand(this._defaultCommandName,t,e)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const s=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(s,t,e)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(s)){checkForUnknownOptions();this._processArguments();this.parent.emit(s,t,e)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,e)}if(this.listenerCount("command:*")){this.emit("command:*",t,e)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((t=>{t.options.forEach((e=>{if(e.mandatory&&t.getOptionValue(e.attributeName())===undefined){t.missingMandatoryOptionValue(e)}}))}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();if(this.getOptionValue(e)===undefined){return false}return this.getOptionValueSource(e)!=="default"}));const e=t.filter((t=>t.conflictsWith.length>0));e.forEach((e=>{const i=t.find((t=>e.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(e,i)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((t=>{t._checkForConflictingLocalOptions()}))}parseOptions(t){const e=[];const i=[];let s=e;const n=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let r=null;while(n.length){const t=n.shift();if(t==="--"){if(s===i)s.push(t);s.push(...n);break}if(r&&!maybeOption(t)){this.emit(`option:${r.name()}`,t);continue}r=null;if(maybeOption(t)){const e=this._findOption(t);if(e){if(e.required){const t=n.shift();if(t===undefined)this.optionMissingArgument(e);this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;if(n.length>0&&!maybeOption(n[0])){t=n.shift()}this.emit(`option:${e.name()}`,t)}else{this.emit(`option:${e.name()}`)}r=e.variadic?e:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const e=this._findOption(`-${t[1]}`);if(e){if(e.required||e.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${e.name()}`,t.slice(2))}else{this.emit(`option:${e.name()}`);n.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("=");const i=this._findOption(t.slice(0,e));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(e+1));continue}}if(maybeOption(t)){s=i}if((this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(t)){e.push(t);if(n.length>0)i.push(...n);break}else if(this._getHelpCommand()&&t===this._getHelpCommand().name()){e.push(t);if(n.length>0)e.push(...n);break}else if(this._defaultCommandName){i.push(t);if(n.length>0)i.push(...n);break}}if(this._passThroughOptions){s.push(t);if(n.length>0)s.push(...n);break}s.push(t)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const e=this.options.length;for(let i=0;i<e;i++){const e=this.options[i].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=e||{};const s=i.exitCode||1;const n=i.code||"commander.error";this._exit(s,n,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in a.env){const e=t.attributeName();if(this.getOptionValue(e)===undefined||["default","config","env"].includes(this.getOptionValueSource(e))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,a.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new p(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((e=>e.implied!==undefined&&hasCustomOptionValue(e.attributeName())&&t.valueFromOption(this.getOptionValue(e.attributeName()),e))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const findBestOptionFromValue=t=>{const e=t.attributeName();const i=this.getOptionValue(e);const s=this.options.find((t=>t.negate&&e===t.attributeName()));const n=this.options.find((t=>!t.negate&&e===t.attributeName()));if(s&&(s.presetArg===undefined&&i===false||s.presetArg!==undefined&&i===s.presetArg)){return s}return n||t};const getErrorMessage=t=>{const e=findBestOptionFromValue(t);const i=e.attributeName();const s=this.getOptionValueSource(i);if(s==="env"){return`environment variable '${e.envVar}'`}return`option '${e.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(e)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let s=this;do{const t=s.createHelp().visibleOptions(s).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);s=s.parent}while(s&&!s._enablePositionalOptions);e=d(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this.registeredArguments.length;const i=e===1?"":"s";const s=this.parent?` for '${this.name()}'`:"";const n=`error: too many arguments${s}. Expected ${e} argument${i} but got ${t.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));e=d(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===undefined)return this._version;this._version=t;e=e||"-V, --version";i=i||"output the version number";const s=this.createOption(e,i);this._versionOptionName=s.attributeName();this._registerOption(s);this.on("option:"+s.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,e){if(t===undefined&&e===undefined)return this._description;this._description=t;if(e){this._argsDescription=e}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){e=this.commands[this.commands.length-1]}if(t===e._name)throw new Error("Command alias can't be the same as its name");const i=this.parent?._findCommand(t);if(i){const e=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${e}'`)}e._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this.registeredArguments.map((t=>l(t)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=r.basename(t,r.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const e=this.createHelp();if(e.helpWidth===undefined){e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return e.formatHelp(this,e)}_getHelpContext(t){t=t||{};const e={error:!!t.error};let i;if(e.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}e.write=t.write||i;e.command=this;return e}outputHelp(t){let e;if(typeof t==="function"){e=t;t=undefined}const i=this._getHelpContext(t);this._getCommandAndAncestors().reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let s=this.helpInformation(i);if(e){s=e(s);if(typeof s!=="string"&&!Buffer.isBuffer(s)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(s);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",i);this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,e){if(typeof t==="boolean"){if(t){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}t=t??"-h, --help";e=e??"display help for command";this._helpOption=this.createOption(t,e);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(t){this._helpOption=t;return this}help(t){this.outputHelp(t);let e=a.exitCode||0;if(e===0&&t&&typeof t!=="function"&&t.error){e=1}this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const s=`${t}Help`;this.on(s,(t=>{let i;if(typeof e==="function"){i=e({error:t.error,command:t.command})}else{i=e}if(i){t.write(`${i}\n`)}}));return this}_outputHelpIfRequested(t){const e=this._getHelpOption();const i=e&&t.find((t=>e.is(t)));if(i){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let e;let i="127.0.0.1";let s="9229";let n;if((n=t.match(/^(--inspect(-brk)?)$/))!==null){e=n[1]}else if((n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){e=n[1];if(/^\d+$/.test(n[3])){s=n[3]}else{i=n[3]}}else if((n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){e=n[1];i=n[3];s=n[4]}if(e&&s!=="0"){return`${e}=${i}:${parseInt(s)+1}`}return t}))}e.Command=Command},2315:(t,e)=>{class CommanderError extends Error{constructor(t,e,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=e;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}e.CommanderError=CommanderError;e.InvalidArgumentError=InvalidArgumentError},9320:(t,e,i)=>{const{humanReadableArgName:s}=i(5e3);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));const i=t._getHelpCommand();if(i&&!i._hidden){e.push(i)}if(this.sortSubcommands){e.sort(((t,e)=>t.name().localeCompare(e.name())))}return e}compareOptions(t,e){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(e))}visibleOptions(t){const e=t.options.filter((t=>!t.hidden));const i=t._getHelpOption();if(i&&!i.hidden){const s=i.short&&t._findOption(i.short);const n=i.long&&t._findOption(i.long);if(!s&&!n){e.push(i)}else if(i.long&&!n){e.push(t.createOption(i.long,i.description))}else if(i.short&&!s){e.push(t.createOption(i.short,i.description))}}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const e=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter((t=>!t.hidden));e.push(...t)}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleArguments(t){if(t._argsDescription){t.registeredArguments.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""}))}if(t.registeredArguments.find((t=>t.description))){return t.registeredArguments}return[]}subcommandTerm(t){const e=t.registeredArguments.map((t=>s(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,i)=>Math.max(t,e.subcommandTerm(i).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,i)=>Math.max(t,e.argumentTerm(i).length)),0)}commandUsage(t){let e=t._name;if(t._aliases[0]){e=e+"|"+t._aliases[0]}let i="";for(let e=t.parent;e;e=e.parent){i=e.name()+" "+i}return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){e.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){e.push(`env: ${t.envVar}`)}if(e.length>0){return`${t.description} (${e.join(", ")})`}return t.description}argumentDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(e.length>0){const i=`(${e.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,e){const i=e.padWidth(t,e);const s=e.helpWidth||80;const n=2;const r=2;function formatItem(t,o){if(o){const a=`${t.padEnd(i+r)}${o}`;return e.wrap(a,s-n,i+r)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(n))}let o=[`Usage: ${e.commandUsage(t)}`,""];const a=e.commandDescription(t);if(a.length>0){o=o.concat([e.wrap(a,s,0),""])}const c=e.visibleArguments(t).map((t=>formatItem(e.argumentTerm(t),e.argumentDescription(t))));if(c.length>0){o=o.concat(["Arguments:",formatList(c),""])}const l=e.visibleOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(l.length>0){o=o.concat(["Options:",formatList(l),""])}if(this.showGlobalOptions){const i=e.visibleGlobalOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(i.length>0){o=o.concat(["Global Options:",formatList(i),""])}}const h=e.visibleCommands(t).map((t=>formatItem(e.subcommandTerm(t),e.subcommandDescription(t))));if(h.length>0){o=o.concat(["Commands:",formatList(h),""])}return o.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,i,s=40){const n=" \\f\\t\\v - \ufeff";const r=new RegExp(`[\\n][${n}]+`);if(t.match(r))return t;const o=e-i;if(o<s)return t;const a=t.slice(0,i);const c=t.slice(i).replace("\r\n","\n");const l=" ".repeat(i);const h="";const u=`\\s${h}`;const f=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");const p=c.match(f)||[];return a+p.map(((t,e)=>{if(t==="\n")return"";return(e>0?l:"")+t.trimEnd()})).join("\n")}}e.Help=Help},4790:(t,e,i)=>{const{InvalidArgumentError:s}=i(2315);class Option{constructor(t,e){this.flags=t;this.description=e||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){let e=t;if(typeof t==="string"){e={[t]:true}}this.implied=Object.assign(this.implied||{},e);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,e)=>{if(this.positiveOptions.has(e)){this.dualOptions.add(e)}}))}valueFromOption(t,e){const i=e.attributeName();if(!this.dualOptions.has(i))return true;const s=this.negativeOptions.get(i).presetArg;const n=s!==undefined?s:false;return e.negate===(n===t)}}function camelcase(t){return t.split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}function splitOptionFlags(t){let e;let i;const s=t.split(/[ |,]+/);if(s.length>1&&!/^[[<]/.test(s[1]))e=s.shift();i=s.shift();if(!e&&/^-[^-]$/.test(i)){e=i;i=undefined}return{shortFlag:e,longFlag:i}}e.Option=Option;e.DualOptions=DualOptions},1492:(t,e)=>{const i=3;function editDistance(t,e){if(Math.abs(t.length-e.length)>i)return Math.max(t.length,e.length);const s=[];for(let e=0;e<=t.length;e++){s[e]=[e]}for(let t=0;t<=e.length;t++){s[0][t]=t}for(let i=1;i<=e.length;i++){for(let n=1;n<=t.length;n++){let r=1;if(t[n-1]===e[i-1]){r=0}else{r=1}s[n][i]=Math.min(s[n-1][i]+1,s[n][i-1]+1,s[n-1][i-1]+r);if(n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]){s[n][i]=Math.min(s[n][i],s[n-2][i-2]+1)}}}return s[t.length][e.length]}function suggestSimilar(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));const s=t.startsWith("--");if(s){t=t.slice(2);e=e.map((t=>t.slice(2)))}let n=[];let r=i;const o=.4;e.forEach((e=>{if(e.length<=1)return;const i=editDistance(t,e);const s=Math.max(t.length,e.length);const a=(s-i)/s;if(a>o){if(i<r){r=i;n=[e]}else if(i===r){n.push(e)}}}));n.sort(((t,e)=>t.localeCompare(e)));if(s){n=n.map((t=>`--${t}`))}if(n.length>1){return`\n(Did you mean one of ${n.join(", ")}?)`}if(n.length===1){return`\n(Did you mean ${n[0]}?)`}return""}e.suggestSimilar=suggestSimilar}};var i={};function __nccwpck_require__(t){var s=i[t];if(s!==undefined){return s.exports}var n=i[t]={exports:{}};var r=true;try{e[t](n,n.exports,__nccwpck_require__);r=false}finally{if(r)delete i[t]}return n.exports}(()=>{__nccwpck_require__.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(e,{a:e});return e}})();(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var e;__nccwpck_require__.t=function(i,s){if(s&1)i=this(i);if(s&8)return i;if(typeof i==="object"&&i){if(s&4&&i.__esModule)return i;if(s&16&&typeof i.then==="function")return i}var n=Object.create(null);__nccwpck_require__.r(n);var r={};e=e||[null,t({}),t([]),t(t)];for(var o=s&2&&i;typeof o=="object"&&!~e.indexOf(o);o=t(o)){Object.getOwnPropertyNames(o).forEach((t=>r[t]=()=>i[t]))}r["default"]=()=>i;__nccwpck_require__.d(n,r);return n}})();(()=>{__nccwpck_require__.d=(t,e)=>{for(var i in e){if(__nccwpck_require__.o(e,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:e[i]})}}}})();(()=>{__nccwpck_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var s={};(()=>{const e=t(import.meta.url)("node:url");globalThis.__filename=(0,e.fileURLToPath)(import.meta.url);const i=10;const wrapAnsi16=(t=0)=>e=>`[${e+t}m`;const wrapAnsi256=(t=0)=>e=>`[${38+t};5;${e}m`;const wrapAnsi16m=(t=0)=>(e,i,s)=>`[${38+t};2;${e};${i};${s}m`;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const n=Object.keys(s.modifier);const r=Object.keys(s.color);const o=Object.keys(s.bgColor);const a=[...r,...o];function assembleStyles(){const t=new Map;for(const[e,i]of Object.entries(s)){for(const[e,n]of Object.entries(i)){s[e]={open:`[${n[0]}m`,close:`[${n[1]}m`};i[e]=s[e];t.set(n[0],n[1])}Object.defineProperty(s,e,{value:i,enumerable:false})}Object.defineProperty(s,"codes",{value:t,enumerable:false});s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi=wrapAnsi16();s.color.ansi256=wrapAnsi256();s.color.ansi16m=wrapAnsi16m();s.bgColor.ansi=wrapAnsi16(i);s.bgColor.ansi256=wrapAnsi256(i);s.bgColor.ansi16m=wrapAnsi16m(i);Object.defineProperties(s,{rgbToAnsi256:{value(t,e,i){if(t===e&&e===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e){return[0,0,0]}let[i]=e;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:false},hexToAnsi256:{value:t=>s.rgbToAnsi256(...s.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value(t){if(t<8){return 30+t}if(t<16){return 90+(t-8)}let e;let i;let s;if(t>=232){e=((t-232)*10+8)/255;i=e;s=e}else{t-=16;const n=t%36;e=Math.floor(t/36)/5;i=Math.floor(n/6)/5;s=n%6/5}const n=Math.max(e,i,s)*2;if(n===0){return 30}let r=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(e));if(n===2){r+=60}return r},enumerable:false},rgbToAnsi:{value:(t,e,i)=>s.ansi256ToAnsi(s.rgbToAnsi256(t,e,i)),enumerable:false},hexToAnsi:{value:t=>s.ansi256ToAnsi(s.hexToAnsi256(t)),enumerable:false}});return s}const c=assembleStyles();const l=c;var h=__nccwpck_require__(7742);const u=t(import.meta.url)("node:os");const f=t(import.meta.url)("node:tty");function hasFlag(t,e=(globalThis.Deno?globalThis.Deno.args:h.argv)){const i=t.startsWith("-")?"":t.length===1?"-":"--";const s=e.indexOf(i+t);const n=e.indexOf("--");return s!==-1&&(n===-1||s<n)}const{env:p}=h;let d;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){d=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){d=1}function envForceColor(){if("FORCE_COLOR"in p){if(p.FORCE_COLOR==="true"){return 1}if(p.FORCE_COLOR==="false"){return 0}return p.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(p.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:e,sniffFlags:i=true}={}){const s=envForceColor();if(s!==undefined){d=s}const n=i?d:s;if(n===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in p&&"AGENT_NAME"in p){return 1}if(t&&!e&&n===undefined){return 0}const r=n||0;if(p.TERM==="dumb"){return r}if(h.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in p){if("GITHUB_ACTIONS"in p||"GITEA_ACTIONS"in p){return 3}if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((t=>t in p))||p.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in p){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0}if(p.COLORTERM==="truecolor"){return 3}if(p.TERM==="xterm-kitty"){return 3}if("TERM_PROGRAM"in p){const t=Number.parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":{return t>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(p.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)){return 1}if("COLORTERM"in p){return 1}return r}function createSupportsColor(t,e={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...e});return translateLevel(i)}const g={stdout:createSupportsColor({isTTY:f.isatty(1)}),stderr:createSupportsColor({isTTY:f.isatty(2)})};const y=g;function stringReplaceAll(t,e,i){let s=t.indexOf(e);if(s===-1){return t}const n=e.length;let r=0;let o="";do{o+=t.slice(r,s)+e+i;r=s+n;s=t.indexOf(e,r)}while(s!==-1);o+=t.slice(r);return o}function stringEncaseCRLFWithFirstIndex(t,e,i,s){let n=0;let r="";do{const o=t[s-1]==="\r";r+=t.slice(n,o?s-1:s)+e+(o?"\r\n":"\n")+i;n=s+1;s=t.indexOf("\n",n)}while(s!==-1);r+=t.slice(n);return r}const{stdout:w,stderr:b}=y;const S=Symbol("GENERATOR");const v=Symbol("STYLER");const _=Symbol("IS_EMPTY");const k=["ansi","ansi","ansi256","ansi16m"];const x=Object.create(null);const applyOptions=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=w?w.level:0;t.level=e.level===undefined?i:e.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,e]of Object.entries(l)){x[t]={get(){const i=createBuilder(this,createStyler(e.open,e.close,this[v]),this[_]);Object.defineProperty(this,t,{value:i});return i}}}x.visible={get(){const t=createBuilder(this,this[v],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,e,i,...s)=>{if(t==="rgb"){if(e==="ansi16m"){return l[i].ansi16m(...s)}if(e==="ansi256"){return l[i].ansi256(l.rgbToAnsi256(...s))}return l[i].ansi(l.rgbToAnsi(...s))}if(t==="hex"){return getModelAnsi("rgb",e,i,...l.hexToRgb(...s))}return l[i][t](...s)};const O=["rgb","hex","ansi256"];for(const t of O){x[t]={get(){const{level:e}=this;return function(...i){const s=createStyler(getModelAnsi(t,k[e],"color",...i),l.color.close,this[v]);return createBuilder(this,s,this[_])}}};const e="bg"+t[0].toUpperCase()+t.slice(1);x[e]={get(){const{level:e}=this;return function(...i){const s=createStyler(getModelAnsi(t,k[e],"bgColor",...i),l.bgColor.close,this[v]);return createBuilder(this,s,this[_])}}}}const E=Object.defineProperties((()=>{}),{...x,level:{enumerable:true,get(){return this[S].level},set(t){this[S].level=t}}});const createStyler=(t,e,i)=>{let s;let n;if(i===undefined){s=t;n=e}else{s=i.openAll+t;n=e+i.closeAll}return{open:t,close:e,openAll:s,closeAll:n,parent:i}};const createBuilder=(t,e,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,E);builder[S]=t;builder[v]=e;builder[_]=i;return builder};const applyStyle=(t,e)=>{if(t.level<=0||!e){return t[_]?"":e}let i=t[v];if(i===undefined){return e}const{openAll:s,closeAll:n}=i;if(e.includes("")){while(i!==undefined){e=stringReplaceAll(e,i.close,i.open);i=i.parent}}const r=e.indexOf("\n");if(r!==-1){e=stringEncaseCRLFWithFirstIndex(e,n,s,r)}return s+e+n};Object.defineProperties(createChalk.prototype,x);const A=createChalk();const C=createChalk({level:b?b.level:0});const F=A;var P=__nccwpck_require__(1776);const{program:T,createCommand:L,createArgument:M,createOption:R,CommanderError:D,InvalidArgumentError:N,InvalidOptionArgumentError:$,Command:j,Argument:I,Option:W,Help:B}=P;var z=__nccwpck_require__(9411);var H=__nccwpck_require__.n(z);var V=__nccwpck_require__(5392);var G=__nccwpck_require__.n(V);const U=t(import.meta.url)("node:module");var q=__nccwpck_require__(2297);const J=1024*64;const assertValidPattern=t=>{if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>J){throw new TypeError("pattern is too long")}};const Y={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=t=>t.join("");const parseClass=(t,e)=>{const i=e;if(t.charAt(i)!=="["){throw new Error("not in a brace expression")}const s=[];const n=[];let r=i+1;let o=false;let a=false;let c=false;let l=false;let h=i;let u="";t:while(r<t.length){const e=t.charAt(r);if((e==="!"||e==="^")&&r===i+1){l=true;r++;continue}if(e==="]"&&o&&!c){h=r+1;break}o=true;if(e==="\\"){if(!c){c=true;r++;continue}}if(e==="["&&!c){for(const[e,[o,c,l]]of Object.entries(Y)){if(t.startsWith(e,r)){if(u){return["$.",false,t.length-i,true]}r+=e.length;if(l)n.push(o);else s.push(o);a=a||c;continue t}}}c=false;if(u){if(e>u){s.push(braceEscape(u)+"-"+braceEscape(e))}else if(e===u){s.push(braceEscape(e))}u="";r++;continue}if(t.startsWith("-]",r+1)){s.push(braceEscape(e+"-"));r+=2;continue}if(t.startsWith("-",r+1)){u=e;r+=2;continue}s.push(braceEscape(e));r++}if(h<r){return["",false,0,false]}if(!s.length&&!n.length){return["$.",false,t.length-i,true]}if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){const t=s[0].length===2?s[0].slice(-1):s[0];return[regexpEscape(t),false,h-i,false]}const f="["+(l?"^":"")+rangesToString(s)+"]";const p="["+(l?"":"^")+rangesToString(n)+"]";const d=s.length&&n.length?"("+f+"|"+p+")":s.length?f:p;return[d,a,h-i,true]};const unescape_unescape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");const K=new Set(["!","?","+","*","@"]);const isExtglobType=t=>K.has(t);const Z="(?!(?:^|/)\\.\\.?(?:$|/))";const Q="(?!\\.)";const X=new Set(["[","."]);const tt=new Set(["..","."]);const et=new Set("().*{}+?[]^$\\!");const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const it="[^/]";const st=it+"*?";const nt=it+"+?";class AST{type;#t;#e;#i=false;#s=[];#n;#r;#o;#a=false;#c;#l;#h=false;constructor(t,e,i={}){this.type=t;if(t)this.#e=true;this.#n=e;this.#t=this.#n?this.#n.#t:this;this.#c=this.#t===this?i:this.#t.#c;this.#o=this.#t===this?[]:this.#t.#o;if(t==="!"&&!this.#t.#a)this.#o.push(this);this.#r=this.#n?this.#n.#s.length:0}get hasMagic(){if(this.#e!==undefined)return this.#e;for(const t of this.#s){if(typeof t==="string")continue;if(t.type||t.hasMagic)return this.#e=true}return this.#e}toString(){if(this.#l!==undefined)return this.#l;if(!this.type){return this.#l=this.#s.map((t=>String(t))).join("")}else{return this.#l=this.type+"("+this.#s.map((t=>String(t))).join("|")+")"}}#u(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let t;while(t=this.#o.pop()){if(t.type!=="!")continue;let e=t;let i=e.#n;while(i){for(let s=e.#r+1;!i.type&&s<i.#s.length;s++){for(const e of t.#s){if(typeof e==="string"){throw new Error("string part in extglob AST??")}e.copyIn(i.#s[s])}}e=i;i=e.#n}}return this}push(...t){for(const e of t){if(e==="")continue;if(typeof e!=="string"&&!(e instanceof AST&&e.#n===this)){throw new Error("invalid part: "+e)}this.#s.push(e)}}toJSON(){const t=this.type===null?this.#s.slice().map((t=>typeof t==="string"?t:t.toJSON())):[this.type,...this.#s.map((t=>t.toJSON()))];if(this.isStart()&&!this.type)t.unshift([]);if(this.isEnd()&&(this===this.#t||this.#t.#a&&this.#n?.type==="!")){t.push({})}return t}isStart(){if(this.#t===this)return true;if(!this.#n?.isStart())return false;if(this.#r===0)return true;const t=this.#n;for(let e=0;e<this.#r;e++){const i=t.#s[e];if(!(i instanceof AST&&i.type==="!")){return false}}return true}isEnd(){if(this.#t===this)return true;if(this.#n?.type==="!")return true;if(!this.#n?.isEnd())return false;if(!this.type)return this.#n?.isEnd();const t=this.#n?this.#n.#s.length:0;return this.#r===t-1}copyIn(t){if(typeof t==="string")this.push(t);else this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#s){e.copyIn(t)}return e}static#f(t,e,i,s){let n=false;let r=false;let o=-1;let a=false;if(e.type===null){let c=i;let l="";while(c<t.length){const i=t.charAt(c++);if(n||i==="\\"){n=!n;l+=i;continue}if(r){if(c===o+1){if(i==="^"||i==="!"){a=true}}else if(i==="]"&&!(c===o+2&&a)){r=false}l+=i;continue}else if(i==="["){r=true;o=c;a=false;l+=i;continue}if(!s.noext&&isExtglobType(i)&&t.charAt(c)==="("){e.push(l);l="";const n=new AST(i,e);c=AST.#f(t,n,c,s);e.push(n);continue}l+=i}e.push(l);return c}let c=i+1;let l=new AST(null,e);const h=[];let u="";while(c<t.length){const i=t.charAt(c++);if(n||i==="\\"){n=!n;u+=i;continue}if(r){if(c===o+1){if(i==="^"||i==="!"){a=true}}else if(i==="]"&&!(c===o+2&&a)){r=false}u+=i;continue}else if(i==="["){r=true;o=c;a=false;u+=i;continue}if(isExtglobType(i)&&t.charAt(c)==="("){l.push(u);u="";const e=new AST(i,l);l.push(e);c=AST.#f(t,e,c,s);continue}if(i==="|"){l.push(u);u="";h.push(l);l=new AST(null,e);continue}if(i===")"){if(u===""&&e.#s.length===0){e.#h=true}l.push(u);u="";e.push(...h,l);return c}u+=i}e.type=null;e.#e=undefined;e.#s=[t.substring(i-1)];return c}static fromGlob(t,e={}){const i=new AST(null,undefined,e);AST.#f(t,i,0,e);return i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString();const[e,i,s,n]=this.toRegExpSource();const r=s||this.#e||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase();if(!r){return i}const o=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#c}toRegExpSource(t){const e=t??!!this.#c.dot;if(this.#t===this)this.#u();if(!this.type){const i=this.isStart()&&this.isEnd();const s=this.#s.map((e=>{const[s,n,r,o]=typeof e==="string"?AST.#p(e,this.#e,i):e.toRegExpSource(t);this.#e=this.#e||r;this.#i=this.#i||o;return s})).join("");let n="";if(this.isStart()){if(typeof this.#s[0]==="string"){const i=this.#s.length===1&&tt.has(this.#s[0]);if(!i){const i=X;const r=e&&i.has(s.charAt(0))||s.startsWith("\\.")&&i.has(s.charAt(2))||s.startsWith("\\.\\.")&&i.has(s.charAt(4));const o=!e&&!t&&i.has(s.charAt(0));n=r?Z:o?Q:""}}}let r="";if(this.isEnd()&&this.#t.#a&&this.#n?.type==="!"){r="(?:$|\\/)"}const o=n+s+r;return[o,unescape_unescape(s),this.#e=!!this.#e,this.#i]}const i=this.type==="*"||this.type==="+";const s=this.type==="!"?"(?:(?!(?:":"(?:";let n=this.#d(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const t=this.toString();this.#s=[t];this.type=null;this.#e=undefined;return[t,unescape_unescape(this.toString()),false,false]}let r=!i||t||e||!Q?"":this.#d(true);if(r===n){r=""}if(r){n=`(?:${n})(?:${r})*?`}let o="";if(this.type==="!"&&this.#h){o=(this.isStart()&&!e?Q:"")+nt}else{const i=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Q:"")+st+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&r?")":this.type==="*"&&r?`)?`:`)${this.type}`;o=s+n+i}return[o,unescape_unescape(n),this.#e=!!this.#e,this.#i]}#d(t){return this.#s.map((e=>{if(typeof e==="string"){throw new Error("string type in extglob ast??")}const[i,s,n,r]=e.toRegExpSource(t);this.#i=this.#i||r;return i})).filter((t=>!(this.isStart()&&this.isEnd())||!!t)).join("|")}static#p(t,e,i=false){let s=false;let n="";let r=false;for(let o=0;o<t.length;o++){const a=t.charAt(o);if(s){s=false;n+=(et.has(a)?"\\":"")+a;continue}if(a==="\\"){if(o===t.length-1){n+="\\\\"}else{s=true}continue}if(a==="["){const[i,s,a,c]=parseClass(t,o);if(a){n+=i;r=r||s;o+=a-1;e=e||c;continue}}if(a==="*"){if(i&&t==="*")n+=nt;else n+=st;e=true;continue}if(a==="?"){n+=it;e=true;continue}n+=regExpEscape(a)}return[n,unescape_unescape(t),!!e,r]}}const escape_escape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");const minimatch=(t,e,i={})=>{assertValidPattern(e);if(!i.nocomment&&e.charAt(0)==="#"){return false}return new Minimatch(e,i).match(t)};const rt=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t);const starDotExtTestDot=t=>e=>e.endsWith(t);const starDotExtTestNocase=t=>{t=t.toLowerCase();return e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)};const starDotExtTestNocaseDot=t=>{t=t.toLowerCase();return e=>e.toLowerCase().endsWith(t)};const ot=/^\*+\.\*+$/;const starDotStarTest=t=>!t.startsWith(".")&&t.includes(".");const starDotStarTestDot=t=>t!=="."&&t!==".."&&t.includes(".");const at=/^\.\*+$/;const dotStarTest=t=>t!=="."&&t!==".."&&t.startsWith(".");const ct=/^\*+$/;const starTest=t=>t.length!==0&&!t.startsWith(".");const starTestDot=t=>t.length!==0&&t!=="."&&t!=="..";const lt=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([t,e=""])=>{const i=qmarksTestNoExt([t]);if(!e)return i;e=e.toLowerCase();return t=>i(t)&&t.toLowerCase().endsWith(e)};const qmarksTestNocaseDot=([t,e=""])=>{const i=qmarksTestNoExtDot([t]);if(!e)return i;e=e.toLowerCase();return t=>i(t)&&t.toLowerCase().endsWith(e)};const qmarksTestDot=([t,e=""])=>{const i=qmarksTestNoExtDot([t]);return!e?i:t=>i(t)&&t.endsWith(e)};const qmarksTest=([t,e=""])=>{const i=qmarksTestNoExt([t]);return!e?i:t=>i(t)&&t.endsWith(e)};const qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")};const qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&t!=="."&&t!==".."};const ht=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const ut={win32:{sep:"\\"},posix:{sep:"/"}};const ft=ht==="win32"?ut.win32.sep:ut.posix.sep;minimatch.sep=ft;const pt=Symbol("globstar **");minimatch.GLOBSTAR=pt;const dt="[^/]";const mt=dt+"*?";const gt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const yt="(?:(?!(?:\\/|^)\\.).)*?";const filter=(t,e={})=>i=>minimatch(i,t,e);minimatch.filter=filter;const ext=(t,e={})=>Object.assign({},t,e);const defaults=t=>{if(!t||typeof t!=="object"||!Object.keys(t).length){return minimatch}const e=minimatch;const m=(i,s,n={})=>e(i,s,ext(t,n));return Object.assign(m,{Minimatch:class Minimatch extends e.Minimatch{constructor(e,i={}){super(e,ext(t,i))}static defaults(i){return e.defaults(ext(t,i)).Minimatch}},AST:class AST extends e.AST{constructor(e,i,s={}){super(e,i,ext(t,s))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ext(t,s))}},unescape:(i,s={})=>e.unescape(i,ext(t,s)),escape:(i,s={})=>e.escape(i,ext(t,s)),filter:(i,s={})=>e.filter(i,ext(t,s)),defaults:i=>e.defaults(ext(t,i)),makeRe:(i,s={})=>e.makeRe(i,ext(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,ext(t,s)),match:(i,s,n={})=>e.match(i,s,ext(t,n)),sep:e.sep,GLOBSTAR:pt})};minimatch.defaults=defaults;const braceExpand=(t,e={})=>{assertValidPattern(t);if(e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return q(t)};minimatch.braceExpand=braceExpand;const makeRe=(t,e={})=>new Minimatch(t,e).makeRe();minimatch.makeRe=makeRe;const match=(t,e,i={})=>{const s=new Minimatch(e,i);t=t.filter((t=>s.match(t)));if(s.options.nonull&&!t.length){t.push(e)}return t};minimatch.match=match;const wt=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){assertValidPattern(t);e=e||{};this.options=e;this.pattern=t;this.platform=e.platform||ht;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!e.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!e.nonegate;this.comment=false;this.empty=false;this.partial=!!e.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=e.windowsNoMagicRoot!==undefined?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const t of this.set){for(const e of t){if(typeof e!=="string")return true}}return false}debug(...t){}make(){const t=this.pattern;const e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(e.debug){this.debug=(...t)=>console.error(...t)}this.debug(this.pattern,this.globSet);const i=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(i);this.debug(this.pattern,this.globParts);let s=this.globParts.map(((t,e,i)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=t[0]===""&&t[1]===""&&(t[2]==="?"||!wt.test(t[2]))&&!wt.test(t[3]);const i=/^[a-z]:/i.test(t[0]);if(e){return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))]}else if(i){return[t[0],...t.slice(1).map((t=>this.parse(t)))]}}return t.map((t=>this.parse(t)))}));this.debug(this.pattern,s);this.set=s.filter((t=>t.indexOf(false)===-1));if(this.isWindows){for(let t=0;t<this.set.length;t++){const e=this.set[t];if(e[0]===""&&e[1]===""&&this.globParts[t][2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3])){e[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar){for(let e=0;e<t.length;e++){for(let i=0;i<t[e].length;i++){if(t[e][i]==="**"){t[e][i]="*"}}}}const{optimizationLevel:e=1}=this.options;if(e>=2){t=this.firstPhasePreProcess(t);t=this.secondPhasePreProcess(t)}else if(e>=1){t=this.levelOneOptimize(t)}else{t=this.adjascentGlobstarOptimize(t)}return t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;while(-1!==(e=t.indexOf("**",e+1))){let i=e;while(t[i+1]==="**"){i++}if(i!==e){t.splice(e,i-e)}}return t}))}levelOneOptimize(t){return t.map((t=>{t=t.reduce(((t,e)=>{const i=t[t.length-1];if(e==="**"&&i==="**"){return t}if(e===".."){if(i&&i!==".."&&i!=="."&&i!=="**"){t.pop();return t}}t.push(e);return t}),[]);return t.length===0?[""]:t}))}levelTwoFileOptimize(t){if(!Array.isArray(t)){t=this.slashSplit(t)}let e=false;do{e=false;if(!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const s=t[i];if(i===1&&s===""&&t[0]==="")continue;if(s==="."||s===""){e=true;t.splice(i,1);i--}}if(t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")){e=true;t.pop()}}let i=0;while(-1!==(i=t.indexOf("..",i+1))){const s=t[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){e=true;t.splice(i-1,2);i-=2}}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let i of t){let s=-1;while(-1!==(s=i.indexOf("**",s+1))){let n=s;while(i[n+1]==="**"){n++}if(n>s){i.splice(s+1,n-s)}let r=i[s+1];const o=i[s+2];const a=i[s+3];if(r!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}e=true;i.splice(s,1);const c=i.slice(0);c[s]="**";t.push(c);s--}if(!this.preserveMultipleSlashes){for(let t=1;t<i.length-1;t++){const s=i[t];if(t===1&&s===""&&i[0]==="")continue;if(s==="."||s===""){e=true;i.splice(t,1);t--}}if(i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")){e=true;i.pop()}}let n=0;while(-1!==(n=i.indexOf("..",n+1))){const t=i[n-1];if(t&&t!=="."&&t!==".."&&t!=="**"){e=true;const t=n===1&&i[n+1]==="**";const s=t?["."]:[];i.splice(n-1,2,...s);if(i.length===0)i.push("");n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++){for(let i=e+1;i<t.length;i++){const s=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(!s)continue;t[e]=s;t[i]=[]}}return t.filter((t=>t.length))}partsMatch(t,e,i=false){let s=0;let n=0;let r=[];let o="";while(s<t.length&&n<e.length){if(t[s]===e[n]){r.push(o==="b"?e[n]:t[s]);s++;n++}else if(i&&t[s]==="**"&&e[n]===t[s+1]){r.push(t[s]);s++}else if(i&&e[n]==="**"&&t[s]===e[n+1]){r.push(e[n]);n++}else if(t[s]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="b")return false;o="a";r.push(t[s]);s++;n++}else if(e[n]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(o==="a")return false;o="b";r.push(e[n]);s++;n++}else{return false}}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=false;let i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++){e=!e;i++}if(i)this.pattern=t.slice(i);this.negate=e}matchOne(t,e,i=false){const s=this.options;if(this.isWindows){const i=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const s=!i&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]);const n=typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0]);const r=!n&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3]);const o=s?3:i?0:undefined;const a=r?3:n?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[i,s]=[t[o],e[a]];if(i.toLowerCase()===s.toLowerCase()){e[a]=i;if(a>o){e=e.slice(a)}else if(o>a){t=t.slice(o)}}}}const{optimizationLevel:n=1}=this.options;if(n>=2){t=this.levelTwoFileOptimize(t)}this.debug("matchOne",this,{file:t,pattern:e});this.debug("matchOne",t.length,e.length);for(var r=0,o=0,a=t.length,c=e.length;r<a&&o<c;r++,o++){this.debug("matchOne loop");var l=e[o];var h=t[r];this.debug(e,l,h);if(l===false){return false}if(l===pt){this.debug("GLOBSTAR",[e,l,h]);var u=r;var f=o+1;if(f===c){this.debug("** at the end");for(;r<a;r++){if(t[r]==="."||t[r]===".."||!s.dot&&t[r].charAt(0)===".")return false}return true}while(u<a){var p=t[u];this.debug("\nglobstar while",t,u,e,f,p);if(this.matchOne(t.slice(u),e.slice(f),i)){this.debug("globstar found match!",u,a,p);return true}else{if(p==="."||p===".."||!s.dot&&p.charAt(0)==="."){this.debug("dot detected!",t,u,e,f);break}this.debug("globstar swallow a segment, and continue");u++}}if(i){this.debug("\n>>> no match, partial?",t,u,e,f);if(u===a){return true}}return false}let n;if(typeof l==="string"){n=h===l;this.debug("string match",l,h,n)}else{n=l.test(h);this.debug("pattern match",l,h,n)}if(!n)return false}if(r===a&&o===c){return true}else if(r===a){return i}else if(o===c){return r===a-1&&t[r]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(t){assertValidPattern(t);const e=this.options;if(t==="**")return pt;if(t==="")return"";let i;let s=null;if(i=t.match(ct)){s=e.dot?starTestDot:starTest}else if(i=t.match(rt)){s=(e.nocase?e.dot?starDotExtTestNocaseDot:starDotExtTestNocase:e.dot?starDotExtTestDot:starDotExtTest)(i[1])}else if(i=t.match(lt)){s=(e.nocase?e.dot?qmarksTestNocaseDot:qmarksTestNocase:e.dot?qmarksTestDot:qmarksTest)(i)}else if(i=t.match(ot)){s=e.dot?starDotStarTestDot:starDotStarTest}else if(i=t.match(at)){s=dotStarTest}const n=AST.fromGlob(t,this.options).toMMPattern();if(s&&typeof n==="object"){Reflect.defineProperty(n,"test",{value:s})}return n}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const t=this.set;if(!t.length){this.regexp=false;return this.regexp}const e=this.options;const i=e.noglobstar?mt:e.dot?gt:yt;const s=new Set(e.nocase?["i"]:[]);let n=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp){for(const e of t.flags.split(""))s.add(e)}return typeof t==="string"?esm_regExpEscape(t):t===pt?pt:t._src}));e.forEach(((t,s)=>{const n=e[s+1];const r=e[s-1];if(t!==pt||r===pt){return}if(r===undefined){if(n!==undefined&&n!==pt){e[s+1]="(?:\\/|"+i+"\\/)?"+n}else{e[s]=i}}else if(n===undefined){e[s-1]=r+"(?:\\/|"+i+")?"}else if(n!==pt){e[s-1]=r+"(?:\\/|\\/"+i+"\\/)"+n;e[s+1]=pt}}));return e.filter((t=>t!==pt)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];n="^"+r+n+o+"$";if(this.negate)n="^(?!"+n+").+$";try{this.regexp=new RegExp(n,[...s].join(""))}catch(t){this.regexp=false}return this.regexp}slashSplit(t){if(this.preserveMultipleSlashes){return t.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(t)){return["",...t.split(/\/+/)]}else{return t.split(/\/+/)}}match(t,e=this.partial){this.debug("match",t,this.pattern);if(this.comment){return false}if(this.empty){return t===""}if(t==="/"&&e){return true}const i=this.options;if(this.isWindows){t=t.split("\\").join("/")}const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const n=this.set;this.debug(this.pattern,"set",n);let r=s[s.length-1];if(!r){for(let t=s.length-2;!r&&t>=0;t--){r=s[t]}}for(let t=0;t<n.length;t++){const o=n[t];let a=s;if(i.matchBase&&o.length===1){a=[r]}const c=this.matchOne(a,o,e);if(c){if(i.flipNegate){return true}return!this.negate}}if(i.flipNegate){return false}return this.negate}static defaults(t){return minimatch.defaults(t).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;const bt=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const St=new Set;const vt=typeof process==="object"&&!!process?process:{};const emitWarning=(t,e,i,s)=>{typeof vt.emitWarning==="function"?vt.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};let _t=globalThis.AbortController;let kt=globalThis.AbortSignal;if(typeof _t==="undefined"){kt=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(t,e){this._onabort.push(e)}};_t=class AbortController{constructor(){warnACPolyfill()}signal=new kt;abort(t){if(this.signal.aborted)return;this.signal.reason=t;this.signal.aborted=true;for(const e of this.signal._onabort){e(t)}this.signal.onabort?.(t)}};let t=vt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!t)return;t=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=t=>!St.has(t);const xt=Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t);const getUintArray=t=>!isPosInt(t)?null:t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(t){super(t);this.fill(0)}}class Stack{heap;length;static#m=false;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#m=true;const i=new Stack(t,e);Stack.#m=false;return i}constructor(t,e){if(!Stack.#m){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new e(t);this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#g;#y;#w;#b;#S;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#v;#_;#k;#x;#O;#E;#A;#C;#F;#P;#T;#L;#M;#R;#D;#N;#$;static unsafeExposeInternals(t){return{starts:t.#M,ttls:t.#R,sizes:t.#L,keyMap:t.#k,keyList:t.#x,valList:t.#O,next:t.#E,prev:t.#A,get head(){return t.#C},get tail(){return t.#F},free:t.#P,isBackgroundFetch:e=>t.#j(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#W(e),indexes:e=>t.#B(e),rindexes:e=>t.#z(e),isStale:e=>t.#H(e)}}get max(){return this.#g}get maxSize(){return this.#y}get calculatedSize(){return this.#_}get size(){return this.#v}get fetchMethod(){return this.#S}get dispose(){return this.#w}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:o,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:u,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:v}=t;if(e!==0&&!isPosInt(e)){throw new TypeError("max option must be a nonnegative integer")}const _=e?getUintArray(e):Array;if(!_){throw new Error("invalid max value: "+e)}this.#g=e;this.#y=f;this.maxEntrySize=p||this.#y;this.sizeCalculation=d;if(this.sizeCalculation){if(!this.#y&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(g!==undefined&&typeof g!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#S=g;this.#N=!!g;this.#k=new Map;this.#x=new Array(e).fill(undefined);this.#O=new Array(e).fill(undefined);this.#E=new _(e);this.#A=new _(e);this.#C=0;this.#F=0;this.#P=Stack.create(e);this.#v=0;this.#_=0;if(typeof c==="function"){this.#w=c}if(typeof l==="function"){this.#b=l;this.#T=[]}else{this.#b=undefined;this.#T=undefined}this.#D=!!this.#w;this.#$=!!this.#b;this.noDisposeOnSet=!!h;this.noUpdateTTL=!!u;this.noDeleteOnFetchRejection=!!y;this.allowStaleOnFetchRejection=!!b;this.allowStaleOnFetchAbort=!!S;this.ignoreFetchAbort=!!v;if(this.maxEntrySize!==0){if(this.#y!==0){if(!isPosInt(this.#y)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#V()}this.allowStale=!!a;this.noDeleteOnStaleGet=!!w;this.updateAgeOnGet=!!r;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(s)||s===0?s:1;this.ttlAutopurge=!!n;this.ttl=i||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#G()}if(this.#g===0&&this.ttl===0&&this.#y===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#y){const t="LRU_CACHE_UNBOUNDED";if(shouldWarn(t)){St.add(t);const e="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(e,"UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#k.has(t)?Infinity:0}#G(){const t=new ZeroArray(this.#g);const e=new ZeroArray(this.#g);this.#R=t;this.#M=e;this.#U=(i,s,n=bt.now())=>{e[i]=s!==0?n:0;t[i]=s;if(s!==0&&this.ttlAutopurge){const t=setTimeout((()=>{if(this.#H(i)){this.delete(this.#x[i])}}),s+1);if(t.unref){t.unref()}}};this.#q=i=>{e[i]=t[i]!==0?bt.now():0};this.#J=(s,n)=>{if(t[n]){const r=t[n];const o=e[n];if(!r||!o)return;s.ttl=r;s.start=o;s.now=i||getNow();const a=s.now-o;s.remainingTTL=r-a}};let i=0;const getNow=()=>{const t=bt.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);if(e.unref){e.unref()}}return t};this.getRemainingTTL=s=>{const n=this.#k.get(s);if(n===undefined){return 0}const r=t[n];const o=e[n];if(!r||!o){return Infinity}const a=(i||getNow())-o;return r-a};this.#H=s=>{const n=e[s];const r=t[s];return!!r&&!!n&&(i||getNow())-n>r}}#q=()=>{};#J=()=>{};#U=()=>{};#H=()=>false;#V(){const t=new ZeroArray(this.#g);this.#_=0;this.#L=t;this.#Y=e=>{this.#_-=t[e];t[e]=0};this.#K=(t,e,i,s)=>{if(this.#j(e)){return 0}if(!isPosInt(i)){if(s){if(typeof s!=="function"){throw new TypeError("sizeCalculation must be a function")}i=s(e,t);if(!isPosInt(i)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return i};this.#Z=(e,i,s)=>{t[e]=i;if(this.#y){const i=this.#y-t[e];while(this.#_>i){this.#Q(true)}}this.#_+=t[e];if(s){s.entrySize=i;s.totalCalculatedSize=this.#_}}}#Y=t=>{};#Z=(t,e,i)=>{};#K=(t,e,i,s)=>{if(i||s){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#B({allowStale:t=this.allowStale}={}){if(this.#v){for(let e=this.#F;true;){if(!this.#X(e)){break}if(t||!this.#H(e)){yield e}if(e===this.#C){break}else{e=this.#A[e]}}}}*#z({allowStale:t=this.allowStale}={}){if(this.#v){for(let e=this.#C;true;){if(!this.#X(e)){break}if(t||!this.#H(e)){yield e}if(e===this.#F){break}else{e=this.#E[e]}}}}#X(t){return t!==undefined&&this.#k.get(this.#x[t])===t}*entries(){for(const t of this.#B()){if(this.#O[t]!==undefined&&this.#x[t]!==undefined&&!this.#j(this.#O[t])){yield[this.#x[t],this.#O[t]]}}}*rentries(){for(const t of this.#z()){if(this.#O[t]!==undefined&&this.#x[t]!==undefined&&!this.#j(this.#O[t])){yield[this.#x[t],this.#O[t]]}}}*keys(){for(const t of this.#B()){const e=this.#x[t];if(e!==undefined&&!this.#j(this.#O[t])){yield e}}}*rkeys(){for(const t of this.#z()){const e=this.#x[t];if(e!==undefined&&!this.#j(this.#O[t])){yield e}}}*values(){for(const t of this.#B()){const e=this.#O[t];if(e!==undefined&&!this.#j(this.#O[t])){yield this.#O[t]}}}*rvalues(){for(const t of this.#z()){const e=this.#O[t];if(e!==undefined&&!this.#j(this.#O[t])){yield this.#O[t]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#B()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;if(t(n,this.#x[i],this)){return this.get(this.#x[i],e)}}}forEach(t,e=this){for(const i of this.#B()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#x[i],this)}}rforEach(t,e=this){for(const i of this.#z()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#x[i],this)}}purgeStale(){let t=false;for(const e of this.#z({allowStale:true})){if(this.#H(e)){this.delete(this.#x[e]);t=true}}return t}info(t){const e=this.#k.get(t);if(e===undefined)return undefined;const i=this.#O[e];const s=this.#j(i)?i.__staleWhileFetching:i;if(s===undefined)return undefined;const n={value:s};if(this.#R&&this.#M){const t=this.#R[e];const i=this.#M[e];if(t&&i){const e=t-(bt.now()-i);n.ttl=e;n.start=Date.now()}}if(this.#L){n.size=this.#L[e]}return n}dump(){const t=[];for(const e of this.#B({allowStale:true})){const i=this.#x[e];const s=this.#O[e];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined||i===undefined)continue;const r={value:n};if(this.#R&&this.#M){r.ttl=this.#R[e];const t=bt.now()-this.#M[e];r.start=Math.floor(Date.now()-t)}if(this.#L){r.size=this.#L[e]}t.unshift([i,r])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=bt.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(e===undefined){this.delete(t);return this}const{ttl:s=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:c=this.noUpdateTTL}=i;const l=this.#K(t,e,i.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.delete(t);return this}let h=this.#v===0?undefined:this.#k.get(t);if(h===undefined){h=this.#v===0?this.#F:this.#P.length!==0?this.#P.pop():this.#v===this.#g?this.#Q(false):this.#v;this.#x[h]=t;this.#O[h]=e;this.#k.set(t,h);this.#E[this.#F]=h;this.#A[h]=this.#F;this.#F=h;this.#v++;this.#Z(h,l,a);if(a)a.set="add";c=false}else{this.#W(h);const i=this.#O[h];if(e!==i){if(this.#N&&this.#j(i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;if(e!==undefined&&!r){if(this.#D){this.#w?.(e,t,"set")}if(this.#$){this.#T?.push([e,t,"set"])}}}else if(!r){if(this.#D){this.#w?.(i,t,"set")}if(this.#$){this.#T?.push([i,t,"set"])}}this.#Y(h);this.#Z(h,l,a);this.#O[h]=e;if(a){a.set="replace";const t=i&&this.#j(i)?i.__staleWhileFetching:i;if(t!==undefined)a.oldValue=t}}else if(a){a.set="update"}}if(s!==0&&!this.#R){this.#G()}if(this.#R){if(!c){this.#U(h,s,n)}if(a)this.#J(a,h)}if(!r&&this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}return this}pop(){try{while(this.#v){const t=this.#O[this.#C];this.#Q(true);if(this.#j(t)){if(t.__staleWhileFetching){return t.__staleWhileFetching}}else if(t!==undefined){return t}}}finally{if(this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}}}#Q(t){const e=this.#C;const i=this.#x[e];const s=this.#O[e];if(this.#N&&this.#j(s)){s.__abortController.abort(new Error("evicted"))}else if(this.#D||this.#$){if(this.#D){this.#w?.(s,i,"evict")}if(this.#$){this.#T?.push([s,i,"evict"])}}this.#Y(e);if(t){this.#x[e]=undefined;this.#O[e]=undefined;this.#P.push(e)}if(this.#v===1){this.#C=this.#F=0;this.#P.length=0}else{this.#C=this.#E[e]}this.#k.delete(i);this.#v--;return e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e;const n=this.#k.get(t);if(n!==undefined){const t=this.#O[n];if(this.#j(t)&&t.__staleWhileFetching===undefined){return false}if(!this.#H(n)){if(i){this.#q(n)}if(s){s.has="hit";this.#J(s,n)}return true}else if(s){s.has="stale";this.#J(s,n)}}else if(s){s.has="miss"}return false}peek(t,e={}){const{allowStale:i=this.allowStale}=e;const s=this.#k.get(t);if(s===undefined||!i&&this.#H(s)){return}const n=this.#O[s];return this.#j(n)?n.__staleWhileFetching:n}#I(t,e,i,s){const n=e===undefined?undefined:this.#O[e];if(this.#j(n)){return n}const r=new _t;const{signal:o}=i;o?.addEventListener("abort",(()=>r.abort(o.reason)),{signal:r.signal});const a={signal:r.signal,options:i,context:s};const cb=(s,n=false)=>{const{aborted:o}=r.signal;const l=i.ignoreFetchAbort&&s!==undefined;if(i.status){if(o&&!n){i.status.fetchAborted=true;i.status.fetchError=r.signal.reason;if(l)i.status.fetchAbortIgnored=true}else{i.status.fetchResolved=true}}if(o&&!l&&!n){return fetchFail(r.signal.reason)}const h=c;if(this.#O[e]===c){if(s===undefined){if(h.__staleWhileFetching){this.#O[e]=h.__staleWhileFetching}else{this.delete(t)}}else{if(i.status)i.status.fetchUpdated=true;this.set(t,s,a.options)}}return s};const eb=t=>{if(i.status){i.status.fetchRejected=true;i.status.fetchError=t}return fetchFail(t)};const fetchFail=s=>{const{aborted:n}=r.signal;const o=n&&i.allowStaleOnFetchAbort;const a=o||i.allowStaleOnFetchRejection;const l=a||i.noDeleteOnFetchRejection;const h=c;if(this.#O[e]===c){const i=!l||h.__staleWhileFetching===undefined;if(i){this.delete(t)}else if(!o){this.#O[e]=h.__staleWhileFetching}}if(a){if(i.status&&h.__staleWhileFetching!==undefined){i.status.returnedStale=true}return h.__staleWhileFetching}else if(h.__returned===h){throw s}};const pcall=(e,s)=>{const o=this.#S?.(t,n,a);if(o&&o instanceof Promise){o.then((t=>e(t===undefined?undefined:t)),s)}r.signal.addEventListener("abort",(()=>{if(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort){e(undefined);if(i.allowStaleOnFetchAbort){e=t=>cb(t,true)}}}))};if(i.status)i.status.fetchDispatched=true;const c=new Promise(pcall).then(cb,eb);const l=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:undefined});if(e===undefined){this.set(t,l,{...a.options,status:undefined});e=this.#k.get(t)}else{this.#O[e]=l}return l}#j(t){if(!this.#N)return false;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof _t}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:g=false,status:y,signal:w}=e;if(!this.#N){if(y)y.fetch="get";return this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:y})}const b={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:y,signal:w};let S=this.#k.get(t);if(S===undefined){if(y)y.fetch="miss";const e=this.#I(t,S,b,d);return e.__returned=e}else{const e=this.#O[S];if(this.#j(e)){const t=i&&e.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(t)y.returnedStale=true}return t?e.__staleWhileFetching:e.__returned=e}const n=this.#H(S);if(!g&&!n){if(y)y.fetch="hit";this.#W(S);if(s){this.#q(S)}if(y)this.#J(y,S);return e}const r=this.#I(t,S,b,d);const o=r.__staleWhileFetching!==undefined;const a=o&&i;if(y){y.fetch=n?"stale":"refresh";if(a&&n)y.returnedStale=true}return a?r.__staleWhileFetching:r.__returned=r}}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e;const o=this.#k.get(t);if(o!==undefined){const e=this.#O[o];const a=this.#j(e);if(r)this.#J(r,o);if(this.#H(o)){if(r)r.get="stale";if(!a){if(!n){this.delete(t)}if(r&&i)r.returnedStale=true;return i?e:undefined}else{if(r&&i&&e.__staleWhileFetching!==undefined){r.returnedStale=true}return i?e.__staleWhileFetching:undefined}}else{if(r)r.get="hit";if(a){return e.__staleWhileFetching}this.#W(o);if(s){this.#q(o)}return e}}else if(r){r.get="miss"}}#tt(t,e){this.#A[e]=t;this.#E[t]=e}#W(t){if(t!==this.#F){if(t===this.#C){this.#C=this.#E[t]}else{this.#tt(this.#A[t],this.#E[t])}this.#tt(this.#F,t);this.#F=t}}delete(t){let e=false;if(this.#v!==0){const i=this.#k.get(t);if(i!==undefined){e=true;if(this.#v===1){this.clear()}else{this.#Y(i);const e=this.#O[i];if(this.#j(e)){e.__abortController.abort(new Error("deleted"))}else if(this.#D||this.#$){if(this.#D){this.#w?.(e,t,"delete")}if(this.#$){this.#T?.push([e,t,"delete"])}}this.#k.delete(t);this.#x[i]=undefined;this.#O[i]=undefined;if(i===this.#F){this.#F=this.#A[i]}else if(i===this.#C){this.#C=this.#E[i]}else{const t=this.#A[i];this.#E[t]=this.#E[i];const e=this.#E[i];this.#A[e]=this.#A[i]}this.#v--;this.#P.push(i)}}}if(this.#$&&this.#T?.length){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}return e}clear(){for(const t of this.#z({allowStale:true})){const e=this.#O[t];if(this.#j(e)){e.__abortController.abort(new Error("deleted"))}else{const i=this.#x[t];if(this.#D){this.#w?.(e,i,"delete")}if(this.#$){this.#T?.push([e,i,"delete"])}}}this.#k.clear();this.#O.fill(undefined);this.#x.fill(undefined);if(this.#R&&this.#M){this.#R.fill(0);this.#M.fill(0)}if(this.#L){this.#L.fill(0)}this.#C=0;this.#F=0;this.#P.length=0;this.#_=0;this.#v=0;if(this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}}}var Ot=__nccwpck_require__(7147);var Et=__nccwpck_require__(7561);var At=__nccwpck_require__.t(Et,2);const Ct=t(import.meta.url)("node:fs/promises");var Ft=__nccwpck_require__.n(Ct);var Pt=__nccwpck_require__(5673);const Tt=t(import.meta.url)("node:stream");const Lt=t(import.meta.url)("node:string_decoder");const Mt=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof Tt||isReadable(t)||isWritable(t));const isReadable=t=>!!t&&typeof t==="object"&&t instanceof Pt.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==Tt.Writable.prototype.pipe;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof Pt.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";const Rt=Symbol("EOF");const Dt=Symbol("maybeEmitEnd");const Nt=Symbol("emittedEnd");const $t=Symbol("emittingEnd");const jt=Symbol("emittedError");const It=Symbol("closed");const Wt=Symbol("read");const Bt=Symbol("flush");const zt=Symbol("flushChunk");const Ht=Symbol("encoding");const Vt=Symbol("decoder");const Gt=Symbol("flowing");const Ut=Symbol("paused");const qt=Symbol("resume");const Jt=Symbol("buffer");const Yt=Symbol("pipes");const Kt=Symbol("bufferLength");const Zt=Symbol("bufferPush");const Qt=Symbol("bufferShift");const Xt=Symbol("objectMode");const te=Symbol("destroyed");const ee=Symbol("error");const ie=Symbol("emitData");const se=Symbol("emitEnd");const ne=Symbol("emitEnd2");const re=Symbol("async");const oe=Symbol("abort");const ae=Symbol("aborted");const ce=Symbol("signal");const le=Symbol("dataListeners");const he=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,e,i){this.src=t;this.dest=e;this.opts=i;this.ondrain=()=>t[qt]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,e,i){super(t,e,i);this.proxyErrors=t=>e.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends Pt.EventEmitter{[Gt]=false;[Ut]=false;[Yt]=[];[Jt]=[];[Xt];[Ht];[re];[Vt];[Rt]=false;[Nt]=false;[$t]=false;[It]=false;[jt]=null;[Kt]=0;[te]=false;[ce];[ae]=false;[le]=0;[he]=false;writable=true;readable=true;constructor(...t){const e=t[0]||{};super();if(e.objectMode&&typeof e.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(e)){this[Xt]=true;this[Ht]=null}else if(isEncodingOptions(e)){this[Ht]=e.encoding;this[Xt]=false}else{this[Xt]=false;this[Ht]=null}this[re]=!!e.async;this[Vt]=this[Ht]?new Lt.StringDecoder(this[Ht]):null;if(e&&e.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[Jt]})}if(e&&e.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[Yt]})}const{signal:i}=e;if(i){this[ce]=i;if(i.aborted){this[oe]()}else{i.addEventListener("abort",(()=>this[oe]()))}}}get bufferLength(){return this[Kt]}get encoding(){return this[Ht]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Xt]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[re]}set["async"](t){this[re]=this[re]||!!t}[oe](){this[ae]=true;this.emit("abort",this[ce]?.reason);this.destroy(this[ce]?.reason)}get aborted(){return this[ae]}set aborted(t){}write(t,e,i){if(this[ae])return false;if(this[Rt])throw new Error("write after end");if(this[te]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof e==="function"){i=e;e="utf8"}if(!e)e="utf8";const s=this[re]?defer:nodefer;if(!this[Xt]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[Xt]){if(this[Gt]&&this[Kt]!==0)this[Bt](true);if(this[Gt])this.emit("data",t);else this[Zt](t);if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}if(!t.length){if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}if(typeof t==="string"&&!(e===this[Ht]&&!this[Vt]?.lastNeed)){t=Buffer.from(t,e)}if(Buffer.isBuffer(t)&&this[Ht]){t=this[Vt].write(t)}if(this[Gt]&&this[Kt]!==0)this[Bt](true);if(this[Gt])this.emit("data",t);else this[Zt](t);if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}read(t){if(this[te])return null;this[he]=false;if(this[Kt]===0||t===0||t&&t>this[Kt]){this[Dt]();return null}if(this[Xt])t=null;if(this[Jt].length>1&&!this[Xt]){this[Jt]=[this[Ht]?this[Jt].join(""):Buffer.concat(this[Jt],this[Kt])]}const e=this[Wt](t||null,this[Jt][0]);this[Dt]();return e}[Wt](t,e){if(this[Xt])this[Qt]();else{const i=e;if(t===i.length||t===null)this[Qt]();else if(typeof i==="string"){this[Jt][0]=i.slice(t);e=i.slice(0,t);this[Kt]-=t}else{this[Jt][0]=i.subarray(t);e=i.subarray(0,t);this[Kt]-=t}}this.emit("data",e);if(!this[Jt].length&&!this[Rt])this.emit("drain");return e}end(t,e,i){if(typeof t==="function"){i=t;t=undefined}if(typeof e==="function"){i=e;e="utf8"}if(t!==undefined)this.write(t,e);if(i)this.once("end",i);this[Rt]=true;this.writable=false;if(this[Gt]||!this[Ut])this[Dt]();return this}[qt](){if(this[te])return;if(!this[le]&&!this[Yt].length){this[he]=true}this[Ut]=false;this[Gt]=true;this.emit("resume");if(this[Jt].length)this[Bt]();else if(this[Rt])this[Dt]();else this.emit("drain")}resume(){return this[qt]()}pause(){this[Gt]=false;this[Ut]=true;this[he]=false}get destroyed(){return this[te]}get flowing(){return this[Gt]}get paused(){return this[Ut]}[Zt](t){if(this[Xt])this[Kt]+=1;else this[Kt]+=t.length;this[Jt].push(t)}[Qt](){if(this[Xt])this[Kt]-=1;else this[Kt]-=this[Jt][0].length;return this[Jt].shift()}[Bt](t=false){do{}while(this[zt](this[Qt]())&&this[Jt].length);if(!t&&!this[Jt].length&&!this[Rt])this.emit("drain")}[zt](t){this.emit("data",t);return this[Gt]}pipe(t,e){if(this[te])return t;this[he]=false;const i=this[Nt];e=e||{};if(t===Mt.stdout||t===Mt.stderr)e.end=false;else e.end=e.end!==false;e.proxyErrors=!!e.proxyErrors;if(i){if(e.end)t.end()}else{this[Yt].push(!e.proxyErrors?new Pipe(this,t,e):new PipeProxyErrors(this,t,e));if(this[re])defer((()=>this[qt]()));else this[qt]()}return t}unpipe(t){const e=this[Yt].find((e=>e.dest===t));if(e){if(this[Yt].length===1){if(this[Gt]&&this[le]===0){this[Gt]=false}this[Yt]=[]}else this[Yt].splice(this[Yt].indexOf(e),1);e.unpipe()}}addListener(t,e){return this.on(t,e)}on(t,e){const i=super.on(t,e);if(t==="data"){this[he]=false;this[le]++;if(!this[Yt].length&&!this[Gt]){this[qt]()}}else if(t==="readable"&&this[Kt]!==0){super.emit("readable")}else if(isEndish(t)&&this[Nt]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[jt]){const t=e;if(this[re])defer((()=>t.call(this,this[jt])));else t.call(this,this[jt])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){const i=super.off(t,e);if(t==="data"){this[le]=this.listeners("data").length;if(this[le]===0&&!this[he]&&!this[Yt].length){this[Gt]=false}}return i}removeAllListeners(t){const e=super.removeAllListeners(t);if(t==="data"||t===undefined){this[le]=0;if(!this[he]&&!this[Yt].length){this[Gt]=false}}return e}get emittedEnd(){return this[Nt]}[Dt](){if(!this[$t]&&!this[Nt]&&!this[te]&&this[Jt].length===0&&this[Rt]){this[$t]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[It])this.emit("close");this[$t]=false}}emit(t,...e){const i=e[0];if(t!=="error"&&t!=="close"&&t!==te&&this[te]){return false}else if(t==="data"){return!this[Xt]&&!i?false:this[re]?(defer((()=>this[ie](i))),true):this[ie](i)}else if(t==="end"){return this[se]()}else if(t==="close"){this[It]=true;if(!this[Nt]&&!this[te])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[jt]=i;super.emit(ee,i);const t=!this[ce]||this.listeners("error").length?super.emit("error",i):false;this[Dt]();return t}else if(t==="resume"){const t=super.emit("resume");this[Dt]();return t}else if(t==="finish"||t==="prefinish"){const e=super.emit(t);this.removeAllListeners(t);return e}const s=super.emit(t,...e);this[Dt]();return s}[ie](t){for(const e of this[Yt]){if(e.dest.write(t)===false)this.pause()}const e=this[he]?false:super.emit("data",t);this[Dt]();return e}[se](){if(this[Nt])return false;this[Nt]=true;this.readable=false;return this[re]?(defer((()=>this[ne]())),true):this[ne]()}[ne](){if(this[Vt]){const t=this[Vt].end();if(t){for(const e of this[Yt]){e.dest.write(t)}if(!this[he])super.emit("data",t)}}for(const t of this[Yt]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[Xt])t.dataLength=0;const e=this.promise();this.on("data",(e=>{t.push(e);if(!this[Xt])t.dataLength+=e.length}));await e;return t}async concat(){if(this[Xt]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[Ht]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(te,(()=>e(new Error("stream destroyed"))));this.on("error",(t=>e(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[he]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[Rt])return stop();let i;let s;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(te,ondestroy);stop();s(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(te,ondestroy);this.pause();i({value:t,done:!!this[Rt]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(te,ondestroy);stop();i({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,e)=>{s=e;i=t;this.once(te,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[he]=false;let t=false;const stop=()=>{this.pause();this.off(ee,stop);this.off(te,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const e=this.read();return e===null?stop():{done:false,value:e}};this.once("end",stop);this.once(ee,stop);this.once(te,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(t){if(this[te]){if(t)this.emit("error",t);else this.emit(te);return this}this[te]=true;this[he]=true;this[Jt].length=0;this[Kt]=0;const e=this;if(typeof e.close==="function"&&!this[It])e.close();if(t)this.emit("error",t);else this.emit(te);return this}static get isStream(){return isStream}}const ue=Ot.realpathSync.native;const fe={lstatSync:Ot.lstatSync,readdir:Ot.readdir,readdirSync:Ot.readdirSync,readlinkSync:Ot.readlinkSync,realpathSync:ue,promises:{lstat:Ct.lstat,readdir:Ct.readdir,readlink:Ct.readlink,realpath:Ct.realpath}};const fsFromOption=t=>!t||t===fe||t===At?fe:{...fe,...t,promises:{...fe.promises,...t.promises||{}}};const pe=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=t=>t.replace(/\//g,"\\").replace(pe,"$1\\");const de=/[\\\/]/;const me=0;const ge=1;const ye=2;const we=4;const be=6;const Se=8;const ve=10;const _e=12;const ke=15;const xe=~ke;const Oe=16;const Ee=32;const Ae=64;const Ce=128;const Fe=256;const Pe=512;const Te=Ae|Ce|Pe;const Le=1023;const entToType=t=>t.isFile()?Se:t.isDirectory()?we:t.isSymbolicLink()?ve:t.isCharacterDevice()?ye:t.isBlockDevice()?be:t.isSocket()?_e:t.isFIFO()?ge:me;const Me=new Map;const normalize=t=>{const e=Me.get(t);if(e)return e;const i=t.normalize("NFKD");Me.set(t,i);return i};const Re=new Map;const normalizeNocase=t=>{const e=Re.get(t);if(e)return e;const i=normalize(t.toLowerCase());Re.set(t,i);return i};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:t=>t.length+1})}}const De=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#et;#it;get dev(){return this.#it}#st;get mode(){return this.#st}#nt;get nlink(){return this.#nt}#rt;get uid(){return this.#rt}#ot;get gid(){return this.#ot}#at;get rdev(){return this.#at}#ct;get blksize(){return this.#ct}#lt;get ino(){return this.#lt}#v;get size(){return this.#v}#ht;get blocks(){return this.#ht}#ut;get atimeMs(){return this.#ut}#ft;get mtimeMs(){return this.#ft}#pt;get ctimeMs(){return this.#pt}#dt;get birthtimeMs(){return this.#dt}#mt;get atime(){return this.#mt}#gt;get mtime(){return this.#gt}#yt;get ctime(){return this.#yt}#wt;get birthtime(){return this.#wt}#bt;#St;#vt;#_t;#kt;#xt;#Ot;#Et;#At;#Ct;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=me,i,s,n,r,o){this.name=t;this.#bt=n?normalizeNocase(t):normalize(t);this.#Ot=e&Le;this.nocase=n;this.roots=s;this.root=i||this;this.#Et=r;this.#vt=o.fullpath;this.#kt=o.relative;this.#xt=o.relativePosix;this.parent=o.parent;if(this.parent){this.#et=this.parent.#et}else{this.#et=fsFromOption(o.fs)}}depth(){if(this.#St!==undefined)return this.#St;if(!this.parent)return this.#St=0;return this.#St=this.parent.depth()+1}childrenCache(){return this.#Et}resolve(t){if(!t){return this}const e=this.getRootString(t);const i=t.substring(e.length);const s=i.split(this.splitSep);const n=e?this.getRoot(e).#Ft(s):this.#Ft(s);return n}#Ft(t){let e=this;for(const i of t){e=e.child(i)}return e}children(){const t=this.#Et.get(this);if(t){return t}const e=Object.assign([],{provisional:0});this.#Et.set(this,e);this.#Ot&=~Oe;return e}child(t,e){if(t===""||t==="."){return this}if(t===".."){return this.parent||this}const i=this.children();const s=this.nocase?normalizeNocase(t):normalize(t);for(const t of i){if(t.#bt===s){return t}}const n=this.parent?this.sep:"";const r=this.#vt?this.#vt+n+t:undefined;const o=this.newChild(t,me,{...e,parent:this,fullpath:r});if(!this.canReaddir()){o.#Ot|=Ce}i.push(o);return o}relative(){if(this.isCWD)return"";if(this.#kt!==undefined){return this.#kt}const t=this.name;const e=this.parent;if(!e){return this.#kt=this.name}const i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#xt!==undefined)return this.#xt;const t=this.name;const e=this.parent;if(!e){return this.#xt=this.fullpathPosix()}const i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(this.#vt!==undefined){return this.#vt}const t=this.name;const e=this.parent;if(!e){return this.#vt=this.name}const i=e.fullpath();const s=i+(!e.parent?"":this.sep)+t;return this.#vt=s}fullpathPosix(){if(this.#_t!==undefined)return this.#_t;if(this.sep==="/")return this.#_t=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(t)){return this.#_t=`//?/${t}`}else{return this.#_t=t}}const t=this.parent;const e=t.fullpathPosix();const i=e+(!e||!t.parent?"":"/")+this.name;return this.#_t=i}isUnknown(){return(this.#Ot&ke)===me}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Ot&ke)===Se}isDirectory(){return(this.#Ot&ke)===we}isCharacterDevice(){return(this.#Ot&ke)===ye}isBlockDevice(){return(this.#Ot&ke)===be}isFIFO(){return(this.#Ot&ke)===ge}isSocket(){return(this.#Ot&ke)===_e}isSymbolicLink(){return(this.#Ot&ve)===ve}lstatCached(){return this.#Ot&Ee?this:undefined}readlinkCached(){return this.#At}realpathCached(){return this.#Ct}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#At)return true;if(!this.parent)return false;const t=this.#Ot&ke;return!(t!==me&&t!==ve||this.#Ot&Fe||this.#Ot&Ce)}calledReaddir(){return!!(this.#Ot&Oe)}isENOENT(){return!!(this.#Ot&Ce)}isNamed(t){return!this.nocase?this.#bt===normalize(t):this.#bt===normalizeNocase(t)}async readlink(){const t=this.#At;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=await this.#et.promises.readlink(this.fullpath());const e=(await this.parent.realpath())?.resolve(t);if(e){return this.#At=e}}catch(t){this.#Pt(t.code);return undefined}}readlinkSync(){const t=this.#At;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=this.#et.readlinkSync(this.fullpath());const e=this.parent.realpathSync()?.resolve(t);if(e){return this.#At=e}}catch(t){this.#Pt(t.code);return undefined}}#Tt(t){this.#Ot|=Oe;for(let e=t.provisional;e<t.length;e++){const i=t[e];if(i)i.#Lt()}}#Lt(){if(this.#Ot&Ce)return;this.#Ot=(this.#Ot|Ce)&xe;this.#Mt()}#Mt(){const t=this.children();t.provisional=0;for(const e of t){e.#Lt()}}#Rt(){this.#Ot|=Pe;this.#Dt()}#Dt(){if(this.#Ot&Ae)return;let t=this.#Ot;if((t&ke)===we)t&=xe;this.#Ot=t|Ae;this.#Mt()}#Nt(t=""){if(t==="ENOTDIR"||t==="EPERM"){this.#Dt()}else if(t==="ENOENT"){this.#Lt()}else{this.children().provisional=0}}#$t(t=""){if(t==="ENOTDIR"){const t=this.parent;t.#Dt()}else if(t==="ENOENT"){this.#Lt()}}#Pt(t=""){let e=this.#Ot;e|=Fe;if(t==="ENOENT")e|=Ce;if(t==="EINVAL"||t==="UNKNOWN"){e&=xe}this.#Ot=e;if(t==="ENOTDIR"&&this.parent){this.parent.#Dt()}}#jt(t,e){return this.#It(t,e)||this.#Wt(t,e)}#Wt(t,e){const i=entToType(t);const s=this.newChild(t.name,i,{parent:this});const n=s.#Ot&ke;if(n!==we&&n!==ve&&n!==me){s.#Ot|=Ae}e.unshift(s);e.provisional++;return s}#It(t,e){for(let i=e.provisional;i<e.length;i++){const s=e[i];const n=this.nocase?normalizeNocase(t.name):normalize(t.name);if(n!==s.#bt){continue}return this.#Bt(t,s,i,e)}}#Bt(t,e,i,s){const n=e.name;e.#Ot=e.#Ot&xe|entToType(t);if(n!==t.name)e.name=t.name;if(i!==s.provisional){if(i===s.length-1)s.pop();else s.splice(i,1);s.unshift(e)}s.provisional++;return e}async lstat(){if((this.#Ot&Ce)===0){try{this.#zt(await this.#et.promises.lstat(this.fullpath()));return this}catch(t){this.#$t(t.code)}}}lstatSync(){if((this.#Ot&Ce)===0){try{this.#zt(this.#et.lstatSync(this.fullpath()));return this}catch(t){this.#$t(t.code)}}}#zt(t){const{atime:e,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:r,blocks:o,ctime:a,ctimeMs:c,dev:l,gid:h,ino:u,mode:f,mtime:p,mtimeMs:d,nlink:g,rdev:y,size:w,uid:b}=t;this.#mt=e;this.#ut=i;this.#wt=s;this.#dt=n;this.#ct=r;this.#ht=o;this.#yt=a;this.#pt=c;this.#it=l;this.#ot=h;this.#lt=u;this.#st=f;this.#gt=p;this.#ft=d;this.#nt=g;this.#at=y;this.#v=w;this.#rt=b;const S=entToType(t);this.#Ot=this.#Ot&xe|S|Ee;if(S!==me&&S!==we&&S!==ve){this.#Ot|=Ae}}#Ht=[];#Vt=false;#Gt(t){this.#Vt=false;const e=this.#Ht.slice();this.#Ht.length=0;e.forEach((e=>e(null,t)))}readdirCB(t,e=false){if(!this.canReaddir()){if(e)t(null,[]);else queueMicrotask((()=>t(null,[])));return}const i=this.children();if(this.calledReaddir()){const s=i.slice(0,i.provisional);if(e)t(null,s);else queueMicrotask((()=>t(null,s)));return}this.#Ht.push(t);if(this.#Vt){return}this.#Vt=true;const s=this.fullpath();this.#et.readdir(s,{withFileTypes:true},((t,e)=>{if(t){this.#Nt(t.code);i.provisional=0}else{for(const t of e){this.#jt(t,i)}this.#Tt(i)}this.#Gt(i.slice(0,i.provisional));return}))}#Ut;async readdir(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();if(this.#Ut){await this.#Ut}else{let resolve=()=>{};this.#Ut=new Promise((t=>resolve=t));try{for(const i of await this.#et.promises.readdir(e,{withFileTypes:true})){this.#jt(i,t)}this.#Tt(t)}catch(e){this.#Nt(e.code);t.provisional=0}this.#Ut=undefined;resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();try{for(const i of this.#et.readdirSync(e,{withFileTypes:true})){this.#jt(i,t)}this.#Tt(t)}catch(e){this.#Nt(e.code);t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#Ot&Te)return false;const t=ke&this.#Ot;if(!(t===me||t===we||t===ve)){return false}return true}shouldWalk(t,e){return(this.#Ot&we)===we&&!(this.#Ot&Te)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#Ct)return this.#Ct;if((Pe|Fe|Ce)&this.#Ot)return undefined;try{const t=await this.#et.promises.realpath(this.fullpath());return this.#Ct=this.resolve(t)}catch(t){this.#Rt()}}realpathSync(){if(this.#Ct)return this.#Ct;if((Pe|Fe|Ce)&this.#Ot)return undefined;try{const t=this.#et.realpathSync(this.fullpath());return this.#Ct=this.resolve(t)}catch(t){this.#Rt()}}[De](t){if(t===this)return;t.isCWD=false;this.isCWD=true;const e=new Set([]);let i=[];let s=this;while(s&&s.parent){e.add(s);s.#kt=i.join(this.sep);s.#xt=i.join("/");s=s.parent;i.push("..")}s=t;while(s&&s.parent&&!e.has(s)){s.#kt=undefined;s.#xt=undefined;s=s.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=de;constructor(t,e=me,i,s,n,r,o){super(t,e,i,s,n,r,o)}newChild(t,e=me,i={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(t){return z.win32.parse(t).root}getRoot(t){t=uncToDrive(t.toUpperCase());if(t===this.root.name){return this.root}for(const[e,i]of Object.entries(this.roots)){if(this.sameRoot(t,e)){return this.roots[t]=i}}return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){t=t.toUpperCase().replace(/\//g,"\\").replace(pe,"$1\\");return t===e}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=me,i,s,n,r,o){super(t,e,i,s,n,r,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=me,i={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}}class PathScurryBase{root;rootPath;roots;cwd;#qt;#Jt;#Et;nocase;#et;constructor(t=process.cwd(),i,s,{nocase:n,childrenCacheSize:r=16*1024,fs:o=fe}={}){this.#et=fsFromOption(o);if(t instanceof URL||t.startsWith("file://")){t=(0,e.fileURLToPath)(t)}const a=i.resolve(t);this.roots=Object.create(null);this.rootPath=this.parseRootPath(a);this.#qt=new ResolveCache;this.#Jt=new ResolveCache;this.#Et=new ChildrenCache(r);const c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]){c.pop()}if(n===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=n;this.root=this.newRoot(this.#et);this.roots[this.rootPath]=this.root;let l=this.root;let h=c.length-1;const u=i.sep;let f=this.rootPath;let p=false;for(const t of c){const e=h--;l=l.child(t,{relative:new Array(e).fill("..").join(u),relativePosix:new Array(e).fill("..").join("/"),fullpath:f+=(p?"":u)+t});p=true}this.cwd=l}depth(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.depth()}childrenCache(){return this.#Et}resolve(...t){let e="";for(let i=t.length-1;i>=0;i--){const s=t[i];if(!s||s===".")continue;e=e?`${s}/${e}`:s;if(this.isAbsolute(s)){break}}const i=this.#qt.get(e);if(i!==undefined){return i}const s=this.cwd.resolve(e).fullpath();this.#qt.set(e,s);return s}resolvePosix(...t){let e="";for(let i=t.length-1;i>=0;i--){const s=t[i];if(!s||s===".")continue;e=e?`${s}/${e}`:s;if(this.isAbsolute(s)){break}}const i=this.#Jt.get(e);if(i!==undefined){return i}const s=this.cwd.resolve(e).fullpathPosix();this.#Jt.set(e,s);return s}relative(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relative()}relativePosix(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relativePosix()}basename(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.name}dirname(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i}=e;if(!t.canReaddir()){return[]}else{const e=await t.readdir();return i?e:e.map((t=>t.name))}}readdirSync(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true}=e;if(!t.canReaddir()){return[]}else if(i){return t.readdirSync()}else{return t.readdirSync().map((t=>t.name))}}async lstat(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstat()}lstatSync(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=await t.readlink();return e?i:i?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=t.readlinkSync();return e?i:i?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=await t.realpath();return e?i:i?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=t.realpathSync();return e?i:i?.fullpath()}async walk(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=[];if(!n||n(t)){o.push(i?t:t.fullpath())}const a=new Set;const walk=(t,e)=>{a.add(t);t.readdirCB(((t,c)=>{if(t){return e(t)}let l=c.length;if(!l)return e();const next=()=>{if(--l===0){e()}};for(const t of c){if(!n||n(t)){o.push(i?t:t.fullpath())}if(s&&t.isSymbolicLink()){t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(a,r)?walk(t,next):next()))}else{if(t.shouldWalk(a,r)){walk(t,next)}else{next()}}}}),true)};const c=t;return new Promise(((t,e)=>{walk(c,(i=>{if(i)return e(i);t(o)}))}))}walkSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=[];if(!n||n(t)){o.push(i?t:t.fullpath())}const a=new Set([t]);for(const t of a){const e=t.readdirSync();for(const t of e){if(!n||n(t)){o.push(i?t:t.fullpath())}let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,r)){a.add(e)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}return this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;if(!n||n(t)){yield i?t:t.fullpath()}const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){if(!n||n(t)){yield i?t:t.fullpath()}let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(o,r)){o.add(e)}}}}stream(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=new Minipass({objectMode:true});if(!n||n(t)){o.write(i?t:t.fullpath())}const a=new Set;const c=[t];let l=0;const process=()=>{let t=false;while(!t){const e=c.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const onReaddir=(e,u,f=false)=>{if(e)return o.emit("error",e);if(s&&!f){const t=[];for(const e of u){if(e.isSymbolicLink()){t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)))}}if(t.length){Promise.all(t).then((()=>onReaddir(null,u,true)));return}}for(const e of u){if(e&&(!n||n(e))){if(!o.write(i?e:e.fullpath())){t=true}}}l--;for(const t of u){const e=t.realpathCached()||t;if(e.shouldWalk(a,r)){c.push(e)}}if(t&&!o.flowing){o.once("drain",process)}else if(!h){process()}};let h=true;e.readdirCB(onReaddir,true);h=false}};process();return o}streamSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=new Minipass({objectMode:true});const a=new Set;if(!n||n(t)){o.write(i?t:t.fullpath())}const c=[t];let l=0;const process=()=>{let t=false;while(!t){const e=c.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const h=e.readdirSync();for(const e of h){if(!n||n(e)){if(!o.write(i?e:e.fullpath())){t=true}}}l--;for(const t of h){let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,r)){c.push(e)}}}if(t&&!o.flowing)o.once("drain",process)};process();return o}chdir(t=this.cwd){const e=this.cwd;this.cwd=typeof t==="string"?this.cwd.resolve(t):t;this.cwd[De](e)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:i=true}=e;super(t,z.win32,"\\",{...e,nocase:i});this.nocase=i;for(let t=this.cwd;t;t=t.parent){t.nocase=this.nocase}}parseRootPath(t){return z.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,we,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:i=false}=e;super(t,z.posix,"/",{...e,nocase:i});this.nocase=i}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,we,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:i=true}=e;super(t,{...e,nocase:i})}}const Ne=process.platform==="win32"?PathWin32:PathPosix;const $e=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=t=>t.length>=1;const isGlobList=t=>t.length>=1;class Pattern{#Yt;#Kt;#Zt;length;#Qt;#Xt;#te;#ee;#ie;#se;#ne=true;constructor(t,e,i,s){if(!isPatternList(t)){throw new TypeError("empty pattern list")}if(!isGlobList(e)){throw new TypeError("empty glob list")}if(e.length!==t.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=t.length;if(i<0||i>=this.length){throw new TypeError("index out of range")}this.#Yt=t;this.#Kt=e;this.#Zt=i;this.#Qt=s;if(this.#Zt===0){if(this.isUNC()){const[t,e,i,s,...n]=this.#Yt;const[r,o,a,c,...l]=this.#Kt;if(n[0]===""){n.shift();l.shift()}const h=[t,e,i,s,""].join("/");const u=[r,o,a,c,""].join("/");this.#Yt=[h,...n];this.#Kt=[u,...l];this.length=this.#Yt.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#Yt;const[i,...s]=this.#Kt;if(e[0]===""){e.shift();s.shift()}const n=t+"/";const r=i+"/";this.#Yt=[n,...e];this.#Kt=[r,...s];this.length=this.#Yt.length}}}pattern(){return this.#Yt[this.#Zt]}isString(){return typeof this.#Yt[this.#Zt]==="string"}isGlobstar(){return this.#Yt[this.#Zt]===pt}isRegExp(){return this.#Yt[this.#Zt]instanceof RegExp}globString(){return this.#te=this.#te||(this.#Zt===0?this.isAbsolute()?this.#Kt[0]+this.#Kt.slice(1).join("/"):this.#Kt.join("/"):this.#Kt.slice(this.#Zt).join("/"))}hasMore(){return this.length>this.#Zt+1}rest(){if(this.#Xt!==undefined)return this.#Xt;if(!this.hasMore())return this.#Xt=null;this.#Xt=new Pattern(this.#Yt,this.#Kt,this.#Zt+1,this.#Qt);this.#Xt.#se=this.#se;this.#Xt.#ie=this.#ie;this.#Xt.#ee=this.#ee;return this.#Xt}isUNC(){const t=this.#Yt;return this.#ie!==undefined?this.#ie:this.#ie=this.#Qt==="win32"&&this.#Zt===0&&t[0]===""&&t[1]===""&&typeof t[2]==="string"&&!!t[2]&&typeof t[3]==="string"&&!!t[3]}isDrive(){const t=this.#Yt;return this.#ee!==undefined?this.#ee:this.#ee=this.#Qt==="win32"&&this.#Zt===0&&this.length>1&&typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#Yt;return this.#se!==undefined?this.#se:this.#se=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#Yt[0];return typeof t==="string"&&this.isAbsolute()&&this.#Zt===0?t:""}checkFollowGlobstar(){return!(this.#Zt===0||!this.isGlobstar()||!this.#ne)}markFollowGlobstar(){if(this.#Zt===0||!this.isGlobstar()||!this.#ne)return false;this.#ne=false;return true}}const je=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:n,platform:r=je}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=r;this.mmopts={dot:true,nobrace:e,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:r,nocomment:true,nonegate:true};for(const e of t)this.add(e)}add(t){const e=new Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const i=e.set[t];const s=e.globParts[t];if(!i||!s){throw new Error("invalid pattern object")}while(i[0]==="."&&s[0]==="."){i.shift();s.shift()}const n=new Pattern(i,s,0,this.platform);const r=new Minimatch(n.globString(),this.mmopts);const o=s[s.length-1]==="**";const a=n.isAbsolute();if(a)this.absolute.push(r);else this.relative.push(r);if(o){if(a)this.absoluteChildren.push(r);else this.relativeChildren.push(r)}}}ignored(t){const e=t.fullpath();const i=`${e}/`;const s=t.relative()||".";const n=`${s}/`;for(const t of this.relative){if(t.match(s)||t.match(n))return true}for(const t of this.absolute){if(t.match(e)||t.match(i))return true}return false}childrenIgnored(t){const e=t.fullpath()+"/";const i=(t.relative()||".")+"/";for(const t of this.relativeChildren){if(t.match(i))return true}for(const t of this.absoluteChildren){if(t.match(e))return true}return false}}class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const i=t.fullpath();const s=this.store.get(i);if(s)s.add(e.globString());else this.store.set(i,new Set([e.globString()]))}}class MatchRecord{store=new Map;add(t,e,i){const s=(e?2:0)|(i?1:0);const n=this.store.get(t);this.store.set(t,n===undefined?s:s&n)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(e&2),!!(e&1)]))}}class SubWalks{store=new Map;add(t,e){if(!t.canReaddir()){return}const i=this.store.get(t);if(i){if(!i.find((t=>t.globString()===e.globString()))){i.push(e)}}else this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e){throw new Error("attempting to walk unknown path")}return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t;this.follow=!!t.follow;this.dot=!!t.dot;this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const i=e.map((e=>[t,e]));for(let[t,e]of i){this.hasWalkedCache.storeWalked(t,e);const i=e.root();const s=e.isAbsolute()&&this.opts.absolute!==false;if(i){t=t.resolve(i==="/"&&this.opts.root!==undefined?this.opts.root:i);const s=e.rest();if(!s){this.matches.add(t,true,false);continue}else{e=s}}if(t.isENOENT())continue;let n;let r;let o=false;while(typeof(n=e.pattern())==="string"&&(r=e.rest())){const i=t.resolve(n);t=i;e=r;o=true}n=e.pattern();r=e.rest();if(o){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if(typeof n==="string"){const e=n===".."||n===""||n===".";this.matches.add(t.resolve(n),s,e);continue}else if(n===pt){if(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar()){this.subwalks.add(t,e)}const i=r?.pattern();const n=r?.rest();if(!r||(i===""||i===".")&&!n){this.matches.add(t,s,i===""||i===".")}else{if(i===".."){const e=t.parent||t;if(!n)this.matches.add(e,s,true);else if(!this.hasWalkedCache.hasWalked(e,n)){this.subwalks.add(e,n)}}}}else if(n instanceof RegExp){this.subwalks.add(t,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const i=this.subwalks.get(t);const s=this.child();for(const t of e){for(const e of i){const i=e.isAbsolute();const n=e.pattern();const r=e.rest();if(n===pt){s.testGlobstar(t,e,r,i)}else if(n instanceof RegExp){s.testRegExp(t,n,r,i)}else{s.testString(t,n,r,i)}}}return s}testGlobstar(t,e,i,s){if(this.dot||!t.name.startsWith(".")){if(!e.hasMore()){this.matches.add(t,s,false)}if(t.canReaddir()){if(this.follow||!t.isSymbolicLink()){this.subwalks.add(t,e)}else if(t.isSymbolicLink()){if(i&&e.checkFollowGlobstar()){this.subwalks.add(t,i)}else if(e.markFollowGlobstar()){this.subwalks.add(t,e)}}}}if(i){const e=i.pattern();if(typeof e==="string"&&e!==".."&&e!==""&&e!=="."){this.testString(t,e,i.rest(),s)}else if(e===".."){const e=t.parent||t;this.subwalks.add(e,i)}else if(e instanceof RegExp){this.testRegExp(t,e,i.rest(),s)}}}testRegExp(t,e,i,s){if(!e.test(t.name))return;if(!i){this.matches.add(t,s,false)}else{this.subwalks.add(t,i)}}testString(t,e,i,s){if(!t.isNamed(e))return;if(!i){this.matches.add(t,s,false)}else{this.subwalks.add(t,i)}}}const makeIgnore=(t,e)=>typeof t==="string"?new Ignore([t],e):Array.isArray(t)?new Ignore(t,e):t;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#re=[];#oe;#ae;signal;maxDepth;includeChildMatches;constructor(t,e,i){this.patterns=t;this.path=e;this.opts=i;this.#ae=!i.posix&&i.platform==="win32"?"\\":"/";this.includeChildMatches=i.includeChildMatches!==false;if(i.ignore||!this.includeChildMatches){this.#oe=makeIgnore(i.ignore??[],i);if(!this.includeChildMatches&&typeof this.#oe.add!=="function"){const t="cannot ignore child matches, ignore lacks add() method.";throw new Error(t)}}this.maxDepth=i.maxDepth||Infinity;if(i.signal){this.signal=i.signal;this.signal.addEventListener("abort",(()=>{this.#re.length=0}))}}#ce(t){return this.seen.has(t)||!!this.#oe?.ignored?.(t)}#le(t){return!!this.#oe?.childrenIgnored?.(t)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let t=undefined;while(!this.paused&&(t=this.#re.shift())){t()}}onResume(t){if(this.signal?.aborted)return;if(!this.paused){t()}else{this.#re.push(t)}}async matchCheck(t,e){if(e&&this.opts.nodir)return undefined;let i;if(this.opts.realpath){i=t.realpathCached()||await t.realpath();if(!i)return undefined;t=i}const s=t.isUnknown()||this.opts.stat;const n=s?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=await n.realpath();if(t&&(t.isUnknown()||this.opts.stat)){await t.lstat()}}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===Infinity||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#ce(t)?t:undefined}matchCheckSync(t,e){if(e&&this.opts.nodir)return undefined;let i;if(this.opts.realpath){i=t.realpathCached()||t.realpathSync();if(!i)return undefined;t=i}const s=t.isUnknown()||this.opts.stat;const n=s?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=n.realpathSync();if(t&&(t?.isUnknown()||this.opts.stat)){t.lstatSync()}}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#ce(t))return;if(!this.includeChildMatches&&this.#oe?.add){const e=`${t.relativePosix()}/**`;this.#oe.add(e)}const i=this.opts.absolute===undefined?e:this.opts.absolute;this.seen.add(t);const s=this.opts.mark&&t.isDirectory()?this.#ae:"";if(this.opts.withFileTypes){this.matchEmit(t)}else if(i){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+s)}else{const e=this.opts.posix?t.relativePosix():t.relative();const i=this.opts.dotRelative&&!e.startsWith(".."+this.#ae)?"."+this.#ae:"";this.matchEmit(!e?"."+s:i+e+s)}}async match(t,e,i){const s=await this.matchCheck(t,i);if(s)this.matchFinish(s,e)}matchSync(t,e,i){const s=this.matchCheckSync(t,i);if(s)this.matchFinish(s,e)}walkCB(t,e,i){if(this.signal?.aborted)i();this.walkCB2(t,e,new Processor(this.opts),i)}walkCB2(t,e,i,s){if(this.#le(t))return s();if(this.signal?.aborted)s();if(this.paused){this.onResume((()=>this.walkCB2(t,e,i,s)));return}i.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;n++;this.match(t,e,s).then((()=>next()))}for(const t of i.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirCached();if(t.calledReaddir())this.walkCB3(t,e,i,next);else{t.readdirCB(((e,s)=>this.walkCB3(t,s,i,next)),true)}}next()}walkCB3(t,e,i,s){i=i.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;n++;this.match(t,e,s).then((()=>next()))}for(const[t,e]of i.subwalks.entries()){n++;this.walkCB2(t,e,i.child(),next)}next()}walkCBSync(t,e,i){if(this.signal?.aborted)i();this.walkCB2Sync(t,e,new Processor(this.opts),i)}walkCB2Sync(t,e,i,s){if(this.#le(t))return s();if(this.signal?.aborted)s();if(this.paused){this.onResume((()=>this.walkCB2Sync(t,e,i,s)));return}i.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;this.matchSync(t,e,s)}for(const t of i.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirSync();this.walkCB3Sync(t,e,i,next)}next()}walkCB3Sync(t,e,i,s){i=i.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;this.matchSync(t,e,s)}for(const[t,e]of i.subwalks.entries()){n++;this.walkCB2Sync(t,e,i.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,i){super(t,e,i)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){e(this.signal.reason)}else{t(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(t,e,i){super(t,e,i);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t);if(!this.results.flowing)this.pause()}stream(){const t=this.path;if(t.isUnknown()){t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(t,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const Ie=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,i){if(!i)throw new TypeError("glob options required");this.withFileTypes=!!i.withFileTypes;this.signal=i.signal;this.follow=!!i.follow;this.dot=!!i.dot;this.dotRelative=!!i.dotRelative;this.nodir=!!i.nodir;this.mark=!!i.mark;if(!i.cwd){this.cwd=""}else if(i.cwd instanceof URL||i.cwd.startsWith("file://")){i.cwd=(0,e.fileURLToPath)(i.cwd)}this.cwd=i.cwd||"";this.root=i.root;this.magicalBraces=!!i.magicalBraces;this.nobrace=!!i.nobrace;this.noext=!!i.noext;this.realpath=!!i.realpath;this.absolute=i.absolute;this.includeChildMatches=i.includeChildMatches!==false;this.noglobstar=!!i.noglobstar;this.matchBase=!!i.matchBase;this.maxDepth=typeof i.maxDepth==="number"?i.maxDepth:Infinity;this.stat=!!i.stat;this.ignore=i.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof t==="string"){t=[t]}this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){t=t.map((t=>t.replace(/\\/g,"/")))}if(this.matchBase){if(i.noglobstar){throw new TypeError("base matching requires globstar")}t=t.map((t=>t.includes("/")?t:`./**/${t}`))}this.pattern=t;this.platform=i.platform||Ie;this.opts={...i,platform:this.platform};if(i.scurry){this.scurry=i.scurry;if(i.nocase!==undefined&&i.nocase!==i.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const t=i.platform==="win32"?PathScurryWin32:i.platform==="darwin"?PathScurryDarwin:i.platform?PathScurryPosix:$e;this.scurry=new t(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const n={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const r=this.pattern.map((t=>new Minimatch(t,n)));const[o,a]=r.reduce(((t,e)=>{t[0].push(...e.set);t[1].push(...e.globParts);return t}),[[],[]]);this.patterns=o.map(((t,e)=>{const i=a[e];if(!i)throw new Error("invalid pattern object");return new Pattern(t,i,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(t,e={})=>{if(!Array.isArray(t)){t=[t]}for(const i of t){if(new Minimatch(i,e).hasMagic())return true}return false};function globStreamSync(t,e={}){return new Glob(t,e).streamSync()}function globStream(t,e={}){return new Glob(t,e).stream()}function globSync(t,e={}){return new Glob(t,e).walkSync()}async function glob_(t,e={}){return new Glob(t,e).walk()}function globIterateSync(t,e={}){return new Glob(t,e).iterateSync()}function globIterate(t,e={}){return new Glob(t,e).iterate()}const We=globStreamSync;const Be=Object.assign(globStream,{sync:globStreamSync});const ze=globIterateSync;const He=Object.assign(globIterate,{sync:globIterateSync});const Ve=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Ge=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:Ve,globStream:globStream,stream:Be,globStreamSync:globStreamSync,streamSync:We,globIterate:globIterate,iterate:He,globIterateSync:globIterateSync,iterateSync:ze,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Ge.glob=Ge;const Ue=(0,U.createRequire)(import.meta.url);const{$:qe,cd:Je}=Ue("zx");let Ye=false;async function runAsync(t,e,i){qe.verbose=i?.verbose??Ye;if(i?.cwd){Je(i.cwd)}return await(qe`${t} ${e}`)}async function setDefaultVerbose(t){Ye=t}const Ke=(0,U.createRequire)(import.meta.url);const{default:Ze}=Ke("@expo/json-file");let Qe=null;const Xe=["@expo/fingerprint","create-expo","eslint-config-universe","expo-dev-client-components","expo-doctor","expo-env-info","expo-face-detector","expo-module-scripts","expo-module-template","expo-module-template-local","expo-test-runner","install-expo-modules","pod-install","uri-scheme","patch-project","create-expo-module","create-expo-nightly","@react-native-community/cli-platform-android","react","react-dom"];const ti=["@react-native/assets-registry","@react-native/dev-middleware","@react-native/babel-preset","react-native"];async function addWorkspacePackagesToAppAsync(t,e){const i=await Ze.readAsync(H().join(t,"package.json"));const s=i.dependencies??{};for(const t of e){s[t.name]="workspace:*"}await Ze.mergeAsync(H().join(t,"package.json"),{dependencies:s})}async function reinstallPackagesAsync(t){await Promise.all([Ft().rm(H().join(t,"node_modules"),{recursive:true,force:true}),Ft().rm(H().join(t,"bun.lockb"),{force:true}),Ft().rm(H().join(t,"yarn.lock"),{force:true})]);await runAsync("bun",["install","--ignore-scripts"],{cwd:t})}async function getExpoPackagesAsync(t){if(Qe!=null){return Qe}const e=await Ge("**/package.json",{cwd:H().join(t,"packages"),ignore:["**/example/**","**/node_modules/**","**/__tests__/**","**/__mocks__/**","**/__fixtures__/**","**/e2e/**","**/build/**"]});const i=(await Promise.all(e.map((async e=>{const i=H().join(t,"packages",H().dirname(e));return await createPackageAsync(i)})))).filter((t=>t!=null));Qe=i.sort(((t,e)=>t.name.localeCompare(e.name)));return Qe}async function getReactNativeTransitivePackagesAsync(t){const e=await Promise.all(ti.map((e=>{const i=path.join(t,"node_modules",e);return Promise.resolve({name:e,path:i})})));return e}async function createPackageAsync(t){const e=H().join(t,"package.json");const i=H().dirname(e);const s=await Ze.readAsync(e);const n=s.name;if(Xe.includes(n)){return null}return{name:n,path:i}}const ei=(0,U.createRequire)(import.meta.url);const{default:ii}=ei("@expo/json-file");async function setupExpoRepoAsync(t,e,i){let s;const n=e&&await G().pathExists(e);if(!n){s=H().join(t,"expo");console.log(`Cloning expo repository to ${s}`);console.time("Cloned expo repository");await runAsync("git",["clone","--depth=1","https://github.com/expo/expo.git",H().basename(s)],{cwd:H().dirname(s)});console.timeEnd("Cloned expo repository")}else{s=e}console.log(`Running \`yarn install\` in ${s}`);console.time("Installed dependencies in expo repository");await setupDependenciesAsync(s,i);await runAsync("yarn",["install"],{cwd:s});console.timeEnd("Installed dependencies in expo repository");return s}async function packExpoBareTemplateTarballAsync(t,e){await G().ensureDir(e);const{stdout:i}=await runAsync("npm",["pack","--json","--pack-destination",e],{cwd:H().join(t,"templates","expo-template-bare-minimum")});const s=JSON.parse(i);const n=s[0].filename;return H().join(e,n)}async function setupDependenciesAsync(t,e){const i=H().join(t,"package.json");const s=await ii.readAsync(i);const n=s.resolutions??{};for(const t of ti){n[t]=`${e}`}await ii.mergeAsync(i,{resolutions:n})}async function getNpmVersionAsync(t,e){const{stdout:i}=await runAsync("npm",["view",`${t}@${e}`,"version"]);return i.trim()}const si=t(import.meta.url)("node:assert");var ni=__nccwpck_require__.n(si);const ri=(0,U.createRequire)(import.meta.url);const{default:oi}=ri("@expo/json-file");async function createExpoApp(t,e){const i=e.template??"blank-typescript";const s=e.templateVersion??"canary";if(await G().pathExists(t)){throw new Error(`Project already exists at ${t}`)}await runAsync("bunx",["create-expo-app",t,"--no-install",`--template`,`${i}@${s}`]);const n=await setupExpoRepoAsync(t,e.useExpoRepoPath,e.nightlyVersion);await setupProjectPackageJsonAsync(t,n,e.nightlyVersion);await setupMetroConfigAsync(t,n);await setupAppJsonAsync(t,{appId:e.appId,newArchEnabled:e.newArchEnabled});return n}async function setupProjectPackageJsonAsync(t,e,i){const s=H().join(t,"package.json");const n=await oi.readAsync(s);const r=n.scripts??{};r["postinstall"]="bun --cwd expo postinstall";let o;const a=H().relative(t,e);if(a.startsWith("..")){o=e}else{o=a}const c=n.resolutions??{};for(const t of ti){c[t]=`${i}`}await oi.mergeAsync(s,{workspaces:[`${o}/packages/*`,`${o}/packages/@expo/*`],expo:{autolinking:{exclude:["expo-face-detector","expo-module-template","expo-module-template-local"]}},resolutions:c,scripts:r})}async function setupMetroConfigAsync(t,e){await G().writeFile(H().join(t,"metro.config.js"),`const { getDefaultConfig } = require('expo/metro-config');\n\n/** @type {import('expo/metro-config').MetroConfig} */\nconst config = getDefaultConfig(__dirname);\n\nconfig.watchFolders = [\n ...config.watchFolders ?? [],\n __dirname,\n '${e}',\n];\n\nconfig.resolver.nodeModulesPaths = [\n ...config.resolver.nodeModulesPaths ?? [],\n '${e}/node_modules',\n];\n\nmodule.exports = config;`)}async function prebuildAppAsync(t,e){await runAsync("npx",["expo","prebuild","--no-install","--template",e],{cwd:t})}async function installCocoaPodsAsync(t){await runAsync("pod",["install"],{cwd:H().join(t,"ios")})}async function setupAppJsonAsync(t,{appId:e,newArchEnabled:i}){const s=H().join(t,"app.json");const n=await oi.readAsync(s);const r=n.expo;ni()(isJSONObject(r));const o=r.android??{};const a=r.ios??{};ni()(isJSONObject(o));ni()(isJSONObject(a));o.package=e;a.bundleIdentifier=e;const c=r.plugins??[];ni()(isJSONArray(c));r.runtimeVersion="1.0.0";r.android=o;r.ios=a;r.plugins=c;r.newArchEnabled=i;await oi.writeAsync(s,n)}function isJSONObject(t){return t!=null&&typeof t==="object"&&!Array.isArray(t)}function isJSONArray(t){return t!=null&&Array.isArray(t)}const ai=(0,U.createRequire)(import.meta.url);const{which:ci}=ai("zx");async function checkRequiredToolsAsync(t){const e=await Promise.all(t.map((t=>ci(t,{nothrow:true}))));for(const[i,s]of e.entries()){if(!s){throw new Error(`Missing required tool: ${t[i]}`)}}}const li=JSON.parse('{"u2":"create-expo-nightly","i8":"0.0.9"}');const hi=new j(li.u2).version(li.i8).description("Create an app for react-native nightlies testing.").argument("[path]","The output path for the app.",".").option("--name <name>","The name of the app to create.","test-nightlies").option("--expo-repo <path>",'The path to the expo repository. (default: Cloning to the "expo" directory in the output app)').option("-v, --verbose","Verbose output.").option("--app-id <name>","The Android applicationId and iOS bundleIdentifier.","dev.expo.testnightlies").option("--no-install","Skip installing CocoaPods.").option("--enable-new-architecture","Enable the New Architecture mode.").parse(process.argv);async function src_runAsync(t){const e=hi.opts();setDefaultVerbose(!!e.verbose);await checkRequiredToolsAsync(["bun","git","npm","yarn"]);const i=e.name;const s=H().join(H().resolve(hi.args[0]||"."),i);const n=await getNpmVersionAsync("react-native","nightly");const r={appId:e.appId,newArchEnabled:!!e.enableNewArchitecture,nightlyVersion:n,useExpoRepoPath:e.expoRepo};console.log(F.cyan(`Setting up app at ${F.bold(s)} with ${F.bold("react-native@"+n)}`));const o=await createExpoApp(s,r);const a=await getExpoPackagesAsync(o);await addWorkspacePackagesToAppAsync(s,a);console.log(F.cyan(`Reinstalling packages`));await reinstallPackagesAsync(s);console.log(F.cyan(`Running prebuild`));const c=await packExpoBareTemplateTarballAsync(o,H().join(s,".expo"));await prebuildAppAsync(s,c);if(e.install){if(process.platform==="darwin"){await checkRequiredToolsAsync(["pod"]);console.log(`Installing CocoaPods dependencies`);console.time("Installed CocoaPods dependencies");await installCocoaPodsAsync(s);console.timeEnd("Installed CocoaPods dependencies")}}}(async()=>{hi.parse(process.argv);try{await src_runAsync(li.u2)}catch(t){console.error("Uncaught Error",t);process.exit(1)}})()})();
|
|
2
|
+
import{createRequire as t}from"module";var e={3353:t=>{t.exports=balanced;function balanced(t,e,i){if(t instanceof RegExp)t=maybeMatch(t,i);if(e instanceof RegExp)e=maybeMatch(e,i);var s=range(t,e,i);return s&&{start:s[0],end:s[1],pre:i.slice(0,s[0]),body:i.slice(s[0]+t.length,s[1]),post:i.slice(s[1]+e.length)}}function maybeMatch(t,e){var i=e.match(t);return i?i[0]:null}balanced.range=range;function range(t,e,i){var s,n,r,o,a;var c=i.indexOf(t);var l=i.indexOf(e,c+1);var h=c;if(c>=0&&l>0){if(t===e){return[c,l]}s=[];r=i.length;while(h>=0&&!a){if(h==c){s.push(h);c=i.indexOf(t,h+1)}else if(s.length==1){a=[s.pop(),l]}else{n=s.pop();if(n<r){r=n;o=l}l=i.indexOf(e,h+1)}h=c<l&&c>=0?c:l}if(s.length){a=[r,o]}}return a}},2297:(t,e,i)=>{var s=i(3353);t.exports=expandTop;var n="\0SLASH"+Math.random()+"\0";var r="\0OPEN"+Math.random()+"\0";var o="\0CLOSE"+Math.random()+"\0";var a="\0COMMA"+Math.random()+"\0";var c="\0PERIOD"+Math.random()+"\0";function numeric(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function escapeBraces(t){return t.split("\\\\").join(n).split("\\{").join(r).split("\\}").join(o).split("\\,").join(a).split("\\.").join(c)}function unescapeBraces(t){return t.split(n).join("\\").split(r).join("{").split(o).join("}").split(a).join(",").split(c).join(".")}function parseCommaParts(t){if(!t)return[""];var e=[];var i=s("{","}",t);if(!i)return t.split(",");var n=i.pre;var r=i.body;var o=i.post;var a=n.split(",");a[a.length-1]+="{"+r+"}";var c=parseCommaParts(o);if(o.length){a[a.length-1]+=c.shift();a.push.apply(a,c)}e.push.apply(e,a);return e}function expandTop(t){if(!t)return[];if(t.substr(0,2)==="{}"){t="\\{\\}"+t.substr(2)}return expand(escapeBraces(t),true).map(unescapeBraces)}function embrace(t){return"{"+t+"}"}function isPadded(t){return/^-?0\d/.test(t)}function lte(t,e){return t<=e}function gte(t,e){return t>=e}function expand(t,e){var i=[];var n=s("{","}",t);if(!n)return[t];var r=n.pre;var a=n.post.length?expand(n.post,false):[""];if(/\$$/.test(n.pre)){for(var c=0;c<a.length;c++){var l=r+"{"+n.body+"}"+a[c];i.push(l)}}else{var h=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(n.body);var u=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(n.body);var f=h||u;var p=n.body.indexOf(",")>=0;if(!f&&!p){if(n.post.match(/,.*\}/)){t=n.pre+"{"+n.body+o+n.post;return expand(t)}return[t]}var d;if(f){d=n.body.split(/\.\./)}else{d=parseCommaParts(n.body);if(d.length===1){d=expand(d[0],false).map(embrace);if(d.length===1){return a.map((function(t){return n.pre+d[0]+t}))}}}var g;if(f){var y=numeric(d[0]);var w=numeric(d[1]);var b=Math.max(d[0].length,d[1].length);var S=d.length==3?Math.abs(numeric(d[2])):1;var v=lte;var _=w<y;if(_){S*=-1;v=gte}var k=d.some(isPadded);g=[];for(var x=y;v(x,w);x+=S){var O;if(u){O=String.fromCharCode(x);if(O==="\\")O=""}else{O=String(x);if(k){var E=b-O.length;if(E>0){var A=new Array(E+1).join("0");if(x<0)O="-"+A+O.slice(1);else O=A+O}}}g.push(O)}}else{g=[];for(var C=0;C<d.length;C++){g.push.apply(g,expand(d[C],false))}}for(var C=0;C<g.length;C++){for(var c=0;c<a.length;c++){var l=r+g[C]+a[c];if(!e||f||l)i.push(l)}}}return i}},9132:t=>{t.exports=clone;var e=Object.getPrototypeOf||function(t){return t.__proto__};function clone(t){if(t===null||typeof t!=="object")return t;if(t instanceof Object)var i={__proto__:e(t)};else var i=Object.create(null);Object.getOwnPropertyNames(t).forEach((function(e){Object.defineProperty(i,e,Object.getOwnPropertyDescriptor(t,e))}));return i}},552:(t,e,i)=>{var s=i(7147);var n=i(1290);var r=i(4410);var o=i(9132);var a=i(3837);var c;var l;if(typeof Symbol==="function"&&typeof Symbol.for==="function"){c=Symbol.for("graceful-fs.queue");l=Symbol.for("graceful-fs.previous")}else{c="___graceful-fs.queue";l="___graceful-fs.previous"}function noop(){}function publishQueue(t,e){Object.defineProperty(t,c,{get:function(){return e}})}var h=noop;if(a.debuglog)h=a.debuglog("gfs4");else if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||""))h=function(){var t=a.format.apply(a,arguments);t="GFS4: "+t.split(/\n/).join("\nGFS4: ");console.error(t)};if(!s[c]){var u=global[c]||[];publishQueue(s,u);s.close=function(t){function close(e,i){return t.call(s,e,(function(t){if(!t){resetQueue()}if(typeof i==="function")i.apply(this,arguments)}))}Object.defineProperty(close,l,{value:t});return close}(s.close);s.closeSync=function(t){function closeSync(e){t.apply(s,arguments);resetQueue()}Object.defineProperty(closeSync,l,{value:t});return closeSync}(s.closeSync);if(/\bgfs4\b/i.test(process.env.NODE_DEBUG||"")){process.on("exit",(function(){h(s[c]);i(9491).equal(s[c].length,0)}))}}if(!global[c]){publishQueue(global,s[c])}t.exports=patch(o(s));if(process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH&&!s.__patched){t.exports=patch(s);s.__patched=true}function patch(t){n(t);t.gracefulify=patch;t.createReadStream=createReadStream;t.createWriteStream=createWriteStream;var e=t.readFile;t.readFile=readFile;function readFile(t,i,s){if(typeof i==="function")s=i,i=null;return go$readFile(t,i,s);function go$readFile(t,i,s,n){return e(t,i,(function(e){if(e&&(e.code==="EMFILE"||e.code==="ENFILE"))enqueue([go$readFile,[t,i,s],e,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var i=t.writeFile;t.writeFile=writeFile;function writeFile(t,e,s,n){if(typeof s==="function")n=s,s=null;return go$writeFile(t,e,s,n);function go$writeFile(t,e,s,n,r){return i(t,e,s,(function(i){if(i&&(i.code==="EMFILE"||i.code==="ENFILE"))enqueue([go$writeFile,[t,e,s,n],i,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var s=t.appendFile;if(s)t.appendFile=appendFile;function appendFile(t,e,i,n){if(typeof i==="function")n=i,i=null;return go$appendFile(t,e,i,n);function go$appendFile(t,e,i,n,r){return s(t,e,i,(function(s){if(s&&(s.code==="EMFILE"||s.code==="ENFILE"))enqueue([go$appendFile,[t,e,i,n],s,r||Date.now(),Date.now()]);else{if(typeof n==="function")n.apply(this,arguments)}}))}}var o=t.copyFile;if(o)t.copyFile=copyFile;function copyFile(t,e,i,s){if(typeof i==="function"){s=i;i=0}return go$copyFile(t,e,i,s);function go$copyFile(t,e,i,s,n){return o(t,e,i,(function(r){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$copyFile,[t,e,i,s],r,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}var a=t.readdir;t.readdir=readdir;var c=/^v[0-5]\./;function readdir(t,e,i){if(typeof e==="function")i=e,e=null;var s=c.test(process.version)?function go$readdir(t,e,i,s){return a(t,fs$readdirCallback(t,e,i,s))}:function go$readdir(t,e,i,s){return a(t,e,fs$readdirCallback(t,e,i,s))};return s(t,e,i);function fs$readdirCallback(t,e,i,n){return function(r,o){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([s,[t,e,i],r,n||Date.now(),Date.now()]);else{if(o&&o.sort)o.sort();if(typeof i==="function")i.call(this,r,o)}}}}if(process.version.substr(0,4)==="v0.8"){var l=r(t);ReadStream=l.ReadStream;WriteStream=l.WriteStream}var h=t.ReadStream;if(h){ReadStream.prototype=Object.create(h.prototype);ReadStream.prototype.open=ReadStream$open}var u=t.WriteStream;if(u){WriteStream.prototype=Object.create(u.prototype);WriteStream.prototype.open=WriteStream$open}Object.defineProperty(t,"ReadStream",{get:function(){return ReadStream},set:function(t){ReadStream=t},enumerable:true,configurable:true});Object.defineProperty(t,"WriteStream",{get:function(){return WriteStream},set:function(t){WriteStream=t},enumerable:true,configurable:true});var f=ReadStream;Object.defineProperty(t,"FileReadStream",{get:function(){return f},set:function(t){f=t},enumerable:true,configurable:true});var p=WriteStream;Object.defineProperty(t,"FileWriteStream",{get:function(){return p},set:function(t){p=t},enumerable:true,configurable:true});function ReadStream(t,e){if(this instanceof ReadStream)return h.apply(this,arguments),this;else return ReadStream.apply(Object.create(ReadStream.prototype),arguments)}function ReadStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,i){if(e){if(t.autoClose)t.destroy();t.emit("error",e)}else{t.fd=i;t.emit("open",i);t.read()}}))}function WriteStream(t,e){if(this instanceof WriteStream)return u.apply(this,arguments),this;else return WriteStream.apply(Object.create(WriteStream.prototype),arguments)}function WriteStream$open(){var t=this;open(t.path,t.flags,t.mode,(function(e,i){if(e){t.destroy();t.emit("error",e)}else{t.fd=i;t.emit("open",i)}}))}function createReadStream(e,i){return new t.ReadStream(e,i)}function createWriteStream(e,i){return new t.WriteStream(e,i)}var d=t.open;t.open=open;function open(t,e,i,s){if(typeof i==="function")s=i,i=null;return go$open(t,e,i,s);function go$open(t,e,i,s,n){return d(t,e,i,(function(r,o){if(r&&(r.code==="EMFILE"||r.code==="ENFILE"))enqueue([go$open,[t,e,i,s],r,n||Date.now(),Date.now()]);else{if(typeof s==="function")s.apply(this,arguments)}}))}}return t}function enqueue(t){h("ENQUEUE",t[0].name,t[1]);s[c].push(t);retry()}var f;function resetQueue(){var t=Date.now();for(var e=0;e<s[c].length;++e){if(s[c][e].length>2){s[c][e][3]=t;s[c][e][4]=t}}retry()}function retry(){clearTimeout(f);f=undefined;if(s[c].length===0)return;var t=s[c].shift();var e=t[0];var i=t[1];var n=t[2];var r=t[3];var o=t[4];if(r===undefined){h("RETRY",e.name,i);e.apply(null,i)}else if(Date.now()-r>=6e4){h("TIMEOUT",e.name,i);var a=i.pop();if(typeof a==="function")a.call(null,n)}else{var l=Date.now()-o;var u=Math.max(o-r,1);var p=Math.min(u*1.2,100);if(l>=p){h("RETRY",e.name,i);e.apply(null,i.concat([r]))}else{s[c].push(t)}}if(f===undefined){f=setTimeout(retry,0)}}},4410:(t,e,i)=>{var s=i(2781).Stream;t.exports=legacy;function legacy(t){return{ReadStream:ReadStream,WriteStream:WriteStream};function ReadStream(e,i){if(!(this instanceof ReadStream))return new ReadStream(e,i);s.call(this);var n=this;this.path=e;this.fd=null;this.readable=true;this.paused=false;this.flags="r";this.mode=438;this.bufferSize=64*1024;i=i||{};var r=Object.keys(i);for(var o=0,a=r.length;o<a;o++){var c=r[o];this[c]=i[c]}if(this.encoding)this.setEncoding(this.encoding);if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.end===undefined){this.end=Infinity}else if("number"!==typeof this.end){throw TypeError("end must be a Number")}if(this.start>this.end){throw new Error("start must be <= end")}this.pos=this.start}if(this.fd!==null){process.nextTick((function(){n._read()}));return}t.open(this.path,this.flags,this.mode,(function(t,e){if(t){n.emit("error",t);n.readable=false;return}n.fd=e;n.emit("open",e);n._read()}))}function WriteStream(e,i){if(!(this instanceof WriteStream))return new WriteStream(e,i);s.call(this);this.path=e;this.fd=null;this.writable=true;this.flags="w";this.encoding="binary";this.mode=438;this.bytesWritten=0;i=i||{};var n=Object.keys(i);for(var r=0,o=n.length;r<o;r++){var a=n[r];this[a]=i[a]}if(this.start!==undefined){if("number"!==typeof this.start){throw TypeError("start must be a Number")}if(this.start<0){throw new Error("start must be >= zero")}this.pos=this.start}this.busy=false;this._queue=[];if(this.fd===null){this._open=t.open;this._queue.push([this._open,this.path,this.flags,this.mode,undefined]);this.flush()}}}},1290:(t,e,i)=>{var s=i(2057);var n=process.cwd;var r=null;var o=process.env.GRACEFUL_FS_PLATFORM||process.platform;process.cwd=function(){if(!r)r=n.call(process);return r};try{process.cwd()}catch(t){}if(typeof process.chdir==="function"){var a=process.chdir;process.chdir=function(t){r=null;a.call(process,t)};if(Object.setPrototypeOf)Object.setPrototypeOf(process.chdir,a)}t.exports=patch;function patch(t){if(s.hasOwnProperty("O_SYMLINK")&&process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)){patchLchmod(t)}if(!t.lutimes){patchLutimes(t)}t.chown=chownFix(t.chown);t.fchown=chownFix(t.fchown);t.lchown=chownFix(t.lchown);t.chmod=chmodFix(t.chmod);t.fchmod=chmodFix(t.fchmod);t.lchmod=chmodFix(t.lchmod);t.chownSync=chownFixSync(t.chownSync);t.fchownSync=chownFixSync(t.fchownSync);t.lchownSync=chownFixSync(t.lchownSync);t.chmodSync=chmodFixSync(t.chmodSync);t.fchmodSync=chmodFixSync(t.fchmodSync);t.lchmodSync=chmodFixSync(t.lchmodSync);t.stat=statFix(t.stat);t.fstat=statFix(t.fstat);t.lstat=statFix(t.lstat);t.statSync=statFixSync(t.statSync);t.fstatSync=statFixSync(t.fstatSync);t.lstatSync=statFixSync(t.lstatSync);if(t.chmod&&!t.lchmod){t.lchmod=function(t,e,i){if(i)process.nextTick(i)};t.lchmodSync=function(){}}if(t.chown&&!t.lchown){t.lchown=function(t,e,i,s){if(s)process.nextTick(s)};t.lchownSync=function(){}}if(o==="win32"){t.rename=typeof t.rename!=="function"?t.rename:function(e){function rename(i,s,n){var r=Date.now();var o=0;e(i,s,(function CB(a){if(a&&(a.code==="EACCES"||a.code==="EPERM"||a.code==="EBUSY")&&Date.now()-r<6e4){setTimeout((function(){t.stat(s,(function(t,r){if(t&&t.code==="ENOENT")e(i,s,CB);else n(a)}))}),o);if(o<100)o+=10;return}if(n)n(a)}))}if(Object.setPrototypeOf)Object.setPrototypeOf(rename,e);return rename}(t.rename)}t.read=typeof t.read!=="function"?t.read:function(e){function read(i,s,n,r,o,a){var c;if(a&&typeof a==="function"){var l=0;c=function(h,u,f){if(h&&h.code==="EAGAIN"&&l<10){l++;return e.call(t,i,s,n,r,o,c)}a.apply(this,arguments)}}return e.call(t,i,s,n,r,o,c)}if(Object.setPrototypeOf)Object.setPrototypeOf(read,e);return read}(t.read);t.readSync=typeof t.readSync!=="function"?t.readSync:function(e){return function(i,s,n,r,o){var a=0;while(true){try{return e.call(t,i,s,n,r,o)}catch(t){if(t.code==="EAGAIN"&&a<10){a++;continue}throw t}}}}(t.readSync);function patchLchmod(t){t.lchmod=function(e,i,n){t.open(e,s.O_WRONLY|s.O_SYMLINK,i,(function(e,s){if(e){if(n)n(e);return}t.fchmod(s,i,(function(e){t.close(s,(function(t){if(n)n(e||t)}))}))}))};t.lchmodSync=function(e,i){var n=t.openSync(e,s.O_WRONLY|s.O_SYMLINK,i);var r=true;var o;try{o=t.fchmodSync(n,i);r=false}finally{if(r){try{t.closeSync(n)}catch(t){}}else{t.closeSync(n)}}return o}}function patchLutimes(t){if(s.hasOwnProperty("O_SYMLINK")&&t.futimes){t.lutimes=function(e,i,n,r){t.open(e,s.O_SYMLINK,(function(e,s){if(e){if(r)r(e);return}t.futimes(s,i,n,(function(e){t.close(s,(function(t){if(r)r(e||t)}))}))}))};t.lutimesSync=function(e,i,n){var r=t.openSync(e,s.O_SYMLINK);var o;var a=true;try{o=t.futimesSync(r,i,n);a=false}finally{if(a){try{t.closeSync(r)}catch(t){}}else{t.closeSync(r)}}return o}}else if(t.futimes){t.lutimes=function(t,e,i,s){if(s)process.nextTick(s)};t.lutimesSync=function(){}}}function chmodFix(e){if(!e)return e;return function(i,s,n){return e.call(t,i,s,(function(t){if(chownErOk(t))t=null;if(n)n.apply(this,arguments)}))}}function chmodFixSync(e){if(!e)return e;return function(i,s){try{return e.call(t,i,s)}catch(t){if(!chownErOk(t))throw t}}}function chownFix(e){if(!e)return e;return function(i,s,n,r){return e.call(t,i,s,n,(function(t){if(chownErOk(t))t=null;if(r)r.apply(this,arguments)}))}}function chownFixSync(e){if(!e)return e;return function(i,s,n){try{return e.call(t,i,s,n)}catch(t){if(!chownErOk(t))throw t}}}function statFix(e){if(!e)return e;return function(i,s,n){if(typeof s==="function"){n=s;s=null}function callback(t,e){if(e){if(e.uid<0)e.uid+=4294967296;if(e.gid<0)e.gid+=4294967296}if(n)n.apply(this,arguments)}return s?e.call(t,i,s,callback):e.call(t,i,callback)}}function statFixSync(e){if(!e)return e;return function(i,s){var n=s?e.call(t,i,s):e.call(t,i);if(n){if(n.uid<0)n.uid+=4294967296;if(n.gid<0)n.gid+=4294967296}return n}}function chownErOk(t){if(!t)return true;if(t.code==="ENOSYS")return true;var e=!process.getuid||process.getuid()!==0;if(e){if(t.code==="EINVAL"||t.code==="EPERM")return true}return false}}},1215:(t,e,i)=>{let s;try{s=i(552)}catch(t){s=i(7147)}const n=i(2703);const{stringify:r,stripBom:o}=i(4978);async function _readFile(t,e={}){if(typeof e==="string"){e={encoding:e}}const i=e.fs||s;const r="throws"in e?e.throws:true;let a=await n.fromCallback(i.readFile)(t,e);a=o(a);let c;try{c=JSON.parse(a,e?e.reviver:null)}catch(e){if(r){e.message=`${t}: ${e.message}`;throw e}else{return null}}return c}const a=n.fromPromise(_readFile);function readFileSync(t,e={}){if(typeof e==="string"){e={encoding:e}}const i=e.fs||s;const n="throws"in e?e.throws:true;try{let s=i.readFileSync(t,e);s=o(s);return JSON.parse(s,e.reviver)}catch(e){if(n){e.message=`${t}: ${e.message}`;throw e}else{return null}}}async function _writeFile(t,e,i={}){const o=i.fs||s;const a=r(e,i);await n.fromCallback(o.writeFile)(t,a,i)}const c=n.fromPromise(_writeFile);function writeFileSync(t,e,i={}){const n=i.fs||s;const o=r(e,i);return n.writeFileSync(t,o,i)}const l={readFile:a,readFileSync:readFileSync,writeFile:c,writeFileSync:writeFileSync};t.exports=l},4978:t=>{function stringify(t,{EOL:e="\n",finalEOL:i=true,replacer:s=null,spaces:n}={}){const r=i?e:"";const o=JSON.stringify(t,s,n);return o.replace(/\n/g,e)+r}function stripBom(t){if(Buffer.isBuffer(t))t=t.toString("utf8");return t.replace(/^\uFEFF/,"")}t.exports={stringify:stringify,stripBom:stripBom}},2703:(t,e)=>{e.fromCallback=function(t){return Object.defineProperty((function(...e){if(typeof e[e.length-1]==="function")t.apply(this,e);else{return new Promise(((i,s)=>{t.call(this,...e,((t,e)=>t!=null?s(t):i(e)))}))}}),"name",{value:t.name})};e.fromPromise=function(t){return Object.defineProperty((function(...e){const i=e[e.length-1];if(typeof i!=="function")return t.apply(this,e);else t.apply(this,e.slice(0,-1)).then((t=>i(null,t)),i)}),"name",{value:t.name})}},1085:(t,e,i)=>{const s=i(552);const n=i(1017);const r=i(9181).mkdirsSync;const o=i(8605).utimesMillisSync;const a=i(9783);function copySync(t,e,i){if(typeof i==="function"){i={filter:i}}i=i||{};i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0002")}const{srcStat:o,destStat:c}=a.checkPathsSync(t,e,"copy",i);a.checkParentPathsSync(t,o,e,"copy");if(i.filter&&!i.filter(t,e))return;const l=n.dirname(e);if(!s.existsSync(l))r(l);return getStats(c,t,e,i)}function getStats(t,e,i,n){const r=n.dereference?s.statSync:s.lstatSync;const o=r(e);if(o.isDirectory())return onDir(o,t,e,i,n);else if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,t,e,i,n);else if(o.isSymbolicLink())return onLink(t,e,i,n);else if(o.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);else if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}function onFile(t,e,i,s,n){if(!e)return copyFile(t,i,s,n);return mayCopyFile(t,i,s,n)}function mayCopyFile(t,e,i,n){if(n.overwrite){s.unlinkSync(i);return copyFile(t,e,i,n)}else if(n.errorOnExist){throw new Error(`'${i}' already exists`)}}function copyFile(t,e,i,n){s.copyFileSync(e,i);if(n.preserveTimestamps)handleTimestamps(t.mode,e,i);return setDestMode(i,t.mode)}function handleTimestamps(t,e,i){if(fileIsNotWritable(t))makeFileWritable(i,t);return setDestTimestamps(e,i)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return setDestMode(t,e|128)}function setDestMode(t,e){return s.chmodSync(t,e)}function setDestTimestamps(t,e){const i=s.statSync(t);return o(e,i.atime,i.mtime)}function onDir(t,e,i,s,n){if(!e)return mkDirAndCopy(t.mode,i,s,n);return copyDir(i,s,n)}function mkDirAndCopy(t,e,i,n){s.mkdirSync(i);copyDir(e,i,n);return setDestMode(i,t)}function copyDir(t,e,i){s.readdirSync(t).forEach((s=>copyDirItem(s,t,e,i)))}function copyDirItem(t,e,i,s){const r=n.join(e,t);const o=n.join(i,t);if(s.filter&&!s.filter(r,o))return;const{destStat:c}=a.checkPathsSync(r,o,"copy",s);return getStats(c,r,o,s)}function onLink(t,e,i,r){let o=s.readlinkSync(e);if(r.dereference){o=n.resolve(process.cwd(),o)}if(!t){return s.symlinkSync(o,i)}else{let t;try{t=s.readlinkSync(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return s.symlinkSync(o,i);throw t}if(r.dereference){t=n.resolve(process.cwd(),t)}if(a.isSrcSubdir(o,t)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${t}'.`)}if(a.isSrcSubdir(t,o)){throw new Error(`Cannot overwrite '${t}' with '${o}'.`)}return copyLink(o,i)}}function copyLink(t,e){s.unlinkSync(e);return s.symlinkSync(t,e)}t.exports=copySync},4487:(t,e,i)=>{const s=i(893);const n=i(1017);const{mkdirs:r}=i(9181);const{pathExists:o}=i(5516);const{utimesMillis:a}=i(8605);const c=i(9783);async function copy(t,e,i={}){if(typeof i==="function"){i={filter:i}}i.clobber="clobber"in i?!!i.clobber:true;i.overwrite="overwrite"in i?!!i.overwrite:i.clobber;if(i.preserveTimestamps&&process.arch==="ia32"){process.emitWarning("Using the preserveTimestamps option in 32-bit node is not recommended;\n\n"+"\tsee https://github.com/jprichardson/node-fs-extra/issues/269","Warning","fs-extra-WARN0001")}const{srcStat:s,destStat:a}=await c.checkPaths(t,e,"copy",i);await c.checkParentPaths(t,s,e,"copy");const l=await runFilter(t,e,i);if(!l)return;const h=n.dirname(e);const u=await o(h);if(!u){await r(h)}await getStatsAndPerformCopy(a,t,e,i)}async function runFilter(t,e,i){if(!i.filter)return true;return i.filter(t,e)}async function getStatsAndPerformCopy(t,e,i,n){const r=n.dereference?s.stat:s.lstat;const o=await r(e);if(o.isDirectory())return onDir(o,t,e,i,n);if(o.isFile()||o.isCharacterDevice()||o.isBlockDevice())return onFile(o,t,e,i,n);if(o.isSymbolicLink())return onLink(t,e,i,n);if(o.isSocket())throw new Error(`Cannot copy a socket file: ${e}`);if(o.isFIFO())throw new Error(`Cannot copy a FIFO pipe: ${e}`);throw new Error(`Unknown file: ${e}`)}async function onFile(t,e,i,n,r){if(!e)return copyFile(t,i,n,r);if(r.overwrite){await s.unlink(n);return copyFile(t,i,n,r)}if(r.errorOnExist){throw new Error(`'${n}' already exists`)}}async function copyFile(t,e,i,n){await s.copyFile(e,i);if(n.preserveTimestamps){if(fileIsNotWritable(t.mode)){await makeFileWritable(i,t.mode)}const n=await s.stat(e);await a(i,n.atime,n.mtime)}return s.chmod(i,t.mode)}function fileIsNotWritable(t){return(t&128)===0}function makeFileWritable(t,e){return s.chmod(t,e|128)}async function onDir(t,e,i,r,o){if(!e){await s.mkdir(r)}const a=await s.readdir(i);await Promise.all(a.map((async t=>{const e=n.join(i,t);const s=n.join(r,t);const a=await runFilter(e,s,o);if(!a)return;const{destStat:l}=await c.checkPaths(e,s,"copy",o);return getStatsAndPerformCopy(l,e,s,o)})));if(!e){await s.chmod(r,t.mode)}}async function onLink(t,e,i,r){let o=await s.readlink(e);if(r.dereference){o=n.resolve(process.cwd(),o)}if(!t){return s.symlink(o,i)}let a=null;try{a=await s.readlink(i)}catch(t){if(t.code==="EINVAL"||t.code==="UNKNOWN")return s.symlink(o,i);throw t}if(r.dereference){a=n.resolve(process.cwd(),a)}if(c.isSrcSubdir(o,a)){throw new Error(`Cannot copy '${o}' to a subdirectory of itself, '${a}'.`)}if(c.isSrcSubdir(a,o)){throw new Error(`Cannot overwrite '${a}' with '${o}'.`)}await s.unlink(i);return s.symlink(o,i)}t.exports=copy},8852:(t,e,i)=>{const s=i(2703).fromPromise;t.exports={copy:s(i(4487)),copySync:i(1085)}},2677:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);const r=i(1017);const o=i(9181);const a=i(4879);const c=s((async function emptyDir(t){let e;try{e=await n.readdir(t)}catch{return o.mkdirs(t)}return Promise.all(e.map((e=>a.remove(r.join(t,e)))))}));function emptyDirSync(t){let e;try{e=n.readdirSync(t)}catch{return o.mkdirsSync(t)}e.forEach((e=>{e=r.join(t,e);a.removeSync(e)}))}t.exports={emptyDirSync:emptyDirSync,emptydirSync:emptyDirSync,emptyDir:c,emptydir:c}},2446:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const o=i(9181);async function createFile(t){let e;try{e=await r.stat(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);let s=null;try{s=await r.stat(i)}catch(e){if(e.code==="ENOENT"){await o.mkdirs(i);await r.writeFile(t,"");return}else{throw e}}if(s.isDirectory()){await r.writeFile(t,"")}else{await r.readdir(i)}}function createFileSync(t){let e;try{e=r.statSync(t)}catch{}if(e&&e.isFile())return;const i=n.dirname(t);try{if(!r.statSync(i).isDirectory()){r.readdirSync(i)}}catch(t){if(t&&t.code==="ENOENT")o.mkdirsSync(i);else throw t}r.writeFileSync(t,"")}t.exports={createFile:s(createFile),createFileSync:createFileSync}},6004:(t,e,i)=>{const{createFile:s,createFileSync:n}=i(2446);const{createLink:r,createLinkSync:o}=i(9140);const{createSymlink:a,createSymlinkSync:c}=i(3674);t.exports={createFile:s,createFileSync:n,ensureFile:s,ensureFileSync:n,createLink:r,createLinkSync:o,ensureLink:r,ensureLinkSync:o,createSymlink:a,createSymlinkSync:c,ensureSymlink:a,ensureSymlinkSync:c}},9140:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const o=i(9181);const{pathExists:a}=i(5516);const{areIdentical:c}=i(9783);async function createLink(t,e){let i;try{i=await r.lstat(e)}catch{}let s;try{s=await r.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}if(i&&c(s,i))return;const l=n.dirname(e);const h=await a(l);if(!h){await o.mkdirs(l)}await r.link(t,e)}function createLinkSync(t,e){let i;try{i=r.lstatSync(e)}catch{}try{const e=r.lstatSync(t);if(i&&c(e,i))return}catch(t){t.message=t.message.replace("lstat","ensureLink");throw t}const s=n.dirname(e);const a=r.existsSync(s);if(a)return r.linkSync(t,e);o.mkdirsSync(s);return r.linkSync(t,e)}t.exports={createLink:s(createLink),createLinkSync:createLinkSync}},6522:(t,e,i)=>{const s=i(1017);const n=i(893);const{pathExists:r}=i(5516);const o=i(2703).fromPromise;async function symlinkPaths(t,e){if(s.isAbsolute(t)){try{await n.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:t}}const i=s.dirname(e);const o=s.join(i,t);const a=await r(o);if(a){return{toCwd:o,toDst:t}}try{await n.lstat(t)}catch(t){t.message=t.message.replace("lstat","ensureSymlink");throw t}return{toCwd:t,toDst:s.relative(i,t)}}function symlinkPathsSync(t,e){if(s.isAbsolute(t)){const e=n.existsSync(t);if(!e)throw new Error("absolute srcpath does not exist");return{toCwd:t,toDst:t}}const i=s.dirname(e);const r=s.join(i,t);const o=n.existsSync(r);if(o){return{toCwd:r,toDst:t}}const a=n.existsSync(t);if(!a)throw new Error("relative srcpath does not exist");return{toCwd:t,toDst:s.relative(i,t)}}t.exports={symlinkPaths:o(symlinkPaths),symlinkPathsSync:symlinkPathsSync}},9634:(t,e,i)=>{const s=i(893);const n=i(2703).fromPromise;async function symlinkType(t,e){if(e)return e;let i;try{i=await s.lstat(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}function symlinkTypeSync(t,e){if(e)return e;let i;try{i=s.lstatSync(t)}catch{return"file"}return i&&i.isDirectory()?"dir":"file"}t.exports={symlinkType:n(symlinkType),symlinkTypeSync:symlinkTypeSync}},3674:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(1017);const r=i(893);const{mkdirs:o,mkdirsSync:a}=i(9181);const{symlinkPaths:c,symlinkPathsSync:l}=i(6522);const{symlinkType:h,symlinkTypeSync:u}=i(9634);const{pathExists:f}=i(5516);const{areIdentical:p}=i(9783);async function createSymlink(t,e,i){let s;try{s=await r.lstat(e)}catch{}if(s&&s.isSymbolicLink()){const[i,s]=await Promise.all([r.stat(t),r.stat(e)]);if(p(i,s))return}const a=await c(t,e);t=a.toDst;const l=await h(a.toCwd,i);const u=n.dirname(e);if(!await f(u)){await o(u)}return r.symlink(t,e,l)}function createSymlinkSync(t,e,i){let s;try{s=r.lstatSync(e)}catch{}if(s&&s.isSymbolicLink()){const i=r.statSync(t);const s=r.statSync(e);if(p(i,s))return}const o=l(t,e);t=o.toDst;i=u(o.toCwd,i);const c=n.dirname(e);const h=r.existsSync(c);if(h)return r.symlinkSync(t,e,i);a(c);return r.symlinkSync(t,e,i)}t.exports={createSymlink:s(createSymlink),createSymlinkSync:createSymlinkSync}},893:(t,e,i)=>{const s=i(2703).fromCallback;const n=i(552);const r=["access","appendFile","chmod","chown","close","copyFile","fchmod","fchown","fdatasync","fstat","fsync","ftruncate","futimes","lchmod","lchown","link","lstat","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"].filter((t=>typeof n[t]==="function"));Object.assign(e,n);r.forEach((t=>{e[t]=s(n[t])}));e.exists=function(t,e){if(typeof e==="function"){return n.exists(t,e)}return new Promise((e=>n.exists(t,e)))};e.read=function(t,e,i,s,r,o){if(typeof o==="function"){return n.read(t,e,i,s,r,o)}return new Promise(((o,a)=>{n.read(t,e,i,s,r,((t,e,i)=>{if(t)return a(t);o({bytesRead:e,buffer:i})}))}))};e.write=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.write(t,e,...i)}return new Promise(((s,r)=>{n.write(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesWritten:e,buffer:i})}))}))};e.readv=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.readv(t,e,...i)}return new Promise(((s,r)=>{n.readv(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesRead:e,buffers:i})}))}))};e.writev=function(t,e,...i){if(typeof i[i.length-1]==="function"){return n.writev(t,e,...i)}return new Promise(((s,r)=>{n.writev(t,e,...i,((t,e,i)=>{if(t)return r(t);s({bytesWritten:e,buffers:i})}))}))};if(typeof n.realpath.native==="function"){e.realpath.native=s(n.realpath.native)}else{process.emitWarning("fs.realpath.native is not a function. Is fs being monkey-patched?","Warning","fs-extra-WARN0003")}},5392:(t,e,i)=>{t.exports={...i(893),...i(8852),...i(2677),...i(6004),...i(3960),...i(9181),...i(7819),...i(2546),...i(5516),...i(4879)}},3960:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(2855);n.outputJson=s(i(7583));n.outputJsonSync=i(3719);n.outputJSON=n.outputJson;n.outputJSONSync=n.outputJsonSync;n.writeJSON=n.writeJson;n.writeJSONSync=n.writeJsonSync;n.readJSON=n.readJson;n.readJSONSync=n.readJsonSync;t.exports=n},2855:(t,e,i)=>{const s=i(1215);t.exports={readJson:s.readFile,readJsonSync:s.readFileSync,writeJson:s.writeFile,writeJsonSync:s.writeFileSync}},3719:(t,e,i)=>{const{stringify:s}=i(4978);const{outputFileSync:n}=i(2546);function outputJsonSync(t,e,i){const r=s(e,i);n(t,r,i)}t.exports=outputJsonSync},7583:(t,e,i)=>{const{stringify:s}=i(4978);const{outputFile:n}=i(2546);async function outputJson(t,e,i={}){const r=s(e,i);await n(t,r,i)}t.exports=outputJson},9181:(t,e,i)=>{const s=i(2703).fromPromise;const{makeDir:n,makeDirSync:r}=i(511);const o=s(n);t.exports={mkdirs:o,mkdirsSync:r,mkdirp:o,mkdirpSync:r,ensureDir:o,ensureDirSync:r}},511:(t,e,i)=>{const s=i(893);const{checkPath:n}=i(1176);const getMode=t=>{const e={mode:511};if(typeof t==="number")return t;return{...e,...t}.mode};t.exports.makeDir=async(t,e)=>{n(t);return s.mkdir(t,{mode:getMode(e),recursive:true})};t.exports.makeDirSync=(t,e)=>{n(t);return s.mkdirSync(t,{mode:getMode(e),recursive:true})}},1176:(t,e,i)=>{const s=i(1017);t.exports.checkPath=function checkPath(t){if(process.platform==="win32"){const e=/[<>:"|?*]/.test(t.replace(s.parse(t).root,""));if(e){const e=new Error(`Path contains invalid characters: ${t}`);e.code="EINVAL";throw e}}}},7819:(t,e,i)=>{const s=i(2703).fromPromise;t.exports={move:s(i(4064)),moveSync:i(9079)}},9079:(t,e,i)=>{const s=i(552);const n=i(1017);const r=i(8852).copySync;const o=i(4879).removeSync;const a=i(9181).mkdirpSync;const c=i(9783);function moveSync(t,e,i){i=i||{};const s=i.overwrite||i.clobber||false;const{srcStat:r,isChangingCase:o=false}=c.checkPathsSync(t,e,"move",i);c.checkParentPathsSync(t,r,e,"move");if(!isParentRoot(e))a(n.dirname(e));return doRename(t,e,s,o)}function isParentRoot(t){const e=n.dirname(t);const i=n.parse(e);return i.root===e}function doRename(t,e,i,n){if(n)return rename(t,e,i);if(i){o(e);return rename(t,e,i)}if(s.existsSync(e))throw new Error("dest already exists.");return rename(t,e,i)}function rename(t,e,i){try{s.renameSync(t,e)}catch(s){if(s.code!=="EXDEV")throw s;return moveAcrossDevice(t,e,i)}}function moveAcrossDevice(t,e,i){const s={overwrite:i,errorOnExist:true,preserveTimestamps:true};r(t,e,s);return o(t)}t.exports=moveSync},4064:(t,e,i)=>{const s=i(893);const n=i(1017);const{copy:r}=i(8852);const{remove:o}=i(4879);const{mkdirp:a}=i(9181);const{pathExists:c}=i(5516);const l=i(9783);async function move(t,e,i={}){const s=i.overwrite||i.clobber||false;const{srcStat:r,isChangingCase:o=false}=await l.checkPaths(t,e,"move",i);await l.checkParentPaths(t,r,e,"move");const c=n.dirname(e);const h=n.parse(c);if(h.root!==c){await a(c)}return doRename(t,e,s,o)}async function doRename(t,e,i,n){if(!n){if(i){await o(e)}else if(await c(e)){throw new Error("dest already exists.")}}try{await s.rename(t,e)}catch(s){if(s.code!=="EXDEV"){throw s}await moveAcrossDevice(t,e,i)}}async function moveAcrossDevice(t,e,i){const s={overwrite:i,errorOnExist:true,preserveTimestamps:true};await r(t,e,s);return o(t)}t.exports=move},2546:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);const r=i(1017);const o=i(9181);const a=i(5516).pathExists;async function outputFile(t,e,i="utf-8"){const s=r.dirname(t);if(!await a(s)){await o.mkdirs(s)}return n.writeFile(t,e,i)}function outputFileSync(t,...e){const i=r.dirname(t);if(!n.existsSync(i)){o.mkdirsSync(i)}n.writeFileSync(t,...e)}t.exports={outputFile:s(outputFile),outputFileSync:outputFileSync}},5516:(t,e,i)=>{const s=i(2703).fromPromise;const n=i(893);function pathExists(t){return n.access(t).then((()=>true)).catch((()=>false))}t.exports={pathExists:s(pathExists),pathExistsSync:n.existsSync}},4879:(t,e,i)=>{const s=i(552);const n=i(2703).fromCallback;function remove(t,e){s.rm(t,{recursive:true,force:true},e)}function removeSync(t){s.rmSync(t,{recursive:true,force:true})}t.exports={remove:n(remove),removeSync:removeSync}},9783:(t,e,i)=>{const s=i(893);const n=i(1017);const r=i(2703).fromPromise;function getStats(t,e,i){const n=i.dereference?t=>s.stat(t,{bigint:true}):t=>s.lstat(t,{bigint:true});return Promise.all([n(t),n(e).catch((t=>{if(t.code==="ENOENT")return null;throw t}))]).then((([t,e])=>({srcStat:t,destStat:e})))}function getStatsSync(t,e,i){let n;const r=i.dereference?t=>s.statSync(t,{bigint:true}):t=>s.lstatSync(t,{bigint:true});const o=r(t);try{n=r(e)}catch(t){if(t.code==="ENOENT")return{srcStat:o,destStat:null};throw t}return{srcStat:o,destStat:n}}async function checkPaths(t,e,i,s){const{srcStat:r,destStat:o}=await getStats(t,e,s);if(o){if(areIdentical(r,o)){const s=n.basename(t);const a=n.basename(e);if(i==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase()){return{srcStat:r,destStat:o,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&!o.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!r.isDirectory()&&o.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(r.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,i))}return{srcStat:r,destStat:o}}function checkPathsSync(t,e,i,s){const{srcStat:r,destStat:o}=getStatsSync(t,e,s);if(o){if(areIdentical(r,o)){const s=n.basename(t);const a=n.basename(e);if(i==="move"&&s!==a&&s.toLowerCase()===a.toLowerCase()){return{srcStat:r,destStat:o,isChangingCase:true}}throw new Error("Source and destination must not be the same.")}if(r.isDirectory()&&!o.isDirectory()){throw new Error(`Cannot overwrite non-directory '${e}' with directory '${t}'.`)}if(!r.isDirectory()&&o.isDirectory()){throw new Error(`Cannot overwrite directory '${e}' with non-directory '${t}'.`)}}if(r.isDirectory()&&isSrcSubdir(t,e)){throw new Error(errMsg(t,e,i))}return{srcStat:r,destStat:o}}async function checkParentPaths(t,e,i,r){const o=n.resolve(n.dirname(t));const a=n.resolve(n.dirname(i));if(a===o||a===n.parse(a).root)return;let c;try{c=await s.stat(a,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,c)){throw new Error(errMsg(t,i,r))}return checkParentPaths(t,e,a,r)}function checkParentPathsSync(t,e,i,r){const o=n.resolve(n.dirname(t));const a=n.resolve(n.dirname(i));if(a===o||a===n.parse(a).root)return;let c;try{c=s.statSync(a,{bigint:true})}catch(t){if(t.code==="ENOENT")return;throw t}if(areIdentical(e,c)){throw new Error(errMsg(t,i,r))}return checkParentPathsSync(t,e,a,r)}function areIdentical(t,e){return e.ino&&e.dev&&e.ino===t.ino&&e.dev===t.dev}function isSrcSubdir(t,e){const i=n.resolve(t).split(n.sep).filter((t=>t));const s=n.resolve(e).split(n.sep).filter((t=>t));return i.every(((t,e)=>s[e]===t))}function errMsg(t,e,i){return`Cannot ${i} '${t}' to a subdirectory of itself, '${e}'.`}t.exports={checkPaths:r(checkPaths),checkPathsSync:checkPathsSync,checkParentPaths:r(checkParentPaths),checkParentPathsSync:checkParentPathsSync,isSrcSubdir:isSrcSubdir,areIdentical:areIdentical}},8605:(t,e,i)=>{const s=i(893);const n=i(2703).fromPromise;async function utimesMillis(t,e,i){const n=await s.open(t,"r+");let r=null;try{await s.futimes(n,e,i)}finally{try{await s.close(n)}catch(t){r=t}}if(r){throw r}}function utimesMillisSync(t,e,i){const n=s.openSync(t,"r+");s.futimesSync(n,e,i);return s.closeSync(n)}t.exports={utimesMillis:n(utimesMillis),utimesMillisSync:utimesMillisSync}},9491:e=>{e.exports=t(import.meta.url)("assert")},2057:e=>{e.exports=t(import.meta.url)("constants")},7147:e=>{e.exports=t(import.meta.url)("fs")},7718:e=>{e.exports=t(import.meta.url)("node:child_process")},5673:e=>{e.exports=t(import.meta.url)("node:events")},7561:e=>{e.exports=t(import.meta.url)("node:fs")},9411:e=>{e.exports=t(import.meta.url)("node:path")},7742:e=>{e.exports=t(import.meta.url)("node:process")},1017:e=>{e.exports=t(import.meta.url)("path")},2781:e=>{e.exports=t(import.meta.url)("stream")},3837:e=>{e.exports=t(import.meta.url)("util")},1776:(t,e,i)=>{const{Argument:s}=i(5e3);const{Command:n}=i(8966);const{CommanderError:r,InvalidArgumentError:o}=i(2315);const{Help:a}=i(9320);const{Option:c}=i(4790);e.program=new n;e.createCommand=t=>new n(t);e.createOption=(t,e)=>new c(t,e);e.createArgument=(t,e)=>new s(t,e);e.Command=n;e.Option=c;e.Argument=s;e.Help=a;e.CommanderError=r;e.InvalidArgumentError=o;e.InvalidOptionArgumentError=o},5e3:(t,e,i)=>{const{InvalidArgumentError:s}=i(2315);class Argument{constructor(t,e){this.description=e||"";this.variadic=false;this.parseArg=undefined;this.defaultValue=undefined;this.defaultValueDescription=undefined;this.argChoices=undefined;switch(t[0]){case"<":this.required=true;this._name=t.slice(1,-1);break;case"[":this.required=false;this._name=t.slice(1,-1);break;default:this.required=true;this._name=t;break}if(this._name.length>3&&this._name.slice(-3)==="..."){this.variadic=true;this._name=this._name.slice(0,-3)}}name(){return this._name}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}argParser(t){this.parseArg=t;return this}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}argRequired(){this.required=true;return this}argOptional(){this.required=false;return this}}function humanReadableArgName(t){const e=t.name()+(t.variadic===true?"...":"");return t.required?"<"+e+">":"["+e+"]"}e.Argument=Argument;e.humanReadableArgName=humanReadableArgName},8966:(t,e,i)=>{const s=i(5673).EventEmitter;const n=i(7718);const r=i(9411);const o=i(7561);const a=i(7742);const{Argument:c,humanReadableArgName:l}=i(5e3);const{CommanderError:h}=i(2315);const{Help:u}=i(9320);const{Option:f,DualOptions:p}=i(4790);const{suggestSimilar:d}=i(1492);class Command extends s{constructor(t){super();this.commands=[];this.options=[];this.parent=null;this._allowUnknownOption=false;this._allowExcessArguments=true;this.registeredArguments=[];this._args=this.registeredArguments;this.args=[];this.rawArgs=[];this.processedArgs=[];this._scriptPath=null;this._name=t||"";this._optionValues={};this._optionValueSources={};this._storeOptionsAsProperties=false;this._actionHandler=null;this._executableHandler=false;this._executableFile=null;this._executableDir=null;this._defaultCommandName=null;this._exitCallback=null;this._aliases=[];this._combineFlagAndOptionalValue=true;this._description="";this._summary="";this._argsDescription=undefined;this._enablePositionalOptions=false;this._passThroughOptions=false;this._lifeCycleHooks={};this._showHelpAfterError=false;this._showSuggestionAfterError=true;this._outputConfiguration={writeOut:t=>a.stdout.write(t),writeErr:t=>a.stderr.write(t),getOutHelpWidth:()=>a.stdout.isTTY?a.stdout.columns:undefined,getErrHelpWidth:()=>a.stderr.isTTY?a.stderr.columns:undefined,outputError:(t,e)=>e(t)};this._hidden=false;this._helpOption=undefined;this._addImplicitHelpCommand=undefined;this._helpCommand=undefined;this._helpConfiguration={}}copyInheritedSettings(t){this._outputConfiguration=t._outputConfiguration;this._helpOption=t._helpOption;this._helpCommand=t._helpCommand;this._helpConfiguration=t._helpConfiguration;this._exitCallback=t._exitCallback;this._storeOptionsAsProperties=t._storeOptionsAsProperties;this._combineFlagAndOptionalValue=t._combineFlagAndOptionalValue;this._allowExcessArguments=t._allowExcessArguments;this._enablePositionalOptions=t._enablePositionalOptions;this._showHelpAfterError=t._showHelpAfterError;this._showSuggestionAfterError=t._showSuggestionAfterError;return this}_getCommandAndAncestors(){const t=[];for(let e=this;e;e=e.parent){t.push(e)}return t}command(t,e,i){let s=e;let n=i;if(typeof s==="object"&&s!==null){n=s;s=null}n=n||{};const[,r,o]=t.match(/([^ ]+) *(.*)/);const a=this.createCommand(r);if(s){a.description(s);a._executableHandler=true}if(n.isDefault)this._defaultCommandName=a._name;a._hidden=!!(n.noHelp||n.hidden);a._executableFile=n.executableFile||null;if(o)a.arguments(o);this._registerCommand(a);a.parent=this;a.copyInheritedSettings(this);if(s)return this;return a}createCommand(t){return new Command(t)}createHelp(){return Object.assign(new u,this.configureHelp())}configureHelp(t){if(t===undefined)return this._helpConfiguration;this._helpConfiguration=t;return this}configureOutput(t){if(t===undefined)return this._outputConfiguration;Object.assign(this._outputConfiguration,t);return this}showHelpAfterError(t=true){if(typeof t!=="string")t=!!t;this._showHelpAfterError=t;return this}showSuggestionAfterError(t=true){this._showSuggestionAfterError=!!t;return this}addCommand(t,e){if(!t._name){throw new Error(`Command passed to .addCommand() must have a name\n- specify the name in Command constructor or using .name()`)}e=e||{};if(e.isDefault)this._defaultCommandName=t._name;if(e.noHelp||e.hidden)t._hidden=true;this._registerCommand(t);t.parent=this;t._checkForBrokenPassThrough();return this}createArgument(t,e){return new c(t,e)}argument(t,e,i,s){const n=this.createArgument(t,e);if(typeof i==="function"){n.default(s).argParser(i)}else{n.default(i)}this.addArgument(n);return this}arguments(t){t.trim().split(/ +/).forEach((t=>{this.argument(t)}));return this}addArgument(t){const e=this.registeredArguments.slice(-1)[0];if(e&&e.variadic){throw new Error(`only the last argument can be variadic '${e.name()}'`)}if(t.required&&t.defaultValue!==undefined&&t.parseArg===undefined){throw new Error(`a default value for a required argument is never used: '${t.name()}'`)}this.registeredArguments.push(t);return this}helpCommand(t,e){if(typeof t==="boolean"){this._addImplicitHelpCommand=t;return this}t=t??"help [command]";const[,i,s]=t.match(/([^ ]+) *(.*)/);const n=e??"display help for command";const r=this.createCommand(i);r.helpOption(false);if(s)r.arguments(s);if(n)r.description(n);this._addImplicitHelpCommand=true;this._helpCommand=r;return this}addHelpCommand(t,e){if(typeof t!=="object"){this.helpCommand(t,e);return this}this._addImplicitHelpCommand=true;this._helpCommand=t;return this}_getHelpCommand(){const t=this._addImplicitHelpCommand??(this.commands.length&&!this._actionHandler&&!this._findCommand("help"));if(t){if(this._helpCommand===undefined){this.helpCommand(undefined,undefined)}return this._helpCommand}return null}hook(t,e){const i=["preSubcommand","preAction","postAction"];if(!i.includes(t)){throw new Error(`Unexpected value for event passed to hook : '${t}'.\nExpecting one of '${i.join("', '")}'`)}if(this._lifeCycleHooks[t]){this._lifeCycleHooks[t].push(e)}else{this._lifeCycleHooks[t]=[e]}return this}exitOverride(t){if(t){this._exitCallback=t}else{this._exitCallback=t=>{if(t.code!=="commander.executeSubCommandAsync"){throw t}else{}}}return this}_exit(t,e,i){if(this._exitCallback){this._exitCallback(new h(t,e,i))}a.exit(t)}action(t){const listener=e=>{const i=this.registeredArguments.length;const s=e.slice(0,i);if(this._storeOptionsAsProperties){s[i]=this}else{s[i]=this.opts()}s.push(this);return t.apply(this,s)};this._actionHandler=listener;return this}createOption(t,e){return new f(t,e)}_callParseArg(t,e,i,s){try{return t.parseArg(e,i)}catch(t){if(t.code==="commander.invalidArgument"){const e=`${s} ${t.message}`;this.error(e,{exitCode:t.exitCode,code:t.code})}throw t}}_registerOption(t){const e=t.short&&this._findOption(t.short)||t.long&&this._findOption(t.long);if(e){const i=t.long&&this._findOption(t.long)?t.long:t.short;throw new Error(`Cannot add option '${t.flags}'${this._name&&` to command '${this._name}'`} due to conflicting flag '${i}'\n- already used by option '${e.flags}'`)}this.options.push(t)}_registerCommand(t){const knownBy=t=>[t.name()].concat(t.aliases());const e=knownBy(t).find((t=>this._findCommand(t)));if(e){const i=knownBy(this._findCommand(e)).join("|");const s=knownBy(t).join("|");throw new Error(`cannot add command '${s}' as already have command '${i}'`)}this.commands.push(t)}addOption(t){this._registerOption(t);const e=t.name();const i=t.attributeName();if(t.negate){const e=t.long.replace(/^--no-/,"--");if(!this._findOption(e)){this.setOptionValueWithSource(i,t.defaultValue===undefined?true:t.defaultValue,"default")}}else if(t.defaultValue!==undefined){this.setOptionValueWithSource(i,t.defaultValue,"default")}const handleOptionValue=(e,s,n)=>{if(e==null&&t.presetArg!==undefined){e=t.presetArg}const r=this.getOptionValue(i);if(e!==null&&t.parseArg){e=this._callParseArg(t,e,r,s)}else if(e!==null&&t.variadic){e=t._concatValue(e,r)}if(e==null){if(t.negate){e=false}else if(t.isBoolean()||t.optional){e=true}else{e=""}}this.setOptionValueWithSource(i,e,n)};this.on("option:"+e,(e=>{const i=`error: option '${t.flags}' argument '${e}' is invalid.`;handleOptionValue(e,i,"cli")}));if(t.envVar){this.on("optionEnv:"+e,(e=>{const i=`error: option '${t.flags}' value '${e}' from env '${t.envVar}' is invalid.`;handleOptionValue(e,i,"env")}))}return this}_optionEx(t,e,i,s,n){if(typeof e==="object"&&e instanceof f){throw new Error("To add an Option object use addOption() instead of option() or requiredOption()")}const r=this.createOption(e,i);r.makeOptionMandatory(!!t.mandatory);if(typeof s==="function"){r.default(n).argParser(s)}else if(s instanceof RegExp){const t=s;s=(e,i)=>{const s=t.exec(e);return s?s[0]:i};r.default(n).argParser(s)}else{r.default(s)}return this.addOption(r)}option(t,e,i,s){return this._optionEx({},t,e,i,s)}requiredOption(t,e,i,s){return this._optionEx({mandatory:true},t,e,i,s)}combineFlagAndOptionalValue(t=true){this._combineFlagAndOptionalValue=!!t;return this}allowUnknownOption(t=true){this._allowUnknownOption=!!t;return this}allowExcessArguments(t=true){this._allowExcessArguments=!!t;return this}enablePositionalOptions(t=true){this._enablePositionalOptions=!!t;return this}passThroughOptions(t=true){this._passThroughOptions=!!t;this._checkForBrokenPassThrough();return this}_checkForBrokenPassThrough(){if(this.parent&&this._passThroughOptions&&!this.parent._enablePositionalOptions){throw new Error(`passThroughOptions cannot be used for '${this._name}' without turning on enablePositionalOptions for parent command(s)`)}}storeOptionsAsProperties(t=true){if(this.options.length){throw new Error("call .storeOptionsAsProperties() before adding options")}if(Object.keys(this._optionValues).length){throw new Error("call .storeOptionsAsProperties() before setting option values")}this._storeOptionsAsProperties=!!t;return this}getOptionValue(t){if(this._storeOptionsAsProperties){return this[t]}return this._optionValues[t]}setOptionValue(t,e){return this.setOptionValueWithSource(t,e,undefined)}setOptionValueWithSource(t,e,i){if(this._storeOptionsAsProperties){this[t]=e}else{this._optionValues[t]=e}this._optionValueSources[t]=i;return this}getOptionValueSource(t){return this._optionValueSources[t]}getOptionValueSourceWithGlobals(t){let e;this._getCommandAndAncestors().forEach((i=>{if(i.getOptionValueSource(t)!==undefined){e=i.getOptionValueSource(t)}}));return e}_prepareUserArgs(t,e){if(t!==undefined&&!Array.isArray(t)){throw new Error("first parameter to parse must be array or undefined")}e=e||{};if(t===undefined&&e.from===undefined){if(a.versions?.electron){e.from="electron"}const t=a.execArgv??[];if(t.includes("-e")||t.includes("--eval")||t.includes("-p")||t.includes("--print")){e.from="eval"}}if(t===undefined){t=a.argv}this.rawArgs=t.slice();let i;switch(e.from){case undefined:case"node":this._scriptPath=t[1];i=t.slice(2);break;case"electron":if(a.defaultApp){this._scriptPath=t[1];i=t.slice(2)}else{i=t.slice(1)}break;case"user":i=t.slice(0);break;case"eval":i=t.slice(1);break;default:throw new Error(`unexpected parse option { from: '${e.from}' }`)}if(!this._name&&this._scriptPath)this.nameFromFilename(this._scriptPath);this._name=this._name||"program";return i}parse(t,e){const i=this._prepareUserArgs(t,e);this._parseCommand([],i);return this}async parseAsync(t,e){const i=this._prepareUserArgs(t,e);await this._parseCommand([],i);return this}_executeSubCommand(t,e){e=e.slice();let i=false;const s=[".js",".ts",".tsx",".mjs",".cjs"];function findFile(t,e){const i=r.resolve(t,e);if(o.existsSync(i))return i;if(s.includes(r.extname(e)))return undefined;const n=s.find((t=>o.existsSync(`${i}${t}`)));if(n)return`${i}${n}`;return undefined}this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();let c=t._executableFile||`${this._name}-${t._name}`;let l=this._executableDir||"";if(this._scriptPath){let t;try{t=o.realpathSync(this._scriptPath)}catch(e){t=this._scriptPath}l=r.resolve(r.dirname(t),l)}if(l){let e=findFile(l,c);if(!e&&!t._executableFile&&this._scriptPath){const i=r.basename(this._scriptPath,r.extname(this._scriptPath));if(i!==this._name){e=findFile(l,`${i}-${t._name}`)}}c=e||c}i=s.includes(r.extname(c));let u;if(a.platform!=="win32"){if(i){e.unshift(c);e=incrementNodeInspectorPort(a.execArgv).concat(e);u=n.spawn(a.argv[0],e,{stdio:"inherit"})}else{u=n.spawn(c,e,{stdio:"inherit"})}}else{e.unshift(c);e=incrementNodeInspectorPort(a.execArgv).concat(e);u=n.spawn(a.execPath,e,{stdio:"inherit"})}if(!u.killed){const t=["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"];t.forEach((t=>{a.on(t,(()=>{if(u.killed===false&&u.exitCode===null){u.kill(t)}}))}))}const f=this._exitCallback;u.on("close",(t=>{t=t??1;if(!f){a.exit(t)}else{f(new h(t,"commander.executeSubCommandAsync","(close)"))}}));u.on("error",(e=>{if(e.code==="ENOENT"){const e=l?`searched for local subcommand relative to directory '${l}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory";const i=`'${c}' does not exist\n - if '${t._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead\n - if the default executable name is not suitable, use the executableFile option to supply a custom name or path\n - ${e}`;throw new Error(i)}else if(e.code==="EACCES"){throw new Error(`'${c}' not executable`)}if(!f){a.exit(1)}else{const t=new h(1,"commander.executeSubCommandAsync","(error)");t.nestedError=e;f(t)}}));this.runningCommand=u}_dispatchSubcommand(t,e,i){const s=this._findCommand(t);if(!s)this.help({error:true});let n;n=this._chainOrCallSubCommandHook(n,s,"preSubcommand");n=this._chainOrCall(n,(()=>{if(s._executableHandler){this._executeSubCommand(s,e.concat(i))}else{return s._parseCommand(e,i)}}));return n}_dispatchHelpCommand(t){if(!t){this.help()}const e=this._findCommand(t);if(e&&!e._executableHandler){e.help()}return this._dispatchSubcommand(t,[],[this._getHelpOption()?.long??this._getHelpOption()?.short??"--help"])}_checkNumberOfArguments(){this.registeredArguments.forEach(((t,e)=>{if(t.required&&this.args[e]==null){this.missingArgument(t.name())}}));if(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic){return}if(this.args.length>this.registeredArguments.length){this._excessArguments(this.args)}}_processArguments(){const myParseArg=(t,e,i)=>{let s=e;if(e!==null&&t.parseArg){const n=`error: command-argument value '${e}' is invalid for argument '${t.name()}'.`;s=this._callParseArg(t,e,i,n)}return s};this._checkNumberOfArguments();const t=[];this.registeredArguments.forEach(((e,i)=>{let s=e.defaultValue;if(e.variadic){if(i<this.args.length){s=this.args.slice(i);if(e.parseArg){s=s.reduce(((t,i)=>myParseArg(e,i,t)),e.defaultValue)}}else if(s===undefined){s=[]}}else if(i<this.args.length){s=this.args[i];if(e.parseArg){s=myParseArg(e,s,e.defaultValue)}}t[i]=s}));this.processedArgs=t}_chainOrCall(t,e){if(t&&t.then&&typeof t.then==="function"){return t.then((()=>e()))}return e()}_chainOrCallHooks(t,e){let i=t;const s=[];this._getCommandAndAncestors().reverse().filter((t=>t._lifeCycleHooks[e]!==undefined)).forEach((t=>{t._lifeCycleHooks[e].forEach((e=>{s.push({hookedCommand:t,callback:e})}))}));if(e==="postAction"){s.reverse()}s.forEach((t=>{i=this._chainOrCall(i,(()=>t.callback(t.hookedCommand,this)))}));return i}_chainOrCallSubCommandHook(t,e,i){let s=t;if(this._lifeCycleHooks[i]!==undefined){this._lifeCycleHooks[i].forEach((t=>{s=this._chainOrCall(s,(()=>t(this,e)))}))}return s}_parseCommand(t,e){const i=this.parseOptions(e);this._parseOptionsEnv();this._parseOptionsImplied();t=t.concat(i.operands);e=i.unknown;this.args=t.concat(e);if(t&&this._findCommand(t[0])){return this._dispatchSubcommand(t[0],t.slice(1),e)}if(this._getHelpCommand()&&t[0]===this._getHelpCommand().name()){return this._dispatchHelpCommand(t[1])}if(this._defaultCommandName){this._outputHelpIfRequested(e);return this._dispatchSubcommand(this._defaultCommandName,t,e)}if(this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName){this.help({error:true})}this._outputHelpIfRequested(i.unknown);this._checkForMissingMandatoryOptions();this._checkForConflictingOptions();const checkForUnknownOptions=()=>{if(i.unknown.length>0){this.unknownOption(i.unknown[0])}};const s=`command:${this.name()}`;if(this._actionHandler){checkForUnknownOptions();this._processArguments();let i;i=this._chainOrCallHooks(i,"preAction");i=this._chainOrCall(i,(()=>this._actionHandler(this.processedArgs)));if(this.parent){i=this._chainOrCall(i,(()=>{this.parent.emit(s,t,e)}))}i=this._chainOrCallHooks(i,"postAction");return i}if(this.parent&&this.parent.listenerCount(s)){checkForUnknownOptions();this._processArguments();this.parent.emit(s,t,e)}else if(t.length){if(this._findCommand("*")){return this._dispatchSubcommand("*",t,e)}if(this.listenerCount("command:*")){this.emit("command:*",t,e)}else if(this.commands.length){this.unknownCommand()}else{checkForUnknownOptions();this._processArguments()}}else if(this.commands.length){checkForUnknownOptions();this.help({error:true})}else{checkForUnknownOptions();this._processArguments()}}_findCommand(t){if(!t)return undefined;return this.commands.find((e=>e._name===t||e._aliases.includes(t)))}_findOption(t){return this.options.find((e=>e.is(t)))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach((t=>{t.options.forEach((e=>{if(e.mandatory&&t.getOptionValue(e.attributeName())===undefined){t.missingMandatoryOptionValue(e)}}))}))}_checkForConflictingLocalOptions(){const t=this.options.filter((t=>{const e=t.attributeName();if(this.getOptionValue(e)===undefined){return false}return this.getOptionValueSource(e)!=="default"}));const e=t.filter((t=>t.conflictsWith.length>0));e.forEach((e=>{const i=t.find((t=>e.conflictsWith.includes(t.attributeName())));if(i){this._conflictingOption(e,i)}}))}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach((t=>{t._checkForConflictingLocalOptions()}))}parseOptions(t){const e=[];const i=[];let s=e;const n=t.slice();function maybeOption(t){return t.length>1&&t[0]==="-"}let r=null;while(n.length){const t=n.shift();if(t==="--"){if(s===i)s.push(t);s.push(...n);break}if(r&&!maybeOption(t)){this.emit(`option:${r.name()}`,t);continue}r=null;if(maybeOption(t)){const e=this._findOption(t);if(e){if(e.required){const t=n.shift();if(t===undefined)this.optionMissingArgument(e);this.emit(`option:${e.name()}`,t)}else if(e.optional){let t=null;if(n.length>0&&!maybeOption(n[0])){t=n.shift()}this.emit(`option:${e.name()}`,t)}else{this.emit(`option:${e.name()}`)}r=e.variadic?e:null;continue}}if(t.length>2&&t[0]==="-"&&t[1]!=="-"){const e=this._findOption(`-${t[1]}`);if(e){if(e.required||e.optional&&this._combineFlagAndOptionalValue){this.emit(`option:${e.name()}`,t.slice(2))}else{this.emit(`option:${e.name()}`);n.unshift(`-${t.slice(2)}`)}continue}}if(/^--[^=]+=/.test(t)){const e=t.indexOf("=");const i=this._findOption(t.slice(0,e));if(i&&(i.required||i.optional)){this.emit(`option:${i.name()}`,t.slice(e+1));continue}}if(maybeOption(t)){s=i}if((this._enablePositionalOptions||this._passThroughOptions)&&e.length===0&&i.length===0){if(this._findCommand(t)){e.push(t);if(n.length>0)i.push(...n);break}else if(this._getHelpCommand()&&t===this._getHelpCommand().name()){e.push(t);if(n.length>0)e.push(...n);break}else if(this._defaultCommandName){i.push(t);if(n.length>0)i.push(...n);break}}if(this._passThroughOptions){s.push(t);if(n.length>0)s.push(...n);break}s.push(t)}return{operands:e,unknown:i}}opts(){if(this._storeOptionsAsProperties){const t={};const e=this.options.length;for(let i=0;i<e;i++){const e=this.options[i].attributeName();t[e]=e===this._versionOptionName?this._version:this[e]}return t}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce(((t,e)=>Object.assign(t,e.opts())),{})}error(t,e){this._outputConfiguration.outputError(`${t}\n`,this._outputConfiguration.writeErr);if(typeof this._showHelpAfterError==="string"){this._outputConfiguration.writeErr(`${this._showHelpAfterError}\n`)}else if(this._showHelpAfterError){this._outputConfiguration.writeErr("\n");this.outputHelp({error:true})}const i=e||{};const s=i.exitCode||1;const n=i.code||"commander.error";this._exit(s,n,t)}_parseOptionsEnv(){this.options.forEach((t=>{if(t.envVar&&t.envVar in a.env){const e=t.attributeName();if(this.getOptionValue(e)===undefined||["default","config","env"].includes(this.getOptionValueSource(e))){if(t.required||t.optional){this.emit(`optionEnv:${t.name()}`,a.env[t.envVar])}else{this.emit(`optionEnv:${t.name()}`)}}}}))}_parseOptionsImplied(){const t=new p(this.options);const hasCustomOptionValue=t=>this.getOptionValue(t)!==undefined&&!["default","implied"].includes(this.getOptionValueSource(t));this.options.filter((e=>e.implied!==undefined&&hasCustomOptionValue(e.attributeName())&&t.valueFromOption(this.getOptionValue(e.attributeName()),e))).forEach((t=>{Object.keys(t.implied).filter((t=>!hasCustomOptionValue(t))).forEach((e=>{this.setOptionValueWithSource(e,t.implied[e],"implied")}))}))}missingArgument(t){const e=`error: missing required argument '${t}'`;this.error(e,{code:"commander.missingArgument"})}optionMissingArgument(t){const e=`error: option '${t.flags}' argument missing`;this.error(e,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(t){const e=`error: required option '${t.flags}' not specified`;this.error(e,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(t,e){const findBestOptionFromValue=t=>{const e=t.attributeName();const i=this.getOptionValue(e);const s=this.options.find((t=>t.negate&&e===t.attributeName()));const n=this.options.find((t=>!t.negate&&e===t.attributeName()));if(s&&(s.presetArg===undefined&&i===false||s.presetArg!==undefined&&i===s.presetArg)){return s}return n||t};const getErrorMessage=t=>{const e=findBestOptionFromValue(t);const i=e.attributeName();const s=this.getOptionValueSource(i);if(s==="env"){return`environment variable '${e.envVar}'`}return`option '${e.flags}'`};const i=`error: ${getErrorMessage(t)} cannot be used with ${getErrorMessage(e)}`;this.error(i,{code:"commander.conflictingOption"})}unknownOption(t){if(this._allowUnknownOption)return;let e="";if(t.startsWith("--")&&this._showSuggestionAfterError){let i=[];let s=this;do{const t=s.createHelp().visibleOptions(s).filter((t=>t.long)).map((t=>t.long));i=i.concat(t);s=s.parent}while(s&&!s._enablePositionalOptions);e=d(t,i)}const i=`error: unknown option '${t}'${e}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(t){if(this._allowExcessArguments)return;const e=this.registeredArguments.length;const i=e===1?"":"s";const s=this.parent?` for '${this.name()}'`:"";const n=`error: too many arguments${s}. Expected ${e} argument${i} but got ${t.length}.`;this.error(n,{code:"commander.excessArguments"})}unknownCommand(){const t=this.args[0];let e="";if(this._showSuggestionAfterError){const i=[];this.createHelp().visibleCommands(this).forEach((t=>{i.push(t.name());if(t.alias())i.push(t.alias())}));e=d(t,i)}const i=`error: unknown command '${t}'${e}`;this.error(i,{code:"commander.unknownCommand"})}version(t,e,i){if(t===undefined)return this._version;this._version=t;e=e||"-V, --version";i=i||"output the version number";const s=this.createOption(e,i);this._versionOptionName=s.attributeName();this._registerOption(s);this.on("option:"+s.name(),(()=>{this._outputConfiguration.writeOut(`${t}\n`);this._exit(0,"commander.version",t)}));return this}description(t,e){if(t===undefined&&e===undefined)return this._description;this._description=t;if(e){this._argsDescription=e}return this}summary(t){if(t===undefined)return this._summary;this._summary=t;return this}alias(t){if(t===undefined)return this._aliases[0];let e=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler){e=this.commands[this.commands.length-1]}if(t===e._name)throw new Error("Command alias can't be the same as its name");const i=this.parent?._findCommand(t);if(i){const e=[i.name()].concat(i.aliases()).join("|");throw new Error(`cannot add alias '${t}' to command '${this.name()}' as already have command '${e}'`)}e._aliases.push(t);return this}aliases(t){if(t===undefined)return this._aliases;t.forEach((t=>this.alias(t)));return this}usage(t){if(t===undefined){if(this._usage)return this._usage;const t=this.registeredArguments.map((t=>l(t)));return[].concat(this.options.length||this._helpOption!==null?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?t:[]).join(" ")}this._usage=t;return this}name(t){if(t===undefined)return this._name;this._name=t;return this}nameFromFilename(t){this._name=r.basename(t,r.extname(t));return this}executableDir(t){if(t===undefined)return this._executableDir;this._executableDir=t;return this}helpInformation(t){const e=this.createHelp();if(e.helpWidth===undefined){e.helpWidth=t&&t.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()}return e.formatHelp(this,e)}_getHelpContext(t){t=t||{};const e={error:!!t.error};let i;if(e.error){i=t=>this._outputConfiguration.writeErr(t)}else{i=t=>this._outputConfiguration.writeOut(t)}e.write=t.write||i;e.command=this;return e}outputHelp(t){let e;if(typeof t==="function"){e=t;t=undefined}const i=this._getHelpContext(t);this._getCommandAndAncestors().reverse().forEach((t=>t.emit("beforeAllHelp",i)));this.emit("beforeHelp",i);let s=this.helpInformation(i);if(e){s=e(s);if(typeof s!=="string"&&!Buffer.isBuffer(s)){throw new Error("outputHelp callback must return a string or a Buffer")}}i.write(s);if(this._getHelpOption()?.long){this.emit(this._getHelpOption().long)}this.emit("afterHelp",i);this._getCommandAndAncestors().forEach((t=>t.emit("afterAllHelp",i)))}helpOption(t,e){if(typeof t==="boolean"){if(t){this._helpOption=this._helpOption??undefined}else{this._helpOption=null}return this}t=t??"-h, --help";e=e??"display help for command";this._helpOption=this.createOption(t,e);return this}_getHelpOption(){if(this._helpOption===undefined){this.helpOption(undefined,undefined)}return this._helpOption}addHelpOption(t){this._helpOption=t;return this}help(t){this.outputHelp(t);let e=a.exitCode||0;if(e===0&&t&&typeof t!=="function"&&t.error){e=1}this._exit(e,"commander.help","(outputHelp)")}addHelpText(t,e){const i=["beforeAll","before","after","afterAll"];if(!i.includes(t)){throw new Error(`Unexpected value for position to addHelpText.\nExpecting one of '${i.join("', '")}'`)}const s=`${t}Help`;this.on(s,(t=>{let i;if(typeof e==="function"){i=e({error:t.error,command:t.command})}else{i=e}if(i){t.write(`${i}\n`)}}));return this}_outputHelpIfRequested(t){const e=this._getHelpOption();const i=e&&t.find((t=>e.is(t)));if(i){this.outputHelp();this._exit(0,"commander.helpDisplayed","(outputHelp)")}}}function incrementNodeInspectorPort(t){return t.map((t=>{if(!t.startsWith("--inspect")){return t}let e;let i="127.0.0.1";let s="9229";let n;if((n=t.match(/^(--inspect(-brk)?)$/))!==null){e=n[1]}else if((n=t.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null){e=n[1];if(/^\d+$/.test(n[3])){s=n[3]}else{i=n[3]}}else if((n=t.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null){e=n[1];i=n[3];s=n[4]}if(e&&s!=="0"){return`${e}=${i}:${parseInt(s)+1}`}return t}))}e.Command=Command},2315:(t,e)=>{class CommanderError extends Error{constructor(t,e,i){super(i);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name;this.code=e;this.exitCode=t;this.nestedError=undefined}}class InvalidArgumentError extends CommanderError{constructor(t){super(1,"commander.invalidArgument",t);Error.captureStackTrace(this,this.constructor);this.name=this.constructor.name}}e.CommanderError=CommanderError;e.InvalidArgumentError=InvalidArgumentError},9320:(t,e,i)=>{const{humanReadableArgName:s}=i(5e3);class Help{constructor(){this.helpWidth=undefined;this.sortSubcommands=false;this.sortOptions=false;this.showGlobalOptions=false}visibleCommands(t){const e=t.commands.filter((t=>!t._hidden));const i=t._getHelpCommand();if(i&&!i._hidden){e.push(i)}if(this.sortSubcommands){e.sort(((t,e)=>t.name().localeCompare(e.name())))}return e}compareOptions(t,e){const getSortKey=t=>t.short?t.short.replace(/^-/,""):t.long.replace(/^--/,"");return getSortKey(t).localeCompare(getSortKey(e))}visibleOptions(t){const e=t.options.filter((t=>!t.hidden));const i=t._getHelpOption();if(i&&!i.hidden){const s=i.short&&t._findOption(i.short);const n=i.long&&t._findOption(i.long);if(!s&&!n){e.push(i)}else if(i.long&&!n){e.push(t.createOption(i.long,i.description))}else if(i.short&&!s){e.push(t.createOption(i.short,i.description))}}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleGlobalOptions(t){if(!this.showGlobalOptions)return[];const e=[];for(let i=t.parent;i;i=i.parent){const t=i.options.filter((t=>!t.hidden));e.push(...t)}if(this.sortOptions){e.sort(this.compareOptions)}return e}visibleArguments(t){if(t._argsDescription){t.registeredArguments.forEach((e=>{e.description=e.description||t._argsDescription[e.name()]||""}))}if(t.registeredArguments.find((t=>t.description))){return t.registeredArguments}return[]}subcommandTerm(t){const e=t.registeredArguments.map((t=>s(t))).join(" ");return t._name+(t._aliases[0]?"|"+t._aliases[0]:"")+(t.options.length?" [options]":"")+(e?" "+e:"")}optionTerm(t){return t.flags}argumentTerm(t){return t.name()}longestSubcommandTermLength(t,e){return e.visibleCommands(t).reduce(((t,i)=>Math.max(t,e.subcommandTerm(i).length)),0)}longestOptionTermLength(t,e){return e.visibleOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestGlobalOptionTermLength(t,e){return e.visibleGlobalOptions(t).reduce(((t,i)=>Math.max(t,e.optionTerm(i).length)),0)}longestArgumentTermLength(t,e){return e.visibleArguments(t).reduce(((t,i)=>Math.max(t,e.argumentTerm(i).length)),0)}commandUsage(t){let e=t._name;if(t._aliases[0]){e=e+"|"+t._aliases[0]}let i="";for(let e=t.parent;e;e=e.parent){i=e.name()+" "+i}return i+e+" "+t.usage()}commandDescription(t){return t.description()}subcommandDescription(t){return t.summary()||t.description()}optionDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){const i=t.required||t.optional||t.isBoolean()&&typeof t.defaultValue==="boolean";if(i){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}}if(t.presetArg!==undefined&&t.optional){e.push(`preset: ${JSON.stringify(t.presetArg)}`)}if(t.envVar!==undefined){e.push(`env: ${t.envVar}`)}if(e.length>0){return`${t.description} (${e.join(", ")})`}return t.description}argumentDescription(t){const e=[];if(t.argChoices){e.push(`choices: ${t.argChoices.map((t=>JSON.stringify(t))).join(", ")}`)}if(t.defaultValue!==undefined){e.push(`default: ${t.defaultValueDescription||JSON.stringify(t.defaultValue)}`)}if(e.length>0){const i=`(${e.join(", ")})`;if(t.description){return`${t.description} ${i}`}return i}return t.description}formatHelp(t,e){const i=e.padWidth(t,e);const s=e.helpWidth||80;const n=2;const r=2;function formatItem(t,o){if(o){const a=`${t.padEnd(i+r)}${o}`;return e.wrap(a,s-n,i+r)}return t}function formatList(t){return t.join("\n").replace(/^/gm," ".repeat(n))}let o=[`Usage: ${e.commandUsage(t)}`,""];const a=e.commandDescription(t);if(a.length>0){o=o.concat([e.wrap(a,s,0),""])}const c=e.visibleArguments(t).map((t=>formatItem(e.argumentTerm(t),e.argumentDescription(t))));if(c.length>0){o=o.concat(["Arguments:",formatList(c),""])}const l=e.visibleOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(l.length>0){o=o.concat(["Options:",formatList(l),""])}if(this.showGlobalOptions){const i=e.visibleGlobalOptions(t).map((t=>formatItem(e.optionTerm(t),e.optionDescription(t))));if(i.length>0){o=o.concat(["Global Options:",formatList(i),""])}}const h=e.visibleCommands(t).map((t=>formatItem(e.subcommandTerm(t),e.subcommandDescription(t))));if(h.length>0){o=o.concat(["Commands:",formatList(h),""])}return o.join("\n")}padWidth(t,e){return Math.max(e.longestOptionTermLength(t,e),e.longestGlobalOptionTermLength(t,e),e.longestSubcommandTermLength(t,e),e.longestArgumentTermLength(t,e))}wrap(t,e,i,s=40){const n=" \\f\\t\\v - \ufeff";const r=new RegExp(`[\\n][${n}]+`);if(t.match(r))return t;const o=e-i;if(o<s)return t;const a=t.slice(0,i);const c=t.slice(i).replace("\r\n","\n");const l=" ".repeat(i);const h="";const u=`\\s${h}`;const f=new RegExp(`\n|.{1,${o-1}}([${u}]|$)|[^${u}]+?([${u}]|$)`,"g");const p=c.match(f)||[];return a+p.map(((t,e)=>{if(t==="\n")return"";return(e>0?l:"")+t.trimEnd()})).join("\n")}}e.Help=Help},4790:(t,e,i)=>{const{InvalidArgumentError:s}=i(2315);class Option{constructor(t,e){this.flags=t;this.description=e||"";this.required=t.includes("<");this.optional=t.includes("[");this.variadic=/\w\.\.\.[>\]]$/.test(t);this.mandatory=false;const i=splitOptionFlags(t);this.short=i.shortFlag;this.long=i.longFlag;this.negate=false;if(this.long){this.negate=this.long.startsWith("--no-")}this.defaultValue=undefined;this.defaultValueDescription=undefined;this.presetArg=undefined;this.envVar=undefined;this.parseArg=undefined;this.hidden=false;this.argChoices=undefined;this.conflictsWith=[];this.implied=undefined}default(t,e){this.defaultValue=t;this.defaultValueDescription=e;return this}preset(t){this.presetArg=t;return this}conflicts(t){this.conflictsWith=this.conflictsWith.concat(t);return this}implies(t){let e=t;if(typeof t==="string"){e={[t]:true}}this.implied=Object.assign(this.implied||{},e);return this}env(t){this.envVar=t;return this}argParser(t){this.parseArg=t;return this}makeOptionMandatory(t=true){this.mandatory=!!t;return this}hideHelp(t=true){this.hidden=!!t;return this}_concatValue(t,e){if(e===this.defaultValue||!Array.isArray(e)){return[t]}return e.concat(t)}choices(t){this.argChoices=t.slice();this.parseArg=(t,e)=>{if(!this.argChoices.includes(t)){throw new s(`Allowed choices are ${this.argChoices.join(", ")}.`)}if(this.variadic){return this._concatValue(t,e)}return t};return this}name(){if(this.long){return this.long.replace(/^--/,"")}return this.short.replace(/^-/,"")}attributeName(){return camelcase(this.name().replace(/^no-/,""))}is(t){return this.short===t||this.long===t}isBoolean(){return!this.required&&!this.optional&&!this.negate}}class DualOptions{constructor(t){this.positiveOptions=new Map;this.negativeOptions=new Map;this.dualOptions=new Set;t.forEach((t=>{if(t.negate){this.negativeOptions.set(t.attributeName(),t)}else{this.positiveOptions.set(t.attributeName(),t)}}));this.negativeOptions.forEach(((t,e)=>{if(this.positiveOptions.has(e)){this.dualOptions.add(e)}}))}valueFromOption(t,e){const i=e.attributeName();if(!this.dualOptions.has(i))return true;const s=this.negativeOptions.get(i).presetArg;const n=s!==undefined?s:false;return e.negate===(n===t)}}function camelcase(t){return t.split("-").reduce(((t,e)=>t+e[0].toUpperCase()+e.slice(1)))}function splitOptionFlags(t){let e;let i;const s=t.split(/[ |,]+/);if(s.length>1&&!/^[[<]/.test(s[1]))e=s.shift();i=s.shift();if(!e&&/^-[^-]$/.test(i)){e=i;i=undefined}return{shortFlag:e,longFlag:i}}e.Option=Option;e.DualOptions=DualOptions},1492:(t,e)=>{const i=3;function editDistance(t,e){if(Math.abs(t.length-e.length)>i)return Math.max(t.length,e.length);const s=[];for(let e=0;e<=t.length;e++){s[e]=[e]}for(let t=0;t<=e.length;t++){s[0][t]=t}for(let i=1;i<=e.length;i++){for(let n=1;n<=t.length;n++){let r=1;if(t[n-1]===e[i-1]){r=0}else{r=1}s[n][i]=Math.min(s[n-1][i]+1,s[n][i-1]+1,s[n-1][i-1]+r);if(n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]){s[n][i]=Math.min(s[n][i],s[n-2][i-2]+1)}}}return s[t.length][e.length]}function suggestSimilar(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));const s=t.startsWith("--");if(s){t=t.slice(2);e=e.map((t=>t.slice(2)))}let n=[];let r=i;const o=.4;e.forEach((e=>{if(e.length<=1)return;const i=editDistance(t,e);const s=Math.max(t.length,e.length);const a=(s-i)/s;if(a>o){if(i<r){r=i;n=[e]}else if(i===r){n.push(e)}}}));n.sort(((t,e)=>t.localeCompare(e)));if(s){n=n.map((t=>`--${t}`))}if(n.length>1){return`\n(Did you mean one of ${n.join(", ")}?)`}if(n.length===1){return`\n(Did you mean ${n[0]}?)`}return""}e.suggestSimilar=suggestSimilar}};var i={};function __nccwpck_require__(t){var s=i[t];if(s!==undefined){return s.exports}var n=i[t]={exports:{}};var r=true;try{e[t](n,n.exports,__nccwpck_require__);r=false}finally{if(r)delete i[t]}return n.exports}(()=>{__nccwpck_require__.n=t=>{var e=t&&t.__esModule?()=>t["default"]:()=>t;__nccwpck_require__.d(e,{a:e});return e}})();(()=>{var t=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__;var e;__nccwpck_require__.t=function(i,s){if(s&1)i=this(i);if(s&8)return i;if(typeof i==="object"&&i){if(s&4&&i.__esModule)return i;if(s&16&&typeof i.then==="function")return i}var n=Object.create(null);__nccwpck_require__.r(n);var r={};e=e||[null,t({}),t([]),t(t)];for(var o=s&2&&i;typeof o=="object"&&!~e.indexOf(o);o=t(o)){Object.getOwnPropertyNames(o).forEach((t=>r[t]=()=>i[t]))}r["default"]=()=>i;__nccwpck_require__.d(n,r);return n}})();(()=>{__nccwpck_require__.d=(t,e)=>{for(var i in e){if(__nccwpck_require__.o(e,i)&&!__nccwpck_require__.o(t,i)){Object.defineProperty(t,i,{enumerable:true,get:e[i]})}}}})();(()=>{__nccwpck_require__.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e)})();(()=>{__nccwpck_require__.r=t=>{if(typeof Symbol!=="undefined"&&Symbol.toStringTag){Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})}Object.defineProperty(t,"__esModule",{value:true})}})();if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=new URL(".",import.meta.url).pathname.slice(import.meta.url.match(/^file:\/\/\/\w:/)?1:0,-1)+"/";var s={};(()=>{const e=t(import.meta.url)("node:url");globalThis.__filename=(0,e.fileURLToPath)(import.meta.url);const i=10;const wrapAnsi16=(t=0)=>e=>`[${e+t}m`;const wrapAnsi256=(t=0)=>e=>`[${38+t};5;${e}m`;const wrapAnsi16m=(t=0)=>(e,i,s)=>`[${38+t};2;${e};${i};${s}m`;const s={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],gray:[90,39],grey:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgGray:[100,49],bgGrey:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};const n=Object.keys(s.modifier);const r=Object.keys(s.color);const o=Object.keys(s.bgColor);const a=[...r,...o];function assembleStyles(){const t=new Map;for(const[e,i]of Object.entries(s)){for(const[e,n]of Object.entries(i)){s[e]={open:`[${n[0]}m`,close:`[${n[1]}m`};i[e]=s[e];t.set(n[0],n[1])}Object.defineProperty(s,e,{value:i,enumerable:false})}Object.defineProperty(s,"codes",{value:t,enumerable:false});s.color.close="[39m";s.bgColor.close="[49m";s.color.ansi=wrapAnsi16();s.color.ansi256=wrapAnsi256();s.color.ansi16m=wrapAnsi16m();s.bgColor.ansi=wrapAnsi16(i);s.bgColor.ansi256=wrapAnsi256(i);s.bgColor.ansi16m=wrapAnsi16m(i);Object.defineProperties(s,{rgbToAnsi256:{value(t,e,i){if(t===e&&e===i){if(t<8){return 16}if(t>248){return 231}return Math.round((t-8)/247*24)+232}return 16+36*Math.round(t/255*5)+6*Math.round(e/255*5)+Math.round(i/255*5)},enumerable:false},hexToRgb:{value(t){const e=/[a-f\d]{6}|[a-f\d]{3}/i.exec(t.toString(16));if(!e){return[0,0,0]}let[i]=e;if(i.length===3){i=[...i].map((t=>t+t)).join("")}const s=Number.parseInt(i,16);return[s>>16&255,s>>8&255,s&255]},enumerable:false},hexToAnsi256:{value:t=>s.rgbToAnsi256(...s.hexToRgb(t)),enumerable:false},ansi256ToAnsi:{value(t){if(t<8){return 30+t}if(t<16){return 90+(t-8)}let e;let i;let s;if(t>=232){e=((t-232)*10+8)/255;i=e;s=e}else{t-=16;const n=t%36;e=Math.floor(t/36)/5;i=Math.floor(n/6)/5;s=n%6/5}const n=Math.max(e,i,s)*2;if(n===0){return 30}let r=30+(Math.round(s)<<2|Math.round(i)<<1|Math.round(e));if(n===2){r+=60}return r},enumerable:false},rgbToAnsi:{value:(t,e,i)=>s.ansi256ToAnsi(s.rgbToAnsi256(t,e,i)),enumerable:false},hexToAnsi:{value:t=>s.ansi256ToAnsi(s.hexToAnsi256(t)),enumerable:false}});return s}const c=assembleStyles();const l=c;var h=__nccwpck_require__(7742);const u=t(import.meta.url)("node:os");const f=t(import.meta.url)("node:tty");function hasFlag(t,e=(globalThis.Deno?globalThis.Deno.args:h.argv)){const i=t.startsWith("-")?"":t.length===1?"-":"--";const s=e.indexOf(i+t);const n=e.indexOf("--");return s!==-1&&(n===-1||s<n)}const{env:p}=h;let d;if(hasFlag("no-color")||hasFlag("no-colors")||hasFlag("color=false")||hasFlag("color=never")){d=0}else if(hasFlag("color")||hasFlag("colors")||hasFlag("color=true")||hasFlag("color=always")){d=1}function envForceColor(){if("FORCE_COLOR"in p){if(p.FORCE_COLOR==="true"){return 1}if(p.FORCE_COLOR==="false"){return 0}return p.FORCE_COLOR.length===0?1:Math.min(Number.parseInt(p.FORCE_COLOR,10),3)}}function translateLevel(t){if(t===0){return false}return{level:t,hasBasic:true,has256:t>=2,has16m:t>=3}}function _supportsColor(t,{streamIsTTY:e,sniffFlags:i=true}={}){const s=envForceColor();if(s!==undefined){d=s}const n=i?d:s;if(n===0){return 0}if(i){if(hasFlag("color=16m")||hasFlag("color=full")||hasFlag("color=truecolor")){return 3}if(hasFlag("color=256")){return 2}}if("TF_BUILD"in p&&"AGENT_NAME"in p){return 1}if(t&&!e&&n===undefined){return 0}const r=n||0;if(p.TERM==="dumb"){return r}if(h.platform==="win32"){const t=u.release().split(".");if(Number(t[0])>=10&&Number(t[2])>=10586){return Number(t[2])>=14931?3:2}return 1}if("CI"in p){if("GITHUB_ACTIONS"in p||"GITEA_ACTIONS"in p){return 3}if(["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","BUILDKITE","DRONE"].some((t=>t in p))||p.CI_NAME==="codeship"){return 1}return r}if("TEAMCITY_VERSION"in p){return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(p.TEAMCITY_VERSION)?1:0}if(p.COLORTERM==="truecolor"){return 3}if(p.TERM==="xterm-kitty"){return 3}if("TERM_PROGRAM"in p){const t=Number.parseInt((p.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(p.TERM_PROGRAM){case"iTerm.app":{return t>=3?3:2}case"Apple_Terminal":{return 2}}}if(/-256(color)?$/i.test(p.TERM)){return 2}if(/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(p.TERM)){return 1}if("COLORTERM"in p){return 1}return r}function createSupportsColor(t,e={}){const i=_supportsColor(t,{streamIsTTY:t&&t.isTTY,...e});return translateLevel(i)}const g={stdout:createSupportsColor({isTTY:f.isatty(1)}),stderr:createSupportsColor({isTTY:f.isatty(2)})};const y=g;function stringReplaceAll(t,e,i){let s=t.indexOf(e);if(s===-1){return t}const n=e.length;let r=0;let o="";do{o+=t.slice(r,s)+e+i;r=s+n;s=t.indexOf(e,r)}while(s!==-1);o+=t.slice(r);return o}function stringEncaseCRLFWithFirstIndex(t,e,i,s){let n=0;let r="";do{const o=t[s-1]==="\r";r+=t.slice(n,o?s-1:s)+e+(o?"\r\n":"\n")+i;n=s+1;s=t.indexOf("\n",n)}while(s!==-1);r+=t.slice(n);return r}const{stdout:w,stderr:b}=y;const S=Symbol("GENERATOR");const v=Symbol("STYLER");const _=Symbol("IS_EMPTY");const k=["ansi","ansi","ansi256","ansi16m"];const x=Object.create(null);const applyOptions=(t,e={})=>{if(e.level&&!(Number.isInteger(e.level)&&e.level>=0&&e.level<=3)){throw new Error("The `level` option should be an integer from 0 to 3")}const i=w?w.level:0;t.level=e.level===undefined?i:e.level};class Chalk{constructor(t){return chalkFactory(t)}}const chalkFactory=t=>{const chalk=(...t)=>t.join(" ");applyOptions(chalk,t);Object.setPrototypeOf(chalk,createChalk.prototype);return chalk};function createChalk(t){return chalkFactory(t)}Object.setPrototypeOf(createChalk.prototype,Function.prototype);for(const[t,e]of Object.entries(l)){x[t]={get(){const i=createBuilder(this,createStyler(e.open,e.close,this[v]),this[_]);Object.defineProperty(this,t,{value:i});return i}}}x.visible={get(){const t=createBuilder(this,this[v],true);Object.defineProperty(this,"visible",{value:t});return t}};const getModelAnsi=(t,e,i,...s)=>{if(t==="rgb"){if(e==="ansi16m"){return l[i].ansi16m(...s)}if(e==="ansi256"){return l[i].ansi256(l.rgbToAnsi256(...s))}return l[i].ansi(l.rgbToAnsi(...s))}if(t==="hex"){return getModelAnsi("rgb",e,i,...l.hexToRgb(...s))}return l[i][t](...s)};const O=["rgb","hex","ansi256"];for(const t of O){x[t]={get(){const{level:e}=this;return function(...i){const s=createStyler(getModelAnsi(t,k[e],"color",...i),l.color.close,this[v]);return createBuilder(this,s,this[_])}}};const e="bg"+t[0].toUpperCase()+t.slice(1);x[e]={get(){const{level:e}=this;return function(...i){const s=createStyler(getModelAnsi(t,k[e],"bgColor",...i),l.bgColor.close,this[v]);return createBuilder(this,s,this[_])}}}}const E=Object.defineProperties((()=>{}),{...x,level:{enumerable:true,get(){return this[S].level},set(t){this[S].level=t}}});const createStyler=(t,e,i)=>{let s;let n;if(i===undefined){s=t;n=e}else{s=i.openAll+t;n=e+i.closeAll}return{open:t,close:e,openAll:s,closeAll:n,parent:i}};const createBuilder=(t,e,i)=>{const builder=(...t)=>applyStyle(builder,t.length===1?""+t[0]:t.join(" "));Object.setPrototypeOf(builder,E);builder[S]=t;builder[v]=e;builder[_]=i;return builder};const applyStyle=(t,e)=>{if(t.level<=0||!e){return t[_]?"":e}let i=t[v];if(i===undefined){return e}const{openAll:s,closeAll:n}=i;if(e.includes("")){while(i!==undefined){e=stringReplaceAll(e,i.close,i.open);i=i.parent}}const r=e.indexOf("\n");if(r!==-1){e=stringEncaseCRLFWithFirstIndex(e,n,s,r)}return s+e+n};Object.defineProperties(createChalk.prototype,x);const A=createChalk();const C=createChalk({level:b?b.level:0});const F=A;var P=__nccwpck_require__(1776);const{program:T,createCommand:L,createArgument:M,createOption:R,CommanderError:D,InvalidArgumentError:N,InvalidOptionArgumentError:$,Command:j,Argument:I,Option:W,Help:B}=P;var z=__nccwpck_require__(9411);var H=__nccwpck_require__.n(z);var V=__nccwpck_require__(5392);var G=__nccwpck_require__.n(V);const U=t(import.meta.url)("node:module");var q=__nccwpck_require__(2297);const J=1024*64;const assertValidPattern=t=>{if(typeof t!=="string"){throw new TypeError("invalid pattern")}if(t.length>J){throw new TypeError("pattern is too long")}};const Y={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",true],"[:alpha:]":["\\p{L}\\p{Nl}",true],"[:ascii:]":["\\x"+"00-\\x"+"7f",false],"[:blank:]":["\\p{Zs}\\t",true],"[:cntrl:]":["\\p{Cc}",true],"[:digit:]":["\\p{Nd}",true],"[:graph:]":["\\p{Z}\\p{C}",true,true],"[:lower:]":["\\p{Ll}",true],"[:print:]":["\\p{C}",true],"[:punct:]":["\\p{P}",true],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",true],"[:upper:]":["\\p{Lu}",true],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",true],"[:xdigit:]":["A-Fa-f0-9",false]};const braceEscape=t=>t.replace(/[[\]\\-]/g,"\\$&");const regexpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const rangesToString=t=>t.join("");const parseClass=(t,e)=>{const i=e;if(t.charAt(i)!=="["){throw new Error("not in a brace expression")}const s=[];const n=[];let r=i+1;let o=false;let a=false;let c=false;let l=false;let h=i;let u="";t:while(r<t.length){const e=t.charAt(r);if((e==="!"||e==="^")&&r===i+1){l=true;r++;continue}if(e==="]"&&o&&!c){h=r+1;break}o=true;if(e==="\\"){if(!c){c=true;r++;continue}}if(e==="["&&!c){for(const[e,[o,c,l]]of Object.entries(Y)){if(t.startsWith(e,r)){if(u){return["$.",false,t.length-i,true]}r+=e.length;if(l)n.push(o);else s.push(o);a=a||c;continue t}}}c=false;if(u){if(e>u){s.push(braceEscape(u)+"-"+braceEscape(e))}else if(e===u){s.push(braceEscape(e))}u="";r++;continue}if(t.startsWith("-]",r+1)){s.push(braceEscape(e+"-"));r+=2;continue}if(t.startsWith("-",r+1)){u=e;r+=2;continue}s.push(braceEscape(e));r++}if(h<r){return["",false,0,false]}if(!s.length&&!n.length){return["$.",false,t.length-i,true]}if(n.length===0&&s.length===1&&/^\\?.$/.test(s[0])&&!l){const t=s[0].length===2?s[0].slice(-1):s[0];return[regexpEscape(t),false,h-i,false]}const f="["+(l?"^":"")+rangesToString(s)+"]";const p="["+(l?"":"^")+rangesToString(n)+"]";const d=s.length&&n.length?"("+f+"|"+p+")":s.length?f:p;return[d,a,h-i,true]};const unescape_unescape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");const K=new Set(["!","?","+","*","@"]);const isExtglobType=t=>K.has(t);const Z="(?!(?:^|/)\\.\\.?(?:$|/))";const Q="(?!\\.)";const X=new Set(["[","."]);const tt=new Set(["..","."]);const et=new Set("().*{}+?[]^$\\!");const regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");const it="[^/]";const st=it+"*?";const nt=it+"+?";class AST{type;#t;#e;#i=false;#s=[];#n;#r;#o;#a=false;#c;#l;#h=false;constructor(t,e,i={}){this.type=t;if(t)this.#e=true;this.#n=e;this.#t=this.#n?this.#n.#t:this;this.#c=this.#t===this?i:this.#t.#c;this.#o=this.#t===this?[]:this.#t.#o;if(t==="!"&&!this.#t.#a)this.#o.push(this);this.#r=this.#n?this.#n.#s.length:0}get hasMagic(){if(this.#e!==undefined)return this.#e;for(const t of this.#s){if(typeof t==="string")continue;if(t.type||t.hasMagic)return this.#e=true}return this.#e}toString(){if(this.#l!==undefined)return this.#l;if(!this.type){return this.#l=this.#s.map((t=>String(t))).join("")}else{return this.#l=this.type+"("+this.#s.map((t=>String(t))).join("|")+")"}}#u(){if(this!==this.#t)throw new Error("should only call on root");if(this.#a)return this;this.toString();this.#a=true;let t;while(t=this.#o.pop()){if(t.type!=="!")continue;let e=t;let i=e.#n;while(i){for(let s=e.#r+1;!i.type&&s<i.#s.length;s++){for(const e of t.#s){if(typeof e==="string"){throw new Error("string part in extglob AST??")}e.copyIn(i.#s[s])}}e=i;i=e.#n}}return this}push(...t){for(const e of t){if(e==="")continue;if(typeof e!=="string"&&!(e instanceof AST&&e.#n===this)){throw new Error("invalid part: "+e)}this.#s.push(e)}}toJSON(){const t=this.type===null?this.#s.slice().map((t=>typeof t==="string"?t:t.toJSON())):[this.type,...this.#s.map((t=>t.toJSON()))];if(this.isStart()&&!this.type)t.unshift([]);if(this.isEnd()&&(this===this.#t||this.#t.#a&&this.#n?.type==="!")){t.push({})}return t}isStart(){if(this.#t===this)return true;if(!this.#n?.isStart())return false;if(this.#r===0)return true;const t=this.#n;for(let e=0;e<this.#r;e++){const i=t.#s[e];if(!(i instanceof AST&&i.type==="!")){return false}}return true}isEnd(){if(this.#t===this)return true;if(this.#n?.type==="!")return true;if(!this.#n?.isEnd())return false;if(!this.type)return this.#n?.isEnd();const t=this.#n?this.#n.#s.length:0;return this.#r===t-1}copyIn(t){if(typeof t==="string")this.push(t);else this.push(t.clone(this))}clone(t){const e=new AST(this.type,t);for(const t of this.#s){e.copyIn(t)}return e}static#f(t,e,i,s){let n=false;let r=false;let o=-1;let a=false;if(e.type===null){let c=i;let l="";while(c<t.length){const i=t.charAt(c++);if(n||i==="\\"){n=!n;l+=i;continue}if(r){if(c===o+1){if(i==="^"||i==="!"){a=true}}else if(i==="]"&&!(c===o+2&&a)){r=false}l+=i;continue}else if(i==="["){r=true;o=c;a=false;l+=i;continue}if(!s.noext&&isExtglobType(i)&&t.charAt(c)==="("){e.push(l);l="";const n=new AST(i,e);c=AST.#f(t,n,c,s);e.push(n);continue}l+=i}e.push(l);return c}let c=i+1;let l=new AST(null,e);const h=[];let u="";while(c<t.length){const i=t.charAt(c++);if(n||i==="\\"){n=!n;u+=i;continue}if(r){if(c===o+1){if(i==="^"||i==="!"){a=true}}else if(i==="]"&&!(c===o+2&&a)){r=false}u+=i;continue}else if(i==="["){r=true;o=c;a=false;u+=i;continue}if(isExtglobType(i)&&t.charAt(c)==="("){l.push(u);u="";const e=new AST(i,l);l.push(e);c=AST.#f(t,e,c,s);continue}if(i==="|"){l.push(u);u="";h.push(l);l=new AST(null,e);continue}if(i===")"){if(u===""&&e.#s.length===0){e.#h=true}l.push(u);u="";e.push(...h,l);return c}u+=i}e.type=null;e.#e=undefined;e.#s=[t.substring(i-1)];return c}static fromGlob(t,e={}){const i=new AST(null,undefined,e);AST.#f(t,i,0,e);return i}toMMPattern(){if(this!==this.#t)return this.#t.toMMPattern();const t=this.toString();const[e,i,s,n]=this.toRegExpSource();const r=s||this.#e||this.#c.nocase&&!this.#c.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase();if(!r){return i}const o=(this.#c.nocase?"i":"")+(n?"u":"");return Object.assign(new RegExp(`^${e}$`,o),{_src:e,_glob:t})}get options(){return this.#c}toRegExpSource(t){const e=t??!!this.#c.dot;if(this.#t===this)this.#u();if(!this.type){const i=this.isStart()&&this.isEnd();const s=this.#s.map((e=>{const[s,n,r,o]=typeof e==="string"?AST.#p(e,this.#e,i):e.toRegExpSource(t);this.#e=this.#e||r;this.#i=this.#i||o;return s})).join("");let n="";if(this.isStart()){if(typeof this.#s[0]==="string"){const i=this.#s.length===1&&tt.has(this.#s[0]);if(!i){const i=X;const r=e&&i.has(s.charAt(0))||s.startsWith("\\.")&&i.has(s.charAt(2))||s.startsWith("\\.\\.")&&i.has(s.charAt(4));const o=!e&&!t&&i.has(s.charAt(0));n=r?Z:o?Q:""}}}let r="";if(this.isEnd()&&this.#t.#a&&this.#n?.type==="!"){r="(?:$|\\/)"}const o=n+s+r;return[o,unescape_unescape(s),this.#e=!!this.#e,this.#i]}const i=this.type==="*"||this.type==="+";const s=this.type==="!"?"(?:(?!(?:":"(?:";let n=this.#d(e);if(this.isStart()&&this.isEnd()&&!n&&this.type!=="!"){const t=this.toString();this.#s=[t];this.type=null;this.#e=undefined;return[t,unescape_unescape(this.toString()),false,false]}let r=!i||t||e||!Q?"":this.#d(true);if(r===n){r=""}if(r){n=`(?:${n})(?:${r})*?`}let o="";if(this.type==="!"&&this.#h){o=(this.isStart()&&!e?Q:"")+nt}else{const i=this.type==="!"?"))"+(this.isStart()&&!e&&!t?Q:"")+st+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&r?")":this.type==="*"&&r?`)?`:`)${this.type}`;o=s+n+i}return[o,unescape_unescape(n),this.#e=!!this.#e,this.#i]}#d(t){return this.#s.map((e=>{if(typeof e==="string"){throw new Error("string type in extglob ast??")}const[i,s,n,r]=e.toRegExpSource(t);this.#i=this.#i||r;return i})).filter((t=>!(this.isStart()&&this.isEnd())||!!t)).join("|")}static#p(t,e,i=false){let s=false;let n="";let r=false;for(let o=0;o<t.length;o++){const a=t.charAt(o);if(s){s=false;n+=(et.has(a)?"\\":"")+a;continue}if(a==="\\"){if(o===t.length-1){n+="\\\\"}else{s=true}continue}if(a==="["){const[i,s,a,c]=parseClass(t,o);if(a){n+=i;r=r||s;o+=a-1;e=e||c;continue}}if(a==="*"){if(i&&t==="*")n+=nt;else n+=st;e=true;continue}if(a==="?"){n+=it;e=true;continue}n+=regExpEscape(a)}return[n,unescape_unescape(t),!!e,r]}}const escape_escape=(t,{windowsPathsNoEscape:e=false}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");const minimatch=(t,e,i={})=>{assertValidPattern(e);if(!i.nocomment&&e.charAt(0)==="#"){return false}return new Minimatch(e,i).match(t)};const rt=/^\*+([^+@!?\*\[\(]*)$/;const starDotExtTest=t=>e=>!e.startsWith(".")&&e.endsWith(t);const starDotExtTestDot=t=>e=>e.endsWith(t);const starDotExtTestNocase=t=>{t=t.toLowerCase();return e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)};const starDotExtTestNocaseDot=t=>{t=t.toLowerCase();return e=>e.toLowerCase().endsWith(t)};const ot=/^\*+\.\*+$/;const starDotStarTest=t=>!t.startsWith(".")&&t.includes(".");const starDotStarTestDot=t=>t!=="."&&t!==".."&&t.includes(".");const at=/^\.\*+$/;const dotStarTest=t=>t!=="."&&t!==".."&&t.startsWith(".");const ct=/^\*+$/;const starTest=t=>t.length!==0&&!t.startsWith(".");const starTestDot=t=>t.length!==0&&t!=="."&&t!=="..";const lt=/^\?+([^+@!?\*\[\(]*)?$/;const qmarksTestNocase=([t,e=""])=>{const i=qmarksTestNoExt([t]);if(!e)return i;e=e.toLowerCase();return t=>i(t)&&t.toLowerCase().endsWith(e)};const qmarksTestNocaseDot=([t,e=""])=>{const i=qmarksTestNoExtDot([t]);if(!e)return i;e=e.toLowerCase();return t=>i(t)&&t.toLowerCase().endsWith(e)};const qmarksTestDot=([t,e=""])=>{const i=qmarksTestNoExtDot([t]);return!e?i:t=>i(t)&&t.endsWith(e)};const qmarksTest=([t,e=""])=>{const i=qmarksTestNoExt([t]);return!e?i:t=>i(t)&&t.endsWith(e)};const qmarksTestNoExt=([t])=>{const e=t.length;return t=>t.length===e&&!t.startsWith(".")};const qmarksTestNoExtDot=([t])=>{const e=t.length;return t=>t.length===e&&t!=="."&&t!==".."};const ht=typeof process==="object"&&process?typeof process.env==="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix";const ut={win32:{sep:"\\"},posix:{sep:"/"}};const ft=ht==="win32"?ut.win32.sep:ut.posix.sep;minimatch.sep=ft;const pt=Symbol("globstar **");minimatch.GLOBSTAR=pt;const dt="[^/]";const mt=dt+"*?";const gt="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?";const yt="(?:(?!(?:\\/|^)\\.).)*?";const filter=(t,e={})=>i=>minimatch(i,t,e);minimatch.filter=filter;const ext=(t,e={})=>Object.assign({},t,e);const defaults=t=>{if(!t||typeof t!=="object"||!Object.keys(t).length){return minimatch}const e=minimatch;const m=(i,s,n={})=>e(i,s,ext(t,n));return Object.assign(m,{Minimatch:class Minimatch extends e.Minimatch{constructor(e,i={}){super(e,ext(t,i))}static defaults(i){return e.defaults(ext(t,i)).Minimatch}},AST:class AST extends e.AST{constructor(e,i,s={}){super(e,i,ext(t,s))}static fromGlob(i,s={}){return e.AST.fromGlob(i,ext(t,s))}},unescape:(i,s={})=>e.unescape(i,ext(t,s)),escape:(i,s={})=>e.escape(i,ext(t,s)),filter:(i,s={})=>e.filter(i,ext(t,s)),defaults:i=>e.defaults(ext(t,i)),makeRe:(i,s={})=>e.makeRe(i,ext(t,s)),braceExpand:(i,s={})=>e.braceExpand(i,ext(t,s)),match:(i,s,n={})=>e.match(i,s,ext(t,n)),sep:e.sep,GLOBSTAR:pt})};minimatch.defaults=defaults;const braceExpand=(t,e={})=>{assertValidPattern(t);if(e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)){return[t]}return q(t)};minimatch.braceExpand=braceExpand;const makeRe=(t,e={})=>new Minimatch(t,e).makeRe();minimatch.makeRe=makeRe;const match=(t,e,i={})=>{const s=new Minimatch(e,i);t=t.filter((t=>s.match(t)));if(s.options.nonull&&!t.length){t.push(e)}return t};minimatch.match=match;const wt=/[?*]|[+@!]\(.*?\)|\[|\]/;const esm_regExpEscape=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&");class Minimatch{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;regexp;constructor(t,e={}){assertValidPattern(t);e=e||{};this.options=e;this.pattern=t;this.platform=e.platform||ht;this.isWindows=this.platform==="win32";this.windowsPathsNoEscape=!!e.windowsPathsNoEscape||e.allowWindowsEscape===false;if(this.windowsPathsNoEscape){this.pattern=this.pattern.replace(/\\/g,"/")}this.preserveMultipleSlashes=!!e.preserveMultipleSlashes;this.regexp=null;this.negate=false;this.nonegate=!!e.nonegate;this.comment=false;this.empty=false;this.partial=!!e.partial;this.nocase=!!this.options.nocase;this.windowsNoMagicRoot=e.windowsNoMagicRoot!==undefined?e.windowsNoMagicRoot:!!(this.isWindows&&this.nocase);this.globSet=[];this.globParts=[];this.set=[];this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1){return true}for(const t of this.set){for(const e of t){if(typeof e!=="string")return true}}return false}debug(...t){}make(){const t=this.pattern;const e=this.options;if(!e.nocomment&&t.charAt(0)==="#"){this.comment=true;return}if(!t){this.empty=true;return}this.parseNegate();this.globSet=[...new Set(this.braceExpand())];if(e.debug){this.debug=(...t)=>console.error(...t)}this.debug(this.pattern,this.globSet);const i=this.globSet.map((t=>this.slashSplit(t)));this.globParts=this.preprocess(i);this.debug(this.pattern,this.globParts);let s=this.globParts.map(((t,e,i)=>{if(this.isWindows&&this.windowsNoMagicRoot){const e=t[0]===""&&t[1]===""&&(t[2]==="?"||!wt.test(t[2]))&&!wt.test(t[3]);const i=/^[a-z]:/i.test(t[0]);if(e){return[...t.slice(0,4),...t.slice(4).map((t=>this.parse(t)))]}else if(i){return[t[0],...t.slice(1).map((t=>this.parse(t)))]}}return t.map((t=>this.parse(t)))}));this.debug(this.pattern,s);this.set=s.filter((t=>t.indexOf(false)===-1));if(this.isWindows){for(let t=0;t<this.set.length;t++){const e=this.set[t];if(e[0]===""&&e[1]===""&&this.globParts[t][2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3])){e[2]="?"}}}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar){for(let e=0;e<t.length;e++){for(let i=0;i<t[e].length;i++){if(t[e][i]==="**"){t[e][i]="*"}}}}const{optimizationLevel:e=1}=this.options;if(e>=2){t=this.firstPhasePreProcess(t);t=this.secondPhasePreProcess(t)}else if(e>=1){t=this.levelOneOptimize(t)}else{t=this.adjascentGlobstarOptimize(t)}return t}adjascentGlobstarOptimize(t){return t.map((t=>{let e=-1;while(-1!==(e=t.indexOf("**",e+1))){let i=e;while(t[i+1]==="**"){i++}if(i!==e){t.splice(e,i-e)}}return t}))}levelOneOptimize(t){return t.map((t=>{t=t.reduce(((t,e)=>{const i=t[t.length-1];if(e==="**"&&i==="**"){return t}if(e===".."){if(i&&i!==".."&&i!=="."&&i!=="**"){t.pop();return t}}t.push(e);return t}),[]);return t.length===0?[""]:t}))}levelTwoFileOptimize(t){if(!Array.isArray(t)){t=this.slashSplit(t)}let e=false;do{e=false;if(!this.preserveMultipleSlashes){for(let i=1;i<t.length-1;i++){const s=t[i];if(i===1&&s===""&&t[0]==="")continue;if(s==="."||s===""){e=true;t.splice(i,1);i--}}if(t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")){e=true;t.pop()}}let i=0;while(-1!==(i=t.indexOf("..",i+1))){const s=t[i-1];if(s&&s!=="."&&s!==".."&&s!=="**"){e=true;t.splice(i-1,2);i-=2}}}while(e);return t.length===0?[""]:t}firstPhasePreProcess(t){let e=false;do{e=false;for(let i of t){let s=-1;while(-1!==(s=i.indexOf("**",s+1))){let n=s;while(i[n+1]==="**"){n++}if(n>s){i.splice(s+1,n-s)}let r=i[s+1];const o=i[s+2];const a=i[s+3];if(r!=="..")continue;if(!o||o==="."||o===".."||!a||a==="."||a===".."){continue}e=true;i.splice(s,1);const c=i.slice(0);c[s]="**";t.push(c);s--}if(!this.preserveMultipleSlashes){for(let t=1;t<i.length-1;t++){const s=i[t];if(t===1&&s===""&&i[0]==="")continue;if(s==="."||s===""){e=true;i.splice(t,1);t--}}if(i[0]==="."&&i.length===2&&(i[1]==="."||i[1]==="")){e=true;i.pop()}}let n=0;while(-1!==(n=i.indexOf("..",n+1))){const t=i[n-1];if(t&&t!=="."&&t!==".."&&t!=="**"){e=true;const t=n===1&&i[n+1]==="**";const s=t?["."]:[];i.splice(n-1,2,...s);if(i.length===0)i.push("");n-=2}}}}while(e);return t}secondPhasePreProcess(t){for(let e=0;e<t.length-1;e++){for(let i=e+1;i<t.length;i++){const s=this.partsMatch(t[e],t[i],!this.preserveMultipleSlashes);if(!s)continue;t[e]=s;t[i]=[]}}return t.filter((t=>t.length))}partsMatch(t,e,i=false){let s=0;let n=0;let r=[];let o="";while(s<t.length&&n<e.length){if(t[s]===e[n]){r.push(o==="b"?e[n]:t[s]);s++;n++}else if(i&&t[s]==="**"&&e[n]===t[s+1]){r.push(t[s]);s++}else if(i&&e[n]==="**"&&t[s]===e[n+1]){r.push(e[n]);n++}else if(t[s]==="*"&&e[n]&&(this.options.dot||!e[n].startsWith("."))&&e[n]!=="**"){if(o==="b")return false;o="a";r.push(t[s]);s++;n++}else if(e[n]==="*"&&t[s]&&(this.options.dot||!t[s].startsWith("."))&&t[s]!=="**"){if(o==="a")return false;o="b";r.push(e[n]);s++;n++}else{return false}}return t.length===e.length&&r}parseNegate(){if(this.nonegate)return;const t=this.pattern;let e=false;let i=0;for(let s=0;s<t.length&&t.charAt(s)==="!";s++){e=!e;i++}if(i)this.pattern=t.slice(i);this.negate=e}matchOne(t,e,i=false){const s=this.options;if(this.isWindows){const i=typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0]);const s=!i&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]);const n=typeof e[0]==="string"&&/^[a-z]:$/i.test(e[0]);const r=!n&&e[0]===""&&e[1]===""&&e[2]==="?"&&typeof e[3]==="string"&&/^[a-z]:$/i.test(e[3]);const o=s?3:i?0:undefined;const a=r?3:n?0:undefined;if(typeof o==="number"&&typeof a==="number"){const[i,s]=[t[o],e[a]];if(i.toLowerCase()===s.toLowerCase()){e[a]=i;if(a>o){e=e.slice(a)}else if(o>a){t=t.slice(o)}}}}const{optimizationLevel:n=1}=this.options;if(n>=2){t=this.levelTwoFileOptimize(t)}this.debug("matchOne",this,{file:t,pattern:e});this.debug("matchOne",t.length,e.length);for(var r=0,o=0,a=t.length,c=e.length;r<a&&o<c;r++,o++){this.debug("matchOne loop");var l=e[o];var h=t[r];this.debug(e,l,h);if(l===false){return false}if(l===pt){this.debug("GLOBSTAR",[e,l,h]);var u=r;var f=o+1;if(f===c){this.debug("** at the end");for(;r<a;r++){if(t[r]==="."||t[r]===".."||!s.dot&&t[r].charAt(0)===".")return false}return true}while(u<a){var p=t[u];this.debug("\nglobstar while",t,u,e,f,p);if(this.matchOne(t.slice(u),e.slice(f),i)){this.debug("globstar found match!",u,a,p);return true}else{if(p==="."||p===".."||!s.dot&&p.charAt(0)==="."){this.debug("dot detected!",t,u,e,f);break}this.debug("globstar swallow a segment, and continue");u++}}if(i){this.debug("\n>>> no match, partial?",t,u,e,f);if(u===a){return true}}return false}let n;if(typeof l==="string"){n=h===l;this.debug("string match",l,h,n)}else{n=l.test(h);this.debug("pattern match",l,h,n)}if(!n)return false}if(r===a&&o===c){return true}else if(r===a){return i}else if(o===c){return r===a-1&&t[r]===""}else{throw new Error("wtf?")}}braceExpand(){return braceExpand(this.pattern,this.options)}parse(t){assertValidPattern(t);const e=this.options;if(t==="**")return pt;if(t==="")return"";let i;let s=null;if(i=t.match(ct)){s=e.dot?starTestDot:starTest}else if(i=t.match(rt)){s=(e.nocase?e.dot?starDotExtTestNocaseDot:starDotExtTestNocase:e.dot?starDotExtTestDot:starDotExtTest)(i[1])}else if(i=t.match(lt)){s=(e.nocase?e.dot?qmarksTestNocaseDot:qmarksTestNocase:e.dot?qmarksTestDot:qmarksTest)(i)}else if(i=t.match(ot)){s=e.dot?starDotStarTestDot:starDotStarTest}else if(i=t.match(at)){s=dotStarTest}const n=AST.fromGlob(t,this.options).toMMPattern();if(s&&typeof n==="object"){Reflect.defineProperty(n,"test",{value:s})}return n}makeRe(){if(this.regexp||this.regexp===false)return this.regexp;const t=this.set;if(!t.length){this.regexp=false;return this.regexp}const e=this.options;const i=e.noglobstar?mt:e.dot?gt:yt;const s=new Set(e.nocase?["i"]:[]);let n=t.map((t=>{const e=t.map((t=>{if(t instanceof RegExp){for(const e of t.flags.split(""))s.add(e)}return typeof t==="string"?esm_regExpEscape(t):t===pt?pt:t._src}));e.forEach(((t,s)=>{const n=e[s+1];const r=e[s-1];if(t!==pt||r===pt){return}if(r===undefined){if(n!==undefined&&n!==pt){e[s+1]="(?:\\/|"+i+"\\/)?"+n}else{e[s]=i}}else if(n===undefined){e[s-1]=r+"(?:\\/|"+i+")?"}else if(n!==pt){e[s-1]=r+"(?:\\/|\\/"+i+"\\/)"+n;e[s+1]=pt}}));return e.filter((t=>t!==pt)).join("/")})).join("|");const[r,o]=t.length>1?["(?:",")"]:["",""];n="^"+r+n+o+"$";if(this.negate)n="^(?!"+n+").+$";try{this.regexp=new RegExp(n,[...s].join(""))}catch(t){this.regexp=false}return this.regexp}slashSplit(t){if(this.preserveMultipleSlashes){return t.split("/")}else if(this.isWindows&&/^\/\/[^\/]+/.test(t)){return["",...t.split(/\/+/)]}else{return t.split(/\/+/)}}match(t,e=this.partial){this.debug("match",t,this.pattern);if(this.comment){return false}if(this.empty){return t===""}if(t==="/"&&e){return true}const i=this.options;if(this.isWindows){t=t.split("\\").join("/")}const s=this.slashSplit(t);this.debug(this.pattern,"split",s);const n=this.set;this.debug(this.pattern,"set",n);let r=s[s.length-1];if(!r){for(let t=s.length-2;!r&&t>=0;t--){r=s[t]}}for(let t=0;t<n.length;t++){const o=n[t];let a=s;if(i.matchBase&&o.length===1){a=[r]}const c=this.matchOne(a,o,e);if(c){if(i.flipNegate){return true}return!this.negate}}if(i.flipNegate){return false}return this.negate}static defaults(t){return minimatch.defaults(t).Minimatch}}minimatch.AST=AST;minimatch.Minimatch=Minimatch;minimatch.escape=escape_escape;minimatch.unescape=unescape_unescape;const bt=typeof performance==="object"&&performance&&typeof performance.now==="function"?performance:Date;const St=new Set;const vt=typeof process==="object"&&!!process?process:{};const emitWarning=(t,e,i,s)=>{typeof vt.emitWarning==="function"?vt.emitWarning(t,e,i,s):console.error(`[${i}] ${e}: ${t}`)};let _t=globalThis.AbortController;let kt=globalThis.AbortSignal;if(typeof _t==="undefined"){kt=class AbortSignal{onabort;_onabort=[];reason;aborted=false;addEventListener(t,e){this._onabort.push(e)}};_t=class AbortController{constructor(){warnACPolyfill()}signal=new kt;abort(t){if(this.signal.aborted)return;this.signal.reason=t;this.signal.aborted=true;for(const e of this.signal._onabort){e(t)}this.signal.onabort?.(t)}};let t=vt.env?.LRU_CACHE_IGNORE_AC_WARNING!=="1";const warnACPolyfill=()=>{if(!t)return;t=false;emitWarning("AbortController is not defined. If using lru-cache in "+"node 14, load an AbortController polyfill from the "+"`node-abort-controller` package. A minimal polyfill is "+"provided for use by LRUCache.fetch(), but it should not be "+"relied upon in other contexts (eg, passing it to other APIs that "+"use AbortController/AbortSignal might have undesirable effects). "+"You may disable this with LRU_CACHE_IGNORE_AC_WARNING=1 in the env.","NO_ABORT_CONTROLLER","ENOTSUP",warnACPolyfill)}}const shouldWarn=t=>!St.has(t);const xt=Symbol("type");const isPosInt=t=>t&&t===Math.floor(t)&&t>0&&isFinite(t);const getUintArray=t=>!isPosInt(t)?null:t<=Math.pow(2,8)?Uint8Array:t<=Math.pow(2,16)?Uint16Array:t<=Math.pow(2,32)?Uint32Array:t<=Number.MAX_SAFE_INTEGER?ZeroArray:null;class ZeroArray extends Array{constructor(t){super(t);this.fill(0)}}class Stack{heap;length;static#m=false;static create(t){const e=getUintArray(t);if(!e)return[];Stack.#m=true;const i=new Stack(t,e);Stack.#m=false;return i}constructor(t,e){if(!Stack.#m){throw new TypeError("instantiate Stack using Stack.create(n)")}this.heap=new e(t);this.length=0}push(t){this.heap[this.length++]=t}pop(){return this.heap[--this.length]}}class LRUCache{#g;#y;#w;#b;#S;ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;#v;#_;#k;#x;#O;#E;#A;#C;#F;#P;#T;#L;#M;#R;#D;#N;#$;static unsafeExposeInternals(t){return{starts:t.#M,ttls:t.#R,sizes:t.#L,keyMap:t.#k,keyList:t.#x,valList:t.#O,next:t.#E,prev:t.#A,get head(){return t.#C},get tail(){return t.#F},free:t.#P,isBackgroundFetch:e=>t.#j(e),backgroundFetch:(e,i,s,n)=>t.#I(e,i,s,n),moveToTail:e=>t.#W(e),indexes:e=>t.#B(e),rindexes:e=>t.#z(e),isStale:e=>t.#H(e)}}get max(){return this.#g}get maxSize(){return this.#y}get calculatedSize(){return this.#_}get size(){return this.#v}get fetchMethod(){return this.#S}get dispose(){return this.#w}get disposeAfter(){return this.#b}constructor(t){const{max:e=0,ttl:i,ttlResolution:s=1,ttlAutopurge:n,updateAgeOnGet:r,updateAgeOnHas:o,allowStale:a,dispose:c,disposeAfter:l,noDisposeOnSet:h,noUpdateTTL:u,maxSize:f=0,maxEntrySize:p=0,sizeCalculation:d,fetchMethod:g,noDeleteOnFetchRejection:y,noDeleteOnStaleGet:w,allowStaleOnFetchRejection:b,allowStaleOnFetchAbort:S,ignoreFetchAbort:v}=t;if(e!==0&&!isPosInt(e)){throw new TypeError("max option must be a nonnegative integer")}const _=e?getUintArray(e):Array;if(!_){throw new Error("invalid max value: "+e)}this.#g=e;this.#y=f;this.maxEntrySize=p||this.#y;this.sizeCalculation=d;if(this.sizeCalculation){if(!this.#y&&!this.maxEntrySize){throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize")}if(typeof this.sizeCalculation!=="function"){throw new TypeError("sizeCalculation set to non-function")}}if(g!==undefined&&typeof g!=="function"){throw new TypeError("fetchMethod must be a function if specified")}this.#S=g;this.#N=!!g;this.#k=new Map;this.#x=new Array(e).fill(undefined);this.#O=new Array(e).fill(undefined);this.#E=new _(e);this.#A=new _(e);this.#C=0;this.#F=0;this.#P=Stack.create(e);this.#v=0;this.#_=0;if(typeof c==="function"){this.#w=c}if(typeof l==="function"){this.#b=l;this.#T=[]}else{this.#b=undefined;this.#T=undefined}this.#D=!!this.#w;this.#$=!!this.#b;this.noDisposeOnSet=!!h;this.noUpdateTTL=!!u;this.noDeleteOnFetchRejection=!!y;this.allowStaleOnFetchRejection=!!b;this.allowStaleOnFetchAbort=!!S;this.ignoreFetchAbort=!!v;if(this.maxEntrySize!==0){if(this.#y!==0){if(!isPosInt(this.#y)){throw new TypeError("maxSize must be a positive integer if specified")}}if(!isPosInt(this.maxEntrySize)){throw new TypeError("maxEntrySize must be a positive integer if specified")}this.#V()}this.allowStale=!!a;this.noDeleteOnStaleGet=!!w;this.updateAgeOnGet=!!r;this.updateAgeOnHas=!!o;this.ttlResolution=isPosInt(s)||s===0?s:1;this.ttlAutopurge=!!n;this.ttl=i||0;if(this.ttl){if(!isPosInt(this.ttl)){throw new TypeError("ttl must be a positive integer if specified")}this.#G()}if(this.#g===0&&this.ttl===0&&this.#y===0){throw new TypeError("At least one of max, maxSize, or ttl is required")}if(!this.ttlAutopurge&&!this.#g&&!this.#y){const t="LRU_CACHE_UNBOUNDED";if(shouldWarn(t)){St.add(t);const e="TTL caching without ttlAutopurge, max, or maxSize can "+"result in unbounded memory consumption.";emitWarning(e,"UnboundedCacheWarning",t,LRUCache)}}}getRemainingTTL(t){return this.#k.has(t)?Infinity:0}#G(){const t=new ZeroArray(this.#g);const e=new ZeroArray(this.#g);this.#R=t;this.#M=e;this.#U=(i,s,n=bt.now())=>{e[i]=s!==0?n:0;t[i]=s;if(s!==0&&this.ttlAutopurge){const t=setTimeout((()=>{if(this.#H(i)){this.delete(this.#x[i])}}),s+1);if(t.unref){t.unref()}}};this.#q=i=>{e[i]=t[i]!==0?bt.now():0};this.#J=(s,n)=>{if(t[n]){const r=t[n];const o=e[n];if(!r||!o)return;s.ttl=r;s.start=o;s.now=i||getNow();const a=s.now-o;s.remainingTTL=r-a}};let i=0;const getNow=()=>{const t=bt.now();if(this.ttlResolution>0){i=t;const e=setTimeout((()=>i=0),this.ttlResolution);if(e.unref){e.unref()}}return t};this.getRemainingTTL=s=>{const n=this.#k.get(s);if(n===undefined){return 0}const r=t[n];const o=e[n];if(!r||!o){return Infinity}const a=(i||getNow())-o;return r-a};this.#H=s=>{const n=e[s];const r=t[s];return!!r&&!!n&&(i||getNow())-n>r}}#q=()=>{};#J=()=>{};#U=()=>{};#H=()=>false;#V(){const t=new ZeroArray(this.#g);this.#_=0;this.#L=t;this.#Y=e=>{this.#_-=t[e];t[e]=0};this.#K=(t,e,i,s)=>{if(this.#j(e)){return 0}if(!isPosInt(i)){if(s){if(typeof s!=="function"){throw new TypeError("sizeCalculation must be a function")}i=s(e,t);if(!isPosInt(i)){throw new TypeError("sizeCalculation return invalid (expect positive integer)")}}else{throw new TypeError("invalid size value (must be positive integer). "+"When maxSize or maxEntrySize is used, sizeCalculation "+"or size must be set.")}}return i};this.#Z=(e,i,s)=>{t[e]=i;if(this.#y){const i=this.#y-t[e];while(this.#_>i){this.#Q(true)}}this.#_+=t[e];if(s){s.entrySize=i;s.totalCalculatedSize=this.#_}}}#Y=t=>{};#Z=(t,e,i)=>{};#K=(t,e,i,s)=>{if(i||s){throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache")}return 0};*#B({allowStale:t=this.allowStale}={}){if(this.#v){for(let e=this.#F;true;){if(!this.#X(e)){break}if(t||!this.#H(e)){yield e}if(e===this.#C){break}else{e=this.#A[e]}}}}*#z({allowStale:t=this.allowStale}={}){if(this.#v){for(let e=this.#C;true;){if(!this.#X(e)){break}if(t||!this.#H(e)){yield e}if(e===this.#F){break}else{e=this.#E[e]}}}}#X(t){return t!==undefined&&this.#k.get(this.#x[t])===t}*entries(){for(const t of this.#B()){if(this.#O[t]!==undefined&&this.#x[t]!==undefined&&!this.#j(this.#O[t])){yield[this.#x[t],this.#O[t]]}}}*rentries(){for(const t of this.#z()){if(this.#O[t]!==undefined&&this.#x[t]!==undefined&&!this.#j(this.#O[t])){yield[this.#x[t],this.#O[t]]}}}*keys(){for(const t of this.#B()){const e=this.#x[t];if(e!==undefined&&!this.#j(this.#O[t])){yield e}}}*rkeys(){for(const t of this.#z()){const e=this.#x[t];if(e!==undefined&&!this.#j(this.#O[t])){yield e}}}*values(){for(const t of this.#B()){const e=this.#O[t];if(e!==undefined&&!this.#j(this.#O[t])){yield this.#O[t]}}}*rvalues(){for(const t of this.#z()){const e=this.#O[t];if(e!==undefined&&!this.#j(this.#O[t])){yield this.#O[t]}}}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(t,e={}){for(const i of this.#B()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;if(t(n,this.#x[i],this)){return this.get(this.#x[i],e)}}}forEach(t,e=this){for(const i of this.#B()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#x[i],this)}}rforEach(t,e=this){for(const i of this.#z()){const s=this.#O[i];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined)continue;t.call(e,n,this.#x[i],this)}}purgeStale(){let t=false;for(const e of this.#z({allowStale:true})){if(this.#H(e)){this.delete(this.#x[e]);t=true}}return t}info(t){const e=this.#k.get(t);if(e===undefined)return undefined;const i=this.#O[e];const s=this.#j(i)?i.__staleWhileFetching:i;if(s===undefined)return undefined;const n={value:s};if(this.#R&&this.#M){const t=this.#R[e];const i=this.#M[e];if(t&&i){const e=t-(bt.now()-i);n.ttl=e;n.start=Date.now()}}if(this.#L){n.size=this.#L[e]}return n}dump(){const t=[];for(const e of this.#B({allowStale:true})){const i=this.#x[e];const s=this.#O[e];const n=this.#j(s)?s.__staleWhileFetching:s;if(n===undefined||i===undefined)continue;const r={value:n};if(this.#R&&this.#M){r.ttl=this.#R[e];const t=bt.now()-this.#M[e];r.start=Math.floor(Date.now()-t)}if(this.#L){r.size=this.#L[e]}t.unshift([i,r])}return t}load(t){this.clear();for(const[e,i]of t){if(i.start){const t=Date.now()-i.start;i.start=bt.now()-t}this.set(e,i.value,i)}}set(t,e,i={}){if(e===undefined){this.delete(t);return this}const{ttl:s=this.ttl,start:n,noDisposeOnSet:r=this.noDisposeOnSet,sizeCalculation:o=this.sizeCalculation,status:a}=i;let{noUpdateTTL:c=this.noUpdateTTL}=i;const l=this.#K(t,e,i.size||0,o);if(this.maxEntrySize&&l>this.maxEntrySize){if(a){a.set="miss";a.maxEntrySizeExceeded=true}this.delete(t);return this}let h=this.#v===0?undefined:this.#k.get(t);if(h===undefined){h=this.#v===0?this.#F:this.#P.length!==0?this.#P.pop():this.#v===this.#g?this.#Q(false):this.#v;this.#x[h]=t;this.#O[h]=e;this.#k.set(t,h);this.#E[this.#F]=h;this.#A[h]=this.#F;this.#F=h;this.#v++;this.#Z(h,l,a);if(a)a.set="add";c=false}else{this.#W(h);const i=this.#O[h];if(e!==i){if(this.#N&&this.#j(i)){i.__abortController.abort(new Error("replaced"));const{__staleWhileFetching:e}=i;if(e!==undefined&&!r){if(this.#D){this.#w?.(e,t,"set")}if(this.#$){this.#T?.push([e,t,"set"])}}}else if(!r){if(this.#D){this.#w?.(i,t,"set")}if(this.#$){this.#T?.push([i,t,"set"])}}this.#Y(h);this.#Z(h,l,a);this.#O[h]=e;if(a){a.set="replace";const t=i&&this.#j(i)?i.__staleWhileFetching:i;if(t!==undefined)a.oldValue=t}}else if(a){a.set="update"}}if(s!==0&&!this.#R){this.#G()}if(this.#R){if(!c){this.#U(h,s,n)}if(a)this.#J(a,h)}if(!r&&this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}return this}pop(){try{while(this.#v){const t=this.#O[this.#C];this.#Q(true);if(this.#j(t)){if(t.__staleWhileFetching){return t.__staleWhileFetching}}else if(t!==undefined){return t}}}finally{if(this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}}}#Q(t){const e=this.#C;const i=this.#x[e];const s=this.#O[e];if(this.#N&&this.#j(s)){s.__abortController.abort(new Error("evicted"))}else if(this.#D||this.#$){if(this.#D){this.#w?.(s,i,"evict")}if(this.#$){this.#T?.push([s,i,"evict"])}}this.#Y(e);if(t){this.#x[e]=undefined;this.#O[e]=undefined;this.#P.push(e)}if(this.#v===1){this.#C=this.#F=0;this.#P.length=0}else{this.#C=this.#E[e]}this.#k.delete(i);this.#v--;return e}has(t,e={}){const{updateAgeOnHas:i=this.updateAgeOnHas,status:s}=e;const n=this.#k.get(t);if(n!==undefined){const t=this.#O[n];if(this.#j(t)&&t.__staleWhileFetching===undefined){return false}if(!this.#H(n)){if(i){this.#q(n)}if(s){s.has="hit";this.#J(s,n)}return true}else if(s){s.has="stale";this.#J(s,n)}}else if(s){s.has="miss"}return false}peek(t,e={}){const{allowStale:i=this.allowStale}=e;const s=this.#k.get(t);if(s===undefined||!i&&this.#H(s)){return}const n=this.#O[s];return this.#j(n)?n.__staleWhileFetching:n}#I(t,e,i,s){const n=e===undefined?undefined:this.#O[e];if(this.#j(n)){return n}const r=new _t;const{signal:o}=i;o?.addEventListener("abort",(()=>r.abort(o.reason)),{signal:r.signal});const a={signal:r.signal,options:i,context:s};const cb=(s,n=false)=>{const{aborted:o}=r.signal;const l=i.ignoreFetchAbort&&s!==undefined;if(i.status){if(o&&!n){i.status.fetchAborted=true;i.status.fetchError=r.signal.reason;if(l)i.status.fetchAbortIgnored=true}else{i.status.fetchResolved=true}}if(o&&!l&&!n){return fetchFail(r.signal.reason)}const h=c;if(this.#O[e]===c){if(s===undefined){if(h.__staleWhileFetching){this.#O[e]=h.__staleWhileFetching}else{this.delete(t)}}else{if(i.status)i.status.fetchUpdated=true;this.set(t,s,a.options)}}return s};const eb=t=>{if(i.status){i.status.fetchRejected=true;i.status.fetchError=t}return fetchFail(t)};const fetchFail=s=>{const{aborted:n}=r.signal;const o=n&&i.allowStaleOnFetchAbort;const a=o||i.allowStaleOnFetchRejection;const l=a||i.noDeleteOnFetchRejection;const h=c;if(this.#O[e]===c){const i=!l||h.__staleWhileFetching===undefined;if(i){this.delete(t)}else if(!o){this.#O[e]=h.__staleWhileFetching}}if(a){if(i.status&&h.__staleWhileFetching!==undefined){i.status.returnedStale=true}return h.__staleWhileFetching}else if(h.__returned===h){throw s}};const pcall=(e,s)=>{const o=this.#S?.(t,n,a);if(o&&o instanceof Promise){o.then((t=>e(t===undefined?undefined:t)),s)}r.signal.addEventListener("abort",(()=>{if(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort){e(undefined);if(i.allowStaleOnFetchAbort){e=t=>cb(t,true)}}}))};if(i.status)i.status.fetchDispatched=true;const c=new Promise(pcall).then(cb,eb);const l=Object.assign(c,{__abortController:r,__staleWhileFetching:n,__returned:undefined});if(e===undefined){this.set(t,l,{...a.options,status:undefined});e=this.#k.get(t)}else{this.#O[e]=l}return l}#j(t){if(!this.#N)return false;const e=t;return!!e&&e instanceof Promise&&e.hasOwnProperty("__staleWhileFetching")&&e.__abortController instanceof _t}async fetch(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,ttl:r=this.ttl,noDisposeOnSet:o=this.noDisposeOnSet,size:a=0,sizeCalculation:c=this.sizeCalculation,noUpdateTTL:l=this.noUpdateTTL,noDeleteOnFetchRejection:h=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:u=this.allowStaleOnFetchRejection,ignoreFetchAbort:f=this.ignoreFetchAbort,allowStaleOnFetchAbort:p=this.allowStaleOnFetchAbort,context:d,forceRefresh:g=false,status:y,signal:w}=e;if(!this.#N){if(y)y.fetch="get";return this.get(t,{allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,status:y})}const b={allowStale:i,updateAgeOnGet:s,noDeleteOnStaleGet:n,ttl:r,noDisposeOnSet:o,size:a,sizeCalculation:c,noUpdateTTL:l,noDeleteOnFetchRejection:h,allowStaleOnFetchRejection:u,allowStaleOnFetchAbort:p,ignoreFetchAbort:f,status:y,signal:w};let S=this.#k.get(t);if(S===undefined){if(y)y.fetch="miss";const e=this.#I(t,S,b,d);return e.__returned=e}else{const e=this.#O[S];if(this.#j(e)){const t=i&&e.__staleWhileFetching!==undefined;if(y){y.fetch="inflight";if(t)y.returnedStale=true}return t?e.__staleWhileFetching:e.__returned=e}const n=this.#H(S);if(!g&&!n){if(y)y.fetch="hit";this.#W(S);if(s){this.#q(S)}if(y)this.#J(y,S);return e}const r=this.#I(t,S,b,d);const o=r.__staleWhileFetching!==undefined;const a=o&&i;if(y){y.fetch=n?"stale":"refresh";if(a&&n)y.returnedStale=true}return a?r.__staleWhileFetching:r.__returned=r}}get(t,e={}){const{allowStale:i=this.allowStale,updateAgeOnGet:s=this.updateAgeOnGet,noDeleteOnStaleGet:n=this.noDeleteOnStaleGet,status:r}=e;const o=this.#k.get(t);if(o!==undefined){const e=this.#O[o];const a=this.#j(e);if(r)this.#J(r,o);if(this.#H(o)){if(r)r.get="stale";if(!a){if(!n){this.delete(t)}if(r&&i)r.returnedStale=true;return i?e:undefined}else{if(r&&i&&e.__staleWhileFetching!==undefined){r.returnedStale=true}return i?e.__staleWhileFetching:undefined}}else{if(r)r.get="hit";if(a){return e.__staleWhileFetching}this.#W(o);if(s){this.#q(o)}return e}}else if(r){r.get="miss"}}#tt(t,e){this.#A[e]=t;this.#E[t]=e}#W(t){if(t!==this.#F){if(t===this.#C){this.#C=this.#E[t]}else{this.#tt(this.#A[t],this.#E[t])}this.#tt(this.#F,t);this.#F=t}}delete(t){let e=false;if(this.#v!==0){const i=this.#k.get(t);if(i!==undefined){e=true;if(this.#v===1){this.clear()}else{this.#Y(i);const e=this.#O[i];if(this.#j(e)){e.__abortController.abort(new Error("deleted"))}else if(this.#D||this.#$){if(this.#D){this.#w?.(e,t,"delete")}if(this.#$){this.#T?.push([e,t,"delete"])}}this.#k.delete(t);this.#x[i]=undefined;this.#O[i]=undefined;if(i===this.#F){this.#F=this.#A[i]}else if(i===this.#C){this.#C=this.#E[i]}else{const t=this.#A[i];this.#E[t]=this.#E[i];const e=this.#E[i];this.#A[e]=this.#A[i]}this.#v--;this.#P.push(i)}}}if(this.#$&&this.#T?.length){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}return e}clear(){for(const t of this.#z({allowStale:true})){const e=this.#O[t];if(this.#j(e)){e.__abortController.abort(new Error("deleted"))}else{const i=this.#x[t];if(this.#D){this.#w?.(e,i,"delete")}if(this.#$){this.#T?.push([e,i,"delete"])}}}this.#k.clear();this.#O.fill(undefined);this.#x.fill(undefined);if(this.#R&&this.#M){this.#R.fill(0);this.#M.fill(0)}if(this.#L){this.#L.fill(0)}this.#C=0;this.#F=0;this.#P.length=0;this.#_=0;this.#v=0;if(this.#$&&this.#T){const t=this.#T;let e;while(e=t?.shift()){this.#b?.(...e)}}}}var Ot=__nccwpck_require__(7147);var Et=__nccwpck_require__(7561);var At=__nccwpck_require__.t(Et,2);const Ct=t(import.meta.url)("node:fs/promises");var Ft=__nccwpck_require__.n(Ct);var Pt=__nccwpck_require__(5673);const Tt=t(import.meta.url)("node:stream");const Lt=t(import.meta.url)("node:string_decoder");const Mt=typeof process==="object"&&process?process:{stdout:null,stderr:null};const isStream=t=>!!t&&typeof t==="object"&&(t instanceof Minipass||t instanceof Tt||isReadable(t)||isWritable(t));const isReadable=t=>!!t&&typeof t==="object"&&t instanceof Pt.EventEmitter&&typeof t.pipe==="function"&&t.pipe!==Tt.Writable.prototype.pipe;const isWritable=t=>!!t&&typeof t==="object"&&t instanceof Pt.EventEmitter&&typeof t.write==="function"&&typeof t.end==="function";const Rt=Symbol("EOF");const Dt=Symbol("maybeEmitEnd");const Nt=Symbol("emittedEnd");const $t=Symbol("emittingEnd");const jt=Symbol("emittedError");const It=Symbol("closed");const Wt=Symbol("read");const Bt=Symbol("flush");const zt=Symbol("flushChunk");const Ht=Symbol("encoding");const Vt=Symbol("decoder");const Gt=Symbol("flowing");const Ut=Symbol("paused");const qt=Symbol("resume");const Jt=Symbol("buffer");const Yt=Symbol("pipes");const Kt=Symbol("bufferLength");const Zt=Symbol("bufferPush");const Qt=Symbol("bufferShift");const Xt=Symbol("objectMode");const te=Symbol("destroyed");const ee=Symbol("error");const ie=Symbol("emitData");const se=Symbol("emitEnd");const ne=Symbol("emitEnd2");const re=Symbol("async");const oe=Symbol("abort");const ae=Symbol("aborted");const ce=Symbol("signal");const le=Symbol("dataListeners");const he=Symbol("discarded");const defer=t=>Promise.resolve().then(t);const nodefer=t=>t();const isEndish=t=>t==="end"||t==="finish"||t==="prefinish";const isArrayBufferLike=t=>t instanceof ArrayBuffer||!!t&&typeof t==="object"&&t.constructor&&t.constructor.name==="ArrayBuffer"&&t.byteLength>=0;const isArrayBufferView=t=>!Buffer.isBuffer(t)&&ArrayBuffer.isView(t);class Pipe{src;dest;opts;ondrain;constructor(t,e,i){this.src=t;this.dest=e;this.opts=i;this.ondrain=()=>t[qt]();this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(t){}end(){this.unpipe();if(this.opts.end)this.dest.end()}}class PipeProxyErrors extends Pipe{unpipe(){this.src.removeListener("error",this.proxyErrors);super.unpipe()}constructor(t,e,i){super(t,e,i);this.proxyErrors=t=>e.emit("error",t);t.on("error",this.proxyErrors)}}const isObjectModeOptions=t=>!!t.objectMode;const isEncodingOptions=t=>!t.objectMode&&!!t.encoding&&t.encoding!=="buffer";class Minipass extends Pt.EventEmitter{[Gt]=false;[Ut]=false;[Yt]=[];[Jt]=[];[Xt];[Ht];[re];[Vt];[Rt]=false;[Nt]=false;[$t]=false;[It]=false;[jt]=null;[Kt]=0;[te]=false;[ce];[ae]=false;[le]=0;[he]=false;writable=true;readable=true;constructor(...t){const e=t[0]||{};super();if(e.objectMode&&typeof e.encoding==="string"){throw new TypeError("Encoding and objectMode may not be used together")}if(isObjectModeOptions(e)){this[Xt]=true;this[Ht]=null}else if(isEncodingOptions(e)){this[Ht]=e.encoding;this[Xt]=false}else{this[Xt]=false;this[Ht]=null}this[re]=!!e.async;this[Vt]=this[Ht]?new Lt.StringDecoder(this[Ht]):null;if(e&&e.debugExposeBuffer===true){Object.defineProperty(this,"buffer",{get:()=>this[Jt]})}if(e&&e.debugExposePipes===true){Object.defineProperty(this,"pipes",{get:()=>this[Yt]})}const{signal:i}=e;if(i){this[ce]=i;if(i.aborted){this[oe]()}else{i.addEventListener("abort",(()=>this[oe]()))}}}get bufferLength(){return this[Kt]}get encoding(){return this[Ht]}set encoding(t){throw new Error("Encoding must be set at instantiation time")}setEncoding(t){throw new Error("Encoding must be set at instantiation time")}get objectMode(){return this[Xt]}set objectMode(t){throw new Error("objectMode must be set at instantiation time")}get["async"](){return this[re]}set["async"](t){this[re]=this[re]||!!t}[oe](){this[ae]=true;this.emit("abort",this[ce]?.reason);this.destroy(this[ce]?.reason)}get aborted(){return this[ae]}set aborted(t){}write(t,e,i){if(this[ae])return false;if(this[Rt])throw new Error("write after end");if(this[te]){this.emit("error",Object.assign(new Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"}));return true}if(typeof e==="function"){i=e;e="utf8"}if(!e)e="utf8";const s=this[re]?defer:nodefer;if(!this[Xt]&&!Buffer.isBuffer(t)){if(isArrayBufferView(t)){t=Buffer.from(t.buffer,t.byteOffset,t.byteLength)}else if(isArrayBufferLike(t)){t=Buffer.from(t)}else if(typeof t!=="string"){throw new Error("Non-contiguous data written to non-objectMode stream")}}if(this[Xt]){if(this[Gt]&&this[Kt]!==0)this[Bt](true);if(this[Gt])this.emit("data",t);else this[Zt](t);if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}if(!t.length){if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}if(typeof t==="string"&&!(e===this[Ht]&&!this[Vt]?.lastNeed)){t=Buffer.from(t,e)}if(Buffer.isBuffer(t)&&this[Ht]){t=this[Vt].write(t)}if(this[Gt]&&this[Kt]!==0)this[Bt](true);if(this[Gt])this.emit("data",t);else this[Zt](t);if(this[Kt]!==0)this.emit("readable");if(i)s(i);return this[Gt]}read(t){if(this[te])return null;this[he]=false;if(this[Kt]===0||t===0||t&&t>this[Kt]){this[Dt]();return null}if(this[Xt])t=null;if(this[Jt].length>1&&!this[Xt]){this[Jt]=[this[Ht]?this[Jt].join(""):Buffer.concat(this[Jt],this[Kt])]}const e=this[Wt](t||null,this[Jt][0]);this[Dt]();return e}[Wt](t,e){if(this[Xt])this[Qt]();else{const i=e;if(t===i.length||t===null)this[Qt]();else if(typeof i==="string"){this[Jt][0]=i.slice(t);e=i.slice(0,t);this[Kt]-=t}else{this[Jt][0]=i.subarray(t);e=i.subarray(0,t);this[Kt]-=t}}this.emit("data",e);if(!this[Jt].length&&!this[Rt])this.emit("drain");return e}end(t,e,i){if(typeof t==="function"){i=t;t=undefined}if(typeof e==="function"){i=e;e="utf8"}if(t!==undefined)this.write(t,e);if(i)this.once("end",i);this[Rt]=true;this.writable=false;if(this[Gt]||!this[Ut])this[Dt]();return this}[qt](){if(this[te])return;if(!this[le]&&!this[Yt].length){this[he]=true}this[Ut]=false;this[Gt]=true;this.emit("resume");if(this[Jt].length)this[Bt]();else if(this[Rt])this[Dt]();else this.emit("drain")}resume(){return this[qt]()}pause(){this[Gt]=false;this[Ut]=true;this[he]=false}get destroyed(){return this[te]}get flowing(){return this[Gt]}get paused(){return this[Ut]}[Zt](t){if(this[Xt])this[Kt]+=1;else this[Kt]+=t.length;this[Jt].push(t)}[Qt](){if(this[Xt])this[Kt]-=1;else this[Kt]-=this[Jt][0].length;return this[Jt].shift()}[Bt](t=false){do{}while(this[zt](this[Qt]())&&this[Jt].length);if(!t&&!this[Jt].length&&!this[Rt])this.emit("drain")}[zt](t){this.emit("data",t);return this[Gt]}pipe(t,e){if(this[te])return t;this[he]=false;const i=this[Nt];e=e||{};if(t===Mt.stdout||t===Mt.stderr)e.end=false;else e.end=e.end!==false;e.proxyErrors=!!e.proxyErrors;if(i){if(e.end)t.end()}else{this[Yt].push(!e.proxyErrors?new Pipe(this,t,e):new PipeProxyErrors(this,t,e));if(this[re])defer((()=>this[qt]()));else this[qt]()}return t}unpipe(t){const e=this[Yt].find((e=>e.dest===t));if(e){if(this[Yt].length===1){if(this[Gt]&&this[le]===0){this[Gt]=false}this[Yt]=[]}else this[Yt].splice(this[Yt].indexOf(e),1);e.unpipe()}}addListener(t,e){return this.on(t,e)}on(t,e){const i=super.on(t,e);if(t==="data"){this[he]=false;this[le]++;if(!this[Yt].length&&!this[Gt]){this[qt]()}}else if(t==="readable"&&this[Kt]!==0){super.emit("readable")}else if(isEndish(t)&&this[Nt]){super.emit(t);this.removeAllListeners(t)}else if(t==="error"&&this[jt]){const t=e;if(this[re])defer((()=>t.call(this,this[jt])));else t.call(this,this[jt])}return i}removeListener(t,e){return this.off(t,e)}off(t,e){const i=super.off(t,e);if(t==="data"){this[le]=this.listeners("data").length;if(this[le]===0&&!this[he]&&!this[Yt].length){this[Gt]=false}}return i}removeAllListeners(t){const e=super.removeAllListeners(t);if(t==="data"||t===undefined){this[le]=0;if(!this[he]&&!this[Yt].length){this[Gt]=false}}return e}get emittedEnd(){return this[Nt]}[Dt](){if(!this[$t]&&!this[Nt]&&!this[te]&&this[Jt].length===0&&this[Rt]){this[$t]=true;this.emit("end");this.emit("prefinish");this.emit("finish");if(this[It])this.emit("close");this[$t]=false}}emit(t,...e){const i=e[0];if(t!=="error"&&t!=="close"&&t!==te&&this[te]){return false}else if(t==="data"){return!this[Xt]&&!i?false:this[re]?(defer((()=>this[ie](i))),true):this[ie](i)}else if(t==="end"){return this[se]()}else if(t==="close"){this[It]=true;if(!this[Nt]&&!this[te])return false;const t=super.emit("close");this.removeAllListeners("close");return t}else if(t==="error"){this[jt]=i;super.emit(ee,i);const t=!this[ce]||this.listeners("error").length?super.emit("error",i):false;this[Dt]();return t}else if(t==="resume"){const t=super.emit("resume");this[Dt]();return t}else if(t==="finish"||t==="prefinish"){const e=super.emit(t);this.removeAllListeners(t);return e}const s=super.emit(t,...e);this[Dt]();return s}[ie](t){for(const e of this[Yt]){if(e.dest.write(t)===false)this.pause()}const e=this[he]?false:super.emit("data",t);this[Dt]();return e}[se](){if(this[Nt])return false;this[Nt]=true;this.readable=false;return this[re]?(defer((()=>this[ne]())),true):this[ne]()}[ne](){if(this[Vt]){const t=this[Vt].end();if(t){for(const e of this[Yt]){e.dest.write(t)}if(!this[he])super.emit("data",t)}}for(const t of this[Yt]){t.end()}const t=super.emit("end");this.removeAllListeners("end");return t}async collect(){const t=Object.assign([],{dataLength:0});if(!this[Xt])t.dataLength=0;const e=this.promise();this.on("data",(e=>{t.push(e);if(!this[Xt])t.dataLength+=e.length}));await e;return t}async concat(){if(this[Xt]){throw new Error("cannot concat in objectMode")}const t=await this.collect();return this[Ht]?t.join(""):Buffer.concat(t,t.dataLength)}async promise(){return new Promise(((t,e)=>{this.on(te,(()=>e(new Error("stream destroyed"))));this.on("error",(t=>e(t)));this.on("end",(()=>t()))}))}[Symbol.asyncIterator](){this[he]=false;let t=false;const stop=async()=>{this.pause();t=true;return{value:undefined,done:true}};const next=()=>{if(t)return stop();const e=this.read();if(e!==null)return Promise.resolve({done:false,value:e});if(this[Rt])return stop();let i;let s;const onerr=t=>{this.off("data",ondata);this.off("end",onend);this.off(te,ondestroy);stop();s(t)};const ondata=t=>{this.off("error",onerr);this.off("end",onend);this.off(te,ondestroy);this.pause();i({value:t,done:!!this[Rt]})};const onend=()=>{this.off("error",onerr);this.off("data",ondata);this.off(te,ondestroy);stop();i({done:true,value:undefined})};const ondestroy=()=>onerr(new Error("stream destroyed"));return new Promise(((t,e)=>{s=e;i=t;this.once(te,ondestroy);this.once("error",onerr);this.once("end",onend);this.once("data",ondata)}))};return{next:next,throw:stop,return:stop,[Symbol.asyncIterator](){return this}}}[Symbol.iterator](){this[he]=false;let t=false;const stop=()=>{this.pause();this.off(ee,stop);this.off(te,stop);this.off("end",stop);t=true;return{done:true,value:undefined}};const next=()=>{if(t)return stop();const e=this.read();return e===null?stop():{done:false,value:e}};this.once("end",stop);this.once(ee,stop);this.once(te,stop);return{next:next,throw:stop,return:stop,[Symbol.iterator](){return this}}}destroy(t){if(this[te]){if(t)this.emit("error",t);else this.emit(te);return this}this[te]=true;this[he]=true;this[Jt].length=0;this[Kt]=0;const e=this;if(typeof e.close==="function"&&!this[It])e.close();if(t)this.emit("error",t);else this.emit(te);return this}static get isStream(){return isStream}}const ue=Ot.realpathSync.native;const fe={lstatSync:Ot.lstatSync,readdir:Ot.readdir,readdirSync:Ot.readdirSync,readlinkSync:Ot.readlinkSync,realpathSync:ue,promises:{lstat:Ct.lstat,readdir:Ct.readdir,readlink:Ct.readlink,realpath:Ct.realpath}};const fsFromOption=t=>!t||t===fe||t===At?fe:{...fe,...t,promises:{...fe.promises,...t.promises||{}}};const pe=/^\\\\\?\\([a-z]:)\\?$/i;const uncToDrive=t=>t.replace(/\//g,"\\").replace(pe,"$1\\");const de=/[\\\/]/;const me=0;const ge=1;const ye=2;const we=4;const be=6;const Se=8;const ve=10;const _e=12;const ke=15;const xe=~ke;const Oe=16;const Ee=32;const Ae=64;const Ce=128;const Fe=256;const Pe=512;const Te=Ae|Ce|Pe;const Le=1023;const entToType=t=>t.isFile()?Se:t.isDirectory()?we:t.isSymbolicLink()?ve:t.isCharacterDevice()?ye:t.isBlockDevice()?be:t.isSocket()?_e:t.isFIFO()?ge:me;const Me=new Map;const normalize=t=>{const e=Me.get(t);if(e)return e;const i=t.normalize("NFKD");Me.set(t,i);return i};const Re=new Map;const normalizeNocase=t=>{const e=Re.get(t);if(e)return e;const i=normalize(t.toLowerCase());Re.set(t,i);return i};class ResolveCache extends LRUCache{constructor(){super({max:256})}}class ChildrenCache extends LRUCache{constructor(t=16*1024){super({maxSize:t,sizeCalculation:t=>t.length+1})}}const De=Symbol("PathScurry setAsCwd");class PathBase{name;root;roots;parent;nocase;isCWD=false;#et;#it;get dev(){return this.#it}#st;get mode(){return this.#st}#nt;get nlink(){return this.#nt}#rt;get uid(){return this.#rt}#ot;get gid(){return this.#ot}#at;get rdev(){return this.#at}#ct;get blksize(){return this.#ct}#lt;get ino(){return this.#lt}#v;get size(){return this.#v}#ht;get blocks(){return this.#ht}#ut;get atimeMs(){return this.#ut}#ft;get mtimeMs(){return this.#ft}#pt;get ctimeMs(){return this.#pt}#dt;get birthtimeMs(){return this.#dt}#mt;get atime(){return this.#mt}#gt;get mtime(){return this.#gt}#yt;get ctime(){return this.#yt}#wt;get birthtime(){return this.#wt}#bt;#St;#vt;#_t;#kt;#xt;#Ot;#Et;#At;#Ct;get parentPath(){return(this.parent||this).fullpath()}get path(){return this.parentPath}constructor(t,e=me,i,s,n,r,o){this.name=t;this.#bt=n?normalizeNocase(t):normalize(t);this.#Ot=e&Le;this.nocase=n;this.roots=s;this.root=i||this;this.#Et=r;this.#vt=o.fullpath;this.#kt=o.relative;this.#xt=o.relativePosix;this.parent=o.parent;if(this.parent){this.#et=this.parent.#et}else{this.#et=fsFromOption(o.fs)}}depth(){if(this.#St!==undefined)return this.#St;if(!this.parent)return this.#St=0;return this.#St=this.parent.depth()+1}childrenCache(){return this.#Et}resolve(t){if(!t){return this}const e=this.getRootString(t);const i=t.substring(e.length);const s=i.split(this.splitSep);const n=e?this.getRoot(e).#Ft(s):this.#Ft(s);return n}#Ft(t){let e=this;for(const i of t){e=e.child(i)}return e}children(){const t=this.#Et.get(this);if(t){return t}const e=Object.assign([],{provisional:0});this.#Et.set(this,e);this.#Ot&=~Oe;return e}child(t,e){if(t===""||t==="."){return this}if(t===".."){return this.parent||this}const i=this.children();const s=this.nocase?normalizeNocase(t):normalize(t);for(const t of i){if(t.#bt===s){return t}}const n=this.parent?this.sep:"";const r=this.#vt?this.#vt+n+t:undefined;const o=this.newChild(t,me,{...e,parent:this,fullpath:r});if(!this.canReaddir()){o.#Ot|=Ce}i.push(o);return o}relative(){if(this.isCWD)return"";if(this.#kt!==undefined){return this.#kt}const t=this.name;const e=this.parent;if(!e){return this.#kt=this.name}const i=e.relative();return i+(!i||!e.parent?"":this.sep)+t}relativePosix(){if(this.sep==="/")return this.relative();if(this.isCWD)return"";if(this.#xt!==undefined)return this.#xt;const t=this.name;const e=this.parent;if(!e){return this.#xt=this.fullpathPosix()}const i=e.relativePosix();return i+(!i||!e.parent?"":"/")+t}fullpath(){if(this.#vt!==undefined){return this.#vt}const t=this.name;const e=this.parent;if(!e){return this.#vt=this.name}const i=e.fullpath();const s=i+(!e.parent?"":this.sep)+t;return this.#vt=s}fullpathPosix(){if(this.#_t!==undefined)return this.#_t;if(this.sep==="/")return this.#_t=this.fullpath();if(!this.parent){const t=this.fullpath().replace(/\\/g,"/");if(/^[a-z]:\//i.test(t)){return this.#_t=`//?/${t}`}else{return this.#_t=t}}const t=this.parent;const e=t.fullpathPosix();const i=e+(!e||!t.parent?"":"/")+this.name;return this.#_t=i}isUnknown(){return(this.#Ot&ke)===me}isType(t){return this[`is${t}`]()}getType(){return this.isUnknown()?"Unknown":this.isDirectory()?"Directory":this.isFile()?"File":this.isSymbolicLink()?"SymbolicLink":this.isFIFO()?"FIFO":this.isCharacterDevice()?"CharacterDevice":this.isBlockDevice()?"BlockDevice":this.isSocket()?"Socket":"Unknown"}isFile(){return(this.#Ot&ke)===Se}isDirectory(){return(this.#Ot&ke)===we}isCharacterDevice(){return(this.#Ot&ke)===ye}isBlockDevice(){return(this.#Ot&ke)===be}isFIFO(){return(this.#Ot&ke)===ge}isSocket(){return(this.#Ot&ke)===_e}isSymbolicLink(){return(this.#Ot&ve)===ve}lstatCached(){return this.#Ot&Ee?this:undefined}readlinkCached(){return this.#At}realpathCached(){return this.#Ct}readdirCached(){const t=this.children();return t.slice(0,t.provisional)}canReadlink(){if(this.#At)return true;if(!this.parent)return false;const t=this.#Ot&ke;return!(t!==me&&t!==ve||this.#Ot&Fe||this.#Ot&Ce)}calledReaddir(){return!!(this.#Ot&Oe)}isENOENT(){return!!(this.#Ot&Ce)}isNamed(t){return!this.nocase?this.#bt===normalize(t):this.#bt===normalizeNocase(t)}async readlink(){const t=this.#At;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=await this.#et.promises.readlink(this.fullpath());const e=(await this.parent.realpath())?.resolve(t);if(e){return this.#At=e}}catch(t){this.#Pt(t.code);return undefined}}readlinkSync(){const t=this.#At;if(t){return t}if(!this.canReadlink()){return undefined}if(!this.parent){return undefined}try{const t=this.#et.readlinkSync(this.fullpath());const e=this.parent.realpathSync()?.resolve(t);if(e){return this.#At=e}}catch(t){this.#Pt(t.code);return undefined}}#Tt(t){this.#Ot|=Oe;for(let e=t.provisional;e<t.length;e++){const i=t[e];if(i)i.#Lt()}}#Lt(){if(this.#Ot&Ce)return;this.#Ot=(this.#Ot|Ce)&xe;this.#Mt()}#Mt(){const t=this.children();t.provisional=0;for(const e of t){e.#Lt()}}#Rt(){this.#Ot|=Pe;this.#Dt()}#Dt(){if(this.#Ot&Ae)return;let t=this.#Ot;if((t&ke)===we)t&=xe;this.#Ot=t|Ae;this.#Mt()}#Nt(t=""){if(t==="ENOTDIR"||t==="EPERM"){this.#Dt()}else if(t==="ENOENT"){this.#Lt()}else{this.children().provisional=0}}#$t(t=""){if(t==="ENOTDIR"){const t=this.parent;t.#Dt()}else if(t==="ENOENT"){this.#Lt()}}#Pt(t=""){let e=this.#Ot;e|=Fe;if(t==="ENOENT")e|=Ce;if(t==="EINVAL"||t==="UNKNOWN"){e&=xe}this.#Ot=e;if(t==="ENOTDIR"&&this.parent){this.parent.#Dt()}}#jt(t,e){return this.#It(t,e)||this.#Wt(t,e)}#Wt(t,e){const i=entToType(t);const s=this.newChild(t.name,i,{parent:this});const n=s.#Ot&ke;if(n!==we&&n!==ve&&n!==me){s.#Ot|=Ae}e.unshift(s);e.provisional++;return s}#It(t,e){for(let i=e.provisional;i<e.length;i++){const s=e[i];const n=this.nocase?normalizeNocase(t.name):normalize(t.name);if(n!==s.#bt){continue}return this.#Bt(t,s,i,e)}}#Bt(t,e,i,s){const n=e.name;e.#Ot=e.#Ot&xe|entToType(t);if(n!==t.name)e.name=t.name;if(i!==s.provisional){if(i===s.length-1)s.pop();else s.splice(i,1);s.unshift(e)}s.provisional++;return e}async lstat(){if((this.#Ot&Ce)===0){try{this.#zt(await this.#et.promises.lstat(this.fullpath()));return this}catch(t){this.#$t(t.code)}}}lstatSync(){if((this.#Ot&Ce)===0){try{this.#zt(this.#et.lstatSync(this.fullpath()));return this}catch(t){this.#$t(t.code)}}}#zt(t){const{atime:e,atimeMs:i,birthtime:s,birthtimeMs:n,blksize:r,blocks:o,ctime:a,ctimeMs:c,dev:l,gid:h,ino:u,mode:f,mtime:p,mtimeMs:d,nlink:g,rdev:y,size:w,uid:b}=t;this.#mt=e;this.#ut=i;this.#wt=s;this.#dt=n;this.#ct=r;this.#ht=o;this.#yt=a;this.#pt=c;this.#it=l;this.#ot=h;this.#lt=u;this.#st=f;this.#gt=p;this.#ft=d;this.#nt=g;this.#at=y;this.#v=w;this.#rt=b;const S=entToType(t);this.#Ot=this.#Ot&xe|S|Ee;if(S!==me&&S!==we&&S!==ve){this.#Ot|=Ae}}#Ht=[];#Vt=false;#Gt(t){this.#Vt=false;const e=this.#Ht.slice();this.#Ht.length=0;e.forEach((e=>e(null,t)))}readdirCB(t,e=false){if(!this.canReaddir()){if(e)t(null,[]);else queueMicrotask((()=>t(null,[])));return}const i=this.children();if(this.calledReaddir()){const s=i.slice(0,i.provisional);if(e)t(null,s);else queueMicrotask((()=>t(null,s)));return}this.#Ht.push(t);if(this.#Vt){return}this.#Vt=true;const s=this.fullpath();this.#et.readdir(s,{withFileTypes:true},((t,e)=>{if(t){this.#Nt(t.code);i.provisional=0}else{for(const t of e){this.#jt(t,i)}this.#Tt(i)}this.#Gt(i.slice(0,i.provisional));return}))}#Ut;async readdir(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();if(this.#Ut){await this.#Ut}else{let resolve=()=>{};this.#Ut=new Promise((t=>resolve=t));try{for(const i of await this.#et.promises.readdir(e,{withFileTypes:true})){this.#jt(i,t)}this.#Tt(t)}catch(e){this.#Nt(e.code);t.provisional=0}this.#Ut=undefined;resolve()}return t.slice(0,t.provisional)}readdirSync(){if(!this.canReaddir()){return[]}const t=this.children();if(this.calledReaddir()){return t.slice(0,t.provisional)}const e=this.fullpath();try{for(const i of this.#et.readdirSync(e,{withFileTypes:true})){this.#jt(i,t)}this.#Tt(t)}catch(e){this.#Nt(e.code);t.provisional=0}return t.slice(0,t.provisional)}canReaddir(){if(this.#Ot&Te)return false;const t=ke&this.#Ot;if(!(t===me||t===we||t===ve)){return false}return true}shouldWalk(t,e){return(this.#Ot&we)===we&&!(this.#Ot&Te)&&!t.has(this)&&(!e||e(this))}async realpath(){if(this.#Ct)return this.#Ct;if((Pe|Fe|Ce)&this.#Ot)return undefined;try{const t=await this.#et.promises.realpath(this.fullpath());return this.#Ct=this.resolve(t)}catch(t){this.#Rt()}}realpathSync(){if(this.#Ct)return this.#Ct;if((Pe|Fe|Ce)&this.#Ot)return undefined;try{const t=this.#et.realpathSync(this.fullpath());return this.#Ct=this.resolve(t)}catch(t){this.#Rt()}}[De](t){if(t===this)return;t.isCWD=false;this.isCWD=true;const e=new Set([]);let i=[];let s=this;while(s&&s.parent){e.add(s);s.#kt=i.join(this.sep);s.#xt=i.join("/");s=s.parent;i.push("..")}s=t;while(s&&s.parent&&!e.has(s)){s.#kt=undefined;s.#xt=undefined;s=s.parent}}}class PathWin32 extends PathBase{sep="\\";splitSep=de;constructor(t,e=me,i,s,n,r,o){super(t,e,i,s,n,r,o)}newChild(t,e=me,i={}){return new PathWin32(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}getRootString(t){return z.win32.parse(t).root}getRoot(t){t=uncToDrive(t.toUpperCase());if(t===this.root.name){return this.root}for(const[e,i]of Object.entries(this.roots)){if(this.sameRoot(t,e)){return this.roots[t]=i}}return this.roots[t]=new PathScurryWin32(t,this).root}sameRoot(t,e=this.root.name){t=t.toUpperCase().replace(/\//g,"\\").replace(pe,"$1\\");return t===e}}class PathPosix extends PathBase{splitSep="/";sep="/";constructor(t,e=me,i,s,n,r,o){super(t,e,i,s,n,r,o)}getRootString(t){return t.startsWith("/")?"/":""}getRoot(t){return this.root}newChild(t,e=me,i={}){return new PathPosix(t,e,this.root,this.roots,this.nocase,this.childrenCache(),i)}}class PathScurryBase{root;rootPath;roots;cwd;#qt;#Jt;#Et;nocase;#et;constructor(t=process.cwd(),i,s,{nocase:n,childrenCacheSize:r=16*1024,fs:o=fe}={}){this.#et=fsFromOption(o);if(t instanceof URL||t.startsWith("file://")){t=(0,e.fileURLToPath)(t)}const a=i.resolve(t);this.roots=Object.create(null);this.rootPath=this.parseRootPath(a);this.#qt=new ResolveCache;this.#Jt=new ResolveCache;this.#Et=new ChildrenCache(r);const c=a.substring(this.rootPath.length).split(s);if(c.length===1&&!c[0]){c.pop()}if(n===undefined){throw new TypeError("must provide nocase setting to PathScurryBase ctor")}this.nocase=n;this.root=this.newRoot(this.#et);this.roots[this.rootPath]=this.root;let l=this.root;let h=c.length-1;const u=i.sep;let f=this.rootPath;let p=false;for(const t of c){const e=h--;l=l.child(t,{relative:new Array(e).fill("..").join(u),relativePosix:new Array(e).fill("..").join("/"),fullpath:f+=(p?"":u)+t});p=true}this.cwd=l}depth(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.depth()}childrenCache(){return this.#Et}resolve(...t){let e="";for(let i=t.length-1;i>=0;i--){const s=t[i];if(!s||s===".")continue;e=e?`${s}/${e}`:s;if(this.isAbsolute(s)){break}}const i=this.#qt.get(e);if(i!==undefined){return i}const s=this.cwd.resolve(e).fullpath();this.#qt.set(e,s);return s}resolvePosix(...t){let e="";for(let i=t.length-1;i>=0;i--){const s=t[i];if(!s||s===".")continue;e=e?`${s}/${e}`:s;if(this.isAbsolute(s)){break}}const i=this.#Jt.get(e);if(i!==undefined){return i}const s=this.cwd.resolve(e).fullpathPosix();this.#Jt.set(e,s);return s}relative(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relative()}relativePosix(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.relativePosix()}basename(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.name}dirname(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return(t.parent||t).fullpath()}async readdir(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i}=e;if(!t.canReaddir()){return[]}else{const e=await t.readdir();return i?e:e.map((t=>t.name))}}readdirSync(t=this.cwd,e={withFileTypes:true}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true}=e;if(!t.canReaddir()){return[]}else if(i){return t.readdirSync()}else{return t.readdirSync().map((t=>t.name))}}async lstat(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstat()}lstatSync(t=this.cwd){if(typeof t==="string"){t=this.cwd.resolve(t)}return t.lstatSync()}async readlink(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=await t.readlink();return e?i:i?.fullpath()}readlinkSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=t.readlinkSync();return e?i:i?.fullpath()}async realpath(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=await t.realpath();return e?i:i?.fullpath()}realpathSync(t=this.cwd,{withFileTypes:e}={withFileTypes:false}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t.withFileTypes;t=this.cwd}const i=t.realpathSync();return e?i:i?.fullpath()}async walk(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=[];if(!n||n(t)){o.push(i?t:t.fullpath())}const a=new Set;const walk=(t,e)=>{a.add(t);t.readdirCB(((t,c)=>{if(t){return e(t)}let l=c.length;if(!l)return e();const next=()=>{if(--l===0){e()}};for(const t of c){if(!n||n(t)){o.push(i?t:t.fullpath())}if(s&&t.isSymbolicLink()){t.realpath().then((t=>t?.isUnknown()?t.lstat():t)).then((t=>t?.shouldWalk(a,r)?walk(t,next):next()))}else{if(t.shouldWalk(a,r)){walk(t,next)}else{next()}}}}),true)};const c=t;return new Promise(((t,e)=>{walk(c,(i=>{if(i)return e(i);t(o)}))}))}walkSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=[];if(!n||n(t)){o.push(i?t:t.fullpath())}const a=new Set([t]);for(const t of a){const e=t.readdirSync();for(const t of e){if(!n||n(t)){o.push(i?t:t.fullpath())}let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,r)){a.add(e)}}}return o}[Symbol.asyncIterator](){return this.iterate()}iterate(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}return this.stream(t,e)[Symbol.asyncIterator]()}[Symbol.iterator](){return this.iterateSync()}*iterateSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;if(!n||n(t)){yield i?t:t.fullpath()}const o=new Set([t]);for(const t of o){const e=t.readdirSync();for(const t of e){if(!n||n(t)){yield i?t:t.fullpath()}let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(o,r)){o.add(e)}}}}stream(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=new Minipass({objectMode:true});if(!n||n(t)){o.write(i?t:t.fullpath())}const a=new Set;const c=[t];let l=0;const process=()=>{let t=false;while(!t){const e=c.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const onReaddir=(e,u,f=false)=>{if(e)return o.emit("error",e);if(s&&!f){const t=[];for(const e of u){if(e.isSymbolicLink()){t.push(e.realpath().then((t=>t?.isUnknown()?t.lstat():t)))}}if(t.length){Promise.all(t).then((()=>onReaddir(null,u,true)));return}}for(const e of u){if(e&&(!n||n(e))){if(!o.write(i?e:e.fullpath())){t=true}}}l--;for(const t of u){const e=t.realpathCached()||t;if(e.shouldWalk(a,r)){c.push(e)}}if(t&&!o.flowing){o.once("drain",process)}else if(!h){process()}};let h=true;e.readdirCB(onReaddir,true);h=false}};process();return o}streamSync(t=this.cwd,e={}){if(typeof t==="string"){t=this.cwd.resolve(t)}else if(!(t instanceof PathBase)){e=t;t=this.cwd}const{withFileTypes:i=true,follow:s=false,filter:n,walkFilter:r}=e;const o=new Minipass({objectMode:true});const a=new Set;if(!n||n(t)){o.write(i?t:t.fullpath())}const c=[t];let l=0;const process=()=>{let t=false;while(!t){const e=c.shift();if(!e){if(l===0)o.end();return}l++;a.add(e);const h=e.readdirSync();for(const e of h){if(!n||n(e)){if(!o.write(i?e:e.fullpath())){t=true}}}l--;for(const t of h){let e=t;if(t.isSymbolicLink()){if(!(s&&(e=t.realpathSync())))continue;if(e.isUnknown())e.lstatSync()}if(e.shouldWalk(a,r)){c.push(e)}}}if(t&&!o.flowing)o.once("drain",process)};process();return o}chdir(t=this.cwd){const e=this.cwd;this.cwd=typeof t==="string"?this.cwd.resolve(t):t;this.cwd[De](e)}}class PathScurryWin32 extends PathScurryBase{sep="\\";constructor(t=process.cwd(),e={}){const{nocase:i=true}=e;super(t,z.win32,"\\",{...e,nocase:i});this.nocase=i;for(let t=this.cwd;t;t=t.parent){t.nocase=this.nocase}}parseRootPath(t){return z.win32.parse(t).root.toUpperCase()}newRoot(t){return new PathWin32(this.rootPath,we,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")||t.startsWith("\\")||/^[a-z]:(\/|\\)/i.test(t)}}class PathScurryPosix extends PathScurryBase{sep="/";constructor(t=process.cwd(),e={}){const{nocase:i=false}=e;super(t,z.posix,"/",{...e,nocase:i});this.nocase=i}parseRootPath(t){return"/"}newRoot(t){return new PathPosix(this.rootPath,we,undefined,this.roots,this.nocase,this.childrenCache(),{fs:t})}isAbsolute(t){return t.startsWith("/")}}class PathScurryDarwin extends PathScurryPosix{constructor(t=process.cwd(),e={}){const{nocase:i=true}=e;super(t,{...e,nocase:i})}}const Ne=process.platform==="win32"?PathWin32:PathPosix;const $e=process.platform==="win32"?PathScurryWin32:process.platform==="darwin"?PathScurryDarwin:PathScurryPosix;const isPatternList=t=>t.length>=1;const isGlobList=t=>t.length>=1;class Pattern{#Yt;#Kt;#Zt;length;#Qt;#Xt;#te;#ee;#ie;#se;#ne=true;constructor(t,e,i,s){if(!isPatternList(t)){throw new TypeError("empty pattern list")}if(!isGlobList(e)){throw new TypeError("empty glob list")}if(e.length!==t.length){throw new TypeError("mismatched pattern list and glob list lengths")}this.length=t.length;if(i<0||i>=this.length){throw new TypeError("index out of range")}this.#Yt=t;this.#Kt=e;this.#Zt=i;this.#Qt=s;if(this.#Zt===0){if(this.isUNC()){const[t,e,i,s,...n]=this.#Yt;const[r,o,a,c,...l]=this.#Kt;if(n[0]===""){n.shift();l.shift()}const h=[t,e,i,s,""].join("/");const u=[r,o,a,c,""].join("/");this.#Yt=[h,...n];this.#Kt=[u,...l];this.length=this.#Yt.length}else if(this.isDrive()||this.isAbsolute()){const[t,...e]=this.#Yt;const[i,...s]=this.#Kt;if(e[0]===""){e.shift();s.shift()}const n=t+"/";const r=i+"/";this.#Yt=[n,...e];this.#Kt=[r,...s];this.length=this.#Yt.length}}}pattern(){return this.#Yt[this.#Zt]}isString(){return typeof this.#Yt[this.#Zt]==="string"}isGlobstar(){return this.#Yt[this.#Zt]===pt}isRegExp(){return this.#Yt[this.#Zt]instanceof RegExp}globString(){return this.#te=this.#te||(this.#Zt===0?this.isAbsolute()?this.#Kt[0]+this.#Kt.slice(1).join("/"):this.#Kt.join("/"):this.#Kt.slice(this.#Zt).join("/"))}hasMore(){return this.length>this.#Zt+1}rest(){if(this.#Xt!==undefined)return this.#Xt;if(!this.hasMore())return this.#Xt=null;this.#Xt=new Pattern(this.#Yt,this.#Kt,this.#Zt+1,this.#Qt);this.#Xt.#se=this.#se;this.#Xt.#ie=this.#ie;this.#Xt.#ee=this.#ee;return this.#Xt}isUNC(){const t=this.#Yt;return this.#ie!==undefined?this.#ie:this.#ie=this.#Qt==="win32"&&this.#Zt===0&&t[0]===""&&t[1]===""&&typeof t[2]==="string"&&!!t[2]&&typeof t[3]==="string"&&!!t[3]}isDrive(){const t=this.#Yt;return this.#ee!==undefined?this.#ee:this.#ee=this.#Qt==="win32"&&this.#Zt===0&&this.length>1&&typeof t[0]==="string"&&/^[a-z]:$/i.test(t[0])}isAbsolute(){const t=this.#Yt;return this.#se!==undefined?this.#se:this.#se=t[0]===""&&t.length>1||this.isDrive()||this.isUNC()}root(){const t=this.#Yt[0];return typeof t==="string"&&this.isAbsolute()&&this.#Zt===0?t:""}checkFollowGlobstar(){return!(this.#Zt===0||!this.isGlobstar()||!this.#ne)}markFollowGlobstar(){if(this.#Zt===0||!this.isGlobstar()||!this.#ne)return false;this.#ne=false;return true}}const je=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Ignore{relative;relativeChildren;absolute;absoluteChildren;platform;mmopts;constructor(t,{nobrace:e,nocase:i,noext:s,noglobstar:n,platform:r=je}){this.relative=[];this.absolute=[];this.relativeChildren=[];this.absoluteChildren=[];this.platform=r;this.mmopts={dot:true,nobrace:e,nocase:i,noext:s,noglobstar:n,optimizationLevel:2,platform:r,nocomment:true,nonegate:true};for(const e of t)this.add(e)}add(t){const e=new Minimatch(t,this.mmopts);for(let t=0;t<e.set.length;t++){const i=e.set[t];const s=e.globParts[t];if(!i||!s){throw new Error("invalid pattern object")}while(i[0]==="."&&s[0]==="."){i.shift();s.shift()}const n=new Pattern(i,s,0,this.platform);const r=new Minimatch(n.globString(),this.mmopts);const o=s[s.length-1]==="**";const a=n.isAbsolute();if(a)this.absolute.push(r);else this.relative.push(r);if(o){if(a)this.absoluteChildren.push(r);else this.relativeChildren.push(r)}}}ignored(t){const e=t.fullpath();const i=`${e}/`;const s=t.relative()||".";const n=`${s}/`;for(const t of this.relative){if(t.match(s)||t.match(n))return true}for(const t of this.absolute){if(t.match(e)||t.match(i))return true}return false}childrenIgnored(t){const e=t.fullpath()+"/";const i=(t.relative()||".")+"/";for(const t of this.relativeChildren){if(t.match(i))return true}for(const t of this.absoluteChildren){if(t.match(e))return true}return false}}class HasWalkedCache{store;constructor(t=new Map){this.store=t}copy(){return new HasWalkedCache(new Map(this.store))}hasWalked(t,e){return this.store.get(t.fullpath())?.has(e.globString())}storeWalked(t,e){const i=t.fullpath();const s=this.store.get(i);if(s)s.add(e.globString());else this.store.set(i,new Set([e.globString()]))}}class MatchRecord{store=new Map;add(t,e,i){const s=(e?2:0)|(i?1:0);const n=this.store.get(t);this.store.set(t,n===undefined?s:s&n)}entries(){return[...this.store.entries()].map((([t,e])=>[t,!!(e&2),!!(e&1)]))}}class SubWalks{store=new Map;add(t,e){if(!t.canReaddir()){return}const i=this.store.get(t);if(i){if(!i.find((t=>t.globString()===e.globString()))){i.push(e)}}else this.store.set(t,[e])}get(t){const e=this.store.get(t);if(!e){throw new Error("attempting to walk unknown path")}return e}entries(){return this.keys().map((t=>[t,this.store.get(t)]))}keys(){return[...this.store.keys()].filter((t=>t.canReaddir()))}}class Processor{hasWalkedCache;matches=new MatchRecord;subwalks=new SubWalks;patterns;follow;dot;opts;constructor(t,e){this.opts=t;this.follow=!!t.follow;this.dot=!!t.dot;this.hasWalkedCache=e?e.copy():new HasWalkedCache}processPatterns(t,e){this.patterns=e;const i=e.map((e=>[t,e]));for(let[t,e]of i){this.hasWalkedCache.storeWalked(t,e);const i=e.root();const s=e.isAbsolute()&&this.opts.absolute!==false;if(i){t=t.resolve(i==="/"&&this.opts.root!==undefined?this.opts.root:i);const s=e.rest();if(!s){this.matches.add(t,true,false);continue}else{e=s}}if(t.isENOENT())continue;let n;let r;let o=false;while(typeof(n=e.pattern())==="string"&&(r=e.rest())){const i=t.resolve(n);t=i;e=r;o=true}n=e.pattern();r=e.rest();if(o){if(this.hasWalkedCache.hasWalked(t,e))continue;this.hasWalkedCache.storeWalked(t,e)}if(typeof n==="string"){const e=n===".."||n===""||n===".";this.matches.add(t.resolve(n),s,e);continue}else if(n===pt){if(!t.isSymbolicLink()||this.follow||e.checkFollowGlobstar()){this.subwalks.add(t,e)}const i=r?.pattern();const n=r?.rest();if(!r||(i===""||i===".")&&!n){this.matches.add(t,s,i===""||i===".")}else{if(i===".."){const e=t.parent||t;if(!n)this.matches.add(e,s,true);else if(!this.hasWalkedCache.hasWalked(e,n)){this.subwalks.add(e,n)}}}}else if(n instanceof RegExp){this.subwalks.add(t,e)}}return this}subwalkTargets(){return this.subwalks.keys()}child(){return new Processor(this.opts,this.hasWalkedCache)}filterEntries(t,e){const i=this.subwalks.get(t);const s=this.child();for(const t of e){for(const e of i){const i=e.isAbsolute();const n=e.pattern();const r=e.rest();if(n===pt){s.testGlobstar(t,e,r,i)}else if(n instanceof RegExp){s.testRegExp(t,n,r,i)}else{s.testString(t,n,r,i)}}}return s}testGlobstar(t,e,i,s){if(this.dot||!t.name.startsWith(".")){if(!e.hasMore()){this.matches.add(t,s,false)}if(t.canReaddir()){if(this.follow||!t.isSymbolicLink()){this.subwalks.add(t,e)}else if(t.isSymbolicLink()){if(i&&e.checkFollowGlobstar()){this.subwalks.add(t,i)}else if(e.markFollowGlobstar()){this.subwalks.add(t,e)}}}}if(i){const e=i.pattern();if(typeof e==="string"&&e!==".."&&e!==""&&e!=="."){this.testString(t,e,i.rest(),s)}else if(e===".."){const e=t.parent||t;this.subwalks.add(e,i)}else if(e instanceof RegExp){this.testRegExp(t,e,i.rest(),s)}}}testRegExp(t,e,i,s){if(!e.test(t.name))return;if(!i){this.matches.add(t,s,false)}else{this.subwalks.add(t,i)}}testString(t,e,i,s){if(!t.isNamed(e))return;if(!i){this.matches.add(t,s,false)}else{this.subwalks.add(t,i)}}}const makeIgnore=(t,e)=>typeof t==="string"?new Ignore([t],e):Array.isArray(t)?new Ignore(t,e):t;class GlobUtil{path;patterns;opts;seen=new Set;paused=false;aborted=false;#re=[];#oe;#ae;signal;maxDepth;includeChildMatches;constructor(t,e,i){this.patterns=t;this.path=e;this.opts=i;this.#ae=!i.posix&&i.platform==="win32"?"\\":"/";this.includeChildMatches=i.includeChildMatches!==false;if(i.ignore||!this.includeChildMatches){this.#oe=makeIgnore(i.ignore??[],i);if(!this.includeChildMatches&&typeof this.#oe.add!=="function"){const t="cannot ignore child matches, ignore lacks add() method.";throw new Error(t)}}this.maxDepth=i.maxDepth||Infinity;if(i.signal){this.signal=i.signal;this.signal.addEventListener("abort",(()=>{this.#re.length=0}))}}#ce(t){return this.seen.has(t)||!!this.#oe?.ignored?.(t)}#le(t){return!!this.#oe?.childrenIgnored?.(t)}pause(){this.paused=true}resume(){if(this.signal?.aborted)return;this.paused=false;let t=undefined;while(!this.paused&&(t=this.#re.shift())){t()}}onResume(t){if(this.signal?.aborted)return;if(!this.paused){t()}else{this.#re.push(t)}}async matchCheck(t,e){if(e&&this.opts.nodir)return undefined;let i;if(this.opts.realpath){i=t.realpathCached()||await t.realpath();if(!i)return undefined;t=i}const s=t.isUnknown()||this.opts.stat;const n=s?await t.lstat():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=await n.realpath();if(t&&(t.isUnknown()||this.opts.stat)){await t.lstat()}}return this.matchCheckTest(n,e)}matchCheckTest(t,e){return t&&(this.maxDepth===Infinity||t.depth()<=this.maxDepth)&&(!e||t.canReaddir())&&(!this.opts.nodir||!t.isDirectory())&&(!this.opts.nodir||!this.opts.follow||!t.isSymbolicLink()||!t.realpathCached()?.isDirectory())&&!this.#ce(t)?t:undefined}matchCheckSync(t,e){if(e&&this.opts.nodir)return undefined;let i;if(this.opts.realpath){i=t.realpathCached()||t.realpathSync();if(!i)return undefined;t=i}const s=t.isUnknown()||this.opts.stat;const n=s?t.lstatSync():t;if(this.opts.follow&&this.opts.nodir&&n?.isSymbolicLink()){const t=n.realpathSync();if(t&&(t?.isUnknown()||this.opts.stat)){t.lstatSync()}}return this.matchCheckTest(n,e)}matchFinish(t,e){if(this.#ce(t))return;if(!this.includeChildMatches&&this.#oe?.add){const e=`${t.relativePosix()}/**`;this.#oe.add(e)}const i=this.opts.absolute===undefined?e:this.opts.absolute;this.seen.add(t);const s=this.opts.mark&&t.isDirectory()?this.#ae:"";if(this.opts.withFileTypes){this.matchEmit(t)}else if(i){const e=this.opts.posix?t.fullpathPosix():t.fullpath();this.matchEmit(e+s)}else{const e=this.opts.posix?t.relativePosix():t.relative();const i=this.opts.dotRelative&&!e.startsWith(".."+this.#ae)?"."+this.#ae:"";this.matchEmit(!e?"."+s:i+e+s)}}async match(t,e,i){const s=await this.matchCheck(t,i);if(s)this.matchFinish(s,e)}matchSync(t,e,i){const s=this.matchCheckSync(t,i);if(s)this.matchFinish(s,e)}walkCB(t,e,i){if(this.signal?.aborted)i();this.walkCB2(t,e,new Processor(this.opts),i)}walkCB2(t,e,i,s){if(this.#le(t))return s();if(this.signal?.aborted)s();if(this.paused){this.onResume((()=>this.walkCB2(t,e,i,s)));return}i.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;n++;this.match(t,e,s).then((()=>next()))}for(const t of i.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirCached();if(t.calledReaddir())this.walkCB3(t,e,i,next);else{t.readdirCB(((e,s)=>this.walkCB3(t,s,i,next)),true)}}next()}walkCB3(t,e,i,s){i=i.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;n++;this.match(t,e,s).then((()=>next()))}for(const[t,e]of i.subwalks.entries()){n++;this.walkCB2(t,e,i.child(),next)}next()}walkCBSync(t,e,i){if(this.signal?.aborted)i();this.walkCB2Sync(t,e,new Processor(this.opts),i)}walkCB2Sync(t,e,i,s){if(this.#le(t))return s();if(this.signal?.aborted)s();if(this.paused){this.onResume((()=>this.walkCB2Sync(t,e,i,s)));return}i.processPatterns(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;this.matchSync(t,e,s)}for(const t of i.subwalkTargets()){if(this.maxDepth!==Infinity&&t.depth()>=this.maxDepth){continue}n++;const e=t.readdirSync();this.walkCB3Sync(t,e,i,next)}next()}walkCB3Sync(t,e,i,s){i=i.filterEntries(t,e);let n=1;const next=()=>{if(--n===0)s()};for(const[t,e,s]of i.matches.entries()){if(this.#ce(t))continue;this.matchSync(t,e,s)}for(const[t,e]of i.subwalks.entries()){n++;this.walkCB2Sync(t,e,i.child(),next)}next()}}class GlobWalker extends GlobUtil{matches=new Set;constructor(t,e,i){super(t,e,i)}matchEmit(t){this.matches.add(t)}async walk(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){await this.path.lstat()}await new Promise(((t,e)=>{this.walkCB(this.path,this.patterns,(()=>{if(this.signal?.aborted){e(this.signal.reason)}else{t(this.matches)}}))}));return this.matches}walkSync(){if(this.signal?.aborted)throw this.signal.reason;if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>{if(this.signal?.aborted)throw this.signal.reason}));return this.matches}}class GlobStream extends GlobUtil{results;constructor(t,e,i){super(t,e,i);this.results=new Minipass({signal:this.signal,objectMode:true});this.results.on("drain",(()=>this.resume()));this.results.on("resume",(()=>this.resume()))}matchEmit(t){this.results.write(t);if(!this.results.flowing)this.pause()}stream(){const t=this.path;if(t.isUnknown()){t.lstat().then((()=>{this.walkCB(t,this.patterns,(()=>this.results.end()))}))}else{this.walkCB(t,this.patterns,(()=>this.results.end()))}return this.results}streamSync(){if(this.path.isUnknown()){this.path.lstatSync()}this.walkCBSync(this.path,this.patterns,(()=>this.results.end()));return this.results}}const Ie=typeof process==="object"&&process&&typeof process.platform==="string"?process.platform:"linux";class Glob{absolute;cwd;root;dot;dotRelative;follow;ignore;magicalBraces;mark;matchBase;maxDepth;nobrace;nocase;nodir;noext;noglobstar;pattern;platform;realpath;scurry;stat;signal;windowsPathsNoEscape;withFileTypes;includeChildMatches;opts;patterns;constructor(t,i){if(!i)throw new TypeError("glob options required");this.withFileTypes=!!i.withFileTypes;this.signal=i.signal;this.follow=!!i.follow;this.dot=!!i.dot;this.dotRelative=!!i.dotRelative;this.nodir=!!i.nodir;this.mark=!!i.mark;if(!i.cwd){this.cwd=""}else if(i.cwd instanceof URL||i.cwd.startsWith("file://")){i.cwd=(0,e.fileURLToPath)(i.cwd)}this.cwd=i.cwd||"";this.root=i.root;this.magicalBraces=!!i.magicalBraces;this.nobrace=!!i.nobrace;this.noext=!!i.noext;this.realpath=!!i.realpath;this.absolute=i.absolute;this.includeChildMatches=i.includeChildMatches!==false;this.noglobstar=!!i.noglobstar;this.matchBase=!!i.matchBase;this.maxDepth=typeof i.maxDepth==="number"?i.maxDepth:Infinity;this.stat=!!i.stat;this.ignore=i.ignore;if(this.withFileTypes&&this.absolute!==undefined){throw new Error("cannot set absolute and withFileTypes:true")}if(typeof t==="string"){t=[t]}this.windowsPathsNoEscape=!!i.windowsPathsNoEscape||i.allowWindowsEscape===false;if(this.windowsPathsNoEscape){t=t.map((t=>t.replace(/\\/g,"/")))}if(this.matchBase){if(i.noglobstar){throw new TypeError("base matching requires globstar")}t=t.map((t=>t.includes("/")?t:`./**/${t}`))}this.pattern=t;this.platform=i.platform||Ie;this.opts={...i,platform:this.platform};if(i.scurry){this.scurry=i.scurry;if(i.nocase!==undefined&&i.nocase!==i.scurry.nocase){throw new Error("nocase option contradicts provided scurry option")}}else{const t=i.platform==="win32"?PathScurryWin32:i.platform==="darwin"?PathScurryDarwin:i.platform?PathScurryPosix:$e;this.scurry=new t(this.cwd,{nocase:i.nocase,fs:i.fs})}this.nocase=this.scurry.nocase;const s=this.platform==="darwin"||this.platform==="win32";const n={...i,dot:this.dot,matchBase:this.matchBase,nobrace:this.nobrace,nocase:this.nocase,nocaseMagicOnly:s,nocomment:true,noext:this.noext,nonegate:true,optimizationLevel:2,platform:this.platform,windowsPathsNoEscape:this.windowsPathsNoEscape,debug:!!this.opts.debug};const r=this.pattern.map((t=>new Minimatch(t,n)));const[o,a]=r.reduce(((t,e)=>{t[0].push(...e.set);t[1].push(...e.globParts);return t}),[[],[]]);this.patterns=o.map(((t,e)=>{const i=a[e];if(!i)throw new Error("invalid pattern object");return new Pattern(t,i,0,this.platform)}))}async walk(){return[...await new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walk()]}walkSync(){return[...new GlobWalker(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).walkSync()]}stream(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).stream()}streamSync(){return new GlobStream(this.patterns,this.scurry.cwd,{...this.opts,maxDepth:this.maxDepth!==Infinity?this.maxDepth+this.scurry.cwd.depth():Infinity,platform:this.platform,nocase:this.nocase,includeChildMatches:this.includeChildMatches}).streamSync()}iterateSync(){return this.streamSync()[Symbol.iterator]()}[Symbol.iterator](){return this.iterateSync()}iterate(){return this.stream()[Symbol.asyncIterator]()}[Symbol.asyncIterator](){return this.iterate()}}const hasMagic=(t,e={})=>{if(!Array.isArray(t)){t=[t]}for(const i of t){if(new Minimatch(i,e).hasMagic())return true}return false};function globStreamSync(t,e={}){return new Glob(t,e).streamSync()}function globStream(t,e={}){return new Glob(t,e).stream()}function globSync(t,e={}){return new Glob(t,e).walkSync()}async function glob_(t,e={}){return new Glob(t,e).walk()}function globIterateSync(t,e={}){return new Glob(t,e).iterateSync()}function globIterate(t,e={}){return new Glob(t,e).iterate()}const We=globStreamSync;const Be=Object.assign(globStream,{sync:globStreamSync});const ze=globIterateSync;const He=Object.assign(globIterate,{sync:globIterateSync});const Ve=Object.assign(globSync,{stream:globStreamSync,iterate:globIterateSync});const Ge=Object.assign(glob_,{glob:glob_,globSync:globSync,sync:Ve,globStream:globStream,stream:Be,globStreamSync:globStreamSync,streamSync:We,globIterate:globIterate,iterate:He,globIterateSync:globIterateSync,iterateSync:ze,Glob:Glob,hasMagic:hasMagic,escape:escape_escape,unescape:unescape_unescape});Ge.glob=Ge;const Ue=(0,U.createRequire)(import.meta.url);const{$:qe,cd:Je}=Ue("zx");let Ye=false;async function runAsync(t,e,i){qe.verbose=i?.verbose??Ye;if(i?.cwd){Je(i.cwd)}return await(qe`${t} ${e}`)}async function setDefaultVerbose(t){Ye=t}const Ke=(0,U.createRequire)(import.meta.url);const{default:Ze}=Ke("@expo/json-file");let Qe=null;const Xe=["@expo/fingerprint","create-expo","eslint-config-universe","expo-dev-client-components","expo-doctor","expo-env-info","expo-face-detector","expo-module-scripts","expo-module-template","expo-module-template-local","expo-test-runner","install-expo-modules","pod-install","uri-scheme","patch-project","create-expo-module","create-expo-nightly","@react-native-community/cli-platform-android","react","react-dom"];const ti=["@react-native/assets-registry","@react-native/dev-middleware","@react-native/babel-preset","react-native"];async function addWorkspacePackagesToAppAsync(t,e){const i=await Ze.readAsync(H().join(t,"package.json"));const s=i.dependencies??{};for(const t of e){s[t.name]="workspace:*"}await Ze.mergeAsync(H().join(t,"package.json"),{dependencies:s})}async function reinstallPackagesAsync(t){await Promise.all([Ft().rm(H().join(t,"node_modules"),{recursive:true,force:true}),Ft().rm(H().join(t,"bun.lockb"),{force:true}),Ft().rm(H().join(t,"yarn.lock"),{force:true})]);await runAsync("bun",["install","--ignore-scripts"],{cwd:t})}async function getExpoPackagesAsync(t){if(Qe!=null){return Qe}const e=await Ge("**/package.json",{cwd:H().join(t,"packages"),ignore:["**/example/**","**/node_modules/**","**/__tests__/**","**/__mocks__/**","**/__fixtures__/**","**/e2e/**","**/build/**"]});const i=(await Promise.all(e.map((async e=>{const i=H().join(t,"packages",H().dirname(e));return await createPackageAsync(i)})))).filter((t=>t!=null));Qe=i.sort(((t,e)=>t.name.localeCompare(e.name)));return Qe}async function getReactNativeTransitivePackagesAsync(t){const e=await Promise.all(ti.map((e=>{const i=path.join(t,"node_modules",e);return Promise.resolve({name:e,path:i})})));return e}async function createPackageAsync(t){const e=H().join(t,"package.json");const i=H().dirname(e);const s=await Ze.readAsync(e);const n=s.name;if(Xe.includes(n)){return null}return{name:n,path:i}}const ei=(0,U.createRequire)(import.meta.url);const{default:ii}=ei("@expo/json-file");async function setupExpoRepoAsync(t,e,i){let s;const n=e&&await G().pathExists(e);if(!n){s=H().join(t,"expo");console.log(`Cloning expo repository to ${s}`);console.time("Cloned expo repository");await runAsync("git",["clone","--depth=1","https://github.com/expo/expo.git",H().basename(s)],{cwd:H().dirname(s)});console.timeEnd("Cloned expo repository")}else{s=e}console.log(`Running \`yarn install\` in ${s}`);console.time("Installed dependencies in expo repository");await setupDependenciesAsync(s,i);await runAsync("yarn",["install"],{cwd:s});console.timeEnd("Installed dependencies in expo repository");return s}async function packExpoBareTemplateTarballAsync(t,e){await G().ensureDir(e);const{stdout:i}=await runAsync("npm",["pack","--json","--pack-destination",e],{cwd:H().join(t,"templates","expo-template-bare-minimum")});const s=JSON.parse(i);const n=s[0].filename;return H().join(e,n)}async function setupDependenciesAsync(t,e){const i=H().join(t,"package.json");const s=await ii.readAsync(i);const n=s.resolutions??{};for(const t of ti){n[t]=`${e}`}await ii.mergeAsync(i,{resolutions:n})}async function getNpmVersionAsync(t,e){const{stdout:i}=await runAsync("npm",["view",`${t}@${e}`,"version"]);return i.trim()}const si=t(import.meta.url)("node:assert");var ni=__nccwpck_require__.n(si);const ri=(0,U.createRequire)(import.meta.url);const{default:oi}=ri("@expo/json-file");async function createExpoApp(t,e){const i=e.template??"blank-typescript";const s=e.templateVersion??"canary";if(await G().pathExists(t)){throw new Error(`Project already exists at ${t}`)}await runAsync("bunx",["create-expo-app",t,"--no-install",`--template`,`${i}@${s}`]);const n=await setupExpoRepoAsync(t,e.useExpoRepoPath,e.nightlyVersion);await setupProjectPackageJsonAsync(t,n,e.nightlyVersion);await setupMetroConfigAsync(t,n);await setupAppJsonAsync(t,{appId:e.appId,newArchEnabled:e.newArchEnabled});return n}async function setupProjectPackageJsonAsync(t,e,i){const s=H().join(t,"package.json");const n=await oi.readAsync(s);const r=n.scripts??{};r["postinstall"]="bun --cwd expo postinstall";let o;const a=H().relative(t,e);if(a.startsWith("..")){o=e}else{o=a}const c=n.resolutions??{};for(const t of ti){c[t]=`${i}`}await oi.mergeAsync(s,{workspaces:[`${o}/packages/*`,`${o}/packages/@expo/*`],expo:{autolinking:{exclude:["expo-face-detector","expo-module-template","expo-module-template-local"]}},resolutions:c,scripts:r})}async function setupMetroConfigAsync(t,e){await G().writeFile(H().join(t,"metro.config.js"),`const { getDefaultConfig } = require('expo/metro-config');\n\n/** @type {import('expo/metro-config').MetroConfig} */\nconst config = getDefaultConfig(__dirname);\n\nconfig.watchFolders = [\n ...config.watchFolders ?? [],\n __dirname,\n '${e}',\n];\n\nconfig.resolver.nodeModulesPaths = [\n ...config.resolver.nodeModulesPaths ?? [],\n '${e}/node_modules',\n];\n\nmodule.exports = config;`)}async function prebuildAppAsync(t,e){await runAsync("npx",["expo","prebuild","--no-install","--template",e],{cwd:t})}async function installCocoaPodsAsync(t){await runAsync("pod",["install"],{cwd:H().join(t,"ios")})}async function setupAppJsonAsync(t,{appId:e,newArchEnabled:i}){const s=H().join(t,"app.json");const n=await oi.readAsync(s);const r=n.expo;ni()(isJSONObject(r));const o=r.android??{};const a=r.ios??{};ni()(isJSONObject(o));ni()(isJSONObject(a));o.package=e;a.bundleIdentifier=e;const c=r.plugins??[];ni()(isJSONArray(c));r.runtimeVersion="1.0.0";r.android=o;r.ios=a;r.plugins=c;r.newArchEnabled=i;await oi.writeAsync(s,n)}function isJSONObject(t){return t!=null&&typeof t==="object"&&!Array.isArray(t)}function isJSONArray(t){return t!=null&&Array.isArray(t)}const ai=(0,U.createRequire)(import.meta.url);const{which:ci}=ai("zx");async function checkRequiredToolsAsync(t){const e=await Promise.all(t.map((t=>ci(t,{nothrow:true}))));for(const[i,s]of e.entries()){if(!s){throw new Error(`Missing required tool: ${t[i]}`)}}}const li=JSON.parse('{"u2":"create-expo-nightly","i8":"0.0.10"}');const hi=new j(li.u2).version(li.i8).description("Create an app for react-native nightlies testing.").argument("[path]","The output path for the app.",".").option("--name <name>","The name of the app to create.","test-nightlies").option("--expo-repo <path>",'The path to the expo repository. (default: Cloning to the "expo" directory in the output app)').option("-v, --verbose","Verbose output.").option("--app-id <name>","The Android applicationId and iOS bundleIdentifier.","dev.expo.testnightlies").option("--no-install","Skip installing CocoaPods.").option("--enable-new-architecture","Enable the New Architecture mode.").parse(process.argv);async function src_runAsync(t){const e=hi.opts();setDefaultVerbose(!!e.verbose);await checkRequiredToolsAsync(["bun","git","npm","yarn"]);const i=e.name;const s=H().join(H().resolve(hi.args[0]||"."),i);const n=await getNpmVersionAsync("react-native","nightly");const r={appId:e.appId,newArchEnabled:!!e.enableNewArchitecture,nightlyVersion:n,useExpoRepoPath:e.expoRepo};console.log(F.cyan(`Setting up app at ${F.bold(s)} with ${F.bold("react-native@"+n)}`));const o=await createExpoApp(s,r);const a=await getExpoPackagesAsync(o);await addWorkspacePackagesToAppAsync(s,a);console.log(F.cyan(`Reinstalling packages`));await reinstallPackagesAsync(s);console.log(F.cyan(`Running prebuild`));const c=await packExpoBareTemplateTarballAsync(o,H().join(s,".expo"));await prebuildAppAsync(s,c);if(e.install){if(process.platform==="darwin"){await checkRequiredToolsAsync(["pod"]);console.log(`Installing CocoaPods dependencies`);console.time("Installed CocoaPods dependencies");await installCocoaPodsAsync(s);console.timeEnd("Installed CocoaPods dependencies")}}}(async()=>{hi.parse(process.argv);try{await src_runAsync(li.u2)}catch(t){console.error("Uncaught Error",t);process.exit(1)}})()})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-expo-nightly",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "A tool to create an Expo app for react-native nightlies testing",
|
|
6
6
|
"keywords": [
|
|
@@ -36,16 +36,18 @@
|
|
|
36
36
|
"url": "git+https://github.com/expo/expo.git",
|
|
37
37
|
"directory": "packages/create-expo-nightly"
|
|
38
38
|
},
|
|
39
|
-
"
|
|
39
|
+
"dependencies": {
|
|
40
40
|
"@expo/json-file": "^9.0.0",
|
|
41
|
+
"zx": "^8.2.0"
|
|
42
|
+
},
|
|
43
|
+
"devDependencies": {
|
|
41
44
|
"@tsconfig/node20": "^20.1.2",
|
|
42
45
|
"@vercel/ncc": "^0.38.0",
|
|
43
46
|
"chalk": "^5.3.0",
|
|
44
47
|
"commander": "^12.1.0",
|
|
45
48
|
"expo-module-scripts": "^4.0.0",
|
|
46
49
|
"fs-extra": "^11.2.0",
|
|
47
|
-
"glob": "^10.3.10"
|
|
48
|
-
"zx": "^8.2.0"
|
|
50
|
+
"glob": "^10.3.10"
|
|
49
51
|
},
|
|
50
|
-
"gitHead": "
|
|
52
|
+
"gitHead": "6f9f79a91090fd9e83159523a16e2083aba88c65"
|
|
51
53
|
}
|