create-bunext 1.0.0 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js CHANGED
@@ -1,110 +1,110 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as wQ}from"node:module";var CQ=Object.create;var{getPrototypeOf:jQ,defineProperty:f6,getOwnPropertyNames:xQ}=Object;var IQ=Object.prototype.hasOwnProperty;var e0=($,X,Z)=>{Z=$!=null?CQ(jQ($)):{};let J=X||!$||!$.__esModule?f6(Z,"default",{value:$,enumerable:!0}):Z;for(let q of xQ($))if(!IQ.call(J,q))f6(J,q,{get:()=>$[q],enumerable:!0});return J};var P0=($,X)=>()=>(X||$((X={exports:{}}).exports,X),X.exports);var W0=wQ(import.meta.url);var W7=P0((hV,U7)=>{U7.exports=B7;B7.sync=Oq;var z7=W0("fs");function wq($,X){var Z=X.pathExt!==void 0?X.pathExt:process.env.PATHEXT;if(!Z)return!0;if(Z=Z.split(";"),Z.indexOf("")!==-1)return!0;for(var J=0;J<Z.length;J++){var q=Z[J].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function K7($,X,Z){if(!$.isSymbolicLink()&&!$.isFile())return!1;return wq(X,Z)}function B7($,X,Z){z7.stat($,function(J,q){Z(J,J?!1:K7(q,$,X))})}function Oq($,X){return K7(z7.statSync($),$,X)}});var T7=P0((NV,R7)=>{R7.exports=L7;L7.sync=Eq;var V7=W0("fs");function L7($,X,Z){V7.stat($,function(J,q){Z(J,J?!1:_7(q,X))})}function Eq($,X){return _7(V7.statSync($),X)}function _7($,X){return $.isFile()&&Aq($,X)}function Aq($,X){var{mode:Z,uid:J,gid:q}=$,Y=X.uid!==void 0?X.uid:process.getuid&&process.getuid(),Q=X.gid!==void 0?X.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),B=parseInt("001",8),K=G|H,U=Z&B||Z&H&&q===Q||Z&G&&J===Y||Z&K&&Y===0;return U}});var M7=P0((SV,F7)=>{var DV=W0("fs"),p$;if(process.platform==="win32"||global.TESTING_WINDOWS)p$=W7();else p$=T7();F7.exports=C2;C2.sync=hq;function C2($,X,Z){if(typeof X==="function")Z=X,X={};if(!Z){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,q){C2($,X||{},function(Y,Q){if(Y)q(Y);else J(Q)})})}p$($,X||{},function(J,q){if(J){if(J.code==="EACCES"||X&&X.ignoreErrors)J=null,q=!1}Z(J,q)})}function hq($,X){try{return p$.sync($,X||{})}catch(Z){if(X&&X.ignoreErrors||Z.code==="EACCES")return!1;else throw Z}}});var O7=P0((vV,w7)=>{var d1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",P7=W0("path"),Nq=d1?";":":",C7=M7(),j7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),x7=($,X)=>{let Z=X.colon||Nq,J=$.match(/\//)||d1&&$.match(/\\/)?[""]:[...d1?[process.cwd()]:[],...(X.path||process.env.PATH||"").split(Z)],q=d1?X.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=d1?q.split(Z):[""];if(d1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:J,pathExt:Y,pathExtExe:q}},I7=($,X,Z)=>{if(typeof X==="function")Z=X,X={};if(!X)X={};let{pathEnv:J,pathExt:q,pathExtExe:Y}=x7($,X),Q=[],G=(B)=>new Promise((K,U)=>{if(B===J.length)return X.all&&Q.length?K(Q):U(j7($));let W=J[B],_=/^".*"$/.test(W)?W.slice(1,-1):W,R=P7.join(_,$),L=!_&&/^\.[\\\/]/.test($)?$.slice(0,2)+R:R;K(H(L,B,0))}),H=(B,K,U)=>new Promise((W,_)=>{if(U===q.length)return W(G(K+1));let R=q[U];C7(B+R,{pathExt:Y},(L,I)=>{if(!L&&I)if(X.all)Q.push(B+R);else return W(B+R);return W(H(B,K,U+1))})});return Z?G(0).then((B)=>Z(null,B),Z):G(0)},Dq=($,X)=>{X=X||{};let{pathEnv:Z,pathExt:J,pathExtExe:q}=x7($,X),Y=[];for(let Q=0;Q<Z.length;Q++){let G=Z[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,B=P7.join(H,$),K=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+B:B;for(let U=0;U<J.length;U++){let W=K+J[U];try{if(C7.sync(W,{pathExt:q}))if(X.all)Y.push(W);else return W}catch(_){}}}if(X.all&&Y.length)return Y;if(X.nothrow)return null;throw j7($)};w7.exports=I7;I7.sync=Dq});var A7=P0((fV,j2)=>{var E7=($={})=>{let X=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(X).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};j2.exports=E7;j2.exports.default=E7});var S7=P0((kV,D7)=>{var h7=W0("path"),Sq=O7(),vq=A7();function N7($,X){let Z=$.options.env||process.env,J=process.cwd(),q=$.options.cwd!=null,Y=q&&process.chdir!==void 0&&!process.chdir.disabled;if(Y)try{process.chdir($.options.cwd)}catch(G){}let Q;try{Q=Sq.sync($.command,{path:Z[vq({env:Z})],pathExt:X?h7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(J)}if(Q)Q=h7.resolve(q?$.options.cwd:"",Q);return Q}function fq($){return N7($)||N7($,!0)}D7.exports=fq});var v7=P0((yq,I2)=>{var x2=/([()\][%!^"`<>&|;, *?])/g;function kq($){return $=$.replace(x2,"^$1"),$}function bq($,X){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(x2,"^$1"),X)$=$.replace(x2,"^$1");return $}yq.command=kq;yq.argument=bq});var k7=P0((bV,f7)=>{f7.exports=/^#!(.*)/});var y7=P0((yV,b7)=>{var cq=k7();b7.exports=($="")=>{let X=$.match(cq);if(!X)return null;let[Z,J]=X[0].replace(/#! ?/,"").split(" "),q=Z.split("/").pop();if(q==="env")return J;return J?`${q} ${J}`:q}});var m7=P0((gV,g7)=>{var w2=W0("fs"),uq=y7();function pq($){let Z=Buffer.alloc(150),J;try{J=w2.openSync($,"r"),w2.readSync(J,Z,0,150,0),w2.closeSync(J)}catch(q){}return uq(Z.toString())}g7.exports=pq});var d7=P0((mV,p7)=>{var dq=W0("path"),c7=S7(),u7=v7(),lq=m7(),nq=process.platform==="win32",iq=/\.(?:com|exe)$/i,tq=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function oq($){$.file=c7($);let X=$.file&&lq($.file);if(X)return $.args.unshift($.file),$.command=X,c7($);return $.file}function aq($){if(!nq)return $;let X=oq($),Z=!iq.test(X);if($.options.forceShell||Z){let J=tq.test(X);$.command=dq.normalize($.command),$.command=u7.command($.command),$.args=$.args.map((Y)=>u7.argument(Y,J));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function rq($,X,Z){if(X&&!Array.isArray(X))Z=X,X=null;X=X?X.slice(0):[],Z=Object.assign({},Z);let J={command:$,args:X,options:Z,file:void 0,original:{command:$,args:X}};return Z.shell?J:aq(J)}p7.exports=rq});var i7=P0((cV,n7)=>{var O2=process.platform==="win32";function E2($,X){return Object.assign(Error(`${X} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${X} ${$.command}`,path:$.command,spawnargs:$.args})}function sq($,X){if(!O2)return;let Z=$.emit;$.emit=function(J,q){if(J==="exit"){let Y=l7(q,X);if(Y)return Z.call($,"error",Y)}return Z.apply($,arguments)}}function l7($,X){if(O2&&$===1&&!X.file)return E2(X.original,"spawn");return null}function eq($,X){if(O2&&$===1&&!X.file)return E2(X.original,"spawnSync");return null}n7.exports={hookChildProcess:sq,verifyENOENT:l7,verifyENOENTSync:eq,notFoundError:E2}});var a7=P0((uV,l1)=>{var t7=W0("child_process"),A2=d7(),h2=i7();function o7($,X,Z){let J=A2($,X,Z),q=t7.spawn(J.command,J.args,J.options);return h2.hookChildProcess(q,J),q}function $9($,X,Z){let J=A2($,X,Z),q=t7.spawnSync(J.command,J.args,J.options);return q.error=q.error||h2.verifyENOENTSync(q.status,J),q}l1.exports=o7;l1.exports.spawn=o7;l1.exports.sync=$9;l1.exports._parse=A2;l1.exports._enoent=h2});var c3=P0((aj,dZ)=>{var m3={to($,X){if(!X)return`\x1B[${$+1}G`;return`\x1B[${X+1};${$+1}H`},move($,X){let Z="";if($<0)Z+=`\x1B[${-$}D`;else if($>0)Z+=`\x1B[${$}C`;if(X<0)Z+=`\x1B[${-X}A`;else if(X>0)Z+=`\x1B[${X}B`;return Z},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},XB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},ZB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let X="";for(let Z=0;Z<$;Z++)X+=this.line+(Z<$-1?m3.up():"");if($)X+=m3.left;return X}};dZ.exports={cursor:m3,scroll:XB,erase:ZB,beep:"\x07"}});var p4=P0((rj,u3)=>{var u4=process||{},lZ=u4.argv||[],c4=u4.env||{},JB=!(!!c4.NO_COLOR||lZ.includes("--no-color"))&&(!!c4.FORCE_COLOR||lZ.includes("--color")||u4.platform==="win32"||(u4.stdout||{}).isTTY&&c4.TERM!=="dumb"||!!c4.CI),QB=($,X,Z=$)=>(J)=>{let q=""+J,Y=q.indexOf(X,$.length);return~Y?$+qB(q,X,Z,Y)+X:$+q+X},qB=($,X,Z,J)=>{let q="",Y=0;do q+=$.substring(Y,J)+Z,Y=J+X.length,J=$.indexOf(X,Y);while(~J);return q+$.substring(Y)},nZ=($=JB)=>{let X=$?QB:()=>String;return{isColorSupported:$,reset:X("\x1B[0m","\x1B[0m"),bold:X("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:X("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:X("\x1B[3m","\x1B[23m"),underline:X("\x1B[4m","\x1B[24m"),inverse:X("\x1B[7m","\x1B[27m"),hidden:X("\x1B[8m","\x1B[28m"),strikethrough:X("\x1B[9m","\x1B[29m"),black:X("\x1B[30m","\x1B[39m"),red:X("\x1B[31m","\x1B[39m"),green:X("\x1B[32m","\x1B[39m"),yellow:X("\x1B[33m","\x1B[39m"),blue:X("\x1B[34m","\x1B[39m"),magenta:X("\x1B[35m","\x1B[39m"),cyan:X("\x1B[36m","\x1B[39m"),white:X("\x1B[37m","\x1B[39m"),gray:X("\x1B[90m","\x1B[39m"),bgBlack:X("\x1B[40m","\x1B[49m"),bgRed:X("\x1B[41m","\x1B[49m"),bgGreen:X("\x1B[42m","\x1B[49m"),bgYellow:X("\x1B[43m","\x1B[49m"),bgBlue:X("\x1B[44m","\x1B[49m"),bgMagenta:X("\x1B[45m","\x1B[49m"),bgCyan:X("\x1B[46m","\x1B[49m"),bgWhite:X("\x1B[47m","\x1B[49m"),blackBright:X("\x1B[90m","\x1B[39m"),redBright:X("\x1B[91m","\x1B[39m"),greenBright:X("\x1B[92m","\x1B[39m"),yellowBright:X("\x1B[93m","\x1B[39m"),blueBright:X("\x1B[94m","\x1B[39m"),magentaBright:X("\x1B[95m","\x1B[39m"),cyanBright:X("\x1B[96m","\x1B[39m"),whiteBright:X("\x1B[97m","\x1B[39m"),bgBlackBright:X("\x1B[100m","\x1B[49m"),bgRedBright:X("\x1B[101m","\x1B[49m"),bgGreenBright:X("\x1B[102m","\x1B[49m"),bgYellowBright:X("\x1B[103m","\x1B[49m"),bgBlueBright:X("\x1B[104m","\x1B[49m"),bgMagentaBright:X("\x1B[105m","\x1B[49m"),bgCyanBright:X("\x1B[106m","\x1B[49m"),bgWhiteBright:X("\x1B[107m","\x1B[49m")}};u3.exports=nZ();u3.exports.createColors=nZ});function Y0($){if(typeof $!=="object"||$===null)return!1;let X=Object.getPrototypeOf($);return(X===null||X===Object.prototype||Object.getPrototypeOf(X)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as OQ}from"node:url";var c1=($,X)=>{let Z=W2(EQ($));if(typeof Z!=="string")throw TypeError(`${X} must be a string or a file URL: ${Z}.`);return Z},EQ=($)=>U2($)?$.toString():$,U2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,W2=($)=>$ instanceof URL?OQ($):$;var N$=($,X=[],Z={})=>{let J=c1($,"First argument"),[q,Y]=Y0(X)?[[],X]:[X,Z];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Y0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[J,Q,Y]};import{ChildProcess as fQ}from"node:child_process";import{StringDecoder as AQ}from"node:string_decoder";var{toString:k6}=Object.prototype,b6=($)=>k6.call($)==="[object ArrayBuffer]",V0=($)=>k6.call($)==="[object Uint8Array]",$1=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),hQ=new TextEncoder,y6=($)=>hQ.encode($),NQ=new TextDecoder,D$=($)=>NQ.decode($),g6=($,X)=>{return DQ($,X).join("")},DQ=($,X)=>{if(X==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let Z=new AQ(X),J=$.map((Y)=>typeof Y==="string"?y6(Y):Y).map((Y)=>Z.write(Y)),q=Z.end();return q===""?J:[...J,q]},z$=($)=>{if($.length===1&&V0($[0]))return $[0];return V2(SQ($))},SQ=($)=>$.map((X)=>typeof X==="string"?y6(X):X),V2=($)=>{let X=new Uint8Array(vQ($)),Z=0;for(let J of $)X.set(J,Z),Z+=J.length;return X},vQ=($)=>{let X=0;for(let Z of $)X+=Z.length;return X};var p6=($)=>Array.isArray($)&&Array.isArray($.raw),d6=($,X)=>{let Z=[];for(let[Y,Q]of $.entries())Z=kQ({templates:$,expressions:X,tokens:Z,index:Y,template:Q});if(Z.length===0)throw TypeError("Template script must not be empty");let[J,...q]=Z;return[J,q,{}]},kQ=({templates:$,expressions:X,tokens:Z,index:J,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[J]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=bQ(q,$.raw[J]),H=c6(Z,Y,Q);if(J===X.length)return H;let B=X[J],K=Array.isArray(B)?B.map((U)=>u6(U)):[u6(B)];return c6(H,K,G)},bQ=($,X)=>{if(X.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let Z=[],J=0,q=m6.has(X[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=X[G];if(m6.has(H)){if(J!==Q)Z.push($.slice(J,Q));J=Q+1}else if(H==="\\"){let B=X[G+1];if(B===`
3
- `)Q-=1,G+=1;else if(B==="u"&&X[G+2]==="{")G=X.indexOf("}",G+3);else G+=yQ[B]??1}}let Y=J===$.length;if(!Y)Z.push($.slice(J));return{nextTokens:Z,leadingWhitespaces:q,trailingWhitespaces:Y}},m6=new Set([" ","\t","\r",`
4
- `]),yQ={x:3,u:5},c6=($,X,Z)=>Z||$.length===0||X.length===0?[...$,...X]:[...$.slice(0,-1),`${$.at(-1)}${X[0]}`,...X.slice(1)],u6=($)=>{let X=typeof $;if(X==="string")return $;if(X==="number")return String($);if(Y0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return gQ($);if($ instanceof fQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${X}" in template expression`)},gQ=({stdout:$})=>{if(typeof $==="string")return $;if(V0($))return D$($);if($===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof $}" stdout in template expression`)};import{spawnSync as nH}from"node:child_process";import{debuglog as mQ}from"node:util";import L2 from"node:process";var b0=($)=>S$.includes($),S$=[L2.stdin,L2.stdout,L2.stderr],h0=["stdin","stdout","stderr"],v$=($)=>h0[$]??`stdio[${$}]`;var n6=($)=>{let X={...$};for(let Z of T2)X[Z]=_2($,Z);return X},_2=($,X)=>{let Z=Array.from({length:cQ($)+1}),J=uQ($[X],Z,X);return iQ(J,X)},cQ=({stdio:$})=>Array.isArray($)?Math.max($.length,h0.length):h0.length,uQ=($,X,Z)=>Y0($)?pQ($,X,Z):X.fill($),pQ=($,X,Z)=>{for(let J of Object.keys($).sort(dQ))for(let q of lQ(J,Z,X))X[q]=$[J];return X},dQ=($,X)=>l6($)<l6(X)?1:-1,l6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},lQ=($,X,Z)=>{if($==="ipc")return[Z.length-1];let J=R2($);if(J===void 0||J===0)throw TypeError(`"${X}.${$}" is invalid.
5
- It must be "${X}.stdout", "${X}.stderr", "${X}.all", "${X}.ipc", or "${X}.fd3", "${X}.fd4" (and so on).`);if(J>=Z.length)throw TypeError(`"${X}.${$}" is invalid: that file descriptor does not exist.
6
- Please set the "stdio" option to ensure that file descriptor exists.`);return J==="all"?[1,2]:[J]},R2=($)=>{if($==="all")return $;if(h0.includes($))return h0.indexOf($);let X=nQ.exec($);if(X!==null)return Number(X[1])},nQ=/^fd(\d+)$/,iQ=($,X)=>$.map((Z)=>Z===void 0?oQ[X]:Z),tQ=mQ("execa").enabled?"full":"none",oQ={lines:!1,buffer:!0,maxBuffer:1e8,verbose:tQ,stripFinalNewline:!0},T2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],X1=($,X)=>X==="ipc"?$.at(-1):$[X];var u1=({verbose:$},X)=>F2($,X)!=="none",p1=({verbose:$},X)=>!["none","short"].includes(F2($,X)),i6=({verbose:$},X)=>{let Z=F2($,X);return f$(Z)?Z:void 0},F2=($,X)=>X===void 0?aQ($):X1($,X),aQ=($)=>$.find((X)=>f$(X))??k$.findLast((X)=>$.includes(X)),f$=($)=>typeof $==="function",k$=["none","short","full"];import{inspect as Tq}from"node:util";import{platform as rQ}from"node:process";import{stripVTControlCharacters as sQ}from"node:util";var t6=($,X)=>{let Z=[$,...X],J=Z.join(" "),q=Z.map((Y)=>Qq(o6(Y))).join(" ");return{command:J,escapedCommand:q}},K$=($)=>sQ($).split(`
7
- `).map((X)=>o6(X)).join(`
8
- `),o6=($)=>$.replaceAll(Xq,(X)=>eQ(X)),eQ=($)=>{let X=Zq[$];if(X!==void 0)return X;let Z=$.codePointAt(0),J=Z.toString(16);return Z<=Jq?`\\u${J.padStart(4,"0")}`:`\\U${J}`},$q=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},Xq=$q(),Zq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Jq=65535,Qq=($)=>{if(qq.test($))return $;return rQ==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},qq=/^[\w./-]+$/;import a6 from"node:process";function M2(){let{env:$}=a6,{TERM:X,TERM_PROGRAM:Z}=$;if(a6.platform!=="win32")return X!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||Z==="Terminus-Sublime"||Z==="vscode"||X==="xterm-256color"||X==="alacritty"||X==="rxvt-unicode"||X==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var r6={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},s6={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},Yq={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Gq={...r6,...s6},Hq={...r6,...Yq},zq=M2(),Kq=zq?Gq:Hq,b$=Kq,MW=Object.entries(s6);import Bq from"node:tty";var Uq=Bq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,X)=>{if(!Uq)return(q)=>q;let Z=`\x1B[${$}m`,J=`\x1B[${X}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(J);if(Q===-1)return Z+Y+J;let G=Z,H=0,K=(X===22?J:"")+Z;while(Q!==-1)G+=Y.slice(H,Q)+K,H=Q+J.length,Q=Y.indexOf(J,H);return G+=Y.slice(H)+J,G}},jW=p(0,0),e6=p(1,22),xW=p(2,22),IW=p(3,23),wW=p(4,24),OW=p(53,55),EW=p(7,27),AW=p(8,28),hW=p(9,29),NW=p(30,39),DW=p(31,39),SW=p(32,39),vW=p(33,39),fW=p(34,39),kW=p(35,39),bW=p(36,39),yW=p(37,39),y$=p(90,39),gW=p(40,49),mW=p(41,49),cW=p(42,49),uW=p(43,49),pW=p(44,49),dW=p(45,49),lW=p(46,49),nW=p(47,49),iW=p(100,49),$7=p(91,39),tW=p(92,39),X7=p(93,39),oW=p(94,39),aW=p(95,39),rW=p(96,39),sW=p(97,39),eW=p(101,49),$V=p(102,49),XV=p(103,49),ZV=p(104,49),JV=p(105,49),QV=p(106,49),qV=p(107,49);var Q7=({type:$,message:X,timestamp:Z,piped:J,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Wq(Z),H=Vq[$]({failed:Y,reject:Q,piped:J}),B=Lq[$]({reject:Q});return`${y$(`[${G}]`)} ${y$(`[${q}]`)} ${B(H)} ${B(X)}`},Wq=($)=>`${g$($.getHours(),2)}:${g$($.getMinutes(),2)}:${g$($.getSeconds(),2)}.${g$($.getMilliseconds(),3)}`,g$=($,X)=>String($).padStart(X,"0"),Z7=({failed:$,reject:X})=>{if(!$)return b$.tick;return X?b$.cross:b$.warning},Vq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:Z7,duration:Z7},J7=($)=>$,Lq={command:()=>e6,output:()=>J7,ipc:()=>J7,error:({reject:$})=>$?$7:X7,duration:()=>y$};var q7=($,X,Z)=>{let J=i6(X,Z);return $.map(({verboseLine:q,verboseObject:Y})=>_q(q,Y,J)).filter((q)=>q!==void 0).map((q)=>Rq(q)).join("")},_q=($,X,Z)=>{if(Z===void 0)return $;let J=Z($,X);if(typeof J==="string")return J},Rq=($)=>$.endsWith(`
2
+ import{createRequire as hQ}from"node:module";var wQ=Object.create;var{getPrototypeOf:OQ,defineProperty:g6,getOwnPropertyNames:EQ}=Object;var AQ=Object.prototype.hasOwnProperty;var $1=($,Z,X)=>{X=$!=null?wQ(OQ($)):{};let J=Z||!$||!$.__esModule?g6(X,"default",{value:$,enumerable:!0}):X;for(let q of EQ($))if(!AQ.call(J,q))g6(J,q,{get:()=>$[q],enumerable:!0});return J};var C0=($,Z)=>()=>(Z||$((Z={exports:{}}).exports,Z),Z.exports);var V0=hQ(import.meta.url);var R7=C0((SV,_7)=>{_7.exports=L7;L7.sync=Nq;var W7=V0("fs");function hq($,Z){var X=Z.pathExt!==void 0?Z.pathExt:process.env.PATHEXT;if(!X)return!0;if(X=X.split(";"),X.indexOf("")!==-1)return!0;for(var J=0;J<X.length;J++){var q=X[J].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function V7($,Z,X){if(!$.isSymbolicLink()&&!$.isFile())return!1;return hq(Z,X)}function L7($,Z,X){W7.stat($,function(J,q){X(J,J?!1:V7(q,$,Z))})}function Nq($,Z){return V7(W7.statSync($),$,Z)}});var P7=C0((vV,C7)=>{C7.exports=F7;F7.sync=Dq;var T7=V0("fs");function F7($,Z,X){T7.stat($,function(J,q){X(J,J?!1:M7(q,Z))})}function Dq($,Z){return M7(T7.statSync($),Z)}function M7($,Z){return $.isFile()&&Sq($,Z)}function Sq($,Z){var{mode:X,uid:J,gid:q}=$,Y=Z.uid!==void 0?Z.uid:process.getuid&&process.getuid(),Q=Z.gid!==void 0?Z.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),K=parseInt("001",8),W=G|H,U=X&K||X&H&&q===Q||X&G&&J===Y||X&W&&Y===0;return U}});var j7=C0((kV,x7)=>{var fV=V0("fs"),d$;if(process.platform==="win32"||global.TESTING_WINDOWS)d$=R7();else d$=P7();x7.exports=I2;I2.sync=vq;function I2($,Z,X){if(typeof Z==="function")X=Z,Z={};if(!X){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(J,q){I2($,Z||{},function(Y,Q){if(Y)q(Y);else J(Q)})})}d$($,Z||{},function(J,q){if(J){if(J.code==="EACCES"||Z&&Z.ignoreErrors)J=null,q=!1}X(J,q)})}function vq($,Z){try{return d$.sync($,Z||{})}catch(X){if(Z&&Z.ignoreErrors||X.code==="EACCES")return!1;else throw X}}});var N7=C0((bV,h7)=>{var l1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",I7=V0("path"),fq=l1?";":":",w7=j7(),O7=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),E7=($,Z)=>{let X=Z.colon||fq,J=$.match(/\//)||l1&&$.match(/\\/)?[""]:[...l1?[process.cwd()]:[],...(Z.path||process.env.PATH||"").split(X)],q=l1?Z.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=l1?q.split(X):[""];if(l1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:J,pathExt:Y,pathExtExe:q}},A7=($,Z,X)=>{if(typeof Z==="function")X=Z,Z={};if(!Z)Z={};let{pathEnv:J,pathExt:q,pathExtExe:Y}=E7($,Z),Q=[],G=(K)=>new Promise((W,U)=>{if(K===J.length)return Z.all&&Q.length?W(Q):U(O7($));let B=J[K],R=/^".*"$/.test(B)?B.slice(1,-1):B,_=I7.join(R,$),L=!R&&/^\.[\\\/]/.test($)?$.slice(0,2)+_:_;W(H(L,K,0))}),H=(K,W,U)=>new Promise((B,R)=>{if(U===q.length)return B(G(W+1));let _=q[U];w7(K+_,{pathExt:Y},(L,j)=>{if(!L&&j)if(Z.all)Q.push(K+_);else return B(K+_);return B(H(K,W,U+1))})});return X?G(0).then((K)=>X(null,K),X):G(0)},kq=($,Z)=>{Z=Z||{};let{pathEnv:X,pathExt:J,pathExtExe:q}=E7($,Z),Y=[];for(let Q=0;Q<X.length;Q++){let G=X[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,K=I7.join(H,$),W=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+K:K;for(let U=0;U<J.length;U++){let B=W+J[U];try{if(w7.sync(B,{pathExt:q}))if(Z.all)Y.push(B);else return B}catch(R){}}}if(Z.all&&Y.length)return Y;if(Z.nothrow)return null;throw O7($)};h7.exports=A7;A7.sync=kq});var S7=C0((yV,w2)=>{var D7=($={})=>{let Z=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"};w2.exports=D7;w2.exports.default=D7});var b7=C0((gV,k7)=>{var v7=V0("path"),bq=N7(),yq=S7();function f7($,Z){let X=$.options.env||process.env,J=process.cwd(),q=$.options.cwd!=null,Y=q&&process.chdir!==void 0&&!process.chdir.disabled;if(Y)try{process.chdir($.options.cwd)}catch(G){}let Q;try{Q=bq.sync($.command,{path:X[yq({env:X})],pathExt:Z?v7.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(J)}if(Q)Q=v7.resolve(q?$.options.cwd:"",Q);return Q}function gq($){return f7($)||f7($,!0)}k7.exports=gq});var y7=C0((cq,E2)=>{var O2=/([()\][%!^"`<>&|;, *?])/g;function uq($){return $=$.replace(O2,"^$1"),$}function mq($,Z){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(O2,"^$1"),Z)$=$.replace(O2,"^$1");return $}cq.command=uq;cq.argument=mq});var u7=C0((uV,g7)=>{g7.exports=/^#!(.*)/});var c7=C0((mV,m7)=>{var lq=u7();m7.exports=($="")=>{let Z=$.match(lq);if(!Z)return null;let[X,J]=Z[0].replace(/#! ?/,"").split(" "),q=X.split("/").pop();if(q==="env")return J;return J?`${q} ${J}`:q}});var d7=C0((cV,p7)=>{var A2=V0("fs"),nq=c7();function iq($){let X=Buffer.alloc(150),J;try{J=A2.openSync($,"r"),A2.readSync(J,X,0,150,0),A2.closeSync(J)}catch(q){}return nq(X.toString())}p7.exports=iq});var t7=C0((pV,i7)=>{var tq=V0("path"),l7=b7(),n7=y7(),oq=d7(),aq=process.platform==="win32",rq=/\.(?:com|exe)$/i,sq=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function eq($){$.file=l7($);let Z=$.file&&oq($.file);if(Z)return $.args.unshift($.file),$.command=Z,l7($);return $.file}function $9($){if(!aq)return $;let Z=eq($),X=!rq.test(Z);if($.options.forceShell||X){let J=sq.test(Z);$.command=tq.normalize($.command),$.command=n7.command($.command),$.args=$.args.map((Y)=>n7.argument(Y,J));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function Z9($,Z,X){if(Z&&!Array.isArray(Z))X=Z,Z=null;Z=Z?Z.slice(0):[],X=Object.assign({},X);let J={command:$,args:Z,options:X,file:void 0,original:{command:$,args:Z}};return X.shell?J:$9(J)}i7.exports=Z9});var r7=C0((dV,a7)=>{var h2=process.platform==="win32";function N2($,Z){return Object.assign(Error(`${Z} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${Z} ${$.command}`,path:$.command,spawnargs:$.args})}function X9($,Z){if(!h2)return;let X=$.emit;$.emit=function(J,q){if(J==="exit"){let Y=o7(q,Z);if(Y)return X.call($,"error",Y)}return X.apply($,arguments)}}function o7($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawn");return null}function J9($,Z){if(h2&&$===1&&!Z.file)return N2(Z.original,"spawnSync");return null}a7.exports={hookChildProcess:X9,verifyENOENT:o7,verifyENOENTSync:J9,notFoundError:N2}});var $8=C0((lV,n1)=>{var s7=V0("child_process"),D2=t7(),S2=r7();function e7($,Z,X){let J=D2($,Z,X),q=s7.spawn(J.command,J.args,J.options);return S2.hookChildProcess(q,J),q}function Q9($,Z,X){let J=D2($,Z,X),q=s7.spawnSync(J.command,J.args,J.options);return q.error=q.error||S2.verifyENOENTSync(q.status,J),q}n1.exports=e7;n1.exports.spawn=e7;n1.exports.sync=Q9;n1.exports._parse=D2;n1.exports._enoent=S2});var d3=C0((ex,tX)=>{var p3={to($,Z){if(!Z)return`\x1B[${$+1}G`;return`\x1B[${Z+1};${$+1}H`},move($,Z){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(Z<0)X+=`\x1B[${-Z}A`;else if(Z>0)X+=`\x1B[${Z}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},qB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},YB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let Z="";for(let X=0;X<$;X++)Z+=this.line+(X<$-1?p3.up():"");if($)Z+=p3.left;return Z}};tX.exports={cursor:p3,scroll:qB,erase:YB,beep:"\x07"}});var d4=C0(($j,l3)=>{var p4=process||{},oX=p4.argv||[],c4=p4.env||{},GB=!(!!c4.NO_COLOR||oX.includes("--no-color"))&&(!!c4.FORCE_COLOR||oX.includes("--color")||p4.platform==="win32"||(p4.stdout||{}).isTTY&&c4.TERM!=="dumb"||!!c4.CI),HB=($,Z,X=$)=>(J)=>{let q=""+J,Y=q.indexOf(Z,$.length);return~Y?$+zB(q,Z,X,Y)+Z:$+q+Z},zB=($,Z,X,J)=>{let q="",Y=0;do q+=$.substring(Y,J)+X,Y=J+Z.length,J=$.indexOf(Z,Y);while(~J);return q+$.substring(Y)},aX=($=GB)=>{let Z=$?HB:()=>String;return{isColorSupported:$,reset:Z("\x1B[0m","\x1B[0m"),bold:Z("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:Z("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:Z("\x1B[3m","\x1B[23m"),underline:Z("\x1B[4m","\x1B[24m"),inverse:Z("\x1B[7m","\x1B[27m"),hidden:Z("\x1B[8m","\x1B[28m"),strikethrough:Z("\x1B[9m","\x1B[29m"),black:Z("\x1B[30m","\x1B[39m"),red:Z("\x1B[31m","\x1B[39m"),green:Z("\x1B[32m","\x1B[39m"),yellow:Z("\x1B[33m","\x1B[39m"),blue:Z("\x1B[34m","\x1B[39m"),magenta:Z("\x1B[35m","\x1B[39m"),cyan:Z("\x1B[36m","\x1B[39m"),white:Z("\x1B[37m","\x1B[39m"),gray:Z("\x1B[90m","\x1B[39m"),bgBlack:Z("\x1B[40m","\x1B[49m"),bgRed:Z("\x1B[41m","\x1B[49m"),bgGreen:Z("\x1B[42m","\x1B[49m"),bgYellow:Z("\x1B[43m","\x1B[49m"),bgBlue:Z("\x1B[44m","\x1B[49m"),bgMagenta:Z("\x1B[45m","\x1B[49m"),bgCyan:Z("\x1B[46m","\x1B[49m"),bgWhite:Z("\x1B[47m","\x1B[49m"),blackBright:Z("\x1B[90m","\x1B[39m"),redBright:Z("\x1B[91m","\x1B[39m"),greenBright:Z("\x1B[92m","\x1B[39m"),yellowBright:Z("\x1B[93m","\x1B[39m"),blueBright:Z("\x1B[94m","\x1B[39m"),magentaBright:Z("\x1B[95m","\x1B[39m"),cyanBright:Z("\x1B[96m","\x1B[39m"),whiteBright:Z("\x1B[97m","\x1B[39m"),bgBlackBright:Z("\x1B[100m","\x1B[49m"),bgRedBright:Z("\x1B[101m","\x1B[49m"),bgGreenBright:Z("\x1B[102m","\x1B[49m"),bgYellowBright:Z("\x1B[103m","\x1B[49m"),bgBlueBright:Z("\x1B[104m","\x1B[49m"),bgMagentaBright:Z("\x1B[105m","\x1B[49m"),bgCyanBright:Z("\x1B[106m","\x1B[49m"),bgWhiteBright:Z("\x1B[107m","\x1B[49m")}};l3.exports=aX();l3.exports.createColors=aX});function Y0($){if(typeof $!=="object"||$===null)return!1;let Z=Object.getPrototypeOf($);return(Z===null||Z===Object.prototype||Object.getPrototypeOf(Z)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as NQ}from"node:url";var c1=($,Z)=>{let X=_2(DQ($));if(typeof X!=="string")throw TypeError(`${Z} must be a string or a file URL: ${X}.`);return X},DQ=($)=>L2($)?$.toString():$,L2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,_2=($)=>$ instanceof URL?NQ($):$;var D$=($,Z=[],X={})=>{let J=c1($,"First argument"),[q,Y]=Y0(Z)?[[],Z]:[Z,X];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!Y0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[J,Q,Y]};import{ChildProcess as gQ}from"node:child_process";import{StringDecoder as SQ}from"node:string_decoder";var{toString:u6}=Object.prototype,m6=($)=>u6.call($)==="[object ArrayBuffer]",L0=($)=>u6.call($)==="[object Uint8Array]",Z1=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),vQ=new TextEncoder,c6=($)=>vQ.encode($),fQ=new TextDecoder,S$=($)=>fQ.decode($),p6=($,Z)=>{return kQ($,Z).join("")},kQ=($,Z)=>{if(Z==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let X=new SQ(Z),J=$.map((Y)=>typeof Y==="string"?c6(Y):Y).map((Y)=>X.write(Y)),q=X.end();return q===""?J:[...J,q]},K$=($)=>{if($.length===1&&L0($[0]))return $[0];return R2(bQ($))},bQ=($)=>$.map((Z)=>typeof Z==="string"?c6(Z):Z),R2=($)=>{let Z=new Uint8Array(yQ($)),X=0;for(let J of $)Z.set(J,X),X+=J.length;return Z},yQ=($)=>{let Z=0;for(let X of $)Z+=X.length;return Z};var i6=($)=>Array.isArray($)&&Array.isArray($.raw),t6=($,Z)=>{let X=[];for(let[Y,Q]of $.entries())X=uQ({templates:$,expressions:Z,tokens:X,index:Y,template:Q});if(X.length===0)throw TypeError("Template script must not be empty");let[J,...q]=X;return[J,q,{}]},uQ=({templates:$,expressions:Z,tokens:X,index:J,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[J]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=mQ(q,$.raw[J]),H=l6(X,Y,Q);if(J===Z.length)return H;let K=Z[J],W=Array.isArray(K)?K.map((U)=>n6(U)):[n6(K)];return l6(H,W,G)},mQ=($,Z)=>{if(Z.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],J=0,q=d6.has(Z[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=Z[G];if(d6.has(H)){if(J!==Q)X.push($.slice(J,Q));J=Q+1}else if(H==="\\"){let K=Z[G+1];if(K===`
3
+ `)Q-=1,G+=1;else if(K==="u"&&Z[G+2]==="{")G=Z.indexOf("}",G+3);else G+=cQ[K]??1}}let Y=J===$.length;if(!Y)X.push($.slice(J));return{nextTokens:X,leadingWhitespaces:q,trailingWhitespaces:Y}},d6=new Set([" ","\t","\r",`
4
+ `]),cQ={x:3,u:5},l6=($,Z,X)=>X||$.length===0||Z.length===0?[...$,...Z]:[...$.slice(0,-1),`${$.at(-1)}${Z[0]}`,...Z.slice(1)],n6=($)=>{let Z=typeof $;if(Z==="string")return $;if(Z==="number")return String($);if(Y0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return pQ($);if($ instanceof gQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${Z}" in template expression`)},pQ=({stdout:$})=>{if(typeof $==="string")return $;if(L0($))return S$($);if($===void 0)throw TypeError(`Missing result.stdout in template expression. This is probably due to the previous subprocess' "stdout" option.`);throw TypeError(`Unexpected "${typeof $}" stdout in template expression`)};import{spawnSync as aH}from"node:child_process";import{debuglog as dQ}from"node:util";import T2 from"node:process";var y0=($)=>v$.includes($),v$=[T2.stdin,T2.stdout,T2.stderr],N0=["stdin","stdout","stderr"],f$=($)=>N0[$]??`stdio[${$}]`;var a6=($)=>{let Z={...$};for(let X of C2)Z[X]=F2($,X);return Z},F2=($,Z)=>{let X=Array.from({length:lQ($)+1}),J=nQ($[Z],X,Z);return rQ(J,Z)},lQ=({stdio:$})=>Array.isArray($)?Math.max($.length,N0.length):N0.length,nQ=($,Z,X)=>Y0($)?iQ($,Z,X):Z.fill($),iQ=($,Z,X)=>{for(let J of Object.keys($).sort(tQ))for(let q of oQ(J,X,Z))Z[q]=$[J];return Z},tQ=($,Z)=>o6($)<o6(Z)?1:-1,o6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},oQ=($,Z,X)=>{if($==="ipc")return[X.length-1];let J=M2($);if(J===void 0||J===0)throw TypeError(`"${Z}.${$}" is invalid.
5
+ It must be "${Z}.stdout", "${Z}.stderr", "${Z}.all", "${Z}.ipc", or "${Z}.fd3", "${Z}.fd4" (and so on).`);if(J>=X.length)throw TypeError(`"${Z}.${$}" is invalid: that file descriptor does not exist.
6
+ Please set the "stdio" option to ensure that file descriptor exists.`);return J==="all"?[1,2]:[J]},M2=($)=>{if($==="all")return $;if(N0.includes($))return N0.indexOf($);let Z=aQ.exec($);if(Z!==null)return Number(Z[1])},aQ=/^fd(\d+)$/,rQ=($,Z)=>$.map((X)=>X===void 0?eQ[Z]:X),sQ=dQ("execa").enabled?"full":"none",eQ={lines:!1,buffer:!0,maxBuffer:1e8,verbose:sQ,stripFinalNewline:!0},C2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],X1=($,Z)=>Z==="ipc"?$.at(-1):$[Z];var p1=({verbose:$},Z)=>P2($,Z)!=="none",d1=({verbose:$},Z)=>!["none","short"].includes(P2($,Z)),r6=({verbose:$},Z)=>{let X=P2($,Z);return k$(X)?X:void 0},P2=($,Z)=>Z===void 0?$q($):X1($,Z),$q=($)=>$.find((Z)=>k$(Z))??b$.findLast((Z)=>$.includes(Z)),k$=($)=>typeof $==="function",b$=["none","short","full"];import{inspect as Pq}from"node:util";import{platform as Zq}from"node:process";import{stripVTControlCharacters as Xq}from"node:util";var s6=($,Z)=>{let X=[$,...Z],J=X.join(" "),q=X.map((Y)=>Hq(e6(Y))).join(" ");return{command:J,escapedCommand:q}},B$=($)=>Xq($).split(`
7
+ `).map((Z)=>e6(Z)).join(`
8
+ `),e6=($)=>$.replaceAll(qq,(Z)=>Jq(Z)),Jq=($)=>{let Z=Yq[$];if(Z!==void 0)return Z;let X=$.codePointAt(0),J=X.toString(16);return X<=Gq?`\\u${J.padStart(4,"0")}`:`\\U${J}`},Qq=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},qq=Qq(),Yq={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},Gq=65535,Hq=($)=>{if(zq.test($))return $;return Zq==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},zq=/^[\w./-]+$/;import $7 from"node:process";function x2(){let{env:$}=$7,{TERM:Z,TERM_PROGRAM:X}=$;if($7.platform!=="win32")return Z!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||Z==="xterm-256color"||Z==="alacritty"||Z==="rxvt-unicode"||Z==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var Z7={circleQuestionMark:"(?)",questionMarkPrefix:"(?)",square:"█",squareDarkShade:"▓",squareMediumShade:"▒",squareLightShade:"░",squareTop:"▀",squareBottom:"▄",squareLeft:"▌",squareRight:"▐",squareCenter:"■",bullet:"●",dot:"․",ellipsis:"…",pointerSmall:"›",triangleUp:"▲",triangleUpSmall:"▴",triangleDown:"▼",triangleDownSmall:"▾",triangleLeftSmall:"◂",triangleRightSmall:"▸",home:"⌂",heart:"♥",musicNote:"♪",musicNoteBeamed:"♫",arrowUp:"↑",arrowDown:"↓",arrowLeft:"←",arrowRight:"→",arrowLeftRight:"↔",arrowUpDown:"↕",almostEqual:"≈",notEqual:"≠",lessOrEqual:"≤",greaterOrEqual:"≥",identical:"≡",infinity:"∞",subscriptZero:"₀",subscriptOne:"₁",subscriptTwo:"₂",subscriptThree:"₃",subscriptFour:"₄",subscriptFive:"₅",subscriptSix:"₆",subscriptSeven:"₇",subscriptEight:"₈",subscriptNine:"₉",oneHalf:"½",oneThird:"⅓",oneQuarter:"¼",oneFifth:"⅕",oneSixth:"⅙",oneEighth:"⅛",twoThirds:"⅔",twoFifths:"⅖",threeQuarters:"¾",threeFifths:"⅗",threeEighths:"⅜",fourFifths:"⅘",fiveSixths:"⅚",fiveEighths:"⅝",sevenEighths:"⅞",line:"─",lineBold:"━",lineDouble:"═",lineDashed0:"┄",lineDashed1:"┅",lineDashed2:"┈",lineDashed3:"┉",lineDashed4:"╌",lineDashed5:"╍",lineDashed6:"╴",lineDashed7:"╶",lineDashed8:"╸",lineDashed9:"╺",lineDashed10:"╼",lineDashed11:"╾",lineDashed12:"−",lineDashed13:"–",lineDashed14:"‐",lineDashed15:"⁃",lineVertical:"│",lineVerticalBold:"┃",lineVerticalDouble:"║",lineVerticalDashed0:"┆",lineVerticalDashed1:"┇",lineVerticalDashed2:"┊",lineVerticalDashed3:"┋",lineVerticalDashed4:"╎",lineVerticalDashed5:"╏",lineVerticalDashed6:"╵",lineVerticalDashed7:"╷",lineVerticalDashed8:"╹",lineVerticalDashed9:"╻",lineVerticalDashed10:"╽",lineVerticalDashed11:"╿",lineDownLeft:"┐",lineDownLeftArc:"╮",lineDownBoldLeftBold:"┓",lineDownBoldLeft:"┒",lineDownLeftBold:"┑",lineDownDoubleLeftDouble:"╗",lineDownDoubleLeft:"╖",lineDownLeftDouble:"╕",lineDownRight:"┌",lineDownRightArc:"╭",lineDownBoldRightBold:"┏",lineDownBoldRight:"┎",lineDownRightBold:"┍",lineDownDoubleRightDouble:"╔",lineDownDoubleRight:"╓",lineDownRightDouble:"╒",lineUpLeft:"┘",lineUpLeftArc:"╯",lineUpBoldLeftBold:"┛",lineUpBoldLeft:"┚",lineUpLeftBold:"┙",lineUpDoubleLeftDouble:"╝",lineUpDoubleLeft:"╜",lineUpLeftDouble:"╛",lineUpRight:"└",lineUpRightArc:"╰",lineUpBoldRightBold:"┗",lineUpBoldRight:"┖",lineUpRightBold:"┕",lineUpDoubleRightDouble:"╚",lineUpDoubleRight:"╙",lineUpRightDouble:"╘",lineUpDownLeft:"┤",lineUpBoldDownBoldLeftBold:"┫",lineUpBoldDownBoldLeft:"┨",lineUpDownLeftBold:"┥",lineUpBoldDownLeftBold:"┩",lineUpDownBoldLeftBold:"┪",lineUpDownBoldLeft:"┧",lineUpBoldDownLeft:"┦",lineUpDoubleDownDoubleLeftDouble:"╣",lineUpDoubleDownDoubleLeft:"╢",lineUpDownLeftDouble:"╡",lineUpDownRight:"├",lineUpBoldDownBoldRightBold:"┣",lineUpBoldDownBoldRight:"┠",lineUpDownRightBold:"┝",lineUpBoldDownRightBold:"┡",lineUpDownBoldRightBold:"┢",lineUpDownBoldRight:"┟",lineUpBoldDownRight:"┞",lineUpDoubleDownDoubleRightDouble:"╠",lineUpDoubleDownDoubleRight:"╟",lineUpDownRightDouble:"╞",lineDownLeftRight:"┬",lineDownBoldLeftBoldRightBold:"┳",lineDownLeftBoldRightBold:"┯",lineDownBoldLeftRight:"┰",lineDownBoldLeftBoldRight:"┱",lineDownBoldLeftRightBold:"┲",lineDownLeftRightBold:"┮",lineDownLeftBoldRight:"┭",lineDownDoubleLeftDoubleRightDouble:"╦",lineDownDoubleLeftRight:"╥",lineDownLeftDoubleRightDouble:"╤",lineUpLeftRight:"┴",lineUpBoldLeftBoldRightBold:"┻",lineUpLeftBoldRightBold:"┷",lineUpBoldLeftRight:"┸",lineUpBoldLeftBoldRight:"┹",lineUpBoldLeftRightBold:"┺",lineUpLeftRightBold:"┶",lineUpLeftBoldRight:"┵",lineUpDoubleLeftDoubleRightDouble:"╩",lineUpDoubleLeftRight:"╨",lineUpLeftDoubleRightDouble:"╧",lineUpDownLeftRight:"┼",lineUpBoldDownBoldLeftBoldRightBold:"╋",lineUpDownBoldLeftBoldRightBold:"╈",lineUpBoldDownLeftBoldRightBold:"╇",lineUpBoldDownBoldLeftRightBold:"╊",lineUpBoldDownBoldLeftBoldRight:"╉",lineUpBoldDownLeftRight:"╀",lineUpDownBoldLeftRight:"╁",lineUpDownLeftBoldRight:"┽",lineUpDownLeftRightBold:"┾",lineUpBoldDownBoldLeftRight:"╂",lineUpDownLeftBoldRightBold:"┿",lineUpBoldDownLeftBoldRight:"╃",lineUpBoldDownLeftRightBold:"╄",lineUpDownBoldLeftBoldRight:"╅",lineUpDownBoldLeftRightBold:"╆",lineUpDoubleDownDoubleLeftDoubleRightDouble:"╬",lineUpDoubleDownDoubleLeftRight:"╫",lineUpDownLeftDoubleRightDouble:"╪",lineCross:"╳",lineBackslash:"╲",lineSlash:"╱"},X7={tick:"✔",info:"ℹ",warning:"⚠",cross:"✘",squareSmall:"◻",squareSmallFilled:"◼",circle:"◯",circleFilled:"◉",circleDotted:"◌",circleDouble:"◎",circleCircle:"ⓞ",circleCross:"ⓧ",circlePipe:"Ⓘ",radioOn:"◉",radioOff:"◯",checkboxOn:"☒",checkboxOff:"☐",checkboxCircleOn:"ⓧ",checkboxCircleOff:"Ⓘ",pointer:"❯",triangleUpOutline:"△",triangleLeft:"◀",triangleRight:"▶",lozenge:"◆",lozengeOutline:"◇",hamburger:"☰",smiley:"㋡",mustache:"෴",star:"★",play:"▶",nodejs:"⬢",oneSeventh:"⅐",oneNinth:"⅑",oneTenth:"⅒"},Kq={tick:"√",info:"i",warning:"‼",cross:"×",squareSmall:"□",squareSmallFilled:"■",circle:"( )",circleFilled:"(*)",circleDotted:"( )",circleDouble:"( )",circleCircle:"(○)",circleCross:"(×)",circlePipe:"(│)",radioOn:"(*)",radioOff:"( )",checkboxOn:"[×]",checkboxOff:"[ ]",checkboxCircleOn:"(×)",checkboxCircleOff:"( )",pointer:">",triangleUpOutline:"∆",triangleLeft:"◄",triangleRight:"►",lozenge:"♦",lozengeOutline:"◊",hamburger:"≡",smiley:"☺",mustache:"┌─┐",star:"✶",play:"►",nodejs:"♦",oneSeventh:"1/7",oneNinth:"1/9",oneTenth:"1/10"},Bq={...Z7,...X7},Uq={...Z7,...Kq},Wq=x2(),Vq=Wq?Bq:Uq,y$=Vq,xW=Object.entries(X7);import Lq from"node:tty";var _q=Lq?.WriteStream?.prototype?.hasColors?.()??!1,p=($,Z)=>{if(!_q)return(q)=>q;let X=`\x1B[${$}m`,J=`\x1B[${Z}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(J);if(Q===-1)return X+Y+J;let G=X,H=0,W=(Z===22?J:"")+X;while(Q!==-1)G+=Y.slice(H,Q)+W,H=Q+J.length,Q=Y.indexOf(J,H);return G+=Y.slice(H)+J,G}},wW=p(0,0),J7=p(1,22),OW=p(2,22),EW=p(3,23),AW=p(4,24),hW=p(53,55),NW=p(7,27),DW=p(8,28),SW=p(9,29),vW=p(30,39),fW=p(31,39),kW=p(32,39),bW=p(33,39),yW=p(34,39),gW=p(35,39),uW=p(36,39),mW=p(37,39),g$=p(90,39),cW=p(40,49),pW=p(41,49),dW=p(42,49),lW=p(43,49),nW=p(44,49),iW=p(45,49),tW=p(46,49),oW=p(47,49),aW=p(100,49),Q7=p(91,39),rW=p(92,39),q7=p(93,39),sW=p(94,39),eW=p(95,39),$V=p(96,39),ZV=p(97,39),XV=p(101,49),JV=p(102,49),QV=p(103,49),qV=p(104,49),YV=p(105,49),GV=p(106,49),HV=p(107,49);var H7=({type:$,message:Z,timestamp:X,piped:J,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=Rq(X),H=Tq[$]({failed:Y,reject:Q,piped:J}),K=Fq[$]({reject:Q});return`${g$(`[${G}]`)} ${g$(`[${q}]`)} ${K(H)} ${K(Z)}`},Rq=($)=>`${u$($.getHours(),2)}:${u$($.getMinutes(),2)}:${u$($.getSeconds(),2)}.${u$($.getMilliseconds(),3)}`,u$=($,Z)=>String($).padStart(Z,"0"),Y7=({failed:$,reject:Z})=>{if(!$)return y$.tick;return Z?y$.cross:y$.warning},Tq={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:Y7,duration:Y7},G7=($)=>$,Fq={command:()=>J7,output:()=>G7,ipc:()=>G7,error:({reject:$})=>$?Q7:q7,duration:()=>g$};var z7=($,Z,X)=>{let J=r6(Z,X);return $.map(({verboseLine:q,verboseObject:Y})=>Mq(q,Y,J)).filter((q)=>q!==void 0).map((q)=>Cq(q)).join("")},Mq=($,Z,X)=>{if(X===void 0)return $;let J=X($,Z);if(typeof J==="string")return J},Cq=($)=>$.endsWith(`
9
9
  `)?$:`${$}
10
- `;var p0=({type:$,verboseMessage:X,fdNumber:Z,verboseInfo:J,result:q})=>{let Y=Fq({type:$,result:q,verboseInfo:J}),Q=Mq(X,Y),G=q7(Q,J,Z);if(G!=="")console.warn(G.slice(0,-1))},Fq=({type:$,result:X,verboseInfo:{escapedCommand:Z,commandId:J,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:Z,commandId:`${J}`,timestamp:new Date,piped:q,result:X,options:Y}),Mq=($,X)=>$.split(`
11
- `).map((Z)=>Pq({...X,message:Z})),Pq=($)=>{return{verboseLine:Q7($),verboseObject:$}},m$=($)=>{let X=typeof $==="string"?$:Tq($);return K$(X).replaceAll("\t"," ".repeat(Cq))},Cq=2;var Y7=($,X)=>{if(!u1(X))return;p0({type:"command",verboseMessage:$,verboseInfo:X})};var G7=($,X,Z)=>{Iq($);let J=jq($);return{verbose:$,escapedCommand:X,commandId:J,rawOptions:Z}},jq=($)=>u1({verbose:$})?xq++:void 0,xq=0n,Iq=($)=>{for(let X of $){if(X===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(X===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!k$.includes(X)&&!f$(X)){let Z=k$.map((J)=>`'${J}'`).join(", ");throw TypeError(`The "verbose" option must not be ${X}. Allowed values are: ${Z} or a function.`)}}};import{hrtime as H7}from"node:process";var c$=()=>H7.bigint(),P2=($)=>Number(H7.bigint()-$)/1e6;var u$=($,X,Z)=>{let J=c$(),{command:q,escapedCommand:Y}=t6($,X),Q=_2(Z,"verbose"),G=G7(Q,Y,{...Z});return Y7(Y,G),{command:q,escapedCommand:Y,startTime:J,verboseInfo:G}};var Y5=e0(a7(),1);import BY from"node:path";import q5 from"node:process";import n$ from"node:process";import M1 from"node:path";function d$($={}){let{env:X=process.env,platform:Z=process.platform}=$;if(Z!=="win32")return"PATH";return Object.keys(X).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"}import{promisify as X9}from"node:util";import{execFile as Z9,execFileSync as nV}from"node:child_process";import r7 from"node:path";import{fileURLToPath as J9}from"node:url";var oV=X9(Z9);function l$($){return $ instanceof URL?J9($):$}function s7($){return{*[Symbol.iterator](){let X=r7.resolve(l$($)),Z;while(Z!==X)yield X,Z=X,X=r7.resolve(X,"..")}}}var Q9=({cwd:$=n$.cwd(),path:X=n$.env[d$()],preferLocal:Z=!0,execPath:J=n$.execPath,addExecPath:q=!0}={})=>{let Y=M1.resolve(l$($)),Q=[],G=X.split(M1.delimiter);if(Z)q9(Q,G,Y);if(q)Y9(Q,G,J,Y);return X===""||X===M1.delimiter?`${Q.join(M1.delimiter)}${X}`:[...Q,X].join(M1.delimiter)},q9=($,X,Z)=>{for(let J of s7(Z)){let q=M1.join(J,"node_modules/.bin");if(!X.includes(q))$.push(q)}},Y9=($,X,Z,J)=>{let q=M1.resolve(J,l$(Z),"..");if(!X.includes(q))$.push(q)},e7=({env:$=n$.env,...X}={})=>{$={...$};let Z=d$({env:$});return X.path=$[Z],$[Z]=Q9(X),$};import{setTimeout as P9}from"node:timers/promises";var $8=($,X,Z)=>{let J=Z?t$:i$,q=$ instanceof d0?{}:{cause:$};return new J(X,q)};class d0 extends Error{}var X8=($,X)=>{Object.defineProperty($.prototype,"name",{value:X,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,J8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Z8=($)=>o$($)&&(J8 in $),J8=Symbol("isExecaError"),o$=($)=>Object.prototype.toString.call($)==="[object Error]";class i$ extends Error{}X8(i$,i$.name);class t$ extends Error{}X8(t$,t$.name);import{constants as B$}from"node:os";import{constants as K9}from"node:os";var Q8=()=>{let $=N2-q8+1;return Array.from({length:$},G9)},G9=($,X)=>({name:`SIGRT${X+1}`,number:q8+X,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),q8=34,N2=64;import{constants as H9}from"node:os";var Y8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var D2=()=>{let $=Q8();return[...Y8,...$].map(z9)},z9=({name:$,number:X,description:Z,action:J,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=H9,G=Q!==void 0;return{name:$,number:G?Q:X,description:Z,supported:G,action:J,forced:q,standard:Y}};var B9=()=>{let $=D2();return Object.fromEntries($.map(U9))},U9=({name:$,number:X,description:Z,supported:J,action:q,forced:Y,standard:Q})=>[$,{name:$,number:X,description:Z,supported:J,action:q,forced:Y,standard:Q}],G8=B9(),W9=()=>{let $=D2(),X=N2+1,Z=Array.from({length:X},(J,q)=>V9(q,$));return Object.assign({},...Z)},V9=($,X)=>{let Z=L9($,X);if(Z===void 0)return{};let{name:J,description:q,supported:Y,action:Q,forced:G,standard:H}=Z;return{[$]:{name:J,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},L9=($,X)=>{let Z=X.find(({name:J})=>K9.signals[J]===$);if(Z!==void 0)return Z;return X.find((J)=>J.number===$)},WL=W9();var z8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return B8($,"option `killSignal`")},K8=($)=>$===0?$:B8($,"`subprocess.kill()`'s argument"),B8=($,X)=>{if(Number.isInteger($))return _9($,X);if(typeof $==="string")return T9($,X);throw TypeError(`Invalid ${X} ${String($)}: it must be a string or an integer.
12
- ${S2()}`)},_9=($,X)=>{if(H8.has($))return H8.get($);throw TypeError(`Invalid ${X} ${$}: this signal integer does not exist.
13
- ${S2()}`)},R9=()=>new Map(Object.entries(B$.signals).reverse().map(([$,X])=>[X,$])),H8=R9(),T9=($,X)=>{if($ in B$.signals)return $;if($.toUpperCase()in B$.signals)throw TypeError(`Invalid ${X} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${X} '${$}': this signal name does not exist.
14
- ${S2()}`)},S2=()=>`Available signal names: ${F9()}.
15
- Available signal numbers: ${M9()}.`,F9=()=>Object.keys(B$.signals).sort().map(($)=>`'${$}'`).join(", "),M9=()=>[...new Set(Object.values(B$.signals).sort(($,X)=>$-X))].join(", "),a$=($)=>G8[$].description;var U8=($)=>{if($===!1)return $;if($===!0)return C9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},C9=5000,W8=({kill:$,options:{forceKillAfterDelay:X,killSignal:Z},onInternalError:J,context:q,controller:Y},Q,G)=>{let{signal:H,error:B}=j9(Q,G,Z);x9(B,J);let K=$(H);return I9({kill:$,signal:H,forceKillAfterDelay:X,killSignal:Z,killResult:K,context:q,controller:Y}),K},j9=($,X,Z)=>{let[J=Z,q]=o$($)?[void 0,$]:[$,X];if(typeof J!=="string"&&!Number.isInteger(J))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(J)}`);if(q!==void 0&&!o$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:K8(J),error:q}},x9=($,X)=>{if($!==void 0)X.reject($)},I9=async({kill:$,signal:X,forceKillAfterDelay:Z,killSignal:J,killResult:q,context:Y,controller:Q})=>{if(X===J&&q)v2({kill:$,forceKillAfterDelay:Z,context:Y,controllerSignal:Q.signal})},v2=async({kill:$,forceKillAfterDelay:X,context:Z,controllerSignal:J})=>{if(X===!1)return;try{if(await P9(X,void 0,{signal:J}),$("SIGKILL"))Z.isForcefullyTerminated??=!0}catch{}};import{once as w9}from"node:events";var r$=async($,X)=>{if(!$.aborted)await w9($,"abort",{signal:X})};var V8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},L8=({subprocess:$,cancelSignal:X,gracefulCancel:Z,context:J,controller:q})=>X===void 0||Z?[]:[O9($,X,J,q)],O9=async($,X,Z,{signal:J})=>{throw await r$(X,J),Z.terminationReason??="cancel",$.kill(),X.reason};import{scheduler as t9}from"node:timers/promises";import{promisify as l9}from"node:util";var n1=({methodName:$,isSubprocess:X,ipc:Z,isConnected:J})=>{E9($,X,Z),f2($,X,J)},E9=($,X,Z)=>{if(!Z)throw Error(`${y0($,X)} can only be used if the \`ipc\` option is \`true\`.`)},f2=($,X,Z)=>{if(!Z)throw Error(`${y0($,X)} cannot be used: the ${G1(X)} has already exited or disconnected.`)},_8=($)=>{throw Error(`${y0("getOneMessage",$)} could not complete: the ${G1($)} exited or disconnected.`)},R8=($)=>{throw Error(`${y0("sendMessage",$)} failed: the ${G1($)} is sending a message too, instead of listening to incoming messages.
10
+ `;var l0=({type:$,verboseMessage:Z,fdNumber:X,verboseInfo:J,result:q})=>{let Y=xq({type:$,result:q,verboseInfo:J}),Q=jq(Z,Y),G=z7(Q,J,X);if(G!=="")console.warn(G.slice(0,-1))},xq=({type:$,result:Z,verboseInfo:{escapedCommand:X,commandId:J,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:X,commandId:`${J}`,timestamp:new Date,piped:q,result:Z,options:Y}),jq=($,Z)=>$.split(`
11
+ `).map((X)=>Iq({...Z,message:X})),Iq=($)=>{return{verboseLine:H7($),verboseObject:$}},m$=($)=>{let Z=typeof $==="string"?$:Pq($);return B$(Z).replaceAll("\t"," ".repeat(wq))},wq=2;var K7=($,Z)=>{if(!p1(Z))return;l0({type:"command",verboseMessage:$,verboseInfo:Z})};var B7=($,Z,X)=>{Aq($);let J=Oq($);return{verbose:$,escapedCommand:Z,commandId:J,rawOptions:X}},Oq=($)=>p1({verbose:$})?Eq++:void 0,Eq=0n,Aq=($)=>{for(let Z of $){if(Z===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(Z===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!b$.includes(Z)&&!k$(Z)){let X=b$.map((J)=>`'${J}'`).join(", ");throw TypeError(`The "verbose" option must not be ${Z}. Allowed values are: ${X} or a function.`)}}};import{hrtime as U7}from"node:process";var c$=()=>U7.bigint(),j2=($)=>Number(U7.bigint()-$)/1e6;var p$=($,Z,X)=>{let J=c$(),{command:q,escapedCommand:Y}=s6($,Z),Q=F2(X,"verbose"),G=B7(Q,Y,{...X});return K7(Y,G),{command:q,escapedCommand:Y,startTime:J,verboseInfo:G}};var K5=$1($8(),1);import LY from"node:path";import z5 from"node:process";import i$ from"node:process";import M1 from"node:path";function l$($={}){let{env:Z=process.env,platform:X=process.platform}=$;if(X!=="win32")return"PATH";return Object.keys(Z).reverse().find((J)=>J.toUpperCase()==="PATH")||"Path"}import{promisify as q9}from"node:util";import{execFile as Y9,execFileSync as oV}from"node:child_process";import Z8 from"node:path";import{fileURLToPath as G9}from"node:url";var sV=q9(Y9);function n$($){return $ instanceof URL?G9($):$}function X8($){return{*[Symbol.iterator](){let Z=Z8.resolve(n$($)),X;while(X!==Z)yield Z,X=Z,Z=Z8.resolve(Z,"..")}}}var H9=({cwd:$=i$.cwd(),path:Z=i$.env[l$()],preferLocal:X=!0,execPath:J=i$.execPath,addExecPath:q=!0}={})=>{let Y=M1.resolve(n$($)),Q=[],G=Z.split(M1.delimiter);if(X)z9(Q,G,Y);if(q)K9(Q,G,J,Y);return Z===""||Z===M1.delimiter?`${Q.join(M1.delimiter)}${Z}`:[...Q,Z].join(M1.delimiter)},z9=($,Z,X)=>{for(let J of X8(X)){let q=M1.join(J,"node_modules/.bin");if(!Z.includes(q))$.push(q)}},K9=($,Z,X,J)=>{let q=M1.resolve(J,n$(X),"..");if(!Z.includes(q))$.push(q)},J8=({env:$=i$.env,...Z}={})=>{$={...$};let X=l$({env:$});return Z.path=$[X],$[X]=H9(Z),$};import{setTimeout as I9}from"node:timers/promises";var Q8=($,Z,X)=>{let J=X?o$:t$,q=$ instanceof n0?{}:{cause:$};return new J(Z,q)};class n0 extends Error{}var q8=($,Z)=>{Object.defineProperty($.prototype,"name",{value:Z,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,G8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},Y8=($)=>a$($)&&(G8 in $),G8=Symbol("isExecaError"),a$=($)=>Object.prototype.toString.call($)==="[object Error]";class t$ extends Error{}q8(t$,t$.name);class o$ extends Error{}q8(o$,o$.name);import{constants as U$}from"node:os";import{constants as V9}from"node:os";var H8=()=>{let $=v2-z8+1;return Array.from({length:$},B9)},B9=($,Z)=>({name:`SIGRT${Z+1}`,number:z8+Z,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),z8=34,v2=64;import{constants as U9}from"node:os";var K8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var f2=()=>{let $=H8();return[...K8,...$].map(W9)},W9=({name:$,number:Z,description:X,action:J,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=U9,G=Q!==void 0;return{name:$,number:G?Q:Z,description:X,supported:G,action:J,forced:q,standard:Y}};var L9=()=>{let $=f2();return Object.fromEntries($.map(_9))},_9=({name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q})=>[$,{name:$,number:Z,description:X,supported:J,action:q,forced:Y,standard:Q}],B8=L9(),R9=()=>{let $=f2(),Z=v2+1,X=Array.from({length:Z},(J,q)=>T9(q,$));return Object.assign({},...X)},T9=($,Z)=>{let X=F9($,Z);if(X===void 0)return{};let{name:J,description:q,supported:Y,action:Q,forced:G,standard:H}=X;return{[$]:{name:J,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},F9=($,Z)=>{let X=Z.find(({name:J})=>V9.signals[J]===$);if(X!==void 0)return X;return Z.find((J)=>J.number===$)},_L=R9();var W8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return L8($,"option `killSignal`")},V8=($)=>$===0?$:L8($,"`subprocess.kill()`'s argument"),L8=($,Z)=>{if(Number.isInteger($))return M9($,Z);if(typeof $==="string")return P9($,Z);throw TypeError(`Invalid ${Z} ${String($)}: it must be a string or an integer.
12
+ ${k2()}`)},M9=($,Z)=>{if(U8.has($))return U8.get($);throw TypeError(`Invalid ${Z} ${$}: this signal integer does not exist.
13
+ ${k2()}`)},C9=()=>new Map(Object.entries(U$.signals).reverse().map(([$,Z])=>[Z,$])),U8=C9(),P9=($,Z)=>{if($ in U$.signals)return $;if($.toUpperCase()in U$.signals)throw TypeError(`Invalid ${Z} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${Z} '${$}': this signal name does not exist.
14
+ ${k2()}`)},k2=()=>`Available signal names: ${x9()}.
15
+ Available signal numbers: ${j9()}.`,x9=()=>Object.keys(U$.signals).sort().map(($)=>`'${$}'`).join(", "),j9=()=>[...new Set(Object.values(U$.signals).sort(($,Z)=>$-Z))].join(", "),r$=($)=>B8[$].description;var _8=($)=>{if($===!1)return $;if($===!0)return w9;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},w9=5000,R8=({kill:$,options:{forceKillAfterDelay:Z,killSignal:X},onInternalError:J,context:q,controller:Y},Q,G)=>{let{signal:H,error:K}=O9(Q,G,X);E9(K,J);let W=$(H);return A9({kill:$,signal:H,forceKillAfterDelay:Z,killSignal:X,killResult:W,context:q,controller:Y}),W},O9=($,Z,X)=>{let[J=X,q]=a$($)?[void 0,$]:[$,Z];if(typeof J!=="string"&&!Number.isInteger(J))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(J)}`);if(q!==void 0&&!a$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:V8(J),error:q}},E9=($,Z)=>{if($!==void 0)Z.reject($)},A9=async({kill:$,signal:Z,forceKillAfterDelay:X,killSignal:J,killResult:q,context:Y,controller:Q})=>{if(Z===J&&q)b2({kill:$,forceKillAfterDelay:X,context:Y,controllerSignal:Q.signal})},b2=async({kill:$,forceKillAfterDelay:Z,context:X,controllerSignal:J})=>{if(Z===!1)return;try{if(await I9(Z,void 0,{signal:J}),$("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as h9}from"node:events";var s$=async($,Z)=>{if(!$.aborted)await h9($,"abort",{signal:Z})};var T8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},F8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,context:J,controller:q})=>Z===void 0||X?[]:[N9($,Z,J,q)],N9=async($,Z,X,{signal:J})=>{throw await s$(Z,J),X.terminationReason??="cancel",$.kill(),Z.reason};import{scheduler as s9}from"node:timers/promises";import{promisify as o9}from"node:util";var i1=({methodName:$,isSubprocess:Z,ipc:X,isConnected:J})=>{D9($,Z,X),y2($,Z,J)},D9=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} can only be used if the \`ipc\` option is \`true\`.`)},y2=($,Z,X)=>{if(!X)throw Error(`${g0($,Z)} cannot be used: the ${H1(Z)} has already exited or disconnected.`)},M8=($)=>{throw Error(`${g0("getOneMessage",$)} could not complete: the ${H1($)} exited or disconnected.`)},C8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} is sending a message too, instead of listening to incoming messages.
16
16
  This can be fixed by both sending a message and listening to incoming messages at the same time:
17
17
 
18
18
  const [receivedMessage] = await Promise.all([
19
- ${y0("getOneMessage",$)},
20
- ${y0("sendMessage",$,"message, {strict: true}")},
21
- ]);`)},s$=($,X)=>Error(`${y0("sendMessage",X)} failed when sending an acknowledgment response to the ${G1(X)}.`,{cause:$}),T8=($)=>{throw Error(`${y0("sendMessage",$)} failed: the ${G1($)} is not listening to incoming messages.`)},F8=($)=>{throw Error(`${y0("sendMessage",$)} failed: the ${G1($)} exited without listening to incoming messages.`)},M8=()=>Error(`\`cancelSignal\` aborted: the ${G1(!0)} disconnected.`),P8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},C8=({error:$,methodName:X,isSubprocess:Z})=>{if($.code==="EPIPE")throw Error(`${y0(X,Z)} cannot be used: the ${G1(Z)} is disconnecting.`,{cause:$})},j8=({error:$,methodName:X,isSubprocess:Z,message:J})=>{if(A9($))throw Error(`${y0(X,Z)}'s argument type is invalid: the message cannot be serialized: ${String(J)}.`,{cause:$})},A9=({code:$,message:X})=>h9.has($)||N9.some((Z)=>X.includes(Z)),h9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),N9=["could not be cloned","circular structure","call stack size exceeded"],y0=($,X,Z="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${D9(X)}${$}(${Z})`,D9=($)=>$?"":"subprocess.",G1=($)=>$?"parent process":"subprocess",i1=($)=>{if($.connected)$.disconnect()};var l0=()=>{let $={},X=new Promise((Z,J)=>{Object.assign($,{resolve:Z,reject:J})});return Object.assign(X,$)};var $4=($,X="stdin")=>{let{options:J,fileDescriptors:q}=n0.get($),Y=x8(q,X,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(I8(Y,X,J,!0));return Q},t1=($,X="stdout")=>{let{options:J,fileDescriptors:q}=n0.get($),Y=x8(q,X,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(I8(Y,X,J,!1));return Q},n0=new WeakMap,x8=($,X,Z)=>{let J=S9(X,Z);return v9(J,X,Z,$),J},S9=($,X)=>{let Z=R2($);if(Z!==void 0)return Z;let{validOptions:J,defaultValue:q}=X?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${U$(X)}" must not be "${$}".
19
+ ${g0("getOneMessage",$)},
20
+ ${g0("sendMessage",$,"message, {strict: true}")},
21
+ ]);`)},e$=($,Z)=>Error(`${g0("sendMessage",Z)} failed when sending an acknowledgment response to the ${H1(Z)}.`,{cause:$}),P8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} is not listening to incoming messages.`)},x8=($)=>{throw Error(`${g0("sendMessage",$)} failed: the ${H1($)} exited without listening to incoming messages.`)},j8=()=>Error(`\`cancelSignal\` aborted: the ${H1(!0)} disconnected.`),I8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},w8=({error:$,methodName:Z,isSubprocess:X})=>{if($.code==="EPIPE")throw Error(`${g0(Z,X)} cannot be used: the ${H1(X)} is disconnecting.`,{cause:$})},O8=({error:$,methodName:Z,isSubprocess:X,message:J})=>{if(S9($))throw Error(`${g0(Z,X)}'s argument type is invalid: the message cannot be serialized: ${String(J)}.`,{cause:$})},S9=({code:$,message:Z})=>v9.has($)||f9.some((X)=>Z.includes(X)),v9=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),f9=["could not be cloned","circular structure","call stack size exceeded"],g0=($,Z,X="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${k9(Z)}${$}(${X})`,k9=($)=>$?"":"subprocess.",H1=($)=>$?"parent process":"subprocess",t1=($)=>{if($.connected)$.disconnect()};var i0=()=>{let $={},Z=new Promise((X,J)=>{Object.assign($,{resolve:X,reject:J})});return Object.assign(Z,$)};var Z4=($,Z="stdin")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(A8(Y,Z,J,!0));return Q},o1=($,Z="stdout")=>{let{options:J,fileDescriptors:q}=t0.get($),Y=E8(q,Z,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(A8(Y,Z,J,!1));return Q},t0=new WeakMap,E8=($,Z,X)=>{let J=b9(Z,X);return y9(J,Z,X,$),J},b9=($,Z)=>{let X=M2($);if(X!==void 0)return X;let{validOptions:J,defaultValue:q}=Z?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${W$(Z)}" must not be "${$}".
22
22
  It must be ${J} or "fd3", "fd4" (and so on).
23
- It is optional and defaults to "${q}".`)},v9=($,X,Z,J)=>{let q=J[w8($)];if(q===void 0)throw TypeError(`"${U$(Z)}" must not be ${X}. That file descriptor does not exist.
24
- Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!Z)throw TypeError(`"${U$(Z)}" must not be ${X}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&Z)throw TypeError(`"${U$(Z)}" must not be ${X}. It must be a writable stream, not readable.`)},I8=($,X,Z,J)=>{if($==="all"&&!Z.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=f9($,Z);return`The "${q}: ${e$(Y)}" option is incompatible with using "${U$(J)}: ${e$(X)}".
25
- Please set this option with "pipe" instead.`},f9=($,{stdin:X,stdout:Z,stderr:J,stdio:q})=>{let Y=w8($);if(Y===0&&X!==void 0)return{optionName:"stdin",optionValue:X};if(Y===1&&Z!==void 0)return{optionName:"stdout",optionValue:Z};if(Y===2&&J!==void 0)return{optionName:"stderr",optionValue:J};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},w8=($)=>$==="all"?1:$,U$=($)=>$?"to":"from",e$=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as c9}from"node:events";import{addAbortListener as k9}from"node:events";var P1=($,X,Z)=>{let J=$.getMaxListeners();if(J===0||J===Number.POSITIVE_INFINITY)return;$.setMaxListeners(J+X),k9(Z,()=>{$.setMaxListeners($.getMaxListeners()-X)})};import{EventEmitter as g9}from"node:events";import{once as b9}from"node:events";import{scheduler as y9}from"node:timers/promises";var X4=($,X)=>{if(X)k2($)},k2=($)=>{$.refCounted()},Z4=($,X)=>{if(X)b2($)},b2=($)=>{$.unrefCounted()},O8=($,X)=>{if(X)b2($),b2($)},E8=($,X)=>{if(X)k2($),k2($)};var A8=async({anyProcess:$,channel:X,isSubprocess:Z,ipcEmitter:J},q)=>{if(D8(q)||v8(q))return;if(!J4.has($))J4.set($,[]);let Y=J4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await S8($,J,q),await y9.yield();let Q=await N8({wrappedMessage:Y[0],anyProcess:$,channel:X,isSubprocess:Z,ipcEmitter:J});Y.shift(),J.emit("message",Q),J.emit("message:done")}},h8=async({anyProcess:$,channel:X,isSubprocess:Z,ipcEmitter:J,boundOnMessage:q})=>{y2();let Y=J4.get($);while(Y?.length>0)await b9(J,"message:done");$.removeListener("message",q),E8(X,Z),J.connected=!1,J.emit("disconnect")},J4=new WeakMap;var H1=($,X,Z)=>{if(Q4.has($))return Q4.get($);let J=new g9;return J.connected=!0,Q4.set($,J),m9({ipcEmitter:J,anyProcess:$,channel:X,isSubprocess:Z}),J},Q4=new WeakMap,m9=({ipcEmitter:$,anyProcess:X,channel:Z,isSubprocess:J})=>{let q=A8.bind(void 0,{anyProcess:X,channel:Z,isSubprocess:J,ipcEmitter:$});X.on("message",q),X.once("disconnect",h8.bind(void 0,{anyProcess:X,channel:Z,isSubprocess:J,ipcEmitter:$,boundOnMessage:q})),O8(Z,J)},q4=($)=>{let X=Q4.get($);return X===void 0?$.channel!==null:X.connected};var f8=({anyProcess:$,channel:X,isSubprocess:Z,message:J,strict:q})=>{if(!q)return J;let Y=H1($,X,Z),Q=H4($,Y);return{id:u9++,type:G4,message:J,hasListeners:Q}},u9=0n,k8=($,X)=>{if(X?.type!==G4||X.hasListeners)return;for(let{id:Z}of $)if(Z!==void 0)Y4[Z].resolve({isDeadlock:!0,hasListeners:!1})},N8=async({wrappedMessage:$,anyProcess:X,channel:Z,isSubprocess:J,ipcEmitter:q})=>{if($?.type!==G4||!X.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:y8,message:H4(X,q)};try{await z4({anyProcess:X,channel:Z,isSubprocess:J,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},D8=($)=>{if($?.type!==y8)return!1;let{id:X,message:Z}=$;return Y4[X]?.resolve({isDeadlock:!1,hasListeners:Z}),!0},b8=async($,X,Z)=>{if($?.type!==G4)return;let J=l0();Y4[$.id]=J;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([J,p9(X,Z,q)]);if(Y)R8(Z);if(!Q)T8(Z)}finally{q.abort(),delete Y4[$.id]}},Y4={},p9=async($,X,{signal:Z})=>{P1($,1,Z),await c9($,"disconnect",{signal:Z}),F8(X)},G4="execa:ipc:request",y8="execa:ipc:response";var g8=($,X,Z)=>{if(!W$.has($))W$.set($,new Set);let J=W$.get($),q=l0(),Y=Z?X.id:void 0,Q={onMessageSent:q,id:Y};return J.add(Q),{outgoingMessages:J,outgoingMessage:Q}},m8=({outgoingMessages:$,outgoingMessage:X})=>{$.delete(X),X.onMessageSent.resolve()},S8=async($,X,Z)=>{while(!H4($,X)&&W$.get($)?.size>0){let J=[...W$.get($)];k8(J,Z),await Promise.all(J.map(({onMessageSent:q})=>q))}},W$=new WeakMap,H4=($,X)=>X.listenerCount("message")>d9($),d9=($)=>n0.has($)&&!X1(n0.get($).options.buffer,"ipc")?1:0;var z4=({anyProcess:$,channel:X,isSubprocess:Z,ipc:J},q,{strict:Y=!1}={})=>{return n1({methodName:"sendMessage",isSubprocess:Z,ipc:J,isConnected:$.connected}),n9({anyProcess:$,channel:X,methodName:"sendMessage",isSubprocess:Z,message:q,strict:Y})},n9=async({anyProcess:$,channel:X,methodName:Z,isSubprocess:J,message:q,strict:Y})=>{let Q=f8({anyProcess:$,channel:X,isSubprocess:J,message:q,strict:Y}),G=g8($,Q,Y);try{await m2({anyProcess:$,methodName:Z,isSubprocess:J,wrappedMessage:Q,message:q})}catch(H){throw i1($),H}finally{m8(G)}},m2=async({anyProcess:$,methodName:X,isSubprocess:Z,wrappedMessage:J,message:q})=>{let Y=i9($);try{await Promise.all([b8(J,$,Z),Y(J)])}catch(Q){throw C8({error:Q,methodName:X,isSubprocess:Z}),j8({error:Q,methodName:X,isSubprocess:Z,message:q}),Q}},i9=($)=>{if(g2.has($))return g2.get($);let X=l9($.send.bind($));return g2.set($,X),X},g2=new WeakMap;var u8=($,X)=>{return f2("cancelSignal",!1,$.connected),m2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:d8,message:X},message:X})},p8=async({anyProcess:$,channel:X,isSubprocess:Z,ipc:J})=>{return await o9({anyProcess:$,channel:X,isSubprocess:Z,ipc:J}),c2.signal},o9=async({anyProcess:$,channel:X,isSubprocess:Z,ipc:J})=>{if(c8)return;if(c8=!0,!J){P8();return}if(X===null){y2();return}H1($,X,Z),await t9.yield()},c8=!1,v8=($)=>{if($?.type!==d8)return!1;return c2.abort($.message),!0},d8="execa:ipc:cancel",y2=()=>{c2.abort(M8())},c2=new AbortController;var l8=({gracefulCancel:$,cancelSignal:X,ipc:Z,serialization:J})=>{if(!$)return;if(X===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!Z)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(J==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},n8=({subprocess:$,cancelSignal:X,gracefulCancel:Z,forceKillAfterDelay:J,context:q,controller:Y})=>Z?[a9({subprocess:$,cancelSignal:X,forceKillAfterDelay:J,context:q,controller:Y})]:[],a9=async({subprocess:$,cancelSignal:X,forceKillAfterDelay:Z,context:J,controller:{signal:q}})=>{await r$(X,q);let Y=r9(X);throw await u8($,Y),v2({kill:$.kill,forceKillAfterDelay:Z,context:J,controllerSignal:q}),J.terminationReason??="gracefulCancel",X.reason},r9=({reason:$})=>{if(!($ instanceof DOMException))return $;let X=Error($.message);return Object.defineProperty(X,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),X};import{setTimeout as s9}from"node:timers/promises";var i8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},t8=($,X,Z,J)=>X===0||X===void 0?[]:[e9($,X,Z,J)],e9=async($,X,Z,{signal:J})=>{throw await s9(X,void 0,{signal:J}),Z.terminationReason??="timeout",$.kill(),new d0};import{execPath as $Y,execArgv as XY}from"node:process";import o8 from"node:path";var a8=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},r8=($,X,{node:Z=!1,nodePath:J=$Y,nodeOptions:q=XY.filter((H)=>!H.startsWith("--inspect")),cwd:Y,execPath:Q,...G})=>{if(Q!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let H=c1(J,'The "nodePath" option'),B=o8.resolve(Y,H),K={...G,nodePath:B,node:Z,cwd:Y};if(!Z)return[$,X,K];if(o8.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[B,[...q,$,...X],{ipc:!0,...K,shell:!1}]};import{serialize as ZY}from"node:v8";var s8=({ipcInput:$,ipc:X,serialization:Z})=>{if($===void 0)return;if(!X)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");qY[Z]($)},JY=($)=>{try{ZY($)}catch(X){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:X})}},QY=($)=>{try{JSON.stringify($)}catch(X){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:X})}},qY={advanced:JY,json:QY},e8=async($,X)=>{if(X===void 0)return;await $.sendMessage(X)};var X5=({encoding:$})=>{if(u2.has($))return;let X=GY($);if(X!==void 0)throw TypeError(`Invalid option \`encoding: ${K4($)}\`.
26
- Please rename it to ${K4(X)}.`);let Z=[...u2].map((J)=>K4(J)).join(", ");throw TypeError(`Invalid option \`encoding: ${K4($)}\`.
27
- Please rename it to one of: ${Z}.`)},YY=new Set(["utf8","utf16le"]),x0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),u2=new Set([...YY,...x0]),GY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let X=$.toLowerCase();if(X in $5)return $5[X];if(u2.has(X))return X},$5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},K4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as HY}from"node:fs";import zY from"node:path";import KY from"node:process";var Z5=($=J5())=>{let X=c1($,'The "cwd" option');return zY.resolve(X)},J5=()=>{try{return KY.cwd()}catch($){throw $.message=`The current directory does not exist.
28
- ${$.message}`,$}},Q5=($,X)=>{if(X===J5())return $;let Z;try{Z=HY(X)}catch(J){return`The "cwd" option is invalid: ${X}.
23
+ It is optional and defaults to "${q}".`)},y9=($,Z,X,J)=>{let q=J[h8($)];if(q===void 0)throw TypeError(`"${W$(X)}" must not be ${Z}. That file descriptor does not exist.
24
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&X)throw TypeError(`"${W$(X)}" must not be ${Z}. It must be a writable stream, not readable.`)},A8=($,Z,X,J)=>{if($==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=g9($,X);return`The "${q}: ${$4(Y)}" option is incompatible with using "${W$(J)}: ${$4(Z)}".
25
+ Please set this option with "pipe" instead.`},g9=($,{stdin:Z,stdout:X,stderr:J,stdio:q})=>{let Y=h8($);if(Y===0&&Z!==void 0)return{optionName:"stdin",optionValue:Z};if(Y===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if(Y===2&&J!==void 0)return{optionName:"stderr",optionValue:J};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},h8=($)=>$==="all"?1:$,W$=($)=>$?"to":"from",$4=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as l9}from"node:events";import{addAbortListener as u9}from"node:events";var C1=($,Z,X)=>{let J=$.getMaxListeners();if(J===0||J===Number.POSITIVE_INFINITY)return;$.setMaxListeners(J+Z),u9(X,()=>{$.setMaxListeners($.getMaxListeners()-Z)})};import{EventEmitter as p9}from"node:events";import{once as m9}from"node:events";import{scheduler as c9}from"node:timers/promises";var X4=($,Z)=>{if(Z)g2($)},g2=($)=>{$.refCounted()},J4=($,Z)=>{if(Z)u2($)},u2=($)=>{$.unrefCounted()},N8=($,Z)=>{if(Z)u2($),u2($)},D8=($,Z)=>{if(Z)g2($),g2($)};var S8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J},q)=>{if(k8(q)||y8(q))return;if(!Q4.has($))Q4.set($,[]);let Y=Q4.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await b8($,J,q),await c9.yield();let Q=await f8({wrappedMessage:Y[0],anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J});Y.shift(),J.emit("message",Q),J.emit("message:done")}},v8=async({anyProcess:$,channel:Z,isSubprocess:X,ipcEmitter:J,boundOnMessage:q})=>{m2();let Y=Q4.get($);while(Y?.length>0)await m9(J,"message:done");$.removeListener("message",q),D8(Z,X),J.connected=!1,J.emit("disconnect")},Q4=new WeakMap;var z1=($,Z,X)=>{if(q4.has($))return q4.get($);let J=new p9;return J.connected=!0,q4.set($,J),d9({ipcEmitter:J,anyProcess:$,channel:Z,isSubprocess:X}),J},q4=new WeakMap,d9=({ipcEmitter:$,anyProcess:Z,channel:X,isSubprocess:J})=>{let q=S8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$});Z.on("message",q),Z.once("disconnect",v8.bind(void 0,{anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:$,boundOnMessage:q})),N8(X,J)},Y4=($)=>{let Z=q4.get($);return Z===void 0?$.channel!==null:Z.connected};var g8=({anyProcess:$,channel:Z,isSubprocess:X,message:J,strict:q})=>{if(!q)return J;let Y=z1($,Z,X),Q=z4($,Y);return{id:n9++,type:H4,message:J,hasListeners:Q}},n9=0n,u8=($,Z)=>{if(Z?.type!==H4||Z.hasListeners)return;for(let{id:X}of $)if(X!==void 0)G4[X].resolve({isDeadlock:!0,hasListeners:!1})},f8=async({wrappedMessage:$,anyProcess:Z,channel:X,isSubprocess:J,ipcEmitter:q})=>{if($?.type!==H4||!Z.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:c8,message:z4(Z,q)};try{await K4({anyProcess:Z,channel:X,isSubprocess:J,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},k8=($)=>{if($?.type!==c8)return!1;let{id:Z,message:X}=$;return G4[Z]?.resolve({isDeadlock:!1,hasListeners:X}),!0},m8=async($,Z,X)=>{if($?.type!==H4)return;let J=i0();G4[$.id]=J;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([J,i9(Z,X,q)]);if(Y)C8(X);if(!Q)P8(X)}finally{q.abort(),delete G4[$.id]}},G4={},i9=async($,Z,{signal:X})=>{C1($,1,X),await l9($,"disconnect",{signal:X}),x8(Z)},H4="execa:ipc:request",c8="execa:ipc:response";var p8=($,Z,X)=>{if(!V$.has($))V$.set($,new Set);let J=V$.get($),q=i0(),Y=X?Z.id:void 0,Q={onMessageSent:q,id:Y};return J.add(Q),{outgoingMessages:J,outgoingMessage:Q}},d8=({outgoingMessages:$,outgoingMessage:Z})=>{$.delete(Z),Z.onMessageSent.resolve()},b8=async($,Z,X)=>{while(!z4($,Z)&&V$.get($)?.size>0){let J=[...V$.get($)];u8(J,X),await Promise.all(J.map(({onMessageSent:q})=>q))}},V$=new WeakMap,z4=($,Z)=>Z.listenerCount("message")>t9($),t9=($)=>t0.has($)&&!X1(t0.get($).options.buffer,"ipc")?1:0;var K4=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},q,{strict:Y=!1}={})=>{return i1({methodName:"sendMessage",isSubprocess:X,ipc:J,isConnected:$.connected}),a9({anyProcess:$,channel:Z,methodName:"sendMessage",isSubprocess:X,message:q,strict:Y})},a9=async({anyProcess:$,channel:Z,methodName:X,isSubprocess:J,message:q,strict:Y})=>{let Q=g8({anyProcess:$,channel:Z,isSubprocess:J,message:q,strict:Y}),G=p8($,Q,Y);try{await p2({anyProcess:$,methodName:X,isSubprocess:J,wrappedMessage:Q,message:q})}catch(H){throw t1($),H}finally{d8(G)}},p2=async({anyProcess:$,methodName:Z,isSubprocess:X,wrappedMessage:J,message:q})=>{let Y=r9($);try{await Promise.all([m8(J,$,X),Y(J)])}catch(Q){throw w8({error:Q,methodName:Z,isSubprocess:X}),O8({error:Q,methodName:Z,isSubprocess:X,message:q}),Q}},r9=($)=>{if(c2.has($))return c2.get($);let Z=o9($.send.bind($));return c2.set($,Z),Z},c2=new WeakMap;var n8=($,Z)=>{return y2("cancelSignal",!1,$.connected),p2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:t8,message:Z},message:Z})},i8=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{return await e9({anyProcess:$,channel:Z,isSubprocess:X,ipc:J}),d2.signal},e9=async({anyProcess:$,channel:Z,isSubprocess:X,ipc:J})=>{if(l8)return;if(l8=!0,!J){I8();return}if(Z===null){m2();return}z1($,Z,X),await s9.yield()},l8=!1,y8=($)=>{if($?.type!==t8)return!1;return d2.abort($.message),!0},t8="execa:ipc:cancel",m2=()=>{d2.abort(j8())},d2=new AbortController;var o8=({gracefulCancel:$,cancelSignal:Z,ipc:X,serialization:J})=>{if(!$)return;if(Z===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(J==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},a8=({subprocess:$,cancelSignal:Z,gracefulCancel:X,forceKillAfterDelay:J,context:q,controller:Y})=>X?[$Y({subprocess:$,cancelSignal:Z,forceKillAfterDelay:J,context:q,controller:Y})]:[],$Y=async({subprocess:$,cancelSignal:Z,forceKillAfterDelay:X,context:J,controller:{signal:q}})=>{await s$(Z,q);let Y=ZY(Z);throw await n8($,Y),b2({kill:$.kill,forceKillAfterDelay:X,context:J,controllerSignal:q}),J.terminationReason??="gracefulCancel",Z.reason},ZY=({reason:$})=>{if(!($ instanceof DOMException))return $;let Z=Error($.message);return Object.defineProperty(Z,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),Z};import{setTimeout as XY}from"node:timers/promises";var r8=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},s8=($,Z,X,J)=>Z===0||Z===void 0?[]:[JY($,Z,X,J)],JY=async($,Z,X,{signal:J})=>{throw await XY(Z,void 0,{signal:J}),X.terminationReason??="timeout",$.kill(),new n0};import{execPath as QY,execArgv as qY}from"node:process";import e8 from"node:path";var $5=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},Z5=($,Z,{node:X=!1,nodePath:J=QY,nodeOptions:q=qY.filter((H)=>!H.startsWith("--inspect")),cwd:Y,execPath:Q,...G})=>{if(Q!==void 0)throw TypeError('The "execPath" option has been removed. Please use the "nodePath" option instead.');let H=c1(J,'The "nodePath" option'),K=e8.resolve(Y,H),W={...G,nodePath:K,node:X,cwd:Y};if(!X)return[$,Z,W];if(e8.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[K,[...q,$,...Z],{ipc:!0,...W,shell:!1}]};import{serialize as YY}from"node:v8";var X5=({ipcInput:$,ipc:Z,serialization:X})=>{if($===void 0)return;if(!Z)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");zY[X]($)},GY=($)=>{try{YY($)}catch(Z){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:Z})}},HY=($)=>{try{JSON.stringify($)}catch(Z){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:Z})}},zY={advanced:GY,json:HY},J5=async($,Z)=>{if(Z===void 0)return;await $.sendMessage(Z)};var q5=({encoding:$})=>{if(l2.has($))return;let Z=BY($);if(Z!==void 0)throw TypeError(`Invalid option \`encoding: ${B4($)}\`.
26
+ Please rename it to ${B4(Z)}.`);let X=[...l2].map((J)=>B4(J)).join(", ");throw TypeError(`Invalid option \`encoding: ${B4($)}\`.
27
+ Please rename it to one of: ${X}.`)},KY=new Set(["utf8","utf16le"]),j0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),l2=new Set([...KY,...j0]),BY=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let Z=$.toLowerCase();if(Z in Q5)return Q5[Z];if(l2.has(Z))return Z},Q5={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},B4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as UY}from"node:fs";import WY from"node:path";import VY from"node:process";var Y5=($=G5())=>{let Z=c1($,'The "cwd" option');return WY.resolve(Z)},G5=()=>{try{return VY.cwd()}catch($){throw $.message=`The current directory does not exist.
28
+ ${$.message}`,$}},H5=($,Z)=>{if(Z===G5())return $;let X;try{X=UY(Z)}catch(J){return`The "cwd" option is invalid: ${Z}.
29
29
  ${J.message}
30
- ${$}`}if(!Z.isDirectory())return`The "cwd" option is not a directory: ${X}.
31
- ${$}`;return $};var B4=($,X,Z)=>{Z.cwd=Z5(Z.cwd);let[J,q,Y]=r8($,X,Z),{command:Q,args:G,options:H}=Y5.default._parse(J,q,Y),B=n6(H),K=UY(B);if(i8(K),X5(K),s8(K),V8(K),l8(K),K.shell=W2(K.shell),K.env=WY(K),K.killSignal=z8(K.killSignal),K.forceKillAfterDelay=U8(K.forceKillAfterDelay),K.lines=K.lines.map((U,W)=>U&&!x0.has(K.encoding)&&K.buffer[W]),q5.platform==="win32"&&BY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:K}},UY=({extendEnv:$=!0,preferLocal:X=!1,cwd:Z,localDir:J=Z,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:B="SIGTERM",forceKillAfterDelay:K=!0,gracefulCancel:U=!1,ipcInput:W,ipc:_=W!==void 0||U,serialization:R="advanced",...L})=>({...L,extendEnv:$,preferLocal:X,cwd:Z,localDirectory:J,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:B,forceKillAfterDelay:K,gracefulCancel:U,ipcInput:W,ipc:_,serialization:R}),WY=({env:$,extendEnv:X,preferLocal:Z,node:J,localDirectory:q,nodePath:Y})=>{let Q=X?{...q5.env,...$}:$;if(Z||J)return e7({env:Q,cwd:q,execPath:Y,preferLocal:Z,addExecPath:J});return Q};var U4=($,X,Z)=>Z.shell&&X.length>0?[[$,...X].join(" "),[],Z]:[$,X,Z];import{inspect as iY}from"node:util";function o1($){if(typeof $==="string")return VY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return LY($)}var VY=($)=>$.at(-1)===G5?$.slice(0,$.at(-2)===H5?-2:-1):$,LY=($)=>$.at(-1)===_Y?$.subarray(0,$.at(-2)===RY?-2:-1):$,G5=`
32
- `,_Y=G5.codePointAt(0),H5="\r",RY=H5.codePointAt(0);import{on as pY}from"node:events";import{finished as dY}from"node:stream/promises";function g0($,{checkOpen:X=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!X||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function p2($,{checkOpen:X=!0}={}){return g0($,{checkOpen:X})&&($.writable||!X)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function C1($,{checkOpen:X=!0}={}){return g0($,{checkOpen:X})&&($.readable||!X)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function d2($,X){return p2($,X)&&C1($,X)}var TY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class z5{#X;#Z;#$=!1;#J=void 0;constructor($,X){this.#X=$,this.#Z=X}next(){let $=()=>this.#q();return this.#J=this.#J?this.#J.then($,$):$(),this.#J}return($){let X=()=>this.#Q($);return this.#J?this.#J.then(X,X):X()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#X.read()}catch(X){throw this.#J=void 0,this.#$=!0,this.#X.releaseLock(),X}return $.done&&(this.#J=void 0,this.#$=!0,this.#X.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#Z){let X=this.#X.cancel($);return this.#X.releaseLock(),await X,{done:!0,value:$}}return this.#X.releaseLock(),{done:!0,value:$}}}var l2=Symbol();function K5(){return this[l2].next()}Object.defineProperty(K5,"name",{value:"next"});function B5($){return this[l2].return($)}Object.defineProperty(B5,"name",{value:"return"});var FY=Object.create(TY,{next:{enumerable:!0,configurable:!0,writable:!0,value:K5},return:{enumerable:!0,configurable:!0,writable:!0,value:B5}});function n2({preventCancel:$=!1}={}){let X=this.getReader(),Z=new z5(X,$),J=Object.create(FY);return J[l2]=Z,J}var U5=($)=>{if(C1($,{checkOpen:!1})&&V$.on!==void 0)return PY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(MY.call($)==="[object ReadableStream]")return n2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:MY}=Object.prototype,PY=async function*($){let X=new AbortController,Z={};CY($,X,Z);try{for await(let[J]of V$.on($,"data",{signal:X.signal}))yield J}catch(J){if(Z.error!==void 0)throw Z.error;else if(!X.signal.aborted)throw J}finally{$.destroy()}},CY=async($,X,Z)=>{try{await V$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(J){Z.error=J}finally{X.abort()}},V$={};var a1=async($,{init:X,convertChunk:Z,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let B=U5($),K=X();K.length=0;try{for await(let U of B){let W=xY(U),_=Z[W](U,K);L5({convertedChunk:_,state:K,getSize:J,truncateChunk:q,addChunk:Y,maxBuffer:H})}return jY({state:K,convertChunk:Z,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(K)}catch(U){let W=typeof U==="object"&&U!==null?U:Error(U);throw W.bufferedData=G(K),W}},jY=({state:$,getSize:X,truncateChunk:Z,addChunk:J,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)L5({convertedChunk:Q,state:$,getSize:X,truncateChunk:Z,addChunk:J,maxBuffer:Y})},L5=({convertedChunk:$,state:X,getSize:Z,truncateChunk:J,addChunk:q,maxBuffer:Y})=>{let Q=Z($),G=X.length+Q;if(G<=Y){W5($,X,q,G);return}let H=J($,Y-X.length);if(H!==void 0)W5(H,X,q,Y);throw new Z1},W5=($,X,Z,J)=>{X.contents=Z($,X,J),X.length=J},xY=($)=>{let X=typeof $;if(X==="string")return"string";if(X!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let Z=V5.call($);if(Z==="[object ArrayBuffer]")return"arrayBuffer";if(Z==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&V5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:V5}=Object.prototype;class Z1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var J1=($)=>$,L$=()=>{return},W4=({contents:$})=>$,V4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},L4=($)=>$.length;async function _4($,X){return a1($,EY,X)}var IY=()=>({contents:[]}),wY=()=>1,OY=($,{contents:X})=>{return X.push($),X},EY={init:IY,convertChunk:{string:J1,buffer:J1,arrayBuffer:J1,dataView:J1,typedArray:J1,others:J1},getSize:wY,truncateChunk:L$,addChunk:OY,getFinalChunk:L$,finalize:W4};async function R4($,X){return a1($,bY,X)}var AY=()=>({contents:new ArrayBuffer(0)}),hY=($)=>NY.encode($),NY=new TextEncoder,_5=($)=>new Uint8Array($),R5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),DY=($,X)=>$.slice(0,X),SY=($,{contents:X,length:Z},J)=>{let q=M5()?fY(X,J):vY(X,J);return new Uint8Array(q).set($,Z),q},vY=($,X)=>{if(X<=$.byteLength)return $;let Z=new ArrayBuffer(F5(X));return new Uint8Array(Z).set(new Uint8Array($),0),Z},fY=($,X)=>{if(X<=$.maxByteLength)return $.resize(X),$;let Z=new ArrayBuffer(X,{maxByteLength:F5(X)});return new Uint8Array(Z).set(new Uint8Array($),0),Z},F5=($)=>T5**Math.ceil(Math.log($)/Math.log(T5)),T5=2,kY=({contents:$,length:X})=>M5()?$:$.slice(0,X),M5=()=>("resize"in ArrayBuffer.prototype),bY={init:AY,convertChunk:{string:hY,buffer:_5,arrayBuffer:_5,dataView:R5,typedArray:R5,others:V4},getSize:L4,truncateChunk:DY,addChunk:SY,getFinalChunk:L$,finalize:kY};async function F4($,X){return a1($,uY,X)}var yY=()=>({contents:"",textDecoder:new TextDecoder}),T4=($,{textDecoder:X})=>X.decode($,{stream:!0}),gY=($,{contents:X})=>X+$,mY=($,X)=>$.slice(0,X),cY=({textDecoder:$})=>{let X=$.decode();return X===""?void 0:X},uY={init:yY,convertChunk:{string:J1,buffer:T4,arrayBuffer:T4,dataView:T4,typedArray:T4,others:V4},getSize:L4,truncateChunk:mY,addChunk:gY,getFinalChunk:cY,finalize:W4};Object.assign(V$,{on:pY,finished:dY});var P5=({error:$,stream:X,readableObjectMode:Z,lines:J,encoding:q,fdNumber:Y})=>{if(!($ instanceof Z1))throw $;if(Y==="all")return $;let Q=lY(Z,J,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},X.destroy(),$},lY=($,X,Z)=>{if($)return"objects";if(X)return"lines";if(Z==="buffer")return"bytes";return"characters"},C5=($,X,Z)=>{if(X.length!==Z)return;let J=new Z1;throw J.maxBufferInfo={fdNumber:"ipc"},J},j5=($,X)=>{let{streamName:Z,threshold:J,unit:q}=nY($,X);return`Command's ${Z} was larger than ${J} ${q}`},nY=($,X)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:X[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:Z,unit:J}}=$;delete $.maxBufferInfo;let q=X1(X,Z);if(Z==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:v$(Z),threshold:q,unit:J}},x5=($,X,Z)=>$?.code==="ENOBUFS"&&X!==null&&X.some((J)=>J!==null&&J.length>M4(Z)),I5=($,X,Z)=>{if(!X)return $;let J=M4(Z);return $.length>J?$.slice(0,J):$},M4=([,$])=>$;var O5=({stdio:$,all:X,ipcOutput:Z,originalError:J,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:B,isGracefullyCanceled:K,isMaxBuffer:U,isForcefullyTerminated:W,forceKillAfterDelay:_,killSignal:R,maxBuffer:L,timeout:I,cwd:j})=>{let N=J?.code,u=tY({originalError:J,timedOut:H,timeout:I,isMaxBuffer:U,maxBuffer:L,errorCode:N,signal:q,signalDescription:Y,exitCode:Q,isCanceled:B,isGracefullyCanceled:K,isForcefullyTerminated:W,forceKillAfterDelay:_,killSignal:R}),x=aY(J,j),n=x===void 0?"":`
33
- ${x}`,i=`${u}: ${G}${n}`,t=X===void 0?[$[2],$[1]]:[X],F0=[i,...t,...$.slice(3),Z.map((l)=>rY(l)).join(`
34
- `)].map((l)=>K$(o1(sY(l)))).filter(Boolean).join(`
30
+ ${$}`}if(!X.isDirectory())return`The "cwd" option is not a directory: ${Z}.
31
+ ${$}`;return $};var U4=($,Z,X)=>{X.cwd=Y5(X.cwd);let[J,q,Y]=Z5($,Z,X),{command:Q,args:G,options:H}=K5.default._parse(J,q,Y),K=a6(H),W=_Y(K);if(r8(W),q5(W),X5(W),T8(W),o8(W),W.shell=_2(W.shell),W.env=RY(W),W.killSignal=W8(W.killSignal),W.forceKillAfterDelay=_8(W.forceKillAfterDelay),W.lines=W.lines.map((U,B)=>U&&!j0.has(W.encoding)&&W.buffer[B]),z5.platform==="win32"&&LY.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:W}},_Y=({extendEnv:$=!0,preferLocal:Z=!1,cwd:X,localDir:J=X,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:K="SIGTERM",forceKillAfterDelay:W=!0,gracefulCancel:U=!1,ipcInput:B,ipc:R=B!==void 0||U,serialization:_="advanced",...L})=>({...L,extendEnv:$,preferLocal:Z,cwd:X,localDirectory:J,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:K,forceKillAfterDelay:W,gracefulCancel:U,ipcInput:B,ipc:R,serialization:_}),RY=({env:$,extendEnv:Z,preferLocal:X,node:J,localDirectory:q,nodePath:Y})=>{let Q=Z?{...z5.env,...$}:$;if(X||J)return J8({env:Q,cwd:q,execPath:Y,preferLocal:X,addExecPath:J});return Q};var W4=($,Z,X)=>X.shell&&Z.length>0?[[$,...Z].join(" "),[],X]:[$,Z,X];import{inspect as rY}from"node:util";function a1($){if(typeof $==="string")return TY($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return FY($)}var TY=($)=>$.at(-1)===B5?$.slice(0,$.at(-2)===U5?-2:-1):$,FY=($)=>$.at(-1)===MY?$.subarray(0,$.at(-2)===CY?-2:-1):$,B5=`
32
+ `,MY=B5.codePointAt(0),U5="\r",CY=U5.codePointAt(0);import{on as iY}from"node:events";import{finished as tY}from"node:stream/promises";function u0($,{checkOpen:Z=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!Z||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function n2($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.writable||!Z)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function P1($,{checkOpen:Z=!0}={}){return u0($,{checkOpen:Z})&&($.readable||!Z)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function i2($,Z){return n2($,Z)&&P1($,Z)}var PY=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class W5{#Z;#X;#$=!1;#J=void 0;constructor($,Z){this.#Z=$,this.#X=Z}next(){let $=()=>this.#q();return this.#J=this.#J?this.#J.then($,$):$(),this.#J}return($){let Z=()=>this.#Q($);return this.#J?this.#J.then(Z,Z):Z()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#Z.read()}catch(Z){throw this.#J=void 0,this.#$=!0,this.#Z.releaseLock(),Z}return $.done&&(this.#J=void 0,this.#$=!0,this.#Z.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#X){let Z=this.#Z.cancel($);return this.#Z.releaseLock(),await Z,{done:!0,value:$}}return this.#Z.releaseLock(),{done:!0,value:$}}}var t2=Symbol();function V5(){return this[t2].next()}Object.defineProperty(V5,"name",{value:"next"});function L5($){return this[t2].return($)}Object.defineProperty(L5,"name",{value:"return"});var xY=Object.create(PY,{next:{enumerable:!0,configurable:!0,writable:!0,value:V5},return:{enumerable:!0,configurable:!0,writable:!0,value:L5}});function o2({preventCancel:$=!1}={}){let Z=this.getReader(),X=new W5(Z,$),J=Object.create(xY);return J[t2]=X,J}var _5=($)=>{if(P1($,{checkOpen:!1})&&L$.on!==void 0)return IY($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(jY.call($)==="[object ReadableStream]")return o2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:jY}=Object.prototype,IY=async function*($){let Z=new AbortController,X={};wY($,Z,X);try{for await(let[J]of L$.on($,"data",{signal:Z.signal}))yield J}catch(J){if(X.error!==void 0)throw X.error;else if(!Z.signal.aborted)throw J}finally{$.destroy()}},wY=async($,Z,X)=>{try{await L$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(J){X.error=J}finally{Z.abort()}},L$={};var r1=async($,{init:Z,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let K=_5($),W=Z();W.length=0;try{for await(let U of K){let B=EY(U),R=X[B](U,W);F5({convertedChunk:R,state:W,getSize:J,truncateChunk:q,addChunk:Y,maxBuffer:H})}return OY({state:W,convertChunk:X,getSize:J,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(W)}catch(U){let B=typeof U==="object"&&U!==null?U:Error(U);throw B.bufferedData=G(W),B}},OY=({state:$,getSize:Z,truncateChunk:X,addChunk:J,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)F5({convertedChunk:Q,state:$,getSize:Z,truncateChunk:X,addChunk:J,maxBuffer:Y})},F5=({convertedChunk:$,state:Z,getSize:X,truncateChunk:J,addChunk:q,maxBuffer:Y})=>{let Q=X($),G=Z.length+Q;if(G<=Y){R5($,Z,q,G);return}let H=J($,Y-Z.length);if(H!==void 0)R5(H,Z,q,Y);throw new J1},R5=($,Z,X,J)=>{Z.contents=X($,Z,J),Z.length=J},EY=($)=>{let Z=typeof $;if(Z==="string")return"string";if(Z!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let X=T5.call($);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&T5.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:T5}=Object.prototype;class J1 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var Q1=($)=>$,_$=()=>{return},V4=({contents:$})=>$,L4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},_4=($)=>$.length;async function R4($,Z){return r1($,DY,Z)}var AY=()=>({contents:[]}),hY=()=>1,NY=($,{contents:Z})=>{return Z.push($),Z},DY={init:AY,convertChunk:{string:Q1,buffer:Q1,arrayBuffer:Q1,dataView:Q1,typedArray:Q1,others:Q1},getSize:hY,truncateChunk:_$,addChunk:NY,getFinalChunk:_$,finalize:V4};async function T4($,Z){return r1($,mY,Z)}var SY=()=>({contents:new ArrayBuffer(0)}),vY=($)=>fY.encode($),fY=new TextEncoder,M5=($)=>new Uint8Array($),C5=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),kY=($,Z)=>$.slice(0,Z),bY=($,{contents:Z,length:X},J)=>{let q=j5()?gY(Z,J):yY(Z,J);return new Uint8Array(q).set($,X),q},yY=($,Z)=>{if(Z<=$.byteLength)return $;let X=new ArrayBuffer(x5(Z));return new Uint8Array(X).set(new Uint8Array($),0),X},gY=($,Z)=>{if(Z<=$.maxByteLength)return $.resize(Z),$;let X=new ArrayBuffer(Z,{maxByteLength:x5(Z)});return new Uint8Array(X).set(new Uint8Array($),0),X},x5=($)=>P5**Math.ceil(Math.log($)/Math.log(P5)),P5=2,uY=({contents:$,length:Z})=>j5()?$:$.slice(0,Z),j5=()=>("resize"in ArrayBuffer.prototype),mY={init:SY,convertChunk:{string:vY,buffer:M5,arrayBuffer:M5,dataView:C5,typedArray:C5,others:L4},getSize:_4,truncateChunk:kY,addChunk:bY,getFinalChunk:_$,finalize:uY};async function M4($,Z){return r1($,nY,Z)}var cY=()=>({contents:"",textDecoder:new TextDecoder}),F4=($,{textDecoder:Z})=>Z.decode($,{stream:!0}),pY=($,{contents:Z})=>Z+$,dY=($,Z)=>$.slice(0,Z),lY=({textDecoder:$})=>{let Z=$.decode();return Z===""?void 0:Z},nY={init:cY,convertChunk:{string:Q1,buffer:F4,arrayBuffer:F4,dataView:F4,typedArray:F4,others:L4},getSize:_4,truncateChunk:dY,addChunk:pY,getFinalChunk:lY,finalize:V4};Object.assign(L$,{on:iY,finished:tY});var I5=({error:$,stream:Z,readableObjectMode:X,lines:J,encoding:q,fdNumber:Y})=>{if(!($ instanceof J1))throw $;if(Y==="all")return $;let Q=oY(X,J,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},Z.destroy(),$},oY=($,Z,X)=>{if($)return"objects";if(Z)return"lines";if(X==="buffer")return"bytes";return"characters"},w5=($,Z,X)=>{if(Z.length!==X)return;let J=new J1;throw J.maxBufferInfo={fdNumber:"ipc"},J},O5=($,Z)=>{let{streamName:X,threshold:J,unit:q}=aY($,Z);return`Command's ${X} was larger than ${J} ${q}`},aY=($,Z)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:Z[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:J}}=$;delete $.maxBufferInfo;let q=X1(Z,X);if(X==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:f$(X),threshold:q,unit:J}},E5=($,Z,X)=>$?.code==="ENOBUFS"&&Z!==null&&Z.some((J)=>J!==null&&J.length>C4(X)),A5=($,Z,X)=>{if(!Z)return $;let J=C4(X);return $.length>J?$.slice(0,J):$},C4=([,$])=>$;var N5=({stdio:$,all:Z,ipcOutput:X,originalError:J,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:K,isGracefullyCanceled:W,isMaxBuffer:U,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_,maxBuffer:L,timeout:j,cwd:C})=>{let N=J?.code,c=sY({originalError:J,timedOut:H,timeout:j,isMaxBuffer:U,maxBuffer:L,errorCode:N,signal:q,signalDescription:Y,exitCode:Q,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:B,forceKillAfterDelay:R,killSignal:_}),I=$G(J,C),n=I===void 0?"":`
33
+ ${I}`,i=`${c}: ${G}${n}`,a=Z===void 0?[$[2],$[1]]:[Z],K0=[i,...a,...$.slice(3),X.map((l)=>ZG(l)).join(`
34
+ `)].map((l)=>B$(a1(XG(l)))).filter(Boolean).join(`
35
35
 
36
- `);return{originalMessage:x,shortMessage:i,message:F0}},tY=({originalError:$,timedOut:X,timeout:Z,isMaxBuffer:J,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:B,isGracefullyCanceled:K,isForcefullyTerminated:U,forceKillAfterDelay:W,killSignal:_})=>{let R=oY(U,W);if(X)return`Command timed out after ${Z} milliseconds${R}`;if(K){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return U?`Command was gracefully canceled${R}`:`Command was gracefully canceled with ${Q} (${G})`}if(B)return`Command was canceled${R}`;if(J)return`${j5($,q)}${R}`;if(Y!==void 0)return`Command failed with ${Y}${R}`;if(U)return`Command was killed with ${_} (${a$(_)})${R}`;if(Q!==void 0)return`Command was killed with ${Q} (${G})`;if(H!==void 0)return`Command failed with exit code ${H}`;return"Command failed"},oY=($,X)=>$?` and was forcefully terminated after ${X} milliseconds`:"",aY=($,X)=>{if($ instanceof d0)return;let Z=Z8($)?$.originalMessage:String($?.message??$),J=K$(Q5(Z,X));return J===""?void 0:J},rY=($)=>typeof $==="string"?$:iY($),sY=($)=>Array.isArray($)?$.map((X)=>o1(w5(X))).filter(Boolean).join(`
37
- `):w5($),w5=($)=>{if(typeof $==="string")return $;if(V0($))return D$($);return""};var P4=({command:$,escapedCommand:X,stdio:Z,all:J,ipcOutput:q,options:{cwd:Y},startTime:Q})=>E5({command:$,escapedCommand:X,cwd:Y,durationMs:P2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:Z[1],stderr:Z[2],all:J,stdio:Z,ipcOutput:q,pipedFrom:[]}),r1=({error:$,command:X,escapedCommand:Z,fileDescriptors:J,options:q,startTime:Y,isSync:Q})=>_$({error:$,command:X,escapedCommand:Z,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:q,isSync:Q}),_$=({error:$,command:X,escapedCommand:Z,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:K,stdio:U,all:W,ipcOutput:_,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:I,killSignal:j,cwd:N,maxBuffer:u},isSync:x})=>{let{exitCode:n,signal:i,signalDescription:t}=$G(B,K),{originalMessage:F0,shortMessage:l,message:r0}=O5({stdio:U,all:W,ipcOutput:_,originalError:$,signal:i,signalDescription:t,exitCode:n,escapedCommand:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:I,killSignal:j,maxBuffer:u,timeout:L,cwd:N}),E=$8($,r0,x);return Object.assign(E,eY({error:E,command:X,escapedCommand:Z,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:n,signal:i,signalDescription:t,stdio:U,all:W,ipcOutput:_,cwd:N,originalMessage:F0,shortMessage:l})),E},eY=({error:$,command:X,escapedCommand:Z,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:K,signalDescription:U,stdio:W,all:_,ipcOutput:R,cwd:L,originalMessage:I,shortMessage:j})=>E5({shortMessage:j,originalMessage:I,command:X,escapedCommand:Z,cwd:L,durationMs:P2(J),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:K!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:K,signalDescription:U,code:$.cause?.code,stdout:W[1],stderr:W[2],all:_,stdio:W,ipcOutput:R,pipedFrom:[]}),E5=($)=>Object.fromEntries(Object.entries($).filter(([,X])=>X!==void 0)),$G=($,X)=>{let Z=$===null?void 0:$,J=X===null?void 0:X,q=J===void 0?void 0:a$(X);return{exitCode:Z,signal:J,signalDescription:q}};var A5=($)=>Number.isFinite($)?$:0;function XG($){return{days:Math.trunc($/86400000),hours:Math.trunc($/3600000%24),minutes:Math.trunc($/60000%60),seconds:Math.trunc($/1000%60),milliseconds:Math.trunc($%1000),microseconds:Math.trunc(A5($*1000)%1000),nanoseconds:Math.trunc(A5($*1e6)%1000)}}function ZG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function i2($){switch(typeof $){case"number":{if(Number.isFinite($))return XG($);break}case"bigint":return ZG($)}throw TypeError("Expected a finite number or bigint")}var JG=($)=>$===0||$===0n,QG=($,X)=>X===1||X===1n?$:`${$}s`,qG=0.0000001,YG=24n*60n*60n*1000n;function t2($,X){let Z=typeof $==="bigint";if(!Z&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");X={...X};let J=$<0?"-":"";if($=$<0?-$:$,X.colonNotation)X.compact=!1,X.formatSubMilliseconds=!1,X.separateMilliseconds=!1,X.verbose=!1;if(X.compact)X.unitCount=1,X.secondsDecimalDigits=0,X.millisecondsDecimalDigits=0;let q=[],Y=(K,U)=>{let W=Math.floor(K*10**U+qG);return(Math.round(W)/10**U).toFixed(U)},Q=(K,U,W,_)=>{if((q.length===0||!X.colonNotation)&&JG(K)&&!(X.colonNotation&&W==="m"))return;if(_??=String(K),X.colonNotation){let R=_.includes(".")?_.split(".")[0].length:_.length,L=q.length>0?2:1;_="0".repeat(Math.max(0,L-R))+_}else _+=X.verbose?" "+QG(U,K):W;q.push(_)},G=i2($),H=BigInt(G.days);if(X.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(X.hideYear)Q(H,"day","d");else Q(H/365n,"year","y"),Q(H%365n,"day","d");Q(Number(G.hours),"hour","h")}if(Q(Number(G.minutes),"minute","m"),!X.hideSeconds)if(X.separateMilliseconds||X.formatSubMilliseconds||!X.colonNotation&&$<1000&&!X.subSecondsAsDecimals){let K=Number(G.seconds),U=Number(G.milliseconds),W=Number(G.microseconds),_=Number(G.nanoseconds);if(Q(K,"second","s"),X.formatSubMilliseconds)Q(U,"millisecond","ms"),Q(W,"microsecond","µs"),Q(_,"nanosecond","ns");else{let R=U+W/1000+_/1e6,L=typeof X.millisecondsDecimalDigits==="number"?X.millisecondsDecimalDigits:0,I=R>=1?Math.round(R):Math.ceil(R),j=L?R.toFixed(L):I;Q(Number.parseFloat(j),"millisecond","ms",j)}}else{let K=(Z?Number($%YG):$)/1000%60,U=typeof X.secondsDecimalDigits==="number"?X.secondsDecimalDigits:1,W=Y(K,U),_=X.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(_),"second","s",_)}if(q.length===0)return J+"0"+(X.verbose?" milliseconds":"ms");let B=X.colonNotation?":":" ";if(typeof X.unitCount==="number")q=q.slice(0,Math.max(X.unitCount,1));return J+q.join(B)}var h5=($,X)=>{if($.failed)p0({type:"error",verboseMessage:$.shortMessage,verboseInfo:X,result:$})};var N5=($,X)=>{if(!u1(X))return;h5($,X),GG($,X)},GG=($,X)=>{let Z=`(done in ${t2($.durationMs)})`;p0({type:"duration",verboseMessage:Z,verboseInfo:X,result:$})};var s1=($,X,{reject:Z})=>{if(N5($,X),$.failed&&Z)throw $;return $};import{readFileSync as QX}from"node:fs";var v5=($,X)=>{if(j1($))return"asyncGenerator";if(b5($))return"generator";if(C4($))return"fileUrl";if(UG($))return"filePath";if(LG($))return"webStream";if(g0($,{checkOpen:!1}))return"native";if(V0($))return"uint8Array";if(_G($))return"asyncIterable";if(RG($))return"iterable";if(r2($))return f5({transform:$},X);if(BG($))return HG($,X);return"native"},HG=($,X)=>{if(d2($.transform,{checkOpen:!1}))return zG($,X);if(r2($.transform))return f5($,X);return KG($,X)},zG=($,X)=>{return k5($,X,"Duplex stream"),"duplex"},f5=($,X)=>{return k5($,X,"web TransformStream"),"webTransform"},k5=({final:$,binary:X,objectMode:Z},J,q)=>{D5($,`${J}.final`,q),D5(X,`${J}.binary`,q),o2(Z,`${J}.objectMode`)},D5=($,X,Z)=>{if($!==void 0)throw TypeError(`The \`${X}\` option can only be defined when using a generator, not a ${Z}.`)},KG=({transform:$,final:X,binary:Z,objectMode:J},q)=>{if($!==void 0&&!S5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(d2(X,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if(r2(X))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(X!==void 0&&!S5(X))throw TypeError(`The \`${q}.final\` option must be a generator.`);return o2(Z,`${q}.binary`),o2(J,`${q}.objectMode`),j1($)||j1(X)?"asyncGenerator":"generator"},o2=($,X)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${X}\` option must use a boolean.`)},S5=($)=>j1($)||b5($),j1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",b5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",BG=($)=>Y0($)&&($.transform!==void 0||$.final!==void 0),C4=($)=>Object.prototype.toString.call($)==="[object URL]",y5=($)=>C4($)&&$.protocol!=="file:",UG=($)=>Y0($)&&Object.keys($).length>0&&Object.keys($).every((X)=>WG.has(X))&&a2($.file),WG=new Set(["file","append"]),a2=($)=>typeof $==="string",g5=($,X)=>$==="native"&&typeof X==="string"&&!VG.has(X),VG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),m5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",j4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",LG=($)=>m5($)||j4($),r2=($)=>m5($?.readable)&&j4($?.writable),_G=($)=>c5($)&&typeof $[Symbol.asyncIterator]==="function",RG=($)=>c5($)&&typeof $[Symbol.iterator]==="function",c5=($)=>typeof $==="object"&&$!==null,N0=new Set(["generator","asyncGenerator","duplex","webTransform"]),x4=new Set(["fileUrl","filePath","fileNumber"]),s2=new Set(["fileUrl","filePath"]),u5=new Set([...s2,"webStream","nodeStream"]),p5=new Set(["webTransform","duplex"]),z1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var e2=($,X,Z,J)=>J==="output"?TG($,X,Z):FG($,X,Z),TG=($,X,Z)=>{let J=X!==0&&Z[X-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:$??J}},FG=($,X,Z)=>{let J=X===0?$===!0:Z[X-1].value.readableObjectMode,q=X!==Z.length-1&&($??J);return{writableObjectMode:J,readableObjectMode:q}},d5=($,X)=>{let Z=$.findLast(({type:J})=>N0.has(J));if(Z===void 0)return!1;return X==="input"?Z.value.writableObjectMode:Z.value.readableObjectMode};var l5=($,X,Z,J)=>[...$.filter(({type:q})=>!N0.has(q)),...MG($,X,Z,J)],MG=($,X,Z,{encoding:J})=>{let q=$.filter(({type:Q})=>N0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=PG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:X,direction:Z,encoding:J});return IG(Y,Z)},PG=({stdioItem:$,stdioItem:{type:X},index:Z,newTransforms:J,optionName:q,direction:Y,encoding:Q})=>{if(X==="duplex")return CG({stdioItem:$,optionName:q});if(X==="webTransform")return jG({stdioItem:$,index:Z,newTransforms:J,direction:Y});return xG({stdioItem:$,index:Z,newTransforms:J,direction:Y,encoding:Q})},CG=({stdioItem:$,stdioItem:{value:{transform:X,transform:{writableObjectMode:Z,readableObjectMode:J},objectMode:q=J}},optionName:Y})=>{if(q&&!J)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&J)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:X,writableObjectMode:Z,readableObjectMode:J}}},jG=({stdioItem:$,stdioItem:{value:X},index:Z,newTransforms:J,direction:q})=>{let{transform:Y,objectMode:Q}=Y0(X)?X:{transform:X},{writableObjectMode:G,readableObjectMode:H}=e2(Q,Z,J,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},xG=({stdioItem:$,stdioItem:{value:X},index:Z,newTransforms:J,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:B=!1,objectMode:K}=Y0(X)?X:{transform:X},U=H||x0.has(Y),{writableObjectMode:W,readableObjectMode:_}=e2(K,Z,J,q);return{...$,value:{transform:Q,final:G,binary:U,preserveNewlines:B,writableObjectMode:W,readableObjectMode:_}}},IG=($,X)=>X==="input"?$.reverse():$;import $3 from"node:process";var n5=($,X,Z)=>{let J=$.map((q)=>wG(q,X));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${Z}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??AG},wG=({type:$,value:X},Z)=>OG[Z]??i5[$](X),OG=["input","output","output"],e1=()=>{return},X3=()=>"input",i5={generator:e1,asyncGenerator:e1,fileUrl:e1,filePath:e1,iterable:X3,asyncIterable:X3,uint8Array:X3,webStream:($)=>j4($)?"output":"input",nodeStream($){if(!C1($,{checkOpen:!1}))return"output";return p2($,{checkOpen:!1})?void 0:"input"},webTransform:e1,duplex:e1,native($){let X=EG($);if(X!==void 0)return X;if(g0($,{checkOpen:!1}))return i5.nodeStream($)}},EG=($)=>{if([0,$3.stdin].includes($))return"input";if([1,2,$3.stdout,$3.stderr].includes($))return"output"},AG="output";var t5=($,X)=>X&&!$.includes("ipc")?[...$,"ipc"]:$;var o5=({stdio:$,ipc:X,buffer:Z,...J},q,Y)=>{let Q=hG($,J).map((G,H)=>a5(G,H));return Y?DG(Q,Z,q):t5(Q,X)},hG=($,X)=>{if($===void 0)return h0.map((J)=>X[J]);if(NG(X))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${h0.map((J)=>`\`${J}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let Z=Math.max($.length,h0.length);return Array.from({length:Z},(J,q)=>$[q])},NG=($)=>h0.some((X)=>$[X]!==void 0),a5=($,X)=>{if(Array.isArray($))return $.map((Z)=>a5(Z,X));if($===null||$===void 0)return X>=h0.length?"ignore":"pipe";return $},DG=($,X,Z)=>$.map((J,q)=>!X[q]&&q!==0&&!p1(Z,q)&&SG(J)?"ignore":J),SG=($)=>$==="pipe"||Array.isArray($)&&$.every((X)=>X==="pipe");import{readFileSync as vG}from"node:fs";import fG from"node:tty";var s5=({stdioItem:$,stdioItem:{type:X},isStdioArray:Z,fdNumber:J,direction:q,isSync:Y})=>{if(!Z||X!=="native")return $;return Y?kG({stdioItem:$,fdNumber:J,direction:q}):gG({stdioItem:$,fdNumber:J})},kG=({stdioItem:$,stdioItem:{value:X,optionName:Z},fdNumber:J,direction:q})=>{let Y=bG({value:X,optionName:Z,fdNumber:J,direction:q});if(Y!==void 0)return Y;if(g0(X,{checkOpen:!1}))throw TypeError(`The \`${Z}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},bG=({value:$,optionName:X,fdNumber:Z,direction:J})=>{let q=yG($,Z);if(q===void 0)return;if(J==="output")return{type:"fileNumber",value:q,optionName:X};if(fG.isatty(q))throw TypeError(`The \`${X}: ${e$($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:$1(vG(q)),optionName:X}},yG=($,X)=>{if($==="inherit")return X;if(typeof $==="number")return $;let Z=S$.indexOf($);if(Z!==-1)return Z},gG=({stdioItem:$,stdioItem:{value:X,optionName:Z},fdNumber:J})=>{if(X==="inherit")return{type:"nodeStream",value:r5(J,X,Z),optionName:Z};if(typeof X==="number")return{type:"nodeStream",value:r5(X,X,Z),optionName:Z};if(g0(X,{checkOpen:!1}))return{type:"nodeStream",value:X,optionName:Z};return $},r5=($,X,Z)=>{let J=S$[$];if(J===void 0)throw TypeError(`The \`${Z}: ${X}\` option is invalid: no such standard stream.`);return J};var e5=({input:$,inputFile:X},Z)=>Z===0?[...mG($),...uG(X)]:[],mG=($)=>$===void 0?[]:[{type:cG($),value:$,optionName:"input"}],cG=($)=>{if(C1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(V0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},uG=($)=>$===void 0?[]:[{...pG($),optionName:"inputFile"}],pG=($)=>{if(C4($))return{type:"fileUrl",value:$};if(a2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var $X=($)=>$.filter((X,Z)=>$.every((J,q)=>X.value!==J.value||Z>=q||X.type==="generator"||X.type==="asyncGenerator")),XX=({stdioItem:{type:$,value:X,optionName:Z},direction:J,fileDescriptors:q,isSync:Y})=>{let Q=dG(q,$);if(Q.length===0)return;if(Y){lG({otherStdioItems:Q,type:$,value:X,optionName:Z,direction:J});return}if(u5.has($))return ZX({otherStdioItems:Q,type:$,value:X,optionName:Z,direction:J});if(p5.has($))iG({otherStdioItems:Q,type:$,value:X,optionName:Z})},dG=($,X)=>$.flatMap(({direction:Z,stdioItems:J})=>J.filter((q)=>q.type===X).map((q)=>({...q,direction:Z}))),lG=({otherStdioItems:$,type:X,value:Z,optionName:J,direction:q})=>{if(s2.has(X))ZX({otherStdioItems:$,type:X,value:Z,optionName:J,direction:q})},ZX=({otherStdioItems:$,type:X,value:Z,optionName:J,direction:q})=>{let Y=$.filter((G)=>nG(G,Z));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return JX(Q,J,X),q==="output"?Y[0].stream:void 0},nG=({type:$,value:X},Z)=>{if($==="filePath")return X.file===Z.file;if($==="fileUrl")return X.href===Z.href;return X===Z},iG=({otherStdioItems:$,type:X,value:Z,optionName:J})=>{let q=$.find(({value:{transform:Y}})=>Y===Z.transform);JX(q,J,X)},JX=($,X,Z)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${X}\` options must not target ${z1[Z]} that is the same.`)};var I4=($,X,Z,J)=>{let Y=o5(X,Z,J).map((G,H)=>tG({stdioOption:G,fdNumber:H,options:X,isSync:J})),Q=ZH({initialFileDescriptors:Y,addProperties:$,options:X,isSync:J});return X.stdio=Q.map(({stdioItems:G})=>qH(G)),Q},tG=({stdioOption:$,fdNumber:X,options:Z,isSync:J})=>{let q=v$(X),{stdioItems:Y,isStdioArray:Q}=oG({stdioOption:$,fdNumber:X,options:Z,optionName:q}),G=n5(Y,X,q),H=Y.map((U)=>s5({stdioItem:U,isStdioArray:Q,fdNumber:X,direction:G,isSync:J})),B=l5(H,q,G,Z),K=d5(B,G);return XH(B,K),{direction:G,objectMode:K,stdioItems:B}},oG=({stdioOption:$,fdNumber:X,options:Z,optionName:J})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>aG(H,J)),...e5(Z,X)],Q=$X(Y),G=Q.length>1;return rG(Q,G,J),eG(Q),{stdioItems:Q,isStdioArray:G}},aG=($,X)=>({type:v5($,X),value:$,optionName:X}),rG=($,X,Z)=>{if($.length===0)throw TypeError(`The \`${Z}\` option must not be an empty array.`);if(!X)return;for(let{value:J,optionName:q}of $)if(sG.has(J))throw Error(`The \`${q}\` option must not include \`${J}\`.`)},sG=new Set(["ignore","ipc"]),eG=($)=>{for(let X of $)$H(X)},$H=({type:$,value:X,optionName:Z})=>{if(y5(X))throw TypeError(`The \`${Z}: URL\` option must use the \`file:\` scheme.
38
- For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(g5($,X))throw TypeError(`The \`${Z}: { file: '...' }\` option must be used instead of \`${Z}: '...'\`.`)},XH=($,X)=>{if(!X)return;let Z=$.find(({type:J})=>x4.has(J));if(Z!==void 0)throw TypeError(`The \`${Z.optionName}\` option cannot use both files and transforms in objectMode.`)},ZH=({initialFileDescriptors:$,addProperties:X,options:Z,isSync:J})=>{let q=[];try{for(let Y of $)q.push(JH({fileDescriptor:Y,fileDescriptors:q,addProperties:X,options:Z,isSync:J}));return q}catch(Y){throw Z3(q),Y}},JH=({fileDescriptor:{direction:$,objectMode:X,stdioItems:Z},fileDescriptors:J,addProperties:q,options:Y,isSync:Q})=>{let G=Z.map((H)=>QH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:J,isSync:Q}));return{direction:$,objectMode:X,stdioItems:G}},QH=({stdioItem:$,addProperties:X,direction:Z,options:J,fileDescriptors:q,isSync:Y})=>{let Q=XX({stdioItem:$,direction:Z,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...X[Z][$.type]($,J)}},Z3=($)=>{for(let{stdioItems:X}of $)for(let{stream:Z}of X)if(Z!==void 0&&!b0(Z))Z.destroy()},qH=($)=>{if($.length>1)return $.some(({value:J})=>J==="overlapped")?"overlapped":"pipe";let[{type:X,value:Z}]=$;return X==="native"?Z:"pipe"};var YX=($,X)=>I4(GH,$,X,!0),i0=({type:$,optionName:X})=>{GX(X,z1[$])},YH=({optionName:$,value:X})=>{if(X==="ipc"||X==="overlapped")GX($,`"${X}"`);return{}},GX=($,X)=>{throw TypeError(`The \`${$}\` option cannot be ${X} with synchronous methods.`)},qX={generator(){},asyncGenerator:i0,webStream:i0,nodeStream:i0,webTransform:i0,duplex:i0,asyncIterable:i0,native:YH},GH={input:{...qX,fileUrl:({value:$})=>({contents:[$1(QX($))]}),filePath:({value:{file:$}})=>({contents:[$1(QX($))]}),fileNumber:i0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...qX,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:X}})=>({path:$,append:X}),fileNumber:({value:$})=>({path:$}),iterable:i0,string:i0,uint8Array:i0}};var Q1=($,{stripFinalNewline:X},Z)=>J3(X,Z)&&$!==void 0&&!Array.isArray($)?o1($):$,J3=($,X)=>X==="all"?$[1]||$[2]:$[X];import{Transform as EH,getDefaultHighWaterMark as TX}from"node:stream";var w4=($,X,Z,J)=>$||Z?void 0:zX(X,J),q3=($,X,Z)=>Z?$.flatMap((J)=>HX(J,X)):HX($,X),HX=($,X)=>{let{transform:Z,final:J}=zX(X,{});return[...Z($),...J()]},zX=($,X)=>{return X.previousChunks="",{transform:HH.bind(void 0,X,$),final:KH.bind(void 0,X)}},HH=function*($,X,Z){if(typeof Z!=="string"){yield Z;return}let{previousChunks:J}=$,q=-1;for(let Y=0;Y<Z.length;Y+=1)if(Z[Y]===`
39
- `){let Q=zH(Z,Y,X,$),G=Z.slice(q+1,Y+1-Q);if(J.length>0)G=Q3(J,G),J="";yield G,q=Y}if(q!==Z.length-1)J=Q3(J,Z.slice(q+1));$.previousChunks=J},zH=($,X,Z,J)=>{if(Z)return 0;return J.isWindowsNewline=X!==0&&$[X-1]==="\r",J.isWindowsNewline?2:1},KH=function*({previousChunks:$}){if($.length>0)yield $},KX=({binary:$,preserveNewlines:X,readableObjectMode:Z,state:J})=>$||X||Z?void 0:{transform:BH.bind(void 0,J)},BH=function*({isWindowsNewline:$=!1},X){let{unixNewline:Z,windowsNewline:J,LF:q,concatBytes:Y}=typeof X==="string"?UH:VH;if(X.at(-1)===q){yield X;return}yield Y(X,$?J:Z)},Q3=($,X)=>`${$}${X}`,UH={windowsNewline:`\r
36
+ `);return{originalMessage:I,shortMessage:i,message:K0}},sY=({originalError:$,timedOut:Z,timeout:X,isMaxBuffer:J,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:K,isGracefullyCanceled:W,isForcefullyTerminated:U,forceKillAfterDelay:B,killSignal:R})=>{let _=eY(U,B);if(Z)return`Command timed out after ${X} milliseconds${_}`;if(W){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return U?`Command was gracefully canceled${_}`:`Command was gracefully canceled with ${Q} (${G})`}if(K)return`Command was canceled${_}`;if(J)return`${O5($,q)}${_}`;if(Y!==void 0)return`Command failed with ${Y}${_}`;if(U)return`Command was killed with ${R} (${r$(R)})${_}`;if(Q!==void 0)return`Command was killed with ${Q} (${G})`;if(H!==void 0)return`Command failed with exit code ${H}`;return"Command failed"},eY=($,Z)=>$?` and was forcefully terminated after ${Z} milliseconds`:"",$G=($,Z)=>{if($ instanceof n0)return;let X=Y8($)?$.originalMessage:String($?.message??$),J=B$(H5(X,Z));return J===""?void 0:J},ZG=($)=>typeof $==="string"?$:rY($),XG=($)=>Array.isArray($)?$.map((Z)=>a1(h5(Z))).filter(Boolean).join(`
37
+ `):h5($),h5=($)=>{if(typeof $==="string")return $;if(L0($))return S$($);return""};var P4=({command:$,escapedCommand:Z,stdio:X,all:J,ipcOutput:q,options:{cwd:Y},startTime:Q})=>D5({command:$,escapedCommand:Z,cwd:Y,durationMs:j2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:J,stdio:X,ipcOutput:q,pipedFrom:[]}),s1=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:Q})=>R$({error:$,command:Z,escapedCommand:X,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:J.length}),ipcOutput:[],options:q,isSync:Q}),R$=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,stdio:U,all:B,ipcOutput:R,options:{timeoutDuration:_,timeout:L=_,forceKillAfterDelay:j,killSignal:C,cwd:N,maxBuffer:c},isSync:I})=>{let{exitCode:n,signal:i,signalDescription:a}=QG(K,W),{originalMessage:K0,shortMessage:l,message:x0}=N5({stdio:U,all:B,ipcOutput:R,originalError:$,signal:i,signalDescription:a,exitCode:n,escapedCommand:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:j,killSignal:C,maxBuffer:c,timeout:L,cwd:N}),E=Q8($,x0,I);return Object.assign(E,JG({error:E,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:n,signal:i,signalDescription:a,stdio:U,all:B,ipcOutput:R,cwd:N,originalMessage:K0,shortMessage:l})),E},JG=({error:$,command:Z,escapedCommand:X,startTime:J,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,stdio:B,all:R,ipcOutput:_,cwd:L,originalMessage:j,shortMessage:C})=>D5({shortMessage:C,originalMessage:j,command:Z,escapedCommand:X,cwd:L,durationMs:j2(J),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:W!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:K,signal:W,signalDescription:U,code:$.cause?.code,stdout:B[1],stderr:B[2],all:R,stdio:B,ipcOutput:_,pipedFrom:[]}),D5=($)=>Object.fromEntries(Object.entries($).filter(([,Z])=>Z!==void 0)),QG=($,Z)=>{let X=$===null?void 0:$,J=Z===null?void 0:Z,q=J===void 0?void 0:r$(Z);return{exitCode:X,signal:J,signalDescription:q}};var S5=($)=>Number.isFinite($)?$:0;function qG($){return{days:Math.trunc($/86400000),hours:Math.trunc($/3600000%24),minutes:Math.trunc($/60000%60),seconds:Math.trunc($/1000%60),milliseconds:Math.trunc($%1000),microseconds:Math.trunc(S5($*1000)%1000),nanoseconds:Math.trunc(S5($*1e6)%1000)}}function YG($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function a2($){switch(typeof $){case"number":{if(Number.isFinite($))return qG($);break}case"bigint":return YG($)}throw TypeError("Expected a finite number or bigint")}var GG=($)=>$===0||$===0n,HG=($,Z)=>Z===1||Z===1n?$:`${$}s`,zG=0.0000001,KG=24n*60n*60n*1000n;function r2($,Z){let X=typeof $==="bigint";if(!X&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");Z={...Z};let J=$<0?"-":"";if($=$<0?-$:$,Z.colonNotation)Z.compact=!1,Z.formatSubMilliseconds=!1,Z.separateMilliseconds=!1,Z.verbose=!1;if(Z.compact)Z.unitCount=1,Z.secondsDecimalDigits=0,Z.millisecondsDecimalDigits=0;let q=[],Y=(W,U)=>{let B=Math.floor(W*10**U+zG);return(Math.round(B)/10**U).toFixed(U)},Q=(W,U,B,R)=>{if((q.length===0||!Z.colonNotation)&&GG(W)&&!(Z.colonNotation&&B==="m"))return;if(R??=String(W),Z.colonNotation){let _=R.includes(".")?R.split(".")[0].length:R.length,L=q.length>0?2:1;R="0".repeat(Math.max(0,L-_))+R}else R+=Z.verbose?" "+HG(U,W):B;q.push(R)},G=a2($),H=BigInt(G.days);if(Z.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(Z.hideYear)Q(H,"day","d");else Q(H/365n,"year","y"),Q(H%365n,"day","d");Q(Number(G.hours),"hour","h")}if(Q(Number(G.minutes),"minute","m"),!Z.hideSeconds)if(Z.separateMilliseconds||Z.formatSubMilliseconds||!Z.colonNotation&&$<1000&&!Z.subSecondsAsDecimals){let W=Number(G.seconds),U=Number(G.milliseconds),B=Number(G.microseconds),R=Number(G.nanoseconds);if(Q(W,"second","s"),Z.formatSubMilliseconds)Q(U,"millisecond","ms"),Q(B,"microsecond","µs"),Q(R,"nanosecond","ns");else{let _=U+B/1000+R/1e6,L=typeof Z.millisecondsDecimalDigits==="number"?Z.millisecondsDecimalDigits:0,j=_>=1?Math.round(_):Math.ceil(_),C=L?_.toFixed(L):j;Q(Number.parseFloat(C),"millisecond","ms",C)}}else{let W=(X?Number($%KG):$)/1000%60,U=typeof Z.secondsDecimalDigits==="number"?Z.secondsDecimalDigits:1,B=Y(W,U),R=Z.keepDecimalsOnWholeSeconds?B:B.replace(/\.0+$/,"");Q(Number.parseFloat(R),"second","s",R)}if(q.length===0)return J+"0"+(Z.verbose?" milliseconds":"ms");let K=Z.colonNotation?":":" ";if(typeof Z.unitCount==="number")q=q.slice(0,Math.max(Z.unitCount,1));return J+q.join(K)}var v5=($,Z)=>{if($.failed)l0({type:"error",verboseMessage:$.shortMessage,verboseInfo:Z,result:$})};var f5=($,Z)=>{if(!p1(Z))return;v5($,Z),BG($,Z)},BG=($,Z)=>{let X=`(done in ${r2($.durationMs)})`;l0({type:"duration",verboseMessage:X,verboseInfo:Z,result:$})};var e1=($,Z,{reject:X})=>{if(f5($,Z),$.failed&&X)throw $;return $};import{readFileSync as HZ}from"node:fs";var y5=($,Z)=>{if(x1($))return"asyncGenerator";if(m5($))return"generator";if(x4($))return"fileUrl";if(_G($))return"filePath";if(FG($))return"webStream";if(u0($,{checkOpen:!1}))return"native";if(L0($))return"uint8Array";if(MG($))return"asyncIterable";if(CG($))return"iterable";if($3($))return g5({transform:$},Z);if(LG($))return UG($,Z);return"native"},UG=($,Z)=>{if(i2($.transform,{checkOpen:!1}))return WG($,Z);if($3($.transform))return g5($,Z);return VG($,Z)},WG=($,Z)=>{return u5($,Z,"Duplex stream"),"duplex"},g5=($,Z)=>{return u5($,Z,"web TransformStream"),"webTransform"},u5=({final:$,binary:Z,objectMode:X},J,q)=>{k5($,`${J}.final`,q),k5(Z,`${J}.binary`,q),s2(X,`${J}.objectMode`)},k5=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${Z}\` option can only be defined when using a generator, not a ${X}.`)},VG=({transform:$,final:Z,binary:X,objectMode:J},q)=>{if($!==void 0&&!b5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(i2(Z,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if($3(Z))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(Z!==void 0&&!b5(Z))throw TypeError(`The \`${q}.final\` option must be a generator.`);return s2(X,`${q}.binary`),s2(J,`${q}.objectMode`),x1($)||x1(Z)?"asyncGenerator":"generator"},s2=($,Z)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${Z}\` option must use a boolean.`)},b5=($)=>x1($)||m5($),x1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",m5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",LG=($)=>Y0($)&&($.transform!==void 0||$.final!==void 0),x4=($)=>Object.prototype.toString.call($)==="[object URL]",c5=($)=>x4($)&&$.protocol!=="file:",_G=($)=>Y0($)&&Object.keys($).length>0&&Object.keys($).every((Z)=>RG.has(Z))&&e2($.file),RG=new Set(["file","append"]),e2=($)=>typeof $==="string",p5=($,Z)=>$==="native"&&typeof Z==="string"&&!TG.has(Z),TG=new Set(["ipc","ignore","inherit","overlapped","pipe"]),d5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",j4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",FG=($)=>d5($)||j4($),$3=($)=>d5($?.readable)&&j4($?.writable),MG=($)=>l5($)&&typeof $[Symbol.asyncIterator]==="function",CG=($)=>l5($)&&typeof $[Symbol.iterator]==="function",l5=($)=>typeof $==="object"&&$!==null,D0=new Set(["generator","asyncGenerator","duplex","webTransform"]),I4=new Set(["fileUrl","filePath","fileNumber"]),Z3=new Set(["fileUrl","filePath"]),n5=new Set([...Z3,"webStream","nodeStream"]),i5=new Set(["webTransform","duplex"]),K1={generator:"a generator",asyncGenerator:"an async generator",fileUrl:"a file URL",filePath:"a file path string",fileNumber:"a file descriptor number",webStream:"a web stream",nodeStream:"a Node.js stream",webTransform:"a web TransformStream",duplex:"a Duplex stream",native:"any value",iterable:"an iterable",asyncIterable:"an async iterable",string:"a string",uint8Array:"a Uint8Array"};var X3=($,Z,X,J)=>J==="output"?PG($,Z,X):xG($,Z,X),PG=($,Z,X)=>{let J=Z!==0&&X[Z-1].value.readableObjectMode;return{writableObjectMode:J,readableObjectMode:$??J}},xG=($,Z,X)=>{let J=Z===0?$===!0:X[Z-1].value.readableObjectMode,q=Z!==X.length-1&&($??J);return{writableObjectMode:J,readableObjectMode:q}},t5=($,Z)=>{let X=$.findLast(({type:J})=>D0.has(J));if(X===void 0)return!1;return Z==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var o5=($,Z,X,J)=>[...$.filter(({type:q})=>!D0.has(q)),...jG($,Z,X,J)],jG=($,Z,X,{encoding:J})=>{let q=$.filter(({type:Q})=>D0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=IG({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:Z,direction:X,encoding:J});return AG(Y,X)},IG=({stdioItem:$,stdioItem:{type:Z},index:X,newTransforms:J,optionName:q,direction:Y,encoding:Q})=>{if(Z==="duplex")return wG({stdioItem:$,optionName:q});if(Z==="webTransform")return OG({stdioItem:$,index:X,newTransforms:J,direction:Y});return EG({stdioItem:$,index:X,newTransforms:J,direction:Y,encoding:Q})},wG=({stdioItem:$,stdioItem:{value:{transform:Z,transform:{writableObjectMode:X,readableObjectMode:J},objectMode:q=J}},optionName:Y})=>{if(q&&!J)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&J)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:Z,writableObjectMode:X,readableObjectMode:J}}},OG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q})=>{let{transform:Y,objectMode:Q}=Y0(Z)?Z:{transform:Z},{writableObjectMode:G,readableObjectMode:H}=X3(Q,X,J,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},EG=({stdioItem:$,stdioItem:{value:Z},index:X,newTransforms:J,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:K=!1,objectMode:W}=Y0(Z)?Z:{transform:Z},U=H||j0.has(Y),{writableObjectMode:B,readableObjectMode:R}=X3(W,X,J,q);return{...$,value:{transform:Q,final:G,binary:U,preserveNewlines:K,writableObjectMode:B,readableObjectMode:R}}},AG=($,Z)=>Z==="input"?$.reverse():$;import J3 from"node:process";var a5=($,Z,X)=>{let J=$.map((q)=>hG(q,Z));if(J.includes("input")&&J.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return J.find(Boolean)??SG},hG=({type:$,value:Z},X)=>NG[X]??r5[$](Z),NG=["input","output","output"],$$=()=>{return},Q3=()=>"input",r5={generator:$$,asyncGenerator:$$,fileUrl:$$,filePath:$$,iterable:Q3,asyncIterable:Q3,uint8Array:Q3,webStream:($)=>j4($)?"output":"input",nodeStream($){if(!P1($,{checkOpen:!1}))return"output";return n2($,{checkOpen:!1})?void 0:"input"},webTransform:$$,duplex:$$,native($){let Z=DG($);if(Z!==void 0)return Z;if(u0($,{checkOpen:!1}))return r5.nodeStream($)}},DG=($)=>{if([0,J3.stdin].includes($))return"input";if([1,2,J3.stdout,J3.stderr].includes($))return"output"},SG="output";var s5=($,Z)=>Z&&!$.includes("ipc")?[...$,"ipc"]:$;var e5=({stdio:$,ipc:Z,buffer:X,...J},q,Y)=>{let Q=vG($,J).map((G,H)=>$Z(G,H));return Y?kG(Q,X,q):s5(Q,Z)},vG=($,Z)=>{if($===void 0)return N0.map((J)=>Z[J]);if(fG(Z))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${N0.map((J)=>`\`${J}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let X=Math.max($.length,N0.length);return Array.from({length:X},(J,q)=>$[q])},fG=($)=>N0.some((Z)=>$[Z]!==void 0),$Z=($,Z)=>{if(Array.isArray($))return $.map((X)=>$Z(X,Z));if($===null||$===void 0)return Z>=N0.length?"ignore":"pipe";return $},kG=($,Z,X)=>$.map((J,q)=>!Z[q]&&q!==0&&!d1(X,q)&&bG(J)?"ignore":J),bG=($)=>$==="pipe"||Array.isArray($)&&$.every((Z)=>Z==="pipe");import{readFileSync as yG}from"node:fs";import gG from"node:tty";var XZ=({stdioItem:$,stdioItem:{type:Z},isStdioArray:X,fdNumber:J,direction:q,isSync:Y})=>{if(!X||Z!=="native")return $;return Y?uG({stdioItem:$,fdNumber:J,direction:q}):pG({stdioItem:$,fdNumber:J})},uG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J,direction:q})=>{let Y=mG({value:Z,optionName:X,fdNumber:J,direction:q});if(Y!==void 0)return Y;if(u0(Z,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},mG=({value:$,optionName:Z,fdNumber:X,direction:J})=>{let q=cG($,X);if(q===void 0)return;if(J==="output")return{type:"fileNumber",value:q,optionName:Z};if(gG.isatty(q))throw TypeError(`The \`${Z}: ${$4($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:Z1(yG(q)),optionName:Z}},cG=($,Z)=>{if($==="inherit")return Z;if(typeof $==="number")return $;let X=v$.indexOf($);if(X!==-1)return X},pG=({stdioItem:$,stdioItem:{value:Z,optionName:X},fdNumber:J})=>{if(Z==="inherit")return{type:"nodeStream",value:ZZ(J,Z,X),optionName:X};if(typeof Z==="number")return{type:"nodeStream",value:ZZ(Z,Z,X),optionName:X};if(u0(Z,{checkOpen:!1}))return{type:"nodeStream",value:Z,optionName:X};return $},ZZ=($,Z,X)=>{let J=v$[$];if(J===void 0)throw TypeError(`The \`${X}: ${Z}\` option is invalid: no such standard stream.`);return J};var JZ=({input:$,inputFile:Z},X)=>X===0?[...dG($),...nG(Z)]:[],dG=($)=>$===void 0?[]:[{type:lG($),value:$,optionName:"input"}],lG=($)=>{if(P1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(L0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},nG=($)=>$===void 0?[]:[{...iG($),optionName:"inputFile"}],iG=($)=>{if(x4($))return{type:"fileUrl",value:$};if(e2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var QZ=($)=>$.filter((Z,X)=>$.every((J,q)=>Z.value!==J.value||X>=q||Z.type==="generator"||Z.type==="asyncGenerator")),qZ=({stdioItem:{type:$,value:Z,optionName:X},direction:J,fileDescriptors:q,isSync:Y})=>{let Q=tG(q,$);if(Q.length===0)return;if(Y){oG({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});return}if(n5.has($))return YZ({otherStdioItems:Q,type:$,value:Z,optionName:X,direction:J});if(i5.has($))rG({otherStdioItems:Q,type:$,value:Z,optionName:X})},tG=($,Z)=>$.flatMap(({direction:X,stdioItems:J})=>J.filter((q)=>q.type===Z).map((q)=>({...q,direction:X}))),oG=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{if(Z3.has(Z))YZ({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})},YZ=({otherStdioItems:$,type:Z,value:X,optionName:J,direction:q})=>{let Y=$.filter((G)=>aG(G,X));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return GZ(Q,J,Z),q==="output"?Y[0].stream:void 0},aG=({type:$,value:Z},X)=>{if($==="filePath")return Z.file===X.file;if($==="fileUrl")return Z.href===X.href;return Z===X},rG=({otherStdioItems:$,type:Z,value:X,optionName:J})=>{let q=$.find(({value:{transform:Y}})=>Y===X.transform);GZ(q,J,Z)},GZ=($,Z,X)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${Z}\` options must not target ${K1[X]} that is the same.`)};var w4=($,Z,X,J)=>{let Y=e5(Z,X,J).map((G,H)=>sG({stdioOption:G,fdNumber:H,options:Z,isSync:J})),Q=YH({initialFileDescriptors:Y,addProperties:$,options:Z,isSync:J});return Z.stdio=Q.map(({stdioItems:G})=>zH(G)),Q},sG=({stdioOption:$,fdNumber:Z,options:X,isSync:J})=>{let q=f$(Z),{stdioItems:Y,isStdioArray:Q}=eG({stdioOption:$,fdNumber:Z,options:X,optionName:q}),G=a5(Y,Z,q),H=Y.map((U)=>XZ({stdioItem:U,isStdioArray:Q,fdNumber:Z,direction:G,isSync:J})),K=o5(H,q,G,X),W=t5(K,G);return qH(K,W),{direction:G,objectMode:W,stdioItems:K}},eG=({stdioOption:$,fdNumber:Z,options:X,optionName:J})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>$H(H,J)),...JZ(X,Z)],Q=QZ(Y),G=Q.length>1;return ZH(Q,G,J),JH(Q),{stdioItems:Q,isStdioArray:G}},$H=($,Z)=>({type:y5($,Z),value:$,optionName:Z}),ZH=($,Z,X)=>{if($.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!Z)return;for(let{value:J,optionName:q}of $)if(XH.has(J))throw Error(`The \`${q}\` option must not include \`${J}\`.`)},XH=new Set(["ignore","ipc"]),JH=($)=>{for(let Z of $)QH(Z)},QH=({type:$,value:Z,optionName:X})=>{if(c5(Z))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
38
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(p5($,Z))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},qH=($,Z)=>{if(!Z)return;let X=$.find(({type:J})=>I4.has(J));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},YH=({initialFileDescriptors:$,addProperties:Z,options:X,isSync:J})=>{let q=[];try{for(let Y of $)q.push(GH({fileDescriptor:Y,fileDescriptors:q,addProperties:Z,options:X,isSync:J}));return q}catch(Y){throw q3(q),Y}},GH=({fileDescriptor:{direction:$,objectMode:Z,stdioItems:X},fileDescriptors:J,addProperties:q,options:Y,isSync:Q})=>{let G=X.map((H)=>HH({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:J,isSync:Q}));return{direction:$,objectMode:Z,stdioItems:G}},HH=({stdioItem:$,addProperties:Z,direction:X,options:J,fileDescriptors:q,isSync:Y})=>{let Q=qZ({stdioItem:$,direction:X,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...Z[X][$.type]($,J)}},q3=($)=>{for(let{stdioItems:Z}of $)for(let{stream:X}of Z)if(X!==void 0&&!y0(X))X.destroy()},zH=($)=>{if($.length>1)return $.some(({value:J})=>J==="overlapped")?"overlapped":"pipe";let[{type:Z,value:X}]=$;return Z==="native"?X:"pipe"};var KZ=($,Z)=>w4(BH,$,Z,!0),o0=({type:$,optionName:Z})=>{BZ(Z,K1[$])},KH=({optionName:$,value:Z})=>{if(Z==="ipc"||Z==="overlapped")BZ($,`"${Z}"`);return{}},BZ=($,Z)=>{throw TypeError(`The \`${$}\` option cannot be ${Z} with synchronous methods.`)},zZ={generator(){},asyncGenerator:o0,webStream:o0,nodeStream:o0,webTransform:o0,duplex:o0,asyncIterable:o0,native:KH},BH={input:{...zZ,fileUrl:({value:$})=>({contents:[Z1(HZ($))]}),filePath:({value:{file:$}})=>({contents:[Z1(HZ($))]}),fileNumber:o0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...zZ,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:Z}})=>({path:$,append:Z}),fileNumber:({value:$})=>({path:$}),iterable:o0,string:o0,uint8Array:o0}};var q1=($,{stripFinalNewline:Z},X)=>Y3(Z,X)&&$!==void 0&&!Array.isArray($)?a1($):$,Y3=($,Z)=>Z==="all"?$[1]||$[2]:$[Z];import{Transform as DH,getDefaultHighWaterMark as PZ}from"node:stream";var O4=($,Z,X,J)=>$||X?void 0:WZ(Z,J),H3=($,Z,X)=>X?$.flatMap((J)=>UZ(J,Z)):UZ($,Z),UZ=($,Z)=>{let{transform:X,final:J}=WZ(Z,{});return[...X($),...J()]},WZ=($,Z)=>{return Z.previousChunks="",{transform:UH.bind(void 0,Z,$),final:VH.bind(void 0,Z)}},UH=function*($,Z,X){if(typeof X!=="string"){yield X;return}let{previousChunks:J}=$,q=-1;for(let Y=0;Y<X.length;Y+=1)if(X[Y]===`
39
+ `){let Q=WH(X,Y,Z,$),G=X.slice(q+1,Y+1-Q);if(J.length>0)G=G3(J,G),J="";yield G,q=Y}if(q!==X.length-1)J=G3(J,X.slice(q+1));$.previousChunks=J},WH=($,Z,X,J)=>{if(X)return 0;return J.isWindowsNewline=Z!==0&&$[Z-1]==="\r",J.isWindowsNewline?2:1},VH=function*({previousChunks:$}){if($.length>0)yield $},VZ=({binary:$,preserveNewlines:Z,readableObjectMode:X,state:J})=>$||Z||X?void 0:{transform:LH.bind(void 0,J)},LH=function*({isWindowsNewline:$=!1},Z){let{unixNewline:X,windowsNewline:J,LF:q,concatBytes:Y}=typeof Z==="string"?_H:TH;if(Z.at(-1)===q){yield Z;return}yield Y(Z,$?J:X)},G3=($,Z)=>`${$}${Z}`,_H={windowsNewline:`\r
40
40
  `,unixNewline:`
41
41
  `,LF:`
42
- `,concatBytes:Q3},WH=($,X)=>{let Z=new Uint8Array($.length+X.length);return Z.set($,0),Z.set(X,$.length),Z},VH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:WH};import{Buffer as LH}from"node:buffer";var BX=($,X)=>$?void 0:_H.bind(void 0,X),_H=function*($,X){if(typeof X!=="string"&&!V0(X)&&!LH.isBuffer(X))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof X}.`);yield X},UX=($,X)=>$?RH.bind(void 0,X):TH.bind(void 0,X),RH=function*($,X){WX($,X),yield X},TH=function*($,X){if(WX($,X),typeof X!=="string"&&!V0(X))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof X}.`);yield X},WX=($,X)=>{if(X===null||X===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${X}\`.
42
+ `,concatBytes:G3},RH=($,Z)=>{let X=new Uint8Array($.length+Z.length);return X.set($,0),X.set(Z,$.length),X},TH={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:RH};import{Buffer as FH}from"node:buffer";var LZ=($,Z)=>$?void 0:MH.bind(void 0,Z),MH=function*($,Z){if(typeof Z!=="string"&&!L0(Z)&&!FH.isBuffer(Z))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof Z}.`);yield Z},_Z=($,Z)=>$?CH.bind(void 0,Z):PH.bind(void 0,Z),CH=function*($,Z){RZ($,Z),yield Z},PH=function*($,Z){if(RZ($,Z),typeof Z!=="string"&&!L0(Z))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof Z}.`);yield Z},RZ=($,Z)=>{if(Z===null||Z===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${Z}\`.
43
43
  Instead, \`yield\` should either be called with a value, or not be called at all. For example:
44
- if (condition) { yield value; }`)};import{Buffer as FH}from"node:buffer";import{StringDecoder as MH}from"node:string_decoder";var O4=($,X,Z)=>{if(Z)return;if($)return{transform:PH.bind(void 0,new TextEncoder)};let J=new MH(X);return{transform:CH.bind(void 0,J),final:jH.bind(void 0,J)}},PH=function*($,X){if(FH.isBuffer(X))yield $1(X);else if(typeof X==="string")yield $.encode(X);else yield X},CH=function*($,X){yield V0(X)?$.write(X):X},jH=function*($){let X=$.end();if(X!=="")yield X};import{callbackify as VX}from"node:util";var Y3=VX(async($,X,Z,J)=>{X.currentIterable=$(...Z);try{for await(let q of X.currentIterable)J.push(q)}finally{delete X.currentIterable}}),E4=async function*($,X,Z){if(Z===X.length){yield $;return}let{transform:J=IH}=X[Z];for await(let q of J($))yield*E4(q,X,Z+1)},LX=async function*($){for(let[X,{final:Z}]of Object.entries($))yield*xH(Z,Number(X),$)},xH=async function*($,X,Z){if($===void 0)return;for await(let J of $())yield*E4(J,Z,X+1)},_X=VX(async({currentIterable:$},X)=>{if($!==void 0){await(X?$.throw(X):$.return());return}if(X)throw X}),IH=function*($){yield $};var G3=($,X,Z,J)=>{try{for(let q of $(...X))Z.push(q);J()}catch(q){J(q)}},RX=($,X)=>[...X.flatMap((Z)=>[...x1(Z,$,0)]),...R$($)],x1=function*($,X,Z){if(Z===X.length){yield $;return}let{transform:J=OH}=X[Z];for(let q of J($))yield*x1(q,X,Z+1)},R$=function*($){for(let[X,{final:Z}]of Object.entries($))yield*wH(Z,Number(X),$)},wH=function*($,X,Z){if($===void 0)return;for(let J of $())yield*x1(J,Z,X+1)},OH=function*($){yield $};var H3=({value:$,value:{transform:X,final:Z,writableObjectMode:J,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=FX($,Q,Y),B=j1(X),K=j1(Z),U=B?Y3.bind(void 0,E4,G):G3.bind(void 0,x1),W=B||K?Y3.bind(void 0,LX,G):G3.bind(void 0,R$),_=B||K?_X.bind(void 0,G):void 0;return{stream:new EH({writableObjectMode:J,writableHighWaterMark:TX(J),readableObjectMode:q,readableHighWaterMark:TX(q),transform(L,I,j){U([L,H,0],this,j)},flush(L){W([H],this,L)},destroy:_})}},A4=($,X,Z,J)=>{let q=X.filter(({type:Q})=>Q==="generator"),Y=J?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=FX(Q,Z,G);$=RX(H,$)}return $},FX=({transform:$,final:X,binary:Z,writableObjectMode:J,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:BX(J,G)},O4(Z,Q,J),w4(Z,Y,J,H),{transform:$,final:X},{transform:UX(q,G)},KX({binary:Z,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var MX=($,X)=>{for(let Z of AH($))hH($,Z,X)},AH=($)=>new Set(Object.entries($).filter(([,{direction:X}])=>X==="input").map(([X])=>Number(X))),hH=($,X,Z)=>{let{stdioItems:J}=$[X],q=J.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(X!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${z1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>NH(G,J));Z.input=z$(Q)},NH=($,X)=>{let Z=A4($,X,"utf8",!0);return DH(Z),z$(Z)},DH=($)=>{let X=$.find((Z)=>typeof Z!=="string"&&!V0(Z));if(X!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${X}.`)};import{writeFileSync as kH,appendFileSync as bH}from"node:fs";var h4=({stdioItems:$,encoding:X,verboseInfo:Z,fdNumber:J})=>J!=="all"&&p1(Z,J)&&!x0.has(X)&&SH(J)&&($.some(({type:q,value:Y})=>q==="native"&&vH.has(Y))||$.every(({type:q})=>N0.has(q))),SH=($)=>$===1||$===2,vH=new Set(["pipe","overlapped"]),PX=async($,X,Z,J)=>{for await(let q of $)if(!fH(X))jX(q,Z,J)},CX=($,X,Z)=>{for(let J of $)jX(J,X,Z)},fH=($)=>$._readableState.pipes.length>0,jX=($,X,Z)=>{let J=m$($);p0({type:"output",verboseMessage:J,fdNumber:X,verboseInfo:Z})};var xX=({fileDescriptors:$,syncResult:{output:X},options:Z,isMaxBuffer:J,verboseInfo:q})=>{if(X===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:X.map((H,B)=>yH({result:H,fileDescriptors:$,fdNumber:B,state:Y,outputFiles:Q,isMaxBuffer:J,verboseInfo:q},Z)),...Y}},yH=({result:$,fileDescriptors:X,fdNumber:Z,state:J,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:B,stripFinalNewline:K,maxBuffer:U})=>{if($===null)return;let W=I5($,Y,U),_=$1(W),{stdioItems:R,objectMode:L}=X[Z],I=gH([_],R,H,J),{serializedResult:j,finalResult:N=j}=mH({chunks:I,objectMode:L,encoding:H,lines:B,stripFinalNewline:K,fdNumber:Z});cH({serializedResult:j,fdNumber:Z,state:J,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let u=G[Z]?N:void 0;try{if(J.error===void 0)uH(j,R,q);return u}catch(x){return J.error=x,u}},gH=($,X,Z,J)=>{try{return A4($,X,Z,!1)}catch(q){return J.error=q,$}},mH=({chunks:$,objectMode:X,encoding:Z,lines:J,stripFinalNewline:q,fdNumber:Y})=>{if(X)return{serializedResult:$};if(Z==="buffer")return{serializedResult:z$($)};let Q=g6($,Z);if(J[Y])return{serializedResult:Q,finalResult:q3(Q,!q[Y],X)};return{serializedResult:Q}},cH=({serializedResult:$,fdNumber:X,state:Z,verboseInfo:J,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!h4({stdioItems:Y,encoding:q,verboseInfo:J,fdNumber:X}))return;let G=q3($,!1,Q);try{CX(G,X,J)}catch(H){Z.error??=H}},uH=($,X,Z)=>{for(let{path:J,append:q}of X.filter(({type:Y})=>x4.has(Y))){let Y=typeof J==="string"?J:J.toString();if(q||Z.has(Y))bH(J,$);else Z.add(Y),kH(J,$)}};var IX=([,$,X],Z)=>{if(!Z.all)return;if($===void 0)return X;if(X===void 0)return $;if(Array.isArray($))return Array.isArray(X)?[...$,...X]:[...$,Q1(X,Z,"all")];if(Array.isArray(X))return[Q1($,Z,"all"),...X];if(V0($)&&V0(X))return V2([$,X]);return`${$}${X}`};import{once as z3}from"node:events";var wX=async($,X)=>{let[Z,J]=await pH($);return X.isForcefullyTerminated??=!1,[Z,J]},pH=async($)=>{let[X,Z]=await Promise.allSettled([z3($,"spawn"),z3($,"exit")]);if(X.status==="rejected")return[];return Z.status==="rejected"?OX($):Z.value},OX=async($)=>{try{return await z3($,"exit")}catch{return OX($)}},EX=async($)=>{let[X,Z]=await $;if(!dH(X,Z)&&K3(X,Z))throw new d0;return[X,Z]},dH=($,X)=>$===void 0&&X===void 0,K3=($,X)=>$!==0||X!==null;var AX=({error:$,status:X,signal:Z,output:J},{maxBuffer:q})=>{let Y=lH($,X,Z),Q=Y?.code==="ETIMEDOUT",G=x5(Y,J,q);return{resultError:Y,exitCode:X,signal:Z,timedOut:Q,isMaxBuffer:G}},lH=($,X,Z)=>{if($!==void 0)return $;return K3(X,Z)?new d0:void 0};var hX=($,X,Z)=>{let{file:J,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:B,fileDescriptors:K}=iH($,X,Z),U=aH({file:J,commandArguments:q,options:B,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:K,startTime:G});return s1(U,H,B)},iH=($,X,Z)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=u$($,X,Z),G=tH(Z),{file:H,commandArguments:B,options:K}=B4($,X,G);oH(K);let U=YX(K,Q);return{file:H,commandArguments:B,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:K,fileDescriptors:U}},tH=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,oH=({ipc:$,ipcInput:X,detached:Z,cancelSignal:J})=>{if(X)N4("ipcInput");if($)N4("ipc: true");if(Z)N4("detached: true");if(J)N4("cancelSignal")},N4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},aH=({file:$,commandArguments:X,options:Z,command:J,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=rH({file:$,commandArguments:X,options:Z,command:J,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:B,exitCode:K,signal:U,timedOut:W,isMaxBuffer:_}=AX(H,Z),{output:R,error:L=B}=xX({fileDescriptors:Q,syncResult:H,options:Z,isMaxBuffer:_,verboseInfo:Y}),I=R.map((N,u)=>Q1(N,Z,u)),j=Q1(IX(R,Z),Z,"all");return eH({error:L,exitCode:K,signal:U,timedOut:W,isMaxBuffer:_,stdio:I,all:j,options:Z,command:J,escapedCommand:q,startTime:G})},rH=({file:$,commandArguments:X,options:Z,command:J,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{MX(Y,Z);let G=sH(Z);return nH(...U4($,X,G))}catch(G){return r1({error:G,command:J,escapedCommand:q,fileDescriptors:Y,options:Z,startTime:Q,isSync:!0})}},sH=({encoding:$,maxBuffer:X,...Z})=>({...Z,encoding:"buffer",maxBuffer:M4(X)}),eH=({error:$,exitCode:X,signal:Z,timedOut:J,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:B,startTime:K})=>$===void 0?P4({command:H,escapedCommand:B,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:K}):_$({error:$,command:H,escapedCommand:B,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:X,signal:Z,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:K,isSync:!0});import{setMaxListeners as mK}from"node:events";import{spawn as cK}from"node:child_process";import fX from"node:process";import{once as B3,on as $z}from"node:events";var NX=({anyProcess:$,channel:X,isSubprocess:Z,ipc:J},{reference:q=!0,filter:Y}={})=>{return n1({methodName:"getOneMessage",isSubprocess:Z,ipc:J,isConnected:q4($)}),Xz({anyProcess:$,channel:X,isSubprocess:Z,filter:Y,reference:q})},Xz=async({anyProcess:$,channel:X,isSubprocess:Z,filter:J,reference:q})=>{X4(X,q);let Y=H1($,X,Z),Q=new AbortController;try{return await Promise.race([Zz(Y,J,Q),Jz(Y,Z,Q),Qz(Y,Z,Q)])}catch(G){throw i1($),G}finally{Q.abort(),Z4(X,q)}},Zz=async($,X,{signal:Z})=>{if(X===void 0){let[J]=await B3($,"message",{signal:Z});return J}for await(let[J]of $z($,"message",{signal:Z}))if(X(J))return J},Jz=async($,X,{signal:Z})=>{await B3($,"disconnect",{signal:Z}),_8(X)},Qz=async($,X,{signal:Z})=>{let[J]=await B3($,"strict:error",{signal:Z});throw s$(J,X)};import{once as SX,on as qz}from"node:events";var vX=({anyProcess:$,channel:X,isSubprocess:Z,ipc:J},{reference:q=!0}={})=>U3({anyProcess:$,channel:X,isSubprocess:Z,ipc:J,shouldAwait:!Z,reference:q}),U3=({anyProcess:$,channel:X,isSubprocess:Z,ipc:J,shouldAwait:q,reference:Y})=>{n1({methodName:"getEachMessage",isSubprocess:Z,ipc:J,isConnected:q4($)}),X4(X,Y);let Q=H1($,X,Z),G=new AbortController,H={};return Yz($,Q,G),Gz({ipcEmitter:Q,isSubprocess:Z,controller:G,state:H}),Hz({anyProcess:$,channel:X,ipcEmitter:Q,isSubprocess:Z,shouldAwait:q,controller:G,state:H,reference:Y})},Yz=async($,X,Z)=>{try{await SX(X,"disconnect",{signal:Z.signal}),Z.abort()}catch{}},Gz=async({ipcEmitter:$,isSubprocess:X,controller:Z,state:J})=>{try{let[q]=await SX($,"strict:error",{signal:Z.signal});J.error=s$(q,X),Z.abort()}catch{}},Hz=async function*({anyProcess:$,channel:X,ipcEmitter:Z,isSubprocess:J,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of qz(Z,"message",{signal:Y.signal}))DX(Q),yield H}catch{DX(Q)}finally{if(Y.abort(),Z4(X,G),!J)i1($);if(q)await $}},DX=({error:$})=>{if($)throw $};var kX=($,{ipc:X})=>{Object.assign($,yX($,!1,X))},bX=()=>{let $=fX,X=!0,Z=fX.channel!==void 0;return{...yX($,!0,Z),getCancelSignal:p8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:Z})}},yX=($,X,Z)=>({sendMessage:z4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:X,ipc:Z}),getOneMessage:NX.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:X,ipc:Z}),getEachMessage:vX.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:X,ipc:Z})});import{ChildProcess as zz}from"node:child_process";import{PassThrough as Kz,Readable as Bz,Writable as Uz,Duplex as Wz}from"node:stream";var gX=({error:$,command:X,escapedCommand:Z,fileDescriptors:J,options:q,startTime:Y,verboseInfo:Q})=>{Z3(J);let G=new zz;Vz(G,J),Object.assign(G,{readable:Lz,writable:_z,duplex:Rz});let H=r1({error:$,command:X,escapedCommand:Z,fileDescriptors:J,options:q,startTime:Y,isSync:!1}),B=Tz(H,Q,q);return{subprocess:G,promise:B}},Vz=($,X)=>{let Z=T$(),J=T$(),q=T$(),Y=Array.from({length:X.length-3},T$),Q=T$(),G=[Z,J,q,...Y];Object.assign($,{stdin:Z,stdout:J,stderr:q,all:Q,stdio:G})},T$=()=>{let $=new Kz;return $.end(),$},Lz=()=>new Bz({read(){}}),_z=()=>new Uz({write(){}}),Rz=()=>new Wz({read(){},write(){}}),Tz=async($,X,Z)=>s1($,X,Z);import{createReadStream as mX,createWriteStream as cX}from"node:fs";import{Buffer as Fz}from"node:buffer";import{Readable as F$,Writable as Mz,Duplex as Pz}from"node:stream";var pX=($,X)=>I4(Cz,$,X,!1),M$=({type:$,optionName:X})=>{throw TypeError(`The \`${X}\` option cannot be ${z1[$]}.`)},uX={fileNumber:M$,generator:H3,asyncGenerator:H3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:X,readableObjectMode:Z}}){let J=X||Z;return{stream:Pz.fromWeb($,{objectMode:J})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},Cz={input:{...uX,fileUrl:({value:$})=>({stream:mX($)}),filePath:({value:{file:$}})=>({stream:mX($)}),webStream:({value:$})=>({stream:F$.fromWeb($)}),iterable:({value:$})=>({stream:F$.from($)}),asyncIterable:({value:$})=>({stream:F$.from($)}),string:({value:$})=>({stream:F$.from($)}),uint8Array:({value:$})=>({stream:F$.from(Fz.from($))})},output:{...uX,fileUrl:({value:$})=>({stream:cX($)}),filePath:({value:{file:$,append:X}})=>({stream:cX($,X?{flags:"a"}:{})}),webStream:({value:$})=>({stream:Mz.fromWeb($)}),iterable:M$,asyncIterable:M$,string:M$,uint8Array:M$}};import{on as jz,once as dX}from"node:events";import{PassThrough as xz,getDefaultHighWaterMark as Iz}from"node:stream";import{finished as iX}from"node:stream/promises";function I1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)W3(q);let X=$.some(({readableObjectMode:q})=>q),Z=wz($,X),J=new tX({objectMode:X,writableHighWaterMark:Z,readableHighWaterMark:Z});for(let q of $)J.add(q);return J}var wz=($,X)=>{if($.length===0)return Iz(X);let Z=$.filter(({readableObjectMode:J})=>J===X).map(({readableHighWaterMark:J})=>J);return Math.max(...Z)};class tX extends xz{#X=new Set([]);#Z=new Set([]);#$=new Set([]);#J;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(W3($),this.#X.has($))return;this.#X.add($),this.#J??=Oz(this,this.#X,this.#q);let X=hz({passThroughStream:this,stream:$,streams:this.#X,ended:this.#Z,aborted:this.#$,onFinished:this.#J,unpipeEvent:this.#q});this.#Q.set($,X),$.pipe(this,{end:!1})}async remove($){if(W3($),!this.#X.has($))return!1;let X=this.#Q.get($);if(X===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await X,!0}}var Oz=async($,X,Z)=>{D4($,lX);let J=new AbortController;try{await Promise.race([Ez($,J),Az($,X,Z,J)])}finally{J.abort(),D4($,-lX)}},Ez=async($,{signal:X})=>{try{await iX($,{signal:X,cleanup:!0})}catch(Z){throw oX($,Z),Z}},Az=async($,X,Z,{signal:J})=>{for await(let[q]of jz($,"unpipe",{signal:J}))if(X.has(q))q.emit(Z)},W3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},hz=async({passThroughStream:$,stream:X,streams:Z,ended:J,aborted:q,onFinished:Y,unpipeEvent:Q})=>{D4($,nX);let G=new AbortController;try{await Promise.race([Nz(Y,X,G),Dz({passThroughStream:$,stream:X,streams:Z,ended:J,aborted:q,controller:G}),Sz({stream:X,streams:Z,ended:J,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),D4($,-nX)}if(Z.size>0&&Z.size===J.size+q.size)if(J.size===0&&q.size>0)V3($);else vz($)},Nz=async($,X,{signal:Z})=>{try{if(await $,!Z.aborted)V3(X)}catch(J){if(!Z.aborted)oX(X,J)}},Dz=async({passThroughStream:$,stream:X,streams:Z,ended:J,aborted:q,controller:{signal:Y}})=>{try{if(await iX(X,{signal:Y,cleanup:!0,readable:!0,writable:!1}),Z.has(X))J.add(X)}catch(Q){if(Y.aborted||!Z.has(X))return;if(aX(Q))q.add(X);else rX($,Q)}},Sz=async({stream:$,streams:X,ended:Z,aborted:J,unpipeEvent:q,controller:{signal:Y}})=>{if(await dX($,q,{signal:Y}),!$.readable)return dX(Y,"abort",{signal:Y});X.delete($),Z.delete($),J.delete($)},vz=($)=>{if($.writable)$.end()},oX=($,X)=>{if(aX(X))V3($);else rX($,X)},aX=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",V3=($)=>{if($.readable||$.writable)$.destroy()},rX=($,X)=>{if(!$.destroyed)$.once("error",fz),$.destroy(X)},fz=()=>{},D4=($,X)=>{let Z=$.getMaxListeners();if(Z!==0&&Z!==Number.POSITIVE_INFINITY)$.setMaxListeners(Z+X)},lX=2,nX=1;import{finished as sX}from"node:stream/promises";var $$=($,X)=>{$.pipe(X),kz($,X),bz($,X)},kz=async($,X)=>{if(b0($)||b0(X))return;try{await sX($,{cleanup:!0,readable:!0,writable:!1})}catch{}L3(X)},L3=($)=>{if($.writable)$.end()},bz=async($,X)=>{if(b0($)||b0(X))return;try{await sX(X,{cleanup:!0,readable:!1,writable:!0})}catch{}_3($)},_3=($)=>{if($.readable)$.destroy()};var eX=($,X,Z)=>{let J=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(X)){for(let{stream:G}of Y.filter(({type:H})=>N0.has(H)))yz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!N0.has(H)))mz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:J,controller:Z})}for(let[q,Y]of J.entries()){let Q=Y.length===1?Y[0]:I1(Y);$$(Q,q)}},yz=($,X,Z,J)=>{if(Z==="output")$$($.stdio[J],X);else $$(X,$.stdio[J]);let q=gz[J];if(q!==void 0)$[q]=X;$.stdio[J]=X},gz=["stdin","stdout","stderr"],mz=({subprocess:$,stream:X,direction:Z,fdNumber:J,pipeGroups:q,controller:Y})=>{if(X===void 0)return;cz(X,Y);let[Q,G]=Z==="output"?[X,$.stdio[J]]:[$.stdio[J],X],H=q.get(Q)??[];q.set(Q,[...H,G])},cz=($,{signal:X})=>{if(b0($))P1($,uz,X)},uz=2;import{addAbortListener as lz}from"node:events";var w1=[];w1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")w1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")w1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var S4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",R3=Symbol.for("signal-exit emitter"),T3=globalThis,pz=Object.defineProperty.bind(Object);class $Z{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(T3[R3])return T3[R3];pz(T3,R3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,X){this.listeners[$].push(X)}removeListener($,X){let Z=this.listeners[$],J=Z.indexOf(X);if(J===-1)return;if(J===0&&Z.length===1)Z.length=0;else Z.splice(J,1)}emit($,X,Z){if(this.emitted[$])return!1;this.emitted[$]=!0;let J=!1;for(let q of this.listeners[$])J=q(X,Z)===!0||J;if($==="exit")J=this.emit("afterExit",X,Z)||J;return J}}class M3{}var dz=($)=>{return{onExit(X,Z){return $.onExit(X,Z)},load(){return $.load()},unload(){return $.unload()}}};class XZ extends M3{onExit(){return()=>{}}load(){}unload(){}}class ZZ extends M3{#X=F3.platform==="win32"?"SIGINT":"SIGHUP";#Z=new $Z;#$;#J;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let X of w1)this.#Q[X]=()=>{let Z=this.#$.listeners(X),{count:J}=this.#Z,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")J+=q.__signal_exit_emitter__.count;if(Z.length===J){this.unload();let Y=this.#Z.emit("exit",null,X),Q=X==="SIGHUP"?this.#X:X;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#J=$.emit}onExit($,X){if(!S4(this.#$))return()=>{};if(this.#Y===!1)this.load();let Z=X?.alwaysLast?"afterExit":"exit";return this.#Z.on(Z,$),()=>{if(this.#Z.removeListener(Z,$),this.#Z.listeners.exit.length===0&&this.#Z.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#Z.count+=1;for(let $ of w1)try{let X=this.#Q[$];if(X)this.#$.on($,X)}catch(X){}this.#$.emit=($,...X)=>{return this.#H($,...X)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,w1.forEach(($)=>{let X=this.#Q[$];if(!X)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,X)}catch(Z){}}),this.#$.emit=this.#J,this.#$.reallyExit=this.#q,this.#Z.count-=1}#G($){if(!S4(this.#$))return 0;return this.#$.exitCode=$||0,this.#Z.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...X){let Z=this.#J;if($==="exit"&&S4(this.#$)){if(typeof X[0]==="number")this.#$.exitCode=X[0];let J=Z.call(this.#$,$,...X);return this.#Z.emit("exit",this.#$.exitCode,null),J}else return Z.call(this.#$,$,...X)}}var F3=globalThis.process,{onExit:JZ,load:aM,unload:rM}=dz(S4(F3)?new ZZ(F3):new XZ);var QZ=($,{cleanup:X,detached:Z},{signal:J})=>{if(!X||Z)return;let q=JZ(()=>{$.kill()});lz(J,()=>{q()})};var YZ=({source:$,sourcePromise:X,boundOptions:Z,createNested:J},...q)=>{let Y=c$(),{destination:Q,destinationStream:G,destinationError:H,from:B,unpipeSignal:K}=nz(Z,J,q),{sourceStream:U,sourceError:W}=tz($,B),{options:_,fileDescriptors:R}=n0.get($);return{sourcePromise:X,sourceStream:U,sourceOptions:_,sourceError:W,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:K,fileDescriptors:R,startTime:Y}},nz=($,X,Z)=>{try{let{destination:J,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=iz($,X,...Z),G=$4(J,Y);return{destination:J,destinationStream:G,from:q,unpipeSignal:Q}}catch(J){return{destinationError:J}}},iz=($,X,Z,...J)=>{if(Array.isArray(Z))return{destination:X(qZ,$)(Z,...J),pipeOptions:$};if(typeof Z==="string"||Z instanceof URL||U2(Z)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=N$(Z,...J);return{destination:X(qZ)(q,Y,Q),pipeOptions:Q}}if(n0.has(Z)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:Z,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${Z}`)},qZ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),tz=($,X)=>{try{return{sourceStream:t1($,X)}}catch(Z){return{sourceError:Z}}};var HZ=({sourceStream:$,sourceError:X,destinationStream:Z,destinationError:J,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=oz({sourceStream:$,sourceError:X,destinationStream:Z,destinationError:J});if(G!==void 0)throw P3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},oz=({sourceStream:$,sourceError:X,destinationStream:Z,destinationError:J})=>{if(X!==void 0&&J!==void 0)return J;if(J!==void 0)return _3($),J;if(X!==void 0)return L3(Z),X},P3=({error:$,fileDescriptors:X,sourceOptions:Z,startTime:J})=>r1({error:$,command:GZ,escapedCommand:GZ,fileDescriptors:X,options:Z,startTime:J,isSync:!1}),GZ="source.pipe(destination)";var zZ=async($)=>{let[{status:X,reason:Z,value:J=Z},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(J))Q.pipedFrom.push(J);if(q==="rejected")throw Q;if(X==="rejected")throw J;return Q};import{finished as az}from"node:stream/promises";var KZ=($,X,Z)=>{let J=v4.has(X)?sz($,X):rz($,X);return P1($,$K,Z.signal),P1(X,XK,Z.signal),ez(X),J},rz=($,X)=>{let Z=I1([$]);return $$(Z,X),v4.set(X,Z),Z},sz=($,X)=>{let Z=v4.get(X);return Z.add($),Z},ez=async($)=>{try{await az($,{cleanup:!0,readable:!1,writable:!0})}catch{}v4.delete($)},v4=new WeakMap,$K=2,XK=1;import{aborted as ZK}from"node:util";var BZ=($,X)=>$===void 0?[]:[JK($,X)],JK=async($,{sourceStream:X,mergedStream:Z,fileDescriptors:J,sourceOptions:q,startTime:Y})=>{await ZK($,X),await Z.remove(X);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw P3({error:Q,fileDescriptors:J,sourceOptions:q,startTime:Y})};var f4=($,...X)=>{if(Y0(X[0]))return f4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...X[0]}});let{destination:Z,...J}=YZ($,...X),q=QK({...J,destination:Z});return q.pipe=f4.bind(void 0,{...$,source:Z,sourcePromise:q,boundOptions:{}}),q},QK=async({sourcePromise:$,sourceStream:X,sourceOptions:Z,sourceError:J,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:B})=>{let K=qK($,q);HZ({sourceStream:X,sourceError:J,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:Z,startTime:B});let U=new AbortController;try{let W=KZ(X,Y,U);return await Promise.race([zZ(K),...BZ(G,{sourceStream:X,mergedStream:W,sourceOptions:Z,fileDescriptors:H,startTime:B})])}finally{U.abort()}},qK=($,X)=>Promise.allSettled([$,X]);import{setImmediate as UK}from"node:timers/promises";import{on as YK}from"node:events";import{getDefaultHighWaterMark as GK}from"node:stream";var k4=({subprocessStdout:$,subprocess:X,binary:Z,shouldEncode:J,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return HK(X,Q),WZ({stream:$,controller:Q,binary:Z,shouldEncode:!$.readableObjectMode&&J,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},HK=async($,X)=>{try{await $}catch{}finally{X.abort()}},C3=({stream:$,onStreamEnd:X,lines:Z,encoding:J,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;zK(X,Q,$);let G=$.readableObjectMode&&!Y;return WZ({stream:$,controller:Q,binary:J==="buffer",shouldEncode:!G,encoding:J,shouldSplit:!G&&Z,preserveNewlines:!q})},zK=async($,X,Z)=>{try{await $}catch{Z.destroy()}finally{X.abort()}},WZ=({stream:$,controller:X,binary:Z,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=YK($,"data",{signal:X.signal,highWaterMark:UZ,highWatermark:UZ});return KK({onStdoutChunk:G,controller:X,binary:Z,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})},j3=GK(!0),UZ=j3,KK=async function*({onStdoutChunk:$,controller:X,binary:Z,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=BK({binary:Z,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*x1(H,G,0)}catch(H){if(!X.signal.aborted)throw H}finally{yield*R$(G)}},BK=({binary:$,shouldEncode:X,encoding:Z,shouldSplit:J,preserveNewlines:q})=>[O4($,Z,!X),w4($,q,!J,{})].filter(Boolean);var VZ=async({stream:$,onStreamEnd:X,fdNumber:Z,encoding:J,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:B,streamInfo:K})=>{let U=WK({stream:$,onStreamEnd:X,fdNumber:Z,encoding:J,allMixed:G,verboseInfo:B,streamInfo:K});if(!q){await Promise.all([VK($),U]);return}let W=J3(H,Z),_=C3({stream:$,onStreamEnd:X,lines:Q,encoding:J,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([LK({stream:$,iterable:_,fdNumber:Z,encoding:J,maxBuffer:Y,lines:Q}),U]);return R},WK=async({stream:$,onStreamEnd:X,fdNumber:Z,encoding:J,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!h4({stdioItems:Q[Z]?.stdioItems,encoding:J,verboseInfo:Y,fdNumber:Z}))return;let G=C3({stream:$,onStreamEnd:X,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:q});await PX(G,$,Z,Y)},VK=async($)=>{if(await UK(),$.readableFlowing===null)$.resume()},LK=async({stream:$,stream:{readableObjectMode:X},iterable:Z,fdNumber:J,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(X||Q)return await _4(Z,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await R4(Z,{maxBuffer:Y}));return await F4(Z,{maxBuffer:Y})}catch(G){return LZ(P5({error:G,stream:$,readableObjectMode:X,lines:Q,encoding:q,fdNumber:J}))}},x3=async($)=>{try{return await $}catch(X){return LZ(X)}},LZ=({bufferedData:$})=>b6($)?new Uint8Array($):$;import{finished as _K}from"node:stream/promises";var P$=async($,X,Z,{isSameDirection:J,stopOnExit:q=!1}={})=>{let Y=RK($,Z),Q=new AbortController;try{await Promise.race([...q?[Z.exitPromise]:[],_K($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)MK(G,X,Z,J)}finally{Q.abort()}},RK=($,{originalStreams:[X],subprocess:Z})=>{let J={stdinCleanedUp:!1};if($===X)TK($,Z,J);return J},TK=($,X,Z)=>{let{_destroy:J}=$;$._destroy=(...q)=>{FK(X,Z),J.call($,...q)}},FK=({exitCode:$,signalCode:X},Z)=>{if($!==null||X!==null)Z.stdinCleanedUp=!0},MK=($,X,Z,J)=>{if(!PK($,X,Z,J))throw $},PK=($,X,Z,J=!0)=>{if(Z.propagating)return _Z($)||b4($);return Z.propagating=!0,I3(Z,X)===J?_Z($):b4($)},I3=({fileDescriptors:$},X)=>X!=="all"&&$[X].direction==="input",b4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",_Z=($)=>$?.code==="EPIPE";var RZ=({subprocess:$,encoding:X,buffer:Z,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,B)=>w3({stream:H,fdNumber:B,encoding:X,buffer:Z[B],maxBuffer:J[B],lines:q[B],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),w3=async({stream:$,fdNumber:X,encoding:Z,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:B})=>{if(!$)return;let K=P$($,X,B);if(I3(B,X)){await K;return}let[U]=await Promise.all([VZ({stream:$,onStreamEnd:K,fdNumber:X,encoding:Z,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:B}),K]);return U};var TZ=({stdout:$,stderr:X},{all:Z})=>Z&&($||X)?I1([$,X].filter(Boolean)):void 0,FZ=({subprocess:$,encoding:X,buffer:Z,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>w3({...CK($,Z),fdNumber:"all",encoding:X,maxBuffer:J[1]+J[2],lines:q[1]||q[2],allMixed:jK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),CK=({stdout:$,stderr:X,all:Z},[,J,q])=>{let Y=J||q;if(!Y)return{stream:Z,buffer:Y};if(!J)return{stream:X,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:Z,buffer:Y}},jK=({all:$,stdout:X,stderr:Z})=>$&&X&&Z&&X.readableObjectMode!==Z.readableObjectMode;import{once as xK}from"node:events";var MZ=($)=>p1($,"ipc"),PZ=($,X)=>{let Z=m$($);p0({type:"ipc",verboseMessage:Z,fdNumber:"ipc",verboseInfo:X})};var CZ=async({subprocess:$,buffer:X,maxBuffer:Z,ipc:J,ipcOutput:q,verboseInfo:Y})=>{if(!J)return q;let Q=MZ(Y),G=X1(X,"ipc"),H=X1(Z,"ipc");for await(let B of U3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(G)C5($,q,H),q.push(B);if(Q)PZ(B,Y)}return q},jZ=async($,X)=>{return await Promise.allSettled([$]),X};var xZ=async({subprocess:$,options:{encoding:X,buffer:Z,maxBuffer:J,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:B,ipc:K,ipcInput:U},context:W,verboseInfo:_,fileDescriptors:R,originalStreams:L,onInternalError:I,controller:j})=>{let N=wX($,W),u={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:N,propagating:!1},x=RZ({subprocess:$,encoding:X,buffer:Z,maxBuffer:J,lines:q,stripFinalNewline:B,verboseInfo:_,streamInfo:u}),n=FZ({subprocess:$,encoding:X,buffer:Z,maxBuffer:J,lines:q,stripFinalNewline:B,verboseInfo:_,streamInfo:u}),i=[],t=CZ({subprocess:$,buffer:Z,maxBuffer:J,ipc:K,ipcOutput:i,verboseInfo:_}),F0=IK(L,$,u),l=wK(R,u);try{return await Promise.race([Promise.all([{},EX(N),Promise.all(x),n,t,e8($,U),...F0,...l]),I,OK($,j),...t8($,Y,W,j),...L8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:j}),...n8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:j})])}catch(r0){return W.terminationReason??="other",Promise.all([{error:r0},N,Promise.all(x.map((E)=>x3(E))),x3(n),jZ(t,i),Promise.allSettled(F0),Promise.allSettled(l)])}},IK=($,X,Z)=>$.map((J,q)=>J===X.stdio[q]?void 0:P$(J,q,Z)),wK=($,X)=>$.flatMap(({stdioItems:Z},J)=>Z.filter(({value:q,stream:Y=q})=>g0(Y,{checkOpen:!1})&&!b0(Y)).map(({type:q,value:Y,stream:Q=Y})=>P$(Q,J,X,{isSameDirection:N0.has(q),stopOnExit:q==="native"}))),OK=async($,{signal:X})=>{let[Z]=await xK($,"error",{signal:X});throw Z};var IZ=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),C$=($,X,Z)=>{let J=$[Z];if(!J.has(X))J.set(X,[]);let q=J.get(X),Y=l0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},X$=async({resolve:$,promises:X},Z)=>{$();let[J]=await Promise.race([Promise.allSettled([!0,Z]),Promise.all([!1,...X])]);return!J};import{Readable as EK}from"node:stream";import{callbackify as AK}from"node:util";import{finished as wZ}from"node:stream/promises";var O3=async($)=>{if($===void 0)return;try{await E3($)}catch{}},OZ=async($)=>{if($===void 0)return;try{await A3($)}catch{}},E3=async($)=>{await wZ($,{cleanup:!0,readable:!1,writable:!0})},A3=async($)=>{await wZ($,{cleanup:!0,readable:!0,writable:!1})},y4=async($,X)=>{if(await $,X)throw X},g4=($,X,Z)=>{if(Z&&!b4(Z))$.destroy(Z);else if(X)$.destroy()};var EZ=({subprocess:$,concurrentStreams:X,encoding:Z},{from:J,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||x0.has(Z),{subprocessStdout:G,waitReadableDestroy:H}=h3($,J,X),{readableEncoding:B,readableObjectMode:K,readableHighWaterMark:U}=N3(G,Q),{read:W,onStdoutDataDone:_}=D3({subprocessStdout:G,subprocess:$,binary:Q,encoding:Z,preserveNewlines:Y}),R=new EK({read:W,destroy:AK(v3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:U,objectMode:K,encoding:B});return S3({subprocessStdout:G,onStdoutDataDone:_,readable:R,subprocess:$}),R},h3=($,X,Z)=>{let J=t1($,X),q=C$(Z,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:q}},N3=({readableEncoding:$,readableObjectMode:X,readableHighWaterMark:Z},J)=>J?{readableEncoding:$,readableObjectMode:X,readableHighWaterMark:Z}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:j3},D3=({subprocessStdout:$,subprocess:X,binary:Z,encoding:J,preserveNewlines:q})=>{let Y=l0(),Q=k4({subprocessStdout:$,subprocess:X,binary:Z,shouldEncode:!Z,encoding:J,preserveNewlines:q});return{read(){hK(this,Q,Y)},onStdoutDataDone:Y}},hK=async($,X,Z)=>{try{let{value:J,done:q}=await X.next();if(q)Z.resolve();else $.push(J)}catch{}},S3=async({subprocessStdout:$,onStdoutDataDone:X,readable:Z,subprocess:J,subprocessStdin:q})=>{try{if(await A3($),await J,await O3(q),await X,Z.readable)Z.push(null)}catch(Y){await O3(q),AZ(Z,Y)}},v3=async({subprocessStdout:$,subprocess:X,waitReadableDestroy:Z},J)=>{if(await X$(Z,X))AZ($,J),await y4(X,J)},AZ=($,X)=>{g4($,$.readable,X)};import{Writable as NK}from"node:stream";import{callbackify as hZ}from"node:util";var NZ=({subprocess:$,concurrentStreams:X},{to:Z}={})=>{let{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}=f3($,Z,X),Q=new NK({...k3(J,$,q),destroy:hZ(y3.bind(void 0,{subprocessStdin:J,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return b3(J,Q),Q},f3=($,X,Z)=>{let J=$4($,X),q=C$(Z,J,"writableFinal"),Y=C$(Z,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}},k3=($,X,Z)=>({write:DK.bind(void 0,$),final:hZ(SK.bind(void 0,$,X,Z))}),DK=($,X,Z,J)=>{if($.write(X,Z))J();else $.once("drain",J)},SK=async($,X,Z)=>{if(await X$(Z,X)){if($.writable)$.end();await X}},b3=async($,X,Z)=>{try{if(await E3($),X.writable)X.end()}catch(J){await OZ(Z),DZ(X,J)}},y3=async({subprocessStdin:$,subprocess:X,waitWritableFinal:Z,waitWritableDestroy:J},q)=>{if(await X$(Z,X),await X$(J,X))DZ($,q),await y4(X,q)},DZ=($,X)=>{g4($,$.writable,X)};import{Duplex as vK}from"node:stream";import{callbackify as fK}from"node:util";var SZ=({subprocess:$,concurrentStreams:X,encoding:Z},{from:J,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||x0.has(Z),{subprocessStdout:H,waitReadableDestroy:B}=h3($,J,X),{subprocessStdin:K,waitWritableFinal:U,waitWritableDestroy:W}=f3($,q,X),{readableEncoding:_,readableObjectMode:R,readableHighWaterMark:L}=N3(H,G),{read:I,onStdoutDataDone:j}=D3({subprocessStdout:H,subprocess:$,binary:G,encoding:Z,preserveNewlines:Q}),N=new vK({read:I,...k3(K,$,U),destroy:fK(kK.bind(void 0,{subprocessStdout:H,subprocessStdin:K,subprocess:$,waitReadableDestroy:B,waitWritableFinal:U,waitWritableDestroy:W})),readableHighWaterMark:L,writableHighWaterMark:K.writableHighWaterMark,readableObjectMode:R,writableObjectMode:K.writableObjectMode,encoding:_});return S3({subprocessStdout:H,onStdoutDataDone:j,readable:N,subprocess:$,subprocessStdin:K}),b3(K,N,H),N},kK=async({subprocessStdout:$,subprocessStdin:X,subprocess:Z,waitReadableDestroy:J,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([v3({subprocessStdout:$,subprocess:Z,waitReadableDestroy:J},Q),y3({subprocessStdin:X,subprocess:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var g3=($,X,{from:Z,binary:J=!1,preserveNewlines:q=!1}={})=>{let Y=J||x0.has(X),Q=t1($,Z),G=k4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:X,preserveNewlines:q});return bK(G,Q,$)},bK=async function*($,X,Z){try{yield*$}finally{if(X.readable)X.destroy();await Z}};var vZ=($,{encoding:X})=>{let Z=IZ();$.readable=EZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:X}),$.writable=NZ.bind(void 0,{subprocess:$,concurrentStreams:Z}),$.duplex=SZ.bind(void 0,{subprocess:$,concurrentStreams:Z,encoding:X}),$.iterable=g3.bind(void 0,$,X),$[Symbol.asyncIterator]=g3.bind(void 0,$,X,{})};var fZ=($,X)=>{for(let[Z,J]of gK){let q=J.value.bind(X);Reflect.defineProperty($,Z,{...J,value:q})}},yK=(async()=>{})().constructor.prototype,gK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(yK,$)]);var kZ=($,X,Z,J)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:B,options:K,fileDescriptors:U}=uK($,X,Z),{subprocess:W,promise:_}=dK({file:q,commandArguments:Y,options:K,startTime:H,verboseInfo:B,command:Q,escapedCommand:G,fileDescriptors:U});return W.pipe=f4.bind(void 0,{source:W,sourcePromise:_,boundOptions:{},createNested:J}),fZ(W,_),n0.set(W,{options:K,fileDescriptors:U}),W},uK=($,X,Z)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=u$($,X,Z),{file:G,commandArguments:H,options:B}=B4($,X,Z),K=pK(B),U=pX(K,Q);return{file:G,commandArguments:H,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:K,fileDescriptors:U}},pK=({timeout:$,signal:X,...Z})=>{if(X!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...Z,timeoutDuration:$}},dK=({file:$,commandArguments:X,options:Z,startTime:J,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=cK(...U4($,X,Z))}catch(R){return gX({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:Z,startTime:J,verboseInfo:q})}let B=new AbortController;mK(Number.POSITIVE_INFINITY,B.signal);let K=[...H.stdio];eX(H,G,B),QZ(H,Z,B);let U={},W=l0();H.kill=W8.bind(void 0,{kill:H.kill.bind(H),options:Z,onInternalError:W,context:U,controller:B}),H.all=TZ(H,Z),vZ(H,Z),kX(H,Z);let _=lK({subprocess:H,options:Z,startTime:J,verboseInfo:q,fileDescriptors:G,originalStreams:K,command:Y,escapedCommand:Q,context:U,onInternalError:W,controller:B});return{subprocess:H,promise:_}},lK=async({subprocess:$,options:X,startTime:Z,verboseInfo:J,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:B,controller:K})=>{let[U,[W,_],R,L,I]=await xZ({subprocess:$,options:X,context:H,verboseInfo:J,fileDescriptors:q,originalStreams:Y,onInternalError:B,controller:K});K.abort(),B.resolve();let j=R.map((x,n)=>Q1(x,X,n)),N=Q1(L,X,"all"),u=nK({errorInfo:U,exitCode:W,signal:_,stdio:j,all:N,ipcOutput:I,context:H,options:X,command:Q,escapedCommand:G,startTime:Z});return s1(u,J,X)},nK=({errorInfo:$,exitCode:X,signal:Z,stdio:J,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:B,startTime:K})=>("error"in $)?_$({error:$.error,command:H,escapedCommand:B,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof Z1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:X,signal:Z,stdio:J,all:q,ipcOutput:Y,options:G,startTime:K,isSync:!1}):P4({command:H,escapedCommand:B,stdio:J,all:q,ipcOutput:Y,options:G,startTime:K});var m4=($,X)=>{let Z=Object.fromEntries(Object.entries(X).map(([J,q])=>[J,iK(J,$[J],q)]));return{...$,...Z}},iK=($,X,Z)=>{if(tK.has($)&&Y0(X)&&Y0(Z))return{...X,...Z};return Z},tK=new Set(["env",...T2]);var K1=($,X,Z,J)=>{let q=(Q,G,H)=>K1(Q,G,Z,H),Y=(...Q)=>oK({mapArguments:$,deepOptions:Z,boundOptions:X,setBoundExeca:J,createNested:q},...Q);if(J!==void 0)J(Y,q,X);return Y},oK=({mapArguments:$,deepOptions:X={},boundOptions:Z={},setBoundExeca:J,createNested:q},Y,...Q)=>{if(Y0(Y))return q($,m4(Z,Y),J);let{file:G,commandArguments:H,options:B,isSync:K}=aK({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:X,boundOptions:Z});return K?hX(G,H,B):kZ(G,H,B,q)},aK=({mapArguments:$,firstArgument:X,nextArguments:Z,deepOptions:J,boundOptions:q})=>{let Y=p6(X)?d6(X,Z):[X,...Z],[Q,G,H]=N$(...Y),B=m4(m4(J,q),H),{file:K=Q,commandArguments:U=G,options:W=B,isSync:_=!1}=$({file:Q,commandArguments:G,options:B});return{file:K,commandArguments:U,options:W,isSync:_}};var bZ=({file:$,commandArguments:X})=>gZ($,X),yZ=({file:$,commandArguments:X})=>({...gZ($,X),isSync:!0}),gZ=($,X)=>{if(X.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${X}.`);let[Z,...J]=rK($);return{file:Z,commandArguments:J}},rK=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let X=$.trim();if(X==="")return[];let Z=[];for(let J of X.split(sK)){let q=Z.at(-1);if(q&&q.endsWith("\\"))Z[Z.length-1]=`${q.slice(0,-1)} ${J}`;else Z.push(J)}return Z},sK=/ +/g;var mZ=($,X,Z)=>{$.sync=X(eK,Z),$.s=$.sync},cZ=({options:$})=>uZ($),eK=({options:$})=>({...uZ($),isSync:!0}),uZ=($)=>({options:{...$B($),...$}}),$B=({input:$,inputFile:X,stdio:Z})=>$===void 0&&X===void 0&&Z===void 0?{stdin:"inherit"}:{},pZ={preferLocal:!0};var C0=K1(()=>({})),mj=K1(()=>({isSync:!0})),cj=K1(bZ),uj=K1(yZ),pj=K1(a8),dj=K1(cZ,{},pZ,mZ),{sendMessage:lj,getOneMessage:nj,getEachMessage:ij,getCancelSignal:tj}=bX();import{stripVTControlCharacters as s3}from"node:util";var T0=e0(c3(),1),JJ=e0(p4(),1);import{stdin as XJ,stdout as ZJ}from"node:process";import*as B1 from"node:readline";import iZ from"node:readline";import{Writable as YB}from"node:stream";function GB({onlyFirst:$=!1}={}){let X=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(X,$?void 0:"g")}var HB=GB();function QJ($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(HB,"")}function qJ($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var YJ={exports:{}};(function($){var X={};$.exports=X,X.eastAsianWidth=function(J){var q=J.charCodeAt(0),Y=J.length==2?J.charCodeAt(1):0,Q=q;return 55296<=q&&q<=56319&&56320<=Y&&Y<=57343&&(q&=1023,Y&=1023,Q=q<<10|Y,Q+=65536),Q==12288||65281<=Q&&Q<=65376||65504<=Q&&Q<=65510?"F":Q==8361||65377<=Q&&Q<=65470||65474<=Q&&Q<=65479||65482<=Q&&Q<=65487||65490<=Q&&Q<=65495||65498<=Q&&Q<=65500||65512<=Q&&Q<=65518?"H":4352<=Q&&Q<=4447||4515<=Q&&Q<=4519||4602<=Q&&Q<=4607||9001<=Q&&Q<=9002||11904<=Q&&Q<=11929||11931<=Q&&Q<=12019||12032<=Q&&Q<=12245||12272<=Q&&Q<=12283||12289<=Q&&Q<=12350||12353<=Q&&Q<=12438||12441<=Q&&Q<=12543||12549<=Q&&Q<=12589||12593<=Q&&Q<=12686||12688<=Q&&Q<=12730||12736<=Q&&Q<=12771||12784<=Q&&Q<=12830||12832<=Q&&Q<=12871||12880<=Q&&Q<=13054||13056<=Q&&Q<=19903||19968<=Q&&Q<=42124||42128<=Q&&Q<=42182||43360<=Q&&Q<=43388||44032<=Q&&Q<=55203||55216<=Q&&Q<=55238||55243<=Q&&Q<=55291||63744<=Q&&Q<=64255||65040<=Q&&Q<=65049||65072<=Q&&Q<=65106||65108<=Q&&Q<=65126||65128<=Q&&Q<=65131||110592<=Q&&Q<=110593||127488<=Q&&Q<=127490||127504<=Q&&Q<=127546||127552<=Q&&Q<=127560||127568<=Q&&Q<=127569||131072<=Q&&Q<=194367||177984<=Q&&Q<=196605||196608<=Q&&Q<=262141?"W":32<=Q&&Q<=126||162<=Q&&Q<=163||165<=Q&&Q<=166||Q==172||Q==175||10214<=Q&&Q<=10221||10629<=Q&&Q<=10630?"Na":Q==161||Q==164||167<=Q&&Q<=168||Q==170||173<=Q&&Q<=174||176<=Q&&Q<=180||182<=Q&&Q<=186||188<=Q&&Q<=191||Q==198||Q==208||215<=Q&&Q<=216||222<=Q&&Q<=225||Q==230||232<=Q&&Q<=234||236<=Q&&Q<=237||Q==240||242<=Q&&Q<=243||247<=Q&&Q<=250||Q==252||Q==254||Q==257||Q==273||Q==275||Q==283||294<=Q&&Q<=295||Q==299||305<=Q&&Q<=307||Q==312||319<=Q&&Q<=322||Q==324||328<=Q&&Q<=331||Q==333||338<=Q&&Q<=339||358<=Q&&Q<=359||Q==363||Q==462||Q==464||Q==466||Q==468||Q==470||Q==472||Q==474||Q==476||Q==593||Q==609||Q==708||Q==711||713<=Q&&Q<=715||Q==717||Q==720||728<=Q&&Q<=731||Q==733||Q==735||768<=Q&&Q<=879||913<=Q&&Q<=929||931<=Q&&Q<=937||945<=Q&&Q<=961||963<=Q&&Q<=969||Q==1025||1040<=Q&&Q<=1103||Q==1105||Q==8208||8211<=Q&&Q<=8214||8216<=Q&&Q<=8217||8220<=Q&&Q<=8221||8224<=Q&&Q<=8226||8228<=Q&&Q<=8231||Q==8240||8242<=Q&&Q<=8243||Q==8245||Q==8251||Q==8254||Q==8308||Q==8319||8321<=Q&&Q<=8324||Q==8364||Q==8451||Q==8453||Q==8457||Q==8467||Q==8470||8481<=Q&&Q<=8482||Q==8486||Q==8491||8531<=Q&&Q<=8532||8539<=Q&&Q<=8542||8544<=Q&&Q<=8555||8560<=Q&&Q<=8569||Q==8585||8592<=Q&&Q<=8601||8632<=Q&&Q<=8633||Q==8658||Q==8660||Q==8679||Q==8704||8706<=Q&&Q<=8707||8711<=Q&&Q<=8712||Q==8715||Q==8719||Q==8721||Q==8725||Q==8730||8733<=Q&&Q<=8736||Q==8739||Q==8741||8743<=Q&&Q<=8748||Q==8750||8756<=Q&&Q<=8759||8764<=Q&&Q<=8765||Q==8776||Q==8780||Q==8786||8800<=Q&&Q<=8801||8804<=Q&&Q<=8807||8810<=Q&&Q<=8811||8814<=Q&&Q<=8815||8834<=Q&&Q<=8835||8838<=Q&&Q<=8839||Q==8853||Q==8857||Q==8869||Q==8895||Q==8978||9312<=Q&&Q<=9449||9451<=Q&&Q<=9547||9552<=Q&&Q<=9587||9600<=Q&&Q<=9615||9618<=Q&&Q<=9621||9632<=Q&&Q<=9633||9635<=Q&&Q<=9641||9650<=Q&&Q<=9651||9654<=Q&&Q<=9655||9660<=Q&&Q<=9661||9664<=Q&&Q<=9665||9670<=Q&&Q<=9672||Q==9675||9678<=Q&&Q<=9681||9698<=Q&&Q<=9701||Q==9711||9733<=Q&&Q<=9734||Q==9737||9742<=Q&&Q<=9743||9748<=Q&&Q<=9749||Q==9756||Q==9758||Q==9792||Q==9794||9824<=Q&&Q<=9825||9827<=Q&&Q<=9829||9831<=Q&&Q<=9834||9836<=Q&&Q<=9837||Q==9839||9886<=Q&&Q<=9887||9918<=Q&&Q<=9919||9924<=Q&&Q<=9933||9935<=Q&&Q<=9953||Q==9955||9960<=Q&&Q<=9983||Q==10045||Q==10071||10102<=Q&&Q<=10111||11093<=Q&&Q<=11097||12872<=Q&&Q<=12879||57344<=Q&&Q<=63743||65024<=Q&&Q<=65039||Q==65533||127232<=Q&&Q<=127242||127248<=Q&&Q<=127277||127280<=Q&&Q<=127337||127344<=Q&&Q<=127386||917760<=Q&&Q<=917999||983040<=Q&&Q<=1048573||1048576<=Q&&Q<=1114109?"A":"N"},X.characterLength=function(J){var q=this.eastAsianWidth(J);return q=="F"||q=="W"||q=="A"?2:1};function Z(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}X.length=function(J){for(var q=Z(J),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},X.slice=function(J,q,Y){textLen=X.length(J),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=Z(J),B=0;B<H.length;B++){var K=H[B],U=X.length(K);if(G>=q-(U==2?1:0))if(G+U<=Y)Q+=K;else break;G+=U}return Q}})(YJ);var zB=YJ.exports,KB=qJ(zB),BB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},UB=qJ(BB);function j$($,X={}){if(typeof $!="string"||$.length===0||(X={ambiguousIsNarrow:!0,...X},$=QJ($),$.length===0))return 0;$=$.replace(UB()," ");let Z=X.ambiguousIsNarrow?1:2,J=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(KB.eastAsianWidth(q)){case"F":case"W":J+=2;break;case"A":J+=Z;break;default:J+=1}}return J}var p3=10,tZ=($=0)=>(X)=>`\x1B[${X+$}m`,oZ=($=0)=>(X)=>`\x1B[${38+$};5;${X}m`,aZ=($=0)=>(X,Z,J)=>`\x1B[${38+$};2;${X};${Z};${J}m`,J0={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]}};Object.keys(J0.modifier);var WB=Object.keys(J0.color),VB=Object.keys(J0.bgColor);[...WB,...VB];function LB(){let $=new Map;for(let[X,Z]of Object.entries(J0)){for(let[J,q]of Object.entries(Z))J0[J]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},Z[J]=J0[J],$.set(q[0],q[1]);Object.defineProperty(J0,X,{value:Z,enumerable:!1})}return Object.defineProperty(J0,"codes",{value:$,enumerable:!1}),J0.color.close="\x1B[39m",J0.bgColor.close="\x1B[49m",J0.color.ansi=tZ(),J0.color.ansi256=oZ(),J0.color.ansi16m=aZ(),J0.bgColor.ansi=tZ(p3),J0.bgColor.ansi256=oZ(p3),J0.bgColor.ansi16m=aZ(p3),Object.defineProperties(J0,{rgbToAnsi256:{value:(X,Z,J)=>X===Z&&Z===J?X<8?16:X>248?231:Math.round((X-8)/247*24)+232:16+36*Math.round(X/255*5)+6*Math.round(Z/255*5)+Math.round(J/255*5),enumerable:!1},hexToRgb:{value:(X)=>{let Z=/[a-f\d]{6}|[a-f\d]{3}/i.exec(X.toString(16));if(!Z)return[0,0,0];let[J]=Z;J.length===3&&(J=[...J].map((Y)=>Y+Y).join(""));let q=Number.parseInt(J,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(X)=>J0.rgbToAnsi256(...J0.hexToRgb(X)),enumerable:!1},ansi256ToAnsi:{value:(X)=>{if(X<8)return 30+X;if(X<16)return 90+(X-8);let Z,J,q;if(X>=232)Z=((X-232)*10+8)/255,J=Z,q=Z;else{X-=16;let G=X%36;Z=Math.floor(X/36)/5,J=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(Z,J,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(J)<<1|Math.round(Z));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(X,Z,J)=>J0.ansi256ToAnsi(J0.rgbToAnsi256(X,Z,J)),enumerable:!1},hexToAnsi:{value:(X)=>J0.ansi256ToAnsi(J0.hexToAnsi256(X)),enumerable:!1}}),J0}var _B=LB(),n4=new Set(["\x1B","›"]),RB=39,n3="\x07",GJ="[",TB="]",HJ="m",i3=`${TB}8;;`,rZ=($)=>`${n4.values().next().value}${GJ}${$}${HJ}`,sZ=($)=>`${n4.values().next().value}${i3}${$}${n3}`,FB=($)=>$.split(" ").map((X)=>j$(X)),d3=($,X,Z)=>{let J=[...X],q=!1,Y=!1,Q=j$(QJ($[$.length-1]));for(let[G,H]of J.entries()){let B=j$(H);if(Q+B<=Z?$[$.length-1]+=H:($.push(H),Q=0),n4.has(H)&&(q=!0,Y=J.slice(G+1).join("").startsWith(i3)),q){Y?H===n3&&(q=!1,Y=!1):H===HJ&&(q=!1);continue}Q+=B,Q===Z&&G<J.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},MB=($)=>{let X=$.split(" "),Z=X.length;for(;Z>0&&!(j$(X[Z-1])>0);)Z--;return Z===X.length?$:X.slice(0,Z).join(" ")+X.slice(Z).join("")},PB=($,X,Z={})=>{if(Z.trim!==!1&&$.trim()==="")return"";let J="",q,Y,Q=FB($),G=[""];for(let[B,K]of $.split(" ").entries()){Z.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let U=j$(G[G.length-1]);if(B!==0&&(U>=X&&(Z.wordWrap===!1||Z.trim===!1)&&(G.push(""),U=0),(U>0||Z.trim===!1)&&(G[G.length-1]+=" ",U++)),Z.hard&&Q[B]>X){let W=X-U,_=1+Math.floor((Q[B]-W-1)/X);Math.floor((Q[B]-1)/X)<_&&G.push(""),d3(G,K,X);continue}if(U+Q[B]>X&&U>0&&Q[B]>0){if(Z.wordWrap===!1&&U<X){d3(G,K,X);continue}G.push("")}if(U+Q[B]>X&&Z.wordWrap===!1){d3(G,K,X);continue}G[G.length-1]+=K}Z.trim!==!1&&(G=G.map((B)=>MB(B)));let H=[...G.join(`
45
- `)];for(let[B,K]of H.entries()){if(J+=K,n4.has(K)){let{groups:W}=new RegExp(`(?:\\${GJ}(?<code>\\d+)m|\\${i3}(?<uri>.*)${n3})`).exec(H.slice(B).join(""))||{groups:{}};if(W.code!==void 0){let _=Number.parseFloat(W.code);q=_===RB?void 0:_}else W.uri!==void 0&&(Y=W.uri.length===0?void 0:W.uri)}let U=_B.codes.get(Number(q));H[B+1]===`
46
- `?(Y&&(J+=sZ("")),q&&U&&(J+=rZ(U))):K===`
47
- `&&(q&&U&&(J+=rZ(q)),Y&&(J+=sZ(Y)))}return J};function eZ($,X,Z){return String($).normalize().replace(/\r\n/g,`
44
+ if (condition) { yield value; }`)};import{Buffer as xH}from"node:buffer";import{StringDecoder as jH}from"node:string_decoder";var E4=($,Z,X)=>{if(X)return;if($)return{transform:IH.bind(void 0,new TextEncoder)};let J=new jH(Z);return{transform:wH.bind(void 0,J),final:OH.bind(void 0,J)}},IH=function*($,Z){if(xH.isBuffer(Z))yield Z1(Z);else if(typeof Z==="string")yield $.encode(Z);else yield Z},wH=function*($,Z){yield L0(Z)?$.write(Z):Z},OH=function*($){let Z=$.end();if(Z!=="")yield Z};import{callbackify as TZ}from"node:util";var z3=TZ(async($,Z,X,J)=>{Z.currentIterable=$(...X);try{for await(let q of Z.currentIterable)J.push(q)}finally{delete Z.currentIterable}}),A4=async function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=AH}=Z[X];for await(let q of J($))yield*A4(q,Z,X+1)},FZ=async function*($){for(let[Z,{final:X}]of Object.entries($))yield*EH(X,Number(Z),$)},EH=async function*($,Z,X){if($===void 0)return;for await(let J of $())yield*A4(J,X,Z+1)},MZ=TZ(async({currentIterable:$},Z)=>{if($!==void 0){await(Z?$.throw(Z):$.return());return}if(Z)throw Z}),AH=function*($){yield $};var K3=($,Z,X,J)=>{try{for(let q of $(...Z))X.push(q);J()}catch(q){J(q)}},CZ=($,Z)=>[...Z.flatMap((X)=>[...j1(X,$,0)]),...T$($)],j1=function*($,Z,X){if(X===Z.length){yield $;return}let{transform:J=NH}=Z[X];for(let q of J($))yield*j1(q,Z,X+1)},T$=function*($){for(let[Z,{final:X}]of Object.entries($))yield*hH(X,Number(Z),$)},hH=function*($,Z,X){if($===void 0)return;for(let J of $())yield*j1(J,X,Z+1)},NH=function*($){yield $};var B3=({value:$,value:{transform:Z,final:X,writableObjectMode:J,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=xZ($,Q,Y),K=x1(Z),W=x1(X),U=K?z3.bind(void 0,A4,G):K3.bind(void 0,j1),B=K||W?z3.bind(void 0,FZ,G):K3.bind(void 0,T$),R=K||W?MZ.bind(void 0,G):void 0;return{stream:new DH({writableObjectMode:J,writableHighWaterMark:PZ(J),readableObjectMode:q,readableHighWaterMark:PZ(q),transform(L,j,C){U([L,H,0],this,C)},flush(L){B([H],this,L)},destroy:R})}},h4=($,Z,X,J)=>{let q=Z.filter(({type:Q})=>Q==="generator"),Y=J?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=xZ(Q,X,G);$=CZ(H,$)}return $},xZ=({transform:$,final:Z,binary:X,writableObjectMode:J,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:LZ(J,G)},E4(X,Q,J),O4(X,Y,J,H),{transform:$,final:Z},{transform:_Z(q,G)},VZ({binary:X,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var jZ=($,Z)=>{for(let X of SH($))vH($,X,Z)},SH=($)=>new Set(Object.entries($).filter(([,{direction:Z}])=>Z==="input").map(([Z])=>Number(Z))),vH=($,Z,X)=>{let{stdioItems:J}=$[Z],q=J.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(Z!==0){let[{type:G,optionName:H}]=q;throw TypeError(`Only the \`stdin\` option, not \`${H}\`, can be ${K1[G]} with synchronous methods.`)}let Q=q.map(({contents:G})=>G).map((G)=>fH(G,J));X.input=K$(Q)},fH=($,Z)=>{let X=h4($,Z,"utf8",!0);return kH(X),K$(X)},kH=($)=>{let Z=$.find((X)=>typeof X!=="string"&&!L0(X));if(Z!==void 0)throw TypeError(`The \`stdin\` option is invalid: when passing objects as input, a transform must be used to serialize them to strings or Uint8Arrays: ${Z}.`)};import{writeFileSync as uH,appendFileSync as mH}from"node:fs";var N4=({stdioItems:$,encoding:Z,verboseInfo:X,fdNumber:J})=>J!=="all"&&d1(X,J)&&!j0.has(Z)&&bH(J)&&($.some(({type:q,value:Y})=>q==="native"&&yH.has(Y))||$.every(({type:q})=>D0.has(q))),bH=($)=>$===1||$===2,yH=new Set(["pipe","overlapped"]),IZ=async($,Z,X,J)=>{for await(let q of $)if(!gH(Z))OZ(q,X,J)},wZ=($,Z,X)=>{for(let J of $)OZ(J,Z,X)},gH=($)=>$._readableState.pipes.length>0,OZ=($,Z,X)=>{let J=m$($);l0({type:"output",verboseMessage:J,fdNumber:Z,verboseInfo:X})};var EZ=({fileDescriptors:$,syncResult:{output:Z},options:X,isMaxBuffer:J,verboseInfo:q})=>{if(Z===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:Z.map((H,K)=>cH({result:H,fileDescriptors:$,fdNumber:K,state:Y,outputFiles:Q,isMaxBuffer:J,verboseInfo:q},X)),...Y}},cH=({result:$,fileDescriptors:Z,fdNumber:X,state:J,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:K,stripFinalNewline:W,maxBuffer:U})=>{if($===null)return;let B=A5($,Y,U),R=Z1(B),{stdioItems:_,objectMode:L}=Z[X],j=pH([R],_,H,J),{serializedResult:C,finalResult:N=C}=dH({chunks:j,objectMode:L,encoding:H,lines:K,stripFinalNewline:W,fdNumber:X});lH({serializedResult:C,fdNumber:X,state:J,verboseInfo:Q,encoding:H,stdioItems:_,objectMode:L});let c=G[X]?N:void 0;try{if(J.error===void 0)nH(C,_,q);return c}catch(I){return J.error=I,c}},pH=($,Z,X,J)=>{try{return h4($,Z,X,!1)}catch(q){return J.error=q,$}},dH=({chunks:$,objectMode:Z,encoding:X,lines:J,stripFinalNewline:q,fdNumber:Y})=>{if(Z)return{serializedResult:$};if(X==="buffer")return{serializedResult:K$($)};let Q=p6($,X);if(J[Y])return{serializedResult:Q,finalResult:H3(Q,!q[Y],Z)};return{serializedResult:Q}},lH=({serializedResult:$,fdNumber:Z,state:X,verboseInfo:J,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!N4({stdioItems:Y,encoding:q,verboseInfo:J,fdNumber:Z}))return;let G=H3($,!1,Q);try{wZ(G,Z,J)}catch(H){X.error??=H}},nH=($,Z,X)=>{for(let{path:J,append:q}of Z.filter(({type:Y})=>I4.has(Y))){let Y=typeof J==="string"?J:J.toString();if(q||X.has(Y))mH(J,$);else X.add(Y),uH(J,$)}};var AZ=([,$,Z],X)=>{if(!X.all)return;if($===void 0)return Z;if(Z===void 0)return $;if(Array.isArray($))return Array.isArray(Z)?[...$,...Z]:[...$,q1(Z,X,"all")];if(Array.isArray(Z))return[q1($,X,"all"),...Z];if(L0($)&&L0(Z))return R2([$,Z]);return`${$}${Z}`};import{once as U3}from"node:events";var hZ=async($,Z)=>{let[X,J]=await iH($);return Z.isForcefullyTerminated??=!1,[X,J]},iH=async($)=>{let[Z,X]=await Promise.allSettled([U3($,"spawn"),U3($,"exit")]);if(Z.status==="rejected")return[];return X.status==="rejected"?NZ($):X.value},NZ=async($)=>{try{return await U3($,"exit")}catch{return NZ($)}},DZ=async($)=>{let[Z,X]=await $;if(!tH(Z,X)&&W3(Z,X))throw new n0;return[Z,X]},tH=($,Z)=>$===void 0&&Z===void 0,W3=($,Z)=>$!==0||Z!==null;var SZ=({error:$,status:Z,signal:X,output:J},{maxBuffer:q})=>{let Y=oH($,Z,X),Q=Y?.code==="ETIMEDOUT",G=E5(Y,J,q);return{resultError:Y,exitCode:Z,signal:X,timedOut:Q,isMaxBuffer:G}},oH=($,Z,X)=>{if($!==void 0)return $;return W3(Z,X)?new n0:void 0};var vZ=($,Z,X)=>{let{file:J,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:K,fileDescriptors:W}=rH($,Z,X),U=$z({file:J,commandArguments:q,options:K,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:W,startTime:G});return e1(U,H,K)},rH=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),G=sH(X),{file:H,commandArguments:K,options:W}=U4($,Z,G);eH(W);let U=KZ(W,Q);return{file:H,commandArguments:K,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},sH=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,eH=({ipc:$,ipcInput:Z,detached:X,cancelSignal:J})=>{if(Z)D4("ipcInput");if($)D4("ipc: true");if(X)D4("detached: true");if(J)D4("cancelSignal")},D4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},$z=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=Zz({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:K,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R}=SZ(H,X),{output:_,error:L=K}=EZ({fileDescriptors:Q,syncResult:H,options:X,isMaxBuffer:R,verboseInfo:Y}),j=_.map((N,c)=>q1(N,X,c)),C=q1(AZ(_,X),X,"all");return Jz({error:L,exitCode:W,signal:U,timedOut:B,isMaxBuffer:R,stdio:j,all:C,options:X,command:J,escapedCommand:q,startTime:G})},Zz=({file:$,commandArguments:Z,options:X,command:J,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{jZ(Y,X);let G=Xz(X);return aH(...W4($,Z,G))}catch(G){return s1({error:G,command:J,escapedCommand:q,fileDescriptors:Y,options:X,startTime:Q,isSync:!0})}},Xz=({encoding:$,maxBuffer:Z,...X})=>({...X,encoding:"buffer",maxBuffer:C4(Z)}),Jz=({error:$,exitCode:Z,signal:X,timedOut:J,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:K,startTime:W})=>$===void 0?P4({command:H,escapedCommand:K,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W}):R$({error:$,command:H,escapedCommand:K,timedOut:J,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:Z,signal:X,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:W,isSync:!0});import{setMaxListeners as dK}from"node:events";import{spawn as lK}from"node:child_process";import gZ from"node:process";import{once as V3,on as Qz}from"node:events";var fZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0,filter:Y}={})=>{return i1({methodName:"getOneMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),qz({anyProcess:$,channel:Z,isSubprocess:X,filter:Y,reference:q})},qz=async({anyProcess:$,channel:Z,isSubprocess:X,filter:J,reference:q})=>{X4(Z,q);let Y=z1($,Z,X),Q=new AbortController;try{return await Promise.race([Yz(Y,J,Q),Gz(Y,X,Q),Hz(Y,X,Q)])}catch(G){throw t1($),G}finally{Q.abort(),J4(Z,q)}},Yz=async($,Z,{signal:X})=>{if(Z===void 0){let[J]=await V3($,"message",{signal:X});return J}for await(let[J]of Qz($,"message",{signal:X}))if(Z(J))return J},Gz=async($,Z,{signal:X})=>{await V3($,"disconnect",{signal:X}),M8(Z)},Hz=async($,Z,{signal:X})=>{let[J]=await V3($,"strict:error",{signal:X});throw e$(J,Z)};import{once as bZ,on as zz}from"node:events";var yZ=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J},{reference:q=!0}={})=>L3({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:!X,reference:q}),L3=({anyProcess:$,channel:Z,isSubprocess:X,ipc:J,shouldAwait:q,reference:Y})=>{i1({methodName:"getEachMessage",isSubprocess:X,ipc:J,isConnected:Y4($)}),X4(Z,Y);let Q=z1($,Z,X),G=new AbortController,H={};return Kz($,Q,G),Bz({ipcEmitter:Q,isSubprocess:X,controller:G,state:H}),Uz({anyProcess:$,channel:Z,ipcEmitter:Q,isSubprocess:X,shouldAwait:q,controller:G,state:H,reference:Y})},Kz=async($,Z,X)=>{try{await bZ(Z,"disconnect",{signal:X.signal}),X.abort()}catch{}},Bz=async({ipcEmitter:$,isSubprocess:Z,controller:X,state:J})=>{try{let[q]=await bZ($,"strict:error",{signal:X.signal});J.error=e$(q,Z),X.abort()}catch{}},Uz=async function*({anyProcess:$,channel:Z,ipcEmitter:X,isSubprocess:J,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of zz(X,"message",{signal:Y.signal}))kZ(Q),yield H}catch{kZ(Q)}finally{if(Y.abort(),J4(Z,G),!J)t1($);if(q)await $}},kZ=({error:$})=>{if($)throw $};var uZ=($,{ipc:Z})=>{Object.assign($,cZ($,!1,Z))},mZ=()=>{let $=gZ,Z=!0,X=gZ.channel!==void 0;return{...cZ($,!0,X),getCancelSignal:i8.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:X})}},cZ=($,Z,X)=>({sendMessage:K4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getOneMessage:fZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X}),getEachMessage:yZ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:Z,ipc:X})});import{ChildProcess as Wz}from"node:child_process";import{PassThrough as Vz,Readable as Lz,Writable as _z,Duplex as Rz}from"node:stream";var pZ=({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,verboseInfo:Q})=>{q3(J);let G=new Wz;Tz(G,J),Object.assign(G,{readable:Fz,writable:Mz,duplex:Cz});let H=s1({error:$,command:Z,escapedCommand:X,fileDescriptors:J,options:q,startTime:Y,isSync:!1}),K=Pz(H,Q,q);return{subprocess:G,promise:K}},Tz=($,Z)=>{let X=F$(),J=F$(),q=F$(),Y=Array.from({length:Z.length-3},F$),Q=F$(),G=[X,J,q,...Y];Object.assign($,{stdin:X,stdout:J,stderr:q,all:Q,stdio:G})},F$=()=>{let $=new Vz;return $.end(),$},Fz=()=>new Lz({read(){}}),Mz=()=>new _z({write(){}}),Cz=()=>new Rz({read(){},write(){}}),Pz=async($,Z,X)=>e1($,Z,X);import{createReadStream as dZ,createWriteStream as lZ}from"node:fs";import{Buffer as xz}from"node:buffer";import{Readable as M$,Writable as jz,Duplex as Iz}from"node:stream";var iZ=($,Z)=>w4(wz,$,Z,!1),C$=({type:$,optionName:Z})=>{throw TypeError(`The \`${Z}\` option cannot be ${K1[$]}.`)},nZ={fileNumber:C$,generator:B3,asyncGenerator:B3,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:Z,readableObjectMode:X}}){let J=Z||X;return{stream:Iz.fromWeb($,{objectMode:J})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},wz={input:{...nZ,fileUrl:({value:$})=>({stream:dZ($)}),filePath:({value:{file:$}})=>({stream:dZ($)}),webStream:({value:$})=>({stream:M$.fromWeb($)}),iterable:({value:$})=>({stream:M$.from($)}),asyncIterable:({value:$})=>({stream:M$.from($)}),string:({value:$})=>({stream:M$.from($)}),uint8Array:({value:$})=>({stream:M$.from(xz.from($))})},output:{...nZ,fileUrl:({value:$})=>({stream:lZ($)}),filePath:({value:{file:$,append:Z}})=>({stream:lZ($,Z?{flags:"a"}:{})}),webStream:({value:$})=>({stream:jz.fromWeb($)}),iterable:C$,asyncIterable:C$,string:C$,uint8Array:C$}};import{on as Oz,once as tZ}from"node:events";import{PassThrough as Ez,getDefaultHighWaterMark as Az}from"node:stream";import{finished as rZ}from"node:stream/promises";function I1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)_3(q);let Z=$.some(({readableObjectMode:q})=>q),X=hz($,Z),J=new sZ({objectMode:Z,writableHighWaterMark:X,readableHighWaterMark:X});for(let q of $)J.add(q);return J}var hz=($,Z)=>{if($.length===0)return Az(Z);let X=$.filter(({readableObjectMode:J})=>J===Z).map(({readableHighWaterMark:J})=>J);return Math.max(...X)};class sZ extends Ez{#Z=new Set([]);#X=new Set([]);#$=new Set([]);#J;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(_3($),this.#Z.has($))return;this.#Z.add($),this.#J??=Nz(this,this.#Z,this.#q);let Z=vz({passThroughStream:this,stream:$,streams:this.#Z,ended:this.#X,aborted:this.#$,onFinished:this.#J,unpipeEvent:this.#q});this.#Q.set($,Z),$.pipe(this,{end:!1})}async remove($){if(_3($),!this.#Z.has($))return!1;let Z=this.#Q.get($);if(Z===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await Z,!0}}var Nz=async($,Z,X)=>{S4($,oZ);let J=new AbortController;try{await Promise.race([Dz($,J),Sz($,Z,X,J)])}finally{J.abort(),S4($,-oZ)}},Dz=async($,{signal:Z})=>{try{await rZ($,{signal:Z,cleanup:!0})}catch(X){throw eZ($,X),X}},Sz=async($,Z,X,{signal:J})=>{for await(let[q]of Oz($,"unpipe",{signal:J}))if(Z.has(q))q.emit(X)},_3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},vz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,onFinished:Y,unpipeEvent:Q})=>{S4($,aZ);let G=new AbortController;try{await Promise.race([fz(Y,Z,G),kz({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:G}),bz({stream:Z,streams:X,ended:J,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),S4($,-aZ)}if(X.size>0&&X.size===J.size+q.size)if(J.size===0&&q.size>0)R3($);else yz($)},fz=async($,Z,{signal:X})=>{try{if(await $,!X.aborted)R3(Z)}catch(J){if(!X.aborted)eZ(Z,J)}},kz=async({passThroughStream:$,stream:Z,streams:X,ended:J,aborted:q,controller:{signal:Y}})=>{try{if(await rZ(Z,{signal:Y,cleanup:!0,readable:!0,writable:!1}),X.has(Z))J.add(Z)}catch(Q){if(Y.aborted||!X.has(Z))return;if($X(Q))q.add(Z);else ZX($,Q)}},bz=async({stream:$,streams:Z,ended:X,aborted:J,unpipeEvent:q,controller:{signal:Y}})=>{if(await tZ($,q,{signal:Y}),!$.readable)return tZ(Y,"abort",{signal:Y});Z.delete($),X.delete($),J.delete($)},yz=($)=>{if($.writable)$.end()},eZ=($,Z)=>{if($X(Z))R3($);else ZX($,Z)},$X=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",R3=($)=>{if($.readable||$.writable)$.destroy()},ZX=($,Z)=>{if(!$.destroyed)$.once("error",gz),$.destroy(Z)},gz=()=>{},S4=($,Z)=>{let X=$.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)$.setMaxListeners(X+Z)},oZ=2,aZ=1;import{finished as XX}from"node:stream/promises";var Z$=($,Z)=>{$.pipe(Z),uz($,Z),mz($,Z)},uz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX($,{cleanup:!0,readable:!0,writable:!1})}catch{}T3(Z)},T3=($)=>{if($.writable)$.end()},mz=async($,Z)=>{if(y0($)||y0(Z))return;try{await XX(Z,{cleanup:!0,readable:!1,writable:!0})}catch{}F3($)},F3=($)=>{if($.readable)$.destroy()};var JX=($,Z,X)=>{let J=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(Z)){for(let{stream:G}of Y.filter(({type:H})=>D0.has(H)))cz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!D0.has(H)))dz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:J,controller:X})}for(let[q,Y]of J.entries()){let Q=Y.length===1?Y[0]:I1(Y);Z$(Q,q)}},cz=($,Z,X,J)=>{if(X==="output")Z$($.stdio[J],Z);else Z$(Z,$.stdio[J]);let q=pz[J];if(q!==void 0)$[q]=Z;$.stdio[J]=Z},pz=["stdin","stdout","stderr"],dz=({subprocess:$,stream:Z,direction:X,fdNumber:J,pipeGroups:q,controller:Y})=>{if(Z===void 0)return;lz(Z,Y);let[Q,G]=X==="output"?[Z,$.stdio[J]]:[$.stdio[J],Z],H=q.get(Q)??[];q.set(Q,[...H,G])},lz=($,{signal:Z})=>{if(y0($))C1($,nz,Z)},nz=2;import{addAbortListener as oz}from"node:events";var w1=[];w1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")w1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")w1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var v4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",M3=Symbol.for("signal-exit emitter"),C3=globalThis,iz=Object.defineProperty.bind(Object);class QX{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(C3[M3])return C3[M3];iz(C3,M3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,Z){this.listeners[$].push(Z)}removeListener($,Z){let X=this.listeners[$],J=X.indexOf(Z);if(J===-1)return;if(J===0&&X.length===1)X.length=0;else X.splice(J,1)}emit($,Z,X){if(this.emitted[$])return!1;this.emitted[$]=!0;let J=!1;for(let q of this.listeners[$])J=q(Z,X)===!0||J;if($==="exit")J=this.emit("afterExit",Z,X)||J;return J}}class x3{}var tz=($)=>{return{onExit(Z,X){return $.onExit(Z,X)},load(){return $.load()},unload(){return $.unload()}}};class qX extends x3{onExit(){return()=>{}}load(){}unload(){}}class YX extends x3{#Z=P3.platform==="win32"?"SIGINT":"SIGHUP";#X=new QX;#$;#J;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let Z of w1)this.#Q[Z]=()=>{let X=this.#$.listeners(Z),{count:J}=this.#X,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")J+=q.__signal_exit_emitter__.count;if(X.length===J){this.unload();let Y=this.#X.emit("exit",null,Z),Q=Z==="SIGHUP"?this.#Z:Z;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#J=$.emit}onExit($,Z){if(!v4(this.#$))return()=>{};if(this.#Y===!1)this.load();let X=Z?.alwaysLast?"afterExit":"exit";return this.#X.on(X,$),()=>{if(this.#X.removeListener(X,$),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#X.count+=1;for(let $ of w1)try{let Z=this.#Q[$];if(Z)this.#$.on($,Z)}catch(Z){}this.#$.emit=($,...Z)=>{return this.#H($,...Z)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,w1.forEach(($)=>{let Z=this.#Q[$];if(!Z)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,Z)}catch(X){}}),this.#$.emit=this.#J,this.#$.reallyExit=this.#q,this.#X.count-=1}#G($){if(!v4(this.#$))return 0;return this.#$.exitCode=$||0,this.#X.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...Z){let X=this.#J;if($==="exit"&&v4(this.#$)){if(typeof Z[0]==="number")this.#$.exitCode=Z[0];let J=X.call(this.#$,$,...Z);return this.#X.emit("exit",this.#$.exitCode,null),J}else return X.call(this.#$,$,...Z)}}var P3=globalThis.process,{onExit:GX,load:eM,unload:$C}=tz(v4(P3)?new YX(P3):new qX);var HX=($,{cleanup:Z,detached:X},{signal:J})=>{if(!Z||X)return;let q=GX(()=>{$.kill()});oz(J,()=>{q()})};var KX=({source:$,sourcePromise:Z,boundOptions:X,createNested:J},...q)=>{let Y=c$(),{destination:Q,destinationStream:G,destinationError:H,from:K,unpipeSignal:W}=az(X,J,q),{sourceStream:U,sourceError:B}=sz($,K),{options:R,fileDescriptors:_}=t0.get($);return{sourcePromise:Z,sourceStream:U,sourceOptions:R,sourceError:B,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:W,fileDescriptors:_,startTime:Y}},az=($,Z,X)=>{try{let{destination:J,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=rz($,Z,...X),G=Z4(J,Y);return{destination:J,destinationStream:G,from:q,unpipeSignal:Q}}catch(J){return{destinationError:J}}},rz=($,Z,X,...J)=>{if(Array.isArray(X))return{destination:Z(zX,$)(X,...J),pipeOptions:$};if(typeof X==="string"||X instanceof URL||L2(X)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=D$(X,...J);return{destination:Z(zX)(q,Y,Q),pipeOptions:Q}}if(t0.has(X)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:J[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},zX=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),sz=($,Z)=>{try{return{sourceStream:o1($,Z)}}catch(X){return{sourceError:X}}};var UX=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=ez({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J});if(G!==void 0)throw j3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},ez=({sourceStream:$,sourceError:Z,destinationStream:X,destinationError:J})=>{if(Z!==void 0&&J!==void 0)return J;if(J!==void 0)return F3($),J;if(Z!==void 0)return T3(X),Z},j3=({error:$,fileDescriptors:Z,sourceOptions:X,startTime:J})=>s1({error:$,command:BX,escapedCommand:BX,fileDescriptors:Z,options:X,startTime:J,isSync:!1}),BX="source.pipe(destination)";var WX=async($)=>{let[{status:Z,reason:X,value:J=X},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(J))Q.pipedFrom.push(J);if(q==="rejected")throw Q;if(Z==="rejected")throw J;return Q};import{finished as $K}from"node:stream/promises";var VX=($,Z,X)=>{let J=f4.has(Z)?XK($,Z):ZK($,Z);return C1($,QK,X.signal),C1(Z,qK,X.signal),JK(Z),J},ZK=($,Z)=>{let X=I1([$]);return Z$(X,Z),f4.set(Z,X),X},XK=($,Z)=>{let X=f4.get(Z);return X.add($),X},JK=async($)=>{try{await $K($,{cleanup:!0,readable:!1,writable:!0})}catch{}f4.delete($)},f4=new WeakMap,QK=2,qK=1;import{aborted as YK}from"node:util";var LX=($,Z)=>$===void 0?[]:[GK($,Z)],GK=async($,{sourceStream:Z,mergedStream:X,fileDescriptors:J,sourceOptions:q,startTime:Y})=>{await YK($,Z),await X.remove(Z);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw j3({error:Q,fileDescriptors:J,sourceOptions:q,startTime:Y})};var k4=($,...Z)=>{if(Y0(Z[0]))return k4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...Z[0]}});let{destination:X,...J}=KX($,...Z),q=HK({...J,destination:X});return q.pipe=k4.bind(void 0,{...$,source:X,sourcePromise:q,boundOptions:{}}),q},HK=async({sourcePromise:$,sourceStream:Z,sourceOptions:X,sourceError:J,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:K})=>{let W=zK($,q);UX({sourceStream:Z,sourceError:J,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:X,startTime:K});let U=new AbortController;try{let B=VX(Z,Y,U);return await Promise.race([WX(W),...LX(G,{sourceStream:Z,mergedStream:B,sourceOptions:X,fileDescriptors:H,startTime:K})])}finally{U.abort()}},zK=($,Z)=>Promise.allSettled([$,Z]);import{setImmediate as _K}from"node:timers/promises";import{on as KK}from"node:events";import{getDefaultHighWaterMark as BK}from"node:stream";var b4=({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:J,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return UK(Z,Q),RX({stream:$,controller:Q,binary:X,shouldEncode:!$.readableObjectMode&&J,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},UK=async($,Z)=>{try{await $}catch{}finally{Z.abort()}},I3=({stream:$,onStreamEnd:Z,lines:X,encoding:J,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;WK(Z,Q,$);let G=$.readableObjectMode&&!Y;return RX({stream:$,controller:Q,binary:J==="buffer",shouldEncode:!G,encoding:J,shouldSplit:!G&&X,preserveNewlines:!q})},WK=async($,Z,X)=>{try{await $}catch{X.destroy()}finally{Z.abort()}},RX=({stream:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=KK($,"data",{signal:Z.signal,highWaterMark:_X,highWatermark:_X});return VK({onStdoutChunk:G,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q})},w3=BK(!0),_X=w3,VK=async function*({onStdoutChunk:$,controller:Z,binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=LK({binary:X,shouldEncode:J,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*j1(H,G,0)}catch(H){if(!Z.signal.aborted)throw H}finally{yield*T$(G)}},LK=({binary:$,shouldEncode:Z,encoding:X,shouldSplit:J,preserveNewlines:q})=>[E4($,X,!Z),O4($,q,!J,{})].filter(Boolean);var TX=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:K,streamInfo:W})=>{let U=RK({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:G,verboseInfo:K,streamInfo:W});if(!q){await Promise.all([TK($),U]);return}let B=Y3(H,X),R=I3({stream:$,onStreamEnd:Z,lines:Q,encoding:J,stripFinalNewline:B,allMixed:G}),[_]=await Promise.all([FK({stream:$,iterable:R,fdNumber:X,encoding:J,maxBuffer:Y,lines:Q}),U]);return _},RK=async({stream:$,onStreamEnd:Z,fdNumber:X,encoding:J,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!N4({stdioItems:Q[X]?.stdioItems,encoding:J,verboseInfo:Y,fdNumber:X}))return;let G=I3({stream:$,onStreamEnd:Z,lines:!0,encoding:J,stripFinalNewline:!0,allMixed:q});await IZ(G,$,X,Y)},TK=async($)=>{if(await _K(),$.readableFlowing===null)$.resume()},FK=async({stream:$,stream:{readableObjectMode:Z},iterable:X,fdNumber:J,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(Z||Q)return await R4(X,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await T4(X,{maxBuffer:Y}));return await M4(X,{maxBuffer:Y})}catch(G){return FX(I5({error:G,stream:$,readableObjectMode:Z,lines:Q,encoding:q,fdNumber:J}))}},O3=async($)=>{try{return await $}catch(Z){return FX(Z)}},FX=({bufferedData:$})=>m6($)?new Uint8Array($):$;import{finished as MK}from"node:stream/promises";var P$=async($,Z,X,{isSameDirection:J,stopOnExit:q=!1}={})=>{let Y=CK($,X),Q=new AbortController;try{await Promise.race([...q?[X.exitPromise]:[],MK($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)jK(G,Z,X,J)}finally{Q.abort()}},CK=($,{originalStreams:[Z],subprocess:X})=>{let J={stdinCleanedUp:!1};if($===Z)PK($,X,J);return J},PK=($,Z,X)=>{let{_destroy:J}=$;$._destroy=(...q)=>{xK(Z,X),J.call($,...q)}},xK=({exitCode:$,signalCode:Z},X)=>{if($!==null||Z!==null)X.stdinCleanedUp=!0},jK=($,Z,X,J)=>{if(!IK($,Z,X,J))throw $},IK=($,Z,X,J=!0)=>{if(X.propagating)return MX($)||y4($);return X.propagating=!0,E3(X,Z)===J?MX($):y4($)},E3=({fileDescriptors:$},Z)=>Z!=="all"&&$[Z].direction==="input",y4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",MX=($)=>$?.code==="EPIPE";var CX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,K)=>A3({stream:H,fdNumber:K,encoding:Z,buffer:X[K],maxBuffer:J[K],lines:q[K],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),A3=async({stream:$,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K})=>{if(!$)return;let W=P$($,Z,K);if(E3(K,Z)){await W;return}let[U]=await Promise.all([TX({stream:$,onStreamEnd:W,fdNumber:Z,encoding:X,buffer:J,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:K}),W]);return U};var PX=({stdout:$,stderr:Z},{all:X})=>X&&($||Z)?I1([$,Z].filter(Boolean)):void 0,xX=({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>A3({...wK($,X),fdNumber:"all",encoding:Z,maxBuffer:J[1]+J[2],lines:q[1]||q[2],allMixed:OK($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),wK=({stdout:$,stderr:Z,all:X},[,J,q])=>{let Y=J||q;if(!Y)return{stream:X,buffer:Y};if(!J)return{stream:Z,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:X,buffer:Y}},OK=({all:$,stdout:Z,stderr:X})=>$&&Z&&X&&Z.readableObjectMode!==X.readableObjectMode;import{once as EK}from"node:events";var jX=($)=>d1($,"ipc"),IX=($,Z)=>{let X=m$($);l0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:Z})};var wX=async({subprocess:$,buffer:Z,maxBuffer:X,ipc:J,ipcOutput:q,verboseInfo:Y})=>{if(!J)return q;let Q=jX(Y),G=X1(Z,"ipc"),H=X1(X,"ipc");for await(let K of L3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:J,shouldAwait:!1,reference:!0})){if(G)w5($,q,H),q.push(K);if(Q)IX(K,Y)}return q},OX=async($,Z)=>{return await Promise.allSettled([$]),Z};var EX=async({subprocess:$,options:{encoding:Z,buffer:X,maxBuffer:J,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:K,ipc:W,ipcInput:U},context:B,verboseInfo:R,fileDescriptors:_,originalStreams:L,onInternalError:j,controller:C})=>{let N=hZ($,B),c={originalStreams:L,fileDescriptors:_,subprocess:$,exitPromise:N,propagating:!1},I=CX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),n=xX({subprocess:$,encoding:Z,buffer:X,maxBuffer:J,lines:q,stripFinalNewline:K,verboseInfo:R,streamInfo:c}),i=[],a=wX({subprocess:$,buffer:X,maxBuffer:J,ipc:W,ipcOutput:i,verboseInfo:R}),K0=AK(L,$,c),l=hK(_,c);try{return await Promise.race([Promise.all([{},DZ(N),Promise.all(I),n,a,J5($,U),...K0,...l]),j,NK($,C),...s8($,Y,B,C),...F8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:B,controller:C}),...a8({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:B,controller:C})])}catch(x0){return B.terminationReason??="other",Promise.all([{error:x0},N,Promise.all(I.map((E)=>O3(E))),O3(n),OX(a,i),Promise.allSettled(K0),Promise.allSettled(l)])}},AK=($,Z,X)=>$.map((J,q)=>J===Z.stdio[q]?void 0:P$(J,q,X)),hK=($,Z)=>$.flatMap(({stdioItems:X},J)=>X.filter(({value:q,stream:Y=q})=>u0(Y,{checkOpen:!1})&&!y0(Y)).map(({type:q,value:Y,stream:Q=Y})=>P$(Q,J,Z,{isSameDirection:D0.has(q),stopOnExit:q==="native"}))),NK=async($,{signal:Z})=>{let[X]=await EK($,"error",{signal:Z});throw X};var AX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),x$=($,Z,X)=>{let J=$[X];if(!J.has(Z))J.set(Z,[]);let q=J.get(Z),Y=i0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},X$=async({resolve:$,promises:Z},X)=>{$();let[J]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...Z])]);return!J};import{Readable as DK}from"node:stream";import{callbackify as SK}from"node:util";import{finished as hX}from"node:stream/promises";var h3=async($)=>{if($===void 0)return;try{await N3($)}catch{}},NX=async($)=>{if($===void 0)return;try{await D3($)}catch{}},N3=async($)=>{await hX($,{cleanup:!0,readable:!1,writable:!0})},D3=async($)=>{await hX($,{cleanup:!0,readable:!0,writable:!1})},g4=async($,Z)=>{if(await $,Z)throw Z},u4=($,Z,X)=>{if(X&&!y4(X))$.destroy(X);else if(Z)$.destroy()};var DX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||j0.has(X),{subprocessStdout:G,waitReadableDestroy:H}=S3($,J,Z),{readableEncoding:K,readableObjectMode:W,readableHighWaterMark:U}=v3(G,Q),{read:B,onStdoutDataDone:R}=f3({subprocessStdout:G,subprocess:$,binary:Q,encoding:X,preserveNewlines:Y}),_=new DK({read:B,destroy:SK(b3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:U,objectMode:W,encoding:K});return k3({subprocessStdout:G,onStdoutDataDone:R,readable:_,subprocess:$}),_},S3=($,Z,X)=>{let J=o1($,Z),q=x$(X,J,"readableDestroy");return{subprocessStdout:J,waitReadableDestroy:q}},v3=({readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X},J)=>J?{readableEncoding:$,readableObjectMode:Z,readableHighWaterMark:X}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:w3},f3=({subprocessStdout:$,subprocess:Z,binary:X,encoding:J,preserveNewlines:q})=>{let Y=i0(),Q=b4({subprocessStdout:$,subprocess:Z,binary:X,shouldEncode:!X,encoding:J,preserveNewlines:q});return{read(){vK(this,Q,Y)},onStdoutDataDone:Y}},vK=async($,Z,X)=>{try{let{value:J,done:q}=await Z.next();if(q)X.resolve();else $.push(J)}catch{}},k3=async({subprocessStdout:$,onStdoutDataDone:Z,readable:X,subprocess:J,subprocessStdin:q})=>{try{if(await D3($),await J,await h3(q),await Z,X.readable)X.push(null)}catch(Y){await h3(q),SX(X,Y)}},b3=async({subprocessStdout:$,subprocess:Z,waitReadableDestroy:X},J)=>{if(await X$(X,Z))SX($,J),await g4(Z,J)},SX=($,Z)=>{u4($,$.readable,Z)};import{Writable as fK}from"node:stream";import{callbackify as vX}from"node:util";var fX=({subprocess:$,concurrentStreams:Z},{to:X}={})=>{let{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}=y3($,X,Z),Q=new fK({...g3(J,$,q),destroy:vX(m3.bind(void 0,{subprocessStdin:J,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:J.writableHighWaterMark,objectMode:J.writableObjectMode});return u3(J,Q),Q},y3=($,Z,X)=>{let J=Z4($,Z),q=x$(X,J,"writableFinal"),Y=x$(X,J,"writableDestroy");return{subprocessStdin:J,waitWritableFinal:q,waitWritableDestroy:Y}},g3=($,Z,X)=>({write:kK.bind(void 0,$),final:vX(bK.bind(void 0,$,Z,X))}),kK=($,Z,X,J)=>{if($.write(Z,X))J();else $.once("drain",J)},bK=async($,Z,X)=>{if(await X$(X,Z)){if($.writable)$.end();await Z}},u3=async($,Z,X)=>{try{if(await N3($),Z.writable)Z.end()}catch(J){await NX(X),kX(Z,J)}},m3=async({subprocessStdin:$,subprocess:Z,waitWritableFinal:X,waitWritableDestroy:J},q)=>{if(await X$(X,Z),await X$(J,Z))kX($,q),await g4(Z,q)},kX=($,Z)=>{u4($,$.writable,Z)};import{Duplex as yK}from"node:stream";import{callbackify as gK}from"node:util";var bX=({subprocess:$,concurrentStreams:Z,encoding:X},{from:J,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||j0.has(X),{subprocessStdout:H,waitReadableDestroy:K}=S3($,J,Z),{subprocessStdin:W,waitWritableFinal:U,waitWritableDestroy:B}=y3($,q,Z),{readableEncoding:R,readableObjectMode:_,readableHighWaterMark:L}=v3(H,G),{read:j,onStdoutDataDone:C}=f3({subprocessStdout:H,subprocess:$,binary:G,encoding:X,preserveNewlines:Q}),N=new yK({read:j,...g3(W,$,U),destroy:gK(uK.bind(void 0,{subprocessStdout:H,subprocessStdin:W,subprocess:$,waitReadableDestroy:K,waitWritableFinal:U,waitWritableDestroy:B})),readableHighWaterMark:L,writableHighWaterMark:W.writableHighWaterMark,readableObjectMode:_,writableObjectMode:W.writableObjectMode,encoding:R});return k3({subprocessStdout:H,onStdoutDataDone:C,readable:N,subprocess:$,subprocessStdin:W}),u3(W,N,H),N},uK=async({subprocessStdout:$,subprocessStdin:Z,subprocess:X,waitReadableDestroy:J,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([b3({subprocessStdout:$,subprocess:X,waitReadableDestroy:J},Q),m3({subprocessStdin:Z,subprocess:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var c3=($,Z,{from:X,binary:J=!1,preserveNewlines:q=!1}={})=>{let Y=J||j0.has(Z),Q=o1($,X),G=b4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:Z,preserveNewlines:q});return mK(G,Q,$)},mK=async function*($,Z,X){try{yield*$}finally{if(Z.readable)Z.destroy();await X}};var yX=($,{encoding:Z})=>{let X=AX();$.readable=DX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.writable=fX.bind(void 0,{subprocess:$,concurrentStreams:X}),$.duplex=bX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:Z}),$.iterable=c3.bind(void 0,$,Z),$[Symbol.asyncIterator]=c3.bind(void 0,$,Z,{})};var gX=($,Z)=>{for(let[X,J]of pK){let q=J.value.bind(Z);Reflect.defineProperty($,X,{...J,value:q})}},cK=(async()=>{})().constructor.prototype,pK=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(cK,$)]);var uX=($,Z,X,J)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:K,options:W,fileDescriptors:U}=nK($,Z,X),{subprocess:B,promise:R}=tK({file:q,commandArguments:Y,options:W,startTime:H,verboseInfo:K,command:Q,escapedCommand:G,fileDescriptors:U});return B.pipe=k4.bind(void 0,{source:B,sourcePromise:R,boundOptions:{},createNested:J}),gX(B,R),t0.set(B,{options:W,fileDescriptors:U}),B},nK=($,Z,X)=>{let{command:J,escapedCommand:q,startTime:Y,verboseInfo:Q}=p$($,Z,X),{file:G,commandArguments:H,options:K}=U4($,Z,X),W=iK(K),U=iZ(W,Q);return{file:G,commandArguments:H,command:J,escapedCommand:q,startTime:Y,verboseInfo:Q,options:W,fileDescriptors:U}},iK=({timeout:$,signal:Z,...X})=>{if(Z!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:$}},tK=({file:$,commandArguments:Z,options:X,startTime:J,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=lK(...W4($,Z,X))}catch(_){return pZ({error:_,command:Y,escapedCommand:Q,fileDescriptors:G,options:X,startTime:J,verboseInfo:q})}let K=new AbortController;dK(Number.POSITIVE_INFINITY,K.signal);let W=[...H.stdio];JX(H,G,K),HX(H,X,K);let U={},B=i0();H.kill=R8.bind(void 0,{kill:H.kill.bind(H),options:X,onInternalError:B,context:U,controller:K}),H.all=PX(H,X),yX(H,X),uZ(H,X);let R=oK({subprocess:H,options:X,startTime:J,verboseInfo:q,fileDescriptors:G,originalStreams:W,command:Y,escapedCommand:Q,context:U,onInternalError:B,controller:K});return{subprocess:H,promise:R}},oK=async({subprocess:$,options:Z,startTime:X,verboseInfo:J,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:K,controller:W})=>{let[U,[B,R],_,L,j]=await EX({subprocess:$,options:Z,context:H,verboseInfo:J,fileDescriptors:q,originalStreams:Y,onInternalError:K,controller:W});W.abort(),K.resolve();let C=_.map((I,n)=>q1(I,Z,n)),N=q1(L,Z,"all"),c=aK({errorInfo:U,exitCode:B,signal:R,stdio:C,all:N,ipcOutput:j,context:H,options:Z,command:Q,escapedCommand:G,startTime:X});return e1(c,J,Z)},aK=({errorInfo:$,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:K,startTime:W})=>("error"in $)?R$({error:$.error,command:H,escapedCommand:K,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof J1,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:Z,signal:X,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W,isSync:!1}):P4({command:H,escapedCommand:K,stdio:J,all:q,ipcOutput:Y,options:G,startTime:W});var m4=($,Z)=>{let X=Object.fromEntries(Object.entries(Z).map(([J,q])=>[J,rK(J,$[J],q)]));return{...$,...X}},rK=($,Z,X)=>{if(sK.has($)&&Y0(Z)&&Y0(X))return{...Z,...X};return X},sK=new Set(["env",...C2]);var B1=($,Z,X,J)=>{let q=(Q,G,H)=>B1(Q,G,X,H),Y=(...Q)=>eK({mapArguments:$,deepOptions:X,boundOptions:Z,setBoundExeca:J,createNested:q},...Q);if(J!==void 0)J(Y,q,Z);return Y},eK=({mapArguments:$,deepOptions:Z={},boundOptions:X={},setBoundExeca:J,createNested:q},Y,...Q)=>{if(Y0(Y))return q($,m4(X,Y),J);let{file:G,commandArguments:H,options:K,isSync:W}=$B({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:Z,boundOptions:X});return W?vZ(G,H,K):uX(G,H,K,q)},$B=({mapArguments:$,firstArgument:Z,nextArguments:X,deepOptions:J,boundOptions:q})=>{let Y=i6(Z)?t6(Z,X):[Z,...X],[Q,G,H]=D$(...Y),K=m4(m4(J,q),H),{file:W=Q,commandArguments:U=G,options:B=K,isSync:R=!1}=$({file:Q,commandArguments:G,options:K});return{file:W,commandArguments:U,options:B,isSync:R}};var mX=({file:$,commandArguments:Z})=>pX($,Z),cX=({file:$,commandArguments:Z})=>({...pX($,Z),isSync:!0}),pX=($,Z)=>{if(Z.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${Z}.`);let[X,...J]=ZB($);return{file:X,commandArguments:J}},ZB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let Z=$.trim();if(Z==="")return[];let X=[];for(let J of Z.split(XB)){let q=X.at(-1);if(q&&q.endsWith("\\"))X[X.length-1]=`${q.slice(0,-1)} ${J}`;else X.push(J)}return X},XB=/ +/g;var dX=($,Z,X)=>{$.sync=Z(JB,X),$.s=$.sync},lX=({options:$})=>nX($),JB=({options:$})=>({...nX($),isSync:!0}),nX=($)=>({options:{...QB($),...$}}),QB=({input:$,inputFile:Z,stdio:X})=>$===void 0&&Z===void 0&&X===void 0?{stdin:"inherit"}:{},iX={preferLocal:!0};var m0=B1(()=>({})),px=B1(()=>({isSync:!0})),dx=B1(mX),lx=B1(cX),nx=B1($5),ix=B1(lX,{},iX,dX),{sendMessage:tx,getOneMessage:ox,getEachMessage:ax,getCancelSignal:rx}=mZ();import{stripVTControlCharacters as Z6}from"node:util";var F0=$1(d3(),1),GJ=$1(d4(),1);import{stdin as qJ,stdout as YJ}from"node:process";import*as U1 from"node:readline";import rX from"node:readline";import{Writable as KB}from"node:stream";function BB({onlyFirst:$=!1}={}){let Z=["[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d\\/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))","(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))"].join("|");return new RegExp(Z,$?void 0:"g")}var UB=BB();function HJ($){if(typeof $!="string")throw TypeError(`Expected a \`string\`, got \`${typeof $}\``);return $.replace(UB,"")}function zJ($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var KJ={exports:{}};(function($){var Z={};$.exports=Z,Z.eastAsianWidth=function(J){var q=J.charCodeAt(0),Y=J.length==2?J.charCodeAt(1):0,Q=q;return 55296<=q&&q<=56319&&56320<=Y&&Y<=57343&&(q&=1023,Y&=1023,Q=q<<10|Y,Q+=65536),Q==12288||65281<=Q&&Q<=65376||65504<=Q&&Q<=65510?"F":Q==8361||65377<=Q&&Q<=65470||65474<=Q&&Q<=65479||65482<=Q&&Q<=65487||65490<=Q&&Q<=65495||65498<=Q&&Q<=65500||65512<=Q&&Q<=65518?"H":4352<=Q&&Q<=4447||4515<=Q&&Q<=4519||4602<=Q&&Q<=4607||9001<=Q&&Q<=9002||11904<=Q&&Q<=11929||11931<=Q&&Q<=12019||12032<=Q&&Q<=12245||12272<=Q&&Q<=12283||12289<=Q&&Q<=12350||12353<=Q&&Q<=12438||12441<=Q&&Q<=12543||12549<=Q&&Q<=12589||12593<=Q&&Q<=12686||12688<=Q&&Q<=12730||12736<=Q&&Q<=12771||12784<=Q&&Q<=12830||12832<=Q&&Q<=12871||12880<=Q&&Q<=13054||13056<=Q&&Q<=19903||19968<=Q&&Q<=42124||42128<=Q&&Q<=42182||43360<=Q&&Q<=43388||44032<=Q&&Q<=55203||55216<=Q&&Q<=55238||55243<=Q&&Q<=55291||63744<=Q&&Q<=64255||65040<=Q&&Q<=65049||65072<=Q&&Q<=65106||65108<=Q&&Q<=65126||65128<=Q&&Q<=65131||110592<=Q&&Q<=110593||127488<=Q&&Q<=127490||127504<=Q&&Q<=127546||127552<=Q&&Q<=127560||127568<=Q&&Q<=127569||131072<=Q&&Q<=194367||177984<=Q&&Q<=196605||196608<=Q&&Q<=262141?"W":32<=Q&&Q<=126||162<=Q&&Q<=163||165<=Q&&Q<=166||Q==172||Q==175||10214<=Q&&Q<=10221||10629<=Q&&Q<=10630?"Na":Q==161||Q==164||167<=Q&&Q<=168||Q==170||173<=Q&&Q<=174||176<=Q&&Q<=180||182<=Q&&Q<=186||188<=Q&&Q<=191||Q==198||Q==208||215<=Q&&Q<=216||222<=Q&&Q<=225||Q==230||232<=Q&&Q<=234||236<=Q&&Q<=237||Q==240||242<=Q&&Q<=243||247<=Q&&Q<=250||Q==252||Q==254||Q==257||Q==273||Q==275||Q==283||294<=Q&&Q<=295||Q==299||305<=Q&&Q<=307||Q==312||319<=Q&&Q<=322||Q==324||328<=Q&&Q<=331||Q==333||338<=Q&&Q<=339||358<=Q&&Q<=359||Q==363||Q==462||Q==464||Q==466||Q==468||Q==470||Q==472||Q==474||Q==476||Q==593||Q==609||Q==708||Q==711||713<=Q&&Q<=715||Q==717||Q==720||728<=Q&&Q<=731||Q==733||Q==735||768<=Q&&Q<=879||913<=Q&&Q<=929||931<=Q&&Q<=937||945<=Q&&Q<=961||963<=Q&&Q<=969||Q==1025||1040<=Q&&Q<=1103||Q==1105||Q==8208||8211<=Q&&Q<=8214||8216<=Q&&Q<=8217||8220<=Q&&Q<=8221||8224<=Q&&Q<=8226||8228<=Q&&Q<=8231||Q==8240||8242<=Q&&Q<=8243||Q==8245||Q==8251||Q==8254||Q==8308||Q==8319||8321<=Q&&Q<=8324||Q==8364||Q==8451||Q==8453||Q==8457||Q==8467||Q==8470||8481<=Q&&Q<=8482||Q==8486||Q==8491||8531<=Q&&Q<=8532||8539<=Q&&Q<=8542||8544<=Q&&Q<=8555||8560<=Q&&Q<=8569||Q==8585||8592<=Q&&Q<=8601||8632<=Q&&Q<=8633||Q==8658||Q==8660||Q==8679||Q==8704||8706<=Q&&Q<=8707||8711<=Q&&Q<=8712||Q==8715||Q==8719||Q==8721||Q==8725||Q==8730||8733<=Q&&Q<=8736||Q==8739||Q==8741||8743<=Q&&Q<=8748||Q==8750||8756<=Q&&Q<=8759||8764<=Q&&Q<=8765||Q==8776||Q==8780||Q==8786||8800<=Q&&Q<=8801||8804<=Q&&Q<=8807||8810<=Q&&Q<=8811||8814<=Q&&Q<=8815||8834<=Q&&Q<=8835||8838<=Q&&Q<=8839||Q==8853||Q==8857||Q==8869||Q==8895||Q==8978||9312<=Q&&Q<=9449||9451<=Q&&Q<=9547||9552<=Q&&Q<=9587||9600<=Q&&Q<=9615||9618<=Q&&Q<=9621||9632<=Q&&Q<=9633||9635<=Q&&Q<=9641||9650<=Q&&Q<=9651||9654<=Q&&Q<=9655||9660<=Q&&Q<=9661||9664<=Q&&Q<=9665||9670<=Q&&Q<=9672||Q==9675||9678<=Q&&Q<=9681||9698<=Q&&Q<=9701||Q==9711||9733<=Q&&Q<=9734||Q==9737||9742<=Q&&Q<=9743||9748<=Q&&Q<=9749||Q==9756||Q==9758||Q==9792||Q==9794||9824<=Q&&Q<=9825||9827<=Q&&Q<=9829||9831<=Q&&Q<=9834||9836<=Q&&Q<=9837||Q==9839||9886<=Q&&Q<=9887||9918<=Q&&Q<=9919||9924<=Q&&Q<=9933||9935<=Q&&Q<=9953||Q==9955||9960<=Q&&Q<=9983||Q==10045||Q==10071||10102<=Q&&Q<=10111||11093<=Q&&Q<=11097||12872<=Q&&Q<=12879||57344<=Q&&Q<=63743||65024<=Q&&Q<=65039||Q==65533||127232<=Q&&Q<=127242||127248<=Q&&Q<=127277||127280<=Q&&Q<=127337||127344<=Q&&Q<=127386||917760<=Q&&Q<=917999||983040<=Q&&Q<=1048573||1048576<=Q&&Q<=1114109?"A":"N"},Z.characterLength=function(J){var q=this.eastAsianWidth(J);return q=="F"||q=="W"||q=="A"?2:1};function X(J){return J.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}Z.length=function(J){for(var q=X(J),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},Z.slice=function(J,q,Y){textLen=Z.length(J),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=X(J),K=0;K<H.length;K++){var W=H[K],U=Z.length(W);if(G>=q-(U==2?1:0))if(G+U<=Y)Q+=W;else break;G+=U}return Q}})(KJ);var WB=KJ.exports,VB=zJ(WB),LB=function(){return/\uD83C\uDFF4\uDB40\uDC67\uDB40\uDC62(?:\uDB40\uDC77\uDB40\uDC6C\uDB40\uDC73|\uDB40\uDC73\uDB40\uDC63\uDB40\uDC74|\uDB40\uDC65\uDB40\uDC6E\uDB40\uDC67)\uDB40\uDC7F|(?:\uD83E\uDDD1\uD83C\uDFFF\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFF\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFE])|(?:\uD83E\uDDD1\uD83C\uDFFE\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFE\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFD\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFD\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFC\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFC\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|(?:\uD83E\uDDD1\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1|\uD83D\uDC69\uD83C\uDFFB\u200D\uD83E\uDD1D\u200D(?:\uD83D[\uDC68\uDC69]))(?:\uD83C[\uDFFC-\uDFFF])|\uD83D\uDC68(?:\uD83C\uDFFB(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFC-\uDFFF])|[\u2695\u2696\u2708]\uFE0F|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))?|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFF]))|\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D)?\uD83D\uDC68|(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFE])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB-\uDFFD\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83E\uDD1D\u200D\uD83D\uDC68(?:\uD83C[\uDFFB\uDFFD-\uDFFF])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])\uFE0F|\u200D(?:(?:\uD83D[\uDC68\uDC69])\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D[\uDC66\uDC67])|\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC)?|(?:\uD83D\uDC69(?:\uD83C\uDFFB\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|(?:\uD83C[\uDFFC-\uDFFF])\u200D\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69]))|\uD83E\uDDD1(?:\uD83C[\uDFFB-\uDFFF])\u200D\uD83E\uDD1D\u200D\uD83E\uDDD1)(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67]))|\uD83D\uDC69(?:\u200D(?:\u2764\uFE0F\u200D(?:\uD83D\uDC8B\u200D(?:\uD83D[\uDC68\uDC69])|\uD83D[\uDC68\uDC69])|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83E\uDDD1(?:\u200D(?:\uD83E\uDD1D\u200D\uD83E\uDDD1|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFF\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFE\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFD\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFC\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C\uDFFB\u200D(?:\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD]))|\uD83D\uDC69\u200D\uD83D\uDC66\u200D\uD83D\uDC66|\uD83D\uDC69\u200D\uD83D\uDC69\u200D(?:\uD83D[\uDC66\uDC67])|\uD83D\uDC69\u200D\uD83D\uDC67\u200D(?:\uD83D[\uDC66\uDC67])|(?:\uD83D\uDC41\uFE0F\u200D\uD83D\uDDE8|\uD83E\uDDD1(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDC69(?:\uD83C\uDFFF\u200D[\u2695\u2696\u2708]|\uD83C\uDFFE\u200D[\u2695\u2696\u2708]|\uD83C\uDFFD\u200D[\u2695\u2696\u2708]|\uD83C\uDFFC\u200D[\u2695\u2696\u2708]|\uD83C\uDFFB\u200D[\u2695\u2696\u2708]|\u200D[\u2695\u2696\u2708])|\uD83D\uDE36\u200D\uD83C\uDF2B|\uD83C\uDFF3\uFE0F\u200D\u26A7|\uD83D\uDC3B\u200D\u2744|(?:(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF])\u200D[\u2640\u2642]|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])\u200D[\u2640\u2642]|\uD83C\uDFF4\u200D\u2620|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])\u200D[\u2640\u2642]|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u2600-\u2604\u260E\u2611\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26B0\u26B1\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0\u26F1\u26F4\u26F7\u26F8\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u3030\u303D\u3297\u3299]|\uD83C[\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]|\uD83D[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3])\uFE0F|\uD83C\uDFF3\uFE0F\u200D\uD83C\uDF08|\uD83D\uDC69\u200D\uD83D\uDC67|\uD83D\uDC69\u200D\uD83D\uDC66|\uD83D\uDE35\u200D\uD83D\uDCAB|\uD83D\uDE2E\u200D\uD83D\uDCA8|\uD83D\uDC15\u200D\uD83E\uDDBA|\uD83E\uDDD1(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83D\uDC69(?:\uD83C\uDFFF|\uD83C\uDFFE|\uD83C\uDFFD|\uD83C\uDFFC|\uD83C\uDFFB)?|\uD83C\uDDFD\uD83C\uDDF0|\uD83C\uDDF6\uD83C\uDDE6|\uD83C\uDDF4\uD83C\uDDF2|\uD83D\uDC08\u200D\u2B1B|\u2764\uFE0F\u200D(?:\uD83D\uDD25|\uD83E\uDE79)|\uD83D\uDC41\uFE0F|\uD83C\uDFF3\uFE0F|\uD83C\uDDFF(?:\uD83C[\uDDE6\uDDF2\uDDFC])|\uD83C\uDDFE(?:\uD83C[\uDDEA\uDDF9])|\uD83C\uDDFC(?:\uD83C[\uDDEB\uDDF8])|\uD83C\uDDFB(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA])|\uD83C\uDDFA(?:\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF])|\uD83C\uDDF9(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF])|\uD83C\uDDF8(?:\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF])|\uD83C\uDDF7(?:\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC])|\uD83C\uDDF5(?:\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE])|\uD83C\uDDF3(?:\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF])|\uD83C\uDDF2(?:\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF])|\uD83C\uDDF1(?:\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE])|\uD83C\uDDF0(?:\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF])|\uD83C\uDDEF(?:\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5])|\uD83C\uDDEE(?:\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9])|\uD83C\uDDED(?:\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA])|\uD83C\uDDEC(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE])|\uD83C\uDDEB(?:\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7])|\uD83C\uDDEA(?:\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA])|\uD83C\uDDE9(?:\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF])|\uD83C\uDDE8(?:\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF])|\uD83C\uDDE7(?:\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF])|\uD83C\uDDE6(?:\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF])|[#\*0-9]\uFE0F\u20E3|\u2764\uFE0F|(?:\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD])(?:\uD83C[\uDFFB-\uDFFF])|(?:\u26F9|\uD83C[\uDFCB\uDFCC]|\uD83D\uDD75)(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|\uD83C\uDFF4|(?:[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5])(?:\uD83C[\uDFFB-\uDFFF])|(?:[\u261D\u270C\u270D]|\uD83D[\uDD74\uDD90])(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])|[\u270A\u270B]|\uD83C[\uDF85\uDFC2\uDFC7]|\uD83D[\uDC08\uDC15\uDC3B\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE2E\uDE35\uDE36\uDE4C\uDE4F\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1C\uDD1E\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5]|\uD83C[\uDFC3\uDFC4\uDFCA]|\uD83D[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6]|\uD83E[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD]|\uD83D\uDC6F|\uD83E[\uDD3C\uDDDE\uDDDF]|[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0D\uDD0E\uDD10-\uDD17\uDD1D\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78\uDD7A-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCB\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6]|(?:[\u231A\u231B\u23E9-\u23EC\u23F0\u23F3\u25FD\u25FE\u2614\u2615\u2648-\u2653\u267F\u2693\u26A1\u26AA\u26AB\u26BD\u26BE\u26C4\u26C5\u26CE\u26D4\u26EA\u26F2\u26F3\u26F5\u26FA\u26FD\u2705\u270A\u270B\u2728\u274C\u274E\u2753-\u2755\u2757\u2795-\u2797\u27B0\u27BF\u2B1B\u2B1C\u2B50\u2B55]|\uD83C[\uDC04\uDCCF\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF93\uDFA0-\uDFCA\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF4\uDFF8-\uDFFF]|\uD83D[\uDC00-\uDC3E\uDC40\uDC42-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDD7A\uDD95\uDD96\uDDA4\uDDFB-\uDE4F\uDE80-\uDEC5\uDECC\uDED0-\uDED2\uDED5-\uDED7\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])|(?:[#\*0-9\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23E9-\u23F3\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB-\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u261D\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692-\u2697\u2699\u269B\u269C\u26A0\u26A1\u26A7\u26AA\u26AB\u26B0\u26B1\u26BD\u26BE\u26C4\u26C5\u26C8\u26CE\u26CF\u26D1\u26D3\u26D4\u26E9\u26EA\u26F0-\u26F5\u26F7-\u26FA\u26FD\u2702\u2705\u2708-\u270D\u270F\u2712\u2714\u2716\u271D\u2721\u2728\u2733\u2734\u2744\u2747\u274C\u274E\u2753-\u2755\u2757\u2763\u2764\u2795-\u2797\u27A1\u27B0\u27BF\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B50\u2B55\u3030\u303D\u3297\u3299]|\uD83C[\uDC04\uDCCF\uDD70\uDD71\uDD7E\uDD7F\uDD8E\uDD91-\uDD9A\uDDE6-\uDDFF\uDE01\uDE02\uDE1A\uDE2F\uDE32-\uDE3A\uDE50\uDE51\uDF00-\uDF21\uDF24-\uDF93\uDF96\uDF97\uDF99-\uDF9B\uDF9E-\uDFF0\uDFF3-\uDFF5\uDFF7-\uDFFF]|\uD83D[\uDC00-\uDCFD\uDCFF-\uDD3D\uDD49-\uDD4E\uDD50-\uDD67\uDD6F\uDD70\uDD73-\uDD7A\uDD87\uDD8A-\uDD8D\uDD90\uDD95\uDD96\uDDA4\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA-\uDE4F\uDE80-\uDEC5\uDECB-\uDED2\uDED5-\uDED7\uDEE0-\uDEE5\uDEE9\uDEEB\uDEEC\uDEF0\uDEF3-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD0C-\uDD3A\uDD3C-\uDD45\uDD47-\uDD78\uDD7A-\uDDCB\uDDCD-\uDDFF\uDE70-\uDE74\uDE78-\uDE7A\uDE80-\uDE86\uDE90-\uDEA8\uDEB0-\uDEB6\uDEC0-\uDEC2\uDED0-\uDED6])\uFE0F|(?:[\u261D\u26F9\u270A-\u270D]|\uD83C[\uDF85\uDFC2-\uDFC4\uDFC7\uDFCA-\uDFCC]|\uD83D[\uDC42\uDC43\uDC46-\uDC50\uDC66-\uDC78\uDC7C\uDC81-\uDC83\uDC85-\uDC87\uDC8F\uDC91\uDCAA\uDD74\uDD75\uDD7A\uDD90\uDD95\uDD96\uDE45-\uDE47\uDE4B-\uDE4F\uDEA3\uDEB4-\uDEB6\uDEC0\uDECC]|\uD83E[\uDD0C\uDD0F\uDD18-\uDD1F\uDD26\uDD30-\uDD39\uDD3C-\uDD3E\uDD77\uDDB5\uDDB6\uDDB8\uDDB9\uDDBB\uDDCD-\uDDCF\uDDD1-\uDDDD])/g},_B=zJ(LB);function j$($,Z={}){if(typeof $!="string"||$.length===0||(Z={ambiguousIsNarrow:!0,...Z},$=HJ($),$.length===0))return 0;$=$.replace(_B()," ");let X=Z.ambiguousIsNarrow?1:2,J=0;for(let q of $){let Y=q.codePointAt(0);if(Y<=31||Y>=127&&Y<=159||Y>=768&&Y<=879)continue;switch(VB.eastAsianWidth(q)){case"F":case"W":J+=2;break;case"A":J+=X;break;default:J+=1}}return J}var n3=10,sX=($=0)=>(Z)=>`\x1B[${Z+$}m`,eX=($=0)=>(Z)=>`\x1B[${38+$};5;${Z}m`,$J=($=0)=>(Z,X,J)=>`\x1B[${38+$};2;${Z};${X};${J}m`,J0={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]}};Object.keys(J0.modifier);var RB=Object.keys(J0.color),TB=Object.keys(J0.bgColor);[...RB,...TB];function FB(){let $=new Map;for(let[Z,X]of Object.entries(J0)){for(let[J,q]of Object.entries(X))J0[J]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},X[J]=J0[J],$.set(q[0],q[1]);Object.defineProperty(J0,Z,{value:X,enumerable:!1})}return Object.defineProperty(J0,"codes",{value:$,enumerable:!1}),J0.color.close="\x1B[39m",J0.bgColor.close="\x1B[49m",J0.color.ansi=sX(),J0.color.ansi256=eX(),J0.color.ansi16m=$J(),J0.bgColor.ansi=sX(n3),J0.bgColor.ansi256=eX(n3),J0.bgColor.ansi16m=$J(n3),Object.defineProperties(J0,{rgbToAnsi256:{value:(Z,X,J)=>Z===X&&X===J?Z<8?16:Z>248?231:Math.round((Z-8)/247*24)+232:16+36*Math.round(Z/255*5)+6*Math.round(X/255*5)+Math.round(J/255*5),enumerable:!1},hexToRgb:{value:(Z)=>{let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec(Z.toString(16));if(!X)return[0,0,0];let[J]=X;J.length===3&&(J=[...J].map((Y)=>Y+Y).join(""));let q=Number.parseInt(J,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(Z)=>J0.rgbToAnsi256(...J0.hexToRgb(Z)),enumerable:!1},ansi256ToAnsi:{value:(Z)=>{if(Z<8)return 30+Z;if(Z<16)return 90+(Z-8);let X,J,q;if(Z>=232)X=((Z-232)*10+8)/255,J=X,q=X;else{Z-=16;let G=Z%36;X=Math.floor(Z/36)/5,J=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(X,J,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(J)<<1|Math.round(X));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(Z,X,J)=>J0.ansi256ToAnsi(J0.rgbToAnsi256(Z,X,J)),enumerable:!1},hexToAnsi:{value:(Z)=>J0.ansi256ToAnsi(J0.hexToAnsi256(Z)),enumerable:!1}}),J0}var MB=FB(),i4=new Set(["\x1B","›"]),CB=39,o3="\x07",BJ="[",PB="]",UJ="m",a3=`${PB}8;;`,ZJ=($)=>`${i4.values().next().value}${BJ}${$}${UJ}`,XJ=($)=>`${i4.values().next().value}${a3}${$}${o3}`,xB=($)=>$.split(" ").map((Z)=>j$(Z)),i3=($,Z,X)=>{let J=[...Z],q=!1,Y=!1,Q=j$(HJ($[$.length-1]));for(let[G,H]of J.entries()){let K=j$(H);if(Q+K<=X?$[$.length-1]+=H:($.push(H),Q=0),i4.has(H)&&(q=!0,Y=J.slice(G+1).join("").startsWith(a3)),q){Y?H===o3&&(q=!1,Y=!1):H===UJ&&(q=!1);continue}Q+=K,Q===X&&G<J.length-1&&($.push(""),Q=0)}!Q&&$[$.length-1].length>0&&$.length>1&&($[$.length-2]+=$.pop())},jB=($)=>{let Z=$.split(" "),X=Z.length;for(;X>0&&!(j$(Z[X-1])>0);)X--;return X===Z.length?$:Z.slice(0,X).join(" ")+Z.slice(X).join("")},IB=($,Z,X={})=>{if(X.trim!==!1&&$.trim()==="")return"";let J="",q,Y,Q=xB($),G=[""];for(let[K,W]of $.split(" ").entries()){X.trim!==!1&&(G[G.length-1]=G[G.length-1].trimStart());let U=j$(G[G.length-1]);if(K!==0&&(U>=Z&&(X.wordWrap===!1||X.trim===!1)&&(G.push(""),U=0),(U>0||X.trim===!1)&&(G[G.length-1]+=" ",U++)),X.hard&&Q[K]>Z){let B=Z-U,R=1+Math.floor((Q[K]-B-1)/Z);Math.floor((Q[K]-1)/Z)<R&&G.push(""),i3(G,W,Z);continue}if(U+Q[K]>Z&&U>0&&Q[K]>0){if(X.wordWrap===!1&&U<Z){i3(G,W,Z);continue}G.push("")}if(U+Q[K]>Z&&X.wordWrap===!1){i3(G,W,Z);continue}G[G.length-1]+=W}X.trim!==!1&&(G=G.map((K)=>jB(K)));let H=[...G.join(`
45
+ `)];for(let[K,W]of H.entries()){if(J+=W,i4.has(W)){let{groups:B}=new RegExp(`(?:\\${BJ}(?<code>\\d+)m|\\${a3}(?<uri>.*)${o3})`).exec(H.slice(K).join(""))||{groups:{}};if(B.code!==void 0){let R=Number.parseFloat(B.code);q=R===CB?void 0:R}else B.uri!==void 0&&(Y=B.uri.length===0?void 0:B.uri)}let U=MB.codes.get(Number(q));H[K+1]===`
46
+ `?(Y&&(J+=XJ("")),q&&U&&(J+=ZJ(U))):W===`
47
+ `&&(q&&U&&(J+=ZJ(q)),Y&&(J+=XJ(Y)))}return J};function JJ($,Z,X){return String($).normalize().replace(/\r\n/g,`
48
48
  `).split(`
49
- `).map((J)=>PB(J,X,Z)).join(`
50
- `)}var CB=["up","down","left","right","space","enter","cancel"],l4={actions:new Set(CB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function t3($,X){if(typeof $=="string")return l4.aliases.get($)===X;for(let Z of $)if(Z!==void 0&&t3(Z,X))return!0;return!1}function jB($,X){if($===X)return;let Z=$.split(`
51
- `),J=X.split(`
52
- `),q=[];for(let Y=0;Y<Math.max(Z.length,J.length);Y++)Z[Y]!==J[Y]&&q.push(Y);return q}var xB=globalThis.process.platform.startsWith("win"),l3=Symbol("clack:cancel");function m0($){return $===l3}function d4($,X){let Z=$;Z.isTTY&&Z.setRawMode(X)}function zJ({input:$=XJ,output:X=ZJ,overwrite:Z=!0,hideCursor:J=!0}={}){let q=B1.createInterface({input:$,output:X,prompt:"",tabSize:1});B1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let B=String(Q);if(t3([B,G,H],"cancel")){J&&X.write(T0.cursor.show),process.exit(0);return}if(!Z)return;B1.moveCursor(X,G==="return"?0:-1,G==="return"?-1:0,()=>{B1.clearLine(X,1,()=>{$.once("keypress",Y)})})};return J&&X.write(T0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),J&&X.write(T0.cursor.show),$.isTTY&&!xB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var IB=Object.defineProperty,wB=($,X,Z)=>(X in $)?IB($,X,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[X]=Z,I0=($,X,Z)=>(wB($,typeof X!="symbol"?X+"":X,Z),Z);class i4{constructor($,X=!0){I0(this,"input"),I0(this,"output"),I0(this,"_abortSignal"),I0(this,"rl"),I0(this,"opts"),I0(this,"_render"),I0(this,"_track",!1),I0(this,"_prevFrame",""),I0(this,"_subscribers",new Map),I0(this,"_cursor",0),I0(this,"state","initial"),I0(this,"error",""),I0(this,"value");let{input:Z=XJ,output:J=ZJ,render:q,signal:Y,...Q}=$;this.opts=Q,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=q.bind(this),this._track=X,this._abortSignal=Y,this.input=Z,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber($,X){let Z=this._subscribers.get($)??[];Z.push(X),this._subscribers.set($,Z)}on($,X){this.setSubscriber($,{cb:X})}once($,X){this.setSubscriber($,{cb:X,once:!0})}emit($,...X){let Z=this._subscribers.get($)??[],J=[];for(let q of Z)q.cb(...X),q.once&&J.push(()=>Z.splice(Z.indexOf(q),1));for(let q of J)q()}prompt(){return new Promise(($,X)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(l3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let Z=new YB;Z._write=(J,q,Y)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),Y()},this.input.pipe(Z),this.rl=iZ.createInterface({input:this.input,output:Z,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),iZ.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),d4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(T0.cursor.show),this.output.off("resize",this.render),d4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(T0.cursor.show),this.output.off("resize",this.render),d4(this.input,!1),$(l3)})})}onKeypress($,X){if(this.state==="error"&&(this.state="active"),X?.name&&(!this._track&&l4.aliases.has(X.name)&&this.emit("cursor",l4.aliases.get(X.name)),l4.actions.has(X.name)&&this.emit("cursor",X.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),X?.name==="return"){if(this.opts.validate){let Z=this.opts.validate(this.value);Z&&(this.error=Z instanceof Error?Z.message:Z,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}t3([$,X?.name,X?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
53
- `),d4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=eZ(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
54
- `).length-1;this.output.write(T0.cursor.move(-999,$*-1))}render(){let $=eZ(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(T0.cursor.hide);else{let X=jB(this._prevFrame,$);if(this.restoreCursor(),X&&X?.length===1){let Z=X[0];this.output.write(T0.cursor.move(0,Z)),this.output.write(T0.erase.lines(1));let J=$.split(`
55
- `);this.output.write(J[Z]),this._prevFrame=$,this.output.write(T0.cursor.move(0,J.length-Z-1));return}if(X&&X?.length>1){let Z=X[0];this.output.write(T0.cursor.move(0,Z)),this.output.write(T0.erase.down());let J=$.split(`
56
- `).slice(Z);this.output.write(J.join(`
57
- `)),this._prevFrame=$;return}this.output.write(T0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class o3 extends i4{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(X)=>{this.output.write(T0.cursor.move(0,-1)),this.value=X,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var OB;OB=new WeakMap;var EB=Object.defineProperty,AB=($,X,Z)=>(X in $)?EB($,X,{enumerable:!0,configurable:!0,writable:!0,value:Z}):$[X]=Z,$J=($,X,Z)=>(AB($,typeof X!="symbol"?X+"":X,Z),Z);class a3 extends i4{constructor($){super($,!1),$J(this,"options"),$J(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:X})=>X===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(X)=>{switch(X){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class r3 extends i4{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let $=this.value.slice(0,this.cursor),[X,...Z]=this.value.slice(this.cursor);return`${$}${JJ.default.inverse(X)}${Z.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var C=e0(p4(),1),t4=e0(c3(),1);import c0 from"node:process";function hB(){return c0.platform!=="win32"?c0.env.TERM!=="linux":!!c0.env.CI||!!c0.env.WT_SESSION||!!c0.env.TERMINUS_SUBLIME||c0.env.ConEmuTask==="{cmd::Cmder}"||c0.env.TERM_PROGRAM==="Terminus-Sublime"||c0.env.TERM_PROGRAM==="vscode"||c0.env.TERM==="xterm-256color"||c0.env.TERM==="alacritty"||c0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var e3=hB(),G0=($,X)=>e3?$:X,NB=G0("◆","*"),BJ=G0("■","x"),UJ=G0("▲","x"),o4=G0("◇","o"),DB=G0("┌","T"),$0=G0("│","|"),Z$=G0("└","—"),$6=G0("●",">"),X6=G0("○"," "),Kx=G0("◻","[•]"),Bx=G0("◼","[+]"),Ux=G0("◻","[ ]"),Wx=G0("▪","•"),KJ=G0("─","-"),SB=G0("╮","+"),vB=G0("├","+"),fB=G0("╯","+"),kB=G0("●","•"),bB=G0("◆","*"),yB=G0("▲","!"),gB=G0("■","x"),Z6=($)=>{switch($){case"initial":case"active":return C.default.cyan(NB);case"cancel":return C.default.red(BJ);case"error":return C.default.yellow(UJ);case"submit":return C.default.green(o4)}},mB=($)=>{let{cursor:X,options:Z,style:J}=$,q=$.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),Q=Math.min(Y,Math.max(q,5)),G=0;X>=G+Q-3?G=Math.max(Math.min(X-Q+3,Z.length-Q),0):X<G+2&&(G=Math.max(X-2,0));let H=Q<Z.length&&G>0,B=Q<Z.length&&G+Q<Z.length;return Z.slice(G,G+Q).map((K,U,W)=>{let _=U===0&&H,R=U===W.length-1&&B;return _||R?C.default.dim("..."):J(K,U+G===X)})},J6=($)=>new r3({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let X=`${C.default.gray($0)}
58
- ${Z6(this.state)} ${$.message}
59
- `,Z=$.placeholder?C.default.inverse($.placeholder[0])+C.default.dim($.placeholder.slice(1)):C.default.inverse(C.default.hidden("_")),J=this.value?this.valueWithCursor:Z;switch(this.state){case"error":return`${X.trim()}
60
- ${C.default.yellow($0)} ${J}
61
- ${C.default.yellow(Z$)} ${C.default.yellow(this.error)}
62
- `;case"submit":return`${X}${C.default.gray($0)} ${C.default.dim(this.value||$.placeholder)}`;case"cancel":return`${X}${C.default.gray($0)} ${C.default.strikethrough(C.default.dim(this.value??""))}${this.value?.trim()?`
63
- ${C.default.gray($0)}`:""}`;default:return`${X}${C.default.cyan($0)} ${J}
64
- ${C.default.cyan(Z$)}
65
- `}}}).prompt();var x$=($)=>{let X=$.active??"Yes",Z=$.inactive??"No";return new o3({active:X,inactive:Z,initialValue:$.initialValue??!0,render(){let J=`${C.default.gray($0)}
66
- ${Z6(this.state)} ${$.message}
67
- `,q=this.value?X:Z;switch(this.state){case"submit":return`${J}${C.default.gray($0)} ${C.default.dim(q)}`;case"cancel":return`${J}${C.default.gray($0)} ${C.default.strikethrough(C.default.dim(q))}
68
- ${C.default.gray($0)}`;default:return`${J}${C.default.cyan($0)} ${this.value?`${C.default.green($6)} ${X}`:`${C.default.dim(X6)} ${C.default.dim(X)}`} ${C.default.dim("/")} ${this.value?`${C.default.dim(X6)} ${C.default.dim(Z)}`:`${C.default.green($6)} ${Z}`}
69
- ${C.default.cyan(Z$)}
70
- `}}}).prompt()},Q6=($)=>{let X=(Z,J)=>{let q=Z.label??String(Z.value);switch(J){case"selected":return`${C.default.dim(q)}`;case"active":return`${C.default.green($6)} ${q} ${Z.hint?C.default.dim(`(${Z.hint})`):""}`;case"cancelled":return`${C.default.strikethrough(C.default.dim(q))}`;default:return`${C.default.dim(X6)} ${C.default.dim(q)}`}};return new a3({options:$.options,initialValue:$.initialValue,render(){let Z=`${C.default.gray($0)}
71
- ${Z6(this.state)} ${$.message}
72
- `;switch(this.state){case"submit":return`${Z}${C.default.gray($0)} ${X(this.options[this.cursor],"selected")}`;case"cancel":return`${Z}${C.default.gray($0)} ${X(this.options[this.cursor],"cancelled")}
73
- ${C.default.gray($0)}`;default:return`${Z}${C.default.cyan($0)} ${mB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(J,q)=>X(J,q?"active":"inactive")}).join(`
74
- ${C.default.cyan($0)} `)}
75
- ${C.default.cyan(Z$)}
76
- `}}}).prompt()};var q6=($="",X="")=>{let Z=`
49
+ `).map((J)=>IB(J,Z,X)).join(`
50
+ `)}var wB=["up","down","left","right","space","enter","cancel"],n4={actions:new Set(wB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function r3($,Z){if(typeof $=="string")return n4.aliases.get($)===Z;for(let X of $)if(X!==void 0&&r3(X,Z))return!0;return!1}function OB($,Z){if($===Z)return;let X=$.split(`
51
+ `),J=Z.split(`
52
+ `),q=[];for(let Y=0;Y<Math.max(X.length,J.length);Y++)X[Y]!==J[Y]&&q.push(Y);return q}var EB=globalThis.process.platform.startsWith("win"),t3=Symbol("clack:cancel");function c0($){return $===t3}function l4($,Z){let X=$;X.isTTY&&X.setRawMode(Z)}function WJ({input:$=qJ,output:Z=YJ,overwrite:X=!0,hideCursor:J=!0}={}){let q=U1.createInterface({input:$,output:Z,prompt:"",tabSize:1});U1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let K=String(Q);if(r3([K,G,H],"cancel")){J&&Z.write(F0.cursor.show),process.exit(0);return}if(!X)return;U1.moveCursor(Z,G==="return"?0:-1,G==="return"?-1:0,()=>{U1.clearLine(Z,1,()=>{$.once("keypress",Y)})})};return J&&Z.write(F0.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),J&&Z.write(F0.cursor.show),$.isTTY&&!EB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var AB=Object.defineProperty,hB=($,Z,X)=>(Z in $)?AB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,I0=($,Z,X)=>(hB($,typeof Z!="symbol"?Z+"":Z,X),X);class t4{constructor($,Z=!0){I0(this,"input"),I0(this,"output"),I0(this,"_abortSignal"),I0(this,"rl"),I0(this,"opts"),I0(this,"_render"),I0(this,"_track",!1),I0(this,"_prevFrame",""),I0(this,"_subscribers",new Map),I0(this,"_cursor",0),I0(this,"state","initial"),I0(this,"error",""),I0(this,"value");let{input:X=qJ,output:J=YJ,render:q,signal:Y,...Q}=$;this.opts=Q,this.onKeypress=this.onKeypress.bind(this),this.close=this.close.bind(this),this.render=this.render.bind(this),this._render=q.bind(this),this._track=Z,this._abortSignal=Y,this.input=X,this.output=J}unsubscribe(){this._subscribers.clear()}setSubscriber($,Z){let X=this._subscribers.get($)??[];X.push(Z),this._subscribers.set($,X)}on($,Z){this.setSubscriber($,{cb:Z})}once($,Z){this.setSubscriber($,{cb:Z,once:!0})}emit($,...Z){let X=this._subscribers.get($)??[],J=[];for(let q of X)q.cb(...Z),q.once&&J.push(()=>X.splice(X.indexOf(q),1));for(let q of J)q()}prompt(){return new Promise(($,Z)=>{if(this._abortSignal){if(this._abortSignal.aborted)return this.state="cancel",this.close(),$(t3);this._abortSignal.addEventListener("abort",()=>{this.state="cancel",this.close()},{once:!0})}let X=new KB;X._write=(J,q,Y)=>{this._track&&(this.value=this.rl?.line.replace(/\t/g,""),this._cursor=this.rl?.cursor??0,this.emit("value",this.value)),Y()},this.input.pipe(X),this.rl=rX.createInterface({input:this.input,output:X,tabSize:2,prompt:"",escapeCodeTimeout:50,terminal:!0}),rX.emitKeypressEvents(this.input,this.rl),this.rl.prompt(),this.opts.initialValue!==void 0&&this._track&&this.rl.write(this.opts.initialValue),this.input.on("keypress",this.onKeypress),l4(this.input,!0),this.output.on("resize",this.render),this.render(),this.once("submit",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(this.value)}),this.once("cancel",()=>{this.output.write(F0.cursor.show),this.output.off("resize",this.render),l4(this.input,!1),$(t3)})})}onKeypress($,Z){if(this.state==="error"&&(this.state="active"),Z?.name&&(!this._track&&n4.aliases.has(Z.name)&&this.emit("cursor",n4.aliases.get(Z.name)),n4.actions.has(Z.name)&&this.emit("cursor",Z.name)),$&&($.toLowerCase()==="y"||$.toLowerCase()==="n")&&this.emit("confirm",$.toLowerCase()==="y"),$==="\t"&&this.opts.placeholder&&(this.value||(this.rl?.write(this.opts.placeholder),this.emit("value",this.opts.placeholder))),$&&this.emit("key",$.toLowerCase()),Z?.name==="return"){if(this.opts.validate){let X=this.opts.validate(this.value);X&&(this.error=X instanceof Error?X.message:X,this.state="error",this.rl?.write(this.value))}this.state!=="error"&&(this.state="submit")}r3([$,Z?.name,Z?.sequence],"cancel")&&(this.state="cancel"),(this.state==="submit"||this.state==="cancel")&&this.emit("finalize"),this.render(),(this.state==="submit"||this.state==="cancel")&&this.close()}close(){this.input.unpipe(),this.input.removeListener("keypress",this.onKeypress),this.output.write(`
53
+ `),l4(this.input,!1),this.rl?.close(),this.rl=void 0,this.emit(`${this.state}`,this.value),this.unsubscribe()}restoreCursor(){let $=JJ(this._prevFrame,process.stdout.columns,{hard:!0}).split(`
54
+ `).length-1;this.output.write(F0.cursor.move(-999,$*-1))}render(){let $=JJ(this._render(this)??"",process.stdout.columns,{hard:!0});if($!==this._prevFrame){if(this.state==="initial")this.output.write(F0.cursor.hide);else{let Z=OB(this._prevFrame,$);if(this.restoreCursor(),Z&&Z?.length===1){let X=Z[0];this.output.write(F0.cursor.move(0,X)),this.output.write(F0.erase.lines(1));let J=$.split(`
55
+ `);this.output.write(J[X]),this._prevFrame=$,this.output.write(F0.cursor.move(0,J.length-X-1));return}if(Z&&Z?.length>1){let X=Z[0];this.output.write(F0.cursor.move(0,X)),this.output.write(F0.erase.down());let J=$.split(`
56
+ `).slice(X);this.output.write(J.join(`
57
+ `)),this._prevFrame=$;return}this.output.write(F0.erase.down())}this.output.write($),this.state==="initial"&&(this.state="active"),this._prevFrame=$}}}class s3 extends t4{get cursor(){return this.value?0:1}get _value(){return this.cursor===0}constructor($){super($,!1),this.value=!!$.initialValue,this.on("value",()=>{this.value=this._value}),this.on("confirm",(Z)=>{this.output.write(F0.cursor.move(0,-1)),this.value=Z,this.state="submit",this.close()}),this.on("cursor",()=>{this.value=!this.value})}}var NB;NB=new WeakMap;var DB=Object.defineProperty,SB=($,Z,X)=>(Z in $)?DB($,Z,{enumerable:!0,configurable:!0,writable:!0,value:X}):$[Z]=X,QJ=($,Z,X)=>(SB($,typeof Z!="symbol"?Z+"":Z,X),X);class e3 extends t4{constructor($){super($,!1),QJ(this,"options"),QJ(this,"cursor",0),this.options=$.options,this.cursor=this.options.findIndex(({value:Z})=>Z===$.initialValue),this.cursor===-1&&(this.cursor=0),this.changeValue(),this.on("cursor",(Z)=>{switch(Z){case"left":case"up":this.cursor=this.cursor===0?this.options.length-1:this.cursor-1;break;case"down":case"right":this.cursor=this.cursor===this.options.length-1?0:this.cursor+1;break}this.changeValue()})}get _value(){return this.options[this.cursor]}changeValue(){this.value=this._value.value}}class $6 extends t4{get valueWithCursor(){if(this.state==="submit")return this.value;if(this.cursor>=this.value.length)return`${this.value}█`;let $=this.value.slice(0,this.cursor),[Z,...X]=this.value.slice(this.cursor);return`${$}${GJ.default.inverse(Z)}${X.join("")}`}get cursor(){return this._cursor}constructor($){super($),this.on("finalize",()=>{this.value||(this.value=$.defaultValue)})}}var x=$1(d4(),1),o4=$1(d3(),1);import p0 from"node:process";function vB(){return p0.platform!=="win32"?p0.env.TERM!=="linux":!!p0.env.CI||!!p0.env.WT_SESSION||!!p0.env.TERMINUS_SUBLIME||p0.env.ConEmuTask==="{cmd::Cmder}"||p0.env.TERM_PROGRAM==="Terminus-Sublime"||p0.env.TERM_PROGRAM==="vscode"||p0.env.TERM==="xterm-256color"||p0.env.TERM==="alacritty"||p0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var X6=vB(),G0=($,Z)=>X6?$:Z,fB=G0("◆","*"),LJ=G0("■","x"),_J=G0("▲","x"),a4=G0("◇","o"),kB=G0("┌","T"),$0=G0("│","|"),J$=G0("└","—"),J6=G0("●",">"),Q6=G0("○"," "),Wj=G0("◻","[•]"),Vj=G0("◼","[+]"),Lj=G0("◻","[ ]"),_j=G0("▪","•"),VJ=G0("─","-"),bB=G0("╮","+"),yB=G0("├","+"),gB=G0("╯","+"),uB=G0("●","•"),mB=G0("◆","*"),cB=G0("▲","!"),pB=G0("■","x"),q6=($)=>{switch($){case"initial":case"active":return x.default.cyan(fB);case"cancel":return x.default.red(LJ);case"error":return x.default.yellow(_J);case"submit":return x.default.green(a4)}},dB=($)=>{let{cursor:Z,options:X,style:J}=$,q=$.maxItems??Number.POSITIVE_INFINITY,Y=Math.max(process.stdout.rows-4,0),Q=Math.min(Y,Math.max(q,5)),G=0;Z>=G+Q-3?G=Math.max(Math.min(Z-Q+3,X.length-Q),0):Z<G+2&&(G=Math.max(Z-2,0));let H=Q<X.length&&G>0,K=Q<X.length&&G+Q<X.length;return X.slice(G,G+Q).map((W,U,B)=>{let R=U===0&&H,_=U===B.length-1&&K;return R||_?x.default.dim("..."):J(W,U+G===Z)})},Y6=($)=>new $6({validate:$.validate,placeholder:$.placeholder,defaultValue:$.defaultValue,initialValue:$.initialValue,render(){let Z=`${x.default.gray($0)}
58
+ ${q6(this.state)} ${$.message}
59
+ `,X=$.placeholder?x.default.inverse($.placeholder[0])+x.default.dim($.placeholder.slice(1)):x.default.inverse(x.default.hidden("_")),J=this.value?this.valueWithCursor:X;switch(this.state){case"error":return`${Z.trim()}
60
+ ${x.default.yellow($0)} ${J}
61
+ ${x.default.yellow(J$)} ${x.default.yellow(this.error)}
62
+ `;case"submit":return`${Z}${x.default.gray($0)} ${x.default.dim(this.value||$.placeholder)}`;case"cancel":return`${Z}${x.default.gray($0)} ${x.default.strikethrough(x.default.dim(this.value??""))}${this.value?.trim()?`
63
+ ${x.default.gray($0)}`:""}`;default:return`${Z}${x.default.cyan($0)} ${J}
64
+ ${x.default.cyan(J$)}
65
+ `}}}).prompt();var I$=($)=>{let Z=$.active??"Yes",X=$.inactive??"No";return new s3({active:Z,inactive:X,initialValue:$.initialValue??!0,render(){let J=`${x.default.gray($0)}
66
+ ${q6(this.state)} ${$.message}
67
+ `,q=this.value?Z:X;switch(this.state){case"submit":return`${J}${x.default.gray($0)} ${x.default.dim(q)}`;case"cancel":return`${J}${x.default.gray($0)} ${x.default.strikethrough(x.default.dim(q))}
68
+ ${x.default.gray($0)}`;default:return`${J}${x.default.cyan($0)} ${this.value?`${x.default.green(J6)} ${Z}`:`${x.default.dim(Q6)} ${x.default.dim(Z)}`} ${x.default.dim("/")} ${this.value?`${x.default.dim(Q6)} ${x.default.dim(X)}`:`${x.default.green(J6)} ${X}`}
69
+ ${x.default.cyan(J$)}
70
+ `}}}).prompt()},G6=($)=>{let Z=(X,J)=>{let q=X.label??String(X.value);switch(J){case"selected":return`${x.default.dim(q)}`;case"active":return`${x.default.green(J6)} ${q} ${X.hint?x.default.dim(`(${X.hint})`):""}`;case"cancelled":return`${x.default.strikethrough(x.default.dim(q))}`;default:return`${x.default.dim(Q6)} ${x.default.dim(q)}`}};return new e3({options:$.options,initialValue:$.initialValue,render(){let X=`${x.default.gray($0)}
71
+ ${q6(this.state)} ${$.message}
72
+ `;switch(this.state){case"submit":return`${X}${x.default.gray($0)} ${Z(this.options[this.cursor],"selected")}`;case"cancel":return`${X}${x.default.gray($0)} ${Z(this.options[this.cursor],"cancelled")}
73
+ ${x.default.gray($0)}`;default:return`${X}${x.default.cyan($0)} ${dB({cursor:this.cursor,options:this.options,maxItems:$.maxItems,style:(J,q)=>Z(J,q?"active":"inactive")}).join(`
74
+ ${x.default.cyan($0)} `)}
75
+ ${x.default.cyan(J$)}
76
+ `}}}).prompt()};var H6=($="",Z="")=>{let X=`
77
77
  ${$}
78
78
  `.split(`
79
- `),J=s3(X).length,q=Math.max(Z.reduce((Q,G)=>{let H=s3(G);return H.length>Q?H.length:Q},0),J)+2,Y=Z.map((Q)=>`${C.default.gray($0)} ${C.default.dim(Q)}${" ".repeat(q-s3(Q).length)}${C.default.gray($0)}`).join(`
80
- `);process.stdout.write(`${C.default.gray($0)}
81
- ${C.default.green(o4)} ${C.default.reset(X)} ${C.default.gray(KJ.repeat(Math.max(q-J-1,1))+SB)}
79
+ `),J=Z6(Z).length,q=Math.max(X.reduce((Q,G)=>{let H=Z6(G);return H.length>Q?H.length:Q},0),J)+2,Y=X.map((Q)=>`${x.default.gray($0)} ${x.default.dim(Q)}${" ".repeat(q-Z6(Q).length)}${x.default.gray($0)}`).join(`
80
+ `);process.stdout.write(`${x.default.gray($0)}
81
+ ${x.default.green(a4)} ${x.default.reset(Z)} ${x.default.gray(VJ.repeat(Math.max(q-J-1,1))+bB)}
82
82
  ${Y}
83
- ${C.default.gray(vB+KJ.repeat(q+2)+fB)}
84
- `)},U1=($="")=>{process.stdout.write(`${C.default.gray(Z$)} ${C.default.red($)}
83
+ ${x.default.gray(yB+VJ.repeat(q+2)+gB)}
84
+ `)},W1=($="")=>{process.stdout.write(`${x.default.gray(J$)} ${x.default.red($)}
85
85
 
86
- `)},a4=($="")=>{process.stdout.write(`${C.default.gray(DB)} ${$}
87
- `)},r4=($="")=>{process.stdout.write(`${C.default.gray($0)}
88
- ${C.default.gray(Z$)} ${$}
86
+ `)},r4=($="")=>{process.stdout.write(`${x.default.gray(kB)} ${$}
87
+ `)},s4=($="")=>{process.stdout.write(`${x.default.gray($0)}
88
+ ${x.default.gray(J$)} ${$}
89
89
 
90
- `)},S={message:($="",{symbol:X=C.default.gray($0)}={})=>{let Z=[`${C.default.gray($0)}`];if($){let[J,...q]=$.split(`
91
- `);Z.push(`${X} ${J}`,...q.map((Y)=>`${C.default.gray($0)} ${Y}`))}process.stdout.write(`${Z.join(`
90
+ `)},S={message:($="",{symbol:Z=x.default.gray($0)}={})=>{let X=[`${x.default.gray($0)}`];if($){let[J,...q]=$.split(`
91
+ `);X.push(`${Z} ${J}`,...q.map((Y)=>`${x.default.gray($0)} ${Y}`))}process.stdout.write(`${X.join(`
92
92
  `)}
93
- `)},info:($)=>{S.message($,{symbol:C.default.blue(kB)})},success:($)=>{S.message($,{symbol:C.default.green(bB)})},step:($)=>{S.message($,{symbol:C.default.green(o4)})},warn:($)=>{S.message($,{symbol:C.default.yellow(yB)})},warning:($)=>{S.warn($)},error:($)=>{S.message($,{symbol:C.default.red(gB)})}},Vx=`${C.default.gray($0)} `;var WJ=({indicator:$="dots"}={})=>{let X=e3?["◒","◐","◓","◑"]:["•","o","O","0"],Z=e3?80:120,J=process.env.CI==="true",q,Y,Q=!1,G="",H,B=performance.now(),K=(x)=>{let n=x>1?"Something went wrong":"Canceled";Q&&u(n,x)},U=()=>K(2),W=()=>K(1),_=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",K)},R=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",K)},L=()=>{if(H===void 0)return;J&&process.stdout.write(`
94
- `);let x=H.split(`
95
- `);process.stdout.write(t4.cursor.move(-999,x.length-1)),process.stdout.write(t4.erase.down(x.length))},I=(x)=>x.replace(/\.+$/,""),j=(x)=>{let n=(performance.now()-x)/1000,i=Math.floor(n/60),t=Math.floor(n%60);return i>0?`[${i}m ${t}s]`:`[${t}s]`},N=(x="")=>{Q=!0,q=zJ(),G=I(x),B=performance.now(),process.stdout.write(`${C.default.gray($0)}
96
- `);let n=0,i=0;_(),Y=setInterval(()=>{if(J&&G===H)return;L(),H=G;let t=C.default.magenta(X[n]);if(J)process.stdout.write(`${t} ${G}...`);else if($==="timer")process.stdout.write(`${t} ${G} ${j(B)}`);else{let F0=".".repeat(Math.floor(i)).slice(0,3);process.stdout.write(`${t} ${G}${F0}`)}n=n+1<X.length?n+1:0,i=i<X.length?i+0.125:0},Z)},u=(x="",n=0)=>{Q=!1,clearInterval(Y),L();let i=n===0?C.default.green(o4):n===1?C.default.red(BJ):C.default.red(UJ);G=I(x??G),$==="timer"?process.stdout.write(`${i} ${G} ${j(B)}
93
+ `)},info:($)=>{S.message($,{symbol:x.default.blue(uB)})},success:($)=>{S.message($,{symbol:x.default.green(mB)})},step:($)=>{S.message($,{symbol:x.default.green(a4)})},warn:($)=>{S.message($,{symbol:x.default.yellow(cB)})},warning:($)=>{S.warn($)},error:($)=>{S.message($,{symbol:x.default.red(pB)})}},Rj=`${x.default.gray($0)} `;var RJ=({indicator:$="dots"}={})=>{let Z=X6?["◒","◐","◓","◑"]:["•","o","O","0"],X=X6?80:120,J=process.env.CI==="true",q,Y,Q=!1,G="",H,K=performance.now(),W=(I)=>{let n=I>1?"Something went wrong":"Canceled";Q&&c(n,I)},U=()=>W(2),B=()=>W(1),R=()=>{process.on("uncaughtExceptionMonitor",U),process.on("unhandledRejection",U),process.on("SIGINT",B),process.on("SIGTERM",B),process.on("exit",W)},_=()=>{process.removeListener("uncaughtExceptionMonitor",U),process.removeListener("unhandledRejection",U),process.removeListener("SIGINT",B),process.removeListener("SIGTERM",B),process.removeListener("exit",W)},L=()=>{if(H===void 0)return;J&&process.stdout.write(`
94
+ `);let I=H.split(`
95
+ `);process.stdout.write(o4.cursor.move(-999,I.length-1)),process.stdout.write(o4.erase.down(I.length))},j=(I)=>I.replace(/\.+$/,""),C=(I)=>{let n=(performance.now()-I)/1000,i=Math.floor(n/60),a=Math.floor(n%60);return i>0?`[${i}m ${a}s]`:`[${a}s]`},N=(I="")=>{Q=!0,q=WJ(),G=j(I),K=performance.now(),process.stdout.write(`${x.default.gray($0)}
96
+ `);let n=0,i=0;R(),Y=setInterval(()=>{if(J&&G===H)return;L(),H=G;let a=x.default.magenta(Z[n]);if(J)process.stdout.write(`${a} ${G}...`);else if($==="timer")process.stdout.write(`${a} ${G} ${C(K)}`);else{let K0=".".repeat(Math.floor(i)).slice(0,3);process.stdout.write(`${a} ${G}${K0}`)}n=n+1<Z.length?n+1:0,i=i<Z.length?i+0.125:0},X)},c=(I="",n=0)=>{Q=!1,clearInterval(Y),L();let i=n===0?x.default.green(a4):n===1?x.default.red(LJ):x.default.red(_J);G=j(I??G),$==="timer"?process.stdout.write(`${i} ${G} ${C(K)}
97
97
  `):process.stdout.write(`${i} ${G}
98
- `),R(),q()};return{start:N,stop:u,message:(x="")=>{G=I(x??G)}}};var a=e0(p4(),1);import{notStrictEqual as zU,strictEqual as KU}from"assert";var uB={right:lB,center:nB};class LJ{constructor($){var X;this.width=$.width,this.wrap=(X=$.wrap)!==null&&X!==void 0?X:!0,this.rows=[]}span(...$){let X=this.div(...$);X.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let X=$.map((Z)=>{if(typeof Z==="string")return this.colFromString(Z);return Z});return this.rows.push(X),X}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let X=$.split(`
99
- `).map((J)=>J.split("\t")),Z=0;return X.forEach((J)=>{if(J.length>1&&w0.stringWidth(J[0])>Z)Z=Math.min(Math.floor(this.width*0.5),w0.stringWidth(J[0]))}),X.forEach((J)=>{this.div(...J.map((q,Y)=>{return{text:q.trim(),padding:this.measurePadding(q),width:Y===0&&J.length>1?Z:void 0}}))}),this.rows[this.rows.length-1]}colFromString($){return{text:$,padding:this.measurePadding($)}}measurePadding($){let X=w0.stripAnsi($);return[0,X.match(/\s*$/)[0].length,0,X.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((X)=>{this.rowToString(X,$)}),$.filter((X)=>!X.hidden).map((X)=>X.text).join(`
100
- `)}rowToString($,X){return this.rasterize($).forEach((Z,J)=>{let q="";Z.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),B=Y;if(H>w0.stringWidth(Y))B+=" ".repeat(H-w0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let U=uB[$[Q].align];if(B=U(B,H),w0.stringWidth(B)<H)B+=" ".repeat((G||0)-w0.stringWidth(B)-1)}let K=$[Q].padding||[0,0,0,0];if(K[3])q+=" ".repeat(K[3]);if(q+=VJ($[Q],B,"| "),q+=B,q+=VJ($[Q],B," |"),K[1])q+=" ".repeat(K[1]);if(J===0&&X.length>0)q=this.renderInline(q,X[X.length-1])}),X.push({text:q.replace(/ +$/,""),span:$.span})}),X}renderInline($,X){let Z=$.match(/^ */),J=Z?Z[0].length:0,q=X.text,Y=w0.stringWidth(q.trimRight());if(!X.span)return $;if(!this.wrap)return X.hidden=!0,q+$;if(J<Y)return $;return X.hidden=!0,q.trimRight()+" ".repeat(J-Y)+$.trimLeft()}rasterize($){let X=[],Z=this.columnWidths($),J;return $.forEach((q,Y)=>{if(q.width=Z[Y],this.wrap)J=w0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
98
+ `),_(),q()};return{start:N,stop:c,message:(I="")=>{G=j(I??G)}}};var o=$1(d4(),1);import{notStrictEqual as WU,strictEqual as VU}from"assert";var nB={right:oB,center:aB};class FJ{constructor($){var Z;this.width=$.width,this.wrap=(Z=$.wrap)!==null&&Z!==void 0?Z:!0,this.rows=[]}span(...$){let Z=this.div(...$);Z.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let Z=$.map((X)=>{if(typeof X==="string")return this.colFromString(X);return X});return this.rows.push(Z),Z}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let Z=$.split(`
99
+ `).map((J)=>J.split("\t")),X=0;return Z.forEach((J)=>{if(J.length>1&&w0.stringWidth(J[0])>X)X=Math.min(Math.floor(this.width*0.5),w0.stringWidth(J[0]))}),Z.forEach((J)=>{this.div(...J.map((q,Y)=>{return{text:q.trim(),padding:this.measurePadding(q),width:Y===0&&J.length>1?X:void 0}}))}),this.rows[this.rows.length-1]}colFromString($){return{text:$,padding:this.measurePadding($)}}measurePadding($){let Z=w0.stripAnsi($);return[0,Z.match(/\s*$/)[0].length,0,Z.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((Z)=>{this.rowToString(Z,$)}),$.filter((Z)=>!Z.hidden).map((Z)=>Z.text).join(`
100
+ `)}rowToString($,Z){return this.rasterize($).forEach((X,J)=>{let q="";X.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),K=Y;if(H>w0.stringWidth(Y))K+=" ".repeat(H-w0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let U=nB[$[Q].align];if(K=U(K,H),w0.stringWidth(K)<H)K+=" ".repeat((G||0)-w0.stringWidth(K)-1)}let W=$[Q].padding||[0,0,0,0];if(W[3])q+=" ".repeat(W[3]);if(q+=TJ($[Q],K,"| "),q+=K,q+=TJ($[Q],K," |"),W[1])q+=" ".repeat(W[1]);if(J===0&&Z.length>0)q=this.renderInline(q,Z[Z.length-1])}),Z.push({text:q.replace(/ +$/,""),span:$.span})}),Z}renderInline($,Z){let X=$.match(/^ */),J=X?X[0].length:0,q=Z.text,Y=w0.stringWidth(q.trimRight());if(!Z.span)return $;if(!this.wrap)return Z.hidden=!0,q+$;if(J<Y)return $;return Z.hidden=!0,q.trimRight()+" ".repeat(J-Y)+$.trimLeft()}rasterize($){let Z=[],X=this.columnWidths($),J;return $.forEach((q,Y)=>{if(q.width=X[Y],this.wrap)J=w0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
101
101
  `);else J=q.text.split(`
102
- `);if(q.border)J.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),J.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)J.unshift(...Array(q.padding[0]||0).fill("")),J.push(...Array(q.padding[2]||0).fill(""));J.forEach((Q,G)=>{if(!X[G])X.push([]);let H=X[G];for(let B=0;B<Y;B++)if(H[B]===void 0)H.push("");H.push(Q)})}),X}negatePadding($){let X=$.width||0;if($.padding)X-=($.padding[3]||0)+($.padding[1]||0);if($.border)X-=4;return X}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||w0.stringWidth(Y.text)});let X=$.length,Z=this.width,J=$.map((Y)=>{if(Y.width)return X--,Z-=Y.width,Y.width;return}),q=X?Math.floor(Z/X):0;return J.map((Y,Q)=>{if(Y===void 0)return Math.max(q,pB($[Q]));return Y})}}function VJ($,X,Z){if($.border){if(/[.']-+[.']/.test(X))return"";if(X.trim().length!==0)return Z;return" "}return""}function pB($){let X=$.padding||[],Z=1+(X[3]||0)+(X[1]||0);if($.border)return Z+4;return Z}function dB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function lB($,X){$=$.trim();let Z=w0.stringWidth($);if(Z<X)return" ".repeat(X-Z)+$;return $}function nB($,X){$=$.trim();let Z=w0.stringWidth($);if(Z>=X)return $;return" ".repeat(X-Z>>1)+$}var w0;function _J($,X){return w0=X,new LJ({width:($===null||$===void 0?void 0:$.width)||dB(),wrap:$===null||$===void 0?void 0:$.wrap})}var RJ=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function Y6($){return $.replace(RJ,"")}function TJ($,X){let[Z,J]=$.match(RJ)||["",""];$=Y6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%X===0)q+=`
103
- `;q+=$.charAt(Y)}if(Z&&J)q=`${Z}${q}${J}`;return q}function G6($){return _J($,{stringWidth:(X)=>{return[...X].length},stripAnsi:Y6,wrap:TJ})}import{dirname as FJ,resolve as MJ}from"path";import{readdirSync as iB,statSync as tB}from"fs";function H6($,X){let Z=MJ(".",$),J;if(!tB(Z).isDirectory())Z=FJ(Z);while(!0){if(J=X(Z,iB(Z)),J)return MJ(Z,J);if(Z=FJ(J=Z),J===Z)break}}import{inspect as BU}from"util";import{readFileSync as UU}from"fs";import{fileURLToPath as WU}from"url";import{format as rB}from"util";import{normalize as sB,resolve as eB}from"path";function O1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let Z="",J=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(J)J=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))J=!0;else if(Q!=="-"&&Q!=="_")Z+=Q}return Z}}function s4($,X){let Z=$.toLowerCase();X=X||"-";let J="";for(let q=0;q<$.length;q++){let Y=Z.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)J+=`${X}${Z.charAt(q)}`;else J+=Q}return J}function e4($){if($===null||$===void 0)return!1;if(typeof $==="number")return!0;if(/^0x[0-9a-f]+$/i.test($))return!0;if(/^0[^.]/.test($))return!1;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test($)}function PJ($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let X=0,Z=null,J=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(Z=J,J=$.charAt(Q),J===" "&&!q){if(Z!==" ")X++;continue}if(J===q)q=null;else if((J==="'"||J==='"')&&!q)q=J;if(!Y[X])Y[X]="";Y[X]+=J}return Y}var D0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(D0||(D0={}));var q1;class K6{constructor($){q1=$}parse($,X){let Z=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},X),J=PJ($),q=typeof $==="string",Y=oB(Object.assign(Object.create(null),Z.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},Z.configuration),G=Object.assign(Object.create(null),Z.default),H=Z.configObjects||[],B=Z.envPrefix,K=Q["populate--"],U=K?"--":"_",W=Object.create(null),_=Object.create(null),R=Z.__||q1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},I=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,j=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(Z.array||[]).filter(Boolean).forEach(function(V){let F=typeof V==="object"?V.key:V,P=Object.keys(V).map(function(M){return{boolean:"bools",string:"strings",number:"numbers"}[M]}).filter(Boolean).pop();if(P)L[P][F]=!0;L.arrays[F]=!0,L.keys.push(F)}),[].concat(Z.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(Z.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(Z.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(Z.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(Z.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof Z.narg==="object")Object.entries(Z.narg).forEach(([V,F])=>{if(typeof F==="number")L.nargs[V]=F,L.keys.push(V)});if(typeof Z.coerce==="object")Object.entries(Z.coerce).forEach(([V,F])=>{if(typeof F==="function")L.coercions[V]=F,L.keys.push(V)});if(typeof Z.config<"u"){if(Array.isArray(Z.config)||typeof Z.config==="string")[].concat(Z.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof Z.config==="object")Object.entries(Z.config).forEach(([V,F])=>{if(typeof F==="boolean"||typeof F==="function")L.configs[V]=F})}H$(Z.key,Y,Z.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(F){G[F]=G[V]})});let N=null;B2();let u=[],x=Object.assign(Object.create(null),{_:[]}),n={};for(let V=0;V<J.length;V++){let F=J[V],P=F.replace(/^-{3,}/,"---"),M,T,D,O,k,L0;if(F!=="--"&&/^-/.test(F)&&s(F))i(F);else if(P.match(/^---+(=|$)/)){i(F);continue}else if(F.match(/^--.+=/)||!Q["short-option-groups"]&&F.match(/^-.+=/)){if(O=F.match(/^--?([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)if(b(O[1],L.arrays))V=F0(V,O[1],J,O[2]);else if(b(O[1],L.nargs)!==!1)V=t(V,O[1],J,O[2]);else l(O[1],O[2],!0)}else if(F.match(j)&&Q["boolean-negation"]){if(O=F.match(j),O!==null&&Array.isArray(O)&&O.length>=2)T=O[1],l(T,b(T,L.arrays)?[!1]:!1)}else if(F.match(/^--.+/)||!Q["short-option-groups"]&&F.match(/^-[^-]+/)){if(O=F.match(/^--?(.+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],b(T,L.arrays))V=F0(V,T,J);else if(b(T,L.nargs)!==!1)V=t(V,T,J);else if(k=J[V+1],k!==void 0&&(!k.match(/^-/)||k.match(I))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-.\..+=/)){if(O=F.match(/^-([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)l(O[1],O[2])}else if(F.match(/^-.\..+/)&&!F.match(I)){if(k=J[V+1],O=F.match(/^-(.\..+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],k!==void 0&&!k.match(/^-/)&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[^-]+/)&&!F.match(I)){D=F.slice(1,-1).split(""),M=!1;for(let M0=0;M0<D.length;M0++){if(k=F.slice(M0+2),D[M0+1]&&D[M0+1]==="="){if(L0=F.slice(M0+3),T=D[M0],b(T,L.arrays))V=F0(V,T,J,L0);else if(b(T,L.nargs)!==!1)V=t(V,T,J,L0);else l(T,L0);M=!0;break}if(k==="-"){l(D[M0],k);continue}if(/[A-Za-z]/.test(D[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)&&b(k,L.bools)===!1){l(D[M0],k),M=!0;break}if(D[M0+1]&&D[M0+1].match(/\W/)){l(D[M0],k),M=!0;break}else l(D[M0],d(D[M0]))}if(T=F.slice(-1)[0],!M&&T!=="-")if(b(T,L.arrays))V=F0(V,T,J);else if(b(T,L.nargs)!==!1)V=t(V,T,J);else if(k=J[V+1],k!==void 0&&(!/^(-|--)[^-]/.test(k)||k.match(I))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[0-9]$/)&&F.match(I)&&b(F.slice(1),L.bools))T=F.slice(1),l(T,d(T));else if(F==="--"){u=J.slice(V+1);break}else if(Q["halt-at-non-option"]){u=J.slice(V);break}else i(F)}if(z0(x,!0),z0(x,!1),v(x),r(),Y1(x,L.aliases,G,!0),o(x),Q["set-placeholder-key"])K0(x);if(Object.keys(L.counts).forEach(function(V){if(!e(x,V.split(".")))l(V,0)}),K&&u.length)x[U]=[];if(u.forEach(function(V){x[U].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(x).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete x[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete x[V.split(".").map((F)=>O1(F)).join(".")];delete x[V]});function i(V){let F=w("_",V);if(typeof F==="string"||typeof F==="number")x._.push(F)}function t(V,F,P,M){let T,D=b(F,L.nargs);if(D=typeof D!=="number"||isNaN(D)?1:D,D===0){if(!U0(M))N=Error(R("Argument unexpected for: %s",F));return l(F,d(F)),V}let O=U0(M)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+O<D)N=Error(R("Not enough arguments following: %s",F));O=D}else{for(T=V+1;T<P.length;T++)if(!P[T].match(/^-[^0-9]/)||P[T].match(I)||s(P[T]))O++;else break;if(O<D)N=Error(R("Not enough arguments following: %s",F))}let k=Math.min(O,D);if(!U0(M)&&k>0)l(F,M),k--;for(T=V+1;T<k+V+1;T++)l(F,P[T]);return V+k}function F0(V,F,P,M){let T=[],D=M||P[V+1],O=b(F,L.nargs);if(b(F,L.bools)&&!/^(true|false)$/.test(D))T.push(!0);else if(U0(D)||U0(M)&&/^-/.test(D)&&!I.test(D)&&!s(D)){if(G[F]!==void 0){let k=G[F];T=Array.isArray(k)?k:[k]}}else{if(!U0(M))T.push(E(F,M,!0));for(let k=V+1;k<P.length;k++){if(!Q["greedy-arrays"]&&T.length>0||O&&typeof O==="number"&&T.length>=O)break;if(D=P[k],/^-/.test(D)&&!I.test(D)&&!s(D))break;V=k,T.push(E(F,D,q))}}if(typeof O==="number"&&(O&&T.length<O||isNaN(O)&&T.length===0))N=Error(R("Not enough arguments following: %s",F));return l(F,T),V}function l(V,F,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let D=V.split(".").map(function(O){return O1(O)}).join(".");r0(V,D)}let M=E(V,F,P),T=V.split(".");if(s0(x,T,M),L.aliases[V])L.aliases[V].forEach(function(D){let O=D.split(".");s0(x,O,M)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(D){let O=D.split("."),k=[].concat(T);if(k.shift(),O=O.concat(k),!(L.aliases[V]||[]).includes(O.join(".")))s0(x,O,M)});if(b(V,L.normalize)&&!b(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(O){Object.defineProperty(n,O,{enumerable:!0,get(){return F},set(k){F=typeof k==="string"?q1.normalize(k):k}})})}function r0(V,F){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[F],W[F]=!0;if(!(L.aliases[F]&&L.aliases[F].length))r0(F,V)}function E(V,F,P){if(P)F=aB(F);if(b(V,L.bools)||b(V,L.counts)){if(typeof F==="string")F=F==="true"}let M=Array.isArray(F)?F.map(function(T){return w(V,T)}):w(V,F);if(b(V,L.counts)&&(U0(M)||typeof M==="boolean"))M=z6();if(b(V,L.normalize)&&b(V,L.arrays))if(Array.isArray(F))M=F.map((T)=>{return q1.normalize(T)});else M=q1.normalize(F);return M}function w(V,F){if(!Q["parse-positional-numbers"]&&V==="_")return F;if(!b(V,L.strings)&&!b(V,L.bools)&&!Array.isArray(F)){if(e4(F)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${F}`)))||!U0(F)&&b(V,L.numbers))F=Number(F)}return F}function v(V){let F=Object.create(null);Y1(F,L.aliases,G),Object.keys(L.configs).forEach(function(P){let M=V[P]||F[P];if(M)try{let T=null,D=q1.resolve(q1.cwd(),M),O=L.configs[P];if(typeof O==="function"){try{T=O(D)}catch(k){T=k}if(T instanceof Error){N=T;return}}else T=q1.require(D);m(T)}catch(T){if(T.name==="PermissionDenied")N=T;else if(V[P])N=Error(R("Invalid JSON config file: %s",M))}})}function m(V,F){Object.keys(V).forEach(function(P){let M=V[P],T=F?F+"."+P:P;if(typeof M==="object"&&M!==null&&!Array.isArray(M)&&Q["dot-notation"])m(M,T);else if(!e(x,T.split("."))||b(T,L.arrays)&&Q["combine-arrays"])l(T,M)})}function r(){if(typeof H<"u")H.forEach(function(V){m(V)})}function z0(V,F){if(typeof B>"u")return;let P=typeof B==="string"?B:"",M=q1.env();Object.keys(M).forEach(function(T){if(P===""||T.lastIndexOf(P,0)===0){let D=T.split("__").map(function(O,k){if(k===0)O=O.substring(P.length);return O1(O)});if((F&&L.configs[D.join(".")]||!F)&&!e(V,D))l(D.join("."),M[T])}})}function o(V){let F,P=new Set;Object.keys(V).forEach(function(M){if(!P.has(M)){if(F=b(M,L.coercions),typeof F==="function")try{let T=w(M,F(V[M]));[].concat(L.aliases[M]||[],M).forEach((D)=>{P.add(D),V[D]=T})}catch(T){N=T}}})}function K0(V){return L.keys.forEach((F)=>{if(~F.indexOf("."))return;if(typeof V[F]>"u")V[F]=void 0}),V}function Y1(V,F,P,M=!1){Object.keys(P).forEach(function(T){if(!e(V,T.split("."))){if(s0(V,T.split("."),P[T]),M)_[T]=!0;(F[T]||[]).forEach(function(D){if(e(V,D.split(".")))return;s0(V,D.split("."),P[T])})}})}function e(V,F){let P=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(T){P=P[T]||{}});let M=F[F.length-1];if(typeof P!=="object")return!1;else return M in P}function s0(V,F,P){let M=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(L0){if(L0=CJ(L0),typeof M==="object"&&M[L0]===void 0)M[L0]={};if(typeof M[L0]!=="object"||Array.isArray(M[L0])){if(Array.isArray(M[L0]))M[L0].push({});else M[L0]=[M[L0],{}];M=M[L0][M[L0].length-1]}else M=M[L0]});let T=CJ(F[F.length-1]),D=b(F.join("."),L.arrays),O=Array.isArray(P),k=Q["duplicate-arguments-array"];if(!k&&b(T,L.nargs)){if(k=!0,!U0(M[T])&&L.nargs[T]===1||Array.isArray(M[T])&&M[T].length===L.nargs[T])M[T]=void 0}if(P===z6())M[T]=z6(M[T]);else if(Array.isArray(M[T]))if(k&&D&&O)M[T]=Q["flatten-duplicate-arrays"]?M[T].concat(P):(Array.isArray(M[T][0])?M[T]:[M[T]]).concat([P]);else if(!k&&Boolean(D)===Boolean(O))M[T]=P;else M[T]=M[T].concat([P]);else if(M[T]===void 0&&D)M[T]=O?P:[P];else if(k&&!(M[T]===void 0||b(T,L.counts)||b(T,L.bools)))M[T]=[M[T],P];else M[T]=P}function H$(...V){V.forEach(function(F){Object.keys(F||{}).forEach(function(P){if(L.aliases[P])return;L.aliases[P]=[].concat(Y[P]||[]),L.aliases[P].concat(P).forEach(function(M){if(/-/.test(M)&&Q["camel-case-expansion"]){let T=O1(M);if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),W[T]=!0}}),L.aliases[P].concat(P).forEach(function(M){if(M.length>1&&/[A-Z]/.test(M)&&Q["camel-case-expansion"]){let T=s4(M,"-");if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),W[T]=!0}}),L.aliases[P].forEach(function(M){L.aliases[M]=[P].concat(L.aliases[P].filter(function(T){return M!==T}))})})})}function b(V,F){let P=[].concat(L.aliases[V]||[],V),M=Object.keys(F),T=P.find((D)=>M.includes(D));return T?F[T]:!1}function m1(V){let F=Object.keys(L);return[].concat(F.map((M)=>L[M])).some(function(M){return Array.isArray(M)?M.includes(V):M[V]})}function v6(V,...F){return[].concat(...F).some(function(M){let T=V.match(M);return T&&m1(T[1])})}function y(V){if(V.match(I)||!V.match(/^-[^-]+/))return!1;let F=!0,P,M=V.slice(1).split("");for(let T=0;T<M.length;T++){if(P=V.slice(T+2),!m1(M[T])){F=!1;break}if(M[T+1]&&M[T+1]==="="||P==="-"||/[A-Za-z]/.test(M[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||M[T+1]&&M[T+1].match(/\W/))break}return F}function s(V){return Q["unknown-options-as-args"]&&B0(V)}function B0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(I))return!1;if(y(V))return!1;return!v6(V,/^-+([^=]+?)=[\s\S]*$/,j,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!b(V,L.bools)&&!b(V,L.counts)&&`${V}`in G)return G[V];else return R0(q0(V))}function R0(V){return{[D0.BOOLEAN]:!0,[D0.STRING]:"",[D0.NUMBER]:void 0,[D0.ARRAY]:[]}[V]}function q0(V){let F=D0.BOOLEAN;if(b(V,L.strings))F=D0.STRING;else if(b(V,L.numbers))F=D0.NUMBER;else if(b(V,L.bools))F=D0.BOOLEAN;else if(b(V,L.arrays))F=D0.ARRAY;return F}function U0(V){return V===void 0}function B2(){Object.keys(L.counts).find((V)=>{if(b(V,L.arrays))return N=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(b(V,L.nargs))return N=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(n,x),configuration:Q,defaulted:Object.assign({},_),error:N,newAliases:Object.assign({},W)}}}function oB($){let X=[],Z=Object.create(null),J=!0;Object.keys($).forEach(function(q){X.push([].concat($[q],q))});while(J){J=!1;for(let q=0;q<X.length;q++)for(let Y=q+1;Y<X.length;Y++)if(X[q].filter(function(G){return X[Y].indexOf(G)!==-1}).length){X[q]=X[q].concat(X[Y]),X.splice(Y,1),J=!0;break}}return X.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")Z[Y]=q}),Z}function z6($){return $!==void 0?$+1:1}function CJ($){if($==="__proto__")return"___proto___";return $}function aB($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var B6,U6,W6,jJ=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,xJ=(U6=(B6=process===null||process===void 0?void 0:process.versions)===null||B6===void 0?void 0:B6.node)!==null&&U6!==void 0?U6:(W6=process===null||process===void 0?void 0:process.version)===null||W6===void 0?void 0:W6.slice(1);if(xJ){if(Number(xJ.match(/^([^.]+)/)[1])<jJ)throw Error(`yargs parser supports a minimum Node.js version of ${jJ}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var $U=process?process.env:{},IJ=new K6({cwd:process.cwd,env:()=>{return $U},format:rB,normalize:sB,resolve:eB,require:($)=>{return W0($)}}),I$=function(X,Z){return IJ.parse(X.slice(),Z).argv};I$.detailed=function($,X){return IJ.parse($.slice(),X)};I$.camelCase=O1;I$.decamelize=s4;I$.looksLikeNumber=e4;var V6=I$;import{basename as VU,dirname as LU,extname as _U,relative as RU,resolve as DJ}from"path";function wJ(){if(XU())return 0;return 1}function XU(){return ZU()&&!process.defaultApp}function ZU(){return!!process.versions.electron}function L6($){return $.slice(wJ()+1)}function OJ(){return process.argv[wJ()]}class X0 extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,X0)}}import{readFileSync as JU,statSync as QU,writeFile as qU}from"fs";import{format as YU}from"util";import{resolve as GU}from"path";var EJ={fs:{readFileSync:JU,writeFile:qU},format:YU,resolve:GU,exists:($)=>{try{return QU($).isFile()}catch(X){return!1}}};var u0;class AJ{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let X=$.shift(),Z=function(){};if(typeof $[$.length-1]==="function")Z=$.pop();if(Z=Z||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][X]&&this.updateFiles)this.cache[this.locale][X]=X,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:Z});else Z();return u0.format.apply(u0.format,[this.cache[this.locale][X]||X].concat($))}__n(){let $=Array.prototype.slice.call(arguments),X=$.shift(),Z=$.shift(),J=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=J===1?X:Z;if(this.cache[this.locale][X])Y=this.cache[this.locale][X][J===1?"one":"other"];if(!this.cache[this.locale][X]&&this.updateFiles)this.cache[this.locale][X]={one:X,other:Z},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(J);return u0.format.apply(u0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let X in $)if(Object.prototype.hasOwnProperty.call($,X))this.cache[this.locale][X]=$[X]}_taggedLiteral($,...X){let Z="";return $.forEach(function(J,q){let Y=X[q+1];if(Z+=J,typeof Y<"u")Z+="%s"}),this.__.apply(this,[Z].concat([].slice.call(X,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,X=this.writeQueue[0],Z=X.directory,J=X.locale,q=X.cb,Y=this._resolveLocaleFile(Z,J),Q=JSON.stringify(this.cache[J],null,2);u0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},X=this._resolveLocaleFile(this.directory,this.locale);try{if(u0.fs.readFileSync)$=JSON.parse(u0.fs.readFileSync(X,"utf-8"))}catch(Z){if(Z instanceof SyntaxError)Z.message="syntax error in "+X;if(Z.code==="ENOENT")$={};else throw Z}this.cache[this.locale]=$}_resolveLocaleFile($,X){let Z=u0.resolve($,"./",X+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(Z)&&~X.lastIndexOf("_")){let J=u0.resolve($,"./",X.split("_")[0]+".json");if(this._fileExistsSync(J))Z=J}return Z}_fileExistsSync($){return u0.exists($)}}function hJ($,X){u0=X;let Z=new AJ($);return{__:Z.__.bind(Z),__n:Z.__n.bind(Z),setLocale:Z.setLocale.bind(Z),getLocale:Z.getLocale.bind(Z),updateLocale:Z.updateLocale.bind(Z),locale:Z.locale}}var HU=($)=>{return hJ($,EJ)},NJ=HU;var TU="require is not supported by ESM",SJ="loading a directory of commands is not supported yet for ESM",w$;try{w$=WU(import.meta.url)}catch($){w$=process.cwd()}var FU=w$.substring(0,w$.lastIndexOf("node_modules")),_6={assert:{notStrictEqual:zU,strictEqual:KU},cliui:G6,findUp:H6,getEnv:($)=>{return process.env[$]},inspect:BU,getCallerFile:()=>{throw new X0(SJ)},getProcessArgvBin:OJ,mainFilename:FU||process.cwd(),Parser:V6,path:{basename:VU,dirname:LU,extname:_U,relative:RU,resolve:DJ},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,X)=>process.emitWarning($,X),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:UU,require:()=>{throw new X0(TU)},requireDirectory:()=>{throw new X0(SJ)},stringWidth:($)=>{return[...$].length},y18n:NJ({directory:DJ(w$,"../../../locales"),updateFiles:!1})};function j0($,X,Z,J){Z.assert.notStrictEqual($,X,J)}function R6($,X){X.assert.strictEqual(typeof $,"string")}function J$($){return Object.keys($)}function Z0($){return!!$&&!!$.then&&typeof $.then==="function"}function W1($){let Z=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),J=/\.*[\][<>]/g,q=Z.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(J,""),demanded:[],optional:[]};return Z.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===Z.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(J,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(J,"").split("|"),variadic:H})}),Y}var MU=["first","second","third","fourth","fifth","sixth"];function A($,X,Z){function J(){return typeof $==="object"?[{demanded:[],optional:[]},$,X]:[W1(`cmd ${$}`),X,Z]}try{let q=0,[Y,Q,G]=J(),H=[].slice.call(Q);while(H.length&&H[H.length-1]===void 0)H.pop();let B=G||H.length;if(B<Y.demanded.length)throw new X0(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let K=Y.demanded.length+Y.optional.length;if(B>K)throw new X0(`Too many arguments provided. Expected max ${K} but received ${B}.`);Y.demanded.forEach((U)=>{let W=H.shift(),_=vJ(W);if(U.cmd.filter((L)=>L===_||L==="*").length===0)fJ(_,U.cmd,q);q+=1}),Y.optional.forEach((U)=>{if(H.length===0)return;let W=H.shift(),_=vJ(W);if(U.cmd.filter((L)=>L===_||L==="*").length===0)fJ(_,U.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function vJ($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function fJ($,X,Z){throw new X0(`Invalid ${MU[Z]||"manyith"} argument. Expected ${X.join(" or ")} but received ${$}.`)}class T6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,X,Z=!0,J=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[$,X,Z],arguments.length),Array.isArray($)){for(let q=0;q<$.length;q++){if(typeof $[q]!=="function")throw Error("middleware must be a function");let Y=$[q];Y.applyBeforeValidation=X,Y.global=Z}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=X,q.global=Z,q.mutates=J,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,X){let Z=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((J)=>{let q=[...Z[X]||[],X];if(!J.option)return!0;else return!q.includes(J.option)}),$.option=X,this.addMiddleware($,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let $=this.frozens.pop();if($!==void 0)this.globalMiddleware=$}reset(){this.globalMiddleware=this.globalMiddleware.filter(($)=>$.global)}}function kJ($){if(!$)return[];return $.map((X)=>{return X.applyBeforeValidation=!1,X})}function E1($,X,Z,J){return Z.reduce((q,Y)=>{if(Y.applyBeforeValidation!==J)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(Z0(q))return q.then((Q)=>Promise.all([Q,Y(Q,X)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,X);return Z0(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function A1($,X,Z=(J)=>{throw J}){try{let J=PU($)?$():$;return Z0(J)?J.then((q)=>X(q)):X(J)}catch(J){return Z(J)}}function PU($){return typeof $==="function"}function F6($){for(let X=0,Z=Object.keys(W0.cache),J;X<Z.length;X++)if(J=W0.cache[Z[X]],J.exports===$)return J;return null}var Q$=/(^\*)|(^\$0)/;class yJ{constructor($,X,Z,J){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=J,this.usage=$,this.globalMiddleware=Z,this.validation=X}addDirectory($,X,Z,J){if(J=J||{},typeof J.recurse!=="boolean")J.recurse=!1;if(!Array.isArray(J.extensions))J.extensions=["js"];let q=typeof J.visit==="function"?J.visit:(Y)=>Y;J.visit=(Y,Q,G)=>{let H=q(Y,Q,G);if(H){if(this.requireCache.has(Q))return H;else this.requireCache.add(Q);this.addHandler(H)}return H},this.shim.requireDirectory({require:X,filename:Z},$,J)}addHandler($,X,Z,J,q,Y){let Q=[],G=kJ(q);if(J=J||(()=>{}),Array.isArray($))if(CU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(xU($)){let H=Array.isArray($.command)||typeof $.command==="string"?$.command:this.moduleName($);if($.aliases)H=[].concat(H).concat($.aliases);this.addHandler(H,this.extractDesc($),$.builder,$.handler,$.middlewares,$.deprecated);return}else if(bJ(Z)){this.addHandler([$].concat(Q),X,Z.builder,Z.handler,Z.middlewares,Z.deprecated);return}if(typeof $==="string"){let H=W1($);Q=Q.map((U)=>W1(U).cmd);let B=!1,K=[H.cmd].concat(Q).filter((U)=>{if(Q$.test(U))return B=!0,!1;return!0});if(K.length===0&&B)K.push("$0");if(B)H.cmd=K[0],Q=K.slice(1),$=$.replace(Q$,H.cmd);if(Q.forEach((U)=>{this.aliasMap[U]=H.cmd}),X!==!1)this.usage.command($,X,B,Q,Y);if(this.handlers[H.cmd]={original:$,description:X,handler:J,builder:Z||{},middlewares:G,deprecated:Y,demanded:H.demanded,optional:H.optional},B)this.defaultCommand=this.handlers[H.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand($,X,Z,J,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=X.getInternalMethods().getContext(),H=G.commands.slice(),B=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let K=this.applyBuilderUpdateUsageAndParse(B,Q,X,Z.aliases,H,J,q,Y);return Z0(K)?K.then((U)=>this.applyMiddlewareAndGetResult(B,Q,U.innerArgv,G,q,U.aliases,X)):this.applyMiddlewareAndGetResult(B,Q,K.innerArgv,G,q,K.aliases,X)}applyBuilderUpdateUsageAndParse($,X,Z,J,q,Y,Q,G){let H=X.builder,B=Z;if($2(H)){Z.getInternalMethods().getUsageInstance().freeze();let K=H(Z.getInternalMethods().reset(J),G);if(Z0(K))return K.then((U)=>{return B=mJ(U)?U:Z,this.parseAndUpdateUsage($,X,B,q,Y,Q)})}else if(jU(H))Z.getInternalMethods().getUsageInstance().freeze(),B=Z.getInternalMethods().reset(J),Object.keys(X.builder).forEach((K)=>{B.option(K,H[K])});return this.parseAndUpdateUsage($,X,B,q,Y,Q)}parseAndUpdateUsage($,X,Z,J,q,Y){if($)Z.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(Z))Z.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(J,X),X.description);let Q=Z.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return Z0(Q)?Q.then((G)=>({aliases:Z.parsed.aliases,innerArgv:G})):{aliases:Z.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,X){let Z=Q$.test(X.original)?X.original.replace(Q$,"").trim():X.original,J=$.filter((q)=>{return!Q$.test(q)});return J.push(Z),`$0 ${J.join(" ")}`}handleValidationAndGetResult($,X,Z,J,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);Z=A1(Z,(B)=>{return H(B),B})}if(X.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(Z,H,!1,!1),Z=E1(Z,Y,Q,!1),Z=A1(Z,(B)=>{let K=X.handler(B);return Z0(K)?K.then(()=>B):B}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(Z0(Z)&&!Y.getInternalMethods().hasParseCallback())Z.catch((B)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,B)}catch(K){}})}if(!$)J.commands.pop(),J.fullCommands.pop();return Z}applyMiddlewareAndGetResult($,X,Z,J,q,Y,Q){let G={};if(q)return Z;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(X,Z,J,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(X.middlewares),B=E1(Z,Q,H,!0);return Z0(B)?B.then((K)=>this.handleValidationAndGetResult($,X,K,J,Y,Q,H,G)):this.handleValidationAndGetResult($,X,B,J,Y,Q,H,G)}populatePositionals($,X,Z,J){X._=X._.slice(Z.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,X._.length);while(q.length){let G=q.shift();this.populatePositional(G,X,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,X,Q)}return X._=Z.commands.concat(X._.map((G)=>""+G)),this.postProcessPositionals(X,Q,this.cmdToParseOptions($.original),J),Q}populatePositional($,X,Z){let J=$.cmd[0];if($.variadic)Z[J]=X._.splice(0).map(String);else if(X._.length)Z[J]=[String(X._.shift())]}cmdToParseOptions($){let X={array:[],default:{},alias:{},demand:{}},Z=W1($);return Z.demanded.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)X.array.push(q),X.default[q]=[];X.alias[q]=Y,X.demand[q]=!0}),Z.optional.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)X.array.push(q),X.default[q]=[];X.alias[q]=Y}),X}postProcessPositionals($,X,Z,J){let q=Object.assign({},J.getOptions());q.default=Object.assign(Z.default,q.default);for(let H of Object.keys(Z.alias))q.alias[H]=(q.alias[H]||[]).concat(Z.alias[H]);q.array=q.array.concat(Z.array),q.config={};let Y=[];if(Object.keys(X).forEach((H)=>{X[H].map((B)=>{if(q.configuration["unknown-options-as-args"])q.key[H]=!0;Y.push(`--${H}`),Y.push(B)})}),!Y.length)return;let Q=Object.assign({},q.configuration,{"populate--":!1}),G=this.shim.Parser.detailed(Y,Object.assign({},q,{configuration:Q}));if(G.error)J.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(X);Object.keys(X).forEach((B)=>{H.push(...G.aliases[B])}),Object.keys(G.argv).forEach((B)=>{if(H.includes(B)){if(!X[B])X[B]=G.argv[B];if(!this.isInConfigs(J,B)&&!this.isDefaulted(J,B)&&Object.prototype.hasOwnProperty.call($,B)&&Object.prototype.hasOwnProperty.call(G.argv,B)&&(Array.isArray($[B])||Array.isArray(G.argv[B])))$[B]=[].concat($[B],G.argv[B]);else $[B]=G.argv[B]}})}}isDefaulted($,X){let{default:Z}=$.getOptions();return Object.prototype.hasOwnProperty.call(Z,X)||Object.prototype.hasOwnProperty.call(Z,this.shim.Parser.camelCase(X))}isInConfigs($,X){let{configObjects:Z}=$.getOptions();return Z.some((J)=>Object.prototype.hasOwnProperty.call(J,X))||Z.some((J)=>Object.prototype.hasOwnProperty.call(J,this.shim.Parser.camelCase(X)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let Z=Q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(Z,this.defaultCommand.description)}let X=this.defaultCommand.builder;if($2(X))return X($,!0);else if(!bJ(X))Object.keys(X).forEach((Z)=>{$.option(Z,X[Z])});return}moduleName($){let X=F6($);if(!X)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(X.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:X,desc:Z}){for(let J of[$,X,Z]){if(typeof J==="string"||J===!1)return J;j0(J,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();j0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function gJ($,X,Z,J){return new yJ($,X,Z,J)}function bJ($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function CU($){return $.every((X)=>typeof X==="string")}function $2($){return typeof $==="function"}function jU($){return typeof $==="object"}function xU($){return typeof $==="object"&&!Array.isArray($)}function V1($={},X=()=>!0){let Z={};return J$($).forEach((J)=>{if(X(J,$[J]))Z[J]=$[J]}),Z}function L1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((X)=>{let Z=X;if(Z._handle&&Z.isTTY&&typeof Z._handle.setBlocking==="function")Z._handle.setBlocking($)})}function IU($){return typeof $==="boolean"}function uJ($,X){let Z=X.y18n.__,J={},q=[];J.failFn=function(w){q.push(w)};let Y=null,Q=null,G=!0;J.showHelpOnFail=function(w=!0,v){let[m,r]=typeof w==="string"?[!0,w]:[w,v];if($.getInternalMethods().isGlobalContext())Q=r;return Y=r,G=m,J};let H=!1;J.fail=function(w,v){let m=$.getInternalMethods().getLoggerInstance();if(q.length)for(let r=q.length-1;r>=0;--r){let z0=q[r];if(IU(z0)){if(v)throw v;else if(w)throw Error(w)}else z0(w,v,J)}else{if($.getExitProcess())L1(!0);if(!H){if(H=!0,G)$.showHelp("error"),m.error();if(w||v)m.error(w||v);let r=Y||Q;if(r){if(w||v)m.error("");m.error(r)}}if(v=v||new X0(w),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,v);else throw v}};let B=[],K=!1;J.usage=(E,w)=>{if(E===null)return K=!0,B=[],J;return K=!1,B.push([E,w||""]),J},J.getUsage=()=>{return B},J.getUsageDisabled=()=>{return K},J.getPositionalGroupName=()=>{return Z("Positionals:")};let U=[];J.example=(E,w)=>{U.push([E,w||""])};let W=[];J.command=function(w,v,m,r,z0=!1){if(m)W=W.map((o)=>{return o[2]=!1,o});W.push([w,v||"",m,r,z0])},J.getCommands=()=>W;let _={};J.describe=function(w,v){if(Array.isArray(w))w.forEach((m)=>{J.describe(m,v)});else if(typeof w==="object")Object.keys(w).forEach((m)=>{J.describe(m,w[m])});else _[w]=v},J.getDescriptions=()=>_;let R=[];J.epilog=(E)=>{R.push(E)};let L=!1,I;J.wrap=(E)=>{L=!0,I=E},J.getWrap=()=>{if(X.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)I=F0(),L=!0;return I};let j="__yargsString__:";J.deferY18nLookup=(E)=>j+E,J.help=function(){if(x)return x;u();let w=$.customScriptName?$.$0:X.path.basename($.$0),v=$.getDemandedOptions(),m=$.getDemandedCommands(),r=$.getDeprecatedOptions(),z0=$.getGroups(),o=$.getOptions(),K0=[];K0=K0.concat(Object.keys(_)),K0=K0.concat(Object.keys(v)),K0=K0.concat(Object.keys(m)),K0=K0.concat(Object.keys(o.default)),K0=K0.filter(i),K0=Object.keys(K0.reduce((y,s)=>{if(s!=="_")y[s]=!0;return y},{}));let Y1=J.getWrap(),e=X.cliui({width:Y1,wrap:!!Y1});if(!K){if(B.length)B.forEach((y)=>{if(e.div({text:`${y[0].replace(/\$0/g,w)}`}),y[1])e.div({text:`${y[1]}`,padding:[1,0,0,0]})}),e.div();else if(W.length){let y=null;if(m._)y=`${w} <${Z("command")}>
104
- `;else y=`${w} [${Z("command")}]
105
- `;e.div(`${y}`)}}if(W.length>1||W.length===1&&!W[0][2]){e.div(Z("Commands:"));let y=$.getInternalMethods().getContext(),s=y.commands.length?`${y.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)W=W.sort((d,R0)=>d[0].localeCompare(R0[0]));let B0=w?`${w} `:"";W.forEach((d)=>{let R0=`${B0}${s}${d[0].replace(/^\$0 ?/,"")}`;e.span({text:R0,padding:[0,2,0,2],width:N(W,Y1,`${w}${s}`)+4},{text:d[1]});let q0=[];if(d[2])q0.push(`[${Z("default")}]`);if(d[3]&&d[3].length)q0.push(`[${Z("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")q0.push(`[${Z("deprecated: %s",d[4])}]`);else q0.push(`[${Z("deprecated")}]`);if(q0.length)e.div({text:q0.join(" "),padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}let s0=(Object.keys(o.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);K0=K0.filter((y)=>!$.parsed.newAliases[y]&&s0.every((s)=>(o.alias[s]||[]).indexOf(y)===-1));let H$=Z("Options:");if(!z0[H$])z0[H$]=[];n(K0,o.alias,z0,H$);let b=(y)=>/^--/.test(X2(y)),m1=Object.keys(z0).filter((y)=>z0[y].length>0).map((y)=>{let s=z0[y].filter(i).map((B0)=>{if(s0.includes(B0))return B0;for(let d=0,R0;(R0=s0[d])!==void 0;d++)if((o.alias[R0]||[]).includes(B0))return R0;return B0});return{groupName:y,normalizedKeys:s}}).filter(({normalizedKeys:y})=>y.length>0).map(({groupName:y,normalizedKeys:s})=>{let B0=s.reduce((d,R0)=>{return d[R0]=[R0].concat(o.alias[R0]||[]).map((q0)=>{if(y===J.getPositionalGroupName())return q0;else return(/^[0-9]$/.test(q0)?o.boolean.includes(R0)?"-":"--":q0.length>1?"--":"-")+q0}).sort((q0,U0)=>b(q0)===b(U0)?0:b(q0)?1:-1).join(", "),d},{});return{groupName:y,normalizedKeys:s,switches:B0}});if(m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).some(({normalizedKeys:y,switches:s})=>!y.every((B0)=>b(s[B0]))))m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).forEach(({normalizedKeys:y,switches:s})=>{y.forEach((B0)=>{if(b(s[B0]))s[B0]=wU(s[B0],4)})});if(m1.forEach(({groupName:y,normalizedKeys:s,switches:B0})=>{e.div(y),s.forEach((d)=>{let R0=B0[d],q0=_[d]||"",U0=null;if(q0.includes(j))q0=Z(q0.substring(j.length));if(o.boolean.includes(d))U0=`[${Z("boolean")}]`;if(o.count.includes(d))U0=`[${Z("count")}]`;if(o.string.includes(d))U0=`[${Z("string")}]`;if(o.normalize.includes(d))U0=`[${Z("string")}]`;if(o.array.includes(d))U0=`[${Z("array")}]`;if(o.number.includes(d))U0=`[${Z("number")}]`;let B2=(P)=>typeof P==="string"?`[${Z("deprecated: %s",P)}]`:`[${Z("deprecated")}]`,V=[d in r?B2(r[d]):null,U0,d in v?`[${Z("required")}]`:null,o.choices&&o.choices[d]?`[${Z("choices:")} ${J.stringifiedValues(o.choices[d])}]`:null,t(o.default[d],o.defaultDescription[d])].filter(Boolean).join(" ");e.span({text:X2(R0),padding:[0,2,0,2+cJ(R0)],width:N(B0,Y1)+4},q0);let F=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!F)e.div({text:V,padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}),U.length)e.div(Z("Examples:")),U.forEach((y)=>{y[0]=y[0].replace(/\$0/g,w)}),U.forEach((y)=>{if(y[1]==="")e.div({text:y[0],padding:[0,2,0,2]});else e.div({text:y[0],padding:[0,2,0,2],width:N(U,Y1)+4},{text:y[1]})}),e.div();if(R.length>0){let y=R.map((s)=>s.replace(/\$0/g,w)).join(`
102
+ `);if(q.border)J.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),J.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)J.unshift(...Array(q.padding[0]||0).fill("")),J.push(...Array(q.padding[2]||0).fill(""));J.forEach((Q,G)=>{if(!Z[G])Z.push([]);let H=Z[G];for(let K=0;K<Y;K++)if(H[K]===void 0)H.push("");H.push(Q)})}),Z}negatePadding($){let Z=$.width||0;if($.padding)Z-=($.padding[3]||0)+($.padding[1]||0);if($.border)Z-=4;return Z}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||w0.stringWidth(Y.text)});let Z=$.length,X=this.width,J=$.map((Y)=>{if(Y.width)return Z--,X-=Y.width,Y.width;return}),q=Z?Math.floor(X/Z):0;return J.map((Y,Q)=>{if(Y===void 0)return Math.max(q,iB($[Q]));return Y})}}function TJ($,Z,X){if($.border){if(/[.']-+[.']/.test(Z))return"";if(Z.trim().length!==0)return X;return" "}return""}function iB($){let Z=$.padding||[],X=1+(Z[3]||0)+(Z[1]||0);if($.border)return X+4;return X}function tB(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function oB($,Z){$=$.trim();let X=w0.stringWidth($);if(X<Z)return" ".repeat(Z-X)+$;return $}function aB($,Z){$=$.trim();let X=w0.stringWidth($);if(X>=Z)return $;return" ".repeat(Z-X>>1)+$}var w0;function MJ($,Z){return w0=Z,new FJ({width:($===null||$===void 0?void 0:$.width)||tB(),wrap:$===null||$===void 0?void 0:$.wrap})}var CJ=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function z6($){return $.replace(CJ,"")}function PJ($,Z){let[X,J]=$.match(CJ)||["",""];$=z6($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%Z===0)q+=`
103
+ `;q+=$.charAt(Y)}if(X&&J)q=`${X}${q}${J}`;return q}function K6($){return MJ($,{stringWidth:(Z)=>{return[...Z].length},stripAnsi:z6,wrap:PJ})}import{dirname as xJ,resolve as jJ}from"path";import{readdirSync as rB,statSync as sB}from"fs";function B6($,Z){let X=jJ(".",$),J;if(!sB(X).isDirectory())X=xJ(X);while(!0){if(J=Z(X,rB(X)),J)return jJ(X,J);if(X=xJ(J=X),J===X)break}}import{inspect as LU}from"util";import{readFileSync as _U}from"fs";import{fileURLToPath as RU}from"url";import{format as ZU}from"util";import{normalize as XU,resolve as JU}from"path";function O1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let X="",J=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(J)J=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))J=!0;else if(Q!=="-"&&Q!=="_")X+=Q}return X}}function e4($,Z){let X=$.toLowerCase();Z=Z||"-";let J="";for(let q=0;q<$.length;q++){let Y=X.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)J+=`${Z}${X.charAt(q)}`;else J+=Q}return J}function $2($){if($===null||$===void 0)return!1;if(typeof $==="number")return!0;if(/^0x[0-9a-f]+$/i.test($))return!0;if(/^0[^.]/.test($))return!1;return/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test($)}function IJ($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let Z=0,X=null,J=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(X=J,J=$.charAt(Q),J===" "&&!q){if(X!==" ")Z++;continue}if(J===q)q=null;else if((J==="'"||J==='"')&&!q)q=J;if(!Y[Z])Y[Z]="";Y[Z]+=J}return Y}var S0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(S0||(S0={}));var Y1;class W6{constructor($){Y1=$}parse($,Z){let X=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},Z),J=IJ($),q=typeof $==="string",Y=eB(Object.assign(Object.create(null),X.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},X.configuration),G=Object.assign(Object.create(null),X.default),H=X.configObjects||[],K=X.envPrefix,W=Q["populate--"],U=W?"--":"_",B=Object.create(null),R=Object.create(null),_=X.__||Y1.format,L={aliases:Object.create(null),arrays:Object.create(null),bools:Object.create(null),strings:Object.create(null),numbers:Object.create(null),counts:Object.create(null),normalize:Object.create(null),configs:Object.create(null),nargs:Object.create(null),coercions:Object.create(null),keys:[]},j=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(X.array||[]).filter(Boolean).forEach(function(V){let F=typeof V==="object"?V.key:V,P=Object.keys(V).map(function(M){return{boolean:"bools",string:"strings",number:"numbers"}[M]}).filter(Boolean).pop();if(P)L[P][F]=!0;L.arrays[F]=!0,L.keys.push(F)}),[].concat(X.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(X.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(X.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(X.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(X.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof X.narg==="object")Object.entries(X.narg).forEach(([V,F])=>{if(typeof F==="number")L.nargs[V]=F,L.keys.push(V)});if(typeof X.coerce==="object")Object.entries(X.coerce).forEach(([V,F])=>{if(typeof F==="function")L.coercions[V]=F,L.keys.push(V)});if(typeof X.config<"u"){if(Array.isArray(X.config)||typeof X.config==="string")[].concat(X.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof X.config==="object")Object.entries(X.config).forEach(([V,F])=>{if(typeof F==="boolean"||typeof F==="function")L.configs[V]=F})}z$(X.key,Y,X.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(F){G[F]=G[V]})});let N=null;V2();let c=[],I=Object.assign(Object.create(null),{_:[]}),n={};for(let V=0;V<J.length;V++){let F=J[V],P=F.replace(/^-{3,}/,"---"),M,T,D,O,k,_0;if(F!=="--"&&/^-/.test(F)&&s(F))i(F);else if(P.match(/^---+(=|$)/)){i(F);continue}else if(F.match(/^--.+=/)||!Q["short-option-groups"]&&F.match(/^-.+=/)){if(O=F.match(/^--?([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)if(b(O[1],L.arrays))V=K0(V,O[1],J,O[2]);else if(b(O[1],L.nargs)!==!1)V=a(V,O[1],J,O[2]);else l(O[1],O[2],!0)}else if(F.match(C)&&Q["boolean-negation"]){if(O=F.match(C),O!==null&&Array.isArray(O)&&O.length>=2)T=O[1],l(T,b(T,L.arrays)?[!1]:!1)}else if(F.match(/^--.+/)||!Q["short-option-groups"]&&F.match(/^-[^-]+/)){if(O=F.match(/^--?(.+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!k.match(/^-/)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-.\..+=/)){if(O=F.match(/^-([^=]+)=([\s\S]*)$/),O!==null&&Array.isArray(O)&&O.length>=3)l(O[1],O[2])}else if(F.match(/^-.\..+/)&&!F.match(j)){if(k=J[V+1],O=F.match(/^-(.\..+)/),O!==null&&Array.isArray(O)&&O.length>=2)if(T=O[1],k!==void 0&&!k.match(/^-/)&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[^-]+/)&&!F.match(j)){D=F.slice(1,-1).split(""),M=!1;for(let M0=0;M0<D.length;M0++){if(k=F.slice(M0+2),D[M0+1]&&D[M0+1]==="="){if(_0=F.slice(M0+3),T=D[M0],b(T,L.arrays))V=K0(V,T,J,_0);else if(b(T,L.nargs)!==!1)V=a(V,T,J,_0);else l(T,_0);M=!0;break}if(k==="-"){l(D[M0],k);continue}if(/[A-Za-z]/.test(D[M0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(k)&&b(k,L.bools)===!1){l(D[M0],k),M=!0;break}if(D[M0+1]&&D[M0+1].match(/\W/)){l(D[M0],k),M=!0;break}else l(D[M0],d(D[M0]))}if(T=F.slice(-1)[0],!M&&T!=="-")if(b(T,L.arrays))V=K0(V,T,J);else if(b(T,L.nargs)!==!1)V=a(V,T,J);else if(k=J[V+1],k!==void 0&&(!/^(-|--)[^-]/.test(k)||k.match(j))&&!b(T,L.bools)&&!b(T,L.counts))l(T,k),V++;else if(/^(true|false)$/.test(k))l(T,k),V++;else l(T,d(T))}else if(F.match(/^-[0-9]$/)&&F.match(j)&&b(F.slice(1),L.bools))T=F.slice(1),l(T,d(T));else if(F==="--"){c=J.slice(V+1);break}else if(Q["halt-at-non-option"]){c=J.slice(V);break}else i(F)}if(z0(I,!0),z0(I,!1),v(I),r(),G1(I,L.aliases,G,!0),t(I),Q["set-placeholder-key"])B0(I);if(Object.keys(L.counts).forEach(function(V){if(!e(I,V.split(".")))l(V,0)}),W&&c.length)I[U]=[];if(c.forEach(function(V){I[U].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(I).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete I[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete I[V.split(".").map((F)=>O1(F)).join(".")];delete I[V]});function i(V){let F=w("_",V);if(typeof F==="string"||typeof F==="number")I._.push(F)}function a(V,F,P,M){let T,D=b(F,L.nargs);if(D=typeof D!=="number"||isNaN(D)?1:D,D===0){if(!W0(M))N=Error(_("Argument unexpected for: %s",F));return l(F,d(F)),V}let O=W0(M)?0:1;if(Q["nargs-eats-options"]){if(P.length-(V+1)+O<D)N=Error(_("Not enough arguments following: %s",F));O=D}else{for(T=V+1;T<P.length;T++)if(!P[T].match(/^-[^0-9]/)||P[T].match(j)||s(P[T]))O++;else break;if(O<D)N=Error(_("Not enough arguments following: %s",F))}let k=Math.min(O,D);if(!W0(M)&&k>0)l(F,M),k--;for(T=V+1;T<k+V+1;T++)l(F,P[T]);return V+k}function K0(V,F,P,M){let T=[],D=M||P[V+1],O=b(F,L.nargs);if(b(F,L.bools)&&!/^(true|false)$/.test(D))T.push(!0);else if(W0(D)||W0(M)&&/^-/.test(D)&&!j.test(D)&&!s(D)){if(G[F]!==void 0){let k=G[F];T=Array.isArray(k)?k:[k]}}else{if(!W0(M))T.push(E(F,M,!0));for(let k=V+1;k<P.length;k++){if(!Q["greedy-arrays"]&&T.length>0||O&&typeof O==="number"&&T.length>=O)break;if(D=P[k],/^-/.test(D)&&!j.test(D)&&!s(D))break;V=k,T.push(E(F,D,q))}}if(typeof O==="number"&&(O&&T.length<O||isNaN(O)&&T.length===0))N=Error(_("Not enough arguments following: %s",F));return l(F,T),V}function l(V,F,P=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let D=V.split(".").map(function(O){return O1(O)}).join(".");x0(V,D)}let M=E(V,F,P),T=V.split(".");if(e0(I,T,M),L.aliases[V])L.aliases[V].forEach(function(D){let O=D.split(".");e0(I,O,M)});if(T.length>1&&Q["dot-notation"])(L.aliases[T[0]]||[]).forEach(function(D){let O=D.split("."),k=[].concat(T);if(k.shift(),O=O.concat(k),!(L.aliases[V]||[]).includes(O.join(".")))e0(I,O,M)});if(b(V,L.normalize)&&!b(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(O){Object.defineProperty(n,O,{enumerable:!0,get(){return F},set(k){F=typeof k==="string"?Y1.normalize(k):k}})})}function x0(V,F){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[F],B[F]=!0;if(!(L.aliases[F]&&L.aliases[F].length))x0(F,V)}function E(V,F,P){if(P)F=$U(F);if(b(V,L.bools)||b(V,L.counts)){if(typeof F==="string")F=F==="true"}let M=Array.isArray(F)?F.map(function(T){return w(V,T)}):w(V,F);if(b(V,L.counts)&&(W0(M)||typeof M==="boolean"))M=U6();if(b(V,L.normalize)&&b(V,L.arrays))if(Array.isArray(F))M=F.map((T)=>{return Y1.normalize(T)});else M=Y1.normalize(F);return M}function w(V,F){if(!Q["parse-positional-numbers"]&&V==="_")return F;if(!b(V,L.strings)&&!b(V,L.bools)&&!Array.isArray(F)){if($2(F)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${F}`)))||!W0(F)&&b(V,L.numbers))F=Number(F)}return F}function v(V){let F=Object.create(null);G1(F,L.aliases,G),Object.keys(L.configs).forEach(function(P){let M=V[P]||F[P];if(M)try{let T=null,D=Y1.resolve(Y1.cwd(),M),O=L.configs[P];if(typeof O==="function"){try{T=O(D)}catch(k){T=k}if(T instanceof Error){N=T;return}}else T=Y1.require(D);u(T)}catch(T){if(T.name==="PermissionDenied")N=T;else if(V[P])N=Error(_("Invalid JSON config file: %s",M))}})}function u(V,F){Object.keys(V).forEach(function(P){let M=V[P],T=F?F+"."+P:P;if(typeof M==="object"&&M!==null&&!Array.isArray(M)&&Q["dot-notation"])u(M,T);else if(!e(I,T.split("."))||b(T,L.arrays)&&Q["combine-arrays"])l(T,M)})}function r(){if(typeof H<"u")H.forEach(function(V){u(V)})}function z0(V,F){if(typeof K>"u")return;let P=typeof K==="string"?K:"",M=Y1.env();Object.keys(M).forEach(function(T){if(P===""||T.lastIndexOf(P,0)===0){let D=T.split("__").map(function(O,k){if(k===0)O=O.substring(P.length);return O1(O)});if((F&&L.configs[D.join(".")]||!F)&&!e(V,D))l(D.join("."),M[T])}})}function t(V){let F,P=new Set;Object.keys(V).forEach(function(M){if(!P.has(M)){if(F=b(M,L.coercions),typeof F==="function")try{let T=w(M,F(V[M]));[].concat(L.aliases[M]||[],M).forEach((D)=>{P.add(D),V[D]=T})}catch(T){N=T}}})}function B0(V){return L.keys.forEach((F)=>{if(~F.indexOf("."))return;if(typeof V[F]>"u")V[F]=void 0}),V}function G1(V,F,P,M=!1){Object.keys(P).forEach(function(T){if(!e(V,T.split("."))){if(e0(V,T.split("."),P[T]),M)R[T]=!0;(F[T]||[]).forEach(function(D){if(e(V,D.split(".")))return;e0(V,D.split("."),P[T])})}})}function e(V,F){let P=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(T){P=P[T]||{}});let M=F[F.length-1];if(typeof P!=="object")return!1;else return M in P}function e0(V,F,P){let M=V;if(!Q["dot-notation"])F=[F.join(".")];F.slice(0,-1).forEach(function(_0){if(_0=wJ(_0),typeof M==="object"&&M[_0]===void 0)M[_0]={};if(typeof M[_0]!=="object"||Array.isArray(M[_0])){if(Array.isArray(M[_0]))M[_0].push({});else M[_0]=[M[_0],{}];M=M[_0][M[_0].length-1]}else M=M[_0]});let T=wJ(F[F.length-1]),D=b(F.join("."),L.arrays),O=Array.isArray(P),k=Q["duplicate-arguments-array"];if(!k&&b(T,L.nargs)){if(k=!0,!W0(M[T])&&L.nargs[T]===1||Array.isArray(M[T])&&M[T].length===L.nargs[T])M[T]=void 0}if(P===U6())M[T]=U6(M[T]);else if(Array.isArray(M[T]))if(k&&D&&O)M[T]=Q["flatten-duplicate-arrays"]?M[T].concat(P):(Array.isArray(M[T][0])?M[T]:[M[T]]).concat([P]);else if(!k&&Boolean(D)===Boolean(O))M[T]=P;else M[T]=M[T].concat([P]);else if(M[T]===void 0&&D)M[T]=O?P:[P];else if(k&&!(M[T]===void 0||b(T,L.counts)||b(T,L.bools)))M[T]=[M[T],P];else M[T]=P}function z$(...V){V.forEach(function(F){Object.keys(F||{}).forEach(function(P){if(L.aliases[P])return;L.aliases[P]=[].concat(Y[P]||[]),L.aliases[P].concat(P).forEach(function(M){if(/-/.test(M)&&Q["camel-case-expansion"]){let T=O1(M);if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].concat(P).forEach(function(M){if(M.length>1&&/[A-Z]/.test(M)&&Q["camel-case-expansion"]){let T=e4(M,"-");if(T!==P&&L.aliases[P].indexOf(T)===-1)L.aliases[P].push(T),B[T]=!0}}),L.aliases[P].forEach(function(M){L.aliases[M]=[P].concat(L.aliases[P].filter(function(T){return M!==T}))})})})}function b(V,F){let P=[].concat(L.aliases[V]||[],V),M=Object.keys(F),T=P.find((D)=>M.includes(D));return T?F[T]:!1}function m1(V){let F=Object.keys(L);return[].concat(F.map((M)=>L[M])).some(function(M){return Array.isArray(M)?M.includes(V):M[V]})}function y6(V,...F){return[].concat(...F).some(function(M){let T=V.match(M);return T&&m1(T[1])})}function y(V){if(V.match(j)||!V.match(/^-[^-]+/))return!1;let F=!0,P,M=V.slice(1).split("");for(let T=0;T<M.length;T++){if(P=V.slice(T+2),!m1(M[T])){F=!1;break}if(M[T+1]&&M[T+1]==="="||P==="-"||/[A-Za-z]/.test(M[T])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(P)||M[T+1]&&M[T+1].match(/\W/))break}return F}function s(V){return Q["unknown-options-as-args"]&&U0(V)}function U0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(j))return!1;if(y(V))return!1;return!y6(V,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function d(V){if(!b(V,L.bools)&&!b(V,L.counts)&&`${V}`in G)return G[V];else return T0(q0(V))}function T0(V){return{[S0.BOOLEAN]:!0,[S0.STRING]:"",[S0.NUMBER]:void 0,[S0.ARRAY]:[]}[V]}function q0(V){let F=S0.BOOLEAN;if(b(V,L.strings))F=S0.STRING;else if(b(V,L.numbers))F=S0.NUMBER;else if(b(V,L.bools))F=S0.BOOLEAN;else if(b(V,L.arrays))F=S0.ARRAY;return F}function W0(V){return V===void 0}function V2(){Object.keys(L.counts).find((V)=>{if(b(V,L.arrays))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(b(V,L.nargs))return N=Error(_("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(n,I),configuration:Q,defaulted:Object.assign({},R),error:N,newAliases:Object.assign({},B)}}}function eB($){let Z=[],X=Object.create(null),J=!0;Object.keys($).forEach(function(q){Z.push([].concat($[q],q))});while(J){J=!1;for(let q=0;q<Z.length;q++)for(let Y=q+1;Y<Z.length;Y++)if(Z[q].filter(function(G){return Z[Y].indexOf(G)!==-1}).length){Z[q]=Z[q].concat(Z[Y]),Z.splice(Y,1),J=!0;break}}return Z.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")X[Y]=q}),X}function U6($){return $!==void 0?$+1:1}function wJ($){if($==="__proto__")return"___proto___";return $}function $U($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var V6,L6,_6,OJ=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,EJ=(L6=(V6=process===null||process===void 0?void 0:process.versions)===null||V6===void 0?void 0:V6.node)!==null&&L6!==void 0?L6:(_6=process===null||process===void 0?void 0:process.version)===null||_6===void 0?void 0:_6.slice(1);if(EJ){if(Number(EJ.match(/^([^.]+)/)[1])<OJ)throw Error(`yargs parser supports a minimum Node.js version of ${OJ}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var QU=process?process.env:{},AJ=new W6({cwd:process.cwd,env:()=>{return QU},format:ZU,normalize:XU,resolve:JU,require:($)=>{return V0($)}}),w$=function(Z,X){return AJ.parse(Z.slice(),X).argv};w$.detailed=function($,Z){return AJ.parse($.slice(),Z)};w$.camelCase=O1;w$.decamelize=e4;w$.looksLikeNumber=$2;var R6=w$;import{basename as TU,dirname as FU,extname as MU,relative as CU,resolve as kJ}from"path";function hJ(){if(qU())return 0;return 1}function qU(){return YU()&&!process.defaultApp}function YU(){return!!process.versions.electron}function T6($){return $.slice(hJ()+1)}function NJ(){return process.argv[hJ()]}class Z0 extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,Z0)}}import{readFileSync as GU,statSync as HU,writeFile as zU}from"fs";import{format as KU}from"util";import{resolve as BU}from"path";var DJ={fs:{readFileSync:GU,writeFile:zU},format:KU,resolve:BU,exists:($)=>{try{return HU($).isFile()}catch(Z){return!1}}};var d0;class SJ{constructor($){$=$||{},this.directory=$.directory||"./locales",this.updateFiles=typeof $.updateFiles==="boolean"?$.updateFiles:!0,this.locale=$.locale||"en",this.fallbackToLanguage=typeof $.fallbackToLanguage==="boolean"?$.fallbackToLanguage:!0,this.cache=Object.create(null),this.writeQueue=[]}__(...$){if(typeof arguments[0]!=="string")return this._taggedLiteral(arguments[0],...arguments);let Z=$.shift(),X=function(){};if(typeof $[$.length-1]==="function")X=$.pop();if(X=X||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]=Z,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:X});else X();return d0.format.apply(d0.format,[this.cache[this.locale][Z]||Z].concat($))}__n(){let $=Array.prototype.slice.call(arguments),Z=$.shift(),X=$.shift(),J=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=J===1?Z:X;if(this.cache[this.locale][Z])Y=this.cache[this.locale][Z][J===1?"one":"other"];if(!this.cache[this.locale][Z]&&this.updateFiles)this.cache[this.locale][Z]={one:Z,other:X},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(J);return d0.format.apply(d0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let Z in $)if(Object.prototype.hasOwnProperty.call($,Z))this.cache[this.locale][Z]=$[Z]}_taggedLiteral($,...Z){let X="";return $.forEach(function(J,q){let Y=Z[q+1];if(X+=J,typeof Y<"u")X+="%s"}),this.__.apply(this,[X].concat([].slice.call(Z,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,Z=this.writeQueue[0],X=Z.directory,J=Z.locale,q=Z.cb,Y=this._resolveLocaleFile(X,J),Q=JSON.stringify(this.cache[J],null,2);d0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},Z=this._resolveLocaleFile(this.directory,this.locale);try{if(d0.fs.readFileSync)$=JSON.parse(d0.fs.readFileSync(Z,"utf-8"))}catch(X){if(X instanceof SyntaxError)X.message="syntax error in "+Z;if(X.code==="ENOENT")$={};else throw X}this.cache[this.locale]=$}_resolveLocaleFile($,Z){let X=d0.resolve($,"./",Z+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(X)&&~Z.lastIndexOf("_")){let J=d0.resolve($,"./",Z.split("_")[0]+".json");if(this._fileExistsSync(J))X=J}return X}_fileExistsSync($){return d0.exists($)}}function vJ($,Z){d0=Z;let X=new SJ($);return{__:X.__.bind(X),__n:X.__n.bind(X),setLocale:X.setLocale.bind(X),getLocale:X.getLocale.bind(X),updateLocale:X.updateLocale.bind(X),locale:X.locale}}var UU=($)=>{return vJ($,DJ)},fJ=UU;var PU="require is not supported by ESM",bJ="loading a directory of commands is not supported yet for ESM",O$;try{O$=RU(import.meta.url)}catch($){O$=process.cwd()}var xU=O$.substring(0,O$.lastIndexOf("node_modules")),F6={assert:{notStrictEqual:WU,strictEqual:VU},cliui:K6,findUp:B6,getEnv:($)=>{return process.env[$]},inspect:LU,getCallerFile:()=>{throw new Z0(bJ)},getProcessArgvBin:NJ,mainFilename:xU||process.cwd(),Parser:R6,path:{basename:TU,dirname:FU,extname:MU,relative:CU,resolve:kJ},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,Z)=>process.emitWarning($,Z),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:_U,require:()=>{throw new Z0(PU)},requireDirectory:()=>{throw new Z0(bJ)},stringWidth:($)=>{return[...$].length},y18n:fJ({directory:kJ(O$,"../../../locales"),updateFiles:!1})};function P0($,Z,X,J){X.assert.notStrictEqual($,Z,J)}function M6($,Z){Z.assert.strictEqual(typeof $,"string")}function Q$($){return Object.keys($)}function X0($){return!!$&&!!$.then&&typeof $.then==="function"}function V1($){let X=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),J=/\.*[\][<>]/g,q=X.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(J,""),demanded:[],optional:[]};return X.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===X.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(J,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(J,"").split("|"),variadic:H})}),Y}var jU=["first","second","third","fourth","fifth","sixth"];function A($,Z,X){function J(){return typeof $==="object"?[{demanded:[],optional:[]},$,Z]:[V1(`cmd ${$}`),Z,X]}try{let q=0,[Y,Q,G]=J(),H=[].slice.call(Q);while(H.length&&H[H.length-1]===void 0)H.pop();let K=G||H.length;if(K<Y.demanded.length)throw new Z0(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let W=Y.demanded.length+Y.optional.length;if(K>W)throw new Z0(`Too many arguments provided. Expected max ${W} but received ${K}.`);Y.demanded.forEach((U)=>{let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1}),Y.optional.forEach((U)=>{if(H.length===0)return;let B=H.shift(),R=yJ(B);if(U.cmd.filter((L)=>L===R||L==="*").length===0)gJ(R,U.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function yJ($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function gJ($,Z,X){throw new Z0(`Invalid ${jU[X]||"manyith"} argument. Expected ${Z.join(" or ")} but received ${$}.`)}class C6{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,Z,X=!0,J=!1){if(A("<array|function> [boolean] [boolean] [boolean]",[$,Z,X],arguments.length),Array.isArray($)){for(let q=0;q<$.length;q++){if(typeof $[q]!=="function")throw Error("middleware must be a function");let Y=$[q];Y.applyBeforeValidation=Z,Y.global=X}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=Z,q.global=X,q.mutates=J,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,Z){let X=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((J)=>{let q=[...X[Z]||[],Z];if(!J.option)return!0;else return!q.includes(J.option)}),$.option=Z,this.addMiddleware($,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){let $=this.frozens.pop();if($!==void 0)this.globalMiddleware=$}reset(){this.globalMiddleware=this.globalMiddleware.filter(($)=>$.global)}}function uJ($){if(!$)return[];return $.map((Z)=>{return Z.applyBeforeValidation=!1,Z})}function E1($,Z,X,J){return X.reduce((q,Y)=>{if(Y.applyBeforeValidation!==J)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(X0(q))return q.then((Q)=>Promise.all([Q,Y(Q,Z)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,Z);return X0(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function A1($,Z,X=(J)=>{throw J}){try{let J=IU($)?$():$;return X0(J)?J.then((q)=>Z(q)):Z(J)}catch(J){return X(J)}}function IU($){return typeof $==="function"}function P6($){for(let Z=0,X=Object.keys(V0.cache),J;Z<X.length;Z++)if(J=V0.cache[X[Z]],J.exports===$)return J;return null}var q$=/(^\*)|(^\$0)/;class cJ{constructor($,Z,X,J){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=J,this.usage=$,this.globalMiddleware=X,this.validation=Z}addDirectory($,Z,X,J){if(J=J||{},typeof J.recurse!=="boolean")J.recurse=!1;if(!Array.isArray(J.extensions))J.extensions=["js"];let q=typeof J.visit==="function"?J.visit:(Y)=>Y;J.visit=(Y,Q,G)=>{let H=q(Y,Q,G);if(H){if(this.requireCache.has(Q))return H;else this.requireCache.add(Q);this.addHandler(H)}return H},this.shim.requireDirectory({require:Z,filename:X},$,J)}addHandler($,Z,X,J,q,Y){let Q=[],G=uJ(q);if(J=J||(()=>{}),Array.isArray($))if(wU($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(EU($)){let H=Array.isArray($.command)||typeof $.command==="string"?$.command:this.moduleName($);if($.aliases)H=[].concat(H).concat($.aliases);this.addHandler(H,this.extractDesc($),$.builder,$.handler,$.middlewares,$.deprecated);return}else if(mJ(X)){this.addHandler([$].concat(Q),Z,X.builder,X.handler,X.middlewares,X.deprecated);return}if(typeof $==="string"){let H=V1($);Q=Q.map((U)=>V1(U).cmd);let K=!1,W=[H.cmd].concat(Q).filter((U)=>{if(q$.test(U))return K=!0,!1;return!0});if(W.length===0&&K)W.push("$0");if(K)H.cmd=W[0],Q=W.slice(1),$=$.replace(q$,H.cmd);if(Q.forEach((U)=>{this.aliasMap[U]=H.cmd}),Z!==!1)this.usage.command($,Z,K,Q,Y);if(this.handlers[H.cmd]={original:$,description:Z,handler:J,builder:X||{},middlewares:G,deprecated:Y,demanded:H.demanded,optional:H.optional},K)this.defaultCommand=this.handlers[H.cmd]}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand($,Z,X,J,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=Z.getInternalMethods().getContext(),H=G.commands.slice(),K=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let W=this.applyBuilderUpdateUsageAndParse(K,Q,Z,X.aliases,H,J,q,Y);return X0(W)?W.then((U)=>this.applyMiddlewareAndGetResult(K,Q,U.innerArgv,G,q,U.aliases,Z)):this.applyMiddlewareAndGetResult(K,Q,W.innerArgv,G,q,W.aliases,Z)}applyBuilderUpdateUsageAndParse($,Z,X,J,q,Y,Q,G){let H=Z.builder,K=X;if(Z2(H)){X.getInternalMethods().getUsageInstance().freeze();let W=H(X.getInternalMethods().reset(J),G);if(X0(W))return W.then((U)=>{return K=dJ(U)?U:X,this.parseAndUpdateUsage($,Z,K,q,Y,Q)})}else if(OU(H))X.getInternalMethods().getUsageInstance().freeze(),K=X.getInternalMethods().reset(J),Object.keys(Z.builder).forEach((W)=>{K.option(W,H[W])});return this.parseAndUpdateUsage($,Z,K,q,Y,Q)}parseAndUpdateUsage($,Z,X,J,q,Y){if($)X.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(X))X.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(J,Z),Z.description);let Q=X.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return X0(Q)?Q.then((G)=>({aliases:X.parsed.aliases,innerArgv:G})):{aliases:X.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,Z){let X=q$.test(Z.original)?Z.original.replace(q$,"").trim():Z.original,J=$.filter((q)=>{return!q$.test(q)});return J.push(X),`$0 ${J.join(" ")}`}handleValidationAndGetResult($,Z,X,J,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);X=A1(X,(K)=>{return H(K),K})}if(Z.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(X,H,!1,!1),X=E1(X,Y,Q,!1),X=A1(X,(K)=>{let W=Z.handler(K);return X0(W)?W.then(()=>K):K}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(X0(X)&&!Y.getInternalMethods().hasParseCallback())X.catch((K)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,K)}catch(W){}})}if(!$)J.commands.pop(),J.fullCommands.pop();return X}applyMiddlewareAndGetResult($,Z,X,J,q,Y,Q){let G={};if(q)return X;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(Z,X,J,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(Z.middlewares),K=E1(X,Q,H,!0);return X0(K)?K.then((W)=>this.handleValidationAndGetResult($,Z,W,J,Y,Q,H,G)):this.handleValidationAndGetResult($,Z,K,J,Y,Q,H,G)}populatePositionals($,Z,X,J){Z._=Z._.slice(X.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,Z._.length);while(q.length){let G=q.shift();this.populatePositional(G,Z,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,Z,Q)}return Z._=X.commands.concat(Z._.map((G)=>""+G)),this.postProcessPositionals(Z,Q,this.cmdToParseOptions($.original),J),Q}populatePositional($,Z,X){let J=$.cmd[0];if($.variadic)X[J]=Z._.splice(0).map(String);else if(Z._.length)X[J]=[String(Z._.shift())]}cmdToParseOptions($){let Z={array:[],default:{},alias:{},demand:{}},X=V1($);return X.demanded.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y,Z.demand[q]=!0}),X.optional.forEach((J)=>{let[q,...Y]=J.cmd;if(J.variadic)Z.array.push(q),Z.default[q]=[];Z.alias[q]=Y}),Z}postProcessPositionals($,Z,X,J){let q=Object.assign({},J.getOptions());q.default=Object.assign(X.default,q.default);for(let H of Object.keys(X.alias))q.alias[H]=(q.alias[H]||[]).concat(X.alias[H]);q.array=q.array.concat(X.array),q.config={};let Y=[];if(Object.keys(Z).forEach((H)=>{Z[H].map((K)=>{if(q.configuration["unknown-options-as-args"])q.key[H]=!0;Y.push(`--${H}`),Y.push(K)})}),!Y.length)return;let Q=Object.assign({},q.configuration,{"populate--":!1}),G=this.shim.Parser.detailed(Y,Object.assign({},q,{configuration:Q}));if(G.error)J.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(Z);Object.keys(Z).forEach((K)=>{H.push(...G.aliases[K])}),Object.keys(G.argv).forEach((K)=>{if(H.includes(K)){if(!Z[K])Z[K]=G.argv[K];if(!this.isInConfigs(J,K)&&!this.isDefaulted(J,K)&&Object.prototype.hasOwnProperty.call($,K)&&Object.prototype.hasOwnProperty.call(G.argv,K)&&(Array.isArray($[K])||Array.isArray(G.argv[K])))$[K]=[].concat($[K],G.argv[K]);else $[K]=G.argv[K]}})}}isDefaulted($,Z){let{default:X}=$.getOptions();return Object.prototype.hasOwnProperty.call(X,Z)||Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(Z))}isInConfigs($,Z){let{configObjects:X}=$.getOptions();return X.some((J)=>Object.prototype.hasOwnProperty.call(J,Z))||X.some((J)=>Object.prototype.hasOwnProperty.call(J,this.shim.Parser.camelCase(Z)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let X=q$.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(X,this.defaultCommand.description)}let Z=this.defaultCommand.builder;if(Z2(Z))return Z($,!0);else if(!mJ(Z))Object.keys(Z).forEach((X)=>{$.option(X,Z[X])});return}moduleName($){let Z=P6($);if(!Z)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(Z.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:Z,desc:X}){for(let J of[$,Z,X]){if(typeof J==="string"||J===!1)return J;P0(J,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();P0($,void 0,this.shim),{handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=$}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function pJ($,Z,X,J){return new cJ($,Z,X,J)}function mJ($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function wU($){return $.every((Z)=>typeof Z==="string")}function Z2($){return typeof $==="function"}function OU($){return typeof $==="object"}function EU($){return typeof $==="object"&&!Array.isArray($)}function L1($={},Z=()=>!0){let X={};return Q$($).forEach((J)=>{if(Z(J,$[J]))X[J]=$[J]}),X}function _1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((Z)=>{let X=Z;if(X._handle&&X.isTTY&&typeof X._handle.setBlocking==="function")X._handle.setBlocking($)})}function AU($){return typeof $==="boolean"}function nJ($,Z){let X=Z.y18n.__,J={},q=[];J.failFn=function(w){q.push(w)};let Y=null,Q=null,G=!0;J.showHelpOnFail=function(w=!0,v){let[u,r]=typeof w==="string"?[!0,w]:[w,v];if($.getInternalMethods().isGlobalContext())Q=r;return Y=r,G=u,J};let H=!1;J.fail=function(w,v){let u=$.getInternalMethods().getLoggerInstance();if(q.length)for(let r=q.length-1;r>=0;--r){let z0=q[r];if(AU(z0)){if(v)throw v;else if(w)throw Error(w)}else z0(w,v,J)}else{if($.getExitProcess())_1(!0);if(!H){if(H=!0,G)$.showHelp("error"),u.error();if(w||v)u.error(w||v);let r=Y||Q;if(r){if(w||v)u.error("");u.error(r)}}if(v=v||new Z0(w),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,v);else throw v}};let K=[],W=!1;J.usage=(E,w)=>{if(E===null)return W=!0,K=[],J;return W=!1,K.push([E,w||""]),J},J.getUsage=()=>{return K},J.getUsageDisabled=()=>{return W},J.getPositionalGroupName=()=>{return X("Positionals:")};let U=[];J.example=(E,w)=>{U.push([E,w||""])};let B=[];J.command=function(w,v,u,r,z0=!1){if(u)B=B.map((t)=>{return t[2]=!1,t});B.push([w,v||"",u,r,z0])},J.getCommands=()=>B;let R={};J.describe=function(w,v){if(Array.isArray(w))w.forEach((u)=>{J.describe(u,v)});else if(typeof w==="object")Object.keys(w).forEach((u)=>{J.describe(u,w[u])});else R[w]=v},J.getDescriptions=()=>R;let _=[];J.epilog=(E)=>{_.push(E)};let L=!1,j;J.wrap=(E)=>{L=!0,j=E},J.getWrap=()=>{if(Z.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)j=K0(),L=!0;return j};let C="__yargsString__:";J.deferY18nLookup=(E)=>C+E,J.help=function(){if(I)return I;c();let w=$.customScriptName?$.$0:Z.path.basename($.$0),v=$.getDemandedOptions(),u=$.getDemandedCommands(),r=$.getDeprecatedOptions(),z0=$.getGroups(),t=$.getOptions(),B0=[];B0=B0.concat(Object.keys(R)),B0=B0.concat(Object.keys(v)),B0=B0.concat(Object.keys(u)),B0=B0.concat(Object.keys(t.default)),B0=B0.filter(i),B0=Object.keys(B0.reduce((y,s)=>{if(s!=="_")y[s]=!0;return y},{}));let G1=J.getWrap(),e=Z.cliui({width:G1,wrap:!!G1});if(!W){if(K.length)K.forEach((y)=>{if(e.div({text:`${y[0].replace(/\$0/g,w)}`}),y[1])e.div({text:`${y[1]}`,padding:[1,0,0,0]})}),e.div();else if(B.length){let y=null;if(u._)y=`${w} <${X("command")}>
104
+ `;else y=`${w} [${X("command")}]
105
+ `;e.div(`${y}`)}}if(B.length>1||B.length===1&&!B[0][2]){e.div(X("Commands:"));let y=$.getInternalMethods().getContext(),s=y.commands.length?`${y.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)B=B.sort((d,T0)=>d[0].localeCompare(T0[0]));let U0=w?`${w} `:"";B.forEach((d)=>{let T0=`${U0}${s}${d[0].replace(/^\$0 ?/,"")}`;e.span({text:T0,padding:[0,2,0,2],width:N(B,G1,`${w}${s}`)+4},{text:d[1]});let q0=[];if(d[2])q0.push(`[${X("default")}]`);if(d[3]&&d[3].length)q0.push(`[${X("aliases:")} ${d[3].join(", ")}]`);if(d[4])if(typeof d[4]==="string")q0.push(`[${X("deprecated: %s",d[4])}]`);else q0.push(`[${X("deprecated")}]`);if(q0.length)e.div({text:q0.join(" "),padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}let e0=(Object.keys(t.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);B0=B0.filter((y)=>!$.parsed.newAliases[y]&&e0.every((s)=>(t.alias[s]||[]).indexOf(y)===-1));let z$=X("Options:");if(!z0[z$])z0[z$]=[];n(B0,t.alias,z0,z$);let b=(y)=>/^--/.test(X2(y)),m1=Object.keys(z0).filter((y)=>z0[y].length>0).map((y)=>{let s=z0[y].filter(i).map((U0)=>{if(e0.includes(U0))return U0;for(let d=0,T0;(T0=e0[d])!==void 0;d++)if((t.alias[T0]||[]).includes(U0))return T0;return U0});return{groupName:y,normalizedKeys:s}}).filter(({normalizedKeys:y})=>y.length>0).map(({groupName:y,normalizedKeys:s})=>{let U0=s.reduce((d,T0)=>{return d[T0]=[T0].concat(t.alias[T0]||[]).map((q0)=>{if(y===J.getPositionalGroupName())return q0;else return(/^[0-9]$/.test(q0)?t.boolean.includes(T0)?"-":"--":q0.length>1?"--":"-")+q0}).sort((q0,W0)=>b(q0)===b(W0)?0:b(q0)?1:-1).join(", "),d},{});return{groupName:y,normalizedKeys:s,switches:U0}});if(m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).some(({normalizedKeys:y,switches:s})=>!y.every((U0)=>b(s[U0]))))m1.filter(({groupName:y})=>y!==J.getPositionalGroupName()).forEach(({normalizedKeys:y,switches:s})=>{y.forEach((U0)=>{if(b(s[U0]))s[U0]=hU(s[U0],4)})});if(m1.forEach(({groupName:y,normalizedKeys:s,switches:U0})=>{e.div(y),s.forEach((d)=>{let T0=U0[d],q0=R[d]||"",W0=null;if(q0.includes(C))q0=X(q0.substring(C.length));if(t.boolean.includes(d))W0=`[${X("boolean")}]`;if(t.count.includes(d))W0=`[${X("count")}]`;if(t.string.includes(d))W0=`[${X("string")}]`;if(t.normalize.includes(d))W0=`[${X("string")}]`;if(t.array.includes(d))W0=`[${X("array")}]`;if(t.number.includes(d))W0=`[${X("number")}]`;let V2=(P)=>typeof P==="string"?`[${X("deprecated: %s",P)}]`:`[${X("deprecated")}]`,V=[d in r?V2(r[d]):null,W0,d in v?`[${X("required")}]`:null,t.choices&&t.choices[d]?`[${X("choices:")} ${J.stringifiedValues(t.choices[d])}]`:null,a(t.default[d],t.defaultDescription[d])].filter(Boolean).join(" ");e.span({text:X2(T0),padding:[0,2,0,2+lJ(T0)],width:N(U0,G1)+4},q0);let F=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!F)e.div({text:V,padding:[0,0,0,2],align:"right"});else e.div()}),e.div()}),U.length)e.div(X("Examples:")),U.forEach((y)=>{y[0]=y[0].replace(/\$0/g,w)}),U.forEach((y)=>{if(y[1]==="")e.div({text:y[0],padding:[0,2,0,2]});else e.div({text:y[0],padding:[0,2,0,2],width:N(U,G1)+4},{text:y[1]})}),e.div();if(_.length>0){let y=_.map((s)=>s.replace(/\$0/g,w)).join(`
106
106
  `);e.div(`${y}
107
- `)}return e.toString().replace(/\s*$/,"")};function N(E,w,v){let m=0;if(!Array.isArray(E))E=Object.values(E).map((r)=>[r]);if(E.forEach((r)=>{m=Math.max(X.stringWidth(v?`${v} ${X2(r[0])}`:X2(r[0]))+cJ(r[0]),m)}),w)m=Math.min(m,parseInt((w*0.5).toString(),10));return m}function u(){let E=$.getDemandedOptions(),w=$.getOptions();(Object.keys(w.alias)||[]).forEach((v)=>{w.alias[v].forEach((m)=>{if(_[m])J.describe(v,_[m]);if(m in E)$.demandOption(v,E[m]);if(w.boolean.includes(m))$.boolean(v);if(w.count.includes(m))$.count(v);if(w.string.includes(m))$.string(v);if(w.normalize.includes(m))$.normalize(v);if(w.array.includes(m))$.array(v);if(w.number.includes(m))$.number(v)})})}let x;J.cacheHelpMessage=function(){x=this.help()},J.clearCachedHelpMessage=function(){x=void 0},J.hasCachedHelpMessage=function(){return!!x};function n(E,w,v,m){let r=[],z0=null;return Object.keys(v).forEach((o)=>{r=r.concat(v[o])}),E.forEach((o)=>{if(z0=[o].concat(w[o]),!z0.some((K0)=>r.indexOf(K0)!==-1))v[m].push(o)}),r}function i(E){return $.getOptions().hiddenOptions.indexOf(E)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}J.showHelp=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(J.help())},J.functionDescription=(E)=>{return["(",E.name?X.Parser.decamelize(E.name,"-"):Z("generated-value"),")"].join("")},J.stringifiedValues=function(w,v){let m="",r=v||", ",z0=[].concat(w);if(!w||!z0.length)return m;return z0.forEach((o)=>{if(m.length)m+=r;m+=JSON.stringify(o)}),m};function t(E,w){let v=`[${Z("default:")} `;if(E===void 0&&!w)return null;if(w)v+=w;else switch(typeof E){case"string":v+=`"${E}"`;break;case"object":v+=JSON.stringify(E);break;default:v+=E}return`${v}]`}function F0(){if(X.process.stdColumns)return Math.min(80,X.process.stdColumns);else return 80}let l=null;J.version=(E)=>{l=E},J.showVersion=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(l)},J.reset=function(w){return Y=null,H=!1,B=[],K=!1,R=[],U=[],W=[],_=V1(_,(v)=>!w[v]),J};let r0=[];return J.freeze=function(){r0.push({failMessage:Y,failureOutput:H,usages:B,usageDisabled:K,epilogs:R,examples:U,commands:W,descriptions:_})},J.unfreeze=function(w=!1){let v=r0.pop();if(!v)return;if(w)_={...v.descriptions,..._},W=[...v.commands,...W],B=[...v.usages,...B],U=[...v.examples,...U],R=[...v.epilogs,...R];else({failMessage:Y,failureOutput:H,usages:B,usageDisabled:K,epilogs:R,examples:U,commands:W,descriptions:_}=v)},J}function M6($){return typeof $==="object"}function wU($,X){return M6($)?{text:$.text,indentation:$.indentation+X}:{text:$,indentation:X}}function cJ($){return M6($)?$.indentation:0}function X2($){return M6($)?$.text:$}var pJ=`###-begin-{{app_name}}-completions-###
107
+ `)}return e.toString().replace(/\s*$/,"")};function N(E,w,v){let u=0;if(!Array.isArray(E))E=Object.values(E).map((r)=>[r]);if(E.forEach((r)=>{u=Math.max(Z.stringWidth(v?`${v} ${X2(r[0])}`:X2(r[0]))+lJ(r[0]),u)}),w)u=Math.min(u,parseInt((w*0.5).toString(),10));return u}function c(){let E=$.getDemandedOptions(),w=$.getOptions();(Object.keys(w.alias)||[]).forEach((v)=>{w.alias[v].forEach((u)=>{if(R[u])J.describe(v,R[u]);if(u in E)$.demandOption(v,E[u]);if(w.boolean.includes(u))$.boolean(v);if(w.count.includes(u))$.count(v);if(w.string.includes(u))$.string(v);if(w.normalize.includes(u))$.normalize(v);if(w.array.includes(u))$.array(v);if(w.number.includes(u))$.number(v)})})}let I;J.cacheHelpMessage=function(){I=this.help()},J.clearCachedHelpMessage=function(){I=void 0},J.hasCachedHelpMessage=function(){return!!I};function n(E,w,v,u){let r=[],z0=null;return Object.keys(v).forEach((t)=>{r=r.concat(v[t])}),E.forEach((t)=>{if(z0=[t].concat(w[t]),!z0.some((B0)=>r.indexOf(B0)!==-1))v[u].push(t)}),r}function i(E){return $.getOptions().hiddenOptions.indexOf(E)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}J.showHelp=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(J.help())},J.functionDescription=(E)=>{return["(",E.name?Z.Parser.decamelize(E.name,"-"):X("generated-value"),")"].join("")},J.stringifiedValues=function(w,v){let u="",r=v||", ",z0=[].concat(w);if(!w||!z0.length)return u;return z0.forEach((t)=>{if(u.length)u+=r;u+=JSON.stringify(t)}),u};function a(E,w){let v=`[${X("default:")} `;if(E===void 0&&!w)return null;if(w)v+=w;else switch(typeof E){case"string":v+=`"${E}"`;break;case"object":v+=JSON.stringify(E);break;default:v+=E}return`${v}]`}function K0(){if(Z.process.stdColumns)return Math.min(80,Z.process.stdColumns);else return 80}let l=null;J.version=(E)=>{l=E},J.showVersion=(E)=>{let w=$.getInternalMethods().getLoggerInstance();if(!E)E="error";(typeof E==="function"?E:w[E])(l)},J.reset=function(w){return Y=null,H=!1,K=[],W=!1,_=[],U=[],B=[],R=L1(R,(v)=>!w[v]),J};let x0=[];return J.freeze=function(){x0.push({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R})},J.unfreeze=function(w=!1){let v=x0.pop();if(!v)return;if(w)R={...v.descriptions,...R},B=[...v.commands,...B],K=[...v.usages,...K],U=[...v.examples,...U],_=[...v.epilogs,..._];else({failMessage:Y,failureOutput:H,usages:K,usageDisabled:W,epilogs:_,examples:U,commands:B,descriptions:R}=v)},J}function x6($){return typeof $==="object"}function hU($,Z){return x6($)?{text:$.text,indentation:$.indentation+Z}:{text:$,indentation:Z}}function lJ($){return x6($)?$.indentation:0}function X2($){return x6($)?$.text:$}var iJ=`###-begin-{{app_name}}-completions-###
108
108
  #
109
109
  # yargs command completion script
110
110
  #
@@ -132,7 +132,7 @@ _{{app_name}}_yargs_completions()
132
132
  }
133
133
  complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
134
134
  ###-end-{{app_name}}-completions-###
135
- `,dJ=`#compdef {{app_name}}
135
+ `,tJ=`#compdef {{app_name}}
136
136
  ###-begin-{{app_name}}-completions-###
137
137
  #
138
138
  # yargs command completion script
@@ -151,31 +151,31 @@ _{{app_name}}_yargs_completions()
151
151
  }
152
152
  compdef _{{app_name}}_yargs_completions {{app_name}}
153
153
  ###-end-{{app_name}}-completions-###
154
- `;class lJ{constructor($,X,Z,J){var q,Y,Q;this.yargs=$,this.usage=X,this.command=Z,this.shim=J,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(Q=((q=this.shim.getEnv("SHELL"))===null||q===void 0?void 0:q.includes("zsh"))||((Y=this.shim.getEnv("ZSH_NAME"))===null||Y===void 0?void 0:Y.includes("zsh")))!==null&&Q!==void 0?Q:!1}defaultCompletion($,X,Z,J){let q=this.command.getCommandHandlers();for(let Q=0,G=$.length;Q<G;++Q)if(q[$[Q]]&&q[$[Q]].builder){let H=q[$[Q]].builder;if($2(H)){this.indexAfterLastReset=Q+1;let B=this.yargs.getInternalMethods().reset();return H(B,!0),B.argv}}let Y=[];this.commandCompletions(Y,$,Z),this.optionCompletions(Y,$,X,Z),this.choicesFromOptionsCompletions(Y,$,X,Z),this.choicesFromPositionalsCompletions(Y,$,X,Z),J(null,Y)}commandCompletions($,X,Z){let J=this.yargs.getInternalMethods().getContext().commands;if(!Z.match(/^-/)&&J[J.length-1]!==Z&&!this.previousArgHasChoices(X))this.usage.getCommands().forEach((q)=>{let Y=W1(q[0]).cmd;if(X.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,X,Z,J){if((J.match(/^-/)||J===""&&$.length===0)&&!this.previousArgHasChoices(X)){let q=this.yargs.getOptions(),Y=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(q.key).forEach((Q)=>{let G=!!q.configuration["boolean-negation"]&&q.boolean.includes(Q);if(!Y.includes(Q)&&!q.hiddenOptions.includes(Q)&&!this.argsContainKey(X,Q,G))this.completeOptionKey(Q,$,J,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,X,Z,J){if(this.previousArgHasChoices(X)){let q=this.getPreviousArgChoices(X);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,X,Z,J){if(J===""&&$.length>0&&this.previousArgHasChoices(X))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[Z._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(J))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let X=$[$.length-1],Z="";if(!X.startsWith("-")&&$.length>1)Z=X,X=$[$.length-2];if(!X.startsWith("-"))return;let J=X.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[J,...this.yargs.getAliases()[J]||[]],Q;for(let G of Y)if(Object.prototype.hasOwnProperty.call(q.key,G)&&Array.isArray(q.choices[G])){Q=q.choices[G];break}if(Q)return Q.filter((G)=>!Z||G.startsWith(Z))}previousArgHasChoices($){let X=this.getPreviousArgChoices($);return X!==void 0&&X.length>0}argsContainKey($,X,Z){let J=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(J(X))return!0;if(Z&&J(`no-${X}`))return!0;if(this.aliases){for(let q of this.aliases[X])if(J(q))return!0}return!1}completeOptionKey($,X,Z,J){var q,Y,Q,G;let H=$;if(this.zshShell){let W=this.usage.getDescriptions(),_=(Y=(q=this===null||this===void 0?void 0:this.aliases)===null||q===void 0?void 0:q[$])===null||Y===void 0?void 0:Y.find((I)=>{let j=W[I];return typeof j==="string"&&j.length>0}),R=_?W[_]:void 0,L=(G=(Q=W[$])!==null&&Q!==void 0?Q:R)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let B=(W)=>/^--/.test(W),K=(W)=>/^[^0-9]$/.test(W),U=!B(Z)&&K($)?"-":"--";if(X.push(U+H),J)X.push(U+"no-"+H)}customCompletion($,X,Z,J){if(j0(this.customCompletionFunction,null,this.shim),EU(this.customCompletionFunction)){let q=this.customCompletionFunction(Z,X);if(Z0(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{J(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{J(Y,void 0)})});return J(null,q)}else if(AU(this.customCompletionFunction))return this.customCompletionFunction(Z,X,(q=J)=>this.defaultCompletion($,X,Z,q),(q)=>{J(null,q)});else return this.customCompletionFunction(Z,X,(q)=>{J(null,q)})}getCompletion($,X){let Z=$.length?$[$.length-1]:"",J=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,Z,X):(Y)=>this.defaultCompletion($,Y,Z,X);return Z0(J)?J.then(q):q(J)}generateCompletionScript($,X){let Z=this.zshShell?dJ:pJ,J=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return Z=Z.replace(/{{app_name}}/g,J),Z=Z.replace(/{{completion_command}}/g,X),Z.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function nJ($,X,Z,J){return new lJ($,X,Z,J)}function EU($){return $.length<3}function AU($){return $.length>3}function iJ($,X){if($.length===0)return X.length;if(X.length===0)return $.length;let Z=[],J;for(J=0;J<=X.length;J++)Z[J]=[J];let q;for(q=0;q<=$.length;q++)Z[0][q]=q;for(J=1;J<=X.length;J++)for(q=1;q<=$.length;q++)if(X.charAt(J-1)===$.charAt(q-1))Z[J][q]=Z[J-1][q-1];else if(J>1&&q>1&&X.charAt(J-2)===$.charAt(q-1)&&X.charAt(J-1)===$.charAt(q-2))Z[J][q]=Z[J-2][q-2]+1;else Z[J][q]=Math.min(Z[J-1][q-1]+1,Math.min(Z[J][q-1]+1,Z[J-1][q]+1));return Z[X.length][$.length]}var tJ=["$0","--","_"];function oJ($,X,Z){let J=Z.y18n.__,q=Z.y18n.__n,Y={};Y.nonOptionCount=function(U){let W=$.getDemandedCommands(),R=U._.length+(U["--"]?U["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(W._&&(R<W._.min||R>W._.max)){if(R<W._.min)if(W._.minMsg!==void 0)X.fail(W._.minMsg?W._.minMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.min.toString()):null);else X.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",R,R.toString(),W._.min.toString()));else if(R>W._.max)if(W._.maxMsg!==void 0)X.fail(W._.maxMsg?W._.maxMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.max.toString()):null);else X.fail(q("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",R,R.toString(),W._.max.toString()))}},Y.positionalCount=function(U,W){if(W<U)X.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",W,W+"",U+""))},Y.requiredArguments=function(U,W){let _=null;for(let R of Object.keys(W))if(!Object.prototype.hasOwnProperty.call(U,R)||typeof U[R]>"u")_=_||{},_[R]=W[R];if(_){let R=[];for(let I of Object.keys(_)){let j=_[I];if(j&&R.indexOf(j)<0)R.push(j)}let L=R.length?`
155
- ${R.join(`
156
- `)}`:"";X.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(_).length,Object.keys(_).join(", ")+L))}},Y.unknownArguments=function(U,W,_,R,L=!0){var I;let j=$.getInternalMethods().getCommandInstance().getCommands(),N=[],u=$.getInternalMethods().getContext();if(Object.keys(U).forEach((x)=>{if(!tJ.includes(x)&&!Object.prototype.hasOwnProperty.call(_,x)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),x)&&!Y.isValidAndSomeAliasIsNotNew(x,W))N.push(x)}),L&&(u.commands.length>0||j.length>0||R))U._.slice(u.commands.length).forEach((x)=>{if(!j.includes(""+x))N.push(""+x)});if(L){let n=((I=$.getDemandedCommands()._)===null||I===void 0?void 0:I.max)||0,i=u.commands.length+n;if(i<U._.length)U._.slice(i).forEach((t)=>{if(t=String(t),!u.commands.includes(t)&&!N.includes(t))N.push(t)})}if(N.length)X.fail(q("Unknown argument: %s","Unknown arguments: %s",N.length,N.map((x)=>x.trim()?x:`"${x}"`).join(", ")))},Y.unknownCommands=function(U){let W=$.getInternalMethods().getCommandInstance().getCommands(),_=[],R=$.getInternalMethods().getContext();if(R.commands.length>0||W.length>0)U._.slice(R.commands.length).forEach((L)=>{if(!W.includes(""+L))_.push(""+L)});if(_.length>0)return X.fail(q("Unknown command: %s","Unknown commands: %s",_.length,_.join(", "))),!0;else return!1},Y.isValidAndSomeAliasIsNotNew=function(U,W){if(!Object.prototype.hasOwnProperty.call(W,U))return!1;let _=$.parsed.newAliases;return[U,...W[U]].some((R)=>!Object.prototype.hasOwnProperty.call(_,R)||!_[U])},Y.limitedChoices=function(U){let W=$.getOptions(),_={};if(!Object.keys(W.choices).length)return;Object.keys(U).forEach((I)=>{if(tJ.indexOf(I)===-1&&Object.prototype.hasOwnProperty.call(W.choices,I))[].concat(U[I]).forEach((j)=>{if(W.choices[I].indexOf(j)===-1&&j!==void 0)_[I]=(_[I]||[]).concat(j)})});let R=Object.keys(_);if(!R.length)return;let L=J("Invalid values:");R.forEach((I)=>{L+=`
157
- ${J("Argument: %s, Given: %s, Choices: %s",I,X.stringifiedValues(_[I]),X.stringifiedValues(W.choices[I]))}`}),X.fail(L)};let Q={};Y.implies=function(U,W){if(A("<string|object> [array|number|string]",[U,W],arguments.length),typeof U==="object")Object.keys(U).forEach((_)=>{Y.implies(_,U[_])});else{if($.global(U),!Q[U])Q[U]=[];if(Array.isArray(W))W.forEach((_)=>Y.implies(U,_));else j0(W,void 0,Z),Q[U].push(W)}},Y.getImplied=function(){return Q};function G(K,U){let W=Number(U);if(U=isNaN(W)?U:W,typeof U==="number")U=K._.length>=U;else if(U.match(/^--no-.+/))U=U.match(/^--no-(.+)/)[1],U=!Object.prototype.hasOwnProperty.call(K,U);else U=Object.prototype.hasOwnProperty.call(K,U);return U}Y.implications=function(U){let W=[];if(Object.keys(Q).forEach((_)=>{let R=_;(Q[_]||[]).forEach((L)=>{let I=R,j=L;if(I=G(U,I),L=G(U,L),I&&!L)W.push(` ${R} -> ${j}`)})}),W.length){let _=`${J("Implications failed:")}
158
- `;W.forEach((R)=>{_+=R}),X.fail(_)}};let H={};Y.conflicts=function(U,W){if(A("<string|object> [array|string]",[U,W],arguments.length),typeof U==="object")Object.keys(U).forEach((_)=>{Y.conflicts(_,U[_])});else{if($.global(U),!H[U])H[U]=[];if(Array.isArray(W))W.forEach((_)=>Y.conflicts(U,_));else H[U].push(W)}},Y.getConflicting=()=>H,Y.conflicting=function(U){if(Object.keys(U).forEach((W)=>{if(H[W])H[W].forEach((_)=>{if(_&&U[W]!==void 0&&U[_]!==void 0)X.fail(J("Arguments %s and %s are mutually exclusive",W,_))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((W)=>{H[W].forEach((_)=>{if(_&&U[Z.Parser.camelCase(W)]!==void 0&&U[Z.Parser.camelCase(_)]!==void 0)X.fail(J("Arguments %s and %s are mutually exclusive",W,_))})})},Y.recommendCommands=function(U,W){W=W.sort((I,j)=>j.length-I.length);let R=null,L=1/0;for(let I=0,j;(j=W[I])!==void 0;I++){let N=iJ(U,j);if(N<=3&&N<L)L=N,R=j}if(R)X.fail(J("Did you mean %s?",R))},Y.reset=function(U){return Q=V1(Q,(W)=>!U[W]),H=V1(H,(W)=>!U[W]),Y};let B=[];return Y.freeze=function(){B.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let U=B.pop();j0(U,void 0,Z),{implied:Q,conflicting:H}=U},Y}var P6=[],O$;function E$($,X,Z,J){O$=J;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=W0.resolve($.extends)}catch(G){return $}else Q=NU(X,$.extends);hU(Q),P6.push(Q),q=Y?JSON.parse(O$.readFileSync(Q,"utf8")):W0($.extends),delete $.extends,q=E$(q,O$.path.dirname(Q),Z,O$)}return P6=[],Z?aJ(q,$):Object.assign({},q,$)}function hU($){if(P6.indexOf($)>-1)throw new X0(`Circular extended configurations: '${$}'.`)}function NU($,X){return O$.path.resolve($,X)}function aJ($,X){let Z={};function J(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(Z,$);for(let q of Object.keys(X))if(J(X[q])&&J(Z[q]))Z[q]=aJ($[q],X[q]);else Z[q]=X[q];return Z}var h=function($,X,Z,J,q){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof X==="function"?$!==X||!q:!X.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?q.call($,Z):q?q.value=Z:X.set($,Z),Z},z=function($,X,Z,J){if(Z==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof X==="function"?$!==X||!J:!X.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return Z==="m"?J:Z==="a"?J.call($):J?J.value:X.get($)},H0,h1,A$,S0,O0,Z2,_1,N1,J2,v0,Q2,f0,t0,E0,k0,q2,q$,_0,f,Y2,G2,A0,D1,Y$,S1,R1,H2,g,v1,f1,k1,c,z2,o0,Q0;function _Q($){return(X=[],Z=$.process.cwd(),J)=>{let q=new RQ(X,Z,J,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var rJ=Symbol("copyDoubleDash"),sJ=Symbol("copyDoubleDash"),C6=Symbol("deleteFromParserHintObject"),eJ=Symbol("emitWarning"),$Q=Symbol("freeze"),XQ=Symbol("getDollarZero"),b1=Symbol("getParserConfiguration"),ZQ=Symbol("getUsageConfiguration"),j6=Symbol("guessLocale"),JQ=Symbol("guessVersion"),QQ=Symbol("parsePositionalNumbers"),x6=Symbol("pkgUp"),T1=Symbol("populateParserHintArray"),G$=Symbol("populateParserHintSingleValueDictionary"),I6=Symbol("populateParserHintArrayDictionary"),w6=Symbol("populateParserHintDictionary"),O6=Symbol("sanitizeKey"),E6=Symbol("setKey"),A6=Symbol("unfreeze"),qQ=Symbol("validateAsync"),YQ=Symbol("getCommandInstance"),GQ=Symbol("getContext"),HQ=Symbol("getHasOutput"),zQ=Symbol("getLoggerInstance"),KQ=Symbol("getParseContext"),BQ=Symbol("getUsageInstance"),UQ=Symbol("getValidationInstance"),K2=Symbol("hasParseCallback"),WQ=Symbol("isGlobalContext"),y1=Symbol("postProcess"),VQ=Symbol("rebase"),h6=Symbol("reset"),h$=Symbol("runYargsParserAndExecuteCommands"),N6=Symbol("runValidation"),LQ=Symbol("setHasOutput"),g1=Symbol("kTrackManuallySetKeys");class RQ{constructor($=[],X,Z,J){this.customScriptName=!1,this.parsed=!1,H0.set(this,void 0),h1.set(this,void 0),A$.set(this,{commands:[],fullCommands:[]}),S0.set(this,null),O0.set(this,null),Z2.set(this,"show-hidden"),_1.set(this,null),N1.set(this,!0),J2.set(this,{}),v0.set(this,!0),Q2.set(this,[]),f0.set(this,void 0),t0.set(this,{}),E0.set(this,!1),k0.set(this,null),q2.set(this,!0),q$.set(this,void 0),_0.set(this,""),f.set(this,void 0),Y2.set(this,void 0),G2.set(this,{}),A0.set(this,null),D1.set(this,null),Y$.set(this,{}),S1.set(this,{}),R1.set(this,void 0),H2.set(this,!1),g.set(this,void 0),v1.set(this,!1),f1.set(this,!1),k1.set(this,!1),c.set(this,void 0),z2.set(this,{}),o0.set(this,null),Q0.set(this,void 0),h(this,g,J,"f"),h(this,R1,$,"f"),h(this,h1,X,"f"),h(this,Y2,Z,"f"),h(this,f0,new T6(this),"f"),this.$0=this[XQ](),this[h6](),h(this,H0,z(this,H0,"f"),"f"),h(this,c,z(this,c,"f"),"f"),h(this,Q0,z(this,Q0,"f"),"f"),h(this,f,z(this,f,"f"),"f"),z(this,f,"f").showHiddenOpt=z(this,Z2,"f"),h(this,q$,this[sJ](),"f")}addHelpOpt($,X){if(A("[string|boolean] [string]",[$,X],arguments.length),z(this,k0,"f"))this[C6](z(this,k0,"f")),h(this,k0,null,"f");if($===!1&&X===void 0)return this;return h(this,k0,typeof $==="string"?$:"help","f"),this.boolean(z(this,k0,"f")),this.describe(z(this,k0,"f"),X||z(this,c,"f").deferY18nLookup("Show help")),this}help($,X){return this.addHelpOpt($,X)}addShowHiddenOpt($,X){if(A("[string|boolean] [string]",[$,X],arguments.length),$===!1&&X===void 0)return this;let Z=typeof $==="string"?$:z(this,Z2,"f");return this.boolean(Z),this.describe(Z,X||z(this,c,"f").deferY18nLookup("Show hidden options")),z(this,f,"f").showHiddenOpt=Z,this}showHidden($,X){return this.addShowHiddenOpt($,X)}alias($,X){return A("<object|string|array> [string|array]",[$,X],arguments.length),this[I6](this.alias.bind(this),"alias",$,X),this}array($){return A("<array|string>",[$],arguments.length),this[T1]("array",$),this[g1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[T1]("boolean",$),this[g1]($),this}check($,X){return A("<function> [boolean]",[$,X],arguments.length),this.middleware((Z,J)=>{return A1(()=>{return $(Z,J.getOptions())},(q)=>{if(!q)z(this,c,"f").fail(z(this,g,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,c,"f").fail(q.toString(),q);return Z},(q)=>{return z(this,c,"f").fail(q.message?q.message:q.toString(),q),Z})},!1,X),this}choices($,X){return A("<object|string|array> [string|array]",[$,X],arguments.length),this[I6](this.choices.bind(this),"choices",$,X),this}coerce($,X){if(A("<object|string|array> [function]",[$,X],arguments.length),Array.isArray($)){if(!X)throw new X0("coerce callback must be provided");for(let Z of $)this.coerce(Z,X);return this}else if(typeof $==="object"){for(let Z of Object.keys($))this.coerce(Z,$[Z]);return this}if(!X)throw new X0("coerce callback must be provided");return z(this,f,"f").key[$]=!0,z(this,f0,"f").addCoerceMiddleware((Z,J)=>{let q;if(!Object.prototype.hasOwnProperty.call(Z,$))return Z;return A1(()=>{return q=J.getAliases(),X(Z[$])},(Q)=>{Z[$]=Q;let G=J.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])Z[H]=Q;return Z},(Q)=>{throw new X0(Q.message)})},$),this}conflicts($,X){return A("<string|object> [string|array]",[$,X],arguments.length),z(this,Q0,"f").conflicts($,X),this}config($="config",X,Z){if(A("[object|string] [string|function] [function]",[$,X,Z],arguments.length),typeof $==="object"&&!Array.isArray($))return $=E$($,z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat($),this;if(typeof X==="function")Z=X,X=void 0;return this.describe($,X||z(this,c,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((J)=>{z(this,f,"f").config[J]=Z||!0}),this}completion($,X,Z){if(A("[string] [string|boolean|function] [function]",[$,X,Z],arguments.length),typeof X==="function")Z=X,X=void 0;if(h(this,O0,$||z(this,O0,"f")||"completion","f"),!X&&X!==!1)X="generate completion script";if(this.command(z(this,O0,"f"),X),Z)z(this,S0,"f").registerFunction(Z);return this}command($,X,Z,J,q,Y){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,X,Z,J,q,Y],arguments.length),z(this,H0,"f").addHandler($,X,Z,J,q,Y),this}commands($,X,Z,J,q,Y){return this.command($,X,Z,J,q,Y)}commandDir($,X){A("<string> [object]",[$,X],arguments.length);let Z=z(this,Y2,"f")||z(this,g,"f").require;return z(this,H0,"f").addDirectory($,Z,z(this,g,"f").getCallerFile(),X),this}count($){return A("<array|string>",[$],arguments.length),this[T1]("count",$),this[g1]($),this}default($,X,Z){if(A("<object|string|array> [*] [string]",[$,X,Z],arguments.length),Z)R6($,z(this,g,"f")),z(this,f,"f").defaultDescription[$]=Z;if(typeof X==="function"){if(R6($,z(this,g,"f")),!z(this,f,"f").defaultDescription[$])z(this,f,"f").defaultDescription[$]=z(this,c,"f").functionDescription(X);X=X.call()}return this[G$](this.default.bind(this),"default",$,X),this}defaults($,X,Z){return this.default($,X,Z)}demandCommand($=1,X,Z,J){if(A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,X,Z,J],arguments.length),typeof X!=="number")Z=X,X=1/0;return this.global("_",!1),z(this,f,"f").demandedCommands._={min:$,max:X,minMsg:Z,maxMsg:J},this}demand($,X,Z){if(Array.isArray(X))X.forEach((J)=>{j0(Z,!0,z(this,g,"f")),this.demandOption(J,Z)}),X=1/0;else if(typeof X!=="number")Z=X,X=1/0;if(typeof $==="number")j0(Z,!0,z(this,g,"f")),this.demandCommand($,X,Z,Z);else if(Array.isArray($))$.forEach((J)=>{j0(Z,!0,z(this,g,"f")),this.demandOption(J,Z)});else if(typeof Z==="string")this.demandOption($,Z);else if(Z===!0||typeof Z>"u")this.demandOption($);return this}demandOption($,X){return A("<object|string|array> [string]",[$,X],arguments.length),this[G$](this.demandOption.bind(this),"demandedOptions",$,X),this}deprecateOption($,X){return A("<string> [string|boolean]",[$,X],arguments.length),z(this,f,"f").deprecatedOptions[$]=X,this}describe($,X){return A("<object|string|array> [string]",[$,X],arguments.length),this[E6]($,!0),z(this,c,"f").describe($,X),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,N1,$,"f"),this}env($){if(A("[string|boolean]",[$],arguments.length),$===!1)delete z(this,f,"f").envPrefix;else z(this,f,"f").envPrefix=$||"";return this}epilogue($){return A("<string>",[$],arguments.length),z(this,c,"f").epilog($),this}epilog($){return this.epilogue($)}example($,X){if(A("<string|array> [string]",[$,X],arguments.length),Array.isArray($))$.forEach((Z)=>this.example(...Z));else z(this,c,"f").example($,X);return this}exit($,X){if(h(this,E0,!0,"f"),h(this,_1,X,"f"),z(this,v0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,v0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new X0("Invalid first argument. Expected function or boolean 'false'");return z(this,c,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,X){if(A("<array> [function]",[$,X],arguments.length),!X)return new Promise((Z,J)=>{z(this,S0,"f").getCompletion($,(q,Y)=>{if(q)J(q);else Z(Y)})});else return z(this,S0,"f").getCompletion($,X)}getDemandedOptions(){return A([],0),z(this,f,"f").demandedOptions}getDemandedCommands(){return A([],0),z(this,f,"f").demandedCommands}getDeprecatedOptions(){return A([],0),z(this,f,"f").deprecatedOptions}getDetectLocale(){return z(this,N1,"f")}getExitProcess(){return z(this,v0,"f")}getGroups(){return Object.assign({},z(this,t0,"f"),z(this,S1,"f"))}getHelp(){if(h(this,E0,!0,"f"),!z(this,c,"f").hasCachedHelpMessage()){if(!this.parsed){let X=this[h$](z(this,R1,"f"),void 0,void 0,0,!0);if(Z0(X))return X.then(()=>{return z(this,c,"f").help()})}let $=z(this,H0,"f").runDefaultBuilderOn(this);if(Z0($))return $.then(()=>{return z(this,c,"f").help()})}return Promise.resolve(z(this,c,"f").help())}getOptions(){return z(this,f,"f")}getStrict(){return z(this,v1,"f")}getStrictCommands(){return z(this,f1,"f")}getStrictOptions(){return z(this,k1,"f")}global($,X){if(A("<string|array> [boolean]",[$,X],arguments.length),$=[].concat($),X!==!1)z(this,f,"f").local=z(this,f,"f").local.filter((Z)=>$.indexOf(Z)===-1);else $.forEach((Z)=>{if(!z(this,f,"f").local.includes(Z))z(this,f,"f").local.push(Z)});return this}group($,X){A("<string|array> <string>",[$,X],arguments.length);let Z=z(this,S1,"f")[X]||z(this,t0,"f")[X];if(z(this,S1,"f")[X])delete z(this,S1,"f")[X];let J={};return z(this,t0,"f")[X]=(Z||[]).concat($).filter((q)=>{if(J[q])return!1;return J[q]=!0}),this}hide($){return A("<string>",[$],arguments.length),z(this,f,"f").hiddenOptions.push($),this}implies($,X){return A("<string|object> [number|string|array]",[$,X],arguments.length),z(this,Q0,"f").implies($,X),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[j6](),z(this,g,"f").y18n.getLocale();return h(this,N1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,X,Z){return z(this,f0,"f").addMiddleware($,!!X,Z)}nargs($,X){return A("<string|object|array> [number]",[$,X],arguments.length),this[G$](this.nargs.bind(this),"narg",$,X),this}normalize($){return A("<array|string>",[$],arguments.length),this[T1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[T1]("number",$),this[g1]($),this}option($,X){if(A("<string|object> [object]",[$,X],arguments.length),typeof $==="object")Object.keys($).forEach((Z)=>{this.options(Z,$[Z])});else{if(typeof X!=="object")X={};if(this[g1]($),z(this,o0,"f")&&($==="version"||(X===null||X===void 0?void 0:X.alias)==="version"))this[eJ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
159
- `),void 0,"versionWarning");if(z(this,f,"f").key[$]=!0,X.alias)this.alias($,X.alias);let Z=X.deprecate||X.deprecated;if(Z)this.deprecateOption($,Z);let J=X.demand||X.required||X.require;if(J)this.demand($,J);if(X.demandOption)this.demandOption($,typeof X.demandOption==="string"?X.demandOption:void 0);if(X.conflicts)this.conflicts($,X.conflicts);if("default"in X)this.default($,X.default);if(X.implies!==void 0)this.implies($,X.implies);if(X.nargs!==void 0)this.nargs($,X.nargs);if(X.config)this.config($,X.configParser);if(X.normalize)this.normalize($);if(X.choices)this.choices($,X.choices);if(X.coerce)this.coerce($,X.coerce);if(X.group)this.group($,X.group);if(X.boolean||X.type==="boolean"){if(this.boolean($),X.alias)this.boolean(X.alias)}if(X.array||X.type==="array"){if(this.array($),X.alias)this.array(X.alias)}if(X.number||X.type==="number"){if(this.number($),X.alias)this.number(X.alias)}if(X.string||X.type==="string"){if(this.string($),X.alias)this.string(X.alias)}if(X.count||X.type==="count")this.count($);if(typeof X.global==="boolean")this.global($,X.global);if(X.defaultDescription)z(this,f,"f").defaultDescription[$]=X.defaultDescription;if(X.skipValidation)this.skipValidation($);let q=X.describe||X.description||X.desc,Y=z(this,c,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(X.hidden)this.hide($);if(X.requiresArg)this.requiresArg($)}return this}options($,X){return this.option($,X)}parse($,X,Z){if(A("[string|array] [function|boolean|object] [function]",[$,X,Z],arguments.length),this[$Q](),typeof $>"u")$=z(this,R1,"f");if(typeof X==="object")h(this,D1,X,"f"),X=Z;if(typeof X==="function")h(this,A0,X,"f"),X=!1;if(!X)h(this,R1,$,"f");if(z(this,A0,"f"))h(this,v0,!1,"f");let J=this[h$]($,!!X),q=this.parsed;if(z(this,S0,"f").setParsed(this.parsed),Z0(J))return J.then((Y)=>{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,_1,"f"),Y,z(this,_0,"f"));return Y}).catch((Y)=>{if(z(this,A0,"f"))z(this,A0,"f")(Y,this.parsed.argv,z(this,_0,"f"));throw Y}).finally(()=>{this[A6](),this.parsed=q});else{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,_1,"f"),J,z(this,_0,"f"));this[A6](),this.parsed=q}return J}parseAsync($,X,Z){let J=this.parse($,X,Z);return!Z0(J)?Promise.resolve(J):J}parseSync($,X,Z){let J=this.parse($,X,Z);if(Z0(J))throw new X0(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return J}parserConfiguration($){return A("<object>",[$],arguments.length),h(this,G2,$,"f"),this}pkgConf($,X){A("<string> [string]",[$,X],arguments.length);let Z=null,J=this[x6](X||z(this,h1,"f"));if(J[$]&&typeof J[$]==="object")Z=E$(J[$],X||z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat(Z);return this}positional($,X){A("<string> <object>",[$,X],arguments.length);let Z=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];X=V1(X,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return Z.includes(Y)});let J=z(this,A$,"f").fullCommands[z(this,A$,"f").fullCommands.length-1],q=J?z(this,H0,"f").cmdToParseOptions(J):{array:[],alias:{},default:{},demand:{}};return J$(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)X[Y]=!0}else if(Q[$]&&!(Y in X))X[Y]=Q[$]}),this.group($,z(this,c,"f").getPositionalGroupName()),this.option($,X)}recommendCommands($=!0){return A("[boolean]",[$],arguments.length),h(this,H2,$,"f"),this}required($,X,Z){return this.demand($,X,Z)}require($,X,Z){return this.demand($,X,Z)}requiresArg($){if(A("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,f,"f").narg[$])return this;else this[G$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,X){return A("[string] [string]",[$,X],arguments.length),$=$||this.$0,z(this,q$,"f").log(z(this,S0,"f").generateCompletionScript($,X||z(this,O0,"f")||"completion")),this}showHelp($){if(A("[string|function]",[$],arguments.length),h(this,E0,!0,"f"),!z(this,c,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[h$](z(this,R1,"f"),void 0,void 0,0,!0);if(Z0(Z))return Z.then(()=>{z(this,c,"f").showHelp($)}),this}let X=z(this,H0,"f").runDefaultBuilderOn(this);if(Z0(X))return X.then(()=>{z(this,c,"f").showHelp($)}),this}return z(this,c,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,X){return A("[boolean|string] [string]",[$,X],arguments.length),z(this,c,"f").showHelpOnFail($,X),this}showVersion($){return A("[string|function]",[$],arguments.length),z(this,c,"f").showVersion($),this}skipValidation($){return A("<array|string>",[$],arguments.length),this[T1]("skipValidation",$),this}strict($){return A("[boolean]",[$],arguments.length),h(this,v1,$!==!1,"f"),this}strictCommands($){return A("[boolean]",[$],arguments.length),h(this,f1,$!==!1,"f"),this}strictOptions($){return A("[boolean]",[$],arguments.length),h(this,k1,$!==!1,"f"),this}string($){return A("<array|string>",[$],arguments.length),this[T1]("string",$),this[g1]($),this}terminalWidth(){return A([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return A("<object>",[$],arguments.length),h(this,N1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,X,Z,J){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[$,X,Z,J],arguments.length),X!==void 0)if(j0($,null,z(this,g,"f")),($||"").match(/^\$0( |$)/))return this.command($,X,Z,J);else throw new X0(".usage() description must start with $0 if being used as alias for .command()");else return z(this,c,"f").usage($),this}usageConfiguration($){return A("<object>",[$],arguments.length),h(this,z2,$,"f"),this}version($,X,Z){if(A("[boolean|string] [string] [string]",[$,X,Z],arguments.length),z(this,o0,"f"))this[C6](z(this,o0,"f")),z(this,c,"f").version(void 0),h(this,o0,null,"f");if(arguments.length===0)Z=this[JQ](),$="version";else if(arguments.length===1){if($===!1)return this;Z=$,$="version"}else if(arguments.length===2)Z=X,X=void 0;return h(this,o0,typeof $==="string"?$:"version","f"),X=X||z(this,c,"f").deferY18nLookup("Show version number"),z(this,c,"f").version(Z||void 0),this.boolean(z(this,o0,"f")),this.describe(z(this,o0,"f"),X),this}wrap($){return A("<number|null|undefined>",[$],arguments.length),z(this,c,"f").wrap($),this}[(H0=new WeakMap,h1=new WeakMap,A$=new WeakMap,S0=new WeakMap,O0=new WeakMap,Z2=new WeakMap,_1=new WeakMap,N1=new WeakMap,J2=new WeakMap,v0=new WeakMap,Q2=new WeakMap,f0=new WeakMap,t0=new WeakMap,E0=new WeakMap,k0=new WeakMap,q2=new WeakMap,q$=new WeakMap,_0=new WeakMap,f=new WeakMap,Y2=new WeakMap,G2=new WeakMap,A0=new WeakMap,D1=new WeakMap,Y$=new WeakMap,S1=new WeakMap,R1=new WeakMap,H2=new WeakMap,g=new WeakMap,v1=new WeakMap,f1=new WeakMap,k1=new WeakMap,c=new WeakMap,z2=new WeakMap,o0=new WeakMap,Q0=new WeakMap,rJ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(X){}return $}[sJ](){return{log:(...$)=>{if(!this[K2]())console.log(...$);if(h(this,E0,!0,"f"),z(this,_0,"f").length)h(this,_0,z(this,_0,"f")+`
160
- `,"f");h(this,_0,z(this,_0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[K2]())console.error(...$);if(h(this,E0,!0,"f"),z(this,_0,"f").length)h(this,_0,z(this,_0,"f")+`
161
- `,"f");h(this,_0,z(this,_0,"f")+$.join(" "),"f")}}}[C6]($){J$(z(this,f,"f")).forEach((X)=>{if(((J)=>J==="configObjects")(X))return;let Z=z(this,f,"f")[X];if(Array.isArray(Z)){if(Z.includes($))Z.splice(Z.indexOf($),1)}else if(typeof Z==="object")delete Z[$]}),delete z(this,c,"f").getDescriptions()[$]}[eJ]($,X,Z){if(!z(this,J2,"f")[Z])z(this,g,"f").process.emitWarning($,X),z(this,J2,"f")[Z]=!0}[$Q](){z(this,Q2,"f").push({options:z(this,f,"f"),configObjects:z(this,f,"f").configObjects.slice(0),exitProcess:z(this,v0,"f"),groups:z(this,t0,"f"),strict:z(this,v1,"f"),strictCommands:z(this,f1,"f"),strictOptions:z(this,k1,"f"),completionCommand:z(this,O0,"f"),output:z(this,_0,"f"),exitError:z(this,_1,"f"),hasOutput:z(this,E0,"f"),parsed:this.parsed,parseFn:z(this,A0,"f"),parseContext:z(this,D1,"f")}),z(this,c,"f").freeze(),z(this,Q0,"f").freeze(),z(this,H0,"f").freeze(),z(this,f0,"f").freeze()}[XQ](){let $="",X;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))X=z(this,g,"f").process.argv().slice(1,2);else X=z(this,g,"f").process.argv().slice(0,1);if($=X.map((Z)=>{let J=this[VQ](z(this,h1,"f"),Z);return Z.match(/^(\/|([a-zA-Z]:)?\\)/)&&J.length<Z.length?J:Z}).join(" ").trim(),z(this,g,"f").getEnv("_")&&z(this,g,"f").getProcessArgvBin()===z(this,g,"f").getEnv("_"))$=z(this,g,"f").getEnv("_").replace(`${z(this,g,"f").path.dirname(z(this,g,"f").process.execPath())}/`,"");return $}[b1](){return z(this,G2,"f")}[ZQ](){return z(this,z2,"f")}[j6](){if(!z(this,N1,"f"))return;let $=z(this,g,"f").getEnv("LC_ALL")||z(this,g,"f").getEnv("LC_MESSAGES")||z(this,g,"f").getEnv("LANG")||z(this,g,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[JQ](){return this[x6]().version||"unknown"}[QQ]($){let X=$["--"]?$["--"]:$._;for(let Z=0,J;(J=X[Z])!==void 0;Z++)if(z(this,g,"f").Parser.looksLikeNumber(J)&&Number.isSafeInteger(Math.floor(parseFloat(`${J}`))))X[Z]=Number(J);return $}[x6]($){let X=$||"*";if(z(this,Y$,"f")[X])return z(this,Y$,"f")[X];let Z={};try{let J=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(J))J=z(this,g,"f").path.dirname(J);let q=z(this,g,"f").findUp(J,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});j0(q,void 0,z(this,g,"f")),Z=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(J){}return z(this,Y$,"f")[X]=Z||{},z(this,Y$,"f")[X]}[T1]($,X){X=[].concat(X),X.forEach((Z)=>{Z=this[O6](Z),z(this,f,"f")[$].push(Z)})}[G$]($,X,Z,J){this[w6]($,X,Z,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=Q})}[I6]($,X,Z,J){this[w6]($,X,Z,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=(z(this,f,"f")[q][Y]||[]).concat(Q)})}[w6]($,X,Z,J,q){if(Array.isArray(Z))Z.forEach((Y)=>{$(Y,J)});else if(((Y)=>typeof Y==="object")(Z))for(let Y of J$(Z))$(Y,Z[Y]);else q(X,this[O6](Z),J)}[O6]($){if($==="__proto__")return"___proto___";return $}[E6]($,X){return this[G$](this[E6].bind(this),"key",$,X),this}[A6](){var $,X,Z,J,q,Y,Q,G,H,B,K,U;let W=z(this,Q2,"f").pop();j0(W,void 0,z(this,g,"f"));let _;$=this,X=this,Z=this,J=this,q=this,Y=this,Q=this,G=this,H=this,B=this,K=this,U=this,{options:{set value(R){h($,f,R,"f")}}.value,configObjects:_,exitProcess:{set value(R){h(X,v0,R,"f")}}.value,groups:{set value(R){h(Z,t0,R,"f")}}.value,output:{set value(R){h(J,_0,R,"f")}}.value,exitError:{set value(R){h(q,_1,R,"f")}}.value,hasOutput:{set value(R){h(Y,E0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){h(Q,v1,R,"f")}}.value,strictCommands:{set value(R){h(G,f1,R,"f")}}.value,strictOptions:{set value(R){h(H,k1,R,"f")}}.value,completionCommand:{set value(R){h(B,O0,R,"f")}}.value,parseFn:{set value(R){h(K,A0,R,"f")}}.value,parseContext:{set value(R){h(U,D1,R,"f")}}.value}=W,z(this,f,"f").configObjects=_,z(this,c,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,H0,"f").unfreeze(),z(this,f0,"f").unfreeze()}[qQ]($,X){return A1(X,(Z)=>{return $(Z),Z})}getInternalMethods(){return{getCommandInstance:this[YQ].bind(this),getContext:this[GQ].bind(this),getHasOutput:this[HQ].bind(this),getLoggerInstance:this[zQ].bind(this),getParseContext:this[KQ].bind(this),getParserConfiguration:this[b1].bind(this),getUsageConfiguration:this[ZQ].bind(this),getUsageInstance:this[BQ].bind(this),getValidationInstance:this[UQ].bind(this),hasParseCallback:this[K2].bind(this),isGlobalContext:this[WQ].bind(this),postProcess:this[y1].bind(this),reset:this[h6].bind(this),runValidation:this[N6].bind(this),runYargsParserAndExecuteCommands:this[h$].bind(this),setHasOutput:this[LQ].bind(this)}}[YQ](){return z(this,H0,"f")}[GQ](){return z(this,A$,"f")}[HQ](){return z(this,E0,"f")}[zQ](){return z(this,q$,"f")}[KQ](){return z(this,D1,"f")||{}}[BQ](){return z(this,c,"f")}[UQ](){return z(this,Q0,"f")}[K2](){return!!z(this,A0,"f")}[WQ](){return z(this,q2,"f")}[y1]($,X,Z,J){if(Z)return $;if(Z0($))return $;if(!X)$=this[rJ]($);if(this[b1]()["parse-positional-numbers"]||this[b1]()["parse-positional-numbers"]===void 0)$=this[QQ]($);if(J)$=E1($,this,z(this,f0,"f").getMiddleware(),!1);return $}[h6]($={}){h(this,f,z(this,f,"f")||{},"f");let X={};X.local=z(this,f,"f").local||[],X.configObjects=z(this,f,"f").configObjects||[];let Z={};X.local.forEach((Y)=>{Z[Y]=!0,($[Y]||[]).forEach((Q)=>{Z[Q]=!0})}),Object.assign(z(this,S1,"f"),Object.keys(z(this,t0,"f")).reduce((Y,Q)=>{let G=z(this,t0,"f")[Q].filter((H)=>!(H in Z));if(G.length>0)Y[Q]=G;return Y},{})),h(this,t0,{},"f");let J=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(J.forEach((Y)=>{X[Y]=(z(this,f,"f")[Y]||[]).filter((Q)=>!Z[Q])}),q.forEach((Y)=>{X[Y]=V1(z(this,f,"f")[Y],(Q)=>!Z[Q])}),X.envPrefix=z(this,f,"f").envPrefix,h(this,f,X,"f"),h(this,c,z(this,c,"f")?z(this,c,"f").reset(Z):uJ(this,z(this,g,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset(Z):oJ(this,z(this,c,"f"),z(this,g,"f")),"f"),h(this,H0,z(this,H0,"f")?z(this,H0,"f").reset():gJ(z(this,c,"f"),z(this,Q0,"f"),z(this,f0,"f"),z(this,g,"f")),"f"),!z(this,S0,"f"))h(this,S0,nJ(this,z(this,c,"f"),z(this,H0,"f"),z(this,g,"f")),"f");return z(this,f0,"f").reset(),h(this,O0,null,"f"),h(this,_0,"","f"),h(this,_1,null,"f"),h(this,E0,!1,"f"),this.parsed=!1,this}[VQ]($,X){return z(this,g,"f").path.relative($,X)}[h$]($,X,Z,J=0,q=!1){let Y=!!Z||q;$=$||z(this,R1,"f"),z(this,f,"f").__=z(this,g,"f").y18n.__,z(this,f,"f").configuration=this[b1]();let Q=!!z(this,f,"f").configuration["populate--"],G=Object.assign({},z(this,f,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,f,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),B=Object.assign(H.argv,z(this,D1,"f")),K=void 0,U=H.aliases,W=!1,_=!1;if(Object.keys(B).forEach((R)=>{if(R===z(this,k0,"f")&&B[R])W=!0;else if(R===z(this,o0,"f")&&B[R])_=!0}),B.$0=this.$0,this.parsed=H,J===0)z(this,c,"f").clearCachedHelpMessage();try{if(this[j6](),X)return this[y1](B,Q,!!Z,!1);if(z(this,k0,"f")){if([z(this,k0,"f")].concat(U[z(this,k0,"f")]||[]).filter((N)=>N.length>1).includes(""+B._[B._.length-1]))B._.pop(),W=!0}h(this,q2,!1,"f");let R=z(this,H0,"f").getCommands(),L=z(this,S0,"f").completionKey in B,I=W||L||q;if(B._.length){if(R.length){let j;for(let N=J||0,u;B._[N]!==void 0;N++)if(u=String(B._[N]),R.includes(u)&&u!==z(this,O0,"f")){let x=z(this,H0,"f").runCommand(u,this,H,N+1,q,W||_||q);return this[y1](x,Q,!!Z,!1)}else if(!j&&u!==z(this,O0,"f")){j=u;break}if(!z(this,H0,"f").hasDefaultCommand()&&z(this,H2,"f")&&j&&!I)z(this,Q0,"f").recommendCommands(j,R)}if(z(this,O0,"f")&&B._.includes(z(this,O0,"f"))&&!L){if(z(this,v0,"f"))L1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,H0,"f").hasDefaultCommand()&&!I){let j=z(this,H0,"f").runCommand(null,this,H,0,q,W||_||q);return this[y1](j,Q,!!Z,!1)}if(L){if(z(this,v0,"f"))L1(!0);$=[].concat($);let j=$.slice($.indexOf(`--${z(this,S0,"f").completionKey}`)+1);return z(this,S0,"f").getCompletion(j,(N,u)=>{if(N)throw new X0(N.message);(u||[]).forEach((x)=>{z(this,q$,"f").log(x)}),this.exit(0)}),this[y1](B,!Q,!!Z,!1)}if(!z(this,E0,"f")){if(W){if(z(this,v0,"f"))L1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(_){if(z(this,v0,"f"))L1(!0);Y=!0,z(this,c,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,f,"f").skipValidation.length>0)Y=Object.keys(B).some((j)=>z(this,f,"f").skipValidation.indexOf(j)>=0&&B[j]===!0);if(!Y){if(H.error)throw new X0(H.error.message);if(!L){let j=this[N6](U,{},H.error);if(!Z)K=E1(B,this,z(this,f0,"f").getMiddleware(),!0);if(K=this[qQ](j,K!==null&&K!==void 0?K:B),Z0(K)&&!Z)K=K.then(()=>{return E1(B,this,z(this,f0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof X0)z(this,c,"f").fail(R.message,R);else throw R}return this[y1](K!==null&&K!==void 0?K:B,Q,!!Z,!0)}[N6]($,X,Z,J){let q={...this.getDemandedOptions()};return(Y)=>{if(Z)throw new X0(Z.message);z(this,Q0,"f").nonOptionCount(Y),z(this,Q0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,f1,"f"))Q=z(this,Q0,"f").unknownCommands(Y);if(z(this,v1,"f")&&!Q)z(this,Q0,"f").unknownArguments(Y,$,X,!!J);else if(z(this,k1,"f"))z(this,Q0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Q0,"f").limitedChoices(Y),z(this,Q0,"f").implications(Y),z(this,Q0,"f").conflicting(Y)}}[LQ](){h(this,E0,!0,"f")}[g1]($){if(typeof $==="string")z(this,f,"f").key[$]=!0;else for(let X of $)z(this,f,"f").key[X]=!0}}function mJ($){return!!$&&typeof $.getInternalMethods==="function"}var DU=_Q(_6),TQ=DU;import{existsSync as D6,readFileSync as PQ,rmSync as SU,writeFileSync as vU}from"fs";import{resolve as F1,dirname as fU,join as kU,basename as bU}from"path";import{fileURLToPath as yU}from"url";var FQ="https://github.com/ardzero/bunext.git",gU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],mU=!0;function cU(){try{let $=yU(import.meta.url),X=fU($),Z=kU(X,"../package.json");return JSON.parse(PQ(Z,"utf-8")).version}catch{return"0.1.0"}}function uU($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function S6($){if(!$)return"Project name is required";if($===".")return;if(!/^\.\/[a-zA-Z0-9-]+$/.test($)&&!/^[a-zA-Z0-9-]+$/.test($))return"Project name must contain only letters, numbers, and hyphens";let X=$.startsWith("./")?$.slice(2):$;if(D6(F1(process.cwd(),X)))return`Directory "${X}" already exists`}async function MQ(){let $=await J6({message:"Where should we create your new project?",placeholder:"./my-app",validate:S6});if(m0($))U1("Operation cancelled"),process.exit(0);return $}function pU(){console.clear(),a4(a.default.bgCyan(a.default.black(" create-bunext "))),console.log(a.default.bold(`
162
- Usage:`)),console.log(` ${a.default.cyan("bun create bunext")} ${a.default.dim("[project-name] [options]")}`),q6(`${a.default.cyan("bun create bunext my-app")}
154
+ `;class oJ{constructor($,Z,X,J){var q,Y,Q;this.yargs=$,this.usage=Z,this.command=X,this.shim=J,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=(Q=((q=this.shim.getEnv("SHELL"))===null||q===void 0?void 0:q.includes("zsh"))||((Y=this.shim.getEnv("ZSH_NAME"))===null||Y===void 0?void 0:Y.includes("zsh")))!==null&&Q!==void 0?Q:!1}defaultCompletion($,Z,X,J){let q=this.command.getCommandHandlers();for(let Q=0,G=$.length;Q<G;++Q)if(q[$[Q]]&&q[$[Q]].builder){let H=q[$[Q]].builder;if(Z2(H)){this.indexAfterLastReset=Q+1;let K=this.yargs.getInternalMethods().reset();return H(K,!0),K.argv}}let Y=[];this.commandCompletions(Y,$,X),this.optionCompletions(Y,$,Z,X),this.choicesFromOptionsCompletions(Y,$,Z,X),this.choicesFromPositionalsCompletions(Y,$,Z,X),J(null,Y)}commandCompletions($,Z,X){let J=this.yargs.getInternalMethods().getContext().commands;if(!X.match(/^-/)&&J[J.length-1]!==X&&!this.previousArgHasChoices(Z))this.usage.getCommands().forEach((q)=>{let Y=V1(q[0]).cmd;if(Z.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,Z,X,J){if((J.match(/^-/)||J===""&&$.length===0)&&!this.previousArgHasChoices(Z)){let q=this.yargs.getOptions(),Y=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(q.key).forEach((Q)=>{let G=!!q.configuration["boolean-negation"]&&q.boolean.includes(Q);if(!Y.includes(Q)&&!q.hiddenOptions.includes(Q)&&!this.argsContainKey(Z,Q,G))this.completeOptionKey(Q,$,J,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,Z,X,J){if(this.previousArgHasChoices(Z)){let q=this.getPreviousArgChoices(Z);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,Z,X,J){if(J===""&&$.length>0&&this.previousArgHasChoices(Z))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[X._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(J))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let Z=$[$.length-1],X="";if(!Z.startsWith("-")&&$.length>1)X=Z,Z=$[$.length-2];if(!Z.startsWith("-"))return;let J=Z.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[J,...this.yargs.getAliases()[J]||[]],Q;for(let G of Y)if(Object.prototype.hasOwnProperty.call(q.key,G)&&Array.isArray(q.choices[G])){Q=q.choices[G];break}if(Q)return Q.filter((G)=>!X||G.startsWith(X))}previousArgHasChoices($){let Z=this.getPreviousArgChoices($);return Z!==void 0&&Z.length>0}argsContainKey($,Z,X){let J=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(J(Z))return!0;if(X&&J(`no-${Z}`))return!0;if(this.aliases){for(let q of this.aliases[Z])if(J(q))return!0}return!1}completeOptionKey($,Z,X,J){var q,Y,Q,G;let H=$;if(this.zshShell){let B=this.usage.getDescriptions(),R=(Y=(q=this===null||this===void 0?void 0:this.aliases)===null||q===void 0?void 0:q[$])===null||Y===void 0?void 0:Y.find((j)=>{let C=B[j];return typeof C==="string"&&C.length>0}),_=R?B[R]:void 0,L=(G=(Q=B[$])!==null&&Q!==void 0?Q:_)!==null&&G!==void 0?G:"";H=`${$.replace(/:/g,"\\:")}:${L.replace("__yargsString__:","").replace(/(\r\n|\n|\r)/gm," ")}`}let K=(B)=>/^--/.test(B),W=(B)=>/^[^0-9]$/.test(B),U=!K(X)&&W($)?"-":"--";if(Z.push(U+H),J)Z.push(U+"no-"+H)}customCompletion($,Z,X,J){if(P0(this.customCompletionFunction,null,this.shim),DU(this.customCompletionFunction)){let q=this.customCompletionFunction(X,Z);if(X0(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{J(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{J(Y,void 0)})});return J(null,q)}else if(SU(this.customCompletionFunction))return this.customCompletionFunction(X,Z,(q=J)=>this.defaultCompletion($,Z,X,q),(q)=>{J(null,q)});else return this.customCompletionFunction(X,Z,(q)=>{J(null,q)})}getCompletion($,Z){let X=$.length?$[$.length-1]:"",J=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,X,Z):(Y)=>this.defaultCompletion($,Y,X,Z);return X0(J)?J.then(q):q(J)}generateCompletionScript($,Z){let X=this.zshShell?tJ:iJ,J=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return X=X.replace(/{{app_name}}/g,J),X=X.replace(/{{completion_command}}/g,Z),X.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function aJ($,Z,X,J){return new oJ($,Z,X,J)}function DU($){return $.length<3}function SU($){return $.length>3}function rJ($,Z){if($.length===0)return Z.length;if(Z.length===0)return $.length;let X=[],J;for(J=0;J<=Z.length;J++)X[J]=[J];let q;for(q=0;q<=$.length;q++)X[0][q]=q;for(J=1;J<=Z.length;J++)for(q=1;q<=$.length;q++)if(Z.charAt(J-1)===$.charAt(q-1))X[J][q]=X[J-1][q-1];else if(J>1&&q>1&&Z.charAt(J-2)===$.charAt(q-1)&&Z.charAt(J-1)===$.charAt(q-2))X[J][q]=X[J-2][q-2]+1;else X[J][q]=Math.min(X[J-1][q-1]+1,Math.min(X[J][q-1]+1,X[J-1][q]+1));return X[Z.length][$.length]}var sJ=["$0","--","_"];function eJ($,Z,X){let J=X.y18n.__,q=X.y18n.__n,Y={};Y.nonOptionCount=function(U){let B=$.getDemandedCommands(),_=U._.length+(U["--"]?U["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(B._&&(_<B._.min||_>B._.max)){if(_<B._.min)if(B._.minMsg!==void 0)Z.fail(B._.minMsg?B._.minMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.min.toString()):null);else Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",_,_.toString(),B._.min.toString()));else if(_>B._.max)if(B._.maxMsg!==void 0)Z.fail(B._.maxMsg?B._.maxMsg.replace(/\$0/g,_.toString()).replace(/\$1/,B._.max.toString()):null);else Z.fail(q("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",_,_.toString(),B._.max.toString()))}},Y.positionalCount=function(U,B){if(B<U)Z.fail(q("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",B,B+"",U+""))},Y.requiredArguments=function(U,B){let R=null;for(let _ of Object.keys(B))if(!Object.prototype.hasOwnProperty.call(U,_)||typeof U[_]>"u")R=R||{},R[_]=B[_];if(R){let _=[];for(let j of Object.keys(R)){let C=R[j];if(C&&_.indexOf(C)<0)_.push(C)}let L=_.length?`
155
+ ${_.join(`
156
+ `)}`:"";Z.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(R).length,Object.keys(R).join(", ")+L))}},Y.unknownArguments=function(U,B,R,_,L=!0){var j;let C=$.getInternalMethods().getCommandInstance().getCommands(),N=[],c=$.getInternalMethods().getContext();if(Object.keys(U).forEach((I)=>{if(!sJ.includes(I)&&!Object.prototype.hasOwnProperty.call(R,I)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),I)&&!Y.isValidAndSomeAliasIsNotNew(I,B))N.push(I)}),L&&(c.commands.length>0||C.length>0||_))U._.slice(c.commands.length).forEach((I)=>{if(!C.includes(""+I))N.push(""+I)});if(L){let n=((j=$.getDemandedCommands()._)===null||j===void 0?void 0:j.max)||0,i=c.commands.length+n;if(i<U._.length)U._.slice(i).forEach((a)=>{if(a=String(a),!c.commands.includes(a)&&!N.includes(a))N.push(a)})}if(N.length)Z.fail(q("Unknown argument: %s","Unknown arguments: %s",N.length,N.map((I)=>I.trim()?I:`"${I}"`).join(", ")))},Y.unknownCommands=function(U){let B=$.getInternalMethods().getCommandInstance().getCommands(),R=[],_=$.getInternalMethods().getContext();if(_.commands.length>0||B.length>0)U._.slice(_.commands.length).forEach((L)=>{if(!B.includes(""+L))R.push(""+L)});if(R.length>0)return Z.fail(q("Unknown command: %s","Unknown commands: %s",R.length,R.join(", "))),!0;else return!1},Y.isValidAndSomeAliasIsNotNew=function(U,B){if(!Object.prototype.hasOwnProperty.call(B,U))return!1;let R=$.parsed.newAliases;return[U,...B[U]].some((_)=>!Object.prototype.hasOwnProperty.call(R,_)||!R[U])},Y.limitedChoices=function(U){let B=$.getOptions(),R={};if(!Object.keys(B.choices).length)return;Object.keys(U).forEach((j)=>{if(sJ.indexOf(j)===-1&&Object.prototype.hasOwnProperty.call(B.choices,j))[].concat(U[j]).forEach((C)=>{if(B.choices[j].indexOf(C)===-1&&C!==void 0)R[j]=(R[j]||[]).concat(C)})});let _=Object.keys(R);if(!_.length)return;let L=J("Invalid values:");_.forEach((j)=>{L+=`
157
+ ${J("Argument: %s, Given: %s, Choices: %s",j,Z.stringifiedValues(R[j]),Z.stringifiedValues(B.choices[j]))}`}),Z.fail(L)};let Q={};Y.implies=function(U,B){if(A("<string|object> [array|number|string]",[U,B],arguments.length),typeof U==="object")Object.keys(U).forEach((R)=>{Y.implies(R,U[R])});else{if($.global(U),!Q[U])Q[U]=[];if(Array.isArray(B))B.forEach((R)=>Y.implies(U,R));else P0(B,void 0,X),Q[U].push(B)}},Y.getImplied=function(){return Q};function G(W,U){let B=Number(U);if(U=isNaN(B)?U:B,typeof U==="number")U=W._.length>=U;else if(U.match(/^--no-.+/))U=U.match(/^--no-(.+)/)[1],U=!Object.prototype.hasOwnProperty.call(W,U);else U=Object.prototype.hasOwnProperty.call(W,U);return U}Y.implications=function(U){let B=[];if(Object.keys(Q).forEach((R)=>{let _=R;(Q[R]||[]).forEach((L)=>{let j=_,C=L;if(j=G(U,j),L=G(U,L),j&&!L)B.push(` ${_} -> ${C}`)})}),B.length){let R=`${J("Implications failed:")}
158
+ `;B.forEach((_)=>{R+=_}),Z.fail(R)}};let H={};Y.conflicts=function(U,B){if(A("<string|object> [array|string]",[U,B],arguments.length),typeof U==="object")Object.keys(U).forEach((R)=>{Y.conflicts(R,U[R])});else{if($.global(U),!H[U])H[U]=[];if(Array.isArray(B))B.forEach((R)=>Y.conflicts(U,R));else H[U].push(B)}},Y.getConflicting=()=>H,Y.conflicting=function(U){if(Object.keys(U).forEach((B)=>{if(H[B])H[B].forEach((R)=>{if(R&&U[B]!==void 0&&U[R]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((B)=>{H[B].forEach((R)=>{if(R&&U[X.Parser.camelCase(B)]!==void 0&&U[X.Parser.camelCase(R)]!==void 0)Z.fail(J("Arguments %s and %s are mutually exclusive",B,R))})})},Y.recommendCommands=function(U,B){B=B.sort((j,C)=>C.length-j.length);let _=null,L=1/0;for(let j=0,C;(C=B[j])!==void 0;j++){let N=rJ(U,C);if(N<=3&&N<L)L=N,_=C}if(_)Z.fail(J("Did you mean %s?",_))},Y.reset=function(U){return Q=L1(Q,(B)=>!U[B]),H=L1(H,(B)=>!U[B]),Y};let K=[];return Y.freeze=function(){K.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let U=K.pop();P0(U,void 0,X),{implied:Q,conflicting:H}=U},Y}var j6=[],E$;function A$($,Z,X,J){E$=J;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=V0.resolve($.extends)}catch(G){return $}else Q=fU(Z,$.extends);vU(Q),j6.push(Q),q=Y?JSON.parse(E$.readFileSync(Q,"utf8")):V0($.extends),delete $.extends,q=A$(q,E$.path.dirname(Q),X,E$)}return j6=[],X?$Q(q,$):Object.assign({},q,$)}function vU($){if(j6.indexOf($)>-1)throw new Z0(`Circular extended configurations: '${$}'.`)}function fU($,Z){return E$.path.resolve($,Z)}function $Q($,Z){let X={};function J(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(X,$);for(let q of Object.keys(Z))if(J(Z[q])&&J(X[q]))X[q]=$Q($[q],Z[q]);else X[q]=Z[q];return X}var h=function($,Z,X,J,q){if(J==="m")throw TypeError("Private method is not writable");if(J==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof Z==="function"?$!==Z||!q:!Z.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return J==="a"?q.call($,X):q?q.value=X:Z.set($,X),X},z=function($,Z,X,J){if(X==="a"&&!J)throw TypeError("Private accessor was defined without a getter");if(typeof Z==="function"?$!==Z||!J:!Z.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?J:X==="a"?J.call($):J?J.value:Z.get($)},H0,h1,h$,v0,O0,J2,R1,N1,Q2,f0,q2,k0,a0,E0,b0,Y2,Y$,R0,f,G2,H2,A0,D1,G$,S1,T1,z2,g,v1,f1,k1,m,K2,r0,Q0;function MQ($){return(Z=[],X=$.process.cwd(),J)=>{let q=new CQ(Z,X,J,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var ZQ=Symbol("copyDoubleDash"),XQ=Symbol("copyDoubleDash"),I6=Symbol("deleteFromParserHintObject"),JQ=Symbol("emitWarning"),QQ=Symbol("freeze"),qQ=Symbol("getDollarZero"),b1=Symbol("getParserConfiguration"),YQ=Symbol("getUsageConfiguration"),w6=Symbol("guessLocale"),GQ=Symbol("guessVersion"),HQ=Symbol("parsePositionalNumbers"),O6=Symbol("pkgUp"),F1=Symbol("populateParserHintArray"),H$=Symbol("populateParserHintSingleValueDictionary"),E6=Symbol("populateParserHintArrayDictionary"),A6=Symbol("populateParserHintDictionary"),h6=Symbol("sanitizeKey"),N6=Symbol("setKey"),D6=Symbol("unfreeze"),zQ=Symbol("validateAsync"),KQ=Symbol("getCommandInstance"),BQ=Symbol("getContext"),UQ=Symbol("getHasOutput"),WQ=Symbol("getLoggerInstance"),VQ=Symbol("getParseContext"),LQ=Symbol("getUsageInstance"),_Q=Symbol("getValidationInstance"),B2=Symbol("hasParseCallback"),RQ=Symbol("isGlobalContext"),y1=Symbol("postProcess"),TQ=Symbol("rebase"),S6=Symbol("reset"),N$=Symbol("runYargsParserAndExecuteCommands"),v6=Symbol("runValidation"),FQ=Symbol("setHasOutput"),g1=Symbol("kTrackManuallySetKeys");class CQ{constructor($=[],Z,X,J){this.customScriptName=!1,this.parsed=!1,H0.set(this,void 0),h1.set(this,void 0),h$.set(this,{commands:[],fullCommands:[]}),v0.set(this,null),O0.set(this,null),J2.set(this,"show-hidden"),R1.set(this,null),N1.set(this,!0),Q2.set(this,{}),f0.set(this,!0),q2.set(this,[]),k0.set(this,void 0),a0.set(this,{}),E0.set(this,!1),b0.set(this,null),Y2.set(this,!0),Y$.set(this,void 0),R0.set(this,""),f.set(this,void 0),G2.set(this,void 0),H2.set(this,{}),A0.set(this,null),D1.set(this,null),G$.set(this,{}),S1.set(this,{}),T1.set(this,void 0),z2.set(this,!1),g.set(this,void 0),v1.set(this,!1),f1.set(this,!1),k1.set(this,!1),m.set(this,void 0),K2.set(this,{}),r0.set(this,null),Q0.set(this,void 0),h(this,g,J,"f"),h(this,T1,$,"f"),h(this,h1,Z,"f"),h(this,G2,X,"f"),h(this,k0,new C6(this),"f"),this.$0=this[qQ](),this[S6](),h(this,H0,z(this,H0,"f"),"f"),h(this,m,z(this,m,"f"),"f"),h(this,Q0,z(this,Q0,"f"),"f"),h(this,f,z(this,f,"f"),"f"),z(this,f,"f").showHiddenOpt=z(this,J2,"f"),h(this,Y$,this[XQ](),"f")}addHelpOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),z(this,b0,"f"))this[I6](z(this,b0,"f")),h(this,b0,null,"f");if($===!1&&Z===void 0)return this;return h(this,b0,typeof $==="string"?$:"help","f"),this.boolean(z(this,b0,"f")),this.describe(z(this,b0,"f"),Z||z(this,m,"f").deferY18nLookup("Show help")),this}help($,Z){return this.addHelpOpt($,Z)}addShowHiddenOpt($,Z){if(A("[string|boolean] [string]",[$,Z],arguments.length),$===!1&&Z===void 0)return this;let X=typeof $==="string"?$:z(this,J2,"f");return this.boolean(X),this.describe(X,Z||z(this,m,"f").deferY18nLookup("Show hidden options")),z(this,f,"f").showHiddenOpt=X,this}showHidden($,Z){return this.addShowHiddenOpt($,Z)}alias($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.alias.bind(this),"alias",$,Z),this}array($){return A("<array|string>",[$],arguments.length),this[F1]("array",$),this[g1]($),this}boolean($){return A("<array|string>",[$],arguments.length),this[F1]("boolean",$),this[g1]($),this}check($,Z){return A("<function> [boolean]",[$,Z],arguments.length),this.middleware((X,J)=>{return A1(()=>{return $(X,J.getOptions())},(q)=>{if(!q)z(this,m,"f").fail(z(this,g,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,m,"f").fail(q.toString(),q);return X},(q)=>{return z(this,m,"f").fail(q.message?q.message:q.toString(),q),X})},!1,Z),this}choices($,Z){return A("<object|string|array> [string|array]",[$,Z],arguments.length),this[E6](this.choices.bind(this),"choices",$,Z),this}coerce($,Z){if(A("<object|string|array> [function]",[$,Z],arguments.length),Array.isArray($)){if(!Z)throw new Z0("coerce callback must be provided");for(let X of $)this.coerce(X,Z);return this}else if(typeof $==="object"){for(let X of Object.keys($))this.coerce(X,$[X]);return this}if(!Z)throw new Z0("coerce callback must be provided");return z(this,f,"f").key[$]=!0,z(this,k0,"f").addCoerceMiddleware((X,J)=>{let q;if(!Object.prototype.hasOwnProperty.call(X,$))return X;return A1(()=>{return q=J.getAliases(),Z(X[$])},(Q)=>{X[$]=Q;let G=J.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])X[H]=Q;return X},(Q)=>{throw new Z0(Q.message)})},$),this}conflicts($,Z){return A("<string|object> [string|array]",[$,Z],arguments.length),z(this,Q0,"f").conflicts($,Z),this}config($="config",Z,X){if(A("[object|string] [string|function] [function]",[$,Z,X],arguments.length),typeof $==="object"&&!Array.isArray($))return $=A$($,z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat($),this;if(typeof Z==="function")X=Z,Z=void 0;return this.describe($,Z||z(this,m,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((J)=>{z(this,f,"f").config[J]=X||!0}),this}completion($,Z,X){if(A("[string] [string|boolean|function] [function]",[$,Z,X],arguments.length),typeof Z==="function")X=Z,Z=void 0;if(h(this,O0,$||z(this,O0,"f")||"completion","f"),!Z&&Z!==!1)Z="generate completion script";if(this.command(z(this,O0,"f"),Z),X)z(this,v0,"f").registerFunction(X);return this}command($,Z,X,J,q,Y){return A("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,Z,X,J,q,Y],arguments.length),z(this,H0,"f").addHandler($,Z,X,J,q,Y),this}commands($,Z,X,J,q,Y){return this.command($,Z,X,J,q,Y)}commandDir($,Z){A("<string> [object]",[$,Z],arguments.length);let X=z(this,G2,"f")||z(this,g,"f").require;return z(this,H0,"f").addDirectory($,X,z(this,g,"f").getCallerFile(),Z),this}count($){return A("<array|string>",[$],arguments.length),this[F1]("count",$),this[g1]($),this}default($,Z,X){if(A("<object|string|array> [*] [string]",[$,Z,X],arguments.length),X)M6($,z(this,g,"f")),z(this,f,"f").defaultDescription[$]=X;if(typeof Z==="function"){if(M6($,z(this,g,"f")),!z(this,f,"f").defaultDescription[$])z(this,f,"f").defaultDescription[$]=z(this,m,"f").functionDescription(Z);Z=Z.call()}return this[H$](this.default.bind(this),"default",$,Z),this}defaults($,Z,X){return this.default($,Z,X)}demandCommand($=1,Z,X,J){if(A("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,Z,X,J],arguments.length),typeof Z!=="number")X=Z,Z=1/0;return this.global("_",!1),z(this,f,"f").demandedCommands._={min:$,max:Z,minMsg:X,maxMsg:J},this}demand($,Z,X){if(Array.isArray(Z))Z.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)}),Z=1/0;else if(typeof Z!=="number")X=Z,Z=1/0;if(typeof $==="number")P0(X,!0,z(this,g,"f")),this.demandCommand($,Z,X,X);else if(Array.isArray($))$.forEach((J)=>{P0(X,!0,z(this,g,"f")),this.demandOption(J,X)});else if(typeof X==="string")this.demandOption($,X);else if(X===!0||typeof X>"u")this.demandOption($);return this}demandOption($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[H$](this.demandOption.bind(this),"demandedOptions",$,Z),this}deprecateOption($,Z){return A("<string> [string|boolean]",[$,Z],arguments.length),z(this,f,"f").deprecatedOptions[$]=Z,this}describe($,Z){return A("<object|string|array> [string]",[$,Z],arguments.length),this[N6]($,!0),z(this,m,"f").describe($,Z),this}detectLocale($){return A("<boolean>",[$],arguments.length),h(this,N1,$,"f"),this}env($){if(A("[string|boolean]",[$],arguments.length),$===!1)delete z(this,f,"f").envPrefix;else z(this,f,"f").envPrefix=$||"";return this}epilogue($){return A("<string>",[$],arguments.length),z(this,m,"f").epilog($),this}epilog($){return this.epilogue($)}example($,Z){if(A("<string|array> [string]",[$,Z],arguments.length),Array.isArray($))$.forEach((X)=>this.example(...X));else z(this,m,"f").example($,Z);return this}exit($,Z){if(h(this,E0,!0,"f"),h(this,R1,Z,"f"),z(this,f0,"f"))z(this,g,"f").process.exit($)}exitProcess($=!0){return A("[boolean]",[$],arguments.length),h(this,f0,$,"f"),this}fail($){if(A("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new Z0("Invalid first argument. Expected function or boolean 'false'");return z(this,m,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,Z){if(A("<array> [function]",[$,Z],arguments.length),!Z)return new Promise((X,J)=>{z(this,v0,"f").getCompletion($,(q,Y)=>{if(q)J(q);else X(Y)})});else return z(this,v0,"f").getCompletion($,Z)}getDemandedOptions(){return A([],0),z(this,f,"f").demandedOptions}getDemandedCommands(){return A([],0),z(this,f,"f").demandedCommands}getDeprecatedOptions(){return A([],0),z(this,f,"f").deprecatedOptions}getDetectLocale(){return z(this,N1,"f")}getExitProcess(){return z(this,f0,"f")}getGroups(){return Object.assign({},z(this,a0,"f"),z(this,S1,"f"))}getHelp(){if(h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let Z=this[N$](z(this,T1,"f"),void 0,void 0,0,!0);if(X0(Z))return Z.then(()=>{return z(this,m,"f").help()})}let $=z(this,H0,"f").runDefaultBuilderOn(this);if(X0($))return $.then(()=>{return z(this,m,"f").help()})}return Promise.resolve(z(this,m,"f").help())}getOptions(){return z(this,f,"f")}getStrict(){return z(this,v1,"f")}getStrictCommands(){return z(this,f1,"f")}getStrictOptions(){return z(this,k1,"f")}global($,Z){if(A("<string|array> [boolean]",[$,Z],arguments.length),$=[].concat($),Z!==!1)z(this,f,"f").local=z(this,f,"f").local.filter((X)=>$.indexOf(X)===-1);else $.forEach((X)=>{if(!z(this,f,"f").local.includes(X))z(this,f,"f").local.push(X)});return this}group($,Z){A("<string|array> <string>",[$,Z],arguments.length);let X=z(this,S1,"f")[Z]||z(this,a0,"f")[Z];if(z(this,S1,"f")[Z])delete z(this,S1,"f")[Z];let J={};return z(this,a0,"f")[Z]=(X||[]).concat($).filter((q)=>{if(J[q])return!1;return J[q]=!0}),this}hide($){return A("<string>",[$],arguments.length),z(this,f,"f").hiddenOptions.push($),this}implies($,Z){return A("<string|object> [number|string|array]",[$,Z],arguments.length),z(this,Q0,"f").implies($,Z),this}locale($){if(A("[string]",[$],arguments.length),$===void 0)return this[w6](),z(this,g,"f").y18n.getLocale();return h(this,N1,!1,"f"),z(this,g,"f").y18n.setLocale($),this}middleware($,Z,X){return z(this,k0,"f").addMiddleware($,!!Z,X)}nargs($,Z){return A("<string|object|array> [number]",[$,Z],arguments.length),this[H$](this.nargs.bind(this),"narg",$,Z),this}normalize($){return A("<array|string>",[$],arguments.length),this[F1]("normalize",$),this}number($){return A("<array|string>",[$],arguments.length),this[F1]("number",$),this[g1]($),this}option($,Z){if(A("<string|object> [object]",[$,Z],arguments.length),typeof $==="object")Object.keys($).forEach((X)=>{this.options(X,$[X])});else{if(typeof Z!=="object")Z={};if(this[g1]($),z(this,r0,"f")&&($==="version"||(Z===null||Z===void 0?void 0:Z.alias)==="version"))this[JQ](['"version" is a reserved word.',"Please do one of the following:",'- Disable version with `yargs.version(false)` if using "version" as an option',"- Use the built-in `yargs.version` method instead (if applicable)","- Use a different option key","https://yargs.js.org/docs/#api-reference-version"].join(`
159
+ `),void 0,"versionWarning");if(z(this,f,"f").key[$]=!0,Z.alias)this.alias($,Z.alias);let X=Z.deprecate||Z.deprecated;if(X)this.deprecateOption($,X);let J=Z.demand||Z.required||Z.require;if(J)this.demand($,J);if(Z.demandOption)this.demandOption($,typeof Z.demandOption==="string"?Z.demandOption:void 0);if(Z.conflicts)this.conflicts($,Z.conflicts);if("default"in Z)this.default($,Z.default);if(Z.implies!==void 0)this.implies($,Z.implies);if(Z.nargs!==void 0)this.nargs($,Z.nargs);if(Z.config)this.config($,Z.configParser);if(Z.normalize)this.normalize($);if(Z.choices)this.choices($,Z.choices);if(Z.coerce)this.coerce($,Z.coerce);if(Z.group)this.group($,Z.group);if(Z.boolean||Z.type==="boolean"){if(this.boolean($),Z.alias)this.boolean(Z.alias)}if(Z.array||Z.type==="array"){if(this.array($),Z.alias)this.array(Z.alias)}if(Z.number||Z.type==="number"){if(this.number($),Z.alias)this.number(Z.alias)}if(Z.string||Z.type==="string"){if(this.string($),Z.alias)this.string(Z.alias)}if(Z.count||Z.type==="count")this.count($);if(typeof Z.global==="boolean")this.global($,Z.global);if(Z.defaultDescription)z(this,f,"f").defaultDescription[$]=Z.defaultDescription;if(Z.skipValidation)this.skipValidation($);let q=Z.describe||Z.description||Z.desc,Y=z(this,m,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(Z.hidden)this.hide($);if(Z.requiresArg)this.requiresArg($)}return this}options($,Z){return this.option($,Z)}parse($,Z,X){if(A("[string|array] [function|boolean|object] [function]",[$,Z,X],arguments.length),this[QQ](),typeof $>"u")$=z(this,T1,"f");if(typeof Z==="object")h(this,D1,Z,"f"),Z=X;if(typeof Z==="function")h(this,A0,Z,"f"),Z=!1;if(!Z)h(this,T1,$,"f");if(z(this,A0,"f"))h(this,f0,!1,"f");let J=this[N$]($,!!Z),q=this.parsed;if(z(this,v0,"f").setParsed(this.parsed),X0(J))return J.then((Y)=>{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,R1,"f"),Y,z(this,R0,"f"));return Y}).catch((Y)=>{if(z(this,A0,"f"))z(this,A0,"f")(Y,this.parsed.argv,z(this,R0,"f"));throw Y}).finally(()=>{this[D6](),this.parsed=q});else{if(z(this,A0,"f"))z(this,A0,"f").call(this,z(this,R1,"f"),J,z(this,R0,"f"));this[D6](),this.parsed=q}return J}parseAsync($,Z,X){let J=this.parse($,Z,X);return!X0(J)?Promise.resolve(J):J}parseSync($,Z,X){let J=this.parse($,Z,X);if(X0(J))throw new Z0(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return J}parserConfiguration($){return A("<object>",[$],arguments.length),h(this,H2,$,"f"),this}pkgConf($,Z){A("<string> [string]",[$,Z],arguments.length);let X=null,J=this[O6](Z||z(this,h1,"f"));if(J[$]&&typeof J[$]==="object")X=A$(J[$],Z||z(this,h1,"f"),this[b1]()["deep-merge-config"]||!1,z(this,g,"f")),z(this,f,"f").configObjects=(z(this,f,"f").configObjects||[]).concat(X);return this}positional($,Z){A("<string> <object>",[$,Z],arguments.length);let X=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];Z=L1(Z,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return X.includes(Y)});let J=z(this,h$,"f").fullCommands[z(this,h$,"f").fullCommands.length-1],q=J?z(this,H0,"f").cmdToParseOptions(J):{array:[],alias:{},default:{},demand:{}};return Q$(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)Z[Y]=!0}else if(Q[$]&&!(Y in Z))Z[Y]=Q[$]}),this.group($,z(this,m,"f").getPositionalGroupName()),this.option($,Z)}recommendCommands($=!0){return A("[boolean]",[$],arguments.length),h(this,z2,$,"f"),this}required($,Z,X){return this.demand($,Z,X)}require($,Z,X){return this.demand($,Z,X)}requiresArg($){if(A("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,f,"f").narg[$])return this;else this[H$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,Z){return A("[string] [string]",[$,Z],arguments.length),$=$||this.$0,z(this,Y$,"f").log(z(this,v0,"f").generateCompletionScript($,Z||z(this,O0,"f")||"completion")),this}showHelp($){if(A("[string|function]",[$],arguments.length),h(this,E0,!0,"f"),!z(this,m,"f").hasCachedHelpMessage()){if(!this.parsed){let X=this[N$](z(this,T1,"f"),void 0,void 0,0,!0);if(X0(X))return X.then(()=>{z(this,m,"f").showHelp($)}),this}let Z=z(this,H0,"f").runDefaultBuilderOn(this);if(X0(Z))return Z.then(()=>{z(this,m,"f").showHelp($)}),this}return z(this,m,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,Z){return A("[boolean|string] [string]",[$,Z],arguments.length),z(this,m,"f").showHelpOnFail($,Z),this}showVersion($){return A("[string|function]",[$],arguments.length),z(this,m,"f").showVersion($),this}skipValidation($){return A("<array|string>",[$],arguments.length),this[F1]("skipValidation",$),this}strict($){return A("[boolean]",[$],arguments.length),h(this,v1,$!==!1,"f"),this}strictCommands($){return A("[boolean]",[$],arguments.length),h(this,f1,$!==!1,"f"),this}strictOptions($){return A("[boolean]",[$],arguments.length),h(this,k1,$!==!1,"f"),this}string($){return A("<array|string>",[$],arguments.length),this[F1]("string",$),this[g1]($),this}terminalWidth(){return A([],0),z(this,g,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return A("<object>",[$],arguments.length),h(this,N1,!1,"f"),z(this,g,"f").y18n.updateLocale($),this}usage($,Z,X,J){if(A("<string|null|undefined> [string|boolean] [function|object] [function]",[$,Z,X,J],arguments.length),Z!==void 0)if(P0($,null,z(this,g,"f")),($||"").match(/^\$0( |$)/))return this.command($,Z,X,J);else throw new Z0(".usage() description must start with $0 if being used as alias for .command()");else return z(this,m,"f").usage($),this}usageConfiguration($){return A("<object>",[$],arguments.length),h(this,K2,$,"f"),this}version($,Z,X){if(A("[boolean|string] [string] [string]",[$,Z,X],arguments.length),z(this,r0,"f"))this[I6](z(this,r0,"f")),z(this,m,"f").version(void 0),h(this,r0,null,"f");if(arguments.length===0)X=this[GQ](),$="version";else if(arguments.length===1){if($===!1)return this;X=$,$="version"}else if(arguments.length===2)X=Z,Z=void 0;return h(this,r0,typeof $==="string"?$:"version","f"),Z=Z||z(this,m,"f").deferY18nLookup("Show version number"),z(this,m,"f").version(X||void 0),this.boolean(z(this,r0,"f")),this.describe(z(this,r0,"f"),Z),this}wrap($){return A("<number|null|undefined>",[$],arguments.length),z(this,m,"f").wrap($),this}[(H0=new WeakMap,h1=new WeakMap,h$=new WeakMap,v0=new WeakMap,O0=new WeakMap,J2=new WeakMap,R1=new WeakMap,N1=new WeakMap,Q2=new WeakMap,f0=new WeakMap,q2=new WeakMap,k0=new WeakMap,a0=new WeakMap,E0=new WeakMap,b0=new WeakMap,Y2=new WeakMap,Y$=new WeakMap,R0=new WeakMap,f=new WeakMap,G2=new WeakMap,H2=new WeakMap,A0=new WeakMap,D1=new WeakMap,G$=new WeakMap,S1=new WeakMap,T1=new WeakMap,z2=new WeakMap,g=new WeakMap,v1=new WeakMap,f1=new WeakMap,k1=new WeakMap,m=new WeakMap,K2=new WeakMap,r0=new WeakMap,Q0=new WeakMap,ZQ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(Z){}return $}[XQ](){return{log:(...$)=>{if(!this[B2]())console.log(...$);if(h(this,E0,!0,"f"),z(this,R0,"f").length)h(this,R0,z(this,R0,"f")+`
160
+ `,"f");h(this,R0,z(this,R0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[B2]())console.error(...$);if(h(this,E0,!0,"f"),z(this,R0,"f").length)h(this,R0,z(this,R0,"f")+`
161
+ `,"f");h(this,R0,z(this,R0,"f")+$.join(" "),"f")}}}[I6]($){Q$(z(this,f,"f")).forEach((Z)=>{if(((J)=>J==="configObjects")(Z))return;let X=z(this,f,"f")[Z];if(Array.isArray(X)){if(X.includes($))X.splice(X.indexOf($),1)}else if(typeof X==="object")delete X[$]}),delete z(this,m,"f").getDescriptions()[$]}[JQ]($,Z,X){if(!z(this,Q2,"f")[X])z(this,g,"f").process.emitWarning($,Z),z(this,Q2,"f")[X]=!0}[QQ](){z(this,q2,"f").push({options:z(this,f,"f"),configObjects:z(this,f,"f").configObjects.slice(0),exitProcess:z(this,f0,"f"),groups:z(this,a0,"f"),strict:z(this,v1,"f"),strictCommands:z(this,f1,"f"),strictOptions:z(this,k1,"f"),completionCommand:z(this,O0,"f"),output:z(this,R0,"f"),exitError:z(this,R1,"f"),hasOutput:z(this,E0,"f"),parsed:this.parsed,parseFn:z(this,A0,"f"),parseContext:z(this,D1,"f")}),z(this,m,"f").freeze(),z(this,Q0,"f").freeze(),z(this,H0,"f").freeze(),z(this,k0,"f").freeze()}[qQ](){let $="",Z;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,g,"f").process.argv()[0]))Z=z(this,g,"f").process.argv().slice(1,2);else Z=z(this,g,"f").process.argv().slice(0,1);if($=Z.map((X)=>{let J=this[TQ](z(this,h1,"f"),X);return X.match(/^(\/|([a-zA-Z]:)?\\)/)&&J.length<X.length?J:X}).join(" ").trim(),z(this,g,"f").getEnv("_")&&z(this,g,"f").getProcessArgvBin()===z(this,g,"f").getEnv("_"))$=z(this,g,"f").getEnv("_").replace(`${z(this,g,"f").path.dirname(z(this,g,"f").process.execPath())}/`,"");return $}[b1](){return z(this,H2,"f")}[YQ](){return z(this,K2,"f")}[w6](){if(!z(this,N1,"f"))return;let $=z(this,g,"f").getEnv("LC_ALL")||z(this,g,"f").getEnv("LC_MESSAGES")||z(this,g,"f").getEnv("LANG")||z(this,g,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[GQ](){return this[O6]().version||"unknown"}[HQ]($){let Z=$["--"]?$["--"]:$._;for(let X=0,J;(J=Z[X])!==void 0;X++)if(z(this,g,"f").Parser.looksLikeNumber(J)&&Number.isSafeInteger(Math.floor(parseFloat(`${J}`))))Z[X]=Number(J);return $}[O6]($){let Z=$||"*";if(z(this,G$,"f")[Z])return z(this,G$,"f")[Z];let X={};try{let J=$||z(this,g,"f").mainFilename;if(!$&&z(this,g,"f").path.extname(J))J=z(this,g,"f").path.dirname(J);let q=z(this,g,"f").findUp(J,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});P0(q,void 0,z(this,g,"f")),X=JSON.parse(z(this,g,"f").readFileSync(q,"utf8"))}catch(J){}return z(this,G$,"f")[Z]=X||{},z(this,G$,"f")[Z]}[F1]($,Z){Z=[].concat(Z),Z.forEach((X)=>{X=this[h6](X),z(this,f,"f")[$].push(X)})}[H$]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=Q})}[E6]($,Z,X,J){this[A6]($,Z,X,J,(q,Y,Q)=>{z(this,f,"f")[q][Y]=(z(this,f,"f")[q][Y]||[]).concat(Q)})}[A6]($,Z,X,J,q){if(Array.isArray(X))X.forEach((Y)=>{$(Y,J)});else if(((Y)=>typeof Y==="object")(X))for(let Y of Q$(X))$(Y,X[Y]);else q(Z,this[h6](X),J)}[h6]($){if($==="__proto__")return"___proto___";return $}[N6]($,Z){return this[H$](this[N6].bind(this),"key",$,Z),this}[D6](){var $,Z,X,J,q,Y,Q,G,H,K,W,U;let B=z(this,q2,"f").pop();P0(B,void 0,z(this,g,"f"));let R;$=this,Z=this,X=this,J=this,q=this,Y=this,Q=this,G=this,H=this,K=this,W=this,U=this,{options:{set value(_){h($,f,_,"f")}}.value,configObjects:R,exitProcess:{set value(_){h(Z,f0,_,"f")}}.value,groups:{set value(_){h(X,a0,_,"f")}}.value,output:{set value(_){h(J,R0,_,"f")}}.value,exitError:{set value(_){h(q,R1,_,"f")}}.value,hasOutput:{set value(_){h(Y,E0,_,"f")}}.value,parsed:this.parsed,strict:{set value(_){h(Q,v1,_,"f")}}.value,strictCommands:{set value(_){h(G,f1,_,"f")}}.value,strictOptions:{set value(_){h(H,k1,_,"f")}}.value,completionCommand:{set value(_){h(K,O0,_,"f")}}.value,parseFn:{set value(_){h(W,A0,_,"f")}}.value,parseContext:{set value(_){h(U,D1,_,"f")}}.value}=B,z(this,f,"f").configObjects=R,z(this,m,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,H0,"f").unfreeze(),z(this,k0,"f").unfreeze()}[zQ]($,Z){return A1(Z,(X)=>{return $(X),X})}getInternalMethods(){return{getCommandInstance:this[KQ].bind(this),getContext:this[BQ].bind(this),getHasOutput:this[UQ].bind(this),getLoggerInstance:this[WQ].bind(this),getParseContext:this[VQ].bind(this),getParserConfiguration:this[b1].bind(this),getUsageConfiguration:this[YQ].bind(this),getUsageInstance:this[LQ].bind(this),getValidationInstance:this[_Q].bind(this),hasParseCallback:this[B2].bind(this),isGlobalContext:this[RQ].bind(this),postProcess:this[y1].bind(this),reset:this[S6].bind(this),runValidation:this[v6].bind(this),runYargsParserAndExecuteCommands:this[N$].bind(this),setHasOutput:this[FQ].bind(this)}}[KQ](){return z(this,H0,"f")}[BQ](){return z(this,h$,"f")}[UQ](){return z(this,E0,"f")}[WQ](){return z(this,Y$,"f")}[VQ](){return z(this,D1,"f")||{}}[LQ](){return z(this,m,"f")}[_Q](){return z(this,Q0,"f")}[B2](){return!!z(this,A0,"f")}[RQ](){return z(this,Y2,"f")}[y1]($,Z,X,J){if(X)return $;if(X0($))return $;if(!Z)$=this[ZQ]($);if(this[b1]()["parse-positional-numbers"]||this[b1]()["parse-positional-numbers"]===void 0)$=this[HQ]($);if(J)$=E1($,this,z(this,k0,"f").getMiddleware(),!1);return $}[S6]($={}){h(this,f,z(this,f,"f")||{},"f");let Z={};Z.local=z(this,f,"f").local||[],Z.configObjects=z(this,f,"f").configObjects||[];let X={};Z.local.forEach((Y)=>{X[Y]=!0,($[Y]||[]).forEach((Q)=>{X[Q]=!0})}),Object.assign(z(this,S1,"f"),Object.keys(z(this,a0,"f")).reduce((Y,Q)=>{let G=z(this,a0,"f")[Q].filter((H)=>!(H in X));if(G.length>0)Y[Q]=G;return Y},{})),h(this,a0,{},"f");let J=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(J.forEach((Y)=>{Z[Y]=(z(this,f,"f")[Y]||[]).filter((Q)=>!X[Q])}),q.forEach((Y)=>{Z[Y]=L1(z(this,f,"f")[Y],(Q)=>!X[Q])}),Z.envPrefix=z(this,f,"f").envPrefix,h(this,f,Z,"f"),h(this,m,z(this,m,"f")?z(this,m,"f").reset(X):nJ(this,z(this,g,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset(X):eJ(this,z(this,m,"f"),z(this,g,"f")),"f"),h(this,H0,z(this,H0,"f")?z(this,H0,"f").reset():pJ(z(this,m,"f"),z(this,Q0,"f"),z(this,k0,"f"),z(this,g,"f")),"f"),!z(this,v0,"f"))h(this,v0,aJ(this,z(this,m,"f"),z(this,H0,"f"),z(this,g,"f")),"f");return z(this,k0,"f").reset(),h(this,O0,null,"f"),h(this,R0,"","f"),h(this,R1,null,"f"),h(this,E0,!1,"f"),this.parsed=!1,this}[TQ]($,Z){return z(this,g,"f").path.relative($,Z)}[N$]($,Z,X,J=0,q=!1){let Y=!!X||q;$=$||z(this,T1,"f"),z(this,f,"f").__=z(this,g,"f").y18n.__,z(this,f,"f").configuration=this[b1]();let Q=!!z(this,f,"f").configuration["populate--"],G=Object.assign({},z(this,f,"f").configuration,{"populate--":!0}),H=z(this,g,"f").Parser.detailed($,Object.assign({},z(this,f,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),K=Object.assign(H.argv,z(this,D1,"f")),W=void 0,U=H.aliases,B=!1,R=!1;if(Object.keys(K).forEach((_)=>{if(_===z(this,b0,"f")&&K[_])B=!0;else if(_===z(this,r0,"f")&&K[_])R=!0}),K.$0=this.$0,this.parsed=H,J===0)z(this,m,"f").clearCachedHelpMessage();try{if(this[w6](),Z)return this[y1](K,Q,!!X,!1);if(z(this,b0,"f")){if([z(this,b0,"f")].concat(U[z(this,b0,"f")]||[]).filter((N)=>N.length>1).includes(""+K._[K._.length-1]))K._.pop(),B=!0}h(this,Y2,!1,"f");let _=z(this,H0,"f").getCommands(),L=z(this,v0,"f").completionKey in K,j=B||L||q;if(K._.length){if(_.length){let C;for(let N=J||0,c;K._[N]!==void 0;N++)if(c=String(K._[N]),_.includes(c)&&c!==z(this,O0,"f")){let I=z(this,H0,"f").runCommand(c,this,H,N+1,q,B||R||q);return this[y1](I,Q,!!X,!1)}else if(!C&&c!==z(this,O0,"f")){C=c;break}if(!z(this,H0,"f").hasDefaultCommand()&&z(this,z2,"f")&&C&&!j)z(this,Q0,"f").recommendCommands(C,_)}if(z(this,O0,"f")&&K._.includes(z(this,O0,"f"))&&!L){if(z(this,f0,"f"))_1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,H0,"f").hasDefaultCommand()&&!j){let C=z(this,H0,"f").runCommand(null,this,H,0,q,B||R||q);return this[y1](C,Q,!!X,!1)}if(L){if(z(this,f0,"f"))_1(!0);$=[].concat($);let C=$.slice($.indexOf(`--${z(this,v0,"f").completionKey}`)+1);return z(this,v0,"f").getCompletion(C,(N,c)=>{if(N)throw new Z0(N.message);(c||[]).forEach((I)=>{z(this,Y$,"f").log(I)}),this.exit(0)}),this[y1](K,!Q,!!X,!1)}if(!z(this,E0,"f")){if(B){if(z(this,f0,"f"))_1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(R){if(z(this,f0,"f"))_1(!0);Y=!0,z(this,m,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,f,"f").skipValidation.length>0)Y=Object.keys(K).some((C)=>z(this,f,"f").skipValidation.indexOf(C)>=0&&K[C]===!0);if(!Y){if(H.error)throw new Z0(H.error.message);if(!L){let C=this[v6](U,{},H.error);if(!X)W=E1(K,this,z(this,k0,"f").getMiddleware(),!0);if(W=this[zQ](C,W!==null&&W!==void 0?W:K),X0(W)&&!X)W=W.then(()=>{return E1(K,this,z(this,k0,"f").getMiddleware(),!1)})}}}catch(_){if(_ instanceof Z0)z(this,m,"f").fail(_.message,_);else throw _}return this[y1](W!==null&&W!==void 0?W:K,Q,!!X,!0)}[v6]($,Z,X,J){let q={...this.getDemandedOptions()};return(Y)=>{if(X)throw new Z0(X.message);z(this,Q0,"f").nonOptionCount(Y),z(this,Q0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,f1,"f"))Q=z(this,Q0,"f").unknownCommands(Y);if(z(this,v1,"f")&&!Q)z(this,Q0,"f").unknownArguments(Y,$,Z,!!J);else if(z(this,k1,"f"))z(this,Q0,"f").unknownArguments(Y,$,{},!1,!1);z(this,Q0,"f").limitedChoices(Y),z(this,Q0,"f").implications(Y),z(this,Q0,"f").conflicting(Y)}}[FQ](){h(this,E0,!0,"f")}[g1]($){if(typeof $==="string")z(this,f,"f").key[$]=!0;else for(let Z of $)z(this,f,"f").key[Z]=!0}}function dJ($){return!!$&&typeof $.getInternalMethods==="function"}var kU=MQ(F6),PQ=kU;import{existsSync as u1,readFileSync as W2,rmSync as U2,writeFileSync as k6}from"fs";import{resolve as h0,dirname as bU,join as yU,basename as gU}from"path";import{fileURLToPath as uU}from"url";var xQ="https://github.com/ardzero/bunext.git",IQ="https://github.com/ardzero/",mU=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],cU=!0;function pU(){try{let $=uU(import.meta.url),Z=bU($),X=yU(Z,"../package.json");return JSON.parse(W2(X,"utf-8")).version}catch{return"0.1.0"}}function b6($){return $.toLowerCase().replace(/[\s_]+/g,"-").replace(/[^a-z0-9-]/g,"").replace(/-+/g,"-").replace(/^-|-$/g,"")||"my-app"}function dU($,Z){let X=b6(Z),J=`${IQ}${X}`,q=h0($,"project_readme.md"),Y=h0($,"README.md");if(!u1(q))return;let Q=W2(q,"utf-8");Q=Q.replace(/\?\{project-name\}/g,Z).replace(/\?\{repo-link\}/g,J),k6(Y,Q),U2(q,{force:!0})}function lU($,Z,X){let J=b6(Z),q=`${IQ}${J}`,Y=h0($,"README.md");if(!u1(Y))return;let Q=W2(Y,"utf-8"),G=X.replace(/^git@github\.com:(.+?)(\.git)?$/,"https://github.com/$1").replace(/^git@gitlab\.com:(.+?)(\.git)?$/,"https://gitlab.com/$1").replace(/\.git$/i,"");Q=Q.split(q).join(G),k6(Y,Q)}function f6($){if(!$)return"Project name is required";if($===".")return;if(!/^\.\/[a-zA-Z0-9-]+$/.test($)&&!/^[a-zA-Z0-9-]+$/.test($))return"Project name must contain only letters, numbers, and hyphens";let Z=$.startsWith("./")?$.slice(2):$;if(u1(h0(process.cwd(),Z)))return`Directory "${Z}" already exists`}async function jQ(){let $=await Y6({message:"Where should we create your new project?",placeholder:"./my-app",validate:f6});if(c0($))W1("Operation cancelled"),process.exit(0);return $}function nU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(o.default.bold(`
162
+ Usage:`)),console.log(` ${o.default.cyan("bun create bunext")} ${o.default.dim("[project-name] [options]")}`),H6(`${o.default.cyan("bun create bunext my-app")}
163
163
  Create a new project with interactive prompts
164
164
 
165
- ${a.default.cyan("bun create bunext my-app -y")}
165
+ ${o.default.cyan("bun create bunext my-app -y")}
166
166
  Create with all defaults (install deps, init git)
167
167
 
168
- ${a.default.cyan("bun create bunext my-app --cursor --git")}
168
+ ${o.default.cyan("bun create bunext my-app --cursor --git")}
169
169
  Create and open in Cursor with git initialized
170
170
 
171
- ${a.default.cyan("bun create bunext my-app --no-install")}
172
- Create without installing dependencies`,"Examples"),console.log(a.default.bold(`
173
- Options:`)),console.log(` ${a.default.cyan("-y, --yes")} Skip all prompts and use defaults`),console.log(` ${a.default.cyan("--git")} Initialize git repository`),console.log(` ${a.default.cyan("--no-git")} Skip git initialization`),console.log(` ${a.default.cyan("--install")} Install dependencies`),console.log(` ${a.default.cyan("--no-install")} Skip dependency installation`),console.log(` ${a.default.cyan("--cursor")} Open project in Cursor after creation`),console.log(` ${a.default.cyan("--vscode")} Open project in VS Code after creation`),console.log(` ${a.default.cyan("-h, --help")} Show this help message`),console.log(` ${a.default.cyan("-v, --version")} Show version number`),r4(`For more info: ${a.default.underline(a.default.cyan("https://github.com/ardzero/bunext"))}`)}var a0=TQ(L6(process.argv)).help(!1).version(!1).option("y",{type:"boolean",description:"Skip all prompts and use defaults (install deps, init git)",default:!1}).option("git",{type:"boolean",description:"Initialize git repository",default:void 0}).option("install",{type:"boolean",description:"Install dependencies",default:void 0}).option("cursor",{type:"boolean",description:"Open project in Cursor after creation"}).option("vscode",{type:"boolean",description:"Open project in VS Code after creation"}).option("h",{alias:"help",type:"boolean",description:"Show help"}).option("v",{alias:"version",type:"boolean",description:"Show version"}).parse();if(a0.h)pU(),process.exit(0);if(a0.v)console.clear(),a4(a.default.bgCyan(a.default.black(" create-bunext "))),console.log(`
174
- ${a.default.bold("Version:")} ${a.default.cyan(cU())}`),r4(a.default.dim("https://github.com/ardzero/bunext")),process.exit(0);async function dU(){console.clear(),a4(a.default.bgCyan(a.default.black(" create-bunext ")));let $=a0._[0]||"",X=!1;if(!$)$=await MQ();else{$=$.startsWith("./")?$.slice(2):$;let K=S6($);if(K)S.error(K),$=await MQ()}if($==="."){X=!0;let{readdirSync:K}=await import("fs");if(K(process.cwd()).filter((_)=>!_.startsWith(".")).length>0)U1("Current directory is not empty. Please use an empty directory or specify a new project name."),process.exit(1)}else{if($.startsWith("./"))$=$.slice(2);let K=S6($);if(K)U1(K),process.exit(1)}let Z=WJ();Z.start("Cloning template");let J=X?".bunext-temp":$;try{await C0("git",["clone","--depth","1",FQ,J]),Z.stop("Template cloned")}catch(K){if(Z.stop("Failed to clone template"),K.message.includes("Could not resolve host")||K.message.includes("unable to access")||K.message.includes("Failed to connect"))S.error("Network error: Unable to reach GitHub"),S.info("Please check your internet connection and try again.");else if(K.message.includes("Repository not found"))S.error("Repository not found"),S.info(`The template repository at ${FQ} could not be found.`);else if(K.message.includes("already exists"))S.error(`Directory "${J}" already exists`),S.info("Please choose a different project name or remove the existing directory.");else S.error("Error details:"),S.info(K.message);process.exit(1)}Z.start("Cleaning up");try{let K=process.platform==="win32",U=X?J:$;if(K)await C0("cmd",["/c","rmdir","/s","/q",`${U}\\.git`],{shell:!0});else await C0("rm",["-rf",`${U}/.git`],{shell:!0});for(let W of gU){let _=F1(process.cwd(),U,W);if(D6(_))try{SU(_,{recursive:!0,force:!0})}catch{}}if(X){let{copyFile:W,mkdir:_,readdir:R}=await import("fs/promises"),{dirname:L,join:I}=await import("path");async function j(N,u){let x=await R(N,{withFileTypes:!0});for(let n of x){let i=I(N,n.name),t=I(u,n.name);if(n.isDirectory())await _(t,{recursive:!0}),await j(i,t);else await _(L(t),{recursive:!0}),await W(i,t)}}if(await j(J,process.cwd()),K)await C0("cmd",["/c","rmdir","/s","/q",J],{shell:!0});else await C0("rm",["-rf",J],{shell:!0})}Z.stop("Cleaned up")}catch(K){Z.stop("Failed to clean up"),S.warn("Could not remove some directories"),S.info("You can manually delete them later.")}if(mU){let K=X?process.cwd():F1(process.cwd(),$),U=X?bU(K):$,W=F1(K,"package.json");if(D6(W))try{let _=JSON.parse(PQ(W,"utf-8"));_.name=uU(U),vU(W,JSON.stringify(_,null,2)+`
175
- `)}catch{}}let q=lU();S.info(`Detected package manager: ${q}`);let Y=a0.install;if(a0.y)Y=!0;else if(Y===void 0){let K=await x$({message:"Install dependencies?",initialValue:!0});if(m0(K))U1("Operation cancelled"),process.exit(0);Y=K}if(Y){Z.start("Installing dependencies");try{await C0(q,["install"],{cwd:X?process.cwd():F1(process.cwd(),$),stdio:"pipe"}),Z.stop("Dependencies installed")}catch(K){if(Z.stop("Failed to install dependencies"),K.message.includes("ENOTFOUND")||K.message.includes("network")||K.message.includes("timeout"))if(S.error("Network error during installation"),S.info("You can install dependencies later by running:"),!X)S.info(` cd ${$} && ${q} install`);else S.info(` ${q} install`);else if(K.message.includes("EACCES")||K.message.includes("permission denied"))S.error("Permission error"),S.info("Try running the command with appropriate permissions.");else if(S.error("Installation error:"),S.info(K.message),S.info("You can try installing manually:"),!X)S.info(` cd ${$} && ${q} install`);else S.info(` ${q} install`);let U=await x$({message:"Continue without installing dependencies?",initialValue:!0});if(m0(U)||!U)U1("Operation cancelled"),process.exit(1);Y=!1}}let Q=a0.git;if(a0.y)Q=!0;else if(Q===void 0){let K=await x$({message:"Initialize a new git repository?",initialValue:!0});if(m0(K))U1("Operation cancelled"),process.exit(0);Q=K}let G=!1;if(Q){Z.start("Initializing git repository");try{let K=X?process.cwd():F1(process.cwd(),$);await C0("git",["init"],{cwd:K}),await C0("git",["add","."],{cwd:K}),await C0("git",["commit","-m","Initial commit"],{cwd:K}),Z.stop("Git repository initialized"),G=!0}catch(K){if(Z.stop("Git initialization skipped"),K.message.includes("not found")||K.message.includes("command not found"))S.warn("Git is not installed or not in PATH.");else if(K.message.includes("user.name")||K.message.includes("user.email"))S.warn("Git user configuration is missing."),S.info('Run: git config --global user.name "Your Name"'),S.info(' git config --global user.email "you@example.com"')}}if(G){let K=await x$({message:"Connect to a remote repository?",initialValue:!1});if(m0(K))S.info("Skipping remote repository setup");else if(K){let U=await J6({message:"Enter the remote repository URL:",placeholder:"https://github.com/username/repo.git",validate:(W)=>{if(!W)return"Remote URL is required";if(!W.startsWith("https://github.com/")&&!W.startsWith("git@github.com:")&&!W.startsWith("https://gitlab.com/")&&!W.startsWith("git@gitlab.com:"))return"Please enter a valid Github or Gitlab repository URL"}});if(m0(U))S.info("Skipping remote repository setup");else{let W=U,_=await Q6({message:"What would you like to do?",options:[{value:"push",label:"Add remote and push code now"},{value:"connect",label:"Just add remote (don't push yet)"}],initialValue:"push"});if(m0(_))S.info("Skipping remote repository setup");else{let R=_==="push";Z.start(R?"Connecting and pushing to remote repository":"Adding remote repository");try{let L=X?process.cwd():F1(process.cwd(),$);if(await C0("git",["remote","add","origin",W],{cwd:L}),await C0("git",["branch","-M","main"],{cwd:L}),R)await C0("git",["push","-u","origin","main"],{cwd:L}),Z.stop("Connected and pushed to remote repository"),S.success(`Successfully pushed to ${W}`);else await C0("git",["config","push.autoSetupRemote","true"],{cwd:L}),Z.stop("Remote repository added"),S.success(`Remote added: ${W}`),S.info("You can push later with: git push (auto-tracking enabled)")}catch(L){if(Z.stop(R?"Failed to connect and push":"Failed to add remote"),L.message.includes("Permission denied")||L.message.includes("authentication failed"))S.error("Authentication failed"),S.info("Make sure you have the correct permissions and authentication set up.");else if(L.message.includes("Repository not found"))S.error("Repository not found"),S.info("Make sure the repository exists and the URL is correct.");else if(L.message.includes("already exists"))S.error("Remote 'origin' already exists"),S.info("You can manually set the remote with:"),S.info(` git remote set-url origin ${W}`);else S.error("Error:"),S.info(L.message),S.info(`
176
- You can manually connect later with:`),S.info(` git remote add origin ${W}`),S.info(" git config push.autoSetupRemote true"),S.info(" git push")}}}}}let H=null;if(a0.cursor)H="cursor";else if(a0.vscode)H="vscode";else if(!a0.y){let K=await Q6({message:"Open project in editor?",options:[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"skip",label:"Skip"}],initialValue:"cursor"});if(m0(K))H="skip";else H=K}if(H&&H!=="skip"){let K=H==="vscode"?"code":"cursor",U=H==="vscode"?"VS Code":"Cursor";try{await C0(K,["."],{cwd:X?process.cwd():F1(process.cwd(),$)}),S.success(`Opened in ${U}`)}catch(W){if(S.warn(`Could not open ${U}`),W.message.includes("not found")||W.message.includes("command not found")){if(S.info(`${U} CLI is not installed or not in PATH.`),!X)S.info(`You can open the project manually: cd ${$}`)}}}let B="";if(!X)B+=`cd ${$}
177
- `;if(!Y)B+=`${q} install
178
- `;B+=`${q} run dev`,q6(B,"Next steps"),r4(a.default.green("All done! \uD83C\uDF89"))}function lU(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}dU().catch(($)=>{if($.isCanceled)U1("Operation cancelled by user"),process.exit(0);S.error("An unexpected error occurred:"),S.info($.message||$),S.info(`
171
+ ${o.default.cyan("bun create bunext my-app --no-install")}
172
+ Create without installing dependencies`,"Examples"),console.log(o.default.bold(`
173
+ Options:`)),console.log(` ${o.default.cyan("-y, --yes")} Skip all prompts and use defaults`),console.log(` ${o.default.cyan("--git")} Initialize git repository`),console.log(` ${o.default.cyan("--no-git")} Skip git initialization`),console.log(` ${o.default.cyan("--install")} Install dependencies`),console.log(` ${o.default.cyan("--no-install")} Skip dependency installation`),console.log(` ${o.default.cyan("--cursor")} Open project in Cursor after creation`),console.log(` ${o.default.cyan("--vscode")} Open project in VS Code after creation`),console.log(` ${o.default.cyan("-h, --help")} Show this help message`),console.log(` ${o.default.cyan("-v, --version")} Show version number`),s4(`For more info: ${o.default.underline(o.default.cyan("https://github.com/ardzero/bunext"))}`)}var s0=PQ(T6(process.argv)).help(!1).version(!1).option("y",{type:"boolean",description:"Skip all prompts and use defaults (install deps, init git)",default:!1}).option("git",{type:"boolean",description:"Initialize git repository",default:void 0}).option("install",{type:"boolean",description:"Install dependencies",default:void 0}).option("cursor",{type:"boolean",description:"Open project in Cursor after creation"}).option("vscode",{type:"boolean",description:"Open project in VS Code after creation"}).option("h",{alias:"help",type:"boolean",description:"Show help"}).option("v",{alias:"version",type:"boolean",description:"Show version"}).parse();if(s0.h)nU(),process.exit(0);if(s0.v)console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext "))),console.log(`
174
+ ${o.default.bold("Version:")} ${o.default.cyan(pU())}`),s4(o.default.dim("https://github.com/ardzero/bunext")),process.exit(0);async function iU(){console.clear(),r4(o.default.bgCyan(o.default.black(" create-bunext ")));let $=s0._[0]||"",Z=!1;if(!$)$=await jQ();else{$=$.startsWith("./")?$.slice(2):$;let B=f6($);if(B)S.error(B),$=await jQ()}if($==="."){Z=!0;let{readdirSync:B}=await import("fs");if(B(process.cwd()).filter((L)=>!L.startsWith(".")).length>0)W1("Current directory is not empty. Please use an empty directory or specify a new project name."),process.exit(1)}else{if($.startsWith("./"))$=$.slice(2);let B=f6($);if(B)W1(B),process.exit(1)}let X=RJ();X.start("Cloning template");let J=Z?".bunext-temp":$;try{await m0("git",["clone","--depth","1",xQ,J]),X.stop("Template cloned")}catch(B){if(X.stop("Failed to clone template"),B.message.includes("Could not resolve host")||B.message.includes("unable to access")||B.message.includes("Failed to connect"))S.error("Network error: Unable to reach GitHub"),S.info("Please check your internet connection and try again.");else if(B.message.includes("Repository not found"))S.error("Repository not found"),S.info(`The template repository at ${xQ} could not be found.`);else if(B.message.includes("already exists"))S.error(`Directory "${J}" already exists`),S.info("Please choose a different project name or remove the existing directory.");else S.error("Error details:"),S.info(B.message);process.exit(1)}let q=Z?process.cwd():h0(process.cwd(),$),Y=Z?gU(q):$;X.start("Cleaning up");try{let B=Z?J:$,R=h0(process.cwd(),B,".git");if(u1(R))U2(R,{recursive:!0,force:!0});for(let _ of mU){let L=h0(process.cwd(),B,_);if(u1(L))try{U2(L,{recursive:!0,force:!0})}catch{}}if(Z){let{copyFile:_,mkdir:L,readdir:j}=await import("fs/promises"),{dirname:C,join:N}=await import("path");async function c(n,i){let a=await j(n,{withFileTypes:!0});for(let K0 of a){let l=N(n,K0.name),x0=N(i,K0.name);if(K0.isDirectory())await L(x0,{recursive:!0}),await c(l,x0);else await L(C(x0),{recursive:!0}),await _(l,x0)}}await c(J,process.cwd());let I=h0(process.cwd(),J);if(u1(I))U2(I,{recursive:!0,force:!0})}if(dU(q,Y),cU){let _=h0(q,"package.json");if(u1(_))try{let L=JSON.parse(W2(_,"utf-8"));L.name=b6(Y),k6(_,JSON.stringify(L,null,2)+`
175
+ `)}catch{}}X.stop("Cleaned up")}catch(B){X.stop("Failed to clean up"),S.warn("Could not remove some directories"),S.info("You can manually delete them later.")}let Q=tU();S.info(`Detected package manager: ${Q}`);let G=s0.install;if(s0.y)G=!0;else if(G===void 0){let B=await I$({message:"Install dependencies?",initialValue:!0});if(c0(B))W1("Operation cancelled"),process.exit(0);G=B}if(G){X.start("Installing dependencies");try{await m0(Q,["install"],{cwd:Z?process.cwd():h0(process.cwd(),$),stdio:"pipe"}),X.stop("Dependencies installed")}catch(B){if(X.stop("Failed to install dependencies"),B.message.includes("ENOTFOUND")||B.message.includes("network")||B.message.includes("timeout"))if(S.error("Network error during installation"),S.info("You can install dependencies later by running:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);else if(B.message.includes("EACCES")||B.message.includes("permission denied"))S.error("Permission error"),S.info("Try running the command with appropriate permissions.");else if(S.error("Installation error:"),S.info(B.message),S.info("You can try installing manually:"),!Z)S.info(` cd ${$} && ${Q} install`);else S.info(` ${Q} install`);let R=await I$({message:"Continue without installing dependencies?",initialValue:!0});if(c0(R)||!R)W1("Operation cancelled"),process.exit(1);G=!1}}let H=s0.git;if(s0.y)H=!0;else if(H===void 0){let B=await I$({message:"Initialize a new git repository?",initialValue:!0});if(c0(B))W1("Operation cancelled"),process.exit(0);H=B}let K=!1;if(H){X.start("Initializing git repository");try{let B=Z?process.cwd():h0(process.cwd(),$);await m0("git",["init"],{cwd:B}),await m0("git",["add","."],{cwd:B}),await m0("git",["commit","-m","Initial commit"],{cwd:B}),X.stop("Git repository initialized"),K=!0}catch(B){if(X.stop("Git initialization skipped"),B.message.includes("not found")||B.message.includes("command not found"))S.warn("Git is not installed or not in PATH.");else if(B.message.includes("user.name")||B.message.includes("user.email"))S.warn("Git user configuration is missing."),S.info('Run: git config --global user.name "Your Name"'),S.info(' git config --global user.email "you@example.com"')}}if(K){let B=await I$({message:"Connect to a remote repository?",initialValue:!1});if(c0(B))S.info("Skipping remote repository setup");else if(B){let R=await Y6({message:"Enter the remote repository URL:",placeholder:"https://github.com/username/repo.git",validate:(_)=>{if(!_)return"Remote URL is required";if(!_.startsWith("https://github.com/")&&!_.startsWith("git@github.com:")&&!_.startsWith("https://gitlab.com/")&&!_.startsWith("git@gitlab.com:"))return"Please enter a valid Github or Gitlab repository URL"}});if(c0(R))S.info("Skipping remote repository setup");else{let _=R,L=await G6({message:"What would you like to do?",options:[{value:"push",label:"Add remote and push code now"},{value:"connect",label:"Just add remote (don't push yet)"}],initialValue:"push"});if(c0(L))S.info("Skipping remote repository setup");else{let j=L==="push";X.start(j?"Connecting and pushing to remote repository":"Adding remote repository");try{let C=Z?process.cwd():h0(process.cwd(),$);if(await m0("git",["remote","add","origin",_],{cwd:C}),await m0("git",["branch","-M","main"],{cwd:C}),j)await m0("git",["push","-u","origin","main"],{cwd:C}),X.stop("Connected and pushed to remote repository"),S.success(`Successfully pushed to ${_}`);else await m0("git",["config","push.autoSetupRemote","true"],{cwd:C}),X.stop("Remote repository added"),S.success(`Remote added: ${_}`),S.info("You can push later with: git push (auto-tracking enabled)");lU(q,Y,_)}catch(C){if(X.stop(j?"Failed to connect and push":"Failed to add remote"),C.message.includes("Permission denied")||C.message.includes("authentication failed"))S.error("Authentication failed"),S.info("Make sure you have the correct permissions and authentication set up.");else if(C.message.includes("Repository not found"))S.error("Repository not found"),S.info("Make sure the repository exists and the URL is correct.");else if(C.message.includes("already exists"))S.error("Remote 'origin' already exists"),S.info("You can manually set the remote with:"),S.info(` git remote set-url origin ${_}`);else S.error("Error:"),S.info(C.message),S.info(`
176
+ You can manually connect later with:`),S.info(` git remote add origin ${_}`),S.info(" git config push.autoSetupRemote true"),S.info(" git push")}}}}}let W=null;if(s0.cursor)W="cursor";else if(s0.vscode)W="vscode";else if(!s0.y){let B=await G6({message:"Open project in editor?",options:[{value:"cursor",label:"Cursor"},{value:"vscode",label:"VS Code"},{value:"skip",label:"Skip"}],initialValue:"cursor"});if(c0(B))W="skip";else W=B}if(W&&W!=="skip"){let B=W==="vscode"?"code":"cursor",R=W==="vscode"?"VS Code":"Cursor";try{await m0(B,["."],{cwd:Z?process.cwd():h0(process.cwd(),$)}),S.success(`Opened in ${R}`)}catch(_){if(S.warn(`Could not open ${R}`),_.message.includes("not found")||_.message.includes("command not found")){if(S.info(`${R} CLI is not installed or not in PATH.`),!Z)S.info(`You can open the project manually: cd ${$}`)}}}let U="";if(!Z)U+=`cd ${$}
177
+ `;if(!G)U+=`${Q} install
178
+ `;U+=`${Q} run dev`,H6(U,"Next steps"),s4(o.default.green("All done! \uD83C\uDF89"))}function tU(){if(typeof globalThis.Bun<"u")return"bun";if(process.env.npm_execpath?.includes("bun"))return"bun";if(process.argv[1]?.includes("bunx"))return"bun";if(process.env.npm_execpath?.includes("pnpm"))return"pnpm";if(process.env.npm_execpath?.includes("yarn"))return"yarn";return"npm"}iU().catch(($)=>{if($.isCanceled)W1("Operation cancelled by user"),process.exit(0);S.error("An unexpected error occurred:"),S.info($.message||$),S.info(`
179
179
  If this issue persists, please report it at:`),S.info("https://github.com/ardzero/bunext/issues"),process.exit(1)});
180
180
 
181
- //# debugId=8815E28AD22CD4EE64756E2164756E21
181
+ //# debugId=661F619C05E4244A64756E2164756E21