create-bunext 0.0.1

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.
Files changed (3) hide show
  1. package/dist/cli.js +181 -0
  2. package/dist/cli.js.map +192 -0
  3. package/package.json +55 -0
package/dist/cli.js ADDED
@@ -0,0 +1,181 @@
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(`
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.
16
+ This can be fixed by both sending a message and listening to incoming messages at the same time:
17
+
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 "${$}".
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}.
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(`
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
40
+ `,unixNewline:`
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}\`.
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,`
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=`
77
+ ${$}
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)}
82
+ ${Y}
83
+ ${C.default.gray(vB+KJ.repeat(q+2)+fB)}
84
+ `)},U1=($="")=>{process.stdout.write(`${C.default.gray(Z$)} ${C.default.red($)}
85
+
86
+ `)},a4=($="")=>{process.stdout.write(`${C.default.gray(DB)} ${$}
87
+ `)},r4=($="")=>{process.stdout.write(`${C.default.gray($0)}
88
+ ${C.default.gray(Z$)} ${$}
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(`
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)}
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(`
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(`
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-###
108
+ #
109
+ # yargs command completion script
110
+ #
111
+ # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
112
+ # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
113
+ #
114
+ _{{app_name}}_yargs_completions()
115
+ {
116
+ local cur_word args type_list
117
+
118
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
119
+ args=("\${COMP_WORDS[@]}")
120
+
121
+ # ask yargs to generate completions.
122
+ type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
123
+
124
+ COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
125
+
126
+ # if no match was found, fall back to filename completion
127
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
128
+ COMPREPLY=()
129
+ fi
130
+
131
+ return 0
132
+ }
133
+ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
134
+ ###-end-{{app_name}}-completions-###
135
+ `,dJ=`#compdef {{app_name}}
136
+ ###-begin-{{app_name}}-completions-###
137
+ #
138
+ # yargs command completion script
139
+ #
140
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
141
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
142
+ #
143
+ _{{app_name}}_yargs_completions()
144
+ {
145
+ local reply
146
+ local si=$IFS
147
+ IFS=$'
148
+ ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
149
+ IFS=$si
150
+ _describe 'values' reply
151
+ }
152
+ compdef _{{app_name}}_yargs_completions {{app_name}}
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")}
163
+ Create a new project with interactive prompts
164
+
165
+ ${a.default.cyan("bun create bunext my-app -y")}
166
+ Create with all defaults (install deps, init git)
167
+
168
+ ${a.default.cyan("bun create bunext my-app --cursor --git")}
169
+ Create and open in Cursor with git initialized
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(`
179
+ If this issue persists, please report it at:`),S.info("https://github.com/ardzero/bunext/issues"),process.exit(1)});
180
+
181
+ //# debugId=8815E28AD22CD4EE64756E2164756E21