codesee
Version:
CodeSee instrumentation and analysis to support developers with continuous code understanding
22 lines • 1.26 MB
JavaScript
"use strict";var ly=Object.create;var Y4=Object.defineProperty;var ty=Object.getOwnPropertyDescriptor;var ry=Object.getOwnPropertyNames;var uy=Object.getPrototypeOf,iy=Object.prototype.hasOwnProperty;var Q2=(n,e)=>()=>(n&&(e=n(n=0)),e);var R=(n,e)=>()=>(e||n((e={exports:{}}).exports,e),e.exports),jl=(n,e)=>{for(var l in e)Y4(n,l,{get:e[l],enumerable:!0})},t9=(n,e,l,t)=>{if(e&&typeof e=="object"||typeof e=="function")for(let r of ry(e))!iy.call(n,r)&&r!==l&&Y4(n,r,{get:()=>e[r],enumerable:!(t=ty(e,r))||t.enumerable});return n};var r2=(n,e,l)=>(l=n!=null?ly(uy(n)):{},t9(e||!n||!n.__esModule?Y4(l,"default",{value:n,enumerable:!0}):l,n)),Ue=n=>t9(Y4({},"__esModule",{value:!0}),n);var kt=R(q0=>{"use strict";var Q4=class extends Error{constructor(e,l,t){super(t),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name,this.code=l,this.exitCode=e,this.nestedError=void 0}},$0=class extends Q4{constructor(e){super(1,"commander.invalidArgument",e),Error.captureStackTrace(this,this.constructor),this.name=this.constructor.name}};q0.CommanderError=Q4;q0.InvalidArgumentError=$0});var Z4=R(W0=>{"use strict";var{InvalidArgumentError:sy}=kt(),V0=class{constructor(e,l){switch(this.description=l||"",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,l){return l===this.defaultValue||!Array.isArray(l)?[e]:l.concat(e)}default(e,l){return this.defaultValue=e,this.defaultValueDescription=l,this}argParser(e){return this.parseArg=e,this}choices(e){return this.argChoices=e.slice(),this.parseArg=(l,t)=>{if(!this.argChoices.includes(l))throw new sy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(l,t):l},this}argRequired(){return this.required=!0,this}argOptional(){return this.required=!1,this}};function oy(n){let e=n.name()+(n.variadic===!0?"...":"");return n.required?"<"+e+">":"["+e+"]"}W0.Argument=V0;W0.humanReadableArgName=oy});var X0=R(r9=>{"use strict";var{humanReadableArgName:ay}=Z4(),K0=class{constructor(){this.helpWidth=void 0,this.sortSubcommands=!1,this.sortOptions=!1}visibleCommands(e){let l=e.commands.filter(t=>!t._hidden);if(e._hasImplicitHelpCommand()){let[,t,r]=e._helpCommandnameAndArgs.match(/([^ ]+) *(.*)/),u=e.createCommand(t).helpOption(!1);u.description(e._helpCommandDescription),r&&u.arguments(r),l.push(u)}return this.sortSubcommands&&l.sort((t,r)=>t.name().localeCompare(r.name())),l}visibleOptions(e){let l=e.options.filter(u=>!u.hidden),t=e._hasHelpOption&&e._helpShortFlag&&!e._findOption(e._helpShortFlag),r=e._hasHelpOption&&!e._findOption(e._helpLongFlag);if(t||r){let u;t?r?u=e.createOption(e._helpFlags,e._helpDescription):u=e.createOption(e._helpShortFlag,e._helpDescription):u=e.createOption(e._helpLongFlag,e._helpDescription),l.push(u)}if(this.sortOptions){let u=i=>i.short?i.short.replace(/^-/,""):i.long.replace(/^--/,"");l.sort((i,s)=>u(i).localeCompare(u(s)))}return l}visibleArguments(e){return e._argsDescription&&e._args.forEach(l=>{l.description=l.description||e._argsDescription[l.name()]||""}),e._args.find(l=>l.description)?e._args:[]}subcommandTerm(e){let l=e._args.map(t=>ay(t)).join(" ");return e._name+(e._aliases[0]?"|"+e._aliases[0]:"")+(e.options.length?" [options]":"")+(l?" "+l:"")}optionTerm(e){return e.flags}argumentTerm(e){return e.name()}longestSubcommandTermLength(e,l){return l.visibleCommands(e).reduce((t,r)=>Math.max(t,l.subcommandTerm(r).length),0)}longestOptionTermLength(e,l){return l.visibleOptions(e).reduce((t,r)=>Math.max(t,l.optionTerm(r).length),0)}longestArgumentTermLength(e,l){return l.visibleArguments(e).reduce((t,r)=>Math.max(t,l.argumentTerm(r).length),0)}commandUsage(e){let l=e._name;e._aliases[0]&&(l=l+"|"+e._aliases[0]);let t="";for(let r=e.parent;r;r=r.parent)t=r.name()+" "+t;return t+l+" "+e.usage()}commandDescription(e){return e.description()}subcommandDescription(e){return e.description()}optionDescription(e){let l=[];return e.argChoices&&l.push(`choices: ${e.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),e.defaultValue!==void 0&&(e.required||e.optional||e.isBoolean()&&typeof e.defaultValue=="boolean")&&l.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),e.presetArg!==void 0&&e.optional&&l.push(`preset: ${JSON.stringify(e.presetArg)}`),e.envVar!==void 0&&l.push(`env: ${e.envVar}`),l.length>0?`${e.description} (${l.join(", ")})`:e.description}argumentDescription(e){let l=[];if(e.argChoices&&l.push(`choices: ${e.argChoices.map(t=>JSON.stringify(t)).join(", ")}`),e.defaultValue!==void 0&&l.push(`default: ${e.defaultValueDescription||JSON.stringify(e.defaultValue)}`),l.length>0){let t=`(${l.join(", ")})`;return e.description?`${e.description} ${t}`:t}return e.description}formatHelp(e,l){let t=l.padWidth(e,l),r=l.helpWidth||80,u=2,i=2;function s(p,m){if(m){let g=`${p.padEnd(t+i)}${m}`;return l.wrap(g,r-u,t+i)}return p}function o(p){return p.join(`
`).replace(/^/gm," ".repeat(u))}let a=[`Usage: ${l.commandUsage(e)}`,""],h=l.commandDescription(e);h.length>0&&(a=a.concat([h,""]));let f=l.visibleArguments(e).map(p=>s(l.argumentTerm(p),l.argumentDescription(p)));f.length>0&&(a=a.concat(["Arguments:",o(f),""]));let d=l.visibleOptions(e).map(p=>s(l.optionTerm(p),l.optionDescription(p)));d.length>0&&(a=a.concat(["Options:",o(d),""]));let c=l.visibleCommands(e).map(p=>s(l.subcommandTerm(p),l.subcommandDescription(p)));return c.length>0&&(a=a.concat(["Commands:",o(c),""])),a.join(`
`)}padWidth(e,l){return Math.max(l.longestOptionTermLength(e,l),l.longestSubcommandTermLength(e,l),l.longestArgumentTermLength(e,l))}wrap(e,l,t,r=40){if(e.match(/[\n]\s+/))return e;let u=l-t;if(u<r)return e;let i=e.slice(0,t),s=e.slice(t),o=" ".repeat(t),a=new RegExp(".{1,"+(u-1)+"}([\\s\u200B]|$)|[^\\s\u200B]+?([\\s\u200B]|$)","g"),h=s.match(a)||[];return i+h.map((f,d)=>(f.slice(-1)===`
`&&(f=f.slice(0,f.length-1)),(d>0?o:"")+f.trimRight())).join(`
`)}};r9.Help=K0});var Y0=R(J0=>{"use strict";var{InvalidArgumentError:cy}=kt(),z0=class{constructor(e,l){this.flags=e,this.description=l||"",this.required=e.includes("<"),this.optional=e.includes("["),this.variadic=/\w\.\.\.[>\]]$/.test(e),this.mandatory=!1;let t=u9(e);this.short=t.shortFlag,this.long=t.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=[]}default(e,l){return this.defaultValue=e,this.defaultValueDescription=l,this}preset(e){return this.presetArg=e,this}conflicts(e){return this.conflictsWith=this.conflictsWith.concat(e),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,l){return l===this.defaultValue||!Array.isArray(l)?[e]:l.concat(e)}choices(e){return this.argChoices=e.slice(),this.parseArg=(l,t)=>{if(!this.argChoices.includes(l))throw new cy(`Allowed choices are ${this.argChoices.join(", ")}.`);return this.variadic?this._concatValue(l,t):l},this}name(){return this.long?this.long.replace(/^--/,""):this.short.replace(/^-/,"")}attributeName(){return hy(this.name().replace(/^no-/,""))}is(e){return this.short===e||this.long===e}isBoolean(){return!this.required&&!this.optional&&!this.negate}};function hy(n){return n.split("-").reduce((e,l)=>e+l[0].toUpperCase()+l.slice(1))}function u9(n){let e,l,t=n.split(/[ |,]+/);return t.length>1&&!/^[[<]/.test(t[1])&&(e=t.shift()),l=t.shift(),!e&&/^-[^-]$/.test(l)&&(e=l,l=void 0),{shortFlag:e,longFlag:l}}J0.Option=z0;J0.splitOptionFlags=u9});var s9=R(i9=>{"use strict";function fy(n,e){if(Math.abs(n.length-e.length)>3)return Math.max(n.length,e.length);let l=[];for(let t=0;t<=n.length;t++)l[t]=[t];for(let t=0;t<=e.length;t++)l[0][t]=t;for(let t=1;t<=e.length;t++)for(let r=1;r<=n.length;r++){let u=1;n[r-1]===e[t-1]?u=0:u=1,l[r][t]=Math.min(l[r-1][t]+1,l[r][t-1]+1,l[r-1][t-1]+u),r>1&&t>1&&n[r-1]===e[t-2]&&n[r-2]===e[t-1]&&(l[r][t]=Math.min(l[r][t],l[r-2][t-2]+1))}return l[n.length][e.length]}function py(n,e){if(!e||e.length===0)return"";e=Array.from(new Set(e));let l=n.startsWith("--");l&&(n=n.slice(2),e=e.map(i=>i.slice(2)));let t=[],r=3,u=.4;return e.forEach(i=>{if(i.length<=1)return;let s=fy(n,i),o=Math.max(n.length,i.length);(o-s)/o>u&&(s<r?(r=s,t=[i]):s===r&&t.push(i))}),t.sort((i,s)=>i.localeCompare(s)),l&&(t=t.map(i=>`--${i}`)),t.length>1?`
(Did you mean one of ${t.join(", ")}?)`:t.length===1?`
(Did you mean ${t[0]}?)`:""}i9.suggestSimilar=py});var p9=R(f9=>{"use strict";var dy=require("events").EventEmitter,Q0=require("child_process"),yn=require("path"),Z0=require("fs"),q2=require("process"),{Argument:my,humanReadableArgName:gy}=Z4(),{CommanderError:er}=kt(),{Help:vy}=X0(),{Option:o9,splitOptionFlags:yy}=Y0(),{suggestSimilar:a9}=s9(),nr=class n extends dy{constructor(e){super(),this.commands=[],this.options=[],this.parent=null,this._allowUnknownOption=!1,this._allowExcessArguments=!0,this._args=[],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._argsDescription=void 0,this._enablePositionalOptions=!1,this._passThroughOptions=!1,this._lifeCycleHooks={},this._showHelpAfterError=!1,this._showSuggestionAfterError=!0,this._outputConfiguration={writeOut:l=>q2.stdout.write(l),writeErr:l=>q2.stderr.write(l),getOutHelpWidth:()=>q2.stdout.isTTY?q2.stdout.columns:void 0,getErrHelpWidth:()=>q2.stderr.isTTY?q2.stderr.columns:void 0,outputError:(l,t)=>t(l)},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}command(e,l,t){let r=l,u=t;typeof r=="object"&&r!==null&&(u=r,r=null),u=u||{};let[,i,s]=e.match(/([^ ]+) *(.*)/),o=this.createCommand(i);return r&&(o.description(r),o._executableHandler=!0),u.isDefault&&(this._defaultCommandName=o._name),o._hidden=!!(u.noHelp||u.hidden),o._executableFile=u.executableFile||null,s&&o.arguments(s),this.commands.push(o),o.parent=this,o.copyInheritedSettings(this),r?this:o}createCommand(e){return new n(e)}createHelp(){return Object.assign(new vy,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,l){if(!e._name)throw new Error(`Command passed to .addCommand() must have a name
- specify the name in Command constructor or using .name()`);return l=l||{},l.isDefault&&(this._defaultCommandName=e._name),(l.noHelp||l.hidden)&&(e._hidden=!0),this.commands.push(e),e.parent=this,this}createArgument(e,l){return new my(e,l)}argument(e,l,t,r){let u=this.createArgument(e,l);return typeof t=="function"?u.default(r).argParser(t):u.default(t),this.addArgument(u),this}arguments(e){return e.split(/ +/).forEach(l=>{this.argument(l)}),this}addArgument(e){let l=this._args.slice(-1)[0];if(l&&l.variadic)throw new Error(`only the last argument can be variadic '${l.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._args.push(e),this}addHelpCommand(e,l){return e===!1?this._addImplicitHelpCommand=!1:(this._addImplicitHelpCommand=!0,typeof e=="string"&&(this._helpCommandName=e.split(" ")[0],this._helpCommandnameAndArgs=e),this._helpCommandDescription=l||this._helpCommandDescription),this}_hasImplicitHelpCommand(){return this._addImplicitHelpCommand===void 0?this.commands.length&&!this._actionHandler&&!this._findCommand("help"):this._addImplicitHelpCommand}hook(e,l){let t=["preAction","postAction"];if(!t.includes(e))throw new Error(`Unexpected value for event passed to hook : '${e}'.
Expecting one of '${t.join("', '")}'`);return this._lifeCycleHooks[e]?this._lifeCycleHooks[e].push(l):this._lifeCycleHooks[e]=[l],this}exitOverride(e){return e?this._exitCallback=e:this._exitCallback=l=>{if(l.code!=="commander.executeSubCommandAsync")throw l},this}_exit(e,l,t){this._exitCallback&&this._exitCallback(new er(e,l,t)),q2.exit(e)}action(e){let l=t=>{let r=this._args.length,u=t.slice(0,r);return this._storeOptionsAsProperties?u[r]=this:u[r]=this.opts(),u.push(this),e.apply(this,u)};return this._actionHandler=l,this}createOption(e,l){return new o9(e,l)}addOption(e){let l=e.name(),t=e.attributeName();if(e.negate){let u=e.long.replace(/^--no-/,"--");this._findOption(u)||this.setOptionValueWithSource(t,e.defaultValue===void 0?!0:e.defaultValue,"default")}else e.defaultValue!==void 0&&this.setOptionValueWithSource(t,e.defaultValue,"default");this.options.push(e);let r=(u,i,s)=>{u==null&&e.presetArg!==void 0&&(u=e.presetArg);let o=this.getOptionValue(t);if(u!==null&&e.parseArg)try{u=e.parseArg(u,o)}catch(a){if(a.code==="commander.invalidArgument"){let h=`${i} ${a.message}`;this.error(h,{exitCode:a.exitCode,code:a.code})}throw a}else u!==null&&e.variadic&&(u=e._concatValue(u,o));u==null&&(e.negate?u=!1:e.isBoolean()||e.optional?u=!0:u=""),this.setOptionValueWithSource(t,u,s)};return this.on("option:"+l,u=>{let i=`error: option '${e.flags}' argument '${u}' is invalid.`;r(u,i,"cli")}),e.envVar&&this.on("optionEnv:"+l,u=>{let i=`error: option '${e.flags}' value '${u}' from env '${e.envVar}' is invalid.`;r(u,i,"env")}),this}_optionEx(e,l,t,r,u){if(typeof l=="object"&&l instanceof o9)throw new Error("To add an Option object use addOption() instead of option() or requiredOption()");let i=this.createOption(l,t);if(i.makeOptionMandatory(!!e.mandatory),typeof r=="function")i.default(u).argParser(r);else if(r instanceof RegExp){let s=r;r=(o,a)=>{let h=s.exec(o);return h?h[0]:a},i.default(u).argParser(r)}else i.default(r);return this.addOption(i)}option(e,l,t,r){return this._optionEx({},e,l,t,r)}requiredOption(e,l,t,r){return this._optionEx({mandatory:!0},e,l,t,r)}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._storeOptionsAsProperties=!!e,this.options.length)throw new Error("call .storeOptionsAsProperties() before adding options");return this}getOptionValue(e){return this._storeOptionsAsProperties?this[e]:this._optionValues[e]}setOptionValue(e,l){return this._storeOptionsAsProperties?this[e]=l:this._optionValues[e]=l,this}setOptionValueWithSource(e,l,t){return this.setOptionValue(e,l),this._optionValueSources[e]=t,this}getOptionValueSource(e){return this._optionValueSources[e]}_prepareUserArgs(e,l){if(e!==void 0&&!Array.isArray(e))throw new Error("first parameter to parse must be array or undefined");l=l||{},e===void 0&&(e=q2.argv,q2.versions&&q2.versions.electron&&(l.from="electron")),this.rawArgs=e.slice();let t;switch(l.from){case void 0:case"node":this._scriptPath=e[1],t=e.slice(2);break;case"electron":q2.defaultApp?(this._scriptPath=e[1],t=e.slice(2)):t=e.slice(1);break;case"user":t=e.slice(0);break;default:throw new Error(`unexpected parse option { from: '${l.from}' }`)}return!this._name&&this._scriptPath&&this.nameFromFilename(this._scriptPath),this._name=this._name||"program",t}parse(e,l){let t=this._prepareUserArgs(e,l);return this._parseCommand([],t),this}async parseAsync(e,l){let t=this._prepareUserArgs(e,l);return await this._parseCommand([],t),this}_executeSubCommand(e,l){l=l.slice();let t=!1,r=[".js",".ts",".tsx",".mjs",".cjs"];function u(h,f){let d=yn.resolve(h,f);if(Z0.existsSync(d))return d;if(r.includes(yn.extname(f)))return;let c=r.find(p=>Z0.existsSync(`${d}${p}`));if(c)return`${d}${c}`}this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let i=e._executableFile||`${this._name}-${e._name}`,s=this._executableDir||"";if(this._scriptPath){let h;try{h=Z0.realpathSync(this._scriptPath)}catch{h=this._scriptPath}s=yn.resolve(yn.dirname(h),s)}if(s){let h=u(s,i);if(!h&&!e._executableFile&&this._scriptPath){let f=yn.basename(this._scriptPath,yn.extname(this._scriptPath));f!==this._name&&(h=u(s,`${f}-${e._name}`))}i=h||i}t=r.includes(yn.extname(i));let o;q2.platform!=="win32"?t?(l.unshift(i),l=h9(q2.execArgv).concat(l),o=Q0.spawn(q2.argv[0],l,{stdio:"inherit"})):o=Q0.spawn(i,l,{stdio:"inherit"}):(l.unshift(i),l=h9(q2.execArgv).concat(l),o=Q0.spawn(q2.execPath,l,{stdio:"inherit"})),o.killed||["SIGUSR1","SIGUSR2","SIGTERM","SIGINT","SIGHUP"].forEach(f=>{q2.on(f,()=>{o.killed===!1&&o.exitCode===null&&o.kill(f)})});let a=this._exitCallback;a?o.on("close",()=>{a(new er(q2.exitCode||0,"commander.executeSubCommandAsync","(close)"))}):o.on("close",q2.exit.bind(q2)),o.on("error",h=>{if(h.code==="ENOENT"){let f=s?`searched for local subcommand relative to directory '${s}'`:"no directory for search for local subcommand, use .executableDir() to supply a custom directory",d=`'${i}' 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
- ${f}`;throw new Error(d)}else if(h.code==="EACCES")throw new Error(`'${i}' not executable`);if(!a)q2.exit(1);else{let f=new er(1,"commander.executeSubCommandAsync","(error)");f.nestedError=h,a(f)}}),this.runningCommand=o}_dispatchSubcommand(e,l,t){let r=this._findCommand(e);if(r||this.help({error:!0}),r._executableHandler)this._executeSubCommand(r,l.concat(t));else return r._parseCommand(l,t)}_checkNumberOfArguments(){this._args.forEach((e,l)=>{e.required&&this.args[l]==null&&this.missingArgument(e.name())}),!(this._args.length>0&&this._args[this._args.length-1].variadic)&&this.args.length>this._args.length&&this._excessArguments(this.args)}_processArguments(){let e=(t,r,u)=>{let i=r;if(r!==null&&t.parseArg)try{i=t.parseArg(r,u)}catch(s){if(s.code==="commander.invalidArgument"){let o=`error: command-argument value '${r}' is invalid for argument '${t.name()}'. ${s.message}`;this.error(o,{exitCode:s.exitCode,code:s.code})}throw s}return i};this._checkNumberOfArguments();let l=[];this._args.forEach((t,r)=>{let u=t.defaultValue;t.variadic?r<this.args.length?(u=this.args.slice(r),t.parseArg&&(u=u.reduce((i,s)=>e(t,s,i),t.defaultValue))):u===void 0&&(u=[]):r<this.args.length&&(u=this.args[r],t.parseArg&&(u=e(t,u,t.defaultValue))),l[r]=u}),this.processedArgs=l}_chainOrCall(e,l){return e&&e.then&&typeof e.then=="function"?e.then(()=>l()):l()}_chainOrCallHooks(e,l){let t=e,r=[];return e5(this).reverse().filter(u=>u._lifeCycleHooks[l]!==void 0).forEach(u=>{u._lifeCycleHooks[l].forEach(i=>{r.push({hookedCommand:u,callback:i})})}),l==="postAction"&&r.reverse(),r.forEach(u=>{t=this._chainOrCall(t,()=>u.callback(u.hookedCommand,this))}),t}_parseCommand(e,l){let t=this.parseOptions(l);if(this._parseOptionsEnv(),e=e.concat(t.operands),l=t.unknown,this.args=e.concat(l),e&&this._findCommand(e[0]))return this._dispatchSubcommand(e[0],e.slice(1),l);if(this._hasImplicitHelpCommand()&&e[0]===this._helpCommandName)return e.length===1&&this.help(),this._dispatchSubcommand(e[1],[],[this._helpLongFlag]);if(this._defaultCommandName)return c9(this,l),this._dispatchSubcommand(this._defaultCommandName,e,l);this.commands.length&&this.args.length===0&&!this._actionHandler&&!this._defaultCommandName&&this.help({error:!0}),c9(this,t.unknown),this._checkForMissingMandatoryOptions(),this._checkForConflictingOptions();let r=()=>{t.unknown.length>0&&this.unknownOption(t.unknown[0])},u=`command:${this.name()}`;if(this._actionHandler){r(),this._processArguments();let i;return i=this._chainOrCallHooks(i,"preAction"),i=this._chainOrCall(i,()=>this._actionHandler(this.processedArgs)),this.parent&&(i=this._chainOrCall(i,()=>{this.parent.emit(u,e,l)})),i=this._chainOrCallHooks(i,"postAction"),i}if(this.parent&&this.parent.listenerCount(u))r(),this._processArguments(),this.parent.emit(u,e,l);else if(e.length){if(this._findCommand("*"))return this._dispatchSubcommand("*",e,l);this.listenerCount("command:*")?this.emit("command:*",e,l):this.commands.length?this.unknownCommand():(r(),this._processArguments())}else this.commands.length?(r(),this.help({error:!0})):(r(),this._processArguments())}_findCommand(e){if(e)return this.commands.find(l=>l._name===e||l._aliases.includes(e))}_findOption(e){return this.options.find(l=>l.is(e))}_checkForMissingMandatoryOptions(){for(let e=this;e;e=e.parent)e.options.forEach(l=>{l.mandatory&&e.getOptionValue(l.attributeName())===void 0&&e.missingMandatoryOptionValue(l)})}_checkForConflictingLocalOptions(){let e=this.options.filter(t=>{let r=t.attributeName();return this.getOptionValue(r)===void 0?!1:this.getOptionValueSource(r)!=="default"});e.filter(t=>t.conflictsWith.length>0).forEach(t=>{let r=e.find(u=>t.conflictsWith.includes(u.attributeName()));r&&this._conflictingOption(t,r)})}_checkForConflictingOptions(){for(let e=this;e;e=e.parent)e._checkForConflictingLocalOptions()}parseOptions(e){let l=[],t=[],r=l,u=e.slice();function i(o){return o.length>1&&o[0]==="-"}let s=null;for(;u.length;){let o=u.shift();if(o==="--"){r===t&&r.push(o),r.push(...u);break}if(s&&!i(o)){this.emit(`option:${s.name()}`,o);continue}if(s=null,i(o)){let a=this._findOption(o);if(a){if(a.required){let h=u.shift();h===void 0&&this.optionMissingArgument(a),this.emit(`option:${a.name()}`,h)}else if(a.optional){let h=null;u.length>0&&!i(u[0])&&(h=u.shift()),this.emit(`option:${a.name()}`,h)}else this.emit(`option:${a.name()}`);s=a.variadic?a:null;continue}}if(o.length>2&&o[0]==="-"&&o[1]!=="-"){let a=this._findOption(`-${o[1]}`);if(a){a.required||a.optional&&this._combineFlagAndOptionalValue?this.emit(`option:${a.name()}`,o.slice(2)):(this.emit(`option:${a.name()}`),u.unshift(`-${o.slice(2)}`));continue}}if(/^--[^=]+=/.test(o)){let a=o.indexOf("="),h=this._findOption(o.slice(0,a));if(h&&(h.required||h.optional)){this.emit(`option:${h.name()}`,o.slice(a+1));continue}}if(i(o)&&(r=t),(this._enablePositionalOptions||this._passThroughOptions)&&l.length===0&&t.length===0){if(this._findCommand(o)){l.push(o),u.length>0&&t.push(...u);break}else if(o===this._helpCommandName&&this._hasImplicitHelpCommand()){l.push(o),u.length>0&&l.push(...u);break}else if(this._defaultCommandName){t.push(o),u.length>0&&t.push(...u);break}}if(this._passThroughOptions){r.push(o),u.length>0&&r.push(...u);break}r.push(o)}return{operands:l,unknown:t}}opts(){if(this._storeOptionsAsProperties){let e={},l=this.options.length;for(let t=0;t<l;t++){let r=this.options[t].attributeName();e[r]=r===this._versionOptionName?this._version:this[r]}return e}return this._optionValues}optsWithGlobals(){return e5(this).reduce((e,l)=>Object.assign(e,l.opts()),{})}error(e,l){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 t=l||{},r=t.exitCode||1,u=t.code||"commander.error";this._exit(r,u,e)}_parseOptionsEnv(){this.options.forEach(e=>{if(e.envVar&&e.envVar in q2.env){let l=e.attributeName();(this.getOptionValue(l)===void 0||["default","config","env"].includes(this.getOptionValueSource(l)))&&(e.required||e.optional?this.emit(`optionEnv:${e.name()}`,q2.env[e.envVar]):this.emit(`optionEnv:${e.name()}`))}})}missingArgument(e){let l=`error: missing required argument '${e}'`;this.error(l,{code:"commander.missingArgument"})}optionMissingArgument(e){let l=`error: option '${e.flags}' argument missing`;this.error(l,{code:"commander.optionMissingArgument"})}missingMandatoryOptionValue(e){let l=`error: required option '${e.flags}' not specified`;this.error(l,{code:"commander.missingMandatoryOptionValue"})}_conflictingOption(e,l){let t=i=>{let s=i.attributeName(),o=this.getOptionValue(s),a=this.options.find(f=>f.negate&&s===f.attributeName()),h=this.options.find(f=>!f.negate&&s===f.attributeName());return a&&(a.presetArg===void 0&&o===!1||a.presetArg!==void 0&&o===a.presetArg)?a:h||i},r=i=>{let s=t(i),o=s.attributeName();return this.getOptionValueSource(o)==="env"?`environment variable '${s.envVar}'`:`option '${s.flags}'`},u=`error: ${r(e)} cannot be used with ${r(l)}`;this.error(u,{code:"commander.conflictingOption"})}unknownOption(e){if(this._allowUnknownOption)return;let l="";if(e.startsWith("--")&&this._showSuggestionAfterError){let r=[],u=this;do{let i=u.createHelp().visibleOptions(u).filter(s=>s.long).map(s=>s.long);r=r.concat(i),u=u.parent}while(u&&!u._enablePositionalOptions);l=a9(e,r)}let t=`error: unknown option '${e}'${l}`;this.error(t,{code:"commander.unknownOption"})}_excessArguments(e){if(this._allowExcessArguments)return;let l=this._args.length,t=l===1?"":"s",u=`error: too many arguments${this.parent?` for '${this.name()}'`:""}. Expected ${l} argument${t} but got ${e.length}.`;this.error(u,{code:"commander.excessArguments"})}unknownCommand(){let e=this.args[0],l="";if(this._showSuggestionAfterError){let r=[];this.createHelp().visibleCommands(this).forEach(u=>{r.push(u.name()),u.alias()&&r.push(u.alias())}),l=a9(e,r)}let t=`error: unknown command '${e}'${l}`;this.error(t,{code:"commander.unknownCommand"})}version(e,l,t){if(e===void 0)return this._version;this._version=e,l=l||"-V, --version",t=t||"output the version number";let r=this.createOption(l,t);return this._versionOptionName=r.attributeName(),this.options.push(r),this.on("option:"+r.name(),()=>{this._outputConfiguration.writeOut(`${e}
`),this._exit(0,"commander.version",e)}),this}description(e,l){return e===void 0&&l===void 0?this._description:(this._description=e,l&&(this._argsDescription=l),this)}alias(e){if(e===void 0)return this._aliases[0];let l=this;if(this.commands.length!==0&&this.commands[this.commands.length-1]._executableHandler&&(l=this.commands[this.commands.length-1]),e===l._name)throw new Error("Command alias can't be the same as its name");return l._aliases.push(e),this}aliases(e){return e===void 0?this._aliases:(e.forEach(l=>this.alias(l)),this)}usage(e){if(e===void 0){if(this._usage)return this._usage;let l=this._args.map(t=>gy(t));return[].concat(this.options.length||this._hasHelpOption?"[options]":[],this.commands.length?"[command]":[],this._args.length?l:[]).join(" ")}return this._usage=e,this}name(e){return e===void 0?this._name:(this._name=e,this)}nameFromFilename(e){return this._name=yn.basename(e,yn.extname(e)),this}executableDir(e){return e===void 0?this._executableDir:(this._executableDir=e,this)}helpInformation(e){let l=this.createHelp();return l.helpWidth===void 0&&(l.helpWidth=e&&e.error?this._outputConfiguration.getErrHelpWidth():this._outputConfiguration.getOutHelpWidth()),l.formatHelp(this,l)}_getHelpContext(e){e=e||{};let l={error:!!e.error},t;return l.error?t=r=>this._outputConfiguration.writeErr(r):t=r=>this._outputConfiguration.writeOut(r),l.write=e.write||t,l.command=this,l}outputHelp(e){let l;typeof e=="function"&&(l=e,e=void 0);let t=this._getHelpContext(e);e5(this).reverse().forEach(u=>u.emit("beforeAllHelp",t)),this.emit("beforeHelp",t);let r=this.helpInformation(t);if(l&&(r=l(r),typeof r!="string"&&!Buffer.isBuffer(r)))throw new Error("outputHelp callback must return a string or a Buffer");t.write(r),this.emit(this._helpLongFlag),this.emit("afterHelp",t),e5(this).forEach(u=>u.emit("afterAllHelp",t))}helpOption(e,l){if(typeof e=="boolean")return this._hasHelpOption=e,this;this._helpFlags=e||this._helpFlags,this._helpDescription=l||this._helpDescription;let t=yy(this._helpFlags);return this._helpShortFlag=t.shortFlag,this._helpLongFlag=t.longFlag,this}help(e){this.outputHelp(e);let l=q2.exitCode||0;l===0&&e&&typeof e!="function"&&e.error&&(l=1),this._exit(l,"commander.help","(outputHelp)")}addHelpText(e,l){let t=["beforeAll","before","after","afterAll"];if(!t.includes(e))throw new Error(`Unexpected value for position to addHelpText.
Expecting one of '${t.join("', '")}'`);let r=`${e}Help`;return this.on(r,u=>{let i;typeof l=="function"?i=l({error:u.error,command:u.command}):i=l,i&&u.write(`${i}
`)}),this}};function c9(n,e){n._hasHelpOption&&e.find(t=>t===n._helpLongFlag||t===n._helpShortFlag)&&(n.outputHelp(),n._exit(0,"commander.helpDisplayed","(outputHelp)"))}function h9(n){return n.map(e=>{if(!e.startsWith("--inspect"))return e;let l,t="127.0.0.1",r="9229",u;return(u=e.match(/^(--inspect(-brk)?)$/))!==null?l=u[1]:(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+)$/))!==null?(l=u[1],/^\d+$/.test(u[3])?r=u[3]:t=u[3]):(u=e.match(/^(--inspect(-brk|-port)?)=([^:]+):(\d+)$/))!==null&&(l=u[1],t=u[3],r=u[4]),l&&r!=="0"?`${l}=${t}:${parseInt(r)+1}`:e})}function e5(n){let e=[];for(let l=n;l;l=l.parent)e.push(l);return e}f9.Command=nr});var v9=R((Ge,g9)=>{"use strict";var{Argument:Ey}=Z4(),{Command:d9}=p9(),{CommanderError:Sy,InvalidArgumentError:m9}=kt(),{Help:xy}=X0(),{Option:Ay}=Y0();Ge=g9.exports=new d9;Ge.program=Ge;Ge.Argument=Ey;Ge.Command=d9;Ge.CommanderError=Sy;Ge.Help=xy;Ge.InvalidArgumentError=m9;Ge.InvalidOptionArgumentError=m9;Ge.Option=Ay});var S9=R((xN,E9)=>{"use strict";E9.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 lr=R((AN,A9)=>{"use strict";var It=S9(),x9={};for(let n of Object.keys(It))x9[It[n]]=n;var d2={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"]}};A9.exports=d2;for(let n of Object.keys(d2)){if(!("channels"in d2[n]))throw new Error("missing channels property: "+n);if(!("labels"in d2[n]))throw new Error("missing channel labels property: "+n);if(d2[n].labels.length!==d2[n].channels)throw new Error("channel and label counts mismatch: "+n);let{channels:e,labels:l}=d2[n];delete d2[n].channels,delete d2[n].labels,Object.defineProperty(d2[n],"channels",{value:e}),Object.defineProperty(d2[n],"labels",{value:l})}d2.rgb.hsl=function(n){let e=n[0]/255,l=n[1]/255,t=n[2]/255,r=Math.min(e,l,t),u=Math.max(e,l,t),i=u-r,s,o;u===r?s=0:e===u?s=(l-t)/i:l===u?s=2+(t-e)/i:t===u&&(s=4+(e-l)/i),s=Math.min(s*60,360),s<0&&(s+=360);let a=(r+u)/2;return u===r?o=0:a<=.5?o=i/(u+r):o=i/(2-u-r),[s,o*100,a*100]};d2.rgb.hsv=function(n){let e,l,t,r,u,i=n[0]/255,s=n[1]/255,o=n[2]/255,a=Math.max(i,s,o),h=a-Math.min(i,s,o),f=function(d){return(a-d)/6/h+1/2};return h===0?(r=0,u=0):(u=h/a,e=f(i),l=f(s),t=f(o),i===a?r=t-l:s===a?r=1/3+e-t:o===a&&(r=2/3+l-e),r<0?r+=1:r>1&&(r-=1)),[r*360,u*100,a*100]};d2.rgb.hwb=function(n){let e=n[0],l=n[1],t=n[2],r=d2.rgb.hsl(n)[0],u=1/255*Math.min(e,Math.min(l,t));return t=1-1/255*Math.max(e,Math.max(l,t)),[r,u*100,t*100]};d2.rgb.cmyk=function(n){let e=n[0]/255,l=n[1]/255,t=n[2]/255,r=Math.min(1-e,1-l,1-t),u=(1-e-r)/(1-r)||0,i=(1-l-r)/(1-r)||0,s=(1-t-r)/(1-r)||0;return[u*100,i*100,s*100,r*100]};function Cy(n,e){return(n[0]-e[0])**2+(n[1]-e[1])**2+(n[2]-e[2])**2}d2.rgb.keyword=function(n){let e=x9[n];if(e)return e;let l=1/0,t;for(let r of Object.keys(It)){let u=It[r],i=Cy(n,u);i<l&&(l=i,t=r)}return t};d2.keyword.rgb=function(n){return It[n]};d2.rgb.xyz=function(n){let e=n[0]/255,l=n[1]/255,t=n[2]/255;e=e>.04045?((e+.055)/1.055)**2.4:e/12.92,l=l>.04045?((l+.055)/1.055)**2.4:l/12.92,t=t>.04045?((t+.055)/1.055)**2.4:t/12.92;let r=e*.4124+l*.3576+t*.1805,u=e*.2126+l*.7152+t*.0722,i=e*.0193+l*.1192+t*.9505;return[r*100,u*100,i*100]};d2.rgb.lab=function(n){let e=d2.rgb.xyz(n),l=e[0],t=e[1],r=e[2];l/=95.047,t/=100,r/=108.883,l=l>.008856?l**(1/3):7.787*l+16/116,t=t>.008856?t**(1/3):7.787*t+16/116,r=r>.008856?r**(1/3):7.787*r+16/116;let u=116*t-16,i=500*(l-t),s=200*(t-r);return[u,i,s]};d2.hsl.rgb=function(n){let e=n[0]/360,l=n[1]/100,t=n[2]/100,r,u,i;if(l===0)return i=t*255,[i,i,i];t<.5?r=t*(1+l):r=t+l-t*l;let s=2*t-r,o=[0,0,0];for(let a=0;a<3;a++)u=e+1/3*-(a-1),u<0&&u++,u>1&&u--,6*u<1?i=s+(r-s)*6*u:2*u<1?i=r:3*u<2?i=s+(r-s)*(2/3-u)*6:i=s,o[a]=i*255;return o};d2.hsl.hsv=function(n){let e=n[0],l=n[1]/100,t=n[2]/100,r=l,u=Math.max(t,.01);t*=2,l*=t<=1?t:2-t,r*=u<=1?u:2-u;let i=(t+l)/2,s=t===0?2*r/(u+r):2*l/(t+l);return[e,s*100,i*100]};d2.hsv.rgb=function(n){let e=n[0]/60,l=n[1]/100,t=n[2]/100,r=Math.floor(e)%6,u=e-Math.floor(e),i=255*t*(1-l),s=255*t*(1-l*u),o=255*t*(1-l*(1-u));switch(t*=255,r){case 0:return[t,o,i];case 1:return[s,t,i];case 2:return[i,t,o];case 3:return[i,s,t];case 4:return[o,i,t];case 5:return[t,i,s]}};d2.hsv.hsl=function(n){let e=n[0],l=n[1]/100,t=n[2]/100,r=Math.max(t,.01),u,i;i=(2-l)*t;let s=(2-l)*r;return u=l*r,u/=s<=1?s:2-s,u=u||0,i/=2,[e,u*100,i*100]};d2.hwb.rgb=function(n){let e=n[0]/360,l=n[1]/100,t=n[2]/100,r=l+t,u;r>1&&(l/=r,t/=r);let i=Math.floor(6*e),s=1-t;u=6*e-i,i&1&&(u=1-u);let o=l+u*(s-l),a,h,f;switch(i){default:case 6:case 0:a=s,h=o,f=l;break;case 1:a=o,h=s,f=l;break;case 2:a=l,h=s,f=o;break;case 3:a=l,h=o,f=s;break;case 4:a=o,h=l,f=s;break;case 5:a=s,h=l,f=o;break}return[a*255,h*255,f*255]};d2.cmyk.rgb=function(n){let e=n[0]/100,l=n[1]/100,t=n[2]/100,r=n[3]/100,u=1-Math.min(1,e*(1-r)+r),i=1-Math.min(1,l*(1-r)+r),s=1-Math.min(1,t*(1-r)+r);return[u*255,i*255,s*255]};d2.xyz.rgb=function(n){let e=n[0]/100,l=n[1]/100,t=n[2]/100,r,u,i;return r=e*3.2406+l*-1.5372+t*-.4986,u=e*-.9689+l*1.8758+t*.0415,i=e*.0557+l*-.204+t*1.057,r=r>.0031308?1.055*r**(1/2.4)-.055:r*12.92,u=u>.0031308?1.055*u**(1/2.4)-.055:u*12.92,i=i>.0031308?1.055*i**(1/2.4)-.055:i*12.92,r=Math.min(Math.max(0,r),1),u=Math.min(Math.max(0,u),1),i=Math.min(Math.max(0,i),1),[r*255,u*255,i*255]};d2.xyz.lab=function(n){let e=n[0],l=n[1],t=n[2];e/=95.047,l/=100,t/=108.883,e=e>.008856?e**(1/3):7.787*e+16/116,l=l>.008856?l**(1/3):7.787*l+16/116,t=t>.008856?t**(1/3):7.787*t+16/116;let r=116*l-16,u=500*(e-l),i=200*(l-t);return[r,u,i]};d2.lab.xyz=function(n){let e=n[0],l=n[1],t=n[2],r,u,i;u=(e+16)/116,r=l/500+u,i=u-t/200;let s=u**3,o=r**3,a=i**3;return u=s>.008856?s:(u-16/116)/7.787,r=o>.008856?o:(r-16/116)/7.787,i=a>.008856?a:(i-16/116)/7.787,r*=95.047,u*=100,i*=108.883,[r,u,i]};d2.lab.lch=function(n){let e=n[0],l=n[1],t=n[2],r;r=Math.atan2(t,l)*360/2/Math.PI,r<0&&(r+=360);let i=Math.sqrt(l*l+t*t);return[e,i,r]};d2.lch.lab=function(n){let e=n[0],l=n[1],r=n[2]/360*2*Math.PI,u=l*Math.cos(r),i=l*Math.sin(r);return[e,u,i]};d2.rgb.ansi16=function(n,e=null){let[l,t,r]=n,u=e===null?d2.rgb.hsv(n)[2]:e;if(u=Math.round(u/50),u===0)return 30;let i=30+(Math.round(r/255)<<2|Math.round(t/255)<<1|Math.round(l/255));return u===2&&(i+=60),i};d2.hsv.ansi16=function(n){return d2.rgb.ansi16(d2.hsv.rgb(n),n[2])};d2.rgb.ansi256=function(n){let e=n[0],l=n[1],t=n[2];return e===l&&l===t?e<8?16:e>248?231:Math.round((e-8)/247*24)+232:16+36*Math.round(e/255*5)+6*Math.round(l/255*5)+Math.round(t/255*5)};d2.ansi16.rgb=function(n){let e=n%10;if(e===0||e===7)return n>50&&(e+=3.5),e=e/10.5*255,[e,e,e];let l=(~~(n>50)+1)*.5,t=(e&1)*l*255,r=(e>>1&1)*l*255,u=(e>>2&1)*l*255;return[t,r,u]};d2.ansi256.rgb=function(n){if(n>=232){let u=(n-232)*10+8;return[u,u,u]}n-=16;let e,l=Math.floor(n/36)/5*255,t=Math.floor((e=n%36)/6)/5*255,r=e%6/5*255;return[l,t,r]};d2.rgb.hex=function(n){let l=(((Math.round(n[0])&255)<<16)+((Math.round(n[1])&255)<<8)+(Math.round(n[2])&255)).toString(16).toUpperCase();return"000000".substring(l.length)+l};d2.hex.rgb=function(n){let e=n.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);if(!e)return[0,0,0];let l=e[0];e[0].length===3&&(l=l.split("").map(s=>s+s).join(""));let t=parseInt(l,16),r=t>>16&255,u=t>>8&255,i=t&255;return[r,u,i]};d2.rgb.hcg=function(n){let e=n[0]/255,l=n[1]/255,t=n[2]/255,r=Math.max(Math.max(e,l),t),u=Math.min(Math.min(e,l),t),i=r-u,s,o;return i<1?s=u/(1-i):s=0,i<=0?o=0:r===e?o=(l-t)/i%6:r===l?o=2+(t-e)/i:o=4+(e-l)/i,o/=6,o%=1,[o*360,i*100,s*100]};d2.hsl.hcg=function(n){let e=n[1]/100,l=n[2]/100,t=l<.5?2*e*l:2*e*(1-l),r=0;return t<1&&(r=(l-.5*t)/(1-t)),[n[0],t*100,r*100]};d2.hsv.hcg=function(n){let e=n[1]/100,l=n[2]/100,t=e*l,r=0;return t<1&&(r=(l-t)/(1-t)),[n[0],t*100,r*100]};d2.hcg.rgb=function(n){let e=n[0]/360,l=n[1]/100,t=n[2]/100;if(l===0)return[t*255,t*255,t*255];let r=[0,0,0],u=e%1*6,i=u%1,s=1-i,o=0;switch(Math.floor(u)){case 0:r[0]=1,r[1]=i,r[2]=0;break;case 1:r[0]=s,r[1]=1,r[2]=0;break;case 2:r[0]=0,r[1]=1,r[2]=i;break;case 3:r[0]=0,r[1]=s,r[2]=1;break;case 4:r[0]=i,r[1]=0,r[2]=1;break;default:r[0]=1,r[1]=0,r[2]=s}return o=(1-l)*t,[(l*r[0]+o)*255,(l*r[1]+o)*255,(l*r[2]+o)*255]};d2.hcg.hsv=function(n){let e=n[1]/100,l=n[2]/100,t=e+l*(1-e),r=0;return t>0&&(r=e/t),[n[0],r*100,t*100]};d2.hcg.hsl=function(n){let e=n[1]/100,t=n[2]/100*(1-e)+.5*e,r=0;return t>0&&t<.5?r=e/(2*t):t>=.5&&t<1&&(r=e/(2*(1-t))),[n[0],r*100,t*100]};d2.hcg.hwb=function(n){let e=n[1]/100,l=n[2]/100,t=e+l*(1-e);return[n[0],(t-e)*100,(1-t)*100]};d2.hwb.hcg=function(n){let e=n[1]/100,t=1-n[2]/100,r=t-e,u=0;return r<1&&(u=(t-r)/(1-r)),[n[0],r*100,u*100]};d2.apple.rgb=function(n){return[n[0]/65535*255,n[1]/65535*255,n[2]/65535*255]};d2.rgb.apple=function(n){return[n[0]/255*65535,n[1]/255*65535,n[2]/255*65535]};d2.gray.rgb=function(n){return[n[0]/100*255,n[0]/100*255,n[0]/100*255]};d2.gray.hsl=function(n){return[0,0,n[0]]};d2.gray.hsv=d2.gray.hsl;d2.gray.hwb=function(n){return[0,100,n[0]]};d2.gray.cmyk=function(n){return[0,0,0,n[0]]};d2.gray.lab=function(n){return[n[0],0,0]};d2.gray.hex=function(n){let e=Math.round(n[0]/100*255)&255,t=((e<<16)+(e<<8)+e).toString(16).toUpperCase();return"000000".substring(t.length)+t};d2.rgb.gray=function(n){return[(n[0]+n[1]+n[2])/3/255*100]}});var _9=R((CN,C9)=>{"use strict";var n5=lr();function _y(){let n={},e=Object.keys(n5);for(let l=e.length,t=0;t<l;t++)n[e[t]]={distance:-1,parent:null};return n}function Dy(n){let e=_y(),l=[n];for(e[n].distance=0;l.length;){let t=l.pop(),r=Object.keys(n5[t]);for(let u=r.length,i=0;i<u;i++){let s=r[i],o=e[s];o.distance===-1&&(o.distance=e[t].distance+1,o.parent=t,l.unshift(s))}}return e}function by(n,e){return function(l){return e(n(l))}}function wy(n,e){let l=[e[n].parent,n],t=n5[e[n].parent][n],r=e[n].parent;for(;e[r].parent;)l.unshift(e[r].parent),t=by(n5[e[r].parent][r],t),r=e[r].parent;return t.conversion=l,t}C9.exports=function(n){let e=Dy(n),l={},t=Object.keys(e);for(let r=t.length,u=0;u<r;u++){let i=t[u];e[i].parent!==null&&(l[i]=wy(i,e))}return l}});var b9=R((_N,D9)=>{"use strict";var tr=lr(),Oy=_9(),$l={},Fy=Object.keys(tr);function Ty(n){let e=function(...l){let t=l[0];return t==null?t:(t.length>1&&(l=t),n(l))};return"conversion"in n&&(e.conversion=n.conversion),e}function Py(n){let e=function(...l){let t=l[0];if(t==null)return t;t.length>1&&(l=t);let r=n(l);if(typeof r=="object")for(let u=r.length,i=0;i<u;i++)r[i]=Math.round(r[i]);return r};return"conversion"in n&&(e.conversion=n.conversion),e}Fy.forEach(n=>{$l[n]={},Object.defineProperty($l[n],"channels",{value:tr[n].channels}),Object.defineProperty($l[n],"labels",{value:tr[n].labels});let e=Oy(n);Object.keys(e).forEach(t=>{let r=e[t];$l[n][t]=Py(r),$l[n][t].raw=Ty(r)})});D9.exports=$l});var R9=R((DN,P9)=>{"use strict";var w9=(n,e)=>(...l)=>`\x1B[${n(...l)+e}m`,O9=(n,e)=>(...l)=>{let t=n(...l);return`\x1B[${38+e};5;${t}m`},F9=(n,e)=>(...l)=>{let t=n(...l);return`\x1B[${38+e};2;${t[0]};${t[1]};${t[2]}m`},l5=n=>n,T9=(n,e,l)=>[n,e,l],ql=(n,e,l)=>{Object.defineProperty(n,e,{get:()=>{let t=l();return Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0}),t},enumerable:!0,configurable:!0})},rr,Vl=(n,e,l,t)=>{rr===void 0&&(rr=b9());let r=t?10:0,u={};for(let[i,s]of Object.entries(rr)){let o=i==="ansi16"?"ansi":i;i===e?u[o]=n(l,r):typeof s=="object"&&(u[o]=n(s[e],r))}return u};function Ry(){let n=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[l,t]of Object.entries(e)){for(let[r,u]of Object.entries(t))e[r]={open:`\x1B[${u[0]}m`,close:`\x1B[${u[1]}m`},t[r]=e[r],n.set(u[0],u[1]);Object.defineProperty(e,l,{value:t,enumerable:!1})}return Object.defineProperty(e,"codes",{value:n,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",ql(e.color,"ansi",()=>Vl(w9,"ansi16",l5,!1)),ql(e.color,"ansi256",()=>Vl(O9,"ansi256",l5,!1)),ql(e.color,"ansi16m",()=>Vl(F9,"rgb",T9,!1)),ql(e.bgColor,"ansi",()=>Vl(w9,"ansi16",l5,!0)),ql(e.bgColor,"ansi256",()=>Vl(O9,"ansi256",l5,!0)),ql(e.bgColor,"ansi16m",()=>Vl(F9,"rgb",T9,!0)),e}Object.defineProperty(P9,"exports",{enumerable:!0,get:Ry})});var ur=R((bN,k9)=>{"use strict";k9.exports=(n,e=process.argv)=>{let l=n.startsWith("-")?"":n.length===1?"-":"--",t=e.indexOf(l+n),r=e.indexOf("--");return t!==-1&&(r===-1||t<r)}});var L9=R((wN,N9)=>{"use strict";var ky=require("os"),I9=require("tty"),me=ur(),{env:a3}=process,Mn;me("no-color")||me("no-colors")||me("color=false")||me("color=never")?Mn=0:(me("color")||me("colors")||me("color=true")||me("color=always"))&&(Mn=1);"FORCE_COLOR"in a3&&(a3.FORCE_COLOR==="true"?Mn=1:a3.FORCE_COLOR==="false"?Mn=0:Mn=a3.FORCE_COLOR.length===0?1:Math.min(parseInt(a3.FORCE_COLOR,10),3));function ir(n){return n===0?!1:{level:n,hasBasic:!0,has256:n>=2,has16m:n>=3}}function sr(n,e){if(Mn===0)return 0;if(me("color=16m")||me("color=full")||me("color=truecolor"))return 3;if(me("color=256"))return 2;if(n&&!e&&Mn===void 0)return 0;let l=Mn||0;if(a3.TERM==="dumb")return l;if(process.platform==="win32"){let t=ky.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in a3)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(t=>t in a3)||a3.CI_NAME==="codeship"?1:l;if("TEAMCITY_VERSION"in a3)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a3.TEAMCITY_VERSION)?1:0;if(a3.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in a3){let t=parseInt((a3.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a3.TERM_PROGRAM){case"iTerm.app":return t>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a3.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a3.TERM)||"COLORTERM"in a3?1:l}function Iy(n){let e=sr(n,n&&n.isTTY);return ir(e)}N9.exports={supportsColor:Iy,stdout:ir(sr(!0,I9.isatty(1))),stderr:ir(sr(!0,I9.isatty(2)))}});var B9=R((ON,M9)=>{"use strict";var Ny=(n,e,l)=>{let t=n.indexOf(e);if(t===-1)return n;let r=e.length,u=0,i="";do i+=n.substr(u,t-u)+e+l,u=t+r,t=n.indexOf(e,u);while(t!==-1);return i+=n.substr(u),i},Ly=(n,e,l,t)=>{let r=0,u="";do{let i=n[t-1]==="\r";u+=n.substr(r,(i?t-1:t)-r)+e+(i?`\r
`:`
`)+l,r=t+1,t=n.indexOf(`
`,r)}while(t!==-1);return u+=n.substr(r),u};M9.exports={stringReplaceAll:Ny,stringEncaseCRLFWithFirstIndex:Ly}});var $9=R((FN,j9)=>{"use strict";var My=/(?:\\(u(?:[a-f\d]{4}|\{[a-f\d]{1,6}\})|x[a-f\d]{2}|.))|(?:\{(~)?(\w+(?:\([^)]*\))?(?:\.\w+(?:\([^)]*\))?)*)(?:[ \t]|(?=\r?\n)))|(\})|((?:.|[\r\n\f])+?)/gi,U9=/(?:^|\.)(\w+)(?:\(([^)]*)\))?/g,By=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$/,Uy=/\\(u(?:[a-f\d]{4}|{[a-f\d]{1,6}})|x[a-f\d]{2}|.)|([^\\])/gi,Gy=new Map([["n",`
`],["r","\r"],["t"," "],["b","\b"],["f","\f"],["v","\v"],["0","\0"],["\\","\\"],["e","\x1B"],["a","\x07"]]);function H9(n){let e=n[0]==="u",l=n[1]==="{";return e&&!l&&n.length===5||n[0]==="x"&&n.length===3?String.fromCharCode(parseInt(n.slice(1),16)):e&&l?String.fromCodePoint(parseInt(n.slice(2,-1),16)):Gy.get(n)||n}function Hy(n,e){let l=[],t=e.trim().split(/\s*,\s*/g),r;for(let u of t){let i=Number(u);if(!Number.isNaN(i))l.push(i);else if(r=u.match(By))l.push(r[2].replace(Uy,(s,o,a)=>o?H9(o):a));else throw new Error(`Invalid Chalk template style argument: ${u} (in style '${n}')`)}return l}functi