bunextupgrade 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cli.js ADDED
@@ -0,0 +1,121 @@
1
+ #!/usr/bin/env node
2
+ import{createRequire as tZ}from"node:module";var dZ=Object.create;var{getPrototypeOf:lZ,defineProperty:K6,getOwnPropertyNames:nZ}=Object;var iZ=Object.prototype.hasOwnProperty;var Z$=($,J,X)=>{X=$!=null?dZ(lZ($)):{};let Z=J||!$||!$.__esModule?K6(X,"default",{value:$,enumerable:!0}):X;for(let q of nZ($))if(!iZ.call(Z,q))K6(Z,q,{get:()=>$[q],enumerable:!0});return Z};var R0=($,J)=>()=>(J||$((J={exports:{}}).exports,J),J.exports);var V0=tZ(import.meta.url);var p6=R0((cW,m6)=>{m6.exports=u6;u6.sync=oQ;var g6=V0("fs");function tQ($,J){var X=J.pathExt!==void 0?J.pathExt:process.env.PATHEXT;if(!X)return!0;if(X=X.split(";"),X.indexOf("")!==-1)return!0;for(var Z=0;Z<X.length;Z++){var q=X[Z].toLowerCase();if(q&&$.substr(-q.length).toLowerCase()===q)return!0}return!1}function c6($,J,X){if(!$.isSymbolicLink()&&!$.isFile())return!1;return tQ(J,X)}function u6($,J,X){g6.stat($,function(Z,q){X(Z,Z?!1:c6(q,$,J))})}function oQ($,J){return c6(g6.statSync($),$,J)}});var t6=R0((uW,i6)=>{i6.exports=l6;l6.sync=aQ;var d6=V0("fs");function l6($,J,X){d6.stat($,function(Z,q){X(Z,Z?!1:n6(q,J))})}function aQ($,J){return n6(d6.statSync($),J)}function n6($,J){return $.isFile()&&rQ($,J)}function rQ($,J){var{mode:X,uid:Z,gid:q}=$,Y=J.uid!==void 0?J.uid:process.getuid&&process.getuid(),Q=J.gid!==void 0?J.gid:process.getgid&&process.getgid(),G=parseInt("100",8),H=parseInt("010",8),B=parseInt("001",8),U=G|H,K=X&B||X&H&&q===Q||X&G&&Z===Y||X&U&&Y===0;return K}});var a6=R0((pW,o6)=>{var mW=V0("fs"),b$;if(process.platform==="win32"||global.TESTING_WINDOWS)b$=p6();else b$=t6();o6.exports=K2;K2.sync=sQ;function K2($,J,X){if(typeof J==="function")X=J,J={};if(!X){if(typeof Promise!=="function")throw TypeError("callback not provided");return new Promise(function(Z,q){K2($,J||{},function(Y,Q){if(Y)q(Y);else Z(Q)})})}b$($,J||{},function(Z,q){if(Z){if(Z.code==="EACCES"||J&&J.ignoreErrors)Z=null,q=!1}X(Z,q)})}function sQ($,J){try{return b$.sync($,J||{})}catch(X){if(J&&J.ignoreErrors||X.code==="EACCES")return!1;else throw X}}});var Z8=R0((dW,X8)=>{var b1=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",r6=V0("path"),eQ=b1?";":":",s6=a6(),e6=($)=>Object.assign(Error(`not found: ${$}`),{code:"ENOENT"}),$8=($,J)=>{let X=J.colon||eQ,Z=$.match(/\//)||b1&&$.match(/\\/)?[""]:[...b1?[process.cwd()]:[],...(J.path||process.env.PATH||"").split(X)],q=b1?J.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",Y=b1?q.split(X):[""];if(b1){if($.indexOf(".")!==-1&&Y[0]!=="")Y.unshift("")}return{pathEnv:Z,pathExt:Y,pathExtExe:q}},J8=($,J,X)=>{if(typeof J==="function")X=J,J={};if(!J)J={};let{pathEnv:Z,pathExt:q,pathExtExe:Y}=$8($,J),Q=[],G=(B)=>new Promise((U,K)=>{if(B===Z.length)return J.all&&Q.length?U(Q):K(e6($));let W=Z[B],P=/^".*"$/.test(W)?W.slice(1,-1):W,R=r6.join(P,$),L=!P&&/^\.[\\\/]/.test($)?$.slice(0,2)+R:R;U(H(L,B,0))}),H=(B,U,K)=>new Promise((W,P)=>{if(K===q.length)return W(G(U+1));let R=q[K];s6(B+R,{pathExt:Y},(L,M)=>{if(!L&&M)if(J.all)Q.push(B+R);else return W(B+R);return W(H(B,U,K+1))})});return X?G(0).then((B)=>X(null,B),X):G(0)},$q=($,J)=>{J=J||{};let{pathEnv:X,pathExt:Z,pathExtExe:q}=$8($,J),Y=[];for(let Q=0;Q<X.length;Q++){let G=X[Q],H=/^".*"$/.test(G)?G.slice(1,-1):G,B=r6.join(H,$),U=!H&&/^\.[\\\/]/.test($)?$.slice(0,2)+B:B;for(let K=0;K<Z.length;K++){let W=U+Z[K];try{if(s6.sync(W,{pathExt:q}))if(J.all)Y.push(W);else return W}catch(P){}}}if(J.all&&Y.length)return Y;if(J.nothrow)return null;throw e6($)};X8.exports=J8;J8.sync=$q});var q8=R0((lW,U2)=>{var Q8=($={})=>{let J=$.env||process.env;if(($.platform||process.platform)!=="win32")return"PATH";return Object.keys(J).reverse().find((Z)=>Z.toUpperCase()==="PATH")||"Path"};U2.exports=Q8;U2.exports.default=Q8});var z8=R0((nW,H8)=>{var Y8=V0("path"),Jq=Z8(),Xq=q8();function G8($,J){let X=$.options.env||process.env,Z=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=Jq.sync($.command,{path:X[Xq({env:X})],pathExt:J?Y8.delimiter:void 0})}catch(G){}finally{if(Y)process.chdir(Z)}if(Q)Q=Y8.resolve(q?$.options.cwd:"",Q);return Q}function Zq($){return G8($)||G8($,!0)}H8.exports=Zq});var B8=R0((Yq,V2)=>{var W2=/([()\][%!^"`<>&|;, *?])/g;function Qq($){return $=$.replace(W2,"^$1"),$}function qq($,J){if($=`${$}`,$=$.replace(/(?=(\\+?)?)\1"/g,"$1$1\\\""),$=$.replace(/(?=(\\+?)?)\1$/,"$1$1"),$=`"${$}"`,$=$.replace(W2,"^$1"),J)$=$.replace(W2,"^$1");return $}Yq.command=Qq;Yq.argument=qq});var U8=R0((iW,K8)=>{K8.exports=/^#!(.*)/});var V8=R0((tW,W8)=>{var zq=U8();W8.exports=($="")=>{let J=$.match(zq);if(!J)return null;let[X,Z]=J[0].replace(/#! ?/,"").split(" "),q=X.split("/").pop();if(q==="env")return Z;return Z?`${q} ${Z}`:q}});var _8=R0((oW,L8)=>{var L2=V0("fs"),Bq=V8();function Kq($){let X=Buffer.alloc(150),Z;try{Z=L2.openSync($,"r"),L2.readSync(Z,X,0,150,0),L2.closeSync(Z)}catch(q){}return Bq(X.toString())}L8.exports=Kq});var F8=R0((aW,P8)=>{var Uq=V0("path"),R8=z8(),T8=B8(),Wq=_8(),Vq=process.platform==="win32",Lq=/\.(?:com|exe)$/i,_q=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function Rq($){$.file=R8($);let J=$.file&&Wq($.file);if(J)return $.args.unshift($.file),$.command=J,R8($);return $.file}function Tq($){if(!Vq)return $;let J=Rq($),X=!Lq.test(J);if($.options.forceShell||X){let Z=_q.test(J);$.command=Uq.normalize($.command),$.command=T8.command($.command),$.args=$.args.map((Y)=>T8.argument(Y,Z));let q=[$.command].concat($.args).join(" ");$.args=["/d","/s","/c",`"${q}"`],$.command=process.env.comspec||"cmd.exe",$.options.windowsVerbatimArguments=!0}return $}function Pq($,J,X){if(J&&!Array.isArray(J))X=J,J=null;J=J?J.slice(0):[],X=Object.assign({},X);let Z={command:$,args:J,options:X,file:void 0,original:{command:$,args:J}};return X.shell?Z:Tq(Z)}P8.exports=Pq});var x8=R0((rW,C8)=>{var _2=process.platform==="win32";function R2($,J){return Object.assign(Error(`${J} ${$.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${J} ${$.command}`,path:$.command,spawnargs:$.args})}function Fq($,J){if(!_2)return;let X=$.emit;$.emit=function(Z,q){if(Z==="exit"){let Y=M8(q,J);if(Y)return X.call($,"error",Y)}return X.apply($,arguments)}}function M8($,J){if(_2&&$===1&&!J.file)return R2(J.original,"spawn");return null}function Mq($,J){if(_2&&$===1&&!J.file)return R2(J.original,"spawnSync");return null}C8.exports={hookChildProcess:Fq,verifyENOENT:M8,verifyENOENTSync:Mq,notFoundError:R2}});var w8=R0((sW,y1)=>{var j8=V0("child_process"),T2=F8(),P2=x8();function I8($,J,X){let Z=T2($,J,X),q=j8.spawn(Z.command,Z.args,Z.options);return P2.hookChildProcess(q,Z),q}function Cq($,J,X){let Z=T2($,J,X),q=j8.spawnSync(Z.command,Z.args,Z.options);return q.error=q.error||P2.verifyENOENTSync(q.status,Z),q}y1.exports=I8;y1.exports.spawn=I8;y1.exports.sync=Cq;y1.exports._parse=T2;y1.exports._enoent=P2});var A3=R0((Yx,MX)=>{var h3={to($,J){if(!J)return`\x1B[${$+1}G`;return`\x1B[${J+1};${$+1}H`},move($,J){let X="";if($<0)X+=`\x1B[${-$}D`;else if($>0)X+=`\x1B[${$}C`;if(J<0)X+=`\x1B[${-J}A`;else if(J>0)X+=`\x1B[${J}B`;return X},up:($=1)=>`\x1B[${$}A`,down:($=1)=>`\x1B[${$}B`,forward:($=1)=>`\x1B[${$}C`,backward:($=1)=>`\x1B[${$}D`,nextLine:($=1)=>"\x1B[E".repeat($),prevLine:($=1)=>"\x1B[F".repeat($),left:"\x1B[G",hide:"\x1B[?25l",show:"\x1B[?25h",save:"\x1B7",restore:"\x1B8"},xB={up:($=1)=>"\x1B[S".repeat($),down:($=1)=>"\x1B[T".repeat($)},jB={screen:"\x1B[2J",up:($=1)=>"\x1B[1J".repeat($),down:($=1)=>"\x1B[J".repeat($),line:"\x1B[2K",lineEnd:"\x1B[K",lineStart:"\x1B[1K",lines($){let J="";for(let X=0;X<$;X++)J+=this.line+(X<$-1?h3.up():"");if($)J+=h3.left;return J}};MX.exports={cursor:h3,scroll:xB,erase:jB,beep:"\x07"}});var D3=R0((Gx,N3)=>{var k4=process||{},CX=k4.argv||[],v4=k4.env||{},IB=!(!!v4.NO_COLOR||CX.includes("--no-color"))&&(!!v4.FORCE_COLOR||CX.includes("--color")||k4.platform==="win32"||(k4.stdout||{}).isTTY&&v4.TERM!=="dumb"||!!v4.CI),wB=($,J,X=$)=>(Z)=>{let q=""+Z,Y=q.indexOf(J,$.length);return~Y?$+OB(q,J,X,Y)+J:$+q+J},OB=($,J,X,Z)=>{let q="",Y=0;do q+=$.substring(Y,Z)+X,Y=Z+J.length,Z=$.indexOf(J,Y);while(~Z);return q+$.substring(Y)},xX=($=IB)=>{let J=$?wB:()=>String;return{isColorSupported:$,reset:J("\x1B[0m","\x1B[0m"),bold:J("\x1B[1m","\x1B[22m","\x1B[22m\x1B[1m"),dim:J("\x1B[2m","\x1B[22m","\x1B[22m\x1B[2m"),italic:J("\x1B[3m","\x1B[23m"),underline:J("\x1B[4m","\x1B[24m"),inverse:J("\x1B[7m","\x1B[27m"),hidden:J("\x1B[8m","\x1B[28m"),strikethrough:J("\x1B[9m","\x1B[29m"),black:J("\x1B[30m","\x1B[39m"),red:J("\x1B[31m","\x1B[39m"),green:J("\x1B[32m","\x1B[39m"),yellow:J("\x1B[33m","\x1B[39m"),blue:J("\x1B[34m","\x1B[39m"),magenta:J("\x1B[35m","\x1B[39m"),cyan:J("\x1B[36m","\x1B[39m"),white:J("\x1B[37m","\x1B[39m"),gray:J("\x1B[90m","\x1B[39m"),bgBlack:J("\x1B[40m","\x1B[49m"),bgRed:J("\x1B[41m","\x1B[49m"),bgGreen:J("\x1B[42m","\x1B[49m"),bgYellow:J("\x1B[43m","\x1B[49m"),bgBlue:J("\x1B[44m","\x1B[49m"),bgMagenta:J("\x1B[45m","\x1B[49m"),bgCyan:J("\x1B[46m","\x1B[49m"),bgWhite:J("\x1B[47m","\x1B[49m"),blackBright:J("\x1B[90m","\x1B[39m"),redBright:J("\x1B[91m","\x1B[39m"),greenBright:J("\x1B[92m","\x1B[39m"),yellowBright:J("\x1B[93m","\x1B[39m"),blueBright:J("\x1B[94m","\x1B[39m"),magentaBright:J("\x1B[95m","\x1B[39m"),cyanBright:J("\x1B[96m","\x1B[39m"),whiteBright:J("\x1B[97m","\x1B[39m"),bgBlackBright:J("\x1B[100m","\x1B[49m"),bgRedBright:J("\x1B[101m","\x1B[49m"),bgGreenBright:J("\x1B[102m","\x1B[49m"),bgYellowBright:J("\x1B[103m","\x1B[49m"),bgBlueBright:J("\x1B[104m","\x1B[49m"),bgMagentaBright:J("\x1B[105m","\x1B[49m"),bgCyanBright:J("\x1B[106m","\x1B[49m"),bgWhiteBright:J("\x1B[107m","\x1B[49m")}};N3.exports=xX();N3.exports.createColors=xX});function X0($){if(typeof $!=="object"||$===null)return!1;let J=Object.getPrototypeOf($);return(J===null||J===Object.prototype||Object.getPrototypeOf(J)===null)&&!(Symbol.toStringTag in $)&&!(Symbol.iterator in $)}import{fileURLToPath as oZ}from"node:url";var f1=($,J)=>{let X=X2(aZ($));if(typeof X!=="string")throw TypeError(`${J} must be a string or a file URL: ${X}.`);return X},aZ=($)=>J2($)?$.toString():$,J2=($)=>typeof $!=="string"&&$&&Object.getPrototypeOf($)===String.prototype,X2=($)=>$ instanceof URL?oZ($):$;var I$=($,J=[],X={})=>{let Z=f1($,"First argument"),[q,Y]=X0(J)?[[],J]:[J,X];if(!Array.isArray(q))throw TypeError(`Second argument must be either an array of arguments or an options object: ${q}`);if(q.some((H)=>typeof H==="object"&&H!==null))throw TypeError(`Second argument must be an array of strings: ${q}`);let Q=q.map(String),G=Q.find((H)=>H.includes("\x00"));if(G!==void 0)throw TypeError(`Arguments cannot contain null bytes ("\\0"): ${G}`);if(!X0(Y))throw TypeError(`Last argument must be an options object: ${Y}`);return[Z,Q,Y]};import{ChildProcess as ZQ}from"node:child_process";import{StringDecoder as rZ}from"node:string_decoder";var{toString:U6}=Object.prototype,W6=($)=>U6.call($)==="[object ArrayBuffer]",z0=($)=>U6.call($)==="[object Uint8Array]",i0=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),sZ=new TextEncoder,V6=($)=>sZ.encode($),eZ=new TextDecoder,w$=($)=>eZ.decode($),L6=($,J)=>{return $Q($,J).join("")},$Q=($,J)=>{if(J==="utf8"&&$.every((Y)=>typeof Y==="string"))return $;let X=new rZ(J),Z=$.map((Y)=>typeof Y==="string"?V6(Y):Y).map((Y)=>X.write(Y)),q=X.end();return q===""?Z:[...Z,q]},Q$=($)=>{if($.length===1&&z0($[0]))return $[0];return Z2(JQ($))},JQ=($)=>$.map((J)=>typeof J==="string"?V6(J):J),Z2=($)=>{let J=new Uint8Array(XQ($)),X=0;for(let Z of $)J.set(Z,X),X+=Z.length;return J},XQ=($)=>{let J=0;for(let X of $)J+=X.length;return J};var P6=($)=>Array.isArray($)&&Array.isArray($.raw),F6=($,J)=>{let X=[];for(let[Y,Q]of $.entries())X=QQ({templates:$,expressions:J,tokens:X,index:Y,template:Q});if(X.length===0)throw TypeError("Template script must not be empty");let[Z,...q]=X;return[Z,q,{}]},QQ=({templates:$,expressions:J,tokens:X,index:Z,template:q})=>{if(q===void 0)throw TypeError(`Invalid backslash sequence: ${$.raw[Z]}`);let{nextTokens:Y,leadingWhitespaces:Q,trailingWhitespaces:G}=qQ(q,$.raw[Z]),H=R6(X,Y,Q);if(Z===J.length)return H;let B=J[Z],U=Array.isArray(B)?B.map((K)=>T6(K)):[T6(B)];return R6(H,U,G)},qQ=($,J)=>{if(J.length===0)return{nextTokens:[],leadingWhitespaces:!1,trailingWhitespaces:!1};let X=[],Z=0,q=_6.has(J[0]);for(let Q=0,G=0;Q<$.length;Q+=1,G+=1){let H=J[G];if(_6.has(H)){if(Z!==Q)X.push($.slice(Z,Q));Z=Q+1}else if(H==="\\"){let B=J[G+1];if(B===`
3
+ `)Q-=1,G+=1;else if(B==="u"&&J[G+2]==="{")G=J.indexOf("}",G+3);else G+=YQ[B]??1}}let Y=Z===$.length;if(!Y)X.push($.slice(Z));return{nextTokens:X,leadingWhitespaces:q,trailingWhitespaces:Y}},_6=new Set([" ","\t","\r",`
4
+ `]),YQ={x:3,u:5},R6=($,J,X)=>X||$.length===0||J.length===0?[...$,...J]:[...$.slice(0,-1),`${$.at(-1)}${J[0]}`,...J.slice(1)],T6=($)=>{let J=typeof $;if(J==="string")return $;if(J==="number")return String($);if(X0($)&&(("stdout"in $)||("isMaxBuffer"in $)))return GQ($);if($ instanceof ZQ||Object.prototype.toString.call($)==="[object Promise]")throw TypeError("Unexpected subprocess in template expression. Please use ${await subprocess} instead of ${subprocess}.");throw TypeError(`Unexpected "${J}" in template expression`)},GQ=({stdout:$})=>{if(typeof $==="string")return $;if(z0($))return w$($);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 VH}from"node:child_process";import{debuglog as HQ}from"node:util";import Q2 from"node:process";var D0=($)=>O$.includes($),O$=[Q2.stdin,Q2.stdout,Q2.stderr],j0=["stdin","stdout","stderr"],E$=($)=>j0[$]??`stdio[${$}]`;var C6=($)=>{let J={...$};for(let X of G2)J[X]=q2($,X);return J},q2=($,J)=>{let X=Array.from({length:zQ($)+1}),Z=BQ($[J],X,J);return LQ(Z,J)},zQ=({stdio:$})=>Array.isArray($)?Math.max($.length,j0.length):j0.length,BQ=($,J,X)=>X0($)?KQ($,J,X):J.fill($),KQ=($,J,X)=>{for(let Z of Object.keys($).sort(UQ))for(let q of WQ(Z,X,J))J[q]=$[Z];return J},UQ=($,J)=>M6($)<M6(J)?1:-1,M6=($)=>{if($==="stdout"||$==="stderr")return 0;return $==="all"?2:1},WQ=($,J,X)=>{if($==="ipc")return[X.length-1];let Z=Y2($);if(Z===void 0||Z===0)throw TypeError(`"${J}.${$}" is invalid.
5
+ It must be "${J}.stdout", "${J}.stderr", "${J}.all", "${J}.ipc", or "${J}.fd3", "${J}.fd4" (and so on).`);if(Z>=X.length)throw TypeError(`"${J}.${$}" is invalid: that file descriptor does not exist.
6
+ Please set the "stdio" option to ensure that file descriptor exists.`);return Z==="all"?[1,2]:[Z]},Y2=($)=>{if($==="all")return $;if(j0.includes($))return j0.indexOf($);let J=VQ.exec($);if(J!==null)return Number(J[1])},VQ=/^fd(\d+)$/,LQ=($,J)=>$.map((X)=>X===void 0?RQ[J]:X),_Q=HQ("execa").enabled?"full":"none",RQ={lines:!1,buffer:!0,maxBuffer:1e8,verbose:_Q,stripFinalNewline:!0},G2=["lines","buffer","maxBuffer","verbose","stripFinalNewline"],t0=($,J)=>J==="ipc"?$.at(-1):$[J];var v1=({verbose:$},J)=>H2($,J)!=="none",k1=({verbose:$},J)=>!["none","short"].includes(H2($,J)),x6=({verbose:$},J)=>{let X=H2($,J);return h$(X)?X:void 0},H2=($,J)=>J===void 0?TQ($):t0($,J),TQ=($)=>$.find((J)=>h$(J))??A$.findLast((J)=>$.includes(J)),h$=($)=>typeof $==="function",A$=["none","short","full"];import{inspect as cQ}from"node:util";import{platform as PQ}from"node:process";import{stripVTControlCharacters as FQ}from"node:util";var j6=($,J)=>{let X=[$,...J],Z=X.join(" "),q=X.map((Y)=>wQ(I6(Y))).join(" ");return{command:Z,escapedCommand:q}},q$=($)=>FQ($).split(`
7
+ `).map((J)=>I6(J)).join(`
8
+ `),I6=($)=>$.replaceAll(xQ,(J)=>MQ(J)),MQ=($)=>{let J=jQ[$];if(J!==void 0)return J;let X=$.codePointAt(0),Z=X.toString(16);return X<=IQ?`\\u${Z.padStart(4,"0")}`:`\\U${Z}`},CQ=()=>{try{return new RegExp("\\p{Separator}|\\p{Other}","gu")}catch{return/[\s\u0000-\u001F\u007F-\u009F\u00AD]/g}},xQ=CQ(),jQ={" ":" ","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"},IQ=65535,wQ=($)=>{if(OQ.test($))return $;return PQ==="win32"?`"${$.replaceAll('"','""')}"`:`'${$.replaceAll("'","'\\''")}'`},OQ=/^[\w./-]+$/;import w6 from"node:process";function z2(){let{env:$}=w6,{TERM:J,TERM_PROGRAM:X}=$;if(w6.platform!=="win32")return J!=="linux";return Boolean($.WT_SESSION)||Boolean($.TERMINUS_SUBLIME)||$.ConEmuTask==="{cmd::Cmder}"||X==="Terminus-Sublime"||X==="vscode"||J==="xterm-256color"||J==="alacritty"||J==="rxvt-unicode"||J==="rxvt-unicode-256color"||$.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var O6={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:"╱"},E6={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:"⅒"},EQ={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"},hQ={...O6,...E6},AQ={...O6,...EQ},NQ=z2(),DQ=NQ?hQ:AQ,N$=DQ,AU=Object.entries(E6);import SQ from"node:tty";var fQ=SQ?.WriteStream?.prototype?.hasColors?.()??!1,c=($,J)=>{if(!fQ)return(q)=>q;let X=`\x1B[${$}m`,Z=`\x1B[${J}m`;return(q)=>{let Y=q+"",Q=Y.indexOf(Z);if(Q===-1)return X+Y+Z;let G=X,H=0,U=(J===22?Z:"")+X;while(Q!==-1)G+=Y.slice(H,Q)+U,H=Q+Z.length,Q=Y.indexOf(Z,H);return G+=Y.slice(H)+Z,G}},SU=c(0,0),h6=c(1,22),fU=c(2,22),vU=c(3,23),kU=c(4,24),bU=c(53,55),yU=c(7,27),gU=c(8,28),cU=c(9,29),uU=c(30,39),mU=c(31,39),pU=c(32,39),dU=c(33,39),lU=c(34,39),nU=c(35,39),iU=c(36,39),tU=c(37,39),D$=c(90,39),oU=c(40,49),aU=c(41,49),rU=c(42,49),sU=c(43,49),eU=c(44,49),$W=c(45,49),JW=c(46,49),XW=c(47,49),ZW=c(100,49),A6=c(91,39),QW=c(92,39),N6=c(93,39),qW=c(94,39),YW=c(95,39),GW=c(96,39),HW=c(97,39),zW=c(101,49),BW=c(102,49),KW=c(103,49),UW=c(104,49),WW=c(105,49),VW=c(106,49),LW=c(107,49);var f6=({type:$,message:J,timestamp:X,piped:Z,commandId:q,result:{failed:Y=!1}={},options:{reject:Q=!0}})=>{let G=vQ(X),H=kQ[$]({failed:Y,reject:Q,piped:Z}),B=bQ[$]({reject:Q});return`${D$(`[${G}]`)} ${D$(`[${q}]`)} ${B(H)} ${B(J)}`},vQ=($)=>`${S$($.getHours(),2)}:${S$($.getMinutes(),2)}:${S$($.getSeconds(),2)}.${S$($.getMilliseconds(),3)}`,S$=($,J)=>String($).padStart(J,"0"),D6=({failed:$,reject:J})=>{if(!$)return N$.tick;return J?N$.cross:N$.warning},kQ={command:({piped:$})=>$?"|":"$",output:()=>" ",ipc:()=>"*",error:D6,duration:D6},S6=($)=>$,bQ={command:()=>h6,output:()=>S6,ipc:()=>S6,error:({reject:$})=>$?A6:N6,duration:()=>D$};var v6=($,J,X)=>{let Z=x6(J,X);return $.map(({verboseLine:q,verboseObject:Y})=>yQ(q,Y,Z)).filter((q)=>q!==void 0).map((q)=>gQ(q)).join("")},yQ=($,J,X)=>{if(X===void 0)return $;let Z=X($,J);if(typeof Z==="string")return Z},gQ=($)=>$.endsWith(`
9
+ `)?$:`${$}
10
+ `;var b0=({type:$,verboseMessage:J,fdNumber:X,verboseInfo:Z,result:q})=>{let Y=uQ({type:$,result:q,verboseInfo:Z}),Q=mQ(J,Y),G=v6(Q,Z,X);if(G!=="")console.warn(G.slice(0,-1))},uQ=({type:$,result:J,verboseInfo:{escapedCommand:X,commandId:Z,rawOptions:{piped:q=!1,...Y}}})=>({type:$,escapedCommand:X,commandId:`${Z}`,timestamp:new Date,piped:q,result:J,options:Y}),mQ=($,J)=>$.split(`
11
+ `).map((X)=>pQ({...J,message:X})),pQ=($)=>{return{verboseLine:f6($),verboseObject:$}},f$=($)=>{let J=typeof $==="string"?$:cQ($);return q$(J).replaceAll("\t"," ".repeat(dQ))},dQ=2;var k6=($,J)=>{if(!v1(J))return;b0({type:"command",verboseMessage:$,verboseInfo:J})};var b6=($,J,X)=>{iQ($);let Z=lQ($);return{verbose:$,escapedCommand:J,commandId:Z,rawOptions:X}},lQ=($)=>v1({verbose:$})?nQ++:void 0,nQ=0n,iQ=($)=>{for(let J of $){if(J===!1)throw TypeError(`The "verbose: false" option was renamed to "verbose: 'none'".`);if(J===!0)throw TypeError(`The "verbose: true" option was renamed to "verbose: 'short'".`);if(!A$.includes(J)&&!h$(J)){let X=A$.map((Z)=>`'${Z}'`).join(", ");throw TypeError(`The "verbose" option must not be ${J}. Allowed values are: ${X} or a function.`)}}};import{hrtime as y6}from"node:process";var v$=()=>y6.bigint(),B2=($)=>Number(y6.bigint()-$)/1e6;var k$=($,J,X)=>{let Z=v$(),{command:q,escapedCommand:Y}=j6($,J),Q=q2(X,"verbose"),G=b6(Q,Y,{...X});return k6(Y,G),{command:q,escapedCommand:Y,startTime:Z,verboseInfo:G}};var k7=Z$(w8(),1);import S9 from"node:path";import v7 from"node:process";import c$ from"node:process";import W1 from"node:path";function y$($={}){let{env:J=process.env,platform:X=process.platform}=$;if(X!=="win32")return"PATH";return Object.keys(J).reverse().find((Z)=>Z.toUpperCase()==="PATH")||"Path"}import{promisify as xq}from"node:util";import{execFile as jq,execFileSync as XV}from"node:child_process";import O8 from"node:path";import{fileURLToPath as Iq}from"node:url";var qV=xq(jq);function g$($){return $ instanceof URL?Iq($):$}function E8($){return{*[Symbol.iterator](){let J=O8.resolve(g$($)),X;while(X!==J)yield J,X=J,J=O8.resolve(J,"..")}}}var wq=({cwd:$=c$.cwd(),path:J=c$.env[y$()],preferLocal:X=!0,execPath:Z=c$.execPath,addExecPath:q=!0}={})=>{let Y=W1.resolve(g$($)),Q=[],G=J.split(W1.delimiter);if(X)Oq(Q,G,Y);if(q)Eq(Q,G,Z,Y);return J===""||J===W1.delimiter?`${Q.join(W1.delimiter)}${J}`:[...Q,J].join(W1.delimiter)},Oq=($,J,X)=>{for(let Z of E8(X)){let q=W1.join(Z,"node_modules/.bin");if(!J.includes(q))$.push(q)}},Eq=($,J,X,Z)=>{let q=W1.resolve(Z,g$(X),"..");if(!J.includes(q))$.push(q)},h8=({env:$=c$.env,...J}={})=>{$={...$};let X=y$({env:$});return J.path=$[X],$[X]=wq(J),$};import{setTimeout as pq}from"node:timers/promises";var A8=($,J,X)=>{let Z=X?m$:u$,q=$ instanceof y0?{}:{cause:$};return new Z(J,q)};class y0 extends Error{}var N8=($,J)=>{Object.defineProperty($.prototype,"name",{value:J,writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty($.prototype,S8,{value:!0,writable:!1,enumerable:!1,configurable:!1})},D8=($)=>p$($)&&(S8 in $),S8=Symbol("isExecaError"),p$=($)=>Object.prototype.toString.call($)==="[object Error]";class u$ extends Error{}N8(u$,u$.name);class m$ extends Error{}N8(m$,m$.name);import{constants as Y$}from"node:os";import{constants as Dq}from"node:os";var f8=()=>{let $=F2-v8+1;return Array.from({length:$},hq)},hq=($,J)=>({name:`SIGRT${J+1}`,number:v8+J,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}),v8=34,F2=64;import{constants as Aq}from"node:os";var k8=[{name:"SIGHUP",number:1,action:"terminate",description:"Terminal closed",standard:"posix"},{name:"SIGINT",number:2,action:"terminate",description:"User interruption with CTRL-C",standard:"ansi"},{name:"SIGQUIT",number:3,action:"core",description:"User interruption with CTRL-\\",standard:"posix"},{name:"SIGILL",number:4,action:"core",description:"Invalid machine instruction",standard:"ansi"},{name:"SIGTRAP",number:5,action:"core",description:"Debugger breakpoint",standard:"posix"},{name:"SIGABRT",number:6,action:"core",description:"Aborted",standard:"ansi"},{name:"SIGIOT",number:6,action:"core",description:"Aborted",standard:"bsd"},{name:"SIGBUS",number:7,action:"core",description:"Bus error due to misaligned, non-existing address or paging error",standard:"bsd"},{name:"SIGEMT",number:7,action:"terminate",description:"Command should be emulated but is not implemented",standard:"other"},{name:"SIGFPE",number:8,action:"core",description:"Floating point arithmetic error",standard:"ansi"},{name:"SIGKILL",number:9,action:"terminate",description:"Forced termination",standard:"posix",forced:!0},{name:"SIGUSR1",number:10,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGSEGV",number:11,action:"core",description:"Segmentation fault",standard:"ansi"},{name:"SIGUSR2",number:12,action:"terminate",description:"Application-specific signal",standard:"posix"},{name:"SIGPIPE",number:13,action:"terminate",description:"Broken pipe or socket",standard:"posix"},{name:"SIGALRM",number:14,action:"terminate",description:"Timeout or timer",standard:"posix"},{name:"SIGTERM",number:15,action:"terminate",description:"Termination",standard:"ansi"},{name:"SIGSTKFLT",number:16,action:"terminate",description:"Stack is empty or overflowed",standard:"other"},{name:"SIGCHLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"posix"},{name:"SIGCLD",number:17,action:"ignore",description:"Child process terminated, paused or unpaused",standard:"other"},{name:"SIGCONT",number:18,action:"unpause",description:"Unpaused",standard:"posix",forced:!0},{name:"SIGSTOP",number:19,action:"pause",description:"Paused",standard:"posix",forced:!0},{name:"SIGTSTP",number:20,action:"pause",description:'Paused using CTRL-Z or "suspend"',standard:"posix"},{name:"SIGTTIN",number:21,action:"pause",description:"Background process cannot read terminal input",standard:"posix"},{name:"SIGBREAK",number:21,action:"terminate",description:"User interruption with CTRL-BREAK",standard:"other"},{name:"SIGTTOU",number:22,action:"pause",description:"Background process cannot write to terminal output",standard:"posix"},{name:"SIGURG",number:23,action:"ignore",description:"Socket received out-of-band data",standard:"bsd"},{name:"SIGXCPU",number:24,action:"core",description:"Process timed out",standard:"bsd"},{name:"SIGXFSZ",number:25,action:"core",description:"File too big",standard:"bsd"},{name:"SIGVTALRM",number:26,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGPROF",number:27,action:"terminate",description:"Timeout or timer",standard:"bsd"},{name:"SIGWINCH",number:28,action:"ignore",description:"Terminal window size changed",standard:"bsd"},{name:"SIGIO",number:29,action:"terminate",description:"I/O is available",standard:"other"},{name:"SIGPOLL",number:29,action:"terminate",description:"Watched event",standard:"other"},{name:"SIGINFO",number:29,action:"ignore",description:"Request for process information",standard:"other"},{name:"SIGPWR",number:30,action:"terminate",description:"Device running out of power",standard:"systemv"},{name:"SIGSYS",number:31,action:"core",description:"Invalid system call",standard:"other"},{name:"SIGUNUSED",number:31,action:"terminate",description:"Invalid system call",standard:"other"}];var M2=()=>{let $=f8();return[...k8,...$].map(Nq)},Nq=({name:$,number:J,description:X,action:Z,forced:q=!1,standard:Y})=>{let{signals:{[$]:Q}}=Aq,G=Q!==void 0;return{name:$,number:G?Q:J,description:X,supported:G,action:Z,forced:q,standard:Y}};var Sq=()=>{let $=M2();return Object.fromEntries($.map(fq))},fq=({name:$,number:J,description:X,supported:Z,action:q,forced:Y,standard:Q})=>[$,{name:$,number:J,description:X,supported:Z,action:q,forced:Y,standard:Q}],b8=Sq(),vq=()=>{let $=M2(),J=F2+1,X=Array.from({length:J},(Z,q)=>kq(q,$));return Object.assign({},...X)},kq=($,J)=>{let X=bq($,J);if(X===void 0)return{};let{name:Z,description:q,supported:Y,action:Q,forced:G,standard:H}=X;return{[$]:{name:Z,number:$,description:q,supported:Y,action:Q,forced:G,standard:H}}},bq=($,J)=>{let X=J.find(({name:Z})=>Dq.signals[Z]===$);if(X!==void 0)return X;return J.find((Z)=>Z.number===$)},xV=vq();var g8=($)=>{if($===0)throw TypeError("Invalid option `killSignal`: 0 cannot be used.");return u8($,"option `killSignal`")},c8=($)=>$===0?$:u8($,"`subprocess.kill()`'s argument"),u8=($,J)=>{if(Number.isInteger($))return yq($,J);if(typeof $==="string")return cq($,J);throw TypeError(`Invalid ${J} ${String($)}: it must be a string or an integer.
12
+ ${C2()}`)},yq=($,J)=>{if(y8.has($))return y8.get($);throw TypeError(`Invalid ${J} ${$}: this signal integer does not exist.
13
+ ${C2()}`)},gq=()=>new Map(Object.entries(Y$.signals).reverse().map(([$,J])=>[J,$])),y8=gq(),cq=($,J)=>{if($ in Y$.signals)return $;if($.toUpperCase()in Y$.signals)throw TypeError(`Invalid ${J} '${$}': please rename it to '${$.toUpperCase()}'.`);throw TypeError(`Invalid ${J} '${$}': this signal name does not exist.
14
+ ${C2()}`)},C2=()=>`Available signal names: ${uq()}.
15
+ Available signal numbers: ${mq()}.`,uq=()=>Object.keys(Y$.signals).sort().map(($)=>`'${$}'`).join(", "),mq=()=>[...new Set(Object.values(Y$.signals).sort(($,J)=>$-J))].join(", "),d$=($)=>b8[$].description;var m8=($)=>{if($===!1)return $;if($===!0)return dq;if(!Number.isFinite($)||$<0)throw TypeError(`Expected the \`forceKillAfterDelay\` option to be a non-negative integer, got \`${$}\` (${typeof $})`);return $},dq=5000,p8=({kill:$,options:{forceKillAfterDelay:J,killSignal:X},onInternalError:Z,context:q,controller:Y},Q,G)=>{let{signal:H,error:B}=lq(Q,G,X);nq(B,Z);let U=$(H);return iq({kill:$,signal:H,forceKillAfterDelay:J,killSignal:X,killResult:U,context:q,controller:Y}),U},lq=($,J,X)=>{let[Z=X,q]=p$($)?[void 0,$]:[$,J];if(typeof Z!=="string"&&!Number.isInteger(Z))throw TypeError(`The first argument must be an error instance or a signal name string/integer: ${String(Z)}`);if(q!==void 0&&!p$(q))throw TypeError(`The second argument is optional. If specified, it must be an error instance: ${q}`);return{signal:c8(Z),error:q}},nq=($,J)=>{if($!==void 0)J.reject($)},iq=async({kill:$,signal:J,forceKillAfterDelay:X,killSignal:Z,killResult:q,context:Y,controller:Q})=>{if(J===Z&&q)x2({kill:$,forceKillAfterDelay:X,context:Y,controllerSignal:Q.signal})},x2=async({kill:$,forceKillAfterDelay:J,context:X,controllerSignal:Z})=>{if(J===!1)return;try{if(await pq(J,void 0,{signal:Z}),$("SIGKILL"))X.isForcefullyTerminated??=!0}catch{}};import{once as tq}from"node:events";var l$=async($,J)=>{if(!$.aborted)await tq($,"abort",{signal:J})};var d8=({cancelSignal:$})=>{if($!==void 0&&Object.prototype.toString.call($)!=="[object AbortSignal]")throw Error(`The \`cancelSignal\` option must be an AbortSignal: ${String($)}`)},l8=({subprocess:$,cancelSignal:J,gracefulCancel:X,context:Z,controller:q})=>J===void 0||X?[]:[oq($,J,Z,q)],oq=async($,J,X,{signal:Z})=>{throw await l$(J,Z),X.terminationReason??="cancel",$.kill(),J.reason};import{scheduler as _9}from"node:timers/promises";import{promisify as W9}from"node:util";var g1=({methodName:$,isSubprocess:J,ipc:X,isConnected:Z})=>{aq($,J,X),j2($,J,Z)},aq=($,J,X)=>{if(!X)throw Error(`${S0($,J)} can only be used if the \`ipc\` option is \`true\`.`)},j2=($,J,X)=>{if(!X)throw Error(`${S0($,J)} cannot be used: the ${J1(J)} has already exited or disconnected.`)},n8=($)=>{throw Error(`${S0("getOneMessage",$)} could not complete: the ${J1($)} exited or disconnected.`)},i8=($)=>{throw Error(`${S0("sendMessage",$)} failed: the ${J1($)} 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
+ ${S0("getOneMessage",$)},
20
+ ${S0("sendMessage",$,"message, {strict: true}")},
21
+ ]);`)},n$=($,J)=>Error(`${S0("sendMessage",J)} failed when sending an acknowledgment response to the ${J1(J)}.`,{cause:$}),t8=($)=>{throw Error(`${S0("sendMessage",$)} failed: the ${J1($)} is not listening to incoming messages.`)},o8=($)=>{throw Error(`${S0("sendMessage",$)} failed: the ${J1($)} exited without listening to incoming messages.`)},a8=()=>Error(`\`cancelSignal\` aborted: the ${J1(!0)} disconnected.`),r8=()=>{throw Error("`getCancelSignal()` cannot be used without setting the `cancelSignal` subprocess option.")},s8=({error:$,methodName:J,isSubprocess:X})=>{if($.code==="EPIPE")throw Error(`${S0(J,X)} cannot be used: the ${J1(X)} is disconnecting.`,{cause:$})},e8=({error:$,methodName:J,isSubprocess:X,message:Z})=>{if(rq($))throw Error(`${S0(J,X)}'s argument type is invalid: the message cannot be serialized: ${String(Z)}.`,{cause:$})},rq=({code:$,message:J})=>sq.has($)||eq.some((X)=>J.includes(X)),sq=new Set(["ERR_MISSING_ARGS","ERR_INVALID_ARG_TYPE"]),eq=["could not be cloned","circular structure","call stack size exceeded"],S0=($,J,X="")=>$==="cancelSignal"?"`cancelSignal`'s `controller.abort()`":`${$9(J)}${$}(${X})`,$9=($)=>$?"":"subprocess.",J1=($)=>$?"parent process":"subprocess",c1=($)=>{if($.connected)$.disconnect()};var g0=()=>{let $={},J=new Promise((X,Z)=>{Object.assign($,{resolve:X,reject:Z})});return Object.assign(J,$)};var t$=($,J="stdin")=>{let{options:Z,fileDescriptors:q}=c0.get($),Y=$7(q,J,!0),Q=$.stdio[Y];if(Q===null)throw TypeError(J7(Y,J,Z,!0));return Q},u1=($,J="stdout")=>{let{options:Z,fileDescriptors:q}=c0.get($),Y=$7(q,J,!1),Q=Y==="all"?$.all:$.stdio[Y];if(Q===null||Q===void 0)throw TypeError(J7(Y,J,Z,!1));return Q},c0=new WeakMap,$7=($,J,X)=>{let Z=J9(J,X);return X9(Z,J,X,$),Z},J9=($,J)=>{let X=Y2($);if(X!==void 0)return X;let{validOptions:Z,defaultValue:q}=J?{validOptions:'"stdin"',defaultValue:"stdin"}:{validOptions:'"stdout", "stderr", "all"',defaultValue:"stdout"};throw TypeError(`"${G$(J)}" must not be "${$}".
22
+ It must be ${Z} or "fd3", "fd4" (and so on).
23
+ It is optional and defaults to "${q}".`)},X9=($,J,X,Z)=>{let q=Z[X7($)];if(q===void 0)throw TypeError(`"${G$(X)}" must not be ${J}. That file descriptor does not exist.
24
+ Please set the "stdio" option to ensure that file descriptor exists.`);if(q.direction==="input"&&!X)throw TypeError(`"${G$(X)}" must not be ${J}. It must be a readable stream, not writable.`);if(q.direction!=="input"&&X)throw TypeError(`"${G$(X)}" must not be ${J}. It must be a writable stream, not readable.`)},J7=($,J,X,Z)=>{if($==="all"&&!X.all)return`The "all" option must be true to use "from: 'all'".`;let{optionName:q,optionValue:Y}=Z9($,X);return`The "${q}: ${i$(Y)}" option is incompatible with using "${G$(Z)}: ${i$(J)}".
25
+ Please set this option with "pipe" instead.`},Z9=($,{stdin:J,stdout:X,stderr:Z,stdio:q})=>{let Y=X7($);if(Y===0&&J!==void 0)return{optionName:"stdin",optionValue:J};if(Y===1&&X!==void 0)return{optionName:"stdout",optionValue:X};if(Y===2&&Z!==void 0)return{optionName:"stderr",optionValue:Z};return{optionName:`stdio[${Y}]`,optionValue:q[Y]}},X7=($)=>$==="all"?1:$,G$=($)=>$?"to":"from",i$=($)=>{if(typeof $==="string")return`'${$}'`;return typeof $==="number"?`${$}`:"Stream"};import{once as z9}from"node:events";import{addAbortListener as Q9}from"node:events";var V1=($,J,X)=>{let Z=$.getMaxListeners();if(Z===0||Z===Number.POSITIVE_INFINITY)return;$.setMaxListeners(Z+J),Q9(X,()=>{$.setMaxListeners($.getMaxListeners()-J)})};import{EventEmitter as G9}from"node:events";import{once as q9}from"node:events";import{scheduler as Y9}from"node:timers/promises";var o$=($,J)=>{if(J)I2($)},I2=($)=>{$.refCounted()},a$=($,J)=>{if(J)w2($)},w2=($)=>{$.unrefCounted()},Z7=($,J)=>{if(J)w2($),w2($)},Q7=($,J)=>{if(J)I2($),I2($)};var q7=async({anyProcess:$,channel:J,isSubprocess:X,ipcEmitter:Z},q)=>{if(H7(q)||B7(q))return;if(!r$.has($))r$.set($,[]);let Y=r$.get($);if(Y.push(q),Y.length>1)return;while(Y.length>0){await z7($,Z,q),await Y9.yield();let Q=await G7({wrappedMessage:Y[0],anyProcess:$,channel:J,isSubprocess:X,ipcEmitter:Z});Y.shift(),Z.emit("message",Q),Z.emit("message:done")}},Y7=async({anyProcess:$,channel:J,isSubprocess:X,ipcEmitter:Z,boundOnMessage:q})=>{O2();let Y=r$.get($);while(Y?.length>0)await q9(Z,"message:done");$.removeListener("message",q),Q7(J,X),Z.connected=!1,Z.emit("disconnect")},r$=new WeakMap;var X1=($,J,X)=>{if(s$.has($))return s$.get($);let Z=new G9;return Z.connected=!0,s$.set($,Z),H9({ipcEmitter:Z,anyProcess:$,channel:J,isSubprocess:X}),Z},s$=new WeakMap,H9=({ipcEmitter:$,anyProcess:J,channel:X,isSubprocess:Z})=>{let q=q7.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:$});J.on("message",q),J.once("disconnect",Y7.bind(void 0,{anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:$,boundOnMessage:q})),Z7(X,Z)},e$=($)=>{let J=s$.get($);return J===void 0?$.channel!==null:J.connected};var K7=({anyProcess:$,channel:J,isSubprocess:X,message:Z,strict:q})=>{if(!q)return Z;let Y=X1($,J,X),Q=X4($,Y);return{id:B9++,type:J4,message:Z,hasListeners:Q}},B9=0n,U7=($,J)=>{if(J?.type!==J4||J.hasListeners)return;for(let{id:X}of $)if(X!==void 0)$4[X].resolve({isDeadlock:!0,hasListeners:!1})},G7=async({wrappedMessage:$,anyProcess:J,channel:X,isSubprocess:Z,ipcEmitter:q})=>{if($?.type!==J4||!J.connected)return $;let{id:Y,message:Q}=$,G={id:Y,type:V7,message:X4(J,q)};try{await Z4({anyProcess:J,channel:X,isSubprocess:Z,ipc:!0},G)}catch(H){q.emit("strict:error",H)}return Q},H7=($)=>{if($?.type!==V7)return!1;let{id:J,message:X}=$;return $4[J]?.resolve({isDeadlock:!1,hasListeners:X}),!0},W7=async($,J,X)=>{if($?.type!==J4)return;let Z=g0();$4[$.id]=Z;let q=new AbortController;try{let{isDeadlock:Y,hasListeners:Q}=await Promise.race([Z,K9(J,X,q)]);if(Y)i8(X);if(!Q)t8(X)}finally{q.abort(),delete $4[$.id]}},$4={},K9=async($,J,{signal:X})=>{V1($,1,X),await z9($,"disconnect",{signal:X}),o8(J)},J4="execa:ipc:request",V7="execa:ipc:response";var L7=($,J,X)=>{if(!H$.has($))H$.set($,new Set);let Z=H$.get($),q=g0(),Y=X?J.id:void 0,Q={onMessageSent:q,id:Y};return Z.add(Q),{outgoingMessages:Z,outgoingMessage:Q}},_7=({outgoingMessages:$,outgoingMessage:J})=>{$.delete(J),J.onMessageSent.resolve()},z7=async($,J,X)=>{while(!X4($,J)&&H$.get($)?.size>0){let Z=[...H$.get($)];U7(Z,X),await Promise.all(Z.map(({onMessageSent:q})=>q))}},H$=new WeakMap,X4=($,J)=>J.listenerCount("message")>U9($),U9=($)=>c0.has($)&&!t0(c0.get($).options.buffer,"ipc")?1:0;var Z4=({anyProcess:$,channel:J,isSubprocess:X,ipc:Z},q,{strict:Y=!1}={})=>{return g1({methodName:"sendMessage",isSubprocess:X,ipc:Z,isConnected:$.connected}),V9({anyProcess:$,channel:J,methodName:"sendMessage",isSubprocess:X,message:q,strict:Y})},V9=async({anyProcess:$,channel:J,methodName:X,isSubprocess:Z,message:q,strict:Y})=>{let Q=K7({anyProcess:$,channel:J,isSubprocess:Z,message:q,strict:Y}),G=L7($,Q,Y);try{await h2({anyProcess:$,methodName:X,isSubprocess:Z,wrappedMessage:Q,message:q})}catch(H){throw c1($),H}finally{_7(G)}},h2=async({anyProcess:$,methodName:J,isSubprocess:X,wrappedMessage:Z,message:q})=>{let Y=L9($);try{await Promise.all([W7(Z,$,X),Y(Z)])}catch(Q){throw s8({error:Q,methodName:J,isSubprocess:X}),e8({error:Q,methodName:J,isSubprocess:X,message:q}),Q}},L9=($)=>{if(E2.has($))return E2.get($);let J=W9($.send.bind($));return E2.set($,J),J},E2=new WeakMap;var T7=($,J)=>{return j2("cancelSignal",!1,$.connected),h2({anyProcess:$,methodName:"cancelSignal",isSubprocess:!1,wrappedMessage:{type:F7,message:J},message:J})},P7=async({anyProcess:$,channel:J,isSubprocess:X,ipc:Z})=>{return await R9({anyProcess:$,channel:J,isSubprocess:X,ipc:Z}),A2.signal},R9=async({anyProcess:$,channel:J,isSubprocess:X,ipc:Z})=>{if(R7)return;if(R7=!0,!Z){r8();return}if(J===null){O2();return}X1($,J,X),await _9.yield()},R7=!1,B7=($)=>{if($?.type!==F7)return!1;return A2.abort($.message),!0},F7="execa:ipc:cancel",O2=()=>{A2.abort(a8())},A2=new AbortController;var M7=({gracefulCancel:$,cancelSignal:J,ipc:X,serialization:Z})=>{if(!$)return;if(J===void 0)throw Error("The `cancelSignal` option must be defined when setting the `gracefulCancel` option.");if(!X)throw Error("The `ipc` option cannot be false when setting the `gracefulCancel` option.");if(Z==="json")throw Error("The `serialization` option cannot be 'json' when setting the `gracefulCancel` option.")},C7=({subprocess:$,cancelSignal:J,gracefulCancel:X,forceKillAfterDelay:Z,context:q,controller:Y})=>X?[T9({subprocess:$,cancelSignal:J,forceKillAfterDelay:Z,context:q,controller:Y})]:[],T9=async({subprocess:$,cancelSignal:J,forceKillAfterDelay:X,context:Z,controller:{signal:q}})=>{await l$(J,q);let Y=P9(J);throw await T7($,Y),x2({kill:$.kill,forceKillAfterDelay:X,context:Z,controllerSignal:q}),Z.terminationReason??="gracefulCancel",J.reason},P9=({reason:$})=>{if(!($ instanceof DOMException))return $;let J=Error($.message);return Object.defineProperty(J,"stack",{value:$.stack,enumerable:!1,configurable:!0,writable:!0}),J};import{setTimeout as F9}from"node:timers/promises";var x7=({timeout:$})=>{if($!==void 0&&(!Number.isFinite($)||$<0))throw TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${$}\` (${typeof $})`)},j7=($,J,X,Z)=>J===0||J===void 0?[]:[M9($,J,X,Z)],M9=async($,J,X,{signal:Z})=>{throw await F9(J,void 0,{signal:Z}),X.terminationReason??="timeout",$.kill(),new y0};import{execPath as C9,execArgv as x9}from"node:process";import I7 from"node:path";var w7=({options:$})=>{if($.node===!1)throw TypeError('The "node" option cannot be false with `execaNode()`.');return{options:{...$,node:!0}}},O7=($,J,{node:X=!1,nodePath:Z=C9,nodeOptions:q=x9.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=f1(Z,'The "nodePath" option'),B=I7.resolve(Y,H),U={...G,nodePath:B,node:X,cwd:Y};if(!X)return[$,J,U];if(I7.basename($,".exe")==="node")throw TypeError('When the "node" option is true, the first argument does not need to be "node".');return[B,[...q,$,...J],{ipc:!0,...U,shell:!1}]};import{serialize as j9}from"node:v8";var E7=({ipcInput:$,ipc:J,serialization:X})=>{if($===void 0)return;if(!J)throw Error("The `ipcInput` option cannot be set unless the `ipc` option is `true`.");O9[X]($)},I9=($)=>{try{j9($)}catch(J){throw Error("The `ipcInput` option is not serializable with a structured clone.",{cause:J})}},w9=($)=>{try{JSON.stringify($)}catch(J){throw Error("The `ipcInput` option is not serializable with JSON.",{cause:J})}},O9={advanced:I9,json:w9},h7=async($,J)=>{if(J===void 0)return;await $.sendMessage(J)};var N7=({encoding:$})=>{if(N2.has($))return;let J=h9($);if(J!==void 0)throw TypeError(`Invalid option \`encoding: ${Q4($)}\`.
26
+ Please rename it to ${Q4(J)}.`);let X=[...N2].map((Z)=>Q4(Z)).join(", ");throw TypeError(`Invalid option \`encoding: ${Q4($)}\`.
27
+ Please rename it to one of: ${X}.`)},E9=new Set(["utf8","utf16le"]),P0=new Set(["buffer","hex","base64","base64url","latin1","ascii"]),N2=new Set([...E9,...P0]),h9=($)=>{if($===null)return"buffer";if(typeof $!=="string")return;let J=$.toLowerCase();if(J in A7)return A7[J];if(N2.has(J))return J},A7={"utf-8":"utf8","utf-16le":"utf16le","ucs-2":"utf16le",ucs2:"utf16le",binary:"latin1"},Q4=($)=>typeof $==="string"?`"${$}"`:String($);import{statSync as A9}from"node:fs";import N9 from"node:path";import D9 from"node:process";var D7=($=S7())=>{let J=f1($,'The "cwd" option');return N9.resolve(J)},S7=()=>{try{return D9.cwd()}catch($){throw $.message=`The current directory does not exist.
28
+ ${$.message}`,$}},f7=($,J)=>{if(J===S7())return $;let X;try{X=A9(J)}catch(Z){return`The "cwd" option is invalid: ${J}.
29
+ ${Z.message}
30
+ ${$}`}if(!X.isDirectory())return`The "cwd" option is not a directory: ${J}.
31
+ ${$}`;return $};var q4=($,J,X)=>{X.cwd=D7(X.cwd);let[Z,q,Y]=O7($,J,X),{command:Q,args:G,options:H}=k7.default._parse(Z,q,Y),B=C6(H),U=f9(B);if(x7(U),N7(U),E7(U),d8(U),M7(U),U.shell=X2(U.shell),U.env=v9(U),U.killSignal=g8(U.killSignal),U.forceKillAfterDelay=m8(U.forceKillAfterDelay),U.lines=U.lines.map((K,W)=>K&&!P0.has(U.encoding)&&U.buffer[W]),v7.platform==="win32"&&S9.basename(Q,".exe")==="cmd")G.unshift("/q");return{file:Q,commandArguments:G,options:U}},f9=({extendEnv:$=!0,preferLocal:J=!1,cwd:X,localDir:Z=X,encoding:q="utf8",reject:Y=!0,cleanup:Q=!0,all:G=!1,windowsHide:H=!0,killSignal:B="SIGTERM",forceKillAfterDelay:U=!0,gracefulCancel:K=!1,ipcInput:W,ipc:P=W!==void 0||K,serialization:R="advanced",...L})=>({...L,extendEnv:$,preferLocal:J,cwd:X,localDirectory:Z,encoding:q,reject:Y,cleanup:Q,all:G,windowsHide:H,killSignal:B,forceKillAfterDelay:U,gracefulCancel:K,ipcInput:W,ipc:P,serialization:R}),v9=({env:$,extendEnv:J,preferLocal:X,node:Z,localDirectory:q,nodePath:Y})=>{let Q=J?{...v7.env,...$}:$;if(X||Z)return h8({env:Q,cwd:q,execPath:Y,preferLocal:X,addExecPath:Z});return Q};var Y4=($,J,X)=>X.shell&&J.length>0?[[$,...J].join(" "),[],X]:[$,J,X];import{inspect as LY}from"node:util";function m1($){if(typeof $==="string")return k9($);if(!(ArrayBuffer.isView($)&&$.BYTES_PER_ELEMENT===1))throw Error("Input must be a string or a Uint8Array");return b9($)}var k9=($)=>$.at(-1)===b7?$.slice(0,$.at(-2)===y7?-2:-1):$,b9=($)=>$.at(-1)===y9?$.subarray(0,$.at(-2)===g9?-2:-1):$,b7=`
32
+ `,y9=b7.codePointAt(0),y7="\r",g9=y7.codePointAt(0);import{on as KY}from"node:events";import{finished as UY}from"node:stream/promises";function f0($,{checkOpen:J=!0}={}){return $!==null&&typeof $==="object"&&($.writable||$.readable||!J||$.writable===void 0&&$.readable===void 0)&&typeof $.pipe==="function"}function D2($,{checkOpen:J=!0}={}){return f0($,{checkOpen:J})&&($.writable||!J)&&typeof $.write==="function"&&typeof $.end==="function"&&typeof $.writable==="boolean"&&typeof $.writableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function L1($,{checkOpen:J=!0}={}){return f0($,{checkOpen:J})&&($.readable||!J)&&typeof $.read==="function"&&typeof $.readable==="boolean"&&typeof $.readableObjectMode==="boolean"&&typeof $.destroy==="function"&&typeof $.destroyed==="boolean"}function S2($,J){return D2($,J)&&L1($,J)}var c9=Object.getPrototypeOf(Object.getPrototypeOf(async function*(){}).prototype);class g7{#J;#X;#$=!1;#Z=void 0;constructor($,J){this.#J=$,this.#X=J}next(){let $=()=>this.#q();return this.#Z=this.#Z?this.#Z.then($,$):$(),this.#Z}return($){let J=()=>this.#Q($);return this.#Z?this.#Z.then(J,J):J()}async#q(){if(this.#$)return{done:!0,value:void 0};let $;try{$=await this.#J.read()}catch(J){throw this.#Z=void 0,this.#$=!0,this.#J.releaseLock(),J}return $.done&&(this.#Z=void 0,this.#$=!0,this.#J.releaseLock()),$}async#Q($){if(this.#$)return{done:!0,value:$};if(this.#$=!0,!this.#X){let J=this.#J.cancel($);return this.#J.releaseLock(),await J,{done:!0,value:$}}return this.#J.releaseLock(),{done:!0,value:$}}}var f2=Symbol();function c7(){return this[f2].next()}Object.defineProperty(c7,"name",{value:"next"});function u7($){return this[f2].return($)}Object.defineProperty(u7,"name",{value:"return"});var u9=Object.create(c9,{next:{enumerable:!0,configurable:!0,writable:!0,value:c7},return:{enumerable:!0,configurable:!0,writable:!0,value:u7}});function v2({preventCancel:$=!1}={}){let J=this.getReader(),X=new g7(J,$),Z=Object.create(u9);return Z[f2]=X,Z}var m7=($)=>{if(L1($,{checkOpen:!1})&&z$.on!==void 0)return p9($);if(typeof $?.[Symbol.asyncIterator]==="function")return $;if(m9.call($)==="[object ReadableStream]")return v2.call($);throw TypeError("The first argument must be a Readable, a ReadableStream, or an async iterable.")},{toString:m9}=Object.prototype,p9=async function*($){let J=new AbortController,X={};d9($,J,X);try{for await(let[Z]of z$.on($,"data",{signal:J.signal}))yield Z}catch(Z){if(X.error!==void 0)throw X.error;else if(!J.signal.aborted)throw Z}finally{$.destroy()}},d9=async($,J,X)=>{try{await z$.finished($,{cleanup:!0,readable:!0,writable:!1,error:!1})}catch(Z){X.error=Z}finally{J.abort()}},z$={};var p1=async($,{init:J,convertChunk:X,getSize:Z,truncateChunk:q,addChunk:Y,getFinalChunk:Q,finalize:G},{maxBuffer:H=Number.POSITIVE_INFINITY}={})=>{let B=m7($),U=J();U.length=0;try{for await(let K of B){let W=n9(K),P=X[W](K,U);l7({convertedChunk:P,state:U,getSize:Z,truncateChunk:q,addChunk:Y,maxBuffer:H})}return l9({state:U,convertChunk:X,getSize:Z,truncateChunk:q,addChunk:Y,getFinalChunk:Q,maxBuffer:H}),G(U)}catch(K){let W=typeof K==="object"&&K!==null?K:Error(K);throw W.bufferedData=G(U),W}},l9=({state:$,getSize:J,truncateChunk:X,addChunk:Z,getFinalChunk:q,maxBuffer:Y})=>{let Q=q($);if(Q!==void 0)l7({convertedChunk:Q,state:$,getSize:J,truncateChunk:X,addChunk:Z,maxBuffer:Y})},l7=({convertedChunk:$,state:J,getSize:X,truncateChunk:Z,addChunk:q,maxBuffer:Y})=>{let Q=X($),G=J.length+Q;if(G<=Y){p7($,J,q,G);return}let H=Z($,Y-J.length);if(H!==void 0)p7(H,J,q,Y);throw new o0},p7=($,J,X,Z)=>{J.contents=X($,J,Z),J.length=Z},n9=($)=>{let J=typeof $;if(J==="string")return"string";if(J!=="object"||$===null)return"others";if(globalThis.Buffer?.isBuffer($))return"buffer";let X=d7.call($);if(X==="[object ArrayBuffer]")return"arrayBuffer";if(X==="[object DataView]")return"dataView";if(Number.isInteger($.byteLength)&&Number.isInteger($.byteOffset)&&d7.call($.buffer)==="[object ArrayBuffer]")return"typedArray";return"others"},{toString:d7}=Object.prototype;class o0 extends Error{name="MaxBufferError";constructor(){super("maxBuffer exceeded")}}var a0=($)=>$,B$=()=>{return},G4=({contents:$})=>$,H4=($)=>{throw Error(`Streams in object mode are not supported: ${String($)}`)},z4=($)=>$.length;async function B4($,J){return p1($,a9,J)}var i9=()=>({contents:[]}),t9=()=>1,o9=($,{contents:J})=>{return J.push($),J},a9={init:i9,convertChunk:{string:a0,buffer:a0,arrayBuffer:a0,dataView:a0,typedArray:a0,others:a0},getSize:t9,truncateChunk:B$,addChunk:o9,getFinalChunk:B$,finalize:G4};async function K4($,J){return p1($,qY,J)}var r9=()=>({contents:new ArrayBuffer(0)}),s9=($)=>e9.encode($),e9=new TextEncoder,n7=($)=>new Uint8Array($),i7=($)=>new Uint8Array($.buffer,$.byteOffset,$.byteLength),$Y=($,J)=>$.slice(0,J),JY=($,{contents:J,length:X},Z)=>{let q=a7()?ZY(J,Z):XY(J,Z);return new Uint8Array(q).set($,X),q},XY=($,J)=>{if(J<=$.byteLength)return $;let X=new ArrayBuffer(o7(J));return new Uint8Array(X).set(new Uint8Array($),0),X},ZY=($,J)=>{if(J<=$.maxByteLength)return $.resize(J),$;let X=new ArrayBuffer(J,{maxByteLength:o7(J)});return new Uint8Array(X).set(new Uint8Array($),0),X},o7=($)=>t7**Math.ceil(Math.log($)/Math.log(t7)),t7=2,QY=({contents:$,length:J})=>a7()?$:$.slice(0,J),a7=()=>("resize"in ArrayBuffer.prototype),qY={init:r9,convertChunk:{string:s9,buffer:n7,arrayBuffer:n7,dataView:i7,typedArray:i7,others:H4},getSize:z4,truncateChunk:$Y,addChunk:JY,getFinalChunk:B$,finalize:QY};async function W4($,J){return p1($,BY,J)}var YY=()=>({contents:"",textDecoder:new TextDecoder}),U4=($,{textDecoder:J})=>J.decode($,{stream:!0}),GY=($,{contents:J})=>J+$,HY=($,J)=>$.slice(0,J),zY=({textDecoder:$})=>{let J=$.decode();return J===""?void 0:J},BY={init:YY,convertChunk:{string:a0,buffer:U4,arrayBuffer:U4,dataView:U4,typedArray:U4,others:H4},getSize:z4,truncateChunk:HY,addChunk:GY,getFinalChunk:zY,finalize:G4};Object.assign(z$,{on:KY,finished:UY});var r7=({error:$,stream:J,readableObjectMode:X,lines:Z,encoding:q,fdNumber:Y})=>{if(!($ instanceof o0))throw $;if(Y==="all")return $;let Q=WY(X,Z,q);throw $.maxBufferInfo={fdNumber:Y,unit:Q},J.destroy(),$},WY=($,J,X)=>{if($)return"objects";if(J)return"lines";if(X==="buffer")return"bytes";return"characters"},s7=($,J,X)=>{if(J.length!==X)return;let Z=new o0;throw Z.maxBufferInfo={fdNumber:"ipc"},Z},e7=($,J)=>{let{streamName:X,threshold:Z,unit:q}=VY($,J);return`Command's ${X} was larger than ${Z} ${q}`},VY=($,J)=>{if($?.maxBufferInfo===void 0)return{streamName:"output",threshold:J[1],unit:"bytes"};let{maxBufferInfo:{fdNumber:X,unit:Z}}=$;delete $.maxBufferInfo;let q=t0(J,X);if(X==="ipc")return{streamName:"IPC output",threshold:q,unit:"messages"};return{streamName:E$(X),threshold:q,unit:Z}},$5=($,J,X)=>$?.code==="ENOBUFS"&&J!==null&&J.some((Z)=>Z!==null&&Z.length>V4(X)),J5=($,J,X)=>{if(!J)return $;let Z=V4(X);return $.length>Z?$.slice(0,Z):$},V4=([,$])=>$;var Z5=({stdio:$,all:J,ipcOutput:X,originalError:Z,signal:q,signalDescription:Y,exitCode:Q,escapedCommand:G,timedOut:H,isCanceled:B,isGracefullyCanceled:U,isMaxBuffer:K,isForcefullyTerminated:W,forceKillAfterDelay:P,killSignal:R,maxBuffer:L,timeout:M,cwd:C})=>{let A=Z?.code,m=_Y({originalError:Z,timedOut:H,timeout:M,isMaxBuffer:K,maxBuffer:L,errorCode:A,signal:q,signalDescription:Y,exitCode:Q,isCanceled:B,isGracefullyCanceled:U,isForcefullyTerminated:W,forceKillAfterDelay:P,killSignal:R}),j=TY(Z,C),l=j===void 0?"":`
33
+ ${j}`,n=`${m}: ${G}${l}`,t=J===void 0?[$[2],$[1]]:[J],L0=[n,...t,...$.slice(3),X.map((p)=>PY(p)).join(`
34
+ `)].map((p)=>q$(m1(FY(p)))).filter(Boolean).join(`
35
+
36
+ `);return{originalMessage:j,shortMessage:n,message:L0}},_Y=({originalError:$,timedOut:J,timeout:X,isMaxBuffer:Z,maxBuffer:q,errorCode:Y,signal:Q,signalDescription:G,exitCode:H,isCanceled:B,isGracefullyCanceled:U,isForcefullyTerminated:K,forceKillAfterDelay:W,killSignal:P})=>{let R=RY(K,W);if(J)return`Command timed out after ${X} milliseconds${R}`;if(U){if(Q===void 0)return`Command was gracefully canceled with exit code ${H}`;return K?`Command was gracefully canceled${R}`:`Command was gracefully canceled with ${Q} (${G})`}if(B)return`Command was canceled${R}`;if(Z)return`${e7($,q)}${R}`;if(Y!==void 0)return`Command failed with ${Y}${R}`;if(K)return`Command was killed with ${P} (${d$(P)})${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"},RY=($,J)=>$?` and was forcefully terminated after ${J} milliseconds`:"",TY=($,J)=>{if($ instanceof y0)return;let X=D8($)?$.originalMessage:String($?.message??$),Z=q$(f7(X,J));return Z===""?void 0:Z},PY=($)=>typeof $==="string"?$:LY($),FY=($)=>Array.isArray($)?$.map((J)=>m1(X5(J))).filter(Boolean).join(`
37
+ `):X5($),X5=($)=>{if(typeof $==="string")return $;if(z0($))return w$($);return""};var L4=({command:$,escapedCommand:J,stdio:X,all:Z,ipcOutput:q,options:{cwd:Y},startTime:Q})=>Q5({command:$,escapedCommand:J,cwd:Y,durationMs:B2(Q),failed:!1,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isTerminated:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,exitCode:0,stdout:X[1],stderr:X[2],all:Z,stdio:X,ipcOutput:q,pipedFrom:[]}),d1=({error:$,command:J,escapedCommand:X,fileDescriptors:Z,options:q,startTime:Y,isSync:Q})=>K$({error:$,command:J,escapedCommand:X,startTime:Y,timedOut:!1,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:!1,isForcefullyTerminated:!1,stdio:Array.from({length:Z.length}),ipcOutput:[],options:q,isSync:Q}),K$=({error:$,command:J,escapedCommand:X,startTime:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:U,stdio:K,all:W,ipcOutput:P,options:{timeoutDuration:R,timeout:L=R,forceKillAfterDelay:M,killSignal:C,cwd:A,maxBuffer:m},isSync:j})=>{let{exitCode:l,signal:n,signalDescription:t}=CY(B,U),{originalMessage:L0,shortMessage:p,message:l0}=Z5({stdio:K,all:W,ipcOutput:P,originalError:$,signal:n,signalDescription:t,exitCode:l,escapedCommand:X,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,forceKillAfterDelay:M,killSignal:C,maxBuffer:m,timeout:L,cwd:A}),O=A8($,l0,j);return Object.assign(O,MY({error:O,command:J,escapedCommand:X,startTime:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:l,signal:n,signalDescription:t,stdio:K,all:W,ipcOutput:P,cwd:A,originalMessage:L0,shortMessage:p})),O},MY=({error:$,command:J,escapedCommand:X,startTime:Z,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:U,signalDescription:K,stdio:W,all:P,ipcOutput:R,cwd:L,originalMessage:M,shortMessage:C})=>Q5({shortMessage:C,originalMessage:M,command:J,escapedCommand:X,cwd:L,durationMs:B2(Z),failed:!0,timedOut:q,isCanceled:Y,isGracefullyCanceled:Q,isTerminated:U!==void 0,isMaxBuffer:G,isForcefullyTerminated:H,exitCode:B,signal:U,signalDescription:K,code:$.cause?.code,stdout:W[1],stderr:W[2],all:P,stdio:W,ipcOutput:R,pipedFrom:[]}),Q5=($)=>Object.fromEntries(Object.entries($).filter(([,J])=>J!==void 0)),CY=($,J)=>{let X=$===null?void 0:$,Z=J===null?void 0:J,q=Z===void 0?void 0:d$(J);return{exitCode:X,signal:Z,signalDescription:q}};var q5=($)=>Number.isFinite($)?$:0;function xY($){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(q5($*1000)%1000),nanoseconds:Math.trunc(q5($*1e6)%1000)}}function jY($){return{days:$/86400000n,hours:$/3600000n%24n,minutes:$/60000n%60n,seconds:$/1000n%60n,milliseconds:$%1000n,microseconds:0n,nanoseconds:0n}}function k2($){switch(typeof $){case"number":{if(Number.isFinite($))return xY($);break}case"bigint":return jY($)}throw TypeError("Expected a finite number or bigint")}var IY=($)=>$===0||$===0n,wY=($,J)=>J===1||J===1n?$:`${$}s`,OY=0.0000001,EY=24n*60n*60n*1000n;function b2($,J){let X=typeof $==="bigint";if(!X&&!Number.isFinite($))throw TypeError("Expected a finite number or bigint");J={...J};let Z=$<0?"-":"";if($=$<0?-$:$,J.colonNotation)J.compact=!1,J.formatSubMilliseconds=!1,J.separateMilliseconds=!1,J.verbose=!1;if(J.compact)J.unitCount=1,J.secondsDecimalDigits=0,J.millisecondsDecimalDigits=0;let q=[],Y=(U,K)=>{let W=Math.floor(U*10**K+OY);return(Math.round(W)/10**K).toFixed(K)},Q=(U,K,W,P)=>{if((q.length===0||!J.colonNotation)&&IY(U)&&!(J.colonNotation&&W==="m"))return;if(P??=String(U),J.colonNotation){let R=P.includes(".")?P.split(".")[0].length:P.length,L=q.length>0?2:1;P="0".repeat(Math.max(0,L-R))+P}else P+=J.verbose?" "+wY(K,U):W;q.push(P)},G=k2($),H=BigInt(G.days);if(J.hideYearAndDays)Q(BigInt(H)*24n+BigInt(G.hours),"hour","h");else{if(J.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"),!J.hideSeconds)if(J.separateMilliseconds||J.formatSubMilliseconds||!J.colonNotation&&$<1000&&!J.subSecondsAsDecimals){let U=Number(G.seconds),K=Number(G.milliseconds),W=Number(G.microseconds),P=Number(G.nanoseconds);if(Q(U,"second","s"),J.formatSubMilliseconds)Q(K,"millisecond","ms"),Q(W,"microsecond","µs"),Q(P,"nanosecond","ns");else{let R=K+W/1000+P/1e6,L=typeof J.millisecondsDecimalDigits==="number"?J.millisecondsDecimalDigits:0,M=R>=1?Math.round(R):Math.ceil(R),C=L?R.toFixed(L):M;Q(Number.parseFloat(C),"millisecond","ms",C)}}else{let U=(X?Number($%EY):$)/1000%60,K=typeof J.secondsDecimalDigits==="number"?J.secondsDecimalDigits:1,W=Y(U,K),P=J.keepDecimalsOnWholeSeconds?W:W.replace(/\.0+$/,"");Q(Number.parseFloat(P),"second","s",P)}if(q.length===0)return Z+"0"+(J.verbose?" milliseconds":"ms");let B=J.colonNotation?":":" ";if(typeof J.unitCount==="number")q=q.slice(0,Math.max(J.unitCount,1));return Z+q.join(B)}var Y5=($,J)=>{if($.failed)b0({type:"error",verboseMessage:$.shortMessage,verboseInfo:J,result:$})};var G5=($,J)=>{if(!v1(J))return;Y5($,J),hY($,J)},hY=($,J)=>{let X=`(done in ${b2($.durationMs)})`;b0({type:"duration",verboseMessage:X,verboseInfo:J,result:$})};var l1=($,J,{reject:X})=>{if(G5($,J),$.failed&&X)throw $;return $};import{readFileSync as f5}from"node:fs";var B5=($,J)=>{if(_1($))return"asyncGenerator";if(W5($))return"generator";if(_4($))return"fileUrl";if(fY($))return"filePath";if(bY($))return"webStream";if(f0($,{checkOpen:!1}))return"native";if(z0($))return"uint8Array";if(yY($))return"asyncIterable";if(gY($))return"iterable";if(c2($))return K5({transform:$},J);if(SY($))return AY($,J);return"native"},AY=($,J)=>{if(S2($.transform,{checkOpen:!1}))return NY($,J);if(c2($.transform))return K5($,J);return DY($,J)},NY=($,J)=>{return U5($,J,"Duplex stream"),"duplex"},K5=($,J)=>{return U5($,J,"web TransformStream"),"webTransform"},U5=({final:$,binary:J,objectMode:X},Z,q)=>{H5($,`${Z}.final`,q),H5(J,`${Z}.binary`,q),y2(X,`${Z}.objectMode`)},H5=($,J,X)=>{if($!==void 0)throw TypeError(`The \`${J}\` option can only be defined when using a generator, not a ${X}.`)},DY=({transform:$,final:J,binary:X,objectMode:Z},q)=>{if($!==void 0&&!z5($))throw TypeError(`The \`${q}.transform\` option must be a generator, a Duplex stream or a web TransformStream.`);if(S2(J,{checkOpen:!1}))throw TypeError(`The \`${q}.final\` option must not be a Duplex stream.`);if(c2(J))throw TypeError(`The \`${q}.final\` option must not be a web TransformStream.`);if(J!==void 0&&!z5(J))throw TypeError(`The \`${q}.final\` option must be a generator.`);return y2(X,`${q}.binary`),y2(Z,`${q}.objectMode`),_1($)||_1(J)?"asyncGenerator":"generator"},y2=($,J)=>{if($!==void 0&&typeof $!=="boolean")throw TypeError(`The \`${J}\` option must use a boolean.`)},z5=($)=>_1($)||W5($),_1=($)=>Object.prototype.toString.call($)==="[object AsyncGeneratorFunction]",W5=($)=>Object.prototype.toString.call($)==="[object GeneratorFunction]",SY=($)=>X0($)&&($.transform!==void 0||$.final!==void 0),_4=($)=>Object.prototype.toString.call($)==="[object URL]",V5=($)=>_4($)&&$.protocol!=="file:",fY=($)=>X0($)&&Object.keys($).length>0&&Object.keys($).every((J)=>vY.has(J))&&g2($.file),vY=new Set(["file","append"]),g2=($)=>typeof $==="string",L5=($,J)=>$==="native"&&typeof J==="string"&&!kY.has(J),kY=new Set(["ipc","ignore","inherit","overlapped","pipe"]),_5=($)=>Object.prototype.toString.call($)==="[object ReadableStream]",R4=($)=>Object.prototype.toString.call($)==="[object WritableStream]",bY=($)=>_5($)||R4($),c2=($)=>_5($?.readable)&&R4($?.writable),yY=($)=>R5($)&&typeof $[Symbol.asyncIterator]==="function",gY=($)=>R5($)&&typeof $[Symbol.iterator]==="function",R5=($)=>typeof $==="object"&&$!==null,I0=new Set(["generator","asyncGenerator","duplex","webTransform"]),T4=new Set(["fileUrl","filePath","fileNumber"]),u2=new Set(["fileUrl","filePath"]),T5=new Set([...u2,"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 m2=($,J,X,Z)=>Z==="output"?cY($,J,X):uY($,J,X),cY=($,J,X)=>{let Z=J!==0&&X[J-1].value.readableObjectMode;return{writableObjectMode:Z,readableObjectMode:$??Z}},uY=($,J,X)=>{let Z=J===0?$===!0:X[J-1].value.readableObjectMode,q=J!==X.length-1&&($??Z);return{writableObjectMode:Z,readableObjectMode:q}},F5=($,J)=>{let X=$.findLast(({type:Z})=>I0.has(Z));if(X===void 0)return!1;return J==="input"?X.value.writableObjectMode:X.value.readableObjectMode};var M5=($,J,X,Z)=>[...$.filter(({type:q})=>!I0.has(q)),...mY($,J,X,Z)],mY=($,J,X,{encoding:Z})=>{let q=$.filter(({type:Q})=>I0.has(Q)),Y=Array.from({length:q.length});for(let[Q,G]of Object.entries(q))Y[Q]=pY({stdioItem:G,index:Number(Q),newTransforms:Y,optionName:J,direction:X,encoding:Z});return iY(Y,X)},pY=({stdioItem:$,stdioItem:{type:J},index:X,newTransforms:Z,optionName:q,direction:Y,encoding:Q})=>{if(J==="duplex")return dY({stdioItem:$,optionName:q});if(J==="webTransform")return lY({stdioItem:$,index:X,newTransforms:Z,direction:Y});return nY({stdioItem:$,index:X,newTransforms:Z,direction:Y,encoding:Q})},dY=({stdioItem:$,stdioItem:{value:{transform:J,transform:{writableObjectMode:X,readableObjectMode:Z},objectMode:q=Z}},optionName:Y})=>{if(q&&!Z)throw TypeError(`The \`${Y}.objectMode\` option can only be \`true\` if \`new Duplex({objectMode: true})\` is used.`);if(!q&&Z)throw TypeError(`The \`${Y}.objectMode\` option cannot be \`false\` if \`new Duplex({objectMode: true})\` is used.`);return{...$,value:{transform:J,writableObjectMode:X,readableObjectMode:Z}}},lY=({stdioItem:$,stdioItem:{value:J},index:X,newTransforms:Z,direction:q})=>{let{transform:Y,objectMode:Q}=X0(J)?J:{transform:J},{writableObjectMode:G,readableObjectMode:H}=m2(Q,X,Z,q);return{...$,value:{transform:Y,writableObjectMode:G,readableObjectMode:H}}},nY=({stdioItem:$,stdioItem:{value:J},index:X,newTransforms:Z,direction:q,encoding:Y})=>{let{transform:Q,final:G,binary:H=!1,preserveNewlines:B=!1,objectMode:U}=X0(J)?J:{transform:J},K=H||P0.has(Y),{writableObjectMode:W,readableObjectMode:P}=m2(U,X,Z,q);return{...$,value:{transform:Q,final:G,binary:K,preserveNewlines:B,writableObjectMode:W,readableObjectMode:P}}},iY=($,J)=>J==="input"?$.reverse():$;import p2 from"node:process";var C5=($,J,X)=>{let Z=$.map((q)=>tY(q,J));if(Z.includes("input")&&Z.includes("output"))throw TypeError(`The \`${X}\` option must not be an array of both readable and writable values.`);return Z.find(Boolean)??rY},tY=({type:$,value:J},X)=>oY[X]??x5[$](J),oY=["input","output","output"],n1=()=>{return},d2=()=>"input",x5={generator:n1,asyncGenerator:n1,fileUrl:n1,filePath:n1,iterable:d2,asyncIterable:d2,uint8Array:d2,webStream:($)=>R4($)?"output":"input",nodeStream($){if(!L1($,{checkOpen:!1}))return"output";return D2($,{checkOpen:!1})?void 0:"input"},webTransform:n1,duplex:n1,native($){let J=aY($);if(J!==void 0)return J;if(f0($,{checkOpen:!1}))return x5.nodeStream($)}},aY=($)=>{if([0,p2.stdin].includes($))return"input";if([1,2,p2.stdout,p2.stderr].includes($))return"output"},rY="output";var j5=($,J)=>J&&!$.includes("ipc")?[...$,"ipc"]:$;var I5=({stdio:$,ipc:J,buffer:X,...Z},q,Y)=>{let Q=sY($,Z).map((G,H)=>w5(G,H));return Y?$G(Q,X,q):j5(Q,J)},sY=($,J)=>{if($===void 0)return j0.map((Z)=>J[Z]);if(eY(J))throw Error(`It's not possible to provide \`stdio\` in combination with one of ${j0.map((Z)=>`\`${Z}\``).join(", ")}`);if(typeof $==="string")return[$,$,$];if(!Array.isArray($))throw TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof $}\``);let X=Math.max($.length,j0.length);return Array.from({length:X},(Z,q)=>$[q])},eY=($)=>j0.some((J)=>$[J]!==void 0),w5=($,J)=>{if(Array.isArray($))return $.map((X)=>w5(X,J));if($===null||$===void 0)return J>=j0.length?"ignore":"pipe";return $},$G=($,J,X)=>$.map((Z,q)=>!J[q]&&q!==0&&!k1(X,q)&&JG(Z)?"ignore":Z),JG=($)=>$==="pipe"||Array.isArray($)&&$.every((J)=>J==="pipe");import{readFileSync as XG}from"node:fs";import ZG from"node:tty";var E5=({stdioItem:$,stdioItem:{type:J},isStdioArray:X,fdNumber:Z,direction:q,isSync:Y})=>{if(!X||J!=="native")return $;return Y?QG({stdioItem:$,fdNumber:Z,direction:q}):GG({stdioItem:$,fdNumber:Z})},QG=({stdioItem:$,stdioItem:{value:J,optionName:X},fdNumber:Z,direction:q})=>{let Y=qG({value:J,optionName:X,fdNumber:Z,direction:q});if(Y!==void 0)return Y;if(f0(J,{checkOpen:!1}))throw TypeError(`The \`${X}: Stream\` option cannot both be an array and include a stream with synchronous methods.`);return $},qG=({value:$,optionName:J,fdNumber:X,direction:Z})=>{let q=YG($,X);if(q===void 0)return;if(Z==="output")return{type:"fileNumber",value:q,optionName:J};if(ZG.isatty(q))throw TypeError(`The \`${J}: ${i$($)}\` option is invalid: it cannot be a TTY with synchronous methods.`);return{type:"uint8Array",value:i0(XG(q)),optionName:J}},YG=($,J)=>{if($==="inherit")return J;if(typeof $==="number")return $;let X=O$.indexOf($);if(X!==-1)return X},GG=({stdioItem:$,stdioItem:{value:J,optionName:X},fdNumber:Z})=>{if(J==="inherit")return{type:"nodeStream",value:O5(Z,J,X),optionName:X};if(typeof J==="number")return{type:"nodeStream",value:O5(J,J,X),optionName:X};if(f0(J,{checkOpen:!1}))return{type:"nodeStream",value:J,optionName:X};return $},O5=($,J,X)=>{let Z=O$[$];if(Z===void 0)throw TypeError(`The \`${X}: ${J}\` option is invalid: no such standard stream.`);return Z};var h5=({input:$,inputFile:J},X)=>X===0?[...HG($),...BG(J)]:[],HG=($)=>$===void 0?[]:[{type:zG($),value:$,optionName:"input"}],zG=($)=>{if(L1($,{checkOpen:!1}))return"nodeStream";if(typeof $==="string")return"string";if(z0($))return"uint8Array";throw Error("The `input` option must be a string, a Uint8Array or a Node.js Readable stream.")},BG=($)=>$===void 0?[]:[{...KG($),optionName:"inputFile"}],KG=($)=>{if(_4($))return{type:"fileUrl",value:$};if(g2($))return{type:"filePath",value:{file:$}};throw Error("The `inputFile` option must be a file path string or a file URL.")};var A5=($)=>$.filter((J,X)=>$.every((Z,q)=>J.value!==Z.value||X>=q||J.type==="generator"||J.type==="asyncGenerator")),N5=({stdioItem:{type:$,value:J,optionName:X},direction:Z,fileDescriptors:q,isSync:Y})=>{let Q=UG(q,$);if(Q.length===0)return;if(Y){WG({otherStdioItems:Q,type:$,value:J,optionName:X,direction:Z});return}if(T5.has($))return D5({otherStdioItems:Q,type:$,value:J,optionName:X,direction:Z});if(P5.has($))LG({otherStdioItems:Q,type:$,value:J,optionName:X})},UG=($,J)=>$.flatMap(({direction:X,stdioItems:Z})=>Z.filter((q)=>q.type===J).map((q)=>({...q,direction:X}))),WG=({otherStdioItems:$,type:J,value:X,optionName:Z,direction:q})=>{if(u2.has(J))D5({otherStdioItems:$,type:J,value:X,optionName:Z,direction:q})},D5=({otherStdioItems:$,type:J,value:X,optionName:Z,direction:q})=>{let Y=$.filter((G)=>VG(G,X));if(Y.length===0)return;let Q=Y.find((G)=>G.direction!==q);return S5(Q,Z,J),q==="output"?Y[0].stream:void 0},VG=({type:$,value:J},X)=>{if($==="filePath")return J.file===X.file;if($==="fileUrl")return J.href===X.href;return J===X},LG=({otherStdioItems:$,type:J,value:X,optionName:Z})=>{let q=$.find(({value:{transform:Y}})=>Y===X.transform);S5(q,Z,J)},S5=($,J,X)=>{if($!==void 0)throw TypeError(`The \`${$.optionName}\` and \`${J}\` options must not target ${Z1[X]} that is the same.`)};var P4=($,J,X,Z)=>{let Y=I5(J,X,Z).map((G,H)=>_G({stdioOption:G,fdNumber:H,options:J,isSync:Z})),Q=jG({initialFileDescriptors:Y,addProperties:$,options:J,isSync:Z});return J.stdio=Q.map(({stdioItems:G})=>OG(G)),Q},_G=({stdioOption:$,fdNumber:J,options:X,isSync:Z})=>{let q=E$(J),{stdioItems:Y,isStdioArray:Q}=RG({stdioOption:$,fdNumber:J,options:X,optionName:q}),G=C5(Y,J,q),H=Y.map((K)=>E5({stdioItem:K,isStdioArray:Q,fdNumber:J,direction:G,isSync:Z})),B=M5(H,q,G,X),U=F5(B,G);return xG(B,U),{direction:G,objectMode:U,stdioItems:B}},RG=({stdioOption:$,fdNumber:J,options:X,optionName:Z})=>{let Y=[...(Array.isArray($)?$:[$]).map((H)=>TG(H,Z)),...h5(X,J)],Q=A5(Y),G=Q.length>1;return PG(Q,G,Z),MG(Q),{stdioItems:Q,isStdioArray:G}},TG=($,J)=>({type:B5($,J),value:$,optionName:J}),PG=($,J,X)=>{if($.length===0)throw TypeError(`The \`${X}\` option must not be an empty array.`);if(!J)return;for(let{value:Z,optionName:q}of $)if(FG.has(Z))throw Error(`The \`${q}\` option must not include \`${Z}\`.`)},FG=new Set(["ignore","ipc"]),MG=($)=>{for(let J of $)CG(J)},CG=({type:$,value:J,optionName:X})=>{if(V5(J))throw TypeError(`The \`${X}: URL\` option must use the \`file:\` scheme.
38
+ For example, you can use the \`pathToFileURL()\` method of the \`url\` core module.`);if(L5($,J))throw TypeError(`The \`${X}: { file: '...' }\` option must be used instead of \`${X}: '...'\`.`)},xG=($,J)=>{if(!J)return;let X=$.find(({type:Z})=>T4.has(Z));if(X!==void 0)throw TypeError(`The \`${X.optionName}\` option cannot use both files and transforms in objectMode.`)},jG=({initialFileDescriptors:$,addProperties:J,options:X,isSync:Z})=>{let q=[];try{for(let Y of $)q.push(IG({fileDescriptor:Y,fileDescriptors:q,addProperties:J,options:X,isSync:Z}));return q}catch(Y){throw l2(q),Y}},IG=({fileDescriptor:{direction:$,objectMode:J,stdioItems:X},fileDescriptors:Z,addProperties:q,options:Y,isSync:Q})=>{let G=X.map((H)=>wG({stdioItem:H,addProperties:q,direction:$,options:Y,fileDescriptors:Z,isSync:Q}));return{direction:$,objectMode:J,stdioItems:G}},wG=({stdioItem:$,addProperties:J,direction:X,options:Z,fileDescriptors:q,isSync:Y})=>{let Q=N5({stdioItem:$,direction:X,fileDescriptors:q,isSync:Y});if(Q!==void 0)return{...$,stream:Q};return{...$,...J[X][$.type]($,Z)}},l2=($)=>{for(let{stdioItems:J}of $)for(let{stream:X}of J)if(X!==void 0&&!D0(X))X.destroy()},OG=($)=>{if($.length>1)return $.some(({value:Z})=>Z==="overlapped")?"overlapped":"pipe";let[{type:J,value:X}]=$;return J==="native"?X:"pipe"};var k5=($,J)=>P4(hG,$,J,!0),u0=({type:$,optionName:J})=>{b5(J,Z1[$])},EG=({optionName:$,value:J})=>{if(J==="ipc"||J==="overlapped")b5($,`"${J}"`);return{}},b5=($,J)=>{throw TypeError(`The \`${$}\` option cannot be ${J} with synchronous methods.`)},v5={generator(){},asyncGenerator:u0,webStream:u0,nodeStream:u0,webTransform:u0,duplex:u0,asyncIterable:u0,native:EG},hG={input:{...v5,fileUrl:({value:$})=>({contents:[i0(f5($))]}),filePath:({value:{file:$}})=>({contents:[i0(f5($))]}),fileNumber:u0,iterable:({value:$})=>({contents:[...$]}),string:({value:$})=>({contents:[$]}),uint8Array:({value:$})=>({contents:[$]})},output:{...v5,fileUrl:({value:$})=>({path:$}),filePath:({value:{file:$,append:J}})=>({path:$,append:J}),fileNumber:({value:$})=>({path:$}),iterable:u0,string:u0,uint8Array:u0}};var r0=($,{stripFinalNewline:J},X)=>n2(J,X)&&$!==void 0&&!Array.isArray($)?m1($):$,n2=($,J)=>J==="all"?$[1]||$[2]:$[J];import{Transform as aG,getDefaultHighWaterMark as t5}from"node:stream";var F4=($,J,X,Z)=>$||X?void 0:g5(J,Z),t2=($,J,X)=>X?$.flatMap((Z)=>y5(Z,J)):y5($,J),y5=($,J)=>{let{transform:X,final:Z}=g5(J,{});return[...X($),...Z()]},g5=($,J)=>{return J.previousChunks="",{transform:AG.bind(void 0,J,$),final:DG.bind(void 0,J)}},AG=function*($,J,X){if(typeof X!=="string"){yield X;return}let{previousChunks:Z}=$,q=-1;for(let Y=0;Y<X.length;Y+=1)if(X[Y]===`
39
+ `){let Q=NG(X,Y,J,$),G=X.slice(q+1,Y+1-Q);if(Z.length>0)G=i2(Z,G),Z="";yield G,q=Y}if(q!==X.length-1)Z=i2(Z,X.slice(q+1));$.previousChunks=Z},NG=($,J,X,Z)=>{if(X)return 0;return Z.isWindowsNewline=J!==0&&$[J-1]==="\r",Z.isWindowsNewline?2:1},DG=function*({previousChunks:$}){if($.length>0)yield $},c5=({binary:$,preserveNewlines:J,readableObjectMode:X,state:Z})=>$||J||X?void 0:{transform:SG.bind(void 0,Z)},SG=function*({isWindowsNewline:$=!1},J){let{unixNewline:X,windowsNewline:Z,LF:q,concatBytes:Y}=typeof J==="string"?fG:kG;if(J.at(-1)===q){yield J;return}yield Y(J,$?Z:X)},i2=($,J)=>`${$}${J}`,fG={windowsNewline:`\r
40
+ `,unixNewline:`
41
+ `,LF:`
42
+ `,concatBytes:i2},vG=($,J)=>{let X=new Uint8Array($.length+J.length);return X.set($,0),X.set(J,$.length),X},kG={windowsNewline:new Uint8Array([13,10]),unixNewline:new Uint8Array([10]),LF:10,concatBytes:vG};import{Buffer as bG}from"node:buffer";var u5=($,J)=>$?void 0:yG.bind(void 0,J),yG=function*($,J){if(typeof J!=="string"&&!z0(J)&&!bG.isBuffer(J))throw TypeError(`The \`${$}\` option's transform must use "objectMode: true" to receive as input: ${typeof J}.`);yield J},m5=($,J)=>$?gG.bind(void 0,J):cG.bind(void 0,J),gG=function*($,J){p5($,J),yield J},cG=function*($,J){if(p5($,J),typeof J!=="string"&&!z0(J))throw TypeError(`The \`${$}\` option's function must yield a string or an Uint8Array, not ${typeof J}.`);yield J},p5=($,J)=>{if(J===null||J===void 0)throw TypeError(`The \`${$}\` option's function must not call \`yield ${J}\`.
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 uG}from"node:buffer";import{StringDecoder as mG}from"node:string_decoder";var M4=($,J,X)=>{if(X)return;if($)return{transform:pG.bind(void 0,new TextEncoder)};let Z=new mG(J);return{transform:dG.bind(void 0,Z),final:lG.bind(void 0,Z)}},pG=function*($,J){if(uG.isBuffer(J))yield i0(J);else if(typeof J==="string")yield $.encode(J);else yield J},dG=function*($,J){yield z0(J)?$.write(J):J},lG=function*($){let J=$.end();if(J!=="")yield J};import{callbackify as d5}from"node:util";var o2=d5(async($,J,X,Z)=>{J.currentIterable=$(...X);try{for await(let q of J.currentIterable)Z.push(q)}finally{delete J.currentIterable}}),C4=async function*($,J,X){if(X===J.length){yield $;return}let{transform:Z=iG}=J[X];for await(let q of Z($))yield*C4(q,J,X+1)},l5=async function*($){for(let[J,{final:X}]of Object.entries($))yield*nG(X,Number(J),$)},nG=async function*($,J,X){if($===void 0)return;for await(let Z of $())yield*C4(Z,X,J+1)},n5=d5(async({currentIterable:$},J)=>{if($!==void 0){await(J?$.throw(J):$.return());return}if(J)throw J}),iG=function*($){yield $};var a2=($,J,X,Z)=>{try{for(let q of $(...J))X.push(q);Z()}catch(q){Z(q)}},i5=($,J)=>[...J.flatMap((X)=>[...R1(X,$,0)]),...U$($)],R1=function*($,J,X){if(X===J.length){yield $;return}let{transform:Z=oG}=J[X];for(let q of Z($))yield*R1(q,J,X+1)},U$=function*($){for(let[J,{final:X}]of Object.entries($))yield*tG(X,Number(J),$)},tG=function*($,J,X){if($===void 0)return;for(let Z of $())yield*R1(Z,X,J+1)},oG=function*($){yield $};var r2=({value:$,value:{transform:J,final:X,writableObjectMode:Z,readableObjectMode:q},optionName:Y},{encoding:Q})=>{let G={},H=o5($,Q,Y),B=_1(J),U=_1(X),K=B?o2.bind(void 0,C4,G):a2.bind(void 0,R1),W=B||U?o2.bind(void 0,l5,G):a2.bind(void 0,U$),P=B||U?n5.bind(void 0,G):void 0;return{stream:new aG({writableObjectMode:Z,writableHighWaterMark:t5(Z),readableObjectMode:q,readableHighWaterMark:t5(q),transform(L,M,C){K([L,H,0],this,C)},flush(L){W([H],this,L)},destroy:P})}},x4=($,J,X,Z)=>{let q=J.filter(({type:Q})=>Q==="generator"),Y=Z?q.reverse():q;for(let{value:Q,optionName:G}of Y){let H=o5(Q,X,G);$=i5(H,$)}return $},o5=({transform:$,final:J,binary:X,writableObjectMode:Z,readableObjectMode:q,preserveNewlines:Y},Q,G)=>{let H={};return[{transform:u5(Z,G)},M4(X,Q,Z),F4(X,Y,Z,H),{transform:$,final:J},{transform:m5(q,G)},c5({binary:X,preserveNewlines:Y,readableObjectMode:q,state:H})].filter(Boolean)};var a5=($,J)=>{for(let X of rG($))sG($,X,J)},rG=($)=>new Set(Object.entries($).filter(([,{direction:J}])=>J==="input").map(([J])=>Number(J))),sG=($,J,X)=>{let{stdioItems:Z}=$[J],q=Z.filter(({contents:G})=>G!==void 0);if(q.length===0)return;if(J!==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)=>eG(G,Z));X.input=Q$(Q)},eG=($,J)=>{let X=x4($,J,"utf8",!0);return $H(X),Q$(X)},$H=($)=>{let J=$.find((X)=>typeof X!=="string"&&!z0(X));if(J!==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: ${J}.`)};import{writeFileSync as QH,appendFileSync as qH}from"node:fs";var j4=({stdioItems:$,encoding:J,verboseInfo:X,fdNumber:Z})=>Z!=="all"&&k1(X,Z)&&!P0.has(J)&&JH(Z)&&($.some(({type:q,value:Y})=>q==="native"&&XH.has(Y))||$.every(({type:q})=>I0.has(q))),JH=($)=>$===1||$===2,XH=new Set(["pipe","overlapped"]),r5=async($,J,X,Z)=>{for await(let q of $)if(!ZH(J))e5(q,X,Z)},s5=($,J,X)=>{for(let Z of $)e5(Z,J,X)},ZH=($)=>$._readableState.pipes.length>0,e5=($,J,X)=>{let Z=f$($);b0({type:"output",verboseMessage:Z,fdNumber:J,verboseInfo:X})};var $J=({fileDescriptors:$,syncResult:{output:J},options:X,isMaxBuffer:Z,verboseInfo:q})=>{if(J===null)return{output:Array.from({length:3})};let Y={},Q=new Set([]);return{output:J.map((H,B)=>YH({result:H,fileDescriptors:$,fdNumber:B,state:Y,outputFiles:Q,isMaxBuffer:Z,verboseInfo:q},X)),...Y}},YH=({result:$,fileDescriptors:J,fdNumber:X,state:Z,outputFiles:q,isMaxBuffer:Y,verboseInfo:Q},{buffer:G,encoding:H,lines:B,stripFinalNewline:U,maxBuffer:K})=>{if($===null)return;let W=J5($,Y,K),P=i0(W),{stdioItems:R,objectMode:L}=J[X],M=GH([P],R,H,Z),{serializedResult:C,finalResult:A=C}=HH({chunks:M,objectMode:L,encoding:H,lines:B,stripFinalNewline:U,fdNumber:X});zH({serializedResult:C,fdNumber:X,state:Z,verboseInfo:Q,encoding:H,stdioItems:R,objectMode:L});let m=G[X]?A:void 0;try{if(Z.error===void 0)BH(C,R,q);return m}catch(j){return Z.error=j,m}},GH=($,J,X,Z)=>{try{return x4($,J,X,!1)}catch(q){return Z.error=q,$}},HH=({chunks:$,objectMode:J,encoding:X,lines:Z,stripFinalNewline:q,fdNumber:Y})=>{if(J)return{serializedResult:$};if(X==="buffer")return{serializedResult:Q$($)};let Q=L6($,X);if(Z[Y])return{serializedResult:Q,finalResult:t2(Q,!q[Y],J)};return{serializedResult:Q}},zH=({serializedResult:$,fdNumber:J,state:X,verboseInfo:Z,encoding:q,stdioItems:Y,objectMode:Q})=>{if(!j4({stdioItems:Y,encoding:q,verboseInfo:Z,fdNumber:J}))return;let G=t2($,!1,Q);try{s5(G,J,Z)}catch(H){X.error??=H}},BH=($,J,X)=>{for(let{path:Z,append:q}of J.filter(({type:Y})=>T4.has(Y))){let Y=typeof Z==="string"?Z:Z.toString();if(q||X.has(Y))qH(Z,$);else X.add(Y),QH(Z,$)}};var JJ=([,$,J],X)=>{if(!X.all)return;if($===void 0)return J;if(J===void 0)return $;if(Array.isArray($))return Array.isArray(J)?[...$,...J]:[...$,r0(J,X,"all")];if(Array.isArray(J))return[r0($,X,"all"),...J];if(z0($)&&z0(J))return Z2([$,J]);return`${$}${J}`};import{once as s2}from"node:events";var XJ=async($,J)=>{let[X,Z]=await KH($);return J.isForcefullyTerminated??=!1,[X,Z]},KH=async($)=>{let[J,X]=await Promise.allSettled([s2($,"spawn"),s2($,"exit")]);if(J.status==="rejected")return[];return X.status==="rejected"?ZJ($):X.value},ZJ=async($)=>{try{return await s2($,"exit")}catch{return ZJ($)}},QJ=async($)=>{let[J,X]=await $;if(!UH(J,X)&&e2(J,X))throw new y0;return[J,X]},UH=($,J)=>$===void 0&&J===void 0,e2=($,J)=>$!==0||J!==null;var qJ=({error:$,status:J,signal:X,output:Z},{maxBuffer:q})=>{let Y=WH($,J,X),Q=Y?.code==="ETIMEDOUT",G=$5(Y,Z,q);return{resultError:Y,exitCode:J,signal:X,timedOut:Q,isMaxBuffer:G}},WH=($,J,X)=>{if($!==void 0)return $;return e2(J,X)?new y0:void 0};var YJ=($,J,X)=>{let{file:Z,commandArguments:q,command:Y,escapedCommand:Q,startTime:G,verboseInfo:H,options:B,fileDescriptors:U}=LH($,J,X),K=TH({file:Z,commandArguments:q,options:B,command:Y,escapedCommand:Q,verboseInfo:H,fileDescriptors:U,startTime:G});return l1(K,H,B)},LH=($,J,X)=>{let{command:Z,escapedCommand:q,startTime:Y,verboseInfo:Q}=k$($,J,X),G=_H(X),{file:H,commandArguments:B,options:U}=q4($,J,G);RH(U);let K=k5(U,Q);return{file:H,commandArguments:B,command:Z,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:K}},_H=($)=>$.node&&!$.ipc?{...$,ipc:!1}:$,RH=({ipc:$,ipcInput:J,detached:X,cancelSignal:Z})=>{if(J)I4("ipcInput");if($)I4("ipc: true");if(X)I4("detached: true");if(Z)I4("cancelSignal")},I4=($)=>{throw TypeError(`The "${$}" option cannot be used with synchronous methods.`)},TH=({file:$,commandArguments:J,options:X,command:Z,escapedCommand:q,verboseInfo:Y,fileDescriptors:Q,startTime:G})=>{let H=PH({file:$,commandArguments:J,options:X,command:Z,escapedCommand:q,fileDescriptors:Q,startTime:G});if(H.failed)return H;let{resultError:B,exitCode:U,signal:K,timedOut:W,isMaxBuffer:P}=qJ(H,X),{output:R,error:L=B}=$J({fileDescriptors:Q,syncResult:H,options:X,isMaxBuffer:P,verboseInfo:Y}),M=R.map((A,m)=>r0(A,X,m)),C=r0(JJ(R,X),X,"all");return MH({error:L,exitCode:U,signal:K,timedOut:W,isMaxBuffer:P,stdio:M,all:C,options:X,command:Z,escapedCommand:q,startTime:G})},PH=({file:$,commandArguments:J,options:X,command:Z,escapedCommand:q,fileDescriptors:Y,startTime:Q})=>{try{a5(Y,X);let G=FH(X);return VH(...Y4($,J,G))}catch(G){return d1({error:G,command:Z,escapedCommand:q,fileDescriptors:Y,options:X,startTime:Q,isSync:!0})}},FH=({encoding:$,maxBuffer:J,...X})=>({...X,encoding:"buffer",maxBuffer:V4(J)}),MH=({error:$,exitCode:J,signal:X,timedOut:Z,isMaxBuffer:q,stdio:Y,all:Q,options:G,command:H,escapedCommand:B,startTime:U})=>$===void 0?L4({command:H,escapedCommand:B,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U}):K$({error:$,command:H,escapedCommand:B,timedOut:Z,isCanceled:!1,isGracefullyCanceled:!1,isMaxBuffer:q,isForcefullyTerminated:!1,exitCode:J,signal:X,stdio:Y,all:Q,ipcOutput:[],options:G,startTime:U,isSync:!0});import{setMaxListeners as HB}from"node:events";import{spawn as zB}from"node:child_process";import KJ from"node:process";import{once as $3,on as CH}from"node:events";var GJ=({anyProcess:$,channel:J,isSubprocess:X,ipc:Z},{reference:q=!0,filter:Y}={})=>{return g1({methodName:"getOneMessage",isSubprocess:X,ipc:Z,isConnected:e$($)}),xH({anyProcess:$,channel:J,isSubprocess:X,filter:Y,reference:q})},xH=async({anyProcess:$,channel:J,isSubprocess:X,filter:Z,reference:q})=>{o$(J,q);let Y=X1($,J,X),Q=new AbortController;try{return await Promise.race([jH(Y,Z,Q),IH(Y,X,Q),wH(Y,X,Q)])}catch(G){throw c1($),G}finally{Q.abort(),a$(J,q)}},jH=async($,J,{signal:X})=>{if(J===void 0){let[Z]=await $3($,"message",{signal:X});return Z}for await(let[Z]of CH($,"message",{signal:X}))if(J(Z))return Z},IH=async($,J,{signal:X})=>{await $3($,"disconnect",{signal:X}),n8(J)},wH=async($,J,{signal:X})=>{let[Z]=await $3($,"strict:error",{signal:X});throw n$(Z,J)};import{once as zJ,on as OH}from"node:events";var BJ=({anyProcess:$,channel:J,isSubprocess:X,ipc:Z},{reference:q=!0}={})=>J3({anyProcess:$,channel:J,isSubprocess:X,ipc:Z,shouldAwait:!X,reference:q}),J3=({anyProcess:$,channel:J,isSubprocess:X,ipc:Z,shouldAwait:q,reference:Y})=>{g1({methodName:"getEachMessage",isSubprocess:X,ipc:Z,isConnected:e$($)}),o$(J,Y);let Q=X1($,J,X),G=new AbortController,H={};return EH($,Q,G),hH({ipcEmitter:Q,isSubprocess:X,controller:G,state:H}),AH({anyProcess:$,channel:J,ipcEmitter:Q,isSubprocess:X,shouldAwait:q,controller:G,state:H,reference:Y})},EH=async($,J,X)=>{try{await zJ(J,"disconnect",{signal:X.signal}),X.abort()}catch{}},hH=async({ipcEmitter:$,isSubprocess:J,controller:X,state:Z})=>{try{let[q]=await zJ($,"strict:error",{signal:X.signal});Z.error=n$(q,J),X.abort()}catch{}},AH=async function*({anyProcess:$,channel:J,ipcEmitter:X,isSubprocess:Z,shouldAwait:q,controller:Y,state:Q,reference:G}){try{for await(let[H]of OH(X,"message",{signal:Y.signal}))HJ(Q),yield H}catch{HJ(Q)}finally{if(Y.abort(),a$(J,G),!Z)c1($);if(q)await $}},HJ=({error:$})=>{if($)throw $};var UJ=($,{ipc:J})=>{Object.assign($,VJ($,!1,J))},WJ=()=>{let $=KJ,J=!0,X=KJ.channel!==void 0;return{...VJ($,!0,X),getCancelSignal:P7.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:!0,ipc:X})}},VJ=($,J,X)=>({sendMessage:Z4.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:X}),getOneMessage:GJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:X}),getEachMessage:BJ.bind(void 0,{anyProcess:$,channel:$.channel,isSubprocess:J,ipc:X})});import{ChildProcess as NH}from"node:child_process";import{PassThrough as DH,Readable as SH,Writable as fH,Duplex as vH}from"node:stream";var LJ=({error:$,command:J,escapedCommand:X,fileDescriptors:Z,options:q,startTime:Y,verboseInfo:Q})=>{l2(Z);let G=new NH;kH(G,Z),Object.assign(G,{readable:bH,writable:yH,duplex:gH});let H=d1({error:$,command:J,escapedCommand:X,fileDescriptors:Z,options:q,startTime:Y,isSync:!1}),B=cH(H,Q,q);return{subprocess:G,promise:B}},kH=($,J)=>{let X=W$(),Z=W$(),q=W$(),Y=Array.from({length:J.length-3},W$),Q=W$(),G=[X,Z,q,...Y];Object.assign($,{stdin:X,stdout:Z,stderr:q,all:Q,stdio:G})},W$=()=>{let $=new DH;return $.end(),$},bH=()=>new SH({read(){}}),yH=()=>new fH({write(){}}),gH=()=>new vH({read(){},write(){}}),cH=async($,J,X)=>l1($,J,X);import{createReadStream as _J,createWriteStream as RJ}from"node:fs";import{Buffer as uH}from"node:buffer";import{Readable as V$,Writable as mH,Duplex as pH}from"node:stream";var PJ=($,J)=>P4(dH,$,J,!1),L$=({type:$,optionName:J})=>{throw TypeError(`The \`${J}\` option cannot be ${Z1[$]}.`)},TJ={fileNumber:L$,generator:r2,asyncGenerator:r2,nodeStream:({value:$})=>({stream:$}),webTransform({value:{transform:$,writableObjectMode:J,readableObjectMode:X}}){let Z=J||X;return{stream:pH.fromWeb($,{objectMode:Z})}},duplex:({value:{transform:$}})=>({stream:$}),native(){}},dH={input:{...TJ,fileUrl:({value:$})=>({stream:_J($)}),filePath:({value:{file:$}})=>({stream:_J($)}),webStream:({value:$})=>({stream:V$.fromWeb($)}),iterable:({value:$})=>({stream:V$.from($)}),asyncIterable:({value:$})=>({stream:V$.from($)}),string:({value:$})=>({stream:V$.from($)}),uint8Array:({value:$})=>({stream:V$.from(uH.from($))})},output:{...TJ,fileUrl:({value:$})=>({stream:RJ($)}),filePath:({value:{file:$,append:J}})=>({stream:RJ($,J?{flags:"a"}:{})}),webStream:({value:$})=>({stream:mH.fromWeb($)}),iterable:L$,asyncIterable:L$,string:L$,uint8Array:L$}};import{on as lH,once as FJ}from"node:events";import{PassThrough as nH,getDefaultHighWaterMark as iH}from"node:stream";import{finished as xJ}from"node:stream/promises";function T1($){if(!Array.isArray($))throw TypeError(`Expected an array, got \`${typeof $}\`.`);for(let q of $)X3(q);let J=$.some(({readableObjectMode:q})=>q),X=tH($,J),Z=new jJ({objectMode:J,writableHighWaterMark:X,readableHighWaterMark:X});for(let q of $)Z.add(q);return Z}var tH=($,J)=>{if($.length===0)return iH(J);let X=$.filter(({readableObjectMode:Z})=>Z===J).map(({readableHighWaterMark:Z})=>Z);return Math.max(...X)};class jJ extends nH{#J=new Set([]);#X=new Set([]);#$=new Set([]);#Z;#q=Symbol("unpipe");#Q=new WeakMap;add($){if(X3($),this.#J.has($))return;this.#J.add($),this.#Z??=oH(this,this.#J,this.#q);let J=sH({passThroughStream:this,stream:$,streams:this.#J,ended:this.#X,aborted:this.#$,onFinished:this.#Z,unpipeEvent:this.#q});this.#Q.set($,J),$.pipe(this,{end:!1})}async remove($){if(X3($),!this.#J.has($))return!1;let J=this.#Q.get($);if(J===void 0)return!1;return this.#Q.delete($),$.unpipe(this),await J,!0}}var oH=async($,J,X)=>{w4($,MJ);let Z=new AbortController;try{await Promise.race([aH($,Z),rH($,J,X,Z)])}finally{Z.abort(),w4($,-MJ)}},aH=async($,{signal:J})=>{try{await xJ($,{signal:J,cleanup:!0})}catch(X){throw IJ($,X),X}},rH=async($,J,X,{signal:Z})=>{for await(let[q]of lH($,"unpipe",{signal:Z}))if(J.has(q))q.emit(X)},X3=($)=>{if(typeof $?.pipe!=="function")throw TypeError(`Expected a readable stream, got: \`${typeof $}\`.`)},sH=async({passThroughStream:$,stream:J,streams:X,ended:Z,aborted:q,onFinished:Y,unpipeEvent:Q})=>{w4($,CJ);let G=new AbortController;try{await Promise.race([eH(Y,J,G),$z({passThroughStream:$,stream:J,streams:X,ended:Z,aborted:q,controller:G}),Jz({stream:J,streams:X,ended:Z,aborted:q,unpipeEvent:Q,controller:G})])}finally{G.abort(),w4($,-CJ)}if(X.size>0&&X.size===Z.size+q.size)if(Z.size===0&&q.size>0)Z3($);else Xz($)},eH=async($,J,{signal:X})=>{try{if(await $,!X.aborted)Z3(J)}catch(Z){if(!X.aborted)IJ(J,Z)}},$z=async({passThroughStream:$,stream:J,streams:X,ended:Z,aborted:q,controller:{signal:Y}})=>{try{if(await xJ(J,{signal:Y,cleanup:!0,readable:!0,writable:!1}),X.has(J))Z.add(J)}catch(Q){if(Y.aborted||!X.has(J))return;if(wJ(Q))q.add(J);else OJ($,Q)}},Jz=async({stream:$,streams:J,ended:X,aborted:Z,unpipeEvent:q,controller:{signal:Y}})=>{if(await FJ($,q,{signal:Y}),!$.readable)return FJ(Y,"abort",{signal:Y});J.delete($),X.delete($),Z.delete($)},Xz=($)=>{if($.writable)$.end()},IJ=($,J)=>{if(wJ(J))Z3($);else OJ($,J)},wJ=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",Z3=($)=>{if($.readable||$.writable)$.destroy()},OJ=($,J)=>{if(!$.destroyed)$.once("error",Zz),$.destroy(J)},Zz=()=>{},w4=($,J)=>{let X=$.getMaxListeners();if(X!==0&&X!==Number.POSITIVE_INFINITY)$.setMaxListeners(X+J)},MJ=2,CJ=1;import{finished as EJ}from"node:stream/promises";var i1=($,J)=>{$.pipe(J),Qz($,J),qz($,J)},Qz=async($,J)=>{if(D0($)||D0(J))return;try{await EJ($,{cleanup:!0,readable:!0,writable:!1})}catch{}Q3(J)},Q3=($)=>{if($.writable)$.end()},qz=async($,J)=>{if(D0($)||D0(J))return;try{await EJ(J,{cleanup:!0,readable:!1,writable:!0})}catch{}q3($)},q3=($)=>{if($.readable)$.destroy()};var hJ=($,J,X)=>{let Z=new Map;for(let[q,{stdioItems:Y,direction:Q}]of Object.entries(J)){for(let{stream:G}of Y.filter(({type:H})=>I0.has(H)))Yz($,G,Q,q);for(let{stream:G}of Y.filter(({type:H})=>!I0.has(H)))Hz({subprocess:$,stream:G,direction:Q,fdNumber:q,pipeGroups:Z,controller:X})}for(let[q,Y]of Z.entries()){let Q=Y.length===1?Y[0]:T1(Y);i1(Q,q)}},Yz=($,J,X,Z)=>{if(X==="output")i1($.stdio[Z],J);else i1(J,$.stdio[Z]);let q=Gz[Z];if(q!==void 0)$[q]=J;$.stdio[Z]=J},Gz=["stdin","stdout","stderr"],Hz=({subprocess:$,stream:J,direction:X,fdNumber:Z,pipeGroups:q,controller:Y})=>{if(J===void 0)return;zz(J,Y);let[Q,G]=X==="output"?[J,$.stdio[Z]]:[$.stdio[Z],J],H=q.get(Q)??[];q.set(Q,[...H,G])},zz=($,{signal:J})=>{if(D0($))V1($,Bz,J)},Bz=2;import{addAbortListener as Wz}from"node:events";var P1=[];P1.push("SIGHUP","SIGINT","SIGTERM");if(process.platform!=="win32")P1.push("SIGALRM","SIGABRT","SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT");if(process.platform==="linux")P1.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT");var O4=($)=>!!$&&typeof $==="object"&&typeof $.removeListener==="function"&&typeof $.emit==="function"&&typeof $.reallyExit==="function"&&typeof $.listeners==="function"&&typeof $.kill==="function"&&typeof $.pid==="number"&&typeof $.on==="function",Y3=Symbol.for("signal-exit emitter"),G3=globalThis,Kz=Object.defineProperty.bind(Object);class AJ{emitted={afterExit:!1,exit:!1};listeners={afterExit:[],exit:[]};count=0;id=Math.random();constructor(){if(G3[Y3])return G3[Y3];Kz(G3,Y3,{value:this,writable:!1,enumerable:!1,configurable:!1})}on($,J){this.listeners[$].push(J)}removeListener($,J){let X=this.listeners[$],Z=X.indexOf(J);if(Z===-1)return;if(Z===0&&X.length===1)X.length=0;else X.splice(Z,1)}emit($,J,X){if(this.emitted[$])return!1;this.emitted[$]=!0;let Z=!1;for(let q of this.listeners[$])Z=q(J,X)===!0||Z;if($==="exit")Z=this.emit("afterExit",J,X)||Z;return Z}}class z3{}var Uz=($)=>{return{onExit(J,X){return $.onExit(J,X)},load(){return $.load()},unload(){return $.unload()}}};class NJ extends z3{onExit(){return()=>{}}load(){}unload(){}}class DJ extends z3{#J=H3.platform==="win32"?"SIGINT":"SIGHUP";#X=new AJ;#$;#Z;#q;#Q={};#Y=!1;constructor($){super();this.#$=$,this.#Q={};for(let J of P1)this.#Q[J]=()=>{let X=this.#$.listeners(J),{count:Z}=this.#X,q=$;if(typeof q.__signal_exit_emitter__==="object"&&typeof q.__signal_exit_emitter__.count==="number")Z+=q.__signal_exit_emitter__.count;if(X.length===Z){this.unload();let Y=this.#X.emit("exit",null,J),Q=J==="SIGHUP"?this.#J:J;if(!Y)$.kill($.pid,Q)}};this.#q=$.reallyExit,this.#Z=$.emit}onExit($,J){if(!O4(this.#$))return()=>{};if(this.#Y===!1)this.load();let X=J?.alwaysLast?"afterExit":"exit";return this.#X.on(X,$),()=>{if(this.#X.removeListener(X,$),this.#X.listeners.exit.length===0&&this.#X.listeners.afterExit.length===0)this.unload()}}load(){if(this.#Y)return;this.#Y=!0,this.#X.count+=1;for(let $ of P1)try{let J=this.#Q[$];if(J)this.#$.on($,J)}catch(J){}this.#$.emit=($,...J)=>{return this.#H($,...J)},this.#$.reallyExit=($)=>{return this.#G($)}}unload(){if(!this.#Y)return;this.#Y=!1,P1.forEach(($)=>{let J=this.#Q[$];if(!J)throw Error("Listener not defined for signal: "+$);try{this.#$.removeListener($,J)}catch(X){}}),this.#$.emit=this.#Z,this.#$.reallyExit=this.#q,this.#X.count-=1}#G($){if(!O4(this.#$))return 0;return this.#$.exitCode=$||0,this.#X.emit("exit",this.#$.exitCode,null),this.#q.call(this.#$,this.#$.exitCode)}#H($,...J){let X=this.#Z;if($==="exit"&&O4(this.#$)){if(typeof J[0]==="number")this.#$.exitCode=J[0];let Z=X.call(this.#$,$,...J);return this.#X.emit("exit",this.#$.exitCode,null),Z}else return X.call(this.#$,$,...J)}}var H3=globalThis.process,{onExit:SJ,load:YF,unload:GF}=Uz(O4(H3)?new DJ(H3):new NJ);var fJ=($,{cleanup:J,detached:X},{signal:Z})=>{if(!J||X)return;let q=SJ(()=>{$.kill()});Wz(Z,()=>{q()})};var kJ=({source:$,sourcePromise:J,boundOptions:X,createNested:Z},...q)=>{let Y=v$(),{destination:Q,destinationStream:G,destinationError:H,from:B,unpipeSignal:U}=Vz(X,Z,q),{sourceStream:K,sourceError:W}=_z($,B),{options:P,fileDescriptors:R}=c0.get($);return{sourcePromise:J,sourceStream:K,sourceOptions:P,sourceError:W,destination:Q,destinationStream:G,destinationError:H,unpipeSignal:U,fileDescriptors:R,startTime:Y}},Vz=($,J,X)=>{try{let{destination:Z,pipeOptions:{from:q,to:Y,unpipeSignal:Q}={}}=Lz($,J,...X),G=t$(Z,Y);return{destination:Z,destinationStream:G,from:q,unpipeSignal:Q}}catch(Z){return{destinationError:Z}}},Lz=($,J,X,...Z)=>{if(Array.isArray(X))return{destination:J(vJ,$)(X,...Z),pipeOptions:$};if(typeof X==="string"||X instanceof URL||J2(X)){if(Object.keys($).length>0)throw TypeError('Please use .pipe("file", ..., options) or .pipe(execa("file", ..., options)) instead of .pipe(options)("file", ...).');let[q,Y,Q]=I$(X,...Z);return{destination:J(vJ)(q,Y,Q),pipeOptions:Q}}if(c0.has(X)){if(Object.keys($).length>0)throw TypeError("Please use .pipe(options)`command` or .pipe($(options)`command`) instead of .pipe(options)($`command`).");return{destination:X,pipeOptions:Z[0]}}throw TypeError(`The first argument must be a template string, an options object, or an Execa subprocess: ${X}`)},vJ=({options:$})=>({options:{...$,stdin:"pipe",piped:!0}}),_z=($,J)=>{try{return{sourceStream:u1($,J)}}catch(X){return{sourceError:X}}};var yJ=({sourceStream:$,sourceError:J,destinationStream:X,destinationError:Z,fileDescriptors:q,sourceOptions:Y,startTime:Q})=>{let G=Rz({sourceStream:$,sourceError:J,destinationStream:X,destinationError:Z});if(G!==void 0)throw B3({error:G,fileDescriptors:q,sourceOptions:Y,startTime:Q})},Rz=({sourceStream:$,sourceError:J,destinationStream:X,destinationError:Z})=>{if(J!==void 0&&Z!==void 0)return Z;if(Z!==void 0)return q3($),Z;if(J!==void 0)return Q3(X),J},B3=({error:$,fileDescriptors:J,sourceOptions:X,startTime:Z})=>d1({error:$,command:bJ,escapedCommand:bJ,fileDescriptors:J,options:X,startTime:Z,isSync:!1}),bJ="source.pipe(destination)";var gJ=async($)=>{let[{status:J,reason:X,value:Z=X},{status:q,reason:Y,value:Q=Y}]=await $;if(!Q.pipedFrom.includes(Z))Q.pipedFrom.push(Z);if(q==="rejected")throw Q;if(J==="rejected")throw Z;return Q};import{finished as Tz}from"node:stream/promises";var cJ=($,J,X)=>{let Z=E4.has(J)?Fz($,J):Pz($,J);return V1($,Cz,X.signal),V1(J,xz,X.signal),Mz(J),Z},Pz=($,J)=>{let X=T1([$]);return i1(X,J),E4.set(J,X),X},Fz=($,J)=>{let X=E4.get(J);return X.add($),X},Mz=async($)=>{try{await Tz($,{cleanup:!0,readable:!1,writable:!0})}catch{}E4.delete($)},E4=new WeakMap,Cz=2,xz=1;import{aborted as jz}from"node:util";var uJ=($,J)=>$===void 0?[]:[Iz($,J)],Iz=async($,{sourceStream:J,mergedStream:X,fileDescriptors:Z,sourceOptions:q,startTime:Y})=>{await jz($,J),await X.remove(J);let Q=Error("Pipe canceled by `unpipeSignal` option.");throw B3({error:Q,fileDescriptors:Z,sourceOptions:q,startTime:Y})};var h4=($,...J)=>{if(X0(J[0]))return h4.bind(void 0,{...$,boundOptions:{...$.boundOptions,...J[0]}});let{destination:X,...Z}=kJ($,...J),q=wz({...Z,destination:X});return q.pipe=h4.bind(void 0,{...$,source:X,sourcePromise:q,boundOptions:{}}),q},wz=async({sourcePromise:$,sourceStream:J,sourceOptions:X,sourceError:Z,destination:q,destinationStream:Y,destinationError:Q,unpipeSignal:G,fileDescriptors:H,startTime:B})=>{let U=Oz($,q);yJ({sourceStream:J,sourceError:Z,destinationStream:Y,destinationError:Q,fileDescriptors:H,sourceOptions:X,startTime:B});let K=new AbortController;try{let W=cJ(J,Y,K);return await Promise.race([gJ(U),...uJ(G,{sourceStream:J,mergedStream:W,sourceOptions:X,fileDescriptors:H,startTime:B})])}finally{K.abort()}},Oz=($,J)=>Promise.allSettled([$,J]);import{setImmediate as fz}from"node:timers/promises";import{on as Ez}from"node:events";import{getDefaultHighWaterMark as hz}from"node:stream";var A4=({subprocessStdout:$,subprocess:J,binary:X,shouldEncode:Z,encoding:q,preserveNewlines:Y})=>{let Q=new AbortController;return Az(J,Q),pJ({stream:$,controller:Q,binary:X,shouldEncode:!$.readableObjectMode&&Z,encoding:q,shouldSplit:!$.readableObjectMode,preserveNewlines:Y})},Az=async($,J)=>{try{await $}catch{}finally{J.abort()}},K3=({stream:$,onStreamEnd:J,lines:X,encoding:Z,stripFinalNewline:q,allMixed:Y})=>{let Q=new AbortController;Nz(J,Q,$);let G=$.readableObjectMode&&!Y;return pJ({stream:$,controller:Q,binary:Z==="buffer",shouldEncode:!G,encoding:Z,shouldSplit:!G&&X,preserveNewlines:!q})},Nz=async($,J,X)=>{try{await $}catch{X.destroy()}finally{J.abort()}},pJ=({stream:$,controller:J,binary:X,shouldEncode:Z,encoding:q,shouldSplit:Y,preserveNewlines:Q})=>{let G=Ez($,"data",{signal:J.signal,highWaterMark:mJ,highWatermark:mJ});return Dz({onStdoutChunk:G,controller:J,binary:X,shouldEncode:Z,encoding:q,shouldSplit:Y,preserveNewlines:Q})},U3=hz(!0),mJ=U3,Dz=async function*({onStdoutChunk:$,controller:J,binary:X,shouldEncode:Z,encoding:q,shouldSplit:Y,preserveNewlines:Q}){let G=Sz({binary:X,shouldEncode:Z,encoding:q,shouldSplit:Y,preserveNewlines:Q});try{for await(let[H]of $)yield*R1(H,G,0)}catch(H){if(!J.signal.aborted)throw H}finally{yield*U$(G)}},Sz=({binary:$,shouldEncode:J,encoding:X,shouldSplit:Z,preserveNewlines:q})=>[M4($,X,!J),F4($,q,!Z,{})].filter(Boolean);var dJ=async({stream:$,onStreamEnd:J,fdNumber:X,encoding:Z,buffer:q,maxBuffer:Y,lines:Q,allMixed:G,stripFinalNewline:H,verboseInfo:B,streamInfo:U})=>{let K=vz({stream:$,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:G,verboseInfo:B,streamInfo:U});if(!q){await Promise.all([kz($),K]);return}let W=n2(H,X),P=K3({stream:$,onStreamEnd:J,lines:Q,encoding:Z,stripFinalNewline:W,allMixed:G}),[R]=await Promise.all([bz({stream:$,iterable:P,fdNumber:X,encoding:Z,maxBuffer:Y,lines:Q}),K]);return R},vz=async({stream:$,onStreamEnd:J,fdNumber:X,encoding:Z,allMixed:q,verboseInfo:Y,streamInfo:{fileDescriptors:Q}})=>{if(!j4({stdioItems:Q[X]?.stdioItems,encoding:Z,verboseInfo:Y,fdNumber:X}))return;let G=K3({stream:$,onStreamEnd:J,lines:!0,encoding:Z,stripFinalNewline:!0,allMixed:q});await r5(G,$,X,Y)},kz=async($)=>{if(await fz(),$.readableFlowing===null)$.resume()},bz=async({stream:$,stream:{readableObjectMode:J},iterable:X,fdNumber:Z,encoding:q,maxBuffer:Y,lines:Q})=>{try{if(J||Q)return await B4(X,{maxBuffer:Y});if(q==="buffer")return new Uint8Array(await K4(X,{maxBuffer:Y}));return await W4(X,{maxBuffer:Y})}catch(G){return lJ(r7({error:G,stream:$,readableObjectMode:J,lines:Q,encoding:q,fdNumber:Z}))}},W3=async($)=>{try{return await $}catch(J){return lJ(J)}},lJ=({bufferedData:$})=>W6($)?new Uint8Array($):$;import{finished as yz}from"node:stream/promises";var _$=async($,J,X,{isSameDirection:Z,stopOnExit:q=!1}={})=>{let Y=gz($,X),Q=new AbortController;try{await Promise.race([...q?[X.exitPromise]:[],yz($,{cleanup:!0,signal:Q.signal})])}catch(G){if(!Y.stdinCleanedUp)mz(G,J,X,Z)}finally{Q.abort()}},gz=($,{originalStreams:[J],subprocess:X})=>{let Z={stdinCleanedUp:!1};if($===J)cz($,X,Z);return Z},cz=($,J,X)=>{let{_destroy:Z}=$;$._destroy=(...q)=>{uz(J,X),Z.call($,...q)}},uz=({exitCode:$,signalCode:J},X)=>{if($!==null||J!==null)X.stdinCleanedUp=!0},mz=($,J,X,Z)=>{if(!pz($,J,X,Z))throw $},pz=($,J,X,Z=!0)=>{if(X.propagating)return nJ($)||N4($);return X.propagating=!0,V3(X,J)===Z?nJ($):N4($)},V3=({fileDescriptors:$},J)=>J!=="all"&&$[J].direction==="input",N4=($)=>$?.code==="ERR_STREAM_PREMATURE_CLOSE",nJ=($)=>$?.code==="EPIPE";var iJ=({subprocess:$,encoding:J,buffer:X,maxBuffer:Z,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>$.stdio.map((H,B)=>L3({stream:H,fdNumber:B,encoding:J,buffer:X[B],maxBuffer:Z[B],lines:q[B],allMixed:!1,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})),L3=async({stream:$,fdNumber:J,encoding:X,buffer:Z,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:B})=>{if(!$)return;let U=_$($,J,B);if(V3(B,J)){await U;return}let[K]=await Promise.all([dJ({stream:$,onStreamEnd:U,fdNumber:J,encoding:X,buffer:Z,maxBuffer:q,lines:Y,allMixed:Q,stripFinalNewline:G,verboseInfo:H,streamInfo:B}),U]);return K};var tJ=({stdout:$,stderr:J},{all:X})=>X&&($||J)?T1([$,J].filter(Boolean)):void 0,oJ=({subprocess:$,encoding:J,buffer:X,maxBuffer:Z,lines:q,stripFinalNewline:Y,verboseInfo:Q,streamInfo:G})=>L3({...dz($,X),fdNumber:"all",encoding:J,maxBuffer:Z[1]+Z[2],lines:q[1]||q[2],allMixed:lz($),stripFinalNewline:Y,verboseInfo:Q,streamInfo:G}),dz=({stdout:$,stderr:J,all:X},[,Z,q])=>{let Y=Z||q;if(!Y)return{stream:X,buffer:Y};if(!Z)return{stream:J,buffer:Y};if(!q)return{stream:$,buffer:Y};return{stream:X,buffer:Y}},lz=({all:$,stdout:J,stderr:X})=>$&&J&&X&&J.readableObjectMode!==X.readableObjectMode;import{once as nz}from"node:events";var aJ=($)=>k1($,"ipc"),rJ=($,J)=>{let X=f$($);b0({type:"ipc",verboseMessage:X,fdNumber:"ipc",verboseInfo:J})};var sJ=async({subprocess:$,buffer:J,maxBuffer:X,ipc:Z,ipcOutput:q,verboseInfo:Y})=>{if(!Z)return q;let Q=aJ(Y),G=t0(J,"ipc"),H=t0(X,"ipc");for await(let B of J3({anyProcess:$,channel:$.channel,isSubprocess:!1,ipc:Z,shouldAwait:!1,reference:!0})){if(G)s7($,q,H),q.push(B);if(Q)rJ(B,Y)}return q},eJ=async($,J)=>{return await Promise.allSettled([$]),J};var $X=async({subprocess:$,options:{encoding:J,buffer:X,maxBuffer:Z,lines:q,timeoutDuration:Y,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,stripFinalNewline:B,ipc:U,ipcInput:K},context:W,verboseInfo:P,fileDescriptors:R,originalStreams:L,onInternalError:M,controller:C})=>{let A=XJ($,W),m={originalStreams:L,fileDescriptors:R,subprocess:$,exitPromise:A,propagating:!1},j=iJ({subprocess:$,encoding:J,buffer:X,maxBuffer:Z,lines:q,stripFinalNewline:B,verboseInfo:P,streamInfo:m}),l=oJ({subprocess:$,encoding:J,buffer:X,maxBuffer:Z,lines:q,stripFinalNewline:B,verboseInfo:P,streamInfo:m}),n=[],t=sJ({subprocess:$,buffer:X,maxBuffer:Z,ipc:U,ipcOutput:n,verboseInfo:P}),L0=iz(L,$,m),p=tz(R,m);try{return await Promise.race([Promise.all([{},QJ(A),Promise.all(j),l,t,h7($,K),...L0,...p]),M,oz($,C),...j7($,Y,W,C),...l8({subprocess:$,cancelSignal:Q,gracefulCancel:G,context:W,controller:C}),...C7({subprocess:$,cancelSignal:Q,gracefulCancel:G,forceKillAfterDelay:H,context:W,controller:C})])}catch(l0){return W.terminationReason??="other",Promise.all([{error:l0},A,Promise.all(j.map((O)=>W3(O))),W3(l),eJ(t,n),Promise.allSettled(L0),Promise.allSettled(p)])}},iz=($,J,X)=>$.map((Z,q)=>Z===J.stdio[q]?void 0:_$(Z,q,X)),tz=($,J)=>$.flatMap(({stdioItems:X},Z)=>X.filter(({value:q,stream:Y=q})=>f0(Y,{checkOpen:!1})&&!D0(Y)).map(({type:q,value:Y,stream:Q=Y})=>_$(Q,Z,J,{isSameDirection:I0.has(q),stopOnExit:q==="native"}))),oz=async($,{signal:J})=>{let[X]=await nz($,"error",{signal:J});throw X};var JX=()=>({readableDestroy:new WeakMap,writableFinal:new WeakMap,writableDestroy:new WeakMap}),R$=($,J,X)=>{let Z=$[X];if(!Z.has(J))Z.set(J,[]);let q=Z.get(J),Y=g0();return q.push(Y),{resolve:Y.resolve.bind(Y),promises:q}},t1=async({resolve:$,promises:J},X)=>{$();let[Z]=await Promise.race([Promise.allSettled([!0,X]),Promise.all([!1,...J])]);return!Z};import{Readable as az}from"node:stream";import{callbackify as rz}from"node:util";import{finished as XX}from"node:stream/promises";var _3=async($)=>{if($===void 0)return;try{await R3($)}catch{}},ZX=async($)=>{if($===void 0)return;try{await T3($)}catch{}},R3=async($)=>{await XX($,{cleanup:!0,readable:!1,writable:!0})},T3=async($)=>{await XX($,{cleanup:!0,readable:!0,writable:!1})},D4=async($,J)=>{if(await $,J)throw J},S4=($,J,X)=>{if(X&&!N4(X))$.destroy(X);else if(J)$.destroy()};var QX=({subprocess:$,concurrentStreams:J,encoding:X},{from:Z,binary:q=!0,preserveNewlines:Y=!0}={})=>{let Q=q||P0.has(X),{subprocessStdout:G,waitReadableDestroy:H}=P3($,Z,J),{readableEncoding:B,readableObjectMode:U,readableHighWaterMark:K}=F3(G,Q),{read:W,onStdoutDataDone:P}=M3({subprocessStdout:G,subprocess:$,binary:Q,encoding:X,preserveNewlines:Y}),R=new az({read:W,destroy:rz(x3.bind(void 0,{subprocessStdout:G,subprocess:$,waitReadableDestroy:H})),highWaterMark:K,objectMode:U,encoding:B});return C3({subprocessStdout:G,onStdoutDataDone:P,readable:R,subprocess:$}),R},P3=($,J,X)=>{let Z=u1($,J),q=R$(X,Z,"readableDestroy");return{subprocessStdout:Z,waitReadableDestroy:q}},F3=({readableEncoding:$,readableObjectMode:J,readableHighWaterMark:X},Z)=>Z?{readableEncoding:$,readableObjectMode:J,readableHighWaterMark:X}:{readableEncoding:$,readableObjectMode:!0,readableHighWaterMark:U3},M3=({subprocessStdout:$,subprocess:J,binary:X,encoding:Z,preserveNewlines:q})=>{let Y=g0(),Q=A4({subprocessStdout:$,subprocess:J,binary:X,shouldEncode:!X,encoding:Z,preserveNewlines:q});return{read(){sz(this,Q,Y)},onStdoutDataDone:Y}},sz=async($,J,X)=>{try{let{value:Z,done:q}=await J.next();if(q)X.resolve();else $.push(Z)}catch{}},C3=async({subprocessStdout:$,onStdoutDataDone:J,readable:X,subprocess:Z,subprocessStdin:q})=>{try{if(await T3($),await Z,await _3(q),await J,X.readable)X.push(null)}catch(Y){await _3(q),qX(X,Y)}},x3=async({subprocessStdout:$,subprocess:J,waitReadableDestroy:X},Z)=>{if(await t1(X,J))qX($,Z),await D4(J,Z)},qX=($,J)=>{S4($,$.readable,J)};import{Writable as ez}from"node:stream";import{callbackify as YX}from"node:util";var GX=({subprocess:$,concurrentStreams:J},{to:X}={})=>{let{subprocessStdin:Z,waitWritableFinal:q,waitWritableDestroy:Y}=j3($,X,J),Q=new ez({...I3(Z,$,q),destroy:YX(O3.bind(void 0,{subprocessStdin:Z,subprocess:$,waitWritableFinal:q,waitWritableDestroy:Y})),highWaterMark:Z.writableHighWaterMark,objectMode:Z.writableObjectMode});return w3(Z,Q),Q},j3=($,J,X)=>{let Z=t$($,J),q=R$(X,Z,"writableFinal"),Y=R$(X,Z,"writableDestroy");return{subprocessStdin:Z,waitWritableFinal:q,waitWritableDestroy:Y}},I3=($,J,X)=>({write:$B.bind(void 0,$),final:YX(JB.bind(void 0,$,J,X))}),$B=($,J,X,Z)=>{if($.write(J,X))Z();else $.once("drain",Z)},JB=async($,J,X)=>{if(await t1(X,J)){if($.writable)$.end();await J}},w3=async($,J,X)=>{try{if(await R3($),J.writable)J.end()}catch(Z){await ZX(X),HX(J,Z)}},O3=async({subprocessStdin:$,subprocess:J,waitWritableFinal:X,waitWritableDestroy:Z},q)=>{if(await t1(X,J),await t1(Z,J))HX($,q),await D4(J,q)},HX=($,J)=>{S4($,$.writable,J)};import{Duplex as XB}from"node:stream";import{callbackify as ZB}from"node:util";var zX=({subprocess:$,concurrentStreams:J,encoding:X},{from:Z,to:q,binary:Y=!0,preserveNewlines:Q=!0}={})=>{let G=Y||P0.has(X),{subprocessStdout:H,waitReadableDestroy:B}=P3($,Z,J),{subprocessStdin:U,waitWritableFinal:K,waitWritableDestroy:W}=j3($,q,J),{readableEncoding:P,readableObjectMode:R,readableHighWaterMark:L}=F3(H,G),{read:M,onStdoutDataDone:C}=M3({subprocessStdout:H,subprocess:$,binary:G,encoding:X,preserveNewlines:Q}),A=new XB({read:M,...I3(U,$,K),destroy:ZB(QB.bind(void 0,{subprocessStdout:H,subprocessStdin:U,subprocess:$,waitReadableDestroy:B,waitWritableFinal:K,waitWritableDestroy:W})),readableHighWaterMark:L,writableHighWaterMark:U.writableHighWaterMark,readableObjectMode:R,writableObjectMode:U.writableObjectMode,encoding:P});return C3({subprocessStdout:H,onStdoutDataDone:C,readable:A,subprocess:$,subprocessStdin:U}),w3(U,A,H),A},QB=async({subprocessStdout:$,subprocessStdin:J,subprocess:X,waitReadableDestroy:Z,waitWritableFinal:q,waitWritableDestroy:Y},Q)=>{await Promise.all([x3({subprocessStdout:$,subprocess:X,waitReadableDestroy:Z},Q),O3({subprocessStdin:J,subprocess:X,waitWritableFinal:q,waitWritableDestroy:Y},Q)])};var E3=($,J,{from:X,binary:Z=!1,preserveNewlines:q=!1}={})=>{let Y=Z||P0.has(J),Q=u1($,X),G=A4({subprocessStdout:Q,subprocess:$,binary:Y,shouldEncode:!0,encoding:J,preserveNewlines:q});return qB(G,Q,$)},qB=async function*($,J,X){try{yield*$}finally{if(J.readable)J.destroy();await X}};var BX=($,{encoding:J})=>{let X=JX();$.readable=QX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:J}),$.writable=GX.bind(void 0,{subprocess:$,concurrentStreams:X}),$.duplex=zX.bind(void 0,{subprocess:$,concurrentStreams:X,encoding:J}),$.iterable=E3.bind(void 0,$,J),$[Symbol.asyncIterator]=E3.bind(void 0,$,J,{})};var KX=($,J)=>{for(let[X,Z]of GB){let q=Z.value.bind(J);Reflect.defineProperty($,X,{...Z,value:q})}},YB=(async()=>{})().constructor.prototype,GB=["then","catch","finally"].map(($)=>[$,Reflect.getOwnPropertyDescriptor(YB,$)]);var UX=($,J,X,Z)=>{let{file:q,commandArguments:Y,command:Q,escapedCommand:G,startTime:H,verboseInfo:B,options:U,fileDescriptors:K}=BB($,J,X),{subprocess:W,promise:P}=UB({file:q,commandArguments:Y,options:U,startTime:H,verboseInfo:B,command:Q,escapedCommand:G,fileDescriptors:K});return W.pipe=h4.bind(void 0,{source:W,sourcePromise:P,boundOptions:{},createNested:Z}),KX(W,P),c0.set(W,{options:U,fileDescriptors:K}),W},BB=($,J,X)=>{let{command:Z,escapedCommand:q,startTime:Y,verboseInfo:Q}=k$($,J,X),{file:G,commandArguments:H,options:B}=q4($,J,X),U=KB(B),K=PJ(U,Q);return{file:G,commandArguments:H,command:Z,escapedCommand:q,startTime:Y,verboseInfo:Q,options:U,fileDescriptors:K}},KB=({timeout:$,signal:J,...X})=>{if(J!==void 0)throw TypeError('The "signal" option has been renamed to "cancelSignal" instead.');return{...X,timeoutDuration:$}},UB=({file:$,commandArguments:J,options:X,startTime:Z,verboseInfo:q,command:Y,escapedCommand:Q,fileDescriptors:G})=>{let H;try{H=zB(...Y4($,J,X))}catch(R){return LJ({error:R,command:Y,escapedCommand:Q,fileDescriptors:G,options:X,startTime:Z,verboseInfo:q})}let B=new AbortController;HB(Number.POSITIVE_INFINITY,B.signal);let U=[...H.stdio];hJ(H,G,B),fJ(H,X,B);let K={},W=g0();H.kill=p8.bind(void 0,{kill:H.kill.bind(H),options:X,onInternalError:W,context:K,controller:B}),H.all=tJ(H,X),BX(H,X),UJ(H,X);let P=WB({subprocess:H,options:X,startTime:Z,verboseInfo:q,fileDescriptors:G,originalStreams:U,command:Y,escapedCommand:Q,context:K,onInternalError:W,controller:B});return{subprocess:H,promise:P}},WB=async({subprocess:$,options:J,startTime:X,verboseInfo:Z,fileDescriptors:q,originalStreams:Y,command:Q,escapedCommand:G,context:H,onInternalError:B,controller:U})=>{let[K,[W,P],R,L,M]=await $X({subprocess:$,options:J,context:H,verboseInfo:Z,fileDescriptors:q,originalStreams:Y,onInternalError:B,controller:U});U.abort(),B.resolve();let C=R.map((j,l)=>r0(j,J,l)),A=r0(L,J,"all"),m=VB({errorInfo:K,exitCode:W,signal:P,stdio:C,all:A,ipcOutput:M,context:H,options:J,command:Q,escapedCommand:G,startTime:X});return l1(m,Z,J)},VB=({errorInfo:$,exitCode:J,signal:X,stdio:Z,all:q,ipcOutput:Y,context:Q,options:G,command:H,escapedCommand:B,startTime:U})=>("error"in $)?K$({error:$.error,command:H,escapedCommand:B,timedOut:Q.terminationReason==="timeout",isCanceled:Q.terminationReason==="cancel"||Q.terminationReason==="gracefulCancel",isGracefullyCanceled:Q.terminationReason==="gracefulCancel",isMaxBuffer:$.error instanceof o0,isForcefullyTerminated:Q.isForcefullyTerminated,exitCode:J,signal:X,stdio:Z,all:q,ipcOutput:Y,options:G,startTime:U,isSync:!1}):L4({command:H,escapedCommand:B,stdio:Z,all:q,ipcOutput:Y,options:G,startTime:U});var f4=($,J)=>{let X=Object.fromEntries(Object.entries(J).map(([Z,q])=>[Z,LB(Z,$[Z],q)]));return{...$,...X}},LB=($,J,X)=>{if(_B.has($)&&X0(J)&&X0(X))return{...J,...X};return X},_B=new Set(["env",...G2]);var Q1=($,J,X,Z)=>{let q=(Q,G,H)=>Q1(Q,G,X,H),Y=(...Q)=>RB({mapArguments:$,deepOptions:X,boundOptions:J,setBoundExeca:Z,createNested:q},...Q);if(Z!==void 0)Z(Y,q,J);return Y},RB=({mapArguments:$,deepOptions:J={},boundOptions:X={},setBoundExeca:Z,createNested:q},Y,...Q)=>{if(X0(Y))return q($,f4(X,Y),Z);let{file:G,commandArguments:H,options:B,isSync:U}=TB({mapArguments:$,firstArgument:Y,nextArguments:Q,deepOptions:J,boundOptions:X});return U?YJ(G,H,B):UX(G,H,B,q)},TB=({mapArguments:$,firstArgument:J,nextArguments:X,deepOptions:Z,boundOptions:q})=>{let Y=P6(J)?F6(J,X):[J,...X],[Q,G,H]=I$(...Y),B=f4(f4(Z,q),H),{file:U=Q,commandArguments:K=G,options:W=B,isSync:P=!1}=$({file:Q,commandArguments:G,options:B});return{file:U,commandArguments:K,options:W,isSync:P}};var WX=({file:$,commandArguments:J})=>LX($,J),VX=({file:$,commandArguments:J})=>({...LX($,J),isSync:!0}),LX=($,J)=>{if(J.length>0)throw TypeError(`The command and its arguments must be passed as a single string: ${$} ${J}.`);let[X,...Z]=PB($);return{file:X,commandArguments:Z}},PB=($)=>{if(typeof $!=="string")throw TypeError(`The command must be a string: ${String($)}.`);let J=$.trim();if(J==="")return[];let X=[];for(let Z of J.split(FB)){let q=X.at(-1);if(q&&q.endsWith("\\"))X[X.length-1]=`${q.slice(0,-1)} ${Z}`;else X.push(Z)}return X},FB=/ +/g;var _X=($,J,X)=>{$.sync=J(MB,X),$.s=$.sync},RX=({options:$})=>TX($),MB=({options:$})=>({...TX($),isSync:!0}),TX=($)=>({options:{...CB($),...$}}),CB=({input:$,inputFile:J,stdio:X})=>$===void 0&&J===void 0&&X===void 0?{stdin:"inherit"}:{},PX={preferLocal:!0};var FX=Q1(()=>({})),aC=Q1(()=>({isSync:!0})),rC=Q1(WX),sC=Q1(VX),eC=Q1(w7),$x=Q1(RX,{},PX,_X),{sendMessage:Jx,getOneMessage:Xx,getEachMessage:Zx,getCancelSignal:Qx}=WJ();var T$=Z$(A3(),1);import{stdin as EB,stdout as hB}from"node:process";import*as q1 from"node:readline";function AB({onlyFirst:$=!1}={}){let J=["[\\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(J,$?void 0:"g")}var zx=AB();function OX($){return $&&$.__esModule&&Object.prototype.hasOwnProperty.call($,"default")?$.default:$}var EX={exports:{}};(function($){var J={};$.exports=J,J.eastAsianWidth=function(Z){var q=Z.charCodeAt(0),Y=Z.length==2?Z.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"},J.characterLength=function(Z){var q=this.eastAsianWidth(Z);return q=="F"||q=="W"||q=="A"?2:1};function X(Z){return Z.match(/[\uD800-\uDBFF][\uDC00-\uDFFF]|[^\uD800-\uDFFF]/g)||[]}J.length=function(Z){for(var q=X(Z),Y=0,Q=0;Q<q.length;Q++)Y=Y+this.characterLength(q[Q]);return Y},J.slice=function(Z,q,Y){textLen=J.length(Z),q=q||0,Y=Y||1,q<0&&(q=textLen+q),Y<0&&(Y=textLen+Y);for(var Q="",G=0,H=X(Z),B=0;B<H.length;B++){var U=H[B],K=J.length(U);if(G>=q-(K==2?1:0))if(G+K<=Y)Q+=U;else break;G+=K}return Q}})(EX);var NB=EX.exports,Bx=OX(NB),DB=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},Kx=OX(DB);var S3=10,jX=($=0)=>(J)=>`\x1B[${J+$}m`,IX=($=0)=>(J)=>`\x1B[${38+$};5;${J}m`,wX=($=0)=>(J,X,Z)=>`\x1B[${38+$};2;${J};${X};${Z}m`,e={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(e.modifier);var SB=Object.keys(e.color),fB=Object.keys(e.bgColor);[...SB,...fB];function vB(){let $=new Map;for(let[J,X]of Object.entries(e)){for(let[Z,q]of Object.entries(X))e[Z]={open:`\x1B[${q[0]}m`,close:`\x1B[${q[1]}m`},X[Z]=e[Z],$.set(q[0],q[1]);Object.defineProperty(e,J,{value:X,enumerable:!1})}return Object.defineProperty(e,"codes",{value:$,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi=jX(),e.color.ansi256=IX(),e.color.ansi16m=wX(),e.bgColor.ansi=jX(S3),e.bgColor.ansi256=IX(S3),e.bgColor.ansi16m=wX(S3),Object.defineProperties(e,{rgbToAnsi256:{value:(J,X,Z)=>J===X&&X===Z?J<8?16:J>248?231:Math.round((J-8)/247*24)+232:16+36*Math.round(J/255*5)+6*Math.round(X/255*5)+Math.round(Z/255*5),enumerable:!1},hexToRgb:{value:(J)=>{let X=/[a-f\d]{6}|[a-f\d]{3}/i.exec(J.toString(16));if(!X)return[0,0,0];let[Z]=X;Z.length===3&&(Z=[...Z].map((Y)=>Y+Y).join(""));let q=Number.parseInt(Z,16);return[q>>16&255,q>>8&255,q&255]},enumerable:!1},hexToAnsi256:{value:(J)=>e.rgbToAnsi256(...e.hexToRgb(J)),enumerable:!1},ansi256ToAnsi:{value:(J)=>{if(J<8)return 30+J;if(J<16)return 90+(J-8);let X,Z,q;if(J>=232)X=((J-232)*10+8)/255,Z=X,q=X;else{J-=16;let G=J%36;X=Math.floor(J/36)/5,Z=Math.floor(G/6)/5,q=G%6/5}let Y=Math.max(X,Z,q)*2;if(Y===0)return 30;let Q=30+(Math.round(q)<<2|Math.round(Z)<<1|Math.round(X));return Y===2&&(Q+=60),Q},enumerable:!1},rgbToAnsi:{value:(J,X,Z)=>e.ansi256ToAnsi(e.rgbToAnsi256(J,X,Z)),enumerable:!1},hexToAnsi:{value:(J)=>e.ansi256ToAnsi(e.hexToAnsi256(J)),enumerable:!1}}),e}var Ux=vB();var kB="]";var Wx=`${kB}8;;`;var bB=["up","down","left","right","space","enter","cancel"],yB={actions:new Set(bB),aliases:new Map([["k","up"],["j","down"],["h","left"],["l","right"],["\x03","cancel"],["escape","cancel"]])};function hX($,J){if(typeof $=="string")return yB.aliases.get($)===J;for(let X of $)if(X!==void 0&&hX(X,J))return!0;return!1}var gB=globalThis.process.platform.startsWith("win"),Vx=Symbol("clack:cancel");function AX({input:$=EB,output:J=hB,overwrite:X=!0,hideCursor:Z=!0}={}){let q=q1.createInterface({input:$,output:J,prompt:"",tabSize:1});q1.emitKeypressEvents($,q),$.isTTY&&$.setRawMode(!0);let Y=(Q,{name:G,sequence:H})=>{let B=String(Q);if(hX([B,G,H],"cancel")){Z&&J.write(T$.cursor.show),process.exit(0);return}if(!X)return;q1.moveCursor(J,G==="return"?0:-1,G==="return"?-1:0,()=>{q1.clearLine(J,1,()=>{$.once("keypress",Y)})})};return Z&&J.write(T$.cursor.hide),$.once("keypress",Y),()=>{$.off("keypress",Y),Z&&J.write(T$.cursor.show),$.isTTY&&!gB&&$.setRawMode(!1),q.terminal=!1,q.close()}}var cB;cB=new WeakMap;var K0=Z$(D3(),1),b4=Z$(A3(),1);import v0 from"node:process";function mB(){return v0.platform!=="win32"?v0.env.TERM!=="linux":!!v0.env.CI||!!v0.env.WT_SESSION||!!v0.env.TERMINUS_SUBLIME||v0.env.ConEmuTask==="{cmd::Cmder}"||v0.env.TERM_PROGRAM==="Terminus-Sublime"||v0.env.TERM_PROGRAM==="vscode"||v0.env.TERM==="xterm-256color"||v0.env.TERM==="alacritty"||v0.env.TERMINAL_EMULATOR==="JetBrains-JediTerm"}var f3=mB(),Z0=($,J)=>f3?$:J,wx=Z0("◆","*"),pB=Z0("■","x"),dB=Z0("▲","x"),NX=Z0("◇","o"),lB=Z0("┌","T"),o1=Z0("│","|"),nB=Z0("└","—"),Ox=Z0("●",">"),Ex=Z0("○"," "),hx=Z0("◻","[•]"),Ax=Z0("◼","[+]"),Nx=Z0("◻","[ ]"),Dx=Z0("▪","•"),Sx=Z0("─","-"),fx=Z0("╮","+"),vx=Z0("├","+"),kx=Z0("╯","+"),iB=Z0("●","•"),tB=Z0("◆","*"),oB=Z0("▲","!"),aB=Z0("■","x");var DX=($="")=>{process.stdout.write(`${K0.default.gray(lB)} ${$}
45
+ `)},SX=($="")=>{process.stdout.write(`${K0.default.gray(o1)}
46
+ ${K0.default.gray(nB)} ${$}
47
+
48
+ `)},m0={message:($="",{symbol:J=K0.default.gray(o1)}={})=>{let X=[`${K0.default.gray(o1)}`];if($){let[Z,...q]=$.split(`
49
+ `);X.push(`${J} ${Z}`,...q.map((Y)=>`${K0.default.gray(o1)} ${Y}`))}process.stdout.write(`${X.join(`
50
+ `)}
51
+ `)},info:($)=>{m0.message($,{symbol:K0.default.blue(iB)})},success:($)=>{m0.message($,{symbol:K0.default.green(tB)})},step:($)=>{m0.message($,{symbol:K0.default.green(NX)})},warn:($)=>{m0.message($,{symbol:K0.default.yellow(oB)})},warning:($)=>{m0.warn($)},error:($)=>{m0.message($,{symbol:K0.default.red(aB)})}},bx=`${K0.default.gray(o1)} `;var fX=({indicator:$="dots"}={})=>{let J=f3?["◒","◐","◓","◑"]:["•","o","O","0"],X=f3?80:120,Z=process.env.CI==="true",q,Y,Q=!1,G="",H,B=performance.now(),U=(j)=>{let l=j>1?"Something went wrong":"Canceled";Q&&m(l,j)},K=()=>U(2),W=()=>U(1),P=()=>{process.on("uncaughtExceptionMonitor",K),process.on("unhandledRejection",K),process.on("SIGINT",W),process.on("SIGTERM",W),process.on("exit",U)},R=()=>{process.removeListener("uncaughtExceptionMonitor",K),process.removeListener("unhandledRejection",K),process.removeListener("SIGINT",W),process.removeListener("SIGTERM",W),process.removeListener("exit",U)},L=()=>{if(H===void 0)return;Z&&process.stdout.write(`
52
+ `);let j=H.split(`
53
+ `);process.stdout.write(b4.cursor.move(-999,j.length-1)),process.stdout.write(b4.erase.down(j.length))},M=(j)=>j.replace(/\.+$/,""),C=(j)=>{let l=(performance.now()-j)/1000,n=Math.floor(l/60),t=Math.floor(l%60);return n>0?`[${n}m ${t}s]`:`[${t}s]`},A=(j="")=>{Q=!0,q=AX(),G=M(j),B=performance.now(),process.stdout.write(`${K0.default.gray(o1)}
54
+ `);let l=0,n=0;P(),Y=setInterval(()=>{if(Z&&G===H)return;L(),H=G;let t=K0.default.magenta(J[l]);if(Z)process.stdout.write(`${t} ${G}...`);else if($==="timer")process.stdout.write(`${t} ${G} ${C(B)}`);else{let L0=".".repeat(Math.floor(n)).slice(0,3);process.stdout.write(`${t} ${G}${L0}`)}l=l+1<J.length?l+1:0,n=n<J.length?n+0.125:0},X)},m=(j="",l=0)=>{Q=!1,clearInterval(Y),L();let n=l===0?K0.default.green(NX):l===1?K0.default.red(pB):K0.default.red(dB);G=M(j??G),$==="timer"?process.stdout.write(`${n} ${G} ${C(B)}
55
+ `):process.stdout.write(`${n} ${G}
56
+ `),R(),q()};return{start:A,stop:m,message:(j="")=>{G=M(j??G)}}};var s4=Z$(D3(),1);import{notStrictEqual as PK,strictEqual as FK}from"assert";var sB={right:JK,center:XK};class kX{constructor($){var J;this.width=$.width,this.wrap=(J=$.wrap)!==null&&J!==void 0?J:!0,this.rows=[]}span(...$){let J=this.div(...$);J.span=!0}resetOutput(){this.rows=[]}div(...$){if($.length===0)this.div("");if(this.wrap&&this.shouldApplyLayoutDSL(...$)&&typeof $[0]==="string")return this.applyLayoutDSL($[0]);let J=$.map((X)=>{if(typeof X==="string")return this.colFromString(X);return X});return this.rows.push(J),J}shouldApplyLayoutDSL(...$){return $.length===1&&typeof $[0]==="string"&&/[\t\n]/.test($[0])}applyLayoutDSL($){let J=$.split(`
57
+ `).map((Z)=>Z.split("\t")),X=0;return J.forEach((Z)=>{if(Z.length>1&&F0.stringWidth(Z[0])>X)X=Math.min(Math.floor(this.width*0.5),F0.stringWidth(Z[0]))}),J.forEach((Z)=>{this.div(...Z.map((q,Y)=>{return{text:q.trim(),padding:this.measurePadding(q),width:Y===0&&Z.length>1?X:void 0}}))}),this.rows[this.rows.length-1]}colFromString($){return{text:$,padding:this.measurePadding($)}}measurePadding($){let J=F0.stripAnsi($);return[0,J.match(/\s*$/)[0].length,0,J.match(/^\s*/)[0].length]}toString(){let $=[];return this.rows.forEach((J)=>{this.rowToString(J,$)}),$.filter((J)=>!J.hidden).map((J)=>J.text).join(`
58
+ `)}rowToString($,J){return this.rasterize($).forEach((X,Z)=>{let q="";X.forEach((Y,Q)=>{let{width:G}=$[Q],H=this.negatePadding($[Q]),B=Y;if(H>F0.stringWidth(Y))B+=" ".repeat(H-F0.stringWidth(Y));if($[Q].align&&$[Q].align!=="left"&&this.wrap){let K=sB[$[Q].align];if(B=K(B,H),F0.stringWidth(B)<H)B+=" ".repeat((G||0)-F0.stringWidth(B)-1)}let U=$[Q].padding||[0,0,0,0];if(U[3])q+=" ".repeat(U[3]);if(q+=vX($[Q],B,"| "),q+=B,q+=vX($[Q],B," |"),U[1])q+=" ".repeat(U[1]);if(Z===0&&J.length>0)q=this.renderInline(q,J[J.length-1])}),J.push({text:q.replace(/ +$/,""),span:$.span})}),J}renderInline($,J){let X=$.match(/^ */),Z=X?X[0].length:0,q=J.text,Y=F0.stringWidth(q.trimRight());if(!J.span)return $;if(!this.wrap)return J.hidden=!0,q+$;if(Z<Y)return $;return J.hidden=!0,q.trimRight()+" ".repeat(Z-Y)+$.trimLeft()}rasterize($){let J=[],X=this.columnWidths($),Z;return $.forEach((q,Y)=>{if(q.width=X[Y],this.wrap)Z=F0.wrap(q.text,this.negatePadding(q),{hard:!0}).split(`
59
+ `);else Z=q.text.split(`
60
+ `);if(q.border)Z.unshift("."+"-".repeat(this.negatePadding(q)+2)+"."),Z.push("'"+"-".repeat(this.negatePadding(q)+2)+"'");if(q.padding)Z.unshift(...Array(q.padding[0]||0).fill("")),Z.push(...Array(q.padding[2]||0).fill(""));Z.forEach((Q,G)=>{if(!J[G])J.push([]);let H=J[G];for(let B=0;B<Y;B++)if(H[B]===void 0)H.push("");H.push(Q)})}),J}negatePadding($){let J=$.width||0;if($.padding)J-=($.padding[3]||0)+($.padding[1]||0);if($.border)J-=4;return J}columnWidths($){if(!this.wrap)return $.map((Y)=>{return Y.width||F0.stringWidth(Y.text)});let J=$.length,X=this.width,Z=$.map((Y)=>{if(Y.width)return J--,X-=Y.width,Y.width;return}),q=J?Math.floor(X/J):0;return Z.map((Y,Q)=>{if(Y===void 0)return Math.max(q,eB($[Q]));return Y})}}function vX($,J,X){if($.border){if(/[.']-+[.']/.test(J))return"";if(J.trim().length!==0)return X;return" "}return""}function eB($){let J=$.padding||[],X=1+(J[3]||0)+(J[1]||0);if($.border)return X+4;return X}function $K(){if(typeof process==="object"&&process.stdout&&process.stdout.columns)return process.stdout.columns;return 80}function JK($,J){$=$.trim();let X=F0.stringWidth($);if(X<J)return" ".repeat(J-X)+$;return $}function XK($,J){$=$.trim();let X=F0.stringWidth($);if(X>=J)return $;return" ".repeat(J-X>>1)+$}var F0;function bX($,J){return F0=J,new kX({width:($===null||$===void 0?void 0:$.width)||$K(),wrap:$===null||$===void 0?void 0:$.wrap})}var yX=new RegExp("\x1B(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function v3($){return $.replace(yX,"")}function gX($,J){let[X,Z]=$.match(yX)||["",""];$=v3($);let q="";for(let Y=0;Y<$.length;Y++){if(Y!==0&&Y%J===0)q+=`
61
+ `;q+=$.charAt(Y)}if(X&&Z)q=`${X}${q}${Z}`;return q}function k3($){return bX($,{stringWidth:(J)=>{return[...J].length},stripAnsi:v3,wrap:gX})}import{dirname as cX,resolve as uX}from"path";import{readdirSync as ZK,statSync as QK}from"fs";function b3($,J){let X=uX(".",$),Z;if(!QK(X).isDirectory())X=cX(X);while(!0){if(Z=J(X,ZK(X)),Z)return uX(X,Z);if(X=cX(Z=X),Z===X)break}}import{inspect as MK}from"util";import{readFileSync as CK}from"fs";import{fileURLToPath as xK}from"url";import{format as GK}from"util";import{normalize as HK,resolve as zK}from"path";function F1($){if(!($!==$.toLowerCase()&&$!==$.toUpperCase()))$=$.toLowerCase();if($.indexOf("-")===-1&&$.indexOf("_")===-1)return $;else{let X="",Z=!1,q=$.match(/^-+/);for(let Y=q?q[0].length:0;Y<$.length;Y++){let Q=$.charAt(Y);if(Z)Z=!1,Q=Q.toUpperCase();if(Y!==0&&(Q==="-"||Q==="_"))Z=!0;else if(Q!=="-"&&Q!=="_")X+=Q}return X}}function y4($,J){let X=$.toLowerCase();J=J||"-";let Z="";for(let q=0;q<$.length;q++){let Y=X.charAt(q),Q=$.charAt(q);if(Y!==Q&&q>0)Z+=`${J}${X.charAt(q)}`;else Z+=Q}return Z}function g4($){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 mX($){if(Array.isArray($))return $.map((Q)=>typeof Q!=="string"?Q+"":Q);$=$.trim();let J=0,X=null,Z=null,q=null,Y=[];for(let Q=0;Q<$.length;Q++){if(X=Z,Z=$.charAt(Q),Z===" "&&!q){if(X!==" ")J++;continue}if(Z===q)q=null;else if((Z==="'"||Z==='"')&&!q)q=Z;if(!Y[J])Y[J]="";Y[J]+=Z}return Y}var w0;(function($){$.BOOLEAN="boolean",$.STRING="string",$.NUMBER="number",$.ARRAY="array"})(w0||(w0={}));var s0;class g3{constructor($){s0=$}parse($,J){let X=Object.assign({alias:void 0,array:void 0,boolean:void 0,config:void 0,configObjects:void 0,configuration:void 0,coerce:void 0,count:void 0,default:void 0,envPrefix:void 0,narg:void 0,normalize:void 0,string:void 0,number:void 0,__:void 0,key:void 0},J),Z=mX($),q=typeof $==="string",Y=qK(Object.assign(Object.create(null),X.alias)),Q=Object.assign({"boolean-negation":!0,"camel-case-expansion":!0,"combine-arrays":!1,"dot-notation":!0,"duplicate-arguments-array":!0,"flatten-duplicate-arrays":!0,"greedy-arrays":!0,"halt-at-non-option":!1,"nargs-eats-options":!1,"negation-prefix":"no-","parse-numbers":!0,"parse-positional-numbers":!0,"populate--":!1,"set-placeholder-key":!1,"short-option-groups":!0,"strip-aliased":!1,"strip-dashed":!1,"unknown-options-as-args":!1},X.configuration),G=Object.assign(Object.create(null),X.default),H=X.configObjects||[],B=X.envPrefix,U=Q["populate--"],K=U?"--":"_",W=Object.create(null),P=Object.create(null),R=X.__||s0.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:[]},M=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,C=new RegExp("^--"+Q["negation-prefix"]+"(.+)");if([].concat(X.array||[]).filter(Boolean).forEach(function(V){let T=typeof V==="object"?V.key:V,x=Object.keys(V).map(function(F){return{boolean:"bools",string:"strings",number:"numbers"}[F]}).filter(Boolean).pop();if(x)L[x][T]=!0;L.arrays[T]=!0,L.keys.push(T)}),[].concat(X.boolean||[]).filter(Boolean).forEach(function(V){L.bools[V]=!0,L.keys.push(V)}),[].concat(X.string||[]).filter(Boolean).forEach(function(V){L.strings[V]=!0,L.keys.push(V)}),[].concat(X.number||[]).filter(Boolean).forEach(function(V){L.numbers[V]=!0,L.keys.push(V)}),[].concat(X.count||[]).filter(Boolean).forEach(function(V){L.counts[V]=!0,L.keys.push(V)}),[].concat(X.normalize||[]).filter(Boolean).forEach(function(V){L.normalize[V]=!0,L.keys.push(V)}),typeof X.narg==="object")Object.entries(X.narg).forEach(([V,T])=>{if(typeof T==="number")L.nargs[V]=T,L.keys.push(V)});if(typeof X.coerce==="object")Object.entries(X.coerce).forEach(([V,T])=>{if(typeof T==="function")L.coercions[V]=T,L.keys.push(V)});if(typeof X.config<"u"){if(Array.isArray(X.config)||typeof X.config==="string")[].concat(X.config).filter(Boolean).forEach(function(V){L.configs[V]=!0});else if(typeof X.config==="object")Object.entries(X.config).forEach(([V,T])=>{if(typeof T==="boolean"||typeof T==="function")L.configs[V]=T})}X$(X.key,Y,X.default,L.arrays),Object.keys(G).forEach(function(V){(L.aliases[V]||[]).forEach(function(T){G[T]=G[V]})});let A=null;$2();let m=[],j=Object.assign(Object.create(null),{_:[]}),l={};for(let V=0;V<Z.length;V++){let T=Z[V],x=T.replace(/^-{3,}/,"---"),F,_,N,w,f,B0;if(T!=="--"&&/^-/.test(T)&&o(T))n(T);else if(x.match(/^---+(=|$)/)){n(T);continue}else if(T.match(/^--.+=/)||!Q["short-option-groups"]&&T.match(/^-.+=/)){if(w=T.match(/^--?([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)if(v(w[1],L.arrays))V=L0(V,w[1],Z,w[2]);else if(v(w[1],L.nargs)!==!1)V=t(V,w[1],Z,w[2]);else p(w[1],w[2],!0)}else if(T.match(C)&&Q["boolean-negation"]){if(w=T.match(C),w!==null&&Array.isArray(w)&&w.length>=2)_=w[1],p(_,v(_,L.arrays)?[!1]:!1)}else if(T.match(/^--.+/)||!Q["short-option-groups"]&&T.match(/^-[^-]+/)){if(w=T.match(/^--?(.+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(_=w[1],v(_,L.arrays))V=L0(V,_,Z);else if(v(_,L.nargs)!==!1)V=t(V,_,Z);else if(f=Z[V+1],f!==void 0&&(!f.match(/^-/)||f.match(M))&&!v(_,L.bools)&&!v(_,L.counts))p(_,f),V++;else if(/^(true|false)$/.test(f))p(_,f),V++;else p(_,u(_))}else if(T.match(/^-.\..+=/)){if(w=T.match(/^-([^=]+)=([\s\S]*)$/),w!==null&&Array.isArray(w)&&w.length>=3)p(w[1],w[2])}else if(T.match(/^-.\..+/)&&!T.match(M)){if(f=Z[V+1],w=T.match(/^-(.\..+)/),w!==null&&Array.isArray(w)&&w.length>=2)if(_=w[1],f!==void 0&&!f.match(/^-/)&&!v(_,L.bools)&&!v(_,L.counts))p(_,f),V++;else p(_,u(_))}else if(T.match(/^-[^-]+/)&&!T.match(M)){N=T.slice(1,-1).split(""),F=!1;for(let _0=0;_0<N.length;_0++){if(f=T.slice(_0+2),N[_0+1]&&N[_0+1]==="="){if(B0=T.slice(_0+3),_=N[_0],v(_,L.arrays))V=L0(V,_,Z,B0);else if(v(_,L.nargs)!==!1)V=t(V,_,Z,B0);else p(_,B0);F=!0;break}if(f==="-"){p(N[_0],f);continue}if(/[A-Za-z]/.test(N[_0])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(f)&&v(f,L.bools)===!1){p(N[_0],f),F=!0;break}if(N[_0+1]&&N[_0+1].match(/\W/)){p(N[_0],f),F=!0;break}else p(N[_0],u(N[_0]))}if(_=T.slice(-1)[0],!F&&_!=="-")if(v(_,L.arrays))V=L0(V,_,Z);else if(v(_,L.nargs)!==!1)V=t(V,_,Z);else if(f=Z[V+1],f!==void 0&&(!/^(-|--)[^-]/.test(f)||f.match(M))&&!v(_,L.bools)&&!v(_,L.counts))p(_,f),V++;else if(/^(true|false)$/.test(f))p(_,f),V++;else p(_,u(_))}else if(T.match(/^-[0-9]$/)&&T.match(M)&&v(T.slice(1),L.bools))_=T.slice(1),p(_,u(_));else if(T==="--"){m=Z.slice(V+1);break}else if(Q["halt-at-non-option"]){m=Z.slice(V);break}else n(T)}if(q0(j,!0),q0(j,!1),D(j),i(),$1(j,L.aliases,G,!0),d(j),Q["set-placeholder-key"])Y0(j);if(Object.keys(L.counts).forEach(function(V){if(!a(j,V.split(".")))p(V,0)}),U&&m.length)j[K]=[];if(m.forEach(function(V){j[K].push(V)}),Q["camel-case-expansion"]&&Q["strip-dashed"])Object.keys(j).filter((V)=>V!=="--"&&V.includes("-")).forEach((V)=>{delete j[V]});if(Q["strip-aliased"])[].concat(...Object.keys(Y).map((V)=>Y[V])).forEach((V)=>{if(Q["camel-case-expansion"]&&V.includes("-"))delete j[V.split(".").map((T)=>F1(T)).join(".")];delete j[V]});function n(V){let T=I("_",V);if(typeof T==="string"||typeof T==="number")j._.push(T)}function t(V,T,x,F){let _,N=v(T,L.nargs);if(N=typeof N!=="number"||isNaN(N)?1:N,N===0){if(!H0(F))A=Error(R("Argument unexpected for: %s",T));return p(T,u(T)),V}let w=H0(F)?0:1;if(Q["nargs-eats-options"]){if(x.length-(V+1)+w<N)A=Error(R("Not enough arguments following: %s",T));w=N}else{for(_=V+1;_<x.length;_++)if(!x[_].match(/^-[^0-9]/)||x[_].match(M)||o(x[_]))w++;else break;if(w<N)A=Error(R("Not enough arguments following: %s",T))}let f=Math.min(w,N);if(!H0(F)&&f>0)p(T,F),f--;for(_=V+1;_<f+V+1;_++)p(T,x[_]);return V+f}function L0(V,T,x,F){let _=[],N=F||x[V+1],w=v(T,L.nargs);if(v(T,L.bools)&&!/^(true|false)$/.test(N))_.push(!0);else if(H0(N)||H0(F)&&/^-/.test(N)&&!M.test(N)&&!o(N)){if(G[T]!==void 0){let f=G[T];_=Array.isArray(f)?f:[f]}}else{if(!H0(F))_.push(O(T,F,!0));for(let f=V+1;f<x.length;f++){if(!Q["greedy-arrays"]&&_.length>0||w&&typeof w==="number"&&_.length>=w)break;if(N=x[f],/^-/.test(N)&&!M.test(N)&&!o(N))break;V=f,_.push(O(T,N,q))}}if(typeof w==="number"&&(w&&_.length<w||isNaN(w)&&_.length===0))A=Error(R("Not enough arguments following: %s",T));return p(T,_),V}function p(V,T,x=q){if(/-/.test(V)&&Q["camel-case-expansion"]){let N=V.split(".").map(function(w){return F1(w)}).join(".");l0(V,N)}let F=O(V,T,x),_=V.split(".");if(n0(j,_,F),L.aliases[V])L.aliases[V].forEach(function(N){let w=N.split(".");n0(j,w,F)});if(_.length>1&&Q["dot-notation"])(L.aliases[_[0]]||[]).forEach(function(N){let w=N.split("."),f=[].concat(_);if(f.shift(),w=w.concat(f),!(L.aliases[V]||[]).includes(w.join(".")))n0(j,w,F)});if(v(V,L.normalize)&&!v(V,L.arrays))[V].concat(L.aliases[V]||[]).forEach(function(w){Object.defineProperty(l,w,{enumerable:!0,get(){return T},set(f){T=typeof f==="string"?s0.normalize(f):f}})})}function l0(V,T){if(!(L.aliases[V]&&L.aliases[V].length))L.aliases[V]=[T],W[T]=!0;if(!(L.aliases[T]&&L.aliases[T].length))l0(T,V)}function O(V,T,x){if(x)T=YK(T);if(v(V,L.bools)||v(V,L.counts)){if(typeof T==="string")T=T==="true"}let F=Array.isArray(T)?T.map(function(_){return I(V,_)}):I(V,T);if(v(V,L.counts)&&(H0(F)||typeof F==="boolean"))F=y3();if(v(V,L.normalize)&&v(V,L.arrays))if(Array.isArray(T))F=T.map((_)=>{return s0.normalize(_)});else F=s0.normalize(T);return F}function I(V,T){if(!Q["parse-positional-numbers"]&&V==="_")return T;if(!v(V,L.strings)&&!v(V,L.bools)&&!Array.isArray(T)){if(g4(T)&&Q["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${T}`)))||!H0(T)&&v(V,L.numbers))T=Number(T)}return T}function D(V){let T=Object.create(null);$1(T,L.aliases,G),Object.keys(L.configs).forEach(function(x){let F=V[x]||T[x];if(F)try{let _=null,N=s0.resolve(s0.cwd(),F),w=L.configs[x];if(typeof w==="function"){try{_=w(N)}catch(f){_=f}if(_ instanceof Error){A=_;return}}else _=s0.require(N);y(_)}catch(_){if(_.name==="PermissionDenied")A=_;else if(V[x])A=Error(R("Invalid JSON config file: %s",F))}})}function y(V,T){Object.keys(V).forEach(function(x){let F=V[x],_=T?T+"."+x:x;if(typeof F==="object"&&F!==null&&!Array.isArray(F)&&Q["dot-notation"])y(F,_);else if(!a(j,_.split("."))||v(_,L.arrays)&&Q["combine-arrays"])p(_,F)})}function i(){if(typeof H<"u")H.forEach(function(V){y(V)})}function q0(V,T){if(typeof B>"u")return;let x=typeof B==="string"?B:"",F=s0.env();Object.keys(F).forEach(function(_){if(x===""||_.lastIndexOf(x,0)===0){let N=_.split("__").map(function(w,f){if(f===0)w=w.substring(x.length);return F1(w)});if((T&&L.configs[N.join(".")]||!T)&&!a(V,N))p(N.join("."),F[_])}})}function d(V){let T,x=new Set;Object.keys(V).forEach(function(F){if(!x.has(F)){if(T=v(F,L.coercions),typeof T==="function")try{let _=I(F,T(V[F]));[].concat(L.aliases[F]||[],F).forEach((N)=>{x.add(N),V[N]=_})}catch(_){A=_}}})}function Y0(V){return L.keys.forEach((T)=>{if(~T.indexOf("."))return;if(typeof V[T]>"u")V[T]=void 0}),V}function $1(V,T,x,F=!1){Object.keys(x).forEach(function(_){if(!a(V,_.split("."))){if(n0(V,_.split("."),x[_]),F)P[_]=!0;(T[_]||[]).forEach(function(N){if(a(V,N.split(".")))return;n0(V,N.split("."),x[_])})}})}function a(V,T){let x=V;if(!Q["dot-notation"])T=[T.join(".")];T.slice(0,-1).forEach(function(_){x=x[_]||{}});let F=T[T.length-1];if(typeof x!=="object")return!1;else return F in x}function n0(V,T,x){let F=V;if(!Q["dot-notation"])T=[T.join(".")];T.slice(0,-1).forEach(function(B0){if(B0=pX(B0),typeof F==="object"&&F[B0]===void 0)F[B0]={};if(typeof F[B0]!=="object"||Array.isArray(F[B0])){if(Array.isArray(F[B0]))F[B0].push({});else F[B0]=[F[B0],{}];F=F[B0][F[B0].length-1]}else F=F[B0]});let _=pX(T[T.length-1]),N=v(T.join("."),L.arrays),w=Array.isArray(x),f=Q["duplicate-arguments-array"];if(!f&&v(_,L.nargs)){if(f=!0,!H0(F[_])&&L.nargs[_]===1||Array.isArray(F[_])&&F[_].length===L.nargs[_])F[_]=void 0}if(x===y3())F[_]=y3(F[_]);else if(Array.isArray(F[_]))if(f&&N&&w)F[_]=Q["flatten-duplicate-arrays"]?F[_].concat(x):(Array.isArray(F[_][0])?F[_]:[F[_]]).concat([x]);else if(!f&&Boolean(N)===Boolean(w))F[_]=x;else F[_]=F[_].concat([x]);else if(F[_]===void 0&&N)F[_]=w?x:[x];else if(f&&!(F[_]===void 0||v(_,L.counts)||v(_,L.bools)))F[_]=[F[_],x];else F[_]=x}function X$(...V){V.forEach(function(T){Object.keys(T||{}).forEach(function(x){if(L.aliases[x])return;L.aliases[x]=[].concat(Y[x]||[]),L.aliases[x].concat(x).forEach(function(F){if(/-/.test(F)&&Q["camel-case-expansion"]){let _=F1(F);if(_!==x&&L.aliases[x].indexOf(_)===-1)L.aliases[x].push(_),W[_]=!0}}),L.aliases[x].concat(x).forEach(function(F){if(F.length>1&&/[A-Z]/.test(F)&&Q["camel-case-expansion"]){let _=y4(F,"-");if(_!==x&&L.aliases[x].indexOf(_)===-1)L.aliases[x].push(_),W[_]=!0}}),L.aliases[x].forEach(function(F){L.aliases[F]=[x].concat(L.aliases[x].filter(function(_){return F!==_}))})})})}function v(V,T){let x=[].concat(L.aliases[V]||[],V),F=Object.keys(T),_=x.find((N)=>F.includes(N));return _?T[_]:!1}function S1(V){let T=Object.keys(L);return[].concat(T.map((F)=>L[F])).some(function(F){return Array.isArray(F)?F.includes(V):F[V]})}function B6(V,...T){return[].concat(...T).some(function(F){let _=V.match(F);return _&&S1(_[1])})}function k(V){if(V.match(M)||!V.match(/^-[^-]+/))return!1;let T=!0,x,F=V.slice(1).split("");for(let _=0;_<F.length;_++){if(x=V.slice(_+2),!S1(F[_])){T=!1;break}if(F[_+1]&&F[_+1]==="="||x==="-"||/[A-Za-z]/.test(F[_])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(x)||F[_+1]&&F[_+1].match(/\W/))break}return T}function o(V){return Q["unknown-options-as-args"]&&G0(V)}function G0(V){if(V=V.replace(/^-{3,}/,"--"),V.match(M))return!1;if(k(V))return!1;return!B6(V,/^-+([^=]+?)=[\s\S]*$/,C,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}function u(V){if(!v(V,L.bools)&&!v(V,L.counts)&&`${V}`in G)return G[V];else return W0(J0(V))}function W0(V){return{[w0.BOOLEAN]:!0,[w0.STRING]:"",[w0.NUMBER]:void 0,[w0.ARRAY]:[]}[V]}function J0(V){let T=w0.BOOLEAN;if(v(V,L.strings))T=w0.STRING;else if(v(V,L.numbers))T=w0.NUMBER;else if(v(V,L.bools))T=w0.BOOLEAN;else if(v(V,L.arrays))T=w0.ARRAY;return T}function H0(V){return V===void 0}function $2(){Object.keys(L.counts).find((V)=>{if(v(V,L.arrays))return A=Error(R("Invalid configuration: %s, opts.count excludes opts.array.",V)),!0;else if(v(V,L.nargs))return A=Error(R("Invalid configuration: %s, opts.count excludes opts.narg.",V)),!0;return!1})}return{aliases:Object.assign({},L.aliases),argv:Object.assign(l,j),configuration:Q,defaulted:Object.assign({},P),error:A,newAliases:Object.assign({},W)}}}function qK($){let J=[],X=Object.create(null),Z=!0;Object.keys($).forEach(function(q){J.push([].concat($[q],q))});while(Z){Z=!1;for(let q=0;q<J.length;q++)for(let Y=q+1;Y<J.length;Y++)if(J[q].filter(function(G){return J[Y].indexOf(G)!==-1}).length){J[q]=J[q].concat(J[Y]),J.splice(Y,1),Z=!0;break}}return J.forEach(function(q){q=q.filter(function(Q,G,H){return H.indexOf(Q)===G});let Y=q.pop();if(Y!==void 0&&typeof Y==="string")X[Y]=q}),X}function y3($){return $!==void 0?$+1:1}function pX($){if($==="__proto__")return"___proto___";return $}function YK($){return typeof $==="string"&&($[0]==="'"||$[0]==='"')&&$[$.length-1]===$[0]?$.substring(1,$.length-1):$}var c3,u3,m3,dX=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12,lX=(u3=(c3=process===null||process===void 0?void 0:process.versions)===null||c3===void 0?void 0:c3.node)!==null&&u3!==void 0?u3:(m3=process===null||process===void 0?void 0:process.version)===null||m3===void 0?void 0:m3.slice(1);if(lX){if(Number(lX.match(/^([^.]+)/)[1])<dX)throw Error(`yargs parser supports a minimum Node.js version of ${dX}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}var BK=process?process.env:{},nX=new g3({cwd:process.cwd,env:()=>{return BK},format:GK,normalize:HK,resolve:zK,require:($)=>{return V0($)}}),P$=function(J,X){return nX.parse(J.slice(),X).argv};P$.detailed=function($,J){return nX.parse($.slice(),J)};P$.camelCase=F1;P$.decamelize=y4;P$.looksLikeNumber=g4;var p3=P$;import{basename as jK,dirname as IK,extname as wK,relative as OK,resolve as eX}from"path";function iX(){if(KK())return 0;return 1}function KK(){return UK()&&!process.defaultApp}function UK(){return!!process.versions.electron}function d3($){return $.slice(iX()+1)}function tX(){return process.argv[iX()]}class r extends Error{constructor($){super($||"yargs error");if(this.name="YError",Error.captureStackTrace)Error.captureStackTrace(this,r)}}import{readFileSync as WK,statSync as VK,writeFile as LK}from"fs";import{format as _K}from"util";import{resolve as RK}from"path";var oX={fs:{readFileSync:WK,writeFile:LK},format:_K,resolve:RK,exists:($)=>{try{return VK($).isFile()}catch(J){return!1}}};var k0;class aX{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 J=$.shift(),X=function(){};if(typeof $[$.length-1]==="function")X=$.pop();if(X=X||function(){},!this.cache[this.locale])this._readLocaleFile();if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]=J,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:X});else X();return k0.format.apply(k0.format,[this.cache[this.locale][J]||J].concat($))}__n(){let $=Array.prototype.slice.call(arguments),J=$.shift(),X=$.shift(),Z=$.shift(),q=function(){};if(typeof $[$.length-1]==="function")q=$.pop();if(!this.cache[this.locale])this._readLocaleFile();let Y=Z===1?J:X;if(this.cache[this.locale][J])Y=this.cache[this.locale][J][Z===1?"one":"other"];if(!this.cache[this.locale][J]&&this.updateFiles)this.cache[this.locale][J]={one:J,other:X},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:q});else q();let Q=[Y];if(~Y.indexOf("%d"))Q.push(Z);return k0.format.apply(k0.format,Q.concat($))}setLocale($){this.locale=$}getLocale(){return this.locale}updateLocale($){if(!this.cache[this.locale])this._readLocaleFile();for(let J in $)if(Object.prototype.hasOwnProperty.call($,J))this.cache[this.locale][J]=$[J]}_taggedLiteral($,...J){let X="";return $.forEach(function(Z,q){let Y=J[q+1];if(X+=Z,typeof Y<"u")X+="%s"}),this.__.apply(this,[X].concat([].slice.call(J,1)))}_enqueueWrite($){if(this.writeQueue.push($),this.writeQueue.length===1)this._processWriteQueue()}_processWriteQueue(){let $=this,J=this.writeQueue[0],X=J.directory,Z=J.locale,q=J.cb,Y=this._resolveLocaleFile(X,Z),Q=JSON.stringify(this.cache[Z],null,2);k0.fs.writeFile(Y,Q,"utf-8",function(G){if($.writeQueue.shift(),$.writeQueue.length>0)$._processWriteQueue();q(G)})}_readLocaleFile(){let $={},J=this._resolveLocaleFile(this.directory,this.locale);try{if(k0.fs.readFileSync)$=JSON.parse(k0.fs.readFileSync(J,"utf-8"))}catch(X){if(X instanceof SyntaxError)X.message="syntax error in "+J;if(X.code==="ENOENT")$={};else throw X}this.cache[this.locale]=$}_resolveLocaleFile($,J){let X=k0.resolve($,"./",J+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(X)&&~J.lastIndexOf("_")){let Z=k0.resolve($,"./",J.split("_")[0]+".json");if(this._fileExistsSync(Z))X=Z}return X}_fileExistsSync($){return k0.exists($)}}function rX($,J){k0=J;let X=new aX($);return{__:X.__.bind(X),__n:X.__n.bind(X),setLocale:X.setLocale.bind(X),getLocale:X.getLocale.bind(X),updateLocale:X.updateLocale.bind(X),locale:X.locale}}var TK=($)=>{return rX($,oX)},sX=TK;var EK="require is not supported by ESM",$Z="loading a directory of commands is not supported yet for ESM",F$;try{F$=xK(import.meta.url)}catch($){F$=process.cwd()}var hK=F$.substring(0,F$.lastIndexOf("node_modules")),l3={assert:{notStrictEqual:PK,strictEqual:FK},cliui:k3,findUp:b3,getEnv:($)=>{return process.env[$]},inspect:MK,getCallerFile:()=>{throw new r($Z)},getProcessArgvBin:tX,mainFilename:hK||process.cwd(),Parser:p3,path:{basename:jK,dirname:IK,extname:wK,relative:OK,resolve:eX},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:($,J)=>process.emitWarning($,J),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:typeof process.stdout.columns<"u"?process.stdout.columns:null},readFileSync:CK,require:()=>{throw new r(EK)},requireDirectory:()=>{throw new r($Z)},stringWidth:($)=>{return[...$].length},y18n:sX({directory:eX(F$,"../../../locales"),updateFiles:!1})};function T0($,J,X,Z){X.assert.notStrictEqual($,J,Z)}function n3($,J){J.assert.strictEqual(typeof $,"string")}function a1($){return Object.keys($)}function s($){return!!$&&!!$.then&&typeof $.then==="function"}function Y1($){let X=$.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),Z=/\.*[\][<>]/g,q=X.shift();if(!q)throw Error(`No command found in: ${$}`);let Y={cmd:q.replace(Z,""),demanded:[],optional:[]};return X.forEach((Q,G)=>{let H=!1;if(Q=Q.replace(/\s/g,""),/\.+[\]>]/.test(Q)&&G===X.length-1)H=!0;if(/^\[/.test(Q))Y.optional.push({cmd:Q.replace(Z,"").split("|"),variadic:H});else Y.demanded.push({cmd:Q.replace(Z,"").split("|"),variadic:H})}),Y}var AK=["first","second","third","fourth","fifth","sixth"];function E($,J,X){function Z(){return typeof $==="object"?[{demanded:[],optional:[]},$,J]:[Y1(`cmd ${$}`),J,X]}try{let q=0,[Y,Q,G]=Z(),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 r(`Not enough arguments provided. Expected ${Y.demanded.length} but received ${H.length}.`);let U=Y.demanded.length+Y.optional.length;if(B>U)throw new r(`Too many arguments provided. Expected max ${U} but received ${B}.`);Y.demanded.forEach((K)=>{let W=H.shift(),P=JZ(W);if(K.cmd.filter((L)=>L===P||L==="*").length===0)XZ(P,K.cmd,q);q+=1}),Y.optional.forEach((K)=>{if(H.length===0)return;let W=H.shift(),P=JZ(W);if(K.cmd.filter((L)=>L===P||L==="*").length===0)XZ(P,K.cmd,q);q+=1})}catch(q){console.warn(q.stack)}}function JZ($){if(Array.isArray($))return"array";else if($===null)return"null";return typeof $}function XZ($,J,X){throw new r(`Invalid ${AK[X]||"manyith"} argument. Expected ${J.join(" or ")} but received ${$}.`)}class i3{constructor($){this.globalMiddleware=[],this.frozens=[],this.yargs=$}addMiddleware($,J,X=!0,Z=!1){if(E("<array|function> [boolean] [boolean] [boolean]",[$,J,X],arguments.length),Array.isArray($)){for(let q=0;q<$.length;q++){if(typeof $[q]!=="function")throw Error("middleware must be a function");let Y=$[q];Y.applyBeforeValidation=J,Y.global=X}Array.prototype.push.apply(this.globalMiddleware,$)}else if(typeof $==="function"){let q=$;q.applyBeforeValidation=J,q.global=X,q.mutates=Z,this.globalMiddleware.push($)}return this.yargs}addCoerceMiddleware($,J){let X=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((Z)=>{let q=[...X[J]||[],J];if(!Z.option)return!0;else return!q.includes(Z.option)}),$.option=J,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 ZZ($){if(!$)return[];return $.map((J)=>{return J.applyBeforeValidation=!1,J})}function M1($,J,X,Z){return X.reduce((q,Y)=>{if(Y.applyBeforeValidation!==Z)return q;if(Y.mutates){if(Y.applied)return q;Y.applied=!0}if(s(q))return q.then((Q)=>Promise.all([Q,Y(Q,J)])).then(([Q,G])=>Object.assign(Q,G));else{let Q=Y(q,J);return s(Q)?Q.then((G)=>Object.assign(q,G)):Object.assign(q,Q)}},$)}function C1($,J,X=(Z)=>{throw Z}){try{let Z=NK($)?$():$;return s(Z)?Z.then((q)=>J(q)):J(Z)}catch(Z){return X(Z)}}function NK($){return typeof $==="function"}function t3($){for(let J=0,X=Object.keys(V0.cache),Z;J<X.length;J++)if(Z=V0.cache[X[J]],Z.exports===$)return Z;return null}var r1=/(^\*)|(^\$0)/;class qZ{constructor($,J,X,Z){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=Z,this.usage=$,this.globalMiddleware=X,this.validation=J}addDirectory($,J,X,Z){if(Z=Z||{},typeof Z.recurse!=="boolean")Z.recurse=!1;if(!Array.isArray(Z.extensions))Z.extensions=["js"];let q=typeof Z.visit==="function"?Z.visit:(Y)=>Y;Z.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:J,filename:X},$,Z)}addHandler($,J,X,Z,q,Y){let Q=[],G=ZZ(q);if(Z=Z||(()=>{}),Array.isArray($))if(DK($))[$,...Q]=$;else for(let H of $)this.addHandler(H);else if(fK($)){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(QZ(X)){this.addHandler([$].concat(Q),J,X.builder,X.handler,X.middlewares,X.deprecated);return}if(typeof $==="string"){let H=Y1($);Q=Q.map((K)=>Y1(K).cmd);let B=!1,U=[H.cmd].concat(Q).filter((K)=>{if(r1.test(K))return B=!0,!1;return!0});if(U.length===0&&B)U.push("$0");if(B)H.cmd=U[0],Q=U.slice(1),$=$.replace(r1,H.cmd);if(Q.forEach((K)=>{this.aliasMap[K]=H.cmd}),J!==!1)this.usage.command($,J,B,Q,Y);if(this.handlers[H.cmd]={original:$,description:J,handler:Z,builder:X||{},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($,J,X,Z,q,Y){let Q=this.handlers[$]||this.handlers[this.aliasMap[$]]||this.defaultCommand,G=J.getInternalMethods().getContext(),H=G.commands.slice(),B=!$;if($)G.commands.push($),G.fullCommands.push(Q.original);let U=this.applyBuilderUpdateUsageAndParse(B,Q,J,X.aliases,H,Z,q,Y);return s(U)?U.then((K)=>this.applyMiddlewareAndGetResult(B,Q,K.innerArgv,G,q,K.aliases,J)):this.applyMiddlewareAndGetResult(B,Q,U.innerArgv,G,q,U.aliases,J)}applyBuilderUpdateUsageAndParse($,J,X,Z,q,Y,Q,G){let H=J.builder,B=X;if(c4(H)){X.getInternalMethods().getUsageInstance().freeze();let U=H(X.getInternalMethods().reset(Z),G);if(s(U))return U.then((K)=>{return B=GZ(K)?K:X,this.parseAndUpdateUsage($,J,B,q,Y,Q)})}else if(SK(H))X.getInternalMethods().getUsageInstance().freeze(),B=X.getInternalMethods().reset(Z),Object.keys(J.builder).forEach((U)=>{B.option(U,H[U])});return this.parseAndUpdateUsage($,J,B,q,Y,Q)}parseAndUpdateUsage($,J,X,Z,q,Y){if($)X.getInternalMethods().getUsageInstance().unfreeze(!0);if(this.shouldUpdateUsage(X))X.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(Z,J),J.description);let Q=X.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,q,Y);return s(Q)?Q.then((G)=>({aliases:X.parsed.aliases,innerArgv:G})):{aliases:X.parsed.aliases,innerArgv:Q}}shouldUpdateUsage($){return!$.getInternalMethods().getUsageInstance().getUsageDisabled()&&$.getInternalMethods().getUsageInstance().getUsage().length===0}usageFromParentCommandsCommandHandler($,J){let X=r1.test(J.original)?J.original.replace(r1,"").trim():J.original,Z=$.filter((q)=>{return!r1.test(q)});return Z.push(X),`$0 ${Z.join(" ")}`}handleValidationAndGetResult($,J,X,Z,q,Y,Q,G){if(!Y.getInternalMethods().getHasOutput()){let H=Y.getInternalMethods().runValidation(q,G,Y.parsed.error,$);X=C1(X,(B)=>{return H(B),B})}if(J.handler&&!Y.getInternalMethods().getHasOutput()){Y.getInternalMethods().setHasOutput();let H=!!Y.getOptions().configuration["populate--"];if(Y.getInternalMethods().postProcess(X,H,!1,!1),X=M1(X,Y,Q,!1),X=C1(X,(B)=>{let U=J.handler(B);return s(U)?U.then(()=>B):B}),!$)Y.getInternalMethods().getUsageInstance().cacheHelpMessage();if(s(X)&&!Y.getInternalMethods().hasParseCallback())X.catch((B)=>{try{Y.getInternalMethods().getUsageInstance().fail(null,B)}catch(U){}})}if(!$)Z.commands.pop(),Z.fullCommands.pop();return X}applyMiddlewareAndGetResult($,J,X,Z,q,Y,Q){let G={};if(q)return X;if(!Q.getInternalMethods().getHasOutput())G=this.populatePositionals(J,X,Z,Q);let H=this.globalMiddleware.getMiddleware().slice(0).concat(J.middlewares),B=M1(X,Q,H,!0);return s(B)?B.then((U)=>this.handleValidationAndGetResult($,J,U,Z,Y,Q,H,G)):this.handleValidationAndGetResult($,J,B,Z,Y,Q,H,G)}populatePositionals($,J,X,Z){J._=J._.slice(X.commands.length);let q=$.demanded.slice(0),Y=$.optional.slice(0),Q={};this.validation.positionalCount(q.length,J._.length);while(q.length){let G=q.shift();this.populatePositional(G,J,Q)}while(Y.length){let G=Y.shift();this.populatePositional(G,J,Q)}return J._=X.commands.concat(J._.map((G)=>""+G)),this.postProcessPositionals(J,Q,this.cmdToParseOptions($.original),Z),Q}populatePositional($,J,X){let Z=$.cmd[0];if($.variadic)X[Z]=J._.splice(0).map(String);else if(J._.length)X[Z]=[String(J._.shift())]}cmdToParseOptions($){let J={array:[],default:{},alias:{},demand:{}},X=Y1($);return X.demanded.forEach((Z)=>{let[q,...Y]=Z.cmd;if(Z.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y,J.demand[q]=!0}),X.optional.forEach((Z)=>{let[q,...Y]=Z.cmd;if(Z.variadic)J.array.push(q),J.default[q]=[];J.alias[q]=Y}),J}postProcessPositionals($,J,X,Z){let q=Object.assign({},Z.getOptions());q.default=Object.assign(X.default,q.default);for(let H of Object.keys(X.alias))q.alias[H]=(q.alias[H]||[]).concat(X.alias[H]);q.array=q.array.concat(X.array),q.config={};let Y=[];if(Object.keys(J).forEach((H)=>{J[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)Z.getInternalMethods().getUsageInstance().fail(G.error.message,G.error);else{let H=Object.keys(J);Object.keys(J).forEach((B)=>{H.push(...G.aliases[B])}),Object.keys(G.argv).forEach((B)=>{if(H.includes(B)){if(!J[B])J[B]=G.argv[B];if(!this.isInConfigs(Z,B)&&!this.isDefaulted(Z,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($,J){let{default:X}=$.getOptions();return Object.prototype.hasOwnProperty.call(X,J)||Object.prototype.hasOwnProperty.call(X,this.shim.Parser.camelCase(J))}isInConfigs($,J){let{configObjects:X}=$.getOptions();return X.some((Z)=>Object.prototype.hasOwnProperty.call(Z,J))||X.some((Z)=>Object.prototype.hasOwnProperty.call(Z,this.shim.Parser.camelCase(J)))}runDefaultBuilderOn($){if(!this.defaultCommand)return;if(this.shouldUpdateUsage($)){let X=r1.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");$.getInternalMethods().getUsageInstance().usage(X,this.defaultCommand.description)}let J=this.defaultCommand.builder;if(c4(J))return J($,!0);else if(!QZ(J))Object.keys(J).forEach((X)=>{$.option(X,J[X])});return}moduleName($){let J=t3($);if(!J)throw Error(`No command name given for module: ${this.shim.inspect($)}`);return this.commandFromFilename(J.filename)}commandFromFilename($){return this.shim.path.basename($,this.shim.path.extname($))}extractDesc({describe:$,description:J,desc:X}){for(let Z of[$,J,X]){if(typeof Z==="string"||Z===!1)return Z;T0(Z,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){let $=this.frozens.pop();T0($,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 YZ($,J,X,Z){return new qZ($,J,X,Z)}function QZ($){return typeof $==="object"&&!!$.builder&&typeof $.handler==="function"}function DK($){return $.every((J)=>typeof J==="string")}function c4($){return typeof $==="function"}function SK($){return typeof $==="object"}function fK($){return typeof $==="object"&&!Array.isArray($)}function G1($={},J=()=>!0){let X={};return a1($).forEach((Z)=>{if(J(Z,$[Z]))X[Z]=$[Z]}),X}function H1($){if(typeof process>"u")return;[process.stdout,process.stderr].forEach((J)=>{let X=J;if(X._handle&&X.isTTY&&typeof X._handle.setBlocking==="function")X._handle.setBlocking($)})}function vK($){return typeof $==="boolean"}function zZ($,J){let X=J.y18n.__,Z={},q=[];Z.failFn=function(I){q.push(I)};let Y=null,Q=null,G=!0;Z.showHelpOnFail=function(I=!0,D){let[y,i]=typeof I==="string"?[!0,I]:[I,D];if($.getInternalMethods().isGlobalContext())Q=i;return Y=i,G=y,Z};let H=!1;Z.fail=function(I,D){let y=$.getInternalMethods().getLoggerInstance();if(q.length)for(let i=q.length-1;i>=0;--i){let q0=q[i];if(vK(q0)){if(D)throw D;else if(I)throw Error(I)}else q0(I,D,Z)}else{if($.getExitProcess())H1(!0);if(!H){if(H=!0,G)$.showHelp("error"),y.error();if(I||D)y.error(I||D);let i=Y||Q;if(i){if(I||D)y.error("");y.error(i)}}if(D=D||new r(I),$.getExitProcess())return $.exit(1);else if($.getInternalMethods().hasParseCallback())return $.exit(1,D);else throw D}};let B=[],U=!1;Z.usage=(O,I)=>{if(O===null)return U=!0,B=[],Z;return U=!1,B.push([O,I||""]),Z},Z.getUsage=()=>{return B},Z.getUsageDisabled=()=>{return U},Z.getPositionalGroupName=()=>{return X("Positionals:")};let K=[];Z.example=(O,I)=>{K.push([O,I||""])};let W=[];Z.command=function(I,D,y,i,q0=!1){if(y)W=W.map((d)=>{return d[2]=!1,d});W.push([I,D||"",y,i,q0])},Z.getCommands=()=>W;let P={};Z.describe=function(I,D){if(Array.isArray(I))I.forEach((y)=>{Z.describe(y,D)});else if(typeof I==="object")Object.keys(I).forEach((y)=>{Z.describe(y,I[y])});else P[I]=D},Z.getDescriptions=()=>P;let R=[];Z.epilog=(O)=>{R.push(O)};let L=!1,M;Z.wrap=(O)=>{L=!0,M=O},Z.getWrap=()=>{if(J.getEnv("YARGS_DISABLE_WRAP"))return null;if(!L)M=L0(),L=!0;return M};let C="__yargsString__:";Z.deferY18nLookup=(O)=>C+O,Z.help=function(){if(j)return j;m();let I=$.customScriptName?$.$0:J.path.basename($.$0),D=$.getDemandedOptions(),y=$.getDemandedCommands(),i=$.getDeprecatedOptions(),q0=$.getGroups(),d=$.getOptions(),Y0=[];Y0=Y0.concat(Object.keys(P)),Y0=Y0.concat(Object.keys(D)),Y0=Y0.concat(Object.keys(y)),Y0=Y0.concat(Object.keys(d.default)),Y0=Y0.filter(n),Y0=Object.keys(Y0.reduce((k,o)=>{if(o!=="_")k[o]=!0;return k},{}));let $1=Z.getWrap(),a=J.cliui({width:$1,wrap:!!$1});if(!U){if(B.length)B.forEach((k)=>{if(a.div({text:`${k[0].replace(/\$0/g,I)}`}),k[1])a.div({text:`${k[1]}`,padding:[1,0,0,0]})}),a.div();else if(W.length){let k=null;if(y._)k=`${I} <${X("command")}>
62
+ `;else k=`${I} [${X("command")}]
63
+ `;a.div(`${k}`)}}if(W.length>1||W.length===1&&!W[0][2]){a.div(X("Commands:"));let k=$.getInternalMethods().getContext(),o=k.commands.length?`${k.commands.join(" ")} `:"";if($.getInternalMethods().getParserConfiguration()["sort-commands"]===!0)W=W.sort((u,W0)=>u[0].localeCompare(W0[0]));let G0=I?`${I} `:"";W.forEach((u)=>{let W0=`${G0}${o}${u[0].replace(/^\$0 ?/,"")}`;a.span({text:W0,padding:[0,2,0,2],width:A(W,$1,`${I}${o}`)+4},{text:u[1]});let J0=[];if(u[2])J0.push(`[${X("default")}]`);if(u[3]&&u[3].length)J0.push(`[${X("aliases:")} ${u[3].join(", ")}]`);if(u[4])if(typeof u[4]==="string")J0.push(`[${X("deprecated: %s",u[4])}]`);else J0.push(`[${X("deprecated")}]`);if(J0.length)a.div({text:J0.join(" "),padding:[0,0,0,2],align:"right"});else a.div()}),a.div()}let n0=(Object.keys(d.alias)||[]).concat(Object.keys($.parsed.newAliases)||[]);Y0=Y0.filter((k)=>!$.parsed.newAliases[k]&&n0.every((o)=>(d.alias[o]||[]).indexOf(k)===-1));let X$=X("Options:");if(!q0[X$])q0[X$]=[];l(Y0,d.alias,q0,X$);let v=(k)=>/^--/.test(u4(k)),S1=Object.keys(q0).filter((k)=>q0[k].length>0).map((k)=>{let o=q0[k].filter(n).map((G0)=>{if(n0.includes(G0))return G0;for(let u=0,W0;(W0=n0[u])!==void 0;u++)if((d.alias[W0]||[]).includes(G0))return W0;return G0});return{groupName:k,normalizedKeys:o}}).filter(({normalizedKeys:k})=>k.length>0).map(({groupName:k,normalizedKeys:o})=>{let G0=o.reduce((u,W0)=>{return u[W0]=[W0].concat(d.alias[W0]||[]).map((J0)=>{if(k===Z.getPositionalGroupName())return J0;else return(/^[0-9]$/.test(J0)?d.boolean.includes(W0)?"-":"--":J0.length>1?"--":"-")+J0}).sort((J0,H0)=>v(J0)===v(H0)?0:v(J0)?1:-1).join(", "),u},{});return{groupName:k,normalizedKeys:o,switches:G0}});if(S1.filter(({groupName:k})=>k!==Z.getPositionalGroupName()).some(({normalizedKeys:k,switches:o})=>!k.every((G0)=>v(o[G0]))))S1.filter(({groupName:k})=>k!==Z.getPositionalGroupName()).forEach(({normalizedKeys:k,switches:o})=>{k.forEach((G0)=>{if(v(o[G0]))o[G0]=kK(o[G0],4)})});if(S1.forEach(({groupName:k,normalizedKeys:o,switches:G0})=>{a.div(k),o.forEach((u)=>{let W0=G0[u],J0=P[u]||"",H0=null;if(J0.includes(C))J0=X(J0.substring(C.length));if(d.boolean.includes(u))H0=`[${X("boolean")}]`;if(d.count.includes(u))H0=`[${X("count")}]`;if(d.string.includes(u))H0=`[${X("string")}]`;if(d.normalize.includes(u))H0=`[${X("string")}]`;if(d.array.includes(u))H0=`[${X("array")}]`;if(d.number.includes(u))H0=`[${X("number")}]`;let $2=(x)=>typeof x==="string"?`[${X("deprecated: %s",x)}]`:`[${X("deprecated")}]`,V=[u in i?$2(i[u]):null,H0,u in D?`[${X("required")}]`:null,d.choices&&d.choices[u]?`[${X("choices:")} ${Z.stringifiedValues(d.choices[u])}]`:null,t(d.default[u],d.defaultDescription[u])].filter(Boolean).join(" ");a.span({text:u4(W0),padding:[0,2,0,2+HZ(W0)],width:A(G0,$1)+4},J0);let T=$.getInternalMethods().getUsageConfiguration()["hide-types"]===!0;if(V&&!T)a.div({text:V,padding:[0,0,0,2],align:"right"});else a.div()}),a.div()}),K.length)a.div(X("Examples:")),K.forEach((k)=>{k[0]=k[0].replace(/\$0/g,I)}),K.forEach((k)=>{if(k[1]==="")a.div({text:k[0],padding:[0,2,0,2]});else a.div({text:k[0],padding:[0,2,0,2],width:A(K,$1)+4},{text:k[1]})}),a.div();if(R.length>0){let k=R.map((o)=>o.replace(/\$0/g,I)).join(`
64
+ `);a.div(`${k}
65
+ `)}return a.toString().replace(/\s*$/,"")};function A(O,I,D){let y=0;if(!Array.isArray(O))O=Object.values(O).map((i)=>[i]);if(O.forEach((i)=>{y=Math.max(J.stringWidth(D?`${D} ${u4(i[0])}`:u4(i[0]))+HZ(i[0]),y)}),I)y=Math.min(y,parseInt((I*0.5).toString(),10));return y}function m(){let O=$.getDemandedOptions(),I=$.getOptions();(Object.keys(I.alias)||[]).forEach((D)=>{I.alias[D].forEach((y)=>{if(P[y])Z.describe(D,P[y]);if(y in O)$.demandOption(D,O[y]);if(I.boolean.includes(y))$.boolean(D);if(I.count.includes(y))$.count(D);if(I.string.includes(y))$.string(D);if(I.normalize.includes(y))$.normalize(D);if(I.array.includes(y))$.array(D);if(I.number.includes(y))$.number(D)})})}let j;Z.cacheHelpMessage=function(){j=this.help()},Z.clearCachedHelpMessage=function(){j=void 0},Z.hasCachedHelpMessage=function(){return!!j};function l(O,I,D,y){let i=[],q0=null;return Object.keys(D).forEach((d)=>{i=i.concat(D[d])}),O.forEach((d)=>{if(q0=[d].concat(I[d]),!q0.some((Y0)=>i.indexOf(Y0)!==-1))D[y].push(d)}),i}function n(O){return $.getOptions().hiddenOptions.indexOf(O)<0||$.parsed.argv[$.getOptions().showHiddenOpt]}Z.showHelp=(O)=>{let I=$.getInternalMethods().getLoggerInstance();if(!O)O="error";(typeof O==="function"?O:I[O])(Z.help())},Z.functionDescription=(O)=>{return["(",O.name?J.Parser.decamelize(O.name,"-"):X("generated-value"),")"].join("")},Z.stringifiedValues=function(I,D){let y="",i=D||", ",q0=[].concat(I);if(!I||!q0.length)return y;return q0.forEach((d)=>{if(y.length)y+=i;y+=JSON.stringify(d)}),y};function t(O,I){let D=`[${X("default:")} `;if(O===void 0&&!I)return null;if(I)D+=I;else switch(typeof O){case"string":D+=`"${O}"`;break;case"object":D+=JSON.stringify(O);break;default:D+=O}return`${D}]`}function L0(){if(J.process.stdColumns)return Math.min(80,J.process.stdColumns);else return 80}let p=null;Z.version=(O)=>{p=O},Z.showVersion=(O)=>{let I=$.getInternalMethods().getLoggerInstance();if(!O)O="error";(typeof O==="function"?O:I[O])(p)},Z.reset=function(I){return Y=null,H=!1,B=[],U=!1,R=[],K=[],W=[],P=G1(P,(D)=>!I[D]),Z};let l0=[];return Z.freeze=function(){l0.push({failMessage:Y,failureOutput:H,usages:B,usageDisabled:U,epilogs:R,examples:K,commands:W,descriptions:P})},Z.unfreeze=function(I=!1){let D=l0.pop();if(!D)return;if(I)P={...D.descriptions,...P},W=[...D.commands,...W],B=[...D.usages,...B],K=[...D.examples,...K],R=[...D.epilogs,...R];else({failMessage:Y,failureOutput:H,usages:B,usageDisabled:U,epilogs:R,examples:K,commands:W,descriptions:P}=D)},Z}function o3($){return typeof $==="object"}function kK($,J){return o3($)?{text:$.text,indentation:$.indentation+J}:{text:$,indentation:J}}function HZ($){return o3($)?$.indentation:0}function u4($){return o3($)?$.text:$}var BZ=`###-begin-{{app_name}}-completions-###
66
+ #
67
+ # yargs command completion script
68
+ #
69
+ # Installation: {{app_path}} {{completion_command}} >> ~/.bashrc
70
+ # or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.
71
+ #
72
+ _{{app_name}}_yargs_completions()
73
+ {
74
+ local cur_word args type_list
75
+
76
+ cur_word="\${COMP_WORDS[COMP_CWORD]}"
77
+ args=("\${COMP_WORDS[@]}")
78
+
79
+ # ask yargs to generate completions.
80
+ type_list=$({{app_path}} --get-yargs-completions "\${args[@]}")
81
+
82
+ COMPREPLY=( $(compgen -W "\${type_list}" -- \${cur_word}) )
83
+
84
+ # if no match was found, fall back to filename completion
85
+ if [ \${#COMPREPLY[@]} -eq 0 ]; then
86
+ COMPREPLY=()
87
+ fi
88
+
89
+ return 0
90
+ }
91
+ complete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}
92
+ ###-end-{{app_name}}-completions-###
93
+ `,KZ=`#compdef {{app_name}}
94
+ ###-begin-{{app_name}}-completions-###
95
+ #
96
+ # yargs command completion script
97
+ #
98
+ # Installation: {{app_path}} {{completion_command}} >> ~/.zshrc
99
+ # or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.
100
+ #
101
+ _{{app_name}}_yargs_completions()
102
+ {
103
+ local reply
104
+ local si=$IFS
105
+ IFS=$'
106
+ ' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "\${words[@]}"))
107
+ IFS=$si
108
+ _describe 'values' reply
109
+ }
110
+ compdef _{{app_name}}_yargs_completions {{app_name}}
111
+ ###-end-{{app_name}}-completions-###
112
+ `;class UZ{constructor($,J,X,Z){var q,Y,Q;this.yargs=$,this.usage=J,this.command=X,this.shim=Z,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($,J,X,Z){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(c4(H)){this.indexAfterLastReset=Q+1;let B=this.yargs.getInternalMethods().reset();return H(B,!0),B.argv}}let Y=[];this.commandCompletions(Y,$,X),this.optionCompletions(Y,$,J,X),this.choicesFromOptionsCompletions(Y,$,J,X),this.choicesFromPositionalsCompletions(Y,$,J,X),Z(null,Y)}commandCompletions($,J,X){let Z=this.yargs.getInternalMethods().getContext().commands;if(!X.match(/^-/)&&Z[Z.length-1]!==X&&!this.previousArgHasChoices(J))this.usage.getCommands().forEach((q)=>{let Y=Y1(q[0]).cmd;if(J.indexOf(Y)===-1)if(!this.zshShell)$.push(Y);else{let Q=q[1]||"";$.push(Y.replace(/:/g,"\\:")+":"+Q)}})}optionCompletions($,J,X,Z){if((Z.match(/^-/)||Z===""&&$.length===0)&&!this.previousArgHasChoices(J)){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(J,Q,G))this.completeOptionKey(Q,$,Z,G&&!!q.default[Q])})}}choicesFromOptionsCompletions($,J,X,Z){if(this.previousArgHasChoices(J)){let q=this.getPreviousArgChoices(J);if(q&&q.length>0)$.push(...q.map((Y)=>Y.replace(/:/g,"\\:")))}}choicesFromPositionalsCompletions($,J,X,Z){if(Z===""&&$.length>0&&this.previousArgHasChoices(J))return;let q=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],Y=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),Q=q[X._.length-Y-1];if(!Q)return;let G=this.yargs.getOptions().choices[Q]||[];for(let H of G)if(H.startsWith(Z))$.push(H.replace(/:/g,"\\:"))}getPreviousArgChoices($){if($.length<1)return;let J=$[$.length-1],X="";if(!J.startsWith("-")&&$.length>1)X=J,J=$[$.length-2];if(!J.startsWith("-"))return;let Z=J.replace(/^-+/,""),q=this.yargs.getOptions(),Y=[Z,...this.yargs.getAliases()[Z]||[]],Q;for(let G of Y)if(Object.prototype.hasOwnProperty.call(q.key,G)&&Array.isArray(q.choices[G])){Q=q.choices[G];break}if(Q)return Q.filter((G)=>!X||G.startsWith(X))}previousArgHasChoices($){let J=this.getPreviousArgChoices($);return J!==void 0&&J.length>0}argsContainKey($,J,X){let Z=(q)=>$.indexOf((/^[^0-9]$/.test(q)?"-":"--")+q)!==-1;if(Z(J))return!0;if(X&&Z(`no-${J}`))return!0;if(this.aliases){for(let q of this.aliases[J])if(Z(q))return!0}return!1}completeOptionKey($,J,X,Z){var q,Y,Q,G;let H=$;if(this.zshShell){let W=this.usage.getDescriptions(),P=(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((M)=>{let C=W[M];return typeof C==="string"&&C.length>0}),R=P?W[P]: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),U=(W)=>/^[^0-9]$/.test(W),K=!B(X)&&U($)?"-":"--";if(J.push(K+H),Z)J.push(K+"no-"+H)}customCompletion($,J,X,Z){if(T0(this.customCompletionFunction,null,this.shim),yK(this.customCompletionFunction)){let q=this.customCompletionFunction(X,J);if(s(q))return q.then((Y)=>{this.shim.process.nextTick(()=>{Z(null,Y)})}).catch((Y)=>{this.shim.process.nextTick(()=>{Z(Y,void 0)})});return Z(null,q)}else if(gK(this.customCompletionFunction))return this.customCompletionFunction(X,J,(q=Z)=>this.defaultCompletion($,J,X,q),(q)=>{Z(null,q)});else return this.customCompletionFunction(X,J,(q)=>{Z(null,q)})}getCompletion($,J){let X=$.length?$[$.length-1]:"",Z=this.yargs.parse($,!0),q=this.customCompletionFunction?(Y)=>this.customCompletion($,Y,X,J):(Y)=>this.defaultCompletion($,Y,X,J);return s(Z)?Z.then(q):q(Z)}generateCompletionScript($,J){let X=this.zshShell?KZ:BZ,Z=this.shim.path.basename($);if($.match(/\.js$/))$=`./${$}`;return X=X.replace(/{{app_name}}/g,Z),X=X.replace(/{{completion_command}}/g,J),X.replace(/{{app_path}}/g,$)}registerFunction($){this.customCompletionFunction=$}setParsed($){this.aliases=$.aliases}}function WZ($,J,X,Z){return new UZ($,J,X,Z)}function yK($){return $.length<3}function gK($){return $.length>3}function VZ($,J){if($.length===0)return J.length;if(J.length===0)return $.length;let X=[],Z;for(Z=0;Z<=J.length;Z++)X[Z]=[Z];let q;for(q=0;q<=$.length;q++)X[0][q]=q;for(Z=1;Z<=J.length;Z++)for(q=1;q<=$.length;q++)if(J.charAt(Z-1)===$.charAt(q-1))X[Z][q]=X[Z-1][q-1];else if(Z>1&&q>1&&J.charAt(Z-2)===$.charAt(q-1)&&J.charAt(Z-1)===$.charAt(q-2))X[Z][q]=X[Z-2][q-2]+1;else X[Z][q]=Math.min(X[Z-1][q-1]+1,Math.min(X[Z][q-1]+1,X[Z-1][q]+1));return X[J.length][$.length]}var LZ=["$0","--","_"];function _Z($,J,X){let Z=X.y18n.__,q=X.y18n.__n,Y={};Y.nonOptionCount=function(K){let W=$.getDemandedCommands(),R=K._.length+(K["--"]?K["--"].length:0)-$.getInternalMethods().getContext().commands.length;if(W._&&(R<W._.min||R>W._.max)){if(R<W._.min)if(W._.minMsg!==void 0)J.fail(W._.minMsg?W._.minMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.min.toString()):null);else J.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)J.fail(W._.maxMsg?W._.maxMsg.replace(/\$0/g,R.toString()).replace(/\$1/,W._.max.toString()):null);else J.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(K,W){if(W<K)J.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+"",K+""))},Y.requiredArguments=function(K,W){let P=null;for(let R of Object.keys(W))if(!Object.prototype.hasOwnProperty.call(K,R)||typeof K[R]>"u")P=P||{},P[R]=W[R];if(P){let R=[];for(let M of Object.keys(P)){let C=P[M];if(C&&R.indexOf(C)<0)R.push(C)}let L=R.length?`
113
+ ${R.join(`
114
+ `)}`:"";J.fail(q("Missing required argument: %s","Missing required arguments: %s",Object.keys(P).length,Object.keys(P).join(", ")+L))}},Y.unknownArguments=function(K,W,P,R,L=!0){var M;let C=$.getInternalMethods().getCommandInstance().getCommands(),A=[],m=$.getInternalMethods().getContext();if(Object.keys(K).forEach((j)=>{if(!LZ.includes(j)&&!Object.prototype.hasOwnProperty.call(P,j)&&!Object.prototype.hasOwnProperty.call($.getInternalMethods().getParseContext(),j)&&!Y.isValidAndSomeAliasIsNotNew(j,W))A.push(j)}),L&&(m.commands.length>0||C.length>0||R))K._.slice(m.commands.length).forEach((j)=>{if(!C.includes(""+j))A.push(""+j)});if(L){let l=((M=$.getDemandedCommands()._)===null||M===void 0?void 0:M.max)||0,n=m.commands.length+l;if(n<K._.length)K._.slice(n).forEach((t)=>{if(t=String(t),!m.commands.includes(t)&&!A.includes(t))A.push(t)})}if(A.length)J.fail(q("Unknown argument: %s","Unknown arguments: %s",A.length,A.map((j)=>j.trim()?j:`"${j}"`).join(", ")))},Y.unknownCommands=function(K){let W=$.getInternalMethods().getCommandInstance().getCommands(),P=[],R=$.getInternalMethods().getContext();if(R.commands.length>0||W.length>0)K._.slice(R.commands.length).forEach((L)=>{if(!W.includes(""+L))P.push(""+L)});if(P.length>0)return J.fail(q("Unknown command: %s","Unknown commands: %s",P.length,P.join(", "))),!0;else return!1},Y.isValidAndSomeAliasIsNotNew=function(K,W){if(!Object.prototype.hasOwnProperty.call(W,K))return!1;let P=$.parsed.newAliases;return[K,...W[K]].some((R)=>!Object.prototype.hasOwnProperty.call(P,R)||!P[K])},Y.limitedChoices=function(K){let W=$.getOptions(),P={};if(!Object.keys(W.choices).length)return;Object.keys(K).forEach((M)=>{if(LZ.indexOf(M)===-1&&Object.prototype.hasOwnProperty.call(W.choices,M))[].concat(K[M]).forEach((C)=>{if(W.choices[M].indexOf(C)===-1&&C!==void 0)P[M]=(P[M]||[]).concat(C)})});let R=Object.keys(P);if(!R.length)return;let L=Z("Invalid values:");R.forEach((M)=>{L+=`
115
+ ${Z("Argument: %s, Given: %s, Choices: %s",M,J.stringifiedValues(P[M]),J.stringifiedValues(W.choices[M]))}`}),J.fail(L)};let Q={};Y.implies=function(K,W){if(E("<string|object> [array|number|string]",[K,W],arguments.length),typeof K==="object")Object.keys(K).forEach((P)=>{Y.implies(P,K[P])});else{if($.global(K),!Q[K])Q[K]=[];if(Array.isArray(W))W.forEach((P)=>Y.implies(K,P));else T0(W,void 0,X),Q[K].push(W)}},Y.getImplied=function(){return Q};function G(U,K){let W=Number(K);if(K=isNaN(W)?K:W,typeof K==="number")K=U._.length>=K;else if(K.match(/^--no-.+/))K=K.match(/^--no-(.+)/)[1],K=!Object.prototype.hasOwnProperty.call(U,K);else K=Object.prototype.hasOwnProperty.call(U,K);return K}Y.implications=function(K){let W=[];if(Object.keys(Q).forEach((P)=>{let R=P;(Q[P]||[]).forEach((L)=>{let M=R,C=L;if(M=G(K,M),L=G(K,L),M&&!L)W.push(` ${R} -> ${C}`)})}),W.length){let P=`${Z("Implications failed:")}
116
+ `;W.forEach((R)=>{P+=R}),J.fail(P)}};let H={};Y.conflicts=function(K,W){if(E("<string|object> [array|string]",[K,W],arguments.length),typeof K==="object")Object.keys(K).forEach((P)=>{Y.conflicts(P,K[P])});else{if($.global(K),!H[K])H[K]=[];if(Array.isArray(W))W.forEach((P)=>Y.conflicts(K,P));else H[K].push(W)}},Y.getConflicting=()=>H,Y.conflicting=function(K){if(Object.keys(K).forEach((W)=>{if(H[W])H[W].forEach((P)=>{if(P&&K[W]!==void 0&&K[P]!==void 0)J.fail(Z("Arguments %s and %s are mutually exclusive",W,P))})}),$.getInternalMethods().getParserConfiguration()["strip-dashed"])Object.keys(H).forEach((W)=>{H[W].forEach((P)=>{if(P&&K[X.Parser.camelCase(W)]!==void 0&&K[X.Parser.camelCase(P)]!==void 0)J.fail(Z("Arguments %s and %s are mutually exclusive",W,P))})})},Y.recommendCommands=function(K,W){W=W.sort((M,C)=>C.length-M.length);let R=null,L=1/0;for(let M=0,C;(C=W[M])!==void 0;M++){let A=VZ(K,C);if(A<=3&&A<L)L=A,R=C}if(R)J.fail(Z("Did you mean %s?",R))},Y.reset=function(K){return Q=G1(Q,(W)=>!K[W]),H=G1(H,(W)=>!K[W]),Y};let B=[];return Y.freeze=function(){B.push({implied:Q,conflicting:H})},Y.unfreeze=function(){let K=B.pop();T0(K,void 0,X),{implied:Q,conflicting:H}=K},Y}var a3=[],M$;function C$($,J,X,Z){M$=Z;let q={};if(Object.prototype.hasOwnProperty.call($,"extends")){if(typeof $.extends!=="string")return q;let Y=/\.json|\..*rc$/.test($.extends),Q=null;if(!Y)try{Q=V0.resolve($.extends)}catch(G){return $}else Q=uK(J,$.extends);cK(Q),a3.push(Q),q=Y?JSON.parse(M$.readFileSync(Q,"utf8")):V0($.extends),delete $.extends,q=C$(q,M$.path.dirname(Q),X,M$)}return a3=[],X?RZ(q,$):Object.assign({},q,$)}function cK($){if(a3.indexOf($)>-1)throw new r(`Circular extended configurations: '${$}'.`)}function uK($,J){return M$.path.resolve($,J)}function RZ($,J){let X={};function Z(q){return q&&typeof q==="object"&&!Array.isArray(q)}Object.assign(X,$);for(let q of Object.keys(J))if(Z(J[q])&&Z(X[q]))X[q]=RZ($[q],J[q]);else X[q]=J[q];return X}var h=function($,J,X,Z,q){if(Z==="m")throw TypeError("Private method is not writable");if(Z==="a"&&!q)throw TypeError("Private accessor was defined without a setter");if(typeof J==="function"?$!==J||!q:!J.has($))throw TypeError("Cannot write private member to an object whose class did not declare it");return Z==="a"?q.call($,X):q?q.value=X:J.set($,X),X},z=function($,J,X,Z){if(X==="a"&&!Z)throw TypeError("Private accessor was defined without a getter");if(typeof J==="function"?$!==J||!Z:!J.has($))throw TypeError("Cannot read private member from an object whose class did not declare it");return X==="m"?Z:X==="a"?Z.call($):Z?Z.value:J.get($)},Q0,x1,x$,O0,M0,m4,z1,j1,p4,E0,d4,h0,p0,C0,A0,l4,s1,U0,S,n4,i4,x0,I1,e1,w1,B1,t4,b,O1,E1,h1,g,o4,d0,$0;function bZ($){return(J=[],X=$.process.cwd(),Z)=>{let q=new yZ(J,X,Z,$);return Object.defineProperty(q,"argv",{get:()=>{return q.parse()},enumerable:!0}),q.help(),q.version(),q}}var TZ=Symbol("copyDoubleDash"),PZ=Symbol("copyDoubleDash"),r3=Symbol("deleteFromParserHintObject"),FZ=Symbol("emitWarning"),MZ=Symbol("freeze"),CZ=Symbol("getDollarZero"),A1=Symbol("getParserConfiguration"),xZ=Symbol("getUsageConfiguration"),s3=Symbol("guessLocale"),jZ=Symbol("guessVersion"),IZ=Symbol("parsePositionalNumbers"),e3=Symbol("pkgUp"),K1=Symbol("populateParserHintArray"),$$=Symbol("populateParserHintSingleValueDictionary"),$6=Symbol("populateParserHintArrayDictionary"),J6=Symbol("populateParserHintDictionary"),X6=Symbol("sanitizeKey"),Z6=Symbol("setKey"),Q6=Symbol("unfreeze"),wZ=Symbol("validateAsync"),OZ=Symbol("getCommandInstance"),EZ=Symbol("getContext"),hZ=Symbol("getHasOutput"),AZ=Symbol("getLoggerInstance"),NZ=Symbol("getParseContext"),DZ=Symbol("getUsageInstance"),SZ=Symbol("getValidationInstance"),a4=Symbol("hasParseCallback"),fZ=Symbol("isGlobalContext"),N1=Symbol("postProcess"),vZ=Symbol("rebase"),q6=Symbol("reset"),j$=Symbol("runYargsParserAndExecuteCommands"),Y6=Symbol("runValidation"),kZ=Symbol("setHasOutput"),D1=Symbol("kTrackManuallySetKeys");class yZ{constructor($=[],J,X,Z){this.customScriptName=!1,this.parsed=!1,Q0.set(this,void 0),x1.set(this,void 0),x$.set(this,{commands:[],fullCommands:[]}),O0.set(this,null),M0.set(this,null),m4.set(this,"show-hidden"),z1.set(this,null),j1.set(this,!0),p4.set(this,{}),E0.set(this,!0),d4.set(this,[]),h0.set(this,void 0),p0.set(this,{}),C0.set(this,!1),A0.set(this,null),l4.set(this,!0),s1.set(this,void 0),U0.set(this,""),S.set(this,void 0),n4.set(this,void 0),i4.set(this,{}),x0.set(this,null),I1.set(this,null),e1.set(this,{}),w1.set(this,{}),B1.set(this,void 0),t4.set(this,!1),b.set(this,void 0),O1.set(this,!1),E1.set(this,!1),h1.set(this,!1),g.set(this,void 0),o4.set(this,{}),d0.set(this,null),$0.set(this,void 0),h(this,b,Z,"f"),h(this,B1,$,"f"),h(this,x1,J,"f"),h(this,n4,X,"f"),h(this,h0,new i3(this),"f"),this.$0=this[CZ](),this[q6](),h(this,Q0,z(this,Q0,"f"),"f"),h(this,g,z(this,g,"f"),"f"),h(this,$0,z(this,$0,"f"),"f"),h(this,S,z(this,S,"f"),"f"),z(this,S,"f").showHiddenOpt=z(this,m4,"f"),h(this,s1,this[PZ](),"f")}addHelpOpt($,J){if(E("[string|boolean] [string]",[$,J],arguments.length),z(this,A0,"f"))this[r3](z(this,A0,"f")),h(this,A0,null,"f");if($===!1&&J===void 0)return this;return h(this,A0,typeof $==="string"?$:"help","f"),this.boolean(z(this,A0,"f")),this.describe(z(this,A0,"f"),J||z(this,g,"f").deferY18nLookup("Show help")),this}help($,J){return this.addHelpOpt($,J)}addShowHiddenOpt($,J){if(E("[string|boolean] [string]",[$,J],arguments.length),$===!1&&J===void 0)return this;let X=typeof $==="string"?$:z(this,m4,"f");return this.boolean(X),this.describe(X,J||z(this,g,"f").deferY18nLookup("Show hidden options")),z(this,S,"f").showHiddenOpt=X,this}showHidden($,J){return this.addShowHiddenOpt($,J)}alias($,J){return E("<object|string|array> [string|array]",[$,J],arguments.length),this[$6](this.alias.bind(this),"alias",$,J),this}array($){return E("<array|string>",[$],arguments.length),this[K1]("array",$),this[D1]($),this}boolean($){return E("<array|string>",[$],arguments.length),this[K1]("boolean",$),this[D1]($),this}check($,J){return E("<function> [boolean]",[$,J],arguments.length),this.middleware((X,Z)=>{return C1(()=>{return $(X,Z.getOptions())},(q)=>{if(!q)z(this,g,"f").fail(z(this,b,"f").y18n.__("Argument check failed: %s",$.toString()));else if(typeof q==="string"||q instanceof Error)z(this,g,"f").fail(q.toString(),q);return X},(q)=>{return z(this,g,"f").fail(q.message?q.message:q.toString(),q),X})},!1,J),this}choices($,J){return E("<object|string|array> [string|array]",[$,J],arguments.length),this[$6](this.choices.bind(this),"choices",$,J),this}coerce($,J){if(E("<object|string|array> [function]",[$,J],arguments.length),Array.isArray($)){if(!J)throw new r("coerce callback must be provided");for(let X of $)this.coerce(X,J);return this}else if(typeof $==="object"){for(let X of Object.keys($))this.coerce(X,$[X]);return this}if(!J)throw new r("coerce callback must be provided");return z(this,S,"f").key[$]=!0,z(this,h0,"f").addCoerceMiddleware((X,Z)=>{let q;if(!Object.prototype.hasOwnProperty.call(X,$))return X;return C1(()=>{return q=Z.getAliases(),J(X[$])},(Q)=>{X[$]=Q;let G=Z.getInternalMethods().getParserConfiguration()["strip-aliased"];if(q[$]&&G!==!0)for(let H of q[$])X[H]=Q;return X},(Q)=>{throw new r(Q.message)})},$),this}conflicts($,J){return E("<string|object> [string|array]",[$,J],arguments.length),z(this,$0,"f").conflicts($,J),this}config($="config",J,X){if(E("[object|string] [string|function] [function]",[$,J,X],arguments.length),typeof $==="object"&&!Array.isArray($))return $=C$($,z(this,x1,"f"),this[A1]()["deep-merge-config"]||!1,z(this,b,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat($),this;if(typeof J==="function")X=J,J=void 0;return this.describe($,J||z(this,g,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray($)?$:[$]).forEach((Z)=>{z(this,S,"f").config[Z]=X||!0}),this}completion($,J,X){if(E("[string] [string|boolean|function] [function]",[$,J,X],arguments.length),typeof J==="function")X=J,J=void 0;if(h(this,M0,$||z(this,M0,"f")||"completion","f"),!J&&J!==!1)J="generate completion script";if(this.command(z(this,M0,"f"),J),X)z(this,O0,"f").registerFunction(X);return this}command($,J,X,Z,q,Y){return E("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[$,J,X,Z,q,Y],arguments.length),z(this,Q0,"f").addHandler($,J,X,Z,q,Y),this}commands($,J,X,Z,q,Y){return this.command($,J,X,Z,q,Y)}commandDir($,J){E("<string> [object]",[$,J],arguments.length);let X=z(this,n4,"f")||z(this,b,"f").require;return z(this,Q0,"f").addDirectory($,X,z(this,b,"f").getCallerFile(),J),this}count($){return E("<array|string>",[$],arguments.length),this[K1]("count",$),this[D1]($),this}default($,J,X){if(E("<object|string|array> [*] [string]",[$,J,X],arguments.length),X)n3($,z(this,b,"f")),z(this,S,"f").defaultDescription[$]=X;if(typeof J==="function"){if(n3($,z(this,b,"f")),!z(this,S,"f").defaultDescription[$])z(this,S,"f").defaultDescription[$]=z(this,g,"f").functionDescription(J);J=J.call()}return this[$$](this.default.bind(this),"default",$,J),this}defaults($,J,X){return this.default($,J,X)}demandCommand($=1,J,X,Z){if(E("[number] [number|string] [string|null|undefined] [string|null|undefined]",[$,J,X,Z],arguments.length),typeof J!=="number")X=J,J=1/0;return this.global("_",!1),z(this,S,"f").demandedCommands._={min:$,max:J,minMsg:X,maxMsg:Z},this}demand($,J,X){if(Array.isArray(J))J.forEach((Z)=>{T0(X,!0,z(this,b,"f")),this.demandOption(Z,X)}),J=1/0;else if(typeof J!=="number")X=J,J=1/0;if(typeof $==="number")T0(X,!0,z(this,b,"f")),this.demandCommand($,J,X,X);else if(Array.isArray($))$.forEach((Z)=>{T0(X,!0,z(this,b,"f")),this.demandOption(Z,X)});else if(typeof X==="string")this.demandOption($,X);else if(X===!0||typeof X>"u")this.demandOption($);return this}demandOption($,J){return E("<object|string|array> [string]",[$,J],arguments.length),this[$$](this.demandOption.bind(this),"demandedOptions",$,J),this}deprecateOption($,J){return E("<string> [string|boolean]",[$,J],arguments.length),z(this,S,"f").deprecatedOptions[$]=J,this}describe($,J){return E("<object|string|array> [string]",[$,J],arguments.length),this[Z6]($,!0),z(this,g,"f").describe($,J),this}detectLocale($){return E("<boolean>",[$],arguments.length),h(this,j1,$,"f"),this}env($){if(E("[string|boolean]",[$],arguments.length),$===!1)delete z(this,S,"f").envPrefix;else z(this,S,"f").envPrefix=$||"";return this}epilogue($){return E("<string>",[$],arguments.length),z(this,g,"f").epilog($),this}epilog($){return this.epilogue($)}example($,J){if(E("<string|array> [string]",[$,J],arguments.length),Array.isArray($))$.forEach((X)=>this.example(...X));else z(this,g,"f").example($,J);return this}exit($,J){if(h(this,C0,!0,"f"),h(this,z1,J,"f"),z(this,E0,"f"))z(this,b,"f").process.exit($)}exitProcess($=!0){return E("[boolean]",[$],arguments.length),h(this,E0,$,"f"),this}fail($){if(E("<function|boolean>",[$],arguments.length),typeof $==="boolean"&&$!==!1)throw new r("Invalid first argument. Expected function or boolean 'false'");return z(this,g,"f").failFn($),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion($,J){if(E("<array> [function]",[$,J],arguments.length),!J)return new Promise((X,Z)=>{z(this,O0,"f").getCompletion($,(q,Y)=>{if(q)Z(q);else X(Y)})});else return z(this,O0,"f").getCompletion($,J)}getDemandedOptions(){return E([],0),z(this,S,"f").demandedOptions}getDemandedCommands(){return E([],0),z(this,S,"f").demandedCommands}getDeprecatedOptions(){return E([],0),z(this,S,"f").deprecatedOptions}getDetectLocale(){return z(this,j1,"f")}getExitProcess(){return z(this,E0,"f")}getGroups(){return Object.assign({},z(this,p0,"f"),z(this,w1,"f"))}getHelp(){if(h(this,C0,!0,"f"),!z(this,g,"f").hasCachedHelpMessage()){if(!this.parsed){let J=this[j$](z(this,B1,"f"),void 0,void 0,0,!0);if(s(J))return J.then(()=>{return z(this,g,"f").help()})}let $=z(this,Q0,"f").runDefaultBuilderOn(this);if(s($))return $.then(()=>{return z(this,g,"f").help()})}return Promise.resolve(z(this,g,"f").help())}getOptions(){return z(this,S,"f")}getStrict(){return z(this,O1,"f")}getStrictCommands(){return z(this,E1,"f")}getStrictOptions(){return z(this,h1,"f")}global($,J){if(E("<string|array> [boolean]",[$,J],arguments.length),$=[].concat($),J!==!1)z(this,S,"f").local=z(this,S,"f").local.filter((X)=>$.indexOf(X)===-1);else $.forEach((X)=>{if(!z(this,S,"f").local.includes(X))z(this,S,"f").local.push(X)});return this}group($,J){E("<string|array> <string>",[$,J],arguments.length);let X=z(this,w1,"f")[J]||z(this,p0,"f")[J];if(z(this,w1,"f")[J])delete z(this,w1,"f")[J];let Z={};return z(this,p0,"f")[J]=(X||[]).concat($).filter((q)=>{if(Z[q])return!1;return Z[q]=!0}),this}hide($){return E("<string>",[$],arguments.length),z(this,S,"f").hiddenOptions.push($),this}implies($,J){return E("<string|object> [number|string|array]",[$,J],arguments.length),z(this,$0,"f").implies($,J),this}locale($){if(E("[string]",[$],arguments.length),$===void 0)return this[s3](),z(this,b,"f").y18n.getLocale();return h(this,j1,!1,"f"),z(this,b,"f").y18n.setLocale($),this}middleware($,J,X){return z(this,h0,"f").addMiddleware($,!!J,X)}nargs($,J){return E("<string|object|array> [number]",[$,J],arguments.length),this[$$](this.nargs.bind(this),"narg",$,J),this}normalize($){return E("<array|string>",[$],arguments.length),this[K1]("normalize",$),this}number($){return E("<array|string>",[$],arguments.length),this[K1]("number",$),this[D1]($),this}option($,J){if(E("<string|object> [object]",[$,J],arguments.length),typeof $==="object")Object.keys($).forEach((X)=>{this.options(X,$[X])});else{if(typeof J!=="object")J={};if(this[D1]($),z(this,d0,"f")&&($==="version"||(J===null||J===void 0?void 0:J.alias)==="version"))this[FZ](['"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(`
117
+ `),void 0,"versionWarning");if(z(this,S,"f").key[$]=!0,J.alias)this.alias($,J.alias);let X=J.deprecate||J.deprecated;if(X)this.deprecateOption($,X);let Z=J.demand||J.required||J.require;if(Z)this.demand($,Z);if(J.demandOption)this.demandOption($,typeof J.demandOption==="string"?J.demandOption:void 0);if(J.conflicts)this.conflicts($,J.conflicts);if("default"in J)this.default($,J.default);if(J.implies!==void 0)this.implies($,J.implies);if(J.nargs!==void 0)this.nargs($,J.nargs);if(J.config)this.config($,J.configParser);if(J.normalize)this.normalize($);if(J.choices)this.choices($,J.choices);if(J.coerce)this.coerce($,J.coerce);if(J.group)this.group($,J.group);if(J.boolean||J.type==="boolean"){if(this.boolean($),J.alias)this.boolean(J.alias)}if(J.array||J.type==="array"){if(this.array($),J.alias)this.array(J.alias)}if(J.number||J.type==="number"){if(this.number($),J.alias)this.number(J.alias)}if(J.string||J.type==="string"){if(this.string($),J.alias)this.string(J.alias)}if(J.count||J.type==="count")this.count($);if(typeof J.global==="boolean")this.global($,J.global);if(J.defaultDescription)z(this,S,"f").defaultDescription[$]=J.defaultDescription;if(J.skipValidation)this.skipValidation($);let q=J.describe||J.description||J.desc,Y=z(this,g,"f").getDescriptions();if(!Object.prototype.hasOwnProperty.call(Y,$)||typeof q==="string")this.describe($,q);if(J.hidden)this.hide($);if(J.requiresArg)this.requiresArg($)}return this}options($,J){return this.option($,J)}parse($,J,X){if(E("[string|array] [function|boolean|object] [function]",[$,J,X],arguments.length),this[MZ](),typeof $>"u")$=z(this,B1,"f");if(typeof J==="object")h(this,I1,J,"f"),J=X;if(typeof J==="function")h(this,x0,J,"f"),J=!1;if(!J)h(this,B1,$,"f");if(z(this,x0,"f"))h(this,E0,!1,"f");let Z=this[j$]($,!!J),q=this.parsed;if(z(this,O0,"f").setParsed(this.parsed),s(Z))return Z.then((Y)=>{if(z(this,x0,"f"))z(this,x0,"f").call(this,z(this,z1,"f"),Y,z(this,U0,"f"));return Y}).catch((Y)=>{if(z(this,x0,"f"))z(this,x0,"f")(Y,this.parsed.argv,z(this,U0,"f"));throw Y}).finally(()=>{this[Q6](),this.parsed=q});else{if(z(this,x0,"f"))z(this,x0,"f").call(this,z(this,z1,"f"),Z,z(this,U0,"f"));this[Q6](),this.parsed=q}return Z}parseAsync($,J,X){let Z=this.parse($,J,X);return!s(Z)?Promise.resolve(Z):Z}parseSync($,J,X){let Z=this.parse($,J,X);if(s(Z))throw new r(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return Z}parserConfiguration($){return E("<object>",[$],arguments.length),h(this,i4,$,"f"),this}pkgConf($,J){E("<string> [string]",[$,J],arguments.length);let X=null,Z=this[e3](J||z(this,x1,"f"));if(Z[$]&&typeof Z[$]==="object")X=C$(Z[$],J||z(this,x1,"f"),this[A1]()["deep-merge-config"]||!1,z(this,b,"f")),z(this,S,"f").configObjects=(z(this,S,"f").configObjects||[]).concat(X);return this}positional($,J){E("<string> <object>",[$,J],arguments.length);let X=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];J=G1(J,(Y,Q)=>{if(Y==="type"&&!["string","number","boolean"].includes(Q))return!1;return X.includes(Y)});let Z=z(this,x$,"f").fullCommands[z(this,x$,"f").fullCommands.length-1],q=Z?z(this,Q0,"f").cmdToParseOptions(Z):{array:[],alias:{},default:{},demand:{}};return a1(q).forEach((Y)=>{let Q=q[Y];if(Array.isArray(Q)){if(Q.indexOf($)!==-1)J[Y]=!0}else if(Q[$]&&!(Y in J))J[Y]=Q[$]}),this.group($,z(this,g,"f").getPositionalGroupName()),this.option($,J)}recommendCommands($=!0){return E("[boolean]",[$],arguments.length),h(this,t4,$,"f"),this}required($,J,X){return this.demand($,J,X)}require($,J,X){return this.demand($,J,X)}requiresArg($){if(E("<array|string|object> [number]",[$],arguments.length),typeof $==="string"&&z(this,S,"f").narg[$])return this;else this[$$](this.requiresArg.bind(this),"narg",$,NaN);return this}showCompletionScript($,J){return E("[string] [string]",[$,J],arguments.length),$=$||this.$0,z(this,s1,"f").log(z(this,O0,"f").generateCompletionScript($,J||z(this,M0,"f")||"completion")),this}showHelp($){if(E("[string|function]",[$],arguments.length),h(this,C0,!0,"f"),!z(this,g,"f").hasCachedHelpMessage()){if(!this.parsed){let X=this[j$](z(this,B1,"f"),void 0,void 0,0,!0);if(s(X))return X.then(()=>{z(this,g,"f").showHelp($)}),this}let J=z(this,Q0,"f").runDefaultBuilderOn(this);if(s(J))return J.then(()=>{z(this,g,"f").showHelp($)}),this}return z(this,g,"f").showHelp($),this}scriptName($){return this.customScriptName=!0,this.$0=$,this}showHelpOnFail($,J){return E("[boolean|string] [string]",[$,J],arguments.length),z(this,g,"f").showHelpOnFail($,J),this}showVersion($){return E("[string|function]",[$],arguments.length),z(this,g,"f").showVersion($),this}skipValidation($){return E("<array|string>",[$],arguments.length),this[K1]("skipValidation",$),this}strict($){return E("[boolean]",[$],arguments.length),h(this,O1,$!==!1,"f"),this}strictCommands($){return E("[boolean]",[$],arguments.length),h(this,E1,$!==!1,"f"),this}strictOptions($){return E("[boolean]",[$],arguments.length),h(this,h1,$!==!1,"f"),this}string($){return E("<array|string>",[$],arguments.length),this[K1]("string",$),this[D1]($),this}terminalWidth(){return E([],0),z(this,b,"f").process.stdColumns}updateLocale($){return this.updateStrings($)}updateStrings($){return E("<object>",[$],arguments.length),h(this,j1,!1,"f"),z(this,b,"f").y18n.updateLocale($),this}usage($,J,X,Z){if(E("<string|null|undefined> [string|boolean] [function|object] [function]",[$,J,X,Z],arguments.length),J!==void 0)if(T0($,null,z(this,b,"f")),($||"").match(/^\$0( |$)/))return this.command($,J,X,Z);else throw new r(".usage() description must start with $0 if being used as alias for .command()");else return z(this,g,"f").usage($),this}usageConfiguration($){return E("<object>",[$],arguments.length),h(this,o4,$,"f"),this}version($,J,X){if(E("[boolean|string] [string] [string]",[$,J,X],arguments.length),z(this,d0,"f"))this[r3](z(this,d0,"f")),z(this,g,"f").version(void 0),h(this,d0,null,"f");if(arguments.length===0)X=this[jZ](),$="version";else if(arguments.length===1){if($===!1)return this;X=$,$="version"}else if(arguments.length===2)X=J,J=void 0;return h(this,d0,typeof $==="string"?$:"version","f"),J=J||z(this,g,"f").deferY18nLookup("Show version number"),z(this,g,"f").version(X||void 0),this.boolean(z(this,d0,"f")),this.describe(z(this,d0,"f"),J),this}wrap($){return E("<number|null|undefined>",[$],arguments.length),z(this,g,"f").wrap($),this}[(Q0=new WeakMap,x1=new WeakMap,x$=new WeakMap,O0=new WeakMap,M0=new WeakMap,m4=new WeakMap,z1=new WeakMap,j1=new WeakMap,p4=new WeakMap,E0=new WeakMap,d4=new WeakMap,h0=new WeakMap,p0=new WeakMap,C0=new WeakMap,A0=new WeakMap,l4=new WeakMap,s1=new WeakMap,U0=new WeakMap,S=new WeakMap,n4=new WeakMap,i4=new WeakMap,x0=new WeakMap,I1=new WeakMap,e1=new WeakMap,w1=new WeakMap,B1=new WeakMap,t4=new WeakMap,b=new WeakMap,O1=new WeakMap,E1=new WeakMap,h1=new WeakMap,g=new WeakMap,o4=new WeakMap,d0=new WeakMap,$0=new WeakMap,TZ)]($){if(!$._||!$["--"])return $;$._.push.apply($._,$["--"]);try{delete $["--"]}catch(J){}return $}[PZ](){return{log:(...$)=>{if(!this[a4]())console.log(...$);if(h(this,C0,!0,"f"),z(this,U0,"f").length)h(this,U0,z(this,U0,"f")+`
118
+ `,"f");h(this,U0,z(this,U0,"f")+$.join(" "),"f")},error:(...$)=>{if(!this[a4]())console.error(...$);if(h(this,C0,!0,"f"),z(this,U0,"f").length)h(this,U0,z(this,U0,"f")+`
119
+ `,"f");h(this,U0,z(this,U0,"f")+$.join(" "),"f")}}}[r3]($){a1(z(this,S,"f")).forEach((J)=>{if(((Z)=>Z==="configObjects")(J))return;let X=z(this,S,"f")[J];if(Array.isArray(X)){if(X.includes($))X.splice(X.indexOf($),1)}else if(typeof X==="object")delete X[$]}),delete z(this,g,"f").getDescriptions()[$]}[FZ]($,J,X){if(!z(this,p4,"f")[X])z(this,b,"f").process.emitWarning($,J),z(this,p4,"f")[X]=!0}[MZ](){z(this,d4,"f").push({options:z(this,S,"f"),configObjects:z(this,S,"f").configObjects.slice(0),exitProcess:z(this,E0,"f"),groups:z(this,p0,"f"),strict:z(this,O1,"f"),strictCommands:z(this,E1,"f"),strictOptions:z(this,h1,"f"),completionCommand:z(this,M0,"f"),output:z(this,U0,"f"),exitError:z(this,z1,"f"),hasOutput:z(this,C0,"f"),parsed:this.parsed,parseFn:z(this,x0,"f"),parseContext:z(this,I1,"f")}),z(this,g,"f").freeze(),z(this,$0,"f").freeze(),z(this,Q0,"f").freeze(),z(this,h0,"f").freeze()}[CZ](){let $="",J;if(/\b(node|iojs|electron)(\.exe)?$/.test(z(this,b,"f").process.argv()[0]))J=z(this,b,"f").process.argv().slice(1,2);else J=z(this,b,"f").process.argv().slice(0,1);if($=J.map((X)=>{let Z=this[vZ](z(this,x1,"f"),X);return X.match(/^(\/|([a-zA-Z]:)?\\)/)&&Z.length<X.length?Z:X}).join(" ").trim(),z(this,b,"f").getEnv("_")&&z(this,b,"f").getProcessArgvBin()===z(this,b,"f").getEnv("_"))$=z(this,b,"f").getEnv("_").replace(`${z(this,b,"f").path.dirname(z(this,b,"f").process.execPath())}/`,"");return $}[A1](){return z(this,i4,"f")}[xZ](){return z(this,o4,"f")}[s3](){if(!z(this,j1,"f"))return;let $=z(this,b,"f").getEnv("LC_ALL")||z(this,b,"f").getEnv("LC_MESSAGES")||z(this,b,"f").getEnv("LANG")||z(this,b,"f").getEnv("LANGUAGE")||"en_US";this.locale($.replace(/[.:].*/,""))}[jZ](){return this[e3]().version||"unknown"}[IZ]($){let J=$["--"]?$["--"]:$._;for(let X=0,Z;(Z=J[X])!==void 0;X++)if(z(this,b,"f").Parser.looksLikeNumber(Z)&&Number.isSafeInteger(Math.floor(parseFloat(`${Z}`))))J[X]=Number(Z);return $}[e3]($){let J=$||"*";if(z(this,e1,"f")[J])return z(this,e1,"f")[J];let X={};try{let Z=$||z(this,b,"f").mainFilename;if(!$&&z(this,b,"f").path.extname(Z))Z=z(this,b,"f").path.dirname(Z);let q=z(this,b,"f").findUp(Z,(Y,Q)=>{if(Q.includes("package.json"))return"package.json";else return});T0(q,void 0,z(this,b,"f")),X=JSON.parse(z(this,b,"f").readFileSync(q,"utf8"))}catch(Z){}return z(this,e1,"f")[J]=X||{},z(this,e1,"f")[J]}[K1]($,J){J=[].concat(J),J.forEach((X)=>{X=this[X6](X),z(this,S,"f")[$].push(X)})}[$$]($,J,X,Z){this[J6]($,J,X,Z,(q,Y,Q)=>{z(this,S,"f")[q][Y]=Q})}[$6]($,J,X,Z){this[J6]($,J,X,Z,(q,Y,Q)=>{z(this,S,"f")[q][Y]=(z(this,S,"f")[q][Y]||[]).concat(Q)})}[J6]($,J,X,Z,q){if(Array.isArray(X))X.forEach((Y)=>{$(Y,Z)});else if(((Y)=>typeof Y==="object")(X))for(let Y of a1(X))$(Y,X[Y]);else q(J,this[X6](X),Z)}[X6]($){if($==="__proto__")return"___proto___";return $}[Z6]($,J){return this[$$](this[Z6].bind(this),"key",$,J),this}[Q6](){var $,J,X,Z,q,Y,Q,G,H,B,U,K;let W=z(this,d4,"f").pop();T0(W,void 0,z(this,b,"f"));let P;$=this,J=this,X=this,Z=this,q=this,Y=this,Q=this,G=this,H=this,B=this,U=this,K=this,{options:{set value(R){h($,S,R,"f")}}.value,configObjects:P,exitProcess:{set value(R){h(J,E0,R,"f")}}.value,groups:{set value(R){h(X,p0,R,"f")}}.value,output:{set value(R){h(Z,U0,R,"f")}}.value,exitError:{set value(R){h(q,z1,R,"f")}}.value,hasOutput:{set value(R){h(Y,C0,R,"f")}}.value,parsed:this.parsed,strict:{set value(R){h(Q,O1,R,"f")}}.value,strictCommands:{set value(R){h(G,E1,R,"f")}}.value,strictOptions:{set value(R){h(H,h1,R,"f")}}.value,completionCommand:{set value(R){h(B,M0,R,"f")}}.value,parseFn:{set value(R){h(U,x0,R,"f")}}.value,parseContext:{set value(R){h(K,I1,R,"f")}}.value}=W,z(this,S,"f").configObjects=P,z(this,g,"f").unfreeze(),z(this,$0,"f").unfreeze(),z(this,Q0,"f").unfreeze(),z(this,h0,"f").unfreeze()}[wZ]($,J){return C1(J,(X)=>{return $(X),X})}getInternalMethods(){return{getCommandInstance:this[OZ].bind(this),getContext:this[EZ].bind(this),getHasOutput:this[hZ].bind(this),getLoggerInstance:this[AZ].bind(this),getParseContext:this[NZ].bind(this),getParserConfiguration:this[A1].bind(this),getUsageConfiguration:this[xZ].bind(this),getUsageInstance:this[DZ].bind(this),getValidationInstance:this[SZ].bind(this),hasParseCallback:this[a4].bind(this),isGlobalContext:this[fZ].bind(this),postProcess:this[N1].bind(this),reset:this[q6].bind(this),runValidation:this[Y6].bind(this),runYargsParserAndExecuteCommands:this[j$].bind(this),setHasOutput:this[kZ].bind(this)}}[OZ](){return z(this,Q0,"f")}[EZ](){return z(this,x$,"f")}[hZ](){return z(this,C0,"f")}[AZ](){return z(this,s1,"f")}[NZ](){return z(this,I1,"f")||{}}[DZ](){return z(this,g,"f")}[SZ](){return z(this,$0,"f")}[a4](){return!!z(this,x0,"f")}[fZ](){return z(this,l4,"f")}[N1]($,J,X,Z){if(X)return $;if(s($))return $;if(!J)$=this[TZ]($);if(this[A1]()["parse-positional-numbers"]||this[A1]()["parse-positional-numbers"]===void 0)$=this[IZ]($);if(Z)$=M1($,this,z(this,h0,"f").getMiddleware(),!1);return $}[q6]($={}){h(this,S,z(this,S,"f")||{},"f");let J={};J.local=z(this,S,"f").local||[],J.configObjects=z(this,S,"f").configObjects||[];let X={};J.local.forEach((Y)=>{X[Y]=!0,($[Y]||[]).forEach((Q)=>{X[Q]=!0})}),Object.assign(z(this,w1,"f"),Object.keys(z(this,p0,"f")).reduce((Y,Q)=>{let G=z(this,p0,"f")[Q].filter((H)=>!(H in X));if(G.length>0)Y[Q]=G;return Y},{})),h(this,p0,{},"f");let Z=["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"],q=["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"];if(Z.forEach((Y)=>{J[Y]=(z(this,S,"f")[Y]||[]).filter((Q)=>!X[Q])}),q.forEach((Y)=>{J[Y]=G1(z(this,S,"f")[Y],(Q)=>!X[Q])}),J.envPrefix=z(this,S,"f").envPrefix,h(this,S,J,"f"),h(this,g,z(this,g,"f")?z(this,g,"f").reset(X):zZ(this,z(this,b,"f")),"f"),h(this,$0,z(this,$0,"f")?z(this,$0,"f").reset(X):_Z(this,z(this,g,"f"),z(this,b,"f")),"f"),h(this,Q0,z(this,Q0,"f")?z(this,Q0,"f").reset():YZ(z(this,g,"f"),z(this,$0,"f"),z(this,h0,"f"),z(this,b,"f")),"f"),!z(this,O0,"f"))h(this,O0,WZ(this,z(this,g,"f"),z(this,Q0,"f"),z(this,b,"f")),"f");return z(this,h0,"f").reset(),h(this,M0,null,"f"),h(this,U0,"","f"),h(this,z1,null,"f"),h(this,C0,!1,"f"),this.parsed=!1,this}[vZ]($,J){return z(this,b,"f").path.relative($,J)}[j$]($,J,X,Z=0,q=!1){let Y=!!X||q;$=$||z(this,B1,"f"),z(this,S,"f").__=z(this,b,"f").y18n.__,z(this,S,"f").configuration=this[A1]();let Q=!!z(this,S,"f").configuration["populate--"],G=Object.assign({},z(this,S,"f").configuration,{"populate--":!0}),H=z(this,b,"f").Parser.detailed($,Object.assign({},z(this,S,"f"),{configuration:{"parse-positional-numbers":!1,...G}})),B=Object.assign(H.argv,z(this,I1,"f")),U=void 0,K=H.aliases,W=!1,P=!1;if(Object.keys(B).forEach((R)=>{if(R===z(this,A0,"f")&&B[R])W=!0;else if(R===z(this,d0,"f")&&B[R])P=!0}),B.$0=this.$0,this.parsed=H,Z===0)z(this,g,"f").clearCachedHelpMessage();try{if(this[s3](),J)return this[N1](B,Q,!!X,!1);if(z(this,A0,"f")){if([z(this,A0,"f")].concat(K[z(this,A0,"f")]||[]).filter((A)=>A.length>1).includes(""+B._[B._.length-1]))B._.pop(),W=!0}h(this,l4,!1,"f");let R=z(this,Q0,"f").getCommands(),L=z(this,O0,"f").completionKey in B,M=W||L||q;if(B._.length){if(R.length){let C;for(let A=Z||0,m;B._[A]!==void 0;A++)if(m=String(B._[A]),R.includes(m)&&m!==z(this,M0,"f")){let j=z(this,Q0,"f").runCommand(m,this,H,A+1,q,W||P||q);return this[N1](j,Q,!!X,!1)}else if(!C&&m!==z(this,M0,"f")){C=m;break}if(!z(this,Q0,"f").hasDefaultCommand()&&z(this,t4,"f")&&C&&!M)z(this,$0,"f").recommendCommands(C,R)}if(z(this,M0,"f")&&B._.includes(z(this,M0,"f"))&&!L){if(z(this,E0,"f"))H1(!0);this.showCompletionScript(),this.exit(0)}}if(z(this,Q0,"f").hasDefaultCommand()&&!M){let C=z(this,Q0,"f").runCommand(null,this,H,0,q,W||P||q);return this[N1](C,Q,!!X,!1)}if(L){if(z(this,E0,"f"))H1(!0);$=[].concat($);let C=$.slice($.indexOf(`--${z(this,O0,"f").completionKey}`)+1);return z(this,O0,"f").getCompletion(C,(A,m)=>{if(A)throw new r(A.message);(m||[]).forEach((j)=>{z(this,s1,"f").log(j)}),this.exit(0)}),this[N1](B,!Q,!!X,!1)}if(!z(this,C0,"f")){if(W){if(z(this,E0,"f"))H1(!0);Y=!0,this.showHelp("log"),this.exit(0)}else if(P){if(z(this,E0,"f"))H1(!0);Y=!0,z(this,g,"f").showVersion("log"),this.exit(0)}}if(!Y&&z(this,S,"f").skipValidation.length>0)Y=Object.keys(B).some((C)=>z(this,S,"f").skipValidation.indexOf(C)>=0&&B[C]===!0);if(!Y){if(H.error)throw new r(H.error.message);if(!L){let C=this[Y6](K,{},H.error);if(!X)U=M1(B,this,z(this,h0,"f").getMiddleware(),!0);if(U=this[wZ](C,U!==null&&U!==void 0?U:B),s(U)&&!X)U=U.then(()=>{return M1(B,this,z(this,h0,"f").getMiddleware(),!1)})}}}catch(R){if(R instanceof r)z(this,g,"f").fail(R.message,R);else throw R}return this[N1](U!==null&&U!==void 0?U:B,Q,!!X,!0)}[Y6]($,J,X,Z){let q={...this.getDemandedOptions()};return(Y)=>{if(X)throw new r(X.message);z(this,$0,"f").nonOptionCount(Y),z(this,$0,"f").requiredArguments(Y,q);let Q=!1;if(z(this,E1,"f"))Q=z(this,$0,"f").unknownCommands(Y);if(z(this,O1,"f")&&!Q)z(this,$0,"f").unknownArguments(Y,$,J,!!Z);else if(z(this,h1,"f"))z(this,$0,"f").unknownArguments(Y,$,{},!1,!1);z(this,$0,"f").limitedChoices(Y),z(this,$0,"f").implications(Y),z(this,$0,"f").conflicting(Y)}}[kZ](){h(this,C0,!0,"f")}[D1]($){if(typeof $==="string")z(this,S,"f").key[$]=!0;else for(let J of $)z(this,S,"f").key[J]=!0}}function GZ($){return!!$&&typeof $.getInternalMethods==="function"}var mK=bZ(l3),gZ=mK;import{existsSync as e0,readFileSync as G6,rmSync as J$,writeFileSync as pK,readdirSync as mZ,copyFileSync as e4,mkdirSync as H6}from"fs";import{resolve as U1,dirname as z6,join as N0}from"path";import{fileURLToPath as dK}from"url";var cZ=gZ(d3(process.argv)).option("h",{alias:"help",type:"boolean"}).option("v",{alias:"version",type:"boolean"}).parseSync(),lK="https://github.com/ardzero/bunext.git",r4=".bunext-upgrade-temp",nK=["create-bunext","packages",".github/workflows","src/app/(index)/docs","src/components/docs"],iK=[".git","public","src/lib/data/siteData.ts"],tK=["android-chrome-192x192.png","android-chrome-512x512.png","site.webmanifest"],oK="favicon.svg",aK="ogImage.jpg";function rK(){try{let $=dK(import.meta.url),J=z6($),X=N0(J,"../package.json");return JSON.parse(G6(X,"utf-8")).version}catch{return"0.1.0"}}function sK($){for(let J of iK){let X=U1($,J);if(!e0(X))return{ok:!1,missing:J}}return{ok:!0}}function uZ($){let J=$.indexOf("export const siteData");if(J===-1)return null;let X=$.indexOf("= {",J);if(X===-1)return null;let Z=1,q=X+3;while(q<$.length&&Z>0){let Y=$[q];if(Y==="{")Z++;else if(Y==="}")Z--;q++}if(Z!==0)return null;return $.slice(J,$.indexOf(";",q)+1)}function eK($){let J=$.match(/favicon:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function $U($){let J=$.match(/ogImage:\s*\{\s*src:\s*['"]([^'"]+)['"]/);return J?J[1]:null}function pZ($,J,X=!1){let Z=mZ($,{withFileTypes:!0});for(let q of Z){if(X&&q.name===".git")continue;let Y=N0($,q.name),Q=N0(J,q.name);if(q.isDirectory())H6(Q,{recursive:!0}),pZ(Y,Q,!1);else H6(z6(Q),{recursive:!0}),e4(Y,Q)}}async function JU(){if(cZ.v)console.log(rK()),process.exit(0);if(cZ.h)console.log("Usage: bunextupgrade"),console.log(" Upgrade an existing Bunext project to the latest template."),console.log(" Run from the project root. Preserves .git, public assets, and siteData."),process.exit(0);let $=process.cwd(),J=sK($);if(!J.ok)m0.error(`This isn't a valid Bunext project (missing: ${J.missing}).`),process.exit(1);console.clear(),DX(s4.default.bgCyan(s4.default.black(" bunextupgrade ")));let X=fX();X.start("Cloning latest Bunext template");try{await FX("git",["clone","--depth","1",lK,r4],{cwd:$}),X.stop("Template cloned")}catch(M){X.stop("Failed to clone");let C=M instanceof Error?M.message:String(M);m0.error(C.includes("already exists")?`Directory "${r4}" already exists. Remove it and try again.`:C),process.exit(1)}let Z=U1($,r4);X.start("Cleaning template");let q=U1(Z,".git");if(e0(q))J$(q,{recursive:!0,force:!0});for(let M of nK){let C=U1(Z,M);if(e0(C))J$(C,{recursive:!0,force:!0})}X.stop("Template cleaned");let Y=U1($,"public"),Q=U1(Z,"public"),G=U1($,"src/lib/data/siteData.ts"),H=U1(Z,"src/lib/data/siteData.ts"),B=G6(G,"utf-8"),U=eK(B),K=$U(B);X.start("Preserving your public assets and site data");for(let M of tK){let C=N0(Y,M),A=N0(Q,M);if(e0(C))H6(z6(A),{recursive:!0}),e4(C,A)}let W=U?N0(Y,U.replace(/^\//,"")):null;if(W&&e0(W)){if(e4(W,N0(Q,U.replace(/^\//,""))),U!=="/favicon.svg"){let M=N0(Q,oK);if(e0(M))J$(M,{force:!0})}}let P=K?N0(Y,K.replace(/^\//,"")):null;if(P&&e0(P)){if(e4(P,N0(Q,K.replace(/^\//,""))),K!=="/ogImage.jpg"){let M=N0(Q,aK);if(e0(M))J$(M,{force:!0})}}let R=uZ(B);if(R&&e0(H)){let M=G6(H,"utf-8"),C=uZ(M);if(C){let A=M.replace(C,R);pK(H,A)}}X.stop("Preserved public assets and site data"),X.start("Replacing project with upgraded files");let L=mZ($,{withFileTypes:!0});for(let M of L){if(M.name===".git"||M.name===r4)continue;let C=N0($,M.name);J$(C,{recursive:!0,force:!0})}pZ(Z,$,!1),J$(Z,{recursive:!0,force:!0}),X.stop("Upgrade complete"),SX(s4.default.green("Project upgraded successfully."))}JU().catch(($)=>{m0.error($ instanceof Error?$.message:String($)),process.exit(1)});
120
+
121
+ //# debugId=292EB8EA2566D71564756E2164756E21