vaultace-cli
Version:
AI-powered security scanner that detects vulnerabilities in AI-generated code. Proactive scanning, autonomous fixing, and emergency response for modern development teams.
23 lines • 2.15 MB
JavaScript
#!/usr/bin/env node
#!/usr/bin/env node
var wY=Object.create;var f0=Object.defineProperty;var EY=Object.getOwnPropertyDescriptor;var FY=Object.getOwnPropertyNames;var SY=Object.getPrototypeOf,CY=Object.prototype.hasOwnProperty;var X=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),S_=(t,e)=>{for(var r in e)f0(t,r,{get:e[r],enumerable:!0})},C_=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of FY(e))!CY.call(t,n)&&n!==r&&f0(t,n,{get:()=>e[n],enumerable:!(i=EY(e,n))||i.enumerable});return t};var oe=(t,e,r)=>(r=t!=null?wY(SY(t)):{},C_(e||!t||!t.__esModule?f0(r,"default",{value:t,enumerable:!0}):r,t)),A_=t=>C_(f0({},"__esModule",{value:!0}),t);var Sc=m(Y3=>{var m0=class extends Error{constructor(e,r,i){super(i),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=r,this.exitCode=e,this.nestedError=void 0}},K3=class extends m0{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};Y3.CommanderError=m0;Y3.InvalidArgumentError=K3});var h0=m(Q3=>{var{InvalidArgumentError:AY}=Sc(),X3=class{constructor(e,r){switch(this.description=r||"",this.variadic=!1,this.parseArg=void 0,this.defaultValue=void 0,this.defaultValueDescription=void 0,this.argChoices=void 0,e[0]){case"<":this.required=!0,this._name=e.slice(1,-1);break;case"[":this.required=!1,this._name=e.slice(1,-1);break;default:this.required=!0,this._name=e;break}this._name.length>3&&this._name.slice(-3)==="..."&&(this.variadic=!0,this._name=this._name.slice(0,-3))}name(){return this._name}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new AY(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,i):r},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function OY(t){let e=t.name()+(t.variadic===!0?"...":"");return t.required?"<"+e+">":"["+e+"]"}Q3.Argument=X3;Q3.humanReadableArgName=OY});var e8=m(O_=>{var{humanReadableArgName:TY}=h0(),Z3=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1,this.showGlobalOptions=!1}visibleCommands(e){let r=e.commands.filter(i=>!i._hidden);if(e._hasImplicitHelpCommand()){let[,i,n]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),a=e.createCommand(i).helpOption(!1);a.description(e._helpCommandDescription),n&&a.arguments(n),r.push(a)}return this.sortSubcommands&&r.sort((i,n)=>i.name().localeCompare(n.name())),r}compareOptions(e,r){let i=n=>n.short?n.short.replace(/^-/,""):n.long.replace(/^--/,"");return i(e).localeCompare(i(r))}visibleOptions(e){let r=e.options.filter(a=>!a.hidden),i=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),n=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(i||n){let a;i?n?a=e.createOption(e._helpFlags,e._helpDescription):a=e.createOption(e._helpShortFlag,e._helpDescription):a=e.createOption(e._helpLongFlag,e._helpDescription),r.push(a)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleGlobalOptions(e){if(!this.showGlobalOptions)return[];let r=[];for(let i=e.parent;i;i=i.parent){let n=i.options.filter(a=>!a.hidden);r.push(...n)}return this.sortOptions&&r.sort(this.compareOptions),r}visibleArguments(e){return e._argsDescription&&e.registeredArguments.forEach(r=>{r.description=r.description||e._argsDescription[r.name()]||""}),e.registeredArguments.find(r=>r.description)?e.registeredArguments:[]}subcommandTerm(e){let r=e.registeredArguments.map(i=>TY(i)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(r?" "+r:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,r){return r.visibleCommands(e).reduce((i,n)=>Math.max(i,r.subcommandTerm(n).length),0)}longestOptionTermLength(e,r){return r.visibleOptions(e).reduce((i,n)=>Math.max(i,r.optionTerm(n).length),0)}longestGlobalOptionTermLength(e,r){return r.visibleGlobalOptions(e).reduce((i,n)=>Math.max(i,r.optionTerm(n).length),0)}longestArgumentTermLength(e,r){return r.visibleArguments(e).reduce((i,n)=>Math.max(i,r.argumentTerm(n).length),0)}commandUsage(e){let r=e._name;e._aliases[0]&&(r=r+"|"+e._aliases[0]);let i="";for(let n=e.parent;n;n=n.parent)i=n.name()+" "+i;return i+r+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.summary()||e.description()}optionDescription(e){let r=[];return e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&r.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&r.push(`env: ${e.envVar}`),r.length>0?`${e.description} (${r.join(", ")})`:e.description}argumentDescription(e){let r=[];if(e.argChoices&&r.push(`choices: ${e.argChoices.map(i=>JSON.stringify(i)).join(", ")}`),e.defaultValue!==void 0&&r.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),r.length>0){let i=`(${r.join(", ")})`;return e.description?`${e.description} ${i}`:i}return e.description}formatHelp(e,r){let i=r.padWidth(e,r),n=r.helpWidth||80,a=2,s=2;function o(h,g){if(g){let v=`${h.padEnd(i+s)}${g}`;return r.wrap(v,n-a,i+s)}return h}function u(h){return h.join(`
`).replace(/^/gm," ".repeat(a))}let l=[`Usage: ${r.commandUsage(e)}`,""],c=r.commandDescription(e);c.length>0&&(l=l.concat([r.wrap(c,n,0),""]));let p=r.visibleArguments(e).map(h=>o(r.argumentTerm(h),r.argumentDescription(h)));p.length>0&&(l=l.concat(["Arguments:",u(p),""]));let d=r.visibleOptions(e).map(h=>o(r.optionTerm(h),r.optionDescription(h)));if(d.length>0&&(l=l.concat(["Options:",u(d),""])),this.showGlobalOptions){let h=r.visibleGlobalOptions(e).map(g=>o(r.optionTerm(g),r.optionDescription(g)));h.length>0&&(l=l.concat(["Global Options:",u(h),""]))}let f=r.visibleCommands(e).map(h=>o(r.subcommandTerm(h),r.subcommandDescription(h)));return f.length>0&&(l=l.concat(["Commands:",u(f),""])),l.join(`
`)}padWidth(e,r){return Math.max(r.longestOptionTermLength(e,r),r.longestGlobalOptionTermLength(e,r),r.longestSubcommandTermLength(e,r),r.longestArgumentTermLength(e,r))}wrap(e,r,i,n=40){let a=" \\f\\t\\v\xA0\u1680\u2000-\u200A\u202F\u205F\u3000\uFEFF",s=new RegExp(`[\\n][${a}]+`);if(e.match(s))return e;let o=r-i;if(o<n)return e;let u=e.slice(0,i),l=e.slice(i).replace(`\r
`,`
`),c=" ".repeat(i),d="\\s\u200B",f=new RegExp(`
|.{1,${o-1}}([${d}]|$)|[^${d}]+?([${d}]|$)`,"g"),h=l.match(f)||[];return u+h.map((g,v)=>g===`
`?"":(v>0?c:"")+g.trimEnd()).join(`
`)}};O_.Help=Z3});var i8=m(g0=>{var{InvalidArgumentError:kY}=Sc(),t8=class{constructor(e,r){this.flags=e,this.description=r||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let i=T_(e);this.short=i.shortFlag,this.long=i.longFlag,this.negate=!1,this.long&&(this.negate=this.long.startsWith("--no-")),this.defaultValue=void 0,this.defaultValueDescription=void 0,this.presetArg=void 0,this.envVar=void 0,this.parseArg=void 0,this.hidden=!1,this.argChoices=void 0,this.conflictsWith=[],this.implied=void 0}default(e,r){return this.defaultValue=e,this.defaultValueDescription=r,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),this}implies(e){let r=e;return typeof e=="string"&&(r={[e]:!0}),this.implied=Object.assign(this.implied||{},r),this}env(e){return this.envVar=e,this}argParser(e){return this.parseArg=e,this}makeOptionMandatory(e=!0){return this.mandatory=!!e,this}hideHelp(e=!0){return this.hidden=!!e,this}_concatValue(e,r){return r===this.defaultValue||!Array.isArray(r)?[e]:r.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(r,i)=>{if(!this.argChoices.includes(r))throw new kY(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(r,i):r},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return PY(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}},r8=class{constructor(e){this.positiveOptions=new Map,this.negativeOptions=new Map,this.dualOptions=new Set,e.forEach(r=>{r.negate?this.negativeOptions.set(r.attributeName(),r):this.positiveOptions.set(r.attributeName(),r)}),this.negativeOptions.forEach((r,i)=>{this.positiveOptions.has(i)&&this.dualOptions.add(i)})}valueFromOption(e,r){let i=r.attributeName();if(!this.dualOptions.has(i))return!0;let n=this.negativeOptions.get(i).presetArg,a=n!==void 0?n:!1;return r.negate===(a===e)}};function PY(t){return t.split("-").reduce((e,r)=>e+r[0].toUpperCase()+r.slice(1))}function T_(t){let e,r,i=t.split(/[ |,]+/);return i.length>1&&!/^[[<]/.test(i[1])&&(e=i.shift()),r=i.shift(),!e&&/^-[^-]$/.test(r)&&(e=r,r=void 0),{shortFlag:e,longFlag:r}}g0.Option=t8;g0.splitOptionFlags=T_;g0.DualOptions=r8});var P_=m(k_=>{function RY(t,e){if(Math.abs(t.length-e.length)>3)return Math.max(t.length,e.length);let r=[];for(let i=0;i<=t.length;i++)r[i]=[i];for(let i=0;i<=e.length;i++)r[0][i]=i;for(let i=1;i<=e.length;i++)for(let n=1;n<=t.length;n++){let a=1;t[n-1]===e[i-1]?a=0:a=1,r[n][i]=Math.min(r[n-1][i]+1,r[n][i-1]+1,r[n-1][i-1]+a),n>1&&i>1&&t[n-1]===e[i-2]&&t[n-2]===e[i-1]&&(r[n][i]=Math.min(r[n][i],r[n-2][i-2]+1))}return r[t.length][e.length]}function BY(t,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let r=t.startsWith("--");r&&(t=t.slice(2),e=e.map(s=>s.slice(2)));let i=[],n=3,a=.4;return e.forEach(s=>{if(s.length<=1)return;let o=RY(t,s),u=Math.max(t.length,s.length);(u-o)/u>a&&(o<n?(n=o,i=[s]):o===n&&i.push(s))}),i.sort((s,o)=>s.localeCompare(o)),r&&(i=i.map(s=>`--${s}`)),i.length>1?`
(Did you mean one of ${i.join(", ")}?)`:i.length===1?`
(Did you mean ${i[0]}?)`:""}k_.suggestSimilar=BY});var L_=m(N_=>{var qY=require("events").EventEmitter,n8=require("child_process"),En=require("path"),a8=require("fs"),We=require("process"),{Argument:jY,humanReadableArgName:NY}=h0(),{CommanderError:s8}=Sc(),{Help:LY}=e8(),{Option:R_,splitOptionFlags:IY,DualOptions:$Y}=i8(),{suggestSimilar:B_}=P_(),o8=class t extends qY{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this.registeredArguments=[],this._args=this.registeredArguments,this.args=[],this.rawArgs=[],this.processedArgs=[],this._scriptPath=null,this._name=e||"",this._optionValues={},this._optionValueSources={},this._storeOptionsAsProperties=!1,this._actionHandler=null,this._executableHandler=!1,this._executableFile=null,this._executableDir=null,this._defaultCommandName=null,this._exitCallback=null,this._aliases=[],this._combineFlagAndOptionalValue=!0,this._description="",this._summary="",this._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:r=>We.stdout.write(r),writeErr:r=>We.stderr.write(r),getOutHelpWidth:()=>We.stdout.isTTY?We.stdout.columns:void 0,getErrHelpWidth:()=>We.stderr.isTTY?We.stderr.columns:void 0,outputError:(r,i)=>i(r)},this._hidden=!1,this._hasHelpOption=!0,this._helpFlags="-h, --help",this._helpDescription="display help for command",this._helpShortFlag="-h",this._helpLongFlag="--help",this._addImplicitHelpCommand=void 0,this._helpCommandName="help",this._helpCommandnameAndArgs="help [command]",this._helpCommandDescription="display help for command",this._helpConfiguration={}}copyInheritedSettings(e){return this._outputConfiguration=e._outputConfiguration,this._hasHelpOption=e._hasHelpOption,this._helpFlags=e._helpFlags,this._helpDescription=e._helpDescription,this._helpShortFlag=e._helpShortFlag,this._helpLongFlag=e._helpLongFlag,this._helpCommandName=e._helpCommandName,this._helpCommandnameAndArgs=e._helpCommandnameAndArgs,this._helpCommandDescription=e._helpCommandDescription,this._helpConfiguration=e._helpConfiguration,this._exitCallback=e._exitCallback,this._storeOptionsAsProperties=e._storeOptionsAsProperties,this._combineFlagAndOptionalValue=e._combineFlagAndOptionalValue,this._allowExcessArguments=e._allowExcessArguments,this._enablePositionalOptions=e._enablePositionalOptions,this._showHelpAfterError=e._showHelpAfterError,this._showSuggestionAfterError=e._showSuggestionAfterError,this}_getCommandAndAncestors(){let e=[];for(let r=this;r;r=r.parent)e.push(r);return e}command(e,r,i){let n=r,a=i;typeof n=="object"&&n!==null&&(a=n,n=null),a=a||{};let[,s,o]=e.match(/([^ ]+) *(.*)/),u=this.createCommand(s);return n&&(u.description(n),u._executableHandler=!0),a.isDefault&&(this._defaultCommandName=u._name),u._hidden=!!(a.noHelp||a.hidden),u._executableFile=a.executableFile||null,o&&u.arguments(o),this.commands.push(u),u.parent=this,u.copyInheritedSettings(this),n?this:u}createCommand(e){return new t(e)}createHelp(){return Object.assign(new LY,this.configureHelp())}configureHelp(e){return e===void 0?this._helpConfiguration:(this._helpConfiguration=e,this)}configureOutput(e){return e===void 0?this._outputConfiguration:(Object.assign(this._outputConfiguration,e),this)}showHelpAfterError(e=!0){return typeof e!="string"&&(e=!!e),this._showHelpAfterError=e,this}showSuggestionAfterError(e=!0){return this._showSuggestionAfterError=!!e,this}addCommand(e,r){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return r=r||{},r.isDefault&&(this._defaultCommandName=e._name),(r.noHelp||r.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,r){return new jY(e,r)}argument(e,r,i,n){let a=this.createArgument(e,r);return typeof i=="function"?a.default(n).argParser(i):a.default(i),this.addArgument(a),this}arguments(e){return e.trim().split(/ +/).forEach(r=>{this.argument(r)}),this}addArgument(e){let r=this.registeredArguments.slice(-1)[0];if(r&&r.variadic)throw new Error(`only the last argument can be variadic '${r.name()}'`);if(e.required&&e.defaultValue!==void 0&&e.parseArg===void 0)throw new Error(`a default value for a required argument is never used: '${e.name()}'`);return this.registeredArguments.push(e),this}addHelpCommand(e,r){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=r||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,r){let i=["preSubcommand","preAction","postAction"];if(!i.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
Expecting one of '${i.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(r):this._lifeCycleHooks[e]=[r],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=r=>{if(r.code!=="commander.executeSubCommandAsync")throw r},this}_exit(e,r,i){this._exitCallback&&this._exitCallback(new s8(e,r,i)),We.exit(e)}action(e){let r=i=>{let n=this.registeredArguments.length,a=i.slice(0,n);return this._storeOptionsAsProperties?a[n]=this:a[n]=this.opts(),a.push(this),e.apply(this,a)};return this._actionHandler=r,this}createOption(e,r){return new R_(e,r)}_callParseArg(e,r,i,n){try{return e.parseArg(r,i)}catch(a){if(a.code==="commander.invalidArgument"){let s=`${n} ${a.message}`;this.error(s,{exitCode:a.exitCode,code:a.code})}throw a}}addOption(e){let r=e.name(),i=e.attributeName();if(e.negate){let a=e.long.replace(/^--no-/,"--");this._findOption(a)||this.setOptionValueWithSource(i,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(i,e.defaultValue,"default");this.options.push(e);let n=(a,s,o)=>{a==null&&e.presetArg!==void 0&&(a=e.presetArg);let u=this.getOptionValue(i);a!==null&&e.parseArg?a=this._callParseArg(e,a,u,s):a!==null&&e.variadic&&(a=e._concatValue(a,u)),a==null&&(e.negate?a=!1:e.isBoolean()||e.optional?a=!0:a=""),this.setOptionValueWithSource(i,a,o)};return this.on("option:"+r,a=>{let s=`error: option '${e.flags}' argument '${a}' is invalid.`;n(a,s,"cli")}),e.envVar&&this.on("optionEnv:"+r,a=>{let s=`error: option '${e.flags}' value '${a}' from env '${e.envVar}' is invalid.`;n(a,s,"env")}),this}_optionEx(e,r,i,n,a){if(typeof r=="object"&&r instanceof R_)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let s=this.createOption(r,i);if(s.makeOptionMandatory(!!e.mandatory),typeof n=="function")s.default(a).argParser(n);else if(n instanceof RegExp){let o=n;n=(u,l)=>{let c=o.exec(u);return c?c[0]:l},s.default(a).argParser(n)}else s.default(n);return this.addOption(s)}option(e,r,i,n){return this._optionEx({},e,r,i,n)}requiredOption(e,r,i,n){return this._optionEx({mandatory:!0},e,r,i,n)}combineFlagAndOptionalValue(e=!0){return this._combineFlagAndOptionalValue=!!e,this}allowUnknownOption(e=!0){return this._allowUnknownOption=!!e,this}allowExcessArguments(e=!0){return this._allowExcessArguments=!!e,this}enablePositionalOptions(e=!0){return this._enablePositionalOptions=!!e,this}passThroughOptions(e=!0){if(this._passThroughOptions=!!e,this.parent&&e&&!this.parent._enablePositionalOptions)throw new Error("passThroughOptions can not be used without turning on enablePositionalOptions for parent command(s)");return this}storeOptionsAsProperties(e=!0){if(this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this._storeOptionsAsProperties=!!e,this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,r){return this.setOptionValueWithSource(e,r,void 0)}setOptionValueWithSource(e,r,i){return this._storeOptionsAsProperties?this[e]=r:this._optionValues[e]=r,this._optionValueSources[e]=i,this}getOptionValueSource(e){return this._optionValueSources[e]}getOptionValueSourceWithGlobals(e){let r;return this._getCommandAndAncestors().forEach(i=>{i.getOptionValueSource(e)!==void 0&&(r=i.getOptionValueSource(e))}),r}_prepareUserArgs(e,r){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");r=r||{},e===void 0&&(e=We.argv,We.versions&&We.versions.electron&&(r.from="electron")),this.rawArgs=e.slice();let i;switch(r.from){case void 0:case"node":this._scriptPath=e[1],i=e.slice(2);break;case"electron":We.defaultApp?(this._scriptPath=e[1],i=e.slice(2)):i=e.slice(1);break;case"user":i=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${r.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",i}parse(e,r){let i=this._prepareUserArgs(e,r);return this._parseCommand([],i),this}async parseAsync(e,r){let i=this._prepareUserArgs(e,r);return await this._parseCommand([],i),this}_executeSubCommand(e,r){r=r.slice();let i=!1,n=[".js",".ts",".tsx",".mjs",".cjs"];function a(c,p){let d=En.resolve(c,p);if(a8.existsSync(d))return d;if(n.includes(En.extname(p)))return;let f=n.find(h=>a8.existsSync(`${d}${h}`));if(f)return`${d}${f}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let s=e._executableFile||`${this._name}-${e._name}`,o=this._executableDir||"";if(this._scriptPath){let c;try{c=a8.realpathSync(this._scriptPath)}catch{c=this._scriptPath}o=En.resolve(En.dirname(c),o)}if(o){let c=a(o,s);if(!c&&!e._executableFile&&this._scriptPath){let p=En.basename(this._scriptPath,En.extname(this._scriptPath));p!==this._name&&(c=a(o,`${p}-${e._name}`))}s=c||s}i=n.includes(En.extname(s));let u;We.platform!=="win32"?i?(r.unshift(s),r=j_(We.execArgv).concat(r),u=n8.spawn(We.argv[0],r,{stdio:"inherit"})):u=n8.spawn(s,r,{stdio:"inherit"}):(r.unshift(s),r=j_(We.execArgv).concat(r),u=n8.spawn(We.execPath,r,{stdio:"inherit"})),u.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(p=>{We.on(p,()=>{u.killed===!1&&u.exitCode===null&&u.kill(p)})});let l=this._exitCallback;l?u.on("close",()=>{l(new s8(We.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):u.on("close",We.exit.bind(We)),u.on("error",c=>{if(c.code==="ENOENT"){let p=o?`searched for local subcommand relative to directory '${o}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",d=`'${s}' does not exist
- if '${e._name}' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
- ${p}`;throw new Error(d)}else if(c.code==="EACCES")throw new Error(`'${s}' not executable`);if(!l)We.exit(1);else{let p=new s8(1,"commander.executeSubCommandAsync","(error)");p.nestedError=c,l(p)}}),this.runningCommand=u}_dispatchSubcommand(e,r,i){let n=this._findCommand(e);n||this.help({error:!0});let a;return a=this._chainOrCallSubCommandHook(a,n,"preSubcommand"),a=this._chainOrCall(a,()=>{if(n._executableHandler)this._executeSubCommand(n,r.concat(i));else return n._parseCommand(r,i)}),a}_dispatchHelpCommand(e){e||this.help();let r=this._findCommand(e);return r&&!r._executableHandler&&r.help(),this._dispatchSubcommand(e,[],[this._helpLongFlag||this._helpShortFlag])}_checkNumberOfArguments(){this.registeredArguments.forEach((e,r)=>{e.required&&this.args[r]==null&&this.missingArgument(e.name())}),!(this.registeredArguments.length>0&&this.registeredArguments[this.registeredArguments.length-1].variadic)&&this.args.length>this.registeredArguments.length&&this._excessArguments(this.args)}_processArguments(){let e=(i,n,a)=>{let s=n;if(n!==null&&i.parseArg){let o=`error: command-argument value '${n}' is invalid for argument '${i.name()}'.`;s=this._callParseArg(i,n,a,o)}return s};this._checkNumberOfArguments();let r=[];this.registeredArguments.forEach((i,n)=>{let a=i.defaultValue;i.variadic?n<this.args.length?(a=this.args.slice(n),i.parseArg&&(a=a.reduce((s,o)=>e(i,o,s),i.defaultValue))):a===void 0&&(a=[]):n<this.args.length&&(a=this.args[n],i.parseArg&&(a=e(i,a,i.defaultValue))),r[n]=a}),this.processedArgs=r}_chainOrCall(e,r){return e&&e.then&&typeof e.then=="function"?e.then(()=>r()):r()}_chainOrCallHooks(e,r){let i=e,n=[];return this._getCommandAndAncestors().reverse().filter(a=>a._lifeCycleHooks[r]!==void 0).forEach(a=>{a._lifeCycleHooks[r].forEach(s=>{n.push({hookedCommand:a,callback:s})})}),r==="postAction"&&n.reverse(),n.forEach(a=>{i=this._chainOrCall(i,()=>a.callback(a.hookedCommand,this))}),i}_chainOrCallSubCommandHook(e,r,i){let n=e;return this._lifeCycleHooks[i]!==void 0&&this._lifeCycleHooks[i].forEach(a=>{n=this._chainOrCall(n,()=>a(this,r))}),n}_parseCommand(e,r){let i=this.parseOptions(r);if(this._parseOptionsEnv(),this._parseOptionsImplied(),e=e.concat(i.operands),r=i.unknown,this.args=e.concat(r),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),r);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return this._dispatchHelpCommand(e[1]);if(this._defaultCommandName)return q_(this,r),this._dispatchSubcommand(this._defaultCommandName,e,r);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),q_(this,i.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let n=()=>{i.unknown.length>0&&this.unknownOption(i.unknown[0])},a=`command:${this.name()}`;if(this._actionHandler){n(),this._processArguments();let s;return s=this._chainOrCallHooks(s,"preAction"),s=this._chainOrCall(s,()=>this._actionHandler(this.processedArgs)),this.parent&&(s=this._chainOrCall(s,()=>{this.parent.emit(a,e,r)})),s=this._chainOrCallHooks(s,"postAction"),s}if(this.parent&&this.parent.listenerCount(a))n(),this._processArguments(),this.parent.emit(a,e,r);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,r);this.listenerCount("command:*")?this.emit("command:*",e,r):this.commands.length?this.unknownCommand():(n(),this._processArguments())}else this.commands.length?(n(),this.help({error:!0})):(n(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(r=>r._name===e||r._aliases.includes(e))}_findOption(e){return this.options.find(r=>r.is(e))}_checkForMissingMandatoryOptions(){this._getCommandAndAncestors().forEach(e=>{e.options.forEach(r=>{r.mandatory&&e.getOptionValue(r.attributeName())===void 0&&e.missingMandatoryOptionValue(r)})})}_checkForConflictingLocalOptions(){let e=this.options.filter(i=>{let n=i.attributeName();return this.getOptionValue(n)===void 0?!1:this.getOptionValueSource(n)!=="default"});e.filter(i=>i.conflictsWith.length>0).forEach(i=>{let n=e.find(a=>i.conflictsWith.includes(a.attributeName()));n&&this._conflictingOption(i,n)})}_checkForConflictingOptions(){this._getCommandAndAncestors().forEach(e=>{e._checkForConflictingLocalOptions()})}parseOptions(e){let r=[],i=[],n=r,a=e.slice();function s(u){return u.length>1&&u[0]==="-"}let o=null;for(;a.length;){let u=a.shift();if(u==="--"){n===i&&n.push(u),n.push(...a);break}if(o&&!s(u)){this.emit(`option:${o.name()}`,u);continue}if(o=null,s(u)){let l=this._findOption(u);if(l){if(l.required){let c=a.shift();c===void 0&&this.optionMissingArgument(l),this.emit(`option:${l.name()}`,c)}else if(l.optional){let c=null;a.length>0&&!s(a[0])&&(c=a.shift()),this.emit(`option:${l.name()}`,c)}else this.emit(`option:${l.name()}`);o=l.variadic?l:null;continue}}if(u.length>2&&u[0]==="-"&&u[1]!=="-"){let l=this._findOption(`-${u[1]}`);if(l){l.required||l.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${l.name()}`,u.slice(2)):(this.emit(`option:${l.name()}`),a.unshift(`-${u.slice(2)}`));continue}}if(/^--[^=]+=/.test(u)){let l=u.indexOf("="),c=this._findOption(u.slice(0,l));if(c&&(c.required||c.optional)){this.emit(`option:${c.name()}`,u.slice(l+1));continue}}if(s(u)&&(n=i),(this._enablePositionalOptions||this._passThroughOptions)&&r.length===0&&i.length===0){if(this._findCommand(u)){r.push(u),a.length>0&&i.push(...a);break}else if(u===this._helpCommandName&&this._hasImplicitHelpCommand()){r.push(u),a.length>0&&r.push(...a);break}else if(this._defaultCommandName){i.push(u),a.length>0&&i.push(...a);break}}if(this._passThroughOptions){n.push(u),a.length>0&&n.push(...a);break}n.push(u)}return{operands:r,unknown:i}}opts(){if(this._storeOptionsAsProperties){let e={},r=this.options.length;for(let i=0;i<r;i++){let n=this.options[i].attributeName();e[n]=n===this._versionOptionName?this._version:this[n]}return e}return this._optionValues}optsWithGlobals(){return this._getCommandAndAncestors().reduce((e,r)=>Object.assign(e,r.opts()),{})}error(e,r){this._outputConfiguration.outputError(`${e}
`,this._outputConfiguration.writeErr),typeof this._showHelpAfterError=="string"?this._outputConfiguration.writeErr(`${this._showHelpAfterError}
`):this._showHelpAfterError&&(this._outputConfiguration.writeErr(`
`),this.outputHelp({error:!0}));let i=r||{},n=i.exitCode||1,a=i.code||"commander.error";this._exit(n,a,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in We.env){let r=e.attributeName();(this.getOptionValue(r)===void 0||["default","config","env"].includes(this.getOptionValueSource(r)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,We.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}_parseOptionsImplied(){let e=new $Y(this.options),r=i=>this.getOptionValue(i)!==void 0&&!["default","implied"].includes(this.getOptionValueSource(i));this.options.filter(i=>i.implied!==void 0&&r(i.attributeName())&&e.valueFromOption(this.getOptionValue(i.attributeName()),i)).forEach(i=>{Object.keys(i.implied).filter(n=>!r(n)).forEach(n=>{this.setOptionValueWithSource(n,i.implied[n],"implied")})})}missingArgument(e){let r=`error: missing required argument '${e}'`;this.error(r,{code:"commander.missingArgument"})}optionMissingArgument(e){let r=`error: option '${e.flags}' argument missing`;this.error(r,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let r=`error: required option '${e.flags}' not specified`;this.error(r,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,r){let i=s=>{let o=s.attributeName(),u=this.getOptionValue(o),l=this.options.find(p=>p.negate&&o===p.attributeName()),c=this.options.find(p=>!p.negate&&o===p.attributeName());return l&&(l.presetArg===void 0&&u===!1||l.presetArg!==void 0&&u===l.presetArg)?l:c||s},n=s=>{let o=i(s),u=o.attributeName();return this.getOptionValueSource(u)==="env"?`environment variable '${o.envVar}'`:`option '${o.flags}'`},a=`error: ${n(e)} cannot be used with ${n(r)}`;this.error(a,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let r="";if(e.startsWith("--")&&this._showSuggestionAfterError){let n=[],a=this;do{let s=a.createHelp().visibleOptions(a).filter(o=>o.long).map(o=>o.long);n=n.concat(s),a=a.parent}while(a&&!a._enablePositionalOptions);r=B_(e,n)}let i=`error: unknown option '${e}'${r}`;this.error(i,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let r=this.registeredArguments.length,i=r===1?"":"s",a=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${r} argument${i} but got ${e.length}.`;this.error(a,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],r="";if(this._showSuggestionAfterError){let n=[];this.createHelp().visibleCommands(this).forEach(a=>{n.push(a.name()),a.alias()&&n.push(a.alias())}),r=B_(e,n)}let i=`error: unknown command '${e}'${r}`;this.error(i,{code:"commander.unknownCommand"})}version(e,r,i){if(e===void 0)return this._version;this._version=e,r=r||"-V, --version",i=i||"output the version number";let n=this.createOption(r,i);return this._versionOptionName=n.attributeName(),this.options.push(n),this.on("option:"+n.name(),()=>{this._outputConfiguration.writeOut(`${e}
`),this._exit(0,"commander.version",e)}),this}description(e,r){return e===void 0&&r===void 0?this._description:(this._description=e,r&&(this._argsDescription=r),this)}summary(e){return e===void 0?this._summary:(this._summary=e,this)}alias(e){if(e===void 0)return this._aliases[0];let r=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(r=this.commands[this.commands.length-1]),e===r._name)throw new Error("Command alias can't be the same as its name");return r._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(r=>this.alias(r)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let r=this.registeredArguments.map(i=>NY(i));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this.registeredArguments.length?r:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=En.basename(e,En.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let r=this.createHelp();return r.helpWidth===void 0&&(r.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),r.formatHelp(this,r)}_getHelpContext(e){e=e||{};let r={error:!!e.error},i;return r.error?i=n=>this._outputConfiguration.writeErr(n):i=n=>this._outputConfiguration.writeOut(n),r.write=e.write||i,r.command=this,r}outputHelp(e){let r;typeof e=="function"&&(r=e,e=void 0);let i=this._getHelpContext(e);this._getCommandAndAncestors().reverse().forEach(a=>a.emit("beforeAllHelp",i)),this.emit("beforeHelp",i);let n=this.helpInformation(i);if(r&&(n=r(n),typeof n!="string"&&!Buffer.isBuffer(n)))throw new Error("outputHelp callback must return a string or a Buffer");i.write(n),this._helpLongFlag&&this.emit(this._helpLongFlag),this.emit("afterHelp",i),this._getCommandAndAncestors().forEach(a=>a.emit("afterAllHelp",i))}helpOption(e,r){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=r||this._helpDescription;let i=IY(this._helpFlags);return this._helpShortFlag=i.shortFlag,this._helpLongFlag=i.longFlag,this}help(e){this.outputHelp(e);let r=We.exitCode||0;r===0&&e&&typeof e!="function"&&e.error&&(r=1),this._exit(r,"commander.help","(outputHelp)")}addHelpText(e,r){let i=["beforeAll","before","after","afterAll"];if(!i.includes(e))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${i.join("', '")}'`);let n=`${e}Help`;return this.on(n,a=>{let s;typeof r=="function"?s=r({error:a.error,command:a.command}):s=r,s&&a.write(`${s}
`)}),this}};function q_(t,e){t._hasHelpOption&&e.find(i=>i===t._helpLongFlag||i===t._helpShortFlag)&&(t.outputHelp(),t._exit(0,"commander.helpDisplayed","(outputHelp)"))}function j_(t){return t.map(e=>{if(!e.startsWith("--inspect"))return e;let r,i="127.0.0.1",n="9229",a;return(a=e.match(/^(--inspect(-brk)?)$/))!==null?r=a[1]:(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(r=a[1],/^\d+$/.test(a[3])?n=a[3]:i=a[3]):(a=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(r=a[1],i=a[3],n=a[4]),r&&n!=="0"?`${r}=${i}:${parseInt(n)+1}`:e})}N_.Command=o8});var ze=m((Ei,M_)=>{var{Argument:MY}=h0(),{Command:I_}=L_(),{CommanderError:UY,InvalidArgumentError:$_}=Sc(),{Help:VY}=e8(),{Option:WY}=i8();Ei=M_.exports=new I_;Ei.program=Ei;Ei.Command=I_;Ei.Option=WY;Ei.Argument=MY;Ei.Help=VY;Ei.CommanderError=UY;Ei.InvalidArgumentError=$_;Ei.InvalidOptionArgumentError=$_});var V_=m((zRe,U_)=>{"use strict";U_.exports={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]}});var u8=m((GRe,z_)=>{var Cc=V_(),W_={};for(let t of Object.keys(Cc))W_[Cc[t]]=t;var H={rgb:{channels:3,labels:"rgb"},hsl:{channels:3,labels:"hsl"},hsv:{channels:3,labels:"hsv"},hwb:{channels:3,labels:"hwb"},cmyk:{channels:4,labels:"cmyk"},xyz:{channels:3,labels:"xyz"},lab:{channels:3,labels:"lab"},lch:{channels:3,labels:"lch"},hex:{channels:1,labels:["hex"]},keyword:{channels:1,labels:["keyword"]},ansi16:{channels:1,labels:["ansi16"]},ansi256:{channels:1,labels:["ansi256"]},hcg:{channels:3,labels:["h","c","g"]},apple:{channels:3,labels:["r16","g16","b16"]},gray:{channels:1,labels:["gray"]}};z_.exports=H;for(let t of Object.keys(H)){if(!("channels"in H[t]))throw new Error("missing channels property: "+t);if(!("labels"in H[t]))throw new Error("missing channel labels property: "+t);if(H[t].labels.length!==H[t].channels)throw new Error("channel and label counts mismatch: "+t);let{channels:e,labels:r}=H[t];delete H[t].channels,delete H[t].labels,Object.defineProperty(H[t],"channels",{value:e}),Object.defineProperty(H[t],"labels",{value:r})}H.rgb.hsl=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(e,r,i),a=Math.max(e,r,i),s=a-n,o,u;a===n?o=0:e===a?o=(r-i)/s:r===a?o=2+(i-e)/s:i===a&&(o=4+(e-r)/s),o=Math.min(o*60,360),o<0&&(o+=360);let l=(n+a)/2;return a===n?u=0:l<=.5?u=s/(a+n):u=s/(2-a-n),[o,u*100,l*100]};H.rgb.hsv=function(t){let e,r,i,n,a,s=t[0]/255,o=t[1]/255,u=t[2]/255,l=Math.max(s,o,u),c=l-Math.min(s,o,u),p=function(d){return(l-d)/6/c+1/2};return c===0?(n=0,a=0):(a=c/l,e=p(s),r=p(o),i=p(u),s===l?n=i-r:o===l?n=1/3+e-i:u===l&&(n=2/3+r-e),n<0?n+=1:n>1&&(n-=1)),[n*360,a*100,l*100]};H.rgb.hwb=function(t){let e=t[0],r=t[1],i=t[2],n=H.rgb.hsl(t)[0],a=1/255*Math.min(e,Math.min(r,i));return i=1-1/255*Math.max(e,Math.max(r,i)),[n,a*100,i*100]};H.rgb.cmyk=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.min(1-e,1-r,1-i),a=(1-e-n)/(1-n)||0,s=(1-r-n)/(1-n)||0,o=(1-i-n)/(1-n)||0;return[a*100,s*100,o*100,n*100]};function zY(t,e){return(t[0]-e[0])**2+(t[1]-e[1])**2+(t[2]-e[2])**2}H.rgb.keyword=function(t){let e=W_[t];if(e)return e;let r=1/0,i;for(let n of Object.keys(Cc)){let a=Cc[n],s=zY(t,a);s<r&&(r=s,i=n)}return i};H.keyword.rgb=function(t){return Cc[t]};H.rgb.xyz=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,r=r>.04045?((r+.055)/1.055)**2.4:r/12.92,i=i>.04045?((i+.055)/1.055)**2.4:i/12.92;let n=e*.4124+r*.3576+i*.1805,a=e*.2126+r*.7152+i*.0722,s=e*.0193+r*.1192+i*.9505;return[n*100,a*100,s*100]};H.rgb.lab=function(t){let e=H.rgb.xyz(t),r=e[0],i=e[1],n=e[2];r/=95.047,i/=100,n/=108.883,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116,n=n>.008856?n**(1/3):7.787*n+16/116;let a=116*i-16,s=500*(r-i),o=200*(i-n);return[a,s,o]};H.hsl.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n,a,s;if(r===0)return s=i*255,[s,s,s];i<.5?n=i*(1+r):n=i+r-i*r;let o=2*i-n,u=[0,0,0];for(let l=0;l<3;l++)a=e+1/3*-(l-1),a<0&&a++,a>1&&a--,6*a<1?s=o+(n-o)*6*a:2*a<1?s=n:3*a<2?s=o+(n-o)*(2/3-a)*6:s=o,u[l]=s*255;return u};H.hsl.hsv=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=r,a=Math.max(i,.01);i*=2,r*=i<=1?i:2-i,n*=a<=1?a:2-a;let s=(i+r)/2,o=i===0?2*n/(a+n):2*r/(i+r);return[e,o*100,s*100]};H.hsv.rgb=function(t){let e=t[0]/60,r=t[1]/100,i=t[2]/100,n=Math.floor(e)%6,a=e-Math.floor(e),s=255*i*(1-r),o=255*i*(1-r*a),u=255*i*(1-r*(1-a));switch(i*=255,n){case 0:return[i,u,s];case 1:return[o,i,s];case 2:return[s,i,u];case 3:return[s,o,i];case 4:return[u,s,i];case 5:return[i,s,o]}};H.hsv.hsl=function(t){let e=t[0],r=t[1]/100,i=t[2]/100,n=Math.max(i,.01),a,s;s=(2-r)*i;let o=(2-r)*n;return a=r*n,a/=o<=1?o:2-o,a=a||0,s/=2,[e,a*100,s*100]};H.hwb.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100,n=r+i,a;n>1&&(r/=n,i/=n);let s=Math.floor(6*e),o=1-i;a=6*e-s,(s&1)!==0&&(a=1-a);let u=r+a*(o-r),l,c,p;switch(s){default:case 6:case 0:l=o,c=u,p=r;break;case 1:l=u,c=o,p=r;break;case 2:l=r,c=o,p=u;break;case 3:l=r,c=u,p=o;break;case 4:l=u,c=r,p=o;break;case 5:l=o,c=r,p=u;break}return[l*255,c*255,p*255]};H.cmyk.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n=t[3]/100,a=1-Math.min(1,e*(1-n)+n),s=1-Math.min(1,r*(1-n)+n),o=1-Math.min(1,i*(1-n)+n);return[a*255,s*255,o*255]};H.xyz.rgb=function(t){let e=t[0]/100,r=t[1]/100,i=t[2]/100,n,a,s;return n=e*3.2406+r*-1.5372+i*-.4986,a=e*-.9689+r*1.8758+i*.0415,s=e*.0557+r*-.204+i*1.057,n=n>.0031308?1.055*n**(1/2.4)-.055:n*12.92,a=a>.0031308?1.055*a**(1/2.4)-.055:a*12.92,s=s>.0031308?1.055*s**(1/2.4)-.055:s*12.92,n=Math.min(Math.max(0,n),1),a=Math.min(Math.max(0,a),1),s=Math.min(Math.max(0,s),1),[n*255,a*255,s*255]};H.xyz.lab=function(t){let e=t[0],r=t[1],i=t[2];e/=95.047,r/=100,i/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,r=r>.008856?r**(1/3):7.787*r+16/116,i=i>.008856?i**(1/3):7.787*i+16/116;let n=116*r-16,a=500*(e-r),s=200*(r-i);return[n,a,s]};H.lab.xyz=function(t){let e=t[0],r=t[1],i=t[2],n,a,s;a=(e+16)/116,n=r/500+a,s=a-i/200;let o=a**3,u=n**3,l=s**3;return a=o>.008856?o:(a-16/116)/7.787,n=u>.008856?u:(n-16/116)/7.787,s=l>.008856?l:(s-16/116)/7.787,n*=95.047,a*=100,s*=108.883,[n,a,s]};H.lab.lch=function(t){let e=t[0],r=t[1],i=t[2],n;n=Math.atan2(i,r)*360/2/Math.PI,n<0&&(n+=360);let s=Math.sqrt(r*r+i*i);return[e,s,n]};H.lch.lab=function(t){let e=t[0],r=t[1],n=t[2]/360*2*Math.PI,a=r*Math.cos(n),s=r*Math.sin(n);return[e,a,s]};H.rgb.ansi16=function(t,e=null){let[r,i,n]=t,a=e===null?H.rgb.hsv(t)[2]:e;if(a=Math.round(a/50),a===0)return 30;let s=30+(Math.round(n/255)<<2|Math.round(i/255)<<1|Math.round(r/255));return a===2&&(s+=60),s};H.hsv.ansi16=function(t){return H.rgb.ansi16(H.hsv.rgb(t),t[2])};H.rgb.ansi256=function(t){let e=t[0],r=t[1],i=t[2];return e===r&&r===i?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(r/255*5)+Math.round(i/255*5)};H.ansi16.rgb=function(t){let e=t%10;if(e===0||e===7)return t>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let r=(~~(t>50)+1)*.5,i=(e&1)*r*255,n=(e>>1&1)*r*255,a=(e>>2&1)*r*255;return[i,n,a]};H.ansi256.rgb=function(t){if(t>=232){let a=(t-232)*10+8;return[a,a,a]}t-=16;let e,r=Math.floor(t/36)/5*255,i=Math.floor((e=t%36)/6)/5*255,n=e%6/5*255;return[r,i,n]};H.rgb.hex=function(t){let r=(((Math.round(t[0])&255)<<16)+((Math.round(t[1])&255)<<8)+(Math.round(t[2])&255)).toString(16).toUpperCase();return"000000".substring(r.length)+r};H.hex.rgb=function(t){let e=t.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let r=e[0];e[0].length===3&&(r=r.split("").map(o=>o+o).join(""));let i=parseInt(r,16),n=i>>16&255,a=i>>8&255,s=i&255;return[n,a,s]};H.rgb.hcg=function(t){let e=t[0]/255,r=t[1]/255,i=t[2]/255,n=Math.max(Math.max(e,r),i),a=Math.min(Math.min(e,r),i),s=n-a,o,u;return s<1?o=a/(1-s):o=0,s<=0?u=0:n===e?u=(r-i)/s%6:n===r?u=2+(i-e)/s:u=4+(e-r)/s,u/=6,u%=1,[u*360,s*100,o*100]};H.hsl.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=r<.5?2*e*r:2*e*(1-r),n=0;return i<1&&(n=(r-.5*i)/(1-i)),[t[0],i*100,n*100]};H.hsv.hcg=function(t){let e=t[1]/100,r=t[2]/100,i=e*r,n=0;return i<1&&(n=(r-i)/(1-i)),[t[0],i*100,n*100]};H.hcg.rgb=function(t){let e=t[0]/360,r=t[1]/100,i=t[2]/100;if(r===0)return[i*255,i*255,i*255];let n=[0,0,0],a=e%1*6,s=a%1,o=1-s,u=0;switch(Math.floor(a)){case 0:n[0]=1,n[1]=s,n[2]=0;break;case 1:n[0]=o,n[1]=1,n[2]=0;break;case 2:n[0]=0,n[1]=1,n[2]=s;break;case 3:n[0]=0,n[1]=o,n[2]=1;break;case 4:n[0]=s,n[1]=0,n[2]=1;break;default:n[0]=1,n[1]=0,n[2]=o}return u=(1-r)*i,[(r*n[0]+u)*255,(r*n[1]+u)*255,(r*n[2]+u)*255]};H.hcg.hsv=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e),n=0;return i>0&&(n=e/i),[t[0],n*100,i*100]};H.hcg.hsl=function(t){let e=t[1]/100,i=t[2]/100*(1-e)+.5*e,n=0;return i>0&&i<.5?n=e/(2*i):i>=.5&&i<1&&(n=e/(2*(1-i))),[t[0],n*100,i*100]};H.hcg.hwb=function(t){let e=t[1]/100,r=t[2]/100,i=e+r*(1-e);return[t[0],(i-e)*100,(1-i)*100]};H.hwb.hcg=function(t){let e=t[1]/100,i=1-t[2]/100,n=i-e,a=0;return n<1&&(a=(i-n)/(1-n)),[t[0],n*100,a*100]};H.apple.rgb=function(t){return[t[0]/65535*255,t[1]/65535*255,t[2]/65535*255]};H.rgb.apple=function(t){return[t[0]/255*65535,t[1]/255*65535,t[2]/255*65535]};H.gray.rgb=function(t){return[t[0]/100*255,t[0]/100*255,t[0]/100*255]};H.gray.hsl=function(t){return[0,0,t[0]]};H.gray.hsv=H.gray.hsl;H.gray.hwb=function(t){return[0,100,t[0]]};H.gray.cmyk=function(t){return[0,0,0,t[0]]};H.gray.lab=function(t){return[t[0],0,0]};H.gray.hex=function(t){let e=Math.round(t[0]/100*255)&255,i=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(i.length)+i};H.rgb.gray=function(t){return[(t[0]+t[1]+t[2])/3/255*100]}});var H_=m((HRe,G_)=>{var v0=u8();function GY(){let t={},e=Object.keys(v0);for(let r=e.length,i=0;i<r;i++)t[e[i]]={distance:-1,parent:null};return t}function HY(t){let e=GY(),r=[t];for(e[t].distance=0;r.length;){let i=r.pop(),n=Object.keys(v0[i]);for(let a=n.length,s=0;s<a;s++){let o=n[s],u=e[o];u.distance===-1&&(u.distance=e[i].distance+1,u.parent=i,r.unshift(o))}}return e}function JY(t,e){return function(r){return e(t(r))}}function KY(t,e){let r=[e[t].parent,t],i=v0[e[t].parent][t],n=e[t].parent;for(;e[n].parent;)r.unshift(e[n].parent),i=JY(v0[e[n].parent][n],i),n=e[n].parent;return i.conversion=r,i}G_.exports=function(t){let e=HY(t),r={},i=Object.keys(e);for(let n=i.length,a=0;a<n;a++){let s=i[a];e[s].parent!==null&&(r[s]=KY(s,e))}return r}});var x0=m((JRe,J_)=>{var l8=u8(),YY=H_(),Zo={},XY=Object.keys(l8);function QY(t){let e=function(...r){let i=r[0];return i==null?i:(i.length>1&&(r=i),t(r))};return"conversion"in t&&(e.conversion=t.conversion),e}function ZY(t){let e=function(...r){let i=r[0];if(i==null)return i;i.length>1&&(r=i);let n=t(r);if(typeof n=="object")for(let a=n.length,s=0;s<a;s++)n[s]=Math.round(n[s]);return n};return"conversion"in t&&(e.conversion=t.conversion),e}XY.forEach(t=>{Zo[t]={},Object.defineProperty(Zo[t],"channels",{value:l8[t].channels}),Object.defineProperty(Zo[t],"labels",{value:l8[t].labels});let e=YY(t);Object.keys(e).forEach(i=>{let n=e[i];Zo[t][i]=ZY(n),Zo[t][i].raw=QY(n)})});J_.exports=Zo});var ew=m((KRe,Z_)=>{"use strict";var K_=(t,e)=>(...r)=>`\x1B[${t(...r)+e}m`,Y_=(t,e)=>(...r)=>{let i=t(...r);return`\x1B[${38+e};5;${i}m`},X_=(t,e)=>(...r)=>{let i=t(...r);return`\x1B[${38+e};2;${i[0]};${i[1]};${i[2]}m`},y0=t=>t,Q_=(t,e,r)=>[t,e,r],eu=(t,e,r)=>{Object.defineProperty(t,e,{get:()=>{let i=r();return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0}),i},enumerable:!0,configurable:!0})},c8,tu=(t,e,r,i)=>{c8===void 0&&(c8=x0());let n=i?10:0,a={};for(let[s,o]of Object.entries(c8)){let u=s==="ansi16"?"ansi":s;s===e?a[u]=t(r,n):typeof o=="object"&&(a[u]=t(o[e],n))}return a};function eX(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,i]of Object.entries(e)){for(let[n,a]of Object.entries(i))e[n]={open:`\x1B[${a[0]}m`,close:`\x1B[${a[1]}m`},i[n]=e[n],t.set(a[0],a[1]);Object.defineProperty(e,r,{value:i,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",eu(e.color,"ansi",()=>tu(K_,"ansi16",y0,!1)),eu(e.color,"ansi256",()=>tu(Y_,"ansi256",y0,!1)),eu(e.color,"ansi16m",()=>tu(X_,"rgb",Q_,!1)),eu(e.bgColor,"ansi",()=>tu(K_,"ansi16",y0,!0)),eu(e.bgColor,"ansi256",()=>tu(Y_,"ansi256",y0,!0)),eu(e.bgColor,"ansi16m",()=>tu(X_,"rgb",Q_,!0)),e}Object.defineProperty(Z_,"exports",{enumerable:!0,get:eX})});var rw=m((YRe,tw)=>{"use strict";tw.exports=(t,e=process.argv)=>{let r=t.startsWith("-")?"":t.length===1?"-":"--",i=e.indexOf(r+t),n=e.indexOf("--");return i!==-1&&(n===-1||i<n)}});var f8=m((XRe,nw)=>{"use strict";var tX=require("os"),iw=require("tty"),Qr=rw(),{env:wt}=process,fa;Qr("no-color")||Qr("no-colors")||Qr("color=false")||Qr("color=never")?fa=0:(Qr("color")||Qr("colors")||Qr("color=true")||Qr("color=always"))&&(fa=1);"FORCE_COLOR"in wt&&(wt.FORCE_