@nice-move/cli 0.9.2 → 0.9.3
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.mjs +1 -1
- package/package.json +1 -1
package/dist/cli.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as t}from"module";var e,n,s,i,r={8995:(t,e,n)=>{const s=n(32081),i=n(19015),r=n(95350);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},95350:t=>{const e="win32"===process.platform;function n(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},19015:(t,e,n)=>{const s=n(71017),i=n(65358),r=n(16214),o=n(63106),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},16214:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},63106:(t,e,n)=>{const s=n(57147),i=n(14256);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},65358:(t,e,n)=>{const s=n(71017),i=n(1468),r=n(26569);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},1468:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(71017),r=s?";":":",o=n(5909),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},23799:(t,e,n)=>{const s=n(71017),i=n(32081),r=n(8995),o=n(36178),a=n(9002),c=n(83937),l=n(97860),h=n(10407),{spawnedKill:u,spawnedCancel:d,setupTimeout:f,validateTimeout:p,setExitHandler:m}=n(5454),{handleInput:g,getSpawnedResult:y,makeAllStream:b,validateInputSync:v}=n(53036),{mergePromise:w,getSpawnedPromise:x}=n(24578),{joinCommand:O,parseCommand:E,getEscapedCommand:S}=n(82899),j=(t,e,n={})=>{const i=r._parse(t,e,n);return t=i.command,e=i.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=i.options).cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...process.env,...t}:t;return n?a.env({env:r,cwd:s,execPath:i}):r})(n),n.stdio=h(n),"win32"===process.platform&&"cmd"===s.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:i}},C=(t,e,n)=>"string"==typeof e||Buffer.isBuffer(e)?t.stripFinalNewline?o(e):e:void 0===n?void 0:"",_=(t,e,n)=>{const s=j(t,e,n),r=O(t,e),o=S(t,e);let a;p(s.options);try{a=i.spawn(s.file,s.args,s.options)}catch(t){const e=new i.ChildProcess,n=Promise.reject(l({error:t,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return w(e,n)}const h=x(a),v=f(a,s.options,h),E=m(a,s.options,v),_={isCanceled:!1};a.kill=u.bind(null,a.kill.bind(a)),a.cancel=d.bind(null,a,_);const A=c((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:i},c,h,u]=await y(a,s.options,E),d=C(s.options,c),f=C(s.options,h),p=C(s.options,u);if(t||0!==e||null!==n){const c=l({error:t,exitCode:e,signal:n,stdout:d,stderr:f,all:p,command:r,escapedCommand:o,parsed:s,timedOut:i,isCanceled:_.isCanceled,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:r,escapedCommand:o,exitCode:0,stdout:d,stderr:f,all:p,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return g(a,s.options.input),a.all=b(a,s.options),w(a,A)};t.exports=_,t.exports.sync=(t,e,n)=>{const s=j(t,e,n),r=O(t,e),o=S(t,e);let a;v(s.options);try{a=i.spawnSync(s.file,s.args,s.options)}catch(t){throw l({error:t,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const c=C(s.options,a.stdout,a.error),h=C(s.options,a.stderr,a.error);if(a.error||0!==a.status||null!==a.signal){const t=l({stdout:c,stderr:h,error:a.error,signal:a.signal,exitCode:a.status,command:r,escapedCommand:o,parsed:s,timedOut:a.error&&"ETIMEDOUT"===a.error.code,isCanceled:!1,killed:null!==a.signal});if(!s.options.reject)return t;throw t}return{command:r,escapedCommand:o,exitCode:0,stdout:c,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(t,e)=>{const[n,...s]=E(t);return _(n,s,e)},t.exports.commandSync=(t,e)=>{const[n,...s]=E(t);return _.sync(n,s,e)},t.exports.node=(t,e,n={})=>{e&&!Array.isArray(e)&&"object"==typeof e&&(n=e,e=[]);const s=h.node(n),i=process.execArgv.filter((t=>!t.startsWith("--inspect"))),{nodePath:r=process.execPath,nodeOptions:o=i}=n;return _(r,[...o,t,...Array.isArray(e)?e:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:s,shell:!1})}},82899:t=>{const e=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],n=/^[\w.-]+$/,s=/"/g,i=/ +/g;t.exports={joinCommand:(t,n)=>e(t,n).join(" "),getEscapedCommand:(t,i)=>e(t,i).map((t=>(t=>"string"!=typeof t||n.test(t)?t:`"${t.replace(s,'\\"')}"`)(t))).join(" "),parseCommand:t=>{const e=[];for(const n of t.trim().split(i)){const t=e[e.length-1];t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e}}},97860:(t,e,n)=>{const{signalsByName:s}=n(83954);t.exports=({stdout:t,stderr:e,all:n,error:i,signal:r,exitCode:o,command:a,escapedCommand:c,timedOut:l,isCanceled:h,killed:u,parsed:{options:{timeout:d}}})=>{o=null===o?void 0:o;const f=void 0===(r=null===r?void 0:r)?void 0:s[r].description,p=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:l,timeout:d,errorCode:i&&i.code,signal:r,signalDescription:f,exitCode:o,isCanceled:h}),m=`Command ${p}: ${a}`,g="[object Error]"===Object.prototype.toString.call(i),y=g?`${m}\n${i.message}`:m,b=[y,e,t].filter(Boolean).join("\n");return g?(i.originalMessage=i.message,i.message=b):i=new Error(b),i.shortMessage=y,i.command=a,i.escapedCommand=c,i.exitCode=o,i.signal=r,i.signalDescription=f,i.stdout=t,i.stderr=e,void 0!==n&&(i.all=n),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=Boolean(l),i.isCanceled=h,i.killed=u&&!l,i}},5454:(t,e,n)=>{const s=n(22037),i=n(90260),r=(t,e,n,s)=>{if(!o(e,n,s))return;const i=c(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},o=(t,{forceKillAfterTimeout:e},n)=>a(t)&&!1!==e&&n,a=t=>t===s.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),c=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t};t.exports={spawnedKill:(t,e="SIGTERM",n={})=>{const s=t(e);return r(t,e,n,s),s},spawnedCancel:(t,e)=>{t.kill()&&(e.isCanceled=!0)},setupTimeout:(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},validateTimeout:({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},setExitHandler:async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const r=i((()=>{t.kill()}));return s.finally((()=>{r()}))}}},24578:t=>{const e=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(e,t)]));t.exports={mergePromise:(t,e)=>{for(const[s,i]of n){const n="function"==typeof e?(...t)=>Reflect.apply(i.value,e(),t):i.value.bind(e);Reflect.defineProperty(t,s,{...i,value:n})}return t},getSpawnedPromise:t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))}))}},10407:t=>{const e=["stdin","stdout","stderr"],n=t=>{if(!t)return;const{stdio:n}=t;if(void 0===n)return e.map((e=>t[e]));if((t=>e.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${e.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof n)return n;if(!Array.isArray(n))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof n}\``);const s=Math.max(n.length,e.length);return Array.from({length:s},((t,e)=>n[e]))};t.exports=n,t.exports.node=t=>{const e=n(t);return"ipc"===e?"ipc":void 0===e||"string"==typeof e?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}},53036:(t,e,n)=>{const s=n(58607),i=n(29551),r=n(90873),o=async(t,e)=>{if(t){t.destroy();try{return await e}catch(t){return t.bufferedData}}},a=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return e?i(t,{encoding:e,maxBuffer:s}):i.buffer(t,{maxBuffer:s})};t.exports={handleInput:(t,e)=>{void 0!==e&&void 0!==t.stdin&&(s(e)?e.pipe(t.stdin):t.stdin.end(e))},makeAllStream:(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=r();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},getSpawnedResult:async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},c)=>{const l=a(t,{encoding:s,buffer:i,maxBuffer:r}),h=a(e,{encoding:s,buffer:i,maxBuffer:r}),u=a(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([c,l,h,u])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},o(t,l),o(e,h),o(n,u)])}},validateInputSync:({input:t})=>{if(s(t))throw new TypeError("The `input` option cannot be a stream in sync mode")}}},30361:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=t=>{t={...t};const{array:e}=t;let{encoding:n}=t;const i="buffer"===n;let r=!1;e?r=!(n||i):n=n||"utf8",i&&(n=null);const o=new s({objectMode:r});n&&o.setEncoding(n);let a=0;const c=[];return o.on("data",(t=>{c.push(t),r?a=c.length:a+=t.length})),o.getBufferedValue=()=>e?c:i?Buffer.concat(c,a):c.join(""),o.getBufferedLength=()=>a,o}},29551:(t,e,n)=>{const{constants:s}=n(14300),i=n(12781),{promisify:r}=n(73837),o=n(30361),a=r(i.pipeline);class c extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function l(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};const{maxBuffer:n}=e,i=o(e);return await new Promise(((e,r)=>{const o=t=>{t&&i.getBufferedLength()<=s.MAX_LENGTH&&(t.bufferedData=i.getBufferedValue()),r(t)};(async()=>{try{await a(t,i),e()}catch(t){o(t)}})(),i.on("data",(()=>{i.getBufferedLength()>n&&o(new c)}))})),i.getBufferedValue()}t.exports=l,t.exports.buffer=(t,e)=>l(t,{...e,encoding:"buffer"}),t.exports.array=(t,e)=>l(t,{...e,array:!0}),t.exports.MaxBufferError=c},55793:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGNALS=void 0;e.SIGNALS=[{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"}]},83954:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.signalsByNumber=e.signalsByName=void 0;var s=n(22037),i=n(49030),r=n(15260);const o=function(t,{name:e,number:n,description:s,supported:i,action:r,forced:o,standard:a}){return{...t,[e]:{name:e,number:n,description:s,supported:i,action:r,forced:o,standard:a}}},a=(0,i.getSignals)().reduce(o,{});e.signalsByName=a;const c=function(t,e){const n=l(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},l=function(t,e){const n=e.find((({name:e})=>s.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},h=function(){const t=(0,i.getSignals)(),e=r.SIGRTMAX+1,n=Array.from({length:e},((e,n)=>c(n,t)));return Object.assign({},...n)}();e.signalsByNumber=h},15260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGRTMAX=e.getRealtimeSignals=void 0;e.getRealtimeSignals=function(){const t=i-s+1;return Array.from({length:t},n)};const n=function(t,e){return{name:`SIGRT${e+1}`,number:s+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},s=34,i=64;e.SIGRTMAX=i},49030:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSignals=void 0;var s=n(22037),i=n(55793),r=n(15260);e.getSignals=function(){const t=(0,r.getRealtimeSignals)();return[...i.SIGNALS,...t].map(o)};const o=function({name:t,number:e,description:n,action:i,forced:r=!1,standard:o}){const{signals:{[t]:a}}=s.constants,c=void 0!==a;return{name:t,number:c?a:e,description:n,supported:c,action:i,forced:r,standard:o}}},58607:t=>{const e=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,t.exports=e},5909:(t,e,n)=>{var s;n(57147);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(90837):n(74703),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},74703:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(57147);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},90837:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(57147);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},90873:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=i,e.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",r.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(){return 0==t.length}function r(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},9002:(t,e,n)=>{const s=n(71017),i=n(26569),r=t=>{let e;t={cwd:process.cwd(),path:process.env[i()],execPath:process.execPath,...t};let n=s.resolve(t.cwd);const r=[];for(;e!==n;)r.push(s.join(n,"node_modules/.bin")),e=n,n=s.resolve(n,"..");const o=s.resolve(t.cwd,t.execPath,"..");return r.push(o),r.concat(t.path).join(s.delimiter)};t.exports=r,t.exports.default=r,t.exports.env=e=>{const n={...(e={env:process.env,...e}).env},s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n}},83937:(t,e,n)=>{const s=n(26587),i=new WeakMap,r=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,r=0;const o=t.displayName||t.name||"<anonymous>",a=function(...s){if(i.set(a,++r),1===r)n=t.apply(this,s),t=null;else if(!0===e.throw)throw new Error(`Function \`${o}\` can only be called once`);return n};return s(a,t),i.set(a,r),a};t.exports=r,t.exports.default=r,t.exports.callCount=t=>{if(!i.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return i.get(t)}},26587:t=>{const e=(t,e)=>{for(const n of Reflect.ownKeys(e))Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n));return t};t.exports=e,t.exports.default=e},26569:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},14256:(t,e,n)=>{const s=n(83882);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},83882:t=>{t.exports=/^#!(.*)/},90260:(t,e,n)=>{var s=global.process;const i=function(t){return t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on};if(i(s)){var r,o=n(39491),a=n(83261),c=/^win/i.test(s.platform),l=n(82361);"function"!=typeof l&&(l=l.EventEmitter),s.__signal_exit_emitter__?r=s.__signal_exit_emitter__:((r=s.__signal_exit_emitter__=new l).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),t.exports=function(t,e){if(!i(global.process))return function(){};o.equal(typeof t,"function","a callback must be provided for exit handler"),!1===f&&p();var n="exit";e&&e.alwaysLast&&(n="afterexit");return r.on(n,t),function(){r.removeListener(n,t),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&h()}};var h=function(){f&&i(global.process)&&(f=!1,a.forEach((function(t){try{s.removeListener(t,d[t])}catch(t){}})),s.emit=y,s.reallyExit=m,r.count-=1)};t.exports.unload=h;var u=function(t,e,n){r.emitted[t]||(r.emitted[t]=!0,r.emit(t,e,n))},d={};a.forEach((function(t){d[t]=function(){i(global.process)&&(s.listeners(t).length===r.count&&(h(),u("exit",null,t),u("afterexit",null,t),c&&"SIGHUP"===t&&(t="SIGINT"),s.kill(s.pid,t)))}})),t.exports.signals=function(){return a};var f=!1,p=function(){!f&&i(global.process)&&(f=!0,r.count+=1,a=a.filter((function(t){try{return s.on(t,d[t]),!0}catch(t){return!1}})),s.emit=b,s.reallyExit=g)};t.exports.load=p;var m=s.reallyExit,g=function(t){i(global.process)&&(s.exitCode=t||0,u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),m.call(s,s.exitCode))},y=s.emit,b=function(t,e){if("exit"===t&&i(global.process)){void 0!==e&&(s.exitCode=e);var n=y.apply(this,arguments);return u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),n}return y.apply(this,arguments)}}else t.exports=function(){return function(){}}},83261:t=>{t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},36178:t=>{t.exports=t=>{const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,t.length-1)),t[t.length-1]===n&&(t=t.slice(0,t.length-1)),t}},39491:e=>{e.exports=t(import.meta.url)("assert")},14300:e=>{e.exports=t(import.meta.url)("buffer")},32081:e=>{e.exports=t(import.meta.url)("child_process")},82361:e=>{e.exports=t(import.meta.url)("events")},57147:e=>{e.exports=t(import.meta.url)("fs")},22037:e=>{e.exports=t(import.meta.url)("os")},71017:e=>{e.exports=t(import.meta.url)("path")},12781:e=>{e.exports=t(import.meta.url)("stream")},76224:e=>{e.exports=t(import.meta.url)("tty")},73837:e=>{e.exports=t(import.meta.url)("util")}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s={442:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>We,command:()=>Fe,description:()=>De});var n={};a.r(n),a.d(n,{builder:()=>en,command:()=>tn});var s=a(57147),i=a(39491);const r={right:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}};class o{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&l.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),l.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=l.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,o)=>{const{width:a}=t[o],h=this.negatePadding(t[o]);let u=n;if(h>l.stringWidth(n)&&(u+=" ".repeat(h-l.stringWidth(n))),t[o].align&&"left"!==t[o].align&&this.wrap){u=(0,r[t[o].align])(u,h),l.stringWidth(u)<h&&(u+=" ".repeat((a||0)-l.stringWidth(u)-1))}const d=t[o].padding||[0,0,0,0];d[3]&&(i+=" ".repeat(d[3])),i+=c(t[o],u,"| "),i+=u,i+=c(t[o],u," |"),d[1]&&(i+=" ".repeat(d[1])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=l.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?l.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[3]||0)+(t.padding[1]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||l.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[3]||0)+(e[1]||0);if(t.border)return n+4;return n}(t[n])):e))}}function c(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let l;const h=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function u(t){return t.replace(h,"")}function d(t,e){const[n,s]=t.match(h)||["",""];t=u(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var f=a(71017);var p=a(73837);const m=t(import.meta.url)("url");function g(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function y(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function b(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var v;let w;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(v||(v={}));function x(t){return void 0!==t?t+1:1}function O(t){return"__proto__"===t?"___proto___":t}const E=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<E)throw Error(`yargs parser supports a minimum Node.js version of ${E}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const S=process?process.env:{},j=new class{constructor(t){w=t}parse(t,e){const n=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},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=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},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||w.format,m={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:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,S=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=g(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=y(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let j=null;Object.keys(m.counts).find((t=>W(t,m.arrays)?(j=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!W(t,m.nargs)&&(j=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const _=Object.assign(Object.create(null),{_:[]}),A={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&B(e))k(e);else{if(n.match(/---+(=|$)/)){k(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(W(c[1],m.arrays)?t=I(t,c[1],s,c[2]):!1!==W(c[1],m.nargs)?t=P(t,c[1],s,c[2]):$(c[1],c[2],!0));else if(e.match(S)&&o["boolean-negation"])c=e.match(S),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],$(r,!!W(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],W(r,m.arrays)?t=I(t,r,s):!1!==W(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(E)||W(r,m.bools)||W(r,m.counts)?/^(true|false)$/.test(l)?($(r,l),t++):$(r,z(r)):($(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&$(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(E))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||W(r,m.bools)||W(r,m.counts)?$(r,z(r)):($(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(E)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],W(r,m.arrays)?t=I(t,r,s,h):!1!==W(r,m.nargs)?t=P(t,r,s,h):$(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===W(l,m.bools)){$(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){$(a[n],l),i=!0;break}$(a[n],z(a[n]))}else $(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(W(r,m.arrays)?t=I(t,r,s):!1!==W(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(E)||W(r,m.bools)||W(r,m.counts)?/^(true|false)$/.test(l)?($(r,l),t++):$(r,z(r)):($(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(E)&&W(e.slice(1),m.bools))r=e.slice(1),$(r,z(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}k(e)}}}function k(t){const e=N("_",t);"string"!=typeof e&&"number"!=typeof e||_._.push(e)}function P(t,e,n,s){let i,r=W(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return H(s)||(j=Error(p("Argument unexpected for: %s",e))),$(e,z(e)),t;let a=H(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(j=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(E)||B(n[i]));i++)a++;a<r&&(j=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!H(s)&&c>0&&($(e,s),c--),i=t+1;i<c+t+1;i++)$(e,n[i]);return t+c}function I(t,e,n,s){let r=[],c=s||n[t+1];const l=W(e,m.nargs);if(W(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(H(c)||H(s)&&/^-/.test(c)&&!E.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{H(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||E.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(j=Error(p("Not enough arguments following: %s",e))),$(e,r),t}function $(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return g(t)})).join(".");M(t,e)}const s=T(t,e,n),r=t.split(".");if(R(_,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");R(_,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||R(_,n,s)})),W(t,m.normalize)&&!W(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(A,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?w.normalize(t):t}})}))}}function M(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||M(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(W(t,m.bools)||W(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return N(t,e)})):N(t,e);return W(t,m.counts)&&(H(s)||"boolean"==typeof s)&&(s=x()),W(t,m.normalize)&&W(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>w.normalize(t))):w.normalize(e)),s}function N(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!W(t,m.strings)&&!W(t,m.bools)&&!Array.isArray(e)){(b(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!H(e)&&W(t,m.numbers))&&(e=Number(e))}return e}function L(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?L(s,i):(!D(_,i.split("."))||W(i,m.arrays)&&o["combine-arrays"])&&$(i,s)}))}function G(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=w.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),g(t)}));(e&&m.configs[r.join(".")]||!e)&&!D(t,r)&&$(r.join("."),s[i])}}))}function F(t,e,n,s=!1){Object.keys(n).forEach((function(i){D(t,i.split("."))||(R(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){D(t,e.split("."))||R(t,e.split("."),n[i])})))}))}function D(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function R(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=O(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=O(e[e.length-1]),r=W(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&W(i,m.nargs)&&(c=!0,(!H(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===x()?s[i]=x(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||W(i,m.counts)||W(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function W(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function U(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if((t=t.replace(/^-{3,}/,"--")).match(E))return!1;if(function(t){if(t.match(E)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!U(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&U(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,S,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function z(t){return W(t,m.bools)||W(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=v.BOOLEAN;return W(t,m.strings)?e=v.STRING:W(t,m.numbers)?e=v.NUMBER:W(t,m.bools)?e=v.BOOLEAN:W(t,m.arrays)&&(e=v.ARRAY),e}(t),{[v.BOOLEAN]:!0,[v.STRING]:"",[v.NUMBER]:void 0,[v.ARRAY]:[]}[e]):a[t];var e}function H(t){return void 0===t}return G(_,!0),G(_,!1),function(t){const e=Object.create(null);F(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=w.resolve(w.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(j=t)}else t=w.require(e);L(t)}catch(e){"PermissionDenied"===e.name?j=e:t[n]&&(j=Error(p("Invalid JSON config file: %s",s)))}}))}(_),void 0!==c&&c.forEach((function(t){L(t)})),F(_,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=W(s,m.coercions),"function"==typeof e))try{const i=N(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){j=t}}))}(_),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(_),Object.keys(m.counts).forEach((function(t){D(_,t.split("."))||$(t,0)})),h&&C.length&&(_[u]=[]),C.forEach((function(t){_[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(_).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete _[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete _[t.split(".").map((t=>g(t))).join(".")],delete _[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(A,_),configuration:o,defaulted:Object.assign({},f),error:j,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>S,format:p.format,normalize:f.normalize,resolve:f.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),C=function(t,e){return j.parse(t.slice(),e).argv};C.detailed=function(t,e){return j.parse(t.slice(),e)},C.camelCase=g,C.decamelize=y,C.looksLikeNumber=b;const _=C;function A(){return process.versions.electron&&!process.defaultApp?0:1}class k extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,k)}}const P={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:p.format,resolve:f.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let I;class ${constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),I.format.apply(I.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),I.format.apply(I.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);I.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{I.fs.readFileSync&&(t=JSON.parse(I.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=I.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=I.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return I.exists(t)}}const M=t=>function(t,e){I=e;const n=new $(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,P),T="loading a directory of commands is not supported yet for ESM";let N;try{N=(0,m.fileURLToPath)(import.meta.url)}catch(t){N=process.cwd()}const L=N.substring(0,N.lastIndexOf("node_modules")),G={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return l=e,new o({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:u,wrap:d})},findUp:function(t,e){let n,i=(0,f.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,f.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,f.resolve)(i,n);if(i=(0,f.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:p.inspect,getCallerFile:()=>{throw new k(T)},getProcessArgvBin:function(){return process.argv[A()]},mainFilename:L||process.cwd(),Parser:_,path:{basename:f.basename,dirname:f.dirname,extname:f.extname,relative:f.relative,resolve:f.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new k("require is not supported by ESM")},requireDirectory:()=>{throw new k(T)},stringWidth:t=>[...t].length,y18n:M({directory:(0,f.resolve)(N,"../../../locales"),updateFiles:!1})};function F(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function D(t,e){e.assert.strictEqual(typeof t,"string")}function R(t){return Object.keys(t)}function W(t){return!!t&&!!t.then&&"function"==typeof t.then}function U(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const B=["first","second","third","fourth","fifth","sixth"];function z(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[U(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new k(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new k(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=H(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&q(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=H(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&q(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function H(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function q(t,e,n){throw new k(`Invalid ${B[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class V{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(z("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function K(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(W(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return W(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function Y(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return W(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const X=/(^\*)|(^\$0)/;class J{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(Q(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=U(t);o=o.map((t=>U(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!X.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(X,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return W(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(Z(c)){const h=c(n.getInternalMethods().reset(s),a);if(W(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return W(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=X.test(e.original)?e.original.replace(X,"").trim():e.original,s=t.filter((t=>!X.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=Y(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=Y(n=K(n,r,o,!1),(t=>{const n=e.handler(t);return W(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),W(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=K(n,o,c,!0);return W(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=U(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=X.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(Z(e))return e(t,!0);Q(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;F(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();F(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Q(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function Z(t){return"function"==typeof t}function tt(t={},e=(()=>!0)){const n={};return R(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function et(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function nt(t){return"boolean"==typeof t}function st(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&et(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new k(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(nt(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;function y(){return g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m}s.wrap=t=>{g=!0,m=t};const b="__yargsString__:";function v(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${ot(t[0])}`:ot(t[0]))+rt(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let w;function x(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>b+t,s.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(x),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const E=y(),S=e.cliui({width:E,wrap:!!E});if(!h)if(l.length)l.forEach((t=>{S.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&S.div({text:`${t[1]}`,padding:[1,0,0,0]})})),S.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,S.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){S.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;S.span({text:e,padding:[0,2,0,2],width:v(d,E,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?S.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):S.div()})),S.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const C=n("Options:");c[C]||(c[C]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,C);const _=t=>/^--/.test(ot(t)),A=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(x).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>_(t)===_(e)?0:_(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(A.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>_(e[t])))))&&A.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;_(e[t])&&(e[t]=(n=e[t],s="-x, ".length,it(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),A.forEach((({groupName:t,normalizedKeys:e,switches:i})=>{S.div(t),e.forEach((t=>{const e=i[t];let o=f[t]||"",c=null;o.includes(b)&&(o=n(o.substring(b.length))),m.boolean.includes(t)&&(c=`[${n("boolean")}]`),m.count.includes(t)&&(c=`[${n("count")}]`),m.string.includes(t)&&(c=`[${n("string")}]`),m.normalize.includes(t)&&(c=`[${n("string")}]`),m.array.includes(t)&&(c=`[${n("array")}]`),m.number.includes(t)&&(c=`[${n("number")}]`);const l=[t in a?(h=a[t],"string"==typeof h?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`):null,c,t in r?`[${n("required")}]`:null,m.choices&&m.choices[t]?`[${n("choices:")} ${s.stringifiedValues(m.choices[t])}]`:null,O(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");var h;S.span({text:ot(e),padding:[0,2,0,2+rt(e)],width:v(i,E)+4},o),l?S.div({text:l,padding:[0,0,0,2],align:"right"}):S.div()})),S.div()})),u.length&&(S.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?S.div({text:t[0],padding:[0,2,0,2]}):S.div({text:t[0],padding:[0,2,0,2],width:v(u,E)+4},{text:t[1]})})),S.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");S.div(`${t}\n`)}return S.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){w=this.help()},s.clearCachedHelpMessage=function(){w=void 0},s.hasCachedHelpMessage=function(){return!!w},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let E=null;s.version=t=>{E=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(E)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=tt(f,(e=>!t[e])),s};const S=[];return s.freeze=function(){S.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=S.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function it(t){return"object"==typeof t}function rt(t){return it(t)?t.indentation:0}function ot(t){return it(t)?t.text:t}class at{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(Z(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=U(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||(this.completeOptionKey(r,t,s),o&&n.default[r]&&this.completeOptionKey(`no-${r}`,t,s))}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n){const s=this.usage.getDescriptions(),i=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const n=s[t]||"";e.push(i+`${t.replace(/:/g,"\\:")}:${n.replace("__yargsString__:","")}`)}else e.push(i+t)}customCompletion(t,e,n,s){if(F(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return W(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return W(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function ct(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const lt=["$0","--","_"];let ht,ut=[];function dt(t,e,n,s){ht=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return ht.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(ut.indexOf(t)>-1)throw new k(`Circular extended configurations: '${t}'.`)}(r),ut.push(r),i=s?JSON.parse(ht.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=dt(i,ht.path.dirname(r),n,ht)}return ut=[],n?ft(i,t):Object.assign({},i,t)}function ft(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=ft(t[i],e[i]):n[i]=e[i];return n}var pt,mt,gt,yt,bt,vt,wt,xt,Ot,Et,St,jt,Ct,_t,At,kt,Pt,It,$t,Mt,Tt,Nt,Lt,Gt,Ft,Dt,Rt,Wt,Ut,Bt,zt,Ht,qt,Vt,Kt=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},Yt=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const Xt=Symbol("copyDoubleDash"),Jt=Symbol("copyDoubleDash"),Qt=Symbol("deleteFromParserHintObject"),Zt=Symbol("emitWarning"),te=Symbol("freeze"),ee=Symbol("getDollarZero"),ne=Symbol("getParserConfiguration"),se=Symbol("guessLocale"),ie=Symbol("guessVersion"),re=Symbol("parsePositionalNumbers"),oe=Symbol("pkgUp"),ae=Symbol("populateParserHintArray"),ce=Symbol("populateParserHintSingleValueDictionary"),le=Symbol("populateParserHintArrayDictionary"),he=Symbol("populateParserHintDictionary"),ue=Symbol("sanitizeKey"),de=Symbol("setKey"),fe=Symbol("unfreeze"),pe=Symbol("validateAsync"),me=Symbol("getCommandInstance"),ge=Symbol("getContext"),ye=Symbol("getHasOutput"),be=Symbol("getLoggerInstance"),ve=Symbol("getParseContext"),we=Symbol("getUsageInstance"),xe=Symbol("getValidationInstance"),Oe=Symbol("hasParseCallback"),Ee=Symbol("isGlobalContext"),Se=Symbol("postProcess"),je=Symbol("rebase"),Ce=Symbol("reset"),_e=Symbol("runYargsParserAndExecuteCommands"),Ae=Symbol("runValidation"),ke=Symbol("setHasOutput"),Pe=Symbol("kTrackManuallySetKeys");class Ie{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,pt.set(this,void 0),mt.set(this,void 0),gt.set(this,{commands:[],fullCommands:[]}),yt.set(this,null),bt.set(this,null),vt.set(this,"show-hidden"),wt.set(this,null),xt.set(this,!0),Ot.set(this,{}),Et.set(this,!0),St.set(this,[]),jt.set(this,void 0),Ct.set(this,{}),_t.set(this,!1),At.set(this,null),kt.set(this,!0),Pt.set(this,void 0),It.set(this,""),$t.set(this,void 0),Mt.set(this,void 0),Tt.set(this,{}),Nt.set(this,null),Lt.set(this,null),Gt.set(this,{}),Ft.set(this,{}),Dt.set(this,void 0),Rt.set(this,!1),Wt.set(this,void 0),Ut.set(this,!1),Bt.set(this,!1),zt.set(this,!1),Ht.set(this,void 0),qt.set(this,null),Vt.set(this,void 0),Kt(this,Wt,s,"f"),Kt(this,Dt,t,"f"),Kt(this,mt,e,"f"),Kt(this,Mt,n,"f"),Kt(this,jt,new V(this),"f"),this.$0=this[ee](),this[Ce](),Kt(this,pt,Yt(this,pt,"f"),"f"),Kt(this,Ht,Yt(this,Ht,"f"),"f"),Kt(this,Vt,Yt(this,Vt,"f"),"f"),Kt(this,$t,Yt(this,$t,"f"),"f"),Yt(this,$t,"f").showHiddenOpt=Yt(this,vt,"f"),Kt(this,Pt,this[Jt](),"f")}addHelpOpt(t,e){return z("[string|boolean] [string]",[t,e],arguments.length),Yt(this,At,"f")&&(this[Qt](Yt(this,At,"f")),Kt(this,At,null,"f")),!1===t&&void 0===e||(Kt(this,At,"string"==typeof t?t:"help","f"),this.boolean(Yt(this,At,"f")),this.describe(Yt(this,At,"f"),e||Yt(this,Ht,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(z("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:Yt(this,vt,"f");return this.boolean(n),this.describe(n,e||Yt(this,Ht,"f").deferY18nLookup("Show hidden options")),Yt(this,$t,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[le](this.alias.bind(this),"alias",t,e),this}array(t){return z("<array|string>",[t],arguments.length),this[ae]("array",t),this[Pe](t),this}boolean(t){return z("<array|string>",[t],arguments.length),this[ae]("boolean",t),this[Pe](t),this}check(t,e){return z("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>Y((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&Yt(this,Ht,"f").fail(n.toString(),n):Yt(this,Ht,"f").fail(Yt(this,Wt,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(Yt(this,Ht,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[le](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(z("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new k("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new k("coerce callback must be provided");return Yt(this,$t,"f").key[t]=!0,Yt(this,jt,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Y((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new k(t.message)})):n}),t),this}conflicts(t,e){return z("<string|object> [string|array]",[t,e],arguments.length),Yt(this,Vt,"f").conflicts(t,e),this}config(t="config",e,n){return z("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||Yt(this,Ht,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{Yt(this,$t,"f").config[t]=n||!0})),this):(t=dt(t,Yt(this,mt,"f"),this[ne]()["deep-merge-config"]||!1,Yt(this,Wt,"f")),Yt(this,$t,"f").configObjects=(Yt(this,$t,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return z("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),Kt(this,bt,t||Yt(this,bt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(Yt(this,bt,"f"),e),n&&Yt(this,yt,"f").registerFunction(n),this}command(t,e,n,s,i,r){return z("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),Yt(this,pt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){z("<string> [object]",[t,e],arguments.length);const n=Yt(this,Mt,"f")||Yt(this,Wt,"f").require;return Yt(this,pt,"f").addDirectory(t,n,Yt(this,Wt,"f").getCallerFile(),e),this}count(t){return z("<array|string>",[t],arguments.length),this[ae]("count",t),this[Pe](t),this}default(t,e,n){return z("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(D(t,Yt(this,Wt,"f")),Yt(this,$t,"f").defaultDescription[t]=n),"function"==typeof e&&(D(t,Yt(this,Wt,"f")),Yt(this,$t,"f").defaultDescription[t]||(Yt(this,$t,"f").defaultDescription[t]=Yt(this,Ht,"f").functionDescription(e)),e=e.call()),this[ce](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return z("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),Yt(this,$t,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{F(n,!0,Yt(this,Wt,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(F(n,!0,Yt(this,Wt,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{F(n,!0,Yt(this,Wt,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[ce](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return z("<string> [string|boolean]",[t,e],arguments.length),Yt(this,$t,"f").deprecatedOptions[t]=e,this}describe(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[de](t,!0),Yt(this,Ht,"f").describe(t,e),this}detectLocale(t){return z("<boolean>",[t],arguments.length),Kt(this,xt,t,"f"),this}env(t){return z("[string|boolean]",[t],arguments.length),!1===t?delete Yt(this,$t,"f").envPrefix:Yt(this,$t,"f").envPrefix=t||"",this}epilogue(t){return z("<string>",[t],arguments.length),Yt(this,Ht,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return z("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):Yt(this,Ht,"f").example(t,e),this}exit(t,e){Kt(this,_t,!0,"f"),Kt(this,wt,e,"f"),Yt(this,Et,"f")&&Yt(this,Wt,"f").process.exit(t)}exitProcess(t=!0){return z("[boolean]",[t],arguments.length),Kt(this,Et,t,"f"),this}fail(t){if(z("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new k("Invalid first argument. Expected function or boolean 'false'");return Yt(this,Ht,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return z("<array> [function]",[t,e],arguments.length),e?Yt(this,yt,"f").getCompletion(t,e):new Promise(((e,n)=>{Yt(this,yt,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return z([],0),Yt(this,$t,"f").demandedOptions}getDemandedCommands(){return z([],0),Yt(this,$t,"f").demandedCommands}getDeprecatedOptions(){return z([],0),Yt(this,$t,"f").deprecatedOptions}getDetectLocale(){return Yt(this,xt,"f")}getExitProcess(){return Yt(this,Et,"f")}getGroups(){return Object.assign({},Yt(this,Ct,"f"),Yt(this,Ft,"f"))}getHelp(){if(Kt(this,_t,!0,"f"),!Yt(this,Ht,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[_e](Yt(this,Dt,"f"),void 0,void 0,0,!0);if(W(t))return t.then((()=>Yt(this,Ht,"f").help()))}const t=Yt(this,pt,"f").runDefaultBuilderOn(this);if(W(t))return t.then((()=>Yt(this,Ht,"f").help()))}return Promise.resolve(Yt(this,Ht,"f").help())}getOptions(){return Yt(this,$t,"f")}getStrict(){return Yt(this,Ut,"f")}getStrictCommands(){return Yt(this,Bt,"f")}getStrictOptions(){return Yt(this,zt,"f")}global(t,e){return z("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?Yt(this,$t,"f").local=Yt(this,$t,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{Yt(this,$t,"f").local.includes(t)||Yt(this,$t,"f").local.push(t)})),this}group(t,e){z("<string|array> <string>",[t,e],arguments.length);const n=Yt(this,Ft,"f")[e]||Yt(this,Ct,"f")[e];Yt(this,Ft,"f")[e]&&delete Yt(this,Ft,"f")[e];const s={};return Yt(this,Ct,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return z("<string>",[t],arguments.length),Yt(this,$t,"f").hiddenOptions.push(t),this}implies(t,e){return z("<string|object> [number|string|array]",[t,e],arguments.length),Yt(this,Vt,"f").implies(t,e),this}locale(t){return z("[string]",[t],arguments.length),void 0===t?(this[se](),Yt(this,Wt,"f").y18n.getLocale()):(Kt(this,xt,!1,"f"),Yt(this,Wt,"f").y18n.setLocale(t),this)}middleware(t,e,n){return Yt(this,jt,"f").addMiddleware(t,!!e,n)}nargs(t,e){return z("<string|object|array> [number]",[t,e],arguments.length),this[ce](this.nargs.bind(this),"narg",t,e),this}normalize(t){return z("<array|string>",[t],arguments.length),this[ae]("normalize",t),this}number(t){return z("<array|string>",[t],arguments.length),this[ae]("number",t),this[Pe](t),this}option(t,e){if(z("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Pe](t),!Yt(this,qt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Zt](['"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("\n"),void 0,"versionWarning"),Yt(this,$t,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(Yt(this,$t,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc;this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){z("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[te](),void 0===t&&(t=Yt(this,Dt,"f")),"object"==typeof e&&(Kt(this,Lt,e,"f"),e=n),"function"==typeof e&&(Kt(this,Nt,e,"f"),e=!1),e||Kt(this,Dt,t,"f"),Yt(this,Nt,"f")&&Kt(this,Et,!1,"f");const s=this[_e](t,!!e),i=this.parsed;return Yt(this,yt,"f").setParsed(this.parsed),W(s)?s.then((t=>(Yt(this,Nt,"f")&&Yt(this,Nt,"f").call(this,Yt(this,wt,"f"),t,Yt(this,It,"f")),t))).catch((t=>{throw Yt(this,Nt,"f")&&Yt(this,Nt,"f")(t,this.parsed.argv,Yt(this,It,"f")),t})).finally((()=>{this[fe](),this.parsed=i})):(Yt(this,Nt,"f")&&Yt(this,Nt,"f").call(this,Yt(this,wt,"f"),s,Yt(this,It,"f")),this[fe](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return W(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(W(s))throw new k(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return z("<object>",[t],arguments.length),Kt(this,Tt,t,"f"),this}pkgConf(t,e){z("<string> [string]",[t,e],arguments.length);let n=null;const s=this[oe](e||Yt(this,mt,"f"));return s[t]&&"object"==typeof s[t]&&(n=dt(s[t],e||Yt(this,mt,"f"),this[ne]()["deep-merge-config"]||!1,Yt(this,Wt,"f")),Yt(this,$t,"f").configObjects=(Yt(this,$t,"f").configObjects||[]).concat(n)),this}positional(t,e){z("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=tt(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=Yt(this,gt,"f").fullCommands[Yt(this,gt,"f").fullCommands.length-1],i=s?Yt(this,pt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return R(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,Yt(this,Ht,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return z("[boolean]",[t],arguments.length),Kt(this,Rt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return z("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&Yt(this,$t,"f").narg[t]||this[ce](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return z("[string] [string]",[t,e],arguments.length),t=t||this.$0,Yt(this,Pt,"f").log(Yt(this,yt,"f").generateCompletionScript(t,e||Yt(this,bt,"f")||"completion")),this}showHelp(t){if(z("[string|function]",[t],arguments.length),Kt(this,_t,!0,"f"),!Yt(this,Ht,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[_e](Yt(this,Dt,"f"),void 0,void 0,0,!0);if(W(e))return e.then((()=>{Yt(this,Ht,"f").showHelp(t)})),this}const e=Yt(this,pt,"f").runDefaultBuilderOn(this);if(W(e))return e.then((()=>{Yt(this,Ht,"f").showHelp(t)})),this}return Yt(this,Ht,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return z("[boolean|string] [string]",[t,e],arguments.length),Yt(this,Ht,"f").showHelpOnFail(t,e),this}showVersion(t){return z("[string|function]",[t],arguments.length),Yt(this,Ht,"f").showVersion(t),this}skipValidation(t){return z("<array|string>",[t],arguments.length),this[ae]("skipValidation",t),this}strict(t){return z("[boolean]",[t],arguments.length),Kt(this,Ut,!1!==t,"f"),this}strictCommands(t){return z("[boolean]",[t],arguments.length),Kt(this,Bt,!1!==t,"f"),this}strictOptions(t){return z("[boolean]",[t],arguments.length),Kt(this,zt,!1!==t,"f"),this}string(t){return z("<array|string>",[t],arguments.length),this[ae]("string",t),this[Pe](t),this}terminalWidth(){return z([],0),Yt(this,Wt,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return z("<object>",[t],arguments.length),Kt(this,xt,!1,"f"),Yt(this,Wt,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(z("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(F(t,null,Yt(this,Wt,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new k(".usage() description must start with $0 if being used as alias for .command()")}return Yt(this,Ht,"f").usage(t),this}version(t,e,n){const s="version";if(z("[boolean|string] [string] [string]",[t,e,n],arguments.length),Yt(this,qt,"f")&&(this[Qt](Yt(this,qt,"f")),Yt(this,Ht,"f").version(void 0),Kt(this,qt,null,"f")),0===arguments.length)n=this[ie](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return Kt(this,qt,"string"==typeof t?t:s,"f"),e=e||Yt(this,Ht,"f").deferY18nLookup("Show version number"),Yt(this,Ht,"f").version(n||void 0),this.boolean(Yt(this,qt,"f")),this.describe(Yt(this,qt,"f"),e),this}wrap(t){return z("<number|null|undefined>",[t],arguments.length),Yt(this,Ht,"f").wrap(t),this}[(pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,yt=new WeakMap,bt=new WeakMap,vt=new WeakMap,wt=new WeakMap,xt=new WeakMap,Ot=new WeakMap,Et=new WeakMap,St=new WeakMap,jt=new WeakMap,Ct=new WeakMap,_t=new WeakMap,At=new WeakMap,kt=new WeakMap,Pt=new WeakMap,It=new WeakMap,$t=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Rt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Xt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[Jt](){return{log:(...t)=>{this[Oe]()||console.log(...t),Kt(this,_t,!0,"f"),Yt(this,It,"f").length&&Kt(this,It,Yt(this,It,"f")+"\n","f"),Kt(this,It,Yt(this,It,"f")+t.join(" "),"f")},error:(...t)=>{this[Oe]()||console.error(...t),Kt(this,_t,!0,"f"),Yt(this,It,"f").length&&Kt(this,It,Yt(this,It,"f")+"\n","f"),Kt(this,It,Yt(this,It,"f")+t.join(" "),"f")}}}[Qt](t){R(Yt(this,$t,"f")).forEach((e=>{if("configObjects"===e)return;const n=Yt(this,$t,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete Yt(this,Ht,"f").getDescriptions()[t]}[Zt](t,e,n){Yt(this,Ot,"f")[n]||(Yt(this,Wt,"f").process.emitWarning(t,e),Yt(this,Ot,"f")[n]=!0)}[te](){Yt(this,St,"f").push({options:Yt(this,$t,"f"),configObjects:Yt(this,$t,"f").configObjects.slice(0),exitProcess:Yt(this,Et,"f"),groups:Yt(this,Ct,"f"),strict:Yt(this,Ut,"f"),strictCommands:Yt(this,Bt,"f"),strictOptions:Yt(this,zt,"f"),completionCommand:Yt(this,bt,"f"),output:Yt(this,It,"f"),exitError:Yt(this,wt,"f"),hasOutput:Yt(this,_t,"f"),parsed:this.parsed,parseFn:Yt(this,Nt,"f"),parseContext:Yt(this,Lt,"f")}),Yt(this,Ht,"f").freeze(),Yt(this,Vt,"f").freeze(),Yt(this,pt,"f").freeze(),Yt(this,jt,"f").freeze()}[ee](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(Yt(this,Wt,"f").process.argv()[0])?Yt(this,Wt,"f").process.argv().slice(1,2):Yt(this,Wt,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[je](Yt(this,mt,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),Yt(this,Wt,"f").getEnv("_")&&Yt(this,Wt,"f").getProcessArgvBin()===Yt(this,Wt,"f").getEnv("_")&&(e=Yt(this,Wt,"f").getEnv("_").replace(`${Yt(this,Wt,"f").path.dirname(Yt(this,Wt,"f").process.execPath())}/`,"")),e}[ne](){return Yt(this,Tt,"f")}[se](){if(!Yt(this,xt,"f"))return;const t=Yt(this,Wt,"f").getEnv("LC_ALL")||Yt(this,Wt,"f").getEnv("LC_MESSAGES")||Yt(this,Wt,"f").getEnv("LANG")||Yt(this,Wt,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[ie](){return this[oe]().version||"unknown"}[re](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)Yt(this,Wt,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[oe](t){const e=t||"*";if(Yt(this,Gt,"f")[e])return Yt(this,Gt,"f")[e];let n={};try{let e=t||Yt(this,Wt,"f").mainFilename;!t&&Yt(this,Wt,"f").path.extname(e)&&(e=Yt(this,Wt,"f").path.dirname(e));const s=Yt(this,Wt,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));F(s,void 0,Yt(this,Wt,"f")),n=JSON.parse(Yt(this,Wt,"f").readFileSync(s,"utf8"))}catch(t){}return Yt(this,Gt,"f")[e]=n||{},Yt(this,Gt,"f")[e]}[ae](t,e){(e=[].concat(e)).forEach((e=>{e=this[ue](e),Yt(this,$t,"f")[t].push(e)}))}[ce](t,e,n,s){this[he](t,e,n,s,((t,e,n)=>{Yt(this,$t,"f")[t][e]=n}))}[le](t,e,n,s){this[he](t,e,n,s,((t,e,n)=>{Yt(this,$t,"f")[t][e]=(Yt(this,$t,"f")[t][e]||[]).concat(n)}))}[he](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of R(n))t(e,n[e]);else i(e,this[ue](n),s)}[ue](t){return"__proto__"===t?"___proto___":t}[de](t,e){return this[ce](this[de].bind(this),"key",t,e),this}[fe](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=Yt(this,St,"f").pop();let f;F(d,void 0,Yt(this,Wt,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){Kt(t,$t,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){Kt(e,Et,t,"f")}}.value,groups:{set value(t){Kt(n,Ct,t,"f")}}.value,output:{set value(t){Kt(s,It,t,"f")}}.value,exitError:{set value(t){Kt(i,wt,t,"f")}}.value,hasOutput:{set value(t){Kt(r,_t,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){Kt(o,Ut,t,"f")}}.value,strictCommands:{set value(t){Kt(a,Bt,t,"f")}}.value,strictOptions:{set value(t){Kt(c,zt,t,"f")}}.value,completionCommand:{set value(t){Kt(l,bt,t,"f")}}.value,parseFn:{set value(t){Kt(h,Nt,t,"f")}}.value,parseContext:{set value(t){Kt(u,Lt,t,"f")}}.value}=d),Yt(this,$t,"f").configObjects=f,Yt(this,Ht,"f").unfreeze(),Yt(this,Vt,"f").unfreeze(),Yt(this,pt,"f").unfreeze(),Yt(this,jt,"f").unfreeze()}[pe](t,e){return Y(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[me].bind(this),getContext:this[ge].bind(this),getHasOutput:this[ye].bind(this),getLoggerInstance:this[be].bind(this),getParseContext:this[ve].bind(this),getParserConfiguration:this[ne].bind(this),getUsageInstance:this[we].bind(this),getValidationInstance:this[xe].bind(this),hasParseCallback:this[Oe].bind(this),isGlobalContext:this[Ee].bind(this),postProcess:this[Se].bind(this),reset:this[Ce].bind(this),runValidation:this[Ae].bind(this),runYargsParserAndExecuteCommands:this[_e].bind(this),setHasOutput:this[ke].bind(this)}}[me](){return Yt(this,pt,"f")}[ge](){return Yt(this,gt,"f")}[ye](){return Yt(this,_t,"f")}[be](){return Yt(this,Pt,"f")}[ve](){return Yt(this,Lt,"f")||{}}[we](){return Yt(this,Ht,"f")}[xe](){return Yt(this,Vt,"f")}[Oe](){return!!Yt(this,Nt,"f")}[Ee](){return Yt(this,kt,"f")}[Se](t,e,n,s){if(n)return t;if(W(t))return t;e||(t=this[Xt](t));return(this[ne]()["parse-positional-numbers"]||void 0===this[ne]()["parse-positional-numbers"])&&(t=this[re](t)),s&&(t=K(t,this,Yt(this,jt,"f").getMiddleware(),!1)),t}[Ce](t={}){Kt(this,$t,Yt(this,$t,"f")||{},"f");const e={};e.local=Yt(this,$t,"f").local||[],e.configObjects=Yt(this,$t,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(Yt(this,Ft,"f"),Object.keys(Yt(this,Ct,"f")).reduce(((t,e)=>{const s=Yt(this,Ct,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),Kt(this,Ct,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(Yt(this,$t,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=tt(Yt(this,$t,"f")[t],(t=>!n[t]))})),e.envPrefix=Yt(this,$t,"f").envPrefix,Kt(this,$t,e,"f"),Kt(this,Ht,Yt(this,Ht,"f")?Yt(this,Ht,"f").reset(n):st(this,Yt(this,Wt,"f")),"f"),Kt(this,Vt,Yt(this,Vt,"f")?Yt(this,Vt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("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(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{lt.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===lt.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){z("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(F(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){z("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=ct(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=tt(o,(e=>!t[e])),c=tt(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();F(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,Yt(this,Ht,"f"),Yt(this,Wt,"f")),"f"),Kt(this,pt,Yt(this,pt,"f")?Yt(this,pt,"f").reset():function(t,e,n,s){return new J(t,e,n,s)}(Yt(this,Ht,"f"),Yt(this,Vt,"f"),Yt(this,jt,"f"),Yt(this,Wt,"f")),"f"),Yt(this,yt,"f")||Kt(this,yt,function(t,e,n,s){return new at(t,e,n,s)}(this,Yt(this,Ht,"f"),Yt(this,pt,"f"),Yt(this,Wt,"f")),"f"),Yt(this,jt,"f").reset(),Kt(this,bt,null,"f"),Kt(this,It,"","f"),Kt(this,wt,null,"f"),Kt(this,_t,!1,"f"),this.parsed=!1,this}[je](t,e){return Yt(this,Wt,"f").path.relative(t,e)}[_e](t,e,n,s=0,i=!1){let r=!!n||i;t=t||Yt(this,Dt,"f"),Yt(this,$t,"f").__=Yt(this,Wt,"f").y18n.__,Yt(this,$t,"f").configuration=this[ne]();const o=!!Yt(this,$t,"f").configuration["populate--"],a=Object.assign({},Yt(this,$t,"f").configuration,{"populate--":!0}),c=Yt(this,Wt,"f").Parser.detailed(t,Object.assign({},Yt(this,$t,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,Yt(this,Lt,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===Yt(this,At,"f")&&l[t]?d=!0:t===Yt(this,qt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&Yt(this,Ht,"f").clearCachedHelpMessage();try{if(this[se](),e)return this[Se](l,o,!!n,!1);if(Yt(this,At,"f")){[Yt(this,At,"f")].concat(u[Yt(this,At,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}Kt(this,kt,!1,"f");const a=Yt(this,pt,"f").getCommands(),p=Yt(this,yt,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==Yt(this,bt,"f")){const t=Yt(this,pt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Se](t,o,!!n,!1)}if(!t&&e!==Yt(this,bt,"f")){t=e;break}}!Yt(this,pt,"f").hasDefaultCommand()&&Yt(this,Rt,"f")&&t&&!m&&Yt(this,Vt,"f").recommendCommands(t,a)}Yt(this,bt,"f")&&l._.includes(Yt(this,bt,"f"))&&!p&&(Yt(this,Et,"f")&&et(!0),this.showCompletionScript(),this.exit(0))}if(Yt(this,pt,"f").hasDefaultCommand()&&!m){const t=Yt(this,pt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Se](t,o,!!n,!1)}if(p){Yt(this,Et,"f")&&et(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${Yt(this,yt,"f").completionKey}`)+1);return Yt(this,yt,"f").getCompletion(e,((t,e)=>{if(t)throw new k(t.message);(e||[]).forEach((t=>{Yt(this,Pt,"f").log(t)})),this.exit(0)})),this[Se](l,!o,!!n,!1)}if(Yt(this,_t,"f")||(d?(Yt(this,Et,"f")&&et(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(Yt(this,Et,"f")&&et(!0),r=!0,Yt(this,Ht,"f").showVersion("log"),this.exit(0))),!r&&Yt(this,$t,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>Yt(this,$t,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new k(c.error.message);if(!p){const t=this[Ae](u,{},c.error);n||(h=K(l,this,Yt(this,jt,"f").getMiddleware(),!0)),h=this[pe](t,null!=h?h:l),W(h)&&!n&&(h=h.then((()=>K(l,this,Yt(this,jt,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof k))throw t;Yt(this,Ht,"f").fail(t.message,t)}return this[Se](null!=h?h:l,o,!!n,!0)}[Ae](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new k(n.message);Yt(this,Vt,"f").nonOptionCount(r),Yt(this,Vt,"f").requiredArguments(r,i);let o=!1;Yt(this,Bt,"f")&&(o=Yt(this,Vt,"f").unknownCommands(r)),Yt(this,Ut,"f")&&!o?Yt(this,Vt,"f").unknownArguments(r,t,e,!!s):Yt(this,zt,"f")&&Yt(this,Vt,"f").unknownArguments(r,t,{},!1,!1),Yt(this,Vt,"f").limitedChoices(r),Yt(this,Vt,"f").implications(r),Yt(this,Vt,"f").conflicting(r)}}[ke](){Kt(this,_t,!0,"f")}[Pe](t){if("string"==typeof t)Yt(this,$t,"f").key[t]=!0;else for(const e of t)Yt(this,$t,"f").key[e]=!0}}const $e=(Me=G,(t=[],e=Me.process.cwd(),n)=>{const s=new Ie(t,e,n,Me);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var Me;const Te=$e;function Ne(t,e){const n=t.startsWith(".")?(0,f.join)(e,t):t;return import(n)}function Le(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Ge=a(23799);const Fe="git",De="";const Re=process.cwd();function We(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{try{Boolean(Ge.sync("git",["--version"]).stdout)&&"true"===Ge.sync("git",["rev-parse","--is-inside-work-tree"],{cwd:Re}).stdout&&""===(0,f.relative)(process.cwd(),Ge.sync("git",["rev-parse","--show-toplevel"],{cwd:Re}).stdout)&&Ge.sync("git",["config","core.hooksPath",".githooks"],{cwd:Re}),console.log("Done: set .githooks")}catch(t){process.exitCode=1,console.error("Fail:",t.message)}})),t.demandCommand(1,"Typing `hooks`")}const Ue=t(import.meta.url)("module"),Be=process.cwd();const ze=(0,Ue.createRequire)(import.meta.url);function He(t,e=Be){return t.startsWith(".")?(0,f.resolve)(e,t):(0,f.isAbsolute)(t)?t:ze.resolve(t)}function qe(t){try{return(0,s.statSync)(He(t)),!0}catch{return!1}}function Ve(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(He(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}const Ke=t(import.meta.url)("fs/promises"),Ye={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function Xe(){return(0,Ke.readFile)((0,f.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function Je(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await Xe(),e=await Promise.all([a.e(402),a.e(824)]).then(a.t.bind(a,69402,19)).then((t=>t.default.default||t.default)),n=await Promise.all([a.e(640),a.e(824)]).then(a.t.bind(a,93794,19)).then((t=>t.default.default||t.default)),s=await e(t,Ye);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function Qe({rustywind:t,garou:e,stylelint:n,eslint:s,prettier:i,typescript:r}){const o=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{{wx,tt,q,ax,jx,ks}ml,swan}":[t&&"rustywind --write"],"*.{vue,html,htm,md}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`,s&&`eslint --fix -f=pretty${o}`],"*.{ts,tsx,mts,cts}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,s&&`eslint --fix -f=pretty${o}`,r&&(()=>"tsc --noEmit")],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,s&&`eslint --fix -f=pretty${o}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&"garou",i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`],"{*.{json,jsonc,webmanifest,editorconfig,yml,yaml,toml},.{babel,npm}rc}":[i&&`prettier -w -u${o}`],"*.svg":[e&&"garou",i&&`prettier --parser html -w -u${o}`,i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`],"yarn.lock":[e&&"garou"]})}async function Ze(){const{default:t}=await Promise.all([a.e(640),a.e(841),a.e(824)]).then(a.bind(a,73750));return t({allowEmpty:!0,concurrent:!0,config:Qe(function(){const t=Ve("devDependencies");return{rustywind:"rustywind"in t,garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t,typescript:"typescript"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const tn="lint";function en(t){Je(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{Ze().then((t=>{process.exitCode=t?0:1})).catch((()=>{process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=Te(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Ne(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Ne(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,m.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>Le(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(qe("svgo/package.json")&&qe("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ue.createRequire)(import.meta.url);Ge("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();
|
|
2
|
+
import{createRequire as t}from"module";var e,n,s,i,r={8995:(t,e,n)=>{const s=n(32081),i=n(19015),r=n(95350);function o(t,e,n){const o=i(t,e,n),a=s.spawn(o.command,o.args,o.options);return r.hookChildProcess(a,o),a}t.exports=o,t.exports.spawn=o,t.exports.sync=function(t,e,n){const o=i(t,e,n),a=s.spawnSync(o.command,o.args,o.options);return a.error=a.error||r.verifyENOENTSync(a.status,o),a},t.exports._parse=i,t.exports._enoent=r},95350:t=>{const e="win32"===process.platform;function n(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function s(t,s){return e&&1===t&&!s.file?n(s.original,"spawn"):null}t.exports={hookChildProcess:function(t,n){if(!e)return;const i=t.emit;t.emit=function(e,r){if("exit"===e){const e=s(r,n);if(e)return i.call(t,"error",e)}return i.apply(t,arguments)}},verifyENOENT:s,verifyENOENTSync:function(t,s){return e&&1===t&&!s.file?n(s.original,"spawnSync"):null},notFoundError:n}},19015:(t,e,n)=>{const s=n(71017),i=n(65358),r=n(16214),o=n(63106),a="win32"===process.platform,c=/\.(?:com|exe)$/i,l=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function h(t){if(!a)return t;const e=function(t){t.file=i(t);const e=t.file&&o(t.file);return e?(t.args.unshift(t.file),t.command=e,i(t)):t.file}(t),n=!c.test(e);if(t.options.forceShell||n){const n=l.test(e);t.command=s.normalize(t.command),t.command=r.command(t.command),t.args=t.args.map((t=>r.argument(t,n)));const i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}t.exports=function(t,e,n){e&&!Array.isArray(e)&&(n=e,e=null);const s={command:t,args:e=e?e.slice(0):[],options:n=Object.assign({},n),file:void 0,original:{command:t,args:e}};return n.shell?s:h(s)}},16214:t=>{const e=/([()\][%!^"`<>&|;, *?])/g;t.exports.command=function(t){return t=t.replace(e,"^$1")},t.exports.argument=function(t,n){return t=(t=`"${t=(t=(t=`${t}`).replace(/(\\*)"/g,'$1$1\\"')).replace(/(\\*)$/,"$1$1")}"`).replace(e,"^$1"),n&&(t=t.replace(e,"^$1")),t}},63106:(t,e,n)=>{const s=n(57147),i=n(14256);t.exports=function(t){const e=Buffer.alloc(150);let n;try{n=s.openSync(t,"r"),s.readSync(n,e,0,150,0),s.closeSync(n)}catch(t){}return i(e.toString())}},65358:(t,e,n)=>{const s=n(71017),i=n(1468),r=n(26569);function o(t,e){const n=t.options.env||process.env,o=process.cwd(),a=null!=t.options.cwd,c=a&&void 0!==process.chdir&&!process.chdir.disabled;if(c)try{process.chdir(t.options.cwd)}catch(t){}let l;try{l=i.sync(t.command,{path:n[r({env:n})],pathExt:e?s.delimiter:void 0})}catch(t){}finally{c&&process.chdir(o)}return l&&(l=s.resolve(a?t.options.cwd:"",l)),l}t.exports=function(t){return o(t)||o(t,!0)}},1468:(t,e,n)=>{const s="win32"===process.platform||"cygwin"===process.env.OSTYPE||"msys"===process.env.OSTYPE,i=n(71017),r=s?";":":",o=n(5909),a=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),c=(t,e)=>{const n=e.colon||r,i=t.match(/\//)||s&&t.match(/\\/)?[""]:[...s?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(n)],o=s?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",a=s?o.split(n):[""];return s&&-1!==t.indexOf(".")&&""!==a[0]&&a.unshift(""),{pathEnv:i,pathExt:a,pathExtExe:o}},l=(t,e,n)=>{"function"==typeof e&&(n=e,e={}),e||(e={});const{pathEnv:s,pathExt:r,pathExtExe:l}=c(t,e),h=[],u=n=>new Promise(((r,o)=>{if(n===s.length)return e.all&&h.length?r(h):o(a(t));const c=s[n],l=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(l,t),f=!l&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;r(d(f,n,0))})),d=(t,n,s)=>new Promise(((i,a)=>{if(s===r.length)return i(u(n+1));const c=r[s];o(t+c,{pathExt:l},((r,o)=>{if(!r&&o){if(!e.all)return i(t+c);h.push(t+c)}return i(d(t,n,s+1))}))}));return n?u(0).then((t=>n(null,t)),n):u(0)};t.exports=l,l.sync=(t,e)=>{e=e||{};const{pathEnv:n,pathExt:s,pathExtExe:r}=c(t,e),l=[];for(let a=0;a<n.length;a++){const c=n[a],h=/^".*"$/.test(c)?c.slice(1,-1):c,u=i.join(h,t),d=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let t=0;t<s.length;t++){const n=d+s[t];try{if(o.sync(n,{pathExt:r})){if(!e.all)return n;l.push(n)}}catch(t){}}}if(e.all&&l.length)return l;if(e.nothrow)return null;throw a(t)}},23799:(t,e,n)=>{const s=n(71017),i=n(32081),r=n(8995),o=n(36178),a=n(9002),c=n(83937),l=n(97860),h=n(10407),{spawnedKill:u,spawnedCancel:d,setupTimeout:f,validateTimeout:p,setExitHandler:m}=n(5454),{handleInput:g,getSpawnedResult:y,makeAllStream:b,validateInputSync:v}=n(53036),{mergePromise:w,getSpawnedPromise:x}=n(24578),{joinCommand:O,parseCommand:E,getEscapedCommand:S}=n(82899),j=(t,e,n={})=>{const i=r._parse(t,e,n);return t=i.command,e=i.args,(n={maxBuffer:1e8,buffer:!0,stripFinalNewline:!0,extendEnv:!0,preferLocal:!1,localDir:(n=i.options).cwd||process.cwd(),execPath:process.execPath,encoding:"utf8",reject:!0,cleanup:!0,all:!1,windowsHide:!0,...n}).env=(({env:t,extendEnv:e,preferLocal:n,localDir:s,execPath:i})=>{const r=e?{...process.env,...t}:t;return n?a.env({env:r,cwd:s,execPath:i}):r})(n),n.stdio=h(n),"win32"===process.platform&&"cmd"===s.basename(t,".exe")&&e.unshift("/q"),{file:t,args:e,options:n,parsed:i}},C=(t,e,n)=>"string"==typeof e||Buffer.isBuffer(e)?t.stripFinalNewline?o(e):e:void 0===n?void 0:"",_=(t,e,n)=>{const s=j(t,e,n),r=O(t,e),o=S(t,e);let a;p(s.options);try{a=i.spawn(s.file,s.args,s.options)}catch(t){const e=new i.ChildProcess,n=Promise.reject(l({error:t,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:s,timedOut:!1,isCanceled:!1,killed:!1}));return w(e,n)}const h=x(a),v=f(a,s.options,h),E=m(a,s.options,v),_={isCanceled:!1};a.kill=u.bind(null,a.kill.bind(a)),a.cancel=d.bind(null,a,_);const A=c((async()=>{const[{error:t,exitCode:e,signal:n,timedOut:i},c,h,u]=await y(a,s.options,E),d=C(s.options,c),f=C(s.options,h),p=C(s.options,u);if(t||0!==e||null!==n){const c=l({error:t,exitCode:e,signal:n,stdout:d,stderr:f,all:p,command:r,escapedCommand:o,parsed:s,timedOut:i,isCanceled:_.isCanceled,killed:a.killed});if(!s.options.reject)return c;throw c}return{command:r,escapedCommand:o,exitCode:0,stdout:d,stderr:f,all:p,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}}));return g(a,s.options.input),a.all=b(a,s.options),w(a,A)};t.exports=_,t.exports.sync=(t,e,n)=>{const s=j(t,e,n),r=O(t,e),o=S(t,e);let a;v(s.options);try{a=i.spawnSync(s.file,s.args,s.options)}catch(t){throw l({error:t,stdout:"",stderr:"",all:"",command:r,escapedCommand:o,parsed:s,timedOut:!1,isCanceled:!1,killed:!1})}const c=C(s.options,a.stdout,a.error),h=C(s.options,a.stderr,a.error);if(a.error||0!==a.status||null!==a.signal){const t=l({stdout:c,stderr:h,error:a.error,signal:a.signal,exitCode:a.status,command:r,escapedCommand:o,parsed:s,timedOut:a.error&&"ETIMEDOUT"===a.error.code,isCanceled:!1,killed:null!==a.signal});if(!s.options.reject)return t;throw t}return{command:r,escapedCommand:o,exitCode:0,stdout:c,stderr:h,failed:!1,timedOut:!1,isCanceled:!1,killed:!1}},t.exports.command=(t,e)=>{const[n,...s]=E(t);return _(n,s,e)},t.exports.commandSync=(t,e)=>{const[n,...s]=E(t);return _.sync(n,s,e)},t.exports.node=(t,e,n={})=>{e&&!Array.isArray(e)&&"object"==typeof e&&(n=e,e=[]);const s=h.node(n),i=process.execArgv.filter((t=>!t.startsWith("--inspect"))),{nodePath:r=process.execPath,nodeOptions:o=i}=n;return _(r,[...o,t,...Array.isArray(e)?e:[]],{...n,stdin:void 0,stdout:void 0,stderr:void 0,stdio:s,shell:!1})}},82899:t=>{const e=(t,e=[])=>Array.isArray(e)?[t,...e]:[t],n=/^[\w.-]+$/,s=/"/g,i=/ +/g;t.exports={joinCommand:(t,n)=>e(t,n).join(" "),getEscapedCommand:(t,i)=>e(t,i).map((t=>(t=>"string"!=typeof t||n.test(t)?t:`"${t.replace(s,'\\"')}"`)(t))).join(" "),parseCommand:t=>{const e=[];for(const n of t.trim().split(i)){const t=e[e.length-1];t&&t.endsWith("\\")?e[e.length-1]=`${t.slice(0,-1)} ${n}`:e.push(n)}return e}}},97860:(t,e,n)=>{const{signalsByName:s}=n(83954);t.exports=({stdout:t,stderr:e,all:n,error:i,signal:r,exitCode:o,command:a,escapedCommand:c,timedOut:l,isCanceled:h,killed:u,parsed:{options:{timeout:d}}})=>{o=null===o?void 0:o;const f=void 0===(r=null===r?void 0:r)?void 0:s[r].description,p=(({timedOut:t,timeout:e,errorCode:n,signal:s,signalDescription:i,exitCode:r,isCanceled:o})=>t?`timed out after ${e} milliseconds`:o?"was canceled":void 0!==n?`failed with ${n}`:void 0!==s?`was killed with ${s} (${i})`:void 0!==r?`failed with exit code ${r}`:"failed")({timedOut:l,timeout:d,errorCode:i&&i.code,signal:r,signalDescription:f,exitCode:o,isCanceled:h}),m=`Command ${p}: ${a}`,g="[object Error]"===Object.prototype.toString.call(i),y=g?`${m}\n${i.message}`:m,b=[y,e,t].filter(Boolean).join("\n");return g?(i.originalMessage=i.message,i.message=b):i=new Error(b),i.shortMessage=y,i.command=a,i.escapedCommand=c,i.exitCode=o,i.signal=r,i.signalDescription=f,i.stdout=t,i.stderr=e,void 0!==n&&(i.all=n),"bufferedData"in i&&delete i.bufferedData,i.failed=!0,i.timedOut=Boolean(l),i.isCanceled=h,i.killed=u&&!l,i}},5454:(t,e,n)=>{const s=n(22037),i=n(90260),r=(t,e,n,s)=>{if(!o(e,n,s))return;const i=c(n),r=setTimeout((()=>{t("SIGKILL")}),i);r.unref&&r.unref()},o=(t,{forceKillAfterTimeout:e},n)=>a(t)&&!1!==e&&n,a=t=>t===s.constants.signals.SIGTERM||"string"==typeof t&&"SIGTERM"===t.toUpperCase(),c=({forceKillAfterTimeout:t=!0})=>{if(!0===t)return 5e3;if(!Number.isFinite(t)||t<0)throw new TypeError(`Expected the \`forceKillAfterTimeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`);return t};t.exports={spawnedKill:(t,e="SIGTERM",n={})=>{const s=t(e);return r(t,e,n,s),s},spawnedCancel:(t,e)=>{t.kill()&&(e.isCanceled=!0)},setupTimeout:(t,{timeout:e,killSignal:n="SIGTERM"},s)=>{if(0===e||void 0===e)return s;let i;const r=new Promise(((s,r)=>{i=setTimeout((()=>{((t,e,n)=>{t.kill(e),n(Object.assign(new Error("Timed out"),{timedOut:!0,signal:e}))})(t,n,r)}),e)})),o=s.finally((()=>{clearTimeout(i)}));return Promise.race([r,o])},validateTimeout:({timeout:t})=>{if(void 0!==t&&(!Number.isFinite(t)||t<0))throw new TypeError(`Expected the \`timeout\` option to be a non-negative integer, got \`${t}\` (${typeof t})`)},setExitHandler:async(t,{cleanup:e,detached:n},s)=>{if(!e||n)return s;const r=i((()=>{t.kill()}));return s.finally((()=>{r()}))}}},24578:t=>{const e=(async()=>{})().constructor.prototype,n=["then","catch","finally"].map((t=>[t,Reflect.getOwnPropertyDescriptor(e,t)]));t.exports={mergePromise:(t,e)=>{for(const[s,i]of n){const n="function"==typeof e?(...t)=>Reflect.apply(i.value,e(),t):i.value.bind(e);Reflect.defineProperty(t,s,{...i,value:n})}return t},getSpawnedPromise:t=>new Promise(((e,n)=>{t.on("exit",((t,n)=>{e({exitCode:t,signal:n})})),t.on("error",(t=>{n(t)})),t.stdin&&t.stdin.on("error",(t=>{n(t)}))}))}},10407:t=>{const e=["stdin","stdout","stderr"],n=t=>{if(!t)return;const{stdio:n}=t;if(void 0===n)return e.map((e=>t[e]));if((t=>e.some((e=>void 0!==t[e])))(t))throw new Error(`It's not possible to provide \`stdio\` in combination with one of ${e.map((t=>`\`${t}\``)).join(", ")}`);if("string"==typeof n)return n;if(!Array.isArray(n))throw new TypeError(`Expected \`stdio\` to be of type \`string\` or \`Array\`, got \`${typeof n}\``);const s=Math.max(n.length,e.length);return Array.from({length:s},((t,e)=>n[e]))};t.exports=n,t.exports.node=t=>{const e=n(t);return"ipc"===e?"ipc":void 0===e||"string"==typeof e?[e,e,e,"ipc"]:e.includes("ipc")?e:[...e,"ipc"]}},53036:(t,e,n)=>{const s=n(58607),i=n(29551),r=n(90873),o=async(t,e)=>{if(t){t.destroy();try{return await e}catch(t){return t.bufferedData}}},a=(t,{encoding:e,buffer:n,maxBuffer:s})=>{if(t&&n)return e?i(t,{encoding:e,maxBuffer:s}):i.buffer(t,{maxBuffer:s})};t.exports={handleInput:(t,e)=>{void 0!==e&&void 0!==t.stdin&&(s(e)?e.pipe(t.stdin):t.stdin.end(e))},makeAllStream:(t,{all:e})=>{if(!e||!t.stdout&&!t.stderr)return;const n=r();return t.stdout&&n.add(t.stdout),t.stderr&&n.add(t.stderr),n},getSpawnedResult:async({stdout:t,stderr:e,all:n},{encoding:s,buffer:i,maxBuffer:r},c)=>{const l=a(t,{encoding:s,buffer:i,maxBuffer:r}),h=a(e,{encoding:s,buffer:i,maxBuffer:r}),u=a(n,{encoding:s,buffer:i,maxBuffer:2*r});try{return await Promise.all([c,l,h,u])}catch(s){return Promise.all([{error:s,signal:s.signal,timedOut:s.timedOut},o(t,l),o(e,h),o(n,u)])}},validateInputSync:({input:t})=>{if(s(t))throw new TypeError("The `input` option cannot be a stream in sync mode")}}},30361:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=t=>{t={...t};const{array:e}=t;let{encoding:n}=t;const i="buffer"===n;let r=!1;e?r=!(n||i):n=n||"utf8",i&&(n=null);const o=new s({objectMode:r});n&&o.setEncoding(n);let a=0;const c=[];return o.on("data",(t=>{c.push(t),r?a=c.length:a+=t.length})),o.getBufferedValue=()=>e?c:i?Buffer.concat(c,a):c.join(""),o.getBufferedLength=()=>a,o}},29551:(t,e,n)=>{const{constants:s}=n(14300),i=n(12781),{promisify:r}=n(73837),o=n(30361),a=r(i.pipeline);class c extends Error{constructor(){super("maxBuffer exceeded"),this.name="MaxBufferError"}}async function l(t,e){if(!t)throw new Error("Expected a stream");e={maxBuffer:1/0,...e};const{maxBuffer:n}=e,i=o(e);return await new Promise(((e,r)=>{const o=t=>{t&&i.getBufferedLength()<=s.MAX_LENGTH&&(t.bufferedData=i.getBufferedValue()),r(t)};(async()=>{try{await a(t,i),e()}catch(t){o(t)}})(),i.on("data",(()=>{i.getBufferedLength()>n&&o(new c)}))})),i.getBufferedValue()}t.exports=l,t.exports.buffer=(t,e)=>l(t,{...e,encoding:"buffer"}),t.exports.array=(t,e)=>l(t,{...e,array:!0}),t.exports.MaxBufferError=c},55793:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGNALS=void 0;e.SIGNALS=[{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"}]},83954:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.signalsByNumber=e.signalsByName=void 0;var s=n(22037),i=n(49030),r=n(15260);const o=function(t,{name:e,number:n,description:s,supported:i,action:r,forced:o,standard:a}){return{...t,[e]:{name:e,number:n,description:s,supported:i,action:r,forced:o,standard:a}}},a=(0,i.getSignals)().reduce(o,{});e.signalsByName=a;const c=function(t,e){const n=l(t,e);if(void 0===n)return{};const{name:s,description:i,supported:r,action:o,forced:a,standard:c}=n;return{[t]:{name:s,number:t,description:i,supported:r,action:o,forced:a,standard:c}}},l=function(t,e){const n=e.find((({name:e})=>s.constants.signals[e]===t));return void 0!==n?n:e.find((e=>e.number===t))},h=function(){const t=(0,i.getSignals)(),e=r.SIGRTMAX+1,n=Array.from({length:e},((e,n)=>c(n,t)));return Object.assign({},...n)}();e.signalsByNumber=h},15260:(t,e)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.SIGRTMAX=e.getRealtimeSignals=void 0;e.getRealtimeSignals=function(){const t=i-s+1;return Array.from({length:t},n)};const n=function(t,e){return{name:`SIGRT${e+1}`,number:s+e,action:"terminate",description:"Application-specific signal (realtime)",standard:"posix"}},s=34,i=64;e.SIGRTMAX=i},49030:(t,e,n)=>{Object.defineProperty(e,"__esModule",{value:!0}),e.getSignals=void 0;var s=n(22037),i=n(55793),r=n(15260);e.getSignals=function(){const t=(0,r.getRealtimeSignals)();return[...i.SIGNALS,...t].map(o)};const o=function({name:t,number:e,description:n,action:i,forced:r=!1,standard:o}){const{signals:{[t]:a}}=s.constants,c=void 0!==a;return{name:t,number:c?a:e,description:n,supported:c,action:i,forced:r,standard:o}}},58607:t=>{const e=t=>null!==t&&"object"==typeof t&&"function"==typeof t.pipe;e.writable=t=>e(t)&&!1!==t.writable&&"function"==typeof t._write&&"object"==typeof t._writableState,e.readable=t=>e(t)&&!1!==t.readable&&"function"==typeof t._read&&"object"==typeof t._readableState,e.duplex=t=>e.writable(t)&&e.readable(t),e.transform=t=>e.duplex(t)&&"function"==typeof t._transform,t.exports=e},5909:(t,e,n)=>{var s;n(57147);function i(t,e,n){if("function"==typeof e&&(n=e,e={}),!n){if("function"!=typeof Promise)throw new TypeError("callback not provided");return new Promise((function(n,s){i(t,e||{},(function(t,e){t?s(t):n(e)}))}))}s(t,e||{},(function(t,s){t&&("EACCES"===t.code||e&&e.ignoreErrors)&&(t=null,s=!1),n(t,s)}))}s="win32"===process.platform||global.TESTING_WINDOWS?n(90837):n(74703),t.exports=i,i.sync=function(t,e){try{return s.sync(t,e||{})}catch(t){if(e&&e.ignoreErrors||"EACCES"===t.code)return!1;throw t}}},74703:(t,e,n)=>{t.exports=i,i.sync=function(t,e){return r(s.statSync(t),e)};var s=n(57147);function i(t,e,n){s.stat(t,(function(t,s){n(t,!t&&r(s,e))}))}function r(t,e){return t.isFile()&&function(t,e){var n=t.mode,s=t.uid,i=t.gid,r=void 0!==e.uid?e.uid:process.getuid&&process.getuid(),o=void 0!==e.gid?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),l=parseInt("001",8),h=a|c;return n&l||n&c&&i===o||n&a&&s===r||n&h&&0===r}(t,e)}},90837:(t,e,n)=>{t.exports=r,r.sync=function(t,e){return i(s.statSync(t),t,e)};var s=n(57147);function i(t,e,n){return!(!t.isSymbolicLink()&&!t.isFile())&&function(t,e){var n=void 0!==e.pathExt?e.pathExt:process.env.PATHEXT;if(!n)return!0;if(-1!==(n=n.split(";")).indexOf(""))return!0;for(var s=0;s<n.length;s++){var i=n[s].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}(e,n)}function r(t,e,n){s.stat(t,(function(s,r){n(s,!s&&i(r,t,e))}))}},90873:(t,e,n)=>{const{PassThrough:s}=n(12781);t.exports=function(){var t=[],e=new s({objectMode:!0});return e.setMaxListeners(0),e.add=n,e.isEmpty=i,e.on("unpipe",r),Array.prototype.slice.call(arguments).forEach(n),e;function n(s){return Array.isArray(s)?(s.forEach(n),this):(t.push(s),s.once("end",r.bind(null,s)),s.once("error",e.emit.bind(e,"error")),s.pipe(e,{end:!1}),this)}function i(){return 0==t.length}function r(n){!(t=t.filter((function(t){return t!==n}))).length&&e.readable&&e.end()}}},9002:(t,e,n)=>{const s=n(71017),i=n(26569),r=t=>{let e;t={cwd:process.cwd(),path:process.env[i()],execPath:process.execPath,...t};let n=s.resolve(t.cwd);const r=[];for(;e!==n;)r.push(s.join(n,"node_modules/.bin")),e=n,n=s.resolve(n,"..");const o=s.resolve(t.cwd,t.execPath,"..");return r.push(o),r.concat(t.path).join(s.delimiter)};t.exports=r,t.exports.default=r,t.exports.env=e=>{const n={...(e={env:process.env,...e}).env},s=i({env:n});return e.path=n[s],n[s]=t.exports(e),n}},83937:(t,e,n)=>{const s=n(26587),i=new WeakMap,r=(t,e={})=>{if("function"!=typeof t)throw new TypeError("Expected a function");let n,r=0;const o=t.displayName||t.name||"<anonymous>",a=function(...s){if(i.set(a,++r),1===r)n=t.apply(this,s),t=null;else if(!0===e.throw)throw new Error(`Function \`${o}\` can only be called once`);return n};return s(a,t),i.set(a,r),a};t.exports=r,t.exports.default=r,t.exports.callCount=t=>{if(!i.has(t))throw new Error(`The given function \`${t.name}\` is not wrapped by the \`onetime\` package`);return i.get(t)}},26587:t=>{const e=(t,e)=>{for(const n of Reflect.ownKeys(e))Object.defineProperty(t,n,Object.getOwnPropertyDescriptor(e,n));return t};t.exports=e,t.exports.default=e},26569:t=>{const e=(t={})=>{const e=t.env||process.env;return"win32"!==(t.platform||process.platform)?"PATH":Object.keys(e).reverse().find((t=>"PATH"===t.toUpperCase()))||"Path"};t.exports=e,t.exports.default=e},14256:(t,e,n)=>{const s=n(83882);t.exports=(t="")=>{const e=t.match(s);if(!e)return null;const[n,i]=e[0].replace(/#! ?/,"").split(" "),r=n.split("/").pop();return"env"===r?i:i?`${r} ${i}`:r}},83882:t=>{t.exports=/^#!(.*)/},90260:(t,e,n)=>{var s=global.process;const i=function(t){return t&&"object"==typeof t&&"function"==typeof t.removeListener&&"function"==typeof t.emit&&"function"==typeof t.reallyExit&&"function"==typeof t.listeners&&"function"==typeof t.kill&&"number"==typeof t.pid&&"function"==typeof t.on};if(i(s)){var r,o=n(39491),a=n(83261),c=/^win/i.test(s.platform),l=n(82361);"function"!=typeof l&&(l=l.EventEmitter),s.__signal_exit_emitter__?r=s.__signal_exit_emitter__:((r=s.__signal_exit_emitter__=new l).count=0,r.emitted={}),r.infinite||(r.setMaxListeners(1/0),r.infinite=!0),t.exports=function(t,e){if(!i(global.process))return function(){};o.equal(typeof t,"function","a callback must be provided for exit handler"),!1===f&&p();var n="exit";e&&e.alwaysLast&&(n="afterexit");return r.on(n,t),function(){r.removeListener(n,t),0===r.listeners("exit").length&&0===r.listeners("afterexit").length&&h()}};var h=function(){f&&i(global.process)&&(f=!1,a.forEach((function(t){try{s.removeListener(t,d[t])}catch(t){}})),s.emit=y,s.reallyExit=m,r.count-=1)};t.exports.unload=h;var u=function(t,e,n){r.emitted[t]||(r.emitted[t]=!0,r.emit(t,e,n))},d={};a.forEach((function(t){d[t]=function(){i(global.process)&&(s.listeners(t).length===r.count&&(h(),u("exit",null,t),u("afterexit",null,t),c&&"SIGHUP"===t&&(t="SIGINT"),s.kill(s.pid,t)))}})),t.exports.signals=function(){return a};var f=!1,p=function(){!f&&i(global.process)&&(f=!0,r.count+=1,a=a.filter((function(t){try{return s.on(t,d[t]),!0}catch(t){return!1}})),s.emit=b,s.reallyExit=g)};t.exports.load=p;var m=s.reallyExit,g=function(t){i(global.process)&&(s.exitCode=t||0,u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),m.call(s,s.exitCode))},y=s.emit,b=function(t,e){if("exit"===t&&i(global.process)){void 0!==e&&(s.exitCode=e);var n=y.apply(this,arguments);return u("exit",s.exitCode,null),u("afterexit",s.exitCode,null),n}return y.apply(this,arguments)}}else t.exports=function(){return function(){}}},83261:t=>{t.exports=["SIGABRT","SIGALRM","SIGHUP","SIGINT","SIGTERM"],"win32"!==process.platform&&t.exports.push("SIGVTALRM","SIGXCPU","SIGXFSZ","SIGUSR2","SIGTRAP","SIGSYS","SIGQUIT","SIGIOT"),"linux"===process.platform&&t.exports.push("SIGIO","SIGPOLL","SIGPWR","SIGSTKFLT","SIGUNUSED")},36178:t=>{t.exports=t=>{const e="string"==typeof t?"\n":"\n".charCodeAt(),n="string"==typeof t?"\r":"\r".charCodeAt();return t[t.length-1]===e&&(t=t.slice(0,t.length-1)),t[t.length-1]===n&&(t=t.slice(0,t.length-1)),t}},39491:e=>{e.exports=t(import.meta.url)("assert")},14300:e=>{e.exports=t(import.meta.url)("buffer")},32081:e=>{e.exports=t(import.meta.url)("child_process")},82361:e=>{e.exports=t(import.meta.url)("events")},57147:e=>{e.exports=t(import.meta.url)("fs")},22037:e=>{e.exports=t(import.meta.url)("os")},71017:e=>{e.exports=t(import.meta.url)("path")},12781:e=>{e.exports=t(import.meta.url)("stream")},76224:e=>{e.exports=t(import.meta.url)("tty")},73837:e=>{e.exports=t(import.meta.url)("util")}},o={};function a(t){var e=o[t];if(void 0!==e)return e.exports;var n=o[t]={id:t,loaded:!1,exports:{}};return r[t].call(n.exports,n,n.exports,a),n.loaded=!0,n.exports}a.m=r,n=Object.getPrototypeOf?t=>Object.getPrototypeOf(t):t=>t.__proto__,a.t=function(t,s){if(1&s&&(t=this(t)),8&s)return t;if("object"==typeof t&&t){if(4&s&&t.__esModule)return t;if(16&s&&"function"==typeof t.then)return t}var i=Object.create(null);a.r(i);var r={};e=e||[null,n({}),n([]),n(n)];for(var o=2&s&&t;"object"==typeof o&&!~e.indexOf(o);o=n(o))Object.getOwnPropertyNames(o).forEach((e=>r[e]=()=>t[e]));return r.default=()=>t,a.d(i,r),i},a.d=(t,e)=>{for(var n in e)a.o(e,n)&&!a.o(t,n)&&Object.defineProperty(t,n,{enumerable:!0,get:e[n]})},a.f={},a.e=t=>Promise.all(Object.keys(a.f).reduce(((e,n)=>(a.f[n](t,e),e)),[])),a.u=t=>t+".mjs",a.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e),a.r=t=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},a.nmd=t=>(t.paths=[],t.children||(t.children=[]),t),s={442:0},i=t=>{var e,n,{ids:i,modules:r,runtime:o}=t,c=0;for(e in r)a.o(r,e)&&(a.m[e]=r[e]);for(o&&o(a);c<i.length;c++)n=i[c],a.o(s,n)&&s[n]&&s[n][0](),s[i[c]]=0},a.f.j=(t,e)=>{var n=a.o(s,t)?s[t]:void 0;if(0!==n)if(n)e.push(n[1]);else{var r=import("./"+a.u(t)).then(i,(e=>{throw 0!==s[t]&&(s[t]=void 0),e}));r=Promise.race([r,new Promise((e=>n=s[t]=[e]))]),e.push(n[1]=r)}},(()=>{var e={};a.r(e),a.d(e,{builder:()=>We,command:()=>Fe,description:()=>De});var n={};a.r(n),a.d(n,{builder:()=>en,command:()=>tn});var s=a(57147),i=a(39491);const r={right:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n<e)return" ".repeat(e-n)+t;return t},center:function(t,e){t=t.trim();const n=l.stringWidth(t);if(n>=e)return t;return" ".repeat(e-n>>1)+t}};class o{constructor(t){var e;this.width=t.width,this.wrap=null===(e=t.wrap)||void 0===e||e,this.rows=[]}span(...t){this.div(...t).span=!0}resetOutput(){this.rows=[]}div(...t){if(0===t.length&&this.div(""),this.wrap&&this.shouldApplyLayoutDSL(...t)&&"string"==typeof t[0])return this.applyLayoutDSL(t[0]);const e=t.map((t=>"string"==typeof t?this.colFromString(t):t));return this.rows.push(e),e}shouldApplyLayoutDSL(...t){return 1===t.length&&"string"==typeof t[0]&&/[\t\n]/.test(t[0])}applyLayoutDSL(t){const e=t.split("\n").map((t=>t.split("\t")));let n=0;return e.forEach((t=>{t.length>1&&l.stringWidth(t[0])>n&&(n=Math.min(Math.floor(.5*this.width),l.stringWidth(t[0])))})),e.forEach((t=>{this.div(...t.map(((e,s)=>({text:e.trim(),padding:this.measurePadding(e),width:0===s&&t.length>1?n:void 0}))))})),this.rows[this.rows.length-1]}colFromString(t){return{text:t,padding:this.measurePadding(t)}}measurePadding(t){const e=l.stripAnsi(t);return[0,e.match(/\s*$/)[0].length,0,e.match(/^\s*/)[0].length]}toString(){const t=[];return this.rows.forEach((e=>{this.rowToString(e,t)})),t.filter((t=>!t.hidden)).map((t=>t.text)).join("\n")}rowToString(t,e){return this.rasterize(t).forEach(((n,s)=>{let i="";n.forEach(((n,o)=>{const{width:a}=t[o],h=this.negatePadding(t[o]);let u=n;if(h>l.stringWidth(n)&&(u+=" ".repeat(h-l.stringWidth(n))),t[o].align&&"left"!==t[o].align&&this.wrap){u=(0,r[t[o].align])(u,h),l.stringWidth(u)<h&&(u+=" ".repeat((a||0)-l.stringWidth(u)-1))}const d=t[o].padding||[0,0,0,0];d[3]&&(i+=" ".repeat(d[3])),i+=c(t[o],u,"| "),i+=u,i+=c(t[o],u," |"),d[1]&&(i+=" ".repeat(d[1])),0===s&&e.length>0&&(i=this.renderInline(i,e[e.length-1]))})),e.push({text:i.replace(/ +$/,""),span:t.span})})),e}renderInline(t,e){const n=t.match(/^ */),s=n?n[0].length:0,i=e.text,r=l.stringWidth(i.trimRight());return e.span?this.wrap?s<r?t:(e.hidden=!0,i.trimRight()+" ".repeat(s-r)+t.trimLeft()):(e.hidden=!0,i+t):t}rasterize(t){const e=[],n=this.columnWidths(t);let s;return t.forEach(((t,i)=>{t.width=n[i],s=this.wrap?l.wrap(t.text,this.negatePadding(t),{hard:!0}).split("\n"):t.text.split("\n"),t.border&&(s.unshift("."+"-".repeat(this.negatePadding(t)+2)+"."),s.push("'"+"-".repeat(this.negatePadding(t)+2)+"'")),t.padding&&(s.unshift(...new Array(t.padding[0]||0).fill("")),s.push(...new Array(t.padding[2]||0).fill(""))),s.forEach(((t,n)=>{e[n]||e.push([]);const s=e[n];for(let t=0;t<i;t++)void 0===s[t]&&s.push("");s.push(t)}))})),e}negatePadding(t){let e=t.width||0;return t.padding&&(e-=(t.padding[3]||0)+(t.padding[1]||0)),t.border&&(e-=4),e}columnWidths(t){if(!this.wrap)return t.map((t=>t.width||l.stringWidth(t.text)));let e=t.length,n=this.width;const s=t.map((t=>{if(t.width)return e--,n-=t.width,t.width})),i=e?Math.floor(n/e):0;return s.map(((e,n)=>void 0===e?Math.max(i,function(t){const e=t.padding||[],n=1+(e[3]||0)+(e[1]||0);if(t.border)return n+4;return n}(t[n])):e))}}function c(t,e,n){return t.border?/[.']-+[.']/.test(e)?"":0!==e.trim().length?n:" ":""}let l;const h=new RegExp("\x1b(?:\\[(?:\\d+[ABCDEFGJKSTm]|\\d+;\\d+[Hfm]|\\d+;\\d+;\\d+m|6n|s|u|\\?25[lh])|\\w)","g");function u(t){return t.replace(h,"")}function d(t,e){const[n,s]=t.match(h)||["",""];t=u(t);let i="";for(let n=0;n<t.length;n++)0!==n&&n%e==0&&(i+="\n"),i+=t.charAt(n);return n&&s&&(i=`${n}${i}${s}`),i}var f=a(71017);var p=a(73837);const m=t(import.meta.url)("url");function g(t){if(t!==t.toLowerCase()&&t!==t.toUpperCase()||(t=t.toLowerCase()),-1===t.indexOf("-")&&-1===t.indexOf("_"))return t;{let e="",n=!1;const s=t.match(/^-+/);for(let i=s?s[0].length:0;i<t.length;i++){let s=t.charAt(i);n&&(n=!1,s=s.toUpperCase()),0===i||"-"!==s&&"_"!==s?"-"!==s&&"_"!==s&&(e+=s):n=!0}return e}}function y(t,e){const n=t.toLowerCase();e=e||"-";let s="";for(let i=0;i<t.length;i++){const r=n.charAt(i),o=t.charAt(i);s+=r!==o&&i>0?`${e}${n.charAt(i)}`:o}return s}function b(t){return null!=t&&("number"==typeof t||(!!/^0x[0-9a-f]+$/i.test(t)||!/^0[^.]/.test(t)&&/^[-]?(?:\d+(?:\.\d*)?|\.\d+)(e[-+]?\d+)?$/.test(t)))}var v;let w;!function(t){t.BOOLEAN="boolean",t.STRING="string",t.NUMBER="number",t.ARRAY="array"}(v||(v={}));function x(t){return void 0!==t?t+1:1}function O(t){return"__proto__"===t?"___proto___":t}const E=process&&process.env&&process.env.YARGS_MIN_NODE_VERSION?Number(process.env.YARGS_MIN_NODE_VERSION):12;if(process&&process.version){if(Number(process.version.match(/v([^.]+)/)[1])<E)throw Error(`yargs parser supports a minimum Node.js version of ${E}. Read our version support policy: https://github.com/yargs/yargs-parser#supported-nodejs-versions`)}const S=process?process.env:{},j=new class{constructor(t){w=t}parse(t,e){const n=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},e),s=function(t){if(Array.isArray(t))return t.map((t=>"string"!=typeof t?t+"":t));t=t.trim();let e=0,n=null,s=null,i=null;const r=[];for(let o=0;o<t.length;o++)n=s,s=t.charAt(o)," "!==s||i?(s===i?i=null:"'"!==s&&'"'!==s||i||(i=s),r[e]||(r[e]=""),r[e]+=s):" "!==n&&e++;return r}(t),i="string"==typeof t,r=function(t){const e=[],n=Object.create(null);let s=!0;Object.keys(t).forEach((function(n){e.push([].concat(t[n],n))}));for(;s;){s=!1;for(let t=0;t<e.length;t++)for(let n=t+1;n<e.length;n++){if(e[t].filter((function(t){return-1!==e[n].indexOf(t)})).length){e[t]=e[t].concat(e[n]),e.splice(n,1),s=!0;break}}}return e.forEach((function(t){const e=(t=t.filter((function(t,e,n){return n.indexOf(t)===e}))).pop();void 0!==e&&"string"==typeof e&&(n[e]=t)})),n}(Object.assign(Object.create(null),n.alias)),o=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},n.configuration),a=Object.assign(Object.create(null),n.default),c=n.configObjects||[],l=n.envPrefix,h=o["populate--"],u=h?"--":"_",d=Object.create(null),f=Object.create(null),p=n.__||w.format,m={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:[]},E=/^-([0-9]+(\.[0-9]+)?|\.[0-9]+)$/,S=new RegExp("^--"+o["negation-prefix"]+"(.+)");[].concat(n.array||[]).filter(Boolean).forEach((function(t){const e="object"==typeof t?t.key:t,n=Object.keys(t).map((function(t){return{boolean:"bools",string:"strings",number:"numbers"}[t]})).filter(Boolean).pop();n&&(m[n][e]=!0),m.arrays[e]=!0,m.keys.push(e)})),[].concat(n.boolean||[]).filter(Boolean).forEach((function(t){m.bools[t]=!0,m.keys.push(t)})),[].concat(n.string||[]).filter(Boolean).forEach((function(t){m.strings[t]=!0,m.keys.push(t)})),[].concat(n.number||[]).filter(Boolean).forEach((function(t){m.numbers[t]=!0,m.keys.push(t)})),[].concat(n.count||[]).filter(Boolean).forEach((function(t){m.counts[t]=!0,m.keys.push(t)})),[].concat(n.normalize||[]).filter(Boolean).forEach((function(t){m.normalize[t]=!0,m.keys.push(t)})),"object"==typeof n.narg&&Object.entries(n.narg).forEach((([t,e])=>{"number"==typeof e&&(m.nargs[t]=e,m.keys.push(t))})),"object"==typeof n.coerce&&Object.entries(n.coerce).forEach((([t,e])=>{"function"==typeof e&&(m.coercions[t]=e,m.keys.push(t))})),void 0!==n.config&&(Array.isArray(n.config)||"string"==typeof n.config?[].concat(n.config).filter(Boolean).forEach((function(t){m.configs[t]=!0})):"object"==typeof n.config&&Object.entries(n.config).forEach((([t,e])=>{"boolean"!=typeof e&&"function"!=typeof e||(m.configs[t]=e)}))),function(...t){t.forEach((function(t){Object.keys(t||{}).forEach((function(t){m.aliases[t]||(m.aliases[t]=[].concat(r[t]||[]),m.aliases[t].concat(t).forEach((function(e){if(/-/.test(e)&&o["camel-case-expansion"]){const n=g(e);n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].concat(t).forEach((function(e){if(e.length>1&&/[A-Z]/.test(e)&&o["camel-case-expansion"]){const n=y(e,"-");n!==t&&-1===m.aliases[t].indexOf(n)&&(m.aliases[t].push(n),d[n]=!0)}})),m.aliases[t].forEach((function(e){m.aliases[e]=[t].concat(m.aliases[t].filter((function(t){return e!==t})))})))}))}))}(n.key,r,n.default,m.arrays),Object.keys(a).forEach((function(t){(m.aliases[t]||[]).forEach((function(e){a[e]=a[t]}))}));let j=null;Object.keys(m.counts).find((t=>W(t,m.arrays)?(j=Error(p("Invalid configuration: %s, opts.count excludes opts.array.",t)),!0):!!W(t,m.nargs)&&(j=Error(p("Invalid configuration: %s, opts.count excludes opts.narg.",t)),!0)));let C=[];const _=Object.assign(Object.create(null),{_:[]}),A={};for(let t=0;t<s.length;t++){const e=s[t],n=e.replace(/^-{3,}/,"---");let i,r,a,c,l,h;if("--"!==e&&B(e))k(e);else{if(n.match(/---+(=|$)/)){k(e);continue}if(e.match(/^--.+=/)||!o["short-option-groups"]&&e.match(/^-.+=/))c=e.match(/^--?([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&(W(c[1],m.arrays)?t=I(t,c[1],s,c[2]):!1!==W(c[1],m.nargs)?t=P(t,c[1],s,c[2]):$(c[1],c[2],!0));else if(e.match(S)&&o["boolean-negation"])c=e.match(S),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],$(r,!!W(r,m.arrays)&&[!1]));else if(e.match(/^--.+/)||!o["short-option-groups"]&&e.match(/^-[^-]+/))c=e.match(/^--?(.+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],W(r,m.arrays)?t=I(t,r,s):!1!==W(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||l.match(/^-/)&&!l.match(E)||W(r,m.bools)||W(r,m.counts)?/^(true|false)$/.test(l)?($(r,l),t++):$(r,z(r)):($(r,l),t++)));else if(e.match(/^-.\..+=/))c=e.match(/^-([^=]+)=([\s\S]*)$/),null!==c&&Array.isArray(c)&&c.length>=3&&$(c[1],c[2]);else if(e.match(/^-.\..+/)&&!e.match(E))l=s[t+1],c=e.match(/^-(.\..+)/),null!==c&&Array.isArray(c)&&c.length>=2&&(r=c[1],void 0===l||l.match(/^-/)||W(r,m.bools)||W(r,m.counts)?$(r,z(r)):($(r,l),t++));else if(e.match(/^-[^-]+/)&&!e.match(E)){a=e.slice(1,-1).split(""),i=!1;for(let n=0;n<a.length;n++){if(l=e.slice(n+2),a[n+1]&&"="===a[n+1]){h=e.slice(n+3),r=a[n],W(r,m.arrays)?t=I(t,r,s,h):!1!==W(r,m.nargs)?t=P(t,r,s,h):$(r,h),i=!0;break}if("-"!==l){if(/[A-Za-z]/.test(a[n])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(l)&&!1===W(l,m.bools)){$(a[n],l),i=!0;break}if(a[n+1]&&a[n+1].match(/\W/)){$(a[n],l),i=!0;break}$(a[n],z(a[n]))}else $(a[n],l)}r=e.slice(-1)[0],i||"-"===r||(W(r,m.arrays)?t=I(t,r,s):!1!==W(r,m.nargs)?t=P(t,r,s):(l=s[t+1],void 0===l||/^(-|--)[^-]/.test(l)&&!l.match(E)||W(r,m.bools)||W(r,m.counts)?/^(true|false)$/.test(l)?($(r,l),t++):$(r,z(r)):($(r,l),t++)))}else if(e.match(/^-[0-9]$/)&&e.match(E)&&W(e.slice(1),m.bools))r=e.slice(1),$(r,z(r));else{if("--"===e){C=s.slice(t+1);break}if(o["halt-at-non-option"]){C=s.slice(t);break}k(e)}}}function k(t){const e=N("_",t);"string"!=typeof e&&"number"!=typeof e||_._.push(e)}function P(t,e,n,s){let i,r=W(e,m.nargs);if(r="number"!=typeof r||isNaN(r)?1:r,0===r)return H(s)||(j=Error(p("Argument unexpected for: %s",e))),$(e,z(e)),t;let a=H(s)?0:1;if(o["nargs-eats-options"])n.length-(t+1)+a<r&&(j=Error(p("Not enough arguments following: %s",e))),a=r;else{for(i=t+1;i<n.length&&(!n[i].match(/^-[^0-9]/)||n[i].match(E)||B(n[i]));i++)a++;a<r&&(j=Error(p("Not enough arguments following: %s",e)))}let c=Math.min(a,r);for(!H(s)&&c>0&&($(e,s),c--),i=t+1;i<c+t+1;i++)$(e,n[i]);return t+c}function I(t,e,n,s){let r=[],c=s||n[t+1];const l=W(e,m.nargs);if(W(e,m.bools)&&!/^(true|false)$/.test(c))r.push(!0);else if(H(c)||H(s)&&/^-/.test(c)&&!E.test(c)&&!B(c)){if(void 0!==a[e]){const t=a[e];r=Array.isArray(t)?t:[t]}}else{H(s)||r.push(T(e,s,!0));for(let s=t+1;s<n.length&&!(!o["greedy-arrays"]&&r.length>0||l&&"number"==typeof l&&r.length>=l)&&(c=n[s],!/^-/.test(c)||E.test(c)||B(c));s++)t=s,r.push(T(e,c,i))}return"number"==typeof l&&(l&&r.length<l||isNaN(l)&&0===r.length)&&(j=Error(p("Not enough arguments following: %s",e))),$(e,r),t}function $(t,e,n=i){if(/-/.test(t)&&o["camel-case-expansion"]){const e=t.split(".").map((function(t){return g(t)})).join(".");M(t,e)}const s=T(t,e,n),r=t.split(".");if(R(_,r,s),m.aliases[t]&&m.aliases[t].forEach((function(t){const e=t.split(".");R(_,e,s)})),r.length>1&&o["dot-notation"]&&(m.aliases[r[0]]||[]).forEach((function(e){let n=e.split(".");const i=[].concat(r);i.shift(),n=n.concat(i),(m.aliases[t]||[]).includes(n.join("."))||R(_,n,s)})),W(t,m.normalize)&&!W(t,m.arrays)){[t].concat(m.aliases[t]||[]).forEach((function(t){Object.defineProperty(A,t,{enumerable:!0,get:()=>e,set(t){e="string"==typeof t?w.normalize(t):t}})}))}}function M(t,e){m.aliases[t]&&m.aliases[t].length||(m.aliases[t]=[e],d[e]=!0),m.aliases[e]&&m.aliases[e].length||M(e,t)}function T(t,e,n){n&&(e=function(t){return"string"!=typeof t||"'"!==t[0]&&'"'!==t[0]||t[t.length-1]!==t[0]?t:t.substring(1,t.length-1)}(e)),(W(t,m.bools)||W(t,m.counts))&&"string"==typeof e&&(e="true"===e);let s=Array.isArray(e)?e.map((function(e){return N(t,e)})):N(t,e);return W(t,m.counts)&&(H(s)||"boolean"==typeof s)&&(s=x()),W(t,m.normalize)&&W(t,m.arrays)&&(s=Array.isArray(e)?e.map((t=>w.normalize(t))):w.normalize(e)),s}function N(t,e){if(!o["parse-positional-numbers"]&&"_"===t)return e;if(!W(t,m.strings)&&!W(t,m.bools)&&!Array.isArray(e)){(b(e)&&o["parse-numbers"]&&Number.isSafeInteger(Math.floor(parseFloat(`${e}`)))||!H(e)&&W(t,m.numbers))&&(e=Number(e))}return e}function L(t,e){Object.keys(t).forEach((function(n){const s=t[n],i=e?e+"."+n:n;"object"==typeof s&&null!==s&&!Array.isArray(s)&&o["dot-notation"]?L(s,i):(!D(_,i.split("."))||W(i,m.arrays)&&o["combine-arrays"])&&$(i,s)}))}function G(t,e){if(void 0===l)return;const n="string"==typeof l?l:"",s=w.env();Object.keys(s).forEach((function(i){if(""===n||0===i.lastIndexOf(n,0)){const r=i.split("__").map((function(t,e){return 0===e&&(t=t.substring(n.length)),g(t)}));(e&&m.configs[r.join(".")]||!e)&&!D(t,r)&&$(r.join("."),s[i])}}))}function F(t,e,n,s=!1){Object.keys(n).forEach((function(i){D(t,i.split("."))||(R(t,i.split("."),n[i]),s&&(f[i]=!0),(e[i]||[]).forEach((function(e){D(t,e.split("."))||R(t,e.split("."),n[i])})))}))}function D(t,e){let n=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){n=n[t]||{}}));const s=e[e.length-1];return"object"==typeof n&&s in n}function R(t,e,n){let s=t;o["dot-notation"]||(e=[e.join(".")]),e.slice(0,-1).forEach((function(t){t=O(t),"object"==typeof s&&void 0===s[t]&&(s[t]={}),"object"!=typeof s[t]||Array.isArray(s[t])?(Array.isArray(s[t])?s[t].push({}):s[t]=[s[t],{}],s=s[t][s[t].length-1]):s=s[t]}));const i=O(e[e.length-1]),r=W(e.join("."),m.arrays),a=Array.isArray(n);let c=o["duplicate-arguments-array"];!c&&W(i,m.nargs)&&(c=!0,(!H(s[i])&&1===m.nargs[i]||Array.isArray(s[i])&&s[i].length===m.nargs[i])&&(s[i]=void 0)),n===x()?s[i]=x(s[i]):Array.isArray(s[i])?c&&r&&a?s[i]=o["flatten-duplicate-arrays"]?s[i].concat(n):(Array.isArray(s[i][0])?s[i]:[s[i]]).concat([n]):c||Boolean(r)!==Boolean(a)?s[i]=s[i].concat([n]):s[i]=n:void 0===s[i]&&r?s[i]=a?n:[n]:!c||void 0===s[i]||W(i,m.counts)||W(i,m.bools)?s[i]=n:s[i]=[s[i],n]}function W(t,e){const n=[].concat(m.aliases[t]||[],t),s=Object.keys(e),i=n.find((t=>s.includes(t)));return!!i&&e[i]}function U(t){const e=Object.keys(m);return[].concat(e.map((t=>m[t]))).some((function(e){return Array.isArray(e)?e.includes(t):e[t]}))}function B(t){return o["unknown-options-as-args"]&&function(t){if((t=t.replace(/^-{3,}/,"--")).match(E))return!1;if(function(t){if(t.match(E)||!t.match(/^-[^-]+/))return!1;let e,n=!0;const s=t.slice(1).split("");for(let i=0;i<s.length;i++){if(e=t.slice(i+2),!U(s[i])){n=!1;break}if(s[i+1]&&"="===s[i+1]||"-"===e||/[A-Za-z]/.test(s[i])&&/^-?\d+(\.\d*)?(e-?\d+)?$/.test(e)||s[i+1]&&s[i+1].match(/\W/))break}return n}(t))return!1;return!function(t,...e){return[].concat(...e).some((function(e){const n=t.match(e);return n&&U(n[1])}))}(t,/^-+([^=]+?)=[\s\S]*$/,S,/^-+([^=]+?)$/,/^-+([^=]+?)-$/,/^-+([^=]+?\d+)$/,/^-+([^=]+?)\W+.*$/)}(t)}function z(t){return W(t,m.bools)||W(t,m.counts)||!(`${t}`in a)?(e=function(t){let e=v.BOOLEAN;return W(t,m.strings)?e=v.STRING:W(t,m.numbers)?e=v.NUMBER:W(t,m.bools)?e=v.BOOLEAN:W(t,m.arrays)&&(e=v.ARRAY),e}(t),{[v.BOOLEAN]:!0,[v.STRING]:"",[v.NUMBER]:void 0,[v.ARRAY]:[]}[e]):a[t];var e}function H(t){return void 0===t}return G(_,!0),G(_,!1),function(t){const e=Object.create(null);F(e,m.aliases,a),Object.keys(m.configs).forEach((function(n){const s=t[n]||e[n];if(s)try{let t=null;const e=w.resolve(w.cwd(),s),i=m.configs[n];if("function"==typeof i){try{t=i(e)}catch(e){t=e}if(t instanceof Error)return void(j=t)}else t=w.require(e);L(t)}catch(e){"PermissionDenied"===e.name?j=e:t[n]&&(j=Error(p("Invalid JSON config file: %s",s)))}}))}(_),void 0!==c&&c.forEach((function(t){L(t)})),F(_,m.aliases,a,!0),function(t){let e;const n=new Set;Object.keys(t).forEach((function(s){if(!n.has(s)&&(e=W(s,m.coercions),"function"==typeof e))try{const i=N(s,e(t[s]));[].concat(m.aliases[s]||[],s).forEach((e=>{n.add(e),t[e]=i}))}catch(t){j=t}}))}(_),o["set-placeholder-key"]&&function(t){m.keys.forEach((e=>{~e.indexOf(".")||void 0===t[e]&&(t[e]=void 0)}))}(_),Object.keys(m.counts).forEach((function(t){D(_,t.split("."))||$(t,0)})),h&&C.length&&(_[u]=[]),C.forEach((function(t){_[u].push(t)})),o["camel-case-expansion"]&&o["strip-dashed"]&&Object.keys(_).filter((t=>"--"!==t&&t.includes("-"))).forEach((t=>{delete _[t]})),o["strip-aliased"]&&[].concat(...Object.keys(r).map((t=>r[t]))).forEach((t=>{o["camel-case-expansion"]&&t.includes("-")&&delete _[t.split(".").map((t=>g(t))).join(".")],delete _[t]})),{aliases:Object.assign({},m.aliases),argv:Object.assign(A,_),configuration:o,defaulted:Object.assign({},f),error:j,newAliases:Object.assign({},d)}}}({cwd:process.cwd,env:()=>S,format:p.format,normalize:f.normalize,resolve:f.resolve,require:t=>{if("undefined"!=typeof require)return require(t);if(t.match(/\.json$/))return JSON.parse((0,s.readFileSync)(t,"utf8"));throw Error("only .json config files are supported in ESM")}}),C=function(t,e){return j.parse(t.slice(),e).argv};C.detailed=function(t,e){return j.parse(t.slice(),e)},C.camelCase=g,C.decamelize=y,C.looksLikeNumber=b;const _=C;function A(){return process.versions.electron&&!process.defaultApp?0:1}class k extends Error{constructor(t){super(t||"yargs error"),this.name="YError",Error.captureStackTrace&&Error.captureStackTrace(this,k)}}const P={fs:{readFileSync:s.readFileSync,writeFile:s.writeFile},format:p.format,resolve:f.resolve,exists:t=>{try{return(0,s.statSync)(t).isFile()}catch(t){return!1}}};let I;class ${constructor(t){t=t||{},this.directory=t.directory||"./locales",this.updateFiles="boolean"!=typeof t.updateFiles||t.updateFiles,this.locale=t.locale||"en",this.fallbackToLanguage="boolean"!=typeof t.fallbackToLanguage||t.fallbackToLanguage,this.cache=Object.create(null),this.writeQueue=[]}__(...t){if("string"!=typeof arguments[0])return this._taggedLiteral(arguments[0],...arguments);const e=t.shift();let n=function(){};return"function"==typeof t[t.length-1]&&(n=t.pop()),n=n||function(){},this.cache[this.locale]||this._readLocaleFile(),!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]=e,this._enqueueWrite({directory:this.directory,locale:this.locale,cb:n})):n(),I.format.apply(I.format,[this.cache[this.locale][e]||e].concat(t))}__n(){const t=Array.prototype.slice.call(arguments),e=t.shift(),n=t.shift(),s=t.shift();let i=function(){};"function"==typeof t[t.length-1]&&(i=t.pop()),this.cache[this.locale]||this._readLocaleFile();let r=1===s?e:n;if(this.cache[this.locale][e]){r=this.cache[this.locale][e][1===s?"one":"other"]}!this.cache[this.locale][e]&&this.updateFiles?(this.cache[this.locale][e]={one:e,other:n},this._enqueueWrite({directory:this.directory,locale:this.locale,cb:i})):i();const o=[r];return~r.indexOf("%d")&&o.push(s),I.format.apply(I.format,o.concat(t))}setLocale(t){this.locale=t}getLocale(){return this.locale}updateLocale(t){this.cache[this.locale]||this._readLocaleFile();for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(this.cache[this.locale][e]=t[e])}_taggedLiteral(t,...e){let n="";return t.forEach((function(t,s){const i=e[s+1];n+=t,void 0!==i&&(n+="%s")})),this.__.apply(this,[n].concat([].slice.call(e,1)))}_enqueueWrite(t){this.writeQueue.push(t),1===this.writeQueue.length&&this._processWriteQueue()}_processWriteQueue(){const t=this,e=this.writeQueue[0],n=e.directory,s=e.locale,i=e.cb,r=this._resolveLocaleFile(n,s),o=JSON.stringify(this.cache[s],null,2);I.fs.writeFile(r,o,"utf-8",(function(e){t.writeQueue.shift(),t.writeQueue.length>0&&t._processWriteQueue(),i(e)}))}_readLocaleFile(){let t={};const e=this._resolveLocaleFile(this.directory,this.locale);try{I.fs.readFileSync&&(t=JSON.parse(I.fs.readFileSync(e,"utf-8")))}catch(n){if(n instanceof SyntaxError&&(n.message="syntax error in "+e),"ENOENT"!==n.code)throw n;t={}}this.cache[this.locale]=t}_resolveLocaleFile(t,e){let n=I.resolve(t,"./",e+".json");if(this.fallbackToLanguage&&!this._fileExistsSync(n)&&~e.lastIndexOf("_")){const s=I.resolve(t,"./",e.split("_")[0]+".json");this._fileExistsSync(s)&&(n=s)}return n}_fileExistsSync(t){return I.exists(t)}}const M=t=>function(t,e){I=e;const n=new $(t);return{__:n.__.bind(n),__n:n.__n.bind(n),setLocale:n.setLocale.bind(n),getLocale:n.getLocale.bind(n),updateLocale:n.updateLocale.bind(n),locale:n.locale}}(t,P),T="loading a directory of commands is not supported yet for ESM";let N;try{N=(0,m.fileURLToPath)(import.meta.url)}catch(t){N=process.cwd()}const L=N.substring(0,N.lastIndexOf("node_modules")),G={assert:{notStrictEqual:i.notStrictEqual,strictEqual:i.strictEqual},cliui:function(t){return function(t,e){return l=e,new o({width:(null==t?void 0:t.width)||("object"==typeof process&&process.stdout&&process.stdout.columns?process.stdout.columns:80),wrap:null==t?void 0:t.wrap})}(t,{stringWidth:t=>[...t].length,stripAnsi:u,wrap:d})},findUp:function(t,e){let n,i=(0,f.resolve)(".",t);for((0,s.statSync)(i).isDirectory()||(i=(0,f.dirname)(i));;){if(n=e(i,(0,s.readdirSync)(i)),n)return(0,f.resolve)(i,n);if(i=(0,f.dirname)(n=i),n===i)break}},getEnv:t=>process.env[t],inspect:p.inspect,getCallerFile:()=>{throw new k(T)},getProcessArgvBin:function(){return process.argv[A()]},mainFilename:L||process.cwd(),Parser:_,path:{basename:f.basename,dirname:f.dirname,extname:f.extname,relative:f.relative,resolve:f.resolve},process:{argv:()=>process.argv,cwd:process.cwd,emitWarning:(t,e)=>process.emitWarning(t,e),execPath:()=>process.execPath,exit:process.exit,nextTick:process.nextTick,stdColumns:void 0!==process.stdout.columns?process.stdout.columns:null},readFileSync:s.readFileSync,require:()=>{throw new k("require is not supported by ESM")},requireDirectory:()=>{throw new k(T)},stringWidth:t=>[...t].length,y18n:M({directory:(0,f.resolve)(N,"../../../locales"),updateFiles:!1})};function F(t,e,n,s){n.assert.notStrictEqual(t,e,s)}function D(t,e){e.assert.strictEqual(typeof t,"string")}function R(t){return Object.keys(t)}function W(t){return!!t&&!!t.then&&"function"==typeof t.then}function U(t){const e=t.replace(/\s{2,}/g," ").split(/\s+(?![^[]*]|[^<]*>)/),n=/\.*[\][<>]/g,s=e.shift();if(!s)throw new Error(`No command found in: ${t}`);const i={cmd:s.replace(n,""),demanded:[],optional:[]};return e.forEach(((t,s)=>{let r=!1;t=t.replace(/\s/g,""),/\.+[\]>]/.test(t)&&s===e.length-1&&(r=!0),/^\[/.test(t)?i.optional.push({cmd:t.replace(n,"").split("|"),variadic:r}):i.demanded.push({cmd:t.replace(n,"").split("|"),variadic:r})})),i}const B=["first","second","third","fourth","fifth","sixth"];function z(t,e,n){try{let s=0;const[i,r,o]="object"==typeof t?[{demanded:[],optional:[]},t,e]:[U(`cmd ${t}`),e,n],a=[].slice.call(r);for(;a.length&&void 0===a[a.length-1];)a.pop();const c=o||a.length;if(c<i.demanded.length)throw new k(`Not enough arguments provided. Expected ${i.demanded.length} but received ${a.length}.`);const l=i.demanded.length+i.optional.length;if(c>l)throw new k(`Too many arguments provided. Expected max ${l} but received ${c}.`);i.demanded.forEach((t=>{const e=H(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&q(e,t.cmd,s),s+=1})),i.optional.forEach((t=>{if(0===a.length)return;const e=H(a.shift());0===t.cmd.filter((t=>t===e||"*"===t)).length&&q(e,t.cmd,s),s+=1}))}catch(t){console.warn(t.stack)}}function H(t){return Array.isArray(t)?"array":null===t?"null":typeof t}function q(t,e,n){throw new k(`Invalid ${B[n]||"manyith"} argument. Expected ${e.join(" or ")} but received ${t}.`)}class V{constructor(t){this.globalMiddleware=[],this.frozens=[],this.yargs=t}addMiddleware(t,e,n=!0,s=!1){if(z("<array|function> [boolean] [boolean] [boolean]",[t,e,n],arguments.length),Array.isArray(t)){for(let s=0;s<t.length;s++){if("function"!=typeof t[s])throw Error("middleware must be a function");const i=t[s];i.applyBeforeValidation=e,i.global=n}Array.prototype.push.apply(this.globalMiddleware,t)}else if("function"==typeof t){const i=t;i.applyBeforeValidation=e,i.global=n,i.mutates=s,this.globalMiddleware.push(t)}return this.yargs}addCoerceMiddleware(t,e){const n=this.yargs.getAliases();return this.globalMiddleware=this.globalMiddleware.filter((t=>{const s=[...n[e]||[],e];return!t.option||!s.includes(t.option)})),t.option=e,this.addMiddleware(t,!0,!0,!0)}getMiddleware(){return this.globalMiddleware}freeze(){this.frozens.push([...this.globalMiddleware])}unfreeze(){const t=this.frozens.pop();void 0!==t&&(this.globalMiddleware=t)}reset(){this.globalMiddleware=this.globalMiddleware.filter((t=>t.global))}}function K(t,e,n,s){return n.reduce(((t,n)=>{if(n.applyBeforeValidation!==s)return t;if(n.mutates){if(n.applied)return t;n.applied=!0}if(W(t))return t.then((t=>Promise.all([t,n(t,e)]))).then((([t,e])=>Object.assign(t,e)));{const s=n(t,e);return W(s)?s.then((e=>Object.assign(t,e))):Object.assign(t,s)}}),t)}function Y(t,e,n=(t=>{throw t})){try{const n="function"==typeof t?t():t;return W(n)?n.then((t=>e(t))):e(n)}catch(t){return n(t)}}const X=/(^\*)|(^\$0)/;class J{constructor(t,e,n,s){this.requireCache=new Set,this.handlers={},this.aliasMap={},this.frozens=[],this.shim=s,this.usage=t,this.globalMiddleware=n,this.validation=e}addDirectory(t,e,n,s){"boolean"!=typeof(s=s||{}).recurse&&(s.recurse=!1),Array.isArray(s.extensions)||(s.extensions=["js"]);const i="function"==typeof s.visit?s.visit:t=>t;s.visit=(t,e,n)=>{const s=i(t,e,n);if(s){if(this.requireCache.has(e))return s;this.requireCache.add(e),this.addHandler(s)}return s},this.shim.requireDirectory({require:e,filename:n},t,s)}addHandler(t,e,n,s,i,r){let o=[];const a=function(t){return t?t.map((t=>(t.applyBeforeValidation=!1,t))):[]}(i);if(s=s||(()=>{}),Array.isArray(t))if(function(t){return t.every((t=>"string"==typeof t))}(t))[t,...o]=t;else for(const e of t)this.addHandler(e);else{if(function(t){return"object"==typeof t&&!Array.isArray(t)}(t)){let e=Array.isArray(t.command)||"string"==typeof t.command?t.command:this.moduleName(t);return t.aliases&&(e=[].concat(e).concat(t.aliases)),void this.addHandler(e,this.extractDesc(t),t.builder,t.handler,t.middlewares,t.deprecated)}if(Q(n))return void this.addHandler([t].concat(o),e,n.builder,n.handler,n.middlewares,n.deprecated)}if("string"==typeof t){const i=U(t);o=o.map((t=>U(t).cmd));let c=!1;const l=[i.cmd].concat(o).filter((t=>!X.test(t)||(c=!0,!1)));0===l.length&&c&&l.push("$0"),c&&(i.cmd=l[0],o=l.slice(1),t=t.replace(X,i.cmd)),o.forEach((t=>{this.aliasMap[t]=i.cmd})),!1!==e&&this.usage.command(t,e,c,o,r),this.handlers[i.cmd]={original:t,description:e,handler:s,builder:n||{},middlewares:a,deprecated:r,demanded:i.demanded,optional:i.optional},c&&(this.defaultCommand=this.handlers[i.cmd])}}getCommandHandlers(){return this.handlers}getCommands(){return Object.keys(this.handlers).concat(Object.keys(this.aliasMap))}hasDefaultCommand(){return!!this.defaultCommand}runCommand(t,e,n,s,i,r){const o=this.handlers[t]||this.handlers[this.aliasMap[t]]||this.defaultCommand,a=e.getInternalMethods().getContext(),c=a.commands.slice(),l=!t;t&&(a.commands.push(t),a.fullCommands.push(o.original));const h=this.applyBuilderUpdateUsageAndParse(l,o,e,n.aliases,c,s,i,r);return W(h)?h.then((t=>this.applyMiddlewareAndGetResult(l,o,t.innerArgv,a,i,t.aliases,e))):this.applyMiddlewareAndGetResult(l,o,h.innerArgv,a,i,h.aliases,e)}applyBuilderUpdateUsageAndParse(t,e,n,s,i,r,o,a){const c=e.builder;let l=n;if(Z(c)){const h=c(n.getInternalMethods().reset(s),a);if(W(h))return h.then((s=>{var a;return l=(a=s)&&"function"==typeof a.getInternalMethods?s:n,this.parseAndUpdateUsage(t,e,l,i,r,o)}))}else(function(t){return"object"==typeof t})(c)&&(l=n.getInternalMethods().reset(s),Object.keys(e.builder).forEach((t=>{l.option(t,c[t])})));return this.parseAndUpdateUsage(t,e,l,i,r,o)}parseAndUpdateUsage(t,e,n,s,i,r){t&&n.getInternalMethods().getUsageInstance().unfreeze(!0),this.shouldUpdateUsage(n)&&n.getInternalMethods().getUsageInstance().usage(this.usageFromParentCommandsCommandHandler(s,e),e.description);const o=n.getInternalMethods().runYargsParserAndExecuteCommands(null,void 0,!0,i,r);return W(o)?o.then((t=>({aliases:n.parsed.aliases,innerArgv:t}))):{aliases:n.parsed.aliases,innerArgv:o}}shouldUpdateUsage(t){return!t.getInternalMethods().getUsageInstance().getUsageDisabled()&&0===t.getInternalMethods().getUsageInstance().getUsage().length}usageFromParentCommandsCommandHandler(t,e){const n=X.test(e.original)?e.original.replace(X,"").trim():e.original,s=t.filter((t=>!X.test(t)));return s.push(n),`$0 ${s.join(" ")}`}handleValidationAndGetResult(t,e,n,s,i,r,o,a){if(!r.getInternalMethods().getHasOutput()){const e=r.getInternalMethods().runValidation(i,a,r.parsed.error,t);n=Y(n,(t=>(e(t),t)))}if(e.handler&&!r.getInternalMethods().getHasOutput()){r.getInternalMethods().setHasOutput();const s=!!r.getOptions().configuration["populate--"];r.getInternalMethods().postProcess(n,s,!1,!1),n=Y(n=K(n,r,o,!1),(t=>{const n=e.handler(t);return W(n)?n.then((()=>t)):t})),t||r.getInternalMethods().getUsageInstance().cacheHelpMessage(),W(n)&&!r.getInternalMethods().hasParseCallback()&&n.catch((t=>{try{r.getInternalMethods().getUsageInstance().fail(null,t)}catch(t){}}))}return t||(s.commands.pop(),s.fullCommands.pop()),n}applyMiddlewareAndGetResult(t,e,n,s,i,r,o){let a={};if(i)return n;o.getInternalMethods().getHasOutput()||(a=this.populatePositionals(e,n,s,o));const c=this.globalMiddleware.getMiddleware().slice(0).concat(e.middlewares),l=K(n,o,c,!0);return W(l)?l.then((n=>this.handleValidationAndGetResult(t,e,n,s,r,o,c,a))):this.handleValidationAndGetResult(t,e,l,s,r,o,c,a)}populatePositionals(t,e,n,s){e._=e._.slice(n.commands.length);const i=t.demanded.slice(0),r=t.optional.slice(0),o={};for(this.validation.positionalCount(i.length,e._.length);i.length;){const t=i.shift();this.populatePositional(t,e,o)}for(;r.length;){const t=r.shift();this.populatePositional(t,e,o)}return e._=n.commands.concat(e._.map((t=>""+t))),this.postProcessPositionals(e,o,this.cmdToParseOptions(t.original),s),o}populatePositional(t,e,n){const s=t.cmd[0];t.variadic?n[s]=e._.splice(0).map(String):e._.length&&(n[s]=[String(e._.shift())])}cmdToParseOptions(t){const e={array:[],default:{},alias:{},demand:{}},n=U(t);return n.demanded.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s,e.demand[n]=!0})),n.optional.forEach((t=>{const[n,...s]=t.cmd;t.variadic&&(e.array.push(n),e.default[n]=[]),e.alias[n]=s})),e}postProcessPositionals(t,e,n,s){const i=Object.assign({},s.getOptions());i.default=Object.assign(n.default,i.default);for(const t of Object.keys(n.alias))i.alias[t]=(i.alias[t]||[]).concat(n.alias[t]);i.array=i.array.concat(n.array),i.config={};const r=[];if(Object.keys(e).forEach((t=>{e[t].map((e=>{i.configuration["unknown-options-as-args"]&&(i.key[t]=!0),r.push(`--${t}`),r.push(e)}))})),!r.length)return;const o=Object.assign({},i.configuration,{"populate--":!1}),a=this.shim.Parser.detailed(r,Object.assign({},i,{configuration:o}));if(a.error)s.getInternalMethods().getUsageInstance().fail(a.error.message,a.error);else{const n=Object.keys(e);Object.keys(e).forEach((t=>{n.push(...a.aliases[t])})),Object.keys(a.argv).forEach((i=>{n.includes(i)&&(e[i]||(e[i]=a.argv[i]),!this.isInConfigs(s,i)&&!this.isDefaulted(s,i)&&Object.prototype.hasOwnProperty.call(t,i)&&Object.prototype.hasOwnProperty.call(a.argv,i)&&(Array.isArray(t[i])||Array.isArray(a.argv[i]))?t[i]=[].concat(t[i],a.argv[i]):t[i]=a.argv[i])}))}}isDefaulted(t,e){const{default:n}=t.getOptions();return Object.prototype.hasOwnProperty.call(n,e)||Object.prototype.hasOwnProperty.call(n,this.shim.Parser.camelCase(e))}isInConfigs(t,e){const{configObjects:n}=t.getOptions();return n.some((t=>Object.prototype.hasOwnProperty.call(t,e)))||n.some((t=>Object.prototype.hasOwnProperty.call(t,this.shim.Parser.camelCase(e))))}runDefaultBuilderOn(t){if(!this.defaultCommand)return;if(this.shouldUpdateUsage(t)){const e=X.test(this.defaultCommand.original)?this.defaultCommand.original:this.defaultCommand.original.replace(/^[^[\]<>]*/,"$0 ");t.getInternalMethods().getUsageInstance().usage(e,this.defaultCommand.description)}const e=this.defaultCommand.builder;if(Z(e))return e(t,!0);Q(e)||Object.keys(e).forEach((n=>{t.option(n,e[n])}))}moduleName(t){const e=function(t){if("undefined"==typeof require)return null;for(let e,n=0,s=Object.keys(require.cache);n<s.length;n++)if(e=require.cache[s[n]],e.exports===t)return e;return null}(t);if(!e)throw new Error(`No command name given for module: ${this.shim.inspect(t)}`);return this.commandFromFilename(e.filename)}commandFromFilename(t){return this.shim.path.basename(t,this.shim.path.extname(t))}extractDesc({describe:t,description:e,desc:n}){for(const s of[t,e,n]){if("string"==typeof s||!1===s)return s;F(s,!0,this.shim)}return!1}freeze(){this.frozens.push({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand})}unfreeze(){const t=this.frozens.pop();F(t,void 0,this.shim),({handlers:this.handlers,aliasMap:this.aliasMap,defaultCommand:this.defaultCommand}=t)}reset(){return this.handlers={},this.aliasMap={},this.defaultCommand=void 0,this.requireCache=new Set,this}}function Q(t){return"object"==typeof t&&!!t.builder&&"function"==typeof t.handler}function Z(t){return"function"==typeof t}function tt(t={},e=(()=>!0)){const n={};return R(t).forEach((s=>{e(s,t[s])&&(n[s]=t[s])})),n}function et(t){"undefined"!=typeof process&&[process.stdout,process.stderr].forEach((e=>{const n=e;n._handle&&n.isTTY&&"function"==typeof n._handle.setBlocking&&n._handle.setBlocking(t)}))}function nt(t){return"boolean"==typeof t}function st(t,e){const n=e.y18n.__,s={},i=[];s.failFn=function(t){i.push(t)};let r=null,o=null,a=!0;s.showHelpOnFail=function(e=!0,n){const[i,c]="string"==typeof e?[!0,e]:[e,n];return t.getInternalMethods().isGlobalContext()&&(o=c),r=c,a=i,s};let c=!1;s.fail=function(e,n){const l=t.getInternalMethods().getLoggerInstance();if(!i.length){if(t.getExitProcess()&&et(!0),!c){c=!0,a&&(t.showHelp("error"),l.error()),(e||n)&&l.error(e||n);const s=r||o;s&&((e||n)&&l.error(""),l.error(s))}if(n=n||new k(e),t.getExitProcess())return t.exit(1);if(t.getInternalMethods().hasParseCallback())return t.exit(1,n);throw n}for(let t=i.length-1;t>=0;--t){const r=i[t];if(nt(r)){if(n)throw n;if(e)throw Error(e)}else r(e,n,s)}};let l=[],h=!1;s.usage=(t,e)=>null===t?(h=!0,l=[],s):(h=!1,l.push([t,e||""]),s),s.getUsage=()=>l,s.getUsageDisabled=()=>h,s.getPositionalGroupName=()=>n("Positionals:");let u=[];s.example=(t,e)=>{u.push([t,e||""])};let d=[];s.command=function(t,e,n,s,i=!1){n&&(d=d.map((t=>(t[2]=!1,t)))),d.push([t,e||"",n,s,i])},s.getCommands=()=>d;let f={};s.describe=function(t,e){Array.isArray(t)?t.forEach((t=>{s.describe(t,e)})):"object"==typeof t?Object.keys(t).forEach((e=>{s.describe(e,t[e])})):f[t]=e},s.getDescriptions=()=>f;let p=[];s.epilog=t=>{p.push(t)};let m,g=!1;function y(){return g||(m=function(){const t=80;return e.process.stdColumns?Math.min(t,e.process.stdColumns):t}(),g=!0),m}s.wrap=t=>{g=!0,m=t};const b="__yargsString__:";function v(t,n,s){let i=0;return Array.isArray(t)||(t=Object.values(t).map((t=>[t]))),t.forEach((t=>{i=Math.max(e.stringWidth(s?`${s} ${ot(t[0])}`:ot(t[0]))+rt(t[0]),i)})),n&&(i=Math.min(i,parseInt((.5*n).toString(),10))),i}let w;function x(e){return t.getOptions().hiddenOptions.indexOf(e)<0||t.parsed.argv[t.getOptions().showHiddenOpt]}function O(t,e){let s=`[${n("default:")} `;if(void 0===t&&!e)return null;if(e)s+=e;else switch(typeof t){case"string":s+=`"${t}"`;break;case"object":s+=JSON.stringify(t);break;default:s+=t}return`${s}]`}s.deferY18nLookup=t=>b+t,s.help=function(){if(w)return w;!function(){const e=t.getDemandedOptions(),n=t.getOptions();(Object.keys(n.alias)||[]).forEach((i=>{n.alias[i].forEach((r=>{f[r]&&s.describe(i,f[r]),r in e&&t.demandOption(i,e[r]),n.boolean.includes(r)&&t.boolean(i),n.count.includes(r)&&t.count(i),n.string.includes(r)&&t.string(i),n.normalize.includes(r)&&t.normalize(i),n.array.includes(r)&&t.array(i),n.number.includes(r)&&t.number(i)}))}))}();const i=t.customScriptName?t.$0:e.path.basename(t.$0),r=t.getDemandedOptions(),o=t.getDemandedCommands(),a=t.getDeprecatedOptions(),c=t.getGroups(),m=t.getOptions();let g=[];g=g.concat(Object.keys(f)),g=g.concat(Object.keys(r)),g=g.concat(Object.keys(o)),g=g.concat(Object.keys(m.default)),g=g.filter(x),g=Object.keys(g.reduce(((t,e)=>("_"!==e&&(t[e]=!0),t)),{}));const E=y(),S=e.cliui({width:E,wrap:!!E});if(!h)if(l.length)l.forEach((t=>{S.div({text:`${t[0].replace(/\$0/g,i)}`}),t[1]&&S.div({text:`${t[1]}`,padding:[1,0,0,0]})})),S.div();else if(d.length){let t=null;t=o._?`${i} <${n("command")}>\n`:`${i} [${n("command")}]\n`,S.div(`${t}`)}if(d.length>1||1===d.length&&!d[0][2]){S.div(n("Commands:"));const e=t.getInternalMethods().getContext(),s=e.commands.length?`${e.commands.join(" ")} `:"";!0===t.getInternalMethods().getParserConfiguration()["sort-commands"]&&(d=d.sort(((t,e)=>t[0].localeCompare(e[0]))));const r=i?`${i} `:"";d.forEach((t=>{const e=`${r}${s}${t[0].replace(/^\$0 ?/,"")}`;S.span({text:e,padding:[0,2,0,2],width:v(d,E,`${i}${s}`)+4},{text:t[1]});const o=[];t[2]&&o.push(`[${n("default")}]`),t[3]&&t[3].length&&o.push(`[${n("aliases:")} ${t[3].join(", ")}]`),t[4]&&("string"==typeof t[4]?o.push(`[${n("deprecated: %s",t[4])}]`):o.push(`[${n("deprecated")}]`)),o.length?S.div({text:o.join(" "),padding:[0,0,0,2],align:"right"}):S.div()})),S.div()}const j=(Object.keys(m.alias)||[]).concat(Object.keys(t.parsed.newAliases)||[]);g=g.filter((e=>!t.parsed.newAliases[e]&&j.every((t=>-1===(m.alias[t]||[]).indexOf(e)))));const C=n("Options:");c[C]||(c[C]=[]),function(t,e,n,s){let i=[],r=null;Object.keys(n).forEach((t=>{i=i.concat(n[t])})),t.forEach((t=>{r=[t].concat(e[t]),r.some((t=>-1!==i.indexOf(t)))||n[s].push(t)}))}(g,m.alias,c,C);const _=t=>/^--/.test(ot(t)),A=Object.keys(c).filter((t=>c[t].length>0)).map((t=>({groupName:t,normalizedKeys:c[t].filter(x).map((t=>{if(j.includes(t))return t;for(let e,n=0;void 0!==(e=j[n]);n++)if((m.alias[e]||[]).includes(t))return e;return t}))}))).filter((({normalizedKeys:t})=>t.length>0)).map((({groupName:t,normalizedKeys:e})=>{const n=e.reduce(((e,n)=>(e[n]=[n].concat(m.alias[n]||[]).map((e=>t===s.getPositionalGroupName()?e:(/^[0-9]$/.test(e)?m.boolean.includes(n)?"-":"--":e.length>1?"--":"-")+e)).sort(((t,e)=>_(t)===_(e)?0:_(t)?1:-1)).join(", "),e)),{});return{groupName:t,normalizedKeys:e,switches:n}}));if(A.filter((({groupName:t})=>t!==s.getPositionalGroupName())).some((({normalizedKeys:t,switches:e})=>!t.every((t=>_(e[t])))))&&A.filter((({groupName:t})=>t!==s.getPositionalGroupName())).forEach((({normalizedKeys:t,switches:e})=>{t.forEach((t=>{var n,s;_(e[t])&&(e[t]=(n=e[t],s="-x, ".length,it(n)?{text:n.text,indentation:n.indentation+s}:{text:n,indentation:s}))}))})),A.forEach((({groupName:t,normalizedKeys:e,switches:i})=>{S.div(t),e.forEach((t=>{const e=i[t];let o=f[t]||"",c=null;o.includes(b)&&(o=n(o.substring(b.length))),m.boolean.includes(t)&&(c=`[${n("boolean")}]`),m.count.includes(t)&&(c=`[${n("count")}]`),m.string.includes(t)&&(c=`[${n("string")}]`),m.normalize.includes(t)&&(c=`[${n("string")}]`),m.array.includes(t)&&(c=`[${n("array")}]`),m.number.includes(t)&&(c=`[${n("number")}]`);const l=[t in a?(h=a[t],"string"==typeof h?`[${n("deprecated: %s",h)}]`:`[${n("deprecated")}]`):null,c,t in r?`[${n("required")}]`:null,m.choices&&m.choices[t]?`[${n("choices:")} ${s.stringifiedValues(m.choices[t])}]`:null,O(m.default[t],m.defaultDescription[t])].filter(Boolean).join(" ");var h;S.span({text:ot(e),padding:[0,2,0,2+rt(e)],width:v(i,E)+4},o),l?S.div({text:l,padding:[0,0,0,2],align:"right"}):S.div()})),S.div()})),u.length&&(S.div(n("Examples:")),u.forEach((t=>{t[0]=t[0].replace(/\$0/g,i)})),u.forEach((t=>{""===t[1]?S.div({text:t[0],padding:[0,2,0,2]}):S.div({text:t[0],padding:[0,2,0,2],width:v(u,E)+4},{text:t[1]})})),S.div()),p.length>0){const t=p.map((t=>t.replace(/\$0/g,i))).join("\n");S.div(`${t}\n`)}return S.toString().replace(/\s*$/,"")},s.cacheHelpMessage=function(){w=this.help()},s.clearCachedHelpMessage=function(){w=void 0},s.hasCachedHelpMessage=function(){return!!w},s.showHelp=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(s.help())},s.functionDescription=t=>["(",t.name?e.Parser.decamelize(t.name,"-"):n("generated-value"),")"].join(""),s.stringifiedValues=function(t,e){let n="";const s=e||", ",i=[].concat(t);return t&&i.length?(i.forEach((t=>{n.length&&(n+=s),n+=JSON.stringify(t)})),n):n};let E=null;s.version=t=>{E=t},s.showVersion=e=>{const n=t.getInternalMethods().getLoggerInstance();e||(e="error");("function"==typeof e?e:n[e])(E)},s.reset=function(t){return r=null,c=!1,l=[],h=!1,p=[],u=[],d=[],f=tt(f,(e=>!t[e])),s};const S=[];return s.freeze=function(){S.push({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f})},s.unfreeze=function(t=!1){const e=S.pop();e&&(t?(f={...e.descriptions,...f},d=[...e.commands,...d],l=[...e.usages,...l],u=[...e.examples,...u],p=[...e.epilogs,...p]):({failMessage:r,failureOutput:c,usages:l,usageDisabled:h,epilogs:p,examples:u,commands:d,descriptions:f}=e))},s}function it(t){return"object"==typeof t}function rt(t){return it(t)?t.indentation:0}function ot(t){return it(t)?t.text:t}class at{constructor(t,e,n,s){var i,r,o;this.yargs=t,this.usage=e,this.command=n,this.shim=s,this.completionKey="get-yargs-completions",this.aliases=null,this.customCompletionFunction=null,this.indexAfterLastReset=0,this.zshShell=null!==(o=(null===(i=this.shim.getEnv("SHELL"))||void 0===i?void 0:i.includes("zsh"))||(null===(r=this.shim.getEnv("ZSH_NAME"))||void 0===r?void 0:r.includes("zsh")))&&void 0!==o&&o}defaultCompletion(t,e,n,s){const i=this.command.getCommandHandlers();for(let e=0,n=t.length;e<n;++e)if(i[t[e]]&&i[t[e]].builder){const n=i[t[e]].builder;if(Z(n)){this.indexAfterLastReset=e+1;const t=this.yargs.getInternalMethods().reset();return n(t,!0),t.argv}}const r=[];this.commandCompletions(r,t,n),this.optionCompletions(r,t,e,n),this.choicesFromOptionsCompletions(r,t,e,n),this.choicesFromPositionalsCompletions(r,t,e,n),s(null,r)}commandCompletions(t,e,n){const s=this.yargs.getInternalMethods().getContext().commands;n.match(/^-/)||s[s.length-1]===n||this.previousArgHasChoices(e)||this.usage.getCommands().forEach((n=>{const s=U(n[0]).cmd;if(-1===e.indexOf(s))if(this.zshShell){const e=n[1]||"";t.push(s.replace(/:/g,"\\:")+":"+e)}else t.push(s)}))}optionCompletions(t,e,n,s){if((s.match(/^-/)||""===s&&0===t.length)&&!this.previousArgHasChoices(e)){const n=this.yargs.getOptions(),i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[];Object.keys(n.key).forEach((r=>{const o=!!n.configuration["boolean-negation"]&&n.boolean.includes(r);i.includes(r)||n.hiddenOptions.includes(r)||this.argsContainKey(e,r,o)||(this.completeOptionKey(r,t,s),o&&n.default[r]&&this.completeOptionKey(`no-${r}`,t,s))}))}}choicesFromOptionsCompletions(t,e,n,s){if(this.previousArgHasChoices(e)){const n=this.getPreviousArgChoices(e);n&&n.length>0&&t.push(...n.map((t=>t.replace(/:/g,"\\:"))))}}choicesFromPositionalsCompletions(t,e,n,s){if(""===s&&t.length>0&&this.previousArgHasChoices(e))return;const i=this.yargs.getGroups()[this.usage.getPositionalGroupName()]||[],r=Math.max(this.indexAfterLastReset,this.yargs.getInternalMethods().getContext().commands.length+1),o=i[n._.length-r-1];if(!o)return;const a=this.yargs.getOptions().choices[o]||[];for(const e of a)e.startsWith(s)&&t.push(e.replace(/:/g,"\\:"))}getPreviousArgChoices(t){if(t.length<1)return;let e=t[t.length-1],n="";if(!e.startsWith("-")&&t.length>1&&(n=e,e=t[t.length-2]),!e.startsWith("-"))return;const s=e.replace(/^-+/,""),i=this.yargs.getOptions(),r=[s,...this.yargs.getAliases()[s]||[]];let o;for(const t of r)if(Object.prototype.hasOwnProperty.call(i.key,t)&&Array.isArray(i.choices[t])){o=i.choices[t];break}return o?o.filter((t=>!n||t.startsWith(n))):void 0}previousArgHasChoices(t){const e=this.getPreviousArgChoices(t);return void 0!==e&&e.length>0}argsContainKey(t,e,n){const s=e=>-1!==t.indexOf((/^[^0-9]$/.test(e)?"-":"--")+e);if(s(e))return!0;if(n&&s(`no-${e}`))return!0;if(this.aliases)for(const t of this.aliases[e])if(s(t))return!0;return!1}completeOptionKey(t,e,n){const s=this.usage.getDescriptions(),i=!/^--/.test(n)&&(t=>/^[^0-9]$/.test(t))(t)?"-":"--";if(this.zshShell){const n=s[t]||"";e.push(i+`${t.replace(/:/g,"\\:")}:${n.replace("__yargsString__:","")}`)}else e.push(i+t)}customCompletion(t,e,n,s){if(F(this.customCompletionFunction,null,this.shim),this.customCompletionFunction.length<3){const t=this.customCompletionFunction(n,e);return W(t)?t.then((t=>{this.shim.process.nextTick((()=>{s(null,t)}))})).catch((t=>{this.shim.process.nextTick((()=>{s(t,void 0)}))})):s(null,t)}return function(t){return t.length>3}(this.customCompletionFunction)?this.customCompletionFunction(n,e,((i=s)=>this.defaultCompletion(t,e,n,i)),(t=>{s(null,t)})):this.customCompletionFunction(n,e,(t=>{s(null,t)}))}getCompletion(t,e){const n=t.length?t[t.length-1]:"",s=this.yargs.parse(t,!0),i=this.customCompletionFunction?s=>this.customCompletion(t,s,n,e):s=>this.defaultCompletion(t,s,n,e);return W(s)?s.then(i):i(s)}generateCompletionScript(t,e){let n=this.zshShell?'#compdef {{app_name}}\n###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.zshrc\n# or {{app_path}} {{completion_command}} >> ~/.zprofile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local reply\n local si=$IFS\n IFS=$\'\n\' reply=($(COMP_CWORD="$((CURRENT-1))" COMP_LINE="$BUFFER" COMP_POINT="$CURSOR" {{app_path}} --get-yargs-completions "${words[@]}"))\n IFS=$si\n _describe \'values\' reply\n}\ncompdef _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n':'###-begin-{{app_name}}-completions-###\n#\n# yargs command completion script\n#\n# Installation: {{app_path}} {{completion_command}} >> ~/.bashrc\n# or {{app_path}} {{completion_command}} >> ~/.bash_profile on OSX.\n#\n_{{app_name}}_yargs_completions()\n{\n local cur_word args type_list\n\n cur_word="${COMP_WORDS[COMP_CWORD]}"\n args=("${COMP_WORDS[@]}")\n\n # ask yargs to generate completions.\n type_list=$({{app_path}} --get-yargs-completions "${args[@]}")\n\n COMPREPLY=( $(compgen -W "${type_list}" -- ${cur_word}) )\n\n # if no match was found, fall back to filename completion\n if [ ${#COMPREPLY[@]} -eq 0 ]; then\n COMPREPLY=()\n fi\n\n return 0\n}\ncomplete -o bashdefault -o default -F _{{app_name}}_yargs_completions {{app_name}}\n###-end-{{app_name}}-completions-###\n';const s=this.shim.path.basename(t);return t.match(/\.js$/)&&(t=`./${t}`),n=n.replace(/{{app_name}}/g,s),n=n.replace(/{{completion_command}}/g,e),n.replace(/{{app_path}}/g,t)}registerFunction(t){this.customCompletionFunction=t}setParsed(t){this.aliases=t.aliases}}function ct(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const n=[];let s,i;for(s=0;s<=e.length;s++)n[s]=[s];for(i=0;i<=t.length;i++)n[0][i]=i;for(s=1;s<=e.length;s++)for(i=1;i<=t.length;i++)e.charAt(s-1)===t.charAt(i-1)?n[s][i]=n[s-1][i-1]:s>1&&i>1&&e.charAt(s-2)===t.charAt(i-1)&&e.charAt(s-1)===t.charAt(i-2)?n[s][i]=n[s-2][i-2]+1:n[s][i]=Math.min(n[s-1][i-1]+1,Math.min(n[s][i-1]+1,n[s-1][i]+1));return n[e.length][t.length]}const lt=["$0","--","_"];let ht,ut=[];function dt(t,e,n,s){ht=s;let i={};if(Object.prototype.hasOwnProperty.call(t,"extends")){if("string"!=typeof t.extends)return i;const s=/\.json|\..*rc$/.test(t.extends);let r=null;if(s)r=function(t,e){return ht.path.resolve(t,e)}(e,t.extends);else try{r=require.resolve(t.extends)}catch(e){return t}!function(t){if(ut.indexOf(t)>-1)throw new k(`Circular extended configurations: '${t}'.`)}(r),ut.push(r),i=s?JSON.parse(ht.readFileSync(r,"utf8")):require(t.extends),delete t.extends,i=dt(i,ht.path.dirname(r),n,ht)}return ut=[],n?ft(i,t):Object.assign({},i,t)}function ft(t,e){const n={};function s(t){return t&&"object"==typeof t&&!Array.isArray(t)}Object.assign(n,t);for(const i of Object.keys(e))s(e[i])&&s(n[i])?n[i]=ft(t[i],e[i]):n[i]=e[i];return n}var pt,mt,gt,yt,bt,vt,wt,xt,Ot,Et,St,jt,Ct,_t,At,kt,Pt,It,$t,Mt,Tt,Nt,Lt,Gt,Ft,Dt,Rt,Wt,Ut,Bt,zt,Ht,qt,Vt,Kt=function(t,e,n,s,i){if("m"===s)throw new TypeError("Private method is not writable");if("a"===s&&!i)throw new TypeError("Private accessor was defined without a setter");if("function"==typeof e?t!==e||!i:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return"a"===s?i.call(t,n):i?i.value=n:e.set(t,n),n},Yt=function(t,e,n,s){if("a"===n&&!s)throw new TypeError("Private accessor was defined without a getter");if("function"==typeof e?t!==e||!s:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return"m"===n?s:"a"===n?s.call(t):s?s.value:e.get(t)};const Xt=Symbol("copyDoubleDash"),Jt=Symbol("copyDoubleDash"),Qt=Symbol("deleteFromParserHintObject"),Zt=Symbol("emitWarning"),te=Symbol("freeze"),ee=Symbol("getDollarZero"),ne=Symbol("getParserConfiguration"),se=Symbol("guessLocale"),ie=Symbol("guessVersion"),re=Symbol("parsePositionalNumbers"),oe=Symbol("pkgUp"),ae=Symbol("populateParserHintArray"),ce=Symbol("populateParserHintSingleValueDictionary"),le=Symbol("populateParserHintArrayDictionary"),he=Symbol("populateParserHintDictionary"),ue=Symbol("sanitizeKey"),de=Symbol("setKey"),fe=Symbol("unfreeze"),pe=Symbol("validateAsync"),me=Symbol("getCommandInstance"),ge=Symbol("getContext"),ye=Symbol("getHasOutput"),be=Symbol("getLoggerInstance"),ve=Symbol("getParseContext"),we=Symbol("getUsageInstance"),xe=Symbol("getValidationInstance"),Oe=Symbol("hasParseCallback"),Ee=Symbol("isGlobalContext"),Se=Symbol("postProcess"),je=Symbol("rebase"),Ce=Symbol("reset"),_e=Symbol("runYargsParserAndExecuteCommands"),Ae=Symbol("runValidation"),ke=Symbol("setHasOutput"),Pe=Symbol("kTrackManuallySetKeys");class Ie{constructor(t=[],e,n,s){this.customScriptName=!1,this.parsed=!1,pt.set(this,void 0),mt.set(this,void 0),gt.set(this,{commands:[],fullCommands:[]}),yt.set(this,null),bt.set(this,null),vt.set(this,"show-hidden"),wt.set(this,null),xt.set(this,!0),Ot.set(this,{}),Et.set(this,!0),St.set(this,[]),jt.set(this,void 0),Ct.set(this,{}),_t.set(this,!1),At.set(this,null),kt.set(this,!0),Pt.set(this,void 0),It.set(this,""),$t.set(this,void 0),Mt.set(this,void 0),Tt.set(this,{}),Nt.set(this,null),Lt.set(this,null),Gt.set(this,{}),Ft.set(this,{}),Dt.set(this,void 0),Rt.set(this,!1),Wt.set(this,void 0),Ut.set(this,!1),Bt.set(this,!1),zt.set(this,!1),Ht.set(this,void 0),qt.set(this,null),Vt.set(this,void 0),Kt(this,Wt,s,"f"),Kt(this,Dt,t,"f"),Kt(this,mt,e,"f"),Kt(this,Mt,n,"f"),Kt(this,jt,new V(this),"f"),this.$0=this[ee](),this[Ce](),Kt(this,pt,Yt(this,pt,"f"),"f"),Kt(this,Ht,Yt(this,Ht,"f"),"f"),Kt(this,Vt,Yt(this,Vt,"f"),"f"),Kt(this,$t,Yt(this,$t,"f"),"f"),Yt(this,$t,"f").showHiddenOpt=Yt(this,vt,"f"),Kt(this,Pt,this[Jt](),"f")}addHelpOpt(t,e){return z("[string|boolean] [string]",[t,e],arguments.length),Yt(this,At,"f")&&(this[Qt](Yt(this,At,"f")),Kt(this,At,null,"f")),!1===t&&void 0===e||(Kt(this,At,"string"==typeof t?t:"help","f"),this.boolean(Yt(this,At,"f")),this.describe(Yt(this,At,"f"),e||Yt(this,Ht,"f").deferY18nLookup("Show help"))),this}help(t,e){return this.addHelpOpt(t,e)}addShowHiddenOpt(t,e){if(z("[string|boolean] [string]",[t,e],arguments.length),!1===t&&void 0===e)return this;const n="string"==typeof t?t:Yt(this,vt,"f");return this.boolean(n),this.describe(n,e||Yt(this,Ht,"f").deferY18nLookup("Show hidden options")),Yt(this,$t,"f").showHiddenOpt=n,this}showHidden(t,e){return this.addShowHiddenOpt(t,e)}alias(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[le](this.alias.bind(this),"alias",t,e),this}array(t){return z("<array|string>",[t],arguments.length),this[ae]("array",t),this[Pe](t),this}boolean(t){return z("<array|string>",[t],arguments.length),this[ae]("boolean",t),this[Pe](t),this}check(t,e){return z("<function> [boolean]",[t,e],arguments.length),this.middleware(((e,n)=>Y((()=>t(e,n.getOptions())),(n=>(n?("string"==typeof n||n instanceof Error)&&Yt(this,Ht,"f").fail(n.toString(),n):Yt(this,Ht,"f").fail(Yt(this,Wt,"f").y18n.__("Argument check failed: %s",t.toString())),e)),(t=>(Yt(this,Ht,"f").fail(t.message?t.message:t.toString(),t),e)))),!1,e),this}choices(t,e){return z("<object|string|array> [string|array]",[t,e],arguments.length),this[le](this.choices.bind(this),"choices",t,e),this}coerce(t,e){if(z("<object|string|array> [function]",[t,e],arguments.length),Array.isArray(t)){if(!e)throw new k("coerce callback must be provided");for(const n of t)this.coerce(n,e);return this}if("object"==typeof t){for(const e of Object.keys(t))this.coerce(e,t[e]);return this}if(!e)throw new k("coerce callback must be provided");return Yt(this,$t,"f").key[t]=!0,Yt(this,jt,"f").addCoerceMiddleware(((n,s)=>{let i;return Object.prototype.hasOwnProperty.call(n,t)?Y((()=>(i=s.getAliases(),e(n[t]))),(e=>{n[t]=e;const r=s.getInternalMethods().getParserConfiguration()["strip-aliased"];if(i[t]&&!0!==r)for(const s of i[t])n[s]=e;return n}),(t=>{throw new k(t.message)})):n}),t),this}conflicts(t,e){return z("<string|object> [string|array]",[t,e],arguments.length),Yt(this,Vt,"f").conflicts(t,e),this}config(t="config",e,n){return z("[object|string] [string|function] [function]",[t,e,n],arguments.length),"object"!=typeof t||Array.isArray(t)?("function"==typeof e&&(n=e,e=void 0),this.describe(t,e||Yt(this,Ht,"f").deferY18nLookup("Path to JSON config file")),(Array.isArray(t)?t:[t]).forEach((t=>{Yt(this,$t,"f").config[t]=n||!0})),this):(t=dt(t,Yt(this,mt,"f"),this[ne]()["deep-merge-config"]||!1,Yt(this,Wt,"f")),Yt(this,$t,"f").configObjects=(Yt(this,$t,"f").configObjects||[]).concat(t),this)}completion(t,e,n){return z("[string] [string|boolean|function] [function]",[t,e,n],arguments.length),"function"==typeof e&&(n=e,e=void 0),Kt(this,bt,t||Yt(this,bt,"f")||"completion","f"),e||!1===e||(e="generate completion script"),this.command(Yt(this,bt,"f"),e),n&&Yt(this,yt,"f").registerFunction(n),this}command(t,e,n,s,i,r){return z("<string|array|object> [string|boolean] [function|object] [function] [array] [boolean|string]",[t,e,n,s,i,r],arguments.length),Yt(this,pt,"f").addHandler(t,e,n,s,i,r),this}commands(t,e,n,s,i,r){return this.command(t,e,n,s,i,r)}commandDir(t,e){z("<string> [object]",[t,e],arguments.length);const n=Yt(this,Mt,"f")||Yt(this,Wt,"f").require;return Yt(this,pt,"f").addDirectory(t,n,Yt(this,Wt,"f").getCallerFile(),e),this}count(t){return z("<array|string>",[t],arguments.length),this[ae]("count",t),this[Pe](t),this}default(t,e,n){return z("<object|string|array> [*] [string]",[t,e,n],arguments.length),n&&(D(t,Yt(this,Wt,"f")),Yt(this,$t,"f").defaultDescription[t]=n),"function"==typeof e&&(D(t,Yt(this,Wt,"f")),Yt(this,$t,"f").defaultDescription[t]||(Yt(this,$t,"f").defaultDescription[t]=Yt(this,Ht,"f").functionDescription(e)),e=e.call()),this[ce](this.default.bind(this),"default",t,e),this}defaults(t,e,n){return this.default(t,e,n)}demandCommand(t=1,e,n,s){return z("[number] [number|string] [string|null|undefined] [string|null|undefined]",[t,e,n,s],arguments.length),"number"!=typeof e&&(n=e,e=1/0),this.global("_",!1),Yt(this,$t,"f").demandedCommands._={min:t,max:e,minMsg:n,maxMsg:s},this}demand(t,e,n){return Array.isArray(e)?(e.forEach((t=>{F(n,!0,Yt(this,Wt,"f")),this.demandOption(t,n)})),e=1/0):"number"!=typeof e&&(n=e,e=1/0),"number"==typeof t?(F(n,!0,Yt(this,Wt,"f")),this.demandCommand(t,e,n,n)):Array.isArray(t)?t.forEach((t=>{F(n,!0,Yt(this,Wt,"f")),this.demandOption(t,n)})):"string"==typeof n?this.demandOption(t,n):!0!==n&&void 0!==n||this.demandOption(t),this}demandOption(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[ce](this.demandOption.bind(this),"demandedOptions",t,e),this}deprecateOption(t,e){return z("<string> [string|boolean]",[t,e],arguments.length),Yt(this,$t,"f").deprecatedOptions[t]=e,this}describe(t,e){return z("<object|string|array> [string]",[t,e],arguments.length),this[de](t,!0),Yt(this,Ht,"f").describe(t,e),this}detectLocale(t){return z("<boolean>",[t],arguments.length),Kt(this,xt,t,"f"),this}env(t){return z("[string|boolean]",[t],arguments.length),!1===t?delete Yt(this,$t,"f").envPrefix:Yt(this,$t,"f").envPrefix=t||"",this}epilogue(t){return z("<string>",[t],arguments.length),Yt(this,Ht,"f").epilog(t),this}epilog(t){return this.epilogue(t)}example(t,e){return z("<string|array> [string]",[t,e],arguments.length),Array.isArray(t)?t.forEach((t=>this.example(...t))):Yt(this,Ht,"f").example(t,e),this}exit(t,e){Kt(this,_t,!0,"f"),Kt(this,wt,e,"f"),Yt(this,Et,"f")&&Yt(this,Wt,"f").process.exit(t)}exitProcess(t=!0){return z("[boolean]",[t],arguments.length),Kt(this,Et,t,"f"),this}fail(t){if(z("<function|boolean>",[t],arguments.length),"boolean"==typeof t&&!1!==t)throw new k("Invalid first argument. Expected function or boolean 'false'");return Yt(this,Ht,"f").failFn(t),this}getAliases(){return this.parsed?this.parsed.aliases:{}}async getCompletion(t,e){return z("<array> [function]",[t,e],arguments.length),e?Yt(this,yt,"f").getCompletion(t,e):new Promise(((e,n)=>{Yt(this,yt,"f").getCompletion(t,((t,s)=>{t?n(t):e(s)}))}))}getDemandedOptions(){return z([],0),Yt(this,$t,"f").demandedOptions}getDemandedCommands(){return z([],0),Yt(this,$t,"f").demandedCommands}getDeprecatedOptions(){return z([],0),Yt(this,$t,"f").deprecatedOptions}getDetectLocale(){return Yt(this,xt,"f")}getExitProcess(){return Yt(this,Et,"f")}getGroups(){return Object.assign({},Yt(this,Ct,"f"),Yt(this,Ft,"f"))}getHelp(){if(Kt(this,_t,!0,"f"),!Yt(this,Ht,"f").hasCachedHelpMessage()){if(!this.parsed){const t=this[_e](Yt(this,Dt,"f"),void 0,void 0,0,!0);if(W(t))return t.then((()=>Yt(this,Ht,"f").help()))}const t=Yt(this,pt,"f").runDefaultBuilderOn(this);if(W(t))return t.then((()=>Yt(this,Ht,"f").help()))}return Promise.resolve(Yt(this,Ht,"f").help())}getOptions(){return Yt(this,$t,"f")}getStrict(){return Yt(this,Ut,"f")}getStrictCommands(){return Yt(this,Bt,"f")}getStrictOptions(){return Yt(this,zt,"f")}global(t,e){return z("<string|array> [boolean]",[t,e],arguments.length),t=[].concat(t),!1!==e?Yt(this,$t,"f").local=Yt(this,$t,"f").local.filter((e=>-1===t.indexOf(e))):t.forEach((t=>{Yt(this,$t,"f").local.includes(t)||Yt(this,$t,"f").local.push(t)})),this}group(t,e){z("<string|array> <string>",[t,e],arguments.length);const n=Yt(this,Ft,"f")[e]||Yt(this,Ct,"f")[e];Yt(this,Ft,"f")[e]&&delete Yt(this,Ft,"f")[e];const s={};return Yt(this,Ct,"f")[e]=(n||[]).concat(t).filter((t=>!s[t]&&(s[t]=!0))),this}hide(t){return z("<string>",[t],arguments.length),Yt(this,$t,"f").hiddenOptions.push(t),this}implies(t,e){return z("<string|object> [number|string|array]",[t,e],arguments.length),Yt(this,Vt,"f").implies(t,e),this}locale(t){return z("[string]",[t],arguments.length),void 0===t?(this[se](),Yt(this,Wt,"f").y18n.getLocale()):(Kt(this,xt,!1,"f"),Yt(this,Wt,"f").y18n.setLocale(t),this)}middleware(t,e,n){return Yt(this,jt,"f").addMiddleware(t,!!e,n)}nargs(t,e){return z("<string|object|array> [number]",[t,e],arguments.length),this[ce](this.nargs.bind(this),"narg",t,e),this}normalize(t){return z("<array|string>",[t],arguments.length),this[ae]("normalize",t),this}number(t){return z("<array|string>",[t],arguments.length),this[ae]("number",t),this[Pe](t),this}option(t,e){if(z("<string|object> [object]",[t,e],arguments.length),"object"==typeof t)Object.keys(t).forEach((e=>{this.options(e,t[e])}));else{"object"!=typeof e&&(e={}),this[Pe](t),!Yt(this,qt,"f")||"version"!==t&&"version"!==(null==e?void 0:e.alias)||this[Zt](['"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("\n"),void 0,"versionWarning"),Yt(this,$t,"f").key[t]=!0,e.alias&&this.alias(t,e.alias);const n=e.deprecate||e.deprecated;n&&this.deprecateOption(t,n);const s=e.demand||e.required||e.require;s&&this.demand(t,s),e.demandOption&&this.demandOption(t,"string"==typeof e.demandOption?e.demandOption:void 0),e.conflicts&&this.conflicts(t,e.conflicts),"default"in e&&this.default(t,e.default),void 0!==e.implies&&this.implies(t,e.implies),void 0!==e.nargs&&this.nargs(t,e.nargs),e.config&&this.config(t,e.configParser),e.normalize&&this.normalize(t),e.choices&&this.choices(t,e.choices),e.coerce&&this.coerce(t,e.coerce),e.group&&this.group(t,e.group),(e.boolean||"boolean"===e.type)&&(this.boolean(t),e.alias&&this.boolean(e.alias)),(e.array||"array"===e.type)&&(this.array(t),e.alias&&this.array(e.alias)),(e.number||"number"===e.type)&&(this.number(t),e.alias&&this.number(e.alias)),(e.string||"string"===e.type)&&(this.string(t),e.alias&&this.string(e.alias)),(e.count||"count"===e.type)&&this.count(t),"boolean"==typeof e.global&&this.global(t,e.global),e.defaultDescription&&(Yt(this,$t,"f").defaultDescription[t]=e.defaultDescription),e.skipValidation&&this.skipValidation(t);const i=e.describe||e.description||e.desc;this.describe(t,i),e.hidden&&this.hide(t),e.requiresArg&&this.requiresArg(t)}return this}options(t,e){return this.option(t,e)}parse(t,e,n){z("[string|array] [function|boolean|object] [function]",[t,e,n],arguments.length),this[te](),void 0===t&&(t=Yt(this,Dt,"f")),"object"==typeof e&&(Kt(this,Lt,e,"f"),e=n),"function"==typeof e&&(Kt(this,Nt,e,"f"),e=!1),e||Kt(this,Dt,t,"f"),Yt(this,Nt,"f")&&Kt(this,Et,!1,"f");const s=this[_e](t,!!e),i=this.parsed;return Yt(this,yt,"f").setParsed(this.parsed),W(s)?s.then((t=>(Yt(this,Nt,"f")&&Yt(this,Nt,"f").call(this,Yt(this,wt,"f"),t,Yt(this,It,"f")),t))).catch((t=>{throw Yt(this,Nt,"f")&&Yt(this,Nt,"f")(t,this.parsed.argv,Yt(this,It,"f")),t})).finally((()=>{this[fe](),this.parsed=i})):(Yt(this,Nt,"f")&&Yt(this,Nt,"f").call(this,Yt(this,wt,"f"),s,Yt(this,It,"f")),this[fe](),this.parsed=i,s)}parseAsync(t,e,n){const s=this.parse(t,e,n);return W(s)?s:Promise.resolve(s)}parseSync(t,e,n){const s=this.parse(t,e,n);if(W(s))throw new k(".parseSync() must not be used with asynchronous builders, handlers, or middleware");return s}parserConfiguration(t){return z("<object>",[t],arguments.length),Kt(this,Tt,t,"f"),this}pkgConf(t,e){z("<string> [string]",[t,e],arguments.length);let n=null;const s=this[oe](e||Yt(this,mt,"f"));return s[t]&&"object"==typeof s[t]&&(n=dt(s[t],e||Yt(this,mt,"f"),this[ne]()["deep-merge-config"]||!1,Yt(this,Wt,"f")),Yt(this,$t,"f").configObjects=(Yt(this,$t,"f").configObjects||[]).concat(n)),this}positional(t,e){z("<string> <object>",[t,e],arguments.length);const n=["default","defaultDescription","implies","normalize","choices","conflicts","coerce","type","describe","desc","description","alias"];e=tt(e,((t,e)=>!("type"===t&&!["string","number","boolean"].includes(e))&&n.includes(t)));const s=Yt(this,gt,"f").fullCommands[Yt(this,gt,"f").fullCommands.length-1],i=s?Yt(this,pt,"f").cmdToParseOptions(s):{array:[],alias:{},default:{},demand:{}};return R(i).forEach((n=>{const s=i[n];Array.isArray(s)?-1!==s.indexOf(t)&&(e[n]=!0):s[t]&&!(n in e)&&(e[n]=s[t])})),this.group(t,Yt(this,Ht,"f").getPositionalGroupName()),this.option(t,e)}recommendCommands(t=!0){return z("[boolean]",[t],arguments.length),Kt(this,Rt,t,"f"),this}required(t,e,n){return this.demand(t,e,n)}require(t,e,n){return this.demand(t,e,n)}requiresArg(t){return z("<array|string|object> [number]",[t],arguments.length),"string"==typeof t&&Yt(this,$t,"f").narg[t]||this[ce](this.requiresArg.bind(this),"narg",t,NaN),this}showCompletionScript(t,e){return z("[string] [string]",[t,e],arguments.length),t=t||this.$0,Yt(this,Pt,"f").log(Yt(this,yt,"f").generateCompletionScript(t,e||Yt(this,bt,"f")||"completion")),this}showHelp(t){if(z("[string|function]",[t],arguments.length),Kt(this,_t,!0,"f"),!Yt(this,Ht,"f").hasCachedHelpMessage()){if(!this.parsed){const e=this[_e](Yt(this,Dt,"f"),void 0,void 0,0,!0);if(W(e))return e.then((()=>{Yt(this,Ht,"f").showHelp(t)})),this}const e=Yt(this,pt,"f").runDefaultBuilderOn(this);if(W(e))return e.then((()=>{Yt(this,Ht,"f").showHelp(t)})),this}return Yt(this,Ht,"f").showHelp(t),this}scriptName(t){return this.customScriptName=!0,this.$0=t,this}showHelpOnFail(t,e){return z("[boolean|string] [string]",[t,e],arguments.length),Yt(this,Ht,"f").showHelpOnFail(t,e),this}showVersion(t){return z("[string|function]",[t],arguments.length),Yt(this,Ht,"f").showVersion(t),this}skipValidation(t){return z("<array|string>",[t],arguments.length),this[ae]("skipValidation",t),this}strict(t){return z("[boolean]",[t],arguments.length),Kt(this,Ut,!1!==t,"f"),this}strictCommands(t){return z("[boolean]",[t],arguments.length),Kt(this,Bt,!1!==t,"f"),this}strictOptions(t){return z("[boolean]",[t],arguments.length),Kt(this,zt,!1!==t,"f"),this}string(t){return z("<array|string>",[t],arguments.length),this[ae]("string",t),this[Pe](t),this}terminalWidth(){return z([],0),Yt(this,Wt,"f").process.stdColumns}updateLocale(t){return this.updateStrings(t)}updateStrings(t){return z("<object>",[t],arguments.length),Kt(this,xt,!1,"f"),Yt(this,Wt,"f").y18n.updateLocale(t),this}usage(t,e,n,s){if(z("<string|null|undefined> [string|boolean] [function|object] [function]",[t,e,n,s],arguments.length),void 0!==e){if(F(t,null,Yt(this,Wt,"f")),(t||"").match(/^\$0( |$)/))return this.command(t,e,n,s);throw new k(".usage() description must start with $0 if being used as alias for .command()")}return Yt(this,Ht,"f").usage(t),this}version(t,e,n){const s="version";if(z("[boolean|string] [string] [string]",[t,e,n],arguments.length),Yt(this,qt,"f")&&(this[Qt](Yt(this,qt,"f")),Yt(this,Ht,"f").version(void 0),Kt(this,qt,null,"f")),0===arguments.length)n=this[ie](),t=s;else if(1===arguments.length){if(!1===t)return this;n=t,t=s}else 2===arguments.length&&(n=e,e=void 0);return Kt(this,qt,"string"==typeof t?t:s,"f"),e=e||Yt(this,Ht,"f").deferY18nLookup("Show version number"),Yt(this,Ht,"f").version(n||void 0),this.boolean(Yt(this,qt,"f")),this.describe(Yt(this,qt,"f"),e),this}wrap(t){return z("<number|null|undefined>",[t],arguments.length),Yt(this,Ht,"f").wrap(t),this}[(pt=new WeakMap,mt=new WeakMap,gt=new WeakMap,yt=new WeakMap,bt=new WeakMap,vt=new WeakMap,wt=new WeakMap,xt=new WeakMap,Ot=new WeakMap,Et=new WeakMap,St=new WeakMap,jt=new WeakMap,Ct=new WeakMap,_t=new WeakMap,At=new WeakMap,kt=new WeakMap,Pt=new WeakMap,It=new WeakMap,$t=new WeakMap,Mt=new WeakMap,Tt=new WeakMap,Nt=new WeakMap,Lt=new WeakMap,Gt=new WeakMap,Ft=new WeakMap,Dt=new WeakMap,Rt=new WeakMap,Wt=new WeakMap,Ut=new WeakMap,Bt=new WeakMap,zt=new WeakMap,Ht=new WeakMap,qt=new WeakMap,Vt=new WeakMap,Xt)](t){if(!t._||!t["--"])return t;t._.push.apply(t._,t["--"]);try{delete t["--"]}catch(t){}return t}[Jt](){return{log:(...t)=>{this[Oe]()||console.log(...t),Kt(this,_t,!0,"f"),Yt(this,It,"f").length&&Kt(this,It,Yt(this,It,"f")+"\n","f"),Kt(this,It,Yt(this,It,"f")+t.join(" "),"f")},error:(...t)=>{this[Oe]()||console.error(...t),Kt(this,_t,!0,"f"),Yt(this,It,"f").length&&Kt(this,It,Yt(this,It,"f")+"\n","f"),Kt(this,It,Yt(this,It,"f")+t.join(" "),"f")}}}[Qt](t){R(Yt(this,$t,"f")).forEach((e=>{if("configObjects"===e)return;const n=Yt(this,$t,"f")[e];Array.isArray(n)?n.includes(t)&&n.splice(n.indexOf(t),1):"object"==typeof n&&delete n[t]})),delete Yt(this,Ht,"f").getDescriptions()[t]}[Zt](t,e,n){Yt(this,Ot,"f")[n]||(Yt(this,Wt,"f").process.emitWarning(t,e),Yt(this,Ot,"f")[n]=!0)}[te](){Yt(this,St,"f").push({options:Yt(this,$t,"f"),configObjects:Yt(this,$t,"f").configObjects.slice(0),exitProcess:Yt(this,Et,"f"),groups:Yt(this,Ct,"f"),strict:Yt(this,Ut,"f"),strictCommands:Yt(this,Bt,"f"),strictOptions:Yt(this,zt,"f"),completionCommand:Yt(this,bt,"f"),output:Yt(this,It,"f"),exitError:Yt(this,wt,"f"),hasOutput:Yt(this,_t,"f"),parsed:this.parsed,parseFn:Yt(this,Nt,"f"),parseContext:Yt(this,Lt,"f")}),Yt(this,Ht,"f").freeze(),Yt(this,Vt,"f").freeze(),Yt(this,pt,"f").freeze(),Yt(this,jt,"f").freeze()}[ee](){let t,e="";return t=/\b(node|iojs|electron)(\.exe)?$/.test(Yt(this,Wt,"f").process.argv()[0])?Yt(this,Wt,"f").process.argv().slice(1,2):Yt(this,Wt,"f").process.argv().slice(0,1),e=t.map((t=>{const e=this[je](Yt(this,mt,"f"),t);return t.match(/^(\/|([a-zA-Z]:)?\\)/)&&e.length<t.length?e:t})).join(" ").trim(),Yt(this,Wt,"f").getEnv("_")&&Yt(this,Wt,"f").getProcessArgvBin()===Yt(this,Wt,"f").getEnv("_")&&(e=Yt(this,Wt,"f").getEnv("_").replace(`${Yt(this,Wt,"f").path.dirname(Yt(this,Wt,"f").process.execPath())}/`,"")),e}[ne](){return Yt(this,Tt,"f")}[se](){if(!Yt(this,xt,"f"))return;const t=Yt(this,Wt,"f").getEnv("LC_ALL")||Yt(this,Wt,"f").getEnv("LC_MESSAGES")||Yt(this,Wt,"f").getEnv("LANG")||Yt(this,Wt,"f").getEnv("LANGUAGE")||"en_US";this.locale(t.replace(/[.:].*/,""))}[ie](){return this[oe]().version||"unknown"}[re](t){const e=t["--"]?t["--"]:t._;for(let t,n=0;void 0!==(t=e[n]);n++)Yt(this,Wt,"f").Parser.looksLikeNumber(t)&&Number.isSafeInteger(Math.floor(parseFloat(`${t}`)))&&(e[n]=Number(t));return t}[oe](t){const e=t||"*";if(Yt(this,Gt,"f")[e])return Yt(this,Gt,"f")[e];let n={};try{let e=t||Yt(this,Wt,"f").mainFilename;!t&&Yt(this,Wt,"f").path.extname(e)&&(e=Yt(this,Wt,"f").path.dirname(e));const s=Yt(this,Wt,"f").findUp(e,((t,e)=>e.includes("package.json")?"package.json":void 0));F(s,void 0,Yt(this,Wt,"f")),n=JSON.parse(Yt(this,Wt,"f").readFileSync(s,"utf8"))}catch(t){}return Yt(this,Gt,"f")[e]=n||{},Yt(this,Gt,"f")[e]}[ae](t,e){(e=[].concat(e)).forEach((e=>{e=this[ue](e),Yt(this,$t,"f")[t].push(e)}))}[ce](t,e,n,s){this[he](t,e,n,s,((t,e,n)=>{Yt(this,$t,"f")[t][e]=n}))}[le](t,e,n,s){this[he](t,e,n,s,((t,e,n)=>{Yt(this,$t,"f")[t][e]=(Yt(this,$t,"f")[t][e]||[]).concat(n)}))}[he](t,e,n,s,i){if(Array.isArray(n))n.forEach((e=>{t(e,s)}));else if((t=>"object"==typeof t)(n))for(const e of R(n))t(e,n[e]);else i(e,this[ue](n),s)}[ue](t){return"__proto__"===t?"___proto___":t}[de](t,e){return this[ce](this[de].bind(this),"key",t,e),this}[fe](){var t,e,n,s,i,r,o,a,c,l,h,u;const d=Yt(this,St,"f").pop();let f;F(d,void 0,Yt(this,Wt,"f")),t=this,e=this,n=this,s=this,i=this,r=this,o=this,a=this,c=this,l=this,h=this,u=this,({options:{set value(e){Kt(t,$t,e,"f")}}.value,configObjects:f,exitProcess:{set value(t){Kt(e,Et,t,"f")}}.value,groups:{set value(t){Kt(n,Ct,t,"f")}}.value,output:{set value(t){Kt(s,It,t,"f")}}.value,exitError:{set value(t){Kt(i,wt,t,"f")}}.value,hasOutput:{set value(t){Kt(r,_t,t,"f")}}.value,parsed:this.parsed,strict:{set value(t){Kt(o,Ut,t,"f")}}.value,strictCommands:{set value(t){Kt(a,Bt,t,"f")}}.value,strictOptions:{set value(t){Kt(c,zt,t,"f")}}.value,completionCommand:{set value(t){Kt(l,bt,t,"f")}}.value,parseFn:{set value(t){Kt(h,Nt,t,"f")}}.value,parseContext:{set value(t){Kt(u,Lt,t,"f")}}.value}=d),Yt(this,$t,"f").configObjects=f,Yt(this,Ht,"f").unfreeze(),Yt(this,Vt,"f").unfreeze(),Yt(this,pt,"f").unfreeze(),Yt(this,jt,"f").unfreeze()}[pe](t,e){return Y(e,(e=>(t(e),e)))}getInternalMethods(){return{getCommandInstance:this[me].bind(this),getContext:this[ge].bind(this),getHasOutput:this[ye].bind(this),getLoggerInstance:this[be].bind(this),getParseContext:this[ve].bind(this),getParserConfiguration:this[ne].bind(this),getUsageInstance:this[we].bind(this),getValidationInstance:this[xe].bind(this),hasParseCallback:this[Oe].bind(this),isGlobalContext:this[Ee].bind(this),postProcess:this[Se].bind(this),reset:this[Ce].bind(this),runValidation:this[Ae].bind(this),runYargsParserAndExecuteCommands:this[_e].bind(this),setHasOutput:this[ke].bind(this)}}[me](){return Yt(this,pt,"f")}[ge](){return Yt(this,gt,"f")}[ye](){return Yt(this,_t,"f")}[be](){return Yt(this,Pt,"f")}[ve](){return Yt(this,Lt,"f")||{}}[we](){return Yt(this,Ht,"f")}[xe](){return Yt(this,Vt,"f")}[Oe](){return!!Yt(this,Nt,"f")}[Ee](){return Yt(this,kt,"f")}[Se](t,e,n,s){if(n)return t;if(W(t))return t;e||(t=this[Xt](t));return(this[ne]()["parse-positional-numbers"]||void 0===this[ne]()["parse-positional-numbers"])&&(t=this[re](t)),s&&(t=K(t,this,Yt(this,jt,"f").getMiddleware(),!1)),t}[Ce](t={}){Kt(this,$t,Yt(this,$t,"f")||{},"f");const e={};e.local=Yt(this,$t,"f").local||[],e.configObjects=Yt(this,$t,"f").configObjects||[];const n={};e.local.forEach((e=>{n[e]=!0,(t[e]||[]).forEach((t=>{n[t]=!0}))})),Object.assign(Yt(this,Ft,"f"),Object.keys(Yt(this,Ct,"f")).reduce(((t,e)=>{const s=Yt(this,Ct,"f")[e].filter((t=>!(t in n)));return s.length>0&&(t[e]=s),t}),{})),Kt(this,Ct,{},"f");return["array","boolean","string","skipValidation","count","normalize","number","hiddenOptions"].forEach((t=>{e[t]=(Yt(this,$t,"f")[t]||[]).filter((t=>!n[t]))})),["narg","key","alias","default","defaultDescription","config","choices","demandedOptions","demandedCommands","deprecatedOptions"].forEach((t=>{e[t]=tt(Yt(this,$t,"f")[t],(t=>!n[t]))})),e.envPrefix=Yt(this,$t,"f").envPrefix,Kt(this,$t,e,"f"),Kt(this,Ht,Yt(this,Ht,"f")?Yt(this,Ht,"f").reset(n):st(this,Yt(this,Wt,"f")),"f"),Kt(this,Vt,Yt(this,Vt,"f")?Yt(this,Vt,"f").reset(n):function(t,e,n){const s=n.y18n.__,i=n.y18n.__n,r={nonOptionCount:function(n){const s=t.getDemandedCommands(),r=n._.length+(n["--"]?n["--"].length:0)-t.getInternalMethods().getContext().commands.length;s._&&(r<s._.min||r>s._.max)&&(r<s._.min?void 0!==s._.minMsg?e.fail(s._.minMsg?s._.minMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.min.toString()):null):e.fail(i("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(),s._.min.toString())):r>s._.max&&(void 0!==s._.maxMsg?e.fail(s._.maxMsg?s._.maxMsg.replace(/\$0/g,r.toString()).replace(/\$1/,s._.max.toString()):null):e.fail(i("Too many non-option arguments: got %s, maximum of %s","Too many non-option arguments: got %s, maximum of %s",r,r.toString(),s._.max.toString()))))},positionalCount:function(t,n){n<t&&e.fail(i("Not enough non-option arguments: got %s, need at least %s","Not enough non-option arguments: got %s, need at least %s",n,n+"",t+""))},requiredArguments:function(t,n){let s=null;for(const e of Object.keys(n))Object.prototype.hasOwnProperty.call(t,e)&&void 0!==t[e]||(s=s||{},s[e]=n[e]);if(s){const t=[];for(const e of Object.keys(s)){const n=s[e];n&&t.indexOf(n)<0&&t.push(n)}const n=t.length?`\n${t.join("\n")}`:"";e.fail(i("Missing required argument: %s","Missing required arguments: %s",Object.keys(s).length,Object.keys(s).join(", ")+n))}},unknownArguments:function(n,s,o,a,c=!0){var l;const h=t.getInternalMethods().getCommandInstance().getCommands(),u=[],d=t.getInternalMethods().getContext();if(Object.keys(n).forEach((e=>{lt.includes(e)||Object.prototype.hasOwnProperty.call(o,e)||Object.prototype.hasOwnProperty.call(t.getInternalMethods().getParseContext(),e)||r.isValidAndSomeAliasIsNotNew(e,s)||u.push(e)})),c&&(d.commands.length>0||h.length>0||a)&&n._.slice(d.commands.length).forEach((t=>{h.includes(""+t)||u.push(""+t)})),c){const e=(null===(l=t.getDemandedCommands()._)||void 0===l?void 0:l.max)||0,s=d.commands.length+e;s<n._.length&&n._.slice(s).forEach((t=>{t=String(t),d.commands.includes(t)||u.includes(t)||u.push(t)}))}u.length&&e.fail(i("Unknown argument: %s","Unknown arguments: %s",u.length,u.map((t=>t.trim()?t:`"${t}"`)).join(", ")))},unknownCommands:function(n){const s=t.getInternalMethods().getCommandInstance().getCommands(),r=[],o=t.getInternalMethods().getContext();return(o.commands.length>0||s.length>0)&&n._.slice(o.commands.length).forEach((t=>{s.includes(""+t)||r.push(""+t)})),r.length>0&&(e.fail(i("Unknown command: %s","Unknown commands: %s",r.length,r.join(", "))),!0)},isValidAndSomeAliasIsNotNew:function(e,n){if(!Object.prototype.hasOwnProperty.call(n,e))return!1;const s=t.parsed.newAliases;return[e,...n[e]].some((t=>!Object.prototype.hasOwnProperty.call(s,t)||!s[e]))},limitedChoices:function(n){const i=t.getOptions(),r={};if(!Object.keys(i.choices).length)return;Object.keys(n).forEach((t=>{-1===lt.indexOf(t)&&Object.prototype.hasOwnProperty.call(i.choices,t)&&[].concat(n[t]).forEach((e=>{-1===i.choices[t].indexOf(e)&&void 0!==e&&(r[t]=(r[t]||[]).concat(e))}))}));const o=Object.keys(r);if(!o.length)return;let a=s("Invalid values:");o.forEach((t=>{a+=`\n ${s("Argument: %s, Given: %s, Choices: %s",t,e.stringifiedValues(r[t]),e.stringifiedValues(i.choices[t]))}`})),e.fail(a)}};let o={};function a(t,e){const n=Number(e);return"number"==typeof(e=isNaN(n)?e:n)?e=t._.length>=e:e.match(/^--no-.+/)?(e=e.match(/^--no-(.+)/)[1],e=!Object.prototype.hasOwnProperty.call(t,e)):e=Object.prototype.hasOwnProperty.call(t,e),e}r.implies=function(e,s){z("<string|object> [array|number|string]",[e,s],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.implies(t,e[t])})):(t.global(e),o[e]||(o[e]=[]),Array.isArray(s)?s.forEach((t=>r.implies(e,t))):(F(s,void 0,n),o[e].push(s)))},r.getImplied=function(){return o},r.implications=function(t){const n=[];if(Object.keys(o).forEach((e=>{const s=e;(o[e]||[]).forEach((e=>{let i=s;const r=e;i=a(t,i),e=a(t,e),i&&!e&&n.push(` ${s} -> ${r}`)}))})),n.length){let t=`${s("Implications failed:")}\n`;n.forEach((e=>{t+=e})),e.fail(t)}};let c={};r.conflicts=function(e,n){z("<string|object> [array|string]",[e,n],arguments.length),"object"==typeof e?Object.keys(e).forEach((t=>{r.conflicts(t,e[t])})):(t.global(e),c[e]||(c[e]=[]),Array.isArray(n)?n.forEach((t=>r.conflicts(e,t))):c[e].push(n))},r.getConflicting=()=>c,r.conflicting=function(i){Object.keys(i).forEach((t=>{c[t]&&c[t].forEach((n=>{n&&void 0!==i[t]&&void 0!==i[n]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,n))}))})),t.getInternalMethods().getParserConfiguration()["strip-dashed"]&&Object.keys(c).forEach((t=>{c[t].forEach((r=>{r&&void 0!==i[n.Parser.camelCase(t)]&&void 0!==i[n.Parser.camelCase(r)]&&e.fail(s("Arguments %s and %s are mutually exclusive",t,r))}))}))},r.recommendCommands=function(t,n){n=n.sort(((t,e)=>e.length-t.length));let i=null,r=1/0;for(let e,s=0;void 0!==(e=n[s]);s++){const n=ct(t,e);n<=3&&n<r&&(r=n,i=e)}i&&e.fail(s("Did you mean %s?",i))},r.reset=function(t){return o=tt(o,(e=>!t[e])),c=tt(c,(e=>!t[e])),r};const l=[];return r.freeze=function(){l.push({implied:o,conflicting:c})},r.unfreeze=function(){const t=l.pop();F(t,void 0,n),({implied:o,conflicting:c}=t)},r}(this,Yt(this,Ht,"f"),Yt(this,Wt,"f")),"f"),Kt(this,pt,Yt(this,pt,"f")?Yt(this,pt,"f").reset():function(t,e,n,s){return new J(t,e,n,s)}(Yt(this,Ht,"f"),Yt(this,Vt,"f"),Yt(this,jt,"f"),Yt(this,Wt,"f")),"f"),Yt(this,yt,"f")||Kt(this,yt,function(t,e,n,s){return new at(t,e,n,s)}(this,Yt(this,Ht,"f"),Yt(this,pt,"f"),Yt(this,Wt,"f")),"f"),Yt(this,jt,"f").reset(),Kt(this,bt,null,"f"),Kt(this,It,"","f"),Kt(this,wt,null,"f"),Kt(this,_t,!1,"f"),this.parsed=!1,this}[je](t,e){return Yt(this,Wt,"f").path.relative(t,e)}[_e](t,e,n,s=0,i=!1){let r=!!n||i;t=t||Yt(this,Dt,"f"),Yt(this,$t,"f").__=Yt(this,Wt,"f").y18n.__,Yt(this,$t,"f").configuration=this[ne]();const o=!!Yt(this,$t,"f").configuration["populate--"],a=Object.assign({},Yt(this,$t,"f").configuration,{"populate--":!0}),c=Yt(this,Wt,"f").Parser.detailed(t,Object.assign({},Yt(this,$t,"f"),{configuration:{"parse-positional-numbers":!1,...a}})),l=Object.assign(c.argv,Yt(this,Lt,"f"));let h;const u=c.aliases;let d=!1,f=!1;Object.keys(l).forEach((t=>{t===Yt(this,At,"f")&&l[t]?d=!0:t===Yt(this,qt,"f")&&l[t]&&(f=!0)})),l.$0=this.$0,this.parsed=c,0===s&&Yt(this,Ht,"f").clearCachedHelpMessage();try{if(this[se](),e)return this[Se](l,o,!!n,!1);if(Yt(this,At,"f")){[Yt(this,At,"f")].concat(u[Yt(this,At,"f")]||[]).filter((t=>t.length>1)).includes(""+l._[l._.length-1])&&(l._.pop(),d=!0)}Kt(this,kt,!1,"f");const a=Yt(this,pt,"f").getCommands(),p=Yt(this,yt,"f").completionKey in l,m=d||p||i;if(l._.length){if(a.length){let t;for(let e,r=s||0;void 0!==l._[r];r++){if(e=String(l._[r]),a.includes(e)&&e!==Yt(this,bt,"f")){const t=Yt(this,pt,"f").runCommand(e,this,c,r+1,i,d||f||i);return this[Se](t,o,!!n,!1)}if(!t&&e!==Yt(this,bt,"f")){t=e;break}}!Yt(this,pt,"f").hasDefaultCommand()&&Yt(this,Rt,"f")&&t&&!m&&Yt(this,Vt,"f").recommendCommands(t,a)}Yt(this,bt,"f")&&l._.includes(Yt(this,bt,"f"))&&!p&&(Yt(this,Et,"f")&&et(!0),this.showCompletionScript(),this.exit(0))}if(Yt(this,pt,"f").hasDefaultCommand()&&!m){const t=Yt(this,pt,"f").runCommand(null,this,c,0,i,d||f||i);return this[Se](t,o,!!n,!1)}if(p){Yt(this,Et,"f")&&et(!0);const e=(t=[].concat(t)).slice(t.indexOf(`--${Yt(this,yt,"f").completionKey}`)+1);return Yt(this,yt,"f").getCompletion(e,((t,e)=>{if(t)throw new k(t.message);(e||[]).forEach((t=>{Yt(this,Pt,"f").log(t)})),this.exit(0)})),this[Se](l,!o,!!n,!1)}if(Yt(this,_t,"f")||(d?(Yt(this,Et,"f")&&et(!0),r=!0,this.showHelp("log"),this.exit(0)):f&&(Yt(this,Et,"f")&&et(!0),r=!0,Yt(this,Ht,"f").showVersion("log"),this.exit(0))),!r&&Yt(this,$t,"f").skipValidation.length>0&&(r=Object.keys(l).some((t=>Yt(this,$t,"f").skipValidation.indexOf(t)>=0&&!0===l[t]))),!r){if(c.error)throw new k(c.error.message);if(!p){const t=this[Ae](u,{},c.error);n||(h=K(l,this,Yt(this,jt,"f").getMiddleware(),!0)),h=this[pe](t,null!=h?h:l),W(h)&&!n&&(h=h.then((()=>K(l,this,Yt(this,jt,"f").getMiddleware(),!1))))}}}catch(t){if(!(t instanceof k))throw t;Yt(this,Ht,"f").fail(t.message,t)}return this[Se](null!=h?h:l,o,!!n,!0)}[Ae](t,e,n,s){const i={...this.getDemandedOptions()};return r=>{if(n)throw new k(n.message);Yt(this,Vt,"f").nonOptionCount(r),Yt(this,Vt,"f").requiredArguments(r,i);let o=!1;Yt(this,Bt,"f")&&(o=Yt(this,Vt,"f").unknownCommands(r)),Yt(this,Ut,"f")&&!o?Yt(this,Vt,"f").unknownArguments(r,t,e,!!s):Yt(this,zt,"f")&&Yt(this,Vt,"f").unknownArguments(r,t,{},!1,!1),Yt(this,Vt,"f").limitedChoices(r),Yt(this,Vt,"f").implications(r),Yt(this,Vt,"f").conflicting(r)}}[ke](){Kt(this,_t,!0,"f")}[Pe](t){if("string"==typeof t)Yt(this,$t,"f").key[t]=!0;else for(const e of t)Yt(this,$t,"f").key[e]=!0}}const $e=(Me=G,(t=[],e=Me.process.cwd(),n)=>{const s=new Ie(t,e,n,Me);return Object.defineProperty(s,"argv",{get:()=>s.parse(),enumerable:!0}),s.help(),s.version(),s});var Me;const Te=$e;function Ne(t,e){const n=t.startsWith(".")?(0,f.join)(e,t):t;return import(n)}function Le(t,e){const{homepage:n,site:s=n,repository:i}=e,r=s&&s!==i,o=t.getInternalMethods(),a=(c=o.getCommandInstance().handlers,Object.keys(c).some((t=>t&&"$0"!==t)));var c;return 0===o.getUsageInstance().getUsage().length&&(a?t.usage("Usage: $0 <command>"):t.usage("Usage: $0")),a&&t.demandCommand(1,"Won't work without a command"),r&&t.epilogue(`Website: ${s}`),i&&t.epilogue(`Repository: ${i}`),t}var Ge=a(23799);const Fe="git",De="",Re=process.cwd();function We(t){t.command("hooks","Set .githooks as git.hooksPath",{},(()=>{try{(function(){try{return Boolean(Ge.sync("git",["--version"],{cwd:Re}).stdout)}catch{throw new Error("git is not installed")}})()&&function(){try{return"true"===Ge.sync("git",["rev-parse","--is-inside-work-tree"],{cwd:Re}).stdout}catch{throw new Error("not a git repository")}}()&&function(){try{Ge.sync("git",["config","core.hooksPath",".githooks"],{cwd:Re})}catch{throw new Error("setting hooks failed")}}(),console.log("Done: set .githooks")}catch(t){console.error("Fail:",t.message),process.exitCode=1}})),t.demandCommand(1,"Typing `hooks`")}const Ue=t(import.meta.url)("module"),Be=process.cwd();const ze=(0,Ue.createRequire)(import.meta.url);function He(t,e=Be){return t.startsWith(".")?(0,f.resolve)(e,t):(0,f.isAbsolute)(t)?t:ze.resolve(t)}function qe(t){try{return(0,s.statSync)(He(t)),!0}catch{return!1}}function Ve(t,e={}){const n=function(t){try{const e=(0,s.readFileSync)(He(t),"utf8");return JSON.parse(e)}catch{return{}}}("./package.json");if(t){const{[t]:s=e}=n;return s}return n}const Ke=t(import.meta.url)("fs/promises"),Ye={"body-leading-blank":[1,"always"],"body-max-line-length":[2,"always",100],"footer-leading-blank":[1,"always"],"footer-max-line-length":[2,"always",100],"header-max-length":[2,"always",100],"subject-case":[0],"subject-empty":[2,"never"],"subject-full-stop":[2,"never","."],"type-case":[2,"always","lower-case"],"type-empty":[2,"never"],"type-enum":[2,"always",["build","chore","ci","docs","feat","fix","perf","refactor","revert","style","test"]],"scope-case":[0],"body-case":[0],"header-case":[0]};function Xe(){return(0,Ke.readFile)((0,f.resolve)(process.cwd(),".git/COMMIT_EDITMSG"),"utf8")}function Je(t){t.command("commit","Lint git commit message",{},(()=>{(async function(){const t=await Xe(),e=await Promise.all([a.e(402),a.e(824)]).then(a.t.bind(a,69402,19)).then((t=>t.default.default||t.default)),n=await Promise.all([a.e(640),a.e(824)]).then(a.t.bind(a,93794,19)).then((t=>t.default.default||t.default)),s=await e(t,Ye);return{result:s,output:await n({results:[s]})}})().then((({result:t,output:e})=>{t.valid?console.log("Pass."):(console.log("Fail:"),console.log(e),process.exitCode=1)})).catch((t=>{console.error(t),process.exitCode=1}))}))}function Qe({rustywind:t,garou:e,stylelint:n,eslint:s,prettier:i,typescript:r}){const o=process.stdin.isTTY?" --color":"";return function(t){const e=Object.entries(t).map((([t,e])=>[t,e.filter(Boolean)])).filter((([t,e])=>e.length));return e.length>0?Object.fromEntries(e):void 0}({"*.{{wx,tt,q,ax,jx,ks}ml,swan}":[t&&"rustywind --write"],"*.{vue,html,htm,md}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`,s&&`eslint --fix -f=pretty${o}`],"*.{ts,tsx,mts,cts}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,s&&`eslint --fix -f=pretty${o}`,r&&(()=>"tsc --noEmit")],"*.{js,jsx,mjs,cjs,wxs,qs}":[t&&"rustywind --write",e&&"garou",i&&`prettier -w -u${o}`,s&&`eslint --fix -f=pretty${o}`],"*.{c,sc,le,wx,q,tt,jx,ac}ss":[e&&"garou",i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`],"{*.{json,jsonc,webmanifest,editorconfig,yml,yaml,toml},.{babel,npm}rc}":[i&&`prettier -w -u${o}`],"*.svg":[e&&"garou",i&&`prettier --parser html -w -u${o}`,i&&`prettier -w -u${o}`,n&&`stylelint --fix --custom-formatter=node_modules/stylelint-formatter-pretty${o}`],"yarn.lock":[e&&"garou"]})}async function Ze(){const{default:t}=await Promise.all([a.e(640),a.e(841),a.e(824)]).then(a.bind(a,73750));return t({allowEmpty:!0,concurrent:!0,config:Qe(function(){const t=Ve("devDependencies");return{rustywind:"rustywind"in t,garou:"garou"in t,stylelint:"stylelint"in t,eslint:"eslint"in t,prettier:"prettier"in t,typescript:"typescript"in t}}()),cwd:process.cwd(),debug:!1,quiet:!1,relative:!1,shell:!1,stash:!0})}const tn="lint";function en(t){Je(t),function(t){t.command("staged","Lint and format git staged files",{},(()=>{Ze().then((t=>{process.exitCode=t?0:1})).catch((()=>{process.exitCode=1}))}))}(t),t.demandCommand(1,"Typing `commit` or `staged`")}process.on("SIGINT",(()=>{})),new class{constructor(t,e){this.root=e;const{bin:n,homepage:i,name:r="cheetor",repository:{url:o=""}={},version:a}="string"==typeof t?JSON.parse((0,s.readFileSync)(new URL(t,e))):t;this.homepage=i,this.repository=o.includes("github.com")?o.replace(/\.git$/,""):"";const c=Te(process.argv.slice(2)).strict().alias("help","h").alias("version","v").hide("help").version(a).hide("version").detectLocale(!1),l=function(t,e){if("string"==typeof t||!t)return e;const n=Object.keys(t);return 1===n.length&&n[0]}(n,r);l&&c.scriptName(l),this.cli=Promise.resolve(c)}config(t){return this.cli=this.cli.then(t),this}command(...t){return this.cli=this.cli.then((e=>e.command(...t))),this}commandFrom(t){return this.cli=this.cli.then((async e=>{const n=await Ne(t,this.root);return e.command(n)})),this}commandSafe(t){return this.cli=this.cli.then((e=>function(t,e){return Ne(t,e).catch((t=>{if("ERR_MODULE_NOT_FOUND"===t.code&&t.message.endsWith(` imported from ${(0,m.fileURLToPath)(import.meta.url)}`))return!1;throw t}))}(t,this.root).then((t=>t&&t.command?e.command(t):e)))),this}commandSmart(t){return this.cli=this.cli.then((async e=>{const n=t();return n&&n.command?e.command(n):e})),this}website(t){return this.site=t,this}middleware(...t){return this.cli=this.cli.then((e=>e.middleware(...t))),this}setup(t){return this.cli.then((t=>Le(t,this))).then((e=>"function"==typeof t?t(e.parse()):e.parse()))}}("../package.json",import.meta.url).website("https://www.npmjs.com/org/nice-move").command(n).command(e).commandSmart((function(){if(qe("svgo/package.json")&&qe("svgo-config/package.json"))return{command:"svgo",describe:"Run `svgo` to optimize `*.svg`",handler({_:[t,e="./"]}){const n=(0,Ue.createRequire)(import.meta.url);Ge("svgo",["-r","-q","--pretty","--indent","2","--config",n.resolve("svgo-config"),"-f",e]).then((()=>{console.log("Done: calling svgo")})).catch((t=>{process.exitCode=1,console.error("Error:",t.message)}))}}})).setup()})();
|